curl-7.35.0/0000755000175000017500000000000012272124477007564 500000000000000curl-7.35.0/depcomp0000755000175000017500000005601612272122666011067 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: curl-7.35.0/mkinstalldirs0000755000175000017500000000672212213173003012301 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2009-04-28.21; # UTC # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: curl-7.35.0/docs/0000755000175000017500000000000012272124477010514 500000000000000curl-7.35.0/docs/VERSIONS0000644000175000017500000000475612213173003011623 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| Version Numbers and Releases Curl is not only curl. Curl is also libcurl. They're actually individually versioned, but they mostly follow each other rather closely. The version numbering is always built up using the same system: X.Y[.Z] Where X is main version number Y is release number Z is patch number One of these numbers will get bumped in each new release. The numbers to the right of a bumped number will be reset to zero. If Z is zero, it may not be included in the version number. The main version number will get bumped when *really* big, world colliding changes are made. The release number is bumped when changes are performed or things/features are added. The patch number is bumped when the changes are mere bugfixes. It means that after release 1.2.3, we can release 2.0 if something really big has been made, 1.3 if not that big changes were made or 1.2.4 if mostly bugs were fixed. Bumping, as in increasing the number with 1, is unconditionally only affecting one of the numbers (except the ones to the right of it, that may be set to zero). 1 becomes 2, 3 becomes 4, 9 becomes 10, 88 becomes 89 and 99 becomes 100. So, after 1.2.9 comes 1.2.10. After 3.99.3, 3.100 might come. All original curl source release archives are named according to the libcurl version (not according to the curl client version that, as said before, might differ). As a service to any application that might want to support new libcurl features while still being able to build with older versions, all releases have the libcurl version stored in the curl/curlver.h file using a static numbering scheme that can be used for comparison. The version number is defined as: #define LIBCURL_VERSION_NUM 0xXXYYZZ Where XX, YY and ZZ are the main version, release and patch numbers in hexadecimal. All three number fields are always represented using two digits (eight bits each). 1.2 would appear as "0x010200" while version 9.11.7 appears as "0x090b07". This 6-digit hexadecimal number is always a greater number in a more recent release. It makes comparisons with greater than and less than work. This number is also available as three separate defines: LIBCURL_VERSION_MAJOR, LIBCURL_VERSION_MINOR and LIBCURL_VERSION_PATCH. curl-7.35.0/docs/MAIL-ETIQUETTE0000644000175000017500000002145712213173003012441 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| MAIL ETIQUETTE 1. About the lists 1.1 Mailing Lists 1.2 Netiquette 1.3 Do Not Mail a Single Individual 1.4 Subscription Required 1.5 Moderation of new posters 1.6 Handling trolls and spam 1.7 How to unsubscribe 2. Sending mail 2.1 Reply or New Mail 2.2 Reply to the List 2.3 Use a Sensible Subject 2.4 Do Not Top-Post 2.5 HTML is not for mails 2.6 Quoting 2.7 Digest 2.8 Please Tell Us How You Solved The Problem! ============================================================================== 1. About the lists 1.1 Mailing Lists The mailing lists we have are all listed and described at http://curl.haxx.se/mail/ Each mailing list is targeted to a specific set of users and subjects, please use the one or the ones that suit you the most. Each mailing list have hundreds up to thousands of readers, meaning that each mail sent will be received and read by a very large amount of people. People from various cultures, regions, religions and continents. 1.2 Netiquette Netiquette is a common name for how to behave on the internet. Of course, in each particular group and subculture there will be differences in what is acceptable and what is considered good manners. This document outlines what we in the cURL project considers to be good etiquette, and primarily this focus on how to behave on and how to use our mailing lists. 1.3 Do Not Mail a Single Individual Many people send one question to one person. One person gets many mails, and there is only one person who can give you a reply. The question may be something that other people are also wanting to ask. These other people have no way to read the reply, but to ask the one person the question. The one person consequently gets overloaded with mail. If you really want to contact an individual and perhaps pay for his or her services, by all means go ahead, but if it's just another curl question, take it to a suitable list instead. 1.4 Subscription Required All curl mailing lists require that you are subscribed to allow a mail to go through to all the subscribers. If you post without being subscribed (or from a different mail address than the one you are subscribed with), your mail will simply be silently discarded. You have to subscribe first, then post. The reason for this unfortunate and strict subscription policy is of course to stop spam from pestering the lists. 1.5 Moderation of new posters Several of the curl mailing lists automatically make all posts from new subscribers require moderation. This means that after you've subscribed and send your first mail to a list, that mail will not be let through to the list until a mailing list administrator has verified that it is OK and permits it to get posted. Once a first post has been made that proves the sender is actually talking about curl-related subjects, the moderation "flag" will be switched off and future posts will go through without being moderated. The reason for this moderation policy is that we do suffer from spammers who actually subscribe and send spam to our lists. 1.6 Handling trolls and spam Despite our good intentions and hard work to keep spam off the lists and to maintain a friendly and positive atmosphere, there will be times when spam and or trolls get through. Troll - "someone who posts inflammatory, extraneous, or off-topic messages in an online community" Spam - "use of electronic messaging systems to send unsolicited bulk messages" No matter what, we NEVER EVER respond to trolls or spammers on the list. If you believe the list admin should do something particular, contact him/her off-list. The subject will be taken care of as good as possible to prevent repeated offences, but responding on the list to such messages never lead to anything good and only puts the light even more on the offender: which was the entire purpose of it getting to the list in the first place. Don't feed the trolls! 1.7 How to unsubscribe You unsubscribe the same way you subscribed in the first place. You go to the page for the particular mailing list you're subscribed to and you enter your email address and password and press the unsubscribe button. Also, this information is included in the headers of every mail that is sent out to all curl related mailing lists and there's footer in each mail that links to the "admin" page on which you can unsubscribe and change other options. You NEVER EVER email the mailing list requesting someone else to get you off the list. 2. Sending mail 2.1 Reply or New Mail Please do not reply to an existing message as a short-cut to post a message to the lists. Many mail programs and web archivers use information within mails to keep them together as "threads", as collections of posts that discuss a certain subject. If you don't intend to reply on the same or similar subject, don't just hit reply on an existing mail and change subject, create a new mail. 2.2 Reply to the List When replying to a message from the list, make sure that you do "group reply" or "reply to all", and not just reply to the author of the single mail you reply to. We're actively discouraging replying back to the single person by setting the Reply-To: field in outgoing mails back to the mailing list address, making it harder for people to mail the author only by mistake. 2.3 Use a Sensible Subject Please use a subject of the mail that makes sense and that is related to the contents of your mail. It makes it a lot easier to find your mail afterwards and it makes it easier to track mail threads and topics. 2.4 Do Not Top-Post If you reply to a message, don't use top-posting. Top-posting is when you write the new text at the top of a mail and you insert the previous quoted mail conversation below. It forces users to read the mail in a backwards order to properly understand it. This is why top posting is so bad: A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? Apart from the screwed up read order (especially when mixed together in a thread when someone responds using the mandated bottom-posting style), it also makes it impossible to quote only parts of the original mail. When you reply to a mail. You let the mail client insert the previous mail quoted. Then you put the cursor on the first line of the mail and you move down through the mail, deleting all parts of the quotes that don't add context for your comments. When you want to add a comment you do so, inline, right after the quotes that relate to your comment. Then you continue downwards again. When most of the quotes have been removed and you've added your own words, you're done! 2.5 HTML is not for mails Please switch off those HTML encoded messages. You can mail all those funny mails to your friends. We speak plain text mails. 2.6 Quoting Quote as little as possible. Just enough to provide the context you cannot leave out. A lengthy description can be found here: http://www.netmeister.org/news/learn2quote.html 2.7 Digest We allow subscribers to subscribe to the "digest" version of the mailing lists. A digest is a collection of mails lumped together in one single mail. Should you decide to reply to a mail sent out as a digest, there are two things you MUST consider if you really really cannot subscribe normally instead: Cut off all mails and chatter that is not related to the mail you want to reply to. Change the subject name to something sensible and related to the subject, preferably even the actual subject of the single mail you wanted to reply to 2.8 Please Tell Us How You Solved The Problem! Many people mail questions to the list, people spend some of their time and make an effort in providing good answers to these questions. If you are the one who asks, please consider responding once more in case one of the hints was what solved your problems. The guys who write answers feel good to know that they provided a good answer and that you fixed the problem. Far too often, the person who asked the question is never heard of again, and we never get to know if he/she is gone because the problem was solved or perhaps because the problem was unsolvable! Getting the solution posted also helps other users that experience the same problem(s). They get to see (possibly in the web archives) that the suggested fixes actually has helped at least one person. curl-7.35.0/docs/BINDINGS0000644000175000017500000001073712213173003011544 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| libcurl bindings Creative people have written bindings or interfaces for various environments and programming languages. Using one of these allows you to take advantage of curl powers from within your favourite language or system. This is a list of all known interfaces as of this writing. The bindings listed below are not part of the curl/libcurl distribution archives, but must be downloaded and installed separately. Ada95 Writtten by Andreas Almroth http://www.almroth.com/adacurl/index.html Basic ScriptBasic bindings to libcurl. Writtten by Peter Verhas http://scriptbasic.com/ C libcurl is a C library in itself! http://curl.haxx.se/libcurl/ C++ Written by Jean-Philippe Barrette-LaPierre http://curlpp.org/ Ch Written by Stephen Nestinger and Jonathan Rogado http://chcurl.sourceforge.net/ Cocoa BBHTTP: written by Bruno de Carvalho https://github.com/brunodecarvalho/BBHTTP curlhandle: Written by Dan Wood http://curlhandle.sourceforge.net/ D Written by Kenneth Bogert http://curl.haxx.se/libcurl/d/ Dylan Written by Chris Double http://dylanlibs.sourceforge.net/ Eiffel Written by Eiffel Software http://curl.haxx.se/libcurl/eiffel/ Euphoria Written by Ray Smith http://rays-web.com/eulibcurl.htm Falcon http://www.falconpl.org/index.ftd?page_id=prjs&prj_id=curl Ferite Written by Paul Querna http://www.ferite.org/ Gambas http://gambas.sourceforge.net glib/GTK+ Written by Richard Atterer http://atterer.net/glibcurl/ Guile: Written by Michael L. Gran http://www.lonelycactus.com/guile-curl.html Haskell Written by Galois, Inc http://hackage.haskell.org/cgi-bin/hackage-scripts/package/curl Java Maintained by [blank] http://curl.haxx.se/libcurl/java/ Julia Written by Paul Howe https://github.com/forio/Curl.jl Lisp Written by Liam Healy http://common-lisp.net/project/cl-curl/ Lua luacurl by Alexander Marinov http://luacurl.luaforge.net/ Lua-cURL by Jürgen Hötzel http://luaforge.net/projects/lua-curl/ Mono Written by Jeffrey Phillips http://forge.novell.com/modules/xfmod/project/?libcurl-mono .NET libcurl-net by Jeffrey Phillips http://sourceforge.net/projects/libcurl-net/ Object-Pascal Free Pascal, Delphi and Kylix binding written by Christophe Espern. http://www.tekool.com/opcurl O'Caml Written by Lars Nilsson http://sourceforge.net/projects/ocurl/ Pascal Free Pascal, Delphi and Kylix binding written by Jeffrey Pohlmeyer. http://houston.quik.com/jkp/curlpas/ Perl Maintained by Cris Bailiff http://curl.haxx.se/libcurl/perl/ PHP Written by Sterling Hughes http://curl.haxx.se/libcurl/php/ PostgreSQL Written by Gian Paolo Ciceri http://gborg.postgresql.org/project/pgcurl/projdisplay.php Python PycURL by Kjetil Jacobsen http://pycurl.sourceforge.net/ R RCurl by Duncan Temple Lang http://www.omegahat.org/RCurl/ Rexx Written Mark Hessling http://rexxcurl.sourceforge.net/ RPG Support for ILE/RPG on OS/400 is included in source distribution http://curl.haxx.se/libcurl/ See packages/OS400/README.OS400 and packages/OS400/curl.inc.in Ruby curb - written by Ross Bamford http://curb.rubyforge.org/ ruby-curl-multi - written by Kristjan Petursson and Keith Rarick http://curl-multi.rubyforge.org/ Scheme Bigloo binding by Kirill Lisovsky http://curl.haxx.se/libcurl/scheme/ S-Lang S-Lang binding by John E Davis http://www.jedsoft.org/slang/modules/curl.html Smalltalk Smalltalk binding by Danil Osipchuk http://www.squeaksource.com/CurlPlugin/ SP-Forth SP-Forth binding by ygrek http://www.forth.org.ru/~ac/lib/lin/curl/ SPL SPL binding by Clifford Wolf http://www.clifford.at/spl/ Tcl Tclcurl by Andrés García http://personal1.iddeo.es/andresgarci/tclcurl/english/docs.html Visual Basic libcurl-vb by Jeffrey Phillips http://sourceforge.net/projects/libcurl-vb/ Visual Foxpro by Carlos Alloatti http://www.ctl32.com.ar/libcurl.asp Q The libcurl module is part of the default install http://q-lang.sourceforge.net/ wxWidgets Written by Casey O'Donnell http://wxcode.sourceforge.net/components/wxcurl/ XBLite Written by David Szafranski http://perso.wanadoo.fr/xblite/libraries.html curl-7.35.0/docs/LIBCURL-STRUCTS0000644000175000017500000002421512262353672012624 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| Structs in libcurl This document should cover 7.32.0 pretty accurately, but will make sense even for older and later versions as things don't change drastically that often. 1. The main structs in libcurl 1.1 SessionHandle 1.2 connectdata 1.3 Curl_multi 1.4 Curl_handler 1.5 conncache 1.6 Curl_share 1.7 CookieInfo ============================================================================== 1. The main structs in libcurl 1.1 SessionHandle The SessionHandle handle struct is the one returned to the outside in the external API as a "CURL *". This is usually known as an easy handle in API documentations and examples. Information and state that is related to the actual connection is in the 'connectdata' struct. When a transfer is about to be made, libcurl will either create a new connection or re-use an existing one. The particular connectdata that is used by this handle is pointed out by SessionHandle->easy_conn. Data and information that regard this particular single transfer is put in the SingleRequest sub-struct. When the SessionHandle struct is added to a multi handle, as it must be in order to do any transfer, the ->multi member will point to the Curl_multi struct it belongs to. The ->prev and ->next members will then be used by the multi code to keep a linked list of SessionHandle structs that are added to that same multi handle. libcurl always uses multi so ->multi *will* point to a Curl_multi when a transfer is in progress. ->mstate is the multi state of this particular SessionHandle. When multi_runsingle() is called, it will act on this handle according to which state it is in. The mstate is also what tells which sockets to return for a speicific SessionHandle when curl_multi_fdset() is called etc. The libcurl source code generally use the name 'data' for the variable that points to the SessionHandle. 1.2 connectdata A general idea in libcurl is to keep connections around in a connection "cache" after they have been used in case they will be used again and then re-use an existing one instead of creating a new as it creates a significant performance boost. Each 'connectdata' identifies a single physical conncetion to a server. If the connection can't be kept alive, the connection will be closed after use and then this struct can be removed from the cache and freed. Thus, the same SessionHandle can be used multiple times and each time select another connectdata struct to use for the connection. Keep this in mind, as it is then important to consider if options or choices are based on the connection or the SessionHandle. Functions in libcurl will assume that connectdata->data points to the SessionHandle that uses this connection. As a special complexity, some protocols supported by libcurl require a special disconnect procedure that is more than just shutting down the socket. It can involve sending one or more commands to the server before doing so. Since connections are kept in the connection cache after use, the original SessionHandle may no longer be around when the time comes to shut down a particular connection. For this purpose, libcurl holds a special dummy 'closure_handle' SessionHandle in the Curl_multi struct to FTP uses two TCP connections for a typical transfer but it keeps both in this single struct and thus can be considered a single connection for most internal concerns. The libcurl source code generally use the name 'conn' for the variable that points to the connectdata. 1.3 Curl_multi Internally, the easy interface is implemented as a wrapper around multi interface functions. This makes everything multi interface. Curl_multi is the multi handle struct exposed as "CURLM *" in external APIs. This struct holds a list of SessionHandle structs that have been added to this handle with curl_multi_add_handle(). The start of the list is ->easyp and ->num_easy is a counter of added SessionHandles. ->msglist is a linked list of messages to send back when curl_multi_info_read() is called. Basically a node is added to that list when an individual SessionHandle's transfer has completed. ->hostcache points to the name cache. It is a hash table for looking up name to IP. The nodes have a limited life time in there and this cache is meant to reduce the time for when the same name is wanted within a short period of time. ->timetree points to a tree of SessionHandles, sorted by the remaining time until it should be checked - normally some sort of timeout. Each SessionHandle has one node in the tree. ->sockhash is a hash table to allow fast lookups of socket descriptor to which SessionHandle that uses that descriptor. This is necessary for the multi_socket API. ->conn_cache points to the connection cache. It keeps track of all connections that are kept after use. The cache has a maximum size. ->closure_handle is described in the 'connectdata' section. The libcurl source code generally use the name 'multi' for the variable that points to the Curl_multi struct. 1.4 Curl_handler Each unique protocol that is supported by libcurl needs to provide at least one Curl_handler struct. It defines what the protocol is called and what functions the main code should call to deal with protocol specific issues. In general, there's a source file named [protocol].c in which there's a "struct Curl_handler Curl_handler_[protocol]" declared. In url.c there's then the main array with all individual Curl_handler structs pointed to from a single array which is scanned through when a URL is given to libcurl to work with. ->scheme is the URL scheme name, usually spelled out in uppercase. That's "HTTP" or "FTP" etc. SSL versions of the protcol need its own Curl_handler setup so HTTPS separate from HTTP. ->setup_connection is called to allow the protocol code to allocate protocol specific data that then gets associated with that SessionHandle for the rest of this transfer. It gets freed again at the end of the transfer. It will be called before the 'connectdata' for the transfer has been selected/created. Most protocols will allocate its private 'struct [PROTOCOL]' here and assign SessionHandle->req.protop to point to it. ->connect_it allows a protocol to do some specific actions after the TCP connect is done, that can still be considered part of the connection phase. Some protocols will alter the connectdata->recv[] and connectdata->send[] function pointers in this function. ->connecting is similarly a function that keeps getting called as long as the protocol considers itself still in the connecting phase. ->do_it is the function called to issue the transfer request. What we call the DO action internally. If the DO is not enough and things need to be kept getting done for the entier DO sequence to complete, ->doing is then usually also provided. Each protocol that needs to do multiple commands or similar for do/doing need to implement their own state machines (see SCP, SFTP, FTP). Some protocols (only FTP and only due to historical reasons) has a separate piece of the DO state called DO_MORE. ->doing keeps getting called while issudeing the transfer request command(s) ->done gets called when the transfer is complete and DONE. That's after the main data has been transferred. ->do_more gets called doring the DO_MORE state. The FTP protocol uses this state when setting up the second connection. ->proto_getsock ->doing_getsock ->domore_getsock ->perform_getsock Functions that return socket information. Which socket(s) to wait for which action(s) during the particular multi state. ->disconnect is called immediately before the TCP connection is shutdown. ->readwrite gets called during transfer to allow the protocol to do extra reads/writes ->defport is the default report TCP or UDP port this protocol uses ->protocol is one or more bits in the CURLPROTO_* set. The SSL versions have their "base" protocol set and then the SSL variation. Like "HTTP|HTTPS". ->flags is a bitmask with additional information about the protocol that will make it get treated differently by the generic engine: PROTOPT_SSL - will make it connect and negotiate SSL PROTOPT_DUAL - this protocol uses two connections PROTOPT_CLOSEACTION - this protocol has actions to do before closing the connection. This flag is no longer used by code, yet still set for a bunch protocol handlers. PROTOPT_DIRLOCK - "direction lock". The SSH protocols set this bit to limit which "direction" of socket actions that the main engine will concern itself about. PROTOPT_NONETWORK - a protocol that doesn't use network (read file:) PROTOPT_NEEDSPWD - this protocol needs a password and will use a default one unless one is provided PROTOPT_NOURLQUERY - this protocol can't handle a query part on the URL (?foo=bar) 1.5 conncache Is a hash table with connections for later re-use. Each SessionHandle has a pointer to its connection cache. Each multi handle sets up a connection cache that all added SessionHandles share by default. 1.6 Curl_share The libcurl share API allocates a Curl_share struct, exposed to the external API as "CURLSH *". The idea is that the struct can have a set of own versions of caches and pools and then by providing this struct in the CURLOPT_SHARE option, those specific SessionHandles will use the caches/pools that this share handle holds. Then individual SessionHandle structs can be made to share specific things that they otherwise wouldn't, such as cookies. The Curl_share struct can currently hold cookies, DNS cache and the SSL session cache. 1.7 CookieInfo This is the main cookie struct. It holds all known cookies and related information. Each SessionHandle has its own private CookieInfo even when they are added to a multi handle. They can be made to share cookies by using the share API. curl-7.35.0/docs/RELEASE-PROCEDURE0000644000175000017500000000315012262353672012764 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| curl release procedure - how to do a release ============================================ [in the source code repo] - edit RELEASE-NOTES to be accurate - update docs/THANKS - make sure all relevant changes are committed on the master branch - tag the git repo in this style: 'git tag -a curl-7_34_0'. -a annotates the tag and we use underscores instead of dots in the version number. - run "./maketgz 7.34.0" to build the release tarballs. It is important that you run this on a machine with the correct set of autotools etc installed as this is what then will be shipped and used by most users on *nix like systems. - push the git commits and the new tag - gpg sign the 4 tarballs as maketgz suggests - upload the 8 resulting files to the primary download directory [data in the curl-www repo] - edit Makefile (version number and date), _newslog.html (announce the new release) and _changes.html (insert changes+bugfixes from RELEASE-NOTES) - commit all local changes - tag the repo with the same tag as used for the source repo - make sure all relevant changes are committed and pushed on the master branch (the web site then updates its contents automatically) [inform] - send an email to curl-users, curl-announce and curl-library. Insert the RELEASE-NOTES into the mail. [celebrate] - suitable beverage intake is encouraged for the festivities curl-7.35.0/docs/BUGS0000644000175000017500000001404412213173003011102 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| BUGS 1. Bugs 1.1 There are still bugs 1.2 Where to report 1.3 What to report 1.4 libcurl problems 1.5 Who will fix the problems 1.6 How to get a stack trace 1.7 Bugs in libcurl bindings ============================================================================== 1.1 There are still bugs Curl and libcurl have grown substantially since the beginning. At the time of writing (January 2013), there are about 83,000 lines of source code, and by the time you read this it has probably grown even more. Of course there are lots of bugs left. And lots of misfeatures. To help us make curl the stable and solid product we want it to be, we need bug reports and bug fixes. 1.2 Where to report If you can't fix a bug yourself and submit a fix for it, try to report an as detailed report as possible to a curl mailing list to allow one of us to have a go at a solution. You can optionally also post your bug/problem at curl's bug tracking system over at https://sourceforge.net/p/curl/bugs/ Please read the rest of this document below first before doing that! Also, you need to login to your sourceforge account before being able to submit a bug report (necessary evil done to avoid spam). If you feel you need to ask around first, find a suitable mailing list and post there. The lists are available on http://curl.haxx.se/mail/ 1.3 What to report When reporting a bug, you should include all information that will help us understand what's wrong, what you expected to happen and how to repeat the bad behavior. You therefore need to tell us: - your operating system's name and version number - what version of curl you're using (curl -V is fine) - versions of the used libraries that libcurl is built to use - what URL you were working with (if possible), at least which protocol and anything and everything else you think matters. Tell us what you expected to happen, tell use what did happen, tell us how you could make it work another way. Dig around, try out, test. Then include all the tiny bits and pieces in your report. You will benefit from this yourself, as it will enable us to help you quicker and more accurately. Since curl deals with networks, it often helps us if you include a protocol debug dump with your bug report. The output you get by using the -v or --trace options. If curl crashed, causing a core dump (in unix), there is hardly any use to send that huge file to anyone of us. Unless we have an exact same system setup as you, we can't do much with it. Instead we ask you to get a stack trace and send that (much smaller) output to us instead! The address and how to subscribe to the mailing lists are detailed in the MANUAL file. 1.4 libcurl problems First, post all libcurl problems on the curl-library mailing list. When you've written your own application with libcurl to perform transfers, it is even more important to be specific and detailed when reporting bugs. Tell us the libcurl version and your operating system. Tell us the name and version of all relevant sub-components like for example the SSL library you're using and what name resolving your libcurl uses. If you use SFTP or SCP, the libssh2 version is relevant etc. Showing us a real source code example repeating your problem is the best way to get our attention and it will greatly increase our chances to understand your problem and to work on a fix (if we agree it truly is a problem). Lots of problems that appear to be libcurl problems are actually just abuses of the libcurl API or other malfunctions in your applications. It is advised that you run your problematic program using a memory debug tool like valgrind or similar before you post memory-related or "crashing" problems to us. 1.5 Who will fix the problems If the problems or bugs you describe are considered to be bugs, we want to have the problems fixed. There are no developers in the curl project that are paid to work on bugs. All developers that take on reported bugs do this on a voluntary basis. We do it out of an ambition to keep curl and libcurl excellent products and out of pride. But please do not assume that you can just lump over something to us and it will then magically be fixed after some given time. Most often we need feedback and help to understand what you've experienced and how to repeat a problem. Then we may only be able to assist YOU to debug the problem and to track down the proper fix. We get reports from many people every month and each report can take a considerable amount of time to really go to the bottom with. 1.6 How to get a stack trace First, you must make sure that you compile all sources with -g and that you don't 'strip' the final executable. Try to avoid optimizing the code as well, remove -O, -O2 etc from the compiler options. Run the program until it cores. Run your debugger on the core file, like ' curl core'. should be replaced with the name of your debugger, in most cases that will be 'gdb', but 'dbx' and others also occur. When the debugger has finished loading the core file and presents you a prompt, enter 'where' (without the quotes) and press return. The list that is presented is the stack trace. If everything worked, it is supposed to contain the chain of functions that were called when curl crashed. Include the stack trace with your detailed bug report. It'll help a lot. 1.7 Bugs in libcurl bindings There will of course pop up bugs in libcurl bindings. You should then primarily approach the team that works on that particular binding and see what you can do to help them fix the problem. If you suspect that the problem exists in the underlying libcurl, then please convert your program over to plain C and follow the steps outlined above. curl-7.35.0/docs/libcurl/0000755000175000017500000000000012272124477012150 500000000000000curl-7.35.0/docs/libcurl/curl_share_init.30000644000175000017500000000370112213173003015307 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_share_init 3 "8 Aug 2003" "libcurl 7.10.7" "libcurl Manual" .SH NAME curl_share_init - Create a shared object .SH SYNOPSIS .B #include .sp .BI "CURLSH *curl_share_init( );" .ad .SH DESCRIPTION This function returns a CURLSH handle to be used as input to all the other share-functions, sometimes referred to as a share handle in some places in the documentation. This init call MUST have a corresponding call to \fIcurl_share_cleanup\fP when all operations using the share are complete. This \fIshare handle\fP is what you pass to curl using the \fICURLOPT_SHARE\fP option with \fIcurl_easy_setopt(3)\fP, to make that specific curl handle use the data in this share. .SH RETURN VALUE If this function returns NULL, something went wrong (out of memory, etc.) and therefore the share object was not created. .SH "SEE ALSO" .BR curl_share_cleanup "(3), " curl_share_setopt "(3)" curl-7.35.0/docs/libcurl/libcurl.30000644000175000017500000002615312262353672013617 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2013, 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. .\" * .\" ************************************************************************** .TH libcurl 3 "19 March 2002" "libcurl 7.9.6" "libcurl overview" .SH NAME libcurl \- client-side URL transfers .SH DESCRIPTION This is a short overview on how to use libcurl in your C programs. There are specific man pages for each function mentioned in here. There are also the \fIlibcurl-easy(3)\fP man page, the \fIlibcurl-multi(3)\fP man page, the \fIlibcurl-share(3)\fP man page and the \fIlibcurl-tutorial(3)\fP man page for in-depth understanding on how to program with libcurl. There are more than thirty custom bindings available that bring libcurl access to your favourite language. Look elsewhere for documentation on those. libcurl has a global constant environment that you must set up and maintain while using libcurl. This essentially means you call \fIcurl_global_init(3)\fP at the start of your program and \fIcurl_global_cleanup(3)\fP at the end. See GLOBAL CONSTANTS below for details. To transfer files, you always set up an "easy handle" using \fIcurl_easy_init(3)\fP for a single specific transfer (in either direction). You then set your desired set of options in that handle with \fIcurk_easy_setopt(3)\fP. Options you set with \fIcurl_easy_setopt(3)\fP will be used on every repeated use of this handle until you either call the function again and change the option, or you reset them all with \fIcurl_easy_reset(3)\fP. To actually transfer data you have the option of using the "easy" interface, or the "multi" interface. The easy interface is a synchronous interface with which you call \fIcurl_easy_perform(3)\fP and let it perform the transfer. When it is completed, the function returns and you can continue. More details are found in the \fIlibcurl-easy(3)\fP man page. The multi interface on the other hand is an asynchronous interface, that you call and that performs only a little piece of the transfer on each invoke. It is perfect if you want to do things while the transfer is in progress, or similar. The multi interface allows you to select() on libcurl action, and even to easily download multiple files simultaneously using a single thread. See further details in the \fIlibcurl-multi(3)\fP man page. You can have multiple easy handles share certain data, even if they are used in different threads. This magic is setup using the share interface, as described in the \fIlibcurl-share(3)\fP man page. There is also a series of other helpful functions to use, including these: .RS .IP curl_version_info() gets detailed libcurl (and other used libraries) version info .IP curl_getdate() converts a date string to time_t .IP curl_easy_getinfo() get information about a performed transfer .IP curl_formadd() helps building an HTTP form POST .IP curl_formfree() free a list built with \fIcurl_formadd(3)\fP .IP curl_slist_append() builds a linked list .IP curl_slist_free_all() frees a whole curl_slist .RE .SH "LINKING WITH LIBCURL" On unix-like machines, there's a tool named curl-config that gets installed with the rest of the curl stuff when 'make install' is performed. curl-config is added to make it easier for applications to link with libcurl and developers to learn about libcurl and how to use it. Run 'curl-config --libs' to get the (additional) linker options you need to link with the particular version of libcurl you've installed. See the \fIcurl-config(1)\fP man page for further details. Unix-like operating system that ship libcurl as part of their distributions often don't provide the curl-config tool, but simply install the library and headers in the common path for this purpose. .SH "LIBCURL SYMBOL NAMES" All public functions in the libcurl interface are prefixed with 'curl_' (with a lowercase c). You can find other functions in the library source code, but other prefixes indicate that the functions are private and may change without further notice in the next release. Only use documented functions and functionality! .SH "PORTABILITY" libcurl works .B exactly the same, on any of the platforms it compiles and builds on. .SH "THREADS" Never ever call curl-functions simultaneously using the same handle from several threads. libcurl is thread-safe and can be used in any number of threads, but you must use separate curl handles if you want to use libcurl in more than one thread simultaneously. The global environment functions are not thread-safe. See GLOBAL CONSTANTS below for details. .SH "PERSISTENT CONNECTIONS" Persistent connections means that libcurl can re-use the same connection for several transfers, if the conditions are right. libcurl will \fBalways\fP attempt to use persistent connections. Whenever you use \fIcurl_easy_perform(3)\fP or \fIcurl_multi_perform(3)\fP etc, libcurl will attempt to use an existing connection to do the transfer, and if none exists it'll open a new one that will be subject for re-use on a possible following call to \fIcurl_easy_perform(3)\fP or \fIcurl_multi_perform(3)\fP. To allow libcurl to take full advantage of persistent connections, you should do as many of your file transfers as possible using the same handle. If you use the easy interface, and you call \fIcurl_easy_cleanup(3)\fP, all the possibly open connections held by libcurl will be closed and forgotten. When you've created a multi handle and are using the multi interface, the connection pool is instead kept in the multi handle so closing and creating new easy handles to do transfers will not affect them. Instead all added easy handles can take advantage of the single shared pool. .SH "GLOBAL CONSTANTS" There are a variety of constants that libcurl uses, mainly through its internal use of other libraries, which are too complicated for the library loader to set up. Therefore, a program must call a library function after the program is loaded and running to finish setting up the library code. For example, when libcurl is built for SSL capability via the GNU TLS library, there is an elaborate tree inside that library that describes the SSL protocol. \fIcurl_global_init()\fP is the function that you must call. This may allocate resources (e.g. the memory for the GNU TLS tree mentioned above), so the companion function \fIcurl_global_cleanup()\fP releases them. The basic rule for constructing a program that uses libcurl is this: Call \fIcurl_global_init()\fP, with a \fICURL_GLOBAL_ALL\fP argument, immediately after the program starts, while it is still only one thread and before it uses libcurl at all. Call \fIcurl_global_cleanup()\fP immediately before the program exits, when the program is again only one thread and after its last use of libcurl. You can call both of these multiple times, as long as all calls meet these requirements and the number of calls to each is the same. It isn't actually required that the functions be called at the beginning and end of the program -- that's just usually the easiest way to do it. It \fIis\fP required that the functions be called when no other thread in the program is running. These global constant functions are \fInot thread safe\fP, so you must not call them when any other thread in the program is running. It isn't good enough that no other thread is using libcurl at the time, because these functions internally call similar functions of other libraries, and those functions are similarly thread-unsafe. You can't generally know what these libraries are, or whether other threads are using them. The global constant situation merits special consideration when the code you are writing to use libcurl is not the main program, but rather a modular piece of a program, e.g. another library. As a module, your code doesn't know about other parts of the program -- it doesn't know whether they use libcurl or not. And its code doesn't necessarily run at the start and end of the whole program. A module like this must have global constant functions of its own, just like \fIcurl_global_init()\fP and \fIcurl_global_cleanup()\fP. The module thus has control at the beginning and end of the program and has a place to call the libcurl functions. Note that if multiple modules in the program use libcurl, they all will separately call the libcurl functions, and that's OK because only the first \fIcurl_global_init()\fP and the last \fIcurl_global_cleanup()\fP in a program change anything. (libcurl uses a reference count in static memory). In a C++ module, it is common to deal with the global constant situation by defining a special class that represents the global constant environment of the module. A program always has exactly one object of the class, in static storage. That way, the program automatically calls the constructor of the object as the program starts up and the destructor as it terminates. As the author of this libcurl-using module, you can make the constructor call \fIcurl_global_init()\fP and the destructor call \fIcurl_global_cleanup()\fP and satisfy libcurl's requirements without your user having to think about it. \fIcurl_global_init()\fP has an argument that tells what particular parts of the global constant environment to set up. In order to successfully use any value except \fICURL_GLOBAL_ALL\fP (which says to set up the whole thing), you must have specific knowledge of internal workings of libcurl and all other parts of the program of which it is part. A special part of the global constant environment is the identity of the memory allocator. \fIcurl_global_init()\fP selects the system default memory allocator, but you can use \fIcurl_global_init_mem()\fP to supply one of your own. However, there is no way to use \fIcurl_global_init_mem()\fP in a modular program -- all modules in the program that might use libcurl would have to agree on one allocator. There is a failsafe in libcurl that makes it usable in simple situations without you having to worry about the global constant environment at all: \fIcurl_easy_init()\fP sets up the environment itself if it hasn't been done yet. The resources it acquires to do so get released by the operating system automatically when the program exits. This failsafe feature exists mainly for backward compatibility because there was a time when the global functions didn't exist. Because it is sufficient only in the simplest of programs, it is not recommended for any program to rely on it. curl-7.35.0/docs/libcurl/curl_share_strerror.30000644000175000017500000000322512213173003016227 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_share_strerror 3 "26 Apr 2004" "libcurl 7.12" "libcurl Manual" .SH NAME curl_share_strerror - return string describing error code .SH SYNOPSIS .nf .B #include .BI "const char *curl_share_strerror(CURLSHcode " errornum ");" .SH DESCRIPTION The curl_share_strerror() function returns a string describing the CURLSHcode error code passed in the argument \fIerrornum\fP. .SH AVAILABILITY This function was added in libcurl 7.12.0 .SH RETURN VALUE A pointer to a zero terminated string. .SH "SEE ALSO" .BR libcurl-errors "(3), " curl_multi_strerror "(3), " curl_easy_strerror "(3)" curl-7.35.0/docs/libcurl/curl_free.pdf0000644000175000017500000000632312272124472014530 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ“ÛŽÓ0†ïó#qƒ×Î9!èEÑn»4ámr· Jœn¬öíçÐH\ K±dOf¾ÿŸñ0Êé5îiiÌ6ƒÁÁx2x ã––ð!Á€P${cø‡C`C94Œ ) î¹”<$íêâǾ–rKœ­ E¾Ó'¦e{Œ2{¡:QÀm˜ù=ùlXŒÚó¥X.Âr4òtELJäÎ «¹ù ñ–{Ô‹¤H2ƒÜ/ÌäçŸÍ¨Ë°¸­¯™fº µL ‘—Pʲª_ =ŠŽ¢” ª]+r%3<®«îp1ñC*Šb¨t…f!›Å}ö(ñ·Õú!^Æ—°„!¯r•]&áN9Óz|¯Ã-Ý ”f»½Ö_Õ¤5¢Ñ ô‘äÙdšÉC¢ƒô(jxÓ›7Ûp6V êy£=§¶¾ÅálÍ·+â®KïJÕ§Eüq³|H–ëÕ­ÓaØXßù£û“ÑÍ9MMËc>µ#Ÿ|mäõ°àHåªi¥È ÚÃù¬­Î#ÔˆÝû(.F¢næDá S»0º*TUŠ"—ÍÀ˜ …ðMW´˜¾*!Ë÷¦®Ev@ö²–*ÅÈ\MºJ¡ÄA–Rµ¨¬}Öâ^ª®q:y*Ú¼RX!ð&Ši"FÍôß“5Lq¼XÀü.^±çn;hÓ9_oT§d“ŠÓø²nzf ÑžP˜ªÉõ€rfbE„“ͻ،9=¶ëO¯ët‹Äø‚ë7ÿ&;endstream endobj 6 0 obj 565 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <>stream 2014-01-29T08:09:46+01:00 2014-01-29T08:09:46+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 14 0000000000 65535 f 0000000888 00000 n 0000002696 00000 n 0000000829 00000 n 0000000669 00000 n 0000000015 00000 n 0000000650 00000 n 0000000953 00000 n 0000001207 00000 n 0000001142 00000 n 0000001074 00000 n 0000000994 00000 n 0000001024 00000 n 0000001273 00000 n trailer << /Size 14 /Root 1 0 R /Info 2 0 R /ID [<234578308CBDACCE73B2977122757665><234578308CBDACCE73B2977122757665>] >> startxref 2850 %%EOF curl-7.35.0/docs/libcurl/curl_easy_send.html0000644000175000017500000000757612272124467015773 00000000000000 curl_easy_send man page

NAME

curl_easy_send - sends raw data over an "easy" connection

SYNOPSIS

#include <curl/easy.h>

CURLcode curl_easy_send( CURL * curl , const void * buffer , size_t buflen , size_t * n );

DESCRIPTION

This function sends arbitrary data over the established connection. You may use it together with curl_easy_recv(3) to implement custom protocols using libcurl. This functionality can be particularly useful if you use proxies and/or SSL encryption: libcurl will take care of proxy negotiation and connection set-up.

buffer is a pointer to the data of length buflen that you want sent. The variable n points to will receive the number of sent bytes.

To establish the connection, set CURLOPT_CONNECT_ONLY option before calling curl_easy_perform(3). Note that curl_easy_send(3) will not work on connections that were created without this option.

You must ensure that the socket is writable before calling curl_easy_send(3), otherwise the call will return CURLE_AGAIN - the socket is used in non-blocking mode internally. Use curl_easy_getinfo(3) with CURLINFO_LASTSOCKET to obtain the socket; use your operating system facilities like select(2) to check if it can be written to.

AVAILABILITY

Added in 7.18.2.

RETURN VALUE

On success, returns CURLE_OK and stores the number of bytes actually sent into *n. Note that this may very well be less than the amount you wanted to send.

On failure, returns the appropriate error code.

If there's no socket available to use from the previous transfer, this function returns CURLE_UNSUPPORTED_PROTOCOL.

EXAMPLE

See sendrecv.c in docs/examples directory for usage example.

SEE ALSO

curl_easy_setopt (3) curl_easy_perform (3) curl_easy_getinfo (3) curl_easy_recv (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_easy_reset.30000644000175000017500000000347512213173003015335 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_easy_reset 3 "31 July 2004" "libcurl 7.12.1" "libcurl Manual" .SH NAME curl_easy_reset - reset all options of a libcurl session handle .SH SYNOPSIS .B #include .BI "void curl_easy_reset(CURL *"handle ");" .SH DESCRIPTION Re-initializes all options previously set on a specified CURL handle to the default values. This puts back the handle to the same state as it was in when it was just created with \fIcurl_easy_init(3)\fP. It does not change the following information kept in the handle: live connections, the Session ID cache, the DNS cache, the cookies and shares. .SH AVAILABILITY This function was added in libcurl 7.12.1 .SH RETURN VALUE Nothing .SH "SEE ALSO" .BR curl_easy_init "(3)," curl_easy_cleanup "(3)," curl_easy_setopt "(3) curl-7.35.0/docs/libcurl/curl_easy_duphandle.pdf0000644000175000017500000000767512272124471016606 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœVÛnã6}÷WèÃJ ‹!uZȦ~Háu¶¶R`‘ Yf,u%JÑ%†ÿ¾CR´¤\€Â€m‰çÌœ3gôŒ¦ˆˆÏð›–‹«m€Ží‚ ãâyAå"~Ò}‰aC(nÄO õ E‚ÈÁa„âñ°¢ø´x0Ò¾)~°¤=ÿ8ôu–ðCÁ çÑDE¾k¦e{_Þ'úèóŸøÏ…E°M!F "€€#O p|¯ÆæÚü¨a•zØ‹@Æ×•ÿ;Álì’YÔËDà|&²ÐMQq†µ¬móŠ#µA:a‹ú8”awß7wßv·»qÛulü’ó´è ý&¿_8û]l·]™ÏÍýv>¿[µé^m)Ñ\ø>vuÒ¯!ÊÄìËæ¯oáÛv„CYv8¤ðÇjw³½ýßÞmæ%³ÙB „q–·è©çi'JtÊ‹5¬ëä‰}E¥¶oÀrJÅ¢âÍ…û "¹ð`ˆš«D–p¤_äiÒÁEßæüˆÑe UµÙ¢ºa¦íâ(ò¨ñ’W}[œ²å\nËyÝwR_RK“ÊYÔ¡ØóÜ 5cõ|LÂApáXFáÒÀ_Fô {o¸ï`/Tu©ºlH¢EiÂQÛï[öÜ3Þ¼=ƒ\ذXÍàKÞ…Ýñ,¾íGð×¢žË1*°åGôVEíÛíEhˆðÔ0qÊ»L±8æí8DHF§=J--´c­:oF}ÙëÔÅŠ%oXB²‡Å¨Æ¿rÚ®žZÈ%é& ý•%- c@NU@¾ª«œwâÏ£KU]W¢4pVµI…KD¡qï©(¶=Lhä)¶¡ºEÁª×ôŠìÖÓì@ •ܧin Pâ ìîPK¡¶4KôY¥Ð.•À¡¸´‚¹?Ë$•ØLÅãÀOäãÀ×ZϦjq"wàÍP%´O¬(0ú.¹‡ž=¢ñ”žzT v!TÞªFFëxa²L~ªŽód¨@t©V,kG ž ˆ"®o˜Hæ'TÜ`¬–)’.AISõ Ìžwy¡´¥e%Ú©Š¹x,£#a¿0´ãBIÂ(œÄ5„¤ê –}­¤e;¦Ž8 »8‰Œ#:ÑÑÇÌjëâ`LXÕV6÷Cמ62¯º¹Ò¤siäêwЛN€õãçIUéôÁ TL•‰ð©%âBÑœ3é”­¼ÞíÖzº´²ýåžêgÎZ<mQ\º\WeSuìÕ€Ð>D1ñ•#È&TbÑ<Ù6ôF HÉÖóC±ÁBW[1ÏMÇÖ"ßà¥d› ø‘OÇX¡ê˜¢Ë­.kXr:ë¦:6I ™v³!e -$úVz ˜|{æiÖT\ôóIV:‚©uaò<ÃJé™¶ì. €%º!ÑFj”(˳çãp¤29Cá%&ÆŒN™”%¼&<¼7ïŒí*¾ßnÐß&u`ùÔ¸^߯/z;8ŒÛ§WõPã²E›ûõz‰Úªd°Îs‚©€NP”£–Æ‹t>8FRäm¨'3‚áGlGا:LÀV>~OY­Ðõzw÷á{Êè›9Ï_õˆOô …0Óåü èBê=-Þ —ùIp66Íÿ<îXTû¤xW01ã2Æ,;tÂPs¦ßì M‹z.!Ø3hˆv¬îX¹g ² ¡²„®¯ß­¨8j/þ‚Ï„° endstream endobj 6 0 obj 1310 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <>stream 2014-01-29T08:09:45+01:00 2014-01-29T08:09:45+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 14 0000000000 65535 f 0000001634 00000 n 0000003442 00000 n 0000001575 00000 n 0000001415 00000 n 0000000015 00000 n 0000001395 00000 n 0000001699 00000 n 0000001953 00000 n 0000001888 00000 n 0000001820 00000 n 0000001740 00000 n 0000001770 00000 n 0000002019 00000 n trailer << /Size 14 /Root 1 0 R /Info 2 0 R /ID [<3A4CEBEC8A483AE98E1FFEE7B9B74ABF><3A4CEBEC8A483AE98E1FFEE7B9B74ABF>] >> startxref 3596 %%EOF curl-7.35.0/docs/libcurl/curl_multi_wait.html0000644000175000017500000001024712272124467016164 00000000000000 curl_multi_wait man page

NAME

curl_multi_wait - polls on all easy handles in a multi handle

SYNOPSIS

#include <curl/curl.h>

CURLMcode curl_multi_wait(CURLM *multi_handle,   struct curl_waitfd extra_fds[],   unsigned int extra_nfds,   int timeout_ms,   int *numfds);

DESCRIPTION

This function polls on all file descriptors used by the curl easy handles contained in the given multi handle set. It will block until activity is detected on at least one of the handles or timeout_ms has passed. Alternatively, if the multi handle has a pending internal timeout that has a shorter expiry time than timeout_ms, that shorter time will be used instead to make sure timeout accuracy is reasonably kept.

The calling application may pass additional curl_waitfd structures which are similar to poll(2)'s pollfd structure to be waited on in the same call.

On completion, if numfds is supplied, it will be populated with the total number of file descriptors on which interesting events occured. This number can include both libcurl internal descriptors as well as descriptors provided in extra_fds.

If no extra file descriptors are provided and libcurl has no file descriptor to offer to wait for, this function will return immediately.

This function is encouraged to be used instead of select(3) when using the multi interface to allow applications to easier circumvent the common problem with 1024 maximum file descriptors.

curl_waitfd

struct curl_waitfd {   curl_socket_t fd;   short events;   short revents; };

CURL_WAIT_POLLIN

Bit flag to curl_waitfd.events indicating the socket should poll on read events such as new data received.

CURL_WAIT_POLLPRI

Bit flag to curl_waitfd.events indicating the socket should poll on high priority read events such as out of band data.

CURL_WAIT_POLLOUT

Bit flag to curl_waitfd.events indicating the socket should poll on write events such as the socket being clear to write without blocking.

RETURN VALUE

CURLMcode type, general libcurl multi interface error code. See libcurl-errors(3)

AVAILABILITY

This function was added in libcurl 7.28.0.

SEE ALSO

curl_multi_fdset (3) curl_multi_perform (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_slist_append.html0000644000175000017500000000501612272124467016471 00000000000000 curl_slist_append man page

NAME

curl_slist_append - add a string to an slist

SYNOPSIS

#include <curl/curl.h>

struct curl_slist *curl_slist_append(struct curl_slist * list, const char * string );

DESCRIPTION

curl_slist_append() appends a specified string to a linked list of strings. The existing list should be passed as the first argument while the new list is returned from this function. The specified string has been appended when this function returns. curl_slist_append() copies the string.

The list should be freed again (after usage) with curl_slist_free_all(3).

RETURN VALUE

A null pointer is returned if anything went wrong, otherwise the new list pointer is returned.

EXAMPLE

 CURL handle;  struct curl_slist *slist=NULL;

 slist = curl_slist_append(slist, "pragma:");  curl_easy_setopt(handle, CURLOPT_HTTPHEADER, slist);

 curl_easy_perform(handle);

 curl_slist_free_all(slist); /* free the list again */

SEE ALSO

curl_slist_free_all (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_easy_strerror.html0000644000175000017500000000345412272124467016713 00000000000000 curl_easy_strerror man page

NAME

curl_easy_strerror - return string describing error code

SYNOPSIS

#include <curl/curl.h>

const char *curl_easy_strerror(CURLcode errornum);

DESCRIPTION

The curl_easy_strerror() function returns a string describing the CURLcode error code passed in the argument errornum.

AVAILABILITY

This function was added in libcurl 7.12.0

RETURN VALUE

A pointer to a zero terminated string.

SEE ALSO

libcurl-errors (3) curl_multi_strerror (3) curl_share_strerror (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_multi_add_handle.pdf0000644000175000017500000001046612272124472017067 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœWÛnÛF}×WlчP¹Ù ¯mQÀq•Æ…/©D·œB ÉµÅš"rÃÿîì¢d+) È6w8{fæÌ™ÑgD0EDýØßÅzòf£»~BÐÝäó„êCdkô6ƒD=Èn'æŠb†â”ã$EÙz’Æ8€?'×^±éêåzSËj™—år•7e->yüÓÕÕ:ú,$˜Ø;Ï›M^£Ã¯LÿÉþ˜ø3 Þ @‘ œ† Pv6ñ.ާ¯8œÒ‡)pY9ñÎgÓìßlFp@bäS¦Ž‰Âú2Tä#øå yÿ„ìCÙ¢iSÔ‹¾¯ÚƸáñO#œèû/.?,N»(´‰FàýX5E½)úEÁx£>ðêWeÎØÉÕüì¼hÁâ@~´zmÌÃ#¤¢× º³›þ úÒßf‹“ùé‡ìôòâX‚£ Ñ);.Ë2ÑKðwå~ŽäJ¸,ɼ¸Ç([U=ºÝ4…„”¡"¯kôXÁÇ:¿W—qL•ãbÂIŒiØâ ©MQ æQbŸƒ3‘ÇÆ'Ô3±Jâ”%ÔÚm#»¶Vh•™Ï“³4JÓ?ˆ¢ú*ʽ»à!¾[ŒÛ+;€[ŽºKƒ§IêÀáwÛ˜BÌxjÑ0ó"ävÓ nÝvPFÛ*¨iÕ[ŽŒó”é„ÕÖ£² 5•¬r)z]¶&ýyß·…:)¡r¥Äê3Ê0KÂ!'{áŒR'Ô=ó•}RbBü{%šýÖZå=ºêyY²q§)¡§vÌi Þ-õÿëM/õƒM/ö ó˜â(2x¬ið¢›R, <ß‹5u1Þ¶ÝÚÈÎnpLBãÏè¤R®riøÁpHÙ€9æŒkÓÓ[åq¼Ð x/¤Šð«~ZåÄnzúòC¶\¼?žÏ@2ÛÝÕí ˆäo ÈBδ•¯nU¸Ï&ÙëkO¿&Ë«ÅlùûÙåÛ)L¨ÇgË“c.å1m¡(&4ÐOÞÃ=G¨’¦1o óR8h üöf5à·po„|Ô…«k{ÁŽÆŽ"ï5ëªf¤6%@‹ýÆŽ!¡N¾1 v*EI2”ÊœJoDi8 í…¶BPwº )B­rm31Ôz”b¥©KVj¿t24Œ’ƒs¨TYU#;=ŸÍß]]œ(eÕå~)ôOž£t'íä¶ÝÔ%ª4¬WZ$#(eäÂꄪ0ø @L ?¶[M­ .€Ê©†×ÝWÍ;Ѳ'œ8ùø")h@:Èr#ý›¼·ê±W¯0±šÒÏ ’3¦ØiÅýöžÇ !î@.s-X/T8ˆpS'ä*u·]%š²WÖôT5¿ÝèlHvíÚÐðQB #Ž3S?¹3²”õ÷¤AéÖæ¡Ôò)«µèPßš+¡Pt ”w/­p8þNVÕÅ‘Y‰ê¶}0Èï”>[T*¦Pä4%ÌûRÉ'¤å0c׈ l‹r*ÚIÛfµ`ÐüúJ/ÛÓ&}s't,FŽ7¬jËÏu ›Ä6:C³%nŠq:´HefVhì`Ñ“¹Úº>#æâ˜‡wù(G|›#Øx\/´.fÐÎ ÚMA“ ÚÈSèµúó0>[2¸#5i:ªáÛÆ‚­e‹¹Ý˜‘Ç$á#:±FlûYgoL5#iÌ "ké-?ÁŽ ·KØ^Ñ4³÷6/ >PVèÂIX*ªx‹¾v½|6TI5—Ý:r“ð ØeÒX´~ÒTÂ: únÿ«7L@Nèá‚À`r (© Öÿ¶¾sj%Ücþ¨CWÆQ ø¶ñ0hÊ÷ýóÿëßD¶ÁîÊ å6ÎÝÞ}íÍgÙÕüý5¥jVGFõÕLÇþÒ~=úB Ÿ`G¼è`3p»¢)QÕ@½oUfS%^^@µ»äK½‰­ûÃ_[f3t|¶¸Ü°÷µåyÀ»¨ô ë NÆÑ®3 5{žÀ öÖ]gÀÄ »2k|ÛLõ®XÔ.ð‡£â2*Kã 8ßöU¤ÕÅM‘®X!F3 I†íÑ£êÉ,›ü ?ÿÏš§endstream endobj 6 0 obj 1595 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:46+01:00 2014-01-29T08:09:46+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001919 00000 n 0000003799 00000 n 0000001860 00000 n 0000001700 00000 n 0000000015 00000 n 0000001680 00000 n 0000001984 00000 n 0000002238 00000 n 0000002173 00000 n 0000002105 00000 n 0000002025 00000 n 0000002055 00000 n 0000002320 00000 n 0000002376 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [<9C2746B3EE3663AD02DCDBA44B0DA95F><9C2746B3EE3663AD02DCDBA44B0DA95F>] >> startxref 3953 %%EOF curl-7.35.0/docs/libcurl/curl_easy_init.pdf0000644000175000017500000000774012272124470015575 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ•VÛnã6}×WèCå"æ’”(QhQ Ýú!…“lc¥ÀbS,h™‰UÈ’W—î7ô£;CJ²ådÑ. ÄFHÍœ9sÎŒ¾F9aøé¿³÷î.&OÇÈ“÷Åãöô_ÙŽü’Â…ÿH=÷ '± qP•tçñ  I_¼O~ÖÕÅg£›Ãç¼ÌÛ?x˜‘"_ã¿gs!e,ö¯uÙ邼qwögú›7gTpœAÞòÒDbêR,=ÿærö=@…S.©L€“n<ÿz1Kÿ:* YLæ\à1CtgàÈœ¬Z]·D ž‘Æ4M^•.ÜIþ9˜óˆ*›oõñæöÃêju¼Öcì3úßåeVtC~ÂÐïðÝþŒ×Eh y·$?œ“@f?B¯3 Õgþu±zwõ!½º½™–|LÎ)SÊ–œnó†> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:44+01:00 2014-01-29T08:09:44+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001577 00000 n 0000003457 00000 n 0000001518 00000 n 0000001358 00000 n 0000000015 00000 n 0000001338 00000 n 0000001642 00000 n 0000001896 00000 n 0000001831 00000 n 0000001763 00000 n 0000001683 00000 n 0000001713 00000 n 0000001978 00000 n 0000002034 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [<801B78BFAB5509A053CF639525163464><801B78BFAB5509A053CF639525163464>] >> startxref 3611 %%EOF curl-7.35.0/docs/libcurl/symbols-in-versions0000644000175000017500000007176712262353672015777 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| This document lists defines and other symbols present in libcurl, together with exact information about the first libcurl version that provides the symbol, the first version in which the symbol was marked as deprecated and for a few symbols the last version that featured it. The names appear in alphabetical order. Name Introduced Deprecated Removed CURLAUTH_ANY 7.10.6 CURLAUTH_ANYSAFE 7.10.6 CURLAUTH_BASIC 7.10.6 CURLAUTH_DIGEST 7.10.6 CURLAUTH_DIGEST_IE 7.19.3 CURLAUTH_GSSNEGOTIATE 7.10.6 CURLAUTH_NONE 7.10.6 CURLAUTH_NTLM 7.10.6 CURLAUTH_NTLM_WB 7.22.0 CURLAUTH_ONLY 7.21.3 CURLCLOSEPOLICY_CALLBACK 7.7 CURLCLOSEPOLICY_LEAST_RECENTLY_USED 7.7 CURLCLOSEPOLICY_LEAST_TRAFFIC 7.7 CURLCLOSEPOLICY_NONE 7.7 CURLCLOSEPOLICY_OLDEST 7.7 CURLCLOSEPOLICY_SLOWEST 7.7 CURLE_ABORTED_BY_CALLBACK 7.1 CURLE_AGAIN 7.18.2 CURLE_ALREADY_COMPLETE 7.7.2 CURLE_BAD_CALLING_ORDER 7.1 7.17.0 CURLE_BAD_CONTENT_ENCODING 7.10 CURLE_BAD_DOWNLOAD_RESUME 7.10 CURLE_BAD_FUNCTION_ARGUMENT 7.1 CURLE_BAD_PASSWORD_ENTERED 7.4.2 7.17.0 CURLE_CHUNK_FAILED 7.21.0 CURLE_CONV_FAILED 7.15.4 CURLE_CONV_REQD 7.15.4 CURLE_COULDNT_CONNECT 7.1 CURLE_COULDNT_RESOLVE_HOST 7.1 CURLE_COULDNT_RESOLVE_PROXY 7.1 CURLE_FAILED_INIT 7.1 CURLE_FILESIZE_EXCEEDED 7.10.8 CURLE_FILE_COULDNT_READ_FILE 7.1 CURLE_FTP_ACCEPT_FAILED 7.24.0 CURLE_FTP_ACCEPT_TIMEOUT 7.24.0 CURLE_FTP_ACCESS_DENIED 7.1 CURLE_FTP_BAD_DOWNLOAD_RESUME 7.1 7.1 CURLE_FTP_BAD_FILE_LIST 7.21.0 CURLE_FTP_CANT_GET_HOST 7.1 CURLE_FTP_CANT_RECONNECT 7.1 7.17.0 CURLE_FTP_COULDNT_GET_SIZE 7.1 7.17.0 CURLE_FTP_COULDNT_RETR_FILE 7.1 CURLE_FTP_COULDNT_SET_ASCII 7.1 7.17.0 CURLE_FTP_COULDNT_SET_BINARY 7.1 7.17.0 CURLE_FTP_COULDNT_SET_TYPE 7.17.0 CURLE_FTP_COULDNT_STOR_FILE 7.1 CURLE_FTP_COULDNT_USE_REST 7.1 CURLE_FTP_PARTIAL_FILE 7.1 7.1 CURLE_FTP_PORT_FAILED 7.1 CURLE_FTP_PRET_FAILED 7.20.0 CURLE_FTP_QUOTE_ERROR 7.1 7.17.0 CURLE_FTP_SSL_FAILED 7.11.0 7.17.0 CURLE_FTP_USER_PASSWORD_INCORRECT 7.1 7.17.0 CURLE_FTP_WEIRD_227_FORMAT 7.1 CURLE_FTP_WEIRD_PASS_REPLY 7.1 CURLE_FTP_WEIRD_PASV_REPLY 7.1 CURLE_FTP_WEIRD_SERVER_REPLY 7.1 CURLE_FTP_WEIRD_USER_REPLY 7.1 7.17.0 CURLE_FTP_WRITE_ERROR 7.1 7.17.0 CURLE_FUNCTION_NOT_FOUND 7.1 CURLE_GOT_NOTHING 7.9.1 CURLE_HTTP_NOT_FOUND 7.1 CURLE_HTTP_PORT_FAILED 7.3 7.12.0 CURLE_HTTP_POST_ERROR 7.1 CURLE_HTTP_RANGE_ERROR 7.1 7.17.0 CURLE_HTTP_RETURNED_ERROR 7.10.3 CURLE_INTERFACE_FAILED 7.12.0 CURLE_LDAP_CANNOT_BIND 7.1 CURLE_LDAP_INVALID_URL 7.10.8 CURLE_LDAP_SEARCH_FAILED 7.1 CURLE_LIBRARY_NOT_FOUND 7.1 7.17.0 CURLE_LOGIN_DENIED 7.13.1 CURLE_MALFORMAT_USER 7.1 7.17.0 CURLE_NOT_BUILT_IN 7.21.5 CURLE_NO_CONNECTION_AVAILABLE 7.30.0 CURLE_OK 7.1 CURLE_OPERATION_TIMEDOUT 7.10.2 CURLE_OPERATION_TIMEOUTED 7.1 7.17.0 CURLE_OUT_OF_MEMORY 7.1 CURLE_PARTIAL_FILE 7.1 CURLE_PEER_FAILED_VERIFICATION 7.17.1 CURLE_QUOTE_ERROR 7.17.0 CURLE_RANGE_ERROR 7.17.0 CURLE_READ_ERROR 7.1 CURLE_RECV_ERROR 7.10 CURLE_REMOTE_ACCESS_DENIED 7.17.0 CURLE_REMOTE_DISK_FULL 7.17.0 CURLE_REMOTE_FILE_EXISTS 7.17.0 CURLE_REMOTE_FILE_NOT_FOUND 7.16.1 CURLE_RTSP_CSEQ_ERROR 7.20.0 CURLE_RTSP_SESSION_ERROR 7.20.0 CURLE_SEND_ERROR 7.10 CURLE_SEND_FAIL_REWIND 7.12.3 CURLE_SHARE_IN_USE 7.9.6 7.17.0 CURLE_SSH 7.16.1 CURLE_SSL_CACERT 7.10 CURLE_SSL_CACERT_BADFILE 7.16.0 CURLE_SSL_CERTPROBLEM 7.10 CURLE_SSL_CIPHER 7.10 CURLE_SSL_CONNECT_ERROR 7.1 CURLE_SSL_CRL_BADFILE 7.19.0 CURLE_SSL_ENGINE_INITFAILED 7.12.3 CURLE_SSL_ENGINE_NOTFOUND 7.9.3 CURLE_SSL_ENGINE_SETFAILED 7.9.3 CURLE_SSL_ISSUER_ERROR 7.19.0 CURLE_SSL_PEER_CERTIFICATE 7.8 7.17.1 CURLE_SSL_SHUTDOWN_FAILED 7.16.1 CURLE_TELNET_OPTION_SYNTAX 7.7 CURLE_TFTP_DISKFULL 7.15.0 7.17.0 CURLE_TFTP_EXISTS 7.15.0 7.17.0 CURLE_TFTP_ILLEGAL 7.15.0 CURLE_TFTP_NOSUCHUSER 7.15.0 CURLE_TFTP_NOTFOUND 7.15.0 CURLE_TFTP_PERM 7.15.0 CURLE_TFTP_UNKNOWNID 7.15.0 CURLE_TOO_MANY_REDIRECTS 7.5 CURLE_UNKNOWN_OPTION 7.21.5 CURLE_UNKNOWN_TELNET_OPTION 7.7 CURLE_UNSUPPORTED_PROTOCOL 7.1 CURLE_UPLOAD_FAILED 7.16.3 CURLE_URL_MALFORMAT 7.1 CURLE_URL_MALFORMAT_USER 7.1 7.17.0 CURLE_USE_SSL_FAILED 7.17.0 CURLE_WRITE_ERROR 7.1 CURLFILETYPE_DEVICE_BLOCK 7.21.0 CURLFILETYPE_DEVICE_CHAR 7.21.0 CURLFILETYPE_DIRECTORY 7.21.0 CURLFILETYPE_DOOR 7.21.0 CURLFILETYPE_FILE 7.21.0 CURLFILETYPE_NAMEDPIPE 7.21.0 CURLFILETYPE_SOCKET 7.21.0 CURLFILETYPE_SYMLINK 7.21.0 CURLFILETYPE_UNKNOWN 7.21.0 CURLFINFOFLAG_KNOWN_FILENAME 7.21.0 CURLFINFOFLAG_KNOWN_FILETYPE 7.21.0 CURLFINFOFLAG_KNOWN_GID 7.21.0 CURLFINFOFLAG_KNOWN_HLINKCOUNT 7.21.0 CURLFINFOFLAG_KNOWN_PERM 7.21.0 CURLFINFOFLAG_KNOWN_SIZE 7.21.0 CURLFINFOFLAG_KNOWN_TIME 7.21.0 CURLFINFOFLAG_KNOWN_UID 7.21.0 CURLFORM_ARRAY 7.9.1 CURLFORM_ARRAY_END 7.9.1 7.9.5 7.9.6 CURLFORM_ARRAY_START 7.9.1 7.9.5 7.9.6 CURLFORM_BUFFER 7.9.8 CURLFORM_BUFFERLENGTH 7.9.8 CURLFORM_BUFFERPTR 7.9.8 CURLFORM_CONTENTHEADER 7.9.3 CURLFORM_CONTENTSLENGTH 7.9 CURLFORM_CONTENTTYPE 7.9 CURLFORM_COPYCONTENTS 7.9 CURLFORM_COPYNAME 7.9 CURLFORM_END 7.9 CURLFORM_FILE 7.9 CURLFORM_FILECONTENT 7.9.1 CURLFORM_FILENAME 7.9.6 CURLFORM_NAMELENGTH 7.9 CURLFORM_NOTHING 7.9 CURLFORM_PTRCONTENTS 7.9 CURLFORM_PTRNAME 7.9 CURLFORM_STREAM 7.18.2 CURLFTPAUTH_DEFAULT 7.12.2 CURLFTPAUTH_SSL 7.12.2 CURLFTPAUTH_TLS 7.12.2 CURLFTPMETHOD_DEFAULT 7.15.3 CURLFTPMETHOD_MULTICWD 7.15.3 CURLFTPMETHOD_NOCWD 7.15.3 CURLFTPMETHOD_SINGLECWD 7.15.3 CURLFTPSSL_ALL 7.11.0 7.17.0 CURLFTPSSL_CCC_ACTIVE 7.16.2 CURLFTPSSL_CCC_NONE 7.16.2 CURLFTPSSL_CCC_PASSIVE 7.16.1 CURLFTPSSL_CONTROL 7.11.0 7.17.0 CURLFTPSSL_NONE 7.11.0 7.17.0 CURLFTPSSL_TRY 7.11.0 7.17.0 CURLFTP_CREATE_DIR 7.19.4 CURLFTP_CREATE_DIR_NONE 7.19.4 CURLFTP_CREATE_DIR_RETRY 7.19.4 CURLGSSAPI_DELEGATION_FLAG 7.22.0 CURLGSSAPI_DELEGATION_NONE 7.22.0 CURLGSSAPI_DELEGATION_POLICY_FLAG 7.22.0 CURLINFO_APPCONNECT_TIME 7.19.0 CURLINFO_CERTINFO 7.19.1 CURLINFO_CONDITION_UNMET 7.19.4 CURLINFO_CONNECT_TIME 7.4.1 CURLINFO_CONTENT_LENGTH_DOWNLOAD 7.6.1 CURLINFO_CONTENT_LENGTH_UPLOAD 7.6.1 CURLINFO_CONTENT_TYPE 7.9.4 CURLINFO_COOKIELIST 7.14.1 CURLINFO_DATA_IN 7.9.6 CURLINFO_DATA_OUT 7.9.6 CURLINFO_DOUBLE 7.4.1 CURLINFO_EFFECTIVE_URL 7.4 CURLINFO_END 7.9.6 CURLINFO_FILETIME 7.5 CURLINFO_FTP_ENTRY_PATH 7.15.4 CURLINFO_HEADER_IN 7.9.6 CURLINFO_HEADER_OUT 7.9.6 CURLINFO_HEADER_SIZE 7.4.1 CURLINFO_HTTPAUTH_AVAIL 7.10.8 CURLINFO_HTTP_CODE 7.4.1 7.10.8 CURLINFO_HTTP_CONNECTCODE 7.10.7 CURLINFO_LASTONE 7.4.1 CURLINFO_LASTSOCKET 7.15.2 CURLINFO_LOCAL_IP 7.21.0 CURLINFO_LOCAL_PORT 7.21.0 CURLINFO_LONG 7.4.1 CURLINFO_MASK 7.4.1 CURLINFO_NAMELOOKUP_TIME 7.4.1 CURLINFO_NONE 7.4.1 CURLINFO_NUM_CONNECTS 7.12.3 CURLINFO_OS_ERRNO 7.12.2 CURLINFO_PRETRANSFER_TIME 7.4.1 CURLINFO_PRIMARY_IP 7.19.0 CURLINFO_PRIMARY_PORT 7.21.0 CURLINFO_PRIVATE 7.10.3 CURLINFO_PROXYAUTH_AVAIL 7.10.8 CURLINFO_REDIRECT_COUNT 7.9.7 CURLINFO_REDIRECT_TIME 7.9.7 CURLINFO_REDIRECT_URL 7.18.2 CURLINFO_REQUEST_SIZE 7.4.1 CURLINFO_RESPONSE_CODE 7.10.8 CURLINFO_RTSP_CLIENT_CSEQ 7.20.0 CURLINFO_RTSP_CSEQ_RECV 7.20.0 CURLINFO_RTSP_SERVER_CSEQ 7.20.0 CURLINFO_RTSP_SESSION_ID 7.20.0 CURLINFO_SIZE_DOWNLOAD 7.4.1 CURLINFO_SIZE_UPLOAD 7.4.1 CURLINFO_SLIST 7.12.3 CURLINFO_SPEED_DOWNLOAD 7.4.1 CURLINFO_SPEED_UPLOAD 7.4.1 CURLINFO_SSL_DATA_IN 7.12.1 CURLINFO_SSL_DATA_OUT 7.12.1 CURLINFO_SSL_ENGINES 7.12.3 CURLINFO_SSL_VERIFYRESULT 7.5 CURLINFO_STARTTRANSFER_TIME 7.9.2 CURLINFO_STRING 7.4.1 CURLINFO_TEXT 7.9.6 CURLINFO_TLS_SESSION 7.34.0 CURLINFO_TOTAL_TIME 7.4.1 CURLINFO_TYPEMASK 7.4.1 CURLIOCMD_NOP 7.12.3 CURLIOCMD_RESTARTREAD 7.12.3 CURLIOE_FAILRESTART 7.12.3 CURLIOE_OK 7.12.3 CURLIOE_UNKNOWNCMD 7.12.3 CURLKHMATCH_MISMATCH 7.19.6 CURLKHMATCH_MISSING 7.19.6 CURLKHMATCH_OK 7.19.6 CURLKHSTAT_DEFER 7.19.6 CURLKHSTAT_FINE 7.19.6 CURLKHSTAT_FINE_ADD_TO_FILE 7.19.6 CURLKHSTAT_REJECT 7.19.6 CURLKHTYPE_DSS 7.19.6 CURLKHTYPE_RSA 7.19.6 CURLKHTYPE_RSA1 7.19.6 CURLKHTYPE_UNKNOWN 7.19.6 CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE 7.30.0 CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE 7.30.0 CURLMOPT_MAXCONNECTS 7.16.3 CURLMOPT_MAX_HOST_CONNECTIONS 7.30.0 CURLMOPT_MAX_PIPELINE_LENGTH 7.30.0 CURLMOPT_MAX_TOTAL_CONNECTIONS 7.30.0 CURLMOPT_PIPELINING 7.16.0 CURLMOPT_PIPELINING_SERVER_BL 7.30.0 CURLMOPT_PIPELINING_SITE_BL 7.30.0 CURLMOPT_SOCKETDATA 7.15.4 CURLMOPT_SOCKETFUNCTION 7.15.4 CURLMOPT_TIMERDATA 7.16.0 CURLMOPT_TIMERFUNCTION 7.16.0 CURLMSG_DONE 7.9.6 CURLMSG_NONE 7.9.6 CURLM_ADDED_ALREADY 7.32.1 CURLM_BAD_EASY_HANDLE 7.9.6 CURLM_BAD_HANDLE 7.9.6 CURLM_BAD_SOCKET 7.15.4 CURLM_CALL_MULTI_PERFORM 7.9.6 CURLM_CALL_MULTI_SOCKET 7.15.5 CURLM_INTERNAL_ERROR 7.9.6 CURLM_OK 7.9.6 CURLM_OUT_OF_MEMORY 7.9.6 CURLM_UNKNOWN_OPTION 7.15.4 CURLOPTTYPE_FUNCTIONPOINT 7.1 CURLOPTTYPE_LONG 7.1 CURLOPTTYPE_OBJECTPOINT 7.1 CURLOPTTYPE_OFF_T 7.11.0 CURLOPT_ACCEPTTIMEOUT_MS 7.24.0 CURLOPT_ACCEPT_ENCODING 7.21.6 CURLOPT_ADDRESS_SCOPE 7.19.0 CURLOPT_APPEND 7.17.0 CURLOPT_AUTOREFERER 7.1 CURLOPT_BUFFERSIZE 7.10 CURLOPT_CAINFO 7.4.2 CURLOPT_CAPATH 7.9.8 CURLOPT_CERTINFO 7.19.1 CURLOPT_CHUNK_BGN_FUNCTION 7.21.0 CURLOPT_CHUNK_DATA 7.21.0 CURLOPT_CHUNK_END_FUNCTION 7.21.0 CURLOPT_CLOSEFUNCTION 7.7 7.11.1 7.15.5 CURLOPT_CLOSEPOLICY 7.7 7.16.1 CURLOPT_CLOSESOCKETDATA 7.21.7 CURLOPT_CLOSESOCKETFUNCTION 7.21.7 CURLOPT_CONNECTTIMEOUT 7.7 CURLOPT_CONNECTTIMEOUT_MS 7.16.2 CURLOPT_CONNECT_ONLY 7.15.2 CURLOPT_CONV_FROM_NETWORK_FUNCTION 7.15.4 CURLOPT_CONV_FROM_UTF8_FUNCTION 7.15.4 CURLOPT_CONV_TO_NETWORK_FUNCTION 7.15.4 CURLOPT_COOKIE 7.1 CURLOPT_COOKIEFILE 7.1 CURLOPT_COOKIEJAR 7.9 CURLOPT_COOKIELIST 7.14.1 CURLOPT_COOKIESESSION 7.9.7 CURLOPT_COPYPOSTFIELDS 7.17.1 CURLOPT_CRLF 7.1 CURLOPT_CRLFILE 7.19.0 CURLOPT_CUSTOMREQUEST 7.1 CURLOPT_DEBUGDATA 7.9.6 CURLOPT_DEBUGFUNCTION 7.9.6 CURLOPT_DIRLISTONLY 7.17.0 CURLOPT_DNS_CACHE_TIMEOUT 7.9.3 CURLOPT_DNS_INTERFACE 7.33.0 CURLOPT_DNS_LOCAL_IP4 7.33.0 CURLOPT_DNS_LOCAL_IP6 7.33.0 CURLOPT_DNS_SERVERS 7.24.0 CURLOPT_DNS_USE_GLOBAL_CACHE 7.9.3 7.11.1 CURLOPT_EGDSOCKET 7.7 CURLOPT_ENCODING 7.10 CURLOPT_ERRORBUFFER 7.1 CURLOPT_FAILONERROR 7.1 CURLOPT_FILE 7.1 7.9.7 CURLOPT_FILETIME 7.5 CURLOPT_FNMATCH_DATA 7.21.0 CURLOPT_FNMATCH_FUNCTION 7.21.0 CURLOPT_FOLLOWLOCATION 7.1 CURLOPT_FORBID_REUSE 7.7 CURLOPT_FRESH_CONNECT 7.7 CURLOPT_FTPAPPEND 7.1 7.16.4 CURLOPT_FTPASCII 7.1 7.11.1 7.15.5 CURLOPT_FTPLISTONLY 7.1 7.16.4 CURLOPT_FTPPORT 7.1 CURLOPT_FTPSSLAUTH 7.12.2 CURLOPT_FTP_ACCOUNT 7.13.0 CURLOPT_FTP_ALTERNATIVE_TO_USER 7.15.5 CURLOPT_FTP_CREATE_MISSING_DIRS 7.10.7 CURLOPT_FTP_FILEMETHOD 7.15.1 CURLOPT_FTP_RESPONSE_TIMEOUT 7.10.8 CURLOPT_FTP_SKIP_PASV_IP 7.15.0 CURLOPT_FTP_SSL 7.11.0 7.16.4 CURLOPT_FTP_SSL_CCC 7.16.1 CURLOPT_FTP_USE_EPRT 7.10.5 CURLOPT_FTP_USE_EPSV 7.9.2 CURLOPT_FTP_USE_PRET 7.20.0 CURLOPT_GSSAPI_DELEGATION 7.22.0 CURLOPT_HEADER 7.1 CURLOPT_HEADERDATA 7.10 CURLOPT_HEADERFUNCTION 7.7.2 CURLOPT_HTTP200ALIASES 7.10.3 CURLOPT_HTTPAUTH 7.10.6 CURLOPT_HTTPGET 7.8.1 CURLOPT_HTTPHEADER 7.1 CURLOPT_HTTPPOST 7.1 CURLOPT_HTTPPROXYTUNNEL 7.3 CURLOPT_HTTPREQUEST 7.1 - 7.15.5 CURLOPT_HTTP_CONTENT_DECODING 7.16.2 CURLOPT_HTTP_TRANSFER_DECODING 7.16.2 CURLOPT_HTTP_VERSION 7.9.1 CURLOPT_IGNORE_CONTENT_LENGTH 7.14.1 CURLOPT_INFILE 7.1 7.9.7 CURLOPT_INFILESIZE 7.1 CURLOPT_INFILESIZE_LARGE 7.11.0 CURLOPT_INTERFACE 7.3 CURLOPT_INTERLEAVEDATA 7.20.0 CURLOPT_INTERLEAVEFUNCTION 7.20.0 CURLOPT_IOCTLDATA 7.12.3 CURLOPT_IOCTLFUNCTION 7.12.3 CURLOPT_IPRESOLVE 7.10.8 CURLOPT_ISSUERCERT 7.19.0 CURLOPT_KEYPASSWD 7.17.0 CURLOPT_KRB4LEVEL 7.3 7.17.0 CURLOPT_KRBLEVEL 7.16.4 CURLOPT_LOCALPORT 7.15.2 CURLOPT_LOCALPORTRANGE 7.15.2 CURLOPT_LOGIN_OPTIONS 7.34.0 CURLOPT_LOW_SPEED_LIMIT 7.1 CURLOPT_LOW_SPEED_TIME 7.1 CURLOPT_MAIL_AUTH 7.25.0 CURLOPT_MAIL_FROM 7.20.0 CURLOPT_MAIL_RCPT 7.20.0 CURLOPT_MAXCONNECTS 7.7 CURLOPT_MAXFILESIZE 7.10.8 CURLOPT_MAXFILESIZE_LARGE 7.11.0 CURLOPT_MAXREDIRS 7.5 CURLOPT_MAX_RECV_SPEED_LARGE 7.15.5 CURLOPT_MAX_SEND_SPEED_LARGE 7.15.5 CURLOPT_MUTE 7.1 7.8 7.15.5 CURLOPT_NETRC 7.1 CURLOPT_NETRC_FILE 7.11.0 CURLOPT_NEW_DIRECTORY_PERMS 7.16.4 CURLOPT_NEW_FILE_PERMS 7.16.4 CURLOPT_NOBODY 7.1 CURLOPT_NOPROGRESS 7.1 CURLOPT_NOPROXY 7.19.4 CURLOPT_NOSIGNAL 7.10 CURLOPT_NOTHING 7.1.1 7.11.1 7.11.0 CURLOPT_OPENSOCKETDATA 7.17.1 CURLOPT_OPENSOCKETFUNCTION 7.17.1 CURLOPT_PASSWDDATA 7.4.2 7.11.1 7.15.5 CURLOPT_PASSWDFUNCTION 7.4.2 7.11.1 7.15.5 CURLOPT_PASSWORD 7.19.1 CURLOPT_PASV_HOST 7.12.1 7.16.0 7.15.5 CURLOPT_PORT 7.1 CURLOPT_POST 7.1 CURLOPT_POST301 7.17.1 7.19.1 CURLOPT_POSTFIELDS 7.1 CURLOPT_POSTFIELDSIZE 7.2 CURLOPT_POSTFIELDSIZE_LARGE 7.11.1 CURLOPT_POSTQUOTE 7.1 CURLOPT_POSTREDIR 7.19.1 CURLOPT_PREQUOTE 7.9.5 CURLOPT_PRIVATE 7.10.3 CURLOPT_PROGRESSDATA 7.1 CURLOPT_PROGRESSFUNCTION 7.1 7.32.0 CURLOPT_PROTOCOLS 7.19.4 CURLOPT_PROXY 7.1 CURLOPT_PROXYAUTH 7.10.7 CURLOPT_PROXYPASSWORD 7.19.1 CURLOPT_PROXYPORT 7.1 CURLOPT_PROXYTYPE 7.10 CURLOPT_PROXYUSERNAME 7.19.1 CURLOPT_PROXYUSERPWD 7.1 CURLOPT_PROXY_TRANSFER_MODE 7.18.0 CURLOPT_PUT 7.1 CURLOPT_QUOTE 7.1 CURLOPT_RANDOM_FILE 7.7 CURLOPT_RANGE 7.1 CURLOPT_READDATA 7.9.7 CURLOPT_READFUNCTION 7.1 CURLOPT_REDIR_PROTOCOLS 7.19.4 CURLOPT_REFERER 7.1 CURLOPT_RESOLVE 7.21.3 CURLOPT_RESUME_FROM 7.1 CURLOPT_RESUME_FROM_LARGE 7.11.0 CURLOPT_RTSPHEADER 7.20.0 CURLOPT_RTSP_CLIENT_CSEQ 7.20.0 CURLOPT_RTSP_REQUEST 7.20.0 CURLOPT_RTSP_SERVER_CSEQ 7.20.0 CURLOPT_RTSP_SESSION_ID 7.20.0 CURLOPT_RTSP_STREAM_URI 7.20.0 CURLOPT_RTSP_TRANSPORT 7.20.0 CURLOPT_SASL_IR 7.31.0 CURLOPT_SEEKDATA 7.18.0 CURLOPT_SEEKFUNCTION 7.18.0 CURLOPT_SERVER_RESPONSE_TIMEOUT 7.20.0 CURLOPT_SHARE 7.10 CURLOPT_SOCKOPTDATA 7.16.0 CURLOPT_SOCKOPTFUNCTION 7.16.0 CURLOPT_SOCKS5_GSSAPI_NEC 7.19.4 CURLOPT_SOCKS5_GSSAPI_SERVICE 7.19.4 CURLOPT_SOURCE_HOST 7.12.1 - 7.15.5 CURLOPT_SOURCE_PATH 7.12.1 - 7.15.5 CURLOPT_SOURCE_PORT 7.12.1 - 7.15.5 CURLOPT_SOURCE_POSTQUOTE 7.12.1 - 7.15.5 CURLOPT_SOURCE_PREQUOTE 7.12.1 - 7.15.5 CURLOPT_SOURCE_QUOTE 7.13.0 - 7.15.5 CURLOPT_SOURCE_URL 7.13.0 - 7.15.5 CURLOPT_SOURCE_USERPWD 7.12.1 - 7.15.5 CURLOPT_SSH_AUTH_TYPES 7.16.1 CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 7.17.1 CURLOPT_SSH_KEYDATA 7.19.6 CURLOPT_SSH_KEYFUNCTION 7.19.6 CURLOPT_SSH_KNOWNHOSTS 7.19.6 CURLOPT_SSH_PRIVATE_KEYFILE 7.16.1 CURLOPT_SSH_PUBLIC_KEYFILE 7.16.1 CURLOPT_SSLCERT 7.1 CURLOPT_SSLCERTPASSWD 7.1.1 7.17.0 CURLOPT_SSLCERTTYPE 7.9.3 CURLOPT_SSLENGINE 7.9.3 CURLOPT_SSLENGINE_DEFAULT 7.9.3 CURLOPT_SSLKEY 7.9.3 CURLOPT_SSLKEYPASSWD 7.9.3 7.17.0 CURLOPT_SSLKEYTYPE 7.9.3 CURLOPT_SSLVERSION 7.1 CURLOPT_SSL_CIPHER_LIST 7.9 CURLOPT_SSL_CTX_DATA 7.10.6 CURLOPT_SSL_CTX_FUNCTION 7.10.6 CURLOPT_SSL_OPTIONS 7.25.0 CURLOPT_SSL_SESSIONID_CACHE 7.16.0 CURLOPT_SSL_VERIFYHOST 7.8.1 CURLOPT_SSL_VERIFYPEER 7.4.2 CURLOPT_STDERR 7.1 CURLOPT_TCP_KEEPALIVE 7.25.0 CURLOPT_TCP_KEEPIDLE 7.25.0 CURLOPT_TCP_KEEPINTVL 7.25.0 CURLOPT_TCP_NODELAY 7.11.2 CURLOPT_TELNETOPTIONS 7.7 CURLOPT_TFTP_BLKSIZE 7.19.4 CURLOPT_TIMECONDITION 7.1 CURLOPT_TIMEOUT 7.1 CURLOPT_TIMEOUT_MS 7.16.2 CURLOPT_TIMEVALUE 7.1 CURLOPT_TLSAUTH_PASSWORD 7.21.4 CURLOPT_TLSAUTH_TYPE 7.21.4 CURLOPT_TLSAUTH_USERNAME 7.21.4 CURLOPT_TRANSFERTEXT 7.1.1 CURLOPT_TRANSFER_ENCODING 7.21.6 CURLOPT_UNRESTRICTED_AUTH 7.10.4 CURLOPT_UPLOAD 7.1 CURLOPT_URL 7.1 CURLOPT_USERAGENT 7.1 CURLOPT_USERNAME 7.19.1 CURLOPT_USERPWD 7.1 CURLOPT_USE_SSL 7.17.0 CURLOPT_VERBOSE 7.1 CURLOPT_WILDCARDMATCH 7.21.0 CURLOPT_WRITEDATA 7.9.7 CURLOPT_WRITEFUNCTION 7.1 CURLOPT_WRITEHEADER 7.1 CURLOPT_WRITEINFO 7.1 CURLOPT_XFERINFODATA 7.32.0 CURLOPT_XFERINFOFUNCTION 7.32.0 CURLOPT_XOAUTH2_BEARER 7.33.0 CURLPAUSE_ALL 7.18.0 CURLPAUSE_CONT 7.18.0 CURLPAUSE_RECV 7.18.0 CURLPAUSE_RECV_CONT 7.18.0 CURLPAUSE_SEND 7.18.0 CURLPAUSE_SEND_CONT 7.18.0 CURLPROTO_ALL 7.19.4 CURLPROTO_DICT 7.19.4 CURLPROTO_FILE 7.19.4 CURLPROTO_FTP 7.19.4 CURLPROTO_FTPS 7.19.4 CURLPROTO_GOPHER 7.21.2 CURLPROTO_HTTP 7.19.4 CURLPROTO_HTTPS 7.19.4 CURLPROTO_IMAP 7.20.0 CURLPROTO_IMAPS 7.20.0 CURLPROTO_LDAP 7.19.4 CURLPROTO_LDAPS 7.19.4 CURLPROTO_POP3 7.20.0 CURLPROTO_POP3S 7.20.0 CURLPROTO_RTMP 7.21.0 CURLPROTO_RTMPE 7.21.0 CURLPROTO_RTMPS 7.21.0 CURLPROTO_RTMPT 7.21.0 CURLPROTO_RTMPTE 7.21.0 CURLPROTO_RTMPTS 7.21.0 CURLPROTO_RTSP 7.20.0 CURLPROTO_SCP 7.19.4 CURLPROTO_SFTP 7.19.4 CURLPROTO_SMTP 7.20.0 CURLPROTO_SMTPS 7.20.0 CURLPROTO_TELNET 7.19.4 CURLPROTO_TFTP 7.19.4 CURLPROXY_HTTP 7.10 CURLPROXY_HTTP_1_0 7.19.4 CURLPROXY_SOCKS4 7.10 CURLPROXY_SOCKS4A 7.18.0 CURLPROXY_SOCKS5 7.10 CURLPROXY_SOCKS5_HOSTNAME 7.18.0 CURLSHE_BAD_OPTION 7.10.3 CURLSHE_INVALID 7.10.3 CURLSHE_IN_USE 7.10.3 CURLSHE_NOMEM 7.12.0 CURLSHE_NOT_BUILT_IN 7.23.0 CURLSHE_OK 7.10.3 CURLSHOPT_LOCKFUNC 7.10.3 CURLSHOPT_NONE 7.10.3 CURLSHOPT_SHARE 7.10.3 CURLSHOPT_UNLOCKFUNC 7.10.3 CURLSHOPT_UNSHARE 7.10.3 CURLSHOPT_USERDATA 7.10.3 CURLSOCKTYPE_ACCEPT 7.28.0 CURLSOCKTYPE_IPCXN 7.16.0 CURLSSH_AUTH_AGENT 7.28.0 CURLSSH_AUTH_ANY 7.16.1 CURLSSH_AUTH_DEFAULT 7.16.1 CURLSSH_AUTH_HOST 7.16.1 CURLSSH_AUTH_KEYBOARD 7.16.1 CURLSSH_AUTH_NONE 7.16.1 CURLSSH_AUTH_PASSWORD 7.16.1 CURLSSH_AUTH_PUBLICKEY 7.16.1 CURLSSLBACKEND_CYASSL 7.34.0 CURLSSLBACKEND_DARWINSSL 7.34.0 CURLSSLBACKEND_GNUTLS 7.34.0 CURLSSLBACKEND_GSKIT 7.34.0 CURLSSLBACKEND_NONE 7.34.0 CURLSSLBACKEND_NSS 7.34.0 CURLSSLBACKEND_OPENSSL 7.34.0 CURLSSLBACKEND_POLARSSL 7.34.0 CURLSSLBACKEND_QSOSSL 7.34.0 CURLSSLBACKEND_SCHANNEL 7.34.0 CURLSSLOPT_ALLOW_BEAST 7.25.0 CURLUSESSL_ALL 7.17.0 CURLUSESSL_CONTROL 7.17.0 CURLUSESSL_NONE 7.17.0 CURLUSESSL_TRY 7.17.0 CURLVERSION_FIRST 7.10 CURLVERSION_FOURTH 7.16.1 CURLVERSION_NOW 7.10 CURLVERSION_SECOND 7.11.1 CURLVERSION_THIRD 7.12.0 CURL_CHUNK_BGN_FUNC_FAIL 7.21.0 CURL_CHUNK_BGN_FUNC_OK 7.21.0 CURL_CHUNK_BGN_FUNC_SKIP 7.21.0 CURL_CHUNK_END_FUNC_FAIL 7.21.0 CURL_CHUNK_END_FUNC_OK 7.21.0 CURL_CSELECT_ERR 7.16.3 CURL_CSELECT_IN 7.16.3 CURL_CSELECT_OUT 7.16.3 CURL_EASY_NONE 7.14.0 - 7.15.4 CURL_EASY_TIMEOUT 7.14.0 - 7.15.4 CURL_ERROR_SIZE 7.1 CURL_FNMATCHFUNC_FAIL 7.21.0 CURL_FNMATCHFUNC_MATCH 7.21.0 CURL_FNMATCHFUNC_NOMATCH 7.21.0 CURL_FORMADD_DISABLED 7.12.1 CURL_FORMADD_ILLEGAL_ARRAY 7.9.8 CURL_FORMADD_INCOMPLETE 7.9.8 CURL_FORMADD_MEMORY 7.9.8 CURL_FORMADD_NULL 7.9.8 CURL_FORMADD_OK 7.9.8 CURL_FORMADD_OPTION_TWICE 7.9.8 CURL_FORMADD_UNKNOWN_OPTION 7.9.8 CURL_GLOBAL_ACK_EINTR 7.30.0 CURL_GLOBAL_ALL 7.8 CURL_GLOBAL_DEFAULT 7.8 CURL_GLOBAL_NOTHING 7.8 CURL_GLOBAL_SSL 7.8 CURL_GLOBAL_WIN32 7.8.1 CURL_HTTP_VERSION_1_0 7.9.1 CURL_HTTP_VERSION_1_1 7.9.1 CURL_HTTP_VERSION_2_0 7.33.0 CURL_HTTP_VERSION_NONE 7.9.1 CURL_IPRESOLVE_V4 7.10.8 CURL_IPRESOLVE_V6 7.10.8 CURL_IPRESOLVE_WHATEVER 7.10.8 CURL_LOCK_ACCESS_NONE 7.10.3 CURL_LOCK_ACCESS_SHARED 7.10.3 CURL_LOCK_ACCESS_SINGLE 7.10.3 CURL_LOCK_DATA_CONNECT 7.10.3 CURL_LOCK_DATA_COOKIE 7.10.3 CURL_LOCK_DATA_DNS 7.10.3 CURL_LOCK_DATA_NONE 7.10.3 CURL_LOCK_DATA_SHARE 7.10.4 CURL_LOCK_DATA_SSL_SESSION 7.10.3 CURL_LOCK_TYPE_CONNECT 7.10 - 7.10.2 CURL_LOCK_TYPE_COOKIE 7.10 - 7.10.2 CURL_LOCK_TYPE_DNS 7.10 - 7.10.2 CURL_LOCK_TYPE_NONE 7.10 - 7.10.2 CURL_LOCK_TYPE_SSL_SESSION 7.10 - 7.10.2 CURL_MAX_HTTP_HEADER 7.19.7 CURL_MAX_WRITE_SIZE 7.9.7 CURL_NETRC_IGNORED 7.9.8 CURL_NETRC_OPTIONAL 7.9.8 CURL_NETRC_REQUIRED 7.9.8 CURL_POLL_IN 7.14.0 CURL_POLL_INOUT 7.14.0 CURL_POLL_NONE 7.14.0 CURL_POLL_OUT 7.14.0 CURL_POLL_REMOVE 7.14.0 CURL_PROGRESS_BAR 7.1.1 - 7.4.1 CURL_PROGRESS_STATS 7.1.1 - 7.4.1 CURL_READFUNC_ABORT 7.12.1 CURL_READFUNC_PAUSE 7.18.0 CURL_REDIR_GET_ALL 7.19.1 CURL_REDIR_POST_301 7.19.1 CURL_REDIR_POST_302 7.19.1 CURL_REDIR_POST_303 7.25.1 CURL_REDIR_POST_ALL 7.19.1 CURL_RTSPREQ_ANNOUNCE 7.20.0 CURL_RTSPREQ_DESCRIBE 7.20.0 CURL_RTSPREQ_GET_PARAMETER 7.20.0 CURL_RTSPREQ_NONE 7.20.0 CURL_RTSPREQ_OPTIONS 7.20.0 CURL_RTSPREQ_PAUSE 7.20.0 CURL_RTSPREQ_PLAY 7.20.0 CURL_RTSPREQ_RECEIVE 7.20.0 CURL_RTSPREQ_RECORD 7.20.0 CURL_RTSPREQ_SETUP 7.20.0 CURL_RTSPREQ_SET_PARAMETER 7.20.0 CURL_RTSPREQ_TEARDOWN 7.20.0 CURL_SEEKFUNC_CANTSEEK 7.19.5 CURL_SEEKFUNC_FAIL 7.19.5 CURL_SEEKFUNC_OK 7.19.5 CURL_SOCKET_BAD 7.14.0 CURL_SOCKET_TIMEOUT 7.14.0 CURL_SOCKOPT_ALREADY_CONNECTED 7.21.5 CURL_SOCKOPT_ERROR 7.21.5 CURL_SOCKOPT_OK 7.21.5 CURL_SSLVERSION_DEFAULT 7.9.2 CURL_SSLVERSION_SSLv2 7.9.2 CURL_SSLVERSION_SSLv3 7.9.2 CURL_SSLVERSION_TLSv1 7.9.2 CURL_SSLVERSION_TLSv1_0 7.34.0 CURL_SSLVERSION_TLSv1_1 7.34.0 CURL_SSLVERSION_TLSv1_2 7.34.0 CURL_TIMECOND_IFMODSINCE 7.9.7 CURL_TIMECOND_IFUNMODSINCE 7.9.7 CURL_TIMECOND_LASTMOD 7.9.7 CURL_TIMECOND_NONE 7.9.7 CURL_TLSAUTH_NONE 7.21.4 CURL_TLSAUTH_SRP 7.21.4 CURL_VERSION_ASYNCHDNS 7.10.7 CURL_VERSION_CONV 7.15.4 CURL_VERSION_CURLDEBUG 7.19.6 CURL_VERSION_DEBUG 7.10.6 CURL_VERSION_GSSNEGOTIATE 7.10.6 CURL_VERSION_HTTP2 7.33.0 CURL_VERSION_IDN 7.12.0 CURL_VERSION_IPV6 7.10 CURL_VERSION_KERBEROS4 7.10 CURL_VERSION_LARGEFILE 7.11.1 CURL_VERSION_LIBZ 7.10 CURL_VERSION_NTLM 7.10.6 CURL_VERSION_NTLM_WB 7.22.0 CURL_VERSION_SPNEGO 7.10.8 CURL_VERSION_SSL 7.10 CURL_VERSION_SSPI 7.13.2 CURL_VERSION_TLSAUTH_SRP 7.21.4 CURL_WAIT_POLLIN 7.28.0 CURL_WAIT_POLLOUT 7.28.0 CURL_WAIT_POLLPRI 7.28.0 CURL_WRITEFUNC_PAUSE 7.18.0 curl-7.35.0/docs/libcurl/curl_free.30000644000175000017500000000306112213173003014102 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_free 3 "12 Aug 2003" "libcurl 7.10" "libcurl Manual" .SH NAME curl_free - reclaim memory that has been obtained through a libcurl call .SH SYNOPSIS .B #include .sp .BI "void curl_free( char *" ptr " );" .ad .SH DESCRIPTION curl_free reclaims memory that has been obtained through a libcurl call. Use curl_free() instead of free() to avoid anomalies that can result from differences in memory management between your application and libcurl. .SH "SEE ALSO" .I curl_unescape(3) curl-7.35.0/docs/libcurl/curl_easy_unescape.30000644000175000017500000000440112213173003016004 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2008, 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. .\" * .\" ************************************************************************** .\" .TH curl_easy_unescape 3 "7 April 2006" "libcurl 7.15.4" "libcurl Manual" .SH NAME curl_easy_unescape - URL decodes the given string .SH SYNOPSIS .B #include .sp .BI "char *curl_easy_unescape( CURL *" curl ", char *" url ", int "inlength .BI ", int *" outlength " );" .ad .SH DESCRIPTION This function converts the given URL encoded input string to a "plain string" and returns that in an allocated memory area. All input characters that are URL encoded (%XX where XX is a two-digit hexadecimal number) are converted to their binary versions. If the \fBlength\fP argument is set to 0 (zero), \fIcurl_easy_unescape(3)\fP will use strlen() on the input \fIurl\fP string to find out the size. If \fBoutlength\fP is non-NULL, the function will write the length of the returned string in the integer it points to. This allows an escaped string containing %00 to still get used properly after unescaping. You must \fIcurl_free(3)\fP the returned string when you're done with it. .SH AVAILABILITY Added in 7.15.4 and replaces the old \fIcurl_unescape(3)\fP function. .SH RETURN VALUE A pointer to a zero terminated string or NULL if it failed. .SH "SEE ALSO" .I curl_easy_escape(3), curl_free(3), RFC 2396 curl-7.35.0/docs/libcurl/curl_multi_socket_action.html0000644000175000017500000002267012272124467020050 00000000000000 curl_multi_socket_action man page

NAME

curl_multi_socket_action - reads/writes available data given an action

SYNOPSIS

#include <curl/curl.h>

CURLMcode curl_multi_socket_action(CURLM * multi_handle,   curl_socket_t sockfd, int ev_bitmask,   int *running_handles);

DESCRIPTION

When the application has detected action on a socket handled by libcurl, it should call curl_multi_socket_action(3) with the sockfd argument set to the socket with the action. When the events on a socket are known, they can be passed as an events bitmask ev_bitmask by first setting ev_bitmask to 0, and then adding using bitwise OR (|) any combination of events to be chosen from CURL_CSELECT_IN, CURL_CSELECT_OUT or CURL_CSELECT_ERR. When the events on a socket are unknown, pass 0 instead, and libcurl will test the descriptor internally. It is also permissible to pass CURL_SOCKET_TIMEOUT to the sockfd parameter in order to initiate the whole process or when a timeout occurs.

At return, the integer running_handles points to will contain the number of running easy handles within the multi handle. When this number reaches zero, all transfers are complete/done. When you call curl_multi_socket_action(3) on a specific socket and the counter decreases by one, it DOES NOT necessarily mean that this exact socket/transfer is the one that completed. Use curl_multi_info_read(3) to figure out which easy handle that completed.

The curl_multi_socket_action(3) functions inform the application about updates in the socket (file descriptor) status by doing none, one, or multiple calls to the socket callback function set with the CURLMOPT_SOCKETFUNCTION option to curl_multi_setopt(3). They update the status with changes since the previous time the callback was called.

Get the timeout time by setting the CURLMOPT_TIMERFUNCTION option with curl_multi_setopt(3). Your application will then get called with information on how long to wait for socket actions at most before doing the timeout action: call the curl_multi_socket_action(3) function with the sockfd argument set to CURL_SOCKET_TIMEOUT. You can also use the curl_multi_timeout(3) function to poll the value at any given time, but for an event-based system using the callback is far better than relying on polling the timeout value.

CALLBACK DETAILS

The socket callback function uses a prototype like this

  int curl_socket_callback(CURL *easy, /* easy handle */   curl_socket_t s, /* socket */   int action, /* see values below */   void *userp, /* private callback pointer */   void *socketp); /* private socket pointer,   NULL if not   previously assigned with   curl_multi_assign(3) */

The callback MUST return 0.

The easy argument is a pointer to the easy handle that deals with this particular socket. Note that a single handle may work with several sockets simultaneously.

The s argument is the actual socket value as you use it within your system.

The action argument to the callback has one of five values:

CURL_POLL_NONE (0)

register, not interested in readiness (yet)

CURL_POLL_IN (1)

register, interested in read readiness

CURL_POLL_OUT (2)

register, interested in write readiness

CURL_POLL_INOUT (3)

register, interested in both read and write readiness

CURL_POLL_REMOVE (4)

unregister

The socketp argument is a private pointer you have previously set with curl_multi_assign(3) to be associated with the s socket. If no pointer has been set, socketp will be NULL. This argument is of course a service to applications that want to keep certain data or structs that are strictly associated to the given socket.

The userp argument is a private pointer you have previously set with curl_multi_setopt(3) and the CURLMOPT_SOCKETDATA option.

RETURN VALUE

CURLMcode type, general libcurl multi interface error code.

Before version 7.20.0: If you receive CURLM_CALL_MULTI_PERFORM, this basically means that you should call curl_multi_socket_action(3) again before you wait for more actions on libcurl's sockets. You don't have to do it immediately, but the return code means that libcurl may have more data available to return or that there may be more data to send off before it is "satisfied".

The return code from this function is for the whole multi stack. Problems still might have occurred on individual transfers even when one of these functions return OK.

TYPICAL USAGE

1. Create a multi handle

2. Set the socket callback with CURLMOPT_SOCKETFUNCTION

3. Set the timeout callback with CURLMOPT_TIMERFUNCTION, to get to know what timeout value to use when waiting for socket activities.

4. Add easy handles with curl_multi_add_handle()

5. Provide some means to manage the sockets libcurl is using, so you can check them for activity. This can be done through your application code, or by way of an external library such as libevent or glib.

6. Call curl_multi_socket_action(..., CURL_SOCKET_TIMEOUT, 0, ...) to kickstart everything. To get one or more callbacks called.

7. Wait for activity on any of libcurl's sockets, use the timeout value your callback has been told.

8, When activity is detected, call curl_multi_socket_action() for the socket(s) that got action. If no activity is detected and the timeout expires, call curl_multi_socket_action(3) with CURL_SOCKET_TIMEOUT.

AVAILABILITY

This function was added in libcurl 7.15.4, and is deemed stable since 7.16.0.

SEE ALSO

curl_multi_cleanup (3) curl_multi_init (3) curl_multi_fdset (3) curl_multi_info_read (3) the hiperfifo.c example

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/libcurl-errors.pdf0000644000175000017500000004133612272124474015535 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœµXÛRãH}ç+*æeä\£Ò]ûÆÐ&–Y³ÆÝ½ô!äkF–Ü’Ü ó ó+û{².’lCO¿l@ØRUååäÉ“õ…¹\0—~Ìß|sòÓ"fOí‰ËžN¾œõ™?ù†ý¼Ä }±|<Ñk‹=§>OR¶Üœˆ@p!B¶|>¹sÊâ!ß5åT6MÝ´Ÿÿó„™ï&S/HyšúŽ~È^ywòŸå/'S—{[ç89ÅÉ< ép?bË«çúlò#ŒÅSò0õaÐru⼟M–¿ŽLõ\¸1› »dÝqì¿LýÃòz%[VT½¡j£ÑÉS=OÔIïf·ç‹Ë›ååüzÿHõ–>øêÈåºhÙ&«Ø6{’8#/wtئn»SV<²ªîXV–§,£½ÈóP¹E ÌòåýÏÕô¢Äùpy5I=$ÈZ5ÀL`0ãó 9ÄÌY3¦C×·Õ…‘ÔÈ/;ÙÂö(3èTImʱ.¾#_kdŒ=¨ƒ=ØÅɰ³†Î®(»iA¨9 †$HeX­X á‘gékVªêûžéûCåÆè•Ì‹†od£"³~ìYOá …g­—uݽ¢eŒ ¥žu!ÖŒôû¶,ò¢CÆVE«W¸{âšEwjw°‘Îö ÅÃȵâ³}CJ4I ›™ˆ[ݬÐåM£$H×½lST¸Îš$Î*Øê•nlIKl;pêQ-Ñ îˆà¨5£¢&Â.eX¯Ãu× î§Çà=Ÿ¸zw½¼_ÌnçW€Žë|œõ®P pŒ!óíÛèuöïqúÜ !'´ý+ðxÐÓŒs~ľǭpè†rê„+ìWùu´#W:$Lnßà€¦þýel84ÄÀG|¹—fáÃÇ‘ºã Yù–¼Ù¾’°;e[“æWä©0Ên´["Ð ìùF$8øÎy5mŸßRgŠ,ËDÿßP¯ß5œÓ â tȾ~Gàšq×H|›%à|SwRï¹§YÃ6€á(v¨± 9ê%6tçóëëÙ9,6ø´†Žw1‚“>‹…QÅy]U2ÇàôyB•iº×mQhäw¾"*–7÷Ÿf—‹w÷·˜‰CÛg ¤õæJ³käó8þ‹2Kú2CؼA&&›g4“ÕôBÔ#X+•gA¨°i”*Òiy~s¸·É?-Gq‰¼Dø}htëHüñP3Žkû‚å²ÁD×týå¿™Ö0Œ:&AªšUïˆz0Ü€í¥é"àÚ'ºÎ E˜UOª™ ÉnšÁîybšƒ†Úbö~¤Rf÷gêƒSçü|v{{ÿnv}9{‡ZH‡ë°d¿ âC->IÔŸuº¡ggo/Ô½Lªi·*hôÈsÙªüÓXf…ç¯èO^r㘶;ˆñSn¡å<§ê”±Ú”BFCá8ß' ÐTÙ<^Ô{gЭÓ@üÍÅ8Q?² 1‹Fjá´… oìQ„îš®¤Z¨pëš]€ZôB4“ïûcK¾Vpîã¦ð³*TSÝ»è •o -à—³þ‰¾YªA #¡§š.Ý£~!ð†æŒOÊ\•mÆÖ%z#Övf…"“Guu1B8ìZÊQµ®e`žƒ,Òl™…C¤Qíú’E£d%Qìá(kIfREÑÄ{:ÜVØ›¸AB¬ºIò]°}}„ÑS«åAø]ò °²×tï¹X×ÔeÏÕ5éKÖ›¢ÌŽÆUšj¸ßh/7jqÑ-ÏPëGÍ<Û_œ¾Õ\D áEt½Ó ýÄ77™ª»@æz†e¾*Z Á‚Ú ÝM<ë Ö@íýmœ/ôm\³²p· ™JZÐ-ÉǤ!¾Ù’TDÓà¸%Qä¼Ô¶¤ÌÌy¦WèÉÌìM7ש¼Ò,ˆDÆ…}2º^Æ4tPÌEµ*ò¬³M ØÜU²—{ÊP¥ÿi€#U£ïz{5ÐOc«dì€sŠöX¢­|¿OÚ/c³G·í8ßs…^{½¸_A_Í–'ÿÄÏÿFD×endstream endobj 6 0 obj 2684 endobj 14 0 obj <> stream xœXÛnÛH}×W4æ%ÔÂâ°›÷‡Y@Ë3Ø‘"Ó ì…@“-‹;©ðÅó ÙÞª¾ðbÉÉÂìðÒ]}êÔ©SüL,“ Ôïd?ùyí“çzb‘çÉç 7‰ú•ìÉ¿"x À Ñv"ß¡ÄgÄm3I´ŸP‡š”º$:NŒ<{JÚ*Ÿñª*«úѰ§D]›Î˜šahò&9óìôßÑïÛ#3ø¥“Xôýýúf±¹ŠV›ùÔÆ%˜o¼¿XE›èúv±¼È£AÙàmÊÄÛ& (®`\¶UV<“¸ qÒdÓè?“!'×7]FC8–xÃUo|áä Ÿ³ðꛞmuϨUŒhEj^×YYã.Ë99N©eZsŒ8kpÇmY‘fÇá±ê‹ˆŽ¾ëõK‰Ý8} lÓrÕuŠDÁRæ›!Ó§¤¦íÑ ÉvŠð°B>rž"Èϼ!1䣨³'ÈXÅk8yŠ“¿È¶*÷}¶ð€ˆ,ä&®áxòP5ÇExÁu§¡ð˜oãi`Ë,C@7ÓèÆb7“r¿‹Ô$Q·ƒ‹‹g5ùo ›u<ãØa)x¬`òåýÍ%ÁG®¼ÿ:xcÍ>–0ñÐPÉ(×€!(L8Z7ÒxÊ Â E†:Š˜”û¡.;TcÐ3^¦zATj¨ ©â¢Þk÷˜¸ñ”qõ‚ÌŸß½¿¾–g„šð‚Ð=•Uü5æë©‡¸¡]Ïo6W×7â¼VqÓ<Œmpòù·b îT4ÀGEÝ"TZì„0µÞ•äãÌãjJØÚ÷ŒgÞ´. þz€lqQ¦À¹]|8€T(8†BýÀ¤6ëCðµ’«€6?ÀŽP"Å(U3›¹&(3ÿÚi”+Y2–þLuö7¿€5SŒ¥mÎÇL ¶mz#œ®l@5§qËÂKK^ïŒNôämö#în<q“ì"‡Š©Œ/YÙÖù yΤ|é %EHN£¨‡‚ewÝ΀3KZÙezo½*õ"Zw\ O _$õ(*¾îUüȳ*Å”AüBÈÞá:ï´‚ ]'ó èþÒ (÷9oøÅÖŒÿˆ{Ý/§Ž&ûb³X¯Å-èË5Êèëâ…‚Ÿ0ÏЭR,Ĥ­hQ?}ÄcQË1=Ýa¼ä˜V'ôÖ X#Zü¤"t³Vñ}Ù(:ã›`«W¯Æ+›Iq 4VhêæEÙçIì¡s =¡ÜŠÅ»Í¤‚óT*Ÿï™žåôGt-Ñq ¬?!:Bé-øF@:noÍ,W>^Dz0)»ìøh > À À%fõ˜ÕhbÒ,‰±‚Ú¢n“¼Ú¶ÍuÚж•[šÞI‡¦zPwÅ¿3ùý-ö[î×—"µ¶rd2µç\)¥R+³%’m‰vvÂ|Rpw>Óu0¿¾Y~ÀàŽ+ÊK^‡`TèHÞƒvoÑN™(Uâx¿ÐÊA0êAw)ê– %K¦CYI›š¾ÿ š>Q°ó?Á|¼ ѧõõ€õXû˜#$#æše¶ü¥àc%]uuÒ©ë˜îXù@ S•IÓ¡ y]µàÖÊ< mDÈËüÁ·$@ÇtDS ˜1db—;´jθQß7W° ƒ‹cµâ<—^æ-àîW7Ë©íJÌæ—À ßn9Raq‰º ÈA»¼Š p5,ª|žpÄuWS¤E{ÈËZßUgGe]iÓC ÈJ[›…‹¦ÛÄ7ýС×úhé"IórÈðØ/Ð¹ŠŒK.ÞES˜¯Â j8rÉï'¹½ 2ÄtŠÛíLµ}ë她­[±ÌTMœ«›‘ë~7:À@é…k>V·®s}=äq Ñn0«e樇 ;ÍÞz1¿T¬W„÷N ‰WznÄ4 W}¨J˜Mö@®Xèþ€Š#&vä{zQ¢§^½5Fà0¸¼ÚÜ.n—ëáü®ˆé:yköbÊ2Lªp4¡+ ¬wiËàãS9ø&zxFˆN%­øç–ƒkz5¯)&Ô­Bæ?-@Å•6ðg…‰Wƒ \ŸýÀ =ŠÔ :œö,ç/(Pb…PÄüuc€ˆøØ‚ƒ~ô#Öw\N5êžÝñ …N1 ”¦„3”Z®ëù”R žyùA|ü¸”_?Xp†[˯$¾jlW³'¸ÊìV\á4@tS)lk»RØâdÅIRV©dK„®Š«Öß±=èÉVÀ.Wt ^%^!õ;ñ²­3½ÑöÕ9*Yiо£>ר~ A‹’!Ifë (ãÖˆlhÃ…` ý¸ ½§Ó™pØËá`Æ÷0]F#ÁKÙÂ…WÇm÷Ü3´ép°É}?oêÁ+®ÃºÁLç-&Ïe)=•mìé²1?yQ¶Ï;§i…µ‚r¥çoÈ! ´&¹ã¯¿0á×_‡Ð¹h ˆÆßBüÌÐñVMµ`ÍÃïOµ÷w¨‰b$·éÉT«ó-žH¾“>‰±Gû4N¥Ýð‚IƒÁ¯ÍSÜGý`ûÿJªÝùr—€,@Ç6h,àéÃ@}Ó©ãBÏ,@u8Ó!æ~=3اÆHô‰Ág)G6œÝHQ6¤n8mŠÞ.÷ãg\> stream xœXÛrÛ8}÷W`ç%äTŒð~Ù—-Ù¦MdÉ+Ñ3“r¶T4I\‹¤CRq<ßÞÓ HQ±“lM¹[$€>Ý}ºû@Ÿ˜ÁMfÐúæ'oæ>ÛÔ'Ûœ|:1åK¦~¥9;‹±  ñú¤Ýc2ßb~hó dq~b:&7M—Å'·Ú.»K÷ÕîTTUYÕ5û£ÎÔ3ýÔrB†¶Ö¾d/¬Õÿÿvb{ìÿâ0ÉCÏoæ“h¹XL–ç³é4:—Ñ|®Ût˜åk³9Ã^·ÛÌMßgq*O1-:E=èñé°ôÄt¹z!¼ ã¹GkÉDUÞíDÎʈ*±bu™ Ýr¹aú¦ö¸•`YÁš­`€ñ&ž,Ø6)Võ6¹× †kZšàìƒnôQ+÷¬Én÷Äé}àÚ®–<@ºËîZ´¢h8-m¿&œ7¨­EÅ`’V :>·³sñw¥Œ®¤‘\Ôu²ô7 '5ËöeV4µ\ñ \®wÙfÛi^Vpá¼ÜïVìN°TTMö5MQ#¾_w‚­ËŠ¬Û¡Å=ÏU˜O[@Ꙥò–'Mýš=$Í–~‰*Ïê:+‹ú£NOëúáÒÊj…·ðŒ•¶æ20§2}踎g:Â8ºX^ÌtÛi“ÿÇt‚”'Ç£Wóhqs!¼›ZT·Z ¿W%òª=»¡J¥·EÙÇ•¨÷¹ çÓd_ËØ±úA¤ÙW<,׺åP&m]‹f˜×š•û ä Ô]¹/VIõ¤{jÇ >)—.Çøï|v3¹˜Æè á÷¡µx@8æó×!Ÿ=×ïÉb+²Ä&“™A¡»r¡Ï=¢L›µÏâèìl ƒŽ†Åãðx#T§kY³e„îŸoÞ´+^u§„´Ø÷¸i»ª¶nµæN·Ÿ‡š(¥ûò@Ëâ¡ßÁ ¼aK•QˆgWeÝ /܃HièjÄæƒÂK„BE ûtpÀ á­e+¸MÖ»pÇ O½X‰¢ÉÖOàÜQ„NmÍ¡ç°&¾ôûâ#É­eu“ÂÃÙE¶bO(ùt+Òûâìÿ’FWñœÓ“ ÙÈÇÔF×ËóÑt:ë;[¼<O/ˆ Á dV;iá蚥I!iœ#^9=¥¬š¤¶>6Û!Þß/µcX‹h4?·¼Ô}GSøSLµHªt «(󟼼™žÇãÙt ÿ$ßðmø9»‘pÌŒ]î‹TºEޝ©æ8¡Š?í3jáa¾°u·æ¨^¾ht6›ë®ŠA],Ï> =“ÉY»ÅàŽ¤°b¶Ä·õМ͠¯÷µCQÙÜèÚ§cµe~jÚ&·%~WV õ¢'dv·»KÒ{r®û^6û %Ã~Ihå/¬)»yÊÕˆø~ÿìc=š¿E·œÆaûY„µqшªHvíÈøæZðÍèš ­¾½o·Ú!ö¦Ê(bO.÷#u“„Ý¡ ?$U’ ˜Ò]·k•¦áq×~Ö.ÇÓ8š_ª²• ð-nØ}˜Û Ïâ«EÄ^Ô4ýžÂN'N!L\+ô=—^¡a™¦¡2Œ¡½Pù'©8DÅlÙ£]öý‡êŒe",‡ÖØ•}³)©d­=b›šòô£Ñ„ör/hîl3””Z/»8ŠphõÁ ê›jnŸÚvÀ}Ç;ÒZ!-‹BÈ|Õ¯ ö_³dµÂ\¬Û|Qf×ñ i°<ôHç'YÐ"ÅM°Ä·Ÿó3Ö1¥Pož6›-¯FÓ˜ˆã9ß‚²åwÙ2ø·1.Û.TcÞNctî}WÐB7•ˆý’¤MÞLZ€/~$‹ãh2b•¼åâÃ4Öq93L³ûOJf7©U÷*ÉfHò¾q‹]!zuS•¥XGÿ£}weh¨jCUu5µIªÉÔ]†ZßræA¿Ð®£h>ÐËߣùør|>ÒMmÔô4ER÷%Q@i­D^‚Oµ¨>ë¦b·¨^ càCê&X½8„Áäa‡Ådp b ÊbñŽå+—}-6¢m‹F 7Ê‚³‚nT³÷Ý(³ln¿àæÛ¡Ð‘ªG‹ß§oÉ3ë…òsm¥•§¸(µQÔ‡á^¬«2oo.ä½,!0;Á!ÔÄ2ìV³sÛC|ÔË×ÃäA§‡½Pwíöb9 ÙDõ iV¡bë&EÑá6¢‘š¸PøP¤`oa¹X©„[9Î7…‘j”ºªuþ€ëô%@4};žFK%”é~w:Ñ}®bZJô÷¸´zz@ïÅ&+„ ¡åˆaqDÔ/ïÜךƒÀAÛ5ÁÁn´H )] LHˆ^D1±>A¯A\ç0ÕÌoËór˜ §%Iiä·v›ë† .ˆ±GJR®Ýïš(ÍãÒ‘ÏGÓ ùý ‘ÓtÃöû×ýÛ0‹•$…hÔuÿž­’&á?™ÿ»¡ì{Çþ]YEŒ#‘µßç Ÿ€ZÆý¨ä7PÑàVp­¢DŠål]Ðç“S높„BùÚ•PÁ,Ýe˜vƒÓ2 ׉S·õ¶kª±ês †ÜB¿¶í®ªÍ߆ Ì>(.Ô–e˜íFT‹åw;lzÅ'ÿÆÏÿžÑdÄendstream endobj 20 0 obj 2264 endobj 24 0 obj <> stream xœ•WÛrÚH}ç+æmEÕ¢Õè®§+!Âo-Þ¢dim„dë'û ùèí¶pœ-—ËxnÝ}úôéæ(2% þˆ¿ÑqðÇÒ"ûr ýàa@ù&¢#yÀ‚Ý ¹C‰¥ËÑdÛ!Áq@u*Sjàq°‘Òä.ª‹tÄŠ"/Ê[I»±6©º#;Ž&5›äÂÙáßÁûf’ü1øJ“õrînW«ùvâ]_¹Kr+œ þáG©ŠG¥I^§qö®ª2x 4U6Á]ܬj\Wp•*²j+´ÙØH%#å=‹’,&Qr`ÅÐ0dE±4IæÞŒ,[¶ñˆš²Ý\:óh<Ôiâ.ùYaØQeÍ–ƒ[édšÊŽæØbÇTšF¦ Á²ˆd#]3VˆUò# +F¢0ËòŠÜ1ÖÕeU‚Ë1yLªù’åCÕ32Ÿ]*…÷¡gŽ¿j†4žn' ?pý`ëú“ÅÔóß°&=K‚@v,Ê÷Yò/جŠ0+wàË¢jp[§ÒøzëùŸ‡íνéöјÚ7æeü=H‡ÒÄ¥…ìkØaéÈ0ÓÛ4¦ILÀž®È 5°GÀ„€ÀЀŸŽsrPø7óæîÊûËݺN\wêNÑ%í9±6ÒÇð[r¬äG \R ÕMé[ÄXÌâŸ`½^5D™ -ieJc0ËMéýè—ì¡f%æv\¸GR&ð  µÙ°; }egtw8‹"Rºë ²eƒ*´-…0IÑa|”꺬9ˆíúStXÃäéèðvéÞx>÷Úèy ˜vSþ7ÀNç@ ’’e1ÉïYVIž¬urB9)pàplé1SÀj‡UØìqŽ“êwr7T©®ø>ÜávU…Gi-;\#ð´Ú™kQCFâN‹òîD#K6MÇQ6'htoœ°QšO•ïúï<ßZ{A•C­SnÍJ vR%ฉñ`vÝlŸdŒì†(Œªi·ÙéÑ©-©ÝN]ßkÌX}¶ªcºQ²âëêø´¢Kb–%(s˜:ÍÁ8¼2ŽÂ>Z2…Rž_ds´Üú‹®®ƒÙbÝоð ‚!¨\»¼F*dï ·„ÈöõöBØÜìµ»üˆ–zÒ‚Y“²D–Ýù]ÊŽÏŒuüÌXäÒý¸àJ‚çw;õV¶³õ%ËR.ņæ;'åh&aÄÐ:¦¸‹µâ×#õæs÷ݘ›£½>ç¥$(¼î1g]C“öáIÐÎ%!8ïDÚIF§®pþ›`ƒ÷¤K Xû"šßC X}5ß@ïhúSsòQ$¥k"Þôäõ´Ú[+4§½Ä¸0-XG™yÿ–”UI [fšÑLóÆt+­TWeêŠ4eçBª`’ø¼íË ÕoÒäaTá„sRiØÒ©¢¾’ˆ–úeͤŠ"[½|p÷–î'î“Ù×IEUc]VØf6¨n{ ðó SCV-E{•*ÜÏÞ¾ £/eÛs1«¯ “¦"8¦ þާÈ}tÞêz-OƒÈüó#fB¸zV‡7$Œ"V–¤Hö‡ª|#Ð_.>ÿliÛJ¿uIú›.Tæuá¨u˜›.ƒ®áüç¬ä¥(7t^§/kãju…æú£ÿ8#uÖMñMIå´¹þëâÈœ÷‰—§VLÄêjL~tëÆ¿Àm»í-Î<šª¶Ñ2‰Š·<@Lj۹½Íð,cQ£Áüa›âÝÔEóªøÂ}Z…,œÉJáG÷•ƒ¾AçÃŒ¨ m.BW­ö†ŽKn0ø?ÿo µ endstream endobj 25 0 obj 1516 endobj 29 0 obj <> stream xœXÛnÛ:}÷WpžŽtP³"ut\gŽO;µ•ÉÀm&ÑT–R]jäúѳ7IÝlOQ¤…‰ä¾­½ö¢¾‹2báŸþÝG×>y)Gy}1ù’èŸý‘ÜD° ÀÑóHíaÄçÄm„$:Ž˜Ã(c.‰N£G#MvûºHÇ¢(ò¢|2ì'“ègæ˜;! CÛP/É•µæ¢¿G¶GÆð?:€OòÐéÃz1ÛNLÇ2þ=™/É“°ÞZÆq­±É÷ßÌè¿#FÀKÜN-tñ42DE’’dyE ÞÉs^Rd‡…Øÿ '¹3ê2§ÛÈqR‘*IS’Tà2N]|³ÙõlW[2Ê_Zø"¤åL½x4¤½8;ª€ßÓ¥–ÅÎ(‰^Á­BTu‘‘}~èež¥ïú™8È Ç,piàm¨ÏE~D{×ÌÒ¥ïC; «˜Ø­ˆË÷maÚ¾Qvùíêé;4,íªNžʼޡ½31uê<¹¾=Σ¶6É—é{2&‡ƒ8$#>eåjϘs2òh 8–üLºRK»ä`ޝ{4ßlfëíl½6m@Wà:Æj.Ù0|4æeY‹‚ì_Åþy6òÜ  ÞèÌ5ã2&y™éÛè~{¿žEÛ[Ó·áÙ€\|BËÎ…e‹r¦0½ {áÅ Íu¨Ï=Þ@›3Ý9äBµEDQV§°­ G|W$†È{ËËúí-/*¹ö%‘ék‹bÙÔv<]B56±6<ÝdF7;eG1G4 U¼´ ðdõ´ËvàSÏg]ä¡ÅeHG‘U”ܲ ñ\§äô*2R—Iörmh¿mRÌ÷ê>ÚN6‘ 0µ ƒÕÝzöÅdÀÌñŒ‡¼’§ZÛ÷yÑZÐ.~ˆ÷­çpk£­Ë*?’Å|Óeö„IJª#|NíÐicRÔVÁ²êU•dz÷ Ö{A‰Ì“Í?$.ÉI¤)b‹[¿ÆÖÚô,#ÚÜo§›Ù‰lGªí^Aö]RãjÿJògÒì'ÓøN²ú¸üÐß°·™m6óÕòŠIïwMnDY&yFæÈNòó׆±‰úl²E:ÙÊ2€MÿŠÍ‡,ÞOo¼ÅE©Z ‰#MÊ öêà$ŸBý€´4†ÉE § ÙV<™¿ðjú×Ãò3öµÓµtpÅ—ék}4§é.:)¶ÔXÎLÓuUþ®Òv–«ítµ\Φæ|"‘ƨ-;•Ù6Œ9Î&jñqËúóÅäFño¨‰’AK0¿¥Þ'ãÔ·ÛÖ¶¨JE`k$Y%Š,N¡…œnŠÂPzáÔæmóœ:/4œ eò”db@4€p·ÝØðŒ>tÀ3F±3yR(OfJ༦ž·d÷ÞèP.ËZ5ËľB¸5lÅUö`U§µßŸ?,$“‰HRDÕI™¥0ö¿"4Ë¥Pd¿ù ßkQ‹¶vܵ¶mµ3ëJÅW7›ÕbÍþÄ”µÂ°™P ©9JECgÙeà éAzmꆗ4.Ó Jˆ†l˜_›òóô¢âå2êa#AÞ{õ‡qÌÚà#3g$OM™ˆq Aj0Ö@8™g9ÅàX‹Aö8®ÝL=RB#eX€è´X¡eªH”OdÏ£1Èàaöï0ŸCMÔUÀ\0ÅêRöÁ?9>E&Šd?P2R@âsIè•6.nb>Öi•¨ÆR Ãâ¶ï%“´” -“ƒ.Æ`è‘h1ŠþÔúPž²-+ˆ ô'Den:¨P}:÷šd Þ­d”I7ÏÚdôtûÝv:Y,¶w ˜WppÀŒh¾½Ÿ­oWë;ÀõøRÉ3^QyÒÂ=MQIkî“ ò-¥,0ì5p¤s¼ ‡Õq€ÇÀjõ…ˆ!«ïyMÊ×¼4!ÅžI„( dB_ýªŒ½AÖóâxE‡°ƒß€>–¢#¤v×,›¯/™ìy]ÁøÐelƒ—ï¥Âõ$f@¤@CO°Þ]’#ð R+Èê$D†ªGêÕž ;½Æ¦ëñ~;(u€‚Ôîeô@5EÇ€·äœ¶Û‡‰0¹¤Æ¨  › ƒ¡>H& 1·eý]_¼÷®$bLc:DÆôWq”*‚³ëðØà’’®lgcârHEÝQ€Çn1Þôþ˜»µÜó–ß®>Œ5!÷n$€Ý쥔´ó3ô‚®›öh“¿&ËOrØ^vÅ£”õoq þŒ!'¯@j©hº#†ìpݸqšÀm׋þ¯9³>›l¾v.ð+7 Kغ.‚'PÉF¬åÕ4…ݨ-ÊðÕ8„[ ^®|}Íû'â'˜ææmÔaýÏ0Ѐjòchè Äàóe4[/a¨+@MíÕ‘"ÕúåýSµ=Žgü„Ñç”ä¹] Å,ulýRRrŸ„¶ Ýuù¯ßDìf5ý> stream xœ¥UÛŽÛ6}×Wy õ ./².Nm NvíÔѦ(Ö…Á•¸¶YÚ•¨,üùèIÉ^×A ´0 AœáèÌ™ÃÃD CÔü†g~ðnÖ1ÚuE;ïÅc6ˆ†G~@2HHÌBöä¹= ÅÅ© IвƒÇBF› ìÕ{ÀUù˜÷m¨¶mÚnƒÅÆGÚð0%i*° ¢Ÿäúf=¡þY˜lÑ_î×·wÛûå§åÊ!I“áß—ÛÕçl±Z¢ ŽÞldÜlĦðöÐWºÜvJ7ÏzƒÉk©÷¨¯»þù¹iµ*ʦ†Ó¢€×²F1aBÁì›Ø‚IlI‡b:›ÍgÛéíz>™N óÜcœ’ÉÈ1™l° Q„ŽëñP6É ) B„¦M<­‘’Ýíe]T ɪU²8"i‘éIdûã¯öë”’8‰\}SÊŽËI­ÕáY»­;¥‡:u*ojX-ŠŒ[Tc­˜­dœ0ýf‚H:1j@—ô|ù5o åGÍœ‡2¡®Õl¯Ð»n/[õ8ת}2{bA&qÂ\3&Y¸ñ˺-« µJ÷m =œ¿eº+ë¢Ì¥†¤½‚(ÐhRFi:h€8 k'úÛ®¯ùvõ &CåoD=~Ô0¶Ïm“+3Íõ]/+r¥Ö‡S­öȤ<ÆÓÙùȰë#ú+k[ˆnEÍ9¦¿Ë“¢SÂ8‚.`Nüé½úÀ1eadø,»Î©OôŸú:79Ä~5ˆb¡ȕ|æÛÅr{ÿeùUûF5V4¨yü¦rÊÙñÖº:š³ÛwꟘX,¿úÌ’!ðôv1C—–óÿi¸çÈ0²øïd,Wwó;€þ‹¼l4RuÓïöè M{¼d_ºÒc ŒÆ ¸iÂZ™9ó•|¬.Í!â„3ÊŸ9;ãdiÀYH’Ÿò®Rœýó(Á÷‹[?…­,Š`}a9¹šØ|q´‹V½ôª3~fX.ëœá¾*P <<*T4µ‚g.A–c¸\Z ¬›ÞèÂ$¼w~™ª0Õ|ž­c½Gîè""º ¸åиêw¤Î¾Ûò“ñHõ^jv«Ë¼¯d‹ž” œ"9#©H.ÍÜLÁ Û¹¼„¸8k\6¤boÄñ‚5)0í77‡Y1^5ìã)ƒf@^.öÈ)sEJx<îˆÌÒ<ó~ƒß_€Ä%Êendstream endobj 35 0 obj 993 endobj 4 0 obj <> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 18 0 obj <> /Contents 19 0 R >> endobj 23 0 obj <> /Contents 24 0 R >> endobj 28 0 obj <> /Contents 29 0 R >> endobj 33 0 obj <> /Contents 34 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R 18 0 R 23 0 R 28 0 R 33 0 R ] /Count 6 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 21 0 obj <> endobj 22 0 obj <> endobj 26 0 obj <> endobj 27 0 obj <> endobj 31 0 obj <> endobj 32 0 obj <> endobj 36 0 obj <> endobj 37 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 38 0 obj <> endobj 39 0 obj <>stream 2014-01-29T08:09:47+01:00 2014-01-29T08:09:47+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 40 0000000000 65535 f 0000013766 00000 n 0000016010 00000 n 0000013672 00000 n 0000012702 00000 n 0000000015 00000 n 0000002769 00000 n 0000013831 00000 n 0000014436 00000 n 0000014371 00000 n 0000014303 00000 n 0000013872 00000 n 0000013902 00000 n 0000012862 00000 n 0000002789 00000 n 0000005342 00000 n 0000013952 00000 n 0000013982 00000 n 0000013024 00000 n 0000005363 00000 n 0000007699 00000 n 0000014023 00000 n 0000014053 00000 n 0000013186 00000 n 0000007720 00000 n 0000009308 00000 n 0000014083 00000 n 0000014113 00000 n 0000013348 00000 n 0000009329 00000 n 0000011596 00000 n 0000014143 00000 n 0000014173 00000 n 0000013510 00000 n 0000011617 00000 n 0000012682 00000 n 0000014223 00000 n 0000014253 00000 n 0000014518 00000 n 0000014587 00000 n trailer << /Size 40 /Root 1 0 R /Info 2 0 R /ID [<262C6C117F0848E7B08A07B09E68FF9A><262C6C117F0848E7B08A07B09E68FF9A>] >> startxref 16164 %%EOF curl-7.35.0/docs/libcurl/curl_easy_init.30000644000175000017500000000437712213173003015160 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_easy_init 3 "4 March 2002" "libcurl 7.8.1" "libcurl Manual" .SH NAME curl_easy_init - Start a libcurl easy session .SH SYNOPSIS .B #include .BI "CURL *curl_easy_init( );" .SH DESCRIPTION This function must be the first function to call, and it returns a CURL easy handle that you must use as input to other easy-functions. curl_easy_init initializes curl and this call \fBMUST\fP have a corresponding call to \fIcurl_easy_cleanup(3)\fP when the operation is complete. If you did not already call \fIcurl_global_init(3)\fP, \fIcurl_easy_init(3)\fP does it automatically. This may be lethal in multi-threaded cases, since \fIcurl_global_init(3)\fP is not thread-safe, and it may result in resource problems because there is no corresponding cleanup. You are strongly advised to not allow this automatic behaviour, by calling \fIcurl_global_init(3)\fP yourself properly. See the description in \fBlibcurl\fP(3) of global environment requirements for details of how to use this function. .SH RETURN VALUE If this function returns NULL, something went wrong and you cannot use the other curl functions. .SH "SEE ALSO" .BR curl_easy_cleanup "(3), " curl_global_init "(3), " curl_easy_reset "(3)" curl-7.35.0/docs/libcurl/libcurl-errors.html0000644000175000017500000005503312272124467015731 00000000000000 libcurl-errors man page

NAME

libcurl-errors - error codes in libcurl

DESCRIPTION

This man page includes most, if not all, available error codes in libcurl. Why they occur and possibly what you can do to fix the problem are also included.

CURLcode

Almost all "easy" interface functions return a CURLcode error code. No matter what, using the curl_easy_setopt(3) option CURLOPT_ERRORBUFFER is a good idea as it will give you a human readable error string that may offer more details about the cause of the error than just the error code. curl_easy_strerror(3) can be called to get an error string from a given CURLcode number.

CURLcode is one of the following:

CURLE_OK (0)

All fine. Proceed as usual.

CURLE_UNSUPPORTED_PROTOCOL (1)

The URL you passed to libcurl used a protocol that this libcurl does not support. The support might be a compile-time option that you didn't use, it can be a misspelled protocol string or just a protocol libcurl has no code for.

CURLE_FAILED_INIT (2)

Very early initialization code failed. This is likely to be an internal error or problem, or a resource problem where something fundamental couldn't get done at init time.

CURLE_URL_MALFORMAT (3)

The URL was not properly formatted.

CURLE_NOT_BUILT_IN (4)

A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. This means that a feature or option was not enabled or explicitly disabled when libcurl was built and in order to get it to function you have to get a rebuilt libcurl.

CURLE_COULDNT_RESOLVE_PROXY (5)

Couldn't resolve proxy. The given proxy host could not be resolved.

CURLE_COULDNT_RESOLVE_HOST (6)

Couldn't resolve host. The given remote host was not resolved.

CURLE_COULDNT_CONNECT (7)

Failed to connect() to host or proxy.

CURLE_FTP_WEIRD_SERVER_REPLY (8)

After connecting to a FTP server, libcurl expects to get a certain reply back. This error code implies that it got a strange or bad reply. The given remote server is probably not an OK FTP server.

CURLE_REMOTE_ACCESS_DENIED (9)

We were denied access to the resource given in the URL. For FTP, this occurs while trying to change to the remote directory.

CURLE_FTP_ACCEPT_FAILED (10)

While waiting for the server to connect back when an active FTP session is used, an error code was sent over the control connection or similar.

CURLE_FTP_WEIRD_PASS_REPLY (11)

After having sent the FTP password to the server, libcurl expects a proper reply. This error code indicates that an unexpected code was returned.

CURLE_FTP_ACCEPT_TIMEOUT (12)

During an active FTP session while waiting for the server to connect, the CURLOPT_ACCEPTTIMOUT_MS (or the internal default) timeout expired.

CURLE_FTP_WEIRD_PASV_REPLY (13)

libcurl failed to get a sensible result back from the server as a response to either a PASV or a EPSV command. The server is flawed.

CURLE_FTP_WEIRD_227_FORMAT (14)

FTP servers return a 227-line as a response to a PASV command. If libcurl fails to parse that line, this return code is passed back.

CURLE_FTP_CANT_GET_HOST (15)

An internal failure to lookup the host used for the new connection.

CURLE_FTP_COULDNT_SET_TYPE (17)

Received an error when trying to set the transfer mode to binary or ASCII.

CURLE_PARTIAL_FILE (18)

A file transfer was shorter or larger than expected. This happens when the server first reports an expected transfer size, and then delivers data that doesn't match the previously given size.

CURLE_FTP_COULDNT_RETR_FILE (19)

This was either a weird reply to a 'RETR' command or a zero byte transfer complete.

CURLE_QUOTE_ERROR (21)

When sending custom "QUOTE" commands to the remote server, one of the commands returned an error code that was 400 or higher (for FTP) or otherwise indicated unsuccessful completion of the command.

CURLE_HTTP_RETURNED_ERROR (22)

This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server returns an error code that is >= 400.

CURLE_WRITE_ERROR (23)

An error occurred when writing received data to a local file, or an error was returned to libcurl from a write callback.

CURLE_UPLOAD_FAILED (25)

Failed starting the upload. For FTP, the server typically denied the STOR command. The error buffer usually contains the server's explanation for this.

CURLE_READ_ERROR (26)

There was a problem reading a local file or an error returned by the read callback.

CURLE_OUT_OF_MEMORY (27)

A memory allocation request failed. This is serious badness and things are severely screwed up if this ever occurs.

CURLE_OPERATION_TIMEDOUT (28)

Operation timeout. The specified time-out period was reached according to the conditions.

CURLE_FTP_PORT_FAILED (30)

The FTP PORT command returned error. This mostly happens when you haven't specified a good enough address for libcurl to use. See CURLOPT_FTPPORT.

CURLE_FTP_COULDNT_USE_REST (31)

The FTP REST command returned error. This should never happen if the server is sane.

CURLE_RANGE_ERROR (33)

The server does not support or accept range requests.

CURLE_HTTP_POST_ERROR (34)

This is an odd error that mainly occurs due to internal confusion.

CURLE_SSL_CONNECT_ERROR (35)

A problem occurred somewhere in the SSL/TLS handshake. You really want the error buffer and read the message there as it pinpoints the problem slightly more. Could be certificates (file formats, paths, permissions), passwords, and others.

CURLE_BAD_DOWNLOAD_RESUME (36)

The download could not be resumed because the specified offset was out of the file boundary.

CURLE_FILE_COULDNT_READ_FILE (37)

A file given with FILE:// couldn't be opened. Most likely because the file path doesn't identify an existing file. Did you check file permissions?

CURLE_LDAP_CANNOT_BIND (38)

LDAP cannot bind. LDAP bind operation failed.

CURLE_LDAP_SEARCH_FAILED (39)

LDAP search failed.

CURLE_FUNCTION_NOT_FOUND (41)

Function not found. A required zlib function was not found.

CURLE_ABORTED_BY_CALLBACK (42)

Aborted by callback. A callback returned "abort" to libcurl.

CURLE_BAD_FUNCTION_ARGUMENT (43)

Internal error. A function was called with a bad parameter.

CURLE_INTERFACE_FAILED (45)

Interface error. A specified outgoing interface could not be used. Set which interface to use for outgoing connections' source IP address with CURLOPT_INTERFACE.

CURLE_TOO_MANY_REDIRECTS (47)

Too many redirects. When following redirects, libcurl hit the maximum amount. Set your limit with CURLOPT_MAXREDIRS.

CURLE_UNKNOWN_OPTION (48)

An option passed to libcurl is not recognized/known. Refer to the appropriate documentation. This is most likely a problem in the program that uses libcurl. The error buffer might contain more specific information about which exact option it concerns.

CURLE_TELNET_OPTION_SYNTAX (49)

A telnet option string was Illegally formatted.

CURLE_PEER_FAILED_VERIFICATION (51)

The remote server's SSL certificate or SSH md5 fingerprint was deemed not OK.

CURLE_GOT_NOTHING (52)

Nothing was returned from the server, and under the circumstances, getting nothing is considered an error.

CURLE_SSL_ENGINE_NOTFOUND (53)

The specified crypto engine wasn't found.

CURLE_SSL_ENGINE_SETFAILED (54)

Failed setting the selected SSL crypto engine as default!

CURLE_SEND_ERROR (55)

Failed sending network data.

CURLE_RECV_ERROR (56)

Failure with receiving network data.

CURLE_SSL_CERTPROBLEM (58)

problem with the local client certificate.

CURLE_SSL_CIPHER (59)

Couldn't use specified cipher.

CURLE_SSL_CACERT (60)

Peer certificate cannot be authenticated with known CA certificates.

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_USE_SSL_FAILED (64)

Requested FTP SSL level failed.

CURLE_SEND_FAIL_REWIND (65)

When doing a send operation curl had to rewind the data to retransmit, but the rewinding operation failed.

CURLE_SSL_ENGINE_INITFAILED (66)

Initiating the SSL Engine failed.

CURLE_LOGIN_DENIED (67)

The remote server denied curl to login (Added in 7.13.1)

CURLE_TFTP_NOTFOUND (68)

File not found on TFTP server.

CURLE_TFTP_PERM (69)

Permission problem on TFTP server.

CURLE_REMOTE_DISK_FULL (70)

Out of disk space on the server.

CURLE_TFTP_ILLEGAL (71)

Illegal TFTP operation.

CURLE_TFTP_UNKNOWNID (72)

Unknown TFTP transfer ID.

CURLE_REMOTE_FILE_EXISTS (73)

File already exists and will not be overwritten.

CURLE_TFTP_NOSUCHUSER (74)

This error should never be returned by a properly functioning TFTP server.

CURLE_CONV_FAILED (75)

Character conversion failed.

CURLE_CONV_REQD (76)

Caller must register conversion callbacks.

CURLE_SSL_CACERT_BADFILE (77)

Problem with reading the SSL CA cert (path? access rights?)

CURLE_REMOTE_FILE_NOT_FOUND (78)

The resource referenced in the URL does not exist.

CURLE_SSH (79)

An unspecified error occurred during the SSH session.

CURLE_SSL_SHUTDOWN_FAILED (80)

Failed to shut down the SSL connection.

CURLE_AGAIN (81)

Socket is not ready for send/recv wait till it's ready and try again. This return code is only returned from curl_easy_recv(3) and curl_easy_send(3) (Added in 7.18.2)

CURLE_SSL_CRL_BADFILE (82)

Failed to load CRL file (Added in 7.19.0)

CURLE_SSL_ISSUER_ERROR (83)

Issuer check failed (Added in 7.19.0)

CURLE_FTP_PRET_FAILED (84)

The FTP server does not understand the PRET command at all or does not support the given argument. Be careful when using CURLOPT_CUSTOMREQUEST, a custom LIST command will be sent with PRET CMD before PASV as well. (Added in 7.20.0)

CURLE_RTSP_CSEQ_ERROR (85)

Mismatch of RTSP CSeq numbers.

CURLE_RTSP_SESSION_ERROR (86)

Mismatch of RTSP Session Identifiers.

CURLE_FTP_BAD_FILE_LIST (87)

Unable to parse FTP file list (during FTP wildcard downloading).

CURLE_CHUNK_FAILED (88)

Chunk callback reported error.

CURLE_NO_CONNECTION_AVAILABLE (89)

(For internal use only, will never be returned by libcurl) No connection available, the session will be queued. (added in 7.30.0)

CURLE_OBSOLETE*

These error codes will never be returned. They were used in an old libcurl version and are currently unused.

CURLMcode

This is the generic return code used by functions in the libcurl multi interface. Also consider curl_multi_strerror(3).

CURLM_CALL_MULTI_PERFORM (-1)

This is not really an error. It means you should call curl_multi_perform(3) again without doing select() or similar in between. Before version 7.20.0 this could be returned by curl_multi_perform(3), but in later versions this return code is never used.

CURLM_OK (0)

Things are fine.

CURLM_BAD_HANDLE (1)

The passed-in handle is not a valid CURLM handle.

CURLM_BAD_EASY_HANDLE (2)

An easy handle was not good/valid. It could mean that it isn't an easy handle at all, or possibly that the handle already is in used by this or another multi handle.

CURLM_OUT_OF_MEMORY (3)

You are doomed.

CURLM_INTERNAL_ERROR (4)

This can only be returned if libcurl bugs. Please report it to us!

CURLM_BAD_SOCKET (5)

The passed-in socket is not a valid one that libcurl already knows about. (Added in 7.15.4)

CURLM_UNKNOWN_OPTION (6)

curl_multi_setopt() with unsupported option (Added in 7.15.4)

CURLM_ADDED_ALREADY (7)

An easy handle already added to a multi handle was attempted to get added a second time. (Added in 7.32.1)

CURLSHcode

The "share" interface will return a CURLSHcode to indicate when an error has occurred. Also consider curl_share_strerror(3).

CURLSHE_OK (0)

All fine. Proceed as usual.

CURLSHE_BAD_OPTION (1)

An invalid option was passed to the function.

CURLSHE_IN_USE (2)

The share object is currently in use.

CURLSHE_INVALID (3)

An invalid share object was passed to the function.

CURLSHE_NOMEM (4)

Not enough memory was available. (Added in 7.12.0)

CURLSHE_NOT_BUILT_IN (5)

The requested sharing could not be done because the library you use don't have that particular feature enabled. (Added in 7.23.0)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_multi_init.pdf0000644000175000017500000000653712272124473015774 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ•TÙjÛ@}×W\èC¥MfÑJK!Mýàb;©-JR‚"--Ž–˜ü}ØNÜBHb–sÎ=÷Ì<% ¨z†oRçs6Aac<LOÂðI øá‚@ Dk£ßÃÀçà‡‚!D…Á%Ü…hgܘIWçwE—·Ù]Vfí­)n-ȳ{5nÙÜ¥„RßœÆeçpj±õ+úfØÈ;Aê©Iè*váA41ÌÙ…õÕâ,s‰ T­ s:²¢ßZ9%õÁf\MS¥ïµ<°!©eÜJˆAB—«\ö@Ì6RÛÌ#fZüœ]]/Æ‹ý²AÝÀe¾ËÊ$ïV>)Âsõ"égµœ;º„Ëå|2…o €[ë#÷Åå||¯fÇåîéq…ÐåFiÖÀº+“6«J¨eÛÕeƒµöô}­ÐVp/¡kä â²rÛµj,ÎshS ¾êÞûª9ƒ¦*d›²Q*ïÄ D„¾æ­åZÖ5*œæ•¹H¡wÃ6©5ϪJºB–m¬héºG‰R2]."ÜÞ`6˜«š/<‡øœ÷ݧĸU3¥JG„ z2R¡ªf[•+[-°E/ðŽ3’•›ž³­z‡,v8q ƒÎ%¹Ä8oûôµ$äÄ Â`زKe_iµ•µ®°Ä¤*¶¹l%y›9æão¸ïý9EËù ~XL8X3/&Ë‘>1§r`Ž×Èw*³åd2´0UåîÐwØÕþb‹à©êв¬Z‹ƒ¨ª_К’Éh“ÅÕ_É[ý âÅ?mðÙ1só(?lÊ&¯îã\Ÿ§c4Ï'~ð¿h2nžNaÑC%î»ÄqÁvi0Ô?\{à“¸úð\N]åWÀ¦/QEãÄ^`\')pJym`À½ç-jdßñù‰Ö”endstream endobj 6 0 obj 705 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <>stream 2014-01-29T08:09:46+01:00 2014-01-29T08:09:46+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 14 0000000000 65535 f 0000001028 00000 n 0000002836 00000 n 0000000969 00000 n 0000000809 00000 n 0000000015 00000 n 0000000790 00000 n 0000001093 00000 n 0000001347 00000 n 0000001282 00000 n 0000001214 00000 n 0000001134 00000 n 0000001164 00000 n 0000001413 00000 n trailer << /Size 14 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 2990 %%EOF curl-7.35.0/docs/libcurl/curl_easy_unescape.pdf0000644000175000017500000001005412272124474016431 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœVioÛFý®_1H„ ¬õ\hQ@I@…b§²İ‹€¦V ŠTxÄu~Ctg—§…KÞkÞ¼yóv¿% ¨þ4ßÑnt¹ð`SŒ(lFßFÌLBóíàÝøz`¹Õ{x¼@?€ånÄ%=ʓ¯*,ž¿V©*¢p¯,ñ`C?ê){Ì%%”zÖÇ0­Â^Xoÿ¹ü}4Æcž!€@j Â…å|d]Mì7ˆg™$2ˆk¹Y§öò¯bN‰C=3®§©Fy$Œáv1‡•в•* Ü*ØÄú ÄÀ¤ âzÄs› ß•žãÄÌ„ûï4Si¡§j\Œœi&ÊÛL Š\fMæ·SÃVwwŸÞ‡ÖdßWÜ!ë+ª•‹*2׌vÀÿvè’e_­,ÝM¯µÖ×6£V'jEš²céÍ郗Ùt “ùÍõ_¨ ®I†àgð‚Ü.`ñá=p¸GÂ×§ ß©M¹~>7U¼o8õñùØÚ‹79O޵Ïã8¥®Ù*ДD»‡é¡érô~þmð&dendstream endobj 6 0 obj 1329 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:48+01:00 2014-01-29T08:09:48+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001653 00000 n 0000003533 00000 n 0000001594 00000 n 0000001434 00000 n 0000000015 00000 n 0000001414 00000 n 0000001718 00000 n 0000001972 00000 n 0000001907 00000 n 0000001839 00000 n 0000001759 00000 n 0000001789 00000 n 0000002054 00000 n 0000002110 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [<884863FDDA6E639AA2809316D1E05212><884863FDDA6E639AA2809316D1E05212>] >> startxref 3687 %%EOF curl-7.35.0/docs/libcurl/curl_easy_perform.30000644000175000017500000000502112213173003015652 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_easy_perform 3 "5 Mar 2001" "libcurl 7.7" "libcurl Manual" .SH NAME curl_easy_perform - Perform a file transfer .SH SYNOPSIS .B #include .sp .BI "CURLcode curl_easy_perform(CURL *" handle ");" .ad .SH DESCRIPTION This function is called after the init and all the \fIcurl_easy_setopt(3)\fP calls are made, and will perform the transfer as described in the options. It must be called with the same .I handle as input as the curl_easy_init call returned. You can do any amount of calls to \fIcurl_easy_perform(3)\fP while using the same handle. If you intend to transfer more than one file, you are even encouraged to do so. libcurl will then attempt to re-use the same connection for the following transfers, thus making the operations faster, less CPU intense and using less network resources. Just note that you will have to use \fIcurl_easy_setopt(3)\fP between the invokes to set options for the following curl_easy_perform. You must never call this function simultaneously from two places using the same handle. Let the function return first before invoking it another time. If you want parallel transfers, you must use several curl handles. .SH RETURN VALUE 0 means everything was ok, non-zero means an error occurred as .I defines. If the CURLOPT_ERRORBUFFER was set with .I curl_easy_setopt there will be a readable error message in the error buffer when non-zero is returned. .SH "SEE ALSO" .BR curl_easy_init "(3), " curl_easy_setopt "(3), " curl-7.35.0/docs/libcurl/curl_global_cleanup.30000644000175000017500000000406112213173003016131 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_global_cleanup 3 "17 Feb 2006" "libcurl 7.8" "libcurl Manual" .SH NAME curl_global_cleanup - global libcurl cleanup .SH SYNOPSIS .B #include .sp .BI "void curl_global_cleanup(void);" .ad .SH DESCRIPTION This function releases resources acquired by \fBcurl_global_init(3)\fP. You should call \fIcurl_global_cleanup(3)\fP once for each call you make to \fIcurl_global_init(3)\fP, after you are done using libcurl. \fBThis function is not thread safe.\fP You must not call it when any other thread in the program (i.e. a thread sharing the same memory) is running. This doesn't just mean no other thread that is using libcurl. Because \fBcurl_global_cleanup(3)\fP calls functions of other libraries that are similarly thread unsafe, it could conflict with any other thread that uses these other libraries. See the description in \fBlibcurl(3)\fP of global environment requirements for details of how to use this function. .SH "SEE ALSO" .BR curl_global_init "(3), " .BR libcurl "(3), " curl-7.35.0/docs/libcurl/curl_multi_cleanup.pdf0000644000175000017500000000734412272124472016454 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ•VÛnã6}×W ЇÊEÄIÝØÒÔÙ&ñÖV I(«U¤¬.1ü÷RÔ-Ùì¢0 ræÌ™33þ .¡àªùNŸ¬ÛË…Gë³EµÌWú¿Æx R/â«¿C!d N"ñ“E)#þ:X7vÚÕÅÝSW´ù]ZȤìžom~»‚"¿W¦•Ã|—¸nh_¢-)àó«¿ã–ãFÑoŠ ÂWxñ…e_®¾GÌh¥>ñG\qfÙ—ëUüÏ 1s‰ç†àP¦Ìî{(Á´¨ Yµb¾}(!}Ù4yUjD qh@"w÷×ÕæÓî|×G&º>¢#ÛßåeZt™„ŸUôêAö¿¨ãÌÓ ]o/.Ó O|‰Ðfø¡½Oʬp»ú Iø ªßÖ»³íù§ø|sµ¤e†=®h±ÏT¬ ôµ|ªÔ¬õÍ#<Ôðü"•‘O]N-AX$"ϛ䠬º: ÅÁ}a,û abÛ$ý—Ày‹œËʪ…‡ZJ¨jh«.Ý#Š!ÓeŽ<"ÂÐ8:æcJ SBé e¦-¨IŸ»­Ê‘é_òLÉN&ÍzÈKŠºæ †ìU Çc!ê–å<$=8Á"ƒÁÐl®:í„.""†ôåâÖ’µc3]b$¢%ž:àÛ¼( ”2C‚à^öŠÍ¿IÙ I8@è-Ž‹xœ:’bŸts 1È`hòòÚ½„®A½p¨k”P޵R™Ëî7INPB§=x*ðßðÇ0>ã#x‰ªŽB1±¢grŠ’Éd ÕƒvÉ#Ÿ°-ZÞÖðTZ¨îf_uE†þ¨»h6u†y2K–rÂGÂs£^qõ=[õ‰ XFʱ+LkNSl6<±FòïåCUK#<ƒ=NÑ죜—Gp1s®Ý¤V2ÀÜPÝsïKOKV5L@ÁQó¯1gô7ÏÐ#|PÚWÊ9+#Vxccy*˜"8)±…X@Æ£¼ÃýŠ A¸ðm™jjúù€4ŽUµQ²½¢å³ÄGÙG@9¦RëqÖ¶«‘EU>béÓª,eÚêÎÐ"À6Æ¡à-E \ô³§÷1/?ÿfùßÛm¯èÁq¥¥iŸÙa/qÚ¯&ªâ›yKÑÕ8Œ^&1,‡F6-œqxœbÚ7öv_o¯àÏå8CjŸ^\¯_©sÚ7³UÔŸå <ÊRÖ86Í7$æe+ë¥}Á‚ÈN°H²®+ULØ”ÐtiŠëó¤_^w›ßUÕjÙv5ê•|s¥®×pz±Û¼»RgÉ˼]"ðˆç’tN–~PøtšØo”¿tF8zƪþw_æÎÝè’³ $¸#pÉx&÷éâÏtÊ\_qÕ; —óÙÈ'€Ië“áºêÿ^¸d\@T½YÇÖøù¯ì-endstream endobj 6 0 obj 1093 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <>stream 2014-01-29T08:09:46+01:00 2014-01-29T08:09:46+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 14 0000000000 65535 f 0000001417 00000 n 0000003225 00000 n 0000001358 00000 n 0000001198 00000 n 0000000015 00000 n 0000001178 00000 n 0000001482 00000 n 0000001736 00000 n 0000001671 00000 n 0000001603 00000 n 0000001523 00000 n 0000001553 00000 n 0000001802 00000 n trailer << /Size 14 /Root 1 0 R /Info 2 0 R /ID [<7A097C4641A9F6532DD4260A22CD1D8C><7A097C4641A9F6532DD4260A22CD1D8C>] >> startxref 3379 %%EOF curl-7.35.0/docs/libcurl/libcurl-share.pdf0000644000175000017500000001151412272124473015315 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ¥XÛrÛF}çWÌæ%`ŠœÅ ÀÌ£b3e§)+»咷\8“€b´ß_ÙÜî¹àBËÊÖT¦ Ì¥çôéÓgø; )#!þ¸Ïâ0ûû]JÛYHg¿Ï˜yIÜGq ?f0@âƒl;³sI9IUD¥"ÙaÆxLÓ8&ÙyìˇâÔì—í.oô§ ú4'îÑ<ûmÆ™¢aÃÙöà f )«N7["bÊ’Û!ã•óB“¯WÇ)ËÂÂ$+ PRc¬KžÊyL–Q‚‹7W8:Ä,¦±Šì&Á/+|>’‡T„)Y2>„9Ù™ü—ìjsãj)l…Ì.wœ»9à>Íÿýl÷ã±ÙjÒí4™[Q%ã(Æ#š)Óc°ˆÁòNB¥‰÷íjýæîý¯ÙûÛ›iàpN4•žíÊ–Ào^‘ÚÅLÐBÒDxžt¢\*)Ü‹æ©4¯"Š´ÈEýAëy…4TAµ3c&Ìâ\RɹÈì\¦>“nºš¤aÌ\¶±>Afˆ{1œÆ¡ç²A.ÉÃBÈý¬ž8eEžëSCÞcS?6ù¡¥$Ûi˜Œ ´G]”äW"Å€8›2à˜?ê–lë†è¼Ø‘í©*º²®ÈAWø©7¸ .I 3É®gÙ÷ÁÕ~ßnqÌké7áýçs&ð±`ásÙíø³™G_ ¦A78ÞþøóêMöþŸ«õ·øq¼x! Á"Åy+‡,VAÌÙl †®&ºÊövVY=’zK6y—“ݵ®L€ä»]^möºýî[Aö,¾½Y‘õ*#·?‘·uFCaª –(WMð4Â$à*#W¶èÒH’ñÔqgùËÀ„¦œ±±Ê\Ý|$ÙÝÕÍú§ÕÝÚíÆ¬bxp–) À@ØDÁÇÚR5”f73˜Rn»S1l‡œ“~;KG;`C>©8ÎhšÈžœnÜ“&‡~-ŽcS9¬¥Ì˜Ó¾+½ÎÛgâvÙ›¤¨u äÝŶ!,ä+÷U~ßn¬‡íËma5r:ÂÀËjCN¶ú,§”ƒM)1á"Úü /ÄTÐTHÿ¾¨ë/VP–"„&Ô³#D°y ú˜¯ê@Jȶ©&{(Åâd@#äùlZ§&ÏF>jø§éÃû´ŸæFÏúÚjZ…ÜÔô[–$O8ú„œõ„+p$Á|÷u]^НC}7x5 ²˶Š}óögj¿ª;ÇØ¤p²i ý-Iú^á&?]ÆøÖN©dÜÃÚ‡Mº>M[¶h²…UA—›¶ò{ aUi§Ç¾r6åšvhÂÔIý¥­ß]Ý­ˆÕÜ—¥eÐ]'*Î7|[R°ã+Ÿ£F› ´ðmHýðDoš‚-5zw š(ßû†1R†‰ ôç²*;ë› lC )‡ú}ïú~Îr( ºf03pr%Ž”@Û°Ï µdؘüI¡ª„55벂ž‹1Ð4¬Ê–^ßL|èv€ã¦]=ö.h—cyÙš¯ò½DÚçªØ5uUþ'G®/pc’8ZhÌ4 ô(‡SÛ¡32¦CÅ,x*Al§ÎúQðbÌôÀ4Éö}"øcÒÓ¾oÝù~ÿ_Àîlq×ïçÂ*PÙBmOh޵´áê %Ávà@0‚ öÙ×ÅÛy*óç`£ ù/Òµ”p¹P` zs‘2É^OYcú”uum³æ»´ ðE‘sÖÚ‚ Òl:CBcf:C")SÉÀÎ|žÄh‚EP題ÀÖ#¼ž ŠƒÄœ’Àôíw¨yñ)§žÁ›w×·¿fŸ&M±Äð¼|â)œ6‹}AM–‘ä¨Ð^º š¨Œ ­›:¢¨è/DÁ"¹n‚¶ãC†yḵ%½ aL=\ÛäŠÆUËÁ7åH9 &=yhn®ƒÞ‚²¸•ªgR bêØåf§Ãô[0¼/0£;Îö,9˜W §šÜ&grYk. 2¡µ‚Y VðûÞ ¦=í!¡ÆàZj:1'߉ ¿8\A)'ü{œFý]ˆãÔó„g-d±/GÊcÞteqÚçÍí.ˆÁÁ¹¥þr÷*ålľ È͇ëkÓÌvˆ¥ÓEp$!Ÿ‚æ)ÚA'éÛA=Øf°¯­z´â¯°¨vãTËѤo¢ò1"ØG^¤/k0•4NGx¬ß!"n^ÀÙÜ}ٹΌ{  Ây¿ÄŒ”§( è¡}Ú´O¦ ²nIÆpµöÇn'PÅ^wü6<†œ@Q¿7h;ô¾v»²³§}¿ ¼eD¯Ko±×yu:¾¤½ ¸:è‚-p{S•ÍÅ×"<µû°ÕŠ\]¯o§÷“ñw <‡RL9GtL" 7ö43á.¦‹ÂžI28 ‹u#Þ÷™‹•AÔÿ½²ƒñkÑÎ}ønŒ#´à€ylUÜ›†””é¨P8ü?ò¡ÉÑWepy°G™ŽÌ<ȬôÏ>Ye³ÀÏÿ¶ªS endstream endobj 6 0 obj 2119 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:47+01:00 2014-01-29T08:09:47+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000002443 00000 n 0000004333 00000 n 0000002384 00000 n 0000002224 00000 n 0000000015 00000 n 0000002204 00000 n 0000002508 00000 n 0000002762 00000 n 0000002697 00000 n 0000002629 00000 n 0000002549 00000 n 0000002579 00000 n 0000002844 00000 n 0000002910 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 4487 %%EOF curl-7.35.0/docs/libcurl/curl_share_setopt.pdf0000644000175000017500000001272112272124473016307 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœåXÛnÛF}×WlчR†¹á.ïmQÀu\Äc§–R p ƒ¦VkŠ«ˆ”ýC>º3³¼éb#IÓ—d{¹;3{æÌ™¡>0‡ æàOý;^\‡ì¾8ì~ða è!«¥söó6D¸0žÌÁBÉÂØåQÌÆó1‡…ñzpc¥«e~[Î’¥º-U¥Õ{Ë}?dyv‡O†¶ôî8¡õ&)VIÎoþ9þu`;\ °Ÿ‚ûÜóØÇÜ€/ÖåÉð;ˆž Ÿû± Q'ëÍÙpüW/^épÏ ™-$>v0Æý™ÍFªbðW¦‹’Mõ’%Œ6L˜¾ûK¥•1ڋ†0lðˆ¼Žþ¸¼z;:uÛêHk¿Ö·Y‘櫉b?¢óøÁg?í„êÑÅNß]_Œ^¥6ÇC³@á# Ü€{¢õùHñ=bpG^ý Ø‰%ä~B:3°9¶ÔN Rð¨Þiñ}6Hér¯ìa:zT“7Øu{quúú—w—§¸µ·a¼‡¸Pý/ÃìÆš¯ÊŠÝ) õBglg•†¦«"%êÌ“*eÅ=!;Õy®‡Í{µÆåÅRWºÚ,Ô÷mi"¶v !(pc#ywÝýõžMX®Ó‡ÛÆ¡1;š%Å$ÏiÇ$©†ýÅ$MUY2óë˜=AnâØ‘–ÃG«R-qÝ@Ð"fcMdhtOÜ8¨i4©ÃD},TÉÖ³¤¢Hébk<.œˆ éu‡|:”U‰b¼Ç ®Å6zÅõyò€% QëÖ^-U¶x!™ÖGSB˜bÐe¶ÎªÙžÄÀúXWìïFg×/ëô¹!A+!æAëd܇¶q{²ZvDÐ#¸‰ dî PÏçåÿDbVÅç‹L­%2ü Zùq+ N`¦¡gÄDà$½V:LøÄ#šF“) hï°z¸þ©‡ãŸÔ5A"À f¢?La1öµðtº>ü”V|†LHÄþ?_§£W'×gŸR¢žˆãÏ)R7ŒÃ†˜nSÖÊ…J³ÀÌÄhh ¾!M9Ó«|‚µl$”³ñ 'ZÃyP©àâüHQCS ¼f Oò•!§í†>÷`}‹4U¦ËìN¡“\×@Ä?äa—É5o¶›'ÛàÑuk’%0—°5txØrV¥ ¯'cvÒå-â~ÇÓÛÓ««×ç¿íc#tv">Õú!S¤u–ç:Ћ–º4ŒSI¹aFpJ¶*Út[ï† [søW¼ÈK3uîÝà5©?…ŠƒX`›é´çŸ^‡]êŠhŠž.‚; ài|tcŸÖ3UPBé’Ýù*¯2FÅ9íšv "@([^“É<ßð\ ¯›çDv§qF¡Øèv)^”ÝmØDMIm±Õ$pš„@¯*s™Y2”ŽõH—ÓˆD9ùÆô +I£ÑÅíèl4ªß»ö“%¢ŒÀF(¸²Äzþò+äŠ*­Ph+ú-«Ô$§Bi}(*È­`hL=Àû¤Ë±ëã¥B—¶y¨uw[‡~ØÔ0f©R]A s›Ms’áÂ,Öö5RwôCÚâ÷q¿ìϱ‘›5 m×C¡[õ{³‡$²d©0×D‡úªSÊŽ>Ä3BÚ¡|bÒ: áÐC‚¾~UŸheÒ¦ ]fjé®Òë¨ ýÞÔù5—æë‘Fí¡KÉ^wàçC¬ˆHZUÙÔ µh)=Ùô„( ¯n¬¦%PÍfer g†A´×‚°ºµ Ûõ=îEñNBˆÊ¾2÷Ф{Ýæ÷¡Àq&‚Ù(‡©ìæDÓP(imš U—4GìŽk\ ïi잀¬îÒn$ù^éïNMùÇ>”cà‰ò·ýØlz¶±»Þ>¨Ïõu§-±$7]” ¯É«¬k{]’øBÕQB§›í½ëû¸,’²ìDwk¨Æé”n†Üƒ±|»IîLàf¸#=É*>Sˆl @ …Œf&†YÒÞ,)¾¢×wŒN¶ô¥ËÙêžIÇqéœâW’f]àÊÙxðüü u¹Ÿendstream endobj 6 0 obj 1788 endobj 14 0 obj <> stream xœmSÛŽ›0}ç+æÑT‹ã ªJi…TµiW%¤/IQâ$T²†(Ú~C?ºc.ÝÝl…d„gæÌ9g†`”³Ïø.NÎ, áÐ: ΃Ãû Œ¯âï3LˆìE¶w†¡€0–4Š!;9œÇ/²«³&ÅÅTÛö˜½muל» ‘ªò§¸že,$_òú’Wðÿt÷Gö ›ÆØ”Æí+d dˆ=²7k’&Ù*ý ß].}+Næ‹U2VMT±ÄãÈjçêû-%Vébù1ÙÞ† ù­MƒÔN:¯[èŽy‡‡äP65\Ýì—#˜¤qŒ‚GÕƒä- W8›æ¬Mõh‘„ Ž4P‚%ä®¶Af¼¯ŸMíÙîcï¼mLc )Уw·¶p–r6ŠñD!•h’DÞZçfö ÇwCò$<ˆh0ôéý";ý§Ö-…¥ÖVá ²Bî÷k2ÊCB®ØQIÒÁ¸¯HKåÍXïû±…PË9?hØ£kçþRU8ý¶ƒkÙa§Û”½Å-˜<›²'.cT©hÔ.“æ‹åýSîËÙ>Û8—‡h‰Þ{9ßP$ 9#Õ~Óî^âb[¥¦ŒWÐR tY—Ýk ">íÉ€ka=Á8å(FIN‡©îBHQsدÎ ×Cà·œ¢ùÓÚøHùôå‚1Ù×ÉÐþ}ý°7Iæ|Ãç/¸¢þÈendstream endobj 15 0 obj 545 endobj 4 0 obj <> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R ] /Count 2 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 18 0 obj <> endobj 19 0 obj <>stream 2014-01-29T08:09:47+01:00 2014-01-29T08:09:47+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 20 0000000000 65535 f 0000002918 00000 n 0000004878 00000 n 0000002852 00000 n 0000002530 00000 n 0000000015 00000 n 0000001873 00000 n 0000002983 00000 n 0000003317 00000 n 0000003252 00000 n 0000003184 00000 n 0000003024 00000 n 0000003054 00000 n 0000002690 00000 n 0000001893 00000 n 0000002510 00000 n 0000003104 00000 n 0000003134 00000 n 0000003399 00000 n 0000003455 00000 n trailer << /Size 20 /Root 1 0 R /Info 2 0 R /ID [<4228FCFF55451DB803E599618B8384B3><4228FCFF55451DB803E599618B8384B3>] >> startxref 5032 %%EOF curl-7.35.0/docs/libcurl/curl_unescape.html0000644000175000017500000000457612272124467015621 00000000000000 curl_unescape man page

NAME

curl_unescape - URL decodes the given string

SYNOPSIS

#include <curl/curl.h>

char *curl_unescape( char * url , int length );

DESCRIPTION

Obsolete function. Use curl_easy_unescape(3) instead!

This function will convert the given URL encoded input string to a "plain string" and return that as a new allocated string. All input characters that are URL encoded (%XX where XX is a two-digit hexadecimal number) will be converted to their plain text versions.

If the 'length' argument is set to 0, curl_unescape() will use strlen() on the input 'url' string to find out the size.

You must curl_free() the returned string when you're done with it.

AVAILABILITY

Since 7.15.4, curl_easy_unescape(3) should be used. This function will be removed in a future release.

RETURN VALUE

A pointer to a zero terminated string or NULL if it failed.

SEE ALSO

curl_easy_escape(3), curl_easy_unescape(3), curl_free(3), RFC 2396

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_getenv.30000644000175000017500000000435012213173003014453 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_getenv 3 "30 April 2004" "libcurl 7.12" "libcurl Manual" .SH NAME curl_getenv - return value for environment name .SH SYNOPSIS .B #include .sp .BI "char *curl_getenv(const char *" name ");" .ad .SH DESCRIPTION curl_getenv() is a portable wrapper for the getenv() function, meant to emulate its behaviour and provide an identical interface for all operating systems libcurl builds on (including win32). .SH AVAILABILITY This function will be removed from the public libcurl API in a near future. It will instead be made "available" by source code access only, and then as curlx_getenv(). .SH RETURN VALUE If successful, curl_getenv() returns a pointer to the value of the specified environment. The memory it refers to is malloc()ed so the application must free() this when the data is no longer needed. When \fIcurl_getenv(3)\fP fails to find the specified name, it returns a null pointer. .SH NOTE Under unix operating systems, there isn't any point in returning an allocated memory, although other systems won't work properly if this isn't done. The unix implementation thus has to suffer slightly from the drawbacks of other systems. .SH "SEE ALSO" .BR getenv "(3C), " curl-7.35.0/docs/libcurl/curl_mprintf.30000644000175000017500000001017512213173003014644 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_printf 3 "30 April 2004" "libcurl 7.12" "libcurl Manual" .SH NAME curl_maprintf, curl_mfprintf, curl_mprintf, curl_msnprintf, curl_msprintf curl_mvaprintf, curl_mvfprintf, curl_mvprintf, curl_mvsnprintf, curl_mvsprintf - formatted output conversion .SH SYNOPSIS .B #include .sp .BI "int curl_mprintf(const char *" format ", ...);" .br .BI "int curl_mfprintf(FILE *" fd ", const char *" format ", ...);" .br .BI "int curl_msprintf(char *" buffer ", const char *" format ", ...);" .br .BI "int curl_msnprintf(char *" buffer ", size_t " maxlength ", const char *" format ", ...);" .br .BI "int curl_mvprintf(const char *" format ", va_list " args ");" .br .BI "int curl_mvfprintf(FILE *" fd ", const char *" format ", va_list " args ");" .br .BI "int curl_mvsprintf(char *" buffer ", const char *" format ", va_list " args ");" .br .BI "int curl_mvsnprintf(char *" buffer ", size_t " maxlength ", const char *" format ", va_list " args ");" .br .BI "char *curl_maprintf(const char *" format ", ...);" .br .BI "char *curl_mvaprintf(const char *" format ", va_list " args ");" .SH DESCRIPTION These are all functions that produce output according to a format string and given arguments. These are mostly clones of the well-known C-style functions and there will be no detailed explanation of all available formatting rules and usage here. See this table for notable exceptions. .RS .TP .B curl_mprintf() Normal printf() clone. .TP .B curl_mfprintf() Normal fprintf() clone. .TP .B curl_msprintf() Normal sprintf() clone. .TP .B curl_msnprintf() snprintf() clone. Many systems don't have this. It is just like \fBsprintf\fP but with an extra argument after the buffer that specifies the length of the target buffer. .TP .B curl_mvprintf() Normal vprintf() clone. .TP .B curl_mvfprintf() Normal vfprintf() clone. .TP .B curl_mvsprintf() Normal vsprintf() clone. .TP .B curl_mvsnprintf() vsnprintf() clone. Many systems don't have this. It is just like \fBvsprintf\fP but with an extra argument after the buffer that specifies the length of the target buffer. .TP .B curl_maprintf() Like printf() but returns the output string as a malloc()ed string. The returned string must be free()ed by the receiver. .TP .B curl_mvaprintf() Like curl_maprintf() but takes a va_list pointer argument instead of a variable amount of arguments. .RE To easily use all these cloned functions instead of the normal ones, #define _MPRINTF_REPLACE before you include the file. Then all the normal names like printf, fprintf, sprintf etc will use the curl-functions instead. .SH AVAILABILITY These function will be removed from the public libcurl API in a near future. They will instead be made "available" by source code access only, and then as curlx_-prefixed functions. See lib/README.curlx for further details. .SH RETURN VALUE The \fBcurl_maprintf\fP and \fBcurl_mvaprintf\fP functions return a pointer to a newly allocated string, or NULL if it failed. All other functions return the number of characters they actually outputted. .SH "SEE ALSO" .BR printf "(3), " sprintf "(3), " fprintf "(3), " vprintf "(3) " curl-7.35.0/docs/libcurl/curl_strequal.pdf0000644000175000017500000001006412272124472015444 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ½WÛnÛF}×W,Ò“µÙ /K´( ´zPàØ®LHí" ©µÍ–ZÊ$eÇù†~tg—\Þdû±à 9;—3sάÁýi§ÛÙ‡uˆîªAw³‡5/Qû+Ý¢1ý ¾5g(  #ŽE„âíŒr‰â§Ù•“îËü[U—òaŸä׿vQžÝè§îœù:Ÿ/Ñ¡©ûWüi6'˜Qð›BØÂâÈבy€â“™sºp SxK}ìG²‰73çóÒÿäÉöHˆæ”é×Dç6Ní¸ ¯ÌÿhŽÒ¤’(S•TUVgÚ¤B}+„`~‹`nÜ=JTi#›L m-ÌûºÌÔJ‹í.)³ªPU“á ¤9c!f² °0e\|==;¿X]ô¦mém!ÎO™JóýF¢_túô|ÿ«6gžÆ'~ådªîŠs©Ð §9½OJôÞàüaM‰í*¡X°J8ECì÷M0V€A@¬ÙqÚaGÂk_4L]ư“>W¨]wð9×îÏ}øÊšëÒ6³× SoWb.þ÷Ê^ŒÐxÜŽÀBô²ò[}ap4—jÃ^Ÿ{ ÝdÌ€wápÌ~_^ü¶^Ç«³Ó1m“ßËI aÀhõD‡FØáj Ü» HÝÞD†·{•ÖY¡ZnÈ Õ÷ÕO pÂPŸ(Ë¢R xFq؃a(VMñ*Q4éù@Â Ž–ÊN¢6“Óæ…wú~ŠV‘ÄË#“ J!º}q§ #ºB£/Åmó7ÌR’Ö²¬0Z™ŽÏ™ðà‘d]9¥¬÷¥ªP‚T¡æ?dY k'^»<Â05Ô¹\‚À/¤K=xâ{Î,QÖ©|`Œ²Tu–&96=2í=w—ø‡½§ õZ‡CèGÔÁÐu6«P•m³<)lP±ç€°Œ 8ð=•»e5*Tþ<ž‘ËjÊÊ|À®Ii7 =æÐ…‰vYßΆfÔnlÆï[y‚ÕF3ß-4ÚbÑÀ¿+ }&ò0áad AhجèÎÝ<ÛU‰êI•Üä%»]mk<Áã®·™‚Ù¨Ë=@µ+ÊÚœÙ&JIƒ<ç>¨¥í1P5¥4ŠI lÞàX;Wøn$å¦÷úÖzŸhyN1Â6d€C/ˆ¬ im¦[²Ç £ÈF8à6›–cN­àOãÚZ‹ò ”ä9ÚåI=o:D8ð:‰»-ÊmÕ€BA¨ÄÁcnô°UM°!žÉyñ-º°pÓ|j'cu²ø¸:YÅ_Ƈ{À’ääåYyÊ á‰J¹-ÆCÒqäQ6˜pífJ ÍíH.Y`“+‹­¡Ñn3Õ Ûâ|ÕŒ‘’°àn÷ 8Ò€?ŠA#PFfch¾šr¢×Ho{%´3bÊÜ9õ#P"ßá-ve–#Fˆg\{ý¦`„}Ïþ€ÏȆ\Ôendstream endobj 6 0 obj 1337 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:46+01:00 2014-01-29T08:09:46+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001661 00000 n 0000003541 00000 n 0000001602 00000 n 0000001442 00000 n 0000000015 00000 n 0000001422 00000 n 0000001726 00000 n 0000001980 00000 n 0000001915 00000 n 0000001847 00000 n 0000001767 00000 n 0000001797 00000 n 0000002062 00000 n 0000002118 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [<3E6F84D0AB832A660FB74ED149DEB775><3E6F84D0AB832A660FB74ED149DEB775>] >> startxref 3695 %%EOF curl-7.35.0/docs/libcurl/curl_global_init_mem.30000644000175000017500000000467312213173003016314 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_global_init_mem 3 "10 May 2004" "libcurl 7.12.0" "libcurl Manual" .SH NAME curl_global_init_mem - Global libcurl initialisation with memory callbacks .SH SYNOPSIS .B #include .nf .B "CURLcode curl_global_init_mem(long " flags, .B " curl_malloc_callback "m, .B " curl_free_callback "f, .B " curl_realloc_callback "r, .B " curl_strdup_callback "s, .B " curl_calloc_callback "c ");" .SH DESCRIPTION This function works exactly as \fIcurl_global_init(3)\fP with one addition: it allows the application to set callbacks to replace the otherwise used internal memory functions. This man page only adds documentation for the callbacks, see the \fIcurl_global_init(3)\fP man page for all the rest. When you use this function, all callback arguments must be set to valid function pointers. The prototypes for the given callbacks should match these: .IP "void *malloc_callback(size_t size);" To replace malloc() .IP "void free_callback(void *ptr);" To replace free() .IP "void *realloc_callback(void *ptr, size_t size);" To replace realloc() .IP "char *strdup_callback(const char *str);" To replace strdup() .IP "void *calloc_callback(size_t nmemb, size_t size);" To replace calloc() .SH "CAUTION" Manipulating these gives considerable powers to the application to severely screw things up for libcurl. Take care! .SH "SEE ALSO" .BR curl_global_init "(3), " .BR curl_global_cleanup "(3), " curl-7.35.0/docs/libcurl/curl_multi_cleanup.30000644000175000017500000000402012213173003016016 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_multi_cleanup 3 "1 March 2002" "libcurl 7.9.5" "libcurl Manual" .SH NAME curl_multi_cleanup - close down a multi session .SH SYNOPSIS .B #include .sp .BI "CURLMcode curl_multi_cleanup( CURLM *multi_handle );" .ad .SH DESCRIPTION Cleans up and removes a whole multi stack. It does not free or touch any individual easy handles in any way - they still need to be closed individually, using the usual \fIcurl_easy_cleanup(3)\fP way. The order of cleaning up should be: 1 - \fIcurl_multi_remove_handle(3)\fP before any easy handles are cleaned up 2 - \fIcurl_easy_cleanup(3)\fP can now be called independently since the easy handle is no longer connected to the multi handle 3 - \fIcurl_multi_cleanup(3)\fP should be called when all easy handles are removed .SH RETURN VALUE CURLMcode type, general libcurl multi interface error code. On success, CURLM_OK is returned. .SH "SEE ALSO" .BR curl_multi_init "(3)," curl_easy_cleanup "(3)," curl_easy_init "(3)" curl-7.35.0/docs/libcurl/libcurl-share.30000644000175000017500000000576312262102134014704 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2012, 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. .\" * .\" ************************************************************************** .TH libcurl-share 3 "8 Aug 2003" "libcurl 7.10.7" "libcurl share interface" .SH NAME libcurl-share \- how to use the share interface .SH DESCRIPTION This is an overview on how to use the libcurl share interface in your C programs. There are specific man pages for each function mentioned in here. All functions in the share interface are prefixed with curl_share. .SH "OBJECTIVES" The share interface was added to enable sharing of data between curl \&"handles". .SH "ONE SET OF DATA - MANY TRANSFERS" You can have multiple easy handles share data between them. Have them update and use the \fBsame\fP cookie database, DNS cache, TLS session cache! This way, each single transfer will take advantage from data updates made by the other transfer(s). The sharing interface, however, does not share active or persistent connections between different easy handles. .SH "SHARE OBJECT" You create a shared object with \fIcurl_share_init(3)\fP. It returns a handle for a newly created one. You tell the shared object what data you want it to share by using \fIcurl_share_setopt(3)\fP. Since you can use this share from multiple threads, and libcurl has no internal thread synchronization, you must provide mutex callbacks if you're using this multi-threaded. You set lock and unlock functions with \fIcurl_share_setopt(3)\fP too. Then, you make an easy handle to use this share, you set the \fICURLOPT_SHARE\fP option with \fIcurl_easy_setopt(3)\fP, and pass in share handle. You can make any number of easy handles share the same share handle. To make an easy handle stop using that particular share, you set \fICURLOPT_SHARE\fP to NULL for that easy handle. To make a handle stop sharing a particular data, you can \fICURLSHOPT_UNSHARE\fP it. When you're done using the share, make sure that no easy handle is still using it, and call \fIcurl_share_cleanup(3)\fP on the handle. .SH "SEE ALSO" .BR curl_share_init "(3), " curl_share_setopt "(3), " curl_share_cleanup "(3)" curl-7.35.0/docs/libcurl/curl_multi_socket.html0000644000175000017500000002251712272124467016513 00000000000000 curl_multi_socket man page

NAME

curl_multi_socket - reads/writes available data

SYNOPSIS

#include <curl/curl.h> CURLMcode curl_multi_socket(CURLM * multi_handle, curl_socket_t sockfd,   int *running_handles);

CURLMcode curl_multi_socket_all(CURLM *multi_handle,   int *running_handles);

DESCRIPTION

These functions are deprecated. Do not use! See curl_multi_socket_action(3) instead!

At return, the integer running_handles points to will contain the number of still running easy handles within the multi handle. When this number reaches zero, all transfers are complete/done. Note that when you call curl_multi_socket_action(3) on a specific socket and the counter decreases by one, it DOES NOT necessarily mean that this exact socket/transfer is the one that completed. Use curl_multi_info_read(3) to figure out which easy handle that completed.

The curl_multi_socket_action(3) functions inform the application about updates in the socket (file descriptor) status by doing none, one, or multiple calls to the socket callback function set with the CURLMOPT_SOCKETFUNCTION option to curl_multi_setopt(3). They update the status with changes since the previous time the callback was called.

Get the timeout time by setting the CURLMOPT_TIMERFUNCTION option with curl_multi_setopt(3). Your application will then get called with information on how long to wait for socket actions at most before doing the timeout action: call the curl_multi_socket_action(3) function with the sockfd argument set to CURL_SOCKET_TIMEOUT. You can also use the curl_multi_timeout(3) function to poll the value at any given time, but for an event-based system using the callback is far better than relying on polling the timeout value.

Usage of curl_multi_socket(3) is deprecated, whereas the function is equivalent to curl_multi_socket_action(3) with ev_bitmask set to 0.

Force libcurl to (re-)check all its internal sockets and transfers instead of just a single one by calling curl_multi_socket_all(3). Note that there should not be any reason to use this function!

CALLBACK DETAILS

The socket callback function uses a prototype like this

  int curl_socket_callback(CURL *easy, /* easy handle */   curl_socket_t s, /* socket */   int action, /* see values below */   void *userp, /* private callback pointer */   void *socketp); /* private socket pointer */

The callback MUST return 0.

The easy argument is a pointer to the easy handle that deals with this particular socket. Note that a single handle may work with several sockets simultaneously.

The s argument is the actual socket value as you use it within your system.

The action argument to the callback has one of five values:

CURL_POLL_NONE (0)

register, not interested in readiness (yet)

CURL_POLL_IN (1)

register, interested in read readiness

CURL_POLL_OUT (2)

register, interested in write readiness

CURL_POLL_INOUT (3)

register, interested in both read and write readiness

CURL_POLL_REMOVE (4)

unregister

The socketp argument is a private pointer you have previously set with curl_multi_assign(3) to be associated with the s socket. If no pointer has been set, socketp will be NULL. This argument is of course a service to applications that want to keep certain data or structs that are strictly associated to the given socket.

The userp argument is a private pointer you have previously set with curl_multi_setopt(3) and the CURLMOPT_SOCKETDATA option.

RETURN VALUE

CURLMcode type, general libcurl multi interface error code.

Legacy: If you receive CURLM_CALL_MULTI_PERFORM, this basically means that you should call curl_multi_socket(3) again, before you wait for more actions on libcurl's sockets. You don't have to do it immediately, but the return code means that libcurl may have more data available to return or that there may be more data to send off before it is "satisfied".

In modern libcurls, CURLM_CALL_MULTI_PERFORM or CURLM_CALL_MULTI_SOKCET should not be returned and no application needs to care about them.

NOTE that the return code is for the whole multi stack. Problems still might have occurred on individual transfers even when one of these functions return OK.

TYPICAL USAGE

1. Create a multi handle

2. Set the socket callback with CURLMOPT_SOCKETFUNCTION

3. Set the timeout callback with CURLMOPT_TIMERFUNCTION, to get to know what timeout value to use when waiting for socket activities.

4. Add easy handles with curl_multi_add_handle()

5. Provide some means to manage the sockets libcurl is using, so you can check them for activity. This can be done through your application code, or by way of an external library such as libevent or glib.

6. Wait for activity on any of libcurl's sockets, use the timeout value your callback has been told

7, When activity is detected, call curl_multi_socket_action() for the socket(s) that got action. If no activity is detected and the timeout expires, call curl_multi_socket_action(3) with CURL_SOCKET_TIMEOUT

8. Go back to step 6.

AVAILABILITY

This function was added in libcurl 7.15.4, and is deemed stable since 7.16.0.

curl_multi_socket(3) is deprecated, use curl_multi_socket_action(3) instead!

SEE ALSO

curl_multi_cleanup (3) curl_multi_init (3) curl_multi_fdset (3) curl_multi_info_read (3) the hiperfifo.c example

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_global_init.30000644000175000017500000000663112213173003015452 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2012, 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. .\" * .\" ************************************************************************** .TH curl_global_init 3 "11 May 2004" "libcurl 7.12" "libcurl Manual" .SH NAME curl_global_init - Global libcurl initialisation .SH SYNOPSIS .B #include .sp .BI "CURLcode curl_global_init(long " flags ");" .ad .SH DESCRIPTION This function sets up the program environment that libcurl needs. Think of it as an extension of the library loader. This function must be called at least once within a program (a program is all the code that shares a memory space) before the program calls any other function in libcurl. The environment it sets up is constant for the life of the program and is the same for every program, so multiple calls have the same effect as one call. The flags option is a bit pattern that tells libcurl exactly what features to init, as described below. Set the desired bits by ORing the values together. In normal operation, you must specify CURL_GLOBAL_ALL. Don't use any other value unless you are familiar with it and mean to control internal operations of libcurl. \fBThis function is not thread safe.\fP You must not call it when any other thread in the program (i.e. a thread sharing the same memory) is running. This doesn't just mean no other thread that is using libcurl. Because \fIcurl_global_init()\fP calls functions of other libraries that are similarly thread unsafe, it could conflict with any other thread that uses these other libraries. See the description in \fBlibcurl\fP(3) of global environment requirements for details of how to use this function. .SH FLAGS .TP 5 .B CURL_GLOBAL_ALL Initialize everything possible. This sets all known bits except \fBCURL_GLOBAL_ACK_EINTR\fP. .TP .B CURL_GLOBAL_SSL Initialize SSL .TP .B CURL_GLOBAL_WIN32 Initialize the Win32 socket libraries. .TP .B CURL_GLOBAL_NOTHING Initialise nothing extra. This sets no bit. .TP .B CURL_GLOBAL_DEFAULT A sensible default. It will init both SSL and Win32. Right now, this equals the functionality of the \fBCURL_GLOBAL_ALL\fP mask. .TP .B CURL_GLOBAL_ACK_EINTR When this flag is set, curl will acknowledge EINTR condition when connecting or when waiting for data. Otherwise, curl waits until full timeout elapses. .SH RETURN VALUE If this function returns non-zero, something went wrong and you cannot use the other curl functions. .SH "SEE ALSO" .BR curl_global_init_mem "(3), " .BR curl_global_cleanup "(3), " .BR curl_easy_init "(3) " .BR libcurl "(3) " curl-7.35.0/docs/libcurl/curl_easy_cleanup.30000644000175000017500000000466212213173003015641 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .\" .TH curl_easy_cleanup 3 "22 aug 2007" "libcurl 7.17.0" "libcurl Manual" .SH NAME curl_easy_cleanup - End a libcurl easy session .SH SYNOPSIS .B #include .BI "void curl_easy_cleanup(CURL *" handle ");" .SH DESCRIPTION This function must be the last function to call for an easy session. It is the opposite of the \fIcurl_easy_init(3)\fP function and must be called with the same \fIhandle\fP as input that the curl_easy_init call returned. This will effectively close all connections this handle has used and possibly has kept open until now. Don't call this function if you intend to transfer more files. Occasionally you may get your progress callback or header callback called from within \fIcurl_easy_cleanup(3)\fP (if previously set for the handle using \fIcurl_easy_setopt(3)\fP). Like if libcurl decides to shut down the connection and the protocol is of a kind that requires a command/response sequence before disconnect. Examples of such protocols are FTP, POP3 and IMAP. Any uses of the \fBhandle\fP after this function has been called and have returned, are illegal. This kills the handle and all memory associated with it! With libcurl versions prior to 7.17.: when you've called this, you can safely remove all the strings you've previously told libcurl to use, as it won't use them anymore now. .SH RETURN VALUE None .SH "SEE ALSO" .BR curl_easy_init "(3), " curl-7.35.0/docs/libcurl/curl_easy_cleanup.pdf0000644000175000017500000001027012272124470016251 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœuVÛnã6}÷WLчHEÌ%©+Û¢@ºëRd“4ñ¶(’b¡È´­F¯(Åõ?ô£;¤DÉr²ÛâhæÌåœáW „ÕýgZÌÞÝE°Q3 ›Ù×3‡Ð¤üºDƒX?X®gÝ; "‘ðH,`YÌ HìÃr?{pҶοÈD¾¤¹LÊv÷èx.äÙ“>qç< „ÒÈù„gIo›»/›Í)á ý§^`x"À ay5s®/Ü3DŒ§<¢Z®fΧ…»üç/§Ä§Ì×ÇTc| æ°(WX” AI¥²ªìü˜#‚9 IlÞÿu}s{y?šõ ûÎ÷Y™æíJÂÏÚõ;ýlÑæsÝL€û&£—Êf$ˆèÓÉVoUèýç»+ø¡‹È¨í „÷¯m“r•Ë)$¿?~tz§œ0çqŸØ‡Åýû»ËÛååÍõ´¤cnØ nÚî,·™‚u[¦ V ŠV5ð$¡ÙJÈü>œ4¤IžÃºª!)'u&pÙzÑ/U»]¥²¿¬õï“L½Ð#Œ…}2c}²2kºñ™à[ûÉ °T`M®`Ÿ5[ƒC%Åip1BÅu&Nˆ k‘(ÈÊ]Û »¤1>§x»rÔ²iëR®ˆ N)‰¶Âï‹,øXä}†ör­ ýø¾ÏúHk‰ùر 1"ŒH^ Î~¾x,â~´¯ãn~€4¯”)­ÊRšéž`ä.YüPÐ*¬’.¶IeOøž~úìâàÆ8r×`e mÙd9”•%th€yÜ#‘×+3ìÕùí |02AhÌãÎæÁ©Ê3ó"všÎ™¤¡8¡¶FÞL†1[áj± DÀ8€M”j-k(ªZ¹T¦ìHè82NnÒ4щ¾æÝ"9ÀF6ú{ »ºÚÔ8²¦sOIú 8Ë[™¬Ðãð¨¤u]fš²¹=!«¡ü7ÔïìhœÊ%³M¦Äc½Î>:˜Ø®–.Ð bÎKVµ*×tj ½ô¬õ-kUVnLÕŽ!>ñ¹xÅ"|¿Ú½Å£HߣGHS­G—ÀUö¬m9Ž­i0çhpÛ<™¹L«¢À7ÞᯒÕÏd™JT ,°ì¸ÚÇžLá*S}T‹“b‡3¦©6ÝÁ1ŽßÇåmW¹Ž±‚a r~;’AgE‡zÞÜz&—ËO·.ÓŽ•%-´Œû±ç¢ìÜGQdqÍÛôC;FèL¬"DT‡{`»K|Feom›aI0ZN²nd}BK-O%¢§ŠÎg›Lõ {ïY­Å D±õ"¡q£‰ˆGÜI/§ç¦Ä(˜²÷Kßç4l6É‘.z£.:9£¸Ïè@Y:Í»©ÄKLHO»ŽLÓYh *$ŠË¥ª4K»S²æ»‰´øÿ̆« C‰!ãÈ‹;²ã«öjòâ2_Ë`ìÈZqÞÕ™¦{A…üö[¬*JÕ™]» PöyhE—zC5Ó±š!22> ït Òí;7r˜âæVÉZ¢ØÔ˜ç´g(G‘?‰ld$âc”ÎÆ7’¬©Q¬T—À±gÜ»B°×Ëlî£ÚD؈ãf<8Viä ÒØTùj($ ׎nèö.3BšM£ g) JÙ°M{LI[5|@¦hô€Ëú¨³_Nw_Œ½—òž Oncq@B6Þ3œ»ÅòóÝ5üá2 dÎÅÕçE/꯯fÎuU‘öí«ëbW÷7ß¼ºN¯*S‚‡Ô^&õ¦87­øªçS‹ØVÚÌ%uç,ÂÈá’vxɉ z?´ww¦,–³ßñïËyhdendstream endobj 6 0 obj 1469 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:44+01:00 2014-01-29T08:09:44+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001793 00000 n 0000003673 00000 n 0000001734 00000 n 0000001574 00000 n 0000000015 00000 n 0000001554 00000 n 0000001858 00000 n 0000002112 00000 n 0000002047 00000 n 0000001979 00000 n 0000001899 00000 n 0000001929 00000 n 0000002194 00000 n 0000002250 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 3827 %%EOF curl-7.35.0/docs/libcurl/curl_multi_setopt.html0000644000175000017500000003063012272124467016534 00000000000000 curl_multi_setopt man page

NAME

curl_multi_setopt - set options for a curl multi handle

SYNOPSIS

#include <curl/curl.h>

CURLMcode curl_multi_setopt(CURLM * multi_handle, CURLMoption option, param);

DESCRIPTION

curl_multi_setopt() is used to tell a libcurl multi handle how to behave. By using the appropriate options to curl_multi_setopt(3), you can change libcurl's behaviour when using that multi handle. All options are set with the option followed by the parameter param. That parameter can be a long, a function pointer, an object pointer or a curl_off_t type, depending on what the specific option expects. Read this manual carefully as bad input values may cause libcurl to behave badly! You can only set one option in each function call.

OPTIONS

CURLMOPT_SOCKETFUNCTION

Pass a pointer to a function matching the curl_socket_callback prototype. The curl_multi_socket_action(3) function informs the application about updates in the socket (file descriptor) status by doing none, one, or multiple calls to the curl_socket_callback given in the param argument. They update the status with changes since the previous time a curl_multi_socket(3) function was called. If the given callback pointer is NULL, no callback will be called. Set the callback's userp argument with CURLMOPT_SOCKETDATA. See curl_multi_socket(3) for more callback details.

CURLMOPT_SOCKETDATA

Pass a pointer to whatever you want passed to the curl_socket_callback's fourth argument, the userp pointer. This is not used by libcurl but only passed-thru as-is. Set the callback pointer with CURLMOPT_SOCKETFUNCTION.

CURLMOPT_PIPELINING

Pass a long set to 1 to enable or 0 to disable. Enabling pipelining on a multi handle will make it attempt to perform HTTP Pipelining as far as possible for transfers using this handle. This means that if you add a second request that can use an already existing connection, the second request will be "piped" on the same connection rather than being executed in parallel. (Added in 7.16.0)

CURLMOPT_TIMERFUNCTION

Pass a pointer to a function matching the curl_multi_timer_callback prototype: int curl_multi_timer_callback(CURLM *multi /* multi handle */, long timeout_ms /* timeout in milliseconds */, void *userp /* TIMERDATA */). This function will then be called when the timeout value changes. The timeout value is at what latest time the application should call one of the "performing" functions of the multi interface (curl_multi_socket_action(3) and curl_multi_perform(3)) - to allow libcurl to keep timeouts and retries etc to work. A timeout value of -1 means that there is no timeout at all, and 0 means that the timeout is already reached. Libcurl attempts to limit calling this only when the fixed future timeout time actually changes. See also CURLMOPT_TIMERDATA. The callback should return 0 on success, and -1 on error. This callback can be used instead of, or in addition to, curl_multi_timeout(3). (Added in 7.16.0)

CURLMOPT_TIMERDATA

Pass a pointer to whatever you want passed to the curl_multi_timer_callback's third argument, the userp pointer. This is not used by libcurl but only passed-thru as-is. Set the callback pointer with CURLMOPT_TIMERFUNCTION. (Added in 7.16.0)

CURLMOPT_MAXCONNECTS

Pass a long. The set number will be used as the maximum amount of simultaneously open connections that libcurl may cache. Default is 10, and libcurl will enlarge the size for each added easy handle to make it fit 4 times the number of added easy handles.

By setting this option, you can prevent the cache size from growing beyond the limit set by you.

When the cache is full, curl closes the oldest one in the cache to prevent the number of open connections from increasing.

This option is for the multi handle's use only, when using the easy interface you should instead use the CURLOPT_MAXCONNECTS option.

(Added in 7.16.3)

CURLMOPT_MAX_HOST_CONNECTIONS

Pass a long. The set number will be used as the maximum amount of simultaneously open connections to a single host. For each new session to a host, libcurl will open a new connection up to the limit set by CURLMOPT_MAX_HOST_CONNECTIONS. When the limit is reached, the sessions will be pending until there are available connections. If CURLMOPT_PIPELINING is 1, libcurl will try to pipeline if the host is capable of it.

The default value is 0, which means that there is no limit. However, for backwards compatibility, setting it to 0 when CURLMOPT_PIPELINING is 1 will not be treated as unlimited. Instead it will open only 1 connection and try to pipeline on it.

(Added in 7.30.0)

CURLMOPT_MAX_PIPELINE_LENGTH

Pass a long. The set number will be used as the maximum amount of requests in a pipelined connection. When this limit is reached, libcurl will use another connection to the same host (see CURLMOPT_MAX_HOST_CONNECTIONS), or queue the requests until one of the pipelines to the host is ready to accept a request. Thus, the total number of requests in-flight is CURLMOPT_MAX_HOST_CONNECTIONS * CURLMOPT_MAX_PIPELINE_LENGTH. The default value is 5.

(Added in 7.30.0)

CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE

Pass a long. If a pipelined connection is currently processing a request with a Content-Length larger than CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, that connection will not be considered for additional requests, even if it is shorter than CURLMOPT_MAX_PIPELINE_LENGTH. The default value is 0, which means that the penalization is inactive.

(Added in 7.30.0)

CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE

Pass a long. If a pipelined connection is currently processing a chunked (Transfer-encoding: chunked) request with a current chunk length larger than CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, that connection will not be considered for additional requests, even if it is shorter than CURLMOPT_MAX_PIPELINE_LENGTH. The default value is 0, which means that the penalization is inactive.

(Added in 7.30.0)

CURLMOPT_PIPELINING_SITE_BL

Pass an array of char *, ending with NULL. This is a list of sites that are blacklisted from pipelining, i.e sites that are known to not support HTTP pipelining. The array is copied by libcurl.

The default value is NULL, which means that there is no blacklist.

Pass a NULL pointer to clear the blacklist.

Example:

  site_blacklist[] =   {   "www.haxx.se",   "www.example.com:1234",   NULL   };

  curl_multi_setopt(m, CURLMOPT_PIPELINE_SITE_BL, site_blacklist);

(Added in 7.30.0)

CURLMOPT_PIPELINING_SERVER_BL

Pass an array of char *, ending with NULL. This is a list of server types prefixes (in the Server: HTTP header) that are blacklisted from pipelining, i.e server types that are known to not support HTTP pipelining. The array is copied by libcurl.

Note that the comparison matches if the Server: header begins with the string in the blacklist, i.e "Server: Ninja 1.2.3" and "Server: Ninja 1.4.0" can both be blacklisted by having "Ninja" in the backlist.

The default value is NULL, which means that there is no blacklist.

Pass a NULL pointer to clear the blacklist.

Example:

  server_blacklist[] =   {   "Microsoft-IIS/6.0",   "nginx/0.8.54",   NULL   };

  curl_multi_setopt(m, CURLMOPT_PIPELINE_SERVER_BL, server_blacklist);

(Added in 7.30.0)

CURLMOPT_MAX_TOTAL_CONNECTIONS

Pass a long. The set number will be used as the maximum amount of simultaneously open connections in total. For each new session, libcurl will open a new connection up to the limit set by CURLMOPT_MAX_TOTAL_CONNECTIONS. When the limit is reached, the sessions will be pending until there are available connections. If CURLMOPT_PIPELINING is 1, libcurl will try to pipeline if the host is capable of it.

The default value is 0, which means that there is no limit. However, for backwards compatibility, setting it to 0 when CURLMOPT_PIPELINING is 1 will not be treated as unlimited. Instead it will open only 1 connection and try to pipeline on it.

(Added in 7.30.0)

RETURNS

The standard CURLMcode for multi interface error codes. Note that it returns a CURLM_UNKNOWN_OPTION if you try setting an option that this version of libcurl doesn't know of.

AVAILABILITY

This function was added in libcurl 7.15.4.

SEE ALSO

curl_multi_cleanup (3) curl_multi_init (3) curl_multi_socket (3) curl_multi_info_read (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_easy_perform.html0000644000175000017500000000566712272124467016513 00000000000000 curl_easy_perform man page

NAME

curl_easy_perform - Perform a file transfer

SYNOPSIS

#include <curl/curl.h>

CURLcode curl_easy_perform(CURL * handle );

DESCRIPTION

This function is called after the init and all the curl_easy_setopt(3) calls are made, and will perform the transfer as described in the options. It must be called with the same handle as input as the curl_easy_init call returned.

You can do any amount of calls to curl_easy_perform(3) while using the same handle. If you intend to transfer more than one file, you are even encouraged to do so. libcurl will then attempt to re-use the same connection for the following transfers, thus making the operations faster, less CPU intense and using less network resources. Just note that you will have to use curl_easy_setopt(3) between the invokes to set options for the following curl_easy_perform.

You must never call this function simultaneously from two places using the same handle. Let the function return first before invoking it another time. If you want parallel transfers, you must use several curl handles.

RETURN VALUE

0 means everything was ok, non-zero means an error occurred as <curl/curl.h> defines. If the CURLOPT_ERRORBUFFER was set with curl_easy_setopt there will be a readable error message in the error buffer when non-zero is returned.

SEE ALSO

curl_easy_init (3) curl_easy_setopt (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_multi_timeout.html0000644000175000017500000000724612272124467016713 00000000000000 curl_multi_timeout man page

NAME

curl_multi_timeout - how long to wait for action before proceeding

SYNOPSIS

#include <curl/curl.h>

CURLMcode curl_multi_timeout(CURLM *multi_handle, long *timeout);

DESCRIPTION

An application using the libcurl multi interface should call curl_multi_timeout(3) to figure out how long it should wait for socket actions - at most - before proceeding.

Proceeding means either doing the socket-style timeout action: call the curl_multi_socket_action(3) function with the sockfd argument set to CURL_SOCKET_TIMEOUT, or call curl_multi_perform(3) if you're using the simpler and older multi interface approach.

The timeout value returned in the long timeout points to, is in number of milliseconds at this very moment. If 0, it means you should proceed immediately without waiting for anything. If it returns -1, there's no timeout at all set.

An application that uses the multi_socket API SHOULD NOT use this function, but SHOULD instead use curl_multi_setopt(3) and its CURLMOPT_TIMERFUNCTION option for proper and desired behavior.

Note: if libcurl returns a -1 timeout here, it just means that libcurl currently has no stored timeout value. You must not wait too long (more than a few seconds perhaps) before you call curl_multi_perform() again.

RETURN VALUE

The standard CURLMcode for multi interface error codes.

TYPICAL USAGE

Call curl_multi_timeout(3), then wait for action on the sockets. You figure out which sockets to wait for by calling curl_multi_fdset(3) or by a previous call to curl_multi_socket(3).

AVAILABILITY

This function was added in libcurl 7.15.4.

SEE ALSO

curl_multi_fdset (3) curl_multi_info_read (3) curl_multi_socket (3) curl_multi_setopt (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/libcurl-easy.pdf0000644000175000017500000001020712272124473015152 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœmVÛŽÛ6}÷WûX³"u#Ó6)Ò´MA¶´2½VcIŽDÅð?äWú=CŠ–œ-öÁ^™š9sÎÌ~a1,¦¿é³jV?¼+ØÓ°ŠÙÓêËJ¸ÙôQ5ìÇ-(z°Ý¯ü;‚’:áJ³m³™à*cÛó*:ÖÕØ¢äaͦÖÛVRƼHðêv‡úõ=Ÿk´4.ØFÈ+º¡ƒù/[¢Õ\k™+­[ÿ½ý…‰ÌåA¬$›ò|5×üšK¥Uêøõ_k³–Ytvoß!òŒç)Ðä\¹0?¿úó§w¯ß¾þíí-n”0ãÜÑõ×Á´lêö)°ö‚^J¸ ÕJ‘ r8ÜÍ .D>=§bï–Úä<Ë2=©‡\³4—nÄÁÚÒ—ž fê®ee»cOƲ’ðõhØCÔí-õfoúÞì˜íX9໣dNT‘(èÎ5)Ò˜´ðAîÖ÷ì|¨«ƒË:†BÔíi´ÎÌJ`4FÑå~l+ `Cx“³÷ƒ™Èqàâé4@Ü}¢€Ÿ¨¾kïÍô’ ­Ôt¨b pÅ$š(ÏB1S ÜŠÉå2eÛ7«èC·~±’\¥éU=QÕ,D ¥A‚„NC‚®µu;öx÷Ö’ìåñè¸èNsÅg #r¼—«9DâUl-(s¯Œ§ªk(†íËv€Rnr-ñÐ’EïÜÛ+4Å…LâÐõˆÓtb6§®·½l:Šy0§&FƒËbÑ»ªpHêÁ¡xÿî «í`Ž{´ ¡¯Ê641èvH0o*$´K$Eª ¬|Må ßÖp‚8Ö*ºØUz®í¡©S‡“©êohMÊ_zÞšò‚¾q™L€ 9´Ïagßf±“B‡#z©õ)M †$ñu²¢ã'•Šç¹žùÉ’Ä—Aœ<¬9û€æ&Ê"ÂX?,Æ%µpz¢ÑlèöŽÇDzúÂŒ­¸©y3šzýlQ úù†P ®¯kƒ:Ãjº~šƒz˜fN¼À8ÒЧE‘Î~IGñ*’Œ§{'¼%ž&%6Op”®÷ …áð6û]2È£ž0¸VyÕ² Ìã@+í[^Áò8 ÄØóÜjt$¹NuQxo®½ @Ânö¤"å‰Î¿[tÒ“]˜¾´Á¼Ïè0˜Ë §;–ªËK¢pBÐ/†.ñ¼;ìØc!(8µDë®ki cUa=ìÇãñ OÛYôò$Žà´Ì¼8p@éŒ?z‰Ñßr~@?ÔÕ”;㵂=¸nog,—Î$$àÆEèŒs·¼ ¨t"ŒrùٜܒŠoÊÏ7‘rPœÏ»qiÉY\­QÏÐ.¬ó!Ó<*lÿûnà¦R(õµûª„ŒöG¶‹œà‘ ¢bÈý!Ý|CŠ {?m²Œl¶ 9Yju4e;ž‡a9cWÐÐ?ï]¸8dx¾ÿ¦ ×ÞuПõ® å¡se¡¸ŠÓ›š„Æö˜/2x³[OnYÃÏȼЈC=à¶`YÕµ­ñ›Ûk½›{rÂ@×¥8Üììb_"â,ޝÀÛÖO’\í5ª›ÆìêñÅy‹Óó=îþqápaÒ½#­N@-w¬19úF-üâ¶'†éfæÔ(›é¾²¼茶Ì&-2.=›Á„ ŽŠŠõFdذ¿Ÿ˜ŒãÄÑ‘æAq^mWàï?¨2—endstream endobj 6 0 obj 1410 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:47+01:00 2014-01-29T08:09:47+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001734 00000 n 0000003624 00000 n 0000001675 00000 n 0000001515 00000 n 0000000015 00000 n 0000001495 00000 n 0000001799 00000 n 0000002053 00000 n 0000001988 00000 n 0000001920 00000 n 0000001840 00000 n 0000001870 00000 n 0000002135 00000 n 0000002201 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 3778 %%EOF curl-7.35.0/docs/libcurl/curl_multi_info_read.30000644000175000017500000000653112213173003016326 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_multi_info_read 3 "18 Dec 2004" "libcurl 7.10.3" "libcurl Manual" .SH NAME curl_multi_info_read - read multi stack informationals .SH SYNOPSIS #include CURLMsg *curl_multi_info_read( CURLM *multi_handle, int *msgs_in_queue); .ad .SH DESCRIPTION Ask the multi handle if there are any messages/informationals from the individual transfers. Messages may include informationals such as an 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 NULL is returned as a signal that there is no more to get at this point. The integer pointed to with \fImsgs_in_queue\fP will contain the number of remaining messages after this function was called. When you fetch a message using this function, it is removed from the internal queue so calling this function again will not return the same message again. It will instead return new messages at each new invoke until the queue is emptied. \fBWARNING:\fP The data the returned pointer points to will not survive calling \fIcurl_multi_cleanup(3)\fP, \fIcurl_multi_remove_handle(3)\fP or \fIcurl_easy_cleanup(3)\fP. The 'CURLMsg' struct is very simple and only contains very basic information. If more involved information is wanted, the particular "easy handle" in present in that struct and can thus be used in subsequent regular \fIcurl_easy_getinfo(3)\fP calls (or similar): .nf 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; }; .fi When \fBmsg\fP is \fICURLMSG_DONE\fP, the message identifies a transfer that is done, and then \fBresult\fP contains the return code for the easy handle that just completed. At this point, there are no other \fBmsg\fP types defined. .SH "RETURN VALUE" 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. .SH "SEE ALSO" .BR curl_multi_cleanup "(3), " curl_multi_init "(3), " curl_multi_perform "(3)" curl-7.35.0/docs/libcurl/libcurl-tutorial.30000644000175000017500000017622212262353672015463 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2013, 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. .\" * .\" ************************************************************************** .\" .TH libcurl-tutorial 3 "4 Mar 2009" "libcurl" "libcurl programming" .SH NAME libcurl-tutorial \- libcurl programming tutorial .SH "Objective" This document attempts to describe the general principles and some basic approaches to consider when programming with libcurl. The text will focus mainly on the C interface but might apply fairly well on other interfaces as well as they usually follow the C one pretty closely. This document will refer to 'the user' as the person writing the source code that uses libcurl. That would probably be you or someone in your position. What will be generally referred to as 'the program' will be the collected source code that you write that is using libcurl for transfers. The program is outside libcurl and libcurl is outside of the program. To get more details on all options and functions described herein, please refer to their respective man pages. .SH "Building" There are many different ways to build C programs. This chapter will assume a UNIX-style build process. If you use a different build system, you can still read this to get general information that may apply to your environment as well. .IP "Compiling the Program" Your compiler needs to know where the libcurl headers are located. Therefore you must set your compiler's include path to point to the directory where you installed them. The 'curl-config'[3] tool can be used to get this information: $ curl-config --cflags .IP "Linking the Program with libcurl" When having compiled the program, you need to link your object files to create a single executable. For that to succeed, you need to link with libcurl and possibly also with other libraries that libcurl itself depends on. Like the OpenSSL libraries, but even some standard OS libraries may be needed on the command line. To figure out which flags to use, once again the 'curl-config' tool comes to the rescue: $ curl-config --libs .IP "SSL or Not" libcurl can be built and customized in many ways. One of the things that varies from different libraries and builds is the support for SSL-based transfers, like HTTPS and FTPS. If a supported SSL library was detected properly at build-time, libcurl will be built with SSL support. To figure out if an installed libcurl has been built with SSL support enabled, use \&'curl-config' like this: $ curl-config --feature And if SSL is supported, the keyword 'SSL' will be written to stdout, possibly together with a few other features that could be either on or off on for different libcurls. See also the "Features libcurl Provides" further down. .IP "autoconf macro" When you write your configure script to detect libcurl and setup variables accordingly, we offer a prewritten macro that probably does everything you need in this area. See docs/libcurl/libcurl.m4 file - it includes docs on how to use it. .SH "Portable Code in a Portable World" The people behind libcurl have put a considerable effort to make libcurl work on a large amount of different operating systems and environments. You program libcurl the same way on all platforms that libcurl runs on. There are only very few minor considerations that differ. If you just make sure to write your code portable enough, you may very well create yourself a very portable program. libcurl shouldn't stop you from that. .SH "Global Preparation" The program must initialize some of the libcurl functionality globally. That means it should be done exactly once, no matter how many times you intend to use the library. Once for your program's entire life time. This is done using curl_global_init() and it takes one parameter which is a bit pattern that tells libcurl what to initialize. Using \fICURL_GLOBAL_ALL\fP will make it initialize all known internal sub modules, and might be a good default option. The current two bits that are specified are: .RS .IP "CURL_GLOBAL_WIN32" which only does anything on Windows machines. When used on a Windows machine, it'll make libcurl initialize the win32 socket stuff. Without having that initialized properly, your program cannot use sockets properly. You should only do this once for each application, so if your program already does this or of another library in use does it, you should not tell libcurl to do this as well. .IP CURL_GLOBAL_SSL which only does anything on libcurls compiled and built SSL-enabled. On these systems, this will make libcurl initialize the SSL library properly for this application. This only needs to be done once for each application so if your program or another library already does this, this bit should not be needed. .RE libcurl has a default protection mechanism that detects if \fIcurl_global_init(3)\fP hasn't been called by the time \fIcurl_easy_perform(3)\fP is called and if that is the case, libcurl runs the function itself with a guessed bit pattern. Please note that depending solely on this is not considered nice nor very good. When the program no longer uses libcurl, it should call \fIcurl_global_cleanup(3)\fP, which is the opposite of the init call. It will then do the reversed operations to cleanup the resources the \fIcurl_global_init(3)\fP call initialized. Repeated calls to \fIcurl_global_init(3)\fP and \fIcurl_global_cleanup(3)\fP should be avoided. They should only be called once each. .SH "Features libcurl Provides" It is considered best-practice to determine libcurl features at run-time rather than at build-time (if possible of course). By calling \fIcurl_version_info(3)\fP and checking out the details of the returned struct, your program can figure out exactly what the currently running libcurl supports. .SH "Handle the Easy libcurl" libcurl first introduced the so called easy interface. All operations in the easy interface are prefixed with 'curl_easy'. Recent libcurl versions also offer the multi interface. More about that interface, what it is targeted for and how to use it is detailed in a separate chapter further down. You still need to understand the easy interface first, so please continue reading for better understanding. To use the easy interface, you must first create yourself an easy handle. You need one handle for each easy session you want to perform. Basically, you should use one handle for every thread you plan to use for transferring. You must never share the same handle in multiple threads. Get an easy handle with easyhandle = curl_easy_init(); It returns an easy handle. Using that you proceed to the next step: setting up your preferred actions. A handle is just a logic entity for the upcoming transfer or series of transfers. You set properties and options for this handle using \fIcurl_easy_setopt(3)\fP. They control how the subsequent transfer or transfers will be made. Options remain set in the handle until set again to something different. Alas, multiple requests using the same handle will use the same options. Many of the options you set in libcurl are "strings", pointers to data terminated with a zero byte. When you set strings with \fIcurl_easy_setopt(3)\fP, libcurl makes its own copy so that they don't need to be kept around in your application after being set[4]. One of the most basic properties to set in the handle is the URL. You set your preferred URL to transfer with CURLOPT_URL in a manner similar to: .nf curl_easy_setopt(handle, CURLOPT_URL, "http://domain.com/"); .fi Let's assume for a while that you want to receive data as the URL identifies a remote resource you want to get here. Since you write a sort of application that needs this transfer, I assume that you would like to get the data passed to you directly instead of simply getting it passed to stdout. So, you write your own function that matches this prototype: size_t write_data(void *buffer, size_t size, size_t nmemb, void *userp); You tell libcurl to pass all data to this function by issuing a function similar to this: curl_easy_setopt(easyhandle, CURLOPT_WRITEFUNCTION, write_data); You can control what data your callback function gets in the fourth argument by setting another property: curl_easy_setopt(easyhandle, CURLOPT_WRITEDATA, &internal_struct); Using that property, you can easily pass local data between your application and the function that gets invoked by libcurl. libcurl itself won't touch the data you pass with \fICURLOPT_WRITEDATA\fP. libcurl offers its own default internal callback that will take care of the data if you don't set the callback with \fICURLOPT_WRITEFUNCTION\fP. It will then simply output the received data to stdout. You can have the default callback write the data to a different file handle by passing a 'FILE *' to a file opened for writing with the \fICURLOPT_WRITEDATA\fP option. Now, we need to take a step back and have a deep breath. Here's one of those rare platform-dependent nitpicks. Did you spot it? On some platforms[2], libcurl won't be able to operate on files opened by the program. Thus, if you use the default callback and pass in an open file with \fICURLOPT_WRITEDATA\fP, it will crash. You should therefore avoid this to make your program run fine virtually everywhere. (\fICURLOPT_WRITEDATA\fP was formerly known as \fICURLOPT_FILE\fP. Both names still work and do the same thing). If you're using libcurl as a win32 DLL, you MUST use the \fICURLOPT_WRITEFUNCTION\fP if you set \fICURLOPT_WRITEDATA\fP - or you will experience crashes. There are of course many more options you can set, and we'll get back to a few of them later. Let's instead continue to the actual transfer: success = curl_easy_perform(easyhandle); \fIcurl_easy_perform(3)\fP will connect to the remote site, do the necessary commands and receive the transfer. Whenever it receives data, it calls the callback function we previously set. The function may get one byte at a time, or it may get many kilobytes at once. libcurl delivers as much as possible as often as possible. Your callback function should return the number of bytes it \&"took care of". If that is not the exact same amount of bytes that was passed to it, libcurl will abort the operation and return with an error code. When the transfer is complete, the function returns a return code that informs you if it succeeded in its mission or not. If a return code isn't enough for you, you can use the CURLOPT_ERRORBUFFER to point libcurl to a buffer of yours where it'll store a human readable error message as well. If you then want to transfer another file, the handle is ready to be used again. Mind you, it is even preferred that you re-use an existing handle if you intend to make another transfer. libcurl will then attempt to re-use the previous connection. For some protocols, downloading a file can involve a complicated process of logging in, setting the transfer mode, changing the current directory and finally transferring the file data. libcurl takes care of all that complication for you. Given simply the URL to a file, libcurl will take care of all the details needed to get the file moved from one machine to another. .SH "Multi-threading Issues" The first basic rule is that you must \fBnever\fP simultaneously share a libcurl handle (be it easy or multi or whatever) between multiple threads. Only use one handle in one thread at any time. You can pass the handles around among threads, but you must never use a single handle from more than one thread at any given time. libcurl is completely thread safe, except for two issues: signals and SSL/TLS handlers. Signals are used for timing out name resolves (during DNS lookup) - when built without c-ares support and not on Windows. If you are accessing HTTPS or FTPS URLs in a multi-threaded manner, you are then of course using the underlying SSL library multi-threaded and those libs might have their own requirements on this issue. Basically, you need to provide one or two functions to allow it to function properly. For all details, see this: OpenSSL http://www.openssl.org/docs/crypto/threads.html#DESCRIPTION GnuTLS http://www.gnu.org/software/gnutls/manual/html_node/Multi_002dthreaded-applications.html NSS is claimed to be thread-safe already without anything required. PolarSSL Required actions unknown. yassl Required actions unknown. axTLS Required actions unknown. Secure Transport The engine is fully thread-safe, and no additional steps are required. When using multiple threads you should set the CURLOPT_NOSIGNAL option to 1 for all handles. Everything will or might work fine except that timeouts are not honored during the DNS lookup - which you can work around by building libcurl with c-ares support. c-ares is a library that provides asynchronous name resolves. On some platforms, libcurl simply will not function properly multi-threaded unless this option is set. Also, note that CURLOPT_DNS_USE_GLOBAL_CACHE is not thread-safe. .SH "When It Doesn't Work" There will always be times when the transfer fails for some reason. You might have set the wrong libcurl option or misunderstood what the libcurl option actually does, or the remote server might return non-standard replies that confuse the library which then confuses your program. There's one golden rule when these things occur: set the CURLOPT_VERBOSE option to 1. It'll cause the library to spew out the entire protocol details it sends, some internal info and some received protocol data as well (especially when using FTP). If you're using HTTP, adding the headers in the received output to study is also a clever way to get a better understanding why the server behaves the way it does. Include headers in the normal body output with CURLOPT_HEADER set 1. Of course, there are bugs left. We need to know about them to be able to fix them, so we're quite dependent on your bug reports! When you do report suspected bugs in libcurl, please include as many details as you possibly can: a protocol dump that CURLOPT_VERBOSE produces, library version, as much as possible of your code that uses libcurl, operating system name and version, compiler name and version etc. If CURLOPT_VERBOSE is not enough, you increase the level of debug data your application receive by using the CURLOPT_DEBUGFUNCTION. Getting some in-depth knowledge about the protocols involved is never wrong, and if you're trying to do funny things, you might very well understand libcurl and how to use it better if you study the appropriate RFC documents at least briefly. .SH "Upload Data to a Remote Site" libcurl tries to keep a protocol independent approach to most transfers, thus uploading to a remote FTP site is very similar to uploading data to a HTTP server with a PUT request. Of course, first you either create an easy handle or you re-use one existing one. Then you set the URL to operate on just like before. This is the remote URL, that we now will upload. Since we write an application, we most likely want libcurl to get the upload data by asking us for it. To make it do that, we set the read callback and the custom pointer libcurl will pass to our read callback. The read callback should have a prototype similar to: size_t function(char *bufptr, size_t size, size_t nitems, void *userp); Where bufptr is the pointer to a buffer we fill in with data to upload and size*nitems is the size of the buffer and therefore also the maximum amount of data we can return to libcurl in this call. The 'userp' pointer is the custom pointer we set to point to a struct of ours to pass private data between the application and the callback. curl_easy_setopt(easyhandle, CURLOPT_READFUNCTION, read_function); curl_easy_setopt(easyhandle, CURLOPT_READDATA, &filedata); Tell libcurl that we want to upload: curl_easy_setopt(easyhandle, CURLOPT_UPLOAD, 1L); A few protocols won't behave properly when uploads are done without any prior knowledge of the expected file size. So, set the upload file size using the CURLOPT_INFILESIZE_LARGE for all known file sizes like this[1]: .nf /* in this example, file_size must be an curl_off_t variable */ curl_easy_setopt(easyhandle, CURLOPT_INFILESIZE_LARGE, file_size); .fi When you call \fIcurl_easy_perform(3)\fP this time, it'll perform all the necessary operations and when it has invoked the upload it'll call your supplied callback to get the data to upload. The program should return as much data as possible in every invoke, as that is likely to make the upload perform as fast as possible. The callback should return the number of bytes it wrote in the buffer. Returning 0 will signal the end of the upload. .SH "Passwords" Many protocols use or even require that user name and password are provided to be able to download or upload the data of your choice. libcurl offers several ways to specify them. Most protocols support that you specify the name and password in the URL itself. libcurl will detect this and use them accordingly. This is written like this: protocol://user:password@example.com/path/ If you need any odd letters in your user name or password, you should enter them URL encoded, as %XX where XX is a two-digit hexadecimal number. libcurl also provides options to set various passwords. The user name and password as shown embedded in the URL can instead get set with the CURLOPT_USERPWD option. The argument passed to libcurl should be a char * to a string in the format "user:password". In a manner like this: curl_easy_setopt(easyhandle, CURLOPT_USERPWD, "myname:thesecret"); Another case where name and password might be needed at times, is for those users who need to authenticate themselves to a proxy they use. libcurl offers another option for this, the CURLOPT_PROXYUSERPWD. It is used quite similar to the CURLOPT_USERPWD option like this: curl_easy_setopt(easyhandle, CURLOPT_PROXYUSERPWD, "myname:thesecret"); There's a long time UNIX "standard" way of storing ftp user names and passwords, namely in the $HOME/.netrc file. The file should be made private so that only the user may read it (see also the "Security Considerations" chapter), as it might contain the password in plain text. libcurl has the ability to use this file to figure out what set of user name and password to use for a particular host. As an extension to the normal functionality, libcurl also supports this file for non-FTP protocols such as HTTP. To make curl use this file, use the CURLOPT_NETRC option: curl_easy_setopt(easyhandle, CURLOPT_NETRC, 1L); And a very basic example of how such a .netrc file may look like: .nf machine myhost.mydomain.com login userlogin password secretword .fi All these examples have been cases where the password has been optional, or at least you could leave it out and have libcurl attempt to do its job without it. There are times when the password isn't optional, like when you're using an SSL private key for secure transfers. To pass the known private key password to libcurl: curl_easy_setopt(easyhandle, CURLOPT_KEYPASSWD, "keypassword"); .SH "HTTP Authentication" The previous chapter showed how to set user name and password for getting URLs that require authentication. When using the HTTP protocol, there are many different ways a client can provide those credentials to the server and you can control which way libcurl will (attempt to) use them. The default HTTP authentication method is called 'Basic', which is sending the name and password in clear-text in the HTTP request, base64-encoded. This is insecure. At the time of this writing, libcurl can be built to use: Basic, Digest, NTLM, Negotiate, GSS-Negotiate and SPNEGO. You can tell libcurl which one to use with CURLOPT_HTTPAUTH as in: curl_easy_setopt(easyhandle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); And when you send authentication to a proxy, you can also set authentication type the same way but instead with CURLOPT_PROXYAUTH: curl_easy_setopt(easyhandle, CURLOPT_PROXYAUTH, CURLAUTH_NTLM); Both these options allow you to set multiple types (by ORing them together), to make libcurl pick the most secure one out of the types the server/proxy claims to support. This method does however add a round-trip since libcurl must first ask the server what it supports: curl_easy_setopt(easyhandle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST|CURLAUTH_BASIC); For convenience, you can use the 'CURLAUTH_ANY' define (instead of a list with specific types) which allows libcurl to use whatever method it wants. When asking for multiple types, libcurl will pick the available one it considers "best" in its own internal order of preference. .SH "HTTP POSTing" We get many questions regarding how to issue HTTP POSTs with libcurl the proper way. This chapter will thus include examples using both different versions of HTTP POST that libcurl supports. The first version is the simple POST, the most common version, that most HTML pages using the

tag uses. We provide a pointer to the data and tell libcurl to post it all to the remote site: .nf char *data="name=daniel&project=curl"; curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDS, data); curl_easy_setopt(easyhandle, CURLOPT_URL, "http://posthere.com/"); curl_easy_perform(easyhandle); /* post away! */ .fi Simple enough, huh? Since you set the POST options with the CURLOPT_POSTFIELDS, this automatically switches the handle to use POST in the upcoming request. Ok, so what if you want to post binary data that also requires you to set the Content-Type: header of the post? Well, binary posts prevent libcurl from being able to do strlen() on the data to figure out the size, so therefore we must tell libcurl the size of the post data. Setting headers in libcurl requests are done in a generic way, by building a list of our own headers and then passing that list to libcurl. .nf struct curl_slist *headers=NULL; headers = curl_slist_append(headers, "Content-Type: text/xml"); /* post binary data */ curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDS, binaryptr); /* set the size of the postfields data */ curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDSIZE, 23L); /* pass our list of custom made headers */ curl_easy_setopt(easyhandle, CURLOPT_HTTPHEADER, headers); curl_easy_perform(easyhandle); /* post away! */ curl_slist_free_all(headers); /* free the header list */ .fi While the simple examples above cover the majority of all cases where HTTP POST operations are required, they don't do multi-part formposts. Multi-part formposts were introduced as a better way to post (possibly large) binary data and were first documented in the RFC1867 (updated in RFC2388). They're called multi-part because they're built by a chain of parts, each part being a single unit of data. Each part has its own name and contents. You can in fact create and post a multi-part formpost with the regular libcurl POST support described above, but that would require that you build a formpost yourself and provide to libcurl. To make that easier, libcurl provides \fIcurl_formadd(3)\fP. Using this function, you add parts to the form. When you're done adding parts, you post the whole form. The following example sets two simple text parts with plain textual contents, and then a file with binary contents and uploads the whole thing. .nf struct curl_httppost *post=NULL; struct curl_httppost *last=NULL; curl_formadd(&post, &last, CURLFORM_COPYNAME, "name", CURLFORM_COPYCONTENTS, "daniel", CURLFORM_END); curl_formadd(&post, &last, CURLFORM_COPYNAME, "project", CURLFORM_COPYCONTENTS, "curl", CURLFORM_END); curl_formadd(&post, &last, CURLFORM_COPYNAME, "logotype-image", CURLFORM_FILECONTENT, "curl.png", CURLFORM_END); /* Set the form info */ curl_easy_setopt(easyhandle, CURLOPT_HTTPPOST, post); curl_easy_perform(easyhandle); /* post away! */ /* free the post data again */ curl_formfree(post); .fi Multipart formposts are chains of parts using MIME-style separators and headers. It means that each one of these separate parts get a few headers set that describe the individual content-type, size etc. To enable your application to handicraft this formpost even more, libcurl allows you to supply your own set of custom headers to such an individual form part. You can of course supply headers to as many parts as you like, but this little example will show how you set headers to one specific part when you add that to the post handle: .nf struct curl_slist *headers=NULL; headers = curl_slist_append(headers, "Content-Type: text/xml"); curl_formadd(&post, &last, CURLFORM_COPYNAME, "logotype-image", CURLFORM_FILECONTENT, "curl.xml", CURLFORM_CONTENTHEADER, headers, CURLFORM_END); curl_easy_perform(easyhandle); /* post away! */ curl_formfree(post); /* free post */ curl_slist_free_all(headers); /* free custom header list */ .fi Since all options on an easyhandle are "sticky", they remain the same until changed even if you do call \fIcurl_easy_perform(3)\fP, you may need to tell curl to go back to a plain GET request if you intend to do one as your next request. You force an easyhandle to go back to GET by using the CURLOPT_HTTPGET option: curl_easy_setopt(easyhandle, CURLOPT_HTTPGET, 1L); Just setting CURLOPT_POSTFIELDS to "" or NULL will *not* stop libcurl from doing a POST. It will just make it POST without any data to send! .SH "Showing Progress" For historical and traditional reasons, libcurl has a built-in progress meter that can be switched on and then makes it present a progress meter in your terminal. Switch on the progress meter by, oddly enough, setting CURLOPT_NOPROGRESS to zero. This option is set to 1 by default. For most applications however, the built-in progress meter is useless and what instead is interesting is the ability to specify a progress callback. The function pointer you pass to libcurl will then be called on irregular intervals with information about the current transfer. Set the progress callback by using CURLOPT_PROGRESSFUNCTION. And pass a pointer to a function that matches this prototype: .nf int progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow); .fi If any of the input arguments is unknown, a 0 will be passed. The first argument, the 'clientp' is the pointer you pass to libcurl with CURLOPT_PROGRESSDATA. libcurl won't touch it. .SH "libcurl with C++" There's basically only one thing to keep in mind when using C++ instead of C when interfacing libcurl: The callbacks CANNOT be non-static class member functions Example C++ code: .nf class AClass { static size_t write_data(void *ptr, size_t size, size_t nmemb, void *ourpointer) { /* do what you want with the data */ } } .fi .SH "Proxies" What "proxy" means according to Merriam-Webster: "a person authorized to act for another" but also "the agency, function, or office of a deputy who acts as a substitute for another". Proxies are exceedingly common these days. Companies often only offer Internet access to employees through their proxies. Network clients or user-agents ask the proxy for documents, the proxy does the actual request and then it returns them. libcurl supports SOCKS and HTTP proxies. When a given URL is wanted, libcurl will ask the proxy for it instead of trying to connect to the actual host identified in the URL. If you're using a SOCKS proxy, you may find that libcurl doesn't quite support all operations through it. For HTTP proxies: the fact that the proxy is a HTTP proxy puts certain restrictions on what can actually happen. A requested URL that might not be a HTTP URL will be still be passed to the HTTP proxy to deliver back to libcurl. This happens transparently, and an application may not need to know. I say "may", because at times it is very important to understand that all operations over a HTTP proxy use the HTTP protocol. For example, you can't invoke your own custom FTP commands or even proper FTP directory listings. .IP "Proxy Options" To tell libcurl to use a proxy at a given port number: curl_easy_setopt(easyhandle, CURLOPT_PROXY, "proxy-host.com:8080"); Some proxies require user authentication before allowing a request, and you pass that information similar to this: curl_easy_setopt(easyhandle, CURLOPT_PROXYUSERPWD, "user:password"); If you want to, you can specify the host name only in the CURLOPT_PROXY option, and set the port number separately with CURLOPT_PROXYPORT. Tell libcurl what kind of proxy it is with CURLOPT_PROXYTYPE (if not, it will default to assume a HTTP proxy): curl_easy_setopt(easyhandle, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); .IP "Environment Variables" libcurl automatically checks and uses a set of environment variables to know what proxies to use for certain protocols. The names of the variables are following an ancient de facto standard and are built up as "[protocol]_proxy" (note the lower casing). Which makes the variable \&'http_proxy' checked for a name of a proxy to use when the input URL is HTTP. Following the same rule, the variable named 'ftp_proxy' is checked for FTP URLs. Again, the proxies are always HTTP proxies, the different names of the variables simply allows different HTTP proxies to be used. The proxy environment variable contents should be in the format \&"[protocol://][user:password@]machine[:port]". Where the protocol:// part is simply ignored if present (so http://proxy and bluerk://proxy will do the same) and the optional port number specifies on which port the proxy operates on the host. If not specified, the internal default port number will be used and that is most likely *not* the one you would like it to be. There are two special environment variables. 'all_proxy' is what sets proxy for any URL in case the protocol specific variable wasn't set, and \&'no_proxy' defines a list of hosts that should not use a proxy even though a variable may say so. If 'no_proxy' is a plain asterisk ("*") it matches all hosts. To explicitly disable libcurl's checking for and using the proxy environment variables, set the proxy name to "" - an empty string - with CURLOPT_PROXY. .IP "SSL and Proxies" SSL is for secure point-to-point connections. This involves strong encryption and similar things, which effectively makes it impossible for a proxy to operate as a "man in between" which the proxy's task is, as previously discussed. Instead, the only way to have SSL work over a HTTP proxy is to ask the proxy to tunnel trough everything without being able to check or fiddle with the traffic. Opening an SSL connection over a HTTP proxy is therefor a matter of asking the proxy for a straight connection to the target host on a specified port. This is made with the HTTP request CONNECT. ("please mr proxy, connect me to that remote host"). Because of the nature of this operation, where the proxy has no idea what kind of data that is passed in and out through this tunnel, this breaks some of the very few advantages that come from using a proxy, such as caching. Many organizations prevent this kind of tunneling to other destination port numbers than 443 (which is the default HTTPS port number). .IP "Tunneling Through Proxy" As explained above, tunneling is required for SSL to work and often even restricted to the operation intended for SSL; HTTPS. This is however not the only time proxy-tunneling might offer benefits to you or your application. As tunneling opens a direct connection from your application to the remote machine, it suddenly also re-introduces the ability to do non-HTTP operations over a HTTP proxy. You can in fact use things such as FTP upload or FTP custom commands this way. Again, this is often prevented by the administrators of proxies and is rarely allowed. Tell libcurl to use proxy tunneling like this: curl_easy_setopt(easyhandle, CURLOPT_HTTPPROXYTUNNEL, 1L); In fact, there might even be times when you want to do plain HTTP operations using a tunnel like this, as it then enables you to operate on the remote server instead of asking the proxy to do so. libcurl will not stand in the way for such innovative actions either! .IP "Proxy Auto-Config" Netscape first came up with this. It is basically a web page (usually using a \&.pac extension) with a Javascript that when executed by the browser with the requested URL as input, returns information to the browser on how to connect to the URL. The returned information might be "DIRECT" (which means no proxy should be used), "PROXY host:port" (to tell the browser where the proxy for this particular URL is) or "SOCKS host:port" (to direct the browser to a SOCKS proxy). libcurl has no means to interpret or evaluate Javascript and thus it doesn't support this. If you get yourself in a position where you face this nasty invention, the following advice have been mentioned and used in the past: - Depending on the Javascript complexity, write up a script that translates it to another language and execute that. - Read the Javascript code and rewrite the same logic in another language. - Implement a Javascript interpreter; people have successfully used the Mozilla Javascript engine in the past. - Ask your admins to stop this, for a static proxy setup or similar. .SH "Persistence Is The Way to Happiness" Re-cycling the same easy handle several times when doing multiple requests is the way to go. After each single \fIcurl_easy_perform(3)\fP operation, libcurl will keep the connection alive and open. A subsequent request using the same easy handle to the same host might just be able to use the already open connection! This reduces network impact a lot. Even if the connection is dropped, all connections involving SSL to the same host again, will benefit from libcurl's session ID cache that drastically reduces re-connection time. FTP connections that are kept alive save a lot of time, as the command- response round-trips are skipped, and also you don't risk getting blocked without permission to login again like on many FTP servers only allowing N persons to be logged in at the same time. libcurl caches DNS name resolving results, to make lookups of a previously looked up name a lot faster. Other interesting details that improve performance for subsequent requests may also be added in the future. Each easy handle will attempt to keep the last few connections alive for a while in case they are to be used again. You can set the size of this "cache" with the CURLOPT_MAXCONNECTS option. Default is 5. There is very seldom any point in changing this value, and if you think of changing this it is often just a matter of thinking again. To force your upcoming request to not use an already existing connection (it will even close one first if there happens to be one alive to the same host you're about to operate on), you can do that by setting CURLOPT_FRESH_CONNECT to 1. In a similar spirit, you can also forbid the upcoming request to be "lying" around and possibly get re-used after the request by setting CURLOPT_FORBID_REUSE to 1. .SH "HTTP Headers Used by libcurl" When you use libcurl to do HTTP requests, it'll pass along a series of headers automatically. It might be good for you to know and understand these. You can replace or remove them by using the CURLOPT_HTTPHEADER option. .IP "Host" This header is required by HTTP 1.1 and even many 1.0 servers and should be the name of the server we want to talk to. This includes the port number if anything but default. .IP "Accept" \&"*/*". .IP "Expect" When doing POST requests, libcurl sets this header to \&"100-continue" to ask the server for an "OK" message before it proceeds with sending the data part of the post. If the POSTed data amount is deemed "small", libcurl will not use this header. .SH "Customizing Operations" There is an ongoing development today where more and more protocols are built upon HTTP for transport. This has obvious benefits as HTTP is a tested and reliable protocol that is widely deployed and has excellent proxy-support. When you use one of these protocols, and even when doing other kinds of programming you may need to change the traditional HTTP (or FTP or...) manners. You may need to change words, headers or various data. libcurl is your friend here too. .IP CUSTOMREQUEST If just changing the actual HTTP request keyword is what you want, like when GET, HEAD or POST is not good enough for you, CURLOPT_CUSTOMREQUEST is there for you. It is very simple to use: curl_easy_setopt(easyhandle, CURLOPT_CUSTOMREQUEST, "MYOWNREQUEST"); When using the custom request, you change the request keyword of the actual request you are performing. Thus, by default you make a GET request but you can also make a POST operation (as described before) and then replace the POST keyword if you want to. You're the boss. .IP "Modify Headers" HTTP-like protocols pass a series of headers to the server when doing the request, and you're free to pass any amount of extra headers that you think fit. Adding headers is this easy: .nf struct curl_slist *headers=NULL; /* init to NULL is important */ headers = curl_slist_append(headers, "Hey-server-hey: how are you?"); headers = curl_slist_append(headers, "X-silly-content: yes"); /* pass our list of custom made headers */ curl_easy_setopt(easyhandle, CURLOPT_HTTPHEADER, headers); curl_easy_perform(easyhandle); /* transfer http */ curl_slist_free_all(headers); /* free the header list */ .fi \&... and if you think some of the internally generated headers, such as Accept: or Host: don't contain the data you want them to contain, you can replace them by simply setting them too: .nf headers = curl_slist_append(headers, "Accept: Agent-007"); headers = curl_slist_append(headers, "Host: munged.host.line"); .fi .IP "Delete Headers" If you replace an existing header with one with no contents, you will prevent the header from being sent. For instance, if you want to completely prevent the \&"Accept:" header from being sent, you can disable it with code similar to this: headers = curl_slist_append(headers, "Accept:"); Both replacing and canceling internal headers should be done with careful consideration and you should be aware that you may violate the HTTP protocol when doing so. .IP "Enforcing chunked transfer-encoding" By making sure a request uses the custom header "Transfer-Encoding: chunked" when doing a non-GET HTTP operation, libcurl will switch over to "chunked" upload, even though the size of the data to upload might be known. By default, libcurl usually switches over to chunked upload automatically if the upload data size is unknown. .IP "HTTP Version" All HTTP requests includes the version number to tell the server which version we support. libcurl speaks HTTP 1.1 by default. Some very old servers don't like getting 1.1-requests and when dealing with stubborn old things like that, you can tell libcurl to use 1.0 instead by doing something like this: curl_easy_setopt(easyhandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); .IP "FTP Custom Commands" Not all protocols are HTTP-like, and thus the above may not help you when you want to make, for example, your FTP transfers to behave differently. Sending custom commands to a FTP server means that you need to send the commands exactly as the FTP server expects them (RFC959 is a good guide here), and you can only use commands that work on the control-connection alone. All kinds of commands that require data interchange and thus need a data-connection must be left to libcurl's own judgement. Also be aware that libcurl will do its very best to change directory to the target directory before doing any transfer, so if you change directory (with CWD or similar) you might confuse libcurl and then it might not attempt to transfer the file in the correct remote directory. A little example that deletes a given file before an operation: .nf headers = curl_slist_append(headers, "DELE file-to-remove"); /* pass the list of custom commands to the handle */ curl_easy_setopt(easyhandle, CURLOPT_QUOTE, headers); curl_easy_perform(easyhandle); /* transfer ftp data! */ curl_slist_free_all(headers); /* free the header list */ .fi If you would instead want this operation (or chain of operations) to happen _after_ the data transfer took place the option to \fIcurl_easy_setopt(3)\fP would instead be called CURLOPT_POSTQUOTE and used the exact same way. The custom FTP command will be issued to the server in the same order they are added to the list, and if a command gets an error code returned back from the server, no more commands will be issued and libcurl will bail out with an error code (CURLE_QUOTE_ERROR). Note that if you use CURLOPT_QUOTE to send commands before a transfer, no transfer will actually take place when a quote command has failed. If you set the CURLOPT_HEADER to 1, you will tell libcurl to get information about the target file and output "headers" about it. The headers will be in "HTTP-style", looking like they do in HTTP. The option to enable headers or to run custom FTP commands may be useful to combine with CURLOPT_NOBODY. If this option is set, no actual file content transfer will be performed. .IP "FTP Custom CUSTOMREQUEST" If you do want to list the contents of a FTP directory using your own defined FTP command, CURLOPT_CUSTOMREQUEST will do just that. "NLST" is the default one for listing directories but you're free to pass in your idea of a good alternative. .SH "Cookies Without Chocolate Chips" In the HTTP sense, a cookie is a name with an associated value. A server sends the name and value to the client, and expects it to get sent back on every subsequent request to the server that matches the particular conditions set. The conditions include that the domain name and path match and that the cookie hasn't become too old. In real-world cases, servers send new cookies to replace existing ones to update them. Server use cookies to "track" users and to keep "sessions". Cookies are sent from server to clients with the header Set-Cookie: and they're sent from clients to servers with the Cookie: header. To just send whatever cookie you want to a server, you can use CURLOPT_COOKIE to set a cookie string like this: curl_easy_setopt(easyhandle, CURLOPT_COOKIE, "name1=var1; name2=var2;"); In many cases, that is not enough. You might want to dynamically save whatever cookies the remote server passes to you, and make sure those cookies are then used accordingly on later requests. One way to do this, is to save all headers you receive in a plain file and when you make a request, you tell libcurl to read the previous headers to figure out which cookies to use. Set the header file to read cookies from with CURLOPT_COOKIEFILE. The CURLOPT_COOKIEFILE option also automatically enables the cookie parser in libcurl. Until the cookie parser is enabled, libcurl will not parse or understand incoming cookies and they will just be ignored. However, when the parser is enabled the cookies will be understood and the cookies will be kept in memory and used properly in subsequent requests when the same handle is used. Many times this is enough, and you may not have to save the cookies to disk at all. Note that the file you specify to CURLOPT_COOKIEFILE doesn't have to exist to enable the parser, so a common way to just enable the parser and not read any cookies is to use the name of a file you know doesn't exist. If you would rather use existing cookies that you've previously received with your Netscape or Mozilla browsers, you can make libcurl use that cookie file as input. The CURLOPT_COOKIEFILE is used for that too, as libcurl will automatically find out what kind of file it is and act accordingly. Perhaps the most advanced cookie operation libcurl offers, is saving the entire internal cookie state back into a Netscape/Mozilla formatted cookie file. We call that the cookie-jar. When you set a file name with CURLOPT_COOKIEJAR, that file name will be created and all received cookies will be stored in it when \fIcurl_easy_cleanup(3)\fP is called. This enables cookies to get passed on properly between multiple handles without any information getting lost. .SH "FTP Peculiarities We Need" FTP transfers use a second TCP/IP connection for the data transfer. This is usually a fact you can forget and ignore but at times this fact will come back to haunt you. libcurl offers several different ways to customize how the second connection is being made. libcurl can either connect to the server a second time or tell the server to connect back to it. The first option is the default and it is also what works best for all the people behind firewalls, NATs or IP-masquerading setups. libcurl then tells the server to open up a new port and wait for a second connection. This is by default attempted with EPSV first, and if that doesn't work it tries PASV instead. (EPSV is an extension to the original FTP spec and does not exist nor work on all FTP servers.) You can prevent libcurl from first trying the EPSV command by setting CURLOPT_FTP_USE_EPSV to zero. In some cases, you will prefer to have the server connect back to you for the second connection. This might be when the server is perhaps behind a firewall or something and only allows connections on a single port. libcurl then informs the remote server which IP address and port number to connect to. This is made with the CURLOPT_FTPPORT option. If you set it to "-", libcurl will use your system's "default IP address". If you want to use a particular IP, you can set the full IP address, a host name to resolve to an IP address or even a local network interface name that libcurl will get the IP address from. When doing the "PORT" approach, libcurl will attempt to use the EPRT and the LPRT before trying PORT, as they work with more protocols. You can disable this behavior by setting CURLOPT_FTP_USE_EPRT to zero. .SH "Headers Equal Fun" Some protocols provide "headers", meta-data separated from the normal data. These headers are by default not included in the normal data stream, but you can make them appear in the data stream by setting CURLOPT_HEADER to 1. What might be even more useful, is libcurl's ability to separate the headers from the data and thus make the callbacks differ. You can for example set a different pointer to pass to the ordinary write callback by setting CURLOPT_WRITEHEADER. Or, you can set an entirely separate function to receive the headers, by using CURLOPT_HEADERFUNCTION. The headers are passed to the callback function one by one, and you can depend on that fact. It makes it easier for you to add custom header parsers etc. \&"Headers" for FTP transfers equal all the FTP server responses. They aren't actually true headers, but in this case we pretend they are! ;-) .SH "Post Transfer Information" [ curl_easy_getinfo ] .SH "Security Considerations" The libcurl project takes security seriously. The library is written with caution and precautions are taken to mitigate many kinds of risks encountered while operating with potentially malicious servers on the Internet. It is a powerful library, however, which allows application writers to make trade offs between ease of writing and exposure to potential risky operations. If used the right way, you can use libcurl to transfer data pretty safely. Many applications are used in closed networks where users and servers can be trusted, but many others are used on arbitrary servers and are fed input from potentially untrusted users. Following is a discussion about some risks in the ways in which applications commonly use libcurl and potential mitigations of those risks. It is by no means comprehensive, but shows classes of attacks that robust applications should consider. The Common Weakness Enumeration project at http://cwe.mitre.org/ is a good reference for many of these and similar types of weaknesses of which application writers should be aware. .IP "Command Lines" If you use a command line tool (such as curl) that uses libcurl, and you give options to the tool on the command line those options can very likely get read by other users of your system when they use 'ps' or other tools to list currently running processes. To avoid this problem, never feed sensitive things to programs using command line options. Write them to a protected file and use the \-K option to avoid this. .IP ".netrc" \&.netrc is a pretty handy file/feature that allows you to login quickly and automatically to frequently visited sites. The file contains passwords in clear text and is a real security risk. In some cases, your .netrc is also stored in a home directory that is NFS mounted or used on another network based file system, so the clear text password will fly through your network every time anyone reads that file! To avoid this problem, don't use .netrc files and never store passwords in plain text anywhere. .IP "Clear Text Passwords" Many of the protocols libcurl supports send name and password unencrypted as clear text (HTTP Basic authentication, FTP, TELNET etc). It is very easy for anyone on your network or a network nearby yours to just fire up a network analyzer tool and eavesdrop on your passwords. Don't let the fact that HTTP Basic uses base64 encoded passwords fool you. They may not look readable at a first glance, but they very easily "deciphered" by anyone within seconds. To avoid this problem, use HTTP authentication methods or other protocols that don't let snoopers see your password: HTTP with Digest, NTLM or GSS authentication, HTTPS, FTPS, SCP, SFTP and FTP-Kerberos are a few examples. .IP "Redirects" The CURLOPT_FOLLOWLOCATION option automatically follows HTTP redirects sent by a remote server. These redirects can refer to any kind of URL, not just HTTP. A redirect to a file: URL would cause the libcurl to read (or write) arbitrary files from the local filesystem. If the application returns the data back to the user (as would happen in some kinds of CGI scripts), an attacker could leverage this to read otherwise forbidden data (e.g. file://localhost/etc/passwd). If authentication credentials are stored in the ~/.netrc file, or Kerberos is in use, any other URL type (not just file:) that requires authentication is also at risk. A redirect such as ftp://some-internal-server/private-file would then return data even when the server is password protected. In the same way, if an unencrypted SSH private key has been configured for the user running the libcurl application, SCP: or SFTP: URLs could access password or private-key protected resources, e.g. sftp://user@some-internal-server/etc/passwd The CURLOPT_REDIR_PROTOCOLS and CURLOPT_NETRC options can be used to mitigate against this kind of attack. A redirect can also specify a location available only on the machine running libcurl, including servers hidden behind a firewall from the attacker. e.g. http://127.0.0.1/ or http://intranet/delete-stuff.cgi?delete=all or tftp://bootp-server/pc-config-data Apps can mitigate against this by disabling CURLOPT_FOLLOWLOCATION and handling redirects itself, sanitizing URLs as necessary. Alternately, an app could leave CURLOPT_FOLLOWLOCATION enabled but set CURLOPT_REDIR_PROTOCOLS and install a CURLOPT_OPENSOCKETFUNCTION callback function in which addresses are sanitized before use. .IP "Private Resources" A user who can control the DNS server of a domain being passed in within a URL can change the address of the host to a local, private address which a server-side libcurl-using application could then use. e.g. the innocuous URL http://fuzzybunnies.example.com/ could actually resolve to the IP address of a server behind a firewall, such as 127.0.0.1 or 10.1.2.3. Apps can mitigate against this by setting a CURLOPT_OPENSOCKETFUNCTION and checking the address before a connection. All the malicious scenarios regarding redirected URLs apply just as well to non-redirected URLs, if the user is allowed to specify an arbitrary URL that could point to a private resource. For example, a web app providing a translation service might happily translate file://localhost/etc/passwd and display the result. Apps can mitigate against this with the CURLOPT_PROTOCOLS option as well as by similar mitigation techniques for redirections. A malicious FTP server could in response to the PASV command return an IP address and port number for a server local to the app running libcurl but behind a firewall. Apps can mitigate against this by using the CURLOPT_FTP_SKIP_PASV_IP option or CURLOPT_FTPPORT. .IP "IPv6 Addresses" libcurl will normally handle IPv6 addresses transparently and just as easily as IPv4 addresses. That means that a sanitizing function that filters out addressses like 127.0.0.1 isn't sufficient--the equivalent IPv6 addresses ::1, ::, 0:00::0:1, ::127.0.0.1 and ::ffff:7f00:1 supplied somehow by an attacker would all bypass a naive filter and could allow access to undesired local resources. IPv6 also has special address blocks like link-local and site-local that generally shouldn't be accessed by a server-side libcurl-using application. A poorly-configured firewall installed in a data center, organization or server may also be configured to limit IPv4 connections but leave IPv6 connections wide open. In some cases, the CURL_IPRESOLVE_V4 option can be used to limit resolved addresses to IPv4 only and bypass these issues. .IP Uploads When uploading, a redirect can cause a local (or remote) file to be overwritten. Apps must not allow any unsanitized URL to be passed in for uploads. Also, CURLOPT_FOLLOWLOCATION should not be used on uploads. Instead, the app should handle redirects itself, sanitizing each URL first. .IP Authentication Use of CURLOPT_UNRESTRICTED_AUTH could cause authentication information to be sent to an unknown second server. Apps can mitigate against this by disabling CURLOPT_FOLLOWLOCATION and handling redirects itself, sanitizing where necessary. Use of the CURLAUTH_ANY option to CURLOPT_HTTPAUTH could result in user name and password being sent in clear text to an HTTP server. Instead, use CURLAUTH_ANYSAFE which ensures that the password is encrypted over the network, or else fail the request. Use of the CURLUSESSL_TRY option to CURLOPT_USE_SSL could result in user name and password being sent in clear text to an FTP server. Instead, use CURLUSESSL_CONTROL to ensure that an encrypted connection is used or else fail the request. .IP Cookies If cookies are enabled and cached, then a user could craft a URL which performs some malicious action to a site whose authentication is already stored in a cookie. e.g. http://mail.example.com/delete-stuff.cgi?delete=all Apps can mitigate against this by disabling cookies or clearing them between requests. .IP "Dangerous URLs" SCP URLs can contain raw commands within the scp: URL, which is a side effect of how the SCP protocol is designed. e.g. scp://user:pass@host/a;date >/tmp/test; Apps must not allow unsanitized SCP: URLs to be passed in for downloads. .IP "Denial of Service" A malicious server could cause libcurl to effectively hang by sending a trickle of data through, or even no data at all but just keeping the TCP connection open. This could result in a denial-of-service attack. The CURLOPT_TIMEOUT and/or CURLOPT_LOW_SPEED_LIMIT options can be used to mitigate against this. A malicious server could cause libcurl to effectively hang by starting to send data, then severing the connection without cleanly closing the TCP connection. The app could install a CURLOPT_SOCKOPTFUNCTION callback function and set the TCP SO_KEEPALIVE option to mitigate against this. Setting one of the timeout options would also work against this attack. A malicious server could cause libcurl to download an infinite amount of data, potentially causing all of memory or disk to be filled. Setting the CURLOPT_MAXFILESIZE_LARGE option is not sufficient to guard against this. Instead, the app should monitor the amount of data received within the write or progress callback and abort once the limit is reached. A malicious HTTP server could cause an infinite redirection loop, causing a denial-of-service. This can be mitigated by using the CURLOPT_MAXREDIRS option. .IP "Arbitrary Headers" User-supplied data must be sanitized when used in options like CURLOPT_USERAGENT, CURLOPT_HTTPHEADER, CURLOPT_POSTFIELDS and others that are used to generate structured data. Characters like embedded carriage returns or ampersands could allow the user to create additional headers or fields that could cause malicious transactions. .IP "Server-supplied Names" A server can supply data which the application may, in some cases, use as a file name. The curl command-line tool does this with --remote-header-name, using the Content-disposition: header to generate a file name. An application could also use CURLINFO_EFFECTIVE_URL to generate a file name from a server-supplied redirect URL. Special care must be taken to sanitize such names to avoid the possibility of a malicious server supplying one like "/etc/passwd", "\\autoexec.bat", "prn:" or even ".bashrc". .IP "Server Certificates" A secure application should never use the CURLOPT_SSL_VERIFYPEER option to disable certificate validation. There are numerous attacks that are enabled by apps that fail to properly validate server TLS/SSL certificates, thus enabling a malicious server to spoof a legitimate one. HTTPS without validated certificates is potentially as insecure as a plain HTTP connection. .IP "Showing What You Do" On a related issue, be aware that even in situations like when you have problems with libcurl and ask someone for help, everything you reveal in order to get best possible help might also impose certain security related risks. Host names, user names, paths, operating system specifics, etc. (not to mention passwords of course) may in fact be used by intruders to gain additional information of a potential target. Be sure to limit access to application logs if they could hold private or security-related data. Besides the obvious candidates like user names and passwords, things like URLs, cookies or even file names could also hold sensitive data. To avoid this problem, you must of course use your common sense. Often, you can just edit out the sensitive data or just search/replace your true information with faked data. .SH "Multiple Transfers Using the multi Interface" The easy interface as described in detail in this document is a synchronous interface that transfers one file at a time and doesn't return until it is done. The multi interface, on the other hand, allows your program to transfer multiple files in both directions at the same time, without forcing you to use multiple threads. The name might make it seem that the multi interface is for multi-threaded programs, but the truth is almost the reverse. The multi interface can allow a single-threaded application to perform the same kinds of multiple, simultaneous transfers that multi-threaded programs can perform. It allows many of the benefits of multi-threaded transfers without the complexity of managing and synchronizing many threads. To use this interface, you are better off if you first understand the basics of how to use the easy interface. The multi interface is simply a way to make multiple transfers at the same time by adding up multiple easy handles into a "multi stack". You create the easy handles you want and you set all the options just like you have been told above, and then you create a multi handle with \fIcurl_multi_init(3)\fP and add all those easy handles to that multi handle with \fIcurl_multi_add_handle(3)\fP. When you've added the handles you have for the moment (you can still add new ones at any time), you start the transfers by calling \fIcurl_multi_perform(3)\fP. \fIcurl_multi_perform(3)\fP is asynchronous. It will only execute as little as possible and then return back control to your program. It is designed to never block. The best usage of this interface is when you do a select() on all possible file descriptors or sockets to know when to call libcurl again. This also makes it easy for you to wait and respond to actions on your own application's sockets/handles. You figure out what to select() for by using \fIcurl_multi_fdset(3)\fP, that fills in a set of fd_set variables for you with the particular file descriptors libcurl uses for the moment. When you then call select(), it'll return when one of the file handles signal action and you then call \fIcurl_multi_perform(3)\fP to allow libcurl to do what it wants to do. Take note that libcurl does also feature some time-out code so we advise you to never use very long timeouts on select() before you call \fIcurl_multi_perform(3)\fP, which thus should be called unconditionally every now and then even if none of its file descriptors have signaled ready. Another precaution you should use: always call \fIcurl_multi_fdset(3)\fP immediately before the select() call since the current set of file descriptors may change when calling a curl function. If you want to stop the transfer of one of the easy handles in the stack, you can use \fIcurl_multi_remove_handle(3)\fP to remove individual easy handles. Remember that easy handles should be \fIcurl_easy_cleanup(3)\fPed. When a transfer within the multi stack has finished, the counter of running transfers (as filled in by \fIcurl_multi_perform(3)\fP) will decrease. When the number reaches zero, all transfers are done. \fIcurl_multi_info_read(3)\fP can be used to get information about completed transfers. It then returns the CURLcode for each easy transfer, to allow you to figure out success on each individual transfer. .SH "SSL, Certificates and Other Tricks" [ seeding, passwords, keys, certificates, ENGINE, ca certs ] .SH "Sharing Data Between Easy Handles" You can share some data between easy handles when the easy interface is used, and some data is share automatically when you use the multi interface. When you add easy handles to a multi handle, these easy handles will automatically share a lot of the data that otherwise would be kept on a per-easy handle basis when the easy interface is used. The DNS cache is shared between handles within a multi handle, making subsequent name resolving faster, and the connection pool that is kept to better allow persistent connections and connection re-use is also shared. If you're using the easy interface, you can still share these between specific easy handles by using the share interface, see \fIlibcurl-share(3)\fP. Some things are never shared automatically, not within multi handles, like for example cookies so the only way to share that is with the share interface. .SH "Footnotes" .IP "[1]" libcurl 7.10.3 and later have the ability to switch over to chunked Transfer-Encoding in cases where HTTP uploads are done with data of an unknown size. .IP "[2]" This happens on Windows machines when libcurl is built and used as a DLL. However, you can still do this on Windows if you link with a static library. .IP "[3]" The curl-config tool is generated at build-time (on UNIX-like systems) and should be installed with the 'make install' or similar instruction that installs the library, header files, man pages etc. .IP "[4]" This behavior was different in versions before 7.17.0, where strings had to remain valid past the end of the \fIcurl_easy_setopt(3)\fP call. curl-7.35.0/docs/libcurl/curl_slist_free_all.30000644000175000017500000000273312213173003016155 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_slist_free_all 3 "5 March 2001" "libcurl 7.0" "libcurl Manual" .SH NAME curl_slist_free_all - free an entire curl_slist list .SH SYNOPSIS .B #include .sp .BI "void curl_slist_free_all(struct curl_slist *" list); .ad .SH DESCRIPTION curl_slist_free_all() removes all traces of a previously built curl_slist linked list. .SH RETURN VALUE Nothing. .SH "SEE ALSO" .BR curl_slist_append "(3), " curl-7.35.0/docs/libcurl/libcurl-multi.30000644000175000017500000001701412213173003014723 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .\" .TH libcurl-multi 3 "3 Feb 2007" "libcurl 7.16.0" "libcurl multi interface" .SH NAME libcurl-multi \- how to use the multi interface .SH DESCRIPTION This is an overview on how to use the libcurl multi interface in your C programs. There are specific man pages for each function mentioned in here. There's also the \fIlibcurl-tutorial(3)\fP man page for a complete tutorial to programming with libcurl and the \fIlibcurl-easy(3)\fP man page for an overview of the libcurl easy interface. All functions in the multi interface are prefixed with curl_multi. .SH "OBJECTIVES" The multi interface offers several abilities that the easy interface doesn't. They are mainly: 1. Enable a "pull" interface. The application that uses libcurl decides where and when to ask libcurl to get/send data. 2. Enable multiple simultaneous transfers in the same thread without making it complicated for the application. 3. Enable the application to wait for action on its own file descriptors and curl's file descriptors simultaneous easily. .SH "ONE MULTI HANDLE MANY EASY HANDLES" To use the multi interface, you must first create a 'multi handle' with \fIcurl_multi_init(3)\fP. This handle is then used as input to all further curl_multi_* functions. Each single transfer is built up with an easy handle. You must create them, and setup the appropriate options for each easy handle, as outlined in the \fIlibcurl(3)\fP man page, using \fIcurl_easy_setopt(3)\fP. When the easy handle is setup for a transfer, then instead of using \fIcurl_easy_perform(3)\fP (as when using the easy interface for transfers), you should instead add the easy handle to the multi handle using \fIcurl_multi_add_handle(3)\fP. The multi handle is sometimes referred to as a \'multi stack\' because of the fact that it may hold a large amount of easy handles. Should you change your mind, the easy handle is again removed from the multi stack using \fIcurl_multi_remove_handle(3)\fP. Once removed from the multi handle, you can again use other easy interface functions like \fIcurl_easy_perform(3)\fP on the handle or whatever you think is necessary. Adding the easy handle to the multi handle does not start the transfer. Remember that one of the main ideas with this interface is to let your application drive. You drive the transfers by invoking \fIcurl_multi_perform(3)\fP. libcurl will then transfer data if there is anything available to transfer. It'll use the callbacks and everything else you have setup in the individual easy handles. It'll transfer data on all current transfers in the multi stack that are ready to transfer anything. It may be all, it may be none. Your application can acquire knowledge from libcurl when it would like to get invoked to transfer data, so that you don't have to busy-loop and call that \fIcurl_multi_perform(3)\fP like crazy. \fIcurl_multi_fdset(3)\fP offers an interface using which you can extract fd_sets from libcurl to use in select() or poll() calls in order to get to know when the transfers in the multi stack might need attention. This also makes it very easy for your program to wait for input on your own private file descriptors at the same time or perhaps timeout every now and then, should you want that. \fIcurl_multi_perform(3)\fP stores the number of still running transfers in one of its input arguments, and by reading that you can figure out when all the transfers in the multi handles are done. 'done' does not mean successful. One or more of the transfers may have failed. Tracking when this number changes, you know when one or more transfers are done. To get information about completed transfers, to figure out success or not and similar, \fIcurl_multi_info_read(3)\fP should be called. It can return a message about a current or previous transfer. Repeated invokes of the function get more messages until the message queue is empty. The information you receive there includes an easy handle pointer which you may use to identify which easy handle the information regards. When a single transfer is completed, the easy handle is still left added to the multi stack. You need to first remove the easy handle with \fIcurl_multi_remove_handle(3)\fP and then close it with \fIcurl_easy_cleanup(3)\fP, or possibly set new options to it and add it again with \fIcurl_multi_add_handle(3)\fP to start another transfer. When all transfers in the multi stack are done, cleanup the multi handle with \fIcurl_multi_cleanup(3)\fP. Be careful and please note that you \fBMUST\fP invoke separate \fIcurl_easy_cleanup(3)\fP calls on every single easy handle to clean them up properly. If you want to re-use an easy handle that was added to the multi handle for transfer, you must first remove it from the multi stack and then re-add it again (possibly after having altered some options at your own choice). .SH "MULTI_SOCKET" \fIcurl_multi_socket_action(3)\fP function offers a way for applications to not only avoid being forced to use select(), but it also offers a much more high-performance API that will make a significant difference for applications using large numbers of simultaneous connections. \fIcurl_multi_socket_action(3)\fP is then used instead of \fIcurl_multi_perform(3)\fP. When using this API, you add easy handles to the multi handle just as with the normal multi interface. Then you also set two callbacks with the CURLMOPT_SOCKETFUNCTION and CURLMOPT_TIMERFUNCTION options to \fIcurl_multi_setopt(3)\fP. The API is then designed to inform your application about which sockets libcurl is currently using and for what activities (read and/or write) on those sockets your application is expected to wait for. Your application must then make sure to receive all sockets informed about in the CURLMOPT_SOCKETFUNCTION callback and make sure it reacts on the given activity on them. When a socket has the given activity, you call \fIcurl_multi_socket_action(3)\fP specifying which socket and action there are. The CURLMOPT_TIMERFUNCTION callback is called to set a timeout. When that timeout expires, your application should call the \fIcurl_multi_socket_action(3)\fP function saying it was due to a timeout. .SH "BLOCKING" A few areas in the code are still using blocking code, even when used from the multi interface. While we certainly want and intend for these to get fixed in the future, you should be aware of the following current restrictions: .nf - Name resolves unless the c-ares or threaded-resolver backends are used - NSS SSL connections - HTTP proxy CONNECT operations - SOCKS proxy handshakes - file:// transfers - TELNET transfers .fi curl-7.35.0/docs/libcurl/curl_easy_send.pdf0000644000175000017500000001207312272124475015563 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœX]oëÆ}ׯX¤!k/wùÝG)ÜèJ®%5| ƒ¦V6{)Ò!);êèîÙ].¿ìhá&¹3sæÌ™³þ•8”Gþ´¿ÓãìÓMHžê™Cžf¿Î˜zHÚ_é‘ü°Ã ‘üÃî0Óß0rÆ.b²;ÎhÀÈîmvo¥§*I}~¨E±ÿb¹_l’gòÏöœûuœÐúœ§$'¼kÿc÷×ÙÜ¡œáäc¦±/c»Ù­fÖza‹\ñ”ùÔ]ä³ÛϬÏK{÷ÏA¦Ü¡ž’9ãò±#³›$GæDþªI•ÈO9õÕ¡§.o}ÛË':˜GCÇ탤IH)Ÿ!W¦¿‹©ƒoÛç¯bpdLyGž~to!œ¢øF¬pF#¿ý\æø IË¢i“•….m€Åœ;.FsÐH}²½[o®·WÛþÕ³{ëY‘æ§½ ’8|’1ìбèóŸUÜSð^ÞÞ¬ÒoM»CäòÀÿtÃÃ?¤Ì´@5¹/»ÏI=vijL=w€LYÔ yµcÇ<ˆ¬2Û#ža„>²‹ìÀ»;óñdšés£öÁáÐó©9Žy *ù`’(z8,0‰Ö}÷>ŽÍ·Ù¿ÄCÓœæÅ9õú7u^Î8§‹âc˜<D{=¢QO À¨F÷qÞ>Ř>å=ÊÖûû÷tBq4Œ†|úq¹½¼¹ºÞ]mÖãÁê)åRŸ«±·vÏYM§B‘µª¤zÌš*©ÎdÿÁ´ø1uC4-h¨@9!/eV4à:.´t=\Ošï3W ?åã4ÚIeá:nl¯yNÕœ7BÏ|+;0@ µç>ìÆ!¦K@%2Ì¥C³ƒª äãYçOßgc!0Ñep߉z|‚ª¿–嫯W"ÙhZÁ.îø£ýö»WA³‰–1/êfSàA ý`¼„‹Óñ``Y&y<7¢6íUâíÒ‹[ÉJID×_†ß–hß0ó¯×séB’i ôÑå{µæ6×»‡ËÍz½¼Ü=lÖ+;æhAXw“f( bZIÔÔ`&%¨ž&yŽžhH,+ìúÝ È ø‰’âÈ÷¬–õnÈhÐeáÔ£–—á®èTm0òI×C…äý4Þeƒ6g“ÌÜá›Ù¶1u€ºAÜ¢ˆR” ˆ«Šp}«¬¾ÀÑ7¡VaÉ›èT"i ÒRfËtWê›êêUÚ?g>& (H;‚ÄîJ]~ìµZÃú¤OǾnàÎàüôtCd¡oõ©Ò(’Ôeªt-VrÄú/ô& AfoU&‰%~¿¹ œgÜÿ}eêlÜ»Æ9èíP9™‡þ»\KoY-4µ‘€™ÎæTMüÜ…ÛåþÀëIz/¶ïKŸéZY\­ÎÐw’Mˆáî ˼fã»æ£pÚJ× †ÌiÁÂbÙ“¬ŠùcŽGr“¥…T²Šõ•ŸG±±¨ ’†¼·C aÍZLÁæ4 Œ¿NÒ“ò‹w‘NVÊVrÒÀœÜoú>‘9ï&O‚wµþió°ZlwÛÍåÏËÝDÅ¡²aìdXàkh  åc“‹f„Ò÷jùBç!{|l? TŸëFÉA+¿XIšaÑËõœg_[KŽ¥ÕlŠH%êÔ€å»/ŸN®Q'ö Ûš²æaÅííèY¤_¥[€/j͆œƒF œR+4£~½»˜Í•%l#Þqôô-~!‹®· hà3³0¯V‹®VW»» ®°èŒÒZì÷š_¸iúy„¿·n–»Û›5ùÅf.F<`Öbu»œð¡÷°à8W†ÅÚÀœÒTÔõE;dõ˜&ªBS‚ž°ÍÏã üÅý¦ä‘:[:¾JÔŠý TÛ$is’S¢7"¦¦œ,uG&òwjú]¸åh<Ér`»™l…°[Ífh †­z€éáäîâÜzsç/w4åaïßd dÉ ‹3Òú}u/Wâ[øÈI¤¤×uabnyÕ…í19Ì*ëÁ<  †ÅÀ¤×”ÁíDP ^b a{¿7Röš  bÃ[®– Š—:p¨àüeE/•–9õX§&A¤­ûkVžPy•ukfe=ʇBÕqC6™^4ƒ°^Ð]=¬Ñ¥Ì@©y{»ÞÞ^ë«Áˆ{·;®77vàX»å×7æúíµqûõ‹A4»7;²é¹5î—ÛåfõÁÀ2,gxÙ\þ}ñùz5ùN?¤ÖVLl.¾ŒÝÞÍINÁO…XéRÜËì@ý!´h:}FÆí.ÙÙd“"GÞ_Á÷eZ¿%òÚV“ ¥øhö¬3¦üL`Ðêä LµY»‚õ1´Mg  †ÿËY.ÉbµÝü·ÿ匼F5ñjŒš Ô2¼x‡]ðá&Åj:ؼMîsºDáÏûQøŸN~R«Y-7]9½1{4ü?On»îzªëãceâN;G£ øP×§-çÍÍWï.”C4| »aÍÉ $8Ò&&0ÿîbò°ånö7üüanxþendstream endobj 6 0 obj 2276 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 13 0 obj <> endobj 9 0 obj <> endobj 14 0 obj <> endobj 8 0 obj <> endobj 15 0 obj <>stream 2014-01-29T08:09:49+01:00 2014-01-29T08:09:49+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 16 0000000000 65535 f 0000002600 00000 n 0000004552 00000 n 0000002541 00000 n 0000002381 00000 n 0000000015 00000 n 0000002361 00000 n 0000002665 00000 n 0000003063 00000 n 0000002926 00000 n 0000002786 00000 n 0000002706 00000 n 0000002736 00000 n 0000002870 00000 n 0000003007 00000 n 0000003129 00000 n trailer << /Size 16 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 4706 %%EOF curl-7.35.0/docs/libcurl/curl_easy_send.30000644000175000017500000000574512213173003015146 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2013, 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. .\" * .\" ************************************************************************** .\" .TH curl_easy_send 3 "29 April 2008" "libcurl 7.18.2" "libcurl Manual" .SH NAME curl_easy_send - sends raw data over an "easy" connection .SH SYNOPSIS .B #include .sp .BI "CURLcode curl_easy_send( CURL *" curl ", const void *" buffer "," .BI " size_t " buflen ", size_t *" n ");" .ad .SH DESCRIPTION This function sends arbitrary data over the established connection. You may use it together with \fIcurl_easy_recv(3)\fP to implement custom protocols using libcurl. This functionality can be particularly useful if you use proxies and/or SSL encryption: libcurl will take care of proxy negotiation and connection set-up. \fBbuffer\fP is a pointer to the data of length \fBbuflen\fP that you want sent. The variable \fBn\fP points to will receive the number of sent bytes. To establish the connection, set \fBCURLOPT_CONNECT_ONLY\fP option before calling \fIcurl_easy_perform(3)\fP. Note that \fIcurl_easy_send(3)\fP will not work on connections that were created without this option. You must ensure that the socket is writable before calling \fIcurl_easy_send(3)\fP, otherwise the call will return \fBCURLE_AGAIN\fP - the socket is used in non-blocking mode internally. Use \fIcurl_easy_getinfo(3)\fP with \fBCURLINFO_LASTSOCKET\fP to obtain the socket; use your operating system facilities like \fIselect(2)\fP to check if it can be written to. .SH AVAILABILITY Added in 7.18.2. .SH RETURN VALUE On success, returns \fBCURLE_OK\fP and stores the number of bytes actually sent into \fB*n\fP. Note that this may very well be less than the amount you wanted to send. On failure, returns the appropriate error code. If there's no socket available to use from the previous transfer, this function returns CURLE_UNSUPPORTED_PROTOCOL. .SH EXAMPLE See \fBsendrecv.c\fP in \fBdocs/examples\fP directory for usage example. .SH "SEE ALSO" .BR curl_easy_setopt "(3), " curl_easy_perform "(3), " curl_easy_getinfo "(3), " .BR curl_easy_recv "(3) " curl-7.35.0/docs/libcurl/curl_multi_wait.30000644000175000017500000000660412262353672015365 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2013, 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. .\" * .\" ************************************************************************** .TH curl_multi_wait 3 "12 Jul 2012" "libcurl 7.28.0" "libcurl Manual" .SH NAME curl_multi_wait - polls on all easy handles in a multi handle .SH SYNOPSIS .nf #include CURLMcode curl_multi_wait(CURLM *multi_handle, struct curl_waitfd extra_fds[], unsigned int extra_nfds, int timeout_ms, int *numfds); .ad .SH DESCRIPTION This function polls on all file descriptors used by the curl easy handles contained in the given multi handle set. It will block until activity is detected on at least one of the handles or \fItimeout_ms\fP has passed. Alternatively, if the multi handle has a pending internal timeout that has a shorter expiry time than \fItimeout_ms\fP, that shorter time will be used instead to make sure timeout accuracy is reasonably kept. The calling application may pass additional curl_waitfd structures which are similar to \fIpoll(2)\fP's pollfd structure to be waited on in the same call. On completion, if \fInumfds\fP is supplied, it will be populated with the total number of file descriptors on which interesting events occured. This number can include both libcurl internal descriptors as well as descriptors provided in \fIextra_fds\fP. If no extra file descriptors are provided and libcurl has no file descriptor to offer to wait for, this function will return immediately. This function is encouraged to be used instead of select(3) when using the multi interface to allow applications to easier circumvent the common problem with 1024 maximum file descriptors. .SH curl_waitfd .nf struct curl_waitfd { curl_socket_t fd; short events; short revents; }; .fi .IP CURL_WAIT_POLLIN Bit flag to curl_waitfd.events indicating the socket should poll on read events such as new data received. .IP CURL_WAIT_POLLPRI Bit flag to curl_waitfd.events indicating the socket should poll on high priority read events such as out of band data. .IP CURL_WAIT_POLLOUT Bit flag to curl_waitfd.events indicating the socket should poll on write events such as the socket being clear to write without blocking. .SH RETURN VALUE CURLMcode type, general libcurl multi interface error code. See \fIlibcurl-errors(3)\fP .SH AVAILABILITY This function was added in libcurl 7.28.0. .SH "SEE ALSO" .BR curl_multi_fdset "(3), " curl_multi_perform "(3)" curl-7.35.0/docs/libcurl/curl_multi_perform.30000644000175000017500000000777312213173003016063 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2012, 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. .\" * .\" ************************************************************************** .TH curl_multi_perform 3 "1 March 2002" "libcurl 7.9.5" "libcurl Manual" .SH NAME curl_multi_perform - reads/writes available data from each easy handle .SH SYNOPSIS #include CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles); .ad .SH DESCRIPTION This function handles transfers on all the added handles that need attention in an non-blocking fashion. When an application has found out there's data available for the multi_handle or a timeout has elapsed, the application should call this function to read/write whatever there is to read or write right now etc. curl_multi_perform() returns as soon as the reads/writes are done. This function does not require that there actually is any data available for reading or that data can be written, it can be called just in case. It will write the number of handles that still transfer data in the second argument's integer-pointer. If the amount of \fIrunning_handles\fP is changed from the previous call (or is less than the amount of easy handles you've added to the multi handle), you know that there is one or more transfers less "running". You can then call \fIcurl_multi_info_read(3)\fP to get information about each individual completed transfer, and that returned info includes CURLcode and more. If an added handle fails very quickly, it may never be counted as a running_handle. When \fIrunning_handles\fP is set to zero (0) on the return of this function, there is no longer any transfers in progress. .SH "RETURN VALUE" CURLMcode type, general libcurl multi interface error code. Before version 7.20.0: If you receive \fICURLM_CALL_MULTI_PERFORM\fP, this basically means that you should call \fIcurl_multi_perform\fP again, before you select() on more actions. You don't have to do it immediately, but the return code means that libcurl may have more data available to return or that there may be more data to send off before it is "satisfied". Do note that \fIcurl_multi_perform(3)\fP will return \fICURLM_CALL_MULTI_PERFORM\fP only when it wants to be called again \fBimmediately\fP. When things are fine and there is nothing immediate it wants done, it'll return \fICURLM_OK\fP and you need to wait for \&"action" and then call this function again. This function only returns errors etc regarding the whole multi stack. Problems still might have occurred on individual transfers even when this function returns \fICURLM_OK\fP. Use \fIcurl_multi_info_read(3)\fP to figure out how individual transfers did. .SH "TYPICAL USAGE" Most applications will use \fIcurl_multi_fdset(3)\fP to get the multi_handle's file descriptors, and \fIcurl_multi_timeout(3)\fP to get a suitable timeout period, then it'll wait for action on the file descriptors using \fBselect(3)\fP. As soon as one or more file descriptor is ready, \fIcurl_multi_perform(3)\fP gets called. .SH "SEE ALSO" .BR curl_multi_cleanup "(3), " curl_multi_init "(3), " .BR curl_multi_fdset "(3), " curl_multi_info_read "(3), " .BR libcurl-errors "(3)" curl-7.35.0/docs/libcurl/curl_formadd.html0000644000175000017500000003605112272124467015423 00000000000000 curl_formadd man page

NAME

curl_formadd - add a section to a multipart/formdata HTTP POST

SYNOPSIS

#include <curl/curl.h>

CURLFORMcode curl_formadd(struct curl_httppost ** firstitem, struct curl_httppost ** lastitem, ...);

DESCRIPTION

curl_formadd() is used to append sections when building a multipart/formdata HTTP POST (sometimes referred to as RFC 2388-style posts). Append one section at a time until you've added all the sections you want included and then you pass the firstitem pointer as parameter to CURLOPT_HTTPPOST. lastitem is set after each curl_formadd(3) call and on repeated invokes it should be left as set to allow repeated invokes to find the end of the list faster.

After the lastitem pointer follow the real arguments.

The pointers firstitem and lastitem should both be pointing to NULL in the first call to this function. All list-data will be allocated by the function itself. You must call curl_formfree(3) on the firstitem after the form post has been done to free the resources.

Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with CURLOPT_HTTPHEADER as usual.

First, there are some basics you need to understand about multipart/formdata posts. Each part consists of at least a NAME and a CONTENTS part. If the part is made for file upload, there are also a stored CONTENT-TYPE and a FILENAME. Below, we'll discuss what options you use to set these properties in the parts you want to add to your post.

The options listed first are for making normal parts. The options from CURLFORM_FILE through CURLFORM_BUFFERLENGTH are for file upload parts.

OPTIONS

CURLFORM_COPYNAME

followed by a string which provides the name of this part. libcurl copies the string so your application doesn't need to keep it around after this function call. If the name isn't NUL-terminated, or if you'd like it to contain zero bytes, you must set its length with CURLFORM_NAMELENGTH. The copied data will be freed by curl_formfree(3).

CURLFORM_PTRNAME

followed by a string which provides the name of this part. libcurl will use the pointer and refer to the data in your application, so you must make sure it remains until curl no longer needs it. If the name isn't NUL-terminated, or if you'd like it to contain zero bytes, you must set its length with CURLFORM_NAMELENGTH.

CURLFORM_COPYCONTENTS

followed by a pointer to the contents of this part, the actual data to send away. libcurl copies the provided data, so your application doesn't need to keep it around after this function call. If the data isn't null terminated, or if you'd like it to contain zero bytes, you must set the length of the name with CURLFORM_CONTENTSLENGTH. The copied data will be freed by curl_formfree(3).

CURLFORM_PTRCONTENTS

followed by a pointer to the contents of this part, the actual data to send away. libcurl will use the pointer and refer to the data in your application, so you must make sure it remains until curl no longer needs it. If the data isn't NUL-terminated, or if you'd like it to contain zero bytes, you must set its length with CURLFORM_CONTENTSLENGTH.

CURLFORM_CONTENTSLENGTH

followed by a long giving the length of the contents. Note that for CURLFORM_STREAM contents, this option is mandatory.

CURLFORM_FILECONTENT

followed by a filename, causes that file to be read and its contents used as data in this part. This part does not automatically become a file upload part simply because its data was read from a file.

CURLFORM_FILE

followed by a filename, makes this part a file upload part. It sets the filename field to the basename of the provided filename, it reads the contents of the file and passes them as data and sets the content-type if the given file match one of the internally known file extensions. For CURLFORM_FILE the user may send one or more files in one part by providing multiple CURLFORM_FILE arguments each followed by the filename (and each CURLFORM_FILE is allowed to have a CURLFORM_CONTENTTYPE).

CURLFORM_CONTENTTYPE

is used in combination with CURLFORM_FILE. Followed by a pointer to a string which provides the content-type for this part, possibly instead of an internally chosen one.

CURLFORM_FILENAME

is used in combination with CURLFORM_FILE. Followed by a pointer to a string, it tells libcurl to use the given string as the filename in the file upload part instead of the actual file name.

CURLFORM_BUFFER

is used for custom file upload parts without use of CURLFORM_FILE. It tells libcurl that the file contents are already present in a buffer. The parameter is a string which provides the filename field in the content header.

CURLFORM_BUFFERPTR

is used in combination with CURLFORM_BUFFER. The parameter is a pointer to the buffer to be uploaded. This buffer must not be freed until after curl_easy_cleanup(3) is called. You must also use CURLFORM_BUFFERLENGTH to set the number of bytes in the buffer.

CURLFORM_BUFFERLENGTH

is used in combination with CURLFORM_BUFFER. The parameter is a long which gives the length of the buffer.

CURLFORM_STREAM

Tells libcurl to use the CURLOPT_READFUNCTION callback to get data. The parameter you pass to CURLFORM_STREAM is the pointer passed on to the read callback's fourth argument. If you want the part to look like a file upload one, set the CURLFORM_FILENAME parameter as well. Note that when using CURLFORM_STREAM, CURLFORM_CONTENTSLENGTH must also be set with the total expected length of the part. (Option added in libcurl 7.18.2)

CURLFORM_ARRAY

Another possibility to send options to curl_formadd() is the CURLFORM_ARRAY option, that passes a struct curl_forms array pointer as its value. Each curl_forms structure element has a CURLformoption and a char pointer. The final element in the array must be a CURLFORM_END. All available options can be used in an array, except the CURLFORM_ARRAY option itself! The last argument in such an array must always be CURLFORM_END.

CURLFORM_CONTENTHEADER

specifies extra headers for the form POST section. This takes a curl_slist prepared in the usual way using curl_slist_append and appends the list of headers to those libcurl automatically generates. The list must exist while the POST occurs, if you free it before the post completes you may experience problems.

When you've passed the HttpPost pointer to curl_easy_setopt(3) (using the CURLOPT_HTTPPOST option), you must not free the list until after you've called curl_easy_cleanup(3) for the curl handle.

See example below.

RETURN VALUE

0 means everything was ok, non-zero means an error occurred corresponding to a CURL_FORMADD_* constant defined in <curl/curl.h>

EXAMPLE

 struct curl_httppost* post = NULL;  struct curl_httppost* last = NULL;  char namebuffer[] = "name buffer";  long namelength = strlen(namebuffer);  char buffer[] = "test buffer";  char htmlbuffer[] = "<HTML>test buffer</HTML>";  long htmlbufferlength = strlen(htmlbuffer);  struct curl_forms forms[3];  char file1[] = "my-face.jpg";  char file2[] = "your-face.jpg";  /* add null character into htmlbuffer, to demonstrate that   transfers of buffers containing null characters actually work  */  htmlbuffer[8] = '\0';

 /* Add simple name/content section */  curl_formadd(&post, &last, CURLFORM_COPYNAME, "name",   CURLFORM_COPYCONTENTS, "content", CURLFORM_END);

 /* Add simple name/content/contenttype section */  curl_formadd(&post, &last, CURLFORM_COPYNAME, "htmlcode",   CURLFORM_COPYCONTENTS, "<HTML></HTML>",   CURLFORM_CONTENTTYPE, "text/html", CURLFORM_END);

 /* Add name/ptrcontent section */  curl_formadd(&post, &last, CURLFORM_COPYNAME, "name_for_ptrcontent",   CURLFORM_PTRCONTENTS, buffer, CURLFORM_END);

 /* Add ptrname/ptrcontent section */  curl_formadd(&post, &last, CURLFORM_PTRNAME, namebuffer,   CURLFORM_PTRCONTENTS, buffer, CURLFORM_NAMELENGTH,   namelength, CURLFORM_END);

 /* Add name/ptrcontent/contenttype section */  curl_formadd(&post, &last, CURLFORM_COPYNAME, "html_code_with_hole",   CURLFORM_PTRCONTENTS, htmlbuffer,   CURLFORM_CONTENTSLENGTH, htmlbufferlength,   CURLFORM_CONTENTTYPE, "text/html", CURLFORM_END);

 /* Add simple file section */  curl_formadd(&post, &last, CURLFORM_COPYNAME, "picture",   CURLFORM_FILE, "my-face.jpg", CURLFORM_END);

 /* Add file/contenttype section */  curl_formadd(&post, &last, CURLFORM_COPYNAME, "picture",   CURLFORM_FILE, "my-face.jpg",   CURLFORM_CONTENTTYPE, "image/jpeg", CURLFORM_END);

 /* Add two file section */  curl_formadd(&post, &last, CURLFORM_COPYNAME, "pictures",   CURLFORM_FILE, "my-face.jpg",   CURLFORM_FILE, "your-face.jpg", CURLFORM_END);

 /* Add two file section using CURLFORM_ARRAY */  forms[0].option = CURLFORM_FILE;  forms[0].value = file1;  forms[1].option = CURLFORM_FILE;  forms[1].value = file2;  forms[2].option = CURLFORM_END;

 /* Add a buffer to upload */  curl_formadd(&post, &last,   CURLFORM_COPYNAME, "name",   CURLFORM_BUFFER, "data",   CURLFORM_BUFFERPTR, record,   CURLFORM_BUFFERLENGTH, record_length,   CURLFORM_END);

 /* no option needed for the end marker */  curl_formadd(&post, &last, CURLFORM_COPYNAME, "pictures",   CURLFORM_ARRAY, forms, CURLFORM_END);  /* Add the content of a file as a normal post text value */  curl_formadd(&post, &last, CURLFORM_COPYNAME, "filecontent",   CURLFORM_FILECONTENT, ".bashrc", CURLFORM_END);  /* Set the form info */  curl_easy_setopt(curl, CURLOPT_HTTPPOST, post);

SEE ALSO

curl_easy_setopt (3) curl_formfree (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_formadd.30000644000175000017500000002572112262353672014624 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2013, 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. .\" * .\" ************************************************************************** .TH curl_formadd 3 "24 June 2002" "libcurl 7.9.8" "libcurl Manual" .SH NAME curl_formadd - add a section to a multipart/formdata HTTP POST .SH SYNOPSIS .B #include .sp .BI "CURLFORMcode curl_formadd(struct curl_httppost ** " firstitem, .BI "struct curl_httppost ** " lastitem, " ...);" .ad .SH DESCRIPTION curl_formadd() is used to append sections when building a multipart/formdata HTTP POST (sometimes referred to as RFC2388-style posts). Append one section at a time until you've added all the sections you want included and then you pass the \fIfirstitem\fP pointer as parameter to \fBCURLOPT_HTTPPOST\fP. \fIlastitem\fP is set after each \fIcurl_formadd(3)\fP call and on repeated invokes it should be left as set to allow repeated invokes to find the end of the list faster. After the \fIlastitem\fP pointer follow the real arguments. The pointers \fIfirstitem\fP and \fIlastitem\fP should both be pointing to NULL in the first call to this function. All list-data will be allocated by the function itself. You must call \fIcurl_formfree(3)\fP on the \fIfirstitem\fP after the form post has been done to free the resources. Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual. First, there are some basics you need to understand about multipart/formdata posts. Each part consists of at least a NAME and a CONTENTS part. If the part is made for file upload, there are also a stored CONTENT-TYPE and a FILENAME. Below, we'll discuss what options you use to set these properties in the parts you want to add to your post. The options listed first are for making normal parts. The options from \fICURLFORM_FILE\fP through \fICURLFORM_BUFFERLENGTH\fP are for file upload parts. .SH OPTIONS .IP CURLFORM_COPYNAME followed by a string which provides the \fIname\fP of this part. libcurl copies the string so your application doesn't need to keep it around after this function call. If the name isn't NUL-terminated, or if you'd like it to contain zero bytes, you must set its length with \fBCURLFORM_NAMELENGTH\fP. The copied data will be freed by \fIcurl_formfree(3)\fP. .IP CURLFORM_PTRNAME followed by a string which provides the \fIname\fP of this part. libcurl will use the pointer and refer to the data in your application, so you must make sure it remains until curl no longer needs it. If the name isn't NUL-terminated, or if you'd like it to contain zero bytes, you must set its length with \fBCURLFORM_NAMELENGTH\fP. .IP CURLFORM_COPYCONTENTS followed by a pointer to the contents of this part, the actual data to send away. libcurl copies the provided data, so your application doesn't need to keep it around after this function call. If the data isn't null terminated, or if you'd like it to contain zero bytes, you must set the length of the name with \fBCURLFORM_CONTENTSLENGTH\fP. The copied data will be freed by \fIcurl_formfree(3)\fP. .IP CURLFORM_PTRCONTENTS followed by a pointer to the contents of this part, the actual data to send away. libcurl will use the pointer and refer to the data in your application, so you must make sure it remains until curl no longer needs it. If the data isn't NUL-terminated, or if you'd like it to contain zero bytes, you must set its length with \fBCURLFORM_CONTENTSLENGTH\fP. .IP CURLFORM_CONTENTSLENGTH followed by a long giving the length of the contents. Note that for \fICURLFORM_STREAM\fP contents, this option is mandatory. .IP CURLFORM_FILECONTENT followed by a filename, causes that file to be read and its contents used as data in this part. This part does \fInot\fP automatically become a file upload part simply because its data was read from a file. .IP CURLFORM_FILE followed by a filename, makes this part a file upload part. It sets the \fIfilename\fP field to the basename of the provided filename, it reads the contents of the file and passes them as data and sets the content-type if the given file match one of the internally known file extensions. For \fBCURLFORM_FILE\fP the user may send one or more files in one part by providing multiple \fBCURLFORM_FILE\fP arguments each followed by the filename (and each \fICURLFORM_FILE\fP is allowed to have a \fICURLFORM_CONTENTTYPE\fP). .IP CURLFORM_CONTENTTYPE is used in combination with \fICURLFORM_FILE\fP. Followed by a pointer to a string which provides the content-type for this part, possibly instead of an internally chosen one. .IP CURLFORM_FILENAME is used in combination with \fICURLFORM_FILE\fP. Followed by a pointer to a string, it tells libcurl to use the given string as the \fIfilename\fP in the file upload part instead of the actual file name. .IP CURLFORM_BUFFER is used for custom file upload parts without use of \fICURLFORM_FILE\fP. It tells libcurl that the file contents are already present in a buffer. The parameter is a string which provides the \fIfilename\fP field in the content header. .IP CURLFORM_BUFFERPTR is used in combination with \fICURLFORM_BUFFER\fP. The parameter is a pointer to the buffer to be uploaded. This buffer must not be freed until after \fIcurl_easy_cleanup(3)\fP is called. You must also use \fICURLFORM_BUFFERLENGTH\fP to set the number of bytes in the buffer. .IP CURLFORM_BUFFERLENGTH is used in combination with \fICURLFORM_BUFFER\fP. The parameter is a long which gives the length of the buffer. .IP CURLFORM_STREAM Tells libcurl to use the \fICURLOPT_READFUNCTION\fP callback to get data. The parameter you pass to \fICURLFORM_STREAM\fP is the pointer passed on to the read callback's fourth argument. If you want the part to look like a file upload one, set the \fICURLFORM_FILENAME\fP parameter as well. Note that when using \fICURLFORM_STREAM\fP, \fICURLFORM_CONTENTSLENGTH\fP must also be set with the total expected length of the part. (Option added in libcurl 7.18.2) .IP CURLFORM_ARRAY Another possibility to send options to curl_formadd() is the \fBCURLFORM_ARRAY\fP option, that passes a struct curl_forms array pointer as its value. Each curl_forms structure element has a CURLformoption and a char pointer. The final element in the array must be a CURLFORM_END. All available options can be used in an array, except the CURLFORM_ARRAY option itself! The last argument in such an array must always be \fBCURLFORM_END\fP. .IP CURLFORM_CONTENTHEADER specifies extra headers for the form POST section. This takes a curl_slist prepared in the usual way using \fBcurl_slist_append\fP and appends the list of headers to those libcurl automatically generates. The list must exist while the POST occurs, if you free it before the post completes you may experience problems. When you've passed the HttpPost pointer to \fIcurl_easy_setopt(3)\fP (using the \fICURLOPT_HTTPPOST\fP option), you must not free the list until after you've called \fIcurl_easy_cleanup(3)\fP for the curl handle. See example below. .SH RETURN VALUE 0 means everything was ok, non-zero means an error occurred corresponding to a CURL_FORMADD_* constant defined in .I .SH EXAMPLE .nf struct curl_httppost* post = NULL; struct curl_httppost* last = NULL; char namebuffer[] = "name buffer"; long namelength = strlen(namebuffer); char buffer[] = "test buffer"; char htmlbuffer[] = "test buffer"; long htmlbufferlength = strlen(htmlbuffer); struct curl_forms forms[3]; char file1[] = "my-face.jpg"; char file2[] = "your-face.jpg"; /* add null character into htmlbuffer, to demonstrate that transfers of buffers containing null characters actually work */ htmlbuffer[8] = '\\0'; /* Add simple name/content section */ curl_formadd(&post, &last, CURLFORM_COPYNAME, "name", CURLFORM_COPYCONTENTS, "content", CURLFORM_END); /* Add simple name/content/contenttype section */ curl_formadd(&post, &last, CURLFORM_COPYNAME, "htmlcode", CURLFORM_COPYCONTENTS, "", CURLFORM_CONTENTTYPE, "text/html", CURLFORM_END); /* Add name/ptrcontent section */ curl_formadd(&post, &last, CURLFORM_COPYNAME, "name_for_ptrcontent", CURLFORM_PTRCONTENTS, buffer, CURLFORM_END); /* Add ptrname/ptrcontent section */ curl_formadd(&post, &last, CURLFORM_PTRNAME, namebuffer, CURLFORM_PTRCONTENTS, buffer, CURLFORM_NAMELENGTH, namelength, CURLFORM_END); /* Add name/ptrcontent/contenttype section */ curl_formadd(&post, &last, CURLFORM_COPYNAME, "html_code_with_hole", CURLFORM_PTRCONTENTS, htmlbuffer, CURLFORM_CONTENTSLENGTH, htmlbufferlength, CURLFORM_CONTENTTYPE, "text/html", CURLFORM_END); /* Add simple file section */ curl_formadd(&post, &last, CURLFORM_COPYNAME, "picture", CURLFORM_FILE, "my-face.jpg", CURLFORM_END); /* Add file/contenttype section */ curl_formadd(&post, &last, CURLFORM_COPYNAME, "picture", CURLFORM_FILE, "my-face.jpg", CURLFORM_CONTENTTYPE, "image/jpeg", CURLFORM_END); /* Add two file section */ curl_formadd(&post, &last, CURLFORM_COPYNAME, "pictures", CURLFORM_FILE, "my-face.jpg", CURLFORM_FILE, "your-face.jpg", CURLFORM_END); /* Add two file section using CURLFORM_ARRAY */ forms[0].option = CURLFORM_FILE; forms[0].value = file1; forms[1].option = CURLFORM_FILE; forms[1].value = file2; forms[2].option = CURLFORM_END; /* Add a buffer to upload */ curl_formadd(&post, &last, CURLFORM_COPYNAME, "name", CURLFORM_BUFFER, "data", CURLFORM_BUFFERPTR, record, CURLFORM_BUFFERLENGTH, record_length, CURLFORM_END); /* no option needed for the end marker */ curl_formadd(&post, &last, CURLFORM_COPYNAME, "pictures", CURLFORM_ARRAY, forms, CURLFORM_END); /* Add the content of a file as a normal post text value */ curl_formadd(&post, &last, CURLFORM_COPYNAME, "filecontent", CURLFORM_FILECONTENT, ".bashrc", CURLFORM_END); /* Set the form info */ curl_easy_setopt(curl, CURLOPT_HTTPPOST, post); .SH "SEE ALSO" .BR curl_easy_setopt "(3), " .BR curl_formfree "(3)" curl-7.35.0/docs/libcurl/curl_multi_socket.pdf0000644000175000017500000002227212272124475016315 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ½YÛnÜ8}ï¯`°«6Ü4IÝg dÏÀ3±ÛXñÂP«i[cµÔ‘({{¿!¿²ÿ¸U¼èÒ¶3dj²X¬:uêç a”†ì¿ùfvô1&w팑»Ù—×?ûO¾!?-aA‚–·3³‡“X8õi’’åfæå]SÞlºR7m?Ì—¿Ï¢€¦°r¹žqžPåÓì³'Õµç_ÏIY¬pÏ|!BF‹½³¬ê²’ìú×ò×™ŸTcËÀŒ ççà^ îÑ4DAR.ÈÂôŽó·¸˜á:Ò0õ­¥³ü>ÜL0°˜,`+üÌŒ¿ûþpÿ’Ffëöè©)”lI¦ÝDwB}ŠÓÄùû˜õ§ƒWIšö‡¢ÌV¥$ëLeÆñxâSÆÁ—ˆ&zõå§ó‹—§—S—á†Ö]ï/E•—ÝZ’¿¡ËGø½ÿ;.Çïg˃ÏÞñÕÇ÷gy ‹ž_ Ž "]½Šóó}V­KyhvôkYìÃÚEðËíúP f½7E¥ÈAÓUUQÝYíõüG5\&\ö}ÝdeÙ{5qJŸš|ש{áåÑ(¶ïN.?ž~Xž^œ¿Þå½l%¹íª\u)o urÛÈuלpvQÝÖ7Í™1áA9˜(ší}KcÀÜŽ–Umï¦{θx_ï:GÝ!Šü~ Í}'uÈä]d W<‚S¦/ø:Ð^˜jÚ¥}Ïap*ÝØð)¬è¸ô„÷n6:„Ùv[ÀRd…Þw[h:é}B.×Þ×ÒDxy¢ Ûg8dµ–mÞ[U7ÐÌ[•©N#g]cÍV@æ¯Æ#ÄE׉.þÉ©L`+Ñ?®²ü¡çXÒÂW¬i½é¡2íŒÓ€kW¼³‹˛ˋãßN–?_#‹“z«-@.'eÉ£Ê!z¡,¥‚-}…˜Ðx> y"PkØ{t9H eÅÝ÷r²?¥bÔñwݰK/q ªóa¢b"©¯´î M-tvmv!’:U(¸ úÐ\„9E T±1û¸>a´“н¬Õ_¦PƒSN_ÃÈûE*½M \´)È-Iav•ôÖj%taÕs²<=;ùèR2%.p:0œÍ^z¯o†@:üóõjšLÃ0\ %Ò¾mxŸê!°¢ßÌÌL?éšIí莥°•ÜY¸ÊµI”)6³ þ»×–tЭ 86‰œè|*ÇÈÁ%–jŒlm²¤Ù0»dÐ\i¢™Û)E6u«ÈJÂ*[¯"ôAàº;r”xS•ãœ#?èkè„Nû{€•οÉQVš}ƒ£Mk=1®ôÕí*{zr E$\þŒ¸ÜÓdJØN¦…ILÃQ•Ýu :ÙÃr¹"„%ƒ–C„ZÆÐ ½¸ZšŒ¥ÜèwsGÐOcœ@ù‡“€›nªpkÙÖ¨ÿ†Kõ0NTO`Ìr´‰¶«ó[#ôû鯅8fýÞAóÈP]Ü•FhCÇêSR^pÈ]ì÷”ñmՊúk@SÅ™Oû:§çã^8ômÐ~èRPÒÞ×]¹ÖCöJ"¿^2›}\ñìšq„HpÖÚ4ô`ÑþæùH|#ÿÝÁñÛ÷ﲩ˜w0Tø©oIÏ{{l<ŠQEé—&Ázþönp ª¥ïpŸ½“å<…à‰$ñÞž¾¿Ük¢ $ã( †È/ÇÒÙ MvOÚãßшe½þ™P9Ø í¤ÃÑ/!Y«Zí¶ˆÁ‡qˆù(oRJh+uÖ ¨F§c‚ì_yð]fú~dÁâ\4Ï;ä'*Ӹ̩®Ùz‡G#g¦…{0p4èQ馳ƒ#£aöŠÅŒ÷¢‰oZ‡ä而žû`û0yàC^ÈÐá|ÁCÆ<Ü u'u†iH–õ¸8tßÝçé`p:Ð1´?9Ê5ìBŒ œùX߻Ś@úš-úÂŒ/Û¦˜v±]œÆDÞjÔ@õc t̃©O ¨è( ¿Ã)Y=tHµ½žÿH^ô-¤ÁÏ×|ûŒÎ’2rÏ̪d?î™v9ÖgW—KûÐezo8f|\JÒ3vÏ‰Ó é!ö\=ÄöÄ*ÑB–õÖN¿ÏžÖô£Űc›5ªÈ»2Íø=ÊÑ·‰@ÓmG{ó¡=e“í`¸€ÐÕ̓9§Ýaø Òk×4Øg¯q}g¨œQ±dȧ¶ÜÍAÏé'bjSÃRÈð85ûï£@JîmiïÛøtˆ8.æ!…W?säªsž€<ê‘Ý0ª¸%øX‡ì_˜‡…¢Â/ÕÖWPÌrÈ÷9kHà™Ø _w× ‡æ=ø…Í:ò×Ç _ÀTÝ3ëHÉEÉ@rÈ5?Ö ŠïÚaLÍÿøp2"†Ï” ØœGîé¯cÛþ`»+‰`,Ò¡mÛÁñÓÉröøó?&“endstream endobj 6 0 obj 2610 endobj 14 0 obj <> stream xœ½X]sÛ6}ׯÀô%ÔŽ„’ øµo®×í¨±-¯C§“qv<´IÜH¤KRöê?ìÞs‚¤d§ÉNg:yH"âãâÞsÎ=ÀïÌåséOû÷b7úñ6bëzä²õè÷‘§?²ö¯ÅŽý”b@L?¤«‘™ã±H°(ñyœ°t7rûjû°Ûo›ü¡._Æé¿G¡ä F¦Ë‘çÅÜ“,}Ý;ªùìøŸÇl›?ÒœñT.wÝȹʊ}¶e§ ý+ýuäÇ’ aÖ² ÐS?Џ'ØÔé“K;8çw·—7óˡëùõûì¸f0ÆL1ãîJ½€võu^7ªÒÛ°t1 —~·ÛM šìÒú­lX^`–ÂÔ%þÉ*•-óBÕ5¶; @]˜…¦^Èc=±mv¡ÞŸ‹,ï"‹x»®ýð*´>>—Ï…—$oÆ5¿K˜ø {©òFý‘Í®Mlþ_ÛcÙlLæ²bù}‘ÞB½½¸še“8ÎG DÐɃ¨÷ÅÛqOÁ¬©:ªt£h»o=×Ò/汈[b9 ˆ‡¨Lõ¹ç»^ûñ‹êεy2‹v”ö¸Ø%³Š>F<ˆ“Xšß\E‰&×z¿SÐ_³Œ=Uy»·Ð‰=»Q»ÊsÖíp¯_ÊA&ŸJÍv(÷l“ÙøÍ E»‚jw}Æœž…-Lì+ÕF‹bˆÓhŸór_o¬V {É›ÍI*C¨RÛ•“Õu¾.:¨õ‰Š!7a’tûÄz›¦dŠaR¹È§F—b—K™ØZã?‘§‡f0 …5¯*<ˆ|[Øã²ÐMd_u­°À‚èË­Îf+V”]‚7YÈTA ˜°n–Ÿð ˆì!dd…ù ‘m·t–ë»ËKÎÒ Õ¹#ãIj_®Ø¢ÜW5¥[¶¹1—AŠÉ‚1qp›³Ïs¾P )Ëžž¶ù"kò²¨‘ %{hž û`Èüà(õĪj2ðr™5++V7Õ~Ñ´Ó²JÑù¢A©Mtš±’ÌÖ¹a•…˜ÅܦìY× Š„‹N‹ºGœÇýØ*ȽCi´"çfu( Ááy†®mb{¤í„„"à~_Ì7YzßCBÿ¤uÌBßä¢'|;'içœrQºžø#.Ú½¾ÅÅPñ_SÃ˧æ-*êtu¢™¦b“·¤ð½Ø‚Ϲšß¤æçï/Òè÷´f²«.~&Þ³”uçÐ"¯+h¹‰'A<< (¤©çƒÂ}Kh{‘ÞÝ^³cχ# =çìòîB£¦?Ͱ/Юå,9<© [«BUpF­cb:1Æ€¬Æh2‰c'©TU4Ó€’°x9r.ÕøUÕ Œ‰áâëãz'åöãâ@%¤xEŽ{çï³±Œ`Ê\é¬z3“'Ÿ'Âos)¸ ¹È%°U©…ʶói¬—1Q/2$ä®/ì¦:1çgè°Ww—cá:éìáæâöçù핎¡‹vÐÚ$xg7™4/ÇÝ~wºÇ¬†mÑʬ$-êM¹ß.};-¼+úUØéü‰ vf ´Ý÷ëmù ˜ƒaQ/Ùš¾Ê…0­%/&ÐîU 9¤°_4XbÁMCÛ6”7 ÙŽg £Áea!öN,î c*Dˆ*Xi¯tÑëÙo»‹ìH]¥æìô’ÜaY뒠c”ôìÕS¡EŽâf}‰n'NÏù_–,oL+rÕ»+T¾Û©%µ‰í¡íp.X ¦­;éäq Ÿp6n§…®«{¦³o´èTªÙW…&Þ;_³Ã©´z¸$à|»žß®mÝõÇB—Ž¢Ó-©`º fG²ïåu¿.ü®êUòmö¸Õ]¸XÐ1ã8Ø EÖ)¸{°ë¢À µ‚ö–«a#õpVCÒÅ¿¢¡šëFöC #PÿW-àFœ] ofÛ)62…ŸØ|©ªªõä„“1¹Pkf¿C3T Ü]há\6ðïXøÃüýùEzº®Ä]!éŠD¦­¬eÓZÆ~÷u®M”¹‰G¶‰J-kªÁ‚EàdÛ=éSk®h¤N.ðÐ) óB§Ž¥çS_Ë‹µ†pmm:Ý®u¹±æNþŒqª6.É‘œ-—Leõ¡MnmÎ:¼.—æÛg-ú‰¶§SFE45Æ€ ’L©»®”PÔ"[«¾Lt¯ÁýŶÐn_#rº¤éæ½È@ÈBÖ‰Ïú@úºqF:FÐq¢i[XLOl¸IïUy:lײ3g¿~‘ÓÞÛµ¬òyè''‰† - üͦ*÷ë XéIÇ„zÈãax‰;]pzåpþ»Z[eîûÅ·5ú¿:¹ Á&Kÿˆ¬î7 ì¸Æü±¤2Ã^Ø»·C¹wBÎ~ÇUtÖÇà!Ðù#ÅAFIräb%†ºÎj;°º¤)]š¾É>;…ÃïCׄžÛ&xz›¬'Œ`=äÑÁ XsB'¿ãdwÃoÊíÒœÞ 6²o26UŒ&ì7bKGUœXªF-pižè¥ß|„®Ë{'!cÏ><IÄèšG§E0fúŶÆGÝqÖeÓ:NûZÑ[x¸>õ2Ý{*¡žò(A3{û³)3€{Ê+U›µúÚ÷òø·åOšöîø¯¼»D‹ê}З^1„‚y?4ê¬Õu~—¯7…‹à^ÿÈsöKÉ4ȇ5ꉅ­}âA›‹Ð°é¾Ò¶"Œqœ}ÞtqcïÌ´3»<ûiv9K?\Jp÷–q|Rý\dû¢es5­äÓ<¬ZÁ‹Àu.'ºrº’ ~œlÙR(!n³ôÔÆ]KiDÐÍ•¢,‚CÎÑûg×l’_ß~Áqö[0‡z"Œ³ìž­ýt‘Žþ‰?ÿSÒœõendstream endobj 15 0 obj 2522 endobj 19 0 obj <> stream xœ¥SËnÛ0¼ó+¶7 ˆ6|I$-àKТh¢[RªD'j$Û±$´Ñ.©‡©=-x ÀÎÎîì¾C,œé.r}«á±% É áC¦«hàCæ&> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 18 0 obj <> /Contents 19 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R 18 0 R ] /Count 3 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 21 0 obj <> endobj 22 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 23 0 obj <> endobj 8 0 obj <> endobj 24 0 obj <> endobj 25 0 obj <>stream 2014-01-29T08:09:48+01:00 2014-01-29T08:09:48+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 26 0000000000 65535 f 0000006453 00000 n 0000008575 00000 n 0000006380 00000 n 0000005896 00000 n 0000000015 00000 n 0000002695 00000 n 0000006518 00000 n 0000007004 00000 n 0000006867 00000 n 0000006799 00000 n 0000006559 00000 n 0000006589 00000 n 0000006056 00000 n 0000002715 00000 n 0000005309 00000 n 0000006639 00000 n 0000006669 00000 n 0000006218 00000 n 0000005330 00000 n 0000005876 00000 n 0000006719 00000 n 0000006749 00000 n 0000006948 00000 n 0000007086 00000 n 0000007152 00000 n trailer << /Size 26 /Root 1 0 R /Info 2 0 R /ID [<0C15957D09D4D6C01E45A8DE0520CF08><0C15957D09D4D6C01E45A8DE0520CF08>] >> startxref 8729 %%EOF curl-7.35.0/docs/libcurl/curl_global_cleanup.html0000644000175000017500000000474112272124467016757 00000000000000 curl_global_cleanup man page

NAME

curl_global_cleanup - global libcurl cleanup

SYNOPSIS

#include <curl/curl.h>

void curl_global_cleanup(void);

DESCRIPTION

This function releases resources acquired by curl_global_init(3).

You should call curl_global_cleanup(3) once for each call you make to curl_global_init(3), after you are done using libcurl.

This function is not thread safe. You must not call it when any other thread in the program (i.e. a thread sharing the same memory) is running. This doesn't just mean no other thread that is using libcurl. Because curl_global_cleanup(3) calls functions of other libraries that are similarly thread unsafe, it could conflict with any other thread that uses these other libraries.

See the description in libcurl(3) of global environment requirements for details of how to use this function.

SEE ALSO

curl_global_init (3) libcurl (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_multi_add_handle.html0000644000175000017500000000656112272124467017267 00000000000000 curl_multi_add_handle man page

NAME

curl_multi_add_handle - add an easy handle to a multi session

SYNOPSIS

#include <curl/curl.h>

CURLMcode curl_multi_add_handle(CURLM *multi_handle, CURL *easy_handle);

DESCRIPTION

Adds a standard easy handle to the multi stack. This function call will make this multi_handle control the specified easy_handle. Furthermore, libcurl now initiates the connection associated with the specified easy_handle.

When an easy handle has been added to a multi stack, you can not and you must not use curl_easy_perform(3) on that handle!

If the easy handle is not set to use a shared (CURLOPT_SHARE) or global DNS cache (CURLOPT_DNS_USE_GLOBAL_CACHE), it will be made to use the DNS cache that is shared between all easy handles within the multi handle when curl_multi_add_handle(3) is called.

If you have CURLMOPT_TIMERFUNCTION set in the multi handle (and you really should if you're working event-based with curl_multi_socket_action(3) and friends), that callback will be called from within this function to ask for an updated timer so that your main event loop will get the activity on this handle to get started.

The easy handle will remain added until you remove it again with curl_multi_remove_handle(3). You should remove the easy handle from the multi stack before you terminate first the easy handle and then the multi handle:

1 - curl_multi_remove_handle(3)

2 - curl_easy_cleanup(3)

3 - curl_multi_cleanup(3)

RETURN VALUE

CURLMcode type, general libcurl multi interface error code.

SEE ALSO

curl_multi_cleanup (3) curl_multi_init (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_share_strerror.html0000644000175000017500000000356612272124467017060 00000000000000 curl_share_strerror man page

NAME

curl_share_strerror - return string describing error code

SYNOPSIS

#include <curl/curl.h> const char *curl_share_strerror(CURLSHcode errornum );

DESCRIPTION

The curl_share_strerror() function returns a string describing the CURLSHcode error code passed in the argument errornum.

AVAILABILITY

This function was added in libcurl 7.12.0

RETURN VALUE

A pointer to a zero terminated string.

SEE ALSO

libcurl-errors (3) curl_multi_strerror (3) curl_easy_strerror (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_multi_init.html0000644000175000017500000000372712272124467016170 00000000000000 curl_multi_init man page

NAME

curl_multi_init - create a multi handle

SYNOPSIS

#include <curl/curl.h>

CURLM *curl_multi_init( );

DESCRIPTION

This function returns a CURLM handle to be used as input to all the other multi-functions, sometimes referred to as a multi handle in some places in the documentation. This init call MUST have a corresponding call to curl_multi_cleanup(3) when the operation is complete.

RETURN VALUE

If this function returns NULL, something went wrong and you cannot use the other curl functions.

SEE ALSO

curl_multi_cleanup (3) curl_global_init (3) curl_easy_init (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_slist_free_all.pdf0000644000175000017500000000630012272124471016570 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ…SYÓ0~ϯ‰DܱSç©@Šz,m µ¨Ê¦iHÓnŽ®ø÷؉æ¢+dɉ<3žï?R¨–þÆGc°pa_{ãÑ`Mô'>ÂÇP&xê Üm —ƒëÛÔó!<Œy„OÆŠÄu‘mÊ,-«Í®H’M”ekb¯MÈÒ3-."ºdåu”ÁKæð‹a!åLöˆ%_B ¾P(l‰Af#óµD-£LPáÛY¸5È40ß=Ìé]°WaT8oÁ Ô/D9$y•I¨­½µÃ’8,æP¯i»ü>›ß-ÇËç4 U7&¯Ò<ÎêmïÕŵÑÕn)3$ >lx]N/Ÿú-©I·×R™Jtt=ÒiVVEW}Ðo  †{΢£eR)kóÝ¿¬8ʶ}fŸƒå§Åø.Ïg×ÊöÈÝ´QÚ^$ÇSGQ4V!£®«1\ãT´d¹ç{C*#jÝEêÙÈ:%¤UUÅI §Dp.“ ¥…M.é©.³ßð`r$ušU׿¿L†mf²m<¥Z¢>&\5Øù¯È"ï3øf2{(¥ad4¹tå -f§êæ{ú¿ M–ó¦§it>'ùöZ}W½ãë!Í£yÛHÍ£B¼°¹n¥¸{‚s X[/¦Ïz;Ô–Nè@TÄàˆ¬©"uº jN‚Ðø*×zÑendstream endobj 6 0 obj 546 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <>stream 2014-01-29T08:09:45+01:00 2014-01-29T08:09:45+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 14 0000000000 65535 f 0000000869 00000 n 0000002677 00000 n 0000000810 00000 n 0000000650 00000 n 0000000015 00000 n 0000000631 00000 n 0000000934 00000 n 0000001188 00000 n 0000001123 00000 n 0000001055 00000 n 0000000975 00000 n 0000001005 00000 n 0000001254 00000 n trailer << /Size 14 /Root 1 0 R /Info 2 0 R /ID [<5CE0AD80C9DF131D6692271939551BB9><5CE0AD80C9DF131D6692271939551BB9>] >> startxref 2831 %%EOF curl-7.35.0/docs/libcurl/curl_easy_getinfo.html0000644000175000017500000005334612272124467016471 00000000000000 curl_easy_getinfo man page

NAME

curl_easy_getinfo - extract information from a curl handle

SYNOPSIS

#include <curl/curl.h>

CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );

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 *, a pointer to a struct curl_slist * or a pointer to a double (as this documentation describes further down). The data pointed-to will be filled in accordingly and can be relied upon only if the function returns CURLE_OK. Use this function AFTER a performed transfer if you want to get transfer- oriented data.

You should not free the memory returned by this function unless it is explicitly mentioned below.

AVAILABLE INFORMATION

The following information can be extracted:

CURLINFO_EFFECTIVE_URL

Pass a pointer to a char pointer to receive the last used effective URL.

CURLINFO_RESPONSE_CODE

Pass a pointer to a long to receive the last received HTTP, FTP or SMTP response code. This option was previously known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier. The value will be zero if no server response code has been received. Note that a proxy's CONNECT response should be read with CURLINFO_HTTP_CONNECTCODE and not this.

Support for SMTP responses added in 7.25.0.

CURLINFO_HTTP_CONNECTCODE

Pass a pointer to a long to receive the last received proxy response code to a CONNECT request.

CURLINFO_FILETIME

Pass a pointer to a long to receive the remote time of the retrieved document (in number of seconds since 1 jan 1970 in the GMT/UTC time zone). If you get -1, it can be because of many reasons (unknown, the server hides it or the server doesn't support the command that tells document time etc) and the time of the document is unknown. Note that you must tell the server to collect this information before the transfer is made, by using the CURLOPT_FILETIME option to curl_easy_setopt(3) or you will unconditionally get a -1 back. (Added in 7.5)

CURLINFO_TOTAL_TIME

Pass a pointer to a double to receive the total time in seconds for the previous transfer, including name resolving, TCP connect etc.

CURLINFO_NAMELOOKUP_TIME

Pass a pointer to a double to receive the time, in seconds, it took from the start until the name resolving was completed.

CURLINFO_CONNECT_TIME

Pass a pointer to a double to receive the time, in seconds, it took from the start until the connect to the remote host (or proxy) was completed.

CURLINFO_APPCONNECT_TIME

Pass a pointer to a double to receive the time, in seconds, it took from the start until the SSL/SSH connect/handshake to the remote host was completed. This time is most often very near to the PRETRANSFER time, except for cases such as HTTP pippelining where the pretransfer time can be delayed due to waits in line for the pipeline and more. (Added in 7.19.0)

CURLINFO_PRETRANSFER_TIME

Pass a pointer to a double to receive the time, in seconds, it took from the start until the file transfer is just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. It does not involve the sending of the protocol- specific request that triggers a transfer.

CURLINFO_STARTTRANSFER_TIME

Pass a pointer to a double to receive the time, in seconds, it took from the start until the first byte is received by libcurl. This includes CURLINFO_PRETRANSFER_TIME and also the time the server needs to calculate the result.

CURLINFO_REDIRECT_TIME

Pass a pointer to a double to receive the total time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started. CURLINFO_REDIRECT_TIME contains the complete execution time for multiple redirections. (Added in 7.9.7)

CURLINFO_REDIRECT_COUNT

Pass a pointer to a long to receive the total number of redirections that were actually followed. (Added in 7.9.7)

CURLINFO_REDIRECT_URL

Pass a pointer to a char pointer to receive the URL a redirect would take you to if you would enable CURLOPT_FOLLOWLOCATION. This can come very handy if you think using the built-in libcurl redirect logic isn't good enough for you but you would still prefer to avoid implementing all the magic of figuring out the new URL. (Added in 7.18.2)

CURLINFO_SIZE_UPLOAD

Pass a pointer to a double to receive the total amount of bytes that were uploaded.

CURLINFO_SIZE_DOWNLOAD

Pass a pointer to a double to receive the total amount of bytes that were downloaded. The amount is only for the latest transfer and will be reset again for each new transfer.

CURLINFO_SPEED_DOWNLOAD

Pass a pointer to a double to receive the average download speed that curl measured for the complete download. Measured in bytes/second.

CURLINFO_SPEED_UPLOAD

Pass a pointer to a double to receive the average upload speed that curl measured for the complete upload. Measured in bytes/second.

CURLINFO_HEADER_SIZE

Pass a pointer to a long to receive the total size of all the headers received. Measured in number of bytes.

CURLINFO_REQUEST_SIZE

Pass a pointer to a long to receive the total size of the issued requests. This is so far only for HTTP requests. Note that this may be more than one request if FOLLOWLOCATION is true.

CURLINFO_SSL_VERIFYRESULT

Pass a pointer to a long to receive the result of the certification verification that was requested (using the CURLOPT_SSL_VERIFYPEER option to curl_easy_setopt(3)).

CURLINFO_SSL_ENGINES

Pass the address of a 'struct curl_slist *' to receive a linked-list of OpenSSL crypto-engines supported. Note that engines are normally implemented in separate dynamic libraries. Hence not all the returned engines may be available at run-time. NOTE: you must call curl_slist_free_all(3) on the list pointer once you're done with it, as libcurl will not free the data for you. (Added in 7.12.3)

CURLINFO_CONTENT_LENGTH_DOWNLOAD

Pass a pointer to a double to receive the content-length of the download. This is the value read from the Content-Length: field. Since 7.19.4, this returns -1 if the size isn't known.

CURLINFO_CONTENT_LENGTH_UPLOAD

Pass a pointer to a double to receive the specified size of the upload. Since 7.19.4, this returns -1 if the size isn't known.

CURLINFO_CONTENT_TYPE

Pass a pointer to a char pointer to receive the content-type of the downloaded object. This is the value read from the Content-Type: field. If you get NULL, it means that the server didn't send a valid Content-Type header or that the protocol used doesn't support this.

CURLINFO_PRIVATE

Pass a pointer to a char pointer to receive the pointer to the private data associated with the curl handle (set with the CURLOPT_PRIVATE option to curl_easy_setopt(3)). Please note that for internal reasons, the value is returned as a char pointer, although effectively being a 'void *'. (Added in 7.10.3)

CURLINFO_HTTPAUTH_AVAIL

Pass a pointer to a long to receive a bitmask indicating the authentication method(s) available. The meaning of the bits is explained in the CURLOPT_HTTPAUTH option for curl_easy_setopt(3). (Added in 7.10.8)

CURLINFO_PROXYAUTH_AVAIL

Pass a pointer to a long to receive a bitmask indicating the authentication method(s) available for your proxy authentication. (Added in 7.10.8)

CURLINFO_OS_ERRNO

Pass a pointer to a long to receive the errno variable from a connect failure. Note that the value is only set on failure, it is not reset upon a successful operation. (Added in 7.12.2)

CURLINFO_NUM_CONNECTS

Pass a pointer to a long to receive how many new connections libcurl had to create to achieve the previous transfer (only the successful connects are counted). Combined with CURLINFO_REDIRECT_COUNT you are able to know how many times libcurl successfully reused existing connection(s) or not. See the Connection Options of curl_easy_setopt(3) to see how libcurl tries to make persistent connections to save time. (Added in 7.12.3)

CURLINFO_PRIMARY_IP

Pass a pointer to a char pointer to receive the pointer to a zero-terminated string holding the IP address of the most recent connection done with this curl handle. This string may be IPv6 if that's enabled. Note that you get a pointer to a memory area that will be re-used at next request so you need to copy the string if you want to keep the information. (Added in 7.19.0)

CURLINFO_PRIMARY_PORT

Pass a pointer to a long to receive the destination port of the most recent connection done with this curl handle. (Added in 7.21.0)

CURLINFO_LOCAL_IP

Pass a pointer to a char pointer to receive the pointer to a zero-terminated string holding the local (source) IP address of the most recent connection done with this curl handle. This string may be IPv6 if that's enabled. The same restrictions apply as to CURLINFO_PRIMARY_IP. (Added in 7.21.0)

CURLINFO_LOCAL_PORT

Pass a pointer to a long to receive the local (source) port of the most recent connection done with this curl handle. (Added in 7.21.0)

CURLINFO_COOKIELIST

Pass a pointer to a 'struct curl_slist *' to receive a linked-list of all cookies cURL knows (expired ones, too). Don't forget to curl_slist_free_all(3) the list after it has been used. If there are no cookies (cookies for the handle have not been enabled or simply none have been received) 'struct curl_slist *' will be set to point to NULL. (Added in 7.14.1)

CURLINFO_LASTSOCKET

Pass a pointer to a long to receive the last socket used by this curl session. If the socket is no longer valid, -1 is returned. When you finish working with the socket, you must call curl_easy_cleanup() as usual and let libcurl close the socket and cleanup other resources associated with the handle. This is typically used in combination with CURLOPT_CONNECT_ONLY. (Added in 7.15.2)

NOTE: this API is not really working on win64, since the SOCKET type on win64 is 64 bit large while its 'long' is only 32 bits.

CURLINFO_FTP_ENTRY_PATH

Pass a pointer to a char pointer to receive a pointer to a string holding the path of the entry path. That is the initial path libcurl ended up in when logging on to the remote FTP server. This stores a NULL as pointer if something is wrong. (Added in 7.15.4)

Also works for SFTP since 7.21.4

CURLINFO_CERTINFO

Pass a pointer to a 'struct curl_certinfo *' and you'll get it set to point to struct that holds a number of linked lists with info about the certificate chain, assuming you had CURLOPT_CERTINFO enabled when the previous request was done. The struct reports how many certs it found and then you can extract info for each of those certs by following the linked lists. The info chain is provided in a series of data in the format "name:content" where the content is for the specific named data. See also the certinfo.c example. NOTE: this option is only available in libcurl built with OpenSSL, NSS, GSKit or QsoSSL support. (Added in 7.19.1)

CURLINFO_TLS_SESSION

Pass a pointer to a 'struct curl_tlsinfo *'. The pointer will be initialized to refer to a 'struct curl_tlsinfo *' that will contain an enum indicating the SSL library used for the handshake and the respective internal TLS session structure of this underlying SSL library.

This may then be used to extract certificate information in a format convenient for further processing, such as manual validation. NOTE: this option may not be available for all SSL backends; unsupported SSL backends will return 'CURLSSLBACKEND_NONE' to indicate that they are not supported; this does not mean that no SSL backend was used. (Added in 7.34.0)

CURLINFO_CONDITION_UNMET

Pass a pointer to a long to receive the number 1 if the condition provided in the previous request didn't match (see CURLOPT_TIMECONDITION). Alas, if this returns a 1 you know that the reason you didn't get data in return is because it didn't fulfill the condition. The long ths argument points to will get a zero stored if the condition instead was met. (Added in 7.19.4)

CURLINFO_RTSP_SESSION_ID

Pass a pointer to a char pointer to receive a pointer to a string holding the most recent RTSP Session ID.

Applications wishing to resume an RTSP session on another connection should retrieve this info before closing the active connection.

CURLINFO_RTSP_CLIENT_CSEQ

Pass a pointer to a long to receive the next CSeq that will be used by the application.

CURLINFO_RTSP_SERVER_CSEQ

Pass a pointer to a long to receive the next server CSeq that will be expected by the application.

(NOTE: listening for server initiated requests is currently unimplemented).

Applications wishing to resume an RTSP session on another connection should retrieve this info before closing the active connection.

CURLINFO_RTSP_CSEQ_RECV

Pass a pointer to a long to receive the most recently received CSeq from the server. If your application encounters a CURLE_RTSP_CSEQ_ERROR then you may wish to troubleshoot and/or fix the CSeq mismatch by peeking at this value.

TIMES

An overview of the six time values available from curl_easy_getinfo()

curl_easy_perform()   |   |--NAMELOOKUP   |--|--CONNECT   |--|--|--APPCONNECT   |--|--|--|--PRETRANSFER   |--|--|--|--|--STARTTRANSFER   |--|--|--|--|--|--TOTAL   |--|--|--|--|--|--REDIRECT

NAMELOOKUP

CURLINFO_NAMELOOKUP_TIME. The time it took from the start until the name resolving was completed.

CONNECT

CURLINFO_CONNECT_TIME. The time it took from the start until the connect to the remote host (or proxy) was completed.

APPCONNECT

CURLINFO_APPCONNECT_TIME. The time it took from the start until the SSL connect/handshake with the remote host was completed. (Added in in 7.19.0)

PRETRANSFER

CURLINFO_PRETRANSFER_TIME. The time it took from the start until the file transfer is just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved.

STARTTRANSFER

CURLINFO_STARTTRANSFER_TIME. The time it took from the start until the first byte is received by libcurl.

TOTAL

CURLINFO_TOTAL_TIME. Total time of the previous request.

REDIRECT

CURLINFO_REDIRECT_TIME. The time it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started. So, this is zero if no redirection took place.

RETURN VALUE

If the operation was successful, CURLE_OK is returned. Otherwise an appropriate error code will be returned.

SEE ALSO

curl_easy_setopt (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_easy_unescape.html0000644000175000017500000000523612272124467016634 00000000000000 curl_easy_unescape man page

NAME

curl_easy_unescape - URL decodes the given string

SYNOPSIS

#include <curl/curl.h>

char *curl_easy_unescape( CURL * curl , char * url , int inlength , int * outlength );

DESCRIPTION

This function converts the given URL encoded input string to a "plain string" and returns that in an allocated memory area. All input characters that are URL encoded (%XX where XX is a two-digit hexadecimal number) are converted to their binary versions.

If the length argument is set to 0 (zero), curl_easy_unescape(3) will use strlen() on the input url string to find out the size.

If outlength is non-NULL, the function will write the length of the returned string in the integer it points to. This allows an escaped string containing %00 to still get used properly after unescaping.

You must curl_free(3) the returned string when you're done with it.

AVAILABILITY

Added in 7.15.4 and replaces the old curl_unescape(3) function.

RETURN VALUE

A pointer to a zero terminated string or NULL if it failed.

SEE ALSO

curl_easy_escape(3), curl_free(3), RFC 2396

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_escape.html0000644000175000017500000000467412272124467015255 00000000000000 curl_escape man page

NAME

curl_escape - URL encodes the given string

SYNOPSIS

#include <curl/curl.h>

char *curl_escape( char * url , int length );

DESCRIPTION

Obsolete function. Use curl_easy_escape(3) instead!

This function will convert the given input string to an URL encoded string and return that as a new allocated string. All input characters that are not a-z, A-Z or 0-9 will be converted to their "URL escaped" version (%NN where NN is a two-digit hexadecimal number).

If the 'length' argument is set to 0, curl_escape() will use strlen() on the input 'url' string to find out the size.

You must curl_free() the returned string when you're done with it.

AVAILABILITY

Since 7.15.4, curl_easy_escape(3) should be used. This function will be removed in a future release.

RETURN VALUE

A pointer to a zero terminated string or NULL if it failed.

SEE ALSO

curl_unescape (3) curl_free (3) RFC 2396

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_formget.pdf0000644000175000017500000001047212272124475015255 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ…WmoÛ6þî_ÁaÀJeKê]Ø:Àí<,EÞ–¨ÅŠx™ŽµÊ’+QÉÒaÿ`?zGRÔ‹“`0`ÃâË=w÷Üs§/ˆ†¨üt¿Ùnöú2DwÍŒ¢»Ù—S‹¨ûÉvèm"ù ÙÌô†B…±K¢%»s#B}”<Ì®qÖÖÅͦªww\¬°»²P‘ßʇ–íø”PâÓ´lÓ=Ùiý‘¼ŸÙ”8 nÍÀh FIìK»n€’“>[X¯'¬2Ÿø± X’õ Ÿ.­äÏJ‡†ÈfŽ\¦O‘!5¼ÎÓ"ÿÊQŠö5·_‚sñ}^µMñˆn-‡â6/Úµ…È÷i-^ËÓëT¤è×$¹@çW ʶi^*ä¼6¶Y@"…ïêÓÙùÅÕñ•Fw(Õ…›—YÑ®9úQ¢|-¿Èö'¹]ÆCG£wÎS¡¸¯L(b°¢âpóõAXQ·™Ð·Bì÷U#Ð’ësto±˜Ä‘ïá µ’ý\ùâú`Õ€ßx“¥Eq›fŸQºßórVÖƒWÆùˆœÿyyõîòø"9>?›fiðŸ/ŽŸãÐ'o[#QR¦’ ²æiÆY#”…L¥îµ §r±í²Ä¨ d€±ŽC½át½Öt°.‰ãxþÔéN‘…ܦé’Åýuß‹¸u/7xqœÈ¬A´Uj=¿Ã"Øã…: û*/¯QÚ€ÓYqNk‹A•Ñ Àw펗•鎯}b¾C<æw†TFJ# qvð¥ÅH[|ØæÙÂTè–£}ÚȘƒy±åèßHc„‘‘«&p ŠãKqgÞÖ^:‘ÇÕˆ§\Ú´e&òª$ÓIŽ®±xÜó5ß Ò~#Ð i{}½ðre­ð½¥híúš×Ob‡$œ„h>µë„RƒŒ~p꼆«&Ùßè³1'nÛn›T'ÞÌ{® ¶ hXD 3´—ÍÀÓ€xA§àå-ƒŒÆûz4 ·](fßC¶Ô ?‰G¥ ånšÃnüð¿=È£oœù‹÷Î@Æ£8òô‚¼Ÿ©û³V…àrÄS –PTmeä“ …"œf’õ·òjÇ÷H2£líFÕzL¼áškP?‰ Yf<¥"¸£¯!¨ñk×B"ËJHß65çëΰYo¶U[¬QÍE[—ê¨BâR‡g a6òTBDid|e!ÈÏØ¢Bn—¨i3].dÜ ÃA]yÓ(ÞSâ:ªñ±ŠÈûˆ’>¼ûpyòËùåéÍUr¹\œNÎhL¼(4Ð\Gi ®ö²Âz9͵ƒ2÷²'Ì%L•w©ª“´>ñœ ³|ÿBÚqyÈZp3 ¡Iß@4‹QzTg–×¼L( X*Åâši¹”Dz ÖKÈnîArܪyº('*…0ñ}Ö“RôÍÓ¶:ž)º¡ær™|¸,µÚ¸FãÝ þB§ô‡§esPöÀ¼‘¼¼”ÿk\?Š­Œýƒ_¹X†äó ®´¿òºB;u{Z"^×  Uá©û6™@Û]:"–¿/N/NÆ<;}ãÓu§À_hý¬3ôè 0Щ†0nes4Öw=>ȶÒnæ¦ç@Ew\•¦`ôúJsdxóP炯ð­§<¦é9bp‰XW­²,o- zØÊ =‚ G åAhíð÷û7ò¬ÞŽ;-R^ÍìÞ*þG•†Ÿõü¥ÙO­YpÙsΘ«D%ÒâFþAoUç›ÕÁt¦…ã»aóüÅè[àØÔR癉¬ÛL:tÒìÌ< ›?Šž¼7ØG:Á.ê©‚^|DÃèæÈÖÁ ÇOoOŽ“Oº*õ&ŠÞ*’-(ª™_4ùc'ˆ$ùaÔBk” $ò­å_–K´8¹:éeÁˆ)L@X«:êÇ0RĦQ÷³¬ûú¹Í`^é®:€KnÊŠÞ·%GLœêz/0/[L^¶Lf¿Áç?:®Úendstream endobj 6 0 obj 1599 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:49+01:00 2014-01-29T08:09:49+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001923 00000 n 0000003803 00000 n 0000001864 00000 n 0000001704 00000 n 0000000015 00000 n 0000001684 00000 n 0000001988 00000 n 0000002242 00000 n 0000002177 00000 n 0000002109 00000 n 0000002029 00000 n 0000002059 00000 n 0000002324 00000 n 0000002380 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 3957 %%EOF curl-7.35.0/docs/libcurl/curl_easy_cleanup.html0000644000175000017500000000543112272124467016455 00000000000000 curl_easy_cleanup man page

NAME

curl_easy_cleanup - End a libcurl easy session

SYNOPSIS

#include <curl/curl.h>

void curl_easy_cleanup(CURL * handle );

DESCRIPTION

This function must be the last function to call for an easy session. It is the opposite of the curl_easy_init(3) function and must be called with the same handle as input that the curl_easy_init call returned.

This will effectively close all connections this handle has used and possibly has kept open until now. Don't call this function if you intend to transfer more files.

Occasionally you may get your progress callback or header callback called from within curl_easy_cleanup(3) (if previously set for the handle using curl_easy_setopt(3)). Like if libcurl decides to shut down the connection and the protocol is of a kind that requires a command/response sequence before disconnect. Examples of such protocols are FTP, POP3 and IMAP.

Any uses of the handle after this function has been called and have returned, are illegal. This kills the handle and all memory associated with it!

With libcurl versions prior to 7.17.: when you've called this, you can safely remove all the strings you've previously told libcurl to use, as it won't use them anymore now.

RETURN VALUE

None

SEE ALSO

curl_easy_init (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_share_strerror.pdf0000644000175000017500000000655012272124474016657 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœTikÛ@ý®_1Ð]…j³»ºvi)8©¡.Ž“ÚJ 8%(²’¨Ør¢ƒÐþúήY>Bƒ@×\oÞ¼Ùg`”ÓWûLVÖñ4„‡Òbð`=[Ü¡}$+8‰ÐAêѽÕÄp„Ê¥RA´²8÷(—½Xs’ÔÅò¶|Œ‹ô¶¬Š´(ÖÅ qolXfwÚf;Âg”±œÅy/á­ûWôÃrk$A!ª| [d2°?"j´rŸúÊEdÑÂ"gC;úÝÃ,õXÚÌ4ÎC0Á"­ê"ü“å°HˤÈîôkã¬i“º‡ÅA0¨4µgדó‹Ùh¶qkñ¶Õɇ,O–õ"…/±¾ÑǯÚ];Œ­è9\çe ¢ƒ£¨Í%eÜçÄ 6_,”‘uÍÜéåt<ûnj§œu4¸Tˆ†£¹‰ó|ß¼^µîdI[_rcÞïZ„!õD¯óoÃÙéttÎ'ÛôošçT0#=¦‡B¹¯ó¤ÊÖy;â©0Á¦ÕÞ|à).ËtY®}4Íh¾‡z•æÕ.9jR*ù?vºžB*%ã-AT—q8õ¥Ü“ªÃ¹KU¸! ý˜gH\Á@G£HŸ¿R>NFãQt½M%ÊÜõ°H_Ês$3+7¬½ØŠ*%Ib¤n±h¸h·BÊe½YRñœL‡ÑåtW6w=ªNãË¡‰ÔozÜ/> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <>stream 2014-01-29T08:09:48+01:00 2014-01-29T08:09:48+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 14 0000000000 65535 f 0000001037 00000 n 0000002845 00000 n 0000000978 00000 n 0000000818 00000 n 0000000015 00000 n 0000000799 00000 n 0000001102 00000 n 0000001356 00000 n 0000001291 00000 n 0000001223 00000 n 0000001143 00000 n 0000001173 00000 n 0000001422 00000 n trailer << /Size 14 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 2999 %%EOF curl-7.35.0/docs/libcurl/curl_multi_wait.pdf0000644000175000017500000001153012272124475015764 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœµXÛnÜÈ}Ÿ¯h æš^²y‡ƒòF³-Go°Eöhó2Köx,,òÉ?çT7¯#i•—…I «««O:UÍߘÍfÓO÷7-?\‡ì¡]ØìañÛÂÑ/Y÷'-Ùû "z°Ù.̇…‚…±Ë£˜mÊ…•šâ®<*¿;.7ÿZø.£8‚å&[8"à^È6ÇÅ­•äê‹å~Y²"¿§EË•ðbG¾õ!©IÁfž~Ýü´pcÁ}ßx–Ó+› Û§ˆ.Ft<ö)À•çÜõØÊ ô’çdl“ãs?v;W.èùx0asÏÙÊôÚ6á΢Á¶ãÇ[±}]-«+–“IûÈvI•²e9ž1½¨{¤Ï1Á­œ€G:”›_>^}ºYßÌÒ&:ë/y•‡L²¿R@?Ð/¾û™ m.›··ÖŸ¯/?¤5ŒfAÜX‘ANÛ°·æ‰íLøý^·V«šCªŒ—îÐ^@ë·“K`hÛ¡k}WMr·ÍÚÛ_Zm9TmþPÉ 8(ZàQz=³ Â coÑ[•—²>¨»ߘGo«C £/Ëwx2Ç̱ h¿¸ùñzýi³¾úøn6w#A‰´6»¼eÛC•ª›¥î?…d™lÓ&ß«ºiÙ¡Eè÷Lí ’óܦu¥’ÜœN›<äŸ(æwÑqì›Ô9â…‘.b.P^÷²*§Ä át/¦Ì!ßnsÇñúS ¸¾>U+gk¥÷¹7‚é,Ž9Nx_ÔéWv¨T^°}¡x¼‰} í¿åꑪL*™*œ’@R¬ ÿKVoõ©{8êÆ`ïØ½<@â èN2æwž"/â¡ôçÝ%-Û'-pçZ;P×#ç…’M•¬ qă0êBÍÁ÷¹ Ž3ðí§À&+¾Ò˧·íŠ[ë,_ ùˆ"k«4UMŠîÛžÛfûQ€1-uF‡IØ^VY^=P PôEÏt€8M»«¼íjŠjìû>oµ)ÙUl غHòóÈÒY£„Ä8c÷DÔßD #Þ³u:4tØ=UÉ[Óc‰RBrËRf9؉tç4UƒYD<7‹àY¥54ðAf])Î4|nenlææãNV0 ’ª¡÷húPݹH«Ûº+ µ“TW9J¸îzb£ôâA¯É(%ƉQœ´<šìÙð;e¥¥- Æ9=oÒCùm Ž¤a·.KÀšú¾¥©`h½Ùýž—‡ò”üµÑÙH³Öß—¦Àg'Z3ÆC´×;LÆ_mÕbbôPª;°'{7™sMo™ßŒ*[N0–‹ÓÄá!ä:Œ$;—Í\z\ 6~MzF§žÇ];(jý[?6p÷„».‡®]žu¾ÞÜ}ºº¼\4Å1Àæpº\<ïQ;ÿM(»c#„ª‡“KÙ6ãó¸u%¾÷­–ʳuߎÒû¡‘+š“E¦‡vRò†ŠBö²fvspGôþÐR¨/CA´‘Ë}„œúcêŽÙ¬¥ŽST¢’N€²;Ž¡Lå|¸u}1"3ð®pgð‚8iýb–>]¯OÒe·ÿ(O¼p«ý“%Ä3‰Úå;Tz^7t©x.mÂÅ0ê½ÚV…3tÕ.}]ýh]0ŸYi¤„bÞSÇÈ/ðT2^Äöêóæ ¶Aàü¶‚®zñŸ.†ñ3àª|Z÷_U :Õ) ã–X¡+ŒQKÕq>zrA¸—mŠÛ¡i·:&ÒtÊ‚¾uâ=7º_d?/M?p¬óËÏ'cÆTÍÇêq/ÏØƒ¬dƒÑ©f-q˜iÑeÓ`R •œÝHyz½Ë=¿OIçm…EKºXY z]jÍg( ?@¢§ß¡D“¿á¤°³Í|xþ3?J äÃwz‰Y_ž¿__®7¿Ì»t­ýtò˜O“^ß^Ì7ŠÜ"n¿ÚOo..ØùåÍÕ˜´“OQ“K˜ 9Æ8C{üV§:›;Â>A0Þí&Îö”-Ñ uSž ò5…§®5-…Mã)h4Ë[wÞåÊñC ü¾…ð:L@¬´k/è?:äèb³ø~þ`â²endstream endobj 6 0 obj 2138 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:49+01:00 2014-01-29T08:09:49+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000002462 00000 n 0000004345 00000 n 0000002403 00000 n 0000002243 00000 n 0000000015 00000 n 0000002223 00000 n 0000002527 00000 n 0000002781 00000 n 0000002716 00000 n 0000002648 00000 n 0000002568 00000 n 0000002598 00000 n 0000002863 00000 n 0000002922 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 4499 %%EOF curl-7.35.0/docs/libcurl/curl_easy_escape.pdf0000644000175000017500000000771312272124474016076 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ…VÛnÛF}×W R"q½K.ohQ@q@…"§2À ƒ!)‰µtx©?ô úÑ]^%Ùè6»s9sæ ¿% ¨|µŸÑqrµqa_N(ì'_'L¡ýˆŽð.Àžü#ØMš; \\ß"žÁqÂLJLüö4ù¬Eu‘=$aùí!)£ð1ÙjÖV‡,ý" ºaÚ”PêjBQ‡¼xZÿ3ømb K†># îcpâÛ2¾å@°šhë¹>Å|ÑÊlbûæÄíÃBþe‹yqê‚ÁLi¦2ËÁ€»Í åqRBuH`ŸJ7˜³›.q6Ä߉´™DY|bz¾Ç[“(¥©ÉŠ -­¡*R±o2•b˜ŒÎ1;‡xêÜíýúæãíòv8Ú–Ü ýŠ(«ã~–U\É7røE%Ä.Ñ!,àí%ªp-k|‹ ]mízÉM‚Ž›U{†Ê†ð˜Ã|¿=6‹ú}­¡x¸I¼`¢3²öÄ«0‹áÔ,í ꥈ¢:óŽóá^–ˆ}u8EÎTº[ý§zàÙû4ôà×Åíõfù1XÞ¬O¹4´ÛdŠKÁ!-aW‹¨JsQ.Nxã2Â|Óî ¡ˆ¡Hªº2Ÿ°‚°„DXº7¹/'½ ûa9qF½Èò(¬’XÕÃ)%–eà19ÃR*š¸æY©JQÒ7Œª¤è2(9~Ï3˜Ì€þ ¦Æ߈0îhò×Ãò¦ÿNÕ%ÙŠVEZ4Çw¾ß ÄÂ~¤¼Q(©Šßœ4ǰ˜¼&ó5´)µ(%A¶Úë5<Ì¿¤ßêIGO¾éxZnÄé>­à舧ïÙ\û'Œ“(=¢RŠúø%)¶:iêê‚rð%ªŽL [½ÜÉäÏæÀ&ŒQó…Ié…ÒÇI±»a!­.ï€Ì¾>&¢’9—I%!¢XÎsRä[}v>˜Ô&ÎXW.þ$8Ž çðnÎëU©inqfq“Ó¡rZ£¨Ÿ6?•—ѪB·>gÝ(8Œ+€0õÿé9Ò­ʰ\N,æõÍ,Óç„( N°l©vŸ£t¶Ê…ºÃA¬ÃØØ”AîÊ Áâ„9ÝÅvSî Ýr°×Ü×’ÑöªÀ}Éí.I4š9f9%à[^Ouî7ÌAŠÅ¹Hà)­V-möÔ»XªX·+¼WAzFX,`¾º½yõa¸Z4ˆMW{»[ŠÍÙÙ\áÆw:¹xÊ\d–Å‘§gµ<”Ö^^¾ëQÛ¼¿¾xL³[Žk¦å;jôLfÁÍV³šçÇ–>£Ç“zø Õ]vç/÷E{,Ò LJ•k A<«»Ãä_‹`ò;¾þBàÈ“endstream endobj 6 0 obj 1222 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:48+01:00 2014-01-29T08:09:48+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001546 00000 n 0000003436 00000 n 0000001487 00000 n 0000001327 00000 n 0000000015 00000 n 0000001307 00000 n 0000001611 00000 n 0000001865 00000 n 0000001800 00000 n 0000001732 00000 n 0000001652 00000 n 0000001682 00000 n 0000001947 00000 n 0000002013 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 3590 %%EOF curl-7.35.0/docs/libcurl/index.html0000644000175000017500000000670712213173003014057 00000000000000 Index to libcurl documentation

Index to libcurl documentation

Programs

curl and tools

Overviews

libcurl
libcurl-easy
libcurl-multi
libcurl-share
libcurl-errors
libcurl-tutorial

Library Functions (A-Z)

curl_easy_cleanup
curl_easy_duphandle
curl_easy_escape
curl_easy_getinfo
curl_easy_init
curl_easy_pause
curl_easy_perform
curl_easy_recv
curl_easy_reset
curl_easy_send
curl_easy_setopt
curl_easy_strerror
curl_easy_unescape
curl_escape (deprecated)
curl_formadd
curl_formfree
curl_formget
curl_free
curl_getdate
curl_getenv (deprecated)
curl_global_cleanup
curl_global_init
curl_global_init_mem
curl_mprintf (deprecated)
curl_multi_add_handle
curl_multi_assign
curl_multi_cleanup
curl_multi_fdset
curl_multi_info_read
curl_multi_init
curl_multi_perform
curl_multi_remove_handle
curl_multi_setopt
curl_multi_socket (deprecated)
curl_multi_socket_action
curl_multi_strerror
curl_multi_timeout (deprecated)
curl_share_cleanup
curl_share_init
curl_share_setopt
curl_share_strerror
curl_slist_append
curl_slist_free_all
curl_strequal and curl_strnequal
curl_unescape (deprecated)
curl_version
curl_version_info curl-7.35.0/docs/libcurl/curl_easy_recv.30000644000175000017500000000634512213173003015151 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2013, 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. .\" * .\" ************************************************************************** .\" .TH curl_easy_recv 3 "29 April 2008" "libcurl 7.18.2" "libcurl Manual" .SH NAME curl_easy_recv - receives raw data on an "easy" connection .SH SYNOPSIS .B #include .sp .BI "CURLcode curl_easy_recv( CURL *" curl ", void *" buffer "," .BI "size_t " buflen ", size_t *" n ");" .ad .SH DESCRIPTION This function receives raw data from the established connection. You may use it together with \fIcurl_easy_send(3)\fP to implement custom protocols using libcurl. This functionality can be particularly useful if you use proxies and/or SSL encryption: libcurl will take care of proxy negotiation and connection set-up. \fBbuffer\fP is a pointer to your buffer that will get the received data. \fBbuflen\fP is the maximum amount of data you can get in that buffer. The variable \fBn\fP points to will receive the number of received bytes. To establish the connection, set \fBCURLOPT_CONNECT_ONLY\fP option before calling \fIcurl_easy_perform(3)\fP. Note that \fIcurl_easy_recv(3)\fP does not work on connections that were created without this option. You must ensure that the socket has data to read before calling \fIcurl_easy_recv(3)\fP, otherwise the call will return \fBCURLE_AGAIN\fP - the socket is used in non-blocking mode internally. Use \fIcurl_easy_getinfo(3)\fP with \fBCURLINFO_LASTSOCKET\fP to obtain the socket; use your operating system facilities like \fIselect(2)\fP to check if it has any data you can read. .SH AVAILABILITY Added in 7.18.2. .SH RETURN VALUE On success, returns \fBCURLE_OK\fP, stores the received data into \fBbuffer\fP, and the number of bytes it actually read into \fB*n\fP. On failure, returns the appropriate error code. If there is no data to read, the function returns \fBCURLE_AGAIN\fP. Use your operating system facilities to wait until the data is ready, and retry. Reading exactly 0 bytes would indicate a closed connection. If there's no socket available to use from the previous transfer, this function returns CURLE_UNSUPPORTED_PROTOCOL. .SH EXAMPLE See \fBsendrecv.c\fP in \fBdocs/examples\fP directory for usage example. .SH "SEE ALSO" .BR curl_easy_setopt "(3), " curl_easy_perform "(3), " .BR curl_easy_getinfo "(3), " .BR curl_easy_send "(3) " curl-7.35.0/docs/libcurl/curl_global_init_mem.html0000644000175000017500000000635612272124467017135 00000000000000 curl_global_init_mem man page

NAME

curl_global_init_mem - Global libcurl initialisation with memory callbacks

SYNOPSIS

#include <curl/curl.h>

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 );

DESCRIPTION

This function works exactly as curl_global_init(3) with one addition: it allows the application to set callbacks to replace the otherwise used internal memory functions.

This man page only adds documentation for the callbacks, see the curl_global_init(3) man page for all the rest. When you use this function, all callback arguments must be set to valid function pointers.

The prototypes for the given callbacks should match these:

void *malloc_callback(size_t size);

To replace malloc()

void free_callback(void *ptr);

To replace free()

void *realloc_callback(void *ptr, size_t size);

To replace realloc()

char *strdup_callback(const char *str);

To replace strdup()

void *calloc_callback(size_t nmemb, size_t size);

To replace calloc()

CAUTION

Manipulating these gives considerable powers to the application to severely screw things up for libcurl. Take care!

SEE ALSO

curl_global_init (3) curl_global_cleanup (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_multi_perform.html0000644000175000017500000001161212272124467016667 00000000000000 curl_multi_perform man page

NAME

curl_multi_perform - reads/writes available data from each easy handle

SYNOPSIS

#include <curl/curl.h>

CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles);

DESCRIPTION

This function handles transfers on all the added handles that need attention in an non-blocking fashion.

When an application has found out there's data available for the multi_handle or a timeout has elapsed, the application should call this function to read/write whatever there is to read or write right now etc. curl_multi_perform() returns as soon as the reads/writes are done. This function does not require that there actually is any data available for reading or that data can be written, it can be called just in case. It will write the number of handles that still transfer data in the second argument's integer-pointer.

If the amount of running_handles is changed from the previous call (or is less than the amount of easy handles you've added to the multi handle), you know that there is one or more transfers less "running". You can then call curl_multi_info_read(3) to get information about each individual completed transfer, and that returned info includes CURLcode and more. If an added handle fails very quickly, it may never be counted as a running_handle.

When running_handles is set to zero (0) on the return of this function, there is no longer any transfers in progress.

RETURN VALUE

CURLMcode type, general libcurl multi interface error code.

Before version 7.20.0: If you receive CURLM_CALL_MULTI_PERFORM, this basically means that you should call curl_multi_perform again, before you select() on more actions. You don't have to do it immediately, but the return code means that libcurl may have more data available to return or that there may be more data to send off before it is "satisfied". Do note that curl_multi_perform(3) will return CURLM_CALL_MULTI_PERFORM only when it wants to be called again immediately. When things are fine and there is nothing immediate it wants done, it'll return CURLM_OK and you need to wait for "action" and then call this function again.

This function only returns errors etc regarding the whole multi stack. Problems still might have occurred on individual transfers even when this function returns CURLM_OK. Use curl_multi_info_read(3) to figure out how individual transfers did.

TYPICAL USAGE

Most applications will use curl_multi_fdset(3) to get the multi_handle's file descriptors, and curl_multi_timeout(3) to get a suitable timeout period, then it'll wait for action on the file descriptors using select(3). As soon as one or more file descriptor is ready, curl_multi_perform(3) gets called.

SEE ALSO

curl_multi_cleanup (3) curl_multi_init (3) curl_multi_fdset (3) curl_multi_info_read (3) libcurl-errors (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_multi_fdset.pdf0000644000175000017500000001207412272124472016126 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ•XkoÛÈý®_1@?„ ¤YrøF‹iÖÅzáØ©­ô±NÐÔHb͇–¤¢¨¿atÏIÉÞ¢‹ ŽCÎܹsϹß™Ë=æÒóo^;»Ù¶›¹l;ûyæ©—Ìü“WìÏ+,HèÁj3Ó{< §>OR¶ªfž¸²Õqöè䇶üRʾø²Yw²ÿìøŸç¬,žèÅ|)B—»nì|ÈêCV²WWÏÿµúq¶t¹ð`=Çá)çiHçû[ÝÌœÛwó7ðo½‡©ŸVë™óáj¾ú÷Ä[áòÀÙÒôÚ}ÝC¶drî,¡À¢Æë*û†§Ÿç¿Ç¶óTx®¯<±ÙøþêáýýõÇÕõÝí¯%u |]®Õ®èØæPç*ùp"€"ï7Tj[XDHó™ðc˜ f¾J•fžÒù,å"Iû²®è¥Z, ÐÌêãÌ™äœ(Ç–ÄCª"O/§h„ZÞÊþÐÖ+à¸É+þvœ¶,ý à®ç9SÕTHdÙ~_¹Ž+Ïjvè$ëw’~6°QÊH@§5õ‚=©Ê&ˆRXÂ4ÒþöìI²îЪ}ùþËOW÷´Úç.­@ü.÷½À8îÜõcüj‰}±“ !ÕdV–E½…7ÓBe®­çšâ.LCt¯Å9ÄÐKô‰ÓX#¢©ËËÖkÆföI‘:Çz„n·lÝÈ®~£ÊpAHñØ7™qúÿŒÒq±}!Û†O ’Ü 乕U£êdqþ±çYH¸Ö¿¯¨Ö|©š%ôœúÉu çÅþeLÒq†B_fÍO‰ÅkiÛË–°þJâà™ÚÒk …évÍ¡\ ¨prJ±®Qx$k6„«Š¡˜D'ÂÉ“T¿ë†BRˆ&zY«l賬{}ÃGÖÂÙ©Æýõ†ÕÍE«v,z¨žN¶uŠ<†è½0á~™Šh†¹  Á}@¹Ÿzê¸cQB[šºÏŠ®±ãNÖø4ÈÙÝP`à…6ª¨<¤=ö†^tIŒ`ÚZÅ.¶+¶Ø;eŸúP=቉†‚ãìït¸}b NõE­}ŒÒÑ  -„ƒ®¥è¤Ô èÑYs€®pzú•¸G8ÝÓ;ý#¸º*2ψF¬oøAÇÅÈc”Z7–*Hx×L:<îF–ÐêÝH}UIVTõ:OQK)ÿ=x1xíôûiãù¶)Àî¦Ñ»®xf€rvjí –US”õcÑïÀó]“?ÏSÕu¬ÀÊì@rÐ꬗åIË€ç'<ÆÊÆ"Q¡àŬ=Õ«nzö\7ÚA+òYñppÓ9ÊÑÿ„ÛŒ}ƒ,!%sJ°)K,ÓÀó¦Ú—²Gï:J×Hß-ºö,‡˜àÑ S$üÒ[P†X-a™9R’Àó ¨ÎàL ö†àÝ–†ŠwgÚ-Ôt‘bDZœV‡–èçg§¹ÎO µP …èäì}¦IþLfÈ»qô?dö  “xÀ»‰%µ¥0÷ G~eÒ‡q9H\϶H]Ì}˜Êw6õðk“Mæ„,™”‚Ôa*åñ évÒ(ú® UëèG£IG—À䦇ÑS {×V|Û-h›tßj aH´pymÂ/Û:SÖ´ØDíÀ‰3©á¦}&«ÀÌÓôzî… c÷z2YRŒÉ‚<+ãš<¨‹ÐÜ`œ´§ƒj$©0ÆáE+IYÈ“¡iq¢c¡ÌÆëÉä4î÷ʬÇô×ü&~àlU¡ G’5’ˆ'=· Añs"ŽÍwðB;j[ĆD>Þ=\ÿƒu§®—'3:”,“ç—·™nð$ £Ñ îW«‡ëŸ®šÑmjòé[5µQ=”›&yú®ðhí¦»Ýƒì{jõ ë›ñ¨'½¼XÁ²¦1 :ijÄêiRA™ÒFÞfî* ÌŽÃUŒ*ï›áÖñÒ¡T"03@ÛI53¹Ñƒ~êlÀJtäí2æCÍ•µ$/ö[Àª›Fl¯4dZ3‚¢ÐÍÔÇözÚ8±.;›òIxƒ`˜ØC³Cþi< á®/. ¹Ð³š(¤ ÔìI2¨s«ìyÃp®—ã5ä4 ÃKÞƒ0@Æ·m¦™ÉOˆðþBnôähæw¼VÃÖ·gúܲ¥ê!Õ€P j<7  §‹Ðíâ9IÅ9å[H„ch¢><:÷W«O÷·ìosÏÇV\çßÝ|º2[_~xœ|ÿèO{¹`[YËddq¯¿Æ(ŽÚ¨PD˜9rÀ¦m’Ê5`ô å‹I'3‡–zŒµ%6̓P.ˆÎÒP7~ž:P¤)Y™|ð¹ºbïnî´Ì¤/?øLô%ÇÐPö2‰[ÕX2uîâÜΊ¢×d·ÀP|n Jjcüm¦^Wp¡«ùÚ{¼ÔR5~èÌVOBõõejZ_?Ѓ‰ÖÇX¥lëŽë4„{‚uA³£½ü:âdzKÆhÔ$\7Rýälwxôèj5û+þü+Òêendstream endobj 6 0 obj 2369 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:46+01:00 2014-01-29T08:09:46+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000002693 00000 n 0000004573 00000 n 0000002634 00000 n 0000002474 00000 n 0000000015 00000 n 0000002454 00000 n 0000002758 00000 n 0000003012 00000 n 0000002947 00000 n 0000002879 00000 n 0000002799 00000 n 0000002829 00000 n 0000003094 00000 n 0000003150 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 4727 %%EOF curl-7.35.0/docs/libcurl/curl_easy_setopt.html0000644000175000017500000057457312272124467016366 00000000000000 curl_easy_setopt man page

NAME

curl_easy_setopt - set options for a curl easy handle

SYNOPSIS

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLoption option, parameter);

DESCRIPTION

curl_easy_setopt() is used to tell libcurl how to behave. By using the appropriate options to curl_easy_setopt, you can change libcurl's behavior. All options are set with the option followed by a parameter. That parameter can be a long, a function pointer, an object pointer or a curl_off_t, depending on what the specific option expects. Read this manual carefully as bad input values may cause libcurl to behave badly! You can only set one option in each function call. A typical application uses many curl_easy_setopt() calls in the setup phase.

Options set with this function call are valid for all forthcoming transfers performed using this handle. The options are not in any way reset between transfers, so if you want subsequent transfers with different options, you must change them between the transfers. You can optionally reset all options back to internal default with curl_easy_reset(3).

Strings passed to libcurl as 'char *' arguments, are copied by the library; thus the string storage associated to the pointer argument may be overwritten after curl_easy_setopt() returns. Exceptions to this rule are described in the option details below.

Before version 7.17.0, strings were not copied. Instead the user was forced keep them available until libcurl no longer needed them.

The handle is the return code from a curl_easy_init(3) or curl_easy_duphandle(3) call.

BEHAVIOR OPTIONS

CURLOPT_VERBOSE

Set the parameter to 1 to get the library to display a lot of verbose information about its operations. Very useful for libcurl and/or protocol debugging and understanding. The verbose information will be sent to stderr, or the stream set with CURLOPT_STDERR. The default value for this parameter is 0.

You hardly ever want this set in production use, you will almost always want this when you debug/report problems. Another neat option for debugging is the CURLOPT_DEBUGFUNCTION.

CURLOPT_HEADER

A parameter set to 1 tells the library to include the header in the body output. This is only relevant for protocols that actually have headers preceding the data (like HTTP). The default value for this parameter is 0.

CURLOPT_NOPROGRESS

Pass a long. If set to 1, it tells the library to shut off the progress meter completely. It will also prevent the CURLOPT_PROGRESSFUNCTION from getting called. The default value for this parameter is 1.

Future versions of libcurl are likely to not have any built-in progress meter at all.

CURLOPT_NOSIGNAL

Pass a long. If it is 1, libcurl will not use any functions that install signal handlers or any functions that cause signals to be sent to the process. This option is mainly here to allow multi-threaded unix applications to still set/use all timeout options etc, without risking getting signals. The default value for this parameter is 0. (Added in 7.10)

If this option is set and libcurl has been built with the standard name resolver, timeouts will not occur while the name resolve takes place. Consider building libcurl with c-ares support to enable asynchronous DNS lookups, which enables nice timeouts for name resolves without signals.

Setting CURLOPT_NOSIGNAL to 1 makes libcurl NOT ask the system to ignore SIGPIPE signals, which otherwise are sent by the system when trying to send data to a socket which is closed in the other end. libcurl makes an effort to never cause such SIGPIPEs to trigger, but some operating systems have no way to avoid them and even on those that have there are some corner cases when they may still happen, contrary to our desire. In addition, using CURLAUTH_NTLM_WB authentication could cause a SIGCHLD signal to be raised.

CURLOPT_WILDCARDMATCH

Set this option to 1 if you want to transfer multiple files according to a file name pattern. The pattern can be specified as part of the CURLOPT_URL option, using an fnmatch-like pattern (Shell Pattern Matching) in the last part of URL (file name).

By default, libcurl uses its internal wildcard matching implementation. You can provide your own matching function by the CURLOPT_FNMATCH_FUNCTION option.

This feature is only supported by the FTP download for now.

A brief introduction of its syntax follows:

* - ASTERISK

ftp://example.com/some/path/*.txt (for all txt's from the root directory)

? - QUESTION MARK

Question mark matches any (exactly one) character.

ftp://example.com/some/path/photo?.jpeg

[ - BRACKET EXPRESSION

The left bracket opens a bracket expression. The question mark and asterisk have no special meaning in a bracket expression. Each bracket expression ends by the right bracket and matches exactly one character. Some examples follow:

[a-zA-Z0-9] or [f-gF-G] - character interval

[abc] - character enumeration

[^abc] or [!abc] - negation

[[:name:]] class expression. Supported classes are alnum,lower, space, alpha, digit, print, upper, blank, graph, xdigit.

[][-!^] - special case - matches only '-', ']', '[', '!' or '^'. These characters have no special purpose.

[\[\]\\] - escape syntax. Matches '[', ']' or '´.

Using the rules above, a file name pattern can be constructed:

ftp://example.com/some/path/[a-z[:upper:]\\].jpeg

(This was added in 7.21.0)

CALLBACK OPTIONS

CURLOPT_WRITEFUNCTION

Pass a pointer to a function that matches the following prototype: size_t function( char *ptr, size_t size, size_t nmemb, void *userdata); This function gets called by libcurl as soon as there is data received that needs to be saved. The size of the data pointed to by ptr is size multiplied with nmemb, it will not be zero terminated. Return the number of bytes actually taken care of. If that amount differs from the amount passed to your function, it'll signal an error to the library. This will abort the transfer and return CURLE_WRITE_ERROR.

From 7.18.0, the function can return CURL_WRITEFUNC_PAUSE which then will cause writing to this connection to become paused. See curl_easy_pause(3) for further details.

This function may be called with zero bytes data if the transferred file is empty.

Set this option to NULL to get the internal default function. The internal default function will write the data to the FILE * given with CURLOPT_WRITEDATA.

Set the userdata argument with the CURLOPT_WRITEDATA option.

The callback function will be passed as much data as possible in all invokes, but you cannot possibly make any assumptions. It may be one byte, it may be thousands. The maximum amount of body data that can be passed to the write callback is defined in the curl.h header file: CURL_MAX_WRITE_SIZE (the usual default is 16K). If you however have CURLOPT_HEADER set, which sends header data to the write callback, you can get up to CURL_MAX_HTTP_HEADER bytes of header data passed into it. This usually means 100K.

CURLOPT_WRITEDATA

Data pointer to pass to the file write function. If you use the CURLOPT_WRITEFUNCTION option, this is the pointer you'll get as input. If you don't use a callback, you must pass a 'FILE *' (cast to 'void *') as libcurl will pass this to fwrite() when writing data. By default, the value of this parameter is unspecified.

The internal CURLOPT_WRITEFUNCTION will write the data to the FILE * given with this option, or to stdout if this option hasn't been set.

If you're using libcurl as a win32 DLL, you MUST use the CURLOPT_WRITEFUNCTION if you set this option or you will experience crashes.

This option is also known with the older name CURLOPT_FILE, the name CURLOPT_WRITEDATA was introduced in 7.9.7.

CURLOPT_READFUNCTION

Pass a pointer to a function that matches the following prototype: size_t function( void *ptr, size_t size, size_t nmemb, void *userdata); This function gets called by libcurl as soon as it needs to read data in order to send it to the peer. The data area pointed at by the pointer ptr may be filled with at most size multiplied with nmemb number of bytes. Your function must return the actual number of bytes that you stored in that memory area. Returning 0 will signal end-of-file to the library and cause it to stop the current transfer.

If you stop the current transfer by returning 0 "pre-maturely" (i.e before the server expected it, like when you've said you will upload N bytes and you upload less than N bytes), you may experience that the server "hangs" waiting for the rest of the data that won't come.

The read callback may return CURL_READFUNC_ABORT to stop the current operation immediately, resulting in a CURLE_ABORTED_BY_CALLBACK error code from the transfer (Added in 7.12.1)

From 7.18.0, the function can return CURL_READFUNC_PAUSE which then will cause reading from this connection to become paused. See curl_easy_pause(3) for further details.

Bugs: when doing TFTP uploads, you must return the exact amount of data that the callback wants, or it will be considered the final packet by the server end and the transfer will end there.

If you set this callback pointer to NULL, or don't set it at all, the default internal read function will be used. It is doing an fread() on the FILE * userdata set with CURLOPT_READDATA.

CURLOPT_READDATA

Data pointer to pass to the file read function. If you use the CURLOPT_READFUNCTION option, this is the pointer you'll get as input. If you don't specify a read callback but instead rely on the default internal read function, this data must be a valid readable FILE * (cast to 'void *').

If you're using libcurl as a win32 DLL, you MUST use a CURLOPT_READFUNCTION if you set this option.

This option was also known by the older name CURLOPT_INFILE, the name CURLOPT_READDATA was introduced in 7.9.7.

CURLOPT_IOCTLFUNCTION

Pass a pointer to a function that matches the following prototype: curlioerr function(CURL *handle, int cmd, void *clientp);. This function gets called by libcurl when something special I/O-related needs to be done that the library can't do by itself. For now, rewinding the read data stream is the only action it can request. The rewinding of the read data stream may be necessary when doing a HTTP PUT or POST with a multi-pass authentication method. By default, this parameter is set to NULL. (Option added in 7.12.3).

Use CURLOPT_SEEKFUNCTION instead to provide seeking! If CURLOPT_SEEKFUNCTION is set, this parameter will be ignored when seeking.

CURLOPT_IOCTLDATA

Pass a pointer that will be untouched by libcurl and passed as the 3rd argument in the ioctl callback set with CURLOPT_IOCTLFUNCTION. By default, the value of this parameter is unspecified. (Option added in 7.12.3)

CURLOPT_SEEKFUNCTION

Pass a pointer to a function that matches the following prototype: int function(void *instream, curl_off_t offset, int origin); This function gets called by libcurl to seek to a certain position in the input stream and can be used to fast forward a file in a resumed upload (instead of reading all uploaded bytes with the normal read function/callback). It is also called to rewind a stream when doing a HTTP PUT or POST with a multi-pass authentication method. The function shall work like "fseek" or "lseek" and accepted SEEK_SET, SEEK_CUR and SEEK_END as argument for origin, although libcurl currently only passes SEEK_SET. The callback must return 0 (CURL_SEEKFUNC_OK) on success, 1 (CURL_SEEKFUNC_FAIL) to cause the upload operation to fail or 2 (CURL_SEEKFUNC_CANTSEEK) to indicate that while the seek failed, libcurl is free to work around the problem if possible. The latter can sometimes be done by instead reading from the input or similar.

By default, this parameter is unset.

If you forward the input arguments directly to "fseek" or "lseek", note that the data type for offset is not the same as defined for curl_off_t on many systems! (Option added in 7.18.0)

CURLOPT_SEEKDATA

Data pointer to pass to the file seek function. If you use the CURLOPT_SEEKFUNCTION option, this is the pointer you'll get as input. If you don't specify a seek callback, NULL is passed. (Option added in 7.18.0)

CURLOPT_SOCKOPTFUNCTION

Pass a pointer to a function that matches the following prototype: int function(void *clientp, curl_socket_t curlfd, curlsocktype purpose);. By default, this parameter is unset. If set, this function gets called by libcurl after the socket() call but before the connect() call. The callback's purpose argument identifies the exact purpose for this particular socket:

CURLSOCKTYPE_IPCXN for actively created connections or since 7.28.0 CURLSOCKTYPE_ACCEPT for FTP when the connection was setup with PORT/EPSV (in earlier versions these sockets weren't passed to this callback).

Future versions of libcurl may support more purposes. It passes the newly created socket descriptor so additional setsockopt() calls can be done at the user's discretion. Return 0 (zero) from the callback on success. Return 1 from the callback function to signal an unrecoverable error to the library and it will close the socket and return CURLE_COULDNT_CONNECT. (Option added in 7.16.0)

Added in 7.21.5, the callback function may return CURL_SOCKOPT_ALREADY_CONNECTED, which tells libcurl that the socket is in fact already connected and then libcurl will not attempt to connect it.

CURLOPT_SOCKOPTDATA

Pass a pointer that will be untouched by libcurl and passed as the first argument in the sockopt callback set with CURLOPT_SOCKOPTFUNCTION. The default value of this parameter is unspecified. (Option added in 7.16.0)

CURLOPT_OPENSOCKETFUNCTION

Pass a pointer to a function that matches the following prototype: curl_socket_t function(void *clientp, curlsocktype purpose, struct curl_sockaddr *address);. This function gets called by libcurl instead of the socket(2) call. The callback's purpose argument identifies the exact purpose for this particular socket: CURLSOCKTYPE_IPCXN is for IP based connections. Future versions of libcurl may support more purposes. It passes the resolved peer address as a address argument so the callback can modify the address or refuse to connect at all. The callback function should return the socket or CURL_SOCKET_BAD in case no connection could be established or another error was detected. Any additional setsockopt(2) calls can be done on the socket at the user's discretion. CURL_SOCKET_BAD return value from the callback function will signal an unrecoverable error to the library and it will return CURLE_COULDNT_CONNECT. This return code can be used for IP address blacklisting. The default behavior is:

  return socket(addr->family, addr->socktype, addr->protocol);

(Option added in 7.17.1.)

CURLOPT_OPENSOCKETDATA

Pass a pointer that will be untouched by libcurl and passed as the first argument in the opensocket callback set with CURLOPT_OPENSOCKETFUNCTION. The default value of this parameter is unspecified. (Option added in 7.17.1.)

CURLOPT_CLOSESOCKETFUNCTION

Pass a pointer to a function that matches the following prototype: int function(void *clientp, curl_socket_t item);. This function gets called by libcurl instead of the close(3) or closesocket(3) call when sockets are closed (not for any other file descriptors). This is pretty much the reverse to the CURLOPT_OPENSOCKETFUNCTION option. Return 0 to signal success and 1 if there was an error. (Option added in 7.21.7)

CURLOPT_CLOSESOCKETDATA

Pass a pointer that will be untouched by libcurl and passed as the first argument in the closesocket callback set with CURLOPT_CLOSESOCKETFUNCTION. The default value of this parameter is unspecified. (Option added in 7.21.7)

CURLOPT_PROGRESSFUNCTION

Pass a pointer to a function that matches the following prototype:

int function(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);

This function gets called by libcurl instead of its internal equivalent with a frequent interval. While data is being transferred it will be called very frequently, and during slow periods like when nothing is being transferred it can slow down to about one call per second.

clientp is the pointer set with CURLOPT_PROGRESSDATA, it is not actually used by libcurl but is only passed along from the application to the callback.

The callback gets told how much data libcurl will transfer and has transferred, in number of bytes. dltotal is the total number of bytes libcurl expects to download in this transfer. dlnow is the number of bytes downloaded so far. ultotal is the total number of bytes libcurl expects to upload in this transfer. ulnow is the number of bytes uploaded so far.

Unknown/unused argument values passed to the callback will be set to zero (like if you only download data, the upload size will remain 0). Many times the callback will be called one or more times first, before it knows the data sizes so a program must be made to handle that.

Returning a non-zero value from this callback will cause libcurl to abort the transfer and return CURLE_ABORTED_BY_CALLBACK.

If you transfer data with the multi interface, this function will not be called during periods of idleness unless you call the appropriate libcurl function that performs transfers.

CURLOPT_NOPROGRESS must be set to 0 to make this function actually get called.

CURLOPT_XFERINFOFUNCTION

Pass a pointer to a function that matches the following prototype:

int function(void *clientp, curl_off_t dltotal, curl_off_t dlnow,   curl_off_t ultotal, curl_off_t ulnow);

This function gets called by libcurl instead of its internal equivalent with a frequent interval. While data is being transferred it will be called very frequently, and during slow periods like when nothing is being transferred it can slow down to about one call per second.

clientp is the pointer set with CURLOPT_XFERINFODATA, it is only passed along from the application to the callback.

The callback gets told how much data libcurl will transfer and has transferred, in number of bytes. dltotal is the total number of bytes libcurl expects to download in this transfer. dlnow is the number of bytes downloaded so far. ultotal is the total number of bytes libcurl expects to upload in this transfer. ulnow is the number of bytes uploaded so far.

Unknown/unused argument values passed to the callback will be set to zero (like if you only download data, the upload size will remain 0). Many times the callback will be called one or more times first, before it knows the data sizes so a program must be made to handle that.

Returning a non-zero value from this callback will cause libcurl to abort the transfer and return CURLE_ABORTED_BY_CALLBACK.

If you transfer data with the multi interface, this function will not be called during periods of idleness unless you call the appropriate libcurl function that performs transfers.

CURLOPT_NOPROGRESS must be set to 0 to make this function actually get called.

(Added in 7.32.0)

CURLOPT_PROGRESSDATA

Pass a pointer that will be untouched by libcurl and passed as the first argument in the progress callback set with CURLOPT_PROGRESSFUNCTION. The default value of this parameter is unspecified.

CURLOPT_XFERINFODATA

Pass a pointer that will be untouched by libcurl and passed as the first argument in the progress callback set with CURLOPT_XFERINFOFUNCTION. The default value of this parameter is unspecified. This option is an alias for CURLOPT_PROGRESSDATA. (Added in 7.32.0)

CURLOPT_HEADERFUNCTION

Pass a pointer to a function that matches the following prototype: size_t function( void *ptr, size_t size, size_t nmemb, void *userdata);. This function gets called by libcurl as soon as it has received header data. The header callback will be called once for each header and only complete header lines are passed on to the callback. Parsing headers is very easy using this. The size of the data pointed to by ptr is size multiplied with nmemb. Do not assume that the header line is zero terminated! The pointer named userdata is the one you set with the CURLOPT_WRITEHEADER option. The callback function must return the number of bytes actually taken care of. If that amount differs from the amount passed to your function, it'll signal an error to the library. This will abort the transfer and return CURL_WRITE_ERROR.

A complete HTTP header that is passed to this function can be up to CURL_MAX_HTTP_HEADER (100K) bytes.

If this option is not set, or if it is set to NULL, but CURLOPT_HEADERDATA (CURLOPT_WRITEHEADER) is set to anything but NULL, the function used to accept response data will be used instead. That is, it will be the function specified with CURLOPT_WRITEFUNCTION, or if it is not specified or NULL - the default, stream-writing function.

It's important to note that the callback will be invoked for the headers of all responses received after initiating a request and not just the final response. This includes all responses which occur during authentication negotiation. If you need to operate on only the headers from the final response, you will need to collect headers in the callback yourself and use HTTP status lines, for example, to delimit response boundaries.

When a server sends a chunked encoded transfer, it may contain a trailer. That trailer is identical to a HTTP header and if such a trailer is received it is passed to the application using this callback as well. There are several ways to detect it being a trailer and not an ordinary header: 1) it comes after the response-body. 2) it comes after the final header line (CR LF) 3) a Trailer: header among the regular response-headers mention what header(s) to expect in the trailer.

For non-HTTP protocols like FTP, POP3, IMAP and SMTP this function will get called with the server responses to the commands that libcurl sends.

CURLOPT_WRITEHEADER

(This option is also known as CURLOPT_HEADERDATA) Pass a pointer to be used to write the header part of the received data to. If you don't use CURLOPT_WRITEFUNCTION or CURLOPT_HEADERFUNCTION to take care of the writing, this must be a valid FILE * as the internal default will then be a plain fwrite(). See also the CURLOPT_HEADERFUNCTION option above on how to set a custom get-all-headers callback.

CURLOPT_DEBUGFUNCTION

Pass a pointer to a function that matches the following prototype: int curl_debug_callback (CURL *, curl_infotype, char *, size_t, void *); CURLOPT_DEBUGFUNCTION replaces the standard debug function used when CURLOPT_VERBOSE is in effect. This callback receives debug information, as specified with the curl_infotype argument. This function must return 0. The data pointed to by the char * passed to this function WILL NOT be zero terminated, but will be exactly of the size as told by the size_t argument.

Available curl_infotype values:

CURLINFO_TEXT

The data is informational text.

CURLINFO_HEADER_IN

The data is header (or header-like) data received from the peer.

CURLINFO_HEADER_OUT

The data is header (or header-like) data sent to the peer.

CURLINFO_DATA_IN

The data is protocol data received from the peer.

CURLINFO_DATA_OUT

The data is protocol data sent to the peer.

CURLOPT_DEBUGDATA

Pass a pointer to whatever you want passed in to your CURLOPT_DEBUGFUNCTION in the last void * argument. This pointer is not used by libcurl, it is only passed to the callback.

CURLOPT_SSL_CTX_FUNCTION

This option does only function for libcurl powered by OpenSSL. If libcurl was built against another SSL library, this functionality is absent.

Pass a pointer to a function that matches the following prototype: CURLcode sslctxfun(CURL *curl, void *sslctx, void *parm); This function gets called by libcurl just before the initialization of a SSL connection after having processed all other SSL related options to give a last chance to an application to modify the behaviour of openssl's ssl initialization. The sslctx parameter is actually a pointer to an openssl SSL_CTX. If an error is returned no attempt to establish a connection is made and the perform operation will return the error code from this callback function. Set the parm argument with the CURLOPT_SSL_CTX_DATA option. This option was introduced in 7.11.0.

This function will get called on all new connections made to a server, during the SSL negotiation. The SSL_CTX pointer will be a new one every time.

To use this properly, a non-trivial amount of knowledge of the openssl libraries is necessary. For example, using this function allows you to use openssl callbacks to add additional validation code for certificates, and even to change the actual URI of a HTTPS request (example used in the lib509 test case). See also the example section for a replacement of the key, certificate and trust file settings.

CURLOPT_SSL_CTX_DATA

Data pointer to pass to the ssl context callback set by the option CURLOPT_SSL_CTX_FUNCTION, this is the pointer you'll get as third parameter, otherwise NULL. (Added in 7.11.0)

CURLOPT_CONV_TO_NETWORK_FUNCTION

CURLOPT_CONV_FROM_NETWORK_FUNCTION

CURLOPT_CONV_FROM_UTF8_FUNCTION

Pass a pointer to a function that matches the following prototype: CURLcode function(char *ptr, size_t length);

These three options apply to non-ASCII platforms only. They are available only if CURL_DOES_CONVERSIONS was defined when libcurl was built. When this is the case, curl_version_info(3) will return the CURL_VERSION_CONV feature bit set.

The data to be converted is in a buffer pointed to by the ptr parameter. The amount of data to convert is indicated by the length parameter. The converted data overlays the input data in the buffer pointed to by the ptr parameter. CURLE_OK should be returned upon successful conversion. A CURLcode return value defined by curl.h, such as CURLE_CONV_FAILED, should be returned if an error was encountered.

CURLOPT_CONV_TO_NETWORK_FUNCTION and CURLOPT_CONV_FROM_NETWORK_FUNCTION convert between the host encoding and the network encoding. They are used when commands or ASCII data are sent/received over the network.

CURLOPT_CONV_FROM_UTF8_FUNCTION is called to convert from UTF8 into the host encoding. It is required only for SSL processing.

If you set a callback pointer to NULL, or don't set it at all, the built-in libcurl iconv functions will be used. If HAVE_ICONV was not defined when libcurl was built, and no callback has been established, conversion will return the CURLE_CONV_REQD error code.

If HAVE_ICONV is defined, CURL_ICONV_CODESET_OF_HOST must also be defined. For example:

 #define CURL_ICONV_CODESET_OF_HOST "IBM-1047"

The iconv code in libcurl will default the network and UTF8 codeset names as follows:

 #define CURL_ICONV_CODESET_OF_NETWORK "ISO8859-1"

 #define CURL_ICONV_CODESET_FOR_UTF8 "UTF-8"

You will need to override these definitions if they are different on your system.

CURLOPT_INTERLEAVEFUNCTION

Pass a pointer to a function that matches the following prototype: size_t function( void *ptr, size_t size, size_t nmemb, void *userdata). This function gets called by libcurl as soon as it has received interleaved RTP data. This function gets called for each $ block and therefore contains exactly one upper-layer protocol unit (e.g. one RTP packet). Curl writes the interleaved header as well as the included data for each call. The first byte is always an ASCII dollar sign. The dollar sign is followed by a one byte channel identifier and then a 2 byte integer length in network byte order. See RFC 2326 Section 10.12 for more information on how RTP interleaving behaves. If unset or set to NULL, curl will use the default write function.

Interleaved RTP poses some challenges for the client application. Since the stream data is sharing the RTSP control connection, it is critical to service the RTP in a timely fashion. If the RTP data is not handled quickly, subsequent response processing may become unreasonably delayed and the connection may close. The application may use CURL_RTSPREQ_RECEIVE to service RTP data when no requests are desired. If the application makes a request, (e.g. CURL_RTSPREQ_PAUSE) then the response handler will process any pending RTP data before marking the request as finished. (Added in 7.20.0)

CURLOPT_INTERLEAVEDATA

This is the userdata pointer that will be passed to CURLOPT_INTERLEAVEFUNCTION when interleaved RTP data is received. (Added in 7.20.0)

CURLOPT_CHUNK_BGN_FUNCTION

Pass a pointer to a function that matches the following prototype: long function (const void *transfer_info, void *ptr, int remains). This function gets called by libcurl before a part of the stream is going to be transferred (if the transfer supports chunks).

This callback makes sense only when using the CURLOPT_WILDCARDMATCH option for now.

The target of transfer_info parameter is a "feature depended" structure. For the FTP wildcard download, the target is curl_fileinfo structure (see curl/curl.h). The parameter ptr is a pointer given by CURLOPT_CHUNK_DATA. The parameter remains contains number of chunks remaining per the transfer. If the feature is not available, the parameter has zero value.

Return CURL_CHUNK_BGN_FUNC_OK if everything is fine, CURL_CHUNK_BGN_FUNC_SKIP if you want to skip the concrete chunk or CURL_CHUNK_BGN_FUNC_FAIL to tell libcurl to stop if some error occurred. (This was added in 7.21.0)

CURLOPT_CHUNK_END_FUNCTION

Pass a pointer to a function that matches the following prototype: long function(void *ptr). This function gets called by libcurl as soon as a part of the stream has been transferred (or skipped).

Return CURL_CHUNK_END_FUNC_OK if everything is fine or CURL_CHUNK_END_FUNC_FAIL to tell the lib to stop if some error occurred. (This was added in 7.21.0)

CURLOPT_CHUNK_DATA

Pass a pointer that will be untouched by libcurl and passed as the ptr argument to the CURL_CHUNK_BGN_FUNTION and CURL_CHUNK_END_FUNTION. (This was added in 7.21.0)

CURLOPT_FNMATCH_FUNCTION

Pass a pointer to a function that matches the following prototype: int function(void *ptr, const char *pattern, const char *string) prototype (see curl/curl.h). It is used internally for the wildcard matching feature.

Return CURL_FNMATCHFUNC_MATCH if pattern matches the string, CURL_FNMATCHFUNC_NOMATCH if not or CURL_FNMATCHFUNC_FAIL if an error occurred. (This was added in 7.21.0)

CURLOPT_FNMATCH_DATA

Pass a pointer that will be untouched by libcurl and passed as the ptr argument to the CURL_FNMATCH_FUNCTION. (This was added in 7.21.0)

ERROR OPTIONS

CURLOPT_ERRORBUFFER

Pass a char * to a buffer that the libcurl may store human readable error messages in. This may be more helpful than just the return code from curl_easy_perform. The buffer must be at least CURL_ERROR_SIZE big. Although this argument is a 'char *', it does not describe an input string. Therefore the (probably undefined) contents of the buffer is NOT copied by the library. You must keep the associated storage available until libcurl no longer needs it. Failing to do so will cause very odd behavior or even crashes. libcurl will need it until you call curl_easy_cleanup(3) or you set the same option again to use a different pointer.

Use CURLOPT_VERBOSE and CURLOPT_DEBUGFUNCTION to better debug/trace why errors happen.

If the library does not return an error, the buffer may not have been touched. Do not rely on the contents in those cases.

CURLOPT_STDERR

Pass a FILE * as parameter. Tell libcurl to use this stream instead of stderr when showing the progress meter and displaying CURLOPT_VERBOSE data.

CURLOPT_FAILONERROR

A parameter set to 1 tells the library to fail silently if the HTTP code returned is equal to or larger than 400. The default action would be to return the page normally, ignoring that code.

This method is not fail-safe and there are occasions where non-successful response codes will slip through, especially when authentication is involved (response codes 401 and 407).

You might get some amounts of headers transferred before this situation is detected, like when a "100-continue" is received as a response to a POST/PUT and a 401 or 407 is received immediately afterwards.

NETWORK OPTIONS

CURLOPT_URL

Pass in a pointer to the actual URL to deal with. The parameter should be a char * to a zero terminated string which must be URL-encoded in the following format:

scheme://host:port/path

For a greater explanation of the format please see RFC 3986.

If the given URL lacks the scheme (such as "http://" or "ftp://" etc) then libcurl will attempt to resolve the protocol based on one of the following given host names:

HTTP, FTP, DICT, LDAP, IMAP, POP3 or SMTP

(POP3 and SMTP added in 7.31.0)

Should the protocol, either that specified by the scheme or deduced by libcurl from the host name, not be supported by libcurl then (CURLE_UNSUPPORTED_PROTOCOL) will be returned from either the curl_easy_perform(3) or curl_multi_perform(3) functions when you call them. Use curl_version_info(3) for detailed information of which protocols are supported by the build of libcurl you are using.

The host part of the URL contains the address of the server that you want to connect to. This can be the fully qualified domain name of the server, the local network name of the machine on your network or the IP address of the server or machine represented by either an IPv4 or IPv6 address. For example:

http://www.example.com/

http://hostname/

http://192.168.0.1/

http://[2001:1890:1112:1::20]/

It is also possible to specify the user name, password and any supported login options as part of the host, for the following protocols, when connecting to servers that require authentication:

http://user:password@www.example.com

ftp://user:password@ftp.example.com

imap://user:password;options@mail.example.com

pop3://user:password;options@mail.example.com

smtp://user:password;options@mail.example.com

At present only IMAP, POP3 and SMTP support login options as part of the host. For more information about the login options in URL syntax please see RFC 2384, RFC 5092 and IETF draft draft-earhart-url-smtp-00.txt (Added in 7.31.0).

The port is optional and when not specified libcurl will use the default port based on the determined or specified protocol: 80 for HTTP, 21 for FTP and 25 for SMTP, etc. The following examples show how to specify the port:

http://www.example.com:8080/ - This will connect to a web server using port 8080 rather than 80.

smtp://mail.example.com:587/ - This will connect to a SMTP server on the alternative mail port.

The path part of the URL is protocol specific and whilst some examples are given below this list is not conclusive:

HTTP

The path part of a HTTP request specifies the file to retrieve and from what directory. If the directory is not specified then the web server's root directory is used. If the file is omitted then the default document will be retrieved for either the directory specified or the root directory. The exact resource returned for each URL is entirely dependent on the server's configuration.

http://www.example.com - This gets the main page from the web server.

http://www.example.com/index.html - This returns the main page by explicitly requesting it.

http://www.example.com/contactus/ - This returns the default document from the contactus directory.

FTP

The path part of an FTP request specifies the file to retrieve and from what directory. If the file part is omitted then libcurl downloads the directory listing for the directory specified. If the directory is omitted then the directory listing for the root / home directory will be returned.

ftp://ftp.example.com - This retrieves the directory listing for the root directory.

ftp://ftp.example.com/readme.txt - This downloads the file readme.txt from the root directory.

ftp://ftp.example.com/libcurl/readme.txt - This downloads readme.txt from the libcurl directory.

ftp://user:password@ftp.example.com/readme.txt - This retrieves the readme.txt file from the user's home directory. When a username and password is specified, everything that is specified in the path part is relative to the user's home directory. To retrieve files from the root directory or a directory underneath the root directory then the absolute path must be specified by prepending an additional forward slash to the beginning of the path.

ftp://user:password@ftp.example.com//readme.txt - This retrieves the readme.txt from the root directory when logging in as a specified user.

SMTP

The path part of a SMTP request specifies the host name to present during communication with the mail server. If the path is omitted then libcurl will attempt to resolve the local computer's host name. However, this may not return the fully qualified domain name that is required by some mail servers and specifying this path allows you to set an alternative name, such as your machine's fully qualified domain name, which you might have obtained from an external function such as gethostname or getaddrinfo.

smtp://mail.example.com - This connects to the mail server at example.com and sends your local computer's host name in the HELO / EHLO command.

smtp://mail.example.com/client.example.com - This will send client.example.com in the HELO / EHLO command to the mail server at example.com.

POP3

The path part of a POP3 request specifies the message ID to retrieve. If the ID is not specified then a list of waiting messages is returned instead.

pop3://user:password@mail.example.com - This lists the available messages for the user

pop3://user:password@mail.example.com/1 - This retrieves the first message for the user

IMAP

The path part of an IMAP request not only specifies the mailbox to list (Added in 7.30.0) or select, but can also be used to check the UIDVALIDITY of the mailbox and to specify the UID and SECTION of the message to fetch (Added in 7.30.0).

imap://user:password@mail.example.com - Performs a top level folder list

imap://user:password@mail.example.com/INBOX - Performs a folder list on the user's inbox

imap://user:password@mail.example.com/INBOX/;UID=1 - Selects the user's inbox and fetches message 1

imap://user:password@mail.example.com/INBOX;UIDVALIDITY=50/;UID=2 - Selects the user's inbox, checks the UIDVALIDITY of the mailbox is 50 and fetches message 2 if it is

imap://user:password@mail.example.com/INBOX/;UID=3/;SECTION=TEXT - Selects the user's inbox and fetches message 3 with only the text portion of the message

For more information about the individual components of an IMAP URL please see RFC 5092.

SCP

The path part of a SCP request specifies the file to retrieve and from what directory. The file part may not be omitted. The file is taken as an absolute path from the root directory on the server. To specify a path relative to the user's home directory on the server, prepend ~/ to the path portion. If the user name is not embedded in the URL, it can be set with the CURLOPT_USERPWD or CURLOPT_USERNAME option.

scp://user@example.com/etc/issue - This specifies the file /etc/issue

scp://example.com/~/my-file - This specifies the file my-file in the user's home directory on the server

SFTP

The path part of a SFTP request specifies the file to retrieve and from what directory. If the file part is omitted then libcurl downloads the directory listing for the directory specified. If the path ends in a / then a directory listing is returned instead of a file. If the path is omitted entirely then the directory listing for the root / home directory will be returned. If the user name is not embedded in the URL, it can be set with the CURLOPT_USERPWD or CURLOPT_USERNAME option.

sftp://user:password@example.com/etc/issue - This specifies the file /etc/issue

sftp://user@example.com/~/my-file - This specifies the file my-file in the user's home directory

sftp://ssh.example.com/~/Documents/ - This requests a directory listing of the Documents directory under the user's home directory

LDAP

The path part of a LDAP request can be used to specify the: Distinguished Name, Attributes, Scope, Filter and Extension for a LDAP search. Each field is separated by a question mark and when that field is not required an empty string with the question mark separator should be included.

ldap://ldap.example.com/o=My%20Organisation - This will perform a LDAP search with the DN as My Organisation.

ldap://ldap.example.com/o=My%20Organisation?postalAddress - This will perform the same search but will only return postalAddress attributes.

ldap://ldap.example.com/?rootDomainNamingContext - This specifies an empty DN and requests information about the rootDomainNamingContext attribute for an Active Directory server.

For more information about the individual components of a LDAP URL please see RFC 4516.

RTMP

There's no official URL spec for RTMP so libcurl uses the URL syntax supported by the underlying librtmp library. It has a syntax where it wants a traditional URL, followed by a space and a series of space-separated name=value pairs.

While space is not typically a "legal" letter, libcurl accepts them. When a user wants to pass in a '#' (hash) character it will be treated as a fragment and get cut off by libcurl if provided literally. You will instead have to escape it by providing it as backslash and its ASCII value in hexadecimal: "\23".

NOTES

Starting with version 7.20.0, the fragment part of the URI will not be sent as part of the path, which was previously the case.

CURLOPT_URL is the only option that must be set before curl_easy_perform(3) is called.

CURLOPT_PROTOCOLS can be used to limit what protocols libcurl will use for this transfer, independent of what libcurl has been compiled to support. That may be useful if you accept the URL from an external source and want to limit the accessibility.

CURLOPT_PROTOCOLS

Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask limits what protocols libcurl may use in the transfer. This allows you to have a libcurl built to support a wide range of protocols but still limit specific transfers to only be allowed to use a subset of them. By default libcurl will accept all protocols it supports. See also CURLOPT_REDIR_PROTOCOLS. (Added in 7.19.4)

CURLOPT_REDIR_PROTOCOLS

Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask limits what protocols libcurl may use in a transfer that it follows to in a redirect when CURLOPT_FOLLOWLOCATION is enabled. This allows you to limit specific transfers to only be allowed to use a subset of protocols in redirections. By default libcurl will allow all protocols except for FILE and SCP. This is a difference compared to pre-7.19.4 versions which unconditionally would follow to all protocols supported. (Added in 7.19.4)

CURLOPT_PROXY

Set HTTP proxy to use. The parameter should be a char * to a zero terminated string holding the host name or dotted IP address. To specify port number in this string, append :[port] to the end of the host name. The proxy string may be prefixed with [protocol]:// since any such prefix will be ignored. The proxy's port number may optionally be specified with the separate option. If not specified, libcurl will default to using port 1080 for proxies. CURLOPT_PROXYPORT.

When you tell the library to use a HTTP proxy, libcurl will transparently convert operations to HTTP even if you specify an FTP URL etc. This may have an impact on what other features of the library you can use, such as CURLOPT_QUOTE and similar FTP specifics that don't work unless you tunnel through the HTTP proxy. Such tunneling is activated with CURLOPT_HTTPPROXYTUNNEL.

libcurl respects the environment variables http_proxy, ftp_proxy, all_proxy etc, if any of those are set. The CURLOPT_PROXY option does however override any possibly set environment variables.

Setting the proxy string to "" (an empty string) will explicitly disable the use of a proxy, even if there is an environment variable set for it.

Since 7.14.1, the proxy host string given in environment variables can be specified the exact same way as the proxy can be set with CURLOPT_PROXY, include protocol prefix (http://) and embedded user + password.

Since 7.21.7, the proxy string may be specified with a protocol:// prefix to specify alternative proxy protocols. Use socks4://, socks4a://, socks5:// or socks5h:// (the last one to enable socks5 and asking the proxy to do the resolving, also known as CURLPROXY_SOCKS5_HOSTNAME type) to request the specific SOCKS version to be used. No protocol specified, http:// and all others will be treated as HTTP proxies.

CURLOPT_PROXYPORT

Pass a long with this option to set the proxy port to connect to unless it is specified in the proxy string CURLOPT_PROXY.

CURLOPT_PROXYTYPE

Pass a long with this option to set type of the proxy. Available options for this are CURLPROXY_HTTP, CURLPROXY_HTTP_1_0 (added in 7.19.4), CURLPROXY_SOCKS4 (added in 7.10), CURLPROXY_SOCKS5, CURLPROXY_SOCKS4A (added in 7.18.0) and CURLPROXY_SOCKS5_HOSTNAME (added in 7.18.0). The HTTP type is default. (Added in 7.10)

If you set CURLOPT_PROXYTYPE to CURLPROXY_HTTP_1_0, it will only affect how libcurl speaks to a proxy when CONNECT is used. The HTTP version used for "regular" HTTP requests is instead controlled with CURLOPT_HTTP_VERSION.

CURLOPT_NOPROXY

Pass a pointer to a zero terminated string. The string consists of a comma separated list of host names that do not require a proxy to get reached, even if one is specified. The only wildcard available is a single * character, which matches all hosts, and effectively disables the proxy. Each name in this list is matched as either a domain which contains the hostname, or the hostname itself. For example, example.com would match example.com, example.com:80, and www.example.com, but not www.notanexample.com. (Added in 7.19.4)

CURLOPT_HTTPPROXYTUNNEL

Set the parameter to 1 to make the library tunnel all operations through a given HTTP proxy. There is a big difference between using a proxy and to tunnel through it. If you don't know what this means, you probably don't want this tunneling option.

CURLOPT_SOCKS5_GSSAPI_SERVICE

Pass a char * as parameter to a string holding the name of the service. The default service name for a SOCKS5 server is rcmd/server-fqdn. This option allows you to change it. (Added in 7.19.4)

CURLOPT_SOCKS5_GSSAPI_NEC

Pass a long set to 1 to enable or 0 to disable. As part of the gssapi negotiation a protection mode is negotiated. The RFC 1961 says in section 4.3/4.4 it should be protected, but the NEC reference implementation does not. If enabled, this option allows the unprotected exchange of the protection mode negotiation. (Added in 7.19.4).

CURLOPT_INTERFACE

Pass a char * as parameter. This sets the interface name to use as outgoing network interface. The name can be an interface name, an IP address, or a host name.

Starting with 7.24.0: If the parameter starts with "if!" then it is treated as only as interface name and no attempt will ever be named to do treat it as an IP address or to do name resolution on it. If the parameter starts with "host!" it is treated as either an IP address or a hostname. Hostnames are resolved synchronously. Using the if! format is highly recommended when using the multi interfaces to avoid allowing the code to block. If "if!" is specified but the parameter does not match an existing interface, CURLE_INTERFACE_FAILED is returned.

CURLOPT_LOCALPORT

Pass a long. This sets the local port number of the socket used for connection. This can be used in combination with CURLOPT_INTERFACE and you are recommended to use CURLOPT_LOCALPORTRANGE as well when this is set. Valid port numbers are 1 - 65535. (Added in 7.15.2)

CURLOPT_LOCALPORTRANGE

Pass a long. This is the number of attempts libcurl will make to find a working local port number. It starts with the given CURLOPT_LOCALPORT and adds one to the number for each retry. Setting this to 1 or below will make libcurl do only one try for the exact port number. Port numbers by nature are scarce resources that will be busy at times so setting this value to something too low might cause unnecessary connection setup failures. (Added in 7.15.2)

CURLOPT_DNS_CACHE_TIMEOUT

Pass a long, this sets the timeout in seconds. Name resolves will be kept in memory for this number of seconds. Set to zero to completely disable caching, or set to -1 to make the cached entries remain forever. By default, libcurl caches this info for 60 seconds.

The name resolve functions of various libc implementations don't re-read name server information unless explicitly told so (for example, by calling res_init(3)). This may cause libcurl to keep using the older server even if DHCP has updated the server info, and this may look like a DNS cache issue to the casual libcurl-app user.

CURLOPT_DNS_USE_GLOBAL_CACHE

Pass a long. If the value is 1, it tells curl to use a global DNS cache that will survive between easy handle creations and deletions. This is not thread-safe and this will use a global variable.

WARNING: this option is considered obsolete. Stop using it. Switch over to using the share interface instead! See CURLOPT_SHARE and curl_share_init(3).

CURLOPT_BUFFERSIZE

Pass a long specifying your preferred size (in bytes) for the receive buffer in libcurl. The main point of this would be that the write callback gets called more often and with smaller chunks. This is just treated as a request, not an order. You cannot be guaranteed to actually get the given size. (Added in 7.10)

This size is by default set as big as possible (CURL_MAX_WRITE_SIZE), so it only makes sense to use this option if you want it smaller.

CURLOPT_PORT

Pass a long specifying what remote port number to connect to, instead of the one specified in the URL or the default port for the used protocol.

CURLOPT_TCP_NODELAY

Pass a long specifying whether the TCP_NODELAY option is to be set or cleared (1 = set, 0 = clear). The option is cleared by default. This will have no effect after the connection has been established.

Setting this option will disable TCP's Nagle algorithm. The purpose of this algorithm is to try to minimize the number of small packets on the network (where "small packets" means TCP segments less than the Maximum Segment Size (MSS) for the network).

Maximizing the amount of data sent per TCP segment is good because it amortizes the overhead of the send. However, in some cases (most notably telnet or rlogin) small segments may need to be sent without delay. This is less efficient than sending larger amounts of data at a time, and can contribute to congestion on the network if overdone.

CURLOPT_ADDRESS_SCOPE

Pass a long specifying the scope_id value to use when connecting to IPv6 link-local or site-local addresses. (Added in 7.19.0)

CURLOPT_TCP_KEEPALIVE

Pass a long. If set to 1, TCP keepalive probes will be sent. The delay and frequency of these probes can be controlled by the CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL options, provided the operating system supports them. Set to 0 (default behavior) to disable keepalive probes (Added in 7.25.0).

CURLOPT_TCP_KEEPIDLE

Pass a long. Sets the delay, in seconds, that the operating system will wait while the connection is idle before sending keepalive probes. Not all operating systems support this option. (Added in 7.25.0)

CURLOPT_TCP_KEEPINTVL

Pass a long. Sets the interval, in seconds, that the operating system will wait between sending keepalive probes. Not all operating systems support this option. (Added in 7.25.0)

NAMES and PASSWORDS OPTIONS (Authentication)

CURLOPT_NETRC

This parameter controls the preference of libcurl between using user names and passwords from your ~/.netrc file, relative to user names and passwords in the URL supplied with CURLOPT_URL.

libcurl uses a user name (and supplied or prompted password) supplied with CURLOPT_USERPWD in preference to any of the options controlled by this parameter.

Pass a long, set to one of the values described below.

CURL_NETRC_OPTIONAL

The use of your ~/.netrc file is optional, and information in the URL is to be preferred. The file will be scanned for the host and user name (to find the password only) or for the host only, to find the first user name and password after that machine, which ever information is not specified in the URL.

Undefined values of the option will have this effect.

CURL_NETRC_IGNORED

The library will ignore the file and use only the information in the URL.

This is the default.

CURL_NETRC_REQUIRED

This value tells the library that use of the file is required, to ignore the information in the URL, and to search the file for the host only.

Only machine name, user name and password are taken into account (init macros and similar things aren't supported).

libcurl does not verify that the file has the correct properties set (as the standard Unix ftp client does). It should only be readable by user.

CURLOPT_NETRC_FILE

Pass a char * as parameter, pointing to a zero terminated string containing the full path name to the file you want libcurl to use as .netrc file. If this option is omitted, and CURLOPT_NETRC is set, libcurl will attempt to find a .netrc file in the current user's home directory. (Added in 7.10.9)

CURLOPT_USERPWD

Pass a char * as parameter, pointing to a zero terminated login details string for the connection. The format of which is: [user name]:[password].

When using NTLM, you can set the domain by prepending it to the user name and separating the domain and name with a forward (/) or backward slash (\). Like this: "domain/user:password" or "domain\user:password". Some HTTP servers (on Windows) support this style even for Basic authentication.

When using HTTP and CURLOPT_FOLLOWLOCATION, libcurl might perform several requests to possibly different hosts. libcurl will only send this user and password information to hosts using the initial host name (unless CURLOPT_UNRESTRICTED_AUTH is set), so if libcurl follows locations to other hosts it will not send the user and password to those. This is enforced to prevent accidental information leakage.

Use CURLOPT_HTTPAUTH to specify the authentication method for HTTP based connections or CURLOPT_LOGIN_OPTIONS to control IMAP, POP3 and SMTP options.

The user and password strings are not URL decoded, so there's no way to send in a user name containing a colon using this option. Use CURLOPT_USERNAME for that, or include it in the URL.

CURLOPT_PROXYUSERPWD

Pass a char * as parameter, which should be [user name]:[password] to use for the connection to the HTTP proxy. Both the name and the password will be URL decoded before use, so to include for example a colon in the user name you should encode it as %3A.

Use CURLOPT_PROXYAUTH to specify the authentication method.

CURLOPT_USERNAME

Pass a char * as parameter, which should be pointing to the zero terminated user name to use for the transfer.

CURLOPT_USERNAME sets the user name to be used in protocol authentication. You should not use this option together with the (older) CURLOPT_USERPWD option.

To specify the password and login options, along with the user name, use the CURLOPT_PASSWORD and CURLOPT_LOGIN_OPTIONS options. (Added in 7.19.1)

CURLOPT_PASSWORD

Pass a char * as parameter, which should be pointing to the zero terminated password to use for the transfer.

The CURLOPT_PASSWORD option should be used in conjunction with the CURLOPT_USERNAME option. (Added in 7.19.1)

CURLOPT_LOGIN_OPTIONS

(Added in 7.34.0) Pass a char * as parameter, which should be pointing to the zero terminated options string to use for the transfer.

At present only IMAP, POP3 and SMTP support login options. For more information about the login options please see RFC 2384, RFC5092 and IETF draft draft-earhart-url-smtp-00.txt

CURLOPT_LOGIN_OPTIONS can be used to set protocol specific login options, such as the preferred authentication mechanism via "AUTH=NTLM" or "AUTH=*", and should be used in conjunction with the CURLOPT_USERNAME option.

CURLOPT_PROXYUSERNAME

Pass a char * as parameter, which should be pointing to the zero terminated user name to use for the transfer while connecting to Proxy.

The CURLOPT_PROXYUSERNAME option should be used in same way as the CURLOPT_PROXYUSERPWD is used. In comparison to CURLOPT_PROXYUSERPWD the CURLOPT_PROXYUSERNAME allows the username to contain a colon, like in the following example: "sip:user@example.com". The CURLOPT_PROXYUSERNAME option is an alternative way to set the user name while connecting to Proxy. There is no meaning to use it together with the CURLOPT_PROXYUSERPWD option.

In order to specify the password to be used in conjunction with the user name use the CURLOPT_PROXYPASSWORD option. (Added in 7.19.1)

CURLOPT_PROXYPASSWORD

Pass a char * as parameter, which should be pointing to the zero terminated password to use for the transfer while connecting to Proxy.

The CURLOPT_PROXYPASSWORD option should be used in conjunction with the CURLOPT_PROXYUSERNAME option. (Added in 7.19.1)

CURLOPT_HTTPAUTH

Pass a long as parameter, which is set to a bitmask, to tell libcurl which authentication method(s) you want it to use. The available bits are listed below. If more than one bit is set, libcurl will first query the site to see which authentication methods it supports and then pick the best one you allow it to use. For some methods, this will induce an extra network round-trip. Set the actual name and password with the CURLOPT_USERPWD option or with the CURLOPT_USERNAME and the CURLOPT_PASSWORD options. (Added in 7.10.6)

CURLAUTH_BASIC

HTTP Basic authentication. This is the default choice, and the only method that is in wide-spread use and supported virtually everywhere. This sends the user name and password over the network in plain text, easily captured by others.

CURLAUTH_DIGEST

HTTP Digest authentication. Digest authentication is defined in RFC 2617 and is a more secure way to do authentication over public networks than the regular old-fashioned Basic method.

CURLAUTH_DIGEST_IE

HTTP Digest authentication with an IE flavor. Digest authentication is defined in RFC 2617 and is a more secure way to do authentication over public networks than the regular old-fashioned Basic method. The IE flavor is simply that libcurl will use a special "quirk" that IE is known to have used before version 7 and that some servers require the client to use. (This define was added in 7.19.3)

CURLAUTH_GSSNEGOTIATE

HTTP GSS-Negotiate authentication. The GSS-Negotiate (also known as plain "Negotiate") method was designed by Microsoft and is used in their web applications. It is primarily meant as a support for Kerberos5 authentication but may also be used along with other authentication methods. For more information see IETF draft draft-brezak-spnego-http-04.txt.

You need to build libcurl with a suitable GSS-API library for this to work.

CURLAUTH_NTLM

HTTP NTLM authentication. A proprietary protocol invented and used by Microsoft. It uses a challenge-response and hash concept similar to Digest, to prevent the password from being eavesdropped.

You need to build libcurl with either OpenSSL, GnuTLS or NSS support for this option to work, or build libcurl on Windows with SSPI support.

CURLAUTH_NTLM_WB

NTLM delegating to winbind helper. Authentication is performed by a separate binary application that is executed when needed. The name of the application is specified at compile time but is typically /usr/bin/ntlm_auth (Added in 7.22.0)

Note that libcurl will fork when necessary to run the winbind application and kill it when complete, calling waitpid() to await its exit when done. On POSIX operating systems, killing the process will cause a SIGCHLD signal to be raised (regardless of whether CURLOPT_NOSIGNAL is set), which must be handled intelligently by the application. In particular, the application must not unconditionally call wait() in its SIGCHLD signal handler to avoid being subject to a race condition. This behavior is subject to change in future versions of libcurl.

CURLAUTH_ANY

This is a convenience macro that sets all bits and thus makes libcurl pick any it finds suitable. libcurl will automatically select the one it finds most secure.

CURLAUTH_ANYSAFE

This is a convenience macro that sets all bits except Basic and thus makes libcurl pick any it finds suitable. libcurl will automatically select the one it finds most secure.

CURLAUTH_ONLY

This is a meta symbol. Or this value together with a single specific auth value to force libcurl to probe for un-restricted auth and if not, only that single auth algorithm is acceptable. (Added in 7.21.3)

CURLOPT_TLSAUTH_TYPE

Pass a long as parameter, which is set to a bitmask, to tell libcurl which authentication method(s) you want it to use for TLS authentication.

CURLOPT_TLSAUTH_SRP

TLS-SRP authentication. Secure Remote Password authentication for TLS is defined in RFC 5054 and provides mutual authentication if both sides have a shared secret. To use TLS-SRP, you must also set the CURLOPT_TLSAUTH_USERNAME and CURLOPT_TLSAUTH_PASSWORD options.

You need to build libcurl with GnuTLS or OpenSSL with TLS-SRP support for this to work. (Added in 7.21.4)

CURLOPT_TLSAUTH_USERNAME

Pass a char * as parameter, which should point to the zero terminated username to use for the TLS authentication method specified with the CURLOPT_TLSAUTH_TYPE option. Requires that the CURLOPT_TLS_PASSWORD option also be set. (Added in 7.21.4)

CURLOPT_TLSAUTH_PASSWORD

Pass a char * as parameter, which should point to the zero terminated password to use for the TLS authentication method specified with the CURLOPT_TLSAUTH_TYPE option. Requires that the CURLOPT_TLS_USERNAME option also be set. (Added in 7.21.4)

CURLOPT_PROXYAUTH

Pass a long as parameter, which is set to a bitmask, to tell libcurl which authentication method(s) you want it to use for your proxy authentication. If more than one bit is set, libcurl will first query the site to see what authentication methods it supports and then pick the best one you allow it to use. For some methods, this will induce an extra network round-trip. Set the actual name and password with the CURLOPT_PROXYUSERPWD option. The bitmask can be constructed by or'ing together the bits listed above for the CURLOPT_HTTPAUTH option. CURLOPT_PROXYAUTH was added in 7.10.7

CURLOPT_SASL_IR

Pass a long. If the value is 1, curl will send the initial response to the server in the first authentication packet in order to reduce the number of ping pong requests. Only applicable to supporting SASL authentication mechanisms and to the IMAP, POP3 and SMTP protocols. (Added in 7.31.0)

Note: Whilst IMAP supports this option there is no need to explicitly set it, as libcurl can determine the feature itself when the server supports the SASL-IR CAPABILITY.

CURLOPT_XOAUTH2_BEARER

Pass a char * as parameter, which should point to the zero terminated OAuth 2.0 Bearer Access Token for use with IMAP, POP3 and SMTP servers that support the OAuth 2.0 Authorization Framework. (Added in 7.33.0)

Note: The user name used to generate the Bearer Token should be supplied via the CURLOPT_USERNAME option.

HTTP OPTIONS

CURLOPT_AUTOREFERER

Pass a parameter set to 1 to enable this. When enabled, libcurl will automatically set the Referer: field in requests where it follows a Location: redirect.

CURLOPT_ACCEPT_ENCODING

Sets the contents of the Accept-Encoding: header sent in a HTTP request, and enables decoding of a response when a Content-Encoding: header is received. Three encodings are supported: identity, which does nothing, deflate which requests the server to compress its response using the zlib algorithm, and gzip which requests the gzip algorithm. If a zero-length string is set, then an Accept-Encoding: header containing all supported encodings is sent.

This is a request, not an order; the server may or may not do it. This option must be set (to any non-NULL value) or else any unsolicited encoding done by the server is ignored. See the special file lib/README.encoding for details.

(This option was called CURLOPT_ENCODING before 7.21.6)

CURLOPT_TRANSFER_ENCODING

Adds a request for compressed Transfer Encoding in the outgoing HTTP request. If the server supports this and so desires, it can respond with the HTTP response sent using a compressed Transfer-Encoding that will be automatically uncompressed by libcurl on reception.

Transfer-Encoding differs slightly from the Content-Encoding you ask for with CURLOPT_ACCEPT_ENCODING in that a Transfer-Encoding is strictly meant to be for the transfer and thus MUST be decoded before the data arrives in the client. Traditionally, Transfer-Encoding has been much less used and supported by both HTTP clients and HTTP servers.

(Added in 7.21.6)

CURLOPT_FOLLOWLOCATION

A parameter set to 1 tells the library to follow any Location: header that the server sends as part of a HTTP header.

This means that the library will re-send the same request on the new location and follow new Location: headers all the way until no more such headers are returned. CURLOPT_MAXREDIRS can be used to limit the number of redirects libcurl will follow.

Since 7.19.4, libcurl can limit what protocols it will automatically follow. The accepted protocols are set with CURLOPT_REDIR_PROTOCOLS and it excludes the FILE protocol by default.

CURLOPT_UNRESTRICTED_AUTH

A parameter set to 1 tells the library it can continue to send authentication (user+password) when following locations, even when hostname changed. This option is meaningful only when setting CURLOPT_FOLLOWLOCATION.

CURLOPT_MAXREDIRS

Pass a long. The set number will be the redirection limit. If that many redirections have been followed, the next redirect will cause an error (CURLE_TOO_MANY_REDIRECTS). This option only makes sense if the CURLOPT_FOLLOWLOCATION is used at the same time. Added in 7.15.1: Setting the limit to 0 will make libcurl refuse any redirect. Set it to -1 for an infinite number of redirects (which is the default)

CURLOPT_POSTREDIR

Pass a bitmask to control how libcurl acts on redirects after POSTs that get a 301, 302 or 303 response back. A parameter with bit 0 set (value CURL_REDIR_POST_301) tells the library to respect RFC 2616/10.3.2 and not convert POST requests into GET requests when following a 301 redirection. Setting bit 1 (value CURL_REDIR_POST_302) makes libcurl maintain the request method after a 302 redirect whilst setting bit 2 (value CURL_REDIR_POST_303) makes libcurl maintain the request method after a 303 redirect. The value CURL_REDIR_POST_ALL is a convenience define that sets all three bits.

The non-RFC behaviour is ubiquitous in web browsers, so the library does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when setting CURLOPT_FOLLOWLOCATION. (Added in 7.17.1) (This option was known as CURLOPT_POST301 up to 7.19.0 as it only supported the 301 then)

CURLOPT_PUT

A parameter set to 1 tells the library to use HTTP PUT to transfer data. The data should be set with CURLOPT_READDATA and CURLOPT_INFILESIZE.

This option is deprecated and starting with version 7.12.1 you should instead use CURLOPT_UPLOAD.

CURLOPT_POST

A parameter set to 1 tells the library to do a regular HTTP post. This will also make the library use a "Content-Type: application/x-www-form-urlencoded" header. (This is by far the most commonly used POST method).

Use one of CURLOPT_POSTFIELDS or CURLOPT_COPYPOSTFIELDS options to specify what data to post and CURLOPT_POSTFIELDSIZE or CURLOPT_POSTFIELDSIZE_LARGE to set the data size.

Optionally, you can provide data to POST using the CURLOPT_READFUNCTION and CURLOPT_READDATA options but then you must make sure to not set CURLOPT_POSTFIELDS to anything but NULL. When providing data with a callback, you must transmit it using chunked transfer-encoding or you must set the size of the data with the CURLOPT_POSTFIELDSIZE or CURLOPT_POSTFIELDSIZE_LARGE option. To enable chunked encoding, you simply pass in the appropriate Transfer-Encoding header, see the post-callback.c example.

You can override the default POST Content-Type: header by setting your own with CURLOPT_HTTPHEADER.

Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with CURLOPT_HTTPHEADER as usual.

If you use POST to a HTTP 1.1 server, you can send data without knowing the size before starting the POST if you use chunked encoding. You enable this by adding a header like "Transfer-Encoding: chunked" with CURLOPT_HTTPHEADER. With HTTP 1.0 or without chunked transfer, you must specify the size in the request.

When setting CURLOPT_POST to 1, it will automatically set CURLOPT_NOBODY to 0 (since 7.14.1).

If you issue a POST request and then want to make a HEAD or GET using the same re-used handle, you must explicitly set the new request type using CURLOPT_NOBODY or CURLOPT_HTTPGET or similar.

CURLOPT_POSTFIELDS

Pass a void * as parameter, which should be the full data to post in a HTTP POST operation. You must make sure that the data is formatted the way you want the server to receive it. libcurl will not convert or encode it for you. Most web servers will assume this data to be url-encoded.

The pointed data are NOT copied by the library: as a consequence, they must be preserved by the calling application until the transfer finishes.

This POST is a normal application/x-www-form-urlencoded kind (and libcurl will set that Content-Type by default when this option is used), which is the most commonly used one by HTML forms. See also the CURLOPT_POST. Using CURLOPT_POSTFIELDS implies CURLOPT_POST.

If you want to do a zero-byte POST, you need to set CURLOPT_POSTFIELDSIZE explicitly to zero, as simply setting CURLOPT_POSTFIELDS to NULL or "" just effectively disables the sending of the specified string. libcurl will instead assume that you'll send the POST data using the read callback!

Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with CURLOPT_HTTPHEADER as usual.

To make multipart/formdata posts (aka RFC 2388-posts), check out the CURLOPT_HTTPPOST option.

CURLOPT_POSTFIELDSIZE

If you want to post data to the server without letting libcurl do a strlen() to measure the data size, this option must be used. When this option is used you can post fully binary data, which otherwise is likely to fail. If this size is set to -1, the library will use strlen() to get the size.

CURLOPT_POSTFIELDSIZE_LARGE

Pass a curl_off_t as parameter. Use this to set the size of the CURLOPT_POSTFIELDS data to prevent libcurl from doing strlen() on the data to figure out the size. This is the large file version of the CURLOPT_POSTFIELDSIZE option. (Added in 7.11.1)

CURLOPT_COPYPOSTFIELDS

Pass a char * as parameter, which should be the full data to post in a HTTP POST operation. It behaves as the CURLOPT_POSTFIELDS option, but the original data are copied by the library, allowing the application to overwrite the original data after setting this option.

Because data are copied, care must be taken when using this option in conjunction with CURLOPT_POSTFIELDSIZE or CURLOPT_POSTFIELDSIZE_LARGE: If the size has not been set prior to CURLOPT_COPYPOSTFIELDS, the data are assumed to be a NUL-terminated string; else the stored size informs the library about the data byte count to copy. In any case, the size must not be changed after CURLOPT_COPYPOSTFIELDS, unless another CURLOPT_POSTFIELDS or CURLOPT_COPYPOSTFIELDS option is issued. (Added in 7.17.1)

CURLOPT_HTTPPOST

Tells libcurl you want a multipart/formdata HTTP POST to be made and you instruct what data to pass on to the server. Pass a pointer to a linked list of curl_httppost structs as parameter. The easiest way to create such a list, is to use curl_formadd(3) as documented. The data in this list must remain intact until you close this curl handle again with curl_easy_cleanup(3).

Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with CURLOPT_HTTPHEADER as usual.

When setting CURLOPT_HTTPPOST, it will automatically set CURLOPT_NOBODY to 0 (since 7.14.1).

CURLOPT_REFERER

Pass a pointer to a zero terminated string as parameter. It will be used to set the Referer: header in the http request sent to the remote server. This can be used to fool servers or scripts. You can also set any custom header with CURLOPT_HTTPHEADER.

CURLOPT_USERAGENT

Pass a pointer to a zero terminated string as parameter. It will be used to set the User-Agent: header in the http request sent to the remote server. This can be used to fool servers or scripts. You can also set any custom header with CURLOPT_HTTPHEADER.

CURLOPT_HTTPHEADER

Pass a pointer to a linked list of HTTP headers to pass to the server in your HTTP request. The linked list should be a fully valid list of struct curl_slist structs properly filled in. Use curl_slist_append(3) to create the list and curl_slist_free_all(3) to clean up an entire list. If you add a header that is otherwise generated and used by libcurl internally, your added one will be used instead. If you add a header with no content as in 'Accept:' (no data on the right side of the colon), the internally used header will get disabled. Thus, using this option you can add new headers, replace internal headers and remove internal headers. To add a header with no content (nothing to the right side of the colon), use the form 'MyHeader;' (note the ending semicolon).

The headers included in the linked list must not be CRLF-terminated, because curl adds CRLF after each header item. Failure to comply with this will result in strange bugs because the server will most likely ignore part of the headers you specified.

The first line in a request (containing the method, usually a GET or POST) is not a header and cannot be replaced using this option. Only the lines following the request-line are headers. Adding this method line in this list of headers will only cause your request to send an invalid header.

Pass a NULL to this to reset back to no custom headers.

The most commonly replaced headers have "shortcuts" in the options CURLOPT_COOKIE, CURLOPT_USERAGENT and CURLOPT_REFERER.

CURLOPT_HTTP200ALIASES

Pass a pointer to a linked list of aliases to be treated as valid HTTP 200 responses. Some servers respond with a custom header response line. For example, IceCast servers respond with "ICY 200 OK". By including this string in your list of aliases, the response will be treated as a valid HTTP header line such as "HTTP/1.0 200 OK". (Added in 7.10.3)

The linked list should be a fully valid list of struct curl_slist structs, and be properly filled in. Use curl_slist_append(3) to create the list and curl_slist_free_all(3) to clean up an entire list.

The alias itself is not parsed for any version strings. Before libcurl 7.16.3, Libcurl used the value set by option CURLOPT_HTTP_VERSION, but starting with 7.16.3 the protocol is assumed to match HTTP 1.0 when an alias matched.

CURLOPT_COOKIE

Pass a pointer to a zero terminated string as parameter. It will be used to set a cookie in the http request. The format of the string should be NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie should contain.

If you need to set multiple cookies, you need to set them all using a single option and thus you need to concatenate them all in one single string. Set multiple cookies in one string like this: "name1=content1; name2=content2;" etc.

This option sets the cookie header explicitly in the outgoing request(s). If multiple requests are done due to authentication, followed redirections or similar, they will all get this cookie passed on.

Using this option multiple times will only make the latest string override the previous ones.

CURLOPT_COOKIEFILE

Pass a pointer to a zero terminated string as parameter. It should contain the name of your file holding cookie data to read. The cookie data may be in Netscape / Mozilla cookie data format or just regular HTTP-style headers dumped to a file.

Given an empty or non-existing file or by passing the empty string (""), this option will enable cookies for this curl handle, making it understand and parse received cookies and then use matching cookies in future requests.

If you use this option multiple times, you just add more files to read. Subsequent files will add more cookies.

CURLOPT_COOKIEJAR

Pass a file name as char *, zero terminated. This will make libcurl write all internally known cookies to the specified file when curl_easy_cleanup(3) is called. If no cookies are known, no file will be created. Specify "-" to instead have the cookies written to stdout. Using this option also enables cookies for this session, so if you for example follow a location it will make matching cookies get sent accordingly.

If the cookie jar file can't be created or written to (when the curl_easy_cleanup(3) is called), libcurl will not and cannot report an error for this. Using CURLOPT_VERBOSE or CURLOPT_DEBUGFUNCTION will get a warning to display, but that is the only visible feedback you get about this possibly lethal situation.

CURLOPT_COOKIESESSION

Pass a long set to 1 to mark this as a new cookie "session". It will force libcurl to ignore all cookies it is about to load that are "session cookies" from the previous session. By default, libcurl always stores and loads all cookies, independent if they are session cookies or not. Session cookies are cookies without expiry date and they are meant to be alive and existing for this "session" only.

CURLOPT_COOKIELIST

Pass a char * to a cookie string. Cookie can be either in Netscape / Mozilla format or just regular HTTP-style header (Set-Cookie: ...) format. If cURL cookie engine was not enabled it will enable its cookie engine. Passing a magic string "ALL" will erase all cookies known by cURL. (Added in 7.14.1) Passing the special string "SESS" will only erase all session cookies known by cURL. (Added in 7.15.4) Passing the special string "FLUSH" will write all cookies known by cURL to the file specified by CURLOPT_COOKIEJAR. (Added in 7.17.1)

CURLOPT_HTTPGET

Pass a long. If the long is 1, this forces the HTTP request to get back to GET. Usable if a POST, HEAD, PUT, or a custom request has been used previously using the same curl handle.

When setting CURLOPT_HTTPGET to 1, it will automatically set CURLOPT_NOBODY to 0 and CURLOPT_UPLOAD to 0.

CURLOPT_HTTP_VERSION

Pass a long, set to one of the values described below. They force libcurl to use the specific HTTP versions. This is not sensible to do unless you have a good reason.

CURL_HTTP_VERSION_NONE

We don't care about what version the library uses. libcurl will use whatever it thinks fit.

CURL_HTTP_VERSION_1_0

Enforce HTTP 1.0 requests.

CURL_HTTP_VERSION_1_1

Enforce HTTP 1.1 requests.

CURLOPT_IGNORE_CONTENT_LENGTH

Ignore the Content-Length header. This is useful for Apache 1.x (and similar servers) which will report incorrect content length for files over 2 gigabytes. If this option is used, curl will not be able to accurately report progress, and will simply stop the download when the server ends the connection. (added in 7.14.1)

CURLOPT_HTTP_CONTENT_DECODING

Pass a long to tell libcurl how to act on content decoding. If set to zero, content decoding will be disabled. If set to 1 it is enabled. Libcurl has no default content decoding but requires you to use CURLOPT_ACCEPT_ENCODING for that. (added in 7.16.2)

CURLOPT_HTTP_TRANSFER_DECODING

Pass a long to tell libcurl how to act on transfer decoding. If set to zero, transfer decoding will be disabled, if set to 1 it is enabled (default). libcurl does chunked transfer decoding by default unless this option is set to zero. (added in 7.16.2)

SMTP OPTIONS

CURLOPT_MAIL_FROM

Pass a pointer to a zero terminated string as parameter. This should be used to specify the sender's email address when sending SMTP mail with libcurl.

An originator email address should be specified with angled brackets (<>) around it, which if not specified, will be added by libcurl from version 7.21.4 onwards. Failing to provide such brackets may cause the server to reject the email.

If this parameter is not specified then an empty address will be sent to the mail server which may or may not cause the email to be rejected.

(Added in 7.20.0)

CURLOPT_MAIL_RCPT

Pass a pointer to a linked list of recipients to pass to the server in your SMTP mail request. The linked list should be a fully valid list of struct curl_slist structs properly filled in. Use curl_slist_append(3) to create the list and curl_slist_free_all(3) to clean up an entire list.

When performing a mail transfer, each recipient should be specified within a pair of angled brackets (<>), however, should you not use an angled bracket as the first character libcurl will assume you provided a single email address and enclose that address within brackets for you. (Added in 7.20.0)

When performing an address verification (VRFY command), each recipient should be specified as the user name or user name and domain (as per Section 3.5 of RFC 5321). (Added in 7.34.0)

When performing a mailing list expand (EXPN command), each recipient should be specified using the mailing list name, such as "Friends" or "London-Office". (Added in 7.34.0)

CURLOPT_MAIL_AUTH

Pass a pointer to a zero terminated string as parameter. This will be used to specify the authentication address (identity) of a submitted message that is being relayed to another server.

This optional parameter allows co-operating agents in a trusted environment to communicate the authentication of individual messages and should only be used by the application program, using libcurl, if the application is itself a mail server acting in such an environment. If the application is operating as such and the AUTH address is not known or is invalid, then an empty string should be used for this parameter.

Unlike CURLOPT_MAIL_FROM and CURLOPT_MAIL_RCPT, the address should not be specified within a pair of angled brackets (<>). However, if an empty string is used then a pair of brackets will be sent by libcurl as required by RFC 2554.

(Added in 7.25.0)

TFTP OPTIONS

CURLOPT_TFTP_BLKSIZE

Specify block size to use for TFTP data transmission. Valid range as per RFC 2348 is 8-65464 bytes. The default of 512 bytes will be used if this option is not specified. The specified block size will only be used pending support by the remote server. If the server does not return an option acknowledgement or returns an option acknowledgement with no blksize, the default of 512 bytes will be used. (added in 7.19.4)

FTP OPTIONS

CURLOPT_FTPPORT

Pass a pointer to a zero terminated string as parameter. It will be used to get the IP address to use for the FTP PORT instruction. The PORT instruction tells the remote server to connect to our specified IP address. The string may be a plain IP address, a host name, a network interface name (under Unix) or just a '-' symbol to let the library use your system's default IP address. Default FTP operations are passive, and thus won't use PORT.

The address can be followed by a ':' to specify a port, optionally followed by a '-' to specify a port range. If the port specified is 0, the operating system will pick a free port. If a range is provided and all ports in the range are not available, libcurl will report CURLE_FTP_PORT_FAILED for the handle. Invalid port/range settings are ignored. IPv6 addresses followed by a port or portrange have to be in brackets. IPv6 addresses without port/range specifier can be in brackets. (added in 7.19.5)

Examples with specified ports:

  eth0:0   192.168.1.2:32000-33000   curl.se:32123   [::1]:1234-4567

You disable PORT again and go back to using the passive version by setting this option to NULL.

CURLOPT_QUOTE

Pass a pointer to a linked list of FTP or SFTP commands to pass to the server prior to your FTP request. This will be done before any other commands are issued (even before the CWD command for FTP). The linked list should be a fully valid list of 'struct curl_slist' structs properly filled in with text strings. Use curl_slist_append(3) to append strings (commands) to the list, and clear the entire list afterwards with curl_slist_free_all(3). Disable this operation again by setting a NULL to this option. When speaking to a FTP (or SFTP since 7.24.0) server, prefix the command with an asterisk (*) to make libcurl continue even if the command fails as by default libcurl will stop at first failure.

The set of valid FTP commands depends on the server (see RFC 959 for a list of mandatory commands).

The valid SFTP commands are: chgrp, chmod, chown, ln, mkdir, pwd, rename, rm, rmdir, symlink (see curl (1)) (SFTP support added in 7.16.3)

CURLOPT_POSTQUOTE

Pass a pointer to a linked list of FTP or SFTP commands to pass to the server after your FTP transfer request. The commands will only be run if no error occurred. The linked list should be a fully valid list of struct curl_slist structs properly filled in as described for CURLOPT_QUOTE. Disable this operation again by setting a NULL to this option.

CURLOPT_PREQUOTE

Pass a pointer to a linked list of FTP commands to pass to the server after the transfer type is set. The linked list should be a fully valid list of struct curl_slist structs properly filled in as described for CURLOPT_QUOTE. Disable this operation again by setting a NULL to this option. Before version 7.16.0, if you also set CURLOPT_NOBODY to 1, this option didn't work.

CURLOPT_DIRLISTONLY

A parameter set to 1 tells the library to just list the names of files in a directory, instead of doing a full directory listing that would include file sizes, dates etc. This works for FTP and SFTP URLs.

This causes an FTP NLST command to be sent on an FTP server. Beware that some FTP servers list only files in their response to NLST; they might not include subdirectories and symbolic links.

Setting this option to 1 also implies a directory listing even if the URL doesn't end with a slash, which otherwise is necessary.

Do NOT use this option if you also use CURLOPT_WILDCARDMATCH as it will effectively break that feature then.

(This option was known as CURLOPT_FTPLISTONLY up to 7.16.4)

CURLOPT_APPEND

A parameter set to 1 tells the library to append to the remote file instead of overwrite it. This is only useful when uploading to an FTP site.

(This option was known as CURLOPT_FTPAPPEND up to 7.16.4)

CURLOPT_FTP_USE_EPRT

Pass a long. If the value is 1, it tells curl to use the EPRT (and LPRT) command when doing active FTP downloads (which is enabled by CURLOPT_FTPPORT). Using EPRT means that it will first attempt to use EPRT and then LPRT before using PORT, but if you pass zero to this option, it will not try using EPRT or LPRT, only plain PORT. (Added in 7.10.5)

If the server is an IPv6 host, this option will have no effect as of 7.12.3.

CURLOPT_FTP_USE_EPSV

Pass a long. If the value is 1, it tells curl to use the EPSV command when doing passive FTP downloads (which it always does by default). Using EPSV means that it will first attempt to use EPSV before using PASV, but if you pass zero to this option, it will not try using EPSV, only plain PASV.

If the server is an IPv6 host, this option will have no effect as of 7.12.3.

CURLOPT_FTP_USE_PRET

Pass a long. If the value is 1, it tells curl to send a PRET command before PASV (and EPSV). Certain FTP servers, mainly drftpd, require this non-standard command for directory listings as well as up and downloads in PASV mode. Has no effect when using the active FTP transfers mode. (Added in 7.20.0)

CURLOPT_FTP_CREATE_MISSING_DIRS

Pass a long. If the value is 1, curl will attempt to create any remote directory that it fails to CWD into. CWD is the command that changes working directory. (Added in 7.10.7)

This setting also applies to SFTP-connections. curl will attempt to create the remote directory if it can't obtain a handle to the target-location. The creation will fail if a file of the same name as the directory to create already exists or lack of permissions prevents creation. (Added in 7.16.3)

Starting with 7.19.4, you can also set this value to 2, which will make libcurl retry the CWD command again if the subsequent MKD command fails. This is especially useful if you're doing many simultaneous connections against the same server and they all have this option enabled, as then CWD may first fail but then another connection does MKD before this connection and thus MKD fails but trying CWD works! 7.19.4 also introduced the CURLFTP_CREATE_DIR and CURLFTP_CREATE_DIR_RETRY enum names for these arguments.

Before version 7.19.4, libcurl will simply ignore arguments set to 2 and act as if 1 was selected.

CURLOPT_FTP_RESPONSE_TIMEOUT

Pass a long. Causes curl to set a timeout period (in seconds) on the amount of time that the server is allowed to take in order to generate a response message for a command before the session is considered hung. While curl is waiting for a response, this value overrides CURLOPT_TIMEOUT. It is recommended that if used in conjunction with CURLOPT_TIMEOUT, you set CURLOPT_FTP_RESPONSE_TIMEOUT to a value smaller than CURLOPT_TIMEOUT. (Added in 7.10.8)

CURLOPT_FTP_ALTERNATIVE_TO_USER

Pass a char * as parameter, pointing to a string which will be used to authenticate if the usual FTP "USER user" and "PASS password" negotiation fails. This is currently only known to be required when connecting to Tumbleweed's Secure Transport FTPS server using client certificates for authentication. (Added in 7.15.5)

CURLOPT_FTP_SKIP_PASV_IP

Pass a long. If set to 1, it instructs libcurl to not use the IP address the server suggests in its 227-response to libcurl's PASV command when libcurl connects the data connection. Instead libcurl will re-use the same IP address it already uses for the control connection. But it will use the port number from the 227-response. (Added in 7.14.2)

This option has no effect if PORT, EPRT or EPSV is used instead of PASV.

CURLOPT_FTPSSLAUTH

Pass a long using one of the values from below, to alter how libcurl issues "AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see CURLOPT_USE_SSL). (Added in 7.12.2)

CURLFTPAUTH_DEFAULT

Allow libcurl to decide.

CURLFTPAUTH_SSL

Try "AUTH SSL" first, and only if that fails try "AUTH TLS".

CURLFTPAUTH_TLS

Try "AUTH TLS" first, and only if that fails try "AUTH SSL".

CURLOPT_FTP_SSL_CCC

If enabled, this option makes libcurl use CCC (Clear Command Channel). It shuts down the SSL/TLS layer after authenticating. The rest of the control channel communication will be unencrypted. This allows NAT routers to follow the FTP transaction. Pass a long using one of the values below. (Added in 7.16.1)

CURLFTPSSL_CCC_NONE

Don't attempt to use CCC.

CURLFTPSSL_CCC_PASSIVE

Do not initiate the shutdown, but wait for the server to do it. Do not send a reply.

CURLFTPSSL_CCC_ACTIVE

Initiate the shutdown and wait for a reply.

CURLOPT_FTP_ACCOUNT

Pass a pointer to a zero terminated string (or NULL to disable). When an FTP server asks for "account data" after user name and password has been provided, this data is sent off using the ACCT command. (Added in 7.13.0)

CURLOPT_FTP_FILEMETHOD

Pass a long that should have one of the following values. This option controls what method libcurl should use to reach a file on a FTP(S) server. The argument should be one of the following alternatives:

CURLFTPMETHOD_MULTICWD

libcurl does a single CWD operation for each path part in the given URL. For deep hierarchies this means many commands. This is how RFC 1738 says it should be done. This is the default but the slowest behavior.

CURLFTPMETHOD_NOCWD

libcurl does no CWD at all. libcurl will do SIZE, RETR, STOR etc and give a full path to the server for all these commands. This is the fastest behavior.

CURLFTPMETHOD_SINGLECWD

libcurl does one CWD with the full target directory and then operates on the file "normally" (like in the multicwd case). This is somewhat more standards compliant than 'nocwd' but without the full penalty of 'multicwd'.

(Added in 7.15.1)

RTSP OPTIONS

CURLOPT_RTSP_REQUEST

Tell libcurl what kind of RTSP request to make. Pass one of the following RTSP enum values. Unless noted otherwise, commands require the Session ID to be initialized. (Added in 7.20.0)

CURL_RTSPREQ_OPTIONS

Used to retrieve the available methods of the server. The application is responsible for parsing and obeying the response. (The session ID is not needed for this method.) (Added in 7.20.0)

CURL_RTSPREQ_DESCRIBE

Used to get the low level description of a stream. The application should note what formats it understands in the 'Accept:' header. Unless set manually, libcurl will automatically fill in 'Accept: application/sdp'. Time-condition headers will be added to Describe requests if the CURLOPT_TIMECONDITION option is active. (The session ID is not needed for this method) (Added in 7.20.0)

CURL_RTSPREQ_ANNOUNCE

When sent by a client, this method changes the description of the session. For example, if a client is using the server to record a meeting, the client can use Announce to inform the server of all the meta-information about the session. ANNOUNCE acts like a HTTP PUT or POST just like CURL_RTSPREQ_SET_PARAMETER (Added in 7.20.0)

CURL_RTSPREQ_SETUP

Setup is used to initialize the transport layer for the session. The application must set the desired Transport options for a session by using the CURLOPT_RTSP_TRANSPORT option prior to calling setup. If no session ID is currently set with CURLOPT_RTSP_SESSION_ID, libcurl will extract and use the session ID in the response to this request. (The session ID is not needed for this method). (Added in 7.20.0)

CURL_RTSPREQ_PLAY

Send a Play command to the server. Use the CURLOPT_RANGE option to modify the playback time (e.g. 'npt=10-15'). (Added in 7.20.0)

CURL_RTSPREQ_PAUSE

Send a Pause command to the server. Use the CURLOPT_RANGE option with a single value to indicate when the stream should be halted. (e.g. npt='25') (Added in 7.20.0)

CURL_RTSPREQ_TEARDOWN

This command terminates an RTSP session. Simply closing a connection does not terminate the RTSP session since it is valid to control an RTSP session over different connections. (Added in 7.20.0)

CURL_RTSPREQ_GET_PARAMETER

Retrieve a parameter from the server. By default, libcurl will automatically include a Content-Type: text/parameters header on all non-empty requests unless a custom one is set. GET_PARAMETER acts just like a HTTP PUT or POST (see CURL_RTSPREQ_SET_PARAMETER). Applications wishing to send a heartbeat message (e.g. in the presence of a server-specified timeout) should send use an empty GET_PARAMETER request. (Added in 7.20.0)

CURL_RTSPREQ_SET_PARAMETER

Set a parameter on the server. By default, libcurl will automatically include a Content-Type: text/parameters header unless a custom one is set. The interaction with SET_PARAMTER is much like a HTTP PUT or POST. An application may either use CURLOPT_UPLOAD with CURLOPT_READDATA like a HTTP PUT, or it may use CURLOPT_POSTFIELDS like a HTTP POST. No chunked transfers are allowed, so the application must set the CURLOPT_INFILESIZE in the former and CURLOPT_POSTFIELDSIZE in the latter. Also, there is no use of multi-part POSTs within RTSP. (Added in 7.20.0)

CURL_RTSPREQ_RECORD

Used to tell the server to record a session. Use the CURLOPT_RANGE option to modify the record time. (Added in 7.20.0)

CURL_RTSPREQ_RECEIVE

This is a special request because it does not send any data to the server. The application may call this function in order to receive interleaved RTP data. It will return after processing one read buffer of data in order to give the application a chance to run. (Added in 7.20.0)

CURLOPT_RTSP_SESSION_ID

Pass a char * as a parameter to set the value of the current RTSP Session ID for the handle. Useful for resuming an in-progress session. Once this value is set to any non-NULL value, libcurl will return CURLE_RTSP_SESSION_ERROR if ID received from the server does not match. If unset (or set to NULL), libcurl will automatically set the ID the first time the server sets it in a response. (Added in 7.20.0)

CURLOPT_RTSP_STREAM_URI

Set the stream URI to operate on by passing a char * . For example, a single session may be controlling rtsp://foo/twister/audio and rtsp://foo/twister/video and the application can switch to the appropriate stream using this option. If unset, libcurl will default to operating on generic server options by passing '*' in the place of the RTSP Stream URI. This option is distinct from CURLOPT_URL. When working with RTSP, the CURLOPT_STREAM_URI indicates what URL to send to the server in the request header while the CURLOPT_URL indicates where to make the connection to. (e.g. the CURLOPT_URL for the above examples might be set to rtsp://foo/twister (Added in 7.20.0)

CURLOPT_RTSP_TRANSPORT

Pass a char * to tell libcurl what to pass for the Transport: header for this RTSP session. This is mainly a convenience method to avoid needing to set a custom Transport: header for every SETUP request. The application must set a Transport: header before issuing a SETUP request. (Added in 7.20.0)

CURLOPT_RTSP_HEADER

This option is simply an alias for CURLOPT_HTTP_HEADER. Use this to replace the standard headers that RTSP and HTTP share. It is also valid to use the shortcuts such as CURLOPT_USERAGENT. (Added in 7.20.0)

CURLOPT_RTSP_CLIENT_CSEQ

Manually set the the CSEQ number to issue for the next RTSP request. Useful if the application is resuming a previously broken connection. The CSEQ will increment from this new number henceforth. (Added in 7.20.0)

CURLOPT_RTSP_SERVER_CSEQ

Manually set the CSEQ number to expect for the next RTSP Server->Client request. At the moment, this feature (listening for Server requests) is unimplemented. (Added in 7.20.0)

PROTOCOL OPTIONS

CURLOPT_TRANSFERTEXT

A parameter set to 1 tells the library to use ASCII mode for FTP transfers, instead of the default binary transfer. For win32 systems it does not set the stdout to binary mode. This option can be usable when transferring text data between systems with different views on certain characters, such as newlines or similar.

libcurl does not do a complete ASCII conversion when doing ASCII transfers over FTP. This is a known limitation/flaw that nobody has rectified. libcurl simply sets the mode to ASCII and performs a standard transfer.

CURLOPT_PROXY_TRANSFER_MODE

Pass a long. If the value is set to 1 (one), it tells libcurl to set the transfer mode (binary or ASCII) for FTP transfers done via a HTTP proxy, by appending ;type=a or ;type=i to the URL. Without this setting, or it being set to 0 (zero, the default), CURLOPT_TRANSFERTEXT has no effect when doing FTP via a proxy. Beware that not all proxies support this feature. (Added in 7.18.0)

CURLOPT_CRLF

Pass a long. If the value is set to 1 (one), libcurl converts Unix newlines to CRLF newlines on transfers. Disable this option again by setting the value to 0 (zero).

CURLOPT_RANGE

Pass a char * as parameter, which should contain the specified range you want. It should be in the format "X-Y", where X or Y may be left out. HTTP transfers also support several intervals, separated with commas as in "X-Y,N-M". Using this kind of multiple intervals will cause the HTTP server to send the response document in pieces (using standard MIME separation techniques). For RTSP, the formatting of a range should follow RFC 2326 Section 12.29. For RTSP, byte ranges are not permitted. Instead, ranges should be given in npt, utc, or smpte formats.

Pass a NULL to this option to disable the use of ranges.

Ranges work on HTTP, FTP, FILE (since 7.18.0), and RTSP (since 7.20.0) transfers only.

CURLOPT_RESUME_FROM

Pass a long as parameter. It contains the offset in number of bytes that you want the transfer to start from. Set this option to 0 to make the transfer start from the beginning (effectively disabling resume). For FTP, set this option to -1 to make the transfer start from the end of the target file (useful to continue an interrupted upload).

When doing uploads with FTP, the resume position is where in the local/source file libcurl should try to resume the upload from and it will then append the source file to the remote target file.

CURLOPT_RESUME_FROM_LARGE

Pass a curl_off_t as parameter. It contains the offset in number of bytes that you want the transfer to start from. (Added in 7.11.0)

CURLOPT_CUSTOMREQUEST

Pass a pointer to a zero terminated string as parameter.

When you change the request method by setting CURLOPT_CUSTOMREQUEST to something, you don't actually change how libcurl behaves or acts in regards to the particular request method, it will only change the actual string sent in the request.

Restore to the internal default by setting this to NULL.

This option can be used to specify the request:

HTTP

Instead of GET or HEAD when performing HTTP based requests. This is particularly useful, for example, for performing a HTTP DELETE request.

For example:

When you tell libcurl to do a HEAD request, but then specify a GET though a custom request libcurl will still act as if it sent a HEAD. To switch to a proper HEAD use CURLOPT_NOBODY, to switch to a proper POST use CURLOPT_POST or CURLOPT_POSTFIELDS and to switch to a proper GET use CURLOPT_HTTPGET.

Please don't perform this at will, on HTTP based requests, by making sure your server supports the command you are sending first.

Many people have wrongly used this option to replace the entire request with their own, including multiple headers and POST contents. While that might work in many cases, it will cause libcurl to send invalid requests and it could possibly confuse the remote server badly. Use CURLOPT_POST and CURLOPT_POSTFIELDS to set POST data. Use CURLOPT_HTTPHEADER to replace or extend the set of headers sent by libcurl. Use CURLOPT_HTTP_VERSION to change HTTP version.

FTP

Instead of LIST and NLST when performing FTP directory listings.

IMAP

Instead of LIST when issuing IMAP based requests. (Added in 7.30.0)

POP3

Instead of LIST and RETR when issuing POP3 based requests. (Added in 7.26.0)

For example:

When you tell libcurl to use a custom request it will behave like a LIST or RETR command was sent where it expects data to be returned by the server. As such CURLOPT_NOBODY should be used when specifying commands such as DELE and NOOP for example.

SMTP

Instead of a HELP or VRFY when issuing SMTP based requests. (Added in 7.34.0)

For example:

Normally a multiline response is returned which can be used, in conjuection with CURLOPT_MAIL_RCPT, to specify an EXPN request. If the CURLOPT_NOBODY option is specified then the request can be used to issue NOOP and RSET commands.

CURLOPT_FILETIME

Pass a long. If it is 1, libcurl will attempt to get the modification date of the remote document in this operation. This requires that the remote server sends the time or replies to a time querying command. The curl_easy_getinfo(3) function with the CURLINFO_FILETIME argument can be used after a transfer to extract the received time (if any).

CURLOPT_NOBODY

A parameter set to 1 tells the library to not include the body-part in the output. This is only relevant for protocols that have separate header and body parts. On HTTP(S) servers, this will make libcurl do a HEAD request.

To change request to GET, you should use CURLOPT_HTTPGET. Change request to POST with CURLOPT_POST etc.

CURLOPT_INFILESIZE

When uploading a file to a remote site, this option should be used to tell libcurl what the expected size of the infile is. This value should be passed as a long. See also CURLOPT_INFILESIZE_LARGE.

For uploading using SCP, this option or CURLOPT_INFILESIZE_LARGE is mandatory.

To "unset" this value again, set it to -1.

When sending emails using SMTP, this command can be used to specify the optional SIZE parameter for the MAIL FROM command. (Added in 7.23.0)

This option does not limit how much data libcurl will actually send, as that is controlled entirely by what the read callback returns.

CURLOPT_INFILESIZE_LARGE

When uploading a file to a remote site, this option should be used to tell libcurl what the expected size of the infile is. This value should be passed as a curl_off_t. (Added in 7.11.0)

For uploading using SCP, this option or CURLOPT_INFILESIZE is mandatory.

To "unset" this value again, set it to -1.

When sending emails using SMTP, this command can be used to specify the optional SIZE parameter for the MAIL FROM command. (Added in 7.23.0)

This option does not limit how much data libcurl will actually send, as that is controlled entirely by what the read callback returns.

CURLOPT_UPLOAD

A parameter set to 1 tells the library to prepare for an upload. The CURLOPT_READDATA and CURLOPT_INFILESIZE or CURLOPT_INFILESIZE_LARGE options are also interesting for uploads. If the protocol is HTTP, uploading means using the PUT request unless you tell libcurl otherwise.

Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with CURLOPT_HTTPHEADER as usual.

If you use PUT to a HTTP 1.1 server, you can upload data without knowing the size before starting the transfer if you use chunked encoding. You enable this by adding a header like "Transfer-Encoding: chunked" with CURLOPT_HTTPHEADER. With HTTP 1.0 or without chunked transfer, you must specify the size.

CURLOPT_MAXFILESIZE

Pass a long as parameter. This allows you to specify the maximum size (in bytes) of a file to download. If the file requested is larger than this value, the transfer will not start and CURLE_FILESIZE_EXCEEDED will be returned.

The file size is not always known prior to download, and for such files this option has no effect even if the file transfer ends up being larger than this given limit. This concerns both FTP and HTTP transfers.

CURLOPT_MAXFILESIZE_LARGE

Pass a curl_off_t as parameter. This allows you to specify the maximum size (in bytes) of a file to download. If the file requested is larger than this value, the transfer will not start and CURLE_FILESIZE_EXCEEDED will be returned. (Added in 7.11.0)

The file size is not always known prior to download, and for such files this option has no effect even if the file transfer ends up being larger than this given limit. This concerns both FTP and HTTP transfers.

CURLOPT_TIMECONDITION

Pass a long as parameter. This defines how the CURLOPT_TIMEVALUE time value is treated. You can set this parameter to CURL_TIMECOND_IFMODSINCE or CURL_TIMECOND_IFUNMODSINCE. This feature applies to HTTP, FTP, RTSP, and FILE.

The last modification time of a file is not always known and in such instances this feature will have no effect even if the given time condition would not have been met. curl_easy_getinfo(3) with the CURLINFO_CONDITION_UNMET option can be used after a transfer to learn if a zero-byte successful "transfer" was due to this condition not matching.

CURLOPT_TIMEVALUE

Pass a long as parameter. This should be the time in seconds since 1 Jan 1970, and the time will be used in a condition as specified with CURLOPT_TIMECONDITION.

CONNECTION OPTIONS

CURLOPT_TIMEOUT

Pass a long as parameter containing the maximum time in seconds that you allow the libcurl transfer operation to take. Normally, name lookups can take a considerable time and limiting operations to less than a few minutes risk aborting perfectly normal operations. This option will cause curl to use the SIGALRM to enable time-outing system calls.

In unix-like systems, this might cause signals to be used unless CURLOPT_NOSIGNAL is set.

Default timeout is 0 (zero) which means it never times out.

CURLOPT_TIMEOUT_MS

An alternative to CURLOPT_TIMEOUT but takes number of milliseconds instead. If libcurl is built to use the standard system name resolver, that portion of the transfer will still use full-second resolution for timeouts with a minimum timeout allowed of one second.

If both CURLOPT_TIMEOUT and CURLOPT_TIMEOUT_MS are set, the value set last will be used.

(Added in 7.16.2)

CURLOPT_LOW_SPEED_LIMIT

Pass a long as parameter. It contains the transfer speed in bytes per second that the transfer should be below during CURLOPT_LOW_SPEED_TIME seconds for the library to consider it too slow and abort.

CURLOPT_LOW_SPEED_TIME

Pass a long as parameter. It contains the time in seconds that the transfer should be below the CURLOPT_LOW_SPEED_LIMIT for the library to consider it too slow and abort.

CURLOPT_MAX_SEND_SPEED_LARGE

Pass a curl_off_t as parameter. If an upload exceeds this speed (counted in bytes per second) on cumulative average during the transfer, the transfer will pause to keep the average rate less than or equal to the parameter value. Defaults to unlimited speed.

This option doesn't affect transfer speeds done with FILE:// URLs. (Added in  7.15.5)

CURLOPT_MAX_RECV_SPEED_LARGE

Pass a curl_off_t as parameter. If a download exceeds this speed (counted in bytes per second) on cumulative average during the transfer, the transfer will pause to keep the average rate less than or equal to the parameter value. Defaults to unlimited speed.

This option doesn't affect transfer speeds done with FILE:// URLs. (Added in 7.15.5)

CURLOPT_MAXCONNECTS

Pass a long. The set number will be the persistent connection cache size. The set amount will be the maximum amount of simultaneously open connections that libcurl may cache in this easy handle. Default is 5, and there isn't much point in changing this value unless you are perfectly aware of how this works and changes libcurl's behaviour. This concerns connections using any of the protocols that support persistent connections.

When reaching the maximum limit, curl closes the oldest one in the cache to prevent increasing the number of open connections.

If you already have performed transfers with this curl handle, setting a smaller MAXCONNECTS than before may cause open connections to get closed unnecessarily.

If you add this easy handle to a multi handle, this setting is not acknowledged, and you must instead use curl_multi_setopt(3) and the CURLMOPT_MAXCONNECTS option.

CURLOPT_CLOSEPOLICY

(Obsolete) This option does nothing.

CURLOPT_FRESH_CONNECT

Pass a long. Set to 1 to make the next transfer use a new (fresh) connection by force. If the connection cache is full before this connection, one of the existing connections will be closed as according to the selected or default policy. This option should be used with caution and only if you understand what it does. Set this to 0 to have libcurl attempt re-using an existing connection (default behavior).

CURLOPT_FORBID_REUSE

Pass a long. Set to 1 to make the next transfer explicitly close the connection when done. Normally, libcurl keeps all connections alive when done with one transfer in case a succeeding one follows that can re-use them. This option should be used with caution and only if you understand what it does. Set to 0 to have libcurl keep the connection open for possible later re-use (default behavior).

CURLOPT_CONNECTTIMEOUT

Pass a long. It should contain the maximum time in seconds that you allow the connection to the server to take. This only limits the connection phase, once it has connected, this option is of no more use. Set to zero to switch to the default built-in connection timeout - 300 seconds. See also the CURLOPT_TIMEOUT option.

In unix-like systems, this might cause signals to be used unless CURLOPT_NOSIGNAL is set.

CURLOPT_CONNECTTIMEOUT_MS

Like CURLOPT_CONNECTTIMEOUT but takes the number of milliseconds instead. If libcurl is built to use the standard system name resolver, that portion of the connect will still use full-second resolution for timeouts with a minimum timeout allowed of one second. (Added in 7.16.2)

CURLOPT_IPRESOLVE

Allows an application to select what kind of IP addresses to use when resolving host names. This is only interesting when using host names that resolve addresses using more than one version of IP. The allowed values are:

CURL_IPRESOLVE_WHATEVER

Default, resolves addresses to all IP versions that your system allows.

CURL_IPRESOLVE_V4

Resolve to IPv4 addresses.

CURL_IPRESOLVE_V6

Resolve to IPv6 addresses.

CURLOPT_CONNECT_ONLY

Pass a long. If the parameter equals 1, it tells the library to perform all the required proxy authentication and connection setup, but no data transfer. This option is implemented for HTTP, SMTP and POP3.

The option can be used to simply test a connection to a server, but is more useful when used with the CURLINFO_LASTSOCKET option to curl_easy_getinfo(3) as the library can set up the connection and then the application can obtain the most recently used socket for special data transfers. (Added in 7.15.2)

CURLOPT_USE_SSL

Pass a long using one of the values from below, to make libcurl use your desired level of SSL for the transfer. (Added in 7.11.0)

This is for enabling SSL/TLS when you use FTP, SMTP, POP3, IMAP etc.

(This option was known as CURLOPT_FTP_SSL up to 7.16.4, and the constants were known as CURLFTPSSL_*)

CURLUSESSL_NONE

Don't attempt to use SSL.

CURLUSESSL_TRY

Try using SSL, proceed as normal otherwise.

CURLUSESSL_CONTROL

Require SSL for the control connection or fail with CURLE_USE_SSL_FAILED.

CURLUSESSL_ALL

Require SSL for all communication or fail with CURLE_USE_SSL_FAILED.

CURLOPT_RESOLVE

Pass a pointer to a linked list of strings with host name resolve information to use for requests with this handle. The linked list should be a fully valid list of struct curl_slist structs properly filled in. Use curl_slist_append(3) to create the list and curl_slist_free_all(3) to clean up an entire list.

Each single name resolve string should be written using the format HOST:PORT:ADDRESS where HOST is the name libcurl will try to resolve, PORT is the port number of the service where libcurl wants to connect to the HOST and ADDRESS is the numerical IP address. If libcurl is built to support IPv6, ADDRESS can of course be either IPv4 or IPv6 style addressing.

This option effectively pre-populates the DNS cache with entries for the host+port pair so redirects and everything that operations against the HOST+PORT will instead use your provided ADDRESS. Addresses to set with CURL_RESOLVE will not time-out from the DNS cache like ordindary entries.

You can remove names from the DNS cache again, to stop providing these fake resolves, by including a string in the linked list that uses the format "-HOST:PORT". The host name must be prefixed with a dash, and the host name and port number must exactly match what was already added previously.

(Added in 7.21.3)

CURLOPT_DNS_SERVERS

Set the list of DNS servers to be used instead of the system default. The format of the dns servers option is:

host[:port][,host[:port]]...

For example:

192.168.1.100,192.168.1.101,3.4.5.6

This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one.

(Added in 7.24.0)

CURLOPT_DNS_INTERFACE

Pass a char * as parameter. Set the name of the network interface that the DNS resolver should bind to. This must be an interface name (not an address). Set this option to NULL to use the default setting (don't bind to a specific interface).

This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one.

(Added in 7.33.0)

CURLOPT_DNS_LOCAL_IP4

Set the local IPv4 address that the resolver should bind to. The argument should be of type char * and contain a single IPv4 address as a string. Set this option to NULL to use the default setting (don't bind to a specific IP address).

This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one.

(Added in 7.33.0)

CURLOPT_DNS_LOCAL_IP6

Set the local IPv6 address that the resolver should bind to. The argument should be of type char * and contain a single IPv6 address as a string. Set this option to NULL to use the default setting (don't bind to a specific IP address).

This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one.

(Added in 7.33.0)

CURLOPT_ACCEPTTIMEOUT_MS

Pass a long telling libcurl the maximum number of milliseconds to wait for a server to connect back to libcurl when an active FTP connection is used. If no timeout is set, the internal default of 60000 will be used. (Added in 7.24.0)

SSL and SECURITY OPTIONS

CURLOPT_SSLCERT

Pass a pointer to a zero terminated string as parameter. The string should be the file name of your certificate. The default format is "P12" on Secure Transport and "PEM" on other engines, and can be changed with CURLOPT_SSLCERTTYPE.

With NSS or Secure Transport, this can also be the nickname of the certificate you wish to authenticate with as it is named in the security database. If you want to use a file from the current directory, please precede it with "./" prefix, in order to avoid confusion with a nickname.

CURLOPT_SSLCERTTYPE

Pass a pointer to a zero terminated string as parameter. The string should be the format of your certificate. Supported formats are "PEM" and "DER", except with Secure Transport. OpenSSL (versions 0.9.3 and later) and Secure Transport (on iOS 5 or later, or OS X 10.7 or later) also support "P12" for PKCS#12-encoded files. (Added in 7.9.3)

CURLOPT_SSLKEY

Pass a pointer to a zero terminated string as parameter. The string should be the file name of your private key. The default format is "PEM" and can be changed with CURLOPT_SSLKEYTYPE.

(iOS and Mac OS X only) This option is ignored if curl was built against Secure Transport. Secure Transport expects the private key to be already present in the keychain or PKCS#12 file containing the certificate.

CURLOPT_SSLKEYTYPE

Pass a pointer to a zero terminated string as parameter. The string should be the format of your private key. Supported formats are "PEM", "DER" and "ENG".

The format "ENG" enables you to load the private key from a crypto engine. In this case CURLOPT_SSLKEY is used as an identifier passed to the engine. You have to set the crypto engine with CURLOPT_SSLENGINE. "DER" format key file currently does not work because of a bug in OpenSSL.

CURLOPT_KEYPASSWD

Pass a pointer to a zero terminated string as parameter. It will be used as the password required to use the CURLOPT_SSLKEY or CURLOPT_SSH_PRIVATE_KEYFILE private key. You never needed a pass phrase to load a certificate but you need one to load your private key.

(This option was known as CURLOPT_SSLKEYPASSWD up to 7.16.4 and CURLOPT_SSLCERTPASSWD up to 7.9.2)

CURLOPT_SSLENGINE

Pass a pointer to a zero terminated string as parameter. It will be used as the identifier for the crypto engine you want to use for your private key.

If the crypto device cannot be loaded, CURLE_SSL_ENGINE_NOTFOUND is returned.

CURLOPT_SSLENGINE_DEFAULT

Sets the actual crypto engine as the default for (asymmetric) crypto operations.

If the crypto device cannot be set, CURLE_SSL_ENGINE_SETFAILED is returned.

Even though this option doesn't need any parameter, in some configurations curl_easy_setopt might be defined as a macro taking exactly three arguments. Therefore, it's recommended to pass 1 as parameter to this option.

CURLOPT_SSLVERSION

Pass a long as parameter to control what version of SSL/TLS to attempt to use. (Added in 7.9.2)

The available options are:

CURL_SSLVERSION_DEFAULT

The default action. This will attempt to figure out the remote SSL protocol version, i.e. either SSLv3 or TLSv1 (but not SSLv2, which became disabled by default with 7.18.1).

CURL_SSLVERSION_TLSv1

Force TLSv1.x

CURL_SSLVERSION_SSLv2

Force SSLv2

CURL_SSLVERSION_SSLv3

Force SSLv3

CURL_SSLVERSION_TLSv1_0

Force TLSv1.0 (Added in 7.34.0)

CURL_SSLVERSION_TLSv1_1

Force TLSv1.1 (Added in 7.34.0)

CURL_SSLVERSION_TLSv1_2

Force TLSv1.2 (Added in 7.34.0)

CURLOPT_SSL_VERIFYPEER

Pass a long as parameter. By default, curl assumes a value of 1.

This option determines whether curl verifies the authenticity of the peer's certificate. A value of 1 means curl verifies; 0 (zero) means it doesn't.

When negotiating a SSL connection, the server sends a certificate indicating its identity. Curl verifies whether the certificate is authentic, i.e. that you can trust that the server is who the certificate says it is. This trust is based on a chain of digital signatures, rooted in certification authority (CA) certificates you supply. curl uses a default bundle of CA certificates (the path for that is determined at build time) and you can specify alternate certificates with the CURLOPT_CAINFO option or the CURLOPT_CAPATH option.

When CURLOPT_SSL_VERIFYPEER is nonzero, and the verification fails to prove that the certificate is authentic, the connection fails. When the option is zero, the peer certificate verification succeeds regardless.

Authenticating the certificate is not by itself very useful. You typically want to ensure that the server, as authentically identified by its certificate, is the server you mean to be talking to. Use CURLOPT_SSL_VERIFYHOST to control that. The check that the host name in the certificate is valid for the host name you're connecting to is done independently of the CURLOPT_SSL_VERIFYPEER option.

CURLOPT_CAINFO

Pass a char * to a zero terminated string naming a file holding one or more certificates to verify the peer with. This makes sense only when used in combination with the CURLOPT_SSL_VERIFYPEER option. If CURLOPT_SSL_VERIFYPEER is zero, CURLOPT_CAINFO need not even indicate an accessible file.

This option is by default set to the system path where libcurl's cacert bundle is assumed to be stored, as established at build time.

If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module (libnsspem.so) needs to be available for this option to work properly.

CURLOPT_ISSUERCERT

Pass a char * to a zero terminated string naming a file holding a CA certificate in PEM format. If the option is set, an additional check against the peer certificate is performed to verify the issuer is indeed the one associated with the certificate provided by the option. This additional check is useful in multi-level PKI where one needs to enforce that the peer certificate is from a specific branch of the tree.

This option makes sense only when used in combination with the CURLOPT_SSL_VERIFYPEER option. Otherwise, the result of the check is not considered as failure.

A specific error code (CURLE_SSL_ISSUER_ERROR) is defined with the option, which is returned if the setup of the SSL/TLS session has failed due to a mismatch with the issuer of peer certificate (CURLOPT_SSL_VERIFYPEER has to be set too for the check to fail). (Added in 7.19.0)

CURLOPT_CAPATH

Pass a char * to a zero terminated string naming a directory holding multiple CA certificates to verify the peer with. If libcurl is built against OpenSSL, the certificate directory must be prepared using the openssl c_rehash utility. This makes sense only when used in combination with the CURLOPT_SSL_VERIFYPEER option. If CURLOPT_SSL_VERIFYPEER is zero, CURLOPT_CAPATH need not even indicate an accessible path. The CURLOPT_CAPATH function apparently does not work in Windows due to some limitation in openssl. This option is OpenSSL-specific and does nothing if libcurl is built to use GnuTLS. NSS-powered libcurl provides the option only for backward compatibility.

CURLOPT_CRLFILE

Pass a char * to a zero terminated string naming a file with the concatenation of CRL (in PEM format) to use in the certificate validation that occurs during the SSL exchange.

When curl is built to use NSS or GnuTLS, there is no way to influence the use of CRL passed to help in the verification process. When libcurl is built with OpenSSL support, X509_V_FLAG_CRL_CHECK and X509_V_FLAG_CRL_CHECK_ALL are both set, requiring CRL check against all the elements of the certificate chain if a CRL file is passed.

This option makes sense only when used in combination with the CURLOPT_SSL_VERIFYPEER option.

A specific error code (CURLE_SSL_CRL_BADFILE) is defined with the option. It is returned when the SSL exchange fails because the CRL file cannot be loaded. A failure in certificate verification due to a revocation information found in the CRL does not trigger this specific error. (Added in 7.19.0)

CURLOPT_SSL_VERIFYHOST

Pass a long as parameter.

This option determines whether libcurl verifies that the server cert is for the server it is known as.

When negotiating a SSL connection, the server sends a certificate indicating its identity.

When CURLOPT_SSL_VERIFYHOST is 2, that certificate must indicate that the server is the server to which you meant to connect, or the connection fails.

Curl considers the server the intended one when the Common Name field or a Subject Alternate Name field in the certificate matches the host name in the URL to which you told Curl to connect.

When the value is 1, curl_easy_setopt will return an error and the option value will not be changed. It was previously (in 7.28.0 and earlier) a debug option of some sorts, but it is no longer supported due to frequently leading to programmer mistakes.

When the value is 0, the connection succeeds regardless of the names in the certificate.

The default value for this option is 2.

This option controls checking the server's certificate's claimed identity. The server could be lying. To control lying, see CURLOPT_SSL_VERIFYPEER. If libcurl is built against NSS and CURLOPT_SSL_VERIFYPEER is zero, CURLOPT_SSL_VERIFYHOST is also set to zero and cannot be overridden.

CURLOPT_CERTINFO

Pass a long set to 1 to enable libcurl's certificate chain info gatherer. With this enabled, libcurl (if built with OpenSSL, NSS, GSKit or QsoSSL) will extract lots of information and data about the certificates in the certificate chain used in the SSL connection. This data may then be retrieved after a transfer using curl_easy_getinfo(3) and its option CURLINFO_CERTINFO. (Added in 7.19.1)

CURLOPT_RANDOM_FILE

Pass a char * to a zero terminated file name. The file will be used to read from to seed the random engine for SSL. The more random the specified file is, the more secure the SSL connection will become.

CURLOPT_EGDSOCKET

Pass a char * to the zero terminated path name to the Entropy Gathering Daemon socket. It will be used to seed the random engine for SSL.

CURLOPT_SSL_CIPHER_LIST

Pass a char *, pointing to a zero terminated string holding the list of ciphers to use for the SSL connection. The list must be syntactically correct, it consists of one or more cipher strings separated by colons. Commas or spaces are also acceptable separators but colons are normally used, !, - and + can be used as operators.

For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA', ´SHA1+DES´, 'TLSv1' and 'DEFAULT'. The default list is normally set when you compile OpenSSL.

You'll find more details about cipher lists on this URL: http://www.openssl.org/docs/apps/ciphers.html

For NSS, valid examples of cipher lists include 'rsa_rc4_128_md5', ´rsa_aes_128_sha´, etc. With NSS you don't add/remove ciphers. If one uses this option then all known ciphers are disabled and only those passed in are enabled.

You'll find more details about the NSS cipher lists on this URL: http://git.fedorahosted.org/cgit/mod_nss.git/plain/docs/mod_nss.html#Directives

CURLOPT_SSL_SESSIONID_CACHE

Pass a long set to 0 to disable libcurl's use of SSL session-ID caching. Set this to 1 to enable it. By default all transfers are done using the cache. While nothing ever should get hurt by attempting to reuse SSL session-IDs, there seem to be broken SSL implementations in the wild that may require you to disable this in order for you to succeed. (Added in 7.16.0)

CURLOPT_SSL_OPTIONS

Pass a long with a bitmask to tell libcurl about specific SSL behaviors.

CURLSSLOPT_ALLOW_BEAST is the only supported bit and by setting this the user will tell libcurl to not attempt to use any workarounds for a security flaw in the SSL3 and TLS1.0 protocols. If this option isn't used or this bit is set to 0, the SSL layer libcurl uses may use a work-around for this flaw although it might cause interoperability problems with some (older) SSL implementations. WARNING: avoiding this work-around loosens the security, and by setting this option to 1 you ask for exactly that. (Added in 7.25.0)

CURLOPT_KRBLEVEL

Pass a char * as parameter. Set the kerberos security level for FTP; this also enables kerberos 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. Set the string to NULL to disable kerberos support for FTP.

(This option was known as CURLOPT_KRB4LEVEL up to 7.16.3)

CURLOPT_GSSAPI_DELEGATION

Set the parameter to CURLGSSAPI_DELEGATION_FLAG to allow unconditional GSSAPI credential delegation. The delegation is disabled by default since 7.21.7. Set the parameter to CURLGSSAPI_DELEGATION_POLICY_FLAG to delegate only if the OK-AS-DELEGATE flag is set in the service ticket in case this feature is supported by the GSSAPI implementation and the definition of GSS_C_DELEG_POLICY_FLAG was available at compile-time. (Added in 7.22.0)

SSH OPTIONS

CURLOPT_SSH_AUTH_TYPES

Pass a long set to a bitmask consisting of one or more of CURLSSH_AUTH_PUBLICKEY, CURLSSH_AUTH_PASSWORD, CURLSSH_AUTH_HOST, CURLSSH_AUTH_KEYBOARD and CURLSSH_AUTH_AGENT. Set CURLSSH_AUTH_ANY to let libcurl pick a suitable one. Currently CURLSSH_AUTH_HOST has no effect. (Added in 7.16.1) If CURLSSH_AUTH_AGENT is used, libcurl attempts to connect to ssh-agent or pageant and let the agent attempt the authentication. (Added in 7.28.0)

CURLOPT_SSH_HOST_PUBLIC_KEY_MD5

Pass a char * pointing to a string containing 32 hexadecimal digits. The string should be the 128 bit MD5 checksum of the remote host's public key, and libcurl will reject the connection to the host unless the md5sums match. This option is only for SCP and SFTP transfers. (Added in 7.17.1)

CURLOPT_SSH_PUBLIC_KEYFILE

Pass a char * pointing to a file name for your public key. If not used, libcurl defaults to $HOME/.ssh/id_dsa.pub if the HOME environment variable is set, and just "id_dsa.pub" in the current directory if HOME is not set. (Added in 7.16.1) If an empty string is passed, libcurl will pass no public key to libssh2 which then tries to compute it from the private key, this is known to work when libssh2 1.4.0+ is linked against OpenSSL. (Added in 7.26.0)

CURLOPT_SSH_PRIVATE_KEYFILE

Pass a char * pointing to a file name for your private key. If not used, libcurl defaults to $HOME/.ssh/id_dsa if the HOME environment variable is set, and just "id_dsa" in the current directory if HOME is not set. If the file is password-protected, set the password with CURLOPT_KEYPASSWD. (Added in 7.16.1)

CURLOPT_SSH_KNOWNHOSTS

Pass a pointer to a zero terminated string holding the file name of the known_host file to use. The known_hosts file should use the OpenSSH file format as supported by libssh2. If this file is specified, libcurl will only accept connections with hosts that are known and present in that file, with a matching public key. Use CURLOPT_SSH_KEYFUNCTION to alter the default behavior on host and key (mis)matching. (Added in 7.19.6)

CURLOPT_SSH_KEYFUNCTION

Pass a pointer to a curl_sshkeycallback function. It gets called when the known_host matching has been done, to allow the application to act and decide for libcurl how to proceed. The callback will only be called if CURLOPT_SSH_KNOWNHOSTS is also set.

The curl_sshkeycallback function gets passed the CURL handle, the key from the known_hosts file, the key from the remote site, info from libcurl on the matching status and a custom pointer (set with CURLOPT_SSH_KEYDATA). It MUST return one of the following return codes to tell libcurl how to act:

CURLKHSTAT_FINE_ADD_TO_FILE

The host+key is accepted and libcurl will append it to the known_hosts file before continuing with the connection. This will also add the host+key combo to the known_host pool kept in memory if it wasn't already present there. The adding of data to the file is done by completely replacing the file with a new copy, so the permissions of the file must allow this.

CURLKHSTAT_FINE

The host+key is accepted libcurl will continue with the connection. This will also add the host+key combo to the known_host pool kept in memory if it wasn't already present there.

CURLKHSTAT_REJECT

The host+key is rejected. libcurl will deny the connection to continue and it will be closed.

CURLKHSTAT_DEFER

The host+key is rejected, but the SSH connection is asked to be kept alive. This feature could be used when the app wants to somehow return back and act on the host+key situation and then retry without needing the overhead of setting it up from scratch again.

 (Added in 7.19.6)

CURLOPT_SSH_KEYDATA

Pass a void * as parameter. This pointer will be passed along verbatim to the callback set with CURLOPT_SSH_KEYFUNCTION. (Added in 7.19.6)

OTHER OPTIONS

CURLOPT_PRIVATE

Pass a void * as parameter, pointing to data that should be associated with this curl handle. The pointer can subsequently be retrieved using curl_easy_getinfo(3) with the CURLINFO_PRIVATE option. libcurl itself does nothing with this data. (Added in 7.10.3)

CURLOPT_SHARE

Pass a share handle as a parameter. The share handle must have been created by a previous call to curl_share_init(3). Setting this option, will make this curl handle use the data from the shared handle instead of keeping the data to itself. This enables several curl handles to share data. If the curl handles are used simultaneously in multiple threads, you MUST use the locking methods in the share handle. See curl_share_setopt(3) for details.

If you add a share that is set to share cookies, your easy handle will use that cookie cache and get the cookie engine enabled. If you unshare an object that was using cookies (or change to another object that doesn't share cookies), the easy handle will get its cookie engine disabled.

Data that the share object is not set to share will be dealt with the usual way, as if no share was used.

CURLOPT_NEW_FILE_PERMS

Pass a long as a parameter, containing the value of the permissions that will be assigned to newly created files on the remote server. The default value is 0644, but any valid value can be used. The only protocols that can use this are sftp://, scp://, and file://. (Added in 7.16.4)

CURLOPT_NEW_DIRECTORY_PERMS

Pass a long as a parameter, containing the value of the permissions that will be assigned to newly created directories on the remote server. The default value is 0755, but any valid value can be used. The only protocols that can use this are sftp://, scp://, and file://. (Added in 7.16.4)

TELNET OPTIONS

CURLOPT_TELNETOPTIONS

Provide a pointer to a curl_slist with variables to pass to the telnet negotiations. The variables should be in the format <option=value>. libcurl supports the options 'TTYPE', 'XDISPLOC' and 'NEW_ENV'. See the TELNET standard for details.

RETURN VALUE

CURLE_OK (zero) means that the option was set properly, non-zero means an error occurred as <curl/curl.h> defines. See the libcurl-errors(3) man page for the full list with descriptions.

If you try to set an option that libcurl doesn't know about, perhaps because the library is too old to support it or the option was removed in a recent version, this function will return CURLE_FAILED_INIT.

SEE ALSO

curl_easy_init (3) curl_easy_cleanup (3) curl_easy_reset (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/libcurl-errors.30000644000175000017500000003240512262353672015126 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2013, 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. .\" * .\" ************************************************************************** .\" .TH libcurl-errors 3 "1 Jan 2010" "libcurl 7.20.0" "libcurl errors" .SH NAME libcurl-errors \- error codes in libcurl .SH DESCRIPTION This man page includes most, if not all, available error codes in libcurl. Why they occur and possibly what you can do to fix the problem are also included. .SH "CURLcode" Almost all "easy" interface functions return a CURLcode error code. No matter what, using the \fIcurl_easy_setopt(3)\fP option \fICURLOPT_ERRORBUFFER\fP is a good idea as it will give you a human readable error string that may offer more details about the cause of the error than just the error code. \fIcurl_easy_strerror(3)\fP can be called to get an error string from a given CURLcode number. CURLcode is one of the following: .IP "CURLE_OK (0)" All fine. Proceed as usual. .IP "CURLE_UNSUPPORTED_PROTOCOL (1)" The URL you passed to libcurl used a protocol that this libcurl does not support. The support might be a compile-time option that you didn't use, it can be a misspelled protocol string or just a protocol libcurl has no code for. .IP "CURLE_FAILED_INIT (2)" Very early initialization code failed. This is likely to be an internal error or problem, or a resource problem where something fundamental couldn't get done at init time. .IP "CURLE_URL_MALFORMAT (3)" The URL was not properly formatted. .IP "CURLE_NOT_BUILT_IN (4)" A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. This means that a feature or option was not enabled or explicitly disabled when libcurl was built and in order to get it to function you have to get a rebuilt libcurl. .IP "CURLE_COULDNT_RESOLVE_PROXY (5)" Couldn't resolve proxy. The given proxy host could not be resolved. .IP "CURLE_COULDNT_RESOLVE_HOST (6)" Couldn't resolve host. The given remote host was not resolved. .IP "CURLE_COULDNT_CONNECT (7)" Failed to connect() to host or proxy. .IP "CURLE_FTP_WEIRD_SERVER_REPLY (8)" After connecting to a FTP server, libcurl expects to get a certain reply back. This error code implies that it got a strange or bad reply. The given remote server is probably not an OK FTP server. .IP "CURLE_REMOTE_ACCESS_DENIED (9)" We were denied access to the resource given in the URL. For FTP, this occurs while trying to change to the remote directory. .IP "CURLE_FTP_ACCEPT_FAILED (10)" While waiting for the server to connect back when an active FTP session is used, an error code was sent over the control connection or similar. .IP "CURLE_FTP_WEIRD_PASS_REPLY (11)" After having sent the FTP password to the server, libcurl expects a proper reply. This error code indicates that an unexpected code was returned. .IP "CURLE_FTP_ACCEPT_TIMEOUT (12)" During an active FTP session while waiting for the server to connect, the \fICURLOPT_ACCEPTTIMOUT_MS\fP (or the internal default) timeout expired. .IP "CURLE_FTP_WEIRD_PASV_REPLY (13)" libcurl failed to get a sensible result back from the server as a response to either a PASV or a EPSV command. The server is flawed. .IP "CURLE_FTP_WEIRD_227_FORMAT (14)" FTP servers return a 227-line as a response to a PASV command. If libcurl fails to parse that line, this return code is passed back. .IP "CURLE_FTP_CANT_GET_HOST (15)" An internal failure to lookup the host used for the new connection. .IP "CURLE_FTP_COULDNT_SET_TYPE (17)" Received an error when trying to set the transfer mode to binary or ASCII. .IP "CURLE_PARTIAL_FILE (18)" A file transfer was shorter or larger than expected. This happens when the server first reports an expected transfer size, and then delivers data that doesn't match the previously given size. .IP "CURLE_FTP_COULDNT_RETR_FILE (19)" This was either a weird reply to a 'RETR' command or a zero byte transfer complete. .IP "CURLE_QUOTE_ERROR (21)" When sending custom "QUOTE" commands to the remote server, one of the commands returned an error code that was 400 or higher (for FTP) or otherwise indicated unsuccessful completion of the command. .IP "CURLE_HTTP_RETURNED_ERROR (22)" This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server returns an error code that is >= 400. .IP "CURLE_WRITE_ERROR (23)" An error occurred when writing received data to a local file, or an error was returned to libcurl from a write callback. .IP "CURLE_UPLOAD_FAILED (25)" Failed starting the upload. For FTP, the server typically denied the STOR command. The error buffer usually contains the server's explanation for this. .IP "CURLE_READ_ERROR (26)" There was a problem reading a local file or an error returned by the read callback. .IP "CURLE_OUT_OF_MEMORY (27)" A memory allocation request failed. This is serious badness and things are severely screwed up if this ever occurs. .IP "CURLE_OPERATION_TIMEDOUT (28)" Operation timeout. The specified time-out period was reached according to the conditions. .IP "CURLE_FTP_PORT_FAILED (30)" The FTP PORT command returned error. This mostly happens when you haven't specified a good enough address for libcurl to use. See \fICURLOPT_FTPPORT\fP. .IP "CURLE_FTP_COULDNT_USE_REST (31)" The FTP REST command returned error. This should never happen if the server is sane. .IP "CURLE_RANGE_ERROR (33)" The server does not support or accept range requests. .IP "CURLE_HTTP_POST_ERROR (34)" This is an odd error that mainly occurs due to internal confusion. .IP "CURLE_SSL_CONNECT_ERROR (35)" A problem occurred somewhere in the SSL/TLS handshake. You really want the error buffer and read the message there as it pinpoints the problem slightly more. Could be certificates (file formats, paths, permissions), passwords, and others. .IP "CURLE_BAD_DOWNLOAD_RESUME (36)" The download could not be resumed because the specified offset was out of the file boundary. .IP "CURLE_FILE_COULDNT_READ_FILE (37)" A file given with FILE:// couldn't be opened. Most likely because the file path doesn't identify an existing file. Did you check file permissions? .IP "CURLE_LDAP_CANNOT_BIND (38)" LDAP cannot bind. LDAP bind operation failed. .IP "CURLE_LDAP_SEARCH_FAILED (39)" LDAP search failed. .IP "CURLE_FUNCTION_NOT_FOUND (41)" Function not found. A required zlib function was not found. .IP "CURLE_ABORTED_BY_CALLBACK (42)" Aborted by callback. A callback returned "abort" to libcurl. .IP "CURLE_BAD_FUNCTION_ARGUMENT (43)" Internal error. A function was called with a bad parameter. .IP "CURLE_INTERFACE_FAILED (45)" Interface error. A specified outgoing interface could not be used. Set which interface to use for outgoing connections' source IP address with CURLOPT_INTERFACE. .IP "CURLE_TOO_MANY_REDIRECTS (47)" Too many redirects. When following redirects, libcurl hit the maximum amount. Set your limit with CURLOPT_MAXREDIRS. .IP "CURLE_UNKNOWN_OPTION (48)" An option passed to libcurl is not recognized/known. Refer to the appropriate documentation. This is most likely a problem in the program that uses libcurl. The error buffer might contain more specific information about which exact option it concerns. .IP "CURLE_TELNET_OPTION_SYNTAX (49)" A telnet option string was Illegally formatted. .IP "CURLE_PEER_FAILED_VERIFICATION (51)" The remote server's SSL certificate or SSH md5 fingerprint was deemed not OK. .IP "CURLE_GOT_NOTHING (52)" Nothing was returned from the server, and under the circumstances, getting nothing is considered an error. .IP "CURLE_SSL_ENGINE_NOTFOUND (53)" The specified crypto engine wasn't found. .IP "CURLE_SSL_ENGINE_SETFAILED (54)" Failed setting the selected SSL crypto engine as default! .IP "CURLE_SEND_ERROR (55)" Failed sending network data. .IP "CURLE_RECV_ERROR (56)" Failure with receiving network data. .IP "CURLE_SSL_CERTPROBLEM (58)" problem with the local client certificate. .IP "CURLE_SSL_CIPHER (59)" Couldn't use specified cipher. .IP "CURLE_SSL_CACERT (60)" Peer certificate cannot be authenticated with known CA certificates. .IP "CURLE_BAD_CONTENT_ENCODING (61)" Unrecognized transfer encoding. .IP "CURLE_LDAP_INVALID_URL (62)" Invalid LDAP URL. .IP "CURLE_FILESIZE_EXCEEDED (63)" Maximum file size exceeded. .IP "CURLE_USE_SSL_FAILED (64)" Requested FTP SSL level failed. .IP "CURLE_SEND_FAIL_REWIND (65)" When doing a send operation curl had to rewind the data to retransmit, but the rewinding operation failed. .IP "CURLE_SSL_ENGINE_INITFAILED (66)" Initiating the SSL Engine failed. .IP "CURLE_LOGIN_DENIED (67)" The remote server denied curl to login (Added in 7.13.1) .IP "CURLE_TFTP_NOTFOUND (68)" File not found on TFTP server. .IP "CURLE_TFTP_PERM (69)" Permission problem on TFTP server. .IP "CURLE_REMOTE_DISK_FULL (70)" Out of disk space on the server. .IP "CURLE_TFTP_ILLEGAL (71)" Illegal TFTP operation. .IP "CURLE_TFTP_UNKNOWNID (72)" Unknown TFTP transfer ID. .IP "CURLE_REMOTE_FILE_EXISTS (73)" File already exists and will not be overwritten. .IP "CURLE_TFTP_NOSUCHUSER (74)" This error should never be returned by a properly functioning TFTP server. .IP "CURLE_CONV_FAILED (75)" Character conversion failed. .IP "CURLE_CONV_REQD (76)" Caller must register conversion callbacks. .IP "CURLE_SSL_CACERT_BADFILE (77)" Problem with reading the SSL CA cert (path? access rights?) .IP "CURLE_REMOTE_FILE_NOT_FOUND (78)" The resource referenced in the URL does not exist. .IP "CURLE_SSH (79)" An unspecified error occurred during the SSH session. .IP "CURLE_SSL_SHUTDOWN_FAILED (80)" Failed to shut down the SSL connection. .IP "CURLE_AGAIN (81)" Socket is not ready for send/recv wait till it's ready and try again. This return code is only returned from \fIcurl_easy_recv(3)\fP and \fIcurl_easy_send(3)\fP (Added in 7.18.2) .IP "CURLE_SSL_CRL_BADFILE (82)" Failed to load CRL file (Added in 7.19.0) .IP "CURLE_SSL_ISSUER_ERROR (83)" Issuer check failed (Added in 7.19.0) .IP "CURLE_FTP_PRET_FAILED (84)" The FTP server does not understand the PRET command at all or does not support the given argument. Be careful when using \fICURLOPT_CUSTOMREQUEST\fP, a custom LIST command will be sent with PRET CMD before PASV as well. (Added in 7.20.0) .IP "CURLE_RTSP_CSEQ_ERROR (85)" Mismatch of RTSP CSeq numbers. .IP "CURLE_RTSP_SESSION_ERROR (86)" Mismatch of RTSP Session Identifiers. .IP "CURLE_FTP_BAD_FILE_LIST (87)" Unable to parse FTP file list (during FTP wildcard downloading). .IP "CURLE_CHUNK_FAILED (88)" Chunk callback reported error. .IP "CURLE_NO_CONNECTION_AVAILABLE (89)" (For internal use only, will never be returned by libcurl) No connection available, the session will be queued. (added in 7.30.0) .IP "CURLE_OBSOLETE*" These error codes will never be returned. They were used in an old libcurl version and are currently unused. .SH "CURLMcode" This is the generic return code used by functions in the libcurl multi interface. Also consider \fIcurl_multi_strerror(3)\fP. .IP "CURLM_CALL_MULTI_PERFORM (-1)" This is not really an error. It means you should call \fIcurl_multi_perform(3)\fP again without doing select() or similar in between. Before version 7.20.0 this could be returned by \fIcurl_multi_perform(3)\fP, but in later versions this return code is never used. .IP "CURLM_OK (0)" Things are fine. .IP "CURLM_BAD_HANDLE (1)" The passed-in handle is not a valid CURLM handle. .IP "CURLM_BAD_EASY_HANDLE (2)" An easy handle was not good/valid. It could mean that it isn't an easy handle at all, or possibly that the handle already is in used by this or another multi handle. .IP "CURLM_OUT_OF_MEMORY (3)" You are doomed. .IP "CURLM_INTERNAL_ERROR (4)" This can only be returned if libcurl bugs. Please report it to us! .IP "CURLM_BAD_SOCKET (5)" The passed-in socket is not a valid one that libcurl already knows about. (Added in 7.15.4) .IP "CURLM_UNKNOWN_OPTION (6)" curl_multi_setopt() with unsupported option (Added in 7.15.4) .IP "CURLM_ADDED_ALREADY (7)" An easy handle already added to a multi handle was attempted to get added a second time. (Added in 7.32.1) .SH "CURLSHcode" The "share" interface will return a CURLSHcode to indicate when an error has occurred. Also consider \fIcurl_share_strerror(3)\fP. .IP "CURLSHE_OK (0)" All fine. Proceed as usual. .IP "CURLSHE_BAD_OPTION (1)" An invalid option was passed to the function. .IP "CURLSHE_IN_USE (2)" The share object is currently in use. .IP "CURLSHE_INVALID (3)" An invalid share object was passed to the function. .IP "CURLSHE_NOMEM (4)" Not enough memory was available. (Added in 7.12.0) .IP "CURLSHE_NOT_BUILT_IN (5)" The requested sharing could not be done because the library you use don't have that particular feature enabled. (Added in 7.23.0) curl-7.35.0/docs/libcurl/libcurl-easy.html0000644000175000017500000000443212272124467015353 00000000000000 libcurl man page

NAME

libcurl-easy - easy interface overview

DESCRIPTION

When using libcurl's "easy" interface you init your session and get a handle (often referred to as an "easy handle"), which you use as input to the easy interface functions you use. Use curl_easy_init(3) to get the handle.

You continue by setting all the options you want in the upcoming transfer, the most important among them is the URL itself (you can't transfer anything without a specified URL as you may have figured out yourself). You might want to set some callbacks as well that will be called from the library when data is available etc. curl_easy_setopt(3) is used for all this.

When all is setup, you tell libcurl to perform the transfer using curl_easy_perform(3). It will then do the entire operation and won't return until it is done (successfully or not).

After the transfer has been made, you can set new options and make another transfer, or if you're done, cleanup the session by calling curl_easy_cleanup(3). If you want persistent connections, you don't cleanup immediately, but instead run ahead and perform other transfers using the same easy handle.

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_easy_setopt.pdf0000644000175000017500000044254112272124470016152 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ•YÛnG}×Wôb< ÄöôÜY, 'Š£ ±¼ °ÆpØ'Î0s1ÃØ_ÙÜS}™ E'XÈ0)N³«ºêÔ©S­ß™ËséǼæû«×1{n¯\ö|õû•P™yÉ÷ìÍ ú`µ½Òß,öXœú8yß”eÖž>¶²«Ý“ã?-XY¬éÁbé….wÝØù)«ú¬dW/þ½úájérO`÷ÆSçiHöýˆ­~¼rÞÝ,^Á_<!S>­6WÎO·‹Õoo=—n̖£Ç.yøÂAö_†7 jÙ¶nX¦üb´ˆí²jSJ½íÄ%YŠˆ'Êîã¯ïîß?Þ=έ«%ʲó÷¢ÊË~#Ù?hç×ôßý“–{:Ð7??ü˜×Xð2"ôˆ}¥ý¸fô›öÕ¸|ÍY“íe'›§Å×ËŸøùííã7wïWw÷ï¾äjÀ“P\ Ô“ƒD-ë[¹a]Í:Y–6±lWÓ†1÷éËÈJšr?tZ>8Çnû!wß©×*½*w~Àc׳ɓ»Œö@âE¨öðy”¸Â<ý,gRî%iXü6:§~²?Ûýé`ê\mQ=³n'Yv84õ¡)²NéïjášÈ,½± ÄÊó°Ðú€ ¡¡jÅ<ŽÒÔ8}¢U¯‚GÂõôz¯|ª{–gË‘ågiƒújº5Š-ÆízÜзA Š”§©;Ÿ‹ºQˆ`Bmà!d5ìð›qƒˆû¾›Ži—\”¬‘ªFŽE·£È…HFM²ý¥³:Ly ›Êm]–*Ì"ᑟ&æã#`µ>±ì<~êáÛ‰MÀx_ ì]¦Ž¾:)V¹á< à¡;à«i<˜œf/g—uc5©Œ¬¥u(5{›4 m˺zVeüÒ8Nç§»Îãã^°n¢ÒW¹*ëC]Tt¦Ë»FHc¾Ü4åa¤Ö­jîsLû¸Ö•zý›Ì»©ÉöÞfÄ…óDŒÓE©j¡Þn?v_ð6ðçt×›1*èvyզБD¾Cî6Ý‚»^¬[ bs¤ Qí¶™ÿÉ D™T€pcßùº–³™¥v૽i5@ñ¶/K ¬ek<,ªCß±Ï / #…NVö’VŸ°7P(àE×Te¯&,•LX Ј>K6©Ð”&c!zA¶)Oc¿Ò° êoØ! Ó)%Ôær?QÙZ}õÁ¹7ô1¡¤cæ´¢¤€ª9HA±ÑðÚíòz¯èºÉªv+›–dƒ{pEoˆ¼hU~&”á'²E2vðP{7¨“ÌH/0„OQ±4ç!V#oÄ&JÖ„)«º£ éˆ#·´$¿Jž [§ã”}ƒX¤–þFRÀÖ²;JY'¿fmÍŠ-;Ç… •&NVu¬í×­ü½—x;ÆI|SlUl|×çÞ@x޵ú@.Áw8K$2=е2·ïÛÎö&ä~?: &¹†³‡F‘g©5 œվ•¡>g6é3ë,ÿDÊBñ)í~S|~p6r«c€’ÏúRìКSaÚ,üØ!ã£Ú“þì(hÃ2ð‰ !ŒÓ™ÍHÎcׂÀdÖMd9ó kØW¯€ ÕëPzÂ≶Ð<ðÜï‘ Ä™“ׇB7A ,öj²æô5~é[]sÊ^ê&C*`µÎI½l´—ÆÂÎPƒóƒCb _7„O)÷c^‘:]m•·¡6´Ï8°¡ÐÌ}!¾œæØ]4d[Õ5/QG¶h*@äö\RKBÓ—’ŽoÂ÷çÙF²Û¼)ÖrcÉÇðàFvYJZK­'àyd¤#(×ÒÜ‘Ž/̓!“"ˆtˆÞH° Q‘AäÐd"æ•{mB²’¦Âu®8»«ÚN·ITÛ 6•‰|Í /3ejÀÈq’O‹”t„:RtUeÃ࣑Ä`תãÏÓV/&á/ÊlöUW r\÷ÑõÌ#Y¢P,p³’r#•Û{gŽ{5“u uç:uñH…†¨N4S£Ì¶©÷/äœpÁ þT?(¬UaÊqf#‘r£n^lÆ®FÔn›þ =¾°%9àYl¨Æyi¸‹xƒðqûýÍi8cç—»ûv¯Æ¨Ç3ú˜Ì|4©aÑÇ_nÞÜ?ªÉt|ŠÔ˜â|”ZÑŒº…!è¿góÄ}´)ÚC‰bÍFH‚­,± lÖ5TKQQ{Ô­?[×P8E×¢`d£>k¹™0c…Q5¿ÈažFzB‹[7 ´“°pC>©î<°\µy_1Euu^—¨Çõ#·jåýó3q–šTS—)‰Ç€6«³n‹²4^*g†ùfZZ“ü nW£.±·ÑÊI¤Ž '/±¼]/¼$‚ÚŒœ¦gCˆ2ß÷†öN.³ý U΀£Kû¶âlbWßÞ><Ìl@HB(…±ÌF`˜…èLðÁ65Š‹jjZœ¦®§Ä©Š½¢Ì+:L^ŽJ敎U®é^\Ïú¢á×™8M‚Ú1Öp¿½ÔKÌL˜j°:YÙÊälL è¢Y—ö?ïÓýÇ!ŠDŒ:E@múܪW­A ûº%Í`=P( 3L‘Ù4Ò“œ@Þ*Wh¾ÂãÑ4¦Ž;´2XÔJÚ=Š^ˆƒs  ýóëF UÉkñMî b§86³K*wö{T®¦>4mž Ô ¶xûööÍŸß~÷ó»oÔEΜ€„ï _5ò%@Šü0ÜÙ¿¿½„Íì†Q•îLF»9LÓ5¨W„–*8Æ¢¼iÖ’4"œ‘–½û¢wè•ø‚éãëzsbà( bÄ þ©‰§‘¥…™î†>ÊZ¸Á_uC£k}ÈmOLt­Ÿh½µð9Šey×+Az~ÿD#^`%Ãh7)Ò£ØõÍ“:$Ê´‘hõöºi“u{rÊâ“¡ŒÄ˜¡ØAøûiÈi¢· X­Þ?-4yjš˜2Ds†0¼aºñÂ91Œ}f¤ˆé%ሷw÷ï¾¹Pºûpûø8ˆ¬¼Ÿ&$™4=̶­jYDÿwÛ.×èM—!Óîzjo™š¯1\£'›¦Ì%P!®ˆlê‹IY~ƈÙW_æÔûC‰wåiº)ò7Ö¿Ã JÇuºãØ(<¤ƒÆÐ,„I ¹]Îà²ô1nxÁpÛüEÁL—e:*ŠrÎoÓ|¨ôEí#a‰/•`Åj”ƒŽè„$vH²^À5ã4¼„!‘ú˜*â?ÁP¢ÿ»âO5wÂd ŒˆnI¨ š¡¡Dˆ ¡„“¤ÞegóGœð`¬-ͽŸéBniEO…¹evß;ªEíi_”ÝR·”)25xjð#g<¹ŒÿÇ»·ï~ +àæÇÿý"¾„~`ž¢v=„Dµ6 Ý:ékÅáêv Dl>m§½ÍÆT—DV_­b+0šÐxÝϦÍ_2@Kt¿rfÝXü…‘asÃè8ÈÙXSŸ²¬/д]5èM[§k3G2 çÛ[-º¦*ˆüw4daifî‰=Æ:änÄÓÈ%Çý”‡ÃáV˜.–Ý®!&õYü¡]öˆQÇñ80ç˜\–µZRR>ÀQ¯U>ð¾+ö’”´½§]~­T"}Øí'ª.[eæÔ\_í%<±€ ‹ZFÙ¤ãpý£ÊqÖõÐȈ‘T¾ÐøŒ2¹¬ Ó/C×užœ›ÍFOÒè]®ýk["Ônl†\[²èD AvM4!zÎ6Øâ‡)\üd¸ðÎ*æ=ê‹þôÒZÐG·««áç“$Àäendstream endobj 6 0 obj 3007 endobj 14 0 obj <> stream xœ­YívÔFý?OÑü²&ÇjÔ’Zþ“cŒIœöp²»cÃik4ÅIHŒ÷xÞqow«õ1˜ÍžÝ 9,uWÕ­[·ª”OÄ¡Œ8òW÷g²=¿ É]3sÈÝìÓŒ©‡¤û#Ù’ ¼É,Ö3}†‘Ð%aìÑ(&‹íŒ¹u8Y<Ì–V²«ó©h?6i[Víµå]ÏIžÝÊsÛåuœÐz-ŠÈÉ“oÏo¿Í`Àö²XÍ»L_~¶&í&kÞÌÊ‚à¿pŒˆbe hÈmšävî ™µËò–ˆ©çÅQ…4häÒ†T¹HR:·¹Ѐ1ë¤,šl•Ö€ŠÅ4ŽÜXBµÊŠ»M…Zb 8Eš]U•uKÚ’¤…¸ÍS…šÍ<gƒ>:m-’M]å®!//®H^–÷»ª9”á&›î††Y‚Ø l벞€€¸ãˆûÒyé Þ!MvWˆ¼¡Ê¸ë“Åù̺JÛ^ÏÀSætDõù‘Æai¼¿<óvññâÍÕÙ/s75‚À:>W÷ ôŽc@ô'Òá fF¶@8Å!¤G£‹7ÚÊåÛ`DD}æ².+ 1¤KI8ºT\r=FÃÚÔÕ¥aiXKÜT?dMJ2ÔFÑ’ÛÇñõ”F[?Ê$ÃÞX‘•h…ü‹ M™(¹q„hz¹®«l Ô´Ô]’—Mº"Y!o×®u‡z×?Ôè)¯òíA“X2…'±I×s—ã®o­;šÅ@s®äœº¾áûçT —fßzâ[u2®…¦tÅà4;ÑáÛHKmÝÝé’ï/dÐ(ŠLÉßöÆ V yôU‰Y’œ%¸[Vi-$%æ¶V‡S3 ù~ è¢ßÀÑŽ#æÑwƒs]Ȭ$e]€„‰h¤˜  4gyLûb²:&»4<Íê@õ;·cƒ¾Iü <qÓJá߈ªJ‹CØ,ÚZÔ ùJ¿J›¬N)9+ˆX­2ÙÂÉ®‘Ò…›GÚå"5Ü]‹×ñ\5Î8²Þ/~ýx±8ýñ{âÅ(LGèÚ÷"†¿IEô>¬wE¢x©ûç^2©÷‡‹W ¿JÞ|õþâdqöæb¿D9ÍV„ ARBæÒZÈÊX§¢ÝAÀd‘ù£™ÀÀÒ®©¿Z¼%«r%Eµ„,/ÅJOQ¥ib„ëa„4Ì} ]£S\éu¦­ã¡Ñaü YÜËP¥k™¶º\í46`†L%f½V|Ý<‡3ÜzhŽÌH¤,˜{zÕ°~²{+h³Üýjqzyvõ»|&5¶Ÿ™—Öº­Žž?OUŠ­/B’„&åö¹Ô÷ç¨òÍóìØ€±–´¢í—vZ¨. 5pŒ^^˹ƒè7^<!ä£2=ǰ§YJI†eÎ×åV%¥.Ë–¬ ôI[ÖØf&X£÷F# ~¶ß p£ž¢^^ÞŸ^Iþ×Ç—€2Ю/éw»´QIØŠú^׎¤Fæ˜`v3íëÚšhÆ¢hˆ*ý2ŠjÒ½EÒ‚zeª'ÉFÔø;%Î-ÚÍÿn@1nôÌýŸUmʶü™þY¥w£X†¬Ùr ÄÛˆKûÅb4JÖÒº<žûŽvää÷Ó9ýÛÛËÓ«+S˜¢‚ ŽGí‰u"&;Gž®1?#âѬÚÊù®ÐÝÝX\ ƒ2éd)_îpÀú¥ÂRÓ(=“wš¤OÎWÐ۴ΰ `šŽ½1ÒÈûy3F .ÙQ?2Ç3í¡lL°3 ª´›üºÞztn'Ty›ŠBiqчÚï>2,7.æý–t£HOíþtÄ=n@Þ’‹Ac sø¦Aëú #ÿdõµ=©¡ÑþÂY¬ú"Ð÷÷ÄÑv¤JÌ ¤âê›éÕx]à½( »`œHûET“¹é¥N“âáhÏP<,˜^¯©KaÿóØþ‡ó-¾™*÷ûnl•µ~ÖŤ@—ëow¯¾ýródIøþÕoÉxbàÑP Ý|?÷CäßmtüQ·ÉÓ¦q4Ôž¬]î0<÷–Ób·UûQYLõe’ñö6?£#k!ZU/‘س;=¹Æ.~,Œ¶‹ÒÓËòÁøÁÄR¤°˜`–G{#„¬‡a_•cÕôŠis:ºÙCBõTÓÑá¤k>¿ank:ÆÊÔŽŠñªÔK²[Ôé¾ÿþ#˜È‘­ï2àîùL¹¡ÊCê…ã¢<ºÂ]âùºw ¸˜ÍL»­D’î¹0éÇÿö´È+½NNNÇÿÉÑUv—íÍ èR>ú,D)¤ÜéW|«ªQcOŒñŒ›{‘£´Þ;ÇGŠô£s·¹(î÷Îɯ†uî®Õæ¿°÷å |¤Aóœîáà äáP7KûÙ‡½ö8<Ú+OLA_ÍDR¨_¬8UeÊÕM~JÆjO¾õM@MÌßÉÁüm){v@0ã|8PM¸µ†ï>ø:O[\¼÷Æ‘?Q]×óûÏDÓ®¦]—ííáÒÿjWWe“î×}â\^_ãß›küsƒ¥ô{E hì Š–þ@†›DTi7¯S½ô*ÍÆæúú [óᨋÁ{µ·ª&½SË÷m9, Õ§çý¯sß›;_÷B#ÖÞòn6ó¤,š¶ÆÂ‘®”„Úò+óþ§ìÎË#UxGá~øO1›LK, jK}¬häwýUࡃvÿ/C}2 µ0˜EX¢KH.šµgö[‹ý6&’7t+ â:Lô¤X›®üÑébö¿þ+r¿endstream endobj 15 0 obj 2758 endobj 19 0 obj <> stream xœ­YÛrÛÈ}×WLùE Kœ`fpMžd[[ëµ|‰LW²‘R*ˆŠˆ € €Ör¿Áîé™@i]v*¥ŠÄ\»OŸ>Ýø…\°ÿìç²:ùËUÊݟüv"ÌCf?–{±€þ°XŸÐÁRÉÒ\ñ,g‹êDHÅØ-N®ƒå¾ÝÞê¢;ÜvºovýM nfl[ÞáƒÙ\Æ!Ã4x[ÔûbËž=û÷âØ2‡-yã®*a‹Ë“àåùåå‹ÙéÉ<äI(Ùby¢R®r•‘«“àüålñŸÉS•áCsæ™}øæ=> ̓œ§i"탋×ïß}ćÃ5ç*á*ÍS6Ò zùéêòý‡Åí?®^/.~úôî%NÂ9p›£$~ð‡Âo•ó,¦}Oâmt+Ø®)ë^·¬oàËz_/û²©Y¿)zVýr£;ø¢ÙºÙns«Pr©a­Ä¬õPÖ÷l×6}Óvú¯t‹ÜÞ"Éy$EnïÙ•èÛÞïu°å¦hÙó]ßâ4!$3g­3s7°-Cå.ò8"/ÛµðãŒÙ/u¥«»3öen E”M¹bÏ÷nWE_ÜÌþfýꡔňÚo±)»Á ÷ºïزØnõŠÝzXѱ®Ç…±M«Íí2þˆa”ËÀz¸/kõR—OE)À'v;Ñš8ÊÈa2˳È>\õhB®d&ìôS­õªCÞiÖ“-R0•’“Â'Vçl>Fû±fmümŽLØX™¥äR:«E ¥[ÚúndÔˆKáœXvG“a{¨q4;5f ÇÕ~Û—»m y(ûÍÑRs¥"ÇÒƒÞ¸)®b…—Ö•ϲÐÚî:8+gJÅ\‰<è *Œq¤àyæüBà(rävËê¦G+ÿ¡Û†AÔTe]€8»Òý¾­åê}uñv¼;ô=Ų†ÙX_|6NJ «(º µhÎ^¯MôÓòÜãJðP Â~Q5ûºg«r=“ŒÉ²`­[@oÛTæ$vÀ®è:râ¡Ù·Üg¬ìOÍ¥%¸2IsÒ!]nÛ•÷5cQ3ݶá\ -ÚÙ˜L,dÌc‡I¾À d¡<õms•E€á!V,ƒÀŽÅ]Óöf“¾-ê vмÇT°xî|‰ÄxA´x{qu5‹lð¿¿:w 0ÏÔÜœG"„€6eD>‘’ò'´dÊEÆÃ3bAG K° ŠáÆß~°ñ›ø“QÆ£ÌEÉù§Á0³2gÜ‘Èâã{Ø”Ë îV3c’eÔÅÚ²Š¥ã&x95Ÿñ pͲ©kmIaÙT kL?j}lÄ$åîxC4ã)Nâ2\%¹c¬uƒhj‘ÙJ÷E¹í¬=áÖc¬=¯Hµ*C–V1¤)ž(\ ñ”ë Z÷u«¬¢«]˜%1xŽ ‹ Yð('ó鞬)ÜZàݧËKü¼×„+“íÕ+½†.r8jæ e¹-àbbÇÉD—Z&㌿̱ævÙ)ÀÁ…z WL?½¾¼`ÏÙý45¢2Ãcæ®DE<Þ7‰¢Z ëˆWvo XòX: <_Œ3‹äó)..D(’iP%° p °®9†Ÿ ]üb~ž©4@ÛE,ˆ+¡Ö.ÚF¤ˆEp¿¯40œÁ.Nóüêi J³Ïÿ÷ÊOFW&¼9ô£ØDDÄ&"ý]±ü<Å †ƒeiÕâß@¾ìš®+ïû 7`dYÛƒÙ :€§žw¿4CVñÙß?ó¾R= ŸÎØÝ Thž‡2Ø÷˜ Ú0Ë™ç„f‚r1ä ³æJwÖ*JkЧø#èOªÆÁPG°†¨È… ·8$Ö«lPªûóÜG¤´Cºn_w{Ç!M­ m`.s¿õ›fßAÒè(l«â÷²ÚW.6ks $‚Ô‘øÁ‘ó˜nÔ¬6>QZ!Ïα!Kì]‰O­áyI y”oØF+`F .#‡q§KŒ”ÌÜhñœrÖíÛóÚ´õñõ¿.ØM€K컽etŽL2bØJ$onfF" ³6ñXl8RxÐS£¯‰p*½Ù2³ÝŒÑž†›K.ÉBÅ6àilRŽÜlN©>• -¼83øóÅù«‹«i8¥ ³ ¤Æˆª (ÆÎlBì4¸ÔÙtL Soœ9 Âßï`Ô±`´[+*ㄟ‹OžMÈ„çÖDD唪@âÏcAy¢8"úÀ]Æ‘%R¬¾!’ÃaMø„0ývÀª†rÐd.$àWi Ð;÷Ž˜ÇŠÙkA ‘¿^ JÞ(8<¦³&U²ßë,²Pt<æk r!I¢§u\ŒŽ X7Ã×E¦X¢Ì3Ê×%U™î˜p€SD>Hï…(úȰ¬wûÞŸpÕÔV¿BôCIpTl•uÐïÇ,¥B8±%raÑ%ï8Õ¾#Á ON)5ŸZ‰ÁŠáyHºý&X0 z:Ž¨Û¥ÏÅ9âjœÔIê«Öïª{_”PqðC âAESÒƒ¢#ú¶„øx·"“¸p¥KµRtTº8(S‰Ôõ«r©Ñ°ƒÝ]}:ÒqxÀÔ¯¿cUú5Ðàr AÇÑHU$6Ž(Ng¦¡%dÐbö@ˆŒº «V’½º¼48u¶¨ÜÎÀ;vË·Ÿ>.¦®Pž8õµŠH(%?Í ¤‚/ž¿ÏÑPr†¾U`nãS‡”bbêkL »6†-(rôLÄÁï;Ý–º^BNh‹n£;ªö‰° fÃŶkØçº¼æ(¡£!NI½ö “5[äû"âX^‡ ÅŽ‰±Iâ(Jä´™Arž ýpŨY† …Ç›)пR=)lçNØ”ÍÈþÔ‡uðêÜ•§VŽ%ƒ2X¸gbzRX!о‡b b1¾DWŽhð™Ëqάû¶Yí—$“@ãñ”PAâÂCùvƒíÍpÚܱ3HßE¾ŽÚœý:¦[Œ›$tZßµº# ª)§¼N=ÌG­MAȾ]ß´®þA‹èªiÆ[®5ŠÁKÛ®" cÞ¬ç(AI£SºâhÔi4=@ꃖ`¿+µZì¸NÑ,ŽñµŽš´‡€6è­.kÅ㟮€˜jGG~¶kõXbßêíá”g%‡šS¯áÂf>Ä„bLí ˜®ýHDKÄi Rl[~&!–#cºän£ßüäm.Iuµgû䕤Dß q¯A@Þ°nˆœ˜ç¾ä—+€$|žÜï¶ Dë;ס®é™ýy«þ„ʸ™Yq ¡A­(À‰·>ßÒmblÖålŠÁXج–)ëìrß=cC™Kò[‹8¡Õ]?y%a–†%µ[c¬ä¨ZŽR¶Æ\5•v-* ^1hªØ–¸ ³s±j|¼úÓMh({U2±O[·ç/Þ_I)ï'ᆉkÞ>dv-H¤T•^•sÛ\Ú^v= Ò* *ZÒ¡çuÖŽ_ù m7‚Ôî}ÀäØ`:ºˆv!Õènt§‹W·/~½¥· VmPOß^MÞ†VfDƒ¤}sd¤Þ¡_dÞ3,›•^cøÈ¼ ÎW+C3¾$“=<ɵ¬çØ• úÃ%7˜[ŽDŒ„iJ9Š_Æ9H ¦„x TÌDÆtÝŠ@áO‹“¿Ãßµ+M5endstream endobj 20 0 obj 3141 endobj 24 0 obj <> stream xœ¥YÛrÛ8}×W`òb*e!xŸ}r§Ö3ž8›ÐOñVŠ– ›ŠÔT´ú‡ùè= IÉÎlf·œŠm}9çtûwæsÁ|ú²ß—›Ù« {èf>{˜ý>ú!³ß–ö:Ç‚”>È×3óŽ`‰dIð4cùf&dÀýˆåûÙgo¹k«/ªè_:Õ7ÛþÎ îæ¬*ïéÁ|!#Ÿû~âýVÔ»¢bÏ®žÿ3ÿe†AÌòÕÌçQ hsï]ÛlXÂEÊýsÖ?*¶ÞÕ˾lj¶,jÖª~×ÖìÍíÇë///Þ¾»}ÿæË‡yþ¯Ù[À¼åL†Oã7À¾ÞÅ-=ôéÀUÒ,µ>]²ýc¹|¤3j¶/+Zì:…#ŠUY?è=e”ñ$ŠÙBHm¥¶pMöeÇ–M]+c\ß°{µl6Šmi—gŸ”¢=^}¾ók’Â2{þèý‚qŠ^ï ÄYfׯ›®hamËVª/ʪãf}f×/dìs°… õ¯w­¹ crÀ¸µ\ˆaëŸ÷£ôbažÐ‹¸2¹hÕÀ+,—`»mիÛìºÞÅ…â¥o-}ɳ$÷Ñ™ãý»Xö¬Ø4»ºgÍš­Š¾À;E¯_\Uu_,¿Úh ²g!ƒ”aè"àí‹ÑVÁ£Ø—æ ßdfÝÃ*xªìMHï©+WªU+}Ê5RrKÇdm×9¼pfX·#õ¥qÚÕZûIo³ÅÞmáÉÛ!gÞß^_kƒWM}¦Ç#©ƒ%²;…6D}7\;ã"‹};lŽ»ÂƒØÜÔËJ­imC†“Q‰6ªØUxƒŽ'?P®F×3iŸPg=交ßÚø ÝEŽEp‘Ñ÷¹+å‹ãº‰‘Û¾pu¦‹d¤’'nã­çO¤’Ð'†Ü¾‹¤¥‹œ] '/`ù ¨8©×¼¥ËNB»-ºŽ¾ë¤«Ô±¯áF“„8XñÄ9¾Æ§Þ!À˯nÞ_YHBL[ 0Gœ›‹Ç Ï‚t47‰S*:'ñìsfâ3ª‹Ì—‡\@ì ¬ª·»~0Y§*¥~À%mÈõÅs©šÉ¤alÕ²\Xa<1TÃ=-Ïž$bÈÖ$ µOw”«]Oë[UlŠ™‹ù(ì=MÒÏ%¿ÐìüYªŸ›ŠÔù©ñ Ù]°osâî2ñŠª\é7ŠûjÈè;oY`)Bj®•tË@J:ßk&·w ŠÍ^žÝÍm*’Ë \_Û{Ïæ!“H¼–*ŽªÌ+E¢@)ÕH¸·Œßn?å:‰ mÓ4‡Ó ?–C~äîQàeŒŽR%'D¨}h’M_ntµèyþò³—KØ^gV$¤G©º†}­íò4I½}íP¸©€Ö¬.6êôJ"“\ÈSиzO2à™ÒÑS¦Ký Ixçý”‹0M—qAb‰Î|\ŽP#”ÃÔ• VZz,‘ð8Èêí…S&±$Å`J~1å¹I€gèNÚ ¦„çuå”ðÊ” A„m³Ú-Aze 9c²/…Š##ž"áÕÍ›üzšd›>7âî}(¦ém+[r?Mw”¢,FvÑ<¿)úå£2 ³nª ñ͉0öö”éÛ¶é›þ°U?ÛÐ;m#“˜ûa8ÑNe£ÚvØýN_ÃW ý— ìX7ˆç½|¡Wêœ0šwuŽ‚Ç Àû$ÊœRyªÙeUªºßÞÍÿF z8 V”ð(OØ 5¨?S@lñ®¸÷¤±:HT<ÑZ†ŽaŸŒž¦Va¼ºY‹[ÕJ­:#C ¡Õ¨«pB[´ÒÏgæA;Ø–.­A«yµe™×Üëc?ö¥…¾UñDŒë;U­9{GŠ µlQ1ÖY£aLº Öäý9kmrI“ÔØ393‘¢Ä)ƒ¼Ã„,kRçúbÒ Ã DA»Š1î KÌ]…GuM )L( œLSñûNu ¸\oJ»‰ ï‡éÀGI¡½=ÚõÈfÏØò?šÕuð¹ ŸÝkHÈ4¶}Ô~ÔÕû{eýá6'5øá¨N¢‰?U}¹Ðj¢ØQ³Ò—ËB›O¹Ò@‘½>hÑçô,ñž!8:õÚ !ò¶hpTžpˆÖ¦F…òù"ò}ïλ1h]¬V<̱íf0Þ»íÔüìš§Yp‚Ÿ./ýÙD< ô¡ÅÇö¤ŸÚf.,9|ƒ€‡±ê+\õtÈbH§ä/žîФì¬DÌ8,:b8øÇJ…Ñm®¯(ꆚ S¸Æ6Ëðñ÷àõDibÍ ÑŸŠÍ³ðOQ˜Ö$Ï¡0á€3W³Aõ9”_ø´0E´ø±ƒÍ2p¤÷°Û í(èaÙ,ûJ#ØÂT¼¶a(;SçZÚ}Gú5ýD<¡ñSþ‰€?§ä2HþÚ ™0«+ɸëa5íû±ÄѦíŽ4Éà¢"ϹÚQ$‰™$ÔJµS¦âò¿ìj ÓÖ R#† Ò¤ OüAM“++}/Ý ±õ“bÓñ'µó”µeíiò„`‘ÓCƒéù°3üC%nü´Tm_ XÛ¦+ Ô¦®íƒa,]¯¥L刂JލÇvÕ´ï¤qA—±nÚ½ù ̼‚ÊQ7‘8•ú§¹²cä–CM$©^Ñ8`ŠþÈðÄ1€yM߯G|5Í€³Íi£ôʵiÀÛùkån=³Á—ºP²H³#¸pјÀ…íýÿT—O‚Ý#¬@[q6£ö>Ž04íסé§O]ETåWƒQ”ÙB8êiõbªÞü$4¡efðG)ð‚Œ~Q™)ŒÅr©¶¤À¨(Q™ùñ®aâZàóOSy‹ÌÁ½ŠâÖê}.ß¿ÕýžK"$ŠŒ{ ÄZTF¦Ø 9 $¡kÕHY]ç|¸{x’ÿµØA÷ÕøOS@wt„‡©–¼ýŸ+# Yž9KG†®úûé|ÐÆKY2Qj‘i?{FÆðöåæW3WêvKRTçL°Ó%ïæI€s³À»¸ºÆê¾±s\Ji[!ÍVµ…Ai£NM!¸Áí¤òÊŠÂ+Ÿœòæâ}N¿˜H"1­ÆÞ?–•²óC@ÄzÀ6ì¦Ðe¸¹¸9ž¦«ö|ÂV)ÚÑÖzPò"êÍÎγ÷•‚z]Üt%~1UÕOÀM ¢»†rƒØ9íäç&Åjá$¼=Eh‡Ø–pé®Ü”ò-²(?Õ{ô–U™d§ˆ²‰Ê|‰ªçî²A:…jP;›…1Ü|ŽÖXŠ ”-rò#m¢wlU¶jIé ‡½xRŒç°~Òö˜á2JWȉ` $éÕȵ2ÍZ–¥Tã½]ìxôƒþ ÊâxÔ„»â@w\Ÿªu¥þ¨4ª·Ô4L”4GÇ ƒ‰®£Gk9º;tSpÆ?UÉM÷{V›§Ü·rAʣ洞å ‘‘ºéëwÇœ±Y4”i ÄM:Mü褦„­qˆ‡¹ñ“Ig8éû3?ÇTÏ :ÍÜ-Ó€ô™oòõOGŸúO*!­¤@¡“.PýQA!ÎÎaô©]ã ñ\7^LW©oÓ=ÈŒFP}a: DÙ¿¨¿ÉLH’^ ¿ˆ_¾“B@ tûæÅ C¯äÞé£Ë|ö|ýÆ"À,endstream endobj 25 0 obj 2943 endobj 29 0 obj <> stream xœÕY[oÛÈ}÷¯˜·¥Ö„3¼oÇ d›Ú®£-ºˆ ƒ¦¨XDjI*®úò£{¾¹‘”%;ÝfŠq, g¾ëùÎþÆ|.˜OÌÏb}òê&aÛŸ}<ùíD¨/™ùQ¬Ùë¤ôÁlq¢Ÿ,‘,Éžfl¶>2à~Äf'¼bÛ¬îʼÝݵeWoº[/¸°Õòž¾˜LeäsßO¼¿äÕ6_±ƒ«'ÿ˜ý|‚¦AÌfs˜…½[ïjÓ-ëŠåóy9gËŠ%\¤ÜÇòÙ?OhéTÄ<¥>xç¿Ü¼»ºžÝ½¿:ÿóDf<Ëdâჟ~¹<Ÿ½½ºT'L]œ¨g%=é]ç´›OŸf<à*>< µsmËr¶©—UW6¬«ñËb[ʬî!ïØ:²Å/%[Ô«U=‘÷E{Ëê#Û4uWw»Mùƒ2àÕMf¢*ÉÃTŸöÁÃönß[ïóDø^½œ³ï‹Õ²¬ºÍ©¶^¦’³\E²­‹Oä@(pª/ù‘JŽWvw ùb~ª~Òz²‡m¶ ='dƒĸímê¶¼üImÈe¤bÕW<‹"k2= éo7WÖ©b³8õ…Ù­\ÐFø(F6ÌgùvÕ"ZË–mò&_—Wü²­Pœ½]0üÔ T–%r)‘ã´Ï“X'Æ¥ácÙµ¬ÈW+ÔÈýÎÖË*cH‹ ‘PE ·ª“Ö³û‰ôu®¶»/uSªŠºªÊ¢_ÈÙŒ>ÅÿîóâÓwÊÝ “\XG•©¯n„o55ßÚL!ÖY½ÊF3y"²Loák§òfB."á}Ü®‘z¶œãßåSaåD„º´ÿ•3û¢ðÒnYlWy£½¦>ð%ymëo`£9*Ce$uuÏì×ë‹»·×ç¿Û+DÄS“F‘¨ú¢“aÉRåÊuWÀç™÷¹4˜L³44_¬v¬hʼCÞLđΖaÇvY%º]"{¡iÀ…-&kòTz r•òÁSŽœMß;?¿¸ž™XwbÆÂ6L¨ëJ9ôÓìš=>”Õ°¨ÒUÃÀ»8êKLæZ*Üí†=.»v}u3‰üÔ¼Ù«‹ë÷c·hrVæ :ºaŸ•1"F ëLÙ´ä¿Á6êšÔU½>æ´eŸX§ÕþcÙ”•®JÉU€aìÐm\вïϼm{€šª[ß·®l@ Luø<ÌT|~Úv[´ÉgZ‚Hd&ø>Í´•ÆV/\/®ók·›MÝ0©ËLá¶hxT1Ù¡ë»*ŸÞã 2¬·iDð–Í˶h–›©FDmÆ8KM¤¨ˆjKÊÆ’Ó〠=5yL“ï€Íëªdu2eÛ–iu.h_ [ø lÏÏû¨J ·YP-aiIÇsvƒÒh*3»YB4²9òo½~;”±L… ,%’¶ûwÙÔ0xÑÔk2P×Ið¨o"@3@/¶Éd(Ûv[eÛZ+0Êí.烡V£û>RÄ’mÕ”E=îmŒÜ$H_èm2D¡ÉïWÀ­¦©]iÆps_öÎ#ß”j¦É›ŽÇÈïÐNêbE(7Âr‘*ZÕèàîá›HW¡ ÅÅÝùÕ/ïÞ\Îðóòòâ|F–DúäᘣAÐòqb‚ s‰‰„òp¤˜¼àëÐá?xKly õÓ;šcRO賞ÜH$þôH^¨…Œ£ß Ý”~·C™ÜÔ(2óŽ8ÑÙ»›‹³7“@µQèýjý¿x³‡‰3[ÇÞ©ö”oØaôJÓãòx`]IÝcÛ\"—¥¢h¾ÃÁ…=§ØU·Thœå+4ý|g!a¡ôv„ÄöUUµ]W®78N—§Ýu˜žÙeÄÿ ƨƒ24ÀdJ›²Æ‡R'ýlÆÎF}1c,ë[ñ¯azˆXRä”o@¡mÕÕ[Ê1A$6°s•_šaaHÖ t„¡êS Ð+¡j¶å ØÓ¡À•ÂÅ .¦é8˜j–íÍßåæú/ˆ¡)°}ÚèÝG=JÏú‹¹ÌÜîðcI¹‰„TÜ“‡¶Ÿ¥^¾Ú–4ežIÖƒ˜gRö.ê~Ñܔ՜3«0èøù‹-Öõ3Ô®±¢5¨$ƒ«ë‹KŠÃEïý9_Ô—?XtÄ T±mðãúAˆ¡ ÁŠ8f¥öaÈSHˆF4òÔÔ·Ó.OeÔ MÿSÖvͶÐúD‚€7ì{úW³™9q&µ­Q&¨çýjJq¬£5Ãr¨H[OÕÉÙ µFšÍéÁ.T"г=¸¬Ú¥k®Ük <¹6ƒ36÷Ê LýÀÙ÷©š)ORß·ö‘H]d×°­ċÄ)¬§IzLŒ$ÜGaÙ3K‘áfeÞhÙ ¸ú5‚u ‰ =[ 5žõ‰aç!‚A¡$Jнy W”?ì‹€˜Ù`Æ?/`0_-ݦó¥¡iJ?½½f÷y;Ö"œ é®ÀL¢ãt}P9~d:ù÷à¦lëÕ版Œbð—Àj‹’÷ÉN€Hıӿªƒ@ }ŸæoÛîy𲇲Möëi`ÒÞê!DHa ÜLµhQâÒëz¾\ì”7Öl„¸)[âqµ1qí'%Ý·hûPoWŽß©Ë Í0eèÜÙ÷Jõ!$uqÔ~|$a=¥I³»×¤8Îö™PNØû:P#fA"êÂB™‰É]¶èî²¥ÙMÂDå™SìwˆS|Ì&7Õ<€Þ"ÀÑÀ¢‘Ð<\’¤'L="KœU£m¨_ííú‘¹"\c;…´×ZAÊ?°­¥ÕÓÐr٣ʧz0Ðmìö›C˜&öñ‰««´ð‰B#—ÕŒ #ŒŽDÎõn¯Ìž\Ü@µûq‡ðU•"?s¨¢UÁOW­¡+4š]yFy)ú÷D{®-eˆAç¿t±BFìk/Ó¿Áàþ›fµ.c‡”Wß{CØEò³0Àîi¥8.­s:€_6;4 LôŠz^ÚŠØ8/Œ+t}*üxï‚náæ~…à¢;">™F¾ïÍ ´WŠNÞ—ùDöÿyYüÁ°ÖÁ]’±gin5ÒJ³áôGÚÜË×ËÕnx# Ñ|ëõéû…}«|ðh+kÉôG˘N™;ƒªhú£bwE½"6¤•Šì•æÁ;süå.Í×7šáZéƒFµTÿ9éêýz–Þú(=]nßLùØ~&qÚ!†sËh¡zSVŽQÄàò2s”ÂX"bbÀMÂìëÔ`ÕÌl½ÞJãÛþÒ×Ü+Ðl©J !Vo>¤#‹îÝAN(Ÿ$ß»a^;Ò¡ß§â³u5ºRÅ7½2~:»$0ÁÀN’Ð{—gQg|%HÈËã+ˆ•}a|É8ùÆ—À iD|`|ÙFÓó T¢×ú£ùZÇ¿n~A°ô38émÇ S#;cÏD(öFØï¼ÇƒV’òͱA=‰(Uc,„VöÛŒa•¯ß;þ&M«*ÄÏ£ýõÊð¨ Ðôî­zD]ÌNþŠ?ÿÙT®endstream endobj 30 0 obj 2988 endobj 34 0 obj <> stream xœíXÛ’ÛD}÷WÌ2µžÌŒî𔈠„l0N•¥¶Æ²¼‘4Ž.kœoà£éž‹${CÿJßþh™Zˆú¦…Œñpþpðµw7OišÜ÷T±!_fe‘×Ýþ‚lT¿.s²)áLYN¾×Ê9j焈)‹#B®xX?øÉc*|ÆO\5‡õg‡÷x8Çx¤‰w¸žmq±ê;O`]éëV»¢±ºÍ»–d²,ó Y]¤IQ·].7DmI 4Ê5D<ßh+8$ŒCA—hk½»i¸x@™o½`"‡¢Ûa˜8¿ëCïæ"4.È’’ŸvE™ÄDÒ uT`ÔƒÆFv’€ ëãØ5²n·yÓ€ýÞQ–ðÆyt7çt&¼¼97—G}…  ži‚ÂãÅŠ队º`€ :K¼zC6}ƒ··@+XŒ'i4BŸŠˆ {Òa?†œLB÷"o µiìw'»ý˜ÆQ¸E‡qw@CaéïíòšÔªÛ-tü0¦!Ö⤠DÓþ ¡LÖ£ÙúZî3êBå6'á…›cž¦ö¥:L·qšFîÕ[¯î Á ;RÈ ©ñe[*Æ֪M|È2·Í3Uo(žûhÉ™ã.SièÙD3«Á,ÀF~ßMÊ;eaÒÄ;» IhÂÝÞ{ÅbßJÔ3—¾~¬}fuñy¼ãÃÆ§!M¬ÑÖˆrÎxäî»(€öòÞëô?½¶ž`S?tKUGdÖÚ–GÒ·§YºžóÔÐ`-Z›8QL#ÿ”ª†Ý{Ùâ~Y*`ŶQ•Jî÷e‘I#œJ?Âà¬eöNG#ðà‚[ùõèT¹!;5ÿüŽ…0€€¸Å§ª©¼ÅÀ3ËáÐ>Û×Î3ÇŽ¹DBÆíd;¥òÈ©ûj ¯A¤ÖÇ.oﳈC˜Ó±žX}¾G#.’!ÉC–±DÒ;ÎoìÌÀÄ‘÷û>Ï4 Ï:<)çb<76j_— „µÀ2UŒ.¡M)£QÂ\®œ{âÌi-––Ù#1 B[[œõ`·Õ Ì͉NPîsãç‰_S&“8±†aZE¶Æ#Ž4˜)›yšd¡¶ö Ærf.)úâž@†ó!?n¼1H'p÷û) &xˆØÇÎÛ·Þ3ZŒÈ=‹}t;-¾oDÓÓdÄøÄXcNÃî‡÷ÑZD  >ÜèDîMý®6ºM”•C ²Œ<ÔúZk™”&‰ïÝöÓ;}fP‘„“†s²ìÁ.›ÿgI>”LTJx÷!o¹ölm‚‚iåJÁ öy1 j½íq"\åQÀ]µè ꎡ_äS(¤C"j?µÄ;%˜&JÁ…¶Ò·->äÆÐ&¯$„š]Ï).Ô¨m Š d\èäØMå9ò ®bFɊʶ‡÷ °Ý*ÕJ5¹vB zEüDZZúœ?𶻀½[XŒeC94œæ-pèI‹ÌØ‚Þ6²"Ußvxk¤Áì@î ¿Ã.Ö0´ÔPÀ[æ]ßÔXÕ%ôõBë”7uý!ð|x'õE{æh&KCja ½VMg²pª¼¾ô\[Ý.¤XB/o?¹Z®.ŸÝ<ùåæéã—/ŸØfÂ7}†®‹¶N>Ã#0<Ž5ßf]D#H1ÕDÈnN£tìl…k _lÉX7X¯×m':U ¦ëܳÌò ÎÐkp Ãš0Á¶{{Û¸aW !Z˜è] Mg˜ÃXÒ×%~ %ºÍ±U¶Qû¦Ýˆøé¼gwª±"@9ûbЏ)Ä«/ÇnåÕô+¾˜Àö+g3‡êä;ðÏl¢3üSÉw“–.X€\$ò1ƒRݺƒNКè,\&J"ÄvøAsä‚fÿüürùâÕó«aü3ù¼éï?6øé Xm·7Ý8ü<»7ˆ¹¸<qÑ/†Š59¥ÿÈÉvúûèà°‡©ïaêûO}Áf§’Ïžúb>@}®GÏ\±F½¡ÿô¬'øß{˜à›aOÀkøÔÉÀ'RôÉðíÓ#›!‚ˆ"€#=%Â'¦¹‡9îaŽ{˜ã渇9îaŽûÍq:Þ0ÆÁ1> stream xœÕYÛr¤F}×WÔ>™v¨YŠ;Þ'­G³–w.ZM;ìˆÑ†-á¡¡è‘åoðGïÉʪZíËëÆDŒ$.UY™'OžL> ϕ£úg±;ûûM"†3O<œ}>“ê¦Ð?Šøç¤ta³=ãw¤H|‘d›fb³;“~àz‘Ø<}tŠCßÜUùð|7Tc·oàv%šúžn¬Ö~乞—8oóö7âäÓ«ÿn¾?Ãë ›faa§.›ª­†AÚ†~ ¸š*Ê¿õppÞ+‡fÒMC»A’©»ªÉô8 ñÐ*ìOºqf,õ]?PxuÈ£÷yñIEí©P‘Än(Ôwzá?/ ´ÿ^ÿðîÛÍÕûwŒ]^¾˜#%DTô2Ž»±~’Îff}˜]VÛ•¤µ³ÔÉÍ(¾¬ü1˜7‡Jt[œÙç}¾«È—õÀÁóÕ8´Ñ8´Ã¾*êß `æH°ùéõåÍÕ»×ï_©G¦ðÇ®Ÿü…ð{®gÙÿ#/þ«ˆýÔäì±ÛlØñRÂk.£Ž·““QÏdü"è6ÞR3ŒÿJ¼}iî1ÏÂ.6ô"h•ˆ¿å “¦†3A…beâ¸ÌONSƒ½ÂßÂf6™º‘ô ¹·Ž=jêçiä3•ÿQáÔÈ—ýîòâÕåÍÜÓ€ Ò=é&¡ÏnY‚¯Ã˱ËGq¶íš¦ã(d‘óT·„¥±Ÿ÷Õ7ºd¦l$p99¶©­îF»ö­ƒpšlîêR|½{µ‚”pp¨1àœ³ PQÃ,µErëyYúq.ôí®ÚÝŸc}ªPI’ñú‡¡êË|ÌoWÿPûønB‹,P™J×îr34Îwã‹Ð¸IËC¶ÿ•.uA¢ªYäšX\ÌP’6WÏ뢯67YQÍ6溊6^3à GâØÎ9ED§É’N3%ÊÎíªV|§)„ÓŒOANah ošè2È^Ë[Uá¨Sy†³QªîW’ÐéùpœvªÒW!›¼(ª=q˰ïÚ¡–"×µ#œi\WúS¸%%‡$ÞRˆ¤Œ·Õ~±¡‘ƧJÚc{Á¡sí9ÊšQ'“€‹Žôø^ sÆÜ —ˆµ2‘:5j"Õ@æ}•ïÖO}=’/Í\åç œö< Yf§3­4Ôs€ù6d ½„óa·ýä­Š¬š•Är©n5Ž}Vú˜4}錜ÓÂ[_ÿ¤•\DÛÑ ˜)¹í\rfÄú@÷³¢ÕƒR¡0&é«n‹æPR\˜ûôXCXv²"_ŸLèMgíïŒÈ ÿëû®|f_§’}¸é4‡tý•.>M#U«é÷ÌËœ±˜Á”Ž–XjÝ=Ù}‹Í›Ÿ[çÛñæ5l¦q}.>e ýgÛ’€+/ý‹¥]×>hýŽÊà—?>g&„ûáÉû阆jhlG¡"üóÅ[g€%p?½ìü²W!hbVéé9—Dlžä;¯;U e”è:N*–Ø&ÿBë'蛈y²k׊ÞÔàÌH ÷I'xÅ T> ´êõb ,õ )i#Á I-T9*3ªèv»œhSi3ÚQLª=|r„|¬.gs/Ñ$}ë"›¡ŸÚNͶ©Ò=Ñðèh¶&Aµ2‹Ž$ÙR\gLS^0RFÇ3Êãñdé¬7º]-âȽë J~> stream xœµXÛrÛF}çWÌ›A9ÁÌàºûäØòF‰"ye(I•µÅ¡„hÔÅßàÞd¥v«R*‰.3}9}úô|!>eÄÇóYlg?\Æä¦ŸùäföeÆÔMb>Š-ù1ƒ¼mfúFbNâTÐ$%ÙvƸ ~H²ûÙ'¯ØwõJæý㪗C»®=q='uµÆó%}êû±÷kÞìóš<ûôü?ÙÏ3‘%üf%¬ùöêòìâC¶zwòã<¥i0á]ýëýÕùÛìôâ\=¾wÀ‚B½Ç8¾ç}ÈçÙŸà\Mi‚Ýp•Ó 5¦ö=ÉÉ®­šAvdháŸÍ¾)†ªmÈp›d›Å­ìáI6m]·sÀîaàÝWÍ ÙuíÐ;ùeÁ—©‰O|ÛýìòûéÙ9¿ÀåPp¹bÆãŠ)¶îfë¹ð}(‘À“_•—*<‚çÇ È––ݶjr0`AÖsŽxNCo?@XëZgWŠ ¬ #kIäœamñØ{È‹¡~$íFÙ¥…)Úº´>ér#T– µ%6„Aq ,„¿g³%£\'þÍÉ篴õ,¤Q”šZ2VTu¾®¥+v•U(izy½—½æœ¥}sÉ"š¸²8=±ÊNþÈT$!~S£êÀÁˆx— €¬éêÍ'ëþtòæÝÉåêôü¥Åoe^©^{mg¾ë Àò˺úìèEBoPï€Ù`]jÀ[mM`Ú¶¤“ AH“#£Ã?ž­Þf¬œ«”B!²`Ä]vª –­4;ºÎTmM‹µz‰…w/;mîÅN6°%§÷Ü$a½í€ö}UC·ºÑ";ŽŸFT ±¹|@9Dçâ»à]®Ábˆ¨š»z÷ƒËE ÍÛ·8ð¦Ý>¯«ác›¯{Õ.Ê †Ž•¼Ä¾ù½2’ògË௥u$§¼ºÉEj—~Î&o° ´l ©r¯F½Ä4±ö#ßíêªÈ58Z²mËj£¥ÜZZO@)ÞUÀj(üZ¨-ÈÎ+e(§)® Œî& Àß´õÅ,v7ê£#íEï¸2 øìR„Ãqê…vüHä[i8 ä)ÌÑõ£ÖÌTšâF†Í2vä˜ïFó@YóÀÒ*‚“Êi¬ÃOLãÄZixÍn«B2Ú+êZ=‹È§Q’x›\}ýÈkä(Þ…€vä»Q²k•gzÚ´4`Ô0ÈíNõd ó㺮ú[ň•ž½Xì«iÁ‚ õ-H4p®4M½Cñ‹žv8ØŸÊ UÛ­^¦¢­1:_F7I¼rP³Úqä(û1g[Pû“ŒbóŠõ>È`ÔãÉDv4 º €d@i¥Bš¶w†U faÞqÜõ&;Pköê!ðG£™@; á±[é6ã1¶€Q×–ûBI+´9¨7dyØZ¨ž!õL„b&~†¿TJ€Ä,‡!ÝÀ@Î+%`´K!§¾;†¸/FŸòx”K‰Æ¹LO T«èew§úe–ÚøÈÎ*¥D72ƒ–½¹(§Án´ÞwÈ ä»F% ZF kâM d ±£X*ŒjŸjs“@×ÓT0ÖÈ„ÍT€3‘â|i¼o§ÞÇ£èkp¢=Pôec»þîyF´Xm¥mÍš[Xœª*ݘ9¦mf-ÙO…xä3KÒ0dëgz© Tže-žj>­u¡iÜÉzά7m³:5¡@+H£QÚÉ’|Ûî¡X€¶?7* eÒP°ÑÝãP7ÒŽõ†ðŒ®©@' ”ØÃŒÌA#õL Ϩx¾ŸÊekxÛ*¨Šg/ÿòáùhc‘ê2È·»Z.@Šj,Mk"·Ò…sYÇ7Ír÷=Šq„5Yç—å-Õqó²ÄßÊ þwî( ZT©ÉiÏŒ/Àn騲¡5 I¤…ì†êtRÙ/µ>|öþ²‡î#¹ÚŠAæyìBäk1ñ ‚«e¾,ªuè§Z²¥``(&gZÌvÀ•‹¼‡qH? ¡¿úHŒ©{=LÔ&½Å;ÎÕêˆTq¹ÁÝçCíáy%idùÇÏgªî  ÄX™‹b¢4t}-Öw¹ÑM¯CÕ÷M5,µ¯IJƒ‘z¼ÐÖR:>xÚRì\Ëü€FìÅ¡| )-o›2çZµ¿O •öÀËŽW ·m£‡YÆ…;«äf›‡alÉà—=‘Óé¨ObÅ}§OâxfÂCeÝÊÎl†o' œãdóW‘ÎXÕž>¬»P¦¯”ÔÇ9Î4:> stream xœYÛrÛF}×WLy·ÊdJc÷ì“#K%ŽåˆtR[ö "‡"Ö À í7ø£÷ô\p¡d+»å¤X0ƒéîÓ§O7þ`Ì£öwµ;yu³ÛæÄc·'œ}“ÙŸÕŽý°À ]XlNÌÁbÉâÔçIÊ»!}î…lqòq²:ÔÅReÍòQmµo?MüOSVä7tc:“¡Ç=/žü’•‡¬`O>=ý×â§?b3ü¿Xcϳ×o¯Þ/–gWï~[^\O½‡?¹úeùaq‘,/>¼;[\^½Ó g0 gY鄤&ï³éâß°WSž„°WñœŸÐ¡'MÃ2¶¯ò²U5k+ü±9”«6¯JÖn³–í²vµU þPlSEE»‰$áÜÐí•ê½îóò–í몭ڇ½úžž|uZïE÷“85k´Y«j­º·}š¬¶Y;۷µ~ƒLxœ$öéSº4óáô Mœež9þµlY¡ÊÛvûiúóR2°ÅÛ“‘9á¦(ØR+Åàr¼æï÷Å™^Våìõüìò’틬ÝTõ®aUYô!1<·¨VLßAeh÷Lû=ƒýò"»)”>+Ë7c·Ï|ßçiØÁ¿|su>׈:¿ž;sûRA[ðø<ŒÝKîõÛá Mð0ò,&ͺ·‹¢@˜’ zžW_Jµf÷[Uº„`÷´1õCÙ?mS)kØÍ”ÌO=99äEËÙï´¶Ýæ Ë WY£N5î_] ÏÙ+#I iíµIy§ê)m&£ˆ©Êe^nª>áz›“‹(µ÷,ª‹‚Õª=Ô¥~­ö õœv"Û¨ w»É[†\æÚn§aPgIä ÈÖY›ân`DU:ïëÇ¢óë„|¡º…7É%2öFGÙxÖ†A½Äó’.OC“¤ºIùµ>Ѷ ™ÇöYí¨€V‡f…4æa—öô5¥)g¯ óGûšF6š¸ueÄæçF½Ç£H ã8–SŠRÏa°ñ½{Õ°$}œä–•LÕuUƒä„Gl¦Ê¥†ªÕš[Îq½øî¨Ì/¦"¡*ŸL®–ïοc î‰ š\]ÿ<.øƒJ'cÞ’¬\«€”ÜïØú±¨àÆ$ HTà}ÓTàOLf¨0‰ Š úJòûÕ°ŠE=÷ 9ªÆqŒðFî±c„Pjúés<°D Z¸Qí½R&]¶UÓj/¯I…Àúj‰'tÅ ÷SÙïa¨¥ª?wk4m£x$Òw‡X˜2NTVáOÕp*aqWà b¡$òf¤U+«j·Ã¡/jf$‡Îü E¤QeûªV+•åäc:‘<|L(ë1 Ä=|~UÝvÆ$<žèǹÐTbŸv _àB É\¡û&ºKÖ‚òÈ]ˆhí4Pÿ*+ Cdǘ‰ 6ž'iÚ¬Ã̦®vŒÎžÅŽ:z[™@aÆÂÔ¾"íâÂ.õs¡¤²7 8e­þ8äHo£Ã Ù|þ–ä0Q¢Ã×Ì­íd ÍÑ.7ì¡:~@E'‹o²Õç¡2÷áíÛS̺*_šPÆ´QNû]0Ûfà…@FÂA;C @ÓcóÓ¾ÄÀ‡¾ãJ§“âšå½TË­ãé•:bäIêTÞänÓ'ƒÀQâN†qß0Q&1Pã´cLû†5A®” |:‹p$™úä’_O…rÔ»ßΗ—ZmÝk:ôÀO Õ²j¥iK'÷´’$¤ÉÈwˆˆ|ÙYzªé¢¬z·oi˜Å Â,¥²jZhî¼ÙªõéS¨ z:üzñ§Çž’—¶ ]ŸÿúÆ–*r@ñ@änëÀ»DÒû Ð4:5ÒU_Å ÞœÏÏË«‹åWóÛF£E©yžõ” (tÔxQõ!‡Žê%k=V{ ]”È.¥&êϯx#Ûí Ó3ΠEô —#ÚãÓ‡ú– /.øe&¼ ~a†ìµ;hÑÝcؘð¤KâÉÝjˆà´«C'¤.™ ÃµV›©&5?œd‡¢íK»J……@¥‰†‚Gy]By5$5L#-(/M&÷Í÷ÆÓAÀ}\ǤߴY+‡r(Ø?¿J’0‰z?Ò_ßáâêZÓñtÓ\B„“øs–˜µ3áŠþÀ‹ÿ¬þƒ›„èüw¸JƸ¿Aî*•aï#…צ§r¤Î×Ô°SÛN¦ä†N °Úí°ž ÈË'ûëq0Q_×¹ÕÐ2& ­¨])‰zkÖ<4­ÚYØË€è*8äõ¸°]¾[œ#I]®…ȵÿo #zqú¿Ïa>õxê2®Î|öÊÏŽKú© $³¦Sà°Ê×fþB;PãÉùÍŒmк]éç”Ù?ÊÚÝœbû.%h{0|MRÇ6Þ*ûhè§¼«XÃÆ }PÇ©ƒÆ ìÖ9êVµX€Àw)‹„k*ÜÆ/ê¨]#R´½š}¬¸ YŽXrC&O¨®|xNßëúŠf¡²Ñ¾$Ô;ü¯í{=̪Ðáœ/Íônñ^ GÎ_u •¡Åù;»)ªÕg'k…;ºím³¼lƬ ßDqøÊ»z=€çLËz¯ 6s’UqX»Ñ@Š K±/5êíÍC«¨>gÅp‡þƒû‰K½û™õ37z¯‘0 µ›¶5d`²ü¶4ï1LADÿ–ƒ.:L\úÞ–tŒ¯„)ÌÑY”é˜ê“®¶YY*¨Á5X3ÿB.1X¢!”´Ö SPâ-îÚ ªçq¡Ÿ5<#iB‹kððôåI`t?õ;¼ŸĠa‘½¼TÊ4˜Ýô­˜ðº"¶-ÄõÅ™ôÑÌ•IžãÖTxHAáö¥xí(;hLXƒziþÛVfjÏ(P¼Y÷ƒdªEÜ‘.ðÜ!ÓÍ4oÔ6WŒ$ăçšØ64 z’%:Ü…z<Š8”$<`ýtMD¯dz®´¢6ý´¢ÑYÕ1Š©‰fš>¹t¶¼T:¤æqórÄs¤*ì§qvªCù_5Šh{§QW’T£óHO~‹œê6Mîi&¨'Es¤œ±¥ik•íì, ›l³Î6Ý—Ï£À¤€ýtñqB -ó÷šëJO²JœSªÔÂ7xoAE=»Ëí‹ÍzÔèˆ#)Ú|§¨4¾fÍVŸör3XA7,“cûAZx<Ìøœúdßšmæê³þ,réi|‚Z&º¯%ÍHjøiW5ÓÈ4´‡›Í*¹°VÍ‚J úTH sE¾?”peS•èu€¢òµKzíPŠjo BC†½×ô~«5Œ4ˆš¾gqr¿›iízˆ BKtv~ùÛùQòJtøI×Ä¡ÕTƒðØÐ@.YGÛÙ)28 ú¤áÒ~ÓÍ$:BjêÑë5z4O ~½±%Ÿ5æh?ꪣ´_ÆHö»½N]õ‡TKåSF¿·ÕÁ0Òª+ˆ“×FËïôÊüØGbø]òË:4gqß‹{Ò·ÝÚ¡Zƒ½Ú†Å €à´‹ùLÃ÷~'Â÷£OB²ûŒ¥J=¡Ó,àC[ ‡ÏG²(Ôe—ÕŸi‰9‘v"ÕÙ/öË‚D­ˆû ¸›ÚèæœÃÙ¯×(ÄzÒ!¸KóDÉbN:źCø(løÜ¨' ÍCƒnCÒ\­k^ÄO#õ×UY‚ßôB$»)]:_œüŠÿ1—"endstream endobj 50 0 obj 3181 endobj 54 0 obj <> stream xœÕYÛrÛF}×WLå%`Jc÷}“m)QâH^šÎÖ®´¥É‘ˆ˜´Jû ùè==\(ʲ³O[¾É¸ÌôtŸ>}ºñó¹`>ý²ÿ.6G¯¦ »oŽ|vôÇ‘Ð7™ýg±a¯gx ¥ ³»#óŽ`‰dIð4c³Í‘÷#6{8ºö»z}«òæñ¶Qmµmo¼àfÂÖÅœnLNdäsßO¼_ór—¯ÙÁ§'ÿžý|ÄìfK¬ùæãôÝÕûÙíÅåìlúîìt"‚ˆû"ò~;{«>\6[ ‘rÂB¼‡‹RQÞéŒNf¿ã€xä$•\YÊN„¤Ç“D?6[ Ãïv¥Ø®Qõ2os¶­Š²U5.æ-{(Ök6Wl›7Z²¶¢U_M…o½#EÈ£@˜ýÙí‡l›FfOÁ³$0l6ˆ[…ÿÜíÊE[T¥‰â&o+eâ|W­×ÕD",™/½‡¢¼gÛºj«öq«þfƒ“¹è&@]ôûIí°u…—ºn¼EU6-ûL6f OâØ:¥*–&˜`õÁü¡­ó²¹SõmQÞÑQÔÊçI›SUÇX3Óv´ûaÛÖ&U¸¤‡G!Ji÷;.:7¥Ç‡Ý‚®qv>6qªZ;þäŽ\.òziˆÙmîÀ¾ÔN»´µ?”ë*_›øÃc]UºÇ —“Õ4*®•6º3 h”Ú#e•Ò.¤ëÓ+ú‹¯Ìs.!q¥~&äÒnÀ°™Ád yè"Õ[Ó» Éh\f‰GÇO¦)eÒþ~̦ BçûcÆÆ™‘¨Oµœ98Ð<î6¥›ÂAeL®oíîÙ Â1:P2ÚçΦӑI½³bÔ[_ÄÙ –‰#ƒHX2P`Õ†ix²Õ?”»Í×E“¦ö‰C±ä¢áMÓª%û Ü=dì‚uíñ <1gàݵ–ÆÔ˜g]HÉD‡u„±¬Z檫4kÂ)ƒê:,A¢ÓµW¬óùZ÷g^å ûª+P¸Ô ôòõNq«^H’Ô%±7U0£Ü‹k”‚å ¬{óöê—1žÔjû†Ly,L¹Gª CÁC!_¬éõc»"¿Ã;–êxÏ<@Y&ú"}ÈÄ¿\¼ß3j È,ŽàI?v6>V;ö «!ÌëŠ=¢éËËQÅPšOÅVûhZÔðµÁ«ê'¬ƒNö]´Œ&Œ´<½x·ÏÕÀ :lû¶ÐÁˆVAº¢FFAÊ2œ¡©6Š¡6«n¢Hiê)ôª“©´RjùƤ*óiDP““в\ 2 ž¦é+Ñé+­“k«³Ë·M[!‘ãð/k+òg¿¤­„(ì²h¤©n¼ÏGœðq]÷ɲ!5 ê%JSS¸p´UcÖ2;õ%Ⴘ4nçÍX¼0+R(Ýç ša,O€ÂëV-­q©þý(ÓAx®<AêÂ÷4ÓãˆG®ÀIÔ©(:œéèšd}c¦w©”u™J–at0“:#Ï'™o “ÐFiâŠi3‰ OU&e!÷Ó¬_ÉðG—H¦p‹Nþ £lÔ€AŽ£ž–¯J(SO]ï ±Ÿu ùióÙEá§×~1çИe†°Ç)7lCwe[íncl–Kןæ&IšX)ˆF=s¹A;FSí6ÊЩàCÞ  ü©%}žØŸ ©’rй¼\î+2dó³øv«Á›{-ˆ€ŽNÜ‹üÆ*¢¾ó•ÜuLÏ)"lùê=£;سQï5ýù%Ô¼‘@ûš¿µñßЫú2ùŸzÕH¼Ä§qÈcW¬h^0bS*«)Ü’ˆÞ ]ƒúÆR뾈®â&f+(Ÿ§z¤–tToiTC ]!è8#ˆi2µ=¤ˆãC=d˜jUä’:ê4”ñt9‘ñï¾|±›l<1D†´ë‰K´æ¢ç~mßå•}6“ò€…(±~˜9) ÈdÎBÒÙO¤#\ñ%¯X µ¬?PbàÚÐM%®i«¼|R@N’)žE}½ EIJD‡ Æ·Ö‹/0Ç“Á%È#~¹v$!~ꇗÿ_µã™`ŽYÔöpÃPB-ˆ´OQ×>û#Îþîûõ$‰³Ø¶²0†ìl:@iû²íjÊ=˜öa_=Å÷1Ö/Rµ ^|=1?ÞÇóó³é·UtqÔGÐP£©zD»nt§Ç†¸”öîÀ†Óî\ä­¬ÒÞ䤭Ðì®vdTë’úV›"Õ4ù=£(i—Ò s£&ÓÈ £ì$8½ÑF/§ÖÛ»i8¬úû®1ÛÖšûÀóKT±ºÚ<Ñ ˆlÀ׿“:|Ю~8Ô_†¨Hb~h8N§†~n$"ýàò€«´‡6d*Ò~Zcs[È&cáC1¦êIÍnÖëÎжGWÓÛÿ:cóâô‡è-²Ä;]·«jw¿‚/hDd¦¶ÄPA÷KŒòI’¾7qÿþ˜-[VÊÌ%–ªYÔÙZ">Û±UÉf¬ ˆ’ÈÍMAøzŽUëy«Wá`'íŽ"uCµu(<‚!– ú½ŠÕÀªÆµ9Ʊ4fñ㋃\^5‘$ZÐ!E‚¸+ϳšÐX? - 9YÜÖy­g]è“^Œp'ÁÍ44CüýNzxÿ¬ìTÈl(º¨y»M¿3N’Ê.u|ß~I P|ÒC÷HHO)3jAV‹"oaå…å.½Í°HÈŒ‡®$¿8,"..úBY1já»R©%r°Õ“V+—òbm§ßK´G•æs[Jb*†i¯»üÐÎ9ä ûlÖHOÕ¬Z¹j•O„ù¦à}.¨6ÖL™ŠJlúä£R˜Q")H\:G×yõÁ»êDg#X›³Ó´‡Úì}bˆiÔ>a†r´ÜmÍב¨KéH§Hëçj÷µG;6ÊÐS“£»´Ó÷ü~Bn”q W—ägò]ΖőÞ2!\SŽºIoyfç}lÔXà‰”°çÀê ÅogÓ×WÎÆ–gÚþàùž)•Œ­ôöìµþdAÈøøãsÑ÷ÇAàÐFÒ¸@A!…J™kÐ\rwÿª­ó¤îÊÖãŒ^@´‘Ü}z>öÓA% ûìDÄh¦š>?¡f°WMæ«à`j+iNw‰Ÿ‡h úÑ+XOú¼¨“î }ílvôwüú/ï9Aendstream endobj 55 0 obj 2947 endobj 59 0 obj <> stream xœ•XksÛºý®_É—Rw,à›þ–ÛSß:‘*Óítì;˜„D6|(|X×ý ýÑÝ>’´3OF ,vçœÝÕ7Â(' ÿ†Ï¤\]îrlWŒWßV\½$ÃGR’_cXâƒø°Ò{8 lD #—+n;”y$>¯ž¬¤oŠ)Ú÷—Vvõ©{¶œç5)òW|±ÞØ£ŒÖgQõ¢ ?]½þ=þmlŸÄéÊÊÄé$+ºŽÿ¹²]߯ }³î¤Ë$šoDóNÒZ¶¤ª;ÒÈ®o*"*"›¦nÖZ9ÔÁ=ÉŠ{6õ|¢@Ûšeø"¤¾ë³hxV_ñ¨Ï<ó´?à³²±pxv )Å»:7ø~¹õФϨëÃfNùàõÛ`[‹xæŒ,Pk¤¬HW÷I&SJ®ë!ªâÔ†¬Ž±}—FaH6ÜV›ÕƤ®:Yu-ÉqaÝJ’ˆV¶*}˜ÑÒP9þéq¿ÝÅ/ñõÍ~¿p×i£ÖNŒ®F4ôL,®ãªãÚ–r{wC~!¢%'шRv²ÁMpÄÈ<øC¾h<ÅÎièº|²éhÉ¢0$‚è²¼%m×HQBdm'EJê¾»0wÇÊ2¼þ¨Þá³AÍ™c<´±’#vän~n€ˆÔû?\¸tv÷óuQÞîDÏÃgzú1uÏÖW 4ã"ÒÒˆ=e0ð mèŽ4^´št38@¹Ï±—Ð-ŠªüÿÆâ÷>Ç4xvûD¿0°=4u©Veæz/€ùCKÓF¨ÎÄ$§íO(K ŠÏìš7ÄNH=ÛÜ? ðÍËã—‡ÇÝn»o®_vûÅEØ>¸ PºÉvJk"4Þó§í½f¼ã«b6€Â:Øçõ¬xCÍÃiŠÒG g_g +fC×+Ä•7Ö›ê’>¦Y~7¸.õ&¼OcëI6¨{zn]ö@uóýDáPîŒØSKhyóÿe]6Cg_©Þ¸ÕÝß{ÝØW¨Ë*)yl¿÷°èQß™ê³:ñ šó[>?´°;}É«C=ÍàÓÑ â¡eõC]5 r´¼ Ϻ A×2àV5Á xuf†¶Œ²™m=#÷yÞ0µ4²ƒåøfà‰¡£ñ¾A\üHà1‚ølÙ@ÑbYÇöMÀ<©Ë}šªpxßÊZb(#Ï2äÃãÔ<yܶD¥,°RA· _±5€–+Õ¼u§¾­§e]PÉ{ìÛqrRKþ%4.Cáè8S£ Ô-Âù|^«_\\nQ©‘­­ÞJ“º¼œwaÃ&D¦ùnÓ<ã  Ü)x0üd3ƯàÊÙçܾâWW6ûW¨6Ù ¨ÿ#ü î²yႪæŒ:Á›ÿØâL¹µ×èR‚qÇg7ñê¯ð÷ ³p¨endstream endobj 60 0 obj 2377 endobj 64 0 obj <> stream xœ­˜ÛnÜ8†ïû)x7ê›-’¢Þ›É.&¬7«¹JYb»µÐ¡#±Óñ;ä¡·ŠIݶ{&À b˜bU±ø×WÅ|&!e$Ä?îß²]m?$äq\…äqõyÅÌ"qÿ”-ùg¤ø‹|·²{I8I2AÓŒäíŠqACIòÓêcP‡æUŒOŒJ÷ý)ŸÖ¤©pa½á2¤a˜ï‹îX4äů׿翮ÀÁFÄ$¯V!MyjßiR¤hÆžúq¬EtOƃ*ëÝÑ{EŽ£HW´ê†Šq<­3še!A?T¤èð¯±/¨à ÉË2*’N¾‚§qÿ2 ŒSÎ ŒÐ‘`Áñpè­*ÒôuG èºï ¨ü šô;4°á1£2“døÙnãÇ÷ý¨oÈ®L¸»¾iú5h–Ê(8ÕÝ#9 ½î˾oÈi¯:Rö]§JKxV5|Y3¨a…&ƒú|¬EŠ#Øët]Э9$Hþn•ÿø1Øk}¸Ýn1;·s^xœb^~:NëXTe²(¾í¡Q´ì[cMì®Y€Åë»ë¶¸ØÎŒÌÅüÃeñ§¶¨›ëvýAüvÆöò8ßo'M¼Ñpkj„ô“¾kžÈÝû7÷ëVœ& •”¦4NCæ$vs?K,¤Iœe^bœYsÿ¾Fªÿ}Ÿß“Ñ îU¹/*j„e-¬EDyâ}¾íqãaÎoÄB'í`h瀠¤1 »Ðƒ¬ê¤Šë`/™—6Æ™È8áUŽ’ÏÌ Z#BR<ôGm<~üíÃ;2>uºøJ ¥Å¨@ÙŠ|xû/.ÒèaÆMî~Îß’j(v¢«w¶ óË*†=äb,ÙàµnÂꯚ| ÞT*xK¨`4ü´¦x+¦(e¡‰ÅC„&É@#° ]›ìzmó «Þ’Œœê¦AؘÓUjgå“¥Aql´5ö§ª@î­K—´+‰)¤V mÝ¡aÀãá–¤¡ÁÈ/y~ïn7µ·'”óØ:øÜð5ORÊlguk¨ÈX:iÏ ®œ¼ÑáÙ¹4æQ„Þ¼ÕNHe⵬&éd .à÷ªKJòpÒ&ÇNYÀÇTŠÌs*Ëe"‘4ŠÒ3p ‘Œ{'b£ot–nóiï¤ÏÍ‹L(þdÒìDôb;Kæíý‚ù”Ôå|ϽoõÖ¸‚ c8Ù ˜ð¸Ž¯¤óˆM4•Ù‚·i˜†[²Ü€ÖŒˆßî9©‡øéšçAe¦- ¤p7 ÛGÑÁ/è%Ò<³\ ß2M®¸¶´±íÅâœ8õ ¨·ƒ¢6Î&È„ó‰&__Yð$£rœY‡èÌY,®„ŒPz.`WÛ*MIÂAÏ0‡Ð€Ø} ¸¢(]©ÖÍ…Ú·Š\x ({¼ŒhGž‚_”•GŒ œ9!r‹ÝÃr,ˆ÷ºUM¶ ”MNú•mxM="plb*NÎUÜ*ÀÛ£”†óÀÃçA©n?dntÛÈ„ÆÒ§:ðؘg;„€Å÷³ä†2fÖPãDÃÑ\Ê7;„ Jµ¾.ZÀBœêÐsZ€,c3…ì7pŸ»¡oáRa©`¼)u?·5‘ØÙƒ@žu»L"¦ÚÅ.&Ré£Sæ…ÒÔ3”JOŸqXÒ'ôðaf(5äê)@ïÐu*JîvSö±kµµÖ‹`Ì9X ´ 'UئL¥ñbê€éÝ&6®ª/-Î1†Ê_ëR~ Ç–ôYÝðê¦Ú-gLŠy´ ªvS‹ãMYuóñpvzï‰y…) cï‰æË4rÁçãqÅÊÞ ’Om§Ô®íÀ+ ó:Ìtýq(MŽvb숪(÷E8q F¾JTWÙ ÐD>‘gJ€Èm÷á1tKßCÇr™£TLƒbß}{<f’²°ä@ûøû{ŽGþ£Ò¶b¡CtPÚÊÙ™v™{ŠÀ°"]Óž;Ì_õ¸­!“©¯t¯ÛÆGaSyÈÃYl84uYkȪö¿ZÿY¸*Mfà¸7é"0੆;?ŽÛ—âÁÉ0!/ÊaJÔdÀôãÖiç£ÁĘùbÆpóPr‰ÝoôEìvfûNìr¨ M]Ù¿Ä.‡éË㸆]‰ß@}Cƒ §)°Ë%§¼è²Ól æ³4ñôsÁâ¡\Ï”%óˆç Ä ùa»rd”§®é‹j¼ÀöR‰V?ÊÌ%JMÄËÅ%F¯¸0dÚÂË«]~µÀ¦Æüà˜ŸÐþ­üB‰ºÛ<S˜4K.h+Ÿ³vÔ‹9€Å‹YüÏÏ1ßuì'+Û ƒù ±è™óê ¶ƒ*ªV™‡—;Œ»5´¶¼5ÔÂâ㩲®r5{[§“Wbp“´á%ß“Ð^ËþwTlóì¿…TÎâ:84V!|_g¿¾üª ¨yÈìFóHŸvpüÝÏùê?ðçÿðÙ‹¡endstream endobj 65 0 obj 1939 endobj 69 0 obj <> stream xœµXiÛFý®_ÑßL-F-vóN``xO`dz¶²ñÂ^”D¸ËC&©9þƒt^õÁC£Ig<É®ãÕ«WÕúÌ\.˜KÿÌßM9[¾‹ØM;sÙÍìóL¨—ÌüÙ”ì»>ˆéÁj7Óg‹$‹Ç [•3!=îlu7ûèlŽMñk–¶¿¶YWºOŽ÷iΊ|M/æ ¸Üu#çMZÓ‚ýzþïÕ38Xx![mas×¾Y.mÖ|sHÛönžð$‘aìÔÍöïxÉ3uD¸#„‡C’'¤ˆœû´<ßÔå²ÉÒm™ñî¾c ¶Úç-k²®É³ùê?³ð@ ›™$üP›qnÕË€û — —qûæeÛÑKW’\H!çB9ßgläôK‘±]S—¬ÛkŸ2Šx,#¶R¤ŸÑXˆt4 ÷½$¶÷ƒCÁãÐ7/\îG §.3¶Í›lÓÕÍÃÄRðÐ÷c‰ÿ2Xòy"Æ–B]É}V±”QHU «iµe}A%”>¡Ï€a{È6ù—l{Át$£´$ÝÇ(6Ý>¯nJÚí±¼Ò %.—nhAry˜ø*W ˆˆº=þkÔÉ&+Ò.ŸT3öyä‰M.1Go3¦jçqAO¨ê\†¾©ŸS ‹C‘×£c}Ãu_¬Þˆ'¹Û;)^ôù>*Q%Šû >:|5÷ÔßMµ‚V“’ ޱv†ÀDr.å/C@1w}ëiȪÈÚž ¬©ën”Õ Ku=B”5ކzÂS§‡oլɨ6g,uÄ,zž®Ûº8v¦Šå±íØ:ê¿~`‡&;dÕ–è‘*6Ï×”ÃÝlõ·NºÝæ]^W’]Ý Â‚šm‘¶ð_+WëlN<߹ɫРÖ;fĺÒ'Ûdö«GÄñ©àüYÅñ¸ôüIŸø<$s¿§8‚{AÞ£3Š3)f/9šÒVO÷úPœ;*NQßÜD9 …ô%!HæOhDŽFmù.1³Áyÿfu=6šÔ;:¬Õ¤W}ÊèkÄúù˜¡îÆC«‚Ý×x¢DÕÚ¬Ž …XËc•oR*;»Ë»=<Vpo†2Í †hoñ: xzEJcÕs—hÙ÷ÜÕ\B3\ôÜ®z=ŽzÊó ¶J u­Ë¼ë€"·w¯(XŠçå¡£\J]Ü÷dÝ ñ]ÑwóXx\+\䨨740ëò€Ž±S‰.Üèü”ˆÀ«<š> zrÔÁÒÓÓƒ0çìU­T) ç‚ûÂJ;^ú+¸kl7lªªý0üSƒ”é« h”c£ubw,Šö ƒ"á¶Fq+C34ˆGà°––ê¯¢Š P.Šog¬â)Iá²)k­aYÓªI§ø¸{Ðs öU™Ó¢¨µ…@¾?)5îZöP©ÌØe`Ÿw4;O&=tƒ^z=sò\ ðÀ¾HÄ©$|ÁÚãfO] _ ²Ü`vf† Ltq€®´L»ÍÝÈmàjèàÒ’1¢ƒ^^Î~ÈeZæ7ûŽíÓ“éqß·‘›5ÉÕCrQ_v¡ÕgÝÁ<ü(µpÐꀻÂ{… ÄýXmTÃÛìo²ŽTb¡7ÌOr:Ö4ÅeZøSÚ±«¹‚I©¼Ó–Jã‰&Ps¥^8Ð!ŒLlƒš[ßÔU±líh”FE-%H„¦7Ût#N»'3B³ 3ÎTTµ¹Vêõ’}Yœ“ÖWhû€88Ûö^/xŽ^RsÝS¯._¿eKvù HS†‚gžÐƹ  H§H©)ê‹ñ”Û9ÚÎDÏã^ÏÜÄ4öc•4RÞ¬?NˆÃñðôø$|SŒ) ¦mœØ•¿l¥„iƒ£GÃíúíµw2Ü ¹O 7úúüp+³¶Mo2võROµ<k(œn’=ÒV=­B—V…Ói%¿(á†vZÁ)°'yíG: ¬£Ôºƒ^j6Zýf¥Á9oUÆt+pRìbL“a«u™T\-óm‡½Dú°–z’êƒ7]¹Ô-#òÔÊ5æ6¸Çl*††7µw©Ñô|Ø!v›ŽR£µ*/Òu‘ c—TÆÔº£8æ{›Ì_ w)NÖÀÉ}IJ\Ѽ“¿»"°¯øKƒzXЦ1°‰`ÉIlBÎÕ›×ú‹ÝÈæ vWŒ¾ïéMtª+Lè)Ϻ¾'’SuØ'çÅv«ˆÀ ˆ0ÿiNòÜfÄôBw€Ô—%%Ðë#žøa¢µEì6£ìã8qÞç¡“4zÛšîÈ\uÿfŸmþ«Âúùꥪ(mÏÊ.mabQÿç‹AC=Ürz …q½Ý¿¾zyµú—½<Ø$Ș­Á:Rß_~¿Ð×ëéæí¬®ÞþÔ3eƒ¡]ÖaÎl4Â袒—éáëÚæ:k@’¶û®>°â”‹>2úc.ÃvcEv…];êW@Uysi¤"†úÊÀ—W?}÷VÏUn~ hÐ>?,®ûh¤àbØP‡dwC` mßã¡*dÜ0§ÍŸh¶ u×ë®oñÿ0³qJ`©™ –ß‚QÏI@Þ«–i§±#–4ûÑÁãèíÁöBAvõP¨,}å²V§% ÂpJUKOAŸüòéL½DOÜ”–ÙâLKJú…#þÃŽtýqG>\| !„XmùL¢ ®†â¤'sÂäBkF{V4âö—¶§B|B+ þ;†¼o|ÉòËé>£½¹’öÅÿ³\dÂ,où-¤ŠôèùêòÃêI“'g0> stream xœµXÛnÛÆ}×W „*¬gxP´nì)bÇÇQ‘‡ô ‘£ˆ-/ 9Š¢—~A>úì=’²å¶çR°rf_Ö¬½ö~">eÄÇ?û›×³å}B>ö3Ÿ|œ}š1ý’ØŸ¼&?®`AŠV›™ÙÃHÂI’4ÍȪž1P?"«Ãì½—ï»êƒýñC/U»S¿xÁ/sR•k|1_ðȧ¾Ÿx7¢Ù‹Šœ]=ÿ×ê'p™Y—àjÄdU̼·/îæ«_'áð¬^Ï|e1º÷V[IvBmá_§H»!‚ÀÒÉO{Ù+Òïd^~•=Q°îk%‰jáêJ96["D>ã<£iCžàÓ‡íÏ’ôîãÓ”ÇÜ­qþ›‚lº¶&‡­P¤(;™«¶;â.@×ä3@-f©ÙèÑÕh‘ÑÄ2ûÂÆ‡iàŠEqê ÆÇ0L àµ8’¦Ud-I[—JÉ‚’•Ý^B¦â·9ÌYÂ<ÙÑÿ×}[í•ÅJGŒˆtm;‰š´~ÚËî³>’ $¸ÅÅ“Æi†ä³„r–eüL^>M¢Ä>oM2c2<â>}>›#œš¬“•P¥ÞâÎ&ÉG6àn7ÂÙ(N‚OÀkçÚ­š†ù9Çæò|vb#`4vK½~;=©8äîE[Ë'0ƒõÌÇÊH@fí'4ˆGÈ.vÓ1°!F¦cìäN¿~_"kÕ@ô¶SeÛPíû4 ܽڰӌስ›”•Í™4¢ÖLAÉz-‹B¤4yü|ÿú‚”Šä@š5¦¥È¡¯ðÎ"ó]%Æ@P{.Þ Ø÷ænõáç·×÷wï®Nk6K)cÜ-m;óÖU;ÂÀC “E”aCï½ÁþíœkI ¼Ë›k+ƒ+¨©È9Ú 8-ÌóªGcõùîùr‰ˆü ç@8™Äû"ê]%iÞÖK©òeÙ÷{IP_€×#1—è0¬E”Ñ,ömRŒ>‰ñß—õq6ž²m_Ûc¸ hÉJ€'٪٠,ÿ€ª]?¥Y2‚«é‹¤!CÖž ²÷öåê²qÚeÉ“ «ÿS2H'qxqküTAqxâŠÄùÿ#³T °–Ë¿÷}5ÂŒ&iäm”ÎÔ˜D'Çh?uBQ[Jæ)++F>Á:¢•cLµq­©TFÃÔy`8xhªVœñ ª²Weó‘lÚîÁ‹fAç‹êC¯6ƒ6èdÖÕØ8l«-é‘O‚,M„âŒKÈNgß5Zz%Ea@Хģ˜f,r™„ö&QL‘ÕQ;Ô ºýCxAœòô4ºS-Éö”ч²ªP¦\È&„«†nÄ'žW@£9n§ ôÍœ“÷_ $Ckñ_RH惢%áS Éi™ãïÔÒíœe@UŸŸÑ°ƒú0°Ùt¦‚¨%põ-þF9|¾}гŠkÛÿ']|à­Fÿ³¢aN#Ó¶øÙ¶ ½0=§…¦žaŠ…¶d»‚ ±ï·Te£ó‡®ìûéc¿jó} $ï—.x«{ýÙêj ‡]r]mhû¦Ýi°yG ƒ¡ÿõÄGf-@ÑRlè²WóXâ̻¼{@(˜‚Òð)чÏPi³À9ÆåúŽ–†v`ËR)°¸ùÒ{N® Jû²ßÂÛ[¨Ñ r© U¬uÒ)§¡ëí0ÊöV”aª83d£¥õmÞîÀÀ˲R€Ÿ€>qýEɦ‡Ъ¢Cí  öRtù–’k‘oÉWY(½„ *Ù‡T¨E÷ÚÔ¡ë×3ŒÎ0ä€âª°93¨3ˆœB㸬w ÄRR8ùx`ݺ†Hûm»;kì˜^ÙäÕ¾@©{f/CX^U!»øC±¼L O¨Ú~wsü÷ߘÖ}××bQHÝù8öÚL(ú³ 6e/tˆ–íZ€w²@k‡èæ˜ÚÕ­íMqHYpJp¸¡ÜɛΎý&° ¡ÑHá§"â1S^­%Á±Æ±ùo…%€%f²vQ|¿k{%ªË¢èdߟÅH߀Ù:Þ3hà(¦¡[ë)ëp¯Œ‰¶>j:9u$L‘¸±‹ƒÊû§|½õª­EÙ@Í#_´2ÊÍñb2°îÿFÕ#¥8}u«KÍ© i«ÆÊišeƒx2‰u Iº6ÿ8ljš% cÌÒÔqC.s¸4Ú´ó$ŠE0Œn˜¼%®•£¸Û†)k˜†£§áAËRž:)&­ph /Û‰8CÎáàÀëêÑ3~p/ÞC›ÅÆv‹²)Ê9L¶ŸËB>ië]ÛèÖáT7ÈL‡†ªƒÁ€À©ŠçIî_¾#Q‡è~"þ<„oå6þûÕ4Èp,¿›aîµÛ ý “¶5¥0òà Ät˜¸ûfÎÓf˜*Z 7ÃÝpóuˆ …«øD‚˜ÙÏM%À€‰"÷4îç1Ÿ‡Þê”§&oh2½›ÙHl”øBúý/ÐFÐuSÅöZ&,h©AÄ'ÝÄÜÄQ¦Áj§êþî†é\“ˆòx*h5³“& Ì3™‹FOªE‰T18\UÕj¢øaæ\¯êw"—º…ÕÞç…Gj71M&½~16<œ‘¿û v=Qí±Ý—UÈ#6%õn[Â\f<Ù6§Ž»2U…!|SÙKžUU˜,âøO5½ú†Tn˜ÅúÂ@Õ%ûtRMx†#ªöäEžËÒ‡_SòÎ\vô䯆‚‚+ùx‹ÍT£†¡ç`}Q2MÅÇïÀ ¸S =ËQ ®¤Ý¤ì9 ëAàÆöÓ3ˆýуòᣠñÙõjöOøû7g pendstream endobj 75 0 obj 2215 endobj 79 0 obj <> stream xœÝYÛrÛF}çWLy fEÜyK¼N­RZK‘èʺ¤” "@k`P÷òÑ{zn(Ùµ[ÎÓ–«,‰ôôôœ>}ºù;ó\ŸyôOÿ\mgo®öÐÍ<ö0û}æË‡LÿXmÙK,ôÁr=Sïø,á,IW¤l¹ùwîN^GÙw쇛·ççìqÎC7QèdÕVj¶)dÈx(ÜÈxñ”åŪÜfÕ÷òDAÄ]DËDìÕÝ^ɨ¾¹N5T9Îr1[~w뼿œ‡ž³|w#íŽÀì© ÁMŸµ=ùz(û \z=‹qVabE ¹°h»²©YârœÿŒõ›b€Ù6€/ùá‡ësÊºé ˜Äa7Y³ËúÍ™<ŽÙLŸÇSa=lÊÕ†æ)ÂúC¯·ÅœGl³ïª£´²ÊºÂÕó=}2çí‡ë‹Ë«å'üÀa†#'ž+‹Ã²“&š¶}t²~“õÓ8ŠÔMO§ˆ³Ýwú¹1‰ä}O'‡#ÏJG^7m¡Z¯"à\ØÍ‡Üß-VoUòOl§žËckî®QEîž^\ÚlAwž§¿ºÖø—°Ž}3‰„ìB^éå’]OÝpH¶·—7'‡nYTD^*M¬²š.yß!ïû©¿%NB$)úfÕT¡@… ¬d82¢MWÐfu·.Z™ƒ"tƒÐ„H¡ƒø!L‹7¸Jõ:/vþ«%¦ä†f› ¥\QÔlÕlwe¥ëö»]Óö.[ÒÒmvÔ^¯÷’ÄŽÍže«U±ë ´7íx¡ðH‰„°îÍ)Ì ›æO ºdÞ5ûvUÈô– My,œ ¾ÙØhƒ®+ïKäqëÜW&Æ_ø±+¾v‹Ü ,ˆ¾|‹iüì-.ÂØ "Ø0üq•ÙWSWD†à¸§âÜQ5©ÐeÛ4UNŸÜ—ý6ë>SèÉÕ©›~´ñø¿w“¶Sóé;–ÔEç²óµÕ™ŠÙP³³[È}¹vcs&ì)pžànàWÖò:Æà Ü„ÞcÈT/5Üë.Ç ˆS[.É)$dNRá: "\8J¼Qsà:£ÌÑΡö ´Ö>JÇ…oVé#ØB{?§¥‘ïì˪!F¨ºjKžÀJ2Ê—X¨Àâ¨]ו÷´µ@1ñì5Ä"T›B-t=e«o·Cúce#ÖÑþ’:‘D* f/r*Û(Ê<¼'BTœ¿uÙJ,ô¦‚y±V çÆ¾jØdûªŸ2ˆÎSì;: y©ìÜäVלp%FÃæ&Å®ßýíüú$ÑÒˆ®î›Èš'šH)u&eιs~ÈI/•TUÉ¢ª/SÁ‹~&ßNÂÿ¿'ÈVO(`™2‹nu2jÝh§IL dË•m‘—m±¢BWÔ§„£r¹µ×÷ÓåÅÅå\¶ ‹_/.:cÕjí)Öÿ0bR=©³<¿|"Ûáã6_¯HQg÷¤Pà&ÔC5ý 鬫•vÄFXÄ ŠA°L¨ °:bf²= ys>ä ÉNîH‚bÙ3ÒÉâÀVªÉÜ·=aTl}¢'É$@~:¿x'+öÍÛ+Õ¨@Y'"þrÖ"S|Kc 3ËKyô¾H-{¾¾D·¨¡ HŠd­Š&”ìBå;ä¶QJ]IùîëUSç%Eú(-*<8;Ê50Égô¡¾Ì±ôé nNèçe6º¹&us Z#±ªJiL¸3„N³*!ë⫯HçòŸãNÎTùGùNˆ—øXõE±bŒT“¿/—Wt³OGLBë È0éƒjÍ ôýñØ98ŽlùnÍ]ÿöý›7¬+k)d5º4¶<71’èØ%.uÜJãf$¡°A’`È ˜kÿP£KÊG~¾¦õ Z°"a’F¦ávºÝ°)ìùÜäÿ(t>ÕÉÉ”¡nLòœ9'ŧ+'}¡Ê¢‚6UzŠ¢ŸÆñI#jLœMY‰H Añü0Vœ%¡HQ–Wë{“C+Q¼žÕ°Ÿ(‘¯´l“ŒAd†¦ôãÕåõrª=JÛ9j IÝ%Âtª2êW0U ‹B„s¶Y{hH8-”éU*؉ìÆt»VTƒ—‹øqÔd½!¬{\n¢D|PHdg/ÅÈ ¡Ì< !ºæLVx©Žph•pÈ /•G:_Lö |°¼u\íÃÝ(žíuëÔ%ŠhêFÎú8"Q𪥱*{{…6$7ÄŸ°)5ŒE¿Òõ˜Ày2’òÑ&¾°#)m‰ÚãR¬Ö¡ÔÆÆ_xd€—’˜Ÿº‚BeÒÔJ5¸Ó–­‹¬ßƒ¶´W")¢»$)ZÍ ÔÞg(Hï¬;QÔ>ÊWñS±ó‹L*khþ¤òdùîD̨ìØV#ªÄäIƦøi‘Ò)5–7õkA^RÝ@‹˜êãôHD2ðÃgÓ „­‡g48ôGÜ*:’)°¯ë‚’ möŠ/N±†\m.\nìfLö‘M< ˜2)' PA\5†0è™ÆÐy o„ø^3ØIì!…]c"OOyQNüYH>Î% ë^âR–˜¶`ùáýûw'D“ ˜'“]ó™fH»D1©áO 7Ûwº¬Yx<–mSËaâ£Rc˜©‰eÖ–¤n»éx.@“e)-yßï>íÚ¹/º°)بhŽGKƒn±^#p Ýö –øX±|Ý*‘4ªLþ’1:nÌO#KxLÏ×­”•¬©.6ΕúzßN%yû)$J0ÌtZQˆH˜2e"X%Ã!P%ÒØéú‰Ì|A¤Ô ñ¬è_ªNHY)åÿ,.!ç%¾R‰è¶ç:&\?HÌ$À©WÕ>/ì0@÷(w²\ ãA¶ô(ÐCäzzÄe]>A%5¾È˜–ý½f× cþ¦ÍèHW¦Ð!„ÉÙó¼ÕØ´=ɬ‡Ô†)'iÊkTe%¿jè'P Dì&^üœáæ‰í»Ð5šÆþé8LF\ö,Ð5«Ï]ˆ}Ïô¯Ùð{Dî µÔúëNöšUÖ‘Ì,ÈK5|Òkd)«Ãȇ‘‚ê D-qÐ8Ðj(ÒÿyÌ£¡àÆ=_½ˆÊÏmÁðåŽï–³_ðï?°y„Òendstream endobj 80 0 obj 3198 endobj 84 0 obj <> stream xœ­ZÛrÛF}×WÌú%à–8Æ îyÓjåX‰#i%&µ.yK‘CkдöòÑ{z.¸Pô%—«l ˜™îéËéÓ `>̧?ößùæèåuš#Ÿ=}8ú%³ÿÌ7ì3,HéÁlydö–H–dO36Û p?b³ÝÑ­7ßÖë;•7Owj«Çö¼›°uqO/&SùÜ÷ï׼ܿkvpõä?³Ÿ `Äl¶8òy*õá^^.XÞ¼/ÊÖ®{¬«OO¬­Ø¢Ò¿×ª©Öñö˜åë¦bïËj2ûï‘ôcC=ßëÃv%Îb§¿]¿¹º¦eSŸ‡l6?Š#žøÒ¬ö.ÿM¯|z.BîYj^Üzoïn.O¹‰î^_ÞÌ.&Aȳ̗ÞɯgZý©Lc„ › iäúÆB^ûô¨`¨]«[Õ´Z÷æQÍ‹?æLÊ>’TIîgNmßõvU7EUÒö{ŶZpvQ‘)Új^­í9jqÌVmûøãË—Lm½fÄÔ¾©=Ù©fÌQ` Žlk•·ŠìÌ^ÏfWÚÈ…j¸Þ‡LEÌSm2ÝåÕìnÏ|’©3Ó—ìwuy=‰u0ÞÌØ !ÑÒiˆÃdÖϻʻc2žv®L"©uo–³u…°Øí ö,†`²vBd Â屪[z:¯ÊRÍõÛr­pDÑ2ìsdEÙïÒÔ’FM[#ÐèùËkáÛä—©/ìÝ?cÁeœeì#yt›ßš£]ÚE<Š}Û—Æ"Añ}â½½½:³ûþŒpºüf/ ôYµÛ5DFJ:SJHN\æñ«ŒÔÊ`M—•‡Š\.ìuZ—b߯•ß°eU}òZíùL²h೩ õ„‹>I¼±Q…à©ø/ÞQ]DÜÝUŽ÷Ô‰yÙ0„Æ‚ƒÞìÎÿŠà;qçïÅQÆÃ8´«dPyçå‹…‰yÜkÞMöKÈÒò¯ë¥.ÜÓÊçQõJE{J‡D1¢>É=ÏÕ $}/5£±šaÌEïô}ɉDŠì{Yèd,°º{Å$è€ßRƒÞñ8 ‡¸øKþ¬Êˆ§]0 –Xè6\á€úœÍºòh´@Î.Ôr’éêxùvÝröÎ;ìó-c˜ŠÀ°© mÉ4¸t¾dOÕ–ÈØ%sîÄêÀ:ìx"[&ÝGÎAŽÇ<ÝÑmµïHöÅwˆÒa’#ð)*æÃ¼BÍ­w\L$Uþ4òÚ6™>T’ÕdÐ [·‚ª\?±|9‘Do"á-©d®*½¹Æ”…v¿·[µÅ §­e€:ðÉã5 `a]AUþ¾¡j‘Ûj½[©’^^\œÎ( áéBDó$‰œweŒÎJú–(Ñÿ/ý‚ ’EÞÃv×/Ì–…5–¶™ÃFÔr‹²iU¾ ÖÐÖÕz3©È=ók€Ú (í£ßÏ®oÎ//ÆQ"i]å15]F)OÒ5ýâr" Cd\ÕÇ=B±%òñÅŠV‘†}E¬Š²UµñÊÿT ®­êMQj–hhñˆù™LÔ°'ú¿m69rï1¯õ†5^Ñ›UÕ´ÏX‚/6ÀVæ…@Xå-‘û²jµ›ŠZu‘u=Îç+¢»jtSéKÀ—£ ÊæG,ÌMeOn½’²"ȼe5È ð´ KR ¹!ŸL#ßl¡‹ë$^ÌóÄÙqYK\ÂG©ÃŠÏ1$›Åä”­@Ü'1½ñb0¬•ñóßÙ|£Îá s½˜VB 4ΗÞñn˜ŽAbØ[óÛä-Œ×èö€ÒënxKíYvĈ¿™X$<ê¡ÑØØf_¦Y iߌy_§p W%Lð³^a¢Ê!„Ÿ……% øà pBaÀ^³v˜IÇþ5WÔíŒ*¨‚Õ&Ǻ¶e4~3Ê‘HÆ1Ó„±€æ Që%g¯H<9)ŽÝ «zœdî­K2õé°iпÈÄ`U¾y\+ŠaA8Þ'ý„#{ØN¿$нj»^˜ a%™#ÉdÚg¡¯ßíÎL“tðôÇÔ7žÞíL€ðHº qmc°Œ‡GÞÓk0É8Mœû·­^ÄŒ¡'rÙK‚bß(ó8䥹žŽ»Ö× êê<fd^Ê=U5ÝPæ˜>GNÂß1v¦É7vD¿¡î¼Ñ;¡ç°<VãÆ5—HŲ8)è¯MþÞ´7‚–RúAlà7dÄ…y8/z8k]Ü×y ˆÛ¢E]›æýQ?u/Ó®êjû°B?ì%d NŒA¯“>NÊòu/=Jw¿éÌ€\I0ªOAð0”nâídà`mñé¾x@Êk IP»f—›ÑËk˹b÷ªÝ)E5š ‡Cv LØÏÞÞ]·ï³LnQ•?è4ä>¬NÐxg(Ú÷ýå|T—È©u»2îzo7@I‚5ר?6®dC8¦g6*/›¤´¿Î=uúé&ÇÇœn#8vîÈËÖ –¹3Ãt®¶Ñ‘k}dßv¡m™÷O77'Wçw7gד„°B&Þïç§g㙊Ý|qšâÛÖUŸj J `sÙ¹«ò«j½ps8 ¶­oTý±˜+æ’€§ð,I{9ª‰Ë»õæŒeUì6 ¨‘]-ôò›µµÚú4ƒ¡°4†IëùfñrïùDÚ¹ÓtùaQ’®ý¨ÙVx»F;•&E«¼|P:LJmå0凰gì ØQÂ~Ý%" ÌõúÙŠž£XˆQ¥™rÔXOcPSg9;Ñ^kOš&,XIü×{¨Ú"77ÕSCªëøeS-(}ÍmF“®RÉ?Ï™ÑËœæ8ùõ«S‘d5ùQfèjyð2D´ð÷JW±{å„w»‡CPB´²0HE§Ž‘ݳD3ÂE‹Bµb£PÁµœE’ê¢ù"$K©ù3V‚˜ö¹›Œ‰ _“èmÙéd ¬ÌºZí›Zí}²áб¬ ÏÂ½ê§ [Ú*ŠÞþ£‰›œ³ž_Ìή_ Y8ìÑONûôJ÷no¬GA¿ïq>{¡/¿&S3ßpj°W(fÃʉ~„ú¶³$? ŽÕuw¡;ü4I2Ð< 4˜m‰¬¶íCE`S¢^è…~˜€v½w{…OÛt ÚI b±ODèØy^Rôáï^p&ã´L̈_±|±¨UÓh*˜k"¨_шá Q®Ôô+7-ò­p£Ï„£_ö¤z5æ -kÌ¢Åòo/è}i'σɻi»§âGÄw“ î˜^j!ÔêÜqâ¤Ç4 =ôg“ØÝ¶jóØ2=é·KiÄE,÷û¥$|Nn½Ùš„@€ÐSå _ Ððt¥:-Ü—º]÷YVsl½D;F½Ùêä¬È$ºöÉT+p¡u¾´Õ8ãA {$ûiåóÆ&ÿÁÜÏ,íš‚}ÅòŽúk=‚ æ±Ë’@Cd^Û5Ý`yêºä2ߤôUBmGwDì›#¨‰~*ç`9eµmÖšxEæíœø“”q7ÿ­Ï,ðæî…¯?oé\u%±EÕt“ëû®Š‡ªVÔ«’0GV¶Ýú jqaÂMëJ=™tìhêbÅTå [?½ñ–=|Pß“eVR˜1Â\™™ŽèëÚG¯@}¬†ä­XX”&äŒBo甤Ұu5OX‚­ëMR ?ãÜ›|õÞ”˜k»ÏÝ]±]V^Ž‘SF!2,ýzgg«S£!¡)Óþ gõgÇ3‡è–§™±+ÅOôD¿õÎî^M’È%ïäüÍÙ?5ÕQí¶.iËBµ^P”Ï© Ôµð‹¸¾§‰ǹ,%B9œ·>«§Dˆ¾l­®Þd÷†½)O²þƒ-GÂ(áL9Û‘n§ÆŠi÷Øq$&ô—׳듋Ÿö@+žt4ÀÆ m§€ó:Ï5ñ1Îáì÷‰ÂË×H¯w4‚UNYEÐjœ ¿rTQ¥¥}S\mÿdpi4þ hã¡0‘Õ‡“­hûï¦´ÙÆ–†¦2Á{.§n©óFô‚Œ¤^õǨ~Ea?E6Pp€Á¤0 ‘JégÁm¦(èð»©Pß/G~ÐÏ ²Ì`ây;ªOš¦ÛycÒcÿgçkå^HFf¡……ÏþšF®á tQ‰~h|›ò“&­„1µ®QH=žu9enÒ˜$ƒCß„†i”w@‹ nÐáIIíÄÏ£‘HŸˆ€é ³1@íÚvÓ³³ÙÑ¿ðçÿ6u+9endstream endobj 85 0 obj 3349 endobj 89 0 obj <> stream xœ•YkSÜFýίèÍk¶@Q·Þ[•Ø&k²³0N6k¶(ÍLÏŒ‚=Àãß½çöCÒqÊEÔê¾}çœ{ý;ó\Î<ú2?—åÑ÷×1Û´GÛý~ÄÕCf~,KözŽ ýa¾>Òïp §¾›¤l^qá»^ÈæGŸœeßw2k÷w­ìê]wëø·3Vä z0;¡çz^ì¼Ïª>+Ø‹«gÿ›ÿt„NüˆÍWGžEjsçFv]^mX·Í[ÖÕ0£nØBõlþÛ‘ïrZ¶ 5&¸"I“@?ä@>µ“Ë^Oòn` ݯFCÅ“,”k8›@Ìw²¾èŽ-¸é´Úéyµ®U"oð«B"\?D™ŸˆÀT†Ng'TOÀÒй1÷,Á‚)2ÅþX‰^ ì+U-Åõa†üI“8q²&¯ûVÌr j wgz᪮^) ‡Cy¸vÍpf[/Òà“Ff+mz+›‡Bîñ4tU䆦T'˜Œáº`’ƒ"´(g€§z;LÏ»"_æ’®«‹áЭCÕ+ÈûŸ3ºÂ1¡Ü2+ ä£-N?&;¿¿æž¥­XbݧÇÓØ“F7WqÚ»¼Ê aÅÈzªn,4rng.›S”ËloðÈæJàžÐ'õ„ïH¹c};Ø%ü”,®ž _ß`w”ñEK¤ä?y71wCï0Å}7þ³wªÜ>–BÆj[¿óÇwÓ˜§6RZN&½{sŶYËúÝ*ëP–dâKÁ=fYµÒ)OÎ(êú¾¸×$aOàU>$o6ž.„›5ëòF—®ý0æÖ> m5Åt 1ZÒÆõ'ÙŽ¼ N á¿TÄŽ)8…Ñ/‚ûÇ›³»^|x=óMF^hÀן€úߊö@ØC´wÙùZ«ê Ò„V#oƒü˜åÀRY-³ÙDÉ•±MQ/pÕ·ÖEênûæ!?@BÒX¡­OüjNy ŽŸp«'Fܰ–ÈîQÊŠ‘"ÓQÀ–€ïÃ(ls"Ô½ÆÊ•GÐ'SÄ<5n³%t8i³µSE~p3Q¨Â(¢<ä­.åÔ”"¡æÅ‘óËé앹ID i‹âúòüòŸÿxR½(;1Ð'tˆ”!œ$ð ºÍQ‚Èõzüß¡Iu#0øø˜wË-«½íƒÉÒø (¡‘xV”Ÿœ¦› @¹àÜ©{uA]Ü ü`4PèÒš u·%õ–WÖ‹qD”a/|b¡NüG㬳 ÒEªbÂdÎ’6m;„ço |©6@f$Ü ñlmÚ²¹ywz}vèÞd H~² ¢“ú#r*½O÷™ùH@/J9Á\rȸo pG=¬î)â„ý…z~­PW`Ç?þxv}sþßo,^¨ïIñ²v'—ùzOØC3³]#ײ¡ió/„!²Øw²E‹cå]ú¤!Ò›€œdÏ‹õ¥f‰Ó+~O ˜]šddÏL‰ .ÂÜ•ËÞ©Shx–&Ãèîp Ê Æ™Å0 žõbŽh€Âf"£ÇGˆp<È¢)¡bïxô^b¦u©ºB8âÖ)k¨PЀ5+Ý7éIÈz&ˆ7ÓÄùc™Ó9*5Éý”H44D#¼ï;$NªvÈ*P^¦f‹ºC‡Ü!@2ƒÀćJŸVA×äzLã—¾“† 7(œg•Dª2Aüõ!øòH`þ*åV X#ë½ÐÂt$ÂOß¾½>»¹¹»yóáêì ½þZÄÁWDJåe½Cÿ±ÒÍ9€hA0¾ µ©ÖAÕ€ëj¼Íί"ˆñêþ¤¨¡Õ@ÊXÒHúhŸÈ¼lµjåç£éÔ5šï+Âà_ggW³”S¿#œÓ‹óŸ¿¹Õ‰<þœÂLrù±‚"ÔèMÇ&LÊ]VMãá"µÀ§dA{LâRÍ¿ò•™Ü!Í›Lel»‡È-YÛïH˜*Â(‡¿‡\Dª[ Ø…„¶âº)À–54­5âcH<Ýæ¨Ù̽´³è,øçɃmù0Wf¼:‘+&™sP5”D»ªÜàU˜‘rýg“Íbî5ø ´e¾ogü§)<ûáˆ×/úÔÊðFL;›ý_ÿw#ò‰endstream endobj 90 0 obj 3221 endobj 94 0 obj <> stream xœ­YÛrÛ8}×W æ%Ô”Œ¼È›'ñìxV±=¶²y°S.š‚,n(R!({½ûþèíÆ”ìÌNª¶\)—IèËéÓ§‘o$¤Œ„øc—›ÉÛKNîÕ$$÷“o¦_û«Ü_ðAŽ«‰YÃ1ÍYl&,Ši˜’Åãä:(w]}+ õt«dßnû› ¾™’ººÃÓ£( iòàcÑ슚¼úõôËâ÷Iœ‘#ø·XN‚÷Ÿ.çç‹ÛÅû‹Û¿Ÿœ\œ~˜ŸLÿœ pj©¿e‘þö¢À7!>4OÁVxÒ˜'h^ )HÝ6÷”\É^‘~-ÉRÖÅ®ŠhÎõ~"£<Â,¾fÕ4Ê9MD4J§÷g‚ æ¾Â#ldÙ6K5ƒ½‹^ÐneWôUsOÔ“ê冱çuíT”œµ=)ÀC·Q»í¶íÐéJÁkô’›àx¹”KR5Ú ‡4ã>_œF) !çøNç1£ùëY?[ücþCiÃCaròZÞ«¦—ÝÃÏgIõ A ÿjú4JC¦àþ<¦… ½“ý£”KŒ3-<ŠY ù‚ðUެÇÀ'.{/’ c¹Ë €î•Üx‡/þ/‰#{Y iÄžôöR+P‘"11Æixv<Ø”ÒTÄ®ž>ž\‘¢Y’‹)©È¸ޝ®>ërHò<8¿üpE ó§çgWhÄ)#†;ÈFÓWeöYš˜) i1uð9;Y\¾GC´€É‘­Õ:¼-ºb# X{}×ÖÛN®d'› °r æóºSÀ‚U ¬VÚ£m¡Ôãx!Oã4h»¥"«®ÝhKñìù$xjwÝô ØÍÂÁðÜ×ãu🷴‘}7yP¸3¤ö¹–3Òƒõû8‰sænÓNzCtK M=ÍínH~0åóŠ—˜.¬í%`C1×Xª+ÀÍcÕ¯­#_$ÖŸ"ø…G~fcú ¨áAX9Š›CÇ·.3 ¬rŸÀZëíi;Hi»Ùörp­‡öô§6ÇÀ†ü…ÍW'—GÆ0óÚ3ÑçûÎD eY“Ñ«o!ª£´pH‹÷þ«~è<£Œ¹-¯ÍQXʸWîžL9{tOÓÔôjºŠƒ T.p&s‘}KG:NëÑê¶Ñ•‰M¨ÝA–R•]u‡fȺuçe–Âu”ˆh‡¬ÕOyØÑîª-r ¼IþÀ%úH\£9ú@¤é…ƒàóœõÓlµÏ#˜B“Ä›µñ¹ƒ û÷i3L¸6²X!c >¬F&À¶¡:6E9e몑ÎÌQ2cÊ=ɳÇ1× Î ®«rMä¾\Jh–EnåƒÜ‹ƒÐ„ìÚuWû8,|‡XO™0v™zˆì¤>â:ÚBŠ4ЬÕV–Õ³iÁR?X¨óÉâçëàS³”ψS€¸»)@[—¥Oëb¿îYŠ‚÷õ¾è¶ £È•M+Pª–N"BIr àlñžþíìüòäÃ~ÖhòîŠîÉXXÝ7¨e{[è}V±½Ve:$ ÝÌ+'êW¾C»Ú9V˜{ôryò¶ƒO§hæ>³`ùĶj"ŒbŒÚO`€•0f£v`×ÝÜŒâ°ÂèKˆÌ$ ÷¢ä ‹â·Åâ"Õ=L™Œd§Àà…φ~L»«êfÙâÆ 8a’ÊNþöDõOP¹û+RK#!)!›ÕX™æ<àV“_ U•öÂL_¿¸X{7$#©~Ø `„3í?²ÞÞm„à˜{?¹²þõ|>?ŸšËÛ8ø1Ï©»ü.–‚Æ P(2 +ð‚&/›8§ÐÂqW†ºcöûwÚ2P{2³0N€2ýŠŸ,&ÀÏÁÔ> stream xœ­YínÛFý¯§(LÖ,g†r,°n›4.b[kÓÈNÐc³¥H•¤êxŸaº÷ÎIQrcgŽ%Î ïÇ9÷ž;ùƒø”ì¿‹Õä¹m&>¹ü1aú!±ÿ,VäÇÄøEòybö0q)AcE’Õ„qAý$÷“ko±©‹OYÚ<|j²¶Z·<ñaJŠüLg<ô©ïGÞiZnÒ‚ì]=ý˜ü:Ì„$ÉÌ‚ƒ½t±È—YÙ¦¼ü\Õ«´Í«’Yú{z›ÑiòÛ„$y;ñ®šlz&3ßÙSÄ`6æýtuñö|ž|z“$sÜ4ó)X¾˜DÂ.8¾Â¯}üŽq ŸÙÉ|0EHÃ(¶O}ÊU¤ m+Ò¬³Eþù´wI7ð»ló…±w•µwÕ’€- 7i“-É¢*Ël RÕæ5ù3ÆBIfŒo¹ðöü—“³Oð×ÉùÙåÈ6S_ZÓœYð–¶® rrz¬]çÆsZæ½çésûà|.HZ.Éå)X YB;uÄgÜTB¦0ôßW ¸¾i²Zï[§Ms?UTÅ~yU½$M[çåmCÒ:#eÕðˆ,³EµÌ–G¤©0ruv¨Vâ¡ HoLCkëµ×”SÄ’b±WÝë…Úp.©Ï£ÈžB Ø—$5•é*ÃXÌŒQ€itÁµÁJó샋ª€¬müÔÞåuŸDÙvžXȨŒœ}.IW—¯.Φ<¢>“Ò;>}¥md "(k/¢½KÛ#@X¼(6ËŒä-X‚#m؃óÀfIã-HÌ/,¦YNE¬òÏÿÓ§7 ¾è¼Gçï~¶[™FÅ,€CÓuó´Û®h:ØG!×!kŒÖ]Z“$m å5„¹Í4˜å!Óc*Øî‡4Scý‰Ì`è._Ü‘æ®ÚKr“‘ë.{_^wR\Æ©˜iXAL ³§à‰:xÂÀ'Öåš2ù†õšŽëºúò`¸¡eØA£.RôÇ¡ÑÀKWªöN¿Tc !Œ°ÁâÀïBèR©ypŸú6À?|4{ *‡¦|*8ßÂëµN6e¡÷%]­‹¬®Nû‡jãBš•ø>„äëqLuö–Ogûc8c”K¥¶pæê*&·¯¡ï‡Õ5¢qÎ=Õ•Çݾ§UC &1Ç=5ÆL!0'T;À ù5¨KÁžu& Ô#Àf ö¢=ïÕgް¾®rpkŽ®…ä¿Y dõ*/Ó0Ò'´G½qŸÃ‘JŽàG´uZ6ŸÁÊ0€B0ÚJ¤lÄ“ãX1ͯh_Õ‚ "xGYŸytñf„80ðFÖ5ÖV€ÍQ )y?eÌ÷:tZÂÚ×lgìèò ÃKn3ì@(ËÄ^U,³´ÇÐ'¨r®‚[ƺkÐZžÐþ ÃÛ%v — 1üPõK£ŽâX Šê|·óˆ¤@ÍÛÞÔ.VGÖ¯qgáºÛi-óiŒ=5 ¼ãËË™C37åÂF•ß…Î{wÞ#0¤Nì\ü¼ÃºâÓÇ=N›ÕXK=Kˆ8ý:^. *" Pc ütsÃÒ*ö1x>U}}×þspà™,ŽCñ \Á,?d{X Š×IÆNõ5ööÍ ɀŶSqÐ1ñÓi D ††E}À' oX$\Êtô°¿ETöåÂè˜Ô{á( ô·Mi:©Ãì ˆ .G°@ÂÍ,ÍxdP ͤ[ÞÙñ°,†¬SœPp¶a4ÄÝGÃ74Ú]‰´Ö2Œ aÀ±u¨µuD«ãXhë»å&æé߃)Õ!Uá^,…¡p­âyX²*ƒ'Fh±D³Z{,¶q5Äàˆª1>·P¬3ÐÎ-©ÊâÁL ‡àdÚ Bq—°áì€2¸ÜÖìÐlÖëªn·ë!%¯µH’Ð1ƒÀ…–1aK(Y¡}éMµi AÁ[1<è[/  ˆ`Ì‚9 #¯â"Žð˜+¸¶íäUòš,ëôsk~ϲ´†\¶3˜Ngͪ]Ï|Ÿ¶_ZƒI×/AÔá¶ ¢cÖÁÅŒÜ\¤eG0=Ÿ´}_Ô2ç‹qËh6€Š´éœv'÷Èåv‡¤AZk8zG%@˼Y‘?ó”OÃGqá]%oþy–¼==À©¾×SÌAØáÜÖ\ùâàHm§P˜d˜}[ÉxB‰1§ ¿qxöuÎl;ßg@º6jÇ]ÙøÔ9I>¥ë0á¤coÕX:ŽÕè÷UŽÓqÈý]^ôs•yÅ\L20BÑÔl8l·]5\à!ß’ùê+wqÇØ(*»Ù’ðx»jзþ¶!}p´1Ј*ЖRõ=Ë´*qœâ]6÷€&Ø3íø{FÁTÝ#6%‡ÜK9Ö‚”Eèt&sïûî à‘7ý;b¨X=,û6C5úAádø• täóò ƒ£²ã&:-ŠjÊ`>÷îûéÂaoµR}»£GÞ#Rä¿ëhA§VzãP½™’=Y>>ê:é•íàæzNÌ{Ü%2dËD¾ASˆR.D0y;…Ã"ÁUæ"{Iš|ýíÿ×`^§ëJFt±u&0>€2Âo è/€3h>iÑbÛ|ëʇùõÅ\Sü‰lêÞ¦(º©6}0Ç’öדЗ¤ìnB³v4>^Dà¨ÐìÅ÷=’Ùk—dènÉ.M±4Fâu!úVVÐæÒr wòvw8_°rp\…ÁÎë÷¤ÅþBuتpBB j®PYý%F0{tù±sõ5±÷µÛA܈9*(ºîÉxo9”ñÿ_¡‰ÂøæÅ¡§Ž71ìf¸A°bÙÖ}K½«÷õÔvÂFi쌒¢ÄVÛìÿBÀèuþà GN¤©YÆ~jÙ@æpŸ™Ð=xÇG¦ð»WÉäßðó<¢¾endstream endobj 100 0 obj 2275 endobj 104 0 obj <> stream xœ•YÛRÛÈ}ç+ºò2òVÔ­û#I˜„98Ø©ÌT8E «ÁdÉ‘dææüóY»/’l É) ¬V÷î½×ZûÂW湜yôe~.V¯/cv×xìîàëW™ù±X±7s,Hèƒùí~‡³X°8õÝ$eóÕ¾ë…l¾=øâ,6My-³öñº•]½î®ÿjÂÊâ†L¦"ô\Ï‹YµÉJöìêÉæ¿ø›âÿ]Õi[–±Å2kد,kÙ:k²•ìdC/ù®O«ðbêr/äÆÊÃí`%\ûÖÈe±X²vYoÊœÝH¶®‹ª+ª;ÖÕ¬[Jö·lð‹lVE•u2ÇYm»U7 ¹pê&§…›V²ÛºÑ—âB¸žHì]<Ú«k²ª½• Û.‹R²E]Ura»hêo“( ÅŽ«öp÷)näyº÷›ŒBòK‘Äwƒ àÿwDT¸S7 «  S7°`QÓ7qÙ•s”çú±Ë @ÎæAêF!ÌŠÜdðæó c]¨ nÔ;Ò9ú4FS2aþÁ¼e€ 7ü `‡Àiì²"žÂš°L¯ao<káÆ1çÖjGï¢e 9¡,c7E·ÊÚûCpY–V ”XšmS0`‘©(ãüe_9­uâ‡=¸Ý!S¬7L$ ¬êXÑn¸Œ€›YÎ åî!ài`îñ0ö ‡?탢ÌnÀX ×4Ö¶DÃYÖÆÓQhØr;îÆÚ*gë²ZÑ'85tE­ÛÕ˜(ÜK­óÌ­Ào°v™U¬®” Æ“‡ƒÓ xðŸ¦í”1‚¸ä ÔGÌô>_7²yTzÒ$·´R~Ïã-y¯Ý¬×uC¯rz¹bëbq¯¶¹‘m§Œ"·g¥v†Ÿ$€€Q6g«‰g>ëMòãD™4ŠÎo´2ð]Ñ㊖™¸Ö kë•´v7K8AÝ»¨òÍ­˜œÀ±OCçDŽU² P7÷¬©7U>íšbí²!‘ð°è(UÀ8]P£ÃZaù¢å–"¸~Ï?N\4Ê_R¢0tã J%RÄ&õ¸øüN¯µºðDIj9eäaç ¢^‘Æ[“0ÁQôŒ:qâ[ƒLL÷¶Fâ ]áõv¿˜$äÑ€kåäï êséø(¼>â3’Á¶×A:4‚VöÕj©ÕŒ²d¹ëƒ:jcŽ&!¦Î§ù‡ë7>Ê f¼íëm=‡ EjkÒSö&k‹ÅÞI€'ü#Läò–Næ Q§gsÆj“lSvHûu±‡– AùhÀITU-*m¿Ùf+ ým‘Ëi»nd–«ÔM[®AZІ€‰]厖sx̳‰íAŽôJŒôªyÜ.e#͵ZYåúf8§é±®ªˆ©Ý]% 'ζë:ç61ê@ôõ®mHº‰Í‘Æ8ü'æuý¾‰*Q_Éž¶ªH#Úë2Ã÷7•É7¨ÊÆþYdënÓ?²—lZ]¶L(ð÷aóîäýñl¾( ´ê(¼¼+îHæö3™†Aäœ;Ï>§øçòŸJgûËßÞŠˆÇÊé%×$]KGžÂIB¨Ô;ÿõ‹ÓJh:dy(re¤‘y½D½[¾ò€|îx?pcÁŸñÿz§ E iý¿¹)AîiF!­N?„ k7ðz%¸ w›Õp]æSE „àÚš.k—°ZÓ~êCIƒp§:u415‰\½*ú™ø]Ÿï…wJýñÏGHÉ*nurÌþ› å’$vã>;?XŒ‡ÈæAäF©®‡—½ëý)°0µ ŒìÐk~ˆ¹y‚²C ÂåÅ\#ñY±¨P¬~*"î.M}—Ôí{8é圬ÒFÀ2J³Xô¡"B6M{MiÔy1"Û„'†©ýsžÓªõ– ò ü‰+ûa:,3„fJb“Î`›*¶,”â&a@k@~²_±åT xb¯Ë\”°×vWŽÊB ê « Ëv:!Ûôÿñïg³³ã÷ç?ÕVÍOŽ&"<ß—ø)òG*ާgº@ôDàÜÕ]Nú™2@Ž—¢öè—^9YÙÖ*^ª+F/–ÄCTtΠRÓ¤òÕ«3…õ(r…oUv3Í(zMÎGö¦ÖÅa¯®&¶š0äNòZ.Ûâ®Ò¹îc±hê¶¾í¬(Øþ7*P5Ê–­×¥¹Ê®U•¬œ¯ ¡ê“Î*k UÁPËDá±¥MØ¿z„ÊæFâÔp_`n´O|d…h€aªÓ¦c+(“rŸíã3Õ_’›žE¿Ù{# måO)ý…ö„šn,ƒ™J‹ ¯ô2joNŽç¿±¼Éà'õ}zÓÈ¿³{T^•±<żŽþÔÊÖ²ëÖS”ÎÝ·Nç&®K&=qþ¬'¿ØZ‡óQ©älªq 5ž €wR nn&ÜÀyS”ùH](A!E§ºOÂåÑÅ =o24rÕa E+ˆ¯)}ÂTéë÷¹t6?ýø„5©Ÿ ‰“V<¡È TE²##ð{W/êÒ¦°>Å 5âäG…jEµ.áWbŒj«ª˜h",ðŠ™À•¥¬îä´‘íH×ÅíY‚FE ¹†œ«‚2 <¥‹5xX7»µµHЗó˜Lçën¢Òd߆‚òµ;zÂv%Ò¹mê¨@C7™íØ€ æË~ksÄ`-ó,N#\jÎC¨Ì*u ÎÅÉEßu{\ó¶‡'}K0¬ÐåÕS¼ÊBñõ|-«Ùìô½¯6óÓµ±g³Ùލ(èš.·ë =¯ ahôsm’÷ý!íÿ‹°ûç>]Un²-zˆm«MžÍ@*c™áOèc~ÈŸëÏožt›¾¯ñ©Ø“ËÒ‚ÌSÆÖQlkŠ»ñÀÉÅ×Îc·EuSše¹¶#¸„ÆâxAÁÍÂÕ=—ôaöÕšïGF…÷jOlHR©y‘4êëhÂTÙX¨Ý¨ÌíïfkÞQféûÝ]2%.·YïÛ‹dŠR=XlH ¶4^ª€;iê9Õ«Ö·zT3:“ºZª¸þ!ùÐ:¢ß^-R¯Ö4æî lt3e#ÒÌÇ5ö¢þúõ¦m^ãί«®\]“ÚíjinÊÔ”þYÝÉgjÁ[êWÍ%²mI!Åf£›'ÍñMH«îÕ«So"覄ëÓ3Ý¢”;žü_ÿãÜendstream endobj 105 0 obj 3053 endobj 109 0 obj <> stream xœÝYÛrÓÈ}÷WôòTÜ£nÝÏ›aà Sø$¦ NQ²Ü!𨒑dBæøè³v_$Ù˜!œËË©PEZÝû²öÚk7™ÏóéÇþ]l'?_&ìC;ñÙ‡ÉljÐ/™ý«Ø²ÇK,HéÁòzb¾,‘,Éžfl¹p?bË»É[¯Ø7›÷*oïß·ª«wÝ;/x7e›rE/¦3ùÜ÷ïE^íó ;¹zúÏåo0#e³ fËõÄç±Hhwï&¯ÖÕ°®fùtùÇdæsÉ–Å$L¹ C² ˽O5½óéEÆSóð­W®ÙJ•ÕÖîW¨¢Ó›°&/+êj]ve]ñé,ŠSé-oÊÜäÆšLð ‰Í^dOªíùTÖ ÃºÑ–lü XYiûd˜ñP²™úC¢ë}·oû4!Ï2™xªiqxËêk(®O%ÿg"†Úƒ'¯.ÏçÓ(⾈2ïÕò×÷ó—oôB½ÎÁEhÛ´ø““{6X"¢  rÑR£hÉ4KC±ªT¢³Í‹¦fÝMÞ1$ n6lUÒ/Õ÷-VÜNò*²ÈS­óíÊâ‹´…’ÇdW1Až°0pgÜ—SÇ<ðC¯û¢WjK¤àa oKíSµ¦X—ÝLûÈ»¦ÑõòÕFñÞ„»Ææû®Þæ]YÀò{ø°Ñ©ºQ¬®¨Ž}¡m·uKþá+ÅÍîßýÕüÙÓ£ø .„ü^üžÄñ~50Ç3ïs¡v{œ·eñ ¤pÅT´Qæ,÷rm¥äÑ [(M€r–Çi"ËlšRô_ËÐúYú×ɸxyg}ï¸\LMÕ ùت.gíývUo8»›Ð›OSIÑL/ßì*ùƒ‚i ,ïnðM æØ(ÖîTQ~)È•ý‰[Í®ë¦P†+pò96:".X´kê•¢¥l_ÍÕvMYtjm¶£Ì•׬ª»3D297››u{¶Ú‚²>›>:þ;o¾^cDzb GzˆNMf‰<ŽßÅbù~y~…0‚„ÒPè0.ß,  {¬¡ôù˜V#W›‘u³¥ÐnjlÞ²]Þä³jè™ПaWÑÓôÙ]¿ŸÛ›zïê²Ò HùOEÚC5۲ʩQ› ÇŒ’ÖÁK˱)7ÍÚr‹¦rNr³m§ØWçíD1%>Oþ¢˜,ªû¶5Æ/ˆ'ˆ†¤003Hæ`×û ØôدžÉ 2UFC=·U¤Ó÷½*Bï“c @ ´ÄnßBÄ }ýP-¦™´TBiëâ´·èÐ%ƒðèJh>¤¾äÑzHÚ[K«SåúŠu-ÎØ@­2ü“Ë®D­¢'ï€Yå´ ”î'3CÚ”pkÚèÏu’/ý‘ú©¥Í»¼¸%ÎH“$ó@Ø RÆ\dcÎ%¢¡½«ýv…‡õ58mGm­^o¶œ]ÐP¾ÛmpìjcøØ-UÖèæILj"ü5MÓítÙn-;GŸ¿˜/¦\Ê¥^êâÅ8ã#(\,½ÅՋ傚TWõ¦=RêÜvA ]†nX$ð˜KÒ—u§þÆ^ß”D• ú‡¦b«^ˆt «ükFE]Ä2BùD}ÊÓÀÜ}¦ •¾e¤¾zFêÀu?"¨µS "4·ùÆ-;JCK£´½'‚D5IºV¹¾¾?©Í5Ú¡ªñBY9¢ecöü’=™”úãççÏ—o¦BfÞ‰ûþ¾V~¿põnî?BU_3QpXíòýã§ó˧‡%6 ‘别,úþˆ@á›3ë+à"IŰ©­ÇÓ 2ØsºþDÜØc•7î¼(TÛº†šÚ ¤-|[LûÀo0ÈÀ[Lí¡¹˜Ô’Ój¯ºó{Ø_L ‡Âu’iºëòo–D<‰q¢„$—¾8YBCÇI1ÕØyÁ]iP´Ltèþ¿ýR7基ÜMt¤B ‡¨<£ŽƒéÕ5¶¼ ‚¾¾!¹ôÿs…º®Ôà ôí¨¡Hì¸áÈ¿ ç‰ñL E¤Ì‡Aˆ¸/¤ gO—“àç_†C¾endstream endobj 110 0 obj 2720 endobj 114 0 obj <> stream xœYÛrÛÈ}çWÌÛ‚‰ˆÅ îΓVæfµ%KE×&e¥\9"ƒÍÕ~ƒóÏ9=7”œÊ¦\e‰à`¦§ûôéÓ­_YàsÐ?ósµ›|¿HÙ¦›l3ùuÂÕ—ÌüXíØK,ÈèÁòi¢ßá,,ÍC?ËÙr7á"ôƒ˜-“ÞêÐVŸdÑ=êdßìû/|˜²ª|¤/¦3~¤Þ»¢>{uõôŸËŸ'8`&l¹ž?BÚÜ»mzù†-·’:Ù²ºØ©ßÖ¬oØFÖ²-zÉz|ýƒ,Z,XN—ÿš‘úQ˜Âjìå5ŸéYîçú3í-ÔÞ²fݶ9Tkö(YwØï«) ÚÞù~Áë„0öÃP˜-¯>,f´`¦ÂO’œÍ¸ />z7wï—Ÿ>ÜÏ·Sð8ò.ßÍÕõf!öÊ3kß¾/›Ú׿Xâç1­šñgFØ;ñ3Z(«Z.ß3œr}w{¯ß±ÛÂwÎX¨L¹œÆ‘Ÿç"õ>,§<óîóç‹ùBY4 pÔêäMï}A›ô4÷³XÛøqžªÓ»Žl_´ˆCw#„ Nÿɺx¬(eç³_¶ð®~²¾°X`DzªXqè›]Ñ—«¢ªžõˆßB>Iðr«:ÙXh}•ˆSY³Vþz]ß±ãëYÙ³§¦ªš©À53xûHÞ4«‚œúË×e+W½¯/¬.jÜyê¤0×Nººšãóüöêîíõí_Õ;ƒoà­(Q^¸—0€¬^5u/k|hžÔçËÕJîûÙ¼^5ë²Þ¼a[Y¬•Ÿêž¬/˜ Ÿ¹Ä+êµñRÇÖR¿„½ˆý$J) tøÍÄ+Úéw:.@HÄSaCÃ#Ù훺“ä:èJ›öÒ–²Ãù+Y*O[ˆ@ø"¶øþ"O@ ²<‹lî$Q¦[ûHÊVªuaæ'<ÌÉLvésV§WÓörýæ<±pp.Ìþ^¹†Éeÿ|ìÀ|}¡“,åùIXrÐÇm¹Ú²ugÖ pXo.ÎNCæåAl˜À[˃>Æg‰ÜãÁ·9×ðÓ[;ðQ¬ÁG_¦<·å™¿"VÍnßJäHÙ““M@E•^ù‰ÀŠjÓÌ49áõl¸IªñÕ–ýv§Ðqfû< ¸±ó{¹[ÏãáûWŒ¦W”êE:µŸEÜ^9MÔ•½ë'€èwÙ6³JÖ›~˺¾¥{>ÈÙ Ú 0«-äUdçð/¥®÷€”4EYÓf €l€Œ:¤î•}ðÃbå%†C!ÚdJÓbû¿ ÁùnÂîó›il +vÅ3^P?èõuƒ ùÓYœÂÅ\¢™™í]¯J¨êÁC˜‹Z…O+Yg?l‚¾O±™$‘>²nêÙ퇛öe* hŠê Q)a…¬€³mèszypÅqb÷?¸œäj‰‰v\•§ÄujÉŸÇ@E¤=Må¦n@>»—º|v{¹*‹ÊÀRd>ãÓ(~µ½ß/æ—oßÍ}wЬ_KijêT´–úè=ŒÜwœ‚°P s¯è‘>ì´Ìk™îÅF’¥¾à~bôÀˆ­Y/—·÷¨aKt€z¬<~¹^Ÿ DYj&,§¡©ŒmQw(>Ì•ˆš|ÒúMCŸO9Ûg×OƒWuÈü(r Ã-!Ûȳd°1R6züN•LU º¾ìP°º ªl«¢6,²FéD Ò¹ÆÃ-ª°h‚)Æ·S^!,G'æžS" *•3ëe½êդőE¯ë62`\ºõÉÀš­òM­ Ì kPeBUe¼¥+b¹ uÅ3–©l÷…c°Ø‘ÉXWÇØº|Ò”†^STåfÛà§¶Ù)×>öÜXÑ}V OA–Û¦~’¿wÜÈÌh;ªø5™pÂÁJ*:8¨ô÷¤àÉBG&1˜ãÚ“»§~œ¶Ö‚|WtÇ,j¥¹º ]·?Ùc&ªŽÔâX[@øê·‡Ž½ûp¿¤·•Þ ÈéÔ£ÖE_ \·cmÀóUg¬ HýG/ôÁG¯+§a“>ñê^9&Ðòv¤Vñ’p‚Ö¿o$~ 2î². :„1{TH› øEƒ{.–r?ä"ÿ&έ# ÞEâ§?Ó—[Ó£”Äö¨™qÕg¨´t („²ÐI¨ï 3W=ÐDK¬ä§E'èL$•zuüöÝ·´èw77wŽš~¹¹»ºœr*HÐûºêø ÃX´_î_D~–f®šƒvuô_*vYUZ oÛ¢}¦ÇZKkõIob¿D€¬ÓÅŸ»Ã"sXýÌnƒHæç}ôœD7ª@¥ÇXWE¹§µ3ñxGmGOâX{A´#ÈÂÁÝ+~:õwp1Q¦(éó\_d:»zFrc=á~¦ƒÜ ¬ë­Ç/¶rF&jÛ©?µ§Ñe¤V ùA¨ä¼€MK|ÇêÔ^,±Y`Ü£Àå¢B+Z›RG9W›¨•¿8‘+î„Y˜ExŸèMjÇÜœ…£SÒŒÌ×å›bQå÷e½ÄvõH·¾¥›÷‡¶†®0”èt«È EéÀ° ëï.ÿ¾˜¿½^œõ±3»zT‘¨>ÍUîJŒú°{LÐÙf¯7œÎ}ðP¢»Yh­9úƒƒÌDZ±nøÊzEê” í,™¤í82ömÓ7«¦"ùÿZ«ûŠP‹¡=¯f꣡E›>"Œ\n–àÚ…ÒÝp†;V­/ÄgÕ\u`²×¥ï¬£È\%²aQ1ùô~aLÕ4SÊ«u3Xª%ÎÝ’Ý †Â5³R+|ÒË'ÖRKÔ'°Ö4õ*± )©:Ùàå}º¢Òw¹™.Æ¡ ‡§9 %vÊ虊×Ê'¼Ñ ýæÔȬ"MÇX¥™CÏ´M3®z`¡¬¿Öe¯Š¹%Ák陸è½(ôfÈUj 6EBŠÄ$¼¿Cy $ý¡¤çÔܹœ,û5–jøW÷-jÕ¶Ñ™œ…Ú™ýËÃHìÑ÷nPg¼[ÐT÷l¯W> stream xœ•YÛrÓJ}ÏWtñr䩸QwëÊ[„§2„ NQ ™J)¶‚5Ø–Ñãù†ùèY»o’„9P!²ÔÚ—µ×^{û ¹`!ý±?çë“çW)ûÒž„ìËÉ·¡?döÇ|Í~Ÿá†Œ.ÌîOÌ3‚¥’¥¹âYÎfë!c6Û|æ}³º-‹vÛ–]½ínu3a«êŽ>˜Leò0Lƒ¿›¾X±Gïžüköç ^0U ›-NBG)4e»-ç»zýR&"y.B®¸dÅfÁ6uÇæõf2û÷ÉžÁ˜ù‰ˆ2EìÅ)Á÷’> 郜Ë,Ï"óÁç éØûË3Ö”ßú²íZVmºšýq>º²[–v_¯VõDÆp Ï‚]µù ¦B¡íŠ8å©ÊØTH:Vq_ŒÕ‹ªÙU½áìCÙuxLÉ$ÏUœ+BžØÛïªñ½ ¾Ó=2ç¹H¬Ū×><¿Ê]6ržæÎÁ—×W·Wç¯Þ^Ý’;·*”t·5d>N¢Hx’ÚÇn&kqéV|¥ë9WÊÇ*([—J¶.&ücݲtÒá—) } £\iÏÖe·¬¬¸ïÊFGN2¸ZµkMxAº ˆ<çažþ, q¬ò'àt$Õ诇! ýÄ|Š´OC@´ï*Îx’DÎwÁãÄ@÷±h±Q> œÍp£Á€Bᣧܗ!Oe"ŸpÿìâÂÜî½– —¹Å˜h«–Æ…,䙌 ÁêâˆÍÿ«ªPº©Êͼd‹ò¿›ž:ÁxÑj…ßš²¤<·Ü Fq%‘䩌Œai. £P 6õfŠªgw岘 ßyGÁ÷ªîÃû»ê[_uuO¥Ëvå»kL¡Š( vmÙ´§¬­uì‘­¦hölQ#utüÓìT±ä‘/º§$ ¬›•Íîö&z >½Ey¯!,‹¿¡«–8áq樟ªåòýìöõåÅÅåD÷&PûNj˗g•â·$ fo/ßi„ŒjH%ȇƒÁ/HŽÇƒñY–ôÞg‹E¹ `¦ùè†7ÁØþÝD„AѲ¯›Z¿F$hjît:ɤb‡˜µÌLÁCëaý–bŠcA‘ô9xSG í·SV{š³LŸµ­›6üéüÜ íüâ΄gžKôË®g¦“Ħ@xŸmÒŒy:†¸AÑ`9€Ù Kñ²rµjJ—û¶dof³÷ ¯¢ß»¦Ø´÷xlQt…áBúk—u¿Z€è<ãŸ}­³hWuË㔣<<¶½SWçg¯^ÙP)y÷Þƒàl6¸†,¸«‡d ¶áР7‹£W#”¹:èÐôê·ï^¿½8ÿðöŸçGÔBë$°’ ‰M+*]Þ–*`QnQe•äPÛn¤´A¢%ÊQ•š¬€0Û×½‹hµë J„ź÷A¥D^# °ÜeøÏvíú=ÕQ‚ŽDpöê¨n’ ÜŽ#\| u€¸éÜqšÿwi Ì•KH÷R€þ"òµæD(øÒ¯ŠÆÀp[·e™]…nU¬Zbé¯ÚŸÁ ²YxmÔ:™äZöè…^íR¢è¾©Šz¯Î x6ø%ˆ«mÐë zB7Õñˆ€Wz~¦ í·å Vl·« (@ŽŸÿ˜îv»é}ݬ§P'è(5hè["ˆq2¤`Srx žm 8ü½Û³{0–aJÄ‹â¹F¸Ð»ÖkâÓMe3hÞ/ íås3Ñ l_Ài¥È5È †`¨ï'¿A®‰ãZ¢ã^¿=¿xõḖr)§îêæ¸0ÁPè‹G‡½¼|ÿéÉPíT(k„)Á– DÃIuOݧ0Ü…ËE”j0•&YšËðÁŒ=d TVIù¤§‰Z'ó 顳@lüÓãn/ήþ8>4‘H²ôrGšvLŽZî% Ȳì0Éçêê?¥Îop©cÕ·GB1bèq$Bl”gåÓýøéHФ™0 ²š¶…´#:RB.ìË`•VßëÁ†c©à*¬*Óy­V÷p:\Íêº@g M½~ï“~;Byœ>6”V_šò0Šœi4Žž’Ô0ÃeßÕk mÔ9öˆ-©G‚{É»Ëß/_M"Û*?ÚD~)NžÄN½‡ì& Î-ïÄ=ÅS-ICÚQé„ZsŽ˜ jÛÞïòÜ›ö Zrî’RøbJ#Û ìšó«]ŧ‘2¿X(‹7Þ‘6îà@BßÇxuÏZ ÷°`ªGÊe±1CBï [oÌ·ºš«r¤öJ³A9ÿ ¹êLÜõÉ3:$Ð’™Ùkå<óƒÃn(P‘réW;6ú£±ò(‡YÄ¿:ýË9ŒG«GÆ:øfù£Ý3ÉvODð”±–£=˜¸!‘U­ŠÆ¬q œvUÉü‰EÍ ü‡=ú°®y_Œh-ócLZ®…š+Øw£ï1ÖÕÕ‚ý¶™[·ÄqjBÍyáñqºRÏýP¦7Ûß²š/G‹CÊñ}²;ÂõFÚl Ûõ¶l £fu/—Ôk À–Öq6ŒÇz›]¤—ÌÜã©‹4Pîm±Ý_éù‹¾2ñCÚ ­sŠÎínwš+Ó’m¯Á=º°±“5éaûgðó²:üÊC&JÏK.nÆGVìÙd–ÙtÜ#¨É ó¢ŽN†@ ˆ%Šy2¯»D²ízÏ”¼Dïuc¢øs<•*R’º2æA…úv3q õ·|糓àÏÿ2ë "endstream endobj 120 0 obj 3136 endobj 124 0 obj <> stream xœÝYÛ’Û6}×W`ý*5‚IðÂûd;ÎÆ©‰íµåÚòÚ[.Í0C‘2IEQ¾Á½§ð¢‹//û²5Uó »OŸ>Ýó‰ù<`>ý¸ßùföðµd·íÌg·³O³À "î‡*Å9èéšúô@q‘ª4²|{ž¦cuÃt•×+ÍŠŽ­qu¨wœýV·ÛëÖêæ9ÖTiyºiÙ¾(K–µín£YwW´l•uëjv£λ°‹­¸9綇BI¶‘Ù–GaH[{Ë;ͶuQuzeWÈÍ^¼¤Ó ®è%˜âÃ(%œ)Ë|0%y” g#­)Ìšõ¶Àj7œK“S›¬9<ÂYYÆà¥VÚápúŠ÷û³œ< g¼ÃfÜ'æ2}ðÞÛÁ'°rÛhë•ÁR©7ìiM}Á>Zbð´—geYT·,ÛnË"Ϻ¢®Ø®êŠÒœµk²ª]ë†}®ŠöN·Ü»ž<°àÇàìW/ß,YAUu³F& >üs±ßïˆáfH¸@°û¢Z±^†Ðl )lžuìi]-æ?Ìè¸×3¯ÓU·Xâ¡K ù}Þ8¦ú ¥'°¬<çYÕ;Üz™Ò796ÇСÝÌœöøC?8Yô˳Ç?={}N!}ô2"Wˆî bHm¤O’>ßá^ßFzY³±Ê ÁQƆ…î ¯Si³˜"p÷˜Ò“Ú˜ Ê¥ªtìVóÛ¬é3› oAï- ûŒ½þù©ÓtaîQ!Èït~Ïê]w¹I Å‘¸às¶[vŠ®gKŽuFHAHÈ#_c“p ¢ ´tGZŒ"e%”ãE²hB6Ýz‰ H8™p“¥%‘!¡ ¡"ËP¯?xƒø|Í·k´YÆ,Ùé+§.Ü1FªŠÄ-Wi7N©P-åì__(ÄÆ6B­9ûzW‚1nŠ ¢ÉìÚWéÇhöEkÂcE‚óòÇ÷V*‹û¹µ‹JÈP*[7²¢äìùÚîNVÐÞFxÔ°àj*Ô,³P¢;ãÖÈm¾v¢òÛýxýøõ?Ž‹Ä_ïU6¡Ì4î!,|iCÚÅHâ»^Ï´¯ •·þØQ)¶³î@t”Ò•½X½$P¾od¶Uo0Ë‘î©p O"ùÝzÂça_3É‹`‡H—’¬í½{\VÄ÷”4(N÷=†×M½ Ö“àÕÕˆ`Xüù–0íR݆“Mëd`™5&Ïü„Çr²[hƒr«ÙçR3›SA”P3B`Fˆ,(D òŒó.84‚š ü"LÕDÄ9i˜zZ›=^‘¶.*eŠjƒ¾Œ|Ȉº¾st>}ùêÝq辘ÐMQbv·¸¼Ëöã1­‹ •âq2XyµŸ"ÒhÔu‘Õu&Ç[PS¹"Ê H a3ä;3[YM¡­·ºÉ¬'žwÖp‘8Eé¾ËŽÑ•òd,m]!•8Cò/›‡1î¡×v&º} †Jt]tÙái±øZ¶ˆdP)¾“ð^±[xO^±šÐÁ·nŠ[Pe9ö®ù¥îÓPfJvöÔpeSQÙ¾i*PJʲž‹ØÛ;UtÔ-"µEúàR’"Ñ·d`³oŠN_:ôÐé5í´>pQjzé€\¬Þz¢óŒXúÄp”rºè+OgeD >4д†¥Ô#ÓöúoRš*jÕßU¹¹¼ ‘~ˆ'ž6EáyWô¥ÜöcöÐŽ4§» ‡÷¿Jc‰ y*ÕIKÞ“ñ{ïÑóy˜‚{Uâ­'x¿í9Ç*¨¾(Ü!Å«š¼ O¹& 2Ç’Q»Ç±ýjÛè",ÓO[ÈA”§†œ³ŸÚÂaÛn/(B?òpD‚mVn”Qo³Æ6À\7´wD™påËQÆø©µC—­kÛÕ }dDCeúü#¹Ýô¥ÄìoºÑ¼ÞY5L:öILªˆö}!\í6;€¿ì$(N•«2Q=KU'<(^X¤:°Éd Ä/Çwz«²Öެ9”$´hWeM:1i˶;q}u '˜T=‰lš¢L†ß lˆ¬øj`wãÙÍþƒ¢+4(<•Ñ'‡ÌÃè{[ßœg(¥×ègI‡¶%“¨ÃjÂòW#\WqÏ,™Ñ&v K4„‹²¨îÝ,]ò0#tÓLMÓHÔ H_£´ïºnk¤†5ª=8±ù’¦æK|9•7Iâ‹‘–ÐD®6$1&Ó)¦Ô4ä¦f%•Ry™i^òFƒ­X»ƒ,Ê̯˜•ì¨z2SÄRô©dì Øe«•Õa5Q4oü ¥pÔ圃7iNŠØZáz6ã¥1„@<’ðD84z“T<» x°seÓÜ•ußr ‚NVÐÐÙí<4WdO Ôöfþ‘—:«vÛ Ö¡¾ qC&aœ> þÿó‹ÿ‹Íñ †Ða©Áôî—玀^àǧ¥}ÊZ!òd¸­H—¨A™\óˆJ…×í'B;+›¿÷ìºzJ“¸Ã…‰-$®á°l˜/Ÿ¼üiù¶a{ç@6œEpl>™…úè«€ŽÜ…#F1‡²̈¶­Ãè/`ÒQ¶ U϶"6teÝšCÚž2‚_§/œfÂì‡(+Bö_ˆˆî=[Îþ‰Ÿÿ”UŠendstream endobj 125 0 obj 2785 endobj 129 0 obj <> stream xœÅYÛnÛH}×W4übj!wؼ3Á<8Yeâ'ÎÚÊ{aÐRÛâE*¼Äãý†|ôžê IÉvv=û° ±É꺞:UùÊ\.˜Kÿ™¿ËÍäÕyÌËî&_'B2óg¹aox!¡‹Û‰þF°Øcqêó$e‹ÍDx>wC¶¸Ÿ\:Ë®.®eÖ<\7²­¶í•ã_MY‘ßÐÁôÈ ]ó1+»¬`O¾=ýÇâ—‰±#ü¿XMœw_ÎOÏ>/®Ïçïççóóé⟓#h —ê5á©×>gtâÒÓ”'!ÔÄS—{QJš9MÃ2¶­ò²•5k+üø—¬+†_›¼ÌZ¹bM[çå˶Íêl#qD=“ˆåÄsî ¡;üÄÆt–ð0Mßœµ÷½*B}žöÚÄJ™¼(Ød]ƒk¡ ŒgíZ²sy+kY¿fk™­ f^*c=?åo u¹k“è“uÛnY-¿v²i!§lIÔrSµêo$D„1÷\« µ,‰•e8iêY˃ö‚I*¬ö~œè(¯ó†-³rlÃmUú6"Äi‚KVÕ¬YÖù¶m8ûm*¢/œªSgES©X‰8ä)¬³ê€Á)Y©õT±öK£ üOYê…¡ ês“îpS«MiJßÇÉŠW#O…EË­:mq!½÷rÕ¦3{”´(»$éÓóÿ˜·iÀC}ê>#ãÀšzƒÇ[äåïSá:ð~‘#âÕ-£kŒ} ½´ÍšÆ&Š %¦ùˆq4ÜšØP=T]­Å˜Dâl±–Ú¸ (4V÷+ÐãAäšú<°[½šuÕ+Ê”ŒÝvEñÀ¾M=ƒ^Y‘÷Ú+å^§Ö½qÀcߨé »e«[YCìÆÐ{‰Øy•[W[YãÂïEmò’S±í`*7[»†;®³íV–+Ý/wîCz¦ÖdÁÝØ×­¢bËZ>”ÕYY¹Ú»/IxàÚ:ºßv[O}ÈM=Ï‘ò:+Š¡QnN¨ÃXKéÆB¢.º-®b¨ù¼Ö7svrKÑ4xês\i,D!ÇB)œ­VŠ)ˆvµ e]Aùú>o$ÉZ¡!ÌÐu~ó`iS©XBͺÃG òRtÛÍœÙÀÄ}g§<ÃõY•Ũ°Q×¾€O µÏC êþ¼lZ¨k­c;PI³.© àà”><^.å¶}}È®®²6Ãó»54_IªžV':]{J %vª¢*¯¦3õÅ`´öG3ô¿,­ò&»A²QÙtÍ /Qi .Á¼òJU˜nÌм”ÓC‚^º‰ÐÀï{ïýzð[p‹íî;ÒnŠÀO2¸)cg(Þm‘-u{P @R;Ø!<ìùG*´ oø|P½-q{@Ì;{âaµÎ!T.Ä÷¯Çöâè%öàG1¤˜µkm²Gz&ÁnWPþ­ž'ëc‡`©·U½a‡>¨ÛÞèœ0‹R'aÜäæ;…ê„g§T4†;,¨Õwæå²èV*/MÍ'èù<îI‡šÈ¨Û ÁÄ– ñÝùéû£vÌðl™‘²ªÄ#zE™o¤öO„Úì–z‚Ì–ëžÒ¶rÃÙ{McßÉò¢.ZT›-rWyYe¥ÊÜZ6]Ñ’€Î¬¼“ìf*Rž&aàtwM¯ÔNñ Šv¹î‘y6Ð¥£®ØT0ºÈ©ci$ÔÈïÊ zaµ6bÖ³T&ÍV.óï(&up6"ð½VòJÊqd¥=W%N–—ºì$s[W+J€NUmÆ~ž/ˆ„|>»X`h‚ (}þ` ‘}ñ—Kb&f¦¸V‹›³³w˜L Ò­(ª©G¬ Žà£”ÑöHéŸÕr¨Ÿãå %jü€tmDo®zf{¾u˜òrE×ëX©NnÝ¢èfI8NãÎ!•¾§ˆ@;ŠM¿9ˆ¡ l—¢6­/š¢U^ð]î}ä{1'v@åòŸÑ,æÓ—ÓS]²¹b'È> çM¶ü~Qí‰Z£©•b„¡2Aeòz£Œïƒcý²Îv±. @u-ŽF°î`'pOቼš™a]Õí²k›[í:èÍ^ƒ.œëÆ{,òÝÙÙ¯'óG,"êÇVg¶'ˆK2HŽÅ}4ŒØ–Ø¥3šŒüpŠF·Ä<ä<&$0wÄ‘ŸØ ¢ÐÚi:Øå¼>M¸Ïp^ÏuOOŽ/æ/ä½A>3¨YÚ™€ÅºC× Òh—v¢4À.³FªCÙ¶Šš­ˆìPÅw¡*eâ•ȹ£0HyäÎEµ“çxž$=ê5ö4ºÑò@õµÀ•ÆÛl7±ûÛT]óÝ,%ëb;8¾¯Ìˆ–êÖ­å¸.÷‘3}⦆‰ÿ‘ôåŒ,å»L͆´@0uL5²£æÁÉ»ßȺ¾A6^=Í· ”£³_8{«è]hN¼¡¦"Ó˜©7öij;cìÅhfpÑxÄðÁqÌ2¦KŸFºx¸K¯zú0êp„´*Û›Ó†6z%dÐ'¯ ½Š¾²èÊ9^™†sr¨¦þš °µqÔ¶ß«}KýpàQ ìÞM{?yfˆÏ@ìÑœcžÀADÝ óñP£õC†fŸ˜r0Ø*o½hÊ yâÛyØ}Áˆ÷÷ˆò'F8¾¿öG#Ž!…ÑÐ"Oô}Ae¨P#‹[ÛæÁ4ˆµƒš¨ª'4˶yµ¾©j:Œ-¨"ñ:™Ñ¯ßÊÛJ©£g"hqÆNÍo½2Jž§ÖA<²¢3Oœr€Dq:ì—s¸t›Ùï £`µ)Ÿ¯ÿ>?¿89û¤ÍK#(ãµEÊ›(³›ñlØQâ–QÉ*TЖ)[m†LNÍš¦Û¨ý¦¨I xÜ-¼MÖ¢ÚÆR¥Ý¯eÉÔ&‡Â£‰áé=×mdhœ/h±™Ýþôžð«‡2¶<=Øê}´¯÷Ýt%zˆk9^H«WÄ NúÜFM¡ª~Ïåx‰§óŠtÈŠ(IMO3jžÉzòlŒè“Þ÷ùhý¶"JÌ~ùøãü§wgŸ  3ŠKMø¡F3œR€õEš-²¶âŽSødÅÑ—÷´O>·Z~®"ŽaS÷ 3Í—rpÌI޶e>î¿Ù¤QaxxÆèOai™Ò§Å®¶ –Ò“ùz`%AŸ%2¡4˜¦%"´–0µ[9»xB­þUízšpiKœ¨VíÇÄ-v´;+@ä°L5‹ÞDð0ØpÈ»â'3‹7Œ~{ö·÷æ€Év¹;©ŠÈ à°v€ÃÆÁ´„"Dk£~\º§þ±-òeÞÒ˜fèn×ÞUd¤ÉÀ+§ÁˆL›˜Þ)椡¡F‚‘½;®Èc«NM¤YÙuzÎF#±“{IûŠ ©¸¶Z盼ÈjÍÇÌ¿Z «„ÖϳÁÏ ¾‰ëZPÓûó U?á8£ÚÅ”=\*ÙÌ,w1þ£ÕªZ^è @@ñ'1ÛQÛ<Ѓñ?°P|ßb†øeœþ°ÄBz®Ðbî÷ì:ÁñBz6_Lþ†ÿþ ûójendstream endobj 130 0 obj 2866 endobj 134 0 obj <> stream xœYkSãFýî_ÑÅ—È)¬¨[ïý6’!Kv0›Ú‚­)Yn@ƒ,9’Œãü†üè=·z2•Ù¢f«uûö}œsnóó\Î<ú2ßóÍì‡O1{hg{˜ý6ãê!3ßò {»Ä‚„>XÞÏô;œÅ‚Å©ï&)[nf\ø®²å~vë仦ü,³öð¹•]½íîÿnÎÊbEæ z®çÅÎ/YµËJöêêù—?ϰÁÂØr ·`عi‹êuE˰®¨+¶Ù•]±-%ëŠlÙ¾(KVWåm²§ùòËL¸p)Ÿñ$r“NÔ#;zâÑç©ó4æÁ£deÖɶcm×ÐN5-\ HÊHºQâq³øYެˆ$MýàÖišb ‡`mÛȹqÖ4qž‹z·+Ùºêl ß‹Ý0b ×”Åw7Ÿ..¯–Ÿß]^þóüìÇó‹³Éö>­jåU6Ú; õÆÜõ¹¯ÂÔ¶,cÛº¨:Ù°®Æ/ȦfømST8àÚž/kÙ6k²Ä#²ˆ\’‰|&xìF^lOäžÏýö½ÀéZå½Ú[À5&6zõ®\³¼®º¬¨Ôñ+Xfõ=;Ô»†ýYª€-D€c'¾=‹‡_"åõc]®É©¼®Ÿ ÉÖY—‘óÌÖ.[ÂÜøÁ&;°•dØè£ìÚ<ÛJöû¥þùÏ& ïëf“u¬Vç£-/t--¿¿u¾ìj¤ˆSŠbßyØ•YÃ>,—W‹¶; ¨±·lZ¶Þm¶ˆš %Ρ(2æüTÌ¿’„‚ 'â»±ç¿R$U6÷c!õJŽBaY˜ÚŒ Ogt³í8«êj¡Ì†‰›òhX&Բߋ¶£ÂGZ½: ½­éɤ²bR眜ÜÍO'ͤºGVÙʤŠ{+1¤ÊG²ià–‚« P ³Ç¬Z—ò”Zv(:¶«(|>gôµÖJ<—Ť²E¸|ÚWe¼›³ÎûÂç©­=ãm‚“Vl‡}öüq¡k.Aëb±=ˆ:ÄPk-ÕÑý®Û5äÝo; š”ê…êB->WU¬ìþ5üœª5ªª²õšmjØC*Ú¾ŒQ)"¨ˆØfÎótñ_ïV-í\uú • Ñî›w&î+ëÆåìÂÉíšü<<]äo>iøù»°‚u^2À •–êk`Gþˆvùþô]¨[ s„†#O¥SÀˆ°i“åxC‘p1ì™j*ÑœÁöMÑaOXT¨Vá§{ªê¹Ü4õ„³¯T0úp"Сí+7ˆt j‡v+óâO´5iª!_~øÄ=Ërm·®wË^òsV¶µ”Vc !—ŸÇIü:¦´ÐU#°Pèö£g xœL#ë0ò{¶¡f¼¯Ë²ÖeÓ“|Á‘Df¹³Ï†²…y\Ø”Õy¦¼tM«×˜‰#×óãÔVïfˆ¥Ñ¶CÀ3F—­8>*Jð) Ý:-5}–çuCôWæ‘¡#M3Œ",u ~ɧ¢Æªï€+È(-ƒ+–nn5PcDæ#š Ç•ª«‡c”Ó;‡z‚v<î Ÿ»a¯™þV_p7Åq[€}tTÂÐõ£>*ÂMM6KÛû”Šªî¼ã¸ôc#·uCŸ0Ù4pÜV©Á#—EÄ]Øü[dü÷Ù§·—×gG¾Æ€Ú>“Z6L‰42¤ùÅpÃneÿýÙÛ9§ú Sçæ§o>¾[ž_~TIii”Žo¥)*YóÍ­£Âäˆ¬©TƒÕl]´Û2;h!¢ÈR¦ «?NWCyª÷Í绑‚$B"¨œ”Z~.ÚbE#åz•åOÔmšz|ó¨]Ub”[«Z‚•mÝÒÛVJ.Y[t;ÕG/i鈕®Ï®¯)$ß"s¡B1ðQY# ˜((œþÛdÍ“ö+£ç••¨vk°Ôï>ã]è üãÓò½ìÄ`Ñ  Ü@ .—v¤QXûP#Ei"Rh“‚êÅ.5Ž¡5*&5N’­ufˆ ì–DNØ}So†©‚hOÄfª0k]ööÀÖò^× Z>ƒ<9íç.…&J;@@-ZªA| CÐ~:‡¿ÑÀž¯9à€ ;œUë-r»í] * û¶ÿØŠ{ !Å|¥F.ï‰õ0Ù/“•ØQ ´Ï\O?ו*@×#±ªãœ5#Â*ºGŠ5?¢—„óû¶h4'H+MCišÉ$éënú½ôÄŸJáŠò?Õ¶Qгz=ú–iGæ@e~¿B» gôXÔêU}ÏŒ}9ªæÕ|l›¹R@†`6ù«ž»8¿^~cÃɨá´èÓ³¡"=R¸ìþM‘7æÏ×G´~,cv£Y‰&lÏVMc^CH2šC"íЋQ ¬u-»…väÌuÝ»¹ÙK©°¡°^Ëꡨ °Tm&˜&¢¤ÏR¤»Bd£õ˺—£ɾػ†Œi¡ÙµÓÜIÐq"ЯÆÝÑ“ͺEnç¶“7'Æ&kå¸ó¬ªÄRA¯Ž<UI!…ÀEœÞ¬×t¤ÊL)j(á”Е lÀl† ^©#ÑO§¡¦Ë†!S©j"ã.AüÉè^fpú¸¹{5ò±«æ²ÄìÜÇ95#ïp_Q'Ö׉÷1Hõ ýUW¼¸¹þ`|æîéaø‡>Кí&®â—o/ßÏOó?G²#ÁPÚÏ#>2 éè»^0ÈjkûæêâróþØ6 èe‹îDl ˜ ”ükìHa¡‘àÿ¤!7“œ-ÿS«HëJ]€RZŸzÃY‰š€Nkó¦X*Ȳ¶w2‘V˜B†;¢D“ÑÞeË¡îIBõ©}4Wyev¸ ¿.ÖmçXÈê;.‹Z¹êÓI@P¡÷iùË›pú†@¾5wB…&TŒ¼zÞ I;V%¸@MøÇ7 ͆/Å{&xß§ò ¢}M÷m­@0scÆ:Êù$á¨Öö¶=™&»R~•l=¾6‡?Ô˜ÀGkðÉySØù(4£?5ŒÔ©Öÿ{ÒýÏýM´TQÓZ¬š¬!€ˆâd&¦LÑ‹rz£GéñmkÙëÔðµ?T¨IE2N× H†0Etimj«¨žZögg†9ºIùj$ùgOk¹¾>Î*=,)Àç®7½c}9Ûã_·ÇìÑuå"Æ  ÐP4Š…uø¾MÿyÒ%CkAË ë} sýõ¾ˆè³³åì_øú‚tendstream endobj 135 0 obj 2849 endobj 139 0 obj <> stream xœ¥XkoÛ8ýî_AôKå…Í©7°X ›IÚ Ò$ëªû@³h‰¶5•%W’“ñü†üè½—IvìtmÑ6"y_çž{ÈïÄ¥Œ¸øËüm'?-"²n'.YO¾O˜úHÌ_Ù–ü5…1þ ]MôF"N¢Ä£qBÒí„qºIŸ&_lß”R´‡‡Vvõ®»w¼û))‹%~˜ÎyàRלO¢Ú‹’¼ºzúïô—‰’9üIó‰sþeq}{—>\}¸¹]\<œßÞ¤7éÃõÅ͇ôã4ýU­e׺4âq®ÖUÝHÒm$9¯«NVÝüZVënC6Rä²Qû(ÇÕÙ„yõY‘¡=šâGW}`4ö¸ùù¦h üÞ·rµ/ɪnÈÙNd`€ÑßȽ#ªœ´Å¶(ECZÙ<â!,¨gFç<åœlZHÊÓ¦È6ä©(K\:÷<Ÿ¡?„âF±ZÝÈ]Ýt¤¨²ºidÖ‘LDJzò\Ê–Ôê(l |9 ÜØ8ÿ(ñ#üÍ& åqûæcÃ×CÈ1õã 1_ õ!¢‘çöG‰å¡“-%W+H/$êVÔ•IM>SEUa‘ªîÈR±,•õ9Kbê²QˆÜUˆ]MDûD'Ë1ïšzÝȶL­:ò»ƒ-`E•6W!sžÐˆù6ËÜ4Ÿª²°s#+µZU…ù4I\5 ²Ê[õZÉl®€7·§Y'µƒ!Å"ç¹Ì¡$¢p°ªÒ!CÁõcšÞõ`ýùâüöç«›Gpë܉¾ J…@ómK)ëjM S£ÒvÙÔÉ.®„ê¹>"“ È@7õÜ€&.sj¡ÂS&x'Gñ`E  u´èÊeVçEµV…†öDӿ˦ž½X¡k³45ö!¼˜55æó¢Eäãã):Ĭ̧k•h<``¥êË8u{oCéòŠ}Ù½ôe9åH1~âì;@Ò÷}"‡z * ?-˜kmnN7þ~íëw6 @0çüüþqcJ¨èÑG@çT¤ØÝFt§x )7xa±‹{ÞÀLº8»ù|y±ø_AãûÞ § ®Ô q-hxâSÏõOAãñ ¬ðhºFTí zêmÔ¼Xr ()QãºÊ73R¼…È3"…©Ñâ)\ÜOim^²Í¾úÖ/=/ÝYˆ=†ù¡†×¾bmUСkKǼ7Šóõ¢¿À$š sÿó§ôŽ@õ¯no>c.l µ`ùéìêúár1õÑÍ qn?iÚúãøà^0àcWÐ@ º/T€”f[TÀÄ0κ͸ØÊNÏMã@Ùânܼ:7=ßO‹¾²ˆYk7õ¾Ìq,à´@»íNfÅê`(º‚áü^ÍÎX­:­&Ú„S64«.†ÜŠ¢$tšíñô\¥V}~*`RDP„¯ÊI=-œ³ŠÔM±ÆÈ¡Ï|V¾>Ë\Ÿ'ª5ÂoÙˆìÔ˜‡ L\¯§U_ÓªìZÅŸÿ#_4õfYÑÍÌôLÃT±Ù݃”aÚ3ksf†h€^-ÄWM½%ZqÀ)ñùˆ…º@r X#Êõ¡cŸ¦Hn®9¢Éa˜_NY i/4gÀV?Ånx,rˆ~.ëhs?úVA˜ºF±ºÕ諳’ (ùñ$ŽßÑèk䯨mð«J>ÕÌCýPgѪ‰Øx(0ú’tXyQÁö]wð`rÖâ”@"ª¸Ê‡÷)ä­…‰‘h¦Bà¸ˬ;‚ C7†à4vÀXÕQÁhÃ3œ{çl SŠ^—ªÏçwé²ìFot7”õnúD¡,DrXÒ¯Àí¬Ø±Vá@´­M®B%‰1I ÌÖfÔi8se Ó/Ýèa;‡a2¿OccüÐ5øñ¨ÏýcG†¶$7¿Ç)7¦EYôœØ‰A€žUóÀa{ÔÌxÓhqÃ1ÅF¨ò˜-nù;Ù€Áç²Tõ¢äK+õΑrAZñ~f9ƒ±ÛéëÌ‘=¸ÄžËÆz2›5W%XÅ‚÷ÄX dè%ýŒ™Z5S/9ÁAÓÊQ–Ã%jdFQoVY,%´Ê~§¦ê@$)ËTSQ0Ãjh9­ðØ^7[5t¹í5ƒÁõ…Š«»•67“#¤†qÛÛÜž¨½Å²€0²(æ˜qçFo2:b`¼SÖ½ãã5¦¿Ù<ÉãÛÐ"³X4·%øè¿¸,1 ÍŒ´Ãă«•x7ÑXÖ1¡üD’@ŠÕñÜH°v!4S‡ƒ!ðܲ ]†ÍkI^1´â~kú Udä ”Dcn¬¢=ËÞ.㊽sHc[ å“醷+Yee­øKt#êTÙ$! ‡áó!Õ(zÁ*ÊËqš6ÍÛ#=ïa⨖ò/¡Uõ> E3j´·ê1fºx΄’`÷Îß—ÿ‚»Àv Á`Åå…–ÐÓÊœ}|ÙÛ(qÒ & ¨‚Ñ0Wy éC£¨‹àÃg`xô£Btqyxœ¡=â{¸Þ›¸Cú§¯o´þK1Ô5ÍúÛß;ÿ¼»ù¡P_¨×}«¼„½) p¦ggò]/ÆÄÐ'¶Ÿ´Ù“,Ì=üñHŸhܳi€7+9_Ò?¬q]þk\—[ö2ôDã2΋^¯q­æxMáŠ=ꔮȄæ/Îc¸±Ÿ¨%…'Û÷t/ìè  ‘¡FËmÑ¡÷[X Ö¦oÁòRb0,ÅA›@;ÙœÎíi`þ©e–ñY\¦ÃG”#Õ¦žr”n´5h©¾­“K·ÜÔ+Z=C4·ŸTæ^Uïh”©³!#gŸuc.qcwt¨.îFž^Aõ‹ª¦Ï ¤>2‡kµ‚³æÉWÅ ÅóìUýrDcqÒ¿íV„»Loªæ‘ÝÁ#üÙE:ùüú½Ùá#endstream endobj 140 0 obj 2574 endobj 144 0 obj <> stream xœ­YÛnÛH}×Wô›©Õa7ïÆb™Äƒõ¬wâq”ìÚƒ–Z6Ç©”Ï7ä£÷TßHÅö‚E`È›ÕÕU§Nê|b!,¤ösµ½¹ÌØ]? ÙÝìÓLè‡Ì~¬¶ì‡%äôÅr33ï–I–Ï ¶Ü΄Œx˜°åÓì*Xí»úF•ýóM¯†v7\ÑõœÕÕ-=˜/dò0Ì‚¿•;¬Ù««ç¿-šaƒE”²åzòDXãýN­ª/jÍžªá¾jXÉveÕ±vÃÊæ®Æ÷·]¹z˜ ì!â4PCÏ®ƒ?ýùzÎÙ_ZmV† Ïc†ƒ'5_þ>[ °¿š ÁcJûðÑ=ŒéYÁe^¸DJÝ1«hÎOßhR¦ÖÆU°)çQ(x¦A£´!­B¼d,r³ŠÎg¬mwÃ3뇮jîXÕ³} ÷jrNí’Lb˜³…ú}sô‚ÃKé£?UuÍnëU3°Ûg—Vö¬SŸöUG{f—?¾•Isœö|\߯×xŒg\&ÐçªÝn(- ).ô9¼2캪ÕµØÀ›ÆEí„'-a˜’†]Õ¤Ÿªqf[·Â'ŒÜ˜d§aa¨ªÐÁä¹Â$ }¿æD‰Ýè·&­¾ßã|×Á×÷ 0ëg4'*잇²äñÚ¦q—òö×wnS“STN:6Tä M¼rF|èd©…Z£‰ K dÇ„¥©I˜KKR©×FbnöÔõµTжKÞÑv£7历gs©t0å)—™ð©Œí JÕ¯¸íC—Yˆ`‹E2}¬ËyU«RÏ%:牊 üìi0–Vy•T“¯²²[šüúH"„-ßa&GÚtst¼-¥n 0Æ+3@b&ÇŒ'óvÀß(n¯=¯éY°ʘ•wó$ ébÂ)¥¦DÂNú!š€®p ÍSg¿ÒÚ@ù Y‰X€Jý:pE&Ä’qtñaÖµ®õYÆã$úêNCöN#çƒàx7UÏä…mµêËg3›EÓ’L¹/dž Ë¥í–ša³„pìªþ.~gÒ¾-Ìî4¿ÐîO&K=Ý=Í ÃQ¤†#¬Fà ˆ(î;$4¼Ü†üN¼€©#FþQÓ»ò¬îVMln¯!‘Į˜ù‘Í÷!"²Ú+7¢êÛ£¯.¿tÀ²µÓûNMo!§¥¿NÓs«Òtñ¨¥D²a‘Ê_+*=à¦)_[Ô¼y.­f韂þòÇ·w"ºÒó™,‡#)ì/L¾­×¼lY›ñ Ú2úkè.L…qô°9äOØêþ®ÛãcÛ®é£õùÔ@–ãgû°®:Wšy¦•@C%ñ«°E¨=pDnG)˜î”™å»-ýIÓ8ŒÅ‹=ûI?³´pÂäy눡¬ÒÄg4ÐA/²4ûä<°é!w s8•׸ž£R®SÏö¦rz]–rK‹LðœÞE~\¼ÿ°ü?IP|ë6Ì"G͈Qe…î?þgePcÍð^–˜ëé…U' º:žk»Õ±‰LQãn÷Áݾ¡kæ¦eªëàX»Bz:w¹l¥NR$ßnä.vê4ºÃÙÑ«Ó¦È M[þ‹Fÿí>O|³Výª«nñ·.'mNàce¨»°r@UY øYñU›“èæEöz›+rǬ¦Ëi ƤèüŒç#Ž áØt2HÝ0]1‰ŸÆ„–ùîÞ©a2æÅ(†Sî ™Ów§ËÙ/ø÷/•nqendstream endobj 145 0 obj 2980 endobj 149 0 obj <> stream xœåY[sÛ6~ׯÀ[¨%Þ0ûäÄîÖ7vm¦Ž½“¡$ÈfC‘ AÅ«þ†þè=7RŠ›4³;~°MÀ¹|ç;ß>’˜2ãû½Ü̾»ÍÉ£žÅäqöqÆÌ‡ÄýZnÈë^(ðA¹žÙ5ŒäœäRÐB’r3c\Ð8%åóì>Zîú潪ôþ½VC·"ñ0'M½Àæ§g`Š´‘ªuµhyp2O³¿8òZCêA§Œ±Ÿ?© Žx!‹ÄÅÛĺ×xrN²ñ ©×dßíHÕèÏ>ŽĤÇ¡z{ýúú<Äè7cÍÉ ..`>;™z@Võª}…§pjŒ/2Ê™”þýç1Žœ:³£®ÿ@MrEoË—ªíüòöêò®œ³êŒº~{ùŒqœæYvTlgÛñ(SôÒƒ’ã»ʾÚ(¬ ˆ &‚‘A56¥ÜÓWýÿ¾„˜â-¬Ñˆâ?ø—{µº~oÝÎ3[÷1%Ïœ‹'u°¦ q’H>Zcª?jõ ªî¼ê @lDxF³8¥iÁ†7kŒÃ%ÃS5ç€sS¡u»lv+…æ]ÿ¡ô YU˜®†%%%fW`4ìjZ!wøD_[†@F¸É*2+—ÕNÃVUkV½½º+=+aàÈE-”|ëß0ÔôjÆÓœ:ÿ ÐO(ÙÜ$07hñÒ×&¤Ôå1K2f?<åЋÐõLF^…âÏ'ÄjÝ+ÝmÔh,)$M¹g+0EÛ˜ ÉAÈ#Ë]­¡&›wCÝ“^ém×j…þ¢ÿä3ð2uÆFÿ¦ùÏbæñ¤&Kª9Úo¦nñ"ö›ÕOi»!$Wï µÉÇŠèýfÑ5õÒз¶åÅ$P 8†¹Äøä)7ÎÝ9NšÖ±©ÃõfÛ˜]_@œrù±DÅyA¥§KRRÇ?sí>jë¹à)eТփ˜ñ“ÇTÈ„ùæ©M1Ô  CiK.¸-ð ÆÓËHŒ ÓÏ|Ä Ïõð>è¦ÒO'6ϘŒ×ÖóS½|"¤·®µi“­Z*­æ™a’$²5Áh›FCö¯Ù åø«Ÿ&™w$*wÓL >Ðê èS²†Ê:&k¯ð¾ŽÔøëåÕù›³ÛóŸÎæÐã”Bùæ‡#ÒÆ¶™óÔ·­Ü*¯Úk ”Q¨5—@E©¯¿5¤»>H1CL:ÿ«F5{WIÔóa„£E¯ª¶ תv¦:Uk Zþã>z°ÜâBbé …Øú¡íæ*Ï£g#| ªm(û Ólg°È„çcä~Ûͽ¤Ü°! , Ë|Ä!DËãûhúýáÐû²I 98»¹¹x{n‘™0ù…V”ÒLÈpÉä·´¢j»U–[ñƒ^mºÁ2{=vî _"N @Ò¯å«îkت\K¨rIEzD…†ЄÈ3$Žì¶MW­ téa»ÿ9£sÉ-žmxá NÔ+ƒ>9™ŠÄ’Äg4ñm¼FÎCA3îÝó„'@]f±?x¯|Å+€••ZÈéAºâN’íšaJ†‹ÍËÜF Ì‚8Kq¼¹ŽY¼™}„c „²wgÐ9Dˆ\pàd1q.y—ßÊ;ä˜`ÂÉ܈',ã¾L¸+<+Zp ‘Üö8hùi1AðÙ4)EHÊ}Ç‚õPÛ™“ô§þ?$ÙÞøÿÄ7·å7q(¥ô‹\(tåø¶»3ûhºAc8üZ]ÈXŽ€…ÂÄAX5oTooô€óeì{Щ-z‰šhrÍ™3;ÿØX¦÷)è…l2†2wÓÐë²—v«~=lW' Â?îêÞqmמêì©úU°/U>›œ5fæY¹ìÏs–1Êm»¿G‰ ª·qÒŒ"p¶Ã9Œ$²à‰‰Å¦[)J~¨ÐèÌ‚œ™9Îium}õ‚fäR‚³iÊù‹lšæ,Ð:wï@ìüå²¶V8áS§HµÅôÿÂÀ»þû×JþÍíÅÙœ1•ﺼ»»|û/¼¼ûö‹öä ‚>âÑÀÐTð„d—0¹Â”TµNÍK+A8² fßOÉFÄ"ˆy;®Pð„¾žuŸäQU7æÿͯçÖ7ž´àÙÑEÝÅ—ÐX´>\ºáŽË§ª}Tãµ&|¼¢œÅ†Q߸èD/TŒü~¤–r? 'P`“»$ì¦á^0\rãE ­æþüÂ;ÅÓe×¶x¯Ðµš~1Γw t˜Ú¨zŒÈÕ,ZVí+¼R¤2ãî‚"z0:GžðpíŠ÷ˆ&˜ Sý0u»j”Ÿ­‡ªŸ³"zTÃiÓ-+{9߆Û½¯Ã—3:´­2ãxçÚ õæÂ‹¸œBMä\åt‹h ü^퉲_çÀ û``ôž4Õò³Uý¦Öxãßž}q€ –âk³ ;z¯P6OóQá« Ñ;ÅÁÆ^ñØoç\ Oú·Bxêe?”ÃØØ qò˜Ù…"¡ÜK¯ˆK|vQÎ~†ŸÿÛI˜bendstream endobj 150 0 obj 2847 endobj 154 0 obj <> stream xœÅYÛnÜF}Ÿ¯èÕ‹9†!»y}TdQ¢X³šQ‚…½P3=ÆRf“´ßÞSÝÍÛø†,,ØŽIvWª:uªôy®Ï<úeÿÜgßßÅìQÍ<ö8û0óõCfÿØÙk¼Ð?¬÷3óÏbÎâT¸IÊÖǙυë…lý<{ëlÛºØÈL½l”lª§æ#ÞÍY‘?Ѓù‚‡žëy±ókV¶YÁ>ûöüßëŸg¸`!"¶ÞÍ<— ß¾j²ºÉËGöœ7»~êçì¥jÙ6+YV¨ŠáÖrÅ>Îyà¦iè;YÑJÖTŒŸ³çC¾=àë¢`Çì½¾ˆ»1¿ñ8r_À=\êÈb¾þàAêâ?¶Œ'¬–Mý‚›$»üý5ÛVǽ¿àIäÆQÀ>·¶Ãmû1+w,{œ“Q‘œ,/Y¾×'¨öAÉ­,öë/ú0ýò^Û秈æv:Ïb‘å…rÙš\ÅR=ÉmžÅ k•Ü· `^Í5àAêÔ’í*ÂgÛƒ˜’X·^´ù"õñ6ïÌ÷]_Äæ:•Û¢ÉJYµ –¥Ü6yUªÎ%%ä’jŒGÙ¿ÉúãÜ]Ï"GÖŒ|ÂC}¹p#:¨‹ØM‚´³"ëQ÷‘Sq:âuÐHÛP?NÜ@ľyîÓßÉNç#"=º±w¯XWB ©ã™,³‡BîÎY¦È²Ò†&ÇCE”(ÐÇì…ýYÃËýi‘„"¤@°‡9'˜yà´$cYáÏzà—JøAî+„C§éè¹Á§ÕïhÈYí,¹™9ûlþÊ8»QÈg@?´ABJÀT¥˜6¥~¡“åÏdp‡‘SÕïÕ?lõ˜¢É˦®víVúþÎ÷lÍóv[€áþîæÇõrsywu1Gô<¡__m^_ßÙ/{²@ ã°‹!Ü#|G/Dâ»aÔAýÕ£7wWë»9¢îù(éÞP¶Ø1XȲ=²y¨Ð&¿”dY­ðâÄyl(8å¤í K~0!BþÞ$ð‘¿ŠbÔqŽ%4C%¨'^þXÒ7tG ¨ïî0¤Ò!ζ åêÓGP|ÏÔGFoȹ³& ”¤Á#dn—ë ¡swµZÞ¾Y]mÖ׿^ÝÞ¯'u!z8e6¢°$ìDXFR(^VTå£;_„ pî¥ÎeúPš—Éb2`äÁHo†?#ßé¤úL·³åâª;«QêÙè@d,ïõeèYRªêÝ+¥p”cU“gºÚ&Òg¤AA`5¬E'¬JüöÜqÔsIîÀ³:7)Úèš«­ñÜ%r$„žIAuÊÈ ¥C¶']´Û#Ôî@o»WúÈÀM _|@aöÙ«VCH„ĆŠn´ÍPÂz‰[‰Y;uV‚oë†^¤l’”m™µ-rÒì[‰¡äOŠ‘–Öµ‰Â>0Ú¯Q<¤‹NÚÕ ‹Ð ¿Y«_®—›%ÕÈÅê·ÍõršÜßjþ>8i­{?»ÞwúÄ?g98"¾n·-ÈÁ#¨YÊ%×K–ívèGjhðD¨$•ºA…n2±Zª}|” ÒÈÓ˜Æ)Ð’ãp{?0Çy¼èÛ1n¶F¼¢¯7 LÁQëÈQËñÔàÇI÷õ=\çTç‘Í-ãÀ.k²‘"@@f;[`hVÑhðb] ÎDÖrÑ¡£GŸD@4+j§'³^ŒÒ…ÝÅäâ ²ð¾>Òžg=Ã…:!j€è¾®Žú”1Z§ù„DG>½š‘¦½™­¿{ë¬G³ÏlVVLîû"Ýà b™åmÏ™ä+‘lŠÓzº7l¿>gWìèC¯XÞv mï &¢ÓüáÔW£þäï¸×䱃µ¶Ý뀸¤Ü‡¹QDÁ@Î8V2s0ò…ÒY­n.æ!¹¦Îýú§¿Z9IœÈfËU)µê=È®#c ¤Ž¬L˜dÑ«³Èήñ M°ædçùÜ̮Ъi`Q·w¨V“ÙíüÄ2§@[b‡jrÝ îÅÜs1¦A¼Òms9WŠÌ>»Ð’ ¢á-n1’ Ð!Vg¬² ^ öñ„çÐ|jý*`?3µ‡œÊTß‹\NTªÍš:¢o- ßZ¬n(G0Qåv2£c8ÿÇq@ýѱ˜µP2JÊ 'ÐfzQÑçúéÞLÆ!zsÞÍOkëÔk…4Ôúm:Óu}Ü£ô§¶ÅIûw–_ÜOB>ø½þióúêÇÉ—bR‚æKñ~Ùê2{¼’´åDª?/óÈÎSŸYj~bÿÅ\h œËõçÌ¿þªÝš–Ì–Ûü0¢é7gÚ°³!æ_Ü>ß¹¼¼½³þ«1àþH#>Ñ oÊØd]1üß1/3Òvî‡9›½¹¿¹Ñ0抎ˆèwó3]4ŸüE½ šúþ~ý(bû£€³l»Õ YšnÎ,#Ñ6@ïÄ5VfàÛŸaÞ×3ÁƒÄÍOue6ߢ¥wœ«G¥œVÕzÕk7±I¬i"ô]¯›Î};YÒxa¿/±ÙƒèJ·#Î"!„æA‘¸ÁPˆwÇ.¥ä¸–p¨èµ£ÿó" äžo>ÄhÏãî ¡ÿíj=û'~ýt°®endstream endobj 155 0 obj 3084 endobj 159 0 obj <> stream xœ•YkSÛHýî_Ñ5_·bºõžªýÀ€3Ã-jj7Ù¢„Ü€&²äXrö7ìÞsû!Y’Ý"ÀjußǹçžÛ|ažË™G_æ{±™ü¸ŒÙC;ñØÃäË„«‡Ì|+6ìç ú »Ÿèw8‹‹SßMR–m&\ø®²ìiòÑ)ö»êVæíóm+»fÛ}rüOSV•wô`:¡çz^ì|Èë}^±WWOÿ•ý6™ynÀ²b‚ƒf~IJõÄ9=›fÂJ|Ê}7HÒ¦àG';g+šÍ&¯×.û䜮×rÍÊšÅ.Özد΂T¿6ã‘›¨=Ïn–—׋ìö}¶¸}q9ÿ0Ï~½>W‹ ÎÂé3.ÔêEÞ[ºIhŽw÷• mËrV5õëóŽµÍ¾Z³Ç|´]¸AÜ¿šW¿JÖ Þň‘϶ÿèÔXt½%»oªª™ŠÀM“0pžJùu*B¼–&N^íeë²ì±lbZ65"Sw»¦jÙ¶‘Ýc³î“¢ÂÍw}‘XW‘¥ ÔNi/ö­d]Ãv2/áå*ØRãBŠ[¹ûJð(uÓÐ8èÈ}&Ü0PÎÇp&M…yèfƒËá ˸˜ï¦÷xdlù*R+’À•¨)g÷}x…pý@»ŠB­ÚãT×®Ñ@Ax½LE('ð@ ~Ph‡KpLñ"íªÔ§*œ~èäm×Ç9ø?ûº¸úårþ"Ä ã£ÙPŒŸJrŒì 7;¢& 'wdÇÖåN]³{VAŪڔ²Ú@½FlùCÝè²2%ôvUQ9è®°A\ž@;«ÊÏ´­ƒž“ D[‰­aYNƒ ¡‚wêN¢Så»id flݲxZ³"oå§éâ¶Ù(òà~¬èófÊ Ý4šr×ÁÇ|·n)OÛªÌkª]è¨ô­ä¸~NêGž¨’ÑE‚º¡€6¦~TL·²w?µŸX3OL>I 7vÁ4v E—\¦P*h@$VÆHXt›Àcn¹cµ`×W+Z0htD! søÇ^,,§Ä»ßlµ¸]Οª_Áý7s”š)ªøH_-/~ž¿PqqŒ DüOžWÎŒˆôÐâ»~haäÌÏ®¯Î/ˆxǹå>ú‘U;fE)çÅñ4(6ûÞ4æêÝ-³@ê›o‰N]„¢JŽtɘeÐËÇ,ó‚d¸úýi¯“ Ô0-ú.Áœ^]]ß\½$îÚ¼?HG¶4ûÞAX²¢*ñó»C Yáõ µ@^«¿b¡¦»HÚþ+‡‚Ck.ïµppc/Õ݃ګ“Ó“gaßNÀb^j¥2™{ö­íZÛ›aÚ^u٢٭áÂFÊëÞ©…ÚÑZÝ,œÖu³¯ uÅPÖ ¤žžâÍñVG  %^ßVhÊS4¸Sô§ U>Ó;jöËï¬î´ñQÜš ƒ`ØKwL›&‚kËz.|¨””Vl!+ó_‡) é`+3ËšL!Ž`¸¸ÉÒ²¸^eìÏ=„bå¤4ìk3tØW‰—ÁÔjžÝ.¦‰™;O—§˜yæËc‡1ñ;( ~ýPŒo/o:4>œ•ìö[ M=ƒºSñïvy ½°ƒËù³™G¸=n\ O«;®¾ ¾’$Q•k–M}ö~{Í:­4{Š@Yõ¸=3d¿ë‹#’£8ßfËÓ«ÕâZÏ ļa‚ºúVÄðÝvW6ª¨WБ-…Æe÷4Ä9 íg‡Ê@K!OiN:¢_ß?a›iÔþa£vƒWóÕ ¤|{qnn‡Âð¨½ÐÕ­/ ?ºWš ÞéɄf†¿Í¢SÒPÝqq=Ò‡tG`J;uý  7Eq¦Ñ}蹉ïõWWßá Vw B »ö·HoDŠÉöû±¸´“1ue/›GÃR»‰×_Ú¼9¨êÚÄô¯™|M¤LóƒÔ¥­‡ƒëÕGºŠWS¼J;eýDPÎßšëA> stream xœ­YÛrÛF}×WÌ›Á” cƒ[Þ”ˆI´¥X mªÖÞRAäPDB ZÑ?ä£÷ôÌ`Pt⤶ü 1—¾ž>Ýó |Îúgÿ.wïæ {j.ötñÛ×™ý³Ü±or,Hé‡|}aöp––d¡Ÿf,ß]púAÄòç‹ÞòXoTѼ<4ª­íG/ü8aÛò‘>L¦" ü H¼‹ý±Ø²³«'ÿÍÿu ¦aÌòÎüö~~ó0ŸÄØÊ£ÌËwóÙOùìr~u; ¥Ÿe"ñ~~¯÷aÏ” ÚøRj¡¼|S6lYívÅ~ÅZUïÊ}Ѫ†{6Ÿä¿@þØç ô²»¤Ùµ¸cjš²ÚûlQîÛ¶ÜVM¹bŽÛïÕ²ÅG¶ªpÖ¾jÍÑS:qjt¢DBûÐͬÝ(Üe<âËN_*V¶ šˆˆŒzŶ„à]ÚÖÕÖ®·'ñh{¥m0…o¡ùòB$‘Âhæ}R$\E²,/2_¤Y*íÇzEúÀ¹Faf?”kúùiðØþ¶VµÚ·ÖFá0Õ_øÆôd Æg½ËÕJé+ ¶ ³ÔZ[/*÷,ñ¼ ßÓYYd–Lyì§ßÏò‡»IÆ}è‘y—óËgùl~Þ\µu©uï #}žvBŸÇFÚO ž=8CˆÄ—qg> ˜UE]ì|ÍÖuµÓ¾lTý‰ve±/¤ì,§júMúa¬ï„Š‘j>~ðüo&2Œ}™Jïe¥Eîîtûµå?ŽÝ6¯8nÛ·]:±çr‹`8¶Õ®hËe±E„"~¶Çô ½ïæ<°‰;åYàÇiä¬ò-b Nœæ:(2?…p] dY¬5}9¨¯Õ´r%"vÒÿÞ¾;õ„#@¹Œ=c L¼6ZŸ5¢ÔO²Èf˜·QÅ ÖC¸Bb$Î~ªv‡ö…Õê·£jÚ†÷[Ä3%Ù±nX‰”h\^…RtZdH,“WÀŸV,qè/8 †ûU‹Æ¬BÇz —…Á‹œï%BÅ…©—çwìî>gUÍîn9â¹QêÔ‚ds9ßŬ Õ…-EΦ‘‡ê]£Abî¸ÆZ7ïãÄg—‡ÃÖéD÷Æ ‚V¦]h†q¨—>—͆ð XÑ(€]Á`ìº}TEËvª1©*„€œQŸªqÌõî¦xRPMùO>âHGö¡V8T­qXç$'0wç‰ âtÚÔ²üC¶ÊªŽ-Š@³©ŽÛ•ìØ(B1íxãØ8ôeÖ#¦ñjïÐLˆÞ¡6RüÉ4 Ï‚ ˆ†A!Æ/™øzp †Iû…j \öWûQîs.qy4²IèÇÑgr àGãÌ'0øç“ŸD1yùQ€Ç@_ÑÁx]¦¡®:ÜEþâ’%£¯ÒOŒ4#è,ðw!"FňÒþè(Óg[¬8L'}'”P¤.L9~.Û)#)R(M"ÆÕFLéÐVåæ.ŠŠ.¼;.7,Œi´Ïü ‹³3`þ†Iv,Fg$@¬8éá€Ê’E £PpØù ôÀvÅ SP“,Ó¼Æ!dg*Æ8t{—?ÜßÝÜN"ièêÄ™ð³ KéΆƒc 4¤Ó¾;s>»¼º²ñìƒì)ÊθÞeÞÓŠÀïàôÒœí`•)é®¶V—d'»­/Âc«,CÙÕð€–?;ëΘKç¹ÞÛj"£ÕЫKý¿$^»ëí&~šð.aì3VCΰ¯§Ö"äòï®g7W‹S%3è#-CŸgâ/´ÄºÊga¯¥ .N¿BM Dê‚ëý$ä™ráUËApxd_Œ{- :ûjמÍCÎÕŠêt2ê=«Õ[ÖT„{aŒ…Q–¡4¹T £•*/RUo;Á#°ÆØÑÊ΄×ï¿»¾™-®ÿ3;5¡ôeàˆ©ÁßuUï ö'g'#GÆ>Œü3I¤7µ¤Ò\ÙñŒç^Ýq_D®Ak¥û·EÛ´‡)´/%Ò¯§þeŸP¶ÿ°mª·tB­¡l_隈2»¸—S@g«=Üh@+»V –tœ%lx/Jw°æù=w1öt…Éñp0¡V6ª¸¯¨ø—”ÐùìÛÛùÕëîËäã}£tïÒ*T©aÁP$ÎIØBëáK¬®Õ²ªWšrØ çœ D³LÂSTº|ÿý‰áfؾKi´š™¸hW­Êµ¡ <# ÅØ $±†˜ŒkeØ?´Ôìúß³W¦ŠãA£ZRÓô ²e:ìQ- Št†®Ý4 oo!À4‚ã¿9^=]8à‹^ÑÚ%oDD5܂޾ð3­‹ç0>t¡…ÓiïºÂ,àCM©‚U Ðw}Ü›Ú £ÂÒ.T9êÚxlzúŽôf®k+{‰¢¡D ¶ª÷~Àþª)޲èuS¼š÷çÊÁ¹¤‡ܱ¬é³ëÖð°ZµÇÍš(â¡®:ÊK{ÊÀž©Þ¿¤ða'BSƒë°GMû$AW¬GMS?Hƒ ë›É!ú€51ѵbd½§±éЙFYwbàGv7L×ULÒŒŸÞ0v+q°MA¹è¸&„!òŒ9@ÔQ’ÐTgœ$:]Í,C$”'`ä‹Åõíû‡ë«ñ0cÐÑßJš:`æ‰qŠaŠ›¢f_±¢‘vÝéJÄ k—”îMßQl‹i8¶žv)Ó Ò—…¸\_QÒ a–ÕVi¤Z·Fx$¿ß“„>nhZ«ãNO“(ð§–§šX®ƒ¼[mæÎdŠAÚqÉjÈ0©×‚ h´©›tx/û!" "\yDþþþ憆N–!Ò¹ã&ÃVLpØXöÄÇDü)[LˆwŒŠïL÷Âν³ù|ÚvøöU#,Eë(†a=åšìý°: ¢ì$¥ežIéõ¼âNFït–ƒ’ߟI"ˆ®<9F¿µÜ õ×èO`}“éiDTÁ%z7ZúèÁãÖEdè“?mຠ…ºôç5€êÏHÄ0 ¢æ‚7Ž; ±»ÑCDJWÄÔ¡‚|¾Ed9ÈÀÊö¥%íL¶æh~|¸Ÿ_¿&Qb²ia•iZ@ÜŽa-Y¡: ekõÑ/HѦ›¬šÄõÙw.͈¦Sº‘ dæý^ì[DfAÃÒ§­rÃOª)Ц’S;äaù *x]m·X9y3 P¸!gÝ6‡¯ß½[WÕ»ö¹l€ïŠãª¬Æ *ûÁèkÆÉSÊoþù3?•+uzf&ûßÀƒTŸï0Ñ€ ¢35µÛÄb?K‡ã a'ñØ[W‡º$[˵‰5¢ÔïI4®ÔZ·êºs!ífª{R{U—K‹Úói:˜¤Õ&€Ìo=ú¦¤˜Ë›¡ßß|õÆÍœ¶ÅÒ¡¯a½)¢©ëÇp wú… )8½W°y ^¡Ç´§žB·+m‡a' èI?ù0]óüÆô’€½ëdJüÙñüŸ{`‰u2Zi‡lÔž=»HUÿJz¹gþ@Qy?q4ÜÞ];&÷oÛAŒ78ñ^ä¼å´Á$í¸Áâ4…éV—ûÅÀîyS´°ñ ¢À‚(D$Ž5䯰ûÕˆZêñ„JÖ½¥µ£çM¹U®£–Á“œHn½Ñ‹œp?ãýŒ>HlÓ‹N ýÂvÜ‘ .ª ˆ¥#{"ÁŸÐÊÔ>wõÏ@mEóÈHTìÙ)êµÐÀ’§_ OÝH©£Åc5.|4%ŽÝpÀHE¬NýÞ8:ÖÔѺÐöeE¶+Ÿ6Ô^ØÚt=â/ŒÄgm,ó4©žÜýߪKŽNnqwk©˜Bþw9a*-¥’®uGñ ŒËÍÓb <š…ªºýº‹Y³c§ÅAŸ¦ý•gmkg4Gš¥YÚ‡S Û•{ýº8ò3ȈìCp‚×äf_êY=¨î¦ÒiØu>z>€ f±;¤Ú«#jåŠí•Z¹7„¶Ÿ¹Â6—ÏÚC=£.>+qý³üþÎØ%’èLv‰¹eÝÀ_{ÏΖŠÎ_  ¯ä{THrs4Cß鞆- )Ñ÷,o¾,L˜]^y9ìÎIajÌ[rAï_e¡î´%÷ã@ž`Äyî®2HFï6Ë~'®›ñüû!×iàÞA÷Þc» Ýl›ªkhèGa„Áö…OX¥"0 t0™Çfʹ}“ŠÜ!-´5ò€ ÉÏd Òí2Í9¶Me;zïž¹d'.ಠÍã‹ÆöT!=ûÁν~3]2ç™Á˜‰ênJÁÿ5lÂêáp³‘$Ü\#ôÛ,¿ø ÿþ§»ÀÏendstream endobj 165 0 obj 3315 endobj 169 0 obj <> stream xœYksÛÆý®_±“/;$‚]¼§ÓÎ( •(#Y E5ÎH H.%Ô @ õ7¤ÿ¹çîY®'ÛqLwïëœ{îê#ó\Î<úeþ^ïN¾[Äì©9ñØÓÉÇ®¾dæ¯õŽ}¿Ä }°Üžèw8‹‹SßMR¶Üpá»^È–Ç“{g}¨‹G™5/l«}ûàøVä+úb2¡çz^ì\eå!+Ø›OOþ¹üGrÏœ‰³f~Ä–˜?»[\^ß,ïnç‹Ó‰:?Îß-Õ Â…ë¡«^è ò/:îƒ3Yþ !â‘Äõ}ÏKô7¹íœn6rÃò’Å®€ƒðÏxºaÀf_©)úk’¨^õÌoW¸<o÷UaU¤<ŒÝ(:z—›ZaÕpšÄI_ä4ŽT‘oeýI—@ ž449‘5™Ý0J­ù{gö÷³"§„ÛΘÌbæžpN•¦Rà&ŒGé»wvÕjªë´•Y{¨%²YäM+KjòVy£|E"NsP¸ã­C™ïö…ª¹Ü¼] ópu ;#¤ÛÂ87 U,Ï üÄôˆbàL€qR•üë%»îšL{‘?ÄöÙõ%C}/®ßÝÒc=A̸›Æ~ØàûVX.NßÝžÏ1¯YÆwyÓA}8§û¾WC7àÖGåVØr²:ÛÉ9RýQ?[Y*8¨±ÎêúøÐHvz{vqÁvÕFÁùò†µuV6[Y7S¤È6¬ÒðÞÈ-íG¡Æ©i‡ìP´ºÍÑ¿i:à¢TÓ‡³ÊKu¢±«L ËŠ?ÃI±åž÷‘q©²gÀ³c^ú‚5/ph×°¼e›JÔUÛ i7ÕAÅk¤¨ˆÐàzâ¤uV²•BÇ,ö\Ÿ§©õ–#yš9M¶*$;ôË55a«aÅ}7䆸M¹¢ÈMÖf0ß%^µžóö™mòíDº¶0G8ù”Kýr„ƒpNÖm††]?£~ë–  Acƒ¦9¬ŸY¦xM„αÈKä‰jò]^dõ$ 5›¸z\ly‰šŠÒLÈ>‹› D¼®D­m ìä[‚Wµâ沤kòIvÅJ]‘¤–Ké ݆uC9W‰ÜT”Amµë/VÄóÒÁÑy zv„S%õbóùòfôFž°Ýµ¾ ûõ~g†«c—'a¶¥rd`»”»^ ã;–@Ó.oÕ¼ûî?™>; ÔÙQfdøØögÓ#ö 2¦ òœµ¨ÃªÚ¼°gTµ¦ÁöQ™­TC§(_YaÍ®“š•¶×Øiìz±-“[àÝè5íðhÐ ÀÁÛY½éJ½ÃƒÈôÎh€u¤Õó¥ W¸> d½~?§žß}ñ[ÇuW×?ÌGõŸ°ç»ÜßdƒKBÛ^~¨Œ5ä{Q•O.»ÐüôI &½ÔׄX@è Æ>8U)&S"Í6Íøº“L&:Õ–Ç€1•s3ÝÁz~Ø“^« Æl ”p1ÏàõOK|³¯«ß_tÏø\%‘ÃwasuïLWߦó’©JØ™FVN⥮'¸…ÞH2ó‰SW¥Û€¨Zº<]eŒÈ×liä{Óµ"´T!ÔÉ®Õé‘õÍ‹)mÉóÚYR€o„œ:07‡ýZr$„ ¤BÏsFŠ’Ú*š#LÚ7z¶¸<l !Þ„”mb¦Ù[؆¾ &‹!šÊ7{²Ðãü+“éAmweþ»Ñêzd•?9—hç̬ÃÙ¢€˜uiÒMAs¼ˆcůcÚëé²r=ìÛFÈž&jRG‰CÓxõbÛÞ¦ÁHP•†Aã?Lþ[¢¡œÿ©j¼":Rì/4ð÷VÞéMbÅi䯼›uÓcß}hâ´ßŸ %ÞcìA?4@~±¡‚)é¡döš< iz’ì¥:°ã„{NVbÝ»hí++Éô V£¤ˆ«—KâÍðàþÍûÙoßLI  ÷ßüÆvÙ ™)ä¶e WÓbO˜YÑT$9Π¢¯k‘Àl°uF[aK;„U]0?…Ù}63u8zî¾Îa§ÐBi‡àw^¾"2Úÿ“Ž»)ÞIÊ©‘„3}7»úÆèùØÆ÷Ñ/Rî†B!ýÔZlt ¢Q?䥒ä;j½ÖfP€Àô¼ÎHâSQ)³¦P˜ÔQ¿„8 ½IT °un(m¬‰¬Ö'’,íûª„ÑMµ>¨M°Ïå¨{€tVÁʉ«‹«¹Jp­oZ¹~.sÚÚ€¦¸ÉëÐ*±ª65Ž”ðl°½jqËaSóij”|{£¡GVöy(ôÒ ¬DI7:E¤gÛ³Ú}Ð¥ åHlfzß´ú¶*Šj|B`µ'½_¦“ çüLø"Ââªî(|©‰›{XzPŠH1Àb¡ç³Ë»æ^öáEæ ÎíÄ!‘Ю éÏ_ âUèÖZê^Mí&êcD¦~·ü8˜C¯Æl4szRB]BëªíúB¯…S{@O OùXÒ‡!pR3RG0½wʰ¤å×wÊr ut_æ};e‡v­äG³Û·¶l;Ö‘ÂÐlF;Ï—ØU“ê»»ËK­ŽzþÇ?7ÝXjIFKèHõAÊŠ±~ï,tŽº ¸"~ u®ƒœ„ÒÇ2=–m°¥,o†ÂcôÕ—Þ¹w..ç€з–:˜ª`1‰Ì­ÝèôÏè;‘á.V/“(´’ŸÓb®„àçWóÛ»«ùãùbxÎõÕxÒ]cxa2–ïŸÍ4ˆ-ºkQ)#þ´Qº›I=Ü®M‚³£¤7ŸjÆ×#MïJÕV«—4t¶$[@Zæ¶ ¥]*ÖcvØ!cAJo¼´•IúÒãý¬ …V}`¾Z_9º@}ûº­<úÏ.û`vTz‰ ‚™ÐíG²¡¹gˆP˜©=p§?N¹¹’:Oy©®ÌˆauyG÷€Ö>‰áWÁû›|QšaóÔ¨€ms iŸ'ƒ‹]©)žSÖ¹£w!‹®î×¢Ô¨X¦·›Kc¡Ox—‘×iœñA;sÜà ÞÈcŠ‘'©M¤ÇÓ¯fR–Ý•¾˜ž¸ˆ'øòG!Õ “F4pôhôê6ø ¶HÒTy ˜•z@ׇ=éˆÃ¾¨² ©EòÐ <}§ûk¿ˆè'ÌÕåí[„™Òskõ³'oÍ6ž¯»º> stream xœ­WÛnÛÆ}×WÌ[¨kÊ™áµoi£´.”È•éErÐm±‘H…;þ‡~tמá”ìÓà…ƒ8!‡û²öÚkïùÂ\.˜K?ýïì0ûn²ûfæ²ûÙ—™Ð/Yÿ+;°ˆèAr73ßJÆŠG1K3!w}–<Î>8YWï?åióô©ÉÛêØ~tÔÇ9Û·ôb¾¾Ë]7tÞ¥e—îÙ‹§çÿM~™ÁÁB,ÙÎ|IÆßwyÉžªŽe»´¼ÏY»ËYéò¦e‡¼ÝU[vûÄ`©-Êûyò'âŽû¸¥ó0 ;,~p~¼Ù¬ÖWɧo®“¹y+é¬ßm–¿Î^àÜ,ñŠ"™$ïÅ<ð¤1â´kªC¾ G åÇÜ“[ib:âv‡H.tÌÛª|EGGVÙ,PÜî`+¥W.½€ÿHÄqÿ"kÓþÉf¼«&&Bɽ(Žú“ûÑ0O îì6ßi Tݧ#žÏƒÑýC>1s «ž…ª©æ* L|§N5 ÚJùƒó¬mXQ¢½W;QЇ£“û1ǘ«Ñ…So0©šÇ´n‹¬Û§µ-¬6(#ÉÅ®«¡5¿`EË‹ýžUå™J5t¬ik”¤([ŠpBN¦¥Ç’Õ,ùÏgƒGUÛHвÍë¶ùæ„*'íöí„b8XèÐß߬V\cã$ôL.ª’ei äY×ä[:Õó¬¸{šÆðýüÕ„¤ÎÏIr¥ŸXƹ< ÷/˦ÍÓ-«îØOË„U5ûyùú {¤–8æõ]U("²ÀnSòØ»h8Ó1áψ. BTwÝþ‚áK¸ˆA¯fNþÝgt0Ч‡ã>×_N]§Æù›åj™,O@Œ/¬±áŽÒ¿Õ|–Üï™?i Ã%Ûbl‰¯Úý÷†.÷•+¬=óÊèРmrôúCUØV)aׇxÁnç"†¸ÒéZªN9”*Õ`ƒhÝýÿÉ:pä0PS7÷ÜX£b}h66-ý ²ÐßK5k”ðJÓ§È/TÜ·[5cÞ‚‡q44xÑf;Ê eǺð& ÔÑHp­L!7VçZ÷~ýÃúÍÜëåí3m‹bjZãéÂHôÝG9lס†½¨Êσ¹Z_'/##î{aoÙÆB‡ÍAë?ôQa1¨Ï­¸<Žä FÞ^.Wo®OM h½’ýi ÛtPZš.C7iJGž<—NŸU91ë’Žgs цŽiz#"QÚÓÕ#-7Šÿ ²êI-¬^È… É?Në,]?¶DzŸ¥¦·ŒÊ¤Fæ. s/5ùÉÒ!ý¬µ®ƒŒú5(W?Ì…g¸tšîx¬ê¶ÑQ/üˆ+uš¸CÚ”U‡Eݓˆ»%»Õ}?ÓôÖüŒÎ‹êìÚâ=MÓG„ML™%ÁÉ+40;›H4,&gƒþìCÎG{(¬ð¢s{uUÞEÛ°zýEëü¸O33ÐE=n àÁŽž53*ä<ˆüѸ)æc‰SfûnÛ/ … â±/¤ˆM½…N J×(PÔ}‘U'%iñï»bOá ž‡â~‡0Ìtñb°þ3(`oX…á©åA‚m‘í §lŠ®Y#1 5Í›¼§b–}GùëÇiÀ]9É@ô¹R¥B_©ë‚þUŠÓÃt†‹éš°/F2ê¼AVuû-;VMSÜÒp®Ê;ŠÆÌ¿CÕæ#A#ß#‚Þ¦ÛýSŸ}à†Ú hÍ4þùÍ4{%-*Ïem¤BñMÙAûÃS`¡ ‘8·„ü-å¾-=ðë‡ýiÑ Š™·† Û´M9»yqrÜæ¦‚C2¿Üœ;"²ÚÓ¢é'®òÄÅÄ`+8ì“Ëa4N¤Þ4á‹ÍWÃkG¥Q «V*ÓÆ ‹(Ô;ü µ‘´RÛRu0›F·,5ŒŸHšeë+6Q(*©sKÒÙvu™ë»®iÓZwˆð=Š˜×&KEv(KL©XÚöá¯çý\8M3¹ÒyÀÄîMN—ížu77þÿöÊ2ºƒNïôH¸ÍûKsµg«—ã“-œ¨Û B\´SÓ5Ãôêz}¥¯"ùWTC=Þ1tÌõ»ä·%íä«+ªéo›·œ¶ }øõþí–d¦eóÎöj'&I3ÐRÆ¿LJ5ÎÜB¥+̇ˆV†ö åѳe2û?) ÝWendstream endobj 175 0 obj 1915 endobj 179 0 obj <> stream xœíXÛrÛF}çWLù%`•8™Üó¦Ør¢”$r%¸6YkK‘C1.4.R¸ßàÞî¹ ÌxËÉÖî>l©Ê–€AO÷™Ó§»ç#a”†?æÿu1ûö6$OÍŒ‘§ÙÇW/‰ùo]ïXáƒd;Óßp Æ.b’3.\Ê|’¼ÌÞ;ë®ÎdÚÙVûöÞqïç$ÏñÅ|!|F ë´ìÒœœ\=ÿ{òÓ 6X¸I63—zqŒÆ›ª.Ò­Sü&m%©¶&´¢‚¿6Õº+d ÖJå–ÚØ8Ä©`®6«ö²Vv(IvŠ»  æÒvl³‘õ³b”»†&hÌSÆd +)õI›àR Ÿîó mU¥zÈׇ¬|RnYS½gÜÕt2°£KSò ѳtÈÆ§903AäÈ6+·Õ—#ŠÃáùkÒeÛ•Cbàiè!Mù\W—7o—G>R Ìñ:ioCêGqäY¨¸«ÇyÒg£é§‰åúÔãGt}ï(^¦Ûðê´l¶ð+@)çÜw~ƒ'k{@k™©H{þqß§6Üg©3Þ׃OΦíÉɼÒëÞɶ sî!²¡s¸ŸS½€Õ±7dÃ4‹}ø"ò¸ÉbB'iq¾v_ý¸O WgFZ§…l­õ9iežk~AzÔi}ÀÇe…,_çÝFªWÕæ°Ø§5>Uª®Ýw­a7¾5®e.&c…Âea¼°þ=Ó–1†Z{à·Àñ}]µÕºÊMÆìÒ#!ˆ=¬‘¥3ß>C> ñԤ͚—föN¦¤HÆF0¶†’eI~L’Õ½sµjÈMø>ŠSÉÍæŒ¨lWzR¤;‘Üxæ‚Êú8ÖM«ELâ/Îßôòn"02p$ãzˤ"ëù7&¾Fœõ5Ã×+viù4h1œäª2A]V…)Š %b‹svÕ¬9§êH³«º|ƒ:>I`OŽаMö•ZTèëa×quüÜùÕò.9U S<=­¬¸þX@BŸFn¿³l×^Î9¼u´„èîòoJˆ†ÌBÇšAÅ‚×íó*Ý€âÂá}Ê¥–b+éY+ 1L!5PŽª"&ÝPŽlMzOº©ÀxüàÖÖ_óƸ$hq-jMö¾Xe%:”5&7Ÿçu† 'Í¡®ìÓFIáP*ï¤$iÞTFÞ‡vN‰³`rà)Ó™ö<¿‡«óÛ&rî=ÉèQN/ìË’^¿­F ôô†/ënÌÛ¨gN­þlºÿ½{½ #$KÿA§C (c–'£³«ê)ý‘Þ½'ŸóæTÜ Ô”÷­Ç:œ¶U}˜¾į̂-5*ï"Ži`¡à´OÿWc}‹úœ²Å Úßö•æ¼1­>}šûNš•gJù3•^ nvµ¶Ì~LfOvì@HY¤²Aõ:1°:Û¹©¶å´QäÇÞZÓˆL[ÅÆô»ª¾(ôa0@HQÓBS ¢,žuUѰlà§Ø‘“··Ðó:ËkÒ7=÷ÎùfA )Î)¦A\Ã;:öM VÁ<+¬]²ëR+!Th׳,z)†3‰p‰•³&8åtÒw®ÛNÍ.ë柪p –²­«<'¡“v1?èÝzbÒw?ݨ¡˜˜yþ˜®?˜ÙçKÍõ)²þOKû‚ÌÍ>cÎXë §ú‚Ö©Þ¶ÚöK·í„P,9zuB5úæëÄ迬CÓFZUå¯Q çmþ úiøÄÿ… ÚöoÕ"—ÿi-F›w««å&5hè]çüm¼ üâhDac„_3Ûìk¤:«ÔêÛ©¡3 Ó »…^ýé\\åd½dÐ÷ÔçÉ‘اÇéS?Œ¸5 ܘ6¸.õýð³÷÷󺧡}ŸŠw)]ÓâAsn}®z|t9JZënÈ ˜CÃŽ¹Õ;ƒx@CJJÌ Ú½Ãêç<äŽz~ð˜æ¸ëR7êUòHgÁ`?û@w{Üøæz#¸Ëê]Ò]™Ë¦!qÆ¥É$¶ãúÀ¹ >®_²F*㨯eÞ)ËhU]r ãæ>’æff§kUJ^]¨ÊöÀʘWYÙÉWf…”öµY »€–¾Ÿé/C¸ âÚÓÇQ´6Y“>æö¦äDˆéÍ`jæÜ3T¶'Ç8œF/n'd€œÖµ±á0³P5õª‘¾i€FŒJµ =Pv´ÆaoޤâŽGa^ÖšíBVYJGUÜ£¿*Ã_•\4ôØaØU×’e•Èy±|PÄ£¶Js󊮊}>¢¶Œ²Q톬 n_½ùOcÏÜaÎgãúCˆÚ/\Ÿ]$³¿ÀÏ?Ðÿakendstream endobj 180 0 obj 2187 endobj 184 0 obj <> stream xœíYÛrÛF}çWLùÅ`•8ÁÌà6û¦µèD.]™ÞMÖÞRA$(b2XQ¾Á½Ý=3¸-ǵ¯)UI%ÓÓ×Ó§›Ÿ˜ÏóñÇþ]ïg?ÜÄ쾞ùì~öi&è!³Ö{ö÷¼à«íÌœ,–,ÖŠ'š­ö3!÷C¶zš}ðÖí¡¸ÍÒúù¶Îšê±ùè©sVäwø`¾¡Ï}?ö.Ó²M vôíù¿WofpÁBElµ™IF ÷ê&=4yyÏš]ÆšCZÖÛìÀò-{®ZÖÖ[ïÚòa¾úÏLD‚k8î;V»lòr]m@g¿Î…ð=8š•é]wyÍîžYºÁç,e»,ÝÀEþ@*I©y$C#ÔËðž…Ò¤ ¶?ýà½XÍUÈ}jÏ*HgUÌsÐçReK«Ê߬â M¶yÁžòfG‡~¸¾ó»Ÿpi%x¯Þß\\¿]Ýþ´Z½ýiyz¶¼A]$Ÿ­ÖÃ` ø,±‡ø?ñ%ß—‘/í¸¡$&¸Ïª]_µ é´ #1UàØBÆ’G‰³Õ{È̵!>Ô\)8 7MœøÂ>p>éʘ«^™“çÁAë0Š=„ißÖ «³u¾}¦¨óß3NjÉ5^²OF>º<ýåõùÅòÝù¿–κ’ÃÙñ6íîÔ< ]˜|%LÖÕ E…Q³Çô³@‘g’˜'í|Õ› ¸œé˜]iQTt2á:²¿Šnzª)“›jdå>ý-ß·{²–}ôòr´Éj¨ªj š}ÁÌ­ØÆÈ BΗO6|*ñytöú\k*¯¨Ò gç[ºå²OmV7P% k‘’‘ §©Ö‘IÞ{(Œf—–¦j>Ïeˆ/-Úìd\ OyQ°²‚Øaý²´Ü0ŒÎò³ L_Ø[œŠ¤ÆìvùË«åòlyf¤Ü¡ŽM{(³ 7ö²Õªebeí WZxiZÌ_v) Š]?¥Ã8…]~ðžköPVs‚ Ùã!‡¢0FU“ˆG‘ÖCBmbW¢7OȺ-¨Ûõu©ƒÛòªd»•bÙ–<«CJ2£Î6[76C%e(Ä *RtNYHJ]¸+ų̂ô5½*ºûà•ù\Åš‡Þ¶!•ÉF)ï.µ…Dë².ZY¹©Yû®FÄ$É$Ú÷¹ š«%¡¡n|ç×ÏcÝ4” e1rº êcB˜ïó†³^³®Êuv(“+€¨×€Pà\r‘ C©q¶„9+j T䀷§7?~/.¨06ž#` Vm)ÿµÒÞö¶ãu8›’£HDq—VHH?Ðÿ4ØSn;ã ^è®×Âö%“Ê "s§yaQ@ê?‡Ó· mœ‚=DŒpµt8q ûÄÿÀøåt³AÍKsð³ #nÏ.C6ßÄAü Dþ‘ÕùåòÕõÕÙùêüúê{‰E|›Xà;”jZ…ú8³•P‹Mö¥„DÙU#aÀ£ËÖ-£W:n’™ºêù¦ÀBN\2 ÍþÇ<Dy§ï—¶ˆ»‚ôC¸Põ¦*“ M¾Ï,>ñ!|ÀâjYÚ`‘þJr€L'‘tJU­¥/G¤¡JkH#L*u¾C´›ÚAÍ»¬B3ºÐÝž¿¾¼>{w~õj9• 2PN‹ÃTd¥þŠÈ÷W†tɘXÏh¼áU–ùö7ÂP†Çƒ,¢˜Es·à³ö±ôñ±È*âïÉÂ×¼3àäõ‹÷åMŽ Ü •ð;¨òVïF‡Ð¹Ý³“aºƒiÐ qÜ”“î› `×ì)ü=ŒD_Ö)!eM×ÊŽ‚±€™$Ðß@cœ9µIÄ–áâX 6#ØBo ¬ÍKèNp§©©ìÒ1`I"‰`ùs# ³=›åJÛÛ lS— Bká‘ÔÍIFB=àù BÃÿзG-`HMºŠ¯Ðñ ž'‘â¯MqQœhw5Æu“S˜žæšÊZBÉ ÒÔYH|m8ˆAÁå쮿šsâ,‡Å4©¬dPÙ|R‚ ßí[U¿E¸'M|©¼¬ÉËmÕïúbKFI‹Ó.•É €úŠ‹9¿z}}Ûaþíû«Ëåj¦AËÍù±é´¶m#d1ikà"éÑ*í&Ôp‘¥‡·)û=;T ¤r˜•Oœìa»˳ºÞ¶{á½€` ÏÐU6- ‡í„6^ }Ú¬w¸1q6¹)Ü \høq÷ßÓë’øÛ½.!nœ$\øñqn,t4ìuõŽí.3³+8CáiÌ{:ö ŸêÞ´ Ñx€R„á˜P„@^:phMÄû <¢ýÌ´'Ä= }•# 2EŒ©æ™†géf_I:â×WWËW(ˆhøón,p‰áõ×ïWßIN„¥¢Ç†iÒ¼tK87€LC4¯¡¥[xð($„Qàñ$p¦ I`Ë® M‰ØEÌ0*,2|7Ša UÙÁ¶ Èøô  #/ãìª:ìA•g;…v“ŠGÂeÜI9D;m>ËÁÕCûXS £h“·F 4zßw»/K×½˜Ú Óª¬ó hH›Ft&eLÙ)_›&©dô†Ê˜f3`¢® N¡?ÙÅŸÙüdùÝpù´Bk çÛ¼laFd‡¼~`é]e6ªp=v£âÀ]5PÈi‹bT=ë”¶­ ï"ñy‚ :-$Ê’wç?ž^Ü\b\ܪ°¨Zºº~†Ár2‹Â0nï¼dm™ÿ¶ÀÅëKÇ5°1:×ÃH%ªÛ.’¤úÄàÝ>¿ß5VÕ:¿/Ó‚¨’ƒà¶DONêXúH¹¦¬÷ê,¸šËp5BÚ;é(0¹a×´ŸlËZ¨PA[®óÁ;ƒæOèˆÜ ùw­pƇAq†÷§]\dŸAâ³¼aå„"@ë㱚4ð#cÒ¡/®òtwî!þp-ïræ c3Èí%aMÀ¬BÓÙN! €…2e„3A“›D õö}høƒ‚ˆë¶éSÞ®¡Ã$:‚¨=¤M¶Ýôïg¥;Yˆ³šf€{‘è9¯)ëÑ-5%8¬l÷w3[Ȭ¢ÈÔ!eÌìºÄaV^U\àhçF7¤xÎD/Ǽ¨˜+$¤›ô°quR"²º*>›o: mvÙàZjdè®ÖµîH}o9Œ•ÀæºéÀúê»ÚYÛÔ þF€l cºi Zq%å„–z-ÉÃ5†Íòš:'ÀÖˆë˜ýݦ YËÔ&(Q•™í&†¡˜½úüŒ³< à (‰ðX¶ù2Ê“@&Îv» öòYËWDÙb~Çð8tÉ•PëÆ¬¾(>±êÒ XÙ@ó/ί4ò ‰By0»»\A¬â6npp¼ÌЏzûr¶ÀoË¢˜›#. áÀšáW-Ðc•r%'Þ –ê¸7¸„šƒ€ ²[v©?[®f?ÃÏ%w‚kendstream endobj 185 0 obj 2693 endobj 189 0 obj <> stream xœíYÛrܸ}×WàmgRL€÷¼yem¢-Ùr¤ÙlRVJÅ!1c9æÅ²òõ9 ÉIk{“ª¼¤T¶U$ÐhtŸsº›þÄ<.˜G?öß|{ôê*fwÝ‘ÇîŽ> ý’Ùò-ûq… =XmŽÌÁbÉâÔçIÊVÛ#!}î…lõpôa‘mu«²îñ¶S}³ëoþÍ’Uåš^,OdèqÏ‹o³zÈ*öìêå?V?ù;ÁŸU›§¿\]\¾_Ý^\.ý{"L¿Þ^¿?;{s{qþö|¥7œàBð!×;…¤‹÷ÙrõOÜ OSž„ðO=.£”œ]tËXÕÔw,ëØ.k³­êUK[$£„¶% Oü05;?,øùRÆÓ`ÑçúXm\$ÅP¹U„Ñ—Ãö0a–A£.¦ýt®Yažß«< îá¢ó›˜¸8ÇDÊ¥=Õ$íÛa yhLOçø”pyîFPàm0Áatûíë¿Ý^Ÿ½{ã\~}õ§3½ãÛÕ#–±‘: ­`Íf)1/M›Û~Ðl¢$KÉäÒ½ä!8c¹·É–¾„ ¹¨‡Ij@P)}gaW5YÁtÒÀùØÅä¥Ñ /9䆠RvVzny3Ôýó"­nj#8IŒôNÑȇíPe}¹­pvG†–ðŸÓ‘Cðeâ<ÂÓY4e’"=N.í¾6»S¬Ðª´‡j+È¡#W —õã Ç ÷ Ô3£‘ÉÒœeU!5C§v—Â3ISj§OÌöUA²%¿rãw›õÀ´ê4+kÖ´‡È·”Ѿl©OTúà9…}¦iÄ}˜6–5HçªAqöFm4\Rªµ3BeCÕwdn¨«r[Rbu¢ Ä/d }]Ph˦fE£ºú‡Óâ€'"M6e6Õ£pá Æf3#âð„#¨ÊûƒZ×á Z!öý=ûéüâì¯^1°±ã@âë¢Ð8Ô'AáƒpÄ[Œ$ðÝ€Q¾À櫳ӿþl–©˜tÝ‘ \Ë—Ó*iÄëÝXš·DÿýtÜÀ­yIò.…{¹Éнà¢ð§­Íü*¤Q:öµå» µ ÒßÇnqI.ùzÿ·éýáe~SA4ã³ð~ƒ¾ä,ÑöâYÚþð¿g-Ûã¨r÷ `š¨4ï0 èD³HR‚=o8qõ‡‹¢²è@•„~¨!°1{yq~úwÍñ©úÝ,.×]S¡K@ƒvXê)~D·§ß8FË?]]ÿùÖºù%Öóåa‰½V4†3Am³v@ðMëûck¤ú™Í8i8*1x‡6Õ‚êˬ» dfôÒÔ.k7¥œŽz¸YÌ%ÞKƦUÝ=‚4«ïëGú²”£d§Zaô;]\O¤O7œ>ñ 6ú1k îÍ ÍŸÞ*´µ¬Å«1¦Í [ÉQ‚Ø­/Püœo®9±„ÃàåyÓÖ7cg,‘°ß´¶šî±SŒaoÓ²bêQµ«2w¥7²¥­˜ûÀƒžÀX[<¢ë™ ”ÇîS$Œë3ÀMßòXËÄD¿#Ú45j~©õÀô|˜""1«á©µ9Ôt®§=TlÊ^ƒÙ‚‹NÄ =úë>ÛC¬@å ÀÐ]‹q訦kÐ7ywUÎt\Yß«í®G¡:qE•Y,B|ž&ÊÄQzŒî+ëÍböõAÐÞ,^¾ÀËË«Ïß`BýåúûÆRýÃOÔÏÒ’*^bh™ð(ðŸÒ½P’Äéd6Ǧz“?g¬Ýd%uyÀ3ri<> stream xœµXÙrÛÊ}çWÌ›Á”8Æ`GÞ›Îå µD„JÉ)D%Ä @ eåòÑ9= Òò­ÜJ¥\–l`–^NŸ>¯Ì傹ôÇüÞì'oïböØN\ö8ù:ê%3¿6{ö§ zí&z`±ÇâÔçIʲýDx>wC–=Oîͱ)×2o_Ö­ìêC÷Ùñ?OYY<ЋéÌ ]s•WǼd¯®žþ#ûuâGl†¿Ùvâ¼ûx·¼¹ÍÖïn®¯çï²lq5¿ù˜M³Nfp÷nÔjá©Õ·9½qéiÊ“Öâ©Ë#?%¶e9+ëꑳEÇÚ§úXnÙ¦®º¼¨X÷$Ù>ÿ^ì{Ö{Éð¬•x»mñ.ïØK}dyYÖt…Ϲ™x©Ë½8Ö79Ï]¿PKÄ`B¢LÀ%8²’›®¨qgM×*o|lð¢Á•V6ßè…ˆx(\Ïž“¾:G6jsþEYp? S½Æç¾]ÃYöT´j…ÏS×® Sµ¢®Êäg_t­òdÚá)oå«« "Ñ1üϾ•Û ,.Z†œÑJú׎U*.³$àq,Rë…Ǿn$;¶0j%;2þ_²©éwû\t›' ¶•»iÊÓ$ôC'?–{P©Ç‡(D pα(»Ò4Ž(2W;6c¾ëÚüÑ•¹kµæ,i“·wµ@‡"5Ñê!8ÂÞPiȽÄ5ivtD¸¾ f^  VÖ.*v¬Šï³²PIó¸BoàñÀì–í€äÈï}i;¹oMÔ÷ÅãSÇ69BÉÚⱂ[»Ü-®(eÛž9乂 sÚ}ïÐõÍjñçë©sWD‘s¹T‘ù–ò Lc®Fjßüå…Føùó*]_­özPß;Køß\¦Ž4× V îG"> û«•ïQFÌ$ÎÃÑ–¨g˜À¼è†òLx”z¦X—QÊ}?M‚¡dMéÚ¨ŽûT ¾/ʲ°ÔPTHN¾£ì,Ó1]sÖLà ‡ÅCikûÜÛ@f‘®I`šòIé¥kÛ.¯¶y³e­B«rPS#Ûº4ôóÔ³ÊF#+¢³6“ñLS–‹Á{ì aqGäv¨U?poDì®ÂúIíŽe9Óž›Jù})¹ºÒ•uGuÜ®nlI¶8¬{'Y*UÅ©^P‘ó ƺ’¦xùtº®óÙ¹ÜnñÕ#TÜ3­b¦Ðep8@{q{7_Ý,5×ù4IÀ¥aqó°¯2R xF—¨X~8”Å&·4ÝÊRŃbõ¥¨”‘‹[–o·ð¶•­MÙó“¬LzŠê‘=Õm§RÖ\<³×ö™º?“#U'qFG'¨íéaº! ( Î×íH$Ü·<éÈ¡ {^2j‰ÎUo¿¾B‘4¯T¾MELµ:ÞžïÂúÞxgq;"³˜Ç‰ëZ4òl¸žø§ço}õ“¥|@©ÿ6õ"ÿÀÉË#¬ÊùG}/KRÅÚ'É>Ëôúo¿\N…N6ÿ4¿;Ëû½óÍÅÒ5— CaàGWŽS )Ízû&ƒ"hl]ž¢¸å?Cç¹ÁŸ‚stÞõi5QAG=LïÙM­’ªj³ ±‡¼ÅãÜ~ ?¸mÌ"Q ûms¢ÿ‹9ѹ9ïEòZé¾_ß\k£þ®#ùß«=7J~P{šÕyƒêAm1ùõH}S\¶édYjŽ7yóB™?Èä¥òª^5ØR4€è¡©¿¿°üˆ‡UWÌ”7êzc–‘;†:@Þcy‚z<\@Óx®Æø¯ªÙ6ïrÖ5yÕî@áäo¤c¨…úy1<ê‹É9UbÅþPÊ=,ƒ¥D¾¿dÙ­fˆPoMyßa/Vãú £þÈ+½gæÇ!‡R³»CÝÞÜú*$o–Äœ"R/3ÊØ²‡XMBüI†!°`5dåTçL‰Ý78ÎçñÀ^¦™¥"z¥™=Œµ’‡%–ÄážÒ†…ÊN4.ˤ°‡‘rЋä[ò[R0„PÄH“,®?ܬ——«luóî/ó39(Ï^/!ÒØèìƒñõìô¦'qjKi˜ˆI§^” ¼ŠjW³ÑpWÁ4¸J«•üÉ”€Ž¶¯kÄz!Ä]:ÒénœjàÚÄP¢ ãj߸Ò‘õÃ03QWjä˜C‚U|Ûzcd^ŠþÑ) ¶¹)0õ@ÝÐ$Ù°4ø:mô¡jôoN‰´§Š«ùzµZþÎi0Àüª<í Â4?jyFÿè>”z±éC»¦ÞΠxCF‘.'ˆ¦ß L>žVê»±g*6Ôf½°ò8ôNT(mÚæ‘ud9¼&Ë Z [„:ßäÙ•ÐöÊ{‡:ZŠé ÝjDí˜Â³5±ZR~5_D) ™œ…³§¶ÑÜC3V_ëü³3’æ¾?ˆˆ1wº)$ÝIj@Xi+ªwBš¬ò‡’ò h¼Í–+]ø4½Sl>dcÁ"Ò3Î+|è¾Â‡ýžÑ–ÛŸlC^°ÅÕå-“ÝF·<Ïù`2 d î³¶Þpij*j ¨ä/•J=ðÓ~TˆRÓdžQ¦-³åרT­×Z&¶Ž©ôi– q©Ž&¹â¦‰>F#ÛÞdkˆÎƹ8vý{]…Ký H¯®o®ç¨ÒQí½¯«7cÍà*ö¶sظ0iÒ CLirèg ¯ÃEbúƒd0dwÓÈH´^0øç„˜ªãl!¼ 3™ úik`tA]#D„»‚,‘ÕjóŒ9P›BÔÿÜ<ˆXè§šSn–?(Ó;-/è2=4éŒuM]Ž»%Þ •™¥neçs´KMh<íÏ-U®?@“Hu.Ëùû³Ž"„ßó¤c&ý]&>ã^ãÔåry>ߟ»AêiSï÷ÇÊvåmn?ó€¾Ðœ~¯ø<ˆ1í¾:$þ0"þ‘Œ>)j5±i-êQ<žPO­×¢”¹@ÃDŸi»ð2cq?Û¦:àvQ—@3r#Û ŠqõDqjõ\E‚µŸXÕ¼Žh“p…êjGª' O{¿ˆ„¡jð†¿m©>ÊÁ0¾ë÷-GD¦ƒZo̧Tè½\}#x± 4JË¢÷Ùd+í?Û„Ü-Ó#GŒØJµ´áTZ¡·x®Ÿž,n©.¡Ôqá¿ËRõ õh[bÐäÎÇöa—Ðgk}ØpåBGV[-·N®OÂÑ9CT5Û42ï¤Q\$mõ‡‘Ñ= :UOÝ÷ã«vÍÔ¨> stream xœÝW[sÛ6~ׯÀô%Tk¡xÏ›7q§î¸±×V;Ó±3Š„l6©ðbGÿ¡?zÏ9HÊiÓÝ—¶³£I$œËw9üÈ—LàÇ~ç»Å·×1{è‚=,>.$Ýdö+ß±­aA‚ÖÛ…yF²X±8õy’²õn!•ÏEÈÖÏ‹[/Úê^gÝá¾Ó}³ïï<ÿnɪrƒ7–+ .Dìý˜ÕCV±ß]½|¿þa¬üˆ­‹…â*Mpsï,ËYWÖ•fu¶Ó¬Õ]S=-׿.§1[ç~À• HxÔÓÞtÃçRÅæ:nÓ–} ۱‚m4{n˾×5ðÖ?j¶mÚ]Ö³ï/oÖ¸—k”Úý__]^ãÕ•à!¢$|!íÝõëñô„ûIš¸°Nß¾½>»¹¡'}¨H°•TxKp姦’ϺÕt.+; …r¶¥dÏeU±¾=°¾quOÓ8òô ø°ŒŠÇ¦RHßë­Ë¥Š}X¬¼®§uÂF/aWA$•Þ7mÏêa·Ñ-k¶K§Û§2‡‚a””¶VFS""¦D¼1`\å‡<©;AĦ±YÝw˜GÞÔµÎ{ü‰gPîY]0[¯±ÃN·eø9¿bYQ@úgçÛ±6°nC§O‚ÄV}(«Þ” W…ÜOåŸD{뵇þÑ hÕìu›aA:–=,¿¡T^VÖ]?BàæˆÇx88†ŽfÏãQ Š1†€ÁtVŸ5;@¡@ ®–"áaèJÿTº0ÐZĉté!"S[‹ÎNM5T‹ÊŠÏ~{-…SÉÀçQì~óÓõÅ=<|y± !Ã$ ¼ŸÏ(¡IWãÌU’Àà¡ÄñºR”;½j†žmÛf÷¢­Uù2Šäî;á3Ù¤’‡‘<zÓe]d  „Õ•äTZï—€ð@‘nH¸›¤¡—T-ðö@y®\s6 `-*ÞR…ÐìfèªÃ2 =NywÞ)-€ ÇŠ‚“Å«+ ¶0qóòj}Ⱥ¿9»^&¸y}C;ø³ª(¢*ÞèÞö ’W@D¢b©RPóÑ;##ùº%×€>£9=Àß+À Áaª9žÄv‹l¨zj¡[¼<ÅBÃîZ€˜º˜Ü2±ÛvÖ{òBŒ1•M-6òö56ðýíÉìÏ{Î9ÖѱÛûC™ùuYŽœh'€3ù”íö•~m£Âu…,„{2ºE áâdþOžø<à!hW¸@-Y}{d¬­þ8€u†=Óð‘¢òú„­ÍRÑêÓHàpì†(P¡¨ÛdùŒ”pØÒN xj Ì´qƒE½0EÅàòU†áØÍh;Ç45 ÿM­ jÍÈð»@Íϱ{Ýówë³ëï¬êá)O\#NßÌu;HœÓxgGB½Jbî‹tÄ…w•ÍL< Gˆ}BL4eùcÖ²¯”uŸµÀûÞ(§ÏC\…@G¯æ7S$¨Sjò¼ØJ¾eiˆEt­û©MûêÇlñ’±D©7Î$f1j ôÒŒøFN$¨A8ÁþĆݛ›Ü`+¡EVAÈÜyHRª•D.ê0 Isñ‡~ ØYðnÉ™ ¢ ï~º¸ÀoœKzCí•ÛúXåP¤…+JÎ=:ÇW4õ+;åSÿÁ“‰dýfÎ>5Š8Úf‰´×yù[>+§¡H®!lS«çËÍ‘sÿïŒóý?eÜÅå›Ó‹ûó«€À>s 3ëßNNјxY°˜ :/Ôf„)›ð×.a<2”Þ¼ùÔýì} rØkËÂy1à=Ëux±êaN–›×ç£xÐní<‚Ò.¡ç¾_qŸ`žÑ—`LN†¤ê¬–wvc'/Á8eŒ¯ÏÁˆÓ?°±«Ï@<½ "xÉæ$˜(¸Ñ?¾ p£ÿ¸Ñ_Üà‹À¾Ü8œ€ëÿOÀ%•M“?.lüWW x …Ö„Ê6С†òè`Mwî*˜»«?ù<ø‘Ò<ˆ¯c®HžŸâµ³õâßðùzŠ€endstream endobj 200 0 obj 1985 endobj 204 0 obj <> stream xœÝYÛrÛÈ}çWL)·Ä1ƒë£ckíÚ–bÂÙuY)DŽ$Ä$@ måüÑ9=\hº­+/±]%Š˜iôtŸ>§{üù\0ŸþÚŸ«íìÉë„ݵ3ŸÝÍ>Ì„~ÈìÕ–ý%Ç‚”¾Èogf`IÀ’Lò4cùv&ÉýˆåŸfï¼Õ¾Ù\«¢}¸nUWïº+O^ÍÙ¦¼¡óEùÜ÷ïeQí‹ ;ºzþÏü—^°1Ë×38êÇÆx~_¶ Ëʺbú°/Õ²î¾èÜ Ø§yƳ4’‘W´ìfè·Io_n:ö©ìîYm½ù8¡§vS¬ÞÏ–Š0öTµ6&ÛýnW7½@¿U5½˜³ü^iEÀòˆ\ËÂɹci;%mV¬®60·ºÇ'ÅõÞ ¤½Þ•÷t½VXX±„KD§ÿóŒ¾1Oéøï¼go^¿¸¸Ì¯ŸÎ%—‰÷ìÙÙežŸ¿<»x“_¿\j‹ Ä 9XÍô怶z—Å<ÿy¸še<9|+¸ÂijmM]ݱNm6%~º8’ÛÛâs¹ÝoYµßÞ Jõ-Û–XÕªU]­q²ÑvQ+ÊŽÝÖ ÌµªApCÊ‚.–a}¥VqS;bôy˜&äŠGQ£¥}ïUÅ ü[u%¡?b`âóÄîÿ¨ØÏýYEÂS™·Æ½#¿tž~›}«Öœß²ªf]¹Uõ¾£¯ÅS€²êTS¦kuKÆ™ò4L»©¶[ì®Z¯@æ2'Y@½ öñðÛlزod>uæaàÉë •Æq@Û‚ŠÀáÀ[._ "k¶< Îó· ˜8¿xµ4Û\Ù€ƒÏÎ^ÏcÊU”yùãð‚ƒ>‡†Ë®Öa¡dìߪAèT³-«¢ÃiÚ®!¡övESléÀñŒL¬fŸñaÓ†=ž)<’ý¡·†Úûz¿YSÔ(_6ŠU°JP|¨÷Úô"W2 JÆŽ‰TÓ•_VðK—¬N¢®Ÿ85)^·…ÎøÉ¥NPœl©€>ÅL„?å~æ‚ cMB^ST-ñ‚ÎÅÉåÙK½±† SÕ]Y©öT?[•qИ™ ZÝÕBF¬dR(|›Ãdæ¢4Íbž¿½<›¦œJ¢©-–‚º©À²± þVŽãЬ?œµ[àÇWË%C÷À†$A1û}9 ™MqjrEÕºik—¬ª\½wɢ߇tPîpìö^ch‡ÕB»t#jp¬ß•z—¡ï–•:edZWÙnÉÛ²{`ë¢+nŠVéªÖ¯Ñ 凙WT½ÕÜ’n›zk<Û7ÂÓ5ädµQ»×ÕÍø8à†z"ƾéén¦oc£ã²ž)¶ƒ-µVä­vü„?9¡/¿|>%¯ëfmkÈ&,0Ä•ôˆó>Öãb´_–kâ°Û}KfÍEÚä>S.£cúqHI¤HæRAä[*ˆxê§ Z|‡ lñZ& t‘ÃhÛ½U2 xǰ’@8`YzX©‡×Æ,ð›âÖeþüìõÉ)SºiAà}^©Ml_)2$a}]pv±S±ö•÷QÇY¦z  wGÓŸd©gP·p †ˆR#ß-z¶ŒKíÑ~7h¬´ Œ=Hƒl ¨+„îbÉ"ªi½Ç0ÏÈ0’°„¡pÖó ‹©ßòš û1õ–¿ ½Kg'L oÒ¥ Áì-“7Tÿ¶o2`$"š’Ÿa[ê.}¶ü“ªZÕ$†(Ëö@q`£Œ“¦hŒé_ÏÞN:„ÿ+=óvëCB`ô„>Ž(Ò d?b"æûióò¸g}O=Ø‚¤G)e¿ý«r@;©é²…Ô• ÉÁ¡ÊˆF24¼Á×*‡„9?æq6Q9™„#§n4&HS,Waž¼xY¬>þ®[pt<@àSyWÕ !í–ÙéAØ¡ŸD™é¡¸›GúW<,«¶›ö ’²&Ò^#-M\`VÛlHò…Ûär7£lú£lêÒGs•m¨ˆ<ý¼CCkæ Šås– üH|,Gq’È(è뿀aL<à)zlÔY à LQÅ@èn…Ÿ¥gñ6*Ö¤‰-©¯•ò©#èPbX{€`ÓœnZ\³èƒ`vøõg ÉNšv(ü{„ãðùåŒ~\9#K:1òû 匫œÍbÂ0‹ ÀD20ÐÿŒc–£ŠG©}[ŒOM>{õד¨PjuL Ì´7U/Es^Ü@_t[H“f]¬ûª™0l&xïÿ#j&[pé*æv8%ia¿ÂðZЂ­š‡<2ÓZ×ÊuÔ­:˜ Ð{ó$(Óv8 *rHØ0SwéÔJ`êÌ ©ØQ˜Ö.×(Çò й+Zú®Qœœ{oç°¤‡@ÞÓ2Àìõ ‘yMçš8$OÂÔ ã‡CjÝ1ÂId’ .š[u¦SÊB×CîìG¦)°¸ â#:Tœ¿Òe * czýXoPLn?×XÜ[óÍ>8¨aiá6ÅØ&‘ýzi×_Æ÷’²››~4Ù`²©ݪFÓIÛÑD†Ã†Ä$²nÞ£ÊW 9¨ïÂÝ€¡ÃÜßam—é£Án3Û¦~MzÃè(]γÀ{º\þöü±3ƒŒ“e¾”L˜vËϤÓ~>Ò˜'Bxݧ‘Þxq(†×Û9rtÿB¯Ðµ„ë+ÃÌ$·v׊„zsÎ 9ù}u ý¢ ÃÆÚ$h þFW3­Æ­÷ ÎuóU©sÙkëÈÐß®/_ŸÿÃ5:,p’A%ŸNÁË;£þ|þâ ­ŠˆµB§%¬Ù<Â… =M HLܾ·zì7Z*5±‰."Þ—ÕñVÀk†™/™Hü;¯RŠÆŠBgíîšÓã *oßi© ]toÛ¯tª9mµ‚ ' ©#jé “9U@mwæt.æ¡cð«ÉÕ¸mcQõ€ùû C]d~ýTð§ D]CïRt’º¸Ù~G'Ea^ ­–[\æ¦{|›Ù+é|à‡Þ2coó¿ÙK üˆûëPüŸHt݆(P‚éˆM$Bá£{°‰ä±CåÔ’ZË‹ ¢˜ào¢^övª¿n§ÈÎqŒ‰8嬛ÿï1ø˜Ib±wÞùíXy×Ê` hùX®My¤Iˆ •†ZŸÎx"BoºSâÏ(í×&ïׯ.úÿÓȾxóê¹Ýß«pré( oT·o*µv`F ¸Àh.8Ýÿ EŒ:Ï}…”.â— C¦ýU+ºŸÀf£ßôtêïÎòÙßñ÷?8¼endstream endobj 205 0 obj 2559 endobj 209 0 obj <> stream xœ­XksÛÆýÎ_±ß vÄ5‹gúIqèFÕv-:ŒÕÑ@àŠB Jaƒ~tÏÝRÖ4v:[`÷qî¹çâ7æsÁ|ú±¿‹íìõÇ„mº™Ï6³ßfB¿döW±e߯° ¥«»™Ù#X°$“<ÍØj;ä~ÄV³Ï^±o«•w‡›NõÍ®¿öäõœUå-½˜/‚È羟xÏë}^±/®žÿkõÓLÆl«õÌ{óéãåû«›««Ë廿]¼[Þü°|;_ý{¶ðy„k rÁ0Z~þɾËýV¦Yj_^®è¥O/¹²…è•oì¿R}Çú{Åò¢×¶‡]ß0UoÊÍ»µº› ßË÷UÏîš–]{pa»U}[ðÖîivªÍû²©;®] B¶ºœ­þòÙ»¸ÓÇØuk5"ŠŠôÊóºnzv«‚r¦·¾þ(|—™ð03î|Ö±YRdnlh®–«·s!ôyÞùÅåò{ÀAdÀE£ìX«ú}[«5×A Ò”[©x¿| §¡ŒýÀì<Ë$…ÊS5œhö›{üÂAÈ\eëFuõ+ÚÂLi²#xœÚý^_iŸ+µfy}´1HxÖWï°7š%æyÞæˆ¼j¶ÊG©/ì’³Ò½ÔÈx’Hßá¥îÆs%—éÄÑ@;Úl‘“¦~Úìm:iý$#©äa ]LO!m»è/$ ÈtH“0ÀÛ–›{ôµzª)ËÙ6/Ú†õù¯e½aj®ÓfÞïgu@Ü[L¶s‘r_‰·ÙoUÝwœ­îU«€LuÆÊþ•A|í}E<Œ\hºvða Djý ËŒûªhíz ›Ö]ÞuLh° „\$ò¨€PXb3Bë'Ø0£Â1 8à×Ö6*Ê÷~^~¼ºxÿN[Œº¼õ}‡÷!Ÿ˜›F® : VÕ H§÷#q}ÛTìñ>ïÙÃÈÉÒ(ôTÛZ›;†›_¯.¯hmÞ÷j»ëéÏ}§ø|Á¢kï|M¾—5KxÆËO }½+”†¥@ÛÛ#íî{Íz­Ú6½¢¸³]ÛôMì<hg©M `Ë•aÍ…»÷˜§U‰³Z:åA2P0Rø @Ä·óÐaìá:¢QZœ!ÿeqò* ¶.; ûšÝ,—›Ëµ+8©FM‰ë¹³áhŸeBð"nß6#Éø<ŽN½„¯·òßu®Âؼý_×i·¾í:³õk/“ß~™üªËt4nü?JŸU-š²ýz#þT>ÅÿɈo̲1"xш481bÊÅ70áâí/–Ë–Aþ¿@Ä´ý‡Ö¦ O1ñÙãßÏ$<¬µ£úÄ ä‚øÈ®r% …D%z¦u#nèÐïè‡A@åÕ^« [¸¤=’Ôñ4‚$m»]M5 Ù¸…¾uÝ+Í+ú‚i»(Ÿ”Õ…{ü_÷eQöº‰ží”j]—Õ¼H]Vò(vQ)ÆD!'q0°hèXTµ}ùTä½âìÜú#²hôÇòò4N¸p«rôgrd­ý+£2øjHR³¤ì> é¸ÀëMœÜH xR§ÿ„¬&µám𾄿¡tjÂF7­•¦ú3íx§Ú}€H¡*ÃA:D¡‘-VÔkJQ18$®ËœZBl—k g Ef+§< ]—äo¦Ò/Å–q™4*–‹Ð‰`aÚ(P.&ñâä$Yö4ɵ–âóº1ǦaÄáٓ4g}»ïzóhµG§Ç‰ A$]¨!Þ7'·Xe¶ Ö «8»ü “UvZ3…¨€Æ-2a{3Ž6ÖàÛ¼C•͈õ}^jm³.7e!¦+7u¯º3Ö6辚k¨Èå¦%L_{oÎQÙ‹­BkÜ<úÑé°tûÝ®Ò Œ­üÉOå 5øÿRëWÙ”@h-BˆkÄÔ»u#¦Vîíëu¥+àÍ9›^{íéÂËÑ«iÓé@t)›JÓÄ@ 9c¸!y¤)•>7ÝHÑ;§‰åZd2¹/+àr«PMy½àÐíTQÞX^áæš45S‹ Xz22±ä™ãLÇ»oÎ/Þ½}:/³ïG"Ûò–öûôèHòxìãÙ,‘Ë„Òcˆós¾šò“¬~<6㠑ȼœJzœøÉ †‰?NýM0Våùr£™Œ©}"%¡á:ä¸njbµ3BáéÌ4óY@ßÍ3ân -«N.msÜJE‚IH¤nÞ ÌÞƒbý,I'f˜pÅ_رSBìÓælbB=¦õx_æ}ÚÀ®L+n&Øea"¹o 8sQSTZpB;tš ®1ÑrjÊu†;£ŒûéH6‚Æ‹þ‡É1üº}Q`\§T¾Žga^ ·™ 9™yZTtg˜mã;ä™LšÏ]dLŸxNÑú ɈªîŽæ‡Êݾr BL+ !E¿hå$! 2 z!œÜÀà0­†(ÎÄ€kÝaÃ*Là2Â£Ö£Žª;šu\w0&1f²a¸Â´J-CK‹Px–® R#hHs†~öÎò¹ŒR`S¢+LÔ› ]~jUÄ52Î4Ö'3æP§#xF!º×;Íj¤È—[ø‘WúÓCߘhJH!m“ó>u§äƒ†ëë N%>/õß_­ž—z<~wHÃÔ`xÞ)œú£Z›*~›ï}ƒæWÓHWÖÏAr4/Ü5δ—frrÀˆ„ª\Ûæ2½ !ze>‹EÈj4n2f·cëÀé®ÔÔZö¨}G©éÛQŽ'á)Má 4¹DC6ŽêÞ—ÈS¦ÓpDÕh'1ÒD¦cAÛϳhxž¨õ@\:òÄOGmbü”¼¾0 q;Bý¥h¹šý?ÿ*´Öendstream endobj 210 0 obj 2298 endobj 214 0 obj <> stream xœ¥XÛrÛÈ}çWLU n‰cÌàþ¨UäµÖÚ•"qw“’S*‰ˆA€@)Ê78ÿœÓ3ƒ iÙ±Ö¥r‘çÒ—Ó§Oã#s¹`.ýÙÏl3{}±ûvæ²ûÙÇ™Ð?2û‘mØK,ˆéÁònföI%¶ÜÌ„ô¸°åãìÆÉvMy«Òöé¶U]½íÞ;Þû9+‹ý0_ÈÀå®9¿¤Õ.-Ù³«çÿ\þ<óB¶À¿e>sN~»:¿¸\ÞžŸýúæb¾ü×lãq_¦W ©W]¦ô‹KO°OqY‘aNÛ²”eë´a?°®Æ÷ÿ¨¦fj6E•v*gm×Õ=«Ò }¤ìS©Øº.sú_])V7lS7ŠeªéŠOö´tÐÝê’ûq8Þë;USÜ=±n­´Í^(¹7,x$tÌœ­R {,º5§u~Ì}‘$æ,Zä›À.×EË6é‡y“D†±ƒû[Uµ°¬*ŸØãZUlב¢bY½Y‘[E]郵 Õ×Wµ™”°vº{!¾¾>¿ýýôêla,vÅÞ7ÿ¸<=½¢Ç#¼„GA Ì}ãòˆ‹9;»3ˇ+}Ÿ•_¸ó¹„'¸/ƒ>Âõ ˆ¥ïèà|6D"98„ÍxnœpéýÊJ!lUÝ1µ.ßÃ…²7÷AMð%ã$öûÝ&VÉ+רXå¡„¥K³Lµm±¤+f‰´žÃ%ÏÀSg׎áÛê‰åênþjÇ\„}Ȱ:LôòtWvÈ~GDnYûÔvjö)r $¦¶â^ixò˜öe3 dÀ³†·Ùà‘\$±EÓÈÙj.e‘ήÊa:ìJÛv·A°píÊ j!qf :˜:ã´j%?¦Ú.]•E»Æ¾”NÁ‘³+JœTl:Éå2‘´{ùÃsv§¹Aǘᇴ¡cé½^F<ˆ¢¨/9™x&0EÕv:$¿^_3@‹Ѥ͓Ž9hÜu)$}fº!1w#ϵxsì)—§¿°Ëw'×ïŠ÷Ž­Úv«6¼­Ap¡VAD‰Žñt¼Xjá%5¼dÈý!µÎԾį§(SΨ› G>Î…LÝ|`Û¦Þª¦|š‡>OâÀwLXÈOÀœÇæÀ¾0ή¯;½:A͉ٱ4;¾]W~?»¦ìäxB«D`r8¼I»žFúÚ>¨T½h”ê±nPGºàò¼ gÔbÖ*û@¨ ¨ñxrM¼Ó‹[Ï]hl£HǶ0‘K—†-8ÚPb=ŠÜús¼œj9Tóv5~¶Jâ¯÷Dü'ûG^4*ƒÆxºˆf¯-ÚÊ^3¡î[6í#_u a,h~TéèH½¼2ú„˜ZÆ<Š&»=“Ã^²Pó‘¾o›ÏÅVU@ÄÑ!í^mvX¶¢F ¶)ŠÚfÓƒ@ ýq„=#¹w-…À”è«ýß6 Z³]W”E§õè0£ÔA¹ìÌ') 8Œ}vôjD;zh¹‰ï="ð¡}?¾±J`~Ø'"þú°å‡ÃÀ7ßÒöµaà ˜k<ÞŽL‘Ä 28¶WQ®û1„ï=[QøÓrš˜†_†-HŒÁæ—æZ±â>Ït쪘Þ=ŒCÏ.4[è¦*¤·¥|4ÖÃ~ Ãäó!l?áwÆš¥Ê(óÃhK§ªKä¦[*ŸªLóZ™Vù¨GhWzZ6³h€ éóÞ-¨5#Ààª74ôǶo m½¡kSté8Äžb£$µµn%˜A˛ԯoJ/pÒ*ì\SIÏP ¤KXð§TÛP‰ì§j‡æÈi|Yl빤‰À œG­úId¢âõA’²juÑßñœ*1EO­h•fµÒhr*|@¤X¶9˜Ažï4WçoÎÎO_øBGØÂÿS#ǨµëŠ0n‰ MÆ yŽ£‡ž›cÉã'm'Tà‡ã.´ >9àõ‡¹4Ó‡“–EnîÔ²·Î BUÓó7¬ iqþ ߪûa6¶ÒŠfã?ˆo÷§cWȽüÓØŠè6Ó(£~:PJÔ€7¼±êµ_úD'ÕwªÒÒ\éãl|¶˜ZôddÔ‘=ÂF‚D\bÛ…*·}æPH¢&&Šùä¯p¦]Ù¸öÒÞètÙbín»­›îÈ+½>qþ¸Éíï·oÎ!jƒö¸ƒò‹Í›3ç'ÚíÉÛÓ“wº¾&{¨š|ŒëA, Ø0{R5@ØöŸ–¥Ž*ÕÜÔ‚~D ’¢úSùOæõ‹I€„y4L.ŒÃ)GkCé÷›B=¢¼|¨*Ùöhû**NçH<šgåÿ×çJφ¢]ùѸÛÐÃñ_‰[¾6†@3tôk?f‚Ž1ïúáØIHÄê|ê°M*Ôœ-S(q KRޗËà$é‡`[e)Ñç4K+êHzeæ”Z=^‰}]ó ?Í9¾›¤‡á·˜ót6§”ƒÅà¯PÚÐèúëEJH|k„j †©éU…QD¯û¶þPO¹y˜\¬»YßÍ+ú~W謁çò~èÆ`éû{eßmµÓ¤k¼¸ÐdQ-·ìq?IöGÿqðaÿÆÁûöâzù¢tcOYSO¡ŠlÒB×™û/zΤ½º'¹ˆÃÙ4ë×€‚¦¿þ•£øyO 2b öÙèAzFý_Ò³Óåìoøû[F%éendstream endobj 215 0 obj 2575 endobj 219 0 obj <> stream xœ•XírÛ¶ý¯§ÀûÃT+ÁøÝ¹Ž“ºuãÔVo¦“ÜñÐ$,±¥H•¤ìºÏÇÉÞ³ARŠ3iÇ3qL‹ÅîÙ³gùs¹`.ýô¿³íìô:bëvæ²õì™Ð/Yÿ+Û²ÿ¬° ¦«û™Ù#X$Y”xÌYYÜÑ‹ùR.wÝÈù)­öiÉž]=ÿßê‡Xz![åpK^mŠ–aIQW,Wj¶E¥Zö¸QÝF5öö0w…:ª)>bA·I;ü£X«óÒ<¼d™j:›÷usô>‰é}¡ßþ^Õs8K[®=“>[]ÎVß¼wÞmTÅ*5]×]‘vEµf)»¹¹dY]U*#‡'÷ðw•·XKž³´S¬¨ò"36Š®eE®ª®èžæaï—qAŸnC1ºR„§J?=«·[˜“nû¨ÊœŽFZ÷w¿á`ö¢+ÄBŸG7º47rÆ …14bÚeeœØÔˆhE‹ûuHÙáí»F´ûc8²n(¹ç }â;ëò^¢¾ü@šDЩ—¤å^Q*ÄÂ``€péI›ãr<L$y‰~í{ç±(KÖ¨nß 6*¦š†"TåÚ•¾Pæ’RøÆ½¥ª;vgâ¶aÌeh!!y|¿Ù&­Ö*çìBû°$²Ze3?቎·)½ë7e3!xºýÕvG/ÝþE(c{ÇFƒ1â0Û/vƒÄÀñ¡¨÷mùÄ>8ÈJÄQU®¾“J›²P ¨,ûÜÍ%aNúÎ~m¯Zß³¶F6ÛºéÚ»›‹ÄÜ|ßõTRÕ¬¬q­ÆÜ=vyˆû×Ã~·ƒ 1GÀøûFý± À©R¥91žîšzݤÛ- ¼-Ú.ý}ŽÓ‚¹úÊ fAà.Žk¨Ýg™Rࢦϋ«ù¡K\žôeí¬Ó!¤ ÷bT¬ i^ª¶¥]Âtû9ø¹N¤tÁ[†sÍê ñœÔð¾ì&Þn‰ŸÈÉ–¸þÓÆ€;uM]¶ e–ý®ceëýd&û~Ð;­šŸPhlÁƒÀ¾k³<1ìé/3l•´Æ‹x&É6ËeB˜j,Ób‹äŽåy™Í‚„GǯF[äX}¡¾Wê†VïAwŠ•O¸9·™Œi÷R&‘>b(µ$1¥¶·Œ‡Ä<ôãØò¸×¯1Q5v8W±H$¸/"ùÅæóöüüš¶„°¨Ý™t!‰àÙŠæ´Šd…^%$šJlƒ_Nãê< ŒQ*ž^¦ü(0ûˆJ×sÍCpUT Þ777T×:F“‹PO ìýé"KÓ¹@}adcç|áv“Kr`Êæ=¤m­©¦>æ`êi¨¥¿×¹Áh–¼ÈjZ¶5Ò¢[% )+K+P­©º(qR Ô–\M±‡ÈDb/ÿ &Õ.§ÕÞ9kê9”Ü MH@#dÚœ!*AbûêâÍ«+ Hsš7оóvJ,q`Ãæ÷Ф%DÌi¯(èU¥w¥²º¯/H-bp»}ÿ™‚X\ï³r]à¬ûš­iqN[FJ ´==°•bè6üÝx„Ö"íÖ¢Û3îæ‹A¨¢ÃÜ÷á—¦BcËô‘s·ŸFÅ%Šƒ% ú‘¬_íT°,Ò öúæG4°æÏm§èWºçê\J5ކBmèÏ®I!hÊºÓ N1h SˆM EyÚ¥,½«÷Ý ã$® Ù\úÆÒÈõÏÐâ}«at(‘9ÓD®ÏÛ¦O´¢"2ƒÂh uT/<_ÃinJ7#ç ¿—C÷Po®^µ÷øï¾³•%Æ›À‹ÂµÑzìµ…kZÆ#‡ÒúH$9oºÔÑ9¡Ç½(œ’' •©¬öÁÊòˆ7]A”ÔÃïƒ3åFPi΋<×7±Bžˆt„„ ønÔùXÄC _¿xóòê§ÛW—ç‡øjñÊh¬]¤¾aßPѦ†žÌô–’ÊùXÅ@éWú/ X$^C{¨¨ zK ÷‰ÌåõV;¥µÔ†Þaz–ªÖµ‚ÐŒùmÝØFìT†!ÑxQ´FéE­B¾Õ30Õîé‘Gk~°hÕG²üùž¿~ysuöãùêÆOás$‡ŽC¸?™I¢_pNíz×K²ºBc“±ÙÓë)]ÅúÞª#Ýô2U4þ´u¦¥eìúàN‚Ü&Èй "ôâ£ÖbSw”-v”“/㎺ßÙÅÛïϯo//nþi죦±[°]9¯Wϟðíô­7¹¬j,¡«‰³b·Ñ“cM>ÀÅçÐÜòZoLÑ@vûTuà\ÌÒ%T}V7žmAÜzNm Ó4г4½—-âºKµ2˜öM?hô5îÈZeËõüš¶d¡Ý¥(9…-Rˆý]§»'Âκ!Å„É:'±QôzZßw½Mm¡¢î@nSŽì_ ³À´0½ßfg™NII Ù`”ø-i”¡ÔÉÙ2ÞðƒŒ/íö~lp^Õ†ýØ2ÞØŠ›«ñÔ€»4$_%ú!ÏtLÝÞ^WûÕåž8¸+¤ÄØQ`Ú3_$0¼ý™nwnFèLRËÊ}®ØÉõ™¿¼ùþÅœ$Ÿë†ÎÉ‚}ÂßâÛ—ç7Ÿ¶F F\yX#'8÷Aœh/N^ž¿êoèC¯yã,ûâ—þe"ûI uÚådD€º±…|bpgf+3Vi ê9´O!É)ý½ƒ¾6€Æv Ñë‰~|fðF´k6¿ÖÓC…†Ÿ½bê="ø}Ô|o|Äu5¤sÕÑ›^[·®Œf|wÔ,—°æ õ†1¨ëvßž>>>Î#Ÿ†‚Ðá@QÕ¶%¯›¹Gä„F½>Íë¬=Mw»öÔ¥Iæ–oºmy¨MÇ6k¾µàNfô‘3zpo¦3ZèF¶€‚ 2x#afæú‰Eèc¦‹¼xÜš _EÝ<èçå¦Mo›Ì¿2¾Ýæ¡¥ªÕÚMúiÁT—qöNŸè‰ˆ&¼QŽÐɧ9޽æcÆ$G^Wv䕺æ $"?´ú¦;àa?ví ç§ úÈ!{\Ķ*Éþ¨5C1)ÑÒÓfÀÓTŒ.dè¼Ñ|ТØî?Ûš/­ÕÀáÄ`yÑj)>ÌKãh\;¨Ïº*I„Ö ü]Úö²•ö÷JÞPT_T'³0Š ï+å@ †bÿwËÂs© ÃÇSë¢ã÷*GØÏÚèúÆž„Vv§uT·èºdB·%“aÿé¶ÎoQMœþ¿+!áM%ÙÇT;ÿ~YP¥9ÔïT{¤„—ô%ßwMƒ7¡µ#F(ÀxÒ@$&~ϳà?0ÛHyhÒf£çCjÚ¾GÏÎW³Ÿñóó-æ?endstream endobj 220 0 obj 2755 endobj 224 0 obj <> stream xœ•YÛrÛF}×WL¥¶J`Vc÷Ý'Yfl%Œ¥é¤\ò– $!0h­þÁûÏ{z.¸Hr¼.W,‡fúrúôéæŸÌ傹ôÇü\ïŽ^]Eì®9rÙÝÑŸGBý’™ë{½Ä1}°¼=ÒïI%¶Ü éq7`ˇ£kg}¨‹›,moš¬­öí'Çû4aE¾¢_L¦2p¹ëFίiyH öâÓ“/>òB6ÅË Î<ûp5¿¸\Þ,ó›Ål±8¿xþææìtâã0á‡ÎÙ»™zi §`ÇZ½-$½í\¦“åð Ÿ&<`=>Å{‰O;MÃRVT僬­ð{üµÉ›tUdÖîc:Bò Q‡ /á¡/õINsè΂ûq û+}Eƪ[ãqEÓäU9=ÃÖéz›—wœ-èÚmÞе‚þÊJuuÞröú‘ΞŠÐåIu.m²[ú\H†Ib¯ó‚X]—Š–¥EÁÚ:-›Û¬†‡uÆ6U™±Cƒ;q]¦îÏ8û}›ã®²jÉ–©ël¥?g:1]Aq”qûæ—uÓNG±0¿ØV‡bÃîàßöP·lõÈÒ¶ÍvûVÙP©»d„WpqÍåRúHuv@àÆQkNÈv8ÓdÙŽbµÊت®î' O’@H'+Õùn_d»¬lÓ/6,/•Ï9ìi·iËvé#«³?y)àÐísòñ{¬C¨Üà€ªÞd5»­jfhëu–m8ûäœn6Ù†Џ¹ MC«X !ŒŸ@ðbëoözÔ‡¼Ýâß«¼Ý¥Í=™ÒfH·Á*KWÕ¡eÍ>[ç_Ö*«l›N¤©•ÏyU7\—‹:J7&âi²òt>¿ #Ÿ›d î†Ϳ߼ž.–Œ‹˜VeñˆPì÷UÝ"0Х冒zÒ™ÞšG‘ÏšrP({•ûê‚.÷€8Ý`c¦ ý/!"-éMËH!N†<4%à<>ôH ¸ŒÚÚˆ"¡Ž®êû´®å¦Q™La$®ÊÛGößÔ+t)<´¿vò‰'#T´S¶*têésOJÏÂ]¡ÕSî/ç DŒí몭¦è±änÜeÙã¯MZWEÃÙ¹ªhÏçà}ó„ ÈPFÔËcm¨z} žiK®‘‘'EŸ>CwÈWGR®ðÃòžª-…—"}D¦lôFŒŠ>S1F”¸4Ф j½(ážXCOS’й ¹ºYÑ }25B•ˆÄúðÐ㟊©c!:N;Q´ –»-(’íò»m 2#Ûò²ÍêjŸÕé*/(§?*x×èŠiª]†Z­ Ô1ZÕ­ù^ÂIRô„DÀ•!ˆhœÓ«÷çïßþƒ¥¶éH E´…ض…ÏÕ°ŠÍ‡ù¦+F?æÛõ‹0,H§&bEU5Y©ËÇBU§_ĺ•RØLœ¤C*]†ž¤Î—D• ú­ïÚoƒ4ÕŽˆêˆc(sÙ5Þí9ÿI×-ªž˜ô ûá@×4ð—ùï—«×óÙo³ùw‘ŸàAôÝz½Mkö#ìbû´Nw²®áä:&®ä~h}ç‹>&’ áǶ¨UãÍØýD¸NV¯€¦çƒ"+ áÆ<”£~Ø]8î‡Åí( ¡½ye?-/ÿ©óŸmõ L v.|E²úacÐ(NiÈЉÖTrS_,RŸ $‹ÐœZg%º(gK“û¨w½N;¸ú1€žÜ´5prÂŽ×E–ÖÇøÇ$ðyG±Ó¤·}°®Ê/ÔFžÇD(Çû:ïªA,öxäZjþ<Ì«è£Õ[ØfÇ– Ó¾/žç¨"P¦YÚZÑÓaÄ»Óê|´ÀM•Y¶ Ѻìµü¯RºOàiý´KÛõ–‘Z‚jÃMv¢ÝÓ©ÐÞ%h;®ü†stf¢ã ïtë[©>¸±º¯óåöþÃ|>TYcÑ©û,•£¶p%Ò:qí``)н;ºÉSw7ÒfùãµóÉYÚÉÄ$›Õt_V´´$‘‘óPR} ªÖWeË{²PÉï¥BïÅúÛÅâôòüæÍl>{{ªm¡CʧÓ÷]߯6$]YÓ]tÞø,ª•t)lüéЛŸæ§¦ƒ EÇ~„öbÕñµó¶E”§J-< ®b[OQT£3Oti~8 kÌ÷:âŽèiØ_¢*69£¶™­ëÌ €„q§tAQ¾Æ›)#¶É «¿]…1t‡°WÓwCy=È0s]L®É ­Ó lù=;ù zϾvvo¤›ªŸ˜1$‰Ñ¤EÒ¿a ¯æÌ댃àŸL# 'Ž_Ì´“Dñ'IØ#úyþ%òË‹ùùÙG•y…t@"TΡ´{šGæ%TR€Æ]mF™—6…γðˆÿ'<àeÃ6­¹b vñËôt1À*5oén¶œA Ýi6³‹pPž¯µŽa:3Á@AÎÐ6_«ž‘À 1}}°~a6f|¹ÍÒö€±)o†RýQip:V;JĶIS{ÉP&Q_JubIœqs¦Ó3LŠšu3 fiÂùv ÓAž•éÄAéˆeIpt5üUšE×*ab°[W»=&Úi›ï2à-p]g,Pd'P^]% NCú-p—DÔe{ŲX¼cƒI­_xOÀ©Çºw7§“Àè£Ëw7Ë—³Å÷-% N’èå¥D?íbš¼Q:W]ªf»ªVÝJpd ±˜ ³ôq­ŒºüðÉùeöqBbÕÅ8sb(\@Qzbì˜qÊtõþj4:§‹Åïzr†j :B£Ó.®ÞœŒ­‰Á˜D :•tØ»‹ÅRI„GÅ'@2:0;'g=JhÎêá‘eqà«ÃàÓ닉è÷ôêa“Øí.¸G35Á{d^ä÷J\ÇJo—(ogï—ºg¡øU_b¥ø^P˜^Êî$ïI £Pþþ#¥µÀvÌÚ£¤I{òV©5SºiJ¯ó© ¤få³C aGZ|äŒj¶ÝØDJ¶ag[”Z ýy;!Å.¤tn³õS1R” É´æÔo`Ds1šÛ©wéjs)ÄA$€Nú}…žïÕ è.aˆZ¯4Ûizïà{ü+-õjAS$¡¯‘ñ™~§[Ð'ü»Nu‡B¬Asð‹ 2S;´›_ßß5¿@«$&Ãf_ab5ÚÏŠnŠ@›æ%ýÝi;º6Ù:ß‘PÈïòViùN=6z×¶Ê”ÃBÆÃýŽÆ]³_¡¹.ÀŒl}ßvFç²:ÛUhdÛªiíŽ!Òý4Då$ÝÂs?¨|4-»bˆŒô^ùZÏ4ý.1æ~¯À³ÇÑùÐ9^??‡Ø@„ýk!£”tý¡ BËL 3¶Ú¾%%%é—+ô>…d‡ƒ—¬w›Q „¿‘úu‹îë4ÿ.Î.þÐØýnu'ÝêIn;¨žˆªç/ïúé|>û.HIhžÄcD}¡Í.ä•]Z¢Œ^L‡Ê§¬ùBj®~> Ð ½Ûr´‹¦4óTÕ>)qRŠ4h¸~¢dacåžîÁºÇYÏrÎßÞ]ü:{ÅA¯òÍͦI9¬wbšÉ½¾Èbß|aT€»ãñÏy]•$qØçnÎIë\oÛ•Ì:Q þã|üÐ_úƒQ_väÒ—ö #;;¯5£>k€±ª•TFäÚdâÒ$£a,—¹0b®ÇÁ¨»O›Q8 þ:øè6ºáÒ#Äè]†û£&AÐÓ‘‰ÐZ¢%~hÕ–è·Ű #vãŽïkäå+$G²‡mŽy™(U‘g†ÇwûCK_b°ÛºÚi­ÿd„–.íýoˆ;’Öc¼*QŽàÚ¹ð„IÚîL4löU;ýÁÄšxí B_©u‹ÕuÓµóP ™OôÂÛ|cqX … ´wÿN÷y©·L´§‰‚^; yíbŸ•‹Åüi[ ûEæ@¡õ÷‹$ruþ›þ–ˆ e6äºç¹vl<]mî‡gö"ïL#Z¶}‹{ÂçÛ¸oRÏÓìCM$Þ÷'ŸBÓù`ÉJÿî®ë§T函Òû*U‘Œü:U þWL5f)5÷'Ý[ê]ÇŽ¢=Öà¡õŒ± ¿ÅX–­˜¡#ÃZA„ xØ õ÷—TEí % Ãn¸ÇÈ -;׿цû> stream xœ­YÛnÛØ}÷Wœ·¡Z›Ãsxï›;qÌ%žÚJ‹". Š<²8¦HE¤b¸ß0ݵϤ¬Ät†Dêp_ÖZûÂÏ,ð9 èŸù[nϾ¿IÙC°‡³Ïg\]dæO¹e_↌¾X®Ïôo8KKóÐÏr¶ÜžqúAÌ–OgŸ¼ò°oîeÑ?ß÷rèvÃÞ-XS¯èÂâBÄ©÷KÑІ¼{ñŸågaÂ.ðYáÌ>Þü|ýëòþööÝýO®aäçYĽ}xw}»¼U÷_À˜PªrA?ô~-Ëßà¾Íý,†áø6ðEblí{V°]W·ƒÜ³¡Ã‡ÿÊ}Çði[·Å +Öûº}`›®©èï°‘ì÷F²¶ØJÖ­ÕçǶ[2(޼§ö~ÓõƒºçzékgÒÀOôã½åF’UaøQìl¥cð5üÔ¦jíÕ¹ý¦;4­½“-â¢.­»ý¶Xѳþ°Ûu{ò`õLÁïûðÙ{²¸ÖÇàO¿“e}¡ŒÑ5¶À.žëý.«s›<öT7 ëÚæ™e)w+»¶•åPwm‹Ã†i+‡ ±7¡‰a>+ÚŠíö²—íÀêVß+ÎõÏ $zøÏxxgÊk¸Rn(ê»Ãª©Kö¸ønÌrúIç&¦ò™¼}A?-Ï2\@ÌEÿ£C~žfÜ\èU"¾¿á7÷ã,µ—g¨»ú÷Û~X¾¿þ ãø ?å©ÍX§:p„¦FÁ 9ªäzÁ ÷Qî‡f`+¹)<÷ó<Þ—ºÛ#¬*xÊ"Êý®Ø|¨pPU²l ÷3øéТn“ÏìÎŽ}Îs&}ζîï6¶>n¾¬*àYI}˜”€ô¡Šs²!ñ³×âñÈÇ~2ã%÷”¨s'yùQÏm™K2+ŒM³*ÊG¶>´ ›ÀýÀ$€I—àêÓF¶#ucä%Ïuê6E¯³AêGv„A¢\XIœSu-`¬ÒÝ( ?£ë€(÷ÓÄdÇ{¦ Ì ]:M©‘{ŠÝ@/Èhub9(âT i¥Øí¨¸qÒAÊ ÅBŸø‰ž%H\òÐëvÊõ\xšðÀÜåí»RÊÊg#æBF WÑyDp#PQ%mëõ}’Ôî/U;"¼‹t¦Ú"…HhhŒƒ8Mß1_Û$~sDD×9îÔ¡¬?‰›8õcž½›—`Ñ@Ù} #ä°ÐV¤V 4sBú£ÜùsËÂõ˜ðÄwRE¦ë[öÝÖw¢.Æqêàb_WŠ8C`ó€y¤°îý~Ú&ŠdæLææc“‚Dp‹A{ µi/·Ý€RSx@Ý®;¶¦K}¦£J?áWX%÷î5ÔV†Å±F ·p@K‹Õ4xP5àJä‚HÄi%~c¼ S•PèSXѾ\Ž>¾ çå\´ˆbÀ!º’Ž»…ÒŠ_>Þ.‚á°oáª+ôëŽNzÁs5rÜÜTv•쉱ƒ´hÄh‰x2'Ð1{u¶2?L‚yãÀëŠ q1§ó^9üMùŸ€ýGêüÓ»Û¥.çpP‘€;åEFžrûÈû·ï?\Ý_¾ys¿\ðLy×øòç+SŽ2€%Ÿàóб`ú×9þ"¤; -¶"î S­ÝN蜒Z$Ö­¾˜&€NÙ¹Uvj:@KÂÙ¬'nJ|W*SaGÁ5O+ •Ô¸ u{¡ÝCo–çÙDÞ…Ö–eXõ'täØëfÖ½y2©TQi©8 !PFCçJbŽF,Ê)Gæ»Çòºíª›9„&3¹«T»®k\ëK]@Z FcK)'ª†“b¤ºïT7¶Û÷ÈΚ"øD¿AõˆÃØÒ¯èÛï `Sn,ŽFÊ ÓBŸæ®Ðc4ì÷²¨ž]ÿöRDŽ‚ ‚UÅPXgM{J•í«4É£‘N¨vº—Ýv×HðîdÜ5E9mÓusÉZ©»ÃP$º'Ê|Ç~ïi’ÕÅÛž¥Sg2‰µkæ‚ð¹yöó9ëç'£h&öànRñÁÇIÅ·¶ÃÊ}¯:h#3døê ¡9œ½¦$ ít˜õ¨«×…R5`ÿ·&hIЕ÷ùó×ÈÅ¡«,Qþ‚ýôŠUšˆüû!È©‡}šåþŒ÷šÆùGXª›[U†]AòN1wÚÌŒ·üsI,WÙS}Ï æÚš1a.j¶zBˆeG˜bý5fbæGêYfF˜|Ä7™‰¨F)·áž3R'.f"–þ©˜º¹úñê‡å)Tq(Û7A…dÄ6"Ÿ!Šú/+£®Žzý~êzê2‰'eæ÷¿(ÔÏ UÉÖšéSƒ”™ï¼çY/’ÜFz=J½ƒf¡ “:|¥ÑÇ3x?™”ʦC·ùçÆúÍÕÛ«›ÓNÄkÎ\YFis‡¿ÐŽ–yx"Ü(a‘ã¯yØ'îs¶Z…EäT-`´½˜zÿÞ#œÇʘÓ§QkÞÑ$ò¸ÈUMŠ0ESÏWA ºÜ±‹ü¢¢ëcŽI°)´ß“†¬%ÚÛ½ÙÚ€óð0Êaj_j-£ýtÆDoæªÑ'É0ĪQì»­DHÖBS3ÄÑúÁÊü$ !za7«†S,ªÝƈhºñ©ä!´t”bm)e²Ÿ.²8¶0®‡C¡BaÄa×¼}Ué¡§äz_H)o‡D¶&méíæFP£šÏrðrûäí7$ª˜: ¤9ìôÜÑ—{5Xñ°PÓzšzEÝúvYKGÝúÚ>ƒºí¯î2Þ̆ÙÀ†òøRhå¿\²Ë™cIL{ãÁ˜Æuãν®®Ø_hW·+öÅVÒ¬¤V…~ÆÎŠð<øMÆIƒ?BªÝ§µ±slÑtè—§:%žÜ¯Š¡ÞÚå†`7ŒéÑÜMcj‰qYùU™jæƒ}d»²›ÂÜe·ŽñÉÔºa¦Í ±2 r‡vs’ÔëåÖaY2½»ºa0ÞÎA¤"᨜Ç~ýzóþŸ3H¤ªnd¯ÉîÕ æö`-¾¶Ksñ ´’ú*BD®Š}žûßM%gZÝ#L(jv¦Ë¦å«Ù"#€HWÖjÛmÚ(I©jë¡ê’H©ÈÊÄ|…Žb‡ºã·8,‹–õ‡U/?ÐgèíéF-t )t«²/¦]tÒç:]¦º„©ë áâñ:ølù˜¾™xpz,ÚnŒoFhd m“Ý(›…“ë4 *ï?¼½~‰Ì«~ìúõW°f@Bv$´ÝNw°¶3©‡^6˜‘:Ù³¶6“Á”æ$$õx‹lÈó¢¡P¼}wy3Çêë‹Û0IÆÅm¿¡ý¾!´˜`T/&= LžirBŨu¥y#ç'ªùgSÌ,ÌS4Ê¡¢ýhAG1iȹ«fd²ÑFZÔ–èyÍ ‘‚:_·ùýRw½E^HŸ •çnT00"kaŠ2îÉûº­'¯®þ(š‹ Ý¦›8ÜN©š£WA¤ßø˜¨ò«Ñp®E}[<•L•ÈÔ`l»ƒé(žD“‰?2[æ9¹Ýk$¥ k»ÿSÉ¨èž ³~åª}w$¹yÏAgÔm?˜â­2ÌoùÎöv¶×06ƒ™l‹U<÷rÞ³©…ªx¥] 4÷æ%¢ñG7W JšïõP­^>*OBX>:’ÙŸÓ/U××ÛC3­8 \4Œás½£7{ŸúsöÜ´ää¶ž¹H´Gœ×›Pаç²JÙ$4]ùHA6]Õë7eZ*Ñh  <Ò‰)g|v+ßgub¦~#lIû^¼s©qÃ8Bo*9uc¶ \m¤í:ž~í¢˜¨QÛj„ª6ô²QcnÊ®{¬¥Žàž‘&[<*ëxƒ¹Ü,7z’z0×;Ä'5¦Ú»dûP·Ò«R©'c­~&JQ·¢!Dý´øîŒöeã¶*1‹JÈÙª‰µÒ ÿKø Þê$Áf³mN˜«÷ä)$Ùny¦ d}¬C?Á7Õr'ˆ“(Ý-ô’ÿE˜ âÔ‘ÿUÝë˜L ?@“„©.Ñ£¿©)˜¨¡ Ë5–¡3øS©ÇÞa„膘”ìÛj/Šé»«åÙ?ðïíœÀendstream endobj 230 0 obj 3157 endobj 234 0 obj <> stream xœåWmoÛ6þî_Áo‘„I½qè d­ dK“ÌQ»É0¨“%W’d¿¡?zw¤(Én»õ{aÀNHÞñ^žçîø‰ø”?ýo¶ž/crßÎ|r?û4cf“ô?Ùšü’ÂÒÕÌÊ0sKAIÒõŒqAý¤O³k/Û6å­Víóm«»zÓÝxâfNÊâ7æG<ô©ïÇÞ[UmUI¾zzþWúë .8Ió™OÁQ¹÷ZuŠtªƒ/MÚÕhRß}ÔYGŠ–TuG@ éê~ë©(Kr§I®UÙÁ݃‘Û¶xóÓ<ý8~LýˆƒGp§žÍx]6KhœÈ$°›×Þ¡š !(gÂk û§/¼Ue¬E!†B‚Q)BÙk¬[Ôèãã”sÆìºÄŒKÖP<ÅcE¾“TFòH$°“#ÆÍê¶Õ9µ,F41˯Þ-Ï..ÓÛóÅ·oNÏ·—‹åÛ+s²»¢AÉ¥Œ’4 EA"ŒEmK)ëêž(ük£µÖnŒTâ)Œ)‚¤7ö0›h”\ø¡ Z]uª¨ P†‘œó€JGž*·º•YÝèf]´mQW­M®Ë›‚ÅûJç˜ÑJ›8óHP‰þÞ§ò¹P1ç!úl£›5Zu às©[RWæºF¯ëУ›Gf<¤\ö{ÖÍÐ*Èfà%“Òღc6‡d]{²Õœl OmoÖÙ„KëlÑŽ—Ì漢4–AÏ‚À†82 )Ç}æ»i˜‡Ä1Ó¨tÁ?ÀO@: O"ÀFEÜënWÝæ§ãc{dð‰%œíÉ»¬µ™“ät?xܤÐ)˜B?»½*ß7 5Ù=Ï7µ3ÊÆèÐoPŸ€Ý¾ï ?És@aQ‘˜i(qEKîÈãë"¿>].^¥s#çïb9Bê³ ò>ôüÆüüÔ°h‡àyÑ@¨›âÛ<#¨¯;4¬šÿ¢9xÃ]h. ­Ù”æƒË_ÒÜP%pùqÚ.“°ïà9C€¹4 Û{\Ôph)IÈ¿BvAÃ!‘¾[(MHoá$À›„Ô6ˆêééÀ­‰ïZÙBþï¦>ÃîîÂóuê/%¨Áš —3ÉI?Ogç‹”@%8½8¿Ú ÊÈó±\Øós–xNÄÌ$“ŠÐÔ†冈2H;V=¹ÆBP”$£²ƒY[m?8YP°Â`”væSM¡î°Å‚èH¿HÁN— d@mxóéÝ×]¡:¬M ÖÞg4ñ]:œ¶~Î<‚ÉCk ëšKÛ‡z[æXF KøUݬv/`Œ„ ~î‰Écò—ÔÍ ¤Ýn6uÓµFÈnÉAš~¸\’ƒ?_Ÿ^]ž]¼:ŠåÆ<¼ú¬ú–æÅùûJ®´6*úlµœWMŽv@™€²X¶t~°—kkÇz¿\¤ï–çäýœ °5bÞÉÙ»E_@¾L8Ð!LŒ˜øÅíÅoäÆûG75 Øk­\uݲƒ%ƒ%}ÖQ‡ L˜fZÒB}¶u6„n!Ât˜<âTÓj2™n«#¼½¿Ø®›|¯3s ·3ì„WÐñ`ÞP]¼˜cü¢/wq&Žƒ6ð¹þ\évˆúžæG-9T¹>ÕG`Ð<íPV7f>ê׎όñÂ(¡0ѹj³w6êޠʢk =käC®Û¬),xìDÎ$‡Õ,NEÿf9]‘çzKºæÙ{B*ÇvhùegÜ€2|ÊKó–wÌ„n‹?É:‡¦+„‹(ûu:‰Ñb t +5“P"\[¤³ßáó/"^Kendstream endobj 235 0 obj 1710 endobj 4 0 obj <> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 18 0 obj <> /Contents 19 0 R >> endobj 23 0 obj <> /Contents 24 0 R >> endobj 28 0 obj <> /Contents 29 0 R >> endobj 33 0 obj <> /Contents 34 0 R >> endobj 38 0 obj <> /Contents 39 0 R >> endobj 43 0 obj <> /Contents 44 0 R >> endobj 48 0 obj <> /Contents 49 0 R >> endobj 53 0 obj <> /Contents 54 0 R >> endobj 58 0 obj <> /Contents 59 0 R >> endobj 63 0 obj <> /Contents 64 0 R >> endobj 68 0 obj <> /Contents 69 0 R >> endobj 73 0 obj <> /Contents 74 0 R >> endobj 78 0 obj <> /Contents 79 0 R >> endobj 83 0 obj <> /Contents 84 0 R >> endobj 88 0 obj <> /Contents 89 0 R >> endobj 93 0 obj <> /Contents 94 0 R >> endobj 98 0 obj <> /Contents 99 0 R >> endobj 103 0 obj <> /Contents 104 0 R >> endobj 108 0 obj <> /Contents 109 0 R >> endobj 113 0 obj <> /Contents 114 0 R >> endobj 118 0 obj <> /Contents 119 0 R >> endobj 123 0 obj <> /Contents 124 0 R >> endobj 128 0 obj <> /Contents 129 0 R >> endobj 133 0 obj <> /Contents 134 0 R >> endobj 138 0 obj <> /Contents 139 0 R >> endobj 143 0 obj <> /Contents 144 0 R >> endobj 148 0 obj <> /Contents 149 0 R >> endobj 153 0 obj <> /Contents 154 0 R >> endobj 158 0 obj <> /Contents 159 0 R >> endobj 163 0 obj <> /Contents 164 0 R >> endobj 168 0 obj <> /Contents 169 0 R >> endobj 173 0 obj <> /Contents 174 0 R >> endobj 178 0 obj <> /Contents 179 0 R >> endobj 183 0 obj <> /Contents 184 0 R >> endobj 188 0 obj <> /Contents 189 0 R >> endobj 193 0 obj <> /Contents 194 0 R >> endobj 198 0 obj <> /Contents 199 0 R >> endobj 203 0 obj <> /Contents 204 0 R >> endobj 208 0 obj <> /Contents 209 0 R >> endobj 213 0 obj <> /Contents 214 0 R >> endobj 218 0 obj <> /Contents 219 0 R >> endobj 223 0 obj <> /Contents 224 0 R >> endobj 228 0 obj <> /Contents 229 0 R >> endobj 233 0 obj <> /Contents 234 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R 18 0 R 23 0 R 28 0 R 33 0 R 38 0 R 43 0 R 48 0 R 53 0 R 58 0 R 63 0 R 68 0 R 73 0 R 78 0 R 83 0 R 88 0 R 93 0 R 98 0 R 103 0 R 108 0 R 113 0 R 118 0 R 123 0 R 128 0 R 133 0 R 138 0 R 143 0 R 148 0 R 153 0 R 158 0 R 163 0 R 168 0 R 173 0 R 178 0 R 183 0 R 188 0 R 193 0 R 198 0 R 203 0 R 208 0 R 213 0 R 218 0 R 223 0 R 228 0 R 233 0 R ] /Count 46 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 21 0 obj <> endobj 22 0 obj <> endobj 26 0 obj <> endobj 27 0 obj <> endobj 31 0 obj <> endobj 32 0 obj <> endobj 36 0 obj <> endobj 37 0 obj <> endobj 41 0 obj <> endobj 42 0 obj <> endobj 46 0 obj <> endobj 47 0 obj <> endobj 51 0 obj <> endobj 52 0 obj <> endobj 56 0 obj <> endobj 57 0 obj <> endobj 61 0 obj <> endobj 62 0 obj <> endobj 66 0 obj <> endobj 67 0 obj <> endobj 71 0 obj <> endobj 72 0 obj <> endobj 76 0 obj <> endobj 77 0 obj <> endobj 81 0 obj <> endobj 82 0 obj <> endobj 86 0 obj <> endobj 87 0 obj <> endobj 91 0 obj <> endobj 92 0 obj <> endobj 96 0 obj <> endobj 97 0 obj <> endobj 101 0 obj <> endobj 102 0 obj <> endobj 106 0 obj <> endobj 107 0 obj <> endobj 111 0 obj <> endobj 112 0 obj <> endobj 116 0 obj <> endobj 117 0 obj <> endobj 121 0 obj <> endobj 122 0 obj <> endobj 126 0 obj <> endobj 127 0 obj <> endobj 131 0 obj <> endobj 132 0 obj <> endobj 136 0 obj <> endobj 137 0 obj <> endobj 141 0 obj <> endobj 142 0 obj <> endobj 146 0 obj <> endobj 147 0 obj <> endobj 151 0 obj <> endobj 152 0 obj <> endobj 156 0 obj <> endobj 157 0 obj <> endobj 161 0 obj <> endobj 162 0 obj <> endobj 166 0 obj <> endobj 167 0 obj <> endobj 171 0 obj <> endobj 172 0 obj <> endobj 176 0 obj <> endobj 177 0 obj <> endobj 181 0 obj <> endobj 182 0 obj <> endobj 186 0 obj <> endobj 187 0 obj <> endobj 191 0 obj <> endobj 192 0 obj <> endobj 196 0 obj <> endobj 197 0 obj <> endobj 201 0 obj <> endobj 202 0 obj <> endobj 206 0 obj <> endobj 207 0 obj <> endobj 211 0 obj <> endobj 212 0 obj <> endobj 216 0 obj <> endobj 217 0 obj <> endobj 221 0 obj <> endobj 222 0 obj <> endobj 226 0 obj <> endobj 227 0 obj <> endobj 231 0 obj <> endobj 232 0 obj <> endobj 236 0 obj <> endobj 237 0 obj <> endobj 10 0 obj <> endobj 238 0 obj <> endobj 9 0 obj <> endobj 239 0 obj <> endobj 8 0 obj <> endobj 240 0 obj <> endobj 241 0 obj <>stream 2014-01-29T08:09:44+01:00 2014-01-29T08:09:44+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 242 0000000000 65535 f 0000138056 00000 n 0000143682 00000 n 0000137654 00000 n 0000130094 00000 n 0000000015 00000 n 0000003092 00000 n 0000138122 00000 n 0000142071 00000 n 0000141915 00000 n 0000141760 00000 n 0000138163 00000 n 0000138193 00000 n 0000130254 00000 n 0000003112 00000 n 0000005942 00000 n 0000138243 00000 n 0000138273 00000 n 0000130416 00000 n 0000005963 00000 n 0000009176 00000 n 0000138323 00000 n 0000138353 00000 n 0000130578 00000 n 0000009197 00000 n 0000012212 00000 n 0000138403 00000 n 0000138433 00000 n 0000130740 00000 n 0000012233 00000 n 0000015293 00000 n 0000138483 00000 n 0000138513 00000 n 0000130902 00000 n 0000015314 00000 n 0000017296 00000 n 0000138563 00000 n 0000138593 00000 n 0000131064 00000 n 0000017317 00000 n 0000020584 00000 n 0000138643 00000 n 0000138673 00000 n 0000131226 00000 n 0000020605 00000 n 0000023424 00000 n 0000138723 00000 n 0000138753 00000 n 0000131388 00000 n 0000023445 00000 n 0000026698 00000 n 0000138803 00000 n 0000138833 00000 n 0000131550 00000 n 0000026719 00000 n 0000029738 00000 n 0000138883 00000 n 0000138913 00000 n 0000131712 00000 n 0000029759 00000 n 0000032208 00000 n 0000138963 00000 n 0000138993 00000 n 0000131874 00000 n 0000032229 00000 n 0000034240 00000 n 0000139043 00000 n 0000139073 00000 n 0000132036 00000 n 0000034261 00000 n 0000036623 00000 n 0000139112 00000 n 0000139142 00000 n 0000132198 00000 n 0000036644 00000 n 0000038931 00000 n 0000139181 00000 n 0000139211 00000 n 0000132360 00000 n 0000038952 00000 n 0000042222 00000 n 0000139261 00000 n 0000139291 00000 n 0000132522 00000 n 0000042243 00000 n 0000045664 00000 n 0000139341 00000 n 0000139371 00000 n 0000132684 00000 n 0000045685 00000 n 0000048978 00000 n 0000139421 00000 n 0000139451 00000 n 0000132846 00000 n 0000048999 00000 n 0000051783 00000 n 0000139501 00000 n 0000139531 00000 n 0000133008 00000 n 0000051804 00000 n 0000054152 00000 n 0000139581 00000 n 0000139612 00000 n 0000133172 00000 n 0000054174 00000 n 0000057301 00000 n 0000139663 00000 n 0000139694 00000 n 0000133338 00000 n 0000057323 00000 n 0000060117 00000 n 0000139736 00000 n 0000139767 00000 n 0000133504 00000 n 0000060139 00000 n 0000063186 00000 n 0000139809 00000 n 0000139840 00000 n 0000133670 00000 n 0000063208 00000 n 0000066418 00000 n 0000139891 00000 n 0000139922 00000 n 0000133836 00000 n 0000066440 00000 n 0000069299 00000 n 0000139973 00000 n 0000140004 00000 n 0000134002 00000 n 0000069321 00000 n 0000072261 00000 n 0000140046 00000 n 0000140077 00000 n 0000134168 00000 n 0000072283 00000 n 0000075206 00000 n 0000140128 00000 n 0000140159 00000 n 0000134334 00000 n 0000075228 00000 n 0000077876 00000 n 0000140201 00000 n 0000140232 00000 n 0000134500 00000 n 0000077898 00000 n 0000080952 00000 n 0000140283 00000 n 0000140314 00000 n 0000134666 00000 n 0000080974 00000 n 0000083895 00000 n 0000140365 00000 n 0000140396 00000 n 0000134832 00000 n 0000083917 00000 n 0000087075 00000 n 0000140438 00000 n 0000140469 00000 n 0000134998 00000 n 0000087097 00000 n 0000089959 00000 n 0000140511 00000 n 0000140542 00000 n 0000135164 00000 n 0000089981 00000 n 0000093370 00000 n 0000140593 00000 n 0000140624 00000 n 0000135330 00000 n 0000093392 00000 n 0000096544 00000 n 0000140666 00000 n 0000140697 00000 n 0000135496 00000 n 0000096566 00000 n 0000098555 00000 n 0000140748 00000 n 0000140779 00000 n 0000135662 00000 n 0000098577 00000 n 0000100838 00000 n 0000140830 00000 n 0000140861 00000 n 0000135828 00000 n 0000100860 00000 n 0000103627 00000 n 0000140903 00000 n 0000140934 00000 n 0000135994 00000 n 0000103649 00000 n 0000106300 00000 n 0000140985 00000 n 0000141016 00000 n 0000136160 00000 n 0000106322 00000 n 0000108942 00000 n 0000141058 00000 n 0000141089 00000 n 0000136326 00000 n 0000108964 00000 n 0000111023 00000 n 0000141140 00000 n 0000141171 00000 n 0000136492 00000 n 0000111045 00000 n 0000113678 00000 n 0000141213 00000 n 0000141244 00000 n 0000136658 00000 n 0000113700 00000 n 0000116072 00000 n 0000141295 00000 n 0000141326 00000 n 0000136824 00000 n 0000116094 00000 n 0000118743 00000 n 0000141368 00000 n 0000141399 00000 n 0000136990 00000 n 0000118765 00000 n 0000121594 00000 n 0000141441 00000 n 0000141472 00000 n 0000137156 00000 n 0000121616 00000 n 0000125013 00000 n 0000141514 00000 n 0000141545 00000 n 0000137322 00000 n 0000125035 00000 n 0000128266 00000 n 0000141596 00000 n 0000141627 00000 n 0000137488 00000 n 0000128288 00000 n 0000130072 00000 n 0000141678 00000 n 0000141709 00000 n 0000141845 00000 n 0000141997 00000 n 0000142154 00000 n 0000142258 00000 n trailer << /Size 242 /Root 1 0 R /Info 2 0 R /ID [<0100AB9B3BE4118E409A02C3A5B87024><0100AB9B3BE4118E409A02C3A5B87024>] >> startxref 143836 %%EOF curl-7.35.0/docs/libcurl/curl_formget.html0000644000175000017500000000632512272124467015453 00000000000000 curl_formget man page

NAME

curl_formget - serialize a previously built multipart/formdata HTTP POST chain

SYNOPSIS

#include <curl/curl.h>

void curl_formget(struct curl_httppost * form, void *userp,   curl_formget_callback append );

DESCRIPTION

curl_formget() is used to serialize data previously built/appended with curl_formadd(3). Accepts a void pointer as second argument named userp which will be passed as the first argument to the curl_formget_callback function.

typedef size_t (*curl_formget_callback)(void * userp, const char * buf, size_t len );

The curl_formget_callback will be executed for each part of the HTTP POST chain. The character buffer passed to the callback must not be freed. The callback should return the buffer length passed to it on success.

If the CURLFORM_STREAM option is used in the formpost, it will prevent curl_formget(3) from working until you've performed the actual HTTP request as only then will libcurl get the actual read callback to use!

RETURN VALUE

0 means everything was ok, non-zero means an error occurred

EXAMPLE

 size_t print_httppost_callback(void *arg, const char *buf, size_t len)  {   fwrite(buf, len, 1, stdout);   (*(size_t *) arg) += len;   return len;  }

 size_t print_httppost(struct curl_httppost *post)  {   size_t total_size = 0;   if(curl_formget(post, &total_size, print_httppost_callback)) {   return (size_t) -1;   }   return total_size;  }

AVAILABILITY

This function was added in libcurl 7.15.5

SEE ALSO

curl_formadd (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_global_init.pdf0000644000175000017500000001174512272124472016076 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœXkoÛÈý®_1@?„¬ ‡‘D‹NâMÕ*öÖR,œÂS#™ŠTøˆVûòŸ{î Ÿ²ÝM ‰ÍÇ}œ{î¹wø•Ù\0›~šÿãýäõmÀvåÄf»É׉Ð7Yó_¼goÖx ¤ ëíļ#Xà° ry±õ~"œ9w¶>N.Òû]š?Èô>É’ê³å~ž²4y Ó™ãÛܶëƒÌj™²gŸžþ{ý÷ÉÌæŽ€õÎ#8ç‘OþÝ9[/'ÖõåôâÅ]ás?rÓz3±>\M׿¢ulîÙ› ‡nÛá“ÙŒ½×µA2ºšÈ4)e•ä™±8a†fbÎCírõËõÍϫŪ¬ ³qjý)Éâ´Þ(ö2þšþá¥ÇOçòöãí2ÎñÀS0Ò<Û!Ñ×·Ânñ÷<.<“îõ]N…míJXï]DÜžÛNÊçéŸŸæ ¢ˆ;ƒ4Þ]­ÞÞ.~^/n®Çö™  óÐyý˜”l[g1ÄJU•¬>°êQ±C‘ï ¹g*›z¨´ˆ|ë[RäÙ^eU‡r¦Ô¦äÓ™ò„Â!›Ù–oJ"K&3¦tZ®çð¹I…"Ð4³~«TV’oŽF)9[õ)pÓƒbb¶T¥kJày6}×{-—à7)ÈkR<œØÍm’ítE¿uHÉ´ÖÑî1OÇæ ð<¸ 1…ä ­LB‹l×%EÓUVD8ç¾4Þ¨XÖ¥2c½[$@üÏÃN¹ŸYܰ‰VÀç®ÓXEýÐìSZx[ÆhÖ™0ÍLNH(R¢s™€Ê²€º59ÔQé‚jçuº!>O ¶Äu]‡Æiå¨ÁÆ“áÙ³ŸÔ^<ô,BËžkTÁ(ÀtÛÖJ™Ùl¤·QõÁjHð„!;E°Úw¼†Üí8{g™Ý€ØÛ)9Á` êk Ù¥ßK=57ª’Iª~Ì[JiBa ;­ícM±­¼6û޾ßê_IÉ Úœ?Ý=[p ""ÁŸ–—S*±´Þ¯ÎÅ,\½ð:M2Fo›W:,ºÞ²ÍÂý»:[ °É9}¿´Üa) ÍlÇyY&)zYwÞ^HB¾d9)ì13³k0kcu¨žlÏ(ך>ËÆvt6 2ðö÷W‹ëõíYruóvÒy2ómÆýòýd«ÕAFÏèçþ»ñO‹k×yÑüÝÐ>ñþ“Y=a%°)óøË”.ø®O«Ã {ÎÍ„r}cŽ XÎ×[\¿ÿ¨@`Œ]rÔÒÇq ÃšC*Qèÿ'˜wW?µ •‘ÜêÖådžž‘ÓLš¨§çrmæ“ç;ã‰8#eðIMšâ]–ãÔé¶±Èo† o@d4;­82{‘%±ër¶ qLÍ)•="€Þ >uêAEâì6Ù=Òoˆ8@ÛÚ Ñ1­ãÅp+†æ¶ÇGŠÉœ”]h‘LÍߊÊQšmÿœ‡sŒÏûŸ¥A`2¶ÜÚËòËy ’¥ð‹Ù´)XûB›:ƒùî›ãÁ'Z5´:bƒg†Púhn`—1‰ Y/Béº-Ã'¡»87îÓÞhšm=,ôƒ?3œ$ˆ¶Ðq}é¨ÛÈöK&ú¾Y¬Œý&>-ño#+0ý†fÖmpA‘t.îêÕ†qMÀ%ãX²*IQ7:¦&{•×S©<”ã¶í¾¸´‘1¾½Z¼½fÿš °Î þxu†èàÃÇb;ž2˜d8ËdÔÙìwUät€Û+ÓÆGuG̼¦2í¿±Ìh¬K#AfN뼺eã™Á5þ8suÅ.—«›?Μ/=÷ØåÆ#›>r…]ë‰}16oóþkËÐbœbo«cƒØÍæýšðƒ•,O:À±­¹=4sfÅÃê¬üñ:ÒÛ˜¹¾Ã]}$j†`{H ¸p¦€W8à£%û O g+O³À›·ßᙹZOþ‰Ÿÿ»Jjendstream endobj 6 0 obj 2190 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 13 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 14 0 obj <> endobj 15 0 obj <>stream 2014-01-29T08:09:46+01:00 2014-01-29T08:09:46+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 16 0000000000 65535 f 0000002514 00000 n 0000004466 00000 n 0000002455 00000 n 0000002295 00000 n 0000000015 00000 n 0000002275 00000 n 0000002579 00000 n 0000002905 00000 n 0000002840 00000 n 0000002700 00000 n 0000002620 00000 n 0000002650 00000 n 0000002784 00000 n 0000002987 00000 n 0000003043 00000 n trailer << /Size 16 /Root 1 0 R /Info 2 0 R /ID [<70BE4C84F4A06B6D8EE5DD0246AE9890><70BE4C84F4A06B6D8EE5DD0246AE9890>] >> startxref 4620 %%EOF curl-7.35.0/docs/libcurl/curl_share_cleanup.pdf0000644000175000017500000000705612272124473016425 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ…UÛnÚ@}÷WŒÔ‡ÚU¼Ù]ßÕªM‘š–@ N¥ ªÈ˜›ØF(ý†~tgwͽQeÉ6žÙ3gΜ]žT^í3]×õAaa<L¡}¤+øcB(?ÄsC¯ap"‡„Ä+ƒ1N<ñÖ›é¦ÊëeR‰Ç4I±YOLgbAžMeȲ¹G ¥y‡±$‡Wò­_ñWæ„3¬" È“âžaö;Ö[äŒQæ/rW<3Ì»®?1攸4›q¦’å?H‚ 7ò ð5šA9}i£áŽêÛHÀf> U½ÑÏþà~t;:¤µۊ曬HóÍLÀYöZÞÈò£Lç®l$~76o†½Ñ—´Ä¬=7‹…„2™GÊè> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:47+01:00 2014-01-29T08:09:47+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001143 00000 n 0000003023 00000 n 0000001084 00000 n 0000000924 00000 n 0000000015 00000 n 0000000905 00000 n 0000001208 00000 n 0000001462 00000 n 0000001397 00000 n 0000001329 00000 n 0000001249 00000 n 0000001279 00000 n 0000001544 00000 n 0000001600 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 3177 %%EOF curl-7.35.0/docs/libcurl/curl_free.html0000644000175000017500000000305212272124467014723 00000000000000 curl_free man page

NAME

curl_free - reclaim memory that has been obtained through a libcurl call

SYNOPSIS

#include <curl/curl.h>

void curl_free( char * ptr );

DESCRIPTION

curl_free reclaims memory that has been obtained through a libcurl call. Use curl_free() instead of free() to avoid anomalies that can result from differences in memory management between your application and libcurl.

SEE ALSO

curl_unescape(3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_mprintf.html0000644000175000017500000001171012272124467015461 00000000000000 curl_printf man page

NAME

curl_maprintf, curl_mfprintf, curl_mprintf, curl_msnprintf, curl_msprintf curl_mvaprintf, curl_mvfprintf, curl_mvprintf, curl_mvsnprintf, curl_mvsprintf - formatted output conversion

SYNOPSIS

#include <curl/mprintf.h>

int curl_mprintf(const char * format , ...);
int curl_mfprintf(FILE * fd , const char * format , ...);
int curl_msprintf(char * buffer , const char * format , ...);
int curl_msnprintf(char * buffer , size_t maxlength , const char * format , ...);
int curl_mvprintf(const char * format , va_list args );
int curl_mvfprintf(FILE * fd , const char * format , va_list args );
int curl_mvsprintf(char * buffer , const char * format , va_list args );
int curl_mvsnprintf(char * buffer , size_t maxlength , const char * format , va_list args );
char *curl_maprintf(const char * format , ...);
char *curl_mvaprintf(const char * format , va_list args );

DESCRIPTION

These are all functions that produce output according to a format string and given arguments. These are mostly clones of the well-known C-style functions and there will be no detailed explanation of all available formatting rules and usage here.

See this table for notable exceptions.

curl_mprintf() Normal printf() clone.

curl_mfprintf() Normal fprintf() clone.

curl_msprintf() Normal sprintf() clone.

curl_msnprintf() snprintf() clone. Many systems don't have this. It is just like sprintf but with an extra argument after the buffer that specifies the length of the target buffer.

curl_mvprintf() Normal vprintf() clone.

curl_mvfprintf() Normal vfprintf() clone.

curl_mvsprintf() Normal vsprintf() clone.

curl_mvsnprintf() vsnprintf() clone. Many systems don't have this. It is just like vsprintf but with an extra argument after the buffer that specifies the length of the target buffer.

curl_maprintf() Like printf() but returns the output string as a malloc()ed string. The returned string must be free()ed by the receiver.

curl_mvaprintf() Like curl_maprintf() but takes a va_list pointer argument instead of a variable amount of arguments.

To easily use all these cloned functions instead of the normal ones, #define _MPRINTF_REPLACE before you include the <curl/mprintf.h> file. Then all the normal names like printf, fprintf, sprintf etc will use the curl-functions instead.

AVAILABILITY

These function will be removed from the public libcurl API in a near future. They will instead be made "available" by source code access only, and then as curlx_-prefixed functions. See lib/README.curlx for further details.

RETURN VALUE

The curl_maprintf and curl_mvaprintf functions return a pointer to a newly allocated string, or NULL if it failed.

All other functions return the number of characters they actually outputted.

SEE ALSO

printf (3) sprintf (3) fprintf (3) vprintf (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_easy_setopt.30000644000175000017500000042350112271241025015531 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2014, 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. .\" * .\" ************************************************************************** .\" .TH curl_easy_setopt 3 "1 Jan 2010" "libcurl 7.20.0" "libcurl Manual" .SH NAME curl_easy_setopt \- set options for a curl easy handle .SH SYNOPSIS #include CURLcode curl_easy_setopt(CURL *handle, CURLoption option, parameter); .SH DESCRIPTION curl_easy_setopt() is used to tell libcurl how to behave. By using the appropriate options to \fIcurl_easy_setopt\fP, you can change libcurl's behavior. All options are set with the \fIoption\fP followed by a \fIparameter\fP. That parameter can be a \fBlong\fP, a \fBfunction pointer\fP, an \fBobject pointer\fP or a \fBcurl_off_t\fP, depending on what the specific option expects. Read this manual carefully as bad input values may cause libcurl to behave badly! You can only set one option in each function call. A typical application uses many curl_easy_setopt() calls in the setup phase. Options set with this function call are valid for all forthcoming transfers performed using this \fIhandle\fP. The options are not in any way reset between transfers, so if you want subsequent transfers with different options, you must change them between the transfers. You can optionally reset all options back to internal default with \fIcurl_easy_reset(3)\fP. Strings passed to libcurl as 'char *' arguments, are copied by the library; thus the string storage associated to the pointer argument may be overwritten after curl_easy_setopt() returns. Exceptions to this rule are described in the option details below. Before version 7.17.0, strings were not copied. Instead the user was forced keep them available until libcurl no longer needed them. The \fIhandle\fP is the return code from a \fIcurl_easy_init(3)\fP or \fIcurl_easy_duphandle(3)\fP call. .SH BEHAVIOR OPTIONS .IP CURLOPT_VERBOSE Set the parameter to 1 to get the library to display a lot of verbose information about its operations. Very useful for libcurl and/or protocol debugging and understanding. The verbose information will be sent to stderr, or the stream set with \fICURLOPT_STDERR\fP. The default value for this parameter is 0. You hardly ever want this set in production use, you will almost always want this when you debug/report problems. Another neat option for debugging is the \fICURLOPT_DEBUGFUNCTION\fP. .IP CURLOPT_HEADER A parameter set to 1 tells the library to include the header in the body output. This is only relevant for protocols that actually have headers preceding the data (like HTTP). The default value for this parameter is 0. .IP CURLOPT_NOPROGRESS Pass a long. If set to 1, it tells the library to shut off the progress meter completely. It will also prevent the \fICURLOPT_PROGRESSFUNCTION\fP from getting called. The default value for this parameter is 1. Future versions of libcurl are likely to not have any built-in progress meter at all. .IP CURLOPT_NOSIGNAL Pass a long. If it is 1, libcurl will not use any functions that install signal handlers or any functions that cause signals to be sent to the process. This option is mainly here to allow multi-threaded unix applications to still set/use all timeout options etc, without risking getting signals. The default value for this parameter is 0. (Added in 7.10) If this option is set and libcurl has been built with the standard name resolver, timeouts will not occur while the name resolve takes place. Consider building libcurl with c-ares support to enable asynchronous DNS lookups, which enables nice timeouts for name resolves without signals. Setting \fICURLOPT_NOSIGNAL\fP to 1 makes libcurl NOT ask the system to ignore SIGPIPE signals, which otherwise are sent by the system when trying to send data to a socket which is closed in the other end. libcurl makes an effort to never cause such SIGPIPEs to trigger, but some operating systems have no way to avoid them and even on those that have there are some corner cases when they may still happen, contrary to our desire. In addition, using \fICURLAUTH_NTLM_WB\fP authentication could cause a SIGCHLD signal to be raised. .IP CURLOPT_WILDCARDMATCH Set this option to 1 if you want to transfer multiple files according to a file name pattern. The pattern can be specified as part of the \fICURLOPT_URL\fP option, using an fnmatch-like pattern (Shell Pattern Matching) in the last part of URL (file name). By default, libcurl uses its internal wildcard matching implementation. You can provide your own matching function by the \fICURLOPT_FNMATCH_FUNCTION\fP option. This feature is only supported by the FTP download for now. A brief introduction of its syntax follows: .RS .IP "* - ASTERISK" \&ftp://example.com/some/path/\fB*.txt\fP (for all txt's from the root directory) .RE .RS .IP "? - QUESTION MARK" Question mark matches any (exactly one) character. \&ftp://example.com/some/path/\fBphoto?.jpeg\fP .RE .RS .IP "[ - BRACKET EXPRESSION" The left bracket opens a bracket expression. The question mark and asterisk have no special meaning in a bracket expression. Each bracket expression ends by the right bracket and matches exactly one character. Some examples follow: \fB[a-zA-Z0\-9]\fP or \fB[f\-gF\-G]\fP \- character interval \fB[abc]\fP - character enumeration \fB[^abc]\fP or \fB[!abc]\fP - negation \fB[[:\fP\fIname\fP\fB:]]\fP class expression. Supported classes are \fBalnum\fP,\fBlower\fP, \fBspace\fP, \fBalpha\fP, \fBdigit\fP, \fBprint\fP, \fBupper\fP, \fBblank\fP, \fBgraph\fP, \fBxdigit\fP. \fB[][-!^]\fP - special case \- matches only '\-', ']', '[', '!' or '^'. These characters have no special purpose. \fB[\\[\\]\\\\]\fP - escape syntax. Matches '[', ']' or '\\'. Using the rules above, a file name pattern can be constructed: \&ftp://example.com/some/path/\fB[a-z[:upper:]\\\\].jpeg\fP .RE .PP (This was added in 7.21.0) .SH CALLBACK OPTIONS .IP CURLOPT_WRITEFUNCTION Pass a pointer to a function that matches the following prototype: \fBsize_t function( char *ptr, size_t size, size_t nmemb, void *userdata);\fP This function gets called by libcurl as soon as there is data received that needs to be saved. The size of the data pointed to by \fIptr\fP is \fIsize\fP multiplied with \fInmemb\fP, it will not be zero terminated. Return the number of bytes actually taken care of. If that amount differs from the amount passed to your function, it'll signal an error to the library. This will abort the transfer and return \fICURLE_WRITE_ERROR\fP. From 7.18.0, the function can return CURL_WRITEFUNC_PAUSE which then will cause writing to this connection to become paused. See \fIcurl_easy_pause(3)\fP for further details. This function may be called with zero bytes data if the transferred file is empty. Set this option to NULL to get the internal default function. The internal default function will write the data to the FILE * given with \fICURLOPT_WRITEDATA\fP. Set the \fIuserdata\fP argument with the \fICURLOPT_WRITEDATA\fP option. The callback function will be passed as much data as possible in all invokes, but you cannot possibly make any assumptions. It may be one byte, it may be thousands. The maximum amount of body data that can be passed to the write callback is defined in the curl.h header file: CURL_MAX_WRITE_SIZE (the usual default is 16K). If you however have \fICURLOPT_HEADER\fP set, which sends header data to the write callback, you can get up to \fICURL_MAX_HTTP_HEADER\fP bytes of header data passed into it. This usually means 100K. .IP CURLOPT_WRITEDATA Data pointer to pass to the file write function. If you use the \fICURLOPT_WRITEFUNCTION\fP option, this is the pointer you'll get as input. If you don't use a callback, you must pass a 'FILE *' (cast to 'void *') as libcurl will pass this to fwrite() when writing data. By default, the value of this parameter is unspecified. The internal \fICURLOPT_WRITEFUNCTION\fP will write the data to the FILE * given with this option, or to stdout if this option hasn't been set. If you're using libcurl as a win32 DLL, you \fBMUST\fP use the \fICURLOPT_WRITEFUNCTION\fP if you set this option or you will experience crashes. This option is also known with the older name \fICURLOPT_FILE\fP, the name \fICURLOPT_WRITEDATA\fP was introduced in 7.9.7. .IP CURLOPT_READFUNCTION Pass a pointer to a function that matches the following prototype: \fBsize_t function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP This function gets called by libcurl as soon as it needs to read data in order to send it to the peer. The data area pointed at by the pointer \fIptr\fP may be filled with at most \fIsize\fP multiplied with \fInmemb\fP number of bytes. Your function must return the actual number of bytes that you stored in that memory area. Returning 0 will signal end-of-file to the library and cause it to stop the current transfer. If you stop the current transfer by returning 0 "pre-maturely" (i.e before the server expected it, like when you've said you will upload N bytes and you upload less than N bytes), you may experience that the server "hangs" waiting for the rest of the data that won't come. The read callback may return \fICURL_READFUNC_ABORT\fP to stop the current operation immediately, resulting in a \fICURLE_ABORTED_BY_CALLBACK\fP error code from the transfer (Added in 7.12.1) From 7.18.0, the function can return CURL_READFUNC_PAUSE which then will cause reading from this connection to become paused. See \fIcurl_easy_pause(3)\fP for further details. \fBBugs\fP: when doing TFTP uploads, you must return the exact amount of data that the callback wants, or it will be considered the final packet by the server end and the transfer will end there. If you set this callback pointer to NULL, or don't set it at all, the default internal read function will be used. It is doing an fread() on the FILE * userdata set with \fICURLOPT_READDATA\fP. .IP CURLOPT_READDATA Data pointer to pass to the file read function. If you use the \fICURLOPT_READFUNCTION\fP option, this is the pointer you'll get as input. If you don't specify a read callback but instead rely on the default internal read function, this data must be a valid readable FILE * (cast to 'void *'). If you're using libcurl as a win32 DLL, you MUST use a \fICURLOPT_READFUNCTION\fP if you set this option. This option was also known by the older name \fICURLOPT_INFILE\fP, the name \fICURLOPT_READDATA\fP was introduced in 7.9.7. .IP CURLOPT_IOCTLFUNCTION Pass a pointer to a function that matches the following prototype: \fBcurlioerr function(CURL *handle, int cmd, void *clientp);\fP. This function gets called by libcurl when something special I/O-related needs to be done that the library can't do by itself. For now, rewinding the read data stream is the only action it can request. The rewinding of the read data stream may be necessary when doing a HTTP PUT or POST with a multi-pass authentication method. By default, this parameter is set to NULL. (Option added in 7.12.3). Use \fICURLOPT_SEEKFUNCTION\fP instead to provide seeking! If \fICURLOPT_SEEKFUNCTION\fP is set, this parameter will be ignored when seeking. .IP CURLOPT_IOCTLDATA Pass a pointer that will be untouched by libcurl and passed as the 3rd argument in the ioctl callback set with \fICURLOPT_IOCTLFUNCTION\fP. By default, the value of this parameter is unspecified. (Option added in 7.12.3) .IP CURLOPT_SEEKFUNCTION Pass a pointer to a function that matches the following prototype: \fBint function(void *instream, curl_off_t offset, int origin);\fP This function gets called by libcurl to seek to a certain position in the input stream and can be used to fast forward a file in a resumed upload (instead of reading all uploaded bytes with the normal read function/callback). It is also called to rewind a stream when doing a HTTP PUT or POST with a multi-pass authentication method. The function shall work like "fseek" or "lseek" and accepted SEEK_SET, SEEK_CUR and SEEK_END as argument for origin, although libcurl currently only passes SEEK_SET. The callback must return 0 (CURL_SEEKFUNC_OK) on success, 1 (CURL_SEEKFUNC_FAIL) to cause the upload operation to fail or 2 (CURL_SEEKFUNC_CANTSEEK) to indicate that while the seek failed, libcurl is free to work around the problem if possible. The latter can sometimes be done by instead reading from the input or similar. By default, this parameter is unset. If you forward the input arguments directly to "fseek" or "lseek", note that the data type for \fIoffset\fP is not the same as defined for curl_off_t on many systems! (Option added in 7.18.0) .IP CURLOPT_SEEKDATA Data pointer to pass to the file seek function. If you use the \fICURLOPT_SEEKFUNCTION\fP option, this is the pointer you'll get as input. If you don't specify a seek callback, NULL is passed. (Option added in 7.18.0) .IP CURLOPT_SOCKOPTFUNCTION Pass a pointer to a function that matches the following prototype: \fBint function(void *clientp, curl_socket_t curlfd, curlsocktype purpose);\fP. By default, this parameter is unset. If set, this function gets called by libcurl after the socket() call but before the connect() call. The callback's \fIpurpose\fP argument identifies the exact purpose for this particular socket: \fICURLSOCKTYPE_IPCXN\fP for actively created connections or since 7.28.0 \fICURLSOCKTYPE_ACCEPT\fP for FTP when the connection was setup with PORT/EPSV (in earlier versions these sockets weren't passed to this callback). Future versions of libcurl may support more purposes. It passes the newly created socket descriptor so additional setsockopt() calls can be done at the user's discretion. Return 0 (zero) from the callback on success. Return 1 from the callback function to signal an unrecoverable error to the library and it will close the socket and return \fICURLE_COULDNT_CONNECT\fP. (Option added in 7.16.0) Added in 7.21.5, the callback function may return \fICURL_SOCKOPT_ALREADY_CONNECTED\fP, which tells libcurl that the socket is in fact already connected and then libcurl will not attempt to connect it. .IP CURLOPT_SOCKOPTDATA Pass a pointer that will be untouched by libcurl and passed as the first argument in the sockopt callback set with \fICURLOPT_SOCKOPTFUNCTION\fP. The default value of this parameter is unspecified. (Option added in 7.16.0) .IP CURLOPT_OPENSOCKETFUNCTION Pass a pointer to a function that matches the following prototype: \fBcurl_socket_t function(void *clientp, curlsocktype purpose, struct curl_sockaddr *address);\fP. This function gets called by libcurl instead of the \fIsocket(2)\fP call. The callback's \fIpurpose\fP argument identifies the exact purpose for this particular socket: \fICURLSOCKTYPE_IPCXN\fP is for IP based connections. Future versions of libcurl may support more purposes. It passes the resolved peer address as a \fIaddress\fP argument so the callback can modify the address or refuse to connect at all. The callback function should return the socket or \fICURL_SOCKET_BAD\fP in case no connection could be established or another error was detected. Any additional \fIsetsockopt(2)\fP calls can be done on the socket at the user's discretion. \fICURL_SOCKET_BAD\fP return value from the callback function will signal an unrecoverable error to the library and it will return \fICURLE_COULDNT_CONNECT\fP. This return code can be used for IP address blacklisting. The default behavior is: .nf return socket(addr->family, addr->socktype, addr->protocol); .fi (Option added in 7.17.1.) .IP CURLOPT_OPENSOCKETDATA Pass a pointer that will be untouched by libcurl and passed as the first argument in the opensocket callback set with \fICURLOPT_OPENSOCKETFUNCTION\fP. The default value of this parameter is unspecified. (Option added in 7.17.1.) .IP CURLOPT_CLOSESOCKETFUNCTION Pass a pointer to a function that matches the following prototype: \fBint function(void *clientp, curl_socket_t item);\fP. This function gets called by libcurl instead of the \fIclose(3)\fP or \fIclosesocket(3)\fP call when sockets are closed (not for any other file descriptors). This is pretty much the reverse to the \fICURLOPT_OPENSOCKETFUNCTION\fP option. Return 0 to signal success and 1 if there was an error. (Option added in 7.21.7) .IP CURLOPT_CLOSESOCKETDATA Pass a pointer that will be untouched by libcurl and passed as the first argument in the closesocket callback set with \fICURLOPT_CLOSESOCKETFUNCTION\fP. The default value of this parameter is unspecified. (Option added in 7.21.7) .IP CURLOPT_PROGRESSFUNCTION Pass a pointer to a function that matches the following prototype: \fBint function(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);\fP This function gets called by libcurl instead of its internal equivalent with a frequent interval. While data is being transferred it will be called very frequently, and during slow periods like when nothing is being transferred it can slow down to about one call per second. \fIclientp\fP is the pointer set with \fICURLOPT_PROGRESSDATA\fP, it is not actually used by libcurl but is only passed along from the application to the callback. The callback gets told how much data libcurl will transfer and has transferred, in number of bytes. \fIdltotal\fP is the total number of bytes libcurl expects to download in this transfer. \fIdlnow\fP is the number of bytes downloaded so far. \fIultotal\fP is the total number of bytes libcurl expects to upload in this transfer. \fIulnow\fP is the number of bytes uploaded so far. Unknown/unused argument values passed to the callback will be set to zero (like if you only download data, the upload size will remain 0). Many times the callback will be called one or more times first, before it knows the data sizes so a program must be made to handle that. Returning a non-zero value from this callback will cause libcurl to abort the transfer and return \fICURLE_ABORTED_BY_CALLBACK\fP. If you transfer data with the multi interface, this function will not be called during periods of idleness unless you call the appropriate libcurl function that performs transfers. \fICURLOPT_NOPROGRESS\fP must be set to 0 to make this function actually get called. .IP CURLOPT_XFERINFOFUNCTION Pass a pointer to a function that matches the following prototype: .nf \fBint function(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow);\fP .fi This function gets called by libcurl instead of its internal equivalent with a frequent interval. While data is being transferred it will be called very frequently, and during slow periods like when nothing is being transferred it can slow down to about one call per second. \fIclientp\fP is the pointer set with \fICURLOPT_XFERINFODATA\fP, it is only passed along from the application to the callback. The callback gets told how much data libcurl will transfer and has transferred, in number of bytes. \fIdltotal\fP is the total number of bytes libcurl expects to download in this transfer. \fIdlnow\fP is the number of bytes downloaded so far. \fIultotal\fP is the total number of bytes libcurl expects to upload in this transfer. \fIulnow\fP is the number of bytes uploaded so far. Unknown/unused argument values passed to the callback will be set to zero (like if you only download data, the upload size will remain 0). Many times the callback will be called one or more times first, before it knows the data sizes so a program must be made to handle that. Returning a non-zero value from this callback will cause libcurl to abort the transfer and return \fICURLE_ABORTED_BY_CALLBACK\fP. If you transfer data with the multi interface, this function will not be called during periods of idleness unless you call the appropriate libcurl function that performs transfers. \fICURLOPT_NOPROGRESS\fP must be set to 0 to make this function actually get called. (Added in 7.32.0) .IP CURLOPT_PROGRESSDATA Pass a pointer that will be untouched by libcurl and passed as the first argument in the progress callback set with \fICURLOPT_PROGRESSFUNCTION\fP. The default value of this parameter is unspecified. .IP CURLOPT_XFERINFODATA Pass a pointer that will be untouched by libcurl and passed as the first argument in the progress callback set with \fICURLOPT_XFERINFOFUNCTION\fP. The default value of this parameter is unspecified. This option is an alias for CURLOPT_PROGRESSDATA. (Added in 7.32.0) .IP CURLOPT_HEADERFUNCTION Pass a pointer to a function that matches the following prototype: \fBsize_t function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP. This function gets called by libcurl as soon as it has received header data. The header callback will be called once for each header and only complete header lines are passed on to the callback. Parsing headers is very easy using this. The size of the data pointed to by \fIptr\fP is \fIsize\fP multiplied with \fInmemb\fP. Do not assume that the header line is zero terminated! The pointer named \fIuserdata\fP is the one you set with the \fICURLOPT_WRITEHEADER\fP option. The callback function must return the number of bytes actually taken care of. If that amount differs from the amount passed to your function, it'll signal an error to the library. This will abort the transfer and return \fICURL_WRITE_ERROR\fP. A complete HTTP header that is passed to this function can be up to \fICURL_MAX_HTTP_HEADER\fP (100K) bytes. If this option is not set, or if it is set to NULL, but \fICURLOPT_HEADERDATA\fP (\fICURLOPT_WRITEHEADER\fP) is set to anything but NULL, the function used to accept response data will be used instead. That is, it will be the function specified with \fICURLOPT_WRITEFUNCTION\fP, or if it is not specified or NULL - the default, stream-writing function. It's important to note that the callback will be invoked for the headers of all responses received after initiating a request and not just the final response. This includes all responses which occur during authentication negotiation. If you need to operate on only the headers from the final response, you will need to collect headers in the callback yourself and use HTTP status lines, for example, to delimit response boundaries. When a server sends a chunked encoded transfer, it may contain a trailer. That trailer is identical to a HTTP header and if such a trailer is received it is passed to the application using this callback as well. There are several ways to detect it being a trailer and not an ordinary header: 1) it comes after the response-body. 2) it comes after the final header line (CR LF) 3) a Trailer: header among the regular response-headers mention what header(s) to expect in the trailer. For non-HTTP protocols like FTP, POP3, IMAP and SMTP this function will get called with the server responses to the commands that libcurl sends. .IP CURLOPT_WRITEHEADER (This option is also known as \fBCURLOPT_HEADERDATA\fP) Pass a pointer to be used to write the header part of the received data to. If you don't use \fICURLOPT_WRITEFUNCTION\fP or \fICURLOPT_HEADERFUNCTION\fP to take care of the writing, this must be a valid FILE * as the internal default will then be a plain fwrite(). See also the \fICURLOPT_HEADERFUNCTION\fP option above on how to set a custom get-all-headers callback. .IP CURLOPT_DEBUGFUNCTION Pass a pointer to a function that matches the following prototype: \fBint curl_debug_callback (CURL *, curl_infotype, char *, size_t, void *);\fP \fICURLOPT_DEBUGFUNCTION\fP replaces the standard debug function used when \fICURLOPT_VERBOSE \fP is in effect. This callback receives debug information, as specified with the \fBcurl_infotype\fP argument. This function must return 0. The data pointed to by the char * passed to this function WILL NOT be zero terminated, but will be exactly of the size as told by the size_t argument. Available curl_infotype values: .RS .IP CURLINFO_TEXT The data is informational text. .IP CURLINFO_HEADER_IN The data is header (or header-like) data received from the peer. .IP CURLINFO_HEADER_OUT The data is header (or header-like) data sent to the peer. .IP CURLINFO_DATA_IN The data is protocol data received from the peer. .IP CURLINFO_DATA_OUT The data is protocol data sent to the peer. .RE .IP CURLOPT_DEBUGDATA Pass a pointer to whatever you want passed in to your \fICURLOPT_DEBUGFUNCTION\fP in the last void * argument. This pointer is not used by libcurl, it is only passed to the callback. .IP CURLOPT_SSL_CTX_FUNCTION This option does only function for libcurl powered by OpenSSL. If libcurl was built against another SSL library, this functionality is absent. Pass a pointer to a function that matches the following prototype: \fBCURLcode sslctxfun(CURL *curl, void *sslctx, void *parm);\fP This function gets called by libcurl just before the initialization of a SSL connection after having processed all other SSL related options to give a last chance to an application to modify the behaviour of openssl's ssl initialization. The \fIsslctx\fP parameter is actually a pointer to an openssl \fISSL_CTX\fP. If an error is returned no attempt to establish a connection is made and the perform operation will return the error code from this callback function. Set the \fIparm\fP argument with the \fICURLOPT_SSL_CTX_DATA\fP option. This option was introduced in 7.11.0. This function will get called on all new connections made to a server, during the SSL negotiation. The SSL_CTX pointer will be a new one every time. To use this properly, a non-trivial amount of knowledge of the openssl libraries is necessary. For example, using this function allows you to use openssl callbacks to add additional validation code for certificates, and even to change the actual URI of a HTTPS request (example used in the lib509 test case). See also the example section for a replacement of the key, certificate and trust file settings. .IP CURLOPT_SSL_CTX_DATA Data pointer to pass to the ssl context callback set by the option \fICURLOPT_SSL_CTX_FUNCTION\fP, this is the pointer you'll get as third parameter, otherwise \fBNULL\fP. (Added in 7.11.0) .IP CURLOPT_CONV_TO_NETWORK_FUNCTION .IP CURLOPT_CONV_FROM_NETWORK_FUNCTION .IP CURLOPT_CONV_FROM_UTF8_FUNCTION Pass a pointer to a function that matches the following prototype: \fBCURLcode function(char *ptr, size_t length);\fP These three options apply to non-ASCII platforms only. They are available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built. When this is the case, \fIcurl_version_info(3)\fP will return the CURL_VERSION_CONV feature bit set. The data to be converted is in a buffer pointed to by the ptr parameter. The amount of data to convert is indicated by the length parameter. The converted data overlays the input data in the buffer pointed to by the ptr parameter. CURLE_OK should be returned upon successful conversion. A CURLcode return value defined by curl.h, such as CURLE_CONV_FAILED, should be returned if an error was encountered. \fBCURLOPT_CONV_TO_NETWORK_FUNCTION\fP and \fBCURLOPT_CONV_FROM_NETWORK_FUNCTION\fP convert between the host encoding and the network encoding. They are used when commands or ASCII data are sent/received over the network. \fBCURLOPT_CONV_FROM_UTF8_FUNCTION\fP is called to convert from UTF8 into the host encoding. It is required only for SSL processing. If you set a callback pointer to NULL, or don't set it at all, the built-in libcurl iconv functions will be used. If HAVE_ICONV was not defined when libcurl was built, and no callback has been established, conversion will return the CURLE_CONV_REQD error code. If HAVE_ICONV is defined, CURL_ICONV_CODESET_OF_HOST must also be defined. For example: \&#define CURL_ICONV_CODESET_OF_HOST "IBM-1047" The iconv code in libcurl will default the network and UTF8 codeset names as follows: \&#define CURL_ICONV_CODESET_OF_NETWORK "ISO8859-1" \&#define CURL_ICONV_CODESET_FOR_UTF8 "UTF-8" You will need to override these definitions if they are different on your system. .IP CURLOPT_INTERLEAVEFUNCTION Pass a pointer to a function that matches the following prototype: \fBsize_t function( void *ptr, size_t size, size_t nmemb, void *userdata)\fP. This function gets called by libcurl as soon as it has received interleaved RTP data. This function gets called for each $ block and therefore contains exactly one upper-layer protocol unit (e.g. one RTP packet). Curl writes the interleaved header as well as the included data for each call. The first byte is always an ASCII dollar sign. The dollar sign is followed by a one byte channel identifier and then a 2 byte integer length in network byte order. See \fIRFC2326 Section 10.12\fP for more information on how RTP interleaving behaves. If unset or set to NULL, curl will use the default write function. Interleaved RTP poses some challenges for the client application. Since the stream data is sharing the RTSP control connection, it is critical to service the RTP in a timely fashion. If the RTP data is not handled quickly, subsequent response processing may become unreasonably delayed and the connection may close. The application may use \fICURL_RTSPREQ_RECEIVE\fP to service RTP data when no requests are desired. If the application makes a request, (e.g. \fICURL_RTSPREQ_PAUSE\fP) then the response handler will process any pending RTP data before marking the request as finished. (Added in 7.20.0) .IP CURLOPT_INTERLEAVEDATA This is the userdata pointer that will be passed to \fICURLOPT_INTERLEAVEFUNCTION\fP when interleaved RTP data is received. (Added in 7.20.0) .IP CURLOPT_CHUNK_BGN_FUNCTION Pass a pointer to a function that matches the following prototype: \fBlong function (const void *transfer_info, void *ptr, int remains)\fP. This function gets called by libcurl before a part of the stream is going to be transferred (if the transfer supports chunks). This callback makes sense only when using the \fICURLOPT_WILDCARDMATCH\fP option for now. The target of transfer_info parameter is a "feature depended" structure. For the FTP wildcard download, the target is curl_fileinfo structure (see \fIcurl/curl.h\fP). The parameter ptr is a pointer given by \fICURLOPT_CHUNK_DATA\fP. The parameter remains contains number of chunks remaining per the transfer. If the feature is not available, the parameter has zero value. Return \fICURL_CHUNK_BGN_FUNC_OK\fP if everything is fine, \fICURL_CHUNK_BGN_FUNC_SKIP\fP if you want to skip the concrete chunk or \fICURL_CHUNK_BGN_FUNC_FAIL\fP to tell libcurl to stop if some error occurred. (This was added in 7.21.0) .IP CURLOPT_CHUNK_END_FUNCTION Pass a pointer to a function that matches the following prototype: \fBlong function(void *ptr)\fP. This function gets called by libcurl as soon as a part of the stream has been transferred (or skipped). Return \fICURL_CHUNK_END_FUNC_OK\fP if everything is fine or \fBCURL_CHUNK_END_FUNC_FAIL\fP to tell the lib to stop if some error occurred. (This was added in 7.21.0) .IP CURLOPT_CHUNK_DATA Pass a pointer that will be untouched by libcurl and passed as the ptr argument to the \fICURL_CHUNK_BGN_FUNTION\fP and \fICURL_CHUNK_END_FUNTION\fP. (This was added in 7.21.0) .IP CURLOPT_FNMATCH_FUNCTION Pass a pointer to a function that matches the following prototype: \fBint function(void *ptr, const char *pattern, const char *string)\fP prototype (see \fIcurl/curl.h\fP). It is used internally for the wildcard matching feature. Return \fICURL_FNMATCHFUNC_MATCH\fP if pattern matches the string, \fICURL_FNMATCHFUNC_NOMATCH\fP if not or \fICURL_FNMATCHFUNC_FAIL\fP if an error occurred. (This was added in 7.21.0) .IP CURLOPT_FNMATCH_DATA Pass a pointer that will be untouched by libcurl and passed as the ptr argument to the \fICURL_FNMATCH_FUNCTION\fP. (This was added in 7.21.0) .SH ERROR OPTIONS .IP CURLOPT_ERRORBUFFER Pass a char * to a buffer that the libcurl may store human readable error messages in. This may be more helpful than just the return code from \fIcurl_easy_perform\fP. The buffer must be at least CURL_ERROR_SIZE big. Although this argument is a 'char *', it does not describe an input string. Therefore the (probably undefined) contents of the buffer is NOT copied by the library. You must keep the associated storage available until libcurl no longer needs it. Failing to do so will cause very odd behavior or even crashes. libcurl will need it until you call \fIcurl_easy_cleanup(3)\fP or you set the same option again to use a different pointer. Use \fICURLOPT_VERBOSE\fP and \fICURLOPT_DEBUGFUNCTION\fP to better debug/trace why errors happen. If the library does not return an error, the buffer may not have been touched. Do not rely on the contents in those cases. .IP CURLOPT_STDERR Pass a FILE * as parameter. Tell libcurl to use this stream instead of stderr when showing the progress meter and displaying \fICURLOPT_VERBOSE\fP data. .IP CURLOPT_FAILONERROR A parameter set to 1 tells the library to fail silently if the HTTP code returned is equal to or larger than 400. The default action would be to return the page normally, ignoring that code. This method is not fail-safe and there are occasions where non-successful response codes will slip through, especially when authentication is involved (response codes 401 and 407). You might get some amounts of headers transferred before this situation is detected, like when a "100-continue" is received as a response to a POST/PUT and a 401 or 407 is received immediately afterwards. .SH NETWORK OPTIONS .IP CURLOPT_URL Pass in a pointer to the actual URL to deal with. The parameter should be a char * to a zero terminated string which must be URL-encoded in the following format: scheme://host:port/path For a greater explanation of the format please see RFC3986. If the given URL lacks the scheme (such as "http://" or "ftp://" etc) then libcurl will attempt to resolve the protocol based on one of the following given host names: HTTP, FTP, DICT, LDAP, IMAP, POP3 or SMTP (POP3 and SMTP added in 7.31.0) Should the protocol, either that specified by the scheme or deduced by libcurl from the host name, not be supported by libcurl then (\fICURLE_UNSUPPORTED_PROTOCOL\fP) will be returned from either the \fIcurl_easy_perform(3)\fP or \fIcurl_multi_perform(3)\fP functions when you call them. Use \fIcurl_version_info(3)\fP for detailed information of which protocols are supported by the build of libcurl you are using. The host part of the URL contains the address of the server that you want to connect to. This can be the fully qualified domain name of the server, the local network name of the machine on your network or the IP address of the server or machine represented by either an IPv4 or IPv6 address. For example: http://www.example.com/ http://hostname/ http://192.168.0.1/ http://[2001:1890:1112:1::20]/ It is also possible to specify the user name, password and any supported login options as part of the host, for the following protocols, when connecting to servers that require authentication: http://user:password@www.example.com ftp://user:password@ftp.example.com imap://user:password;options@mail.example.com pop3://user:password;options@mail.example.com smtp://user:password;options@mail.example.com At present only IMAP, POP3 and SMTP support login options as part of the host. For more information about the login options in URL syntax please see RFC2384, RFC5092 and IETF draft draft-earhart-url-smtp-00.txt (Added in 7.31.0). The port is optional and when not specified libcurl will use the default port based on the determined or specified protocol: 80 for HTTP, 21 for FTP and 25 for SMTP, etc. The following examples show how to specify the port: http://www.example.com:8080/ - This will connect to a web server using port 8080 rather than 80. smtp://mail.example.com:587/ - This will connect to a SMTP server on the alternative mail port. The path part of the URL is protocol specific and whilst some examples are given below this list is not conclusive: .B HTTP The path part of a HTTP request specifies the file to retrieve and from what directory. If the directory is not specified then the web server's root directory is used. If the file is omitted then the default document will be retrieved for either the directory specified or the root directory. The exact resource returned for each URL is entirely dependent on the server's configuration. http://www.example.com - This gets the main page from the web server. http://www.example.com/index.html - This returns the main page by explicitly requesting it. http://www.example.com/contactus/ - This returns the default document from the contactus directory. .B FTP The path part of an FTP request specifies the file to retrieve and from what directory. If the file part is omitted then libcurl downloads the directory listing for the directory specified. If the directory is omitted then the directory listing for the root / home directory will be returned. ftp://ftp.example.com - This retrieves the directory listing for the root directory. ftp://ftp.example.com/readme.txt - This downloads the file readme.txt from the root directory. ftp://ftp.example.com/libcurl/readme.txt - This downloads readme.txt from the libcurl directory. ftp://user:password@ftp.example.com/readme.txt - This retrieves the readme.txt file from the user's home directory. When a username and password is specified, everything that is specified in the path part is relative to the user's home directory. To retrieve files from the root directory or a directory underneath the root directory then the absolute path must be specified by prepending an additional forward slash to the beginning of the path. ftp://user:password@ftp.example.com//readme.txt - This retrieves the readme.txt from the root directory when logging in as a specified user. .B SMTP The path part of a SMTP request specifies the host name to present during communication with the mail server. If the path is omitted then libcurl will attempt to resolve the local computer's host name. However, this may not return the fully qualified domain name that is required by some mail servers and specifying this path allows you to set an alternative name, such as your machine's fully qualified domain name, which you might have obtained from an external function such as gethostname or getaddrinfo. smtp://mail.example.com - This connects to the mail server at example.com and sends your local computer's host name in the HELO / EHLO command. smtp://mail.example.com/client.example.com - This will send client.example.com in the HELO / EHLO command to the mail server at example.com. .B POP3 The path part of a POP3 request specifies the message ID to retrieve. If the ID is not specified then a list of waiting messages is returned instead. pop3://user:password@mail.example.com - This lists the available messages for the user pop3://user:password@mail.example.com/1 - This retrieves the first message for the user .B IMAP The path part of an IMAP request not only specifies the mailbox to list (Added in 7.30.0) or select, but can also be used to check the UIDVALIDITY of the mailbox and to specify the UID and SECTION of the message to fetch (Added in 7.30.0). imap://user:password@mail.example.com - Performs a top level folder list imap://user:password@mail.example.com/INBOX - Performs a folder list on the user's inbox imap://user:password@mail.example.com/INBOX/;UID=1 - Selects the user's inbox and fetches message 1 imap://user:password@mail.example.com/INBOX;UIDVALIDITY=50/;UID=2 - Selects the user's inbox, checks the UIDVALIDITY of the mailbox is 50 and fetches message 2 if it is imap://user:password@mail.example.com/INBOX/;UID=3/;SECTION=TEXT - Selects the user's inbox and fetches message 3 with only the text portion of the message For more information about the individual components of an IMAP URL please see RFC5092. .B SCP The path part of a SCP request specifies the file to retrieve and from what directory. The file part may not be omitted. The file is taken as an absolute path from the root directory on the server. To specify a path relative to the user's home directory on the server, prepend ~/ to the path portion. If the user name is not embedded in the URL, it can be set with the \fICURLOPT_USERPWD\fP or \fBCURLOPT_USERNAME\fP option. scp://user@example.com/etc/issue - This specifies the file /etc/issue scp://example.com/~/my-file - This specifies the file my-file in the user's home directory on the server .B SFTP The path part of a SFTP request specifies the file to retrieve and from what directory. If the file part is omitted then libcurl downloads the directory listing for the directory specified. If the path ends in a / then a directory listing is returned instead of a file. If the path is omitted entirely then the directory listing for the root / home directory will be returned. If the user name is not embedded in the URL, it can be set with the \fICURLOPT_USERPWD\fP or \fBCURLOPT_USERNAME\fP option. sftp://user:password@example.com/etc/issue - This specifies the file /etc/issue sftp://user@example.com/~/my-file - This specifies the file my-file in the user's home directory sftp://ssh.example.com/~/Documents/ - This requests a directory listing of the Documents directory under the user's home directory .B LDAP The path part of a LDAP request can be used to specify the: Distinguished Name, Attributes, Scope, Filter and Extension for a LDAP search. Each field is separated by a question mark and when that field is not required an empty string with the question mark separator should be included. ldap://ldap.example.com/o=My%20Organisation - This will perform a LDAP search with the DN as My Organisation. ldap://ldap.example.com/o=My%20Organisation?postalAddress - This will perform the same search but will only return postalAddress attributes. ldap://ldap.example.com/?rootDomainNamingContext - This specifies an empty DN and requests information about the rootDomainNamingContext attribute for an Active Directory server. For more information about the individual components of a LDAP URL please see RFC4516. .B RTMP There's no official URL spec for RTMP so libcurl uses the URL syntax supported by the underlying librtmp library. It has a syntax where it wants a traditional URL, followed by a space and a series of space-separated name=value pairs. While space is not typically a "legal" letter, libcurl accepts them. When a user wants to pass in a '#' (hash) character it will be treated as a fragment and get cut off by libcurl if provided literally. You will instead have to escape it by providing it as backslash and its ASCII value in hexadecimal: "\\23". .B NOTES Starting with version 7.20.0, the fragment part of the URI will not be sent as part of the path, which was previously the case. \fICURLOPT_URL\fP is the only option that \fBmust\fP be set before \fIcurl_easy_perform(3)\fP is called. \fICURLOPT_PROTOCOLS\fP can be used to limit what protocols libcurl will use for this transfer, independent of what libcurl has been compiled to support. That may be useful if you accept the URL from an external source and want to limit the accessibility. .IP CURLOPT_PROTOCOLS Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask limits what protocols libcurl may use in the transfer. This allows you to have a libcurl built to support a wide range of protocols but still limit specific transfers to only be allowed to use a subset of them. By default libcurl will accept all protocols it supports. See also \fICURLOPT_REDIR_PROTOCOLS\fP. (Added in 7.19.4) .IP CURLOPT_REDIR_PROTOCOLS Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask limits what protocols libcurl may use in a transfer that it follows to in a redirect when \fICURLOPT_FOLLOWLOCATION\fP is enabled. This allows you to limit specific transfers to only be allowed to use a subset of protocols in redirections. By default libcurl will allow all protocols except for FILE and SCP. This is a difference compared to pre-7.19.4 versions which unconditionally would follow to all protocols supported. (Added in 7.19.4) .IP CURLOPT_PROXY Set HTTP proxy to use. The parameter should be a char * to a zero terminated string holding the host name or dotted IP address. To specify port number in this string, append :[port] to the end of the host name. The proxy string may be prefixed with [protocol]:// since any such prefix will be ignored. The proxy's port number may optionally be specified with the separate option. If not specified, libcurl will default to using port 1080 for proxies. \fICURLOPT_PROXYPORT\fP. When you tell the library to use a HTTP proxy, libcurl will transparently convert operations to HTTP even if you specify an FTP URL etc. This may have an impact on what other features of the library you can use, such as \fICURLOPT_QUOTE\fP and similar FTP specifics that don't work unless you tunnel through the HTTP proxy. Such tunneling is activated with \fICURLOPT_HTTPPROXYTUNNEL\fP. libcurl respects the environment variables \fBhttp_proxy\fP, \fBftp_proxy\fP, \fBall_proxy\fP etc, if any of those are set. The \fICURLOPT_PROXY\fP option does however override any possibly set environment variables. Setting the proxy string to "" (an empty string) will explicitly disable the use of a proxy, even if there is an environment variable set for it. Since 7.14.1, the proxy host string given in environment variables can be specified the exact same way as the proxy can be set with \fICURLOPT_PROXY\fP, include protocol prefix (http://) and embedded user + password. Since 7.21.7, the proxy string may be specified with a protocol:// prefix to specify alternative proxy protocols. Use socks4://, socks4a://, socks5:// or socks5h:// (the last one to enable socks5 and asking the proxy to do the resolving, also known as CURLPROXY_SOCKS5_HOSTNAME type) to request the specific SOCKS version to be used. No protocol specified, http:// and all others will be treated as HTTP proxies. .IP CURLOPT_PROXYPORT Pass a long with this option to set the proxy port to connect to unless it is specified in the proxy string \fICURLOPT_PROXY\fP. .IP CURLOPT_PROXYTYPE Pass a long with this option to set type of the proxy. Available options for this are \fICURLPROXY_HTTP\fP, \fICURLPROXY_HTTP_1_0\fP (added in 7.19.4), \fICURLPROXY_SOCKS4\fP (added in 7.10), \fICURLPROXY_SOCKS5\fP, \fICURLPROXY_SOCKS4A\fP (added in 7.18.0) and \fICURLPROXY_SOCKS5_HOSTNAME\fP (added in 7.18.0). The HTTP type is default. (Added in 7.10) If you set \fBCURLOPT_PROXYTYPE\fP to \fICURLPROXY_HTTP_1_0\fP, it will only affect how libcurl speaks to a proxy when CONNECT is used. The HTTP version used for "regular" HTTP requests is instead controlled with \fICURLOPT_HTTP_VERSION\fP. .IP CURLOPT_NOPROXY Pass a pointer to a zero terminated string. The string consists of a comma separated list of host names that do not require a proxy to get reached, even if one is specified. The only wildcard available is a single * character, which matches all hosts, and effectively disables the proxy. Each name in this list is matched as either a domain which contains the hostname, or the hostname itself. For example, example.com would match example.com, example.com:80, and www.example.com, but not www.notanexample.com. (Added in 7.19.4) .IP CURLOPT_HTTPPROXYTUNNEL Set the parameter to 1 to make the library tunnel all operations through a given HTTP proxy. There is a big difference between using a proxy and to tunnel through it. If you don't know what this means, you probably don't want this tunneling option. .IP CURLOPT_SOCKS5_GSSAPI_SERVICE Pass a char * as parameter to a string holding the name of the service. The default service name for a SOCKS5 server is rcmd/server-fqdn. This option allows you to change it. (Added in 7.19.4) .IP CURLOPT_SOCKS5_GSSAPI_NEC Pass a long set to 1 to enable or 0 to disable. As part of the gssapi negotiation a protection mode is negotiated. The RFC1961 says in section 4.3/4.4 it should be protected, but the NEC reference implementation does not. If enabled, this option allows the unprotected exchange of the protection mode negotiation. (Added in 7.19.4). .IP CURLOPT_INTERFACE Pass a char * as parameter. This sets the interface name to use as outgoing network interface. The name can be an interface name, an IP address, or a host name. Starting with 7.24.0: If the parameter starts with "if!" then it is treated as only as interface name and no attempt will ever be named to do treat it as an IP address or to do name resolution on it. If the parameter starts with \&"host!" it is treated as either an IP address or a hostname. Hostnames are resolved synchronously. Using the if! format is highly recommended when using the multi interfaces to avoid allowing the code to block. If "if!" is specified but the parameter does not match an existing interface, CURLE_INTERFACE_FAILED is returned. .IP CURLOPT_LOCALPORT Pass a long. This sets the local port number of the socket used for connection. This can be used in combination with \fICURLOPT_INTERFACE\fP and you are recommended to use \fICURLOPT_LOCALPORTRANGE\fP as well when this is set. Valid port numbers are 1 - 65535. (Added in 7.15.2) .IP CURLOPT_LOCALPORTRANGE Pass a long. This is the number of attempts libcurl will make to find a working local port number. It starts with the given \fICURLOPT_LOCALPORT\fP and adds one to the number for each retry. Setting this to 1 or below will make libcurl do only one try for the exact port number. Port numbers by nature are scarce resources that will be busy at times so setting this value to something too low might cause unnecessary connection setup failures. (Added in 7.15.2) .IP CURLOPT_DNS_CACHE_TIMEOUT Pass a long, this sets the timeout in seconds. Name resolves will be kept in memory for this number of seconds. Set to zero to completely disable caching, or set to -1 to make the cached entries remain forever. By default, libcurl caches this info for 60 seconds. The name resolve functions of various libc implementations don't re-read name server information unless explicitly told so (for example, by calling \fIres_init(3)\fP). This may cause libcurl to keep using the older server even if DHCP has updated the server info, and this may look like a DNS cache issue to the casual libcurl-app user. .IP CURLOPT_DNS_USE_GLOBAL_CACHE Pass a long. If the value is 1, it tells curl to use a global DNS cache that will survive between easy handle creations and deletions. This is not thread-safe and this will use a global variable. \fBWARNING:\fP this option is considered obsolete. Stop using it. Switch over to using the share interface instead! See \fICURLOPT_SHARE\fP and \fIcurl_share_init(3)\fP. .IP CURLOPT_BUFFERSIZE Pass a long specifying your preferred size (in bytes) for the receive buffer in libcurl. The main point of this would be that the write callback gets called more often and with smaller chunks. This is just treated as a request, not an order. You cannot be guaranteed to actually get the given size. (Added in 7.10) This size is by default set as big as possible (CURL_MAX_WRITE_SIZE), so it only makes sense to use this option if you want it smaller. .IP CURLOPT_PORT Pass a long specifying what remote port number to connect to, instead of the one specified in the URL or the default port for the used protocol. .IP CURLOPT_TCP_NODELAY Pass a long specifying whether the TCP_NODELAY option is to be set or cleared (1 = set, 0 = clear). The option is cleared by default. This will have no effect after the connection has been established. Setting this option will disable TCP's Nagle algorithm. The purpose of this algorithm is to try to minimize the number of small packets on the network (where "small packets" means TCP segments less than the Maximum Segment Size (MSS) for the network). Maximizing the amount of data sent per TCP segment is good because it amortizes the overhead of the send. However, in some cases (most notably telnet or rlogin) small segments may need to be sent without delay. This is less efficient than sending larger amounts of data at a time, and can contribute to congestion on the network if overdone. .IP CURLOPT_ADDRESS_SCOPE Pass a long specifying the scope_id value to use when connecting to IPv6 link-local or site-local addresses. (Added in 7.19.0) .IP CURLOPT_TCP_KEEPALIVE Pass a long. If set to 1, TCP keepalive probes will be sent. The delay and frequency of these probes can be controlled by the \fICURLOPT_TCP_KEEPIDLE\fP and \fICURLOPT_TCP_KEEPINTVL\fP options, provided the operating system supports them. Set to 0 (default behavior) to disable keepalive probes (Added in 7.25.0). .IP CURLOPT_TCP_KEEPIDLE Pass a long. Sets the delay, in seconds, that the operating system will wait while the connection is idle before sending keepalive probes. Not all operating systems support this option. (Added in 7.25.0) .IP CURLOPT_TCP_KEEPINTVL Pass a long. Sets the interval, in seconds, that the operating system will wait between sending keepalive probes. Not all operating systems support this option. (Added in 7.25.0) .SH NAMES and PASSWORDS OPTIONS (Authentication) .IP CURLOPT_NETRC This parameter controls the preference of libcurl between using user names and passwords from your \fI~/.netrc\fP file, relative to user names and passwords in the URL supplied with \fICURLOPT_URL\fP. libcurl uses a user name (and supplied or prompted password) supplied with \fICURLOPT_USERPWD\fP in preference to any of the options controlled by this parameter. Pass a long, set to one of the values described below. .RS .IP CURL_NETRC_OPTIONAL The use of your \fI~/.netrc\fP file is optional, and information in the URL is to be preferred. The file will be scanned for the host and user name (to find the password only) or for the host only, to find the first user name and password after that \fImachine\fP, which ever information is not specified in the URL. Undefined values of the option will have this effect. .IP CURL_NETRC_IGNORED The library will ignore the file and use only the information in the URL. This is the default. .IP CURL_NETRC_REQUIRED This value tells the library that use of the file is required, to ignore the information in the URL, and to search the file for the host only. .RE Only machine name, user name and password are taken into account (init macros and similar things aren't supported). libcurl does not verify that the file has the correct properties set (as the standard Unix ftp client does). It should only be readable by user. .IP CURLOPT_NETRC_FILE Pass a char * as parameter, pointing to a zero terminated string containing the full path name to the file you want libcurl to use as .netrc file. If this option is omitted, and \fICURLOPT_NETRC\fP is set, libcurl will attempt to find a .netrc file in the current user's home directory. (Added in 7.10.9) .IP CURLOPT_USERPWD Pass a char * as parameter, pointing to a zero terminated login details string for the connection. The format of which is: [user name]:[password]. When using NTLM, you can set the domain by prepending it to the user name and separating the domain and name with a forward (/) or backward slash (\\). Like this: "domain/user:password" or "domain\\user:password". Some HTTP servers (on Windows) support this style even for Basic authentication. When using HTTP and \fICURLOPT_FOLLOWLOCATION\fP, libcurl might perform several requests to possibly different hosts. libcurl will only send this user and password information to hosts using the initial host name (unless \fICURLOPT_UNRESTRICTED_AUTH\fP is set), so if libcurl follows locations to other hosts it will not send the user and password to those. This is enforced to prevent accidental information leakage. Use \fICURLOPT_HTTPAUTH\fP to specify the authentication method for HTTP based connections or \fICURLOPT_LOGIN_OPTIONS\fP to control IMAP, POP3 and SMTP options. The user and password strings are not URL decoded, so there's no way to send in a user name containing a colon using this option. Use \fICURLOPT_USERNAME\fP for that, or include it in the URL. .IP CURLOPT_PROXYUSERPWD Pass a char * as parameter, which should be [user name]:[password] to use for the connection to the HTTP proxy. Both the name and the password will be URL decoded before use, so to include for example a colon in the user name you should encode it as %3A. Use \fICURLOPT_PROXYAUTH\fP to specify the authentication method. .IP CURLOPT_USERNAME Pass a char * as parameter, which should be pointing to the zero terminated user name to use for the transfer. \fBCURLOPT_USERNAME\fP sets the user name to be used in protocol authentication. You should not use this option together with the (older) CURLOPT_USERPWD option. To specify the password and login options, along with the user name, use the \fICURLOPT_PASSWORD\fP and \fICURLOPT_LOGIN_OPTIONS\fP options. (Added in 7.19.1) .IP CURLOPT_PASSWORD Pass a char * as parameter, which should be pointing to the zero terminated password to use for the transfer. The CURLOPT_PASSWORD option should be used in conjunction with the \fICURLOPT_USERNAME\fP option. (Added in 7.19.1) .IP CURLOPT_LOGIN_OPTIONS (Added in 7.34.0) Pass a char * as parameter, which should be pointing to the zero terminated options string to use for the transfer. At present only IMAP, POP3 and SMTP support login options. For more information about the login options please see RFC2384, RFC5092 and IETF draft draft-earhart-url-smtp-00.txt \fBCURLOPT_LOGIN_OPTIONS\fP can be used to set protocol specific login options, such as the preferred authentication mechanism via "AUTH=NTLM" or "AUTH=*", and should be used in conjunction with the \fICURLOPT_USERNAME\fP option. .IP CURLOPT_PROXYUSERNAME Pass a char * as parameter, which should be pointing to the zero terminated user name to use for the transfer while connecting to Proxy. The CURLOPT_PROXYUSERNAME option should be used in same way as the \fICURLOPT_PROXYUSERPWD\fP is used. In comparison to \fICURLOPT_PROXYUSERPWD\fP the CURLOPT_PROXYUSERNAME allows the username to contain a colon, like in the following example: "sip:user@example.com". The CURLOPT_PROXYUSERNAME option is an alternative way to set the user name while connecting to Proxy. There is no meaning to use it together with the \fICURLOPT_PROXYUSERPWD\fP option. In order to specify the password to be used in conjunction with the user name use the \fICURLOPT_PROXYPASSWORD\fP option. (Added in 7.19.1) .IP CURLOPT_PROXYPASSWORD Pass a char * as parameter, which should be pointing to the zero terminated password to use for the transfer while connecting to Proxy. The CURLOPT_PROXYPASSWORD option should be used in conjunction with the \fICURLOPT_PROXYUSERNAME\fP option. (Added in 7.19.1) .IP CURLOPT_HTTPAUTH Pass a long as parameter, which is set to a bitmask, to tell libcurl which authentication method(s) you want it to use. The available bits are listed below. If more than one bit is set, libcurl will first query the site to see which authentication methods it supports and then pick the best one you allow it to use. For some methods, this will induce an extra network round-trip. Set the actual name and password with the \fICURLOPT_USERPWD\fP option or with the \fICURLOPT_USERNAME\fP and the \fICURLOPT_PASSWORD\fP options. (Added in 7.10.6) .RS .IP CURLAUTH_BASIC HTTP Basic authentication. This is the default choice, and the only method that is in wide-spread use and supported virtually everywhere. This sends the user name and password over the network in plain text, easily captured by others. .IP CURLAUTH_DIGEST HTTP Digest authentication. Digest authentication is defined in RFC2617 and is a more secure way to do authentication over public networks than the regular old-fashioned Basic method. .IP CURLAUTH_DIGEST_IE HTTP Digest authentication with an IE flavor. Digest authentication is defined in RFC2617 and is a more secure way to do authentication over public networks than the regular old-fashioned Basic method. The IE flavor is simply that libcurl will use a special "quirk" that IE is known to have used before version 7 and that some servers require the client to use. (This define was added in 7.19.3) .IP CURLAUTH_GSSNEGOTIATE HTTP GSS-Negotiate authentication. The GSS-Negotiate (also known as plain \&"Negotiate") method was designed by Microsoft and is used in their web applications. It is primarily meant as a support for Kerberos5 authentication but may also be used along with other authentication methods. For more information see IETF draft draft-brezak-spnego-http-04.txt. You need to build libcurl with a suitable GSS-API library for this to work. .IP CURLAUTH_NTLM HTTP NTLM authentication. A proprietary protocol invented and used by Microsoft. It uses a challenge-response and hash concept similar to Digest, to prevent the password from being eavesdropped. You need to build libcurl with either OpenSSL, GnuTLS or NSS support for this option to work, or build libcurl on Windows with SSPI support. .IP CURLAUTH_NTLM_WB NTLM delegating to winbind helper. Authentication is performed by a separate binary application that is executed when needed. The name of the application is specified at compile time but is typically /usr/bin/ntlm_auth (Added in 7.22.0) Note that libcurl will fork when necessary to run the winbind application and kill it when complete, calling waitpid() to await its exit when done. On POSIX operating systems, killing the process will cause a SIGCHLD signal to be raised (regardless of whether \fICURLOPT_NOSIGNAL\fP is set), which must be handled intelligently by the application. In particular, the application must not unconditionally call wait() in its SIGCHLD signal handler to avoid being subject to a race condition. This behavior is subject to change in future versions of libcurl. .IP CURLAUTH_ANY This is a convenience macro that sets all bits and thus makes libcurl pick any it finds suitable. libcurl will automatically select the one it finds most secure. .IP CURLAUTH_ANYSAFE This is a convenience macro that sets all bits except Basic and thus makes libcurl pick any it finds suitable. libcurl will automatically select the one it finds most secure. .IP CURLAUTH_ONLY This is a meta symbol. Or this value together with a single specific auth value to force libcurl to probe for un-restricted auth and if not, only that single auth algorithm is acceptable. (Added in 7.21.3) .RE .IP CURLOPT_TLSAUTH_TYPE Pass a long as parameter, which is set to a bitmask, to tell libcurl which authentication method(s) you want it to use for TLS authentication. .RS .IP CURLOPT_TLSAUTH_SRP TLS-SRP authentication. Secure Remote Password authentication for TLS is defined in RFC5054 and provides mutual authentication if both sides have a shared secret. To use TLS-SRP, you must also set the \fICURLOPT_TLSAUTH_USERNAME\fP and \fICURLOPT_TLSAUTH_PASSWORD\fP options. You need to build libcurl with GnuTLS or OpenSSL with TLS-SRP support for this to work. (Added in 7.21.4) .RE .IP CURLOPT_TLSAUTH_USERNAME Pass a char * as parameter, which should point to the zero terminated username to use for the TLS authentication method specified with the \fICURLOPT_TLSAUTH_TYPE\fP option. Requires that the \fICURLOPT_TLS_PASSWORD\fP option also be set. (Added in 7.21.4) .IP CURLOPT_TLSAUTH_PASSWORD Pass a char * as parameter, which should point to the zero terminated password to use for the TLS authentication method specified with the \fICURLOPT_TLSAUTH_TYPE\fP option. Requires that the \fICURLOPT_TLS_USERNAME\fP option also be set. (Added in 7.21.4) .IP CURLOPT_PROXYAUTH Pass a long as parameter, which is set to a bitmask, to tell libcurl which authentication method(s) you want it to use for your proxy authentication. If more than one bit is set, libcurl will first query the site to see what authentication methods it supports and then pick the best one you allow it to use. For some methods, this will induce an extra network round-trip. Set the actual name and password with the \fICURLOPT_PROXYUSERPWD\fP option. The bitmask can be constructed by or'ing together the bits listed above for the \fICURLOPT_HTTPAUTH\fP option. \fICURLOPT_PROXYAUTH\fP was added in 7.10.7 .IP CURLOPT_SASL_IR Pass a long. If the value is 1, curl will send the initial response to the server in the first authentication packet in order to reduce the number of ping pong requests. Only applicable to supporting SASL authentication mechanisms and to the IMAP, POP3 and SMTP protocols. (Added in 7.31.0) Note: Whilst IMAP supports this option there is no need to explicitly set it, as libcurl can determine the feature itself when the server supports the SASL-IR CAPABILITY. .IP CURLOPT_XOAUTH2_BEARER Pass a char * as parameter, which should point to the zero terminated OAuth 2.0 Bearer Access Token for use with IMAP, POP3 and SMTP servers that support the OAuth 2.0 Authorization Framework. (Added in 7.33.0) Note: The user name used to generate the Bearer Token should be supplied via the \fICURLOPT_USERNAME\fP option. .SH HTTP OPTIONS .IP CURLOPT_AUTOREFERER Pass a parameter set to 1 to enable this. When enabled, libcurl will automatically set the Referer: field in requests where it follows a Location: redirect. .IP CURLOPT_ACCEPT_ENCODING Sets the contents of the Accept-Encoding: header sent in a HTTP request, and enables decoding of a response when a Content-Encoding: header is received. Three encodings are supported: \fIidentity\fP, which does nothing, \fIdeflate\fP which requests the server to compress its response using the zlib algorithm, and \fIgzip\fP which requests the gzip algorithm. If a zero-length string is set, then an Accept-Encoding: header containing all supported encodings is sent. This is a request, not an order; the server may or may not do it. This option must be set (to any non-NULL value) or else any unsolicited encoding done by the server is ignored. See the special file lib/README.encoding for details. (This option was called CURLOPT_ENCODING before 7.21.6) .IP CURLOPT_TRANSFER_ENCODING Adds a request for compressed Transfer Encoding in the outgoing HTTP request. If the server supports this and so desires, it can respond with the HTTP response sent using a compressed Transfer-Encoding that will be automatically uncompressed by libcurl on reception. Transfer-Encoding differs slightly from the Content-Encoding you ask for with \fBCURLOPT_ACCEPT_ENCODING\fP in that a Transfer-Encoding is strictly meant to be for the transfer and thus MUST be decoded before the data arrives in the client. Traditionally, Transfer-Encoding has been much less used and supported by both HTTP clients and HTTP servers. (Added in 7.21.6) .IP CURLOPT_FOLLOWLOCATION A parameter set to 1 tells the library to follow any Location: header that the server sends as part of a HTTP header. This means that the library will re-send the same request on the new location and follow new Location: headers all the way until no more such headers are returned. \fICURLOPT_MAXREDIRS\fP can be used to limit the number of redirects libcurl will follow. Since 7.19.4, libcurl can limit what protocols it will automatically follow. The accepted protocols are set with \fICURLOPT_REDIR_PROTOCOLS\fP and it excludes the FILE protocol by default. .IP CURLOPT_UNRESTRICTED_AUTH A parameter set to 1 tells the library it can continue to send authentication (user+password) when following locations, even when hostname changed. This option is meaningful only when setting \fICURLOPT_FOLLOWLOCATION\fP. .IP CURLOPT_MAXREDIRS Pass a long. The set number will be the redirection limit. If that many redirections have been followed, the next redirect will cause an error (\fICURLE_TOO_MANY_REDIRECTS\fP). This option only makes sense if the \fICURLOPT_FOLLOWLOCATION\fP is used at the same time. Added in 7.15.1: Setting the limit to 0 will make libcurl refuse any redirect. Set it to -1 for an infinite number of redirects (which is the default) .IP CURLOPT_POSTREDIR Pass a bitmask to control how libcurl acts on redirects after POSTs that get a 301, 302 or 303 response back. A parameter with bit 0 set (value \fBCURL_REDIR_POST_301\fP) tells the library to respect RFC2616/10.3.2 and not convert POST requests into GET requests when following a 301 redirection. Setting bit 1 (value \fBCURL_REDIR_POST_302\fP) makes libcurl maintain the request method after a 302 redirect whilst setting bit 2 (value \fBCURL_REDIR_POST_303\fP) makes libcurl maintain the request method after a 303 redirect. The value \fBCURL_REDIR_POST_ALL\fP is a convenience define that sets all three bits. The non-RFC behaviour is ubiquitous in web browsers, so the library does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when setting \fICURLOPT_FOLLOWLOCATION\fP. (Added in 7.17.1) (This option was known as CURLOPT_POST301 up to 7.19.0 as it only supported the 301 then) .IP CURLOPT_PUT A parameter set to 1 tells the library to use HTTP PUT to transfer data. The data should be set with \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP. This option is deprecated and starting with version 7.12.1 you should instead use \fICURLOPT_UPLOAD\fP. .IP CURLOPT_POST A parameter set to 1 tells the library to do a regular HTTP post. This will also make the library use a "Content-Type: application/x-www-form-urlencoded" header. (This is by far the most commonly used POST method). Use one of \fICURLOPT_POSTFIELDS\fP or \fICURLOPT_COPYPOSTFIELDS\fP options to specify what data to post and \fICURLOPT_POSTFIELDSIZE\fP or \fICURLOPT_POSTFIELDSIZE_LARGE\fP to set the data size. Optionally, you can provide data to POST using the \fICURLOPT_READFUNCTION\fP and \fICURLOPT_READDATA\fP options but then you must make sure to not set \fICURLOPT_POSTFIELDS\fP to anything but NULL. When providing data with a callback, you must transmit it using chunked transfer-encoding or you must set the size of the data with the \fICURLOPT_POSTFIELDSIZE\fP or \fICURLOPT_POSTFIELDSIZE_LARGE\fP option. To enable chunked encoding, you simply pass in the appropriate Transfer-Encoding header, see the post-callback.c example. You can override the default POST Content-Type: header by setting your own with \fICURLOPT_HTTPHEADER\fP. Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual. If you use POST to a HTTP 1.1 server, you can send data without knowing the size before starting the POST if you use chunked encoding. You enable this by adding a header like "Transfer-Encoding: chunked" with \fICURLOPT_HTTPHEADER\fP. With HTTP 1.0 or without chunked transfer, you must specify the size in the request. When setting \fICURLOPT_POST\fP to 1, it will automatically set \fICURLOPT_NOBODY\fP to 0 (since 7.14.1). If you issue a POST request and then want to make a HEAD or GET using the same re-used handle, you must explicitly set the new request type using \fICURLOPT_NOBODY\fP or \fICURLOPT_HTTPGET\fP or similar. .IP CURLOPT_POSTFIELDS Pass a void * as parameter, which should be the full data to post in a HTTP POST operation. You must make sure that the data is formatted the way you want the server to receive it. libcurl will not convert or encode it for you. Most web servers will assume this data to be url-encoded. The pointed data are NOT copied by the library: as a consequence, they must be preserved by the calling application until the transfer finishes. This POST is a normal application/x-www-form-urlencoded kind (and libcurl will set that Content-Type by default when this option is used), which is the most commonly used one by HTML forms. See also the \fICURLOPT_POST\fP. Using \fICURLOPT_POSTFIELDS\fP implies \fICURLOPT_POST\fP. If you want to do a zero-byte POST, you need to set \fICURLOPT_POSTFIELDSIZE\fP explicitly to zero, as simply setting \fICURLOPT_POSTFIELDS\fP to NULL or "" just effectively disables the sending of the specified string. libcurl will instead assume that you'll send the POST data using the read callback! Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual. To make multipart/formdata posts (aka RFC2388-posts), check out the \fICURLOPT_HTTPPOST\fP option. .IP CURLOPT_POSTFIELDSIZE If you want to post data to the server without letting libcurl do a strlen() to measure the data size, this option must be used. When this option is used you can post fully binary data, which otherwise is likely to fail. If this size is set to -1, the library will use strlen() to get the size. .IP CURLOPT_POSTFIELDSIZE_LARGE Pass a curl_off_t as parameter. Use this to set the size of the \fICURLOPT_POSTFIELDS\fP data to prevent libcurl from doing strlen() on the data to figure out the size. This is the large file version of the \fICURLOPT_POSTFIELDSIZE\fP option. (Added in 7.11.1) .IP CURLOPT_COPYPOSTFIELDS Pass a char * as parameter, which should be the full data to post in a HTTP POST operation. It behaves as the \fICURLOPT_POSTFIELDS\fP option, but the original data are copied by the library, allowing the application to overwrite the original data after setting this option. Because data are copied, care must be taken when using this option in conjunction with \fICURLOPT_POSTFIELDSIZE\fP or \fICURLOPT_POSTFIELDSIZE_LARGE\fP: If the size has not been set prior to \fICURLOPT_COPYPOSTFIELDS\fP, the data are assumed to be a NUL-terminated string; else the stored size informs the library about the data byte count to copy. In any case, the size must not be changed after \fICURLOPT_COPYPOSTFIELDS\fP, unless another \fICURLOPT_POSTFIELDS\fP or \fICURLOPT_COPYPOSTFIELDS\fP option is issued. (Added in 7.17.1) .IP CURLOPT_HTTPPOST Tells libcurl you want a multipart/formdata HTTP POST to be made and you instruct what data to pass on to the server. Pass a pointer to a linked list of curl_httppost structs as parameter. The easiest way to create such a list, is to use \fIcurl_formadd(3)\fP as documented. The data in this list must remain intact until you close this curl handle again with \fIcurl_easy_cleanup(3)\fP. Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual. When setting \fICURLOPT_HTTPPOST\fP, it will automatically set \fICURLOPT_NOBODY\fP to 0 (since 7.14.1). .IP CURLOPT_REFERER Pass a pointer to a zero terminated string as parameter. It will be used to set the Referer: header in the http request sent to the remote server. This can be used to fool servers or scripts. You can also set any custom header with \fICURLOPT_HTTPHEADER\fP. .IP CURLOPT_USERAGENT Pass a pointer to a zero terminated string as parameter. It will be used to set the User-Agent: header in the http request sent to the remote server. This can be used to fool servers or scripts. You can also set any custom header with \fICURLOPT_HTTPHEADER\fP. .IP CURLOPT_HTTPHEADER Pass a pointer to a linked list of HTTP headers to pass to the server in your HTTP request. The linked list should be a fully valid list of \fBstruct curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire list. If you add a header that is otherwise generated and used by libcurl internally, your added one will be used instead. If you add a header with no content as in 'Accept:' (no data on the right side of the colon), the internally used header will get disabled. Thus, using this option you can add new headers, replace internal headers and remove internal headers. To add a header with no content (nothing to the right side of the colon), use the form 'MyHeader;' (note the ending semicolon). The headers included in the linked list must not be CRLF-terminated, because curl adds CRLF after each header item. Failure to comply with this will result in strange bugs because the server will most likely ignore part of the headers you specified. The first line in a request (containing the method, usually a GET or POST) is not a header and cannot be replaced using this option. Only the lines following the request-line are headers. Adding this method line in this list of headers will only cause your request to send an invalid header. Pass a NULL to this to reset back to no custom headers. The most commonly replaced headers have "shortcuts" in the options \fICURLOPT_COOKIE\fP, \fICURLOPT_USERAGENT\fP and \fICURLOPT_REFERER\fP. .IP CURLOPT_HTTP200ALIASES Pass a pointer to a linked list of aliases to be treated as valid HTTP 200 responses. Some servers respond with a custom header response line. For example, IceCast servers respond with "ICY 200 OK". By including this string in your list of aliases, the response will be treated as a valid HTTP header line such as "HTTP/1.0 200 OK". (Added in 7.10.3) The linked list should be a fully valid list of struct curl_slist structs, and be properly filled in. Use \fIcurl_slist_append(3)\fP to create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire list. The alias itself is not parsed for any version strings. Before libcurl 7.16.3, Libcurl used the value set by option \fICURLOPT_HTTP_VERSION\fP, but starting with 7.16.3 the protocol is assumed to match HTTP 1.0 when an alias matched. .IP CURLOPT_COOKIE Pass a pointer to a zero terminated string as parameter. It will be used to set a cookie in the http request. The format of the string should be NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie should contain. If you need to set multiple cookies, you need to set them all using a single option and thus you need to concatenate them all in one single string. Set multiple cookies in one string like this: "name1=content1; name2=content2;" etc. This option sets the cookie header explicitly in the outgoing request(s). If multiple requests are done due to authentication, followed redirections or similar, they will all get this cookie passed on. Using this option multiple times will only make the latest string override the previous ones. .IP CURLOPT_COOKIEFILE Pass a pointer to a zero terminated string as parameter. It should contain the name of your file holding cookie data to read. The cookie data may be in Netscape / Mozilla cookie data format or just regular HTTP-style headers dumped to a file. Given an empty or non-existing file or by passing the empty string (""), this option will enable cookies for this curl handle, making it understand and parse received cookies and then use matching cookies in future requests. If you use this option multiple times, you just add more files to read. Subsequent files will add more cookies. .IP CURLOPT_COOKIEJAR Pass a file name as char *, zero terminated. This will make libcurl write all internally known cookies to the specified file when \fIcurl_easy_cleanup(3)\fP is called. If no cookies are known, no file will be created. Specify "-" to instead have the cookies written to stdout. Using this option also enables cookies for this session, so if you for example follow a location it will make matching cookies get sent accordingly. If the cookie jar file can't be created or written to (when the \fIcurl_easy_cleanup(3)\fP is called), libcurl will not and cannot report an error for this. Using \fICURLOPT_VERBOSE\fP or \fICURLOPT_DEBUGFUNCTION\fP will get a warning to display, but that is the only visible feedback you get about this possibly lethal situation. .IP CURLOPT_COOKIESESSION Pass a long set to 1 to mark this as a new cookie "session". It will force libcurl to ignore all cookies it is about to load that are "session cookies" from the previous session. By default, libcurl always stores and loads all cookies, independent if they are session cookies or not. Session cookies are cookies without expiry date and they are meant to be alive and existing for this "session" only. .IP CURLOPT_COOKIELIST Pass a char * to a cookie string. Cookie can be either in Netscape / Mozilla format or just regular HTTP-style header (Set-Cookie: ...) format. If cURL cookie engine was not enabled it will enable its cookie engine. Passing a magic string \&"ALL" will erase all cookies known by cURL. (Added in 7.14.1) Passing the special string \&"SESS" will only erase all session cookies known by cURL. (Added in 7.15.4) Passing the special string \&"FLUSH" will write all cookies known by cURL to the file specified by \fICURLOPT_COOKIEJAR\fP. (Added in 7.17.1) .IP CURLOPT_HTTPGET Pass a long. If the long is 1, this forces the HTTP request to get back to GET. Usable if a POST, HEAD, PUT, or a custom request has been used previously using the same curl handle. When setting \fICURLOPT_HTTPGET\fP to 1, it will automatically set \fICURLOPT_NOBODY\fP to 0 and \fICURLOPT_UPLOAD\fP to 0. .IP CURLOPT_HTTP_VERSION Pass a long, set to one of the values described below. They force libcurl to use the specific HTTP versions. This is not sensible to do unless you have a good reason. .RS .IP CURL_HTTP_VERSION_NONE We don't care about what version the library uses. libcurl will use whatever it thinks fit. .IP CURL_HTTP_VERSION_1_0 Enforce HTTP 1.0 requests. .IP CURL_HTTP_VERSION_1_1 Enforce HTTP 1.1 requests. .RE .IP CURLOPT_IGNORE_CONTENT_LENGTH Ignore the Content-Length header. This is useful for Apache 1.x (and similar servers) which will report incorrect content length for files over 2 gigabytes. If this option is used, curl will not be able to accurately report progress, and will simply stop the download when the server ends the connection. (added in 7.14.1) .IP CURLOPT_HTTP_CONTENT_DECODING Pass a long to tell libcurl how to act on content decoding. If set to zero, content decoding will be disabled. If set to 1 it is enabled. Libcurl has no default content decoding but requires you to use \fICURLOPT_ACCEPT_ENCODING\fP for that. (added in 7.16.2) .IP CURLOPT_HTTP_TRANSFER_DECODING Pass a long to tell libcurl how to act on transfer decoding. If set to zero, transfer decoding will be disabled, if set to 1 it is enabled (default). libcurl does chunked transfer decoding by default unless this option is set to zero. (added in 7.16.2) .SH SMTP OPTIONS .IP CURLOPT_MAIL_FROM Pass a pointer to a zero terminated string as parameter. This should be used to specify the sender's email address when sending SMTP mail with libcurl. An originator email address should be specified with angled brackets (<>) around it, which if not specified, will be added by libcurl from version 7.21.4 onwards. Failing to provide such brackets may cause the server to reject the email. If this parameter is not specified then an empty address will be sent to the mail server which may or may not cause the email to be rejected. (Added in 7.20.0) .IP CURLOPT_MAIL_RCPT Pass a pointer to a linked list of recipients to pass to the server in your SMTP mail request. The linked list should be a fully valid list of \fBstruct curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire list. When performing a mail transfer, each recipient should be specified within a pair of angled brackets (<>), however, should you not use an angled bracket as the first character libcurl will assume you provided a single email address and enclose that address within brackets for you. (Added in 7.20.0) When performing an address verification (VRFY command), each recipient should be specified as the user name or user name and domain (as per Section 3.5 of RFC5321). (Added in 7.34.0) When performing a mailing list expand (EXPN command), each recipient should be specified using the mailing list name, such as "Friends" or "London-Office". (Added in 7.34.0) .IP CURLOPT_MAIL_AUTH Pass a pointer to a zero terminated string as parameter. This will be used to specify the authentication address (identity) of a submitted message that is being relayed to another server. This optional parameter allows co-operating agents in a trusted environment to communicate the authentication of individual messages and should only be used by the application program, using libcurl, if the application is itself a mail server acting in such an environment. If the application is operating as such and the AUTH address is not known or is invalid, then an empty string should be used for this parameter. Unlike CURLOPT_MAIL_FROM and CURLOPT_MAIL_RCPT, the address should not be specified within a pair of angled brackets (<>). However, if an empty string is used then a pair of brackets will be sent by libcurl as required by RFC2554. (Added in 7.25.0) .SH TFTP OPTIONS .IP CURLOPT_TFTP_BLKSIZE Specify block size to use for TFTP data transmission. Valid range as per RFC2348 is 8-65464 bytes. The default of 512 bytes will be used if this option is not specified. The specified block size will only be used pending support by the remote server. If the server does not return an option acknowledgement or returns an option acknowledgement with no blksize, the default of 512 bytes will be used. (added in 7.19.4) .SH FTP OPTIONS .IP CURLOPT_FTPPORT Pass a pointer to a zero terminated string as parameter. It will be used to get the IP address to use for the FTP PORT instruction. The PORT instruction tells the remote server to connect to our specified IP address. The string may be a plain IP address, a host name, a network interface name (under Unix) or just a '-' symbol to let the library use your system's default IP address. Default FTP operations are passive, and thus won't use PORT. The address can be followed by a ':' to specify a port, optionally followed by a '-' to specify a port range. If the port specified is 0, the operating system will pick a free port. If a range is provided and all ports in the range are not available, libcurl will report CURLE_FTP_PORT_FAILED for the handle. Invalid port/range settings are ignored. IPv6 addresses followed by a port or portrange have to be in brackets. IPv6 addresses without port/range specifier can be in brackets. (added in 7.19.5) Examples with specified ports: .nf eth0:0 192.168.1.2:32000-33000 curl.se:32123 [::1]:1234-4567 .fi You disable PORT again and go back to using the passive version by setting this option to NULL. .IP CURLOPT_QUOTE Pass a pointer to a linked list of FTP or SFTP commands to pass to the server prior to your FTP request. This will be done before any other commands are issued (even before the CWD command for FTP). The linked list should be a fully valid list of 'struct curl_slist' structs properly filled in with text strings. Use \fIcurl_slist_append(3)\fP to append strings (commands) to the list, and clear the entire list afterwards with \fIcurl_slist_free_all(3)\fP. Disable this operation again by setting a NULL to this option. When speaking to a FTP (or SFTP since 7.24.0) server, prefix the command with an asterisk (*) to make libcurl continue even if the command fails as by default libcurl will stop at first failure. The set of valid FTP commands depends on the server (see RFC959 for a list of mandatory commands). The valid SFTP commands are: chgrp, chmod, chown, ln, mkdir, pwd, rename, rm, rmdir, symlink (see .BR curl (1)) (SFTP support added in 7.16.3) .IP CURLOPT_POSTQUOTE Pass a pointer to a linked list of FTP or SFTP commands to pass to the server after your FTP transfer request. The commands will only be run if no error occurred. The linked list should be a fully valid list of struct curl_slist structs properly filled in as described for \fICURLOPT_QUOTE\fP. Disable this operation again by setting a NULL to this option. .IP CURLOPT_PREQUOTE Pass a pointer to a linked list of FTP commands to pass to the server after the transfer type is set. The linked list should be a fully valid list of struct curl_slist structs properly filled in as described for \fICURLOPT_QUOTE\fP. Disable this operation again by setting a NULL to this option. Before version 7.16.0, if you also set \fICURLOPT_NOBODY\fP to 1, this option didn't work. .IP CURLOPT_DIRLISTONLY A parameter set to 1 tells the library to just list the names of files in a directory, instead of doing a full directory listing that would include file sizes, dates etc. This works for FTP and SFTP URLs. This causes an FTP NLST command to be sent on an FTP server. Beware that some FTP servers list only files in their response to NLST; they might not include subdirectories and symbolic links. Setting this option to 1 also implies a directory listing even if the URL doesn't end with a slash, which otherwise is necessary. Do NOT use this option if you also use \fICURLOPT_WILDCARDMATCH\fP as it will effectively break that feature then. (This option was known as CURLOPT_FTPLISTONLY up to 7.16.4) .IP CURLOPT_APPEND A parameter set to 1 tells the library to append to the remote file instead of overwrite it. This is only useful when uploading to an FTP site. (This option was known as CURLOPT_FTPAPPEND up to 7.16.4) .IP CURLOPT_FTP_USE_EPRT Pass a long. If the value is 1, it tells curl to use the EPRT (and LPRT) command when doing active FTP downloads (which is enabled by \fICURLOPT_FTPPORT\fP). Using EPRT means that it will first attempt to use EPRT and then LPRT before using PORT, but if you pass zero to this option, it will not try using EPRT or LPRT, only plain PORT. (Added in 7.10.5) If the server is an IPv6 host, this option will have no effect as of 7.12.3. .IP CURLOPT_FTP_USE_EPSV Pass a long. If the value is 1, it tells curl to use the EPSV command when doing passive FTP downloads (which it always does by default). Using EPSV means that it will first attempt to use EPSV before using PASV, but if you pass zero to this option, it will not try using EPSV, only plain PASV. If the server is an IPv6 host, this option will have no effect as of 7.12.3. .IP CURLOPT_FTP_USE_PRET Pass a long. If the value is 1, it tells curl to send a PRET command before PASV (and EPSV). Certain FTP servers, mainly drftpd, require this non-standard command for directory listings as well as up and downloads in PASV mode. Has no effect when using the active FTP transfers mode. (Added in 7.20.0) .IP CURLOPT_FTP_CREATE_MISSING_DIRS Pass a long. If the value is 1, curl will attempt to create any remote directory that it fails to CWD into. CWD is the command that changes working directory. (Added in 7.10.7) This setting also applies to SFTP-connections. curl will attempt to create the remote directory if it can't obtain a handle to the target-location. The creation will fail if a file of the same name as the directory to create already exists or lack of permissions prevents creation. (Added in 7.16.3) Starting with 7.19.4, you can also set this value to 2, which will make libcurl retry the CWD command again if the subsequent MKD command fails. This is especially useful if you're doing many simultaneous connections against the same server and they all have this option enabled, as then CWD may first fail but then another connection does MKD before this connection and thus MKD fails but trying CWD works! 7.19.4 also introduced the \fICURLFTP_CREATE_DIR\fP and \fICURLFTP_CREATE_DIR_RETRY\fP enum names for these arguments. Before version 7.19.4, libcurl will simply ignore arguments set to 2 and act as if 1 was selected. .IP CURLOPT_FTP_RESPONSE_TIMEOUT Pass a long. Causes curl to set a timeout period (in seconds) on the amount of time that the server is allowed to take in order to generate a response message for a command before the session is considered hung. While curl is waiting for a response, this value overrides \fICURLOPT_TIMEOUT\fP. It is recommended that if used in conjunction with \fICURLOPT_TIMEOUT\fP, you set \fICURLOPT_FTP_RESPONSE_TIMEOUT\fP to a value smaller than \fICURLOPT_TIMEOUT\fP. (Added in 7.10.8) .IP CURLOPT_FTP_ALTERNATIVE_TO_USER Pass a char * as parameter, pointing to a string which will be used to authenticate if the usual FTP "USER user" and "PASS password" negotiation fails. This is currently only known to be required when connecting to Tumbleweed's Secure Transport FTPS server using client certificates for authentication. (Added in 7.15.5) .IP CURLOPT_FTP_SKIP_PASV_IP Pass a long. If set to 1, it instructs libcurl to not use the IP address the server suggests in its 227-response to libcurl's PASV command when libcurl connects the data connection. Instead libcurl will re-use the same IP address it already uses for the control connection. But it will use the port number from the 227-response. (Added in 7.14.2) This option has no effect if PORT, EPRT or EPSV is used instead of PASV. .IP CURLOPT_FTPSSLAUTH Pass a long using one of the values from below, to alter how libcurl issues \&"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see \fICURLOPT_USE_SSL\fP). (Added in 7.12.2) .RS .IP CURLFTPAUTH_DEFAULT Allow libcurl to decide. .IP CURLFTPAUTH_SSL Try "AUTH SSL" first, and only if that fails try "AUTH TLS". .IP CURLFTPAUTH_TLS Try "AUTH TLS" first, and only if that fails try "AUTH SSL". .RE .IP CURLOPT_FTP_SSL_CCC If enabled, this option makes libcurl use CCC (Clear Command Channel). It shuts down the SSL/TLS layer after authenticating. The rest of the control channel communication will be unencrypted. This allows NAT routers to follow the FTP transaction. Pass a long using one of the values below. (Added in 7.16.1) .RS .IP CURLFTPSSL_CCC_NONE Don't attempt to use CCC. .IP CURLFTPSSL_CCC_PASSIVE Do not initiate the shutdown, but wait for the server to do it. Do not send a reply. .IP CURLFTPSSL_CCC_ACTIVE Initiate the shutdown and wait for a reply. .RE .IP CURLOPT_FTP_ACCOUNT Pass a pointer to a zero terminated string (or NULL to disable). When an FTP server asks for "account data" after user name and password has been provided, this data is sent off using the ACCT command. (Added in 7.13.0) .IP CURLOPT_FTP_FILEMETHOD Pass a long that should have one of the following values. This option controls what method libcurl should use to reach a file on a FTP(S) server. The argument should be one of the following alternatives: .RS .IP CURLFTPMETHOD_MULTICWD libcurl does a single CWD operation for each path part in the given URL. For deep hierarchies this means many commands. This is how RFC1738 says it should be done. This is the default but the slowest behavior. .IP CURLFTPMETHOD_NOCWD libcurl does no CWD at all. libcurl will do SIZE, RETR, STOR etc and give a full path to the server for all these commands. This is the fastest behavior. .IP CURLFTPMETHOD_SINGLECWD libcurl does one CWD with the full target directory and then operates on the file \&"normally" (like in the multicwd case). This is somewhat more standards compliant than 'nocwd' but without the full penalty of 'multicwd'. .RE (Added in 7.15.1) .SH RTSP OPTIONS .IP CURLOPT_RTSP_REQUEST Tell libcurl what kind of RTSP request to make. Pass one of the following RTSP enum values. Unless noted otherwise, commands require the Session ID to be initialized. (Added in 7.20.0) .RS .IP CURL_RTSPREQ_OPTIONS Used to retrieve the available methods of the server. The application is responsible for parsing and obeying the response. \fB(The session ID is not needed for this method.)\fP (Added in 7.20.0) .IP CURL_RTSPREQ_DESCRIBE Used to get the low level description of a stream. The application should note what formats it understands in the \fI'Accept:'\fP header. Unless set manually, libcurl will automatically fill in \fI'Accept: application/sdp'\fP. Time-condition headers will be added to Describe requests if the \fICURLOPT_TIMECONDITION\fP option is active. \fB(The session ID is not needed for this method)\fP (Added in 7.20.0) .IP CURL_RTSPREQ_ANNOUNCE When sent by a client, this method changes the description of the session. For example, if a client is using the server to record a meeting, the client can use Announce to inform the server of all the meta-information about the session. ANNOUNCE acts like a HTTP PUT or POST just like \fICURL_RTSPREQ_SET_PARAMETER\fP (Added in 7.20.0) .IP CURL_RTSPREQ_SETUP Setup is used to initialize the transport layer for the session. The application must set the desired Transport options for a session by using the \fICURLOPT_RTSP_TRANSPORT\fP option prior to calling setup. If no session ID is currently set with \fICURLOPT_RTSP_SESSION_ID\fP, libcurl will extract and use the session ID in the response to this request. \fB(The session ID is not needed for this method).\fP (Added in 7.20.0) .IP CURL_RTSPREQ_PLAY Send a Play command to the server. Use the \fICURLOPT_RANGE\fP option to modify the playback time (e.g. 'npt=10-15'). (Added in 7.20.0) .IP CURL_RTSPREQ_PAUSE Send a Pause command to the server. Use the \fICURLOPT_RANGE\fP option with a single value to indicate when the stream should be halted. (e.g. npt='25') (Added in 7.20.0) .IP CURL_RTSPREQ_TEARDOWN This command terminates an RTSP session. Simply closing a connection does not terminate the RTSP session since it is valid to control an RTSP session over different connections. (Added in 7.20.0) .IP CURL_RTSPREQ_GET_PARAMETER Retrieve a parameter from the server. By default, libcurl will automatically include a \fIContent-Type: text/parameters\fP header on all non-empty requests unless a custom one is set. GET_PARAMETER acts just like a HTTP PUT or POST (see \fICURL_RTSPREQ_SET_PARAMETER\fP). Applications wishing to send a heartbeat message (e.g. in the presence of a server-specified timeout) should send use an empty GET_PARAMETER request. (Added in 7.20.0) .IP CURL_RTSPREQ_SET_PARAMETER Set a parameter on the server. By default, libcurl will automatically include a \fIContent-Type: text/parameters\fP header unless a custom one is set. The interaction with SET_PARAMTER is much like a HTTP PUT or POST. An application may either use \fICURLOPT_UPLOAD\fP with \fICURLOPT_READDATA\fP like a HTTP PUT, or it may use \fICURLOPT_POSTFIELDS\fP like a HTTP POST. No chunked transfers are allowed, so the application must set the \fICURLOPT_INFILESIZE\fP in the former and \fICURLOPT_POSTFIELDSIZE\fP in the latter. Also, there is no use of multi-part POSTs within RTSP. (Added in 7.20.0) .IP CURL_RTSPREQ_RECORD Used to tell the server to record a session. Use the \fICURLOPT_RANGE\fP option to modify the record time. (Added in 7.20.0) .IP CURL_RTSPREQ_RECEIVE This is a special request because it does not send any data to the server. The application may call this function in order to receive interleaved RTP data. It will return after processing one read buffer of data in order to give the application a chance to run. (Added in 7.20.0) .RE .IP CURLOPT_RTSP_SESSION_ID Pass a char * as a parameter to set the value of the current RTSP Session ID for the handle. Useful for resuming an in-progress session. Once this value is set to any non-NULL value, libcurl will return \fICURLE_RTSP_SESSION_ERROR\fP if ID received from the server does not match. If unset (or set to NULL), libcurl will automatically set the ID the first time the server sets it in a response. (Added in 7.20.0) .IP CURLOPT_RTSP_STREAM_URI Set the stream URI to operate on by passing a char * . For example, a single session may be controlling \fIrtsp://foo/twister/audio\fP and \fIrtsp://foo/twister/video\fP and the application can switch to the appropriate stream using this option. If unset, libcurl will default to operating on generic server options by passing '*' in the place of the RTSP Stream URI. This option is distinct from \fICURLOPT_URL\fP. When working with RTSP, the \fICURLOPT_STREAM_URI\fP indicates what URL to send to the server in the request header while the \fICURLOPT_URL\fP indicates where to make the connection to. (e.g. the \fICURLOPT_URL\fP for the above examples might be set to \fIrtsp://foo/twister\fP (Added in 7.20.0) .IP CURLOPT_RTSP_TRANSPORT Pass a char * to tell libcurl what to pass for the Transport: header for this RTSP session. This is mainly a convenience method to avoid needing to set a custom Transport: header for every SETUP request. The application must set a Transport: header before issuing a SETUP request. (Added in 7.20.0) .IP CURLOPT_RTSP_HEADER This option is simply an alias for \fICURLOPT_HTTP_HEADER\fP. Use this to replace the standard headers that RTSP and HTTP share. It is also valid to use the shortcuts such as \fICURLOPT_USERAGENT\fP. (Added in 7.20.0) .IP CURLOPT_RTSP_CLIENT_CSEQ Manually set the the CSEQ number to issue for the next RTSP request. Useful if the application is resuming a previously broken connection. The CSEQ will increment from this new number henceforth. (Added in 7.20.0) .IP CURLOPT_RTSP_SERVER_CSEQ Manually set the CSEQ number to expect for the next RTSP Server->Client request. At the moment, this feature (listening for Server requests) is unimplemented. (Added in 7.20.0) .SH PROTOCOL OPTIONS .IP CURLOPT_TRANSFERTEXT A parameter set to 1 tells the library to use ASCII mode for FTP transfers, instead of the default binary transfer. For win32 systems it does not set the stdout to binary mode. This option can be usable when transferring text data between systems with different views on certain characters, such as newlines or similar. libcurl does not do a complete ASCII conversion when doing ASCII transfers over FTP. This is a known limitation/flaw that nobody has rectified. libcurl simply sets the mode to ASCII and performs a standard transfer. .IP CURLOPT_PROXY_TRANSFER_MODE Pass a long. If the value is set to 1 (one), it tells libcurl to set the transfer mode (binary or ASCII) for FTP transfers done via a HTTP proxy, by appending ;type=a or ;type=i to the URL. Without this setting, or it being set to 0 (zero, the default), \fICURLOPT_TRANSFERTEXT\fP has no effect when doing FTP via a proxy. Beware that not all proxies support this feature. (Added in 7.18.0) .IP CURLOPT_CRLF Pass a long. If the value is set to 1 (one), libcurl converts Unix newlines to CRLF newlines on transfers. Disable this option again by setting the value to 0 (zero). .IP CURLOPT_RANGE Pass a char * as parameter, which should contain the specified range you want. It should be in the format "X-Y", where X or Y may be left out. HTTP transfers also support several intervals, separated with commas as in \fI"X-Y,N-M"\fP. Using this kind of multiple intervals will cause the HTTP server to send the response document in pieces (using standard MIME separation techniques). For RTSP, the formatting of a range should follow RFC2326 Section 12.29. For RTSP, byte ranges are \fBnot\fP permitted. Instead, ranges should be given in npt, utc, or smpte formats. Pass a NULL to this option to disable the use of ranges. Ranges work on HTTP, FTP, FILE (since 7.18.0), and RTSP (since 7.20.0) transfers only. .IP CURLOPT_RESUME_FROM Pass a long as parameter. It contains the offset in number of bytes that you want the transfer to start from. Set this option to 0 to make the transfer start from the beginning (effectively disabling resume). For FTP, set this option to -1 to make the transfer start from the end of the target file (useful to continue an interrupted upload). When doing uploads with FTP, the resume position is where in the local/source file libcurl should try to resume the upload from and it will then append the source file to the remote target file. .IP CURLOPT_RESUME_FROM_LARGE Pass a curl_off_t as parameter. It contains the offset in number of bytes that you want the transfer to start from. (Added in 7.11.0) .IP CURLOPT_CUSTOMREQUEST Pass a pointer to a zero terminated string as parameter. When you change the request method by setting \fBCURLOPT_CUSTOMREQUEST\fP to something, you don't actually change how libcurl behaves or acts in regards to the particular request method, it will only change the actual string sent in the request. Restore to the internal default by setting this to NULL. This option can be used to specify the request: .B HTTP Instead of GET or HEAD when performing HTTP based requests. This is particularly useful, for example, for performing a HTTP DELETE request. For example: When you tell libcurl to do a HEAD request, but then specify a GET though a custom request libcurl will still act as if it sent a HEAD. To switch to a proper HEAD use \fICURLOPT_NOBODY\fP, to switch to a proper POST use \fICURLOPT_POST\fP or \fICURLOPT_POSTFIELDS\fP and to switch to a proper GET use CURLOPT_HTTPGET. Please don't perform this at will, on HTTP based requests, by making sure your server supports the command you are sending first. Many people have wrongly used this option to replace the entire request with their own, including multiple headers and POST contents. While that might work in many cases, it will cause libcurl to send invalid requests and it could possibly confuse the remote server badly. Use \fICURLOPT_POST\fP and \fICURLOPT_POSTFIELDS\fP to set POST data. Use \fICURLOPT_HTTPHEADER\fP to replace or extend the set of headers sent by libcurl. Use \fICURLOPT_HTTP_VERSION\fP to change HTTP version. .B FTP Instead of LIST and NLST when performing FTP directory listings. .B IMAP Instead of LIST when issuing IMAP based requests. (Added in 7.30.0) .B POP3 Instead of LIST and RETR when issuing POP3 based requests. (Added in 7.26.0) For example: When you tell libcurl to use a custom request it will behave like a LIST or RETR command was sent where it expects data to be returned by the server. As such \fICURLOPT_NOBODY\fP should be used when specifying commands such as DELE and NOOP for example. .B SMTP Instead of a HELP or VRFY when issuing SMTP based requests. (Added in 7.34.0) For example: Normally a multiline response is returned which can be used, in conjuection with \fICURLOPT_MAIL_RCPT\fP, to specify an EXPN request. If the \fICURLOPT_NOBODY\fP option is specified then the request can be used to issue NOOP and RSET commands. .IP CURLOPT_FILETIME Pass a long. If it is 1, libcurl will attempt to get the modification date of the remote document in this operation. This requires that the remote server sends the time or replies to a time querying command. The \fIcurl_easy_getinfo(3)\fP function with the \fICURLINFO_FILETIME\fP argument can be used after a transfer to extract the received time (if any). .IP CURLOPT_NOBODY A parameter set to 1 tells the library to not include the body-part in the output. This is only relevant for protocols that have separate header and body parts. On HTTP(S) servers, this will make libcurl do a HEAD request. To change request to GET, you should use \fICURLOPT_HTTPGET\fP. Change request to POST with \fICURLOPT_POST\fP etc. .IP CURLOPT_INFILESIZE When uploading a file to a remote site, this option should be used to tell libcurl what the expected size of the infile is. This value should be passed as a long. See also \fICURLOPT_INFILESIZE_LARGE\fP. For uploading using SCP, this option or \fICURLOPT_INFILESIZE_LARGE\fP is mandatory. To "unset" this value again, set it to -1. When sending emails using SMTP, this command can be used to specify the optional SIZE parameter for the MAIL FROM command. (Added in 7.23.0) This option does not limit how much data libcurl will actually send, as that is controlled entirely by what the read callback returns. .IP CURLOPT_INFILESIZE_LARGE When uploading a file to a remote site, this option should be used to tell libcurl what the expected size of the infile is. This value should be passed as a curl_off_t. (Added in 7.11.0) For uploading using SCP, this option or \fICURLOPT_INFILESIZE\fP is mandatory. To "unset" this value again, set it to -1. When sending emails using SMTP, this command can be used to specify the optional SIZE parameter for the MAIL FROM command. (Added in 7.23.0) This option does not limit how much data libcurl will actually send, as that is controlled entirely by what the read callback returns. .IP CURLOPT_UPLOAD A parameter set to 1 tells the library to prepare for an upload. The \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP or \fICURLOPT_INFILESIZE_LARGE\fP options are also interesting for uploads. If the protocol is HTTP, uploading means using the PUT request unless you tell libcurl otherwise. Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual. If you use PUT to a HTTP 1.1 server, you can upload data without knowing the size before starting the transfer if you use chunked encoding. You enable this by adding a header like "Transfer-Encoding: chunked" with \fICURLOPT_HTTPHEADER\fP. With HTTP 1.0 or without chunked transfer, you must specify the size. .IP CURLOPT_MAXFILESIZE Pass a long as parameter. This allows you to specify the maximum size (in bytes) of a file to download. If the file requested is larger than this value, the transfer will not start and CURLE_FILESIZE_EXCEEDED will be returned. The file size is not always known prior to download, and for such files this option has no effect even if the file transfer ends up being larger than this given limit. This concerns both FTP and HTTP transfers. .IP CURLOPT_MAXFILESIZE_LARGE Pass a curl_off_t as parameter. This allows you to specify the maximum size (in bytes) of a file to download. If the file requested is larger than this value, the transfer will not start and \fICURLE_FILESIZE_EXCEEDED\fP will be returned. (Added in 7.11.0) The file size is not always known prior to download, and for such files this option has no effect even if the file transfer ends up being larger than this given limit. This concerns both FTP and HTTP transfers. .IP CURLOPT_TIMECONDITION Pass a long as parameter. This defines how the \fICURLOPT_TIMEVALUE\fP time value is treated. You can set this parameter to \fICURL_TIMECOND_IFMODSINCE\fP or \fICURL_TIMECOND_IFUNMODSINCE\fP. This feature applies to HTTP, FTP, RTSP, and FILE. The last modification time of a file is not always known and in such instances this feature will have no effect even if the given time condition would not have been met. \fIcurl_easy_getinfo(3)\fP with the \fICURLINFO_CONDITION_UNMET\fP option can be used after a transfer to learn if a zero-byte successful "transfer" was due to this condition not matching. .IP CURLOPT_TIMEVALUE Pass a long as parameter. This should be the time in seconds since 1 Jan 1970, and the time will be used in a condition as specified with \fICURLOPT_TIMECONDITION\fP. .SH CONNECTION OPTIONS .IP CURLOPT_TIMEOUT Pass a long as parameter containing the maximum time in seconds that you allow the libcurl transfer operation to take. Normally, name lookups can take a considerable time and limiting operations to less than a few minutes risk aborting perfectly normal operations. This option will cause curl to use the SIGALRM to enable time-outing system calls. In unix-like systems, this might cause signals to be used unless \fICURLOPT_NOSIGNAL\fP is set. Default timeout is 0 (zero) which means it never times out. .IP CURLOPT_TIMEOUT_MS An alternative to \fICURLOPT_TIMEOUT\fP but takes number of milliseconds instead. If libcurl is built to use the standard system name resolver, that portion of the transfer will still use full-second resolution for timeouts with a minimum timeout allowed of one second. If both \fICURLOPT_TIMEOUT\fP and \fICURLOPT_TIMEOUT_MS\fP are set, the value set last will be used. (Added in 7.16.2) .IP CURLOPT_LOW_SPEED_LIMIT Pass a long as parameter. It contains the transfer speed in bytes per second that the transfer should be below during \fICURLOPT_LOW_SPEED_TIME\fP seconds for the library to consider it too slow and abort. .IP CURLOPT_LOW_SPEED_TIME Pass a long as parameter. It contains the time in seconds that the transfer should be below the \fICURLOPT_LOW_SPEED_LIMIT\fP for the library to consider it too slow and abort. .IP CURLOPT_MAX_SEND_SPEED_LARGE Pass a curl_off_t as parameter. If an upload exceeds this speed (counted in bytes per second) on cumulative average during the transfer, the transfer will pause to keep the average rate less than or equal to the parameter value. Defaults to unlimited speed. This option doesn't affect transfer speeds done with FILE:// URLs. (Added in 7.15.5) .IP CURLOPT_MAX_RECV_SPEED_LARGE Pass a curl_off_t as parameter. If a download exceeds this speed (counted in bytes per second) on cumulative average during the transfer, the transfer will pause to keep the average rate less than or equal to the parameter value. Defaults to unlimited speed. This option doesn't affect transfer speeds done with FILE:// URLs. (Added in 7.15.5) .IP CURLOPT_MAXCONNECTS Pass a long. The set number will be the persistent connection cache size. The set amount will be the maximum amount of simultaneously open connections that libcurl may cache in this easy handle. Default is 5, and there isn't much point in changing this value unless you are perfectly aware of how this works and changes libcurl's behaviour. This concerns connections using any of the protocols that support persistent connections. When reaching the maximum limit, curl closes the oldest one in the cache to prevent increasing the number of open connections. If you already have performed transfers with this curl handle, setting a smaller MAXCONNECTS than before may cause open connections to get closed unnecessarily. If you add this easy handle to a multi handle, this setting is not acknowledged, and you must instead use \fIcurl_multi_setopt(3)\fP and the \fICURLMOPT_MAXCONNECTS\fP option. .IP CURLOPT_CLOSEPOLICY (Obsolete) This option does nothing. .IP CURLOPT_FRESH_CONNECT Pass a long. Set to 1 to make the next transfer use a new (fresh) connection by force. If the connection cache is full before this connection, one of the existing connections will be closed as according to the selected or default policy. This option should be used with caution and only if you understand what it does. Set this to 0 to have libcurl attempt re-using an existing connection (default behavior). .IP CURLOPT_FORBID_REUSE Pass a long. Set to 1 to make the next transfer explicitly close the connection when done. Normally, libcurl keeps all connections alive when done with one transfer in case a succeeding one follows that can re-use them. This option should be used with caution and only if you understand what it does. Set to 0 to have libcurl keep the connection open for possible later re-use (default behavior). .IP CURLOPT_CONNECTTIMEOUT Pass a long. It should contain the maximum time in seconds that you allow the connection to the server to take. This only limits the connection phase, once it has connected, this option is of no more use. Set to zero to switch to the default built-in connection timeout - 300 seconds. See also the \fICURLOPT_TIMEOUT\fP option. In unix-like systems, this might cause signals to be used unless \fICURLOPT_NOSIGNAL\fP is set. .IP CURLOPT_CONNECTTIMEOUT_MS Like \fICURLOPT_CONNECTTIMEOUT\fP but takes the number of milliseconds instead. If libcurl is built to use the standard system name resolver, that portion of the connect will still use full-second resolution for timeouts with a minimum timeout allowed of one second. (Added in 7.16.2) .IP CURLOPT_IPRESOLVE Allows an application to select what kind of IP addresses to use when resolving host names. This is only interesting when using host names that resolve addresses using more than one version of IP. The allowed values are: .RS .IP CURL_IPRESOLVE_WHATEVER Default, resolves addresses to all IP versions that your system allows. .IP CURL_IPRESOLVE_V4 Resolve to IPv4 addresses. .IP CURL_IPRESOLVE_V6 Resolve to IPv6 addresses. .RE .IP CURLOPT_CONNECT_ONLY Pass a long. If the parameter equals 1, it tells the library to perform all the required proxy authentication and connection setup, but no data transfer. This option is implemented for HTTP, SMTP and POP3. The option can be used to simply test a connection to a server, but is more useful when used with the \fICURLINFO_LASTSOCKET\fP option to \fIcurl_easy_getinfo(3)\fP as the library can set up the connection and then the application can obtain the most recently used socket for special data transfers. (Added in 7.15.2) .IP CURLOPT_USE_SSL Pass a long using one of the values from below, to make libcurl use your desired level of SSL for the transfer. (Added in 7.11.0) This is for enabling SSL/TLS when you use FTP, SMTP, POP3, IMAP etc. (This option was known as CURLOPT_FTP_SSL up to 7.16.4, and the constants were known as CURLFTPSSL_*) .RS .IP CURLUSESSL_NONE Don't attempt to use SSL. .IP CURLUSESSL_TRY Try using SSL, proceed as normal otherwise. .IP CURLUSESSL_CONTROL Require SSL for the control connection or fail with \fICURLE_USE_SSL_FAILED\fP. .IP CURLUSESSL_ALL Require SSL for all communication or fail with \fICURLE_USE_SSL_FAILED\fP. .RE .IP CURLOPT_RESOLVE Pass a pointer to a linked list of strings with host name resolve information to use for requests with this handle. The linked list should be a fully valid list of \fBstruct curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire list. Each single name resolve string should be written using the format HOST:PORT:ADDRESS where HOST is the name libcurl will try to resolve, PORT is the port number of the service where libcurl wants to connect to the HOST and ADDRESS is the numerical IP address. If libcurl is built to support IPv6, ADDRESS can of course be either IPv4 or IPv6 style addressing. This option effectively pre-populates the DNS cache with entries for the host+port pair so redirects and everything that operations against the HOST+PORT will instead use your provided ADDRESS. Addresses to set with \fICURL_RESOLVE\fP will not time-out from the DNS cache like ordindary entries. You can remove names from the DNS cache again, to stop providing these fake resolves, by including a string in the linked list that uses the format \&"-HOST:PORT". The host name must be prefixed with a dash, and the host name and port number must exactly match what was already added previously. (Added in 7.21.3) .IP CURLOPT_DNS_SERVERS Set the list of DNS servers to be used instead of the system default. The format of the dns servers option is: host[:port][,host[:port]]... For example: 192.168.1.100,192.168.1.101,3.4.5.6 This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. (Added in 7.24.0) .IP CURLOPT_DNS_INTERFACE Pass a char * as parameter. Set the name of the network interface that the DNS resolver should bind to. This must be an interface name (not an address). Set this option to NULL to use the default setting (don't bind to a specific interface). This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. (Added in 7.33.0) .IP CURLOPT_DNS_LOCAL_IP4 Set the local IPv4 address that the resolver should bind to. The argument should be of type char * and contain a single IPv4 address as a string. Set this option to NULL to use the default setting (don't bind to a specific IP address). This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. (Added in 7.33.0) .IP CURLOPT_DNS_LOCAL_IP6 Set the local IPv6 address that the resolver should bind to. The argument should be of type char * and contain a single IPv6 address as a string. Set this option to NULL to use the default setting (don't bind to a specific IP address). This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. (Added in 7.33.0) .IP CURLOPT_ACCEPTTIMEOUT_MS Pass a long telling libcurl the maximum number of milliseconds to wait for a server to connect back to libcurl when an active FTP connection is used. If no timeout is set, the internal default of 60000 will be used. (Added in 7.24.0) .SH SSL and SECURITY OPTIONS .IP CURLOPT_SSLCERT Pass a pointer to a zero terminated string as parameter. The string should be the file name of your certificate. The default format is "P12" on Secure Transport and "PEM" on other engines, and can be changed with \fICURLOPT_SSLCERTTYPE\fP. With NSS or Secure Transport, this can also be the nickname of the certificate you wish to authenticate with as it is named in the security database. If you want to use a file from the current directory, please precede it with "./" prefix, in order to avoid confusion with a nickname. .IP CURLOPT_SSLCERTTYPE Pass a pointer to a zero terminated string as parameter. The string should be the format of your certificate. Supported formats are "PEM" and "DER", except with Secure Transport. OpenSSL (versions 0.9.3 and later) and Secure Transport (on iOS 5 or later, or OS X 10.7 or later) also support "P12" for PKCS#12-encoded files. (Added in 7.9.3) .IP CURLOPT_SSLKEY Pass a pointer to a zero terminated string as parameter. The string should be the file name of your private key. The default format is "PEM" and can be changed with \fICURLOPT_SSLKEYTYPE\fP. (iOS and Mac OS X only) This option is ignored if curl was built against Secure Transport. Secure Transport expects the private key to be already present in the keychain or PKCS#12 file containing the certificate. .IP CURLOPT_SSLKEYTYPE Pass a pointer to a zero terminated string as parameter. The string should be the format of your private key. Supported formats are "PEM", "DER" and "ENG". The format "ENG" enables you to load the private key from a crypto engine. In this case \fICURLOPT_SSLKEY\fP is used as an identifier passed to the engine. You have to set the crypto engine with \fICURLOPT_SSLENGINE\fP. \&"DER" format key file currently does not work because of a bug in OpenSSL. .IP CURLOPT_KEYPASSWD Pass a pointer to a zero terminated string as parameter. It will be used as the password required to use the \fICURLOPT_SSLKEY\fP or \fICURLOPT_SSH_PRIVATE_KEYFILE\fP private key. You never needed a pass phrase to load a certificate but you need one to load your private key. (This option was known as CURLOPT_SSLKEYPASSWD up to 7.16.4 and CURLOPT_SSLCERTPASSWD up to 7.9.2) .IP CURLOPT_SSLENGINE Pass a pointer to a zero terminated string as parameter. It will be used as the identifier for the crypto engine you want to use for your private key. If the crypto device cannot be loaded, \fICURLE_SSL_ENGINE_NOTFOUND\fP is returned. .IP CURLOPT_SSLENGINE_DEFAULT Sets the actual crypto engine as the default for (asymmetric) crypto operations. If the crypto device cannot be set, \fICURLE_SSL_ENGINE_SETFAILED\fP is returned. Even though this option doesn't need any parameter, in some configurations \fIcurl_easy_setopt\fP might be defined as a macro taking exactly three arguments. Therefore, it's recommended to pass 1 as parameter to this option. .IP CURLOPT_SSLVERSION Pass a long as parameter to control what version of SSL/TLS to attempt to use. (Added in 7.9.2) The available options are: .RS .IP CURL_SSLVERSION_DEFAULT The default action. This will attempt to figure out the remote SSL protocol version, i.e. either SSLv3 or TLSv1 (but not SSLv2, which became disabled by default with 7.18.1). .IP CURL_SSLVERSION_TLSv1 Force TLSv1.x .IP CURL_SSLVERSION_SSLv2 Force SSLv2 .IP CURL_SSLVERSION_SSLv3 Force SSLv3 .IP CURL_SSLVERSION_TLSv1_0 Force TLSv1.0 (Added in 7.34.0) .IP CURL_SSLVERSION_TLSv1_1 Force TLSv1.1 (Added in 7.34.0) .IP CURL_SSLVERSION_TLSv1_2 Force TLSv1.2 (Added in 7.34.0) .RE .IP CURLOPT_SSL_VERIFYPEER Pass a long as parameter. By default, curl assumes a value of 1. This option determines whether curl verifies the authenticity of the peer's certificate. A value of 1 means curl verifies; 0 (zero) means it doesn't. When negotiating a SSL connection, the server sends a certificate indicating its identity. Curl verifies whether the certificate is authentic, i.e. that you can trust that the server is who the certificate says it is. This trust is based on a chain of digital signatures, rooted in certification authority (CA) certificates you supply. curl uses a default bundle of CA certificates (the path for that is determined at build time) and you can specify alternate certificates with the \fICURLOPT_CAINFO\fP option or the \fICURLOPT_CAPATH\fP option. When \fICURLOPT_SSL_VERIFYPEER\fP is nonzero, and the verification fails to prove that the certificate is authentic, the connection fails. When the option is zero, the peer certificate verification succeeds regardless. Authenticating the certificate is not by itself very useful. You typically want to ensure that the server, as authentically identified by its certificate, is the server you mean to be talking to. Use \fICURLOPT_SSL_VERIFYHOST\fP to control that. The check that the host name in the certificate is valid for the host name you're connecting to is done independently of the \fICURLOPT_SSL_VERIFYPEER\fP option. .IP CURLOPT_CAINFO Pass a char * to a zero terminated string naming a file holding one or more certificates to verify the peer with. This makes sense only when used in combination with the \fICURLOPT_SSL_VERIFYPEER\fP option. If \fICURLOPT_SSL_VERIFYPEER\fP is zero, \fICURLOPT_CAINFO\fP need not even indicate an accessible file. This option is by default set to the system path where libcurl's cacert bundle is assumed to be stored, as established at build time. If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module (libnsspem.so) needs to be available for this option to work properly. .IP CURLOPT_ISSUERCERT Pass a char * to a zero terminated string naming a file holding a CA certificate in PEM format. If the option is set, an additional check against the peer certificate is performed to verify the issuer is indeed the one associated with the certificate provided by the option. This additional check is useful in multi-level PKI where one needs to enforce that the peer certificate is from a specific branch of the tree. This option makes sense only when used in combination with the \fICURLOPT_SSL_VERIFYPEER\fP option. Otherwise, the result of the check is not considered as failure. A specific error code (CURLE_SSL_ISSUER_ERROR) is defined with the option, which is returned if the setup of the SSL/TLS session has failed due to a mismatch with the issuer of peer certificate (\fICURLOPT_SSL_VERIFYPEER\fP has to be set too for the check to fail). (Added in 7.19.0) .IP CURLOPT_CAPATH Pass a char * to a zero terminated string naming a directory holding multiple CA certificates to verify the peer with. If libcurl is built against OpenSSL, the certificate directory must be prepared using the openssl c_rehash utility. This makes sense only when used in combination with the \fICURLOPT_SSL_VERIFYPEER\fP option. If \fICURLOPT_SSL_VERIFYPEER\fP is zero, \fICURLOPT_CAPATH\fP need not even indicate an accessible path. The \fICURLOPT_CAPATH\fP function apparently does not work in Windows due to some limitation in openssl. This option is OpenSSL-specific and does nothing if libcurl is built to use GnuTLS. NSS-powered libcurl provides the option only for backward compatibility. .IP CURLOPT_CRLFILE Pass a char * to a zero terminated string naming a file with the concatenation of CRL (in PEM format) to use in the certificate validation that occurs during the SSL exchange. When curl is built to use NSS or GnuTLS, there is no way to influence the use of CRL passed to help in the verification process. When libcurl is built with OpenSSL support, X509_V_FLAG_CRL_CHECK and X509_V_FLAG_CRL_CHECK_ALL are both set, requiring CRL check against all the elements of the certificate chain if a CRL file is passed. This option makes sense only when used in combination with the \fICURLOPT_SSL_VERIFYPEER\fP option. A specific error code (CURLE_SSL_CRL_BADFILE) is defined with the option. It is returned when the SSL exchange fails because the CRL file cannot be loaded. A failure in certificate verification due to a revocation information found in the CRL does not trigger this specific error. (Added in 7.19.0) .IP CURLOPT_SSL_VERIFYHOST Pass a long as parameter. This option determines whether libcurl verifies that the server cert is for the server it is known as. When negotiating a SSL connection, the server sends a certificate indicating its identity. When \fICURLOPT_SSL_VERIFYHOST\fP is 2, that certificate must indicate that the server is the server to which you meant to connect, or the connection fails. Curl considers the server the intended one when the Common Name field or a Subject Alternate Name field in the certificate matches the host name in the URL to which you told Curl to connect. When the value is 1, \fIcurl_easy_setopt\fP will return an error and the option value will not be changed. It was previously (in 7.28.0 and earlier) a debug option of some sorts, but it is no longer supported due to frequently leading to programmer mistakes. When the value is 0, the connection succeeds regardless of the names in the certificate. The default value for this option is 2. This option controls checking the server's certificate's claimed identity. The server could be lying. To control lying, see \fICURLOPT_SSL_VERIFYPEER\fP. If libcurl is built against NSS and \fICURLOPT_SSL_VERIFYPEER\fP is zero, \fICURLOPT_SSL_VERIFYHOST\fP is also set to zero and cannot be overridden. .IP CURLOPT_CERTINFO Pass a long set to 1 to enable libcurl's certificate chain info gatherer. With this enabled, libcurl (if built with OpenSSL, NSS, GSKit or QsoSSL) will extract lots of information and data about the certificates in the certificate chain used in the SSL connection. This data may then be retrieved after a transfer using \fIcurl_easy_getinfo(3)\fP and its option \fICURLINFO_CERTINFO\fP. (Added in 7.19.1) .IP CURLOPT_RANDOM_FILE Pass a char * to a zero terminated file name. The file will be used to read from to seed the random engine for SSL. The more random the specified file is, the more secure the SSL connection will become. .IP CURLOPT_EGDSOCKET Pass a char * to the zero terminated path name to the Entropy Gathering Daemon socket. It will be used to seed the random engine for SSL. .IP CURLOPT_SSL_CIPHER_LIST Pass a char *, pointing to a zero terminated string holding the list of ciphers to use for the SSL connection. The list must be syntactically correct, it consists of one or more cipher strings separated by colons. Commas or spaces are also acceptable separators but colons are normally used, \&!, \&- and \&+ can be used as operators. For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA', \'SHA1+DES\', 'TLSv1' and 'DEFAULT'. The default list is normally set when you compile OpenSSL. You'll find more details about cipher lists on this URL: \fIhttp://www.openssl.org/docs/apps/ciphers.html\fP For NSS, valid examples of cipher lists include 'rsa_rc4_128_md5', \'rsa_aes_128_sha\', etc. With NSS you don't add/remove ciphers. If one uses this option then all known ciphers are disabled and only those passed in are enabled. You'll find more details about the NSS cipher lists on this URL: \fIhttp://git.fedorahosted.org/cgit/mod_nss.git/plain/docs/mod_nss.html#Directives\fP .IP CURLOPT_SSL_SESSIONID_CACHE Pass a long set to 0 to disable libcurl's use of SSL session-ID caching. Set this to 1 to enable it. By default all transfers are done using the cache. While nothing ever should get hurt by attempting to reuse SSL session-IDs, there seem to be broken SSL implementations in the wild that may require you to disable this in order for you to succeed. (Added in 7.16.0) .IP CURLOPT_SSL_OPTIONS Pass a long with a bitmask to tell libcurl about specific SSL behaviors. CURLSSLOPT_ALLOW_BEAST is the only supported bit and by setting this the user will tell libcurl to not attempt to use any workarounds for a security flaw in the SSL3 and TLS1.0 protocols. If this option isn't used or this bit is set to 0, the SSL layer libcurl uses may use a work-around for this flaw although it might cause interoperability problems with some (older) SSL implementations. WARNING: avoiding this work-around loosens the security, and by setting this option to 1 you ask for exactly that. (Added in 7.25.0) .IP CURLOPT_KRBLEVEL Pass a char * as parameter. Set the kerberos security level for FTP; this also enables kerberos 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. Set the string to NULL to disable kerberos support for FTP. (This option was known as CURLOPT_KRB4LEVEL up to 7.16.3) .IP CURLOPT_GSSAPI_DELEGATION Set the parameter to CURLGSSAPI_DELEGATION_FLAG to allow unconditional GSSAPI credential delegation. The delegation is disabled by default since 7.21.7. Set the parameter to CURLGSSAPI_DELEGATION_POLICY_FLAG to delegate only if the OK-AS-DELEGATE flag is set in the service ticket in case this feature is supported by the GSSAPI implementation and the definition of GSS_C_DELEG_POLICY_FLAG was available at compile-time. (Added in 7.22.0) .SH SSH OPTIONS .IP CURLOPT_SSH_AUTH_TYPES Pass a long set to a bitmask consisting of one or more of CURLSSH_AUTH_PUBLICKEY, CURLSSH_AUTH_PASSWORD, CURLSSH_AUTH_HOST, CURLSSH_AUTH_KEYBOARD and CURLSSH_AUTH_AGENT. Set CURLSSH_AUTH_ANY to let libcurl pick a suitable one. Currently CURLSSH_AUTH_HOST has no effect. (Added in 7.16.1) If CURLSSH_AUTH_AGENT is used, libcurl attempts to connect to ssh-agent or pageant and let the agent attempt the authentication. (Added in 7.28.0) .IP CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 Pass a char * pointing to a string containing 32 hexadecimal digits. The string should be the 128 bit MD5 checksum of the remote host's public key, and libcurl will reject the connection to the host unless the md5sums match. This option is only for SCP and SFTP transfers. (Added in 7.17.1) .IP CURLOPT_SSH_PUBLIC_KEYFILE Pass a char * pointing to a file name for your public key. If not used, libcurl defaults to \fB$HOME/.ssh/id_dsa.pub\fP if the HOME environment variable is set, and just "id_dsa.pub" in the current directory if HOME is not set. (Added in 7.16.1) If an empty string is passed, libcurl will pass no public key to libssh2 which then tries to compute it from the private key, this is known to work when libssh2 1.4.0+ is linked against OpenSSL. (Added in 7.26.0) .IP CURLOPT_SSH_PRIVATE_KEYFILE Pass a char * pointing to a file name for your private key. If not used, libcurl defaults to \fB$HOME/.ssh/id_dsa\fP if the HOME environment variable is set, and just "id_dsa" in the current directory if HOME is not set. If the file is password-protected, set the password with \fICURLOPT_KEYPASSWD\fP. (Added in 7.16.1) .IP CURLOPT_SSH_KNOWNHOSTS Pass a pointer to a zero terminated string holding the file name of the known_host file to use. The known_hosts file should use the OpenSSH file format as supported by libssh2. If this file is specified, libcurl will only accept connections with hosts that are known and present in that file, with a matching public key. Use \fICURLOPT_SSH_KEYFUNCTION\fP to alter the default behavior on host and key (mis)matching. (Added in 7.19.6) .IP CURLOPT_SSH_KEYFUNCTION Pass a pointer to a curl_sshkeycallback function. It gets called when the known_host matching has been done, to allow the application to act and decide for libcurl how to proceed. The callback will only be called if \fICURLOPT_SSH_KNOWNHOSTS\fP is also set. The curl_sshkeycallback function gets passed the CURL handle, the key from the known_hosts file, the key from the remote site, info from libcurl on the matching status and a custom pointer (set with \fICURLOPT_SSH_KEYDATA\fP). It MUST return one of the following return codes to tell libcurl how to act: .RS .IP CURLKHSTAT_FINE_ADD_TO_FILE The host+key is accepted and libcurl will append it to the known_hosts file before continuing with the connection. This will also add the host+key combo to the known_host pool kept in memory if it wasn't already present there. The adding of data to the file is done by completely replacing the file with a new copy, so the permissions of the file must allow this. .IP CURLKHSTAT_FINE The host+key is accepted libcurl will continue with the connection. This will also add the host+key combo to the known_host pool kept in memory if it wasn't already present there. .IP CURLKHSTAT_REJECT The host+key is rejected. libcurl will deny the connection to continue and it will be closed. .IP CURLKHSTAT_DEFER The host+key is rejected, but the SSH connection is asked to be kept alive. This feature could be used when the app wants to somehow return back and act on the host+key situation and then retry without needing the overhead of setting it up from scratch again. .RE (Added in 7.19.6) .IP CURLOPT_SSH_KEYDATA Pass a void * as parameter. This pointer will be passed along verbatim to the callback set with \fICURLOPT_SSH_KEYFUNCTION\fP. (Added in 7.19.6) .SH OTHER OPTIONS .IP CURLOPT_PRIVATE Pass a void * as parameter, pointing to data that should be associated with this curl handle. The pointer can subsequently be retrieved using \fIcurl_easy_getinfo(3)\fP with the CURLINFO_PRIVATE option. libcurl itself does nothing with this data. (Added in 7.10.3) .IP CURLOPT_SHARE Pass a share handle as a parameter. The share handle must have been created by a previous call to \fIcurl_share_init(3)\fP. Setting this option, will make this curl handle use the data from the shared handle instead of keeping the data to itself. This enables several curl handles to share data. If the curl handles are used simultaneously in multiple threads, you \fBMUST\fP use the locking methods in the share handle. See \fIcurl_share_setopt(3)\fP for details. If you add a share that is set to share cookies, your easy handle will use that cookie cache and get the cookie engine enabled. If you unshare an object that was using cookies (or change to another object that doesn't share cookies), the easy handle will get its cookie engine disabled. Data that the share object is not set to share will be dealt with the usual way, as if no share was used. .IP CURLOPT_NEW_FILE_PERMS Pass a long as a parameter, containing the value of the permissions that will be assigned to newly created files on the remote server. The default value is \fI0644\fP, but any valid value can be used. The only protocols that can use this are \fIsftp://\fP, \fIscp://\fP, and \fIfile://\fP. (Added in 7.16.4) .IP CURLOPT_NEW_DIRECTORY_PERMS Pass a long as a parameter, containing the value of the permissions that will be assigned to newly created directories on the remote server. The default value is \fI0755\fP, but any valid value can be used. The only protocols that can use this are \fIsftp://\fP, \fIscp://\fP, and \fIfile://\fP. (Added in 7.16.4) .SH TELNET OPTIONS .IP CURLOPT_TELNETOPTIONS Provide a pointer to a curl_slist with variables to pass to the telnet negotiations. The variables should be in the format . libcurl supports the options 'TTYPE', 'XDISPLOC' and 'NEW_ENV'. See the TELNET standard for details. .SH RETURN VALUE CURLE_OK (zero) means that the option was set properly, non-zero means an error occurred as \fI\fP defines. See the \fIlibcurl-errors(3)\fP man page for the full list with descriptions. If you try to set an option that libcurl doesn't know about, perhaps because the library is too old to support it or the option was removed in a recent version, this function will return \fICURLE_FAILED_INIT\fP. .SH "SEE ALSO" .BR curl_easy_init "(3), " curl_easy_cleanup "(3), " curl_easy_reset "(3)" curl-7.35.0/docs/libcurl/libcurl-multi.html0000644000175000017500000002224112272124467015542 00000000000000 libcurl-multi man page

NAME

libcurl-multi - how to use the multi interface

DESCRIPTION

This is an overview on how to use the libcurl multi interface in your C programs. There are specific man pages for each function mentioned in here. There's also the libcurl-tutorial(3) man page for a complete tutorial to programming with libcurl and the libcurl-easy(3) man page for an overview of the libcurl easy interface.

All functions in the multi interface are prefixed with curl_multi.

OBJECTIVES

The multi interface offers several abilities that the easy interface doesn't. They are mainly:

1. Enable a "pull" interface. The application that uses libcurl decides where and when to ask libcurl to get/send data.

2. Enable multiple simultaneous transfers in the same thread without making it complicated for the application.

3. Enable the application to wait for action on its own file descriptors and curl's file descriptors simultaneous easily.

ONE MULTI HANDLE MANY EASY HANDLES

To use the multi interface, you must first create a 'multi handle' with curl_multi_init(3). This handle is then used as input to all further curl_multi_* functions.

Each single transfer is built up with an easy handle. You must create them, and setup the appropriate options for each easy handle, as outlined in the libcurl(3) man page, using curl_easy_setopt(3).

When the easy handle is setup for a transfer, then instead of using curl_easy_perform(3) (as when using the easy interface for transfers), you should instead add the easy handle to the multi handle using curl_multi_add_handle(3). The multi handle is sometimes referred to as a ´multi stack´ because of the fact that it may hold a large amount of easy handles.

Should you change your mind, the easy handle is again removed from the multi stack using curl_multi_remove_handle(3). Once removed from the multi handle, you can again use other easy interface functions like curl_easy_perform(3) on the handle or whatever you think is necessary.

Adding the easy handle to the multi handle does not start the transfer. Remember that one of the main ideas with this interface is to let your application drive. You drive the transfers by invoking curl_multi_perform(3). libcurl will then transfer data if there is anything available to transfer. It'll use the callbacks and everything else you have setup in the individual easy handles. It'll transfer data on all current transfers in the multi stack that are ready to transfer anything. It may be all, it may be none.

Your application can acquire knowledge from libcurl when it would like to get invoked to transfer data, so that you don't have to busy-loop and call that curl_multi_perform(3) like crazy. curl_multi_fdset(3) offers an interface using which you can extract fd_sets from libcurl to use in select() or poll() calls in order to get to know when the transfers in the multi stack might need attention. This also makes it very easy for your program to wait for input on your own private file descriptors at the same time or perhaps timeout every now and then, should you want that.

curl_multi_perform(3) stores the number of still running transfers in one of its input arguments, and by reading that you can figure out when all the transfers in the multi handles are done. 'done' does not mean successful. One or more of the transfers may have failed. Tracking when this number changes, you know when one or more transfers are done.

To get information about completed transfers, to figure out success or not and similar, curl_multi_info_read(3) should be called. It can return a message about a current or previous transfer. Repeated invokes of the function get more messages until the message queue is empty. The information you receive there includes an easy handle pointer which you may use to identify which easy handle the information regards.

When a single transfer is completed, the easy handle is still left added to the multi stack. You need to first remove the easy handle with curl_multi_remove_handle(3) and then close it with curl_easy_cleanup(3), or possibly set new options to it and add it again with curl_multi_add_handle(3) to start another transfer.

When all transfers in the multi stack are done, cleanup the multi handle with curl_multi_cleanup(3). Be careful and please note that you MUST invoke separate curl_easy_cleanup(3) calls on every single easy handle to clean them up properly.

If you want to re-use an easy handle that was added to the multi handle for transfer, you must first remove it from the multi stack and then re-add it again (possibly after having altered some options at your own choice).

MULTI_SOCKET

curl_multi_socket_action(3) function offers a way for applications to not only avoid being forced to use select(), but it also offers a much more high-performance API that will make a significant difference for applications using large numbers of simultaneous connections.

curl_multi_socket_action(3) is then used instead of curl_multi_perform(3).

When using this API, you add easy handles to the multi handle just as with the normal multi interface. Then you also set two callbacks with the CURLMOPT_SOCKETFUNCTION and CURLMOPT_TIMERFUNCTION options to curl_multi_setopt(3).

The API is then designed to inform your application about which sockets libcurl is currently using and for what activities (read and/or write) on those sockets your application is expected to wait for.

Your application must then make sure to receive all sockets informed about in the CURLMOPT_SOCKETFUNCTION callback and make sure it reacts on the given activity on them. When a socket has the given activity, you call curl_multi_socket_action(3) specifying which socket and action there are.

The CURLMOPT_TIMERFUNCTION callback is called to set a timeout. When that timeout expires, your application should call the curl_multi_socket_action(3) function saying it was due to a timeout.

BLOCKING

A few areas in the code are still using blocking code, even when used from the multi interface. While we certainly want and intend for these to get fixed in the future, you should be aware of the following current restrictions:

 - Name resolves unless the c-ares or threaded-resolver backends are used  - NSS SSL connections  - HTTP proxy CONNECT operations  - SOCKS proxy handshakes  - file:// transfers  - TELNET transfers

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_getdate.html0000644000175000017500000001155712272124467015430 00000000000000 curl_getdate man page

NAME

curl_getdate - Convert a date string to number of seconds

SYNOPSIS

#include <curl/curl.h>

time_t curl_getdate(char * datestring , time_t *now );

DESCRIPTION

curl_getdate(3) returns the number of seconds since the Epoch, January 1st 1970 00:00:00 in the UTC time zone, for the date and time that the datestring parameter specifies. The now parameter is not used, pass a NULL there.

PARSING DATES AND TIMES

A "date" is a string containing several items separated by whitespace. The order of the items is immaterial. A date string may contain many flavors of items:

calendar date items Can be specified several ways. Month names can only be three-letter english abbreviations, numbers can be zero-prefixed and the year may use 2 or 4 digits. Examples: 06 Nov 1994, 06-Nov-94 and Nov-94 6.

time of the day items This string specifies the time on a given day. You must specify it with 6 digits with two colons: HH:MM:SS. To not include the time in a date string, will make the function assume 00:00:00. Example: 18:19:21.

time zone items Specifies international time zone. There are a few acronyms supported, but in general you should instead use the specific relative time compared to UTC. Supported formats include: -1200, MST, +0100.

day of the week items Specifies a day of the week. Days of the week may be spelled out in full (using english): `Sunday', `Monday', etc or they may be abbreviated to their first three letters. This is usually not info that adds anything.

pure numbers If a decimal number of the form YYYYMMDD appears, then YYYY is read as the year, MM as the month number and DD as the day of the month, for the specified calendar date.

EXAMPLES

Sun, 06 Nov 1994 08:49:37 GMT Sunday, 06-Nov-94 08:49:37 GMT Sun Nov 6 08:49:37 1994 06 Nov 1994 08:49:37 GMT 06-Nov-94 08:49:37 GMT Nov 6 08:49:37 1994 06 Nov 1994 08:49:37 06-Nov-94 08:49:37 1994 Nov 6 08:49:37 GMT 08:49:37 06-Nov-94 Sunday 94 6 Nov 08:49:37 1994 Nov 6 06-Nov-94 Sun Nov 6 94 1994.Nov.6 Sun/Nov/6/94/GMT Sun, 06 Nov 1994 08:49:37 CET 06 Nov 1994 08:49:37 EST Sun, 12 Sep 2004 15:05:58 -0700 Sat, 11 Sep 2004 21:32:11 +0200 20040912 15:05:58 -0700 20040911 +0200

STANDARDS

This parser was written to handle date formats specified in RFC 822 (including the update in RFC 1123) using time zone name or time zone delta and RFC 850 (obsoleted by RFC 1036) and ANSI C's asctime() format. These formats are the only ones RFC 2616 says HTTP applications may use.

RETURN VALUE

This function returns -1 when it fails to parse the date string. Otherwise it returns the number of seconds as described.

If the year is larger than 2037 on systems with 32 bit time_t, this function will return 0x7fffffff (since that is the largest possible signed 32 bit number).

Having a 64 bit time_t is not a guarantee that dates beyond 03:14:07 UTC, January 19, 2038 will work fine. On systems with a 64 bit time_t but with a crippled mktime(), curl_getdate will return -1 in this case.

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_slist_append.30000644000175000017500000000417012213173003015650 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_slist_append 3 "19 Jun 2003" "libcurl 7.10.4" "libcurl Manual" .SH NAME curl_slist_append - add a string to an slist .SH SYNOPSIS .B #include .sp .BI "struct curl_slist *curl_slist_append(struct curl_slist *" list, .BI "const char * "string ");" .ad .SH DESCRIPTION curl_slist_append() appends a specified string to a linked list of strings. The existing \fIlist\fP should be passed as the first argument while the new list is returned from this function. The specified \fIstring\fP has been appended when this function returns. curl_slist_append() copies the string. The list should be freed again (after usage) with \fBcurl_slist_free_all(3)\fP. .SH RETURN VALUE A null pointer is returned if anything went wrong, otherwise the new list pointer is returned. .SH EXAMPLE .nf CURL handle; struct curl_slist *slist=NULL; slist = curl_slist_append(slist, "pragma:"); curl_easy_setopt(handle, CURLOPT_HTTPHEADER, slist); curl_easy_perform(handle); curl_slist_free_all(slist); /* free the list again */ .fi .SH "SEE ALSO" .BR curl_slist_free_all "(3), " curl-7.35.0/docs/libcurl/curl_global_init.html0000644000175000017500000001016212272124467016265 00000000000000 curl_global_init man page

NAME

curl_global_init - Global libcurl initialisation

SYNOPSIS

#include <curl/curl.h>

CURLcode curl_global_init(long flags );

DESCRIPTION

This function sets up the program environment that libcurl needs. Think of it as an extension of the library loader.

This function must be called at least once within a program (a program is all the code that shares a memory space) before the program calls any other function in libcurl. The environment it sets up is constant for the life of the program and is the same for every program, so multiple calls have the same effect as one call.

The flags option is a bit pattern that tells libcurl exactly what features to init, as described below. Set the desired bits by ORing the values together. In normal operation, you must specify CURL_GLOBAL_ALL. Don't use any other value unless you are familiar with it and mean to control internal operations of libcurl.

This function is not thread safe. You must not call it when any other thread in the program (i.e. a thread sharing the same memory) is running. This doesn't just mean no other thread that is using libcurl. Because curl_global_init() calls functions of other libraries that are similarly thread unsafe, it could conflict with any other thread that uses these other libraries.

See the description in libcurl(3) of global environment requirements for details of how to use this function.

FLAGS

CURL_GLOBAL_ALL Initialize everything possible. This sets all known bits except CURL_GLOBAL_ACK_EINTR.

CURL_GLOBAL_SSL Initialize SSL

CURL_GLOBAL_WIN32 Initialize the Win32 socket libraries.

CURL_GLOBAL_NOTHING Initialise nothing extra. This sets no bit.

CURL_GLOBAL_DEFAULT A sensible default. It will init both SSL and Win32. Right now, this equals the functionality of the CURL_GLOBAL_ALL mask.

CURL_GLOBAL_ACK_EINTR When this flag is set, curl will acknowledge EINTR condition when connecting or when waiting for data. Otherwise, curl waits until full timeout elapses.

RETURN VALUE

If this function returns non-zero, something went wrong and you cannot use the other curl functions.

SEE ALSO

curl_global_init_mem (3) curl_global_cleanup (3) curl_easy_init (3) libcurl (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_easy_getinfo.pdf0000644000175000017500000004160112272124470016257 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ¥XÛnÛH}÷W4°¡«Ã滋<yã_´=ÀÀY4Õ¶8¡H…;žoØÞSÝMŠ’d“A€È ›ÝU§ªNêOÌæ‚ÙôÏüfëƒwW!{hlöpðé@¨—ÌüdköS‚=Hîô7‚… c—G1KÖBD<,y:¸±²®.neÚ<ß>È6/ï«–ûaŠüŽÞL¦ŽosÛ­ó´ìÒ‚½¾|òŸä_S›;ûg8>Æñ<öÉ7`ÉÙuq4y‹ñVøÜ]X•,¬óÙ$ù}d¯csÏÙT8ôÚþ‚lÊäûÀ0×úÜÖiÖ2z^¯Ó6¯Jv_Wk–*cÙ*-—…TîØ5…aSðHÙ±øíâr¾8]hkbcZ¢,±þ’—YÑ-%û;íúŽþã«ÐrÇ#“·7ÖñõÕYVa;ÁÇãqä{à¢Eì-­8dô÷éÅÉ%ë×ÄNhU‡ŒsÎ>Lþö£Èýólq|u:ON//vQÜÚ-¸ï†„¢u%?u²!œZY—å ÀÚ•¶œ5²ièéSÞ®ð4oØ}Wf´+‡ãÛŽ í¨ý|µõ’¥5­BÞˆ~•õЭeÙîëqÛõã>®Éž ßáN²”ÞO=ï"oH˜¢ÜTÊ5ÖV}Q•‡øÝy˜­Òš½}ñ¸ië ¤‚Ö90z˪zÕ²êî É>Xi£1YVY7%“È3""eyªQ]Ê&«ó;IøÕ@·Æ7¨á8¨í—ÃýÕSùaÂ@¤=Á½ oØx™¶½MË)lzÊ‹‚—ÿ…\"œ,Ͳª^æåCñÌõ,KKz_Ë"Ç‚nS• A¸<ØÖa ë¬*ña~¯¡8¾n»ºlT®În/á“©/B*a뺑»éÁŽN’Ù!'kJ.œŠâ,›{¸Ž}Ÿ«Ž=Mb*×·Ò²%dQ!*Ï­~%r¸OLáÚÜuãÈdÀ´"ë5…ØQ“6ë©wÈ¢ü ÿ|îŠ-—aí)LŽ~eGƒCí,œf7ÖéÙÑOg3Ftu~4‰Á@¡ïXŠP4÷ }gx8Ý$Í*÷ûª€Ùü~l=!ñvHŤ<7̦™Z.ÿª6×ö¢5ô,x;;9™'§¿Înñi0„cËÃótð(æ‘o̯ÕúèI-3™+ûM…çsP‡©1W!öˆÐnSÀã~Ðç†A ^)¢k5¹%í{‰˜÷Ôû‡w^ì~½Ý=lA^é;qÄãQ_°¹š-æ—‹Ùíñåϳ?¾¸$Ôùð%¢É/ ƒ°ºNÔoš-v ižØ?¦Çèå¦è žöiý¨¸ÎEιÚbç™—Ë÷ãcÄ ’d¾ó^C¬Ã“íWÚËÖ/Ô1HæÄí‹süÖ²%‚èg÷æŽïó(µÐ8è r£[qXl;.õ‚M-u„õ˜W]ƒÂþXVó'ðr3túÛ÷p@ÅÛ¨,¢UòPq¶Lk°u­RÉCUˆC—{=l<Ùúèr;4)léÖA*La=u£€ûþÀóÖã89Äjp)QùWtrè*Ⱥ"Ò.+èúQÑ—ð ©³Vƒõ²4ñÞ©Ç…Tˆý€Û¯›³‹ª%ZM[JѺúüüF‡ÙÕtù|ئ9;ýóË‹ ЇÁE=GFZƒÕ&sÕÓ¥R9Zy»g;äA™ì‡NÒWá˜!!ªû,¥HR³ †` ; ¹ã MhÑm6Un²ŸŒ(ÑåR·s|Ìõç;bõ«ýÒü ¨ðY~…<è‡-÷é´0 y/16ãzî §ôØKBe¾A¯”Ô5À{Gí¿‚ÞÉéÙ,9=ÿ>ÔP-¾ûlŠv L)ü×DÊ:îþ)+ÊÒµ*Ž|-Y¥ÕDÏ^„\üåïq«ë{¯ ºë»ñöTMá¶$N v‘‡e·¾ƒ‹8º‘ÙTƒ]}w«!}×|X.Ö`V’:‡qhS2“Õÿ]á¼Ê>f@ýÿ€Â\â(z•œAœÑAÑ yÛªM M@, ÊüÞÔR@&=”ÂljAè±E@Û ¿¯…Ã|89"÷:Fݳ #LßÃ4c»»¼L×DMU<æ4æ'ÇsddY"#©^vÌ›m¨.&®™ÃŽÎgg——¿\Ïu0vtË·5µãF?hˆ`{wòz";Œ¶Å}# Ž" Ø²­ªÛû›¦MÁ#æJ]»•N^Èñ»7kˆÐ´ jŽƒœm ‰IkX^W¦Ý¾Ìåo÷P‹ÊbŸ‡Ñ0²yf“}¼Jý ðúœj+!”OíAØn;ôªj¨e¢,”‚ªÿ? GóùŸÀÔÜÃ}/¤ Q=ç¼tD¤ý)?èbqön±xoÐÄT9HtË`ýŽ®k›UúQ÷ûP5Ñ•â÷71²¸!¦XX•n@úzòp¸ÈAÕyƒ£'7'ˆö‚2 €ƒ-‹†@CtèPôIußb¶1ÞvПY‰)ð„O:ž±Çí`Ü•½P_JίfÉÕÑÅâdveSåÓ%Ø0y¡¦Ï™Üè‘ KihºlEÃ#É|¶É7Yä¥*Ö•4 uCJÐôTev¦¥ÒÔœ°›«PUKY¤ÏtOÖ©Œ’·žIK¹¥ö\)•¢X£‹ïµFºÄè¯ÿCL7»ÌýÐh´¹7A¸!3-!؉¼cŽmÇzÂ&&AVÏ’ƒãßÿK¼É¡endstream endobj 6 0 obj 2527 endobj 14 0 obj <> stream xœ­YÛrÛÈ}×WÌ›Á” c÷¼)6+%KZ ÊV"§T 8¢° 4.Ò*ßàÎé @Ò”l)[*[.Ó=§»OŸ~eŽÍ™C?ýïl}ôn²Usä°ÕÑ×#®n²þW¶fKð@D’Û#ýg¡`aìÚQÌ’õç‘p–<][YW72moV²ÍËÛê‹å~™°"_ÐÉTøŽí8¡õ9-»´`‡Ÿü'ùÇ‘°)þ%Ë#ëýÕüôäìãùÍÅ|–ÌÏ.?Îæ7ÉÉçÙ$ùíhŠø,ÉÔ \¨.RºãÐÕØŽ|¸Œ«Žíú!yi5 KÙ¦ÊËVÖ¬­ðDzꅤϵÌd¾³.{±Y$è¹ÇãƒîÙ±÷íÜá‘|-ß²¼d̪rÙàs 3Õïì¶®Ö¬Å#M›Ö-ëÊ6/ÔßßÈ‘:-›©rƒûÜŰ7ÇŽ_c} ïó†ýÖ5-KUG ³…œ3‘ïY«¼´Yr‡Gò2+º¥Ä¶‹‚mj9UëÓûYµ^§ð‹á?VJ¼#l/0›‰@mfUµyÚæUÙÀËk¸¾‘ÚÉþ•ÁG—Gê¥,ÿ–‘W´¯ ¶™g]‘Öp¡j«¬*¾X ’#/{¼…†Ò¡¼RÖ­ûj;ýÅâž.†và:޹&—6;iGÙÐÍwsîô)ëyväzýceÕêÛCBû¶›Ev m7 <㉰#Ún¶ïÒVz éÝÐlŠb.Ëe^®Xu«¡éñ˜¢„™òCø®=bªc^˯D¼UÚ:_­dMÙl:ñûàÛ*”SUÆ×c!]&”¯ƒÜ²Žç“À¡±•ì—Zàç«ËqýWU—gñX¢ý"ûÕ8>ß7ôÊòªßⱕ¨]`^L¾˜Ýp÷#‡›DtqO# ¢8êóëÚZ.&^Àm7ö¬ÇB!¨v B°^$ôSÂæô.v Yq¿HŸ¤;U¤iÑèz¢½Óå«ïÛ^ñ½lid}¯éÀã¢QJ‰RG²´ JlÕˆJÓíŒf>ûp2Ÿ½O^N»Ã÷^“® NÌ"A¿ÈnbøxÄö 8U‹öòLzTµ"ÃZ.sØ&^C¦ÈMŸ~l‡Ž0C¥¸‘F´+S€_`¥nó$Z–Xã-QëÀ¬«á…„Aä^INÑÅT›|˜58qd¥ÎT™ŠY>Åžxèª=Ž™nÓ\q²$2ßA•“7#Âõl_ô¹gý!·b´•ºdI£—uÊ5•^Ó¹‘cÝm¬[3” ÀÅNÖY_¬ãåR. öÐŽèçªE<ŸWïϯΒ&–àü‰Ä**ë|ãÚ^š%ü~‰ý´ #'ÍìfUÙ­0îÞFDSòƒD˜\ˆ›âð…êšZ ˆpF t{Ý:‚‰¡¢­‡ª+–» [D6`3P¶éït›˜"ÐѷƦÑÊÇÑ×vƒ^ÓXUGÛÊoÙ#>=Ð3 ì{|¸¯­"@¢¿¥k„Ö¹–,S".ŠÃùEróñüôôœÞàé›u~==¬üƒÊðM‹HNÎÏzÊÏÒ’ŠV²ûA´Éú‘Ý;í]^þκ†äùBуp!¸C]^´½ côб"m'ê[MiDø=ªd•ghƒå-cüÈÓj%ÆGV»Ú–1n`Pº¶ªjÉdYu«;Åäìb"”¾w-¨Q®&3³ã <Ò©G8ƒõr-JoûüÛÑ`1”Iü¬ÌQ*D{k‰_®4 .Œ€Îv ‹èž\§´kTï·UW+FÊ7JÙà‰æ›<¼1À0àŠq~j³‚Å($úŠå1åÂaùuòïÙÍÕr™¡à:þð2¹õ •å"ë Äò´³Ëw麂|"ÄH6m]·)ªtièŒGÚáÓþ@Ûµ~=ë·Í½àÅÛvlÏy•˜ÿŠ02‹„Î!1 Ýh4äê–ÿ8,«‰ @z±õPö ÂeÿŠÞ#÷ANŽØ“h`ªT­¢VIH¢Œôý¶Œx  Y(&1x­&=ßBçW/Ê4»3Ó[Ÿ¿c£?ðèÖ.é~_ÀOÍ •èá8^Ìfþœ@¾N‚þ…k–€ª=Øx8wâÑÌнÓÝ¥4.¾«ê¿—EÒJ˜@&À4¨¡æU (R]Ë´éÀ¬C ÁëÓ>ð`1ñ]àµRë3‡¦/½°Í>›•\•hï´zýÁD§"óq 87~í‰/FÄãÃ$Q`ÐhèPT¼0üAPtL4ùüT Öš£BLbÜÝí z¥çZ}šÀxF÷ÂÓ(<%ÀžQ¯p€Þ3R^žº~<š vé¼Éÿ+‰ÄL?¼“ૺ9dÍãj úA4öä±ÐCoÜR¸~èõ¶¦ýS‘u5»L4¬/=‡ˆ^1Ð9P8àE‡ˆ3¿ÏÅž™ëï%Pó¦éG\Ó˜C^ÅnÇ¡¯ÉÿS’\ô|á‘z‰ØÁ“,uV©¹€hÑuúHÍaM&®–XRÃ$"µ85D­5)tªÒ¡äQ[wòÜryzóÏÙüäã¿æ³Ë«ÓI,°VXÉËBƒ)ÀyÍÀêàã°áæü8ä|ßÌp´a¢’ɺͿeê“©³;ZÝu·mYÏé6¯bÆcŸõ\¹Ôû¡RûcÜ(Ù͘0Ⲟ³j£×¯öf A$hÓxBŽÞ7ôùÎH„öâ¹ÃùÔ—I_].Gƒ> stream xœ­ZÛVÛH}ç+ê-r¯X­*Ýç!ô43bz&+Ìb »Ô‘%G’!ô7ôGÏ>uÑŤW.€,UË>ûìSâ+ó\Î<úc¾ÎW{?ŸÇìs³ç±Ï{_÷¸ú™/óûû 7$ta¶ÜÓÏp §¾›¤l¶ÚãüÀ —=àÃÝ€D’noGaí—ÖQÎGM„ëE‘ñì±t:-j$k3–5M5ϳ ºËцhEÕ¨U¤#ôõ¸c#ŽV¦a“• 0é¥Ó¶Ýs”‡Ó³ÙÃ4ðˆ2–ŒÒ ]‰©¨F% ƒu›W%|¦>çžÑ#>@àùöé^MÀ°jÝj1¡ž°&N‡¸œ¸ì¬À’•b¢°»¬je¾ï¡4x0pߊ•€òµßTeóvМ=èæÜ±;b›5[ÀPu€Dº|¡#Rn½xÛ'sWx¼CJÚioªÍç&—*”b¨%Hn nÔ}ºßÊ$ÄÅ=»–yù–¾±ˆR=É ÃîñjXæ"Xá§7º:‰O¸HÆìÒÙ_ç%u?Ï5Y™ª¾ò ŒÍÎŒ¡r9󒾌/úð A‰UW´Ã¾Á¯ &èºãoûǼþ¡£ãqñ§x&L“çÊŸÇÁ#å_Tá«¢ïYeŸ±ëníQ£ØÚ(oWYó\äó¬¥4ä² þ/[u å±’Æe Å=æy±Þõ‡GY!/2($j‘Rç'D¬Â¨¯n$u(²Á´Ûë¼U-U¢M9ßÖE–—:ÛCZPi5 WçUøà—äù´²JW¿)ÌAùGÜ _[û¯Lø4Z“'Ñzvné>ï·8ý¯Á£f:d¶›ð@¤5æÇ}6p ›wâú/A4é=/~ÐÑ+à þèpš>‚å´‹†Ý㇑º`ŸArOåaJ#Ë0ÍPaÕ¦&‘òí~kw’ìž·z”Ù „ÓW‡çç'§/Tξ—¼"ô0È6yÄÕ,1› xÄl£³¬ë²Î’u®£E"6#A]¢‰°¥ò–ûh¡—@·Õ{ey±©A'h›´'$M""ñ`»N šî¤¶;šX¢õ‰8ÙJMU¢‘¸ ªŸp£3õžJ"ƒlаºi³Æmk6ó¹lšå¦aÈúñTbǧSyrñž†¡“Ãه¦3HÓ…O¥31ùý˜Ð¥óf ý˜BÕ—œ¹¯ºc«¾äTZl»uVêaQݺÝðïËñêt[÷¤¼cóK X-î'_»±Â ¢ÜØóvƒY>Î!ŒZ5jgó›\޽ÀGI²ÃÛñ¨Æ–Ñl7J"·oFκV—av¯nÐY„Ñh·yµÁUc”Z"—Sjžêqb Ž\Õ4Hn­4!@CÝ œƒju­š©\™¡ø„@´ç=xÎßMµÁ@–דç€`uq2·¥R?ô;xä«€ÐXHfeæÐâKYédFtTQŒÙnp·…ÒKÈ,¹”€fí1RÌâ[Hdéü-[¡ˆW²A`D¼–jü“Ýû-oëëØOÍ¡Dšº¡ßimòÃLø„/Ý0[¢æ)9`’$‰RÚ™Û‘®5«åv²x‚xY‚úµ€A ¥›©+ð Òä ŽÀŽn®¹+†ãey ÓøttÚ:G¬°Þ*SG6Ìq/ ÔSD`¤KÀi b‡>eq«\%˲q…yfÏü;{CÙšQÓ8™·¢TŒNGpVUh ,}Zý.(§ñÎC= ï÷Ï'%=LWGg/=’õRñ#6Ä–Ù¥|³Ô6ÉD‘U0ývã;cȺšâ§U^ª9¹Aß›ªXXñr¤çSÜû^æò”ëf¹X S5V.¯ª¦U62ÉU)í47Œ©£@ÊøpÌcUÉÆ^Œñt8§›#/c÷*£9&ßFú7kÕ¸G'ÈhÏf‹ÆÀX0êÒóç'G–ÄJ ÝþõÔlO±¶Rµ’«ª¾'"Ëô}wyQµœ*bÀ¥r@˜¯‰5­©5¶=6,¥Ô-¦ZOÞØ£¤ ÚÉTÃSP"~\¹ÝAW€öZÅ­ô½”k•z Q¯´|`cåi•B£–ÿ.ðŸâ'£bf/=цÐ~…¤ •ÜñtÀw1˜¾Ò4ü’Z quøözÜNyJ:é½»qßÀG¸_p|ò2 õ#;¤ÛñéÁþñÕÑÙ(ßóÖ€¿žkÀÂïYêỾ½Û+¨¦¨æYaØÆwS‘ŠÓ [b²™K´Ì£3öp†ZêÍ‘@†SëÜœcNo#XôG ~ª¡ù€èíbj ÂNö:¶YÑ‘ÒJZIZnšQÉg+¢²Ã´Ël½†*Éš‡g‰<]H6KÛÕ õ&~з22PÉê–Ñy;KÝKg€µX$Ü·gÕf6чz™8Búp>ù´rb ¶i*â—³Jðš‰_½d´8vÃ|0ðQ‡s…[6€æKˆEã=ðé<Ùºõ§ˆS>Õ"_J31ÉáÝ4spzú¯£Ã㣳—èú0ðo&a¨[àºÁ®DjS@ó±ŸÞô)%šÇ‘Ëýî( ö‡Š½ …Ö÷ûÊË/frŠ’A²¬er1U{"9YA3Rõ…뾫!¤{AÝ rúQ`Љ‡oë¼ÖrêÇ4/ Ê=ôC3;J:6¯*:‚Wé·št@¦¼ŠbüN·ËaSçÝ;XGŸî$ }ȃº6Ú5¿¡ ¢zµ¬'~Dõ#Ðü¯àlÿÛƒ9  Âî >ô#{²TSœ²%¥0o1ü6 9Yª^˜S¢ÐwÃ$uŽÊi”«é=ƒN ˆ¡¯g?¡“ÃÁ6=%è·Ä“)1:Àý/òš ÏKõ›ƒÈR‰OÎÎöþ?ÿªÑæÇendstream endobj 20 0 obj 2906 endobj 24 0 obj <> stream xœÅXÛrÛF}çWLåE`JB0¸#yRdfW±B9"³[)yK‚#k PŠò ùè=Ý3¸Rì8/[vY29Ó3Ý}úôéù([ ‡þ˜ŸÙvòÍM$š‰#&'’¿æG¶ß/± ¦–÷½GŠÈQâÙq"–Û‰”±J±|šÜZÙ¾.îTÚ<ß=¨6/ï«÷–÷~*Š|EßLÏÜÀ±'²~JË}Zˆ×—Oÿ³üq‚#μP,×Çè—§‰•UÕ‡\5â}ÿÛ}U‹v£Ä&-×ý˜.ÿ;9ƒsXfé%¶—àÆl%ö¶ò¨DIË^ÙžtK³¤jÅJ©R¨2]j-pJ“owų(«òå1¾c»ò•cVŸ9†Ž¨U¦òs^h;‰o® 3½‘Ävã$öÍkÄõ„¾“¾-ý~}ÓÖû¬eƒ^äÙQ,ΤËÇêRÄ›"oZñõ‰xÊ‹žŠFµ¢­Ä®ÊKþeþËÕ•0Ÿ¯×ð>/EdÓ)H Û a3´c>ïâ—›«Ëù×wWç‹åâúâílyäMwë]:r%6Ѷx|µ¦©¾‚ªé©(ªò~{#éú¶ËÎDhL æíóÀN\ïø€¥Há}Seh©¨†á°Ê×@F@ö |_=_yÃHE˜š&¯J[\Þ3êØFb'I ]ÚueÅè=“Ibnçºo{À3&ŸàßãÔ lGº®•ùú iw­Ú}]ªµ-þ½6ž«½ø£Ì›xb«®+íØ5—%›¦êªúCŽH=åíæà^1€†{²¡í^giQè v¶:tØIášÌ …2ݽ·€´´A<¨dQh¢€¯¦¤EVTNED]T],ýìI˜h°·¼×¶Ôp¸©öu†JNìÏÏ8Ës7‰zàèYi‹”ônꢷŒ„¿íó.'ŸuêÛ¬Ú®ò2m‘4ÞFÖ¿¹‘Ž¡37sEE· åëwË»‹ëù|v±¼»ž_M]â«$¶~娘Œ ¸,[—1päa½ÖP`»º†\Àìjbͯ§'T¿Ž—Ä]¼|ë¬.gßjì¿»ÔÐj/öïi*q/™]êÙ¿2ôOÁSe¦ó¡‹‘¢¢úïÉþ]åH`Z³O@¦té²”ö%í ð|¹µž69H6otÊ'd±*q'Ï%³­á5æˆÛ$~X¾»›Í—7ÓÐï‡Ö¯wïLÁØRrÕJŽáë|9T³ ŽM:–ûçœ%…øò“Lã€&þ„h²MZ?y…pиü¨ÇtOñ0ÔEí9òè´ñ9 gÊÖ¦*Öô“²´KæJó‰*Ûú™?ш’qFJÔut‰.7)“ íÉ˼ÍQ—l§+JUæPe€Ý1IQ=<œà"´¯VÛªU ­Õtžç¹vè Zªf ÚšM"¿Û!~”°¦ì6\›¶ª© 5$Ö‹‚Ú 1Jñüä±U;® O5uÜÛ×µ³üúÖ:/š U@çKª@kûÃ%@¶ýO¢ñb :Ö’þ£þÕ®…ê M§x‰¦“iÊñL3Ö2'S5Kê»D„àävÀM¤…6ü@ ¤}ÑŠ‰–RN¸¡ÓÊýv¥tõžñz¢ ‚À´„{€¡üÀ#¸—W‹»Ål±¸¼ž¡âç|‚»|ŽþwµEc¨Ëžž…IŒà„«ÛÛ ¦å¿Ã î£÷ƒaMžxþŸÍ*ƒà°ert8_!G˜"DSQqöò¯íÊ"‹dÕimôàxVl6©ÖªÐ!-HXð˜OÇí ¤Úñ….usc–,]¨Ñòèöh”sF£QòÁ¸¶ìDYÏ éíCu{³° âQuñLÎŽ†¦ Œ óÑ4I4‘ÞÔQ5ý5ó6}fæ¢Ìqˆ)]TÃF£æ@9 :çz"20eL¶O—äãgXº —¸UæD ”žû}Íc 3Ac¦RwÉÐãüÐÓ>ÀyèÝ=82%_øEáQóbò\ÅWeZð˜_Ò… äqÿ3„ØxŸ¡ºŽöÂP¹ÎYY¥z""üPvàü¾3Â\ó¤IϾ4¤€¤ô–ˆo0²°]z^'Ä Xö}çÏ@2Å~/¥/Ôy˜»Ãz;›¿¹›_Ïg'”~SDJ×™Áº‡i̼tvØ·ÇtlÑ ‚ÎÁº›!Ðå¼£‚bÝ»öNźRzºÙb4Ô—Õ«nÉGc-¤4)¦‡YÊ< 1kºñ1kb¸{s¹gÞý2ÿé ß*Ð ÃðËß*Àäá e’0zõ­Âõ¢atÐknéµB‹=!I%›VºÎ»Ôǹ¢ q÷îº1‹«àPW™)Ë÷í(¥u¾.OŒB®5¸a?ÄXíö5î0¦ºžÉQï­F©£á'tzâìôãòò§YŸ½c©CÄɬ?µÅy‘6§Úíþm„â.Y•~(«ƒ‹K/™và|ÅÖÞèÞú)ÁÀ›&ê33©è¦3<ˆ˜i«©ôKL+BÏD.ìõ.¶ã¦!ã¨yLœþ ¤M¦rá×Je)Lzòà­b‘/Wv$ÔÞ@Ȥ×nûâ°Á:´ð jµ~*ômßïgýýÄÛéö£Bep7„hfšNRñ»ª+=ß­_Â1/›V¥G5Š©î¥®ñÇ%úÊ\FS™[–‹wƹ»|ó¥3½þíêMÊî‘1u<òûPÇ®{tàíç†þmÕ´|&úžv–Þrà¬X(t=]ª±geÅb1pùÆž 04#ïvËŸª¤æÐð,Íža’S$’nè­ ãxÔÇ'ÖÏö|p'5*Túq©-IÒÙTûbM¨…ú?ŒS±†2ÝP†òUvó='9>–Ÿí ) Ñ ƒèÐß•B;UüÆØ….=ÖXè2Þèù¬WY£á-¹ö”Ö;eÞXhˆþ /®.gs À‹ÙÏ_ˆÃ¿Ñ1èuì…G£€¾¢©U˜‰3õo­¸X¨#¹Üi<~ÑF¼±mˆ4ý¥‚¼™ÆæÿÿšÝüü¢Á\Ò¼:âЗÑ“¤ä?*O¡ €}ªn,Ôü6=“Aà%æƒÔJ¸˜Hy#IWŸn?[N~ÆŸÿŠð‘endstream endobj 25 0 obj 2813 endobj 29 0 obj <> stream xœ•XÛnã8}÷Wðm¥E›-ê®}ófÝ@vÒvÆVÏK²d™Ž5-‹n]œñ`>¡?z«HQ¢/zØ"YU§N*úq(#þõÿóÃäã*"¯ÍÄ!¯“o&_’þ_~ ÿLaAŒ_¤»‰ÚÃHä’(ñhœô0a,¦!#éÛäÉÊ»º|áYs~yåmQíijå=Û¤,6øÆžºC'²>gU—•äörû?é¿Á(sz«`mê…$Ý‚ÒʳµXÚ¾<ɳÒù?àü¦åUQ½’¨IÃë¯IQm‘µ|KjÛ‹`q[ü[Ç›¶!Eƒ¶áû&±ŸX¼jË3éªâp,ù>ñí³M{Gtô®OÒ‡‰Ccmú÷'kv<–Ežµ…¨òV4{ô¡¤æMwà$«ÈÊš$nd¥ëGp­i`-'«D»7sQU<ÇH³] îò¶.¸4>…<$Í'žŸPßCüFYˆX'NZ;ýqÉ',€N¿½”Kö*"‹ËE_z?eî§µá'y)éýüäm>Ž©ç%±>ÛÓÖóÑzHÝÁº5ÄDå1 ’D`6¤1¾²î¾¬îŸ–/+;Ô‰\?¾Ü­ç¿¾¬æw¿]Ej—­Çl0™Ð8Ð9LùÔ4$#GQ@kLDFJ¡S’óË  ÆFÀ<æÝÕ§AìÆ×f£ƒhZy¨¤ÎûÓãˆÆ,Ñ€œ8¾ti€ ën Äë_nïL{ìž/í­ù7²«ÅAfù"‡FÌÕx­-øxPD]´S/Ÿ,zo»£^Y»³W™KÀ\ìé¬u5É£§Š/~Dß3%õ-IW^å¢C s\n–,£~ éª²=Y ž¯V¶×—ÅruUfÌ©?„Wä,:rÈβÂ0—m-ºMÉ¡^D …´ýUÿýGÑ-jDþÍÁ ñP4‡¬Í÷ds&Gο"ã³vB™œ"D<´²²ãºúp‹&z6E%Ò¶ÒûÏóµŠ[»nðtE~ɶ„a’\ðÁyÏ…úThªôEíiß„­õs׎9t=¨MgÀ RèÏeD˜¦¾¬\yx„@'‘vɬ,f¸T”€­øwC±A°%èVSB¦(“°k\yä5(ÌA¯¨4HÉÏ.Ê*ªé_ÓéÂö|Å‹ÙçùÃrùË—Gé3¾ƒçn¹XÌïRûoú xf·¾†çq5OW³ÅúÓ|¯z æ³Nmhc ˜5SBÄ‚ÄJ‡M†eóAC¢¬³Ê<ÖÊh-Ó±’ûÚ³fŸ0Q ‡Øß»šÿë~…a(Úx2GS —æÜbf*…3Àº¬C—Ñ„9®6jèîÂv# ×~AF˘]»2:£*¡1Mj„ •îùƒ†º¾ÖGIÀJKˆ¯†vµYÝB£m‹R~®2XÝR”',Å7I}ô,ÔìË%E §a8— lÕЧißÙ ”4.±0Šs@¡_©"‡åMï*pð&JnŽRë&º#û€òOEÞ÷})g{Äà Z>tKܸ”¯=ö›g ”îX‹?Î0U½Ù ¡qà€1ð5~ˆQ"?Æd\lÀâr]ñ!¤Å/aqœdBpÛÏ ²^?hd>îAÙ§½¶Ä±Ö¾6ûì«)’±9{ð·‹n:½—=ŽE»7'Ö7›9½NšHܳíÈ¢Â'¢ áN?ŸNC‰Çl¦Üüfcµ³ï]ÓÏÇÑë6ξ§qN¼Ÿdßwô¶Îªf‡“rC~ïšVA *èEùuÜD—mD'éºá6C‘Õ|-*JR5cæe·ÅS–ÀP>N<É5©Ô\ë†0ÃúÃ8먩êUàÀ.gév]9ƒ±´9ò¼øž÷e"]Ô›/¦Ø#ÄWä]™ÉúhE.Êg«*)ª^O]ÙÙpž¨ræ0©;hyRñAÊIÖdlN°ÿOï¸IC„áŒÀíé%pk Ëè’ ØküTðàþ¥'M( 'þI.ÔP›3C¡´–Éñm,·£3NλáöÝ8ódm78´XçÒX\›ÕÕêãcÙô@ìaD1f­eÿ>ñzòGýèo¥3³&4<Wõï‹P÷ZÕÊÁõqB[^ô¸xtxö0Ôkò˜"ß¹‘¼Z\‰háö+³#v2P1€“u*D×€4Ékª¦¤Ý7ÕÜœ~ 2z©¡0Ñ»þ7Ë[¬r+½M*èGXñ5ßµ¾Æ¶ü8‚êð%¬íŽúöÆ ÿÆB ŒÕËþÄbÔŒáCSý^!xøe¦ ª©Á äÎѧª*A—|G9_‹jÒ‡çO^ RìH%ßU¯Ñç\¨ Z‘ñË,çT!ÿ¿nO¡ôËjA~³N³!(Ä×ùÕ5gLÌh¾’ï{Es6FÁ8‡èL$¾7DÖå9oš]W~ ꎵüƒ»ºÂ—ø\›äop·«Å±ÆE¯kÚ z+ ¥­ÚÖXúýIïC6' …Òz>'³‡õr\{ÅËñNÐðVÛËÛ¨Ž®1õ;d‹m—L£„öâÙÿ–¤º±oã½ÃK,¸—~ââ‚hJœýP÷Ì™§“_áï¿@ÄÐendstream endobj 30 0 obj 1973 endobj 4 0 obj <> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 18 0 obj <> /Contents 19 0 R >> endobj 23 0 obj <> /Contents 24 0 R >> endobj 28 0 obj <> /Contents 29 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R 18 0 R 23 0 R 28 0 R ] /Count 5 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 21 0 obj <> endobj 22 0 obj <> endobj 26 0 obj <> endobj 27 0 obj <> endobj 31 0 obj <> endobj 32 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 33 0 obj <> endobj 34 0 obj <>stream 2014-01-29T08:09:44+01:00 2014-01-29T08:09:44+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 35 0000000000 65535 f 0000014082 00000 n 0000016273 00000 n 0000013995 00000 n 0000013187 00000 n 0000000015 00000 n 0000002612 00000 n 0000014147 00000 n 0000014712 00000 n 0000014647 00000 n 0000014579 00000 n 0000014188 00000 n 0000014218 00000 n 0000013347 00000 n 0000002632 00000 n 0000005195 00000 n 0000014268 00000 n 0000014298 00000 n 0000013509 00000 n 0000005216 00000 n 0000008194 00000 n 0000014348 00000 n 0000014378 00000 n 0000013671 00000 n 0000008215 00000 n 0000011100 00000 n 0000014428 00000 n 0000014458 00000 n 0000013833 00000 n 0000011121 00000 n 0000013166 00000 n 0000014499 00000 n 0000014529 00000 n 0000014794 00000 n 0000014850 00000 n trailer << /Size 35 /Root 1 0 R /Info 2 0 R /ID [<1B61F9555F20156DEBDDD00F825502A3><1B61F9555F20156DEBDDD00F825502A3>] >> startxref 16427 %%EOF curl-7.35.0/docs/libcurl/libcurl-tutorial.html0000644000175000017500000023066012272124467016261 00000000000000 libcurl-tutorial man page

NAME

libcurl-tutorial - libcurl programming tutorial

Objective

This document attempts to describe the general principles and some basic approaches to consider when programming with libcurl. The text will focus mainly on the C interface but might apply fairly well on other interfaces as well as they usually follow the C one pretty closely.

This document will refer to 'the user' as the person writing the source code that uses libcurl. That would probably be you or someone in your position. What will be generally referred to as 'the program' will be the collected source code that you write that is using libcurl for transfers. The program is outside libcurl and libcurl is outside of the program.

To get more details on all options and functions described herein, please refer to their respective man pages.

Building

There are many different ways to build C programs. This chapter will assume a UNIX-style build process. If you use a different build system, you can still read this to get general information that may apply to your environment as well.

Compiling the Program

Your compiler needs to know where the libcurl headers are located. Therefore you must set your compiler's include path to point to the directory where you installed them. The 'curl-config'[3] tool can be used to get this information:

$ curl-config --cflags

Linking the Program with libcurl

When having compiled the program, you need to link your object files to create a single executable. For that to succeed, you need to link with libcurl and possibly also with other libraries that libcurl itself depends on. Like the OpenSSL libraries, but even some standard OS libraries may be needed on the command line. To figure out which flags to use, once again the 'curl-config' tool comes to the rescue:

$ curl-config --libs

SSL or Not

libcurl can be built and customized in many ways. One of the things that varies from different libraries and builds is the support for SSL-based transfers, like HTTPS and FTPS. If a supported SSL library was detected properly at build-time, libcurl will be built with SSL support. To figure out if an installed libcurl has been built with SSL support enabled, use 'curl-config' like this:

$ curl-config --feature

And if SSL is supported, the keyword 'SSL' will be written to stdout, possibly together with a few other features that could be either on or off on for different libcurls.

See also the "Features libcurl Provides" further down.

autoconf macro

When you write your configure script to detect libcurl and setup variables accordingly, we offer a prewritten macro that probably does everything you need in this area. See docs/libcurl/libcurl.m4 file - it includes docs on how to use it.

Portable Code in a Portable World

The people behind libcurl have put a considerable effort to make libcurl work on a large amount of different operating systems and environments.

You program libcurl the same way on all platforms that libcurl runs on. There are only very few minor considerations that differ. If you just make sure to write your code portable enough, you may very well create yourself a very portable program. libcurl shouldn't stop you from that.

Global Preparation

The program must initialize some of the libcurl functionality globally. That means it should be done exactly once, no matter how many times you intend to use the library. Once for your program's entire life time. This is done using

 curl_global_init()

and it takes one parameter which is a bit pattern that tells libcurl what to initialize. Using CURL_GLOBAL_ALL will make it initialize all known internal sub modules, and might be a good default option. The current two bits that are specified are:

CURL_GLOBAL_WIN32

which only does anything on Windows machines. When used on a Windows machine, it'll make libcurl initialize the win32 socket stuff. Without having that initialized properly, your program cannot use sockets properly. You should only do this once for each application, so if your program already does this or of another library in use does it, you should not tell libcurl to do this as well.

CURL_GLOBAL_SSL

which only does anything on libcurls compiled and built SSL-enabled. On these systems, this will make libcurl initialize the SSL library properly for this application. This only needs to be done once for each application so if your program or another library already does this, this bit should not be needed.

libcurl has a default protection mechanism that detects if curl_global_init(3) hasn't been called by the time curl_easy_perform(3) is called and if that is the case, libcurl runs the function itself with a guessed bit pattern. Please note that depending solely on this is not considered nice nor very good.

When the program no longer uses libcurl, it should call curl_global_cleanup(3), which is the opposite of the init call. It will then do the reversed operations to cleanup the resources the curl_global_init(3) call initialized.

Repeated calls to curl_global_init(3) and curl_global_cleanup(3) should be avoided. They should only be called once each.

Features libcurl Provides

It is considered best-practice to determine libcurl features at run-time rather than at build-time (if possible of course). By calling curl_version_info(3) and checking out the details of the returned struct, your program can figure out exactly what the currently running libcurl supports.

Handle the Easy libcurl

libcurl first introduced the so called easy interface. All operations in the easy interface are prefixed with 'curl_easy'.

Recent libcurl versions also offer the multi interface. More about that interface, what it is targeted for and how to use it is detailed in a separate chapter further down. You still need to understand the easy interface first, so please continue reading for better understanding.

To use the easy interface, you must first create yourself an easy handle. You need one handle for each easy session you want to perform. Basically, you should use one handle for every thread you plan to use for transferring. You must never share the same handle in multiple threads.

Get an easy handle with

 easyhandle = curl_easy_init();

It returns an easy handle. Using that you proceed to the next step: setting up your preferred actions. A handle is just a logic entity for the upcoming transfer or series of transfers.

You set properties and options for this handle using curl_easy_setopt(3). They control how the subsequent transfer or transfers will be made. Options remain set in the handle until set again to something different. Alas, multiple requests using the same handle will use the same options.

Many of the options you set in libcurl are "strings", pointers to data terminated with a zero byte. When you set strings with curl_easy_setopt(3), libcurl makes its own copy so that they don't need to be kept around in your application after being set[4].

One of the most basic properties to set in the handle is the URL. You set your preferred URL to transfer with CURLOPT_URL in a manner similar to:

 curl_easy_setopt(handle, CURLOPT_URL, "http://domain.com/");

Let's assume for a while that you want to receive data as the URL identifies a remote resource you want to get here. Since you write a sort of application that needs this transfer, I assume that you would like to get the data passed to you directly instead of simply getting it passed to stdout. So, you write your own function that matches this prototype:

 size_t write_data(void *buffer, size_t size, size_t nmemb, void *userp);

You tell libcurl to pass all data to this function by issuing a function similar to this:

 curl_easy_setopt(easyhandle, CURLOPT_WRITEFUNCTION, write_data);

You can control what data your callback function gets in the fourth argument by setting another property:

 curl_easy_setopt(easyhandle, CURLOPT_WRITEDATA, &internal_struct);

Using that property, you can easily pass local data between your application and the function that gets invoked by libcurl. libcurl itself won't touch the data you pass with CURLOPT_WRITEDATA.

libcurl offers its own default internal callback that will take care of the data if you don't set the callback with CURLOPT_WRITEFUNCTION. It will then simply output the received data to stdout. You can have the default callback write the data to a different file handle by passing a 'FILE *' to a file opened for writing with the CURLOPT_WRITEDATA option.

Now, we need to take a step back and have a deep breath. Here's one of those rare platform-dependent nitpicks. Did you spot it? On some platforms[2], libcurl won't be able to operate on files opened by the program. Thus, if you use the default callback and pass in an open file with CURLOPT_WRITEDATA, it will crash. You should therefore avoid this to make your program run fine virtually everywhere.

(CURLOPT_WRITEDATA was formerly known as CURLOPT_FILE. Both names still work and do the same thing).

If you're using libcurl as a win32 DLL, you MUST use the CURLOPT_WRITEFUNCTION if you set CURLOPT_WRITEDATA - or you will experience crashes.

There are of course many more options you can set, and we'll get back to a few of them later. Let's instead continue to the actual transfer:

 success = curl_easy_perform(easyhandle);

curl_easy_perform(3) will connect to the remote site, do the necessary commands and receive the transfer. Whenever it receives data, it calls the callback function we previously set. The function may get one byte at a time, or it may get many kilobytes at once. libcurl delivers as much as possible as often as possible. Your callback function should return the number of bytes it "took care of". If that is not the exact same amount of bytes that was passed to it, libcurl will abort the operation and return with an error code.

When the transfer is complete, the function returns a return code that informs you if it succeeded in its mission or not. If a return code isn't enough for you, you can use the CURLOPT_ERRORBUFFER to point libcurl to a buffer of yours where it'll store a human readable error message as well.

If you then want to transfer another file, the handle is ready to be used again. Mind you, it is even preferred that you re-use an existing handle if you intend to make another transfer. libcurl will then attempt to re-use the previous connection.

For some protocols, downloading a file can involve a complicated process of logging in, setting the transfer mode, changing the current directory and finally transferring the file data. libcurl takes care of all that complication for you. Given simply the URL to a file, libcurl will take care of all the details needed to get the file moved from one machine to another.

Multi-threading Issues

The first basic rule is that you must never simultaneously share a libcurl handle (be it easy or multi or whatever) between multiple threads. Only use one handle in one thread at any time. You can pass the handles around among threads, but you must never use a single handle from more than one thread at any given time.

libcurl is completely thread safe, except for two issues: signals and SSL/TLS handlers. Signals are used for timing out name resolves (during DNS lookup) - when built without c-ares support and not on Windows.

If you are accessing HTTPS or FTPS URLs in a multi-threaded manner, you are then of course using the underlying SSL library multi-threaded and those libs might have their own requirements on this issue. Basically, you need to provide one or two functions to allow it to function properly. For all details, see this:

OpenSSL

 http://www.openssl.org/docs/crypto/threads.html#DESCRIPTION

GnuTLS

 http://www.gnu.org/software/gnutls/manual/html_node/Multi_002dthreaded-applications.html

NSS

 is claimed to be thread-safe already without anything required.

PolarSSL

 Required actions unknown.

yassl

 Required actions unknown.

axTLS

 Required actions unknown.

Secure Transport

 The engine is fully thread-safe, and no additional steps are required.

When using multiple threads you should set the CURLOPT_NOSIGNAL option to 1 for all handles. Everything will or might work fine except that timeouts are not honored during the DNS lookup - which you can work around by building libcurl with c-ares support. c-ares is a library that provides asynchronous name resolves. On some platforms, libcurl simply will not function properly multi-threaded unless this option is set.

Also, note that CURLOPT_DNS_USE_GLOBAL_CACHE is not thread-safe.

When It Doesn't Work

There will always be times when the transfer fails for some reason. You might have set the wrong libcurl option or misunderstood what the libcurl option actually does, or the remote server might return non-standard replies that confuse the library which then confuses your program.

There's one golden rule when these things occur: set the CURLOPT_VERBOSE option to 1. It'll cause the library to spew out the entire protocol details it sends, some internal info and some received protocol data as well (especially when using FTP). If you're using HTTP, adding the headers in the received output to study is also a clever way to get a better understanding why the server behaves the way it does. Include headers in the normal body output with CURLOPT_HEADER set 1.

Of course, there are bugs left. We need to know about them to be able to fix them, so we're quite dependent on your bug reports! When you do report suspected bugs in libcurl, please include as many details as you possibly can: a protocol dump that CURLOPT_VERBOSE produces, library version, as much as possible of your code that uses libcurl, operating system name and version, compiler name and version etc.

If CURLOPT_VERBOSE is not enough, you increase the level of debug data your application receive by using the CURLOPT_DEBUGFUNCTION.

Getting some in-depth knowledge about the protocols involved is never wrong, and if you're trying to do funny things, you might very well understand libcurl and how to use it better if you study the appropriate RFC documents at least briefly.

Upload Data to a Remote Site

libcurl tries to keep a protocol independent approach to most transfers, thus uploading to a remote FTP site is very similar to uploading data to a HTTP server with a PUT request.

Of course, first you either create an easy handle or you re-use one existing one. Then you set the URL to operate on just like before. This is the remote URL, that we now will upload.

Since we write an application, we most likely want libcurl to get the upload data by asking us for it. To make it do that, we set the read callback and the custom pointer libcurl will pass to our read callback. The read callback should have a prototype similar to:

 size_t function(char *bufptr, size_t size, size_t nitems, void *userp);

Where bufptr is the pointer to a buffer we fill in with data to upload and size*nitems is the size of the buffer and therefore also the maximum amount of data we can return to libcurl in this call. The 'userp' pointer is the custom pointer we set to point to a struct of ours to pass private data between the application and the callback.

 curl_easy_setopt(easyhandle, CURLOPT_READFUNCTION, read_function);

 curl_easy_setopt(easyhandle, CURLOPT_READDATA, &filedata);

Tell libcurl that we want to upload:

 curl_easy_setopt(easyhandle, CURLOPT_UPLOAD, 1L);

A few protocols won't behave properly when uploads are done without any prior knowledge of the expected file size. So, set the upload file size using the CURLOPT_INFILESIZE_LARGE for all known file sizes like this[1]:

 /* in this example, file_size must be an curl_off_t variable */  curl_easy_setopt(easyhandle, CURLOPT_INFILESIZE_LARGE, file_size);

When you call curl_easy_perform(3) this time, it'll perform all the necessary operations and when it has invoked the upload it'll call your supplied callback to get the data to upload. The program should return as much data as possible in every invoke, as that is likely to make the upload perform as fast as possible. The callback should return the number of bytes it wrote in the buffer. Returning 0 will signal the end of the upload.

Passwords

Many protocols use or even require that user name and password are provided to be able to download or upload the data of your choice. libcurl offers several ways to specify them.

Most protocols support that you specify the name and password in the URL itself. libcurl will detect this and use them accordingly. This is written like this:

 protocol://user:password@example.com/path/

If you need any odd letters in your user name or password, you should enter them URL encoded, as %XX where XX is a two-digit hexadecimal number.

libcurl also provides options to set various passwords. The user name and password as shown embedded in the URL can instead get set with the CURLOPT_USERPWD option. The argument passed to libcurl should be a char * to a string in the format "user:password". In a manner like this:

 curl_easy_setopt(easyhandle, CURLOPT_USERPWD, "myname:thesecret");

Another case where name and password might be needed at times, is for those users who need to authenticate themselves to a proxy they use. libcurl offers another option for this, the CURLOPT_PROXYUSERPWD. It is used quite similar to the CURLOPT_USERPWD option like this:

 curl_easy_setopt(easyhandle, CURLOPT_PROXYUSERPWD, "myname:thesecret");

There's a long time UNIX "standard" way of storing ftp user names and passwords, namely in the $HOME/.netrc file. The file should be made private so that only the user may read it (see also the "Security Considerations" chapter), as it might contain the password in plain text. libcurl has the ability to use this file to figure out what set of user name and password to use for a particular host. As an extension to the normal functionality, libcurl also supports this file for non-FTP protocols such as HTTP. To make curl use this file, use the CURLOPT_NETRC option:

 curl_easy_setopt(easyhandle, CURLOPT_NETRC, 1L);

And a very basic example of how such a .netrc file may look like:

 machine myhost.mydomain.com  login userlogin  password secretword

All these examples have been cases where the password has been optional, or at least you could leave it out and have libcurl attempt to do its job without it. There are times when the password isn't optional, like when you're using an SSL private key for secure transfers.

To pass the known private key password to libcurl:

 curl_easy_setopt(easyhandle, CURLOPT_KEYPASSWD, "keypassword");

HTTP Authentication

The previous chapter showed how to set user name and password for getting URLs that require authentication. When using the HTTP protocol, there are many different ways a client can provide those credentials to the server and you can control which way libcurl will (attempt to) use them. The default HTTP authentication method is called 'Basic', which is sending the name and password in clear-text in the HTTP request, base64-encoded. This is insecure.

At the time of this writing, libcurl can be built to use: Basic, Digest, NTLM, Negotiate, GSS-Negotiate and SPNEGO. You can tell libcurl which one to use with CURLOPT_HTTPAUTH as in:

 curl_easy_setopt(easyhandle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);

And when you send authentication to a proxy, you can also set authentication type the same way but instead with CURLOPT_PROXYAUTH:

 curl_easy_setopt(easyhandle, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);

Both these options allow you to set multiple types (by ORing them together), to make libcurl pick the most secure one out of the types the server/proxy claims to support. This method does however add a round-trip since libcurl must first ask the server what it supports:

 curl_easy_setopt(easyhandle, CURLOPT_HTTPAUTH,  CURLAUTH_DIGEST|CURLAUTH_BASIC);

For convenience, you can use the 'CURLAUTH_ANY' define (instead of a list with specific types) which allows libcurl to use whatever method it wants.

When asking for multiple types, libcurl will pick the available one it considers "best" in its own internal order of preference.

HTTP POSTing

We get many questions regarding how to issue HTTP POSTs with libcurl the proper way. This chapter will thus include examples using both different versions of HTTP POST that libcurl supports.

The first version is the simple POST, the most common version, that most HTML pages using the <form> tag uses. We provide a pointer to the data and tell libcurl to post it all to the remote site:

  char *data="name=daniel&project=curl";   curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDS, data);   curl_easy_setopt(easyhandle, CURLOPT_URL, "http://posthere.com/");

  curl_easy_perform(easyhandle); /* post away! */

Simple enough, huh? Since you set the POST options with the CURLOPT_POSTFIELDS, this automatically switches the handle to use POST in the upcoming request.

Ok, so what if you want to post binary data that also requires you to set the Content-Type: header of the post? Well, binary posts prevent libcurl from being able to do strlen() on the data to figure out the size, so therefore we must tell libcurl the size of the post data. Setting headers in libcurl requests are done in a generic way, by building a list of our own headers and then passing that list to libcurl.

 struct curl_slist *headers=NULL;  headers = curl_slist_append(headers, "Content-Type: text/xml");

 /* post binary data */  curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDS, binaryptr);

 /* set the size of the postfields data */  curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDSIZE, 23L);

 /* pass our list of custom made headers */  curl_easy_setopt(easyhandle, CURLOPT_HTTPHEADER, headers);

 curl_easy_perform(easyhandle); /* post away! */

 curl_slist_free_all(headers); /* free the header list */

While the simple examples above cover the majority of all cases where HTTP POST operations are required, they don't do multi-part formposts. Multi-part formposts were introduced as a better way to post (possibly large) binary data and were first documented in the RFC 1867 (updated in RFC2388). They're called multi-part because they're built by a chain of parts, each part being a single unit of data. Each part has its own name and contents. You can in fact create and post a multi-part formpost with the regular libcurl POST support described above, but that would require that you build a formpost yourself and provide to libcurl. To make that easier, libcurl provides curl_formadd(3). Using this function, you add parts to the form. When you're done adding parts, you post the whole form.

The following example sets two simple text parts with plain textual contents, and then a file with binary contents and uploads the whole thing.

 struct curl_httppost *post=NULL;  struct curl_httppost *last=NULL;  curl_formadd(&post, &last,   CURLFORM_COPYNAME, "name",   CURLFORM_COPYCONTENTS, "daniel", CURLFORM_END);  curl_formadd(&post, &last,   CURLFORM_COPYNAME, "project",   CURLFORM_COPYCONTENTS, "curl", CURLFORM_END);  curl_formadd(&post, &last,   CURLFORM_COPYNAME, "logotype-image",   CURLFORM_FILECONTENT, "curl.png", CURLFORM_END);

 /* Set the form info */  curl_easy_setopt(easyhandle, CURLOPT_HTTPPOST, post);

 curl_easy_perform(easyhandle); /* post away! */

 /* free the post data again */  curl_formfree(post);

Multipart formposts are chains of parts using MIME-style separators and headers. It means that each one of these separate parts get a few headers set that describe the individual content-type, size etc. To enable your application to handicraft this formpost even more, libcurl allows you to supply your own set of custom headers to such an individual form part. You can of course supply headers to as many parts as you like, but this little example will show how you set headers to one specific part when you add that to the post handle:

 struct curl_slist *headers=NULL;  headers = curl_slist_append(headers, "Content-Type: text/xml");

 curl_formadd(&post, &last,   CURLFORM_COPYNAME, "logotype-image",   CURLFORM_FILECONTENT, "curl.xml",   CURLFORM_CONTENTHEADER, headers,   CURLFORM_END);

 curl_easy_perform(easyhandle); /* post away! */

 curl_formfree(post); /* free post */  curl_slist_free_all(headers); /* free custom header list */

Since all options on an easyhandle are "sticky", they remain the same until changed even if you do call curl_easy_perform(3), you may need to tell curl to go back to a plain GET request if you intend to do one as your next request. You force an easyhandle to go back to GET by using the CURLOPT_HTTPGET option:

 curl_easy_setopt(easyhandle, CURLOPT_HTTPGET, 1L);

Just setting CURLOPT_POSTFIELDS to "" or NULL will *not* stop libcurl from doing a POST. It will just make it POST without any data to send!

Showing Progress

For historical and traditional reasons, libcurl has a built-in progress meter that can be switched on and then makes it present a progress meter in your terminal.

Switch on the progress meter by, oddly enough, setting CURLOPT_NOPROGRESS to zero. This option is set to 1 by default.

For most applications however, the built-in progress meter is useless and what instead is interesting is the ability to specify a progress callback. The function pointer you pass to libcurl will then be called on irregular intervals with information about the current transfer.

Set the progress callback by using CURLOPT_PROGRESSFUNCTION. And pass a pointer to a function that matches this prototype:

 int progress_callback(void *clientp,   double dltotal,   double dlnow,   double ultotal,   double ulnow);

If any of the input arguments is unknown, a 0 will be passed. The first argument, the 'clientp' is the pointer you pass to libcurl with CURLOPT_PROGRESSDATA. libcurl won't touch it.

libcurl with C++

There's basically only one thing to keep in mind when using C++ instead of C when interfacing libcurl:

The callbacks CANNOT be non-static class member functions

Example C++ code:

class AClass {   static size_t write_data(void *ptr, size_t size, size_t nmemb,   void *ourpointer)   {   /* do what you want with the data */   }  }

Proxies

What "proxy" means according to Merriam-Webster: "a person authorized to act for another" but also "the agency, function, or office of a deputy who acts as a substitute for another".

Proxies are exceedingly common these days. Companies often only offer Internet access to employees through their proxies. Network clients or user-agents ask the proxy for documents, the proxy does the actual request and then it returns them.

libcurl supports SOCKS and HTTP proxies. When a given URL is wanted, libcurl will ask the proxy for it instead of trying to connect to the actual host identified in the URL.

If you're using a SOCKS proxy, you may find that libcurl doesn't quite support all operations through it.

For HTTP proxies: the fact that the proxy is a HTTP proxy puts certain restrictions on what can actually happen. A requested URL that might not be a HTTP URL will be still be passed to the HTTP proxy to deliver back to libcurl. This happens transparently, and an application may not need to know. I say "may", because at times it is very important to understand that all operations over a HTTP proxy use the HTTP protocol. For example, you can't invoke your own custom FTP commands or even proper FTP directory listings.

Proxy Options

To tell libcurl to use a proxy at a given port number:

 curl_easy_setopt(easyhandle, CURLOPT_PROXY, "proxy-host.com:8080");

Some proxies require user authentication before allowing a request, and you pass that information similar to this:

 curl_easy_setopt(easyhandle, CURLOPT_PROXYUSERPWD, "user:password");

If you want to, you can specify the host name only in the CURLOPT_PROXY option, and set the port number separately with CURLOPT_PROXYPORT.

Tell libcurl what kind of proxy it is with CURLOPT_PROXYTYPE (if not, it will default to assume a HTTP proxy):

 curl_easy_setopt(easyhandle, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);

Environment Variables

libcurl automatically checks and uses a set of environment variables to know what proxies to use for certain protocols. The names of the variables are following an ancient de facto standard and are built up as "[protocol]_proxy" (note the lower casing). Which makes the variable 'http_proxy' checked for a name of a proxy to use when the input URL is HTTP. Following the same rule, the variable named 'ftp_proxy' is checked for FTP URLs. Again, the proxies are always HTTP proxies, the different names of the variables simply allows different HTTP proxies to be used.

The proxy environment variable contents should be in the format "[protocol://][user:password@]machine[:port]". Where the protocol:// part is simply ignored if present (so http://proxy and bluerk://proxy will do the same) and the optional port number specifies on which port the proxy operates on the host. If not specified, the internal default port number will be used and that is most likely *not* the one you would like it to be.

There are two special environment variables. 'all_proxy' is what sets proxy for any URL in case the protocol specific variable wasn't set, and 'no_proxy' defines a list of hosts that should not use a proxy even though a variable may say so. If 'no_proxy' is a plain asterisk ("*") it matches all hosts.

To explicitly disable libcurl's checking for and using the proxy environment variables, set the proxy name to "" - an empty string - with CURLOPT_PROXY.

SSL and Proxies

SSL is for secure point-to-point connections. This involves strong encryption and similar things, which effectively makes it impossible for a proxy to operate as a "man in between" which the proxy's task is, as previously discussed. Instead, the only way to have SSL work over a HTTP proxy is to ask the proxy to tunnel trough everything without being able to check or fiddle with the traffic.

Opening an SSL connection over a HTTP proxy is therefor a matter of asking the proxy for a straight connection to the target host on a specified port. This is made with the HTTP request CONNECT. ("please mr proxy, connect me to that remote host").

Because of the nature of this operation, where the proxy has no idea what kind of data that is passed in and out through this tunnel, this breaks some of the very few advantages that come from using a proxy, such as caching. Many organizations prevent this kind of tunneling to other destination port numbers than 443 (which is the default HTTPS port number).

Tunneling Through Proxy

As explained above, tunneling is required for SSL to work and often even restricted to the operation intended for SSL; HTTPS.

This is however not the only time proxy-tunneling might offer benefits to you or your application.

As tunneling opens a direct connection from your application to the remote machine, it suddenly also re-introduces the ability to do non-HTTP operations over a HTTP proxy. You can in fact use things such as FTP upload or FTP custom commands this way.

Again, this is often prevented by the administrators of proxies and is rarely allowed.

Tell libcurl to use proxy tunneling like this:

 curl_easy_setopt(easyhandle, CURLOPT_HTTPPROXYTUNNEL, 1L);

In fact, there might even be times when you want to do plain HTTP operations using a tunnel like this, as it then enables you to operate on the remote server instead of asking the proxy to do so. libcurl will not stand in the way for such innovative actions either!

Proxy Auto-Config

Netscape first came up with this. It is basically a web page (usually using a .pac extension) with a Javascript that when executed by the browser with the requested URL as input, returns information to the browser on how to connect to the URL. The returned information might be "DIRECT" (which means no proxy should be used), "PROXY host:port" (to tell the browser where the proxy for this particular URL is) or "SOCKS host:port" (to direct the browser to a SOCKS proxy).

libcurl has no means to interpret or evaluate Javascript and thus it doesn't support this. If you get yourself in a position where you face this nasty invention, the following advice have been mentioned and used in the past:

- Depending on the Javascript complexity, write up a script that translates it to another language and execute that.

- Read the Javascript code and rewrite the same logic in another language.

- Implement a Javascript interpreter; people have successfully used the Mozilla Javascript engine in the past.

- Ask your admins to stop this, for a static proxy setup or similar.

Persistence Is The Way to Happiness

Re-cycling the same easy handle several times when doing multiple requests is the way to go.

After each single curl_easy_perform(3) operation, libcurl will keep the connection alive and open. A subsequent request using the same easy handle to the same host might just be able to use the already open connection! This reduces network impact a lot.

Even if the connection is dropped, all connections involving SSL to the same host again, will benefit from libcurl's session ID cache that drastically reduces re-connection time.

FTP connections that are kept alive save a lot of time, as the command- response round-trips are skipped, and also you don't risk getting blocked without permission to login again like on many FTP servers only allowing N persons to be logged in at the same time.

libcurl caches DNS name resolving results, to make lookups of a previously looked up name a lot faster.

Other interesting details that improve performance for subsequent requests may also be added in the future.

Each easy handle will attempt to keep the last few connections alive for a while in case they are to be used again. You can set the size of this "cache" with the CURLOPT_MAXCONNECTS option. Default is 5. There is very seldom any point in changing this value, and if you think of changing this it is often just a matter of thinking again.

To force your upcoming request to not use an already existing connection (it will even close one first if there happens to be one alive to the same host you're about to operate on), you can do that by setting CURLOPT_FRESH_CONNECT to 1. In a similar spirit, you can also forbid the upcoming request to be "lying" around and possibly get re-used after the request by setting CURLOPT_FORBID_REUSE to 1.

HTTP Headers Used by libcurl

When you use libcurl to do HTTP requests, it'll pass along a series of headers automatically. It might be good for you to know and understand these. You can replace or remove them by using the CURLOPT_HTTPHEADER option.

Host

This header is required by HTTP 1.1 and even many 1.0 servers and should be the name of the server we want to talk to. This includes the port number if anything but default.

Accept

"*/*".

Expect

When doing POST requests, libcurl sets this header to "100-continue" to ask the server for an "OK" message before it proceeds with sending the data part of the post. If the POSTed data amount is deemed "small", libcurl will not use this header.

Customizing Operations

There is an ongoing development today where more and more protocols are built upon HTTP for transport. This has obvious benefits as HTTP is a tested and reliable protocol that is widely deployed and has excellent proxy-support.

When you use one of these protocols, and even when doing other kinds of programming you may need to change the traditional HTTP (or FTP or...) manners. You may need to change words, headers or various data.

libcurl is your friend here too.

CUSTOMREQUEST

If just changing the actual HTTP request keyword is what you want, like when GET, HEAD or POST is not good enough for you, CURLOPT_CUSTOMREQUEST is there for you. It is very simple to use:

 curl_easy_setopt(easyhandle, CURLOPT_CUSTOMREQUEST, "MYOWNREQUEST");

When using the custom request, you change the request keyword of the actual request you are performing. Thus, by default you make a GET request but you can also make a POST operation (as described before) and then replace the POST keyword if you want to. You're the boss.

Modify Headers

HTTP-like protocols pass a series of headers to the server when doing the request, and you're free to pass any amount of extra headers that you think fit. Adding headers is this easy:

 struct curl_slist *headers=NULL; /* init to NULL is important */

 headers = curl_slist_append(headers, "Hey-server-hey: how are you?");  headers = curl_slist_append(headers, "X-silly-content: yes");

 /* pass our list of custom made headers */  curl_easy_setopt(easyhandle, CURLOPT_HTTPHEADER, headers);

 curl_easy_perform(easyhandle); /* transfer http */

 curl_slist_free_all(headers); /* free the header list */

... and if you think some of the internally generated headers, such as Accept: or Host: don't contain the data you want them to contain, you can replace them by simply setting them too:

 headers = curl_slist_append(headers, "Accept: Agent-007");  headers = curl_slist_append(headers, "Host: munged.host.line");

Delete Headers

If you replace an existing header with one with no contents, you will prevent the header from being sent. For instance, if you want to completely prevent the "Accept:" header from being sent, you can disable it with code similar to this:

 headers = curl_slist_append(headers, "Accept:");

Both replacing and canceling internal headers should be done with careful consideration and you should be aware that you may violate the HTTP protocol when doing so.

Enforcing chunked transfer-encoding

By making sure a request uses the custom header "Transfer-Encoding: chunked" when doing a non-GET HTTP operation, libcurl will switch over to "chunked" upload, even though the size of the data to upload might be known. By default, libcurl usually switches over to chunked upload automatically if the upload data size is unknown.

HTTP Version

All HTTP requests includes the version number to tell the server which version we support. libcurl speaks HTTP 1.1 by default. Some very old servers don't like getting 1.1-requests and when dealing with stubborn old things like that, you can tell libcurl to use 1.0 instead by doing something like this:

 curl_easy_setopt(easyhandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);

FTP Custom Commands

Not all protocols are HTTP-like, and thus the above may not help you when you want to make, for example, your FTP transfers to behave differently.

Sending custom commands to a FTP server means that you need to send the commands exactly as the FTP server expects them (RFC 959 is a good guide here), and you can only use commands that work on the control-connection alone. All kinds of commands that require data interchange and thus need a data-connection must be left to libcurl's own judgement. Also be aware that libcurl will do its very best to change directory to the target directory before doing any transfer, so if you change directory (with CWD or similar) you might confuse libcurl and then it might not attempt to transfer the file in the correct remote directory.

A little example that deletes a given file before an operation:

 headers = curl_slist_append(headers, "DELE file-to-remove");

 /* pass the list of custom commands to the handle */  curl_easy_setopt(easyhandle, CURLOPT_QUOTE, headers);

 curl_easy_perform(easyhandle); /* transfer ftp data! */

 curl_slist_free_all(headers); /* free the header list */

If you would instead want this operation (or chain of operations) to happen _after_ the data transfer took place the option to curl_easy_setopt(3) would instead be called CURLOPT_POSTQUOTE and used the exact same way.

The custom FTP command will be issued to the server in the same order they are added to the list, and if a command gets an error code returned back from the server, no more commands will be issued and libcurl will bail out with an error code (CURLE_QUOTE_ERROR). Note that if you use CURLOPT_QUOTE to send commands before a transfer, no transfer will actually take place when a quote command has failed.

If you set the CURLOPT_HEADER to 1, you will tell libcurl to get information about the target file and output "headers" about it. The headers will be in "HTTP-style", looking like they do in HTTP.

The option to enable headers or to run custom FTP commands may be useful to combine with CURLOPT_NOBODY. If this option is set, no actual file content transfer will be performed.

FTP Custom CUSTOMREQUEST

If you do want to list the contents of a FTP directory using your own defined FTP command, CURLOPT_CUSTOMREQUEST will do just that. "NLST" is the default one for listing directories but you're free to pass in your idea of a good alternative.

Cookies Without Chocolate Chips

In the HTTP sense, a cookie is a name with an associated value. A server sends the name and value to the client, and expects it to get sent back on every subsequent request to the server that matches the particular conditions set. The conditions include that the domain name and path match and that the cookie hasn't become too old.

In real-world cases, servers send new cookies to replace existing ones to update them. Server use cookies to "track" users and to keep "sessions".

Cookies are sent from server to clients with the header Set-Cookie: and they're sent from clients to servers with the Cookie: header.

To just send whatever cookie you want to a server, you can use CURLOPT_COOKIE to set a cookie string like this:

 curl_easy_setopt(easyhandle, CURLOPT_COOKIE, "name1=var1; name2=var2;");

In many cases, that is not enough. You might want to dynamically save whatever cookies the remote server passes to you, and make sure those cookies are then used accordingly on later requests.

One way to do this, is to save all headers you receive in a plain file and when you make a request, you tell libcurl to read the previous headers to figure out which cookies to use. Set the header file to read cookies from with CURLOPT_COOKIEFILE.

The CURLOPT_COOKIEFILE option also automatically enables the cookie parser in libcurl. Until the cookie parser is enabled, libcurl will not parse or understand incoming cookies and they will just be ignored. However, when the parser is enabled the cookies will be understood and the cookies will be kept in memory and used properly in subsequent requests when the same handle is used. Many times this is enough, and you may not have to save the cookies to disk at all. Note that the file you specify to CURLOPT_COOKIEFILE doesn't have to exist to enable the parser, so a common way to just enable the parser and not read any cookies is to use the name of a file you know doesn't exist.

If you would rather use existing cookies that you've previously received with your Netscape or Mozilla browsers, you can make libcurl use that cookie file as input. The CURLOPT_COOKIEFILE is used for that too, as libcurl will automatically find out what kind of file it is and act accordingly.

Perhaps the most advanced cookie operation libcurl offers, is saving the entire internal cookie state back into a Netscape/Mozilla formatted cookie file. We call that the cookie-jar. When you set a file name with CURLOPT_COOKIEJAR, that file name will be created and all received cookies will be stored in it when curl_easy_cleanup(3) is called. This enables cookies to get passed on properly between multiple handles without any information getting lost.

FTP Peculiarities We Need

FTP transfers use a second TCP/IP connection for the data transfer. This is usually a fact you can forget and ignore but at times this fact will come back to haunt you. libcurl offers several different ways to customize how the second connection is being made.

libcurl can either connect to the server a second time or tell the server to connect back to it. The first option is the default and it is also what works best for all the people behind firewalls, NATs or IP-masquerading setups. libcurl then tells the server to open up a new port and wait for a second connection. This is by default attempted with EPSV first, and if that doesn't work it tries PASV instead. (EPSV is an extension to the original FTP spec and does not exist nor work on all FTP servers.)

You can prevent libcurl from first trying the EPSV command by setting CURLOPT_FTP_USE_EPSV to zero.

In some cases, you will prefer to have the server connect back to you for the second connection. This might be when the server is perhaps behind a firewall or something and only allows connections on a single port. libcurl then informs the remote server which IP address and port number to connect to. This is made with the CURLOPT_FTPPORT option. If you set it to "-", libcurl will use your system's "default IP address". If you want to use a particular IP, you can set the full IP address, a host name to resolve to an IP address or even a local network interface name that libcurl will get the IP address from.

When doing the "PORT" approach, libcurl will attempt to use the EPRT and the LPRT before trying PORT, as they work with more protocols. You can disable this behavior by setting CURLOPT_FTP_USE_EPRT to zero.

Headers Equal Fun

Some protocols provide "headers", meta-data separated from the normal data. These headers are by default not included in the normal data stream, but you can make them appear in the data stream by setting CURLOPT_HEADER to 1.

What might be even more useful, is libcurl's ability to separate the headers from the data and thus make the callbacks differ. You can for example set a different pointer to pass to the ordinary write callback by setting CURLOPT_WRITEHEADER.

Or, you can set an entirely separate function to receive the headers, by using CURLOPT_HEADERFUNCTION.

The headers are passed to the callback function one by one, and you can depend on that fact. It makes it easier for you to add custom header parsers etc.

"Headers" for FTP transfers equal all the FTP server responses. They aren't actually true headers, but in this case we pretend they are! ;-)

Post Transfer Information

 [ curl_easy_getinfo ]

Security Considerations

The libcurl project takes security seriously. The library is written with caution and precautions are taken to mitigate many kinds of risks encountered while operating with potentially malicious servers on the Internet. It is a powerful library, however, which allows application writers to make trade offs between ease of writing and exposure to potential risky operations. If used the right way, you can use libcurl to transfer data pretty safely.

Many applications are used in closed networks where users and servers can be trusted, but many others are used on arbitrary servers and are fed input from potentially untrusted users. Following is a discussion about some risks in the ways in which applications commonly use libcurl and potential mitigations of those risks. It is by no means comprehensive, but shows classes of attacks that robust applications should consider. The Common Weakness Enumeration project at http://cwe.mitre.org/ is a good reference for many of these and similar types of weaknesses of which application writers should be aware.

Command Lines

If you use a command line tool (such as curl) that uses libcurl, and you give options to the tool on the command line those options can very likely get read by other users of your system when they use 'ps' or other tools to list currently running processes.

To avoid this problem, never feed sensitive things to programs using command line options. Write them to a protected file and use the -K option to avoid this.

.netrc

.netrc is a pretty handy file/feature that allows you to login quickly and automatically to frequently visited sites. The file contains passwords in clear text and is a real security risk. In some cases, your .netrc is also stored in a home directory that is NFS mounted or used on another network based file system, so the clear text password will fly through your network every time anyone reads that file!

To avoid this problem, don't use .netrc files and never store passwords in plain text anywhere.

Clear Text Passwords

Many of the protocols libcurl supports send name and password unencrypted as clear text (HTTP Basic authentication, FTP, TELNET etc). It is very easy for anyone on your network or a network nearby yours to just fire up a network analyzer tool and eavesdrop on your passwords. Don't let the fact that HTTP Basic uses base64 encoded passwords fool you. They may not look readable at a first glance, but they very easily "deciphered" by anyone within seconds.

To avoid this problem, use HTTP authentication methods or other protocols that don't let snoopers see your password: HTTP with Digest, NTLM or GSS authentication, HTTPS, FTPS, SCP, SFTP and FTP-Kerberos are a few examples.

Redirects

The CURLOPT_FOLLOWLOCATION option automatically follows HTTP redirects sent by a remote server. These redirects can refer to any kind of URL, not just HTTP. A redirect to a file: URL would cause the libcurl to read (or write) arbitrary files from the local filesystem. If the application returns the data back to the user (as would happen in some kinds of CGI scripts), an attacker could leverage this to read otherwise forbidden data (e.g. file://localhost/etc/passwd).

If authentication credentials are stored in the ~/.netrc file, or Kerberos is in use, any other URL type (not just file:) that requires authentication is also at risk. A redirect such as ftp://some-internal-server/private-file would then return data even when the server is password protected.

In the same way, if an unencrypted SSH private key has been configured for the user running the libcurl application, SCP: or SFTP: URLs could access password or private-key protected resources, e.g. sftp://user@some-internal-server/etc/passwd

The CURLOPT_REDIR_PROTOCOLS and CURLOPT_NETRC options can be used to mitigate against this kind of attack.

A redirect can also specify a location available only on the machine running libcurl, including servers hidden behind a firewall from the attacker. e.g. http://127.0.0.1/ or http://intranet/delete-stuff.cgi?delete=all or tftp://bootp-server/pc-config-data

Apps can mitigate against this by disabling CURLOPT_FOLLOWLOCATION and handling redirects itself, sanitizing URLs as necessary. Alternately, an app could leave CURLOPT_FOLLOWLOCATION enabled but set CURLOPT_REDIR_PROTOCOLS and install a CURLOPT_OPENSOCKETFUNCTION callback function in which addresses are sanitized before use.

Private Resources

A user who can control the DNS server of a domain being passed in within a URL can change the address of the host to a local, private address which a server-side libcurl-using application could then use. e.g. the innocuous URL http://fuzzybunnies.example.com/ could actually resolve to the IP address of a server behind a firewall, such as 127.0.0.1 or 10.1.2.3. Apps can mitigate against this by setting a CURLOPT_OPENSOCKETFUNCTION and checking the address before a connection.

All the malicious scenarios regarding redirected URLs apply just as well to non-redirected URLs, if the user is allowed to specify an arbitrary URL that could point to a private resource. For example, a web app providing a translation service might happily translate file://localhost/etc/passwd and display the result. Apps can mitigate against this with the CURLOPT_PROTOCOLS option as well as by similar mitigation techniques for redirections.

A malicious FTP server could in response to the PASV command return an IP address and port number for a server local to the app running libcurl but behind a firewall. Apps can mitigate against this by using the CURLOPT_FTP_SKIP_PASV_IP option or CURLOPT_FTPPORT.

IPv6 Addresses

libcurl will normally handle IPv6 addresses transparently and just as easily as IPv4 addresses. That means that a sanitizing function that filters out addressses like 127.0.0.1 isn't sufficient--the equivalent IPv6 addresses ::1, ::, 0:00::0:1, ::127.0.0.1 and ::ffff:7f00:1 supplied somehow by an attacker would all bypass a naive filter and could allow access to undesired local resources. IPv6 also has special address blocks like link-local and site-local that generally shouldn't be accessed by a server-side libcurl-using application. A poorly-configured firewall installed in a data center, organization or server may also be configured to limit IPv4 connections but leave IPv6 connections wide open. In some cases, the CURL_IPRESOLVE_V4 option can be used to limit resolved addresses to IPv4 only and bypass these issues.

Uploads

When uploading, a redirect can cause a local (or remote) file to be overwritten. Apps must not allow any unsanitized URL to be passed in for uploads. Also, CURLOPT_FOLLOWLOCATION should not be used on uploads. Instead, the app should handle redirects itself, sanitizing each URL first.

Authentication

Use of CURLOPT_UNRESTRICTED_AUTH could cause authentication information to be sent to an unknown second server. Apps can mitigate against this by disabling CURLOPT_FOLLOWLOCATION and handling redirects itself, sanitizing where necessary.

Use of the CURLAUTH_ANY option to CURLOPT_HTTPAUTH could result in user name and password being sent in clear text to an HTTP server. Instead, use CURLAUTH_ANYSAFE which ensures that the password is encrypted over the network, or else fail the request.

Use of the CURLUSESSL_TRY option to CURLOPT_USE_SSL could result in user name and password being sent in clear text to an FTP server. Instead, use CURLUSESSL_CONTROL to ensure that an encrypted connection is used or else fail the request.

Cookies

If cookies are enabled and cached, then a user could craft a URL which performs some malicious action to a site whose authentication is already stored in a cookie. e.g. http://mail.example.com/delete-stuff.cgi?delete=all Apps can mitigate against this by disabling cookies or clearing them between requests.

Dangerous URLs

SCP URLs can contain raw commands within the scp: URL, which is a side effect of how the SCP protocol is designed. e.g. scp://user:pass@host/a;date >/tmp/test; Apps must not allow unsanitized SCP: URLs to be passed in for downloads.

Denial of Service

A malicious server could cause libcurl to effectively hang by sending a trickle of data through, or even no data at all but just keeping the TCP connection open. This could result in a denial-of-service attack. The CURLOPT_TIMEOUT and/or CURLOPT_LOW_SPEED_LIMIT options can be used to mitigate against this.

A malicious server could cause libcurl to effectively hang by starting to send data, then severing the connection without cleanly closing the TCP connection. The app could install a CURLOPT_SOCKOPTFUNCTION callback function and set the TCP SO_KEEPALIVE option to mitigate against this. Setting one of the timeout options would also work against this attack.

A malicious server could cause libcurl to download an infinite amount of data, potentially causing all of memory or disk to be filled. Setting the CURLOPT_MAXFILESIZE_LARGE option is not sufficient to guard against this. Instead, the app should monitor the amount of data received within the write or progress callback and abort once the limit is reached.

A malicious HTTP server could cause an infinite redirection loop, causing a denial-of-service. This can be mitigated by using the CURLOPT_MAXREDIRS option.

Arbitrary Headers

User-supplied data must be sanitized when used in options like CURLOPT_USERAGENT, CURLOPT_HTTPHEADER, CURLOPT_POSTFIELDS and others that are used to generate structured data. Characters like embedded carriage returns or ampersands could allow the user to create additional headers or fields that could cause malicious transactions.

Server-supplied Names

A server can supply data which the application may, in some cases, use as a file name. The curl command-line tool does this with --remote-header-name, using the Content-disposition: header to generate a file name. An application could also use CURLINFO_EFFECTIVE_URL to generate a file name from a server-supplied redirect URL. Special care must be taken to sanitize such names to avoid the possibility of a malicious server supplying one like "/etc/passwd", "\autoexec.bat", "prn:" or even ".bashrc".

Server Certificates

A secure application should never use the CURLOPT_SSL_VERIFYPEER option to disable certificate validation. There are numerous attacks that are enabled by apps that fail to properly validate server TLS/SSL certificates, thus enabling a malicious server to spoof a legitimate one. HTTPS without validated certificates is potentially as insecure as a plain HTTP connection.

Showing What You Do

On a related issue, be aware that even in situations like when you have problems with libcurl and ask someone for help, everything you reveal in order to get best possible help might also impose certain security related risks. Host names, user names, paths, operating system specifics, etc. (not to mention passwords of course) may in fact be used by intruders to gain additional information of a potential target.

Be sure to limit access to application logs if they could hold private or security-related data. Besides the obvious candidates like user names and passwords, things like URLs, cookies or even file names could also hold sensitive data.

To avoid this problem, you must of course use your common sense. Often, you can just edit out the sensitive data or just search/replace your true information with faked data.

Multiple Transfers Using the multi Interface

The easy interface as described in detail in this document is a synchronous interface that transfers one file at a time and doesn't return until it is done.

The multi interface, on the other hand, allows your program to transfer multiple files in both directions at the same time, without forcing you to use multiple threads. The name might make it seem that the multi interface is for multi-threaded programs, but the truth is almost the reverse. The multi interface can allow a single-threaded application to perform the same kinds of multiple, simultaneous transfers that multi-threaded programs can perform. It allows many of the benefits of multi-threaded transfers without the complexity of managing and synchronizing many threads.

To use this interface, you are better off if you first understand the basics of how to use the easy interface. The multi interface is simply a way to make multiple transfers at the same time by adding up multiple easy handles into a "multi stack".

You create the easy handles you want and you set all the options just like you have been told above, and then you create a multi handle with curl_multi_init(3) and add all those easy handles to that multi handle with curl_multi_add_handle(3).

When you've added the handles you have for the moment (you can still add new ones at any time), you start the transfers by calling curl_multi_perform(3).

curl_multi_perform(3) is asynchronous. It will only execute as little as possible and then return back control to your program. It is designed to never block.

The best usage of this interface is when you do a select() on all possible file descriptors or sockets to know when to call libcurl again. This also makes it easy for you to wait and respond to actions on your own application's sockets/handles. You figure out what to select() for by using curl_multi_fdset(3), that fills in a set of fd_set variables for you with the particular file descriptors libcurl uses for the moment.

When you then call select(), it'll return when one of the file handles signal action and you then call curl_multi_perform(3) to allow libcurl to do what it wants to do. Take note that libcurl does also feature some time-out code so we advise you to never use very long timeouts on select() before you call curl_multi_perform(3), which thus should be called unconditionally every now and then even if none of its file descriptors have signaled ready. Another precaution you should use: always call curl_multi_fdset(3) immediately before the select() call since the current set of file descriptors may change when calling a curl function.

If you want to stop the transfer of one of the easy handles in the stack, you can use curl_multi_remove_handle(3) to remove individual easy handles. Remember that easy handles should be curl_easy_cleanup(3)ed.

When a transfer within the multi stack has finished, the counter of running transfers (as filled in by curl_multi_perform(3)) will decrease. When the number reaches zero, all transfers are done.

curl_multi_info_read(3) can be used to get information about completed transfers. It then returns the CURLcode for each easy transfer, to allow you to figure out success on each individual transfer.

SSL, Certificates and Other Tricks

 [ seeding, passwords, keys, certificates, ENGINE, ca certs ]

Sharing Data Between Easy Handles

You can share some data between easy handles when the easy interface is used, and some data is share automatically when you use the multi interface.

When you add easy handles to a multi handle, these easy handles will automatically share a lot of the data that otherwise would be kept on a per-easy handle basis when the easy interface is used.

The DNS cache is shared between handles within a multi handle, making subsequent name resolving faster, and the connection pool that is kept to better allow persistent connections and connection re-use is also shared. If you're using the easy interface, you can still share these between specific easy handles by using the share interface, see libcurl-share(3).

Some things are never shared automatically, not within multi handles, like for example cookies so the only way to share that is with the share interface.

Footnotes

[1]

libcurl 7.10.3 and later have the ability to switch over to chunked Transfer-Encoding in cases where HTTP uploads are done with data of an unknown size.

[2]

This happens on Windows machines when libcurl is built and used as a DLL. However, you can still do this on Windows if you link with a static library.

[3]

The curl-config tool is generated at build-time (on UNIX-like systems) and should be installed with the 'make install' or similar instruction that installs the library, header files, man pages etc.

[4]

This behavior was different in versions before 7.17.0, where strings had to remain valid past the end of the curl_easy_setopt(3) call.

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/libcurl.m40000644000175000017500000002367112213173003013757 00000000000000# 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]) AH_TEMPLATE([LIBCURL_PROTOCOL_RTSP],[Defined if libcurl supports RTSP]) AH_TEMPLATE([LIBCURL_PROTOCOL_POP3],[Defined if libcurl supports POP3]) AH_TEMPLATE([LIBCURL_PROTOCOL_IMAP],[Defined if libcurl supports IMAP]) AH_TEMPLATE([LIBCURL_PROTOCOL_SMTP],[Defined if libcurl supports SMTP]) AC_ARG_WITH(libcurl, AC_HELP_STRING([--with-libcurl=PREFIX],[look for the curl library in PREFIX/lib and headers in PREFIX/include]), [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])]) 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],[curl-config],[], ["$withval/bin"]) else AC_PATH_PROG([_libcurl_config],[curl-config],[],[$PATH]) 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; if (x) ; ]])],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 TFTP" if test x$libcurl_feature_SSL = xyes ; then _libcurl_protocols="$_libcurl_protocols HTTPS" # FTPS wasn't standards-compliant until version # 7.11.0 (0x070b00 == 461568) if test $_libcurl_version -ge 461568; then _libcurl_protocols="$_libcurl_protocols FTPS" fi fi # RTSP, IMAP, POP3 and SMTP were added in # 7.20.0 (0x071400 == 463872) if test $_libcurl_version -ge 463872; then _libcurl_protocols="$_libcurl_protocols RTSP IMAP POP3 SMTP" 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 curl-7.35.0/docs/libcurl/curl_share_cleanup.html0000644000175000017500000000367012272124467016621 00000000000000 curl_share_cleanup man page

NAME

curl_share_cleanup - Clean up a shared object

SYNOPSIS

#include <curl/curl.h>

CURLSHcode curl_share_cleanup(CURLSH * share_handle );

DESCRIPTION

This function deletes a shared object. The share handle cannot be used anymore when this function has been called.

RETURN VALUE

CURLSHE_OK (zero) means that the option was set properly, non-zero means an error occurred as <curl/curl.h> defines. See the libcurl-errors.3 man page for the full list with descriptions. If an error occurs, then the share object will not be deleted.

SEE ALSO

curl_share_init (3) curl_share_setopt (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_multi_assign.pdf0000644000175000017500000001076112272124475016311 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ½WÛnÛH}×W4°¡«ÓÍ;1‹4c¡À¹¬­dØ‹€&[Ç©á%‚þa~eÿqOu“Å8ÉÛÀ†%³›¬S§NjþÉ—LÐO÷™ìg¯n¶­g‚mgΤ^dÝG²g¿­±!¤ ëÍÌÜ#Y`³ rx±õ~&eÈ=|;Îî­¤­ò/û6o²/q]gÛâÁræ,Ïie¾°=Á…¬·qÑÆ9{~ûü¿ë7³…à¶ÄS„žG!p|¶¾™Yï–ó@ŒUé!¸Tëtf½½ž¯ÿáµwEÀÒ¦eñŒì¬V Kã&fMÉp±L²¸ÉÊ‚³fÇâ‚eE£ªˆ±ô4—ÂRFymp éóPc¹ûüîý‡»ÕÝ%"½E£±þ‘IÞ¦Šý“½¢?|÷+m·]JrýòÞzýñöæmRbÓ3TéEöÒ\ÜÅEš«+³O£Œxzލ_{“^ Ôu°|-)®&4~Ãf–²—tß¡©濘<ÆéJpŽ2þýúîõíêÃzõþÝ÷’¨$û+éb аѾA&l ½3f<ôF[MDa;ˆÈM›9!¼É•+«Ís¢E†îÀG'ZñŒ`'4Ü{–µ²ºx¡ †ëÐPy(£^úÍX¾hÓh`=¯Tœž¨QqöxêýœÊ;îb]•J¡u²ª*èÓó¬Ž) ŠŽX³g ¹{#m3rW.¤YJj\Cµ²b›Ÿ;§7ÔÝØó´àW¸ ‹Žû&kÕ;`G>Ôø?㾂ñ7Ù^ 2­ë\x“áRÇûo¨yÙÇO:vÇ}èÃ"„æyî-è%ëF¨ž€-¾£©i½Èã#Neä kÜ™¥*f;U‘i.âÆ26Ù‡©|©ÈéúYa¼URߺ?±º‘ÃÁ¥¨.÷ ûà´È%~,Û†©‹. ߊ¼Ÿuå§EcU'ã SŠ(à¾;š2Âuô6c &6¹•É~ùaejR(ˆˆ¬½!Ãêu˜@»hÍŽ ÛÒ’e É0Qô%îúa×gü¿ÓÃæñÝYyüéæeùÔ:õdðÌ?89Ü[·×ë·ïا¹t\ùÒZÞ|¼žã­©uÝ ¸JÙùÈ@áÌèÔ7É Fº9í«ùOŽ2ðùÃêõò†}¼[Î=@ ìÈú×÷ÑÑ-Ðé¯`¬90ÉòñHc§²%Ë.ñ¯¢nª6i¡P¹"Å“ÕzØS†•´À>[¤§"Þg‰9¬Q‚*Nv¦áÀ¼k»<œ‹¦Zô/UKâHg Ä:Ý£¾ôØØø™I£­„Õtd@û< ÿ¦y «ùv37ð¸{îüNò÷fø–m5ØPhGd,ú9HRkƒ„úÏn®Œl<eïWôd8€ïrÛéÉ=žcÄŽì§…îî“>3•`¬êÏÌpõÈëìå¨-¥õúÞ®«EÓÕ TtÁñ¶!†£ÝÕq|z°ÁG»Šc:Ò¤^ØÙa“Qê8<°}ûÛ"ŽßI.Êâ´ãu+å1Ê›ü!®š,ió¸22Å42j£Ât·,ÁŒjW¢Ñ¡áK¼¶„8‡L&Ëd¨ÄÛ9:1t¥Š+zpZb¼_Θ0}Åš]vÕ¼ás˜? [»¡…Ì ÉZå_ç’`{®ÕÏBr-4}Ó[H—FËÙ†°O,?±ådùžì«·ºYþ¶ºY­?OúÈ㎆J/ßAF&€º¤)òÉÎCÇiî ¦ÕìÊv»c7K•Úc[m\þÔŸü~ôVx}Í–7wïÏoS“·Â±‡¨¦<4—‰ çû†±´0¯.Ÿ„@¾>/_:Ò¸"ó|ê˜püdc2‚Ì.3G„@£Ó¤n–ûGôæ,#ÉðüÒ3[_ßè„Üuû;$]º^ÏþŸÿƒˆ;endstream endobj 6 0 obj 1772 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:49+01:00 2014-01-29T08:09:49+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000002096 00000 n 0000003986 00000 n 0000002037 00000 n 0000001877 00000 n 0000000015 00000 n 0000001857 00000 n 0000002161 00000 n 0000002415 00000 n 0000002350 00000 n 0000002282 00000 n 0000002202 00000 n 0000002232 00000 n 0000002497 00000 n 0000002563 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [<1F205829729F179EF5BCF230432EF921><1F205829729F179EF5BCF230432EF921>] >> startxref 4140 %%EOF curl-7.35.0/docs/libcurl/curl_easy_pause.html0000644000175000017500000001433512272124467016146 00000000000000 curl_easy_pause man page

NAME

curl_easy_pause - pause and unpause a connection

SYNOPSIS

#include <curl/curl.h>

CURLcode curl_easy_pause(CURL *handle , int bitmask );

DESCRIPTION

Using this function, you can explicitly mark a running connection to get paused, and you can unpause a connection that was previously paused.

A connection can be paused by using this function or by letting the read or the write callbacks return the proper magic return code (CURL_READFUNC_PAUSE and CURL_WRITEFUNC_PAUSE). A write callback that returns pause signals to the library that it couldn't take care of any data at all, and that data will then be delivered again to the callback when the writing is later unpaused.

While it may feel tempting, take care and notice that you cannot call this function from another thread. To unpause, you may for example call it from the progress callback (see curl_easy_setopt(3)'s CURLOPT_PROGRESSFUNCTION), which gets called at least once per second, even if the connection is paused.

When this function is called to unpause reading, the chance is high that you will get your write callback called before this function returns.

The handle argument is of course identifying the handle that operates on the connection you want to pause or unpause.

The bitmask argument is a set of bits that sets the new state of the connection. The following bits can be used:

CURLPAUSE_RECV

Pause receiving data. There will be no data received on this connection until this function is called again without this bit set. Thus, the write callback (CURLOPT_WRITEFUNCTION) won't be called.

CURLPAUSE_SEND

Pause sending data. There will be no data sent on this connection until this function is called again without this bit set. Thus, the read callback (CURLOPT_READFUNCTION) won't be called.

CURLPAUSE_ALL

Convenience define that pauses both directions.

CURLPAUSE_CONT

Convenience define that unpauses both directions

RETURN VALUE

CURLE_OK (zero) means that the option was set properly, and a non-zero return code means something wrong occurred after the new state was set. See the libcurl-errors(3) man page for the full list with descriptions.

LIMITATIONS

The pausing of transfers does not work with protocols that work without network connectivity, like FILE://. Trying to pause such a transfer, in any direction, will cause problems in the worst case or an error in the best case.

AVAILABILITY

This function was added in libcurl 7.18.0. Before this version, there was no explicit support for pausing transfers.

USAGE WITH THE MULTI-SOCKET INTERFACE

Before libcurl 7.32.0, when a specific handle was unpaused with this function, there was no particular forced rechecking or similar of the socket's state, which made the continuation of the transfer get delayed until next multi-socket call invoke or even longer. Alternatively, the user could forcibly call for example curl_multi_socket_all(3) - with a rather hefty performance penalty.

Starting in libcurl 7.32.0, unpausing a transfer will schedule a timeout trigger for that handle 1 millisecond into the future, so that a curl_multi_socket_action( ... CURL_SOCKET_TIMEOUT) can be used immediately afterwards to get the transfer going again as desired.

MEMORY USE

When pausing a read by returning the magic return code from a write callback, the read data is already in libcurl's internal buffers so it'll have to keep it in an allocated buffer until the reading is again unpaused using this function.

If the downloaded data is compressed and is asked to get uncompressed automatically on download, libcurl will continue to uncompress the entire downloaded chunk and it will cache the data uncompressed. This has the side- effect that if you download something that is compressed a lot, it can result in a very large data amount needing to be allocated to save the data during the pause. This said, you should probably consider not using paused reading if you allow libcurl to uncompress data automatically.

SEE ALSO

curl_easy_cleanup (3) curl_easy_reset (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_easy_strerror.pdf0000644000175000017500000000652312272124474016516 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ•Tïo›0ýÎ_qÒ> ¦áÚÆ€­M“hLJLiÒ%´R•Nš2%¤å‡ªí¯ßÙ6iÓMR öݽwïžý”0 úÞÙÚ:š…°l, KëÁbf†W¶†ã¤^Hn­>‡AÈ!T‘ ’µÅXH|É£µ°³®^]ióëºi뢮7õ•í]9°*oô–ãrŸJCû4­ºtoÄ;?’o–K gˆ!…ˆò5/€dlÙ“Èyœq—ùÄWòJrË>äçcN‰ !¸ŒëmªY .ÔEÛÕàJY-!/š¬.oôgmò¢¯¼CÅE.. ˆ4ÐóËÉôl>šï0!Ü~WVÙªË ø¬ér÷E‡sazÊ6UÓBv—Öðá2'ç³±&Òsªºõ•ó Uø §¯ñüd6:KFÓÉ[´( Œ*É]qp8½Û®ÊÚrS "5ЩÅü}‚F4¸O›¦È¡¬LDZk‚I„ÃÈ–«×Üaq«Öº¨Úž3£Ûarâ÷I ák/y¶ÑÂxf§ÁHIÙ€A #¾”¯ 媀x:ôI6 ¤Âˆ]@¤SÑÐKìú’£qt<’Ë}aÑž@”]Ç-Pܲy–ñÑQD)H;E-ó¼—g8#Æ Úyk² {'ç³ \8ÌDÌŽÆç±ÉÒ*™&x0ºj‡ 2¥†v6eÕ5´îï¢Þþ[—UÚ"¹~Øäµÿñ0›;‡ Ž!ϧϱûöЦ«ˆ7‡’"À6/ÆçKÂÝjm.…û52¶ÃͳîVm©½k*+› ¯(󢼑‚P_Éÿið|>×ïѤ6¢ü'šà*ÜE3®äÊ×zºBí+dŒà ´<@ãÚ<€è¾N©0…E°½ó˜.'Öw|þb®ˆŸendstream endobj 6 0 obj 693 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <>stream 2014-01-29T08:09:48+01:00 2014-01-29T08:09:48+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 14 0000000000 65535 f 0000001016 00000 n 0000002824 00000 n 0000000957 00000 n 0000000797 00000 n 0000000015 00000 n 0000000778 00000 n 0000001081 00000 n 0000001335 00000 n 0000001270 00000 n 0000001202 00000 n 0000001122 00000 n 0000001152 00000 n 0000001401 00000 n trailer << /Size 14 /Root 1 0 R /Info 2 0 R /ID [<9F67460768ED40604F5E23378B68A289><9F67460768ED40604F5E23378B68A289>] >> startxref 2978 %%EOF curl-7.35.0/docs/libcurl/curl_easy_recv.html0000644000175000017500000001034312272124467015763 00000000000000 curl_easy_recv man page

NAME

curl_easy_recv - receives raw data on an "easy" connection

SYNOPSIS

#include <curl/easy.h>

CURLcode curl_easy_recv( CURL * curl , void * buffer , size_t buflen , size_t * n );

DESCRIPTION

This function receives raw data from the established connection. You may use it together with curl_easy_send(3) to implement custom protocols using libcurl. This functionality can be particularly useful if you use proxies and/or SSL encryption: libcurl will take care of proxy negotiation and connection set-up.

buffer is a pointer to your buffer that will get the received data. buflen is the maximum amount of data you can get in that buffer. The variable n points to will receive the number of received bytes.

To establish the connection, set CURLOPT_CONNECT_ONLY option before calling curl_easy_perform(3). Note that curl_easy_recv(3) does not work on connections that were created without this option.

You must ensure that the socket has data to read before calling curl_easy_recv(3), otherwise the call will return CURLE_AGAIN - the socket is used in non-blocking mode internally. Use curl_easy_getinfo(3) with CURLINFO_LASTSOCKET to obtain the socket; use your operating system facilities like select(2) to check if it has any data you can read.

AVAILABILITY

Added in 7.18.2.

RETURN VALUE

On success, returns CURLE_OK, stores the received data into buffer, and the number of bytes it actually read into *n.

On failure, returns the appropriate error code.

If there is no data to read, the function returns CURLE_AGAIN. Use your operating system facilities to wait until the data is ready, and retry.

Reading exactly 0 bytes would indicate a closed connection.

If there's no socket available to use from the previous transfer, this function returns CURLE_UNSUPPORTED_PROTOCOL.

EXAMPLE

See sendrecv.c in docs/examples directory for usage example.

SEE ALSO

curl_easy_setopt (3) curl_easy_perform (3) curl_easy_getinfo (3) curl_easy_send (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_multi_timeout.pdf0000644000175000017500000001102412272124475016504 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ•WÛnã6}÷WèÃR‹˜%©+Û¢€›º­Ûl’ÆJ [Š,ÇjeÉ«Ëù‡þJÿ±3”(ÉŠƒE‘ ‘"Ïœ9sfü‰p&ǯîw¼Ÿ}}ã“§jÆÉÓìÓLèEÒýŠ÷ä‡6ø ÜÎÚwñ%ñ•ÍEÂýL›q›„ϳ{7eö°o²:}¨Ó}R4õGj´H–>â’5—.gœûôC”7QFÞØoýþ:›s&ܘrƒí‘ðbF/Ö;À «Âe®²W¸™ÑK+ük„XræpŸÌ…ÄeŽ(O€$ÿ’]/Jæâ‘ÊgžPª;ó9Ã¥ö.Ü ŸÞÓ""uAž-Ái”Öd[”$Šë´ÈÉcÿ$äPq’lÒüItÆ\8Tsá±@_³¾»¼º^¯ÖÇ@¸xúUšÇY³IÈwÁ×øƒí¾×°ÍÉùíÍҸ€§xÕ«ä}ûtå›,9#FñÞì±¾Raêû Ä—ëó›Õu¸ºº| %Ëiµ°ÈIt8diiNš*EÂv‰ÑHHš×I¹µSJzâ„T»¢É6$޲lDœN§í3×äú-ñ!ƒTr¯O%ä럧RƒI7)÷L­'˜ëqy2çž­‚nùJk\œ;<^ÆÒº§tãÂU½2ª"þ»˜ÔR*P^T“}Q¡_Ɇéð9³m‰Ç‡ïïéu¿HöI$)pZ’Maèín‚KæUý’%Ĉ¼½òÍ+îœrÌwŒºGäÐN}hÏ uäR2á·MÏ[¦PO\®$s„6 ª•ñ h<:qŽå¯C;bØn&¢ƒÄô…•¸êTÐAŸš}’פº!ñ¨ÿ‡õÕùoËð!\}X^݆øŠÃ‚<6sl£”³Â,ÊNŽf±ŒÔ˜ˆQ°GA}€8AêE/]0CТܟ¤“ ôt¦Û–Kx Œ÷Xv/EóÎrt ù$4[•îèêÙþz³ì ZË"ŠwFuÂvŒêÂÝ £Ï–„¨^Êš„”IÝ”y²Ûê.ŽìNÇáBº&•Ý9“\ºàÓ†|¼Úm;€¬ë ÒwFÒ ¯È›ý#QlÉ>Ͳ´Jâ"ßTXDõv|¶rÐMʨ+@Ï\(È¡'£âº¨èjK8œ^wõTê ‘¤û=T\T'Ù‹+²ð¬½Cè“hŽÝ ACÍ#ýº!ä–À$K‡¾@(i÷Áe-m 9CÚÊäF ý¥íyƒ®*l£œ*±€”¢EÝæwIÁ|îfXSo6ó|qÜö´À7?TÓ fŽ#LŽ'~]ï`sS%•ÎêÈ Œd ª×+²þåêöâGryÕáWx" ƒöô®6CÁ8 ! iŽ#;çLÚ ¢k €3òhIEywMšWumX'2Á; Í%X†rúÒ8²°¤.§ÚCà0¿ïô-OX)i]µûúÓ!ÓÁî¥W×­‘Üüt{yþº' [1á÷ÓÂA³ŠšYºŠÜ$UZ‚“]ÔF nð9-JËÅsÚ‰Wº’AžçØé‘6ÕúçeQ'ßtÛ÷T#«Xè+å¥þWS™ëôš·àG …òÞEÉ RÕÂJ½¬®·V,}-¡¹`:ßónÙ7ž§læ©f?ˆÁe2àbDÿ=EŒyQw=”û¶î¡uQ´ÃÊGºÇ& øA¯d›˜²iµå2ÑmÕp ”ƒ0½ýžvžIØE‡ ÆÓ®ñbéëæ8ñimϰ-z²tVl åìÄP'¡ G3Ý=½Y†·7—ä Ì”)OÐÅÅírbóÃðÔmUƒ4¢rC†ye3õíøvR–°ŒûªS˜Æ\pw½:_\ÛõBkÌ—Šþü6"zþº§)æ/¾<„ÙLò ßûiÌkòMÏê>CsàÐÞÿ}|ŰKr#°Ðɘ]äãÇÌ'#w–Ðÿƒçæ½ç]ïHïa\Ú¸»áµˆÀ lÛ0¨ÖÚK»‘χÞtì«/Z48åñäHüü¢^ó´Ý€½åEƒJ!N8:»Hô €Ñ54U7À“. Ü _ù_àN0ûÀšÊvƒàÕ篹 EfÛƒ¦`׃]üA}FÁͼÞçéêbñÃêbÞM<Žr‚éŽû$§RÀ×6›vÔ0Öù€ÑáKº§ëå’,.ÖWÇ)é|šŸcœ>gn×穦ïlRó¼!u£ÃÒ¼óÀÇŠ‡Ò>T®íPhb“( ¬÷ÂÿyË$Ó“}Ð÷½ë‹'¿nœ2Ü Z-¶R >¦Ì%ŒÑ-¥£yŒÚ„VaÛæùëàÓ‚ÙC“ƒ—œ{úEè¥Ò7o|´ g¿Ã×/ª‹endstream endobj 6 0 obj 1807 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:49+01:00 2014-01-29T08:09:49+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000002131 00000 n 0000004021 00000 n 0000002072 00000 n 0000001912 00000 n 0000000015 00000 n 0000001892 00000 n 0000002196 00000 n 0000002450 00000 n 0000002385 00000 n 0000002317 00000 n 0000002237 00000 n 0000002267 00000 n 0000002532 00000 n 0000002598 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [<379F2E1A0BF3BA70C8D49876CFCCAF9D><379F2E1A0BF3BA70C8D49876CFCCAF9D>] >> startxref 4175 %%EOF curl-7.35.0/docs/libcurl/curl_multi_socket.30000644000175000017500000001532212213173003015666 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_multi_socket 3 "9 Jul 2006" "libcurl 7.16.0" "libcurl Manual" .SH NAME curl_multi_socket \- reads/writes available data .SH SYNOPSIS .nf #include CURLMcode curl_multi_socket(CURLM * multi_handle, curl_socket_t sockfd, int *running_handles); CURLMcode curl_multi_socket_all(CURLM *multi_handle, int *running_handles); .fi .SH DESCRIPTION These functions are deprecated. Do not use! See \fIcurl_multi_socket_action(3)\fP instead! At return, the integer \fBrunning_handles\fP points to will contain the number of still running easy handles within the multi handle. When this number reaches zero, all transfers are complete/done. Note that when you call \fIcurl_multi_socket_action(3)\fP on a specific socket and the counter decreases by one, it DOES NOT necessarily mean that this exact socket/transfer is the one that completed. Use \fIcurl_multi_info_read(3)\fP to figure out which easy handle that completed. The \fBcurl_multi_socket_action(3)\fP functions inform the application about updates in the socket (file descriptor) status by doing none, one, or multiple calls to the socket callback function set with the CURLMOPT_SOCKETFUNCTION option to \fIcurl_multi_setopt(3)\fP. They update the status with changes since the previous time the callback was called. Get the timeout time by setting the \fICURLMOPT_TIMERFUNCTION\fP option with \fIcurl_multi_setopt(3)\fP. Your application will then get called with information on how long to wait for socket actions at most before doing the timeout action: call the \fBcurl_multi_socket_action(3)\fP function with the \fBsockfd\fP argument set to CURL_SOCKET_TIMEOUT. You can also use the \fIcurl_multi_timeout(3)\fP function to poll the value at any given time, but for an event-based system using the callback is far better than relying on polling the timeout value. Usage of \fIcurl_multi_socket(3)\fP is deprecated, whereas the function is equivalent to \fIcurl_multi_socket_action(3)\fP with \fBev_bitmask\fP set to 0. Force libcurl to (re-)check all its internal sockets and transfers instead of just a single one by calling \fBcurl_multi_socket_all(3)\fP. Note that there should not be any reason to use this function! .SH "CALLBACK DETAILS" The socket \fBcallback\fP function uses a prototype like this .nf int curl_socket_callback(CURL *easy, /* easy handle */ curl_socket_t s, /* socket */ int action, /* see values below */ void *userp, /* private callback pointer */ void *socketp); /* private socket pointer */ .fi The callback MUST return 0. The \fIeasy\fP argument is a pointer to the easy handle that deals with this particular socket. Note that a single handle may work with several sockets simultaneously. The \fIs\fP argument is the actual socket value as you use it within your system. The \fIaction\fP argument to the callback has one of five values: .RS .IP "CURL_POLL_NONE (0)" register, not interested in readiness (yet) .IP "CURL_POLL_IN (1)" register, interested in read readiness .IP "CURL_POLL_OUT (2)" register, interested in write readiness .IP "CURL_POLL_INOUT (3)" register, interested in both read and write readiness .IP "CURL_POLL_REMOVE (4)" unregister .RE The \fIsocketp\fP argument is a private pointer you have previously set with \fIcurl_multi_assign(3)\fP to be associated with the \fIs\fP socket. If no pointer has been set, socketp will be NULL. This argument is of course a service to applications that want to keep certain data or structs that are strictly associated to the given socket. The \fIuserp\fP argument is a private pointer you have previously set with \fIcurl_multi_setopt(3)\fP and the CURLMOPT_SOCKETDATA option. .SH "RETURN VALUE" CURLMcode type, general libcurl multi interface error code. Legacy: If you receive \fICURLM_CALL_MULTI_PERFORM\fP, this basically means that you should call \fIcurl_multi_socket(3)\fP again, before you wait for more actions on libcurl's sockets. You don't have to do it immediately, but the return code means that libcurl may have more data available to return or that there may be more data to send off before it is "satisfied". In modern libcurls, \fICURLM_CALL_MULTI_PERFORM\fP or \fICURLM_CALL_MULTI_SOKCET\fP should not be returned and no application needs to care about them. NOTE that the return code is for the whole multi stack. Problems still might have occurred on individual transfers even when one of these functions return OK. .SH "TYPICAL USAGE" 1. Create a multi handle 2. Set the socket callback with CURLMOPT_SOCKETFUNCTION 3. Set the timeout callback with CURLMOPT_TIMERFUNCTION, to get to know what timeout value to use when waiting for socket activities. 4. Add easy handles with curl_multi_add_handle() 5. Provide some means to manage the sockets libcurl is using, so you can check them for activity. This can be done through your application code, or by way of an external library such as libevent or glib. 6. Wait for activity on any of libcurl's sockets, use the timeout value your callback has been told 7, When activity is detected, call curl_multi_socket_action() for the socket(s) that got action. If no activity is detected and the timeout expires, call \fIcurl_multi_socket_action(3)\fP with \fICURL_SOCKET_TIMEOUT\fP 8. Go back to step 6. .SH AVAILABILITY This function was added in libcurl 7.15.4, and is deemed stable since 7.16.0. \fIcurl_multi_socket(3)\fP is deprecated, use \fIcurl_multi_socket_action(3)\fP instead! .SH "SEE ALSO" .BR curl_multi_cleanup "(3), " curl_multi_init "(3), " .BR curl_multi_fdset "(3), " curl_multi_info_read "(3), " .BR "the hiperfifo.c example" curl-7.35.0/docs/libcurl/curl_easy_init.html0000644000175000017500000000536312272124467015775 00000000000000 curl_easy_init man page

NAME

curl_easy_init - Start a libcurl easy session

SYNOPSIS

#include <curl/curl.h>

CURL *curl_easy_init( );

DESCRIPTION

This function must be the first function to call, and it returns a CURL easy handle that you must use as input to other easy-functions. curl_easy_init initializes curl and this call MUST have a corresponding call to curl_easy_cleanup(3) when the operation is complete.

If you did not already call curl_global_init(3), curl_easy_init(3) does it automatically. This may be lethal in multi-threaded cases, since curl_global_init(3) is not thread-safe, and it may result in resource problems because there is no corresponding cleanup.

You are strongly advised to not allow this automatic behaviour, by calling curl_global_init(3) yourself properly. See the description in libcurl(3) of global environment requirements for details of how to use this function.

RETURN VALUE

If this function returns NULL, something went wrong and you cannot use the other curl functions.

SEE ALSO

curl_easy_cleanup (3) curl_global_init (3) curl_easy_reset (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_unescape.pdf0000644000175000017500000000761112272124472015413 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ•VÛnÛF}×WLS& k½^Ñ¢€’ª€ ÙN%*ˆ!M­$ÔÒá%Nò ýèÎ.IQ” …KæîΜ9sæ,?% ¨þ´ßÉat³ðaWŽ(ìFŸFÌ,Bû•àm„ý ÚŽš3 |~(HBt1!õ z­­¤.²¿j%Ë$~––x´!KŸôS{Ì]J(õ­ÛXÕq—[í?£ßGcJ8ø ¦ 1- ]Y`‚ùȺ›ØWˆW™KÜP šh3²n§vô÷ NN‰C}3®—©Æ6„cX-æ°‘I¾‘%T{ »TÇÀôÌ5ñ‡„aÿ³Ôkœ˜•ð œvI•z©ÄˆÀ•v¡*Rµk`Ô1æ”OCóH`ö-îîß/gË~k[o‹Þú>UIVo$ü¬K¸ÑÈþÈ1¤$û¸€Ïø„æ)Òu³`´ëÓÕ¤{ÒÕgfœ°€²v×uz,Ï'~@iWžªÀ}lFœþ\&Õ®Úkâ&B·ãÑþév,»gç×éòÝbö>šÝß [|BÐýS™g²’°­UR¥¹"°*å¼Ð!Ž8&7dɸüz¦ÀAŠÐ%Üm¤ª¬d¼ùÎh„!ñkþQ^ÄŽ‘X´OË#xI3Ty®² ñãl +z¡*R˜Eõš8öˆ{|E¦Ï\èsÕëÓ%Â]n”¿TZþHÕs]Ai U1¼yÎâTµÞ@¬6PȪ.¢‰+ˆKÜ£š¡ðâÑNT/¦Ãìt×F¨ãšbâ,Ë“¸ÂŒM`¤¨É®å'•,Ê6E!͈v­>~„—½Äçø#Õ*“N¸8w-ËX‘•7é.­`ß—ºÊ/1~zˆÍŒö$½¡[¨úð$ ´/ÓÅ'yÑÈ-†Äe#ר@œbÓZ+i3í.Ü·¾TðùøÂ)Ic„(2Ÿ†'2k\v¶5¢¸²qp(ã¼¶+$Íõ<´ÑII¦¢]}ªÒÄ•²Òˆèõ¹wåÖ¥Ô¨æY®Lº¦OWxäêD+ÿ 4òÚ¨ÔðÓæîf³L¿IÒ Þ8Hõ£'µ®ƒžÁzëéTùÑ*hSu]V àm!°U#Ë£¤´B|Íë+Û VQ0›\I,­ÚCZµì2âÁÅ53ö8qzûk=ö&`rD‡.깬¿Ù|òv6ŸEC÷ÐÓæÁPVKôr >jˆ8×gåâÐôdüo‡*÷ym´T±}¯˜Ñ“¦ëï9ßÔþ_÷ÜÚÚ¤67”Z*Þ.B»ã5¶B§ÈwÓõ!¹M˜{=½kk1V‹;ø`33à1k2_MMðã½ôŠáOž{¡œ’¶¶òT¡…4öM8v²8¤êÄs /àn5ŸCºE1ÀgÈŠÓ 3i‡€ñÅD?¹­§S˜Ì—÷g½á¼õIïN:×NÛeK¯;UÛ -Ù-,~{\„^ ­£bܤÅ&_ûŠ…ºòm„Ê…cq·q‘ìSÊÌqÇëÞ–˜?Fàç_Ì»¢âendstream endobj 6 0 obj 1166 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:46+01:00 2014-01-29T08:09:46+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001490 00000 n 0000003370 00000 n 0000001431 00000 n 0000001271 00000 n 0000000015 00000 n 0000001251 00000 n 0000001555 00000 n 0000001809 00000 n 0000001744 00000 n 0000001676 00000 n 0000001596 00000 n 0000001626 00000 n 0000001891 00000 n 0000001947 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 3524 %%EOF curl-7.35.0/docs/libcurl/curl_multi_strerror.30000644000175000017500000000322312213173003016255 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_multi_strerror 3 "26 Apr 2004" "libcurl 7.12" "libcurl Manual" .SH NAME curl_multi_strerror - return string describing error code .SH SYNOPSIS .nf .B #include .BI "const char *curl_multi_strerror(CURLMcode " errornum ");" .SH DESCRIPTION The curl_multi_strerror() function returns a string describing the CURLMcode error code passed in the argument \fIerrornum\fP. .SH AVAILABILITY This function was added in libcurl 7.12.0 .SH RETURN VALUE A pointer to a zero terminated string. .SH "SEE ALSO" .BR libcurl-errors "(3), " curl_easy_strerror "(3), " curl_share_strerror "(3)" curl-7.35.0/docs/libcurl/libcurl-easy.30000644000175000017500000000442312213173003014532 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH libcurl 3 "12 Aug 2003" "libcurl 7.10.7" "libcurl easy interface" .SH NAME libcurl-easy \- easy interface overview .SH DESCRIPTION When using libcurl's "easy" interface you init your session and get a handle (often referred to as an "easy handle"), which you use as input to the easy interface functions you use. Use \fIcurl_easy_init(3)\fP to get the handle. You continue by setting all the options you want in the upcoming transfer, the most important among them is the URL itself (you can't transfer anything without a specified URL as you may have figured out yourself). You might want to set some callbacks as well that will be called from the library when data is available etc. \fIcurl_easy_setopt(3)\fP is used for all this. When all is setup, you tell libcurl to perform the transfer using \fIcurl_easy_perform(3)\fP. It will then do the entire operation and won't return until it is done (successfully or not). After the transfer has been made, you can set new options and make another transfer, or if you're done, cleanup the session by calling \fIcurl_easy_cleanup(3)\fP. If you want persistent connections, you don't cleanup immediately, but instead run ahead and perform other transfers using the same easy handle. curl-7.35.0/docs/libcurl/curl_strequal.html0000644000175000017500000000504612272124467015647 00000000000000 curl_strequal man page

NAME

curl_strequal, curl_strnequal - case insensitive string comparisons

SYNOPSIS

#include <curl/curl.h>

int curl_strequal(char * str1 , char * str2 );

int curl_strenqual(char * str1 , char * str2 , size_t len );

DESCRIPTION

The curl_strequal() function compares the two strings str1 and str2, ignoring the case of the characters. It returns a non-zero (TRUE) integer if the strings are identical.

The curl_strnequal() function is similar, except it only compares the first len characters of str1.

These functions are provided by libcurl to enable applications to compare strings in a truly portable manner. There are no standard portable case insensitive string comparison functions. These two work on all platforms.

AVAILABILITY

These functions will be removed from the public libcurl API in a near future. They will instead be made "available" by source code access only, and then as curlx_strequal() and curlx_strenqual().

RETURN VALUE

Non-zero if the strings are identical. Zero if they're not.

SEE ALSO

strcmp (3) strcasecmp (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_easy_escape.30000644000175000017500000000404412213173003015444 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .\" .TH curl_easy_escape 3 "7 April 2006" "libcurl 7.15.4" "libcurl Manual" .SH NAME curl_easy_escape - URL encodes the given string .SH SYNOPSIS .B #include .sp .BI "char *curl_easy_escape( CURL *" curl ", char *" url ", int "length " );" .ad .SH DESCRIPTION This function converts the given input string to an URL encoded string and returns that as a new allocated string. All input characters that are not a-z, A-Z, 0-9, '-', '.', '_' or '~' are converted to their "URL escaped" version (%NN where NN is a two-digit hexadecimal number). If the \fBlength\fP argument is set to 0 (zero), \fIcurl_easy_escape(3)\fP uses strlen() on the input \fBurl\fP to find out the size. You must \fIcurl_free(3)\fP the returned string when you're done with it. .SH AVAILABILITY Added in 7.15.4 and replaces the old \fIcurl_escape(3)\fP function. .SH RETURN VALUE A pointer to a zero terminated string or NULL if it failed. .SH "SEE ALSO" .BR curl_easy_unescape "(3), " curl_free "(3), " RFC 2396 curl-7.35.0/docs/libcurl/curl_multi_timeout.30000644000175000017500000000561212213173003016065 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_multi_timeout 3 "2 Jan 2006" "libcurl 7.16.0" "libcurl Manual" .SH NAME curl_multi_timeout \- how long to wait for action before proceeding .SH SYNOPSIS #include CURLMcode curl_multi_timeout(CURLM *multi_handle, long *timeout); .SH DESCRIPTION An application using the libcurl multi interface should call \fBcurl_multi_timeout(3)\fP to figure out how long it should wait for socket actions \- at most \- before proceeding. Proceeding means either doing the socket-style timeout action: call the \fBcurl_multi_socket_action(3)\fP function with the \fBsockfd\fP argument set to CURL_SOCKET_TIMEOUT, or call \fBcurl_multi_perform(3)\fP if you're using the simpler and older multi interface approach. The timeout value returned in the long \fBtimeout\fP points to, is in number of milliseconds at this very moment. If 0, it means you should proceed immediately without waiting for anything. If it returns -1, there's no timeout at all set. An application that uses the multi_socket API SHOULD NOT use this function, but SHOULD instead use \fIcurl_multi_setopt(3)\fP and its \fPCURLMOPT_TIMERFUNCTION\fP option for proper and desired behavior. Note: if libcurl returns a -1 timeout here, it just means that libcurl currently has no stored timeout value. You must not wait too long (more than a few seconds perhaps) before you call curl_multi_perform() again. .SH "RETURN VALUE" The standard CURLMcode for multi interface error codes. .SH "TYPICAL USAGE" Call \fBcurl_multi_timeout(3)\fP, then wait for action on the sockets. You figure out which sockets to wait for by calling \fBcurl_multi_fdset(3)\fP or by a previous call to \fBcurl_multi_socket(3)\fP. .SH AVAILABILITY This function was added in libcurl 7.15.4. .SH "SEE ALSO" .BR curl_multi_fdset "(3), " curl_multi_info_read "(3), " .BR curl_multi_socket "(3), " curl_multi_setopt "(3) " curl-7.35.0/docs/libcurl/curl_global_cleanup.pdf0000644000175000017500000000742412272124472016561 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœVÛnÛF}×W Ї…¹Ùåu‰’V\$vñ%°‹€¦V"Sr׿ņ>¢ÿÜÙ%W"Ø´f9çÌ™3³~JPý™~ÍêíçöÝŠÂ~õ´b&Ó¯¢÷àú‹l·ßaø¤á)d ¾ÂIÌ {YÝ9ÅÐÖ_÷µzÈë¯E-r9<Þ;Á½ uõ c®çG”Pš81–×ðÚ î?Ù_+Ÿ!FR¤@ÒH³bÈ>¬œ›wîdQ‘( Y¶]9×nömÆÙ§$¤ xÌ×aªy^¢ Œ_Xª0Æl3xñ=nà6_nn?m®7§cÅ Ðù©’E=lüª³¾Õ?Hù›>îé& }?4õ<+[OJÒ±˜;§Ú^–èÙeÔQÕöÞýÅHµdF˜áÄñõæ÷Ïן²ëÛ›¥63šYYu°dÑWJB+¨>tjh |Ê‹§¡jÅËZY’jÜQý9ÙJVýØÌ(íqbt`£è §õÀØ¥ƒ ¸±ÃS,„q†NÇîûÄOø „ëãØãR 5Š—×õÏè„$Mù¾ ÿ-(§œGGÉBÀNµ ò¢4pP4ù¿–0 û$ˆm¥¢?¦$¦‰e Îè!?a½ªçf&lLâø¨ÐU> |ÎN q£Ð®­až·Âô!à!aA¸œ•­’†®’{;dÙJ¢Ð$Ì~¾;³>KÕC_¶.KHÊyàˆ| ]¾dœð©õ³¢:ÌŠc=@C~Áͩˆðc…hŽÞàšÖT=¼”BB.m*c§a‚£ ê”Ê q+VŽvêK Ñü+‰O[µoóîŠù6Rú #~¥$”ûãŠìʼÕbê ]ÞhD£ÚîHT«¤Ä q½·ªÏø(èV‰N¾1Šù$Ò™pkPô1§úoÇ8a¡^›'-ô5 j^D_潆ü¾µŒÇ$Š’)Á{QäC'–=÷P:ó£U~pŽe¸©#«m‚™uŒ}:¹¦µ›¨"«ÕÂícØ¢O¡«šªÎÛú`뤶ӕîs1޼’ÿUE?n– páè—ª/'; šFË”D§É™›A˜>×nè /щs¶ãV }BuR»Ï6B˜¦oEW´Õã8 r©+ç8ÔúxjÊ!Ã#¯;Õšn.!ÝÐÜ®ó\µJ6Bö¸ÁÍÞÖÏÙZ[ÑçUmT.•õÔ設oÓ¾ô.ÞÕŽÌ£†oµèt%³AŸm„ã„ʇ>ÏíE¹^û›ÛW/ÊóU·¬8NnE;¯F’«³{H¯?ê/µ;û_—kp!‰ÇBNlUˆNˆçïCB¸1 µî` ü)À§46ÈŽ Ó®³Õßøù]„…Gendstream endobj 6 0 obj 1049 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:46+01:00 2014-01-29T08:09:46+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001373 00000 n 0000003253 00000 n 0000001314 00000 n 0000001154 00000 n 0000000015 00000 n 0000001134 00000 n 0000001438 00000 n 0000001692 00000 n 0000001627 00000 n 0000001559 00000 n 0000001479 00000 n 0000001509 00000 n 0000001774 00000 n 0000001830 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 3407 %%EOF curl-7.35.0/docs/libcurl/curl_multi_fdset.30000644000175000017500000000711012213173003015477 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_multi_fdset 3 "2 Jan 2006" "libcurl 7.16.0" "libcurl Manual" .SH NAME curl_multi_fdset - extracts file descriptor information from a multi handle .SH SYNOPSIS .nf #include 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); .ad .SH DESCRIPTION This function extracts file descriptor information from a given multi_handle. libcurl returns its fd_set sets. The application can use these to select() on, but be sure to FD_ZERO them before calling this function as \fIcurl_multi_fdset(3)\fP only adds its own descriptors, it doesn't zero or otherwise remove any others. The \fIcurl_multi_perform(3)\fP function should be called as soon as one of them is ready to be read from or written to. If no file descriptors are set by libcurl, \fImax_fd\fP will contain -1 when this function returns. Otherwise it will contain the higher descriptor number libcurl set. When libcurl returns -1 in \fImax_fd\fP, it is because libcurl currently does something that isn't possible for your application to monitor with a socket and unfortunately you can then not know exactly when the current action is completed using select(). When max_fd returns with -1, you need to wait a while and then proceed and call \fIcurl_multi_perform\fP anyway. How long to wait? I would suggest 100 milliseconds at least, but you may want to test it out in your own particular conditions to find a suitable value. When doing select(), you should use \fBcurl_multi_timeout\fP to figure out how long to wait for action. Call \fIcurl_multi_perform\fP even if no activity has been seen on the fd_sets after the timeout expires as otherwise internal retries and timeouts may not work as you'd think and want. If one of the sockets used by libcurl happens to be larger than what can be set in an fd_set, which on POSIX systems means that the file descriptor is larger than FD_SETSIZE, then libcurl will try to not set it. Setting a too large file descriptor in an fd_set implies an out of bounds write which can cause crashes, or worse. The effect of NOT storing it will possibly save you from the crash, but will make your program NOT wait for sockets it should wait for... .SH RETURN VALUE CURLMcode type, general libcurl multi interface error code. See \fIlibcurl-errors(3)\fP .SH "SEE ALSO" .BR curl_multi_cleanup "(3), " curl_multi_init "(3), " .BR curl_multi_timeout "(3), " curl_multi_perform "(3) " curl-7.35.0/docs/libcurl/curl_escape.pdf0000644000175000017500000000765612272124471015060 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ•VÛnã6}÷WL·(,-"†¤îhQÀ»u޳µ•R§(‰¶UØTV—M7ßÐî’,)I±- D/3‡gÎòP€ª_ûMN“˵ûrBa?ù4azÚOr‚w.Ô@´›4{øüÐ&AÑi›P¢ÇÉÖHêâø‡(“øAÜö Çì^™w)¡Ô7®bYÇGx¾Ðü=úebQÂÆL0eˆ)I説6_NŒÕÌœ"Jœe.qC‘Déĸš›ÑŸŒœ‡ú`1®¦©Â5„ܬ— d’§¢„ê `Ÿ©˜œ¹:ºí0l£jŽ=„ÓNÉRM5€±q¦¨ŠLîPƒSX,dÄSÀ<èu›ÛÕõ‡ÍbÓ/mOÛb7¾Ídr¬S?¨\ª?äð£ähJ’C\ÀÛ—ÐŒ!U—kF»ºÑøgnˆŠË/#å.án»<“e%âô­æ‡Ä ÀRÌ£¬HZZÑ!+Ïà1;¢¶s9Tˆ«};)оÔSQ½¦F›ÏvÇr´QmÁ+‚̆‚d^›Qaõ5VùPWPjyB•C,­v±L¡U]H„W—ƒ<çõUxî„$ ]ÞǸÏëêxÚã1·ôa† êš’pl0ݘquÎL`†äe¤qœT¢([…™ã×zº€™õäP+lø¾/(çØkNè}rÌŽL ïYo4Zéø¬ö0t›µ‚Ø¢0¹²±00¬Æ±ŽL£À†v³5J¥…;ã»Õ ±ã?™â±z45r+ÍöYa2ôšÀuŒ¿âT$Ù QÖ§{QÜ™D'PÅc*hôvk,vZ!SŒA(ã¼m¶)Ò£{Ȳo÷U×ïë“•J_ŠJ–^ŒÝ]ZÓX—BUcê±\êdM=¦¸a:Îß(’¼Ö‚Õ¼·™»Þ,³'Aš¶Á{i7nst¤Ör”8ÙÙaëÓP=üì-•uY5pw…hÀ*T@{Ñ"˾äõÔDe†!÷ $=Í¥À£UȪ†M„ã63v§·\…ÚVÜÍ>ÂìŒ+ï¹xÀöb9{·X.¢Û±àl'Æ×Ï}\€Ú$ÎÅ3‡râ÷düO‡*y}LU`ñR¯˜Ñ½"ë”o8_Ÿük7ÜÖH3“kB ï=j&B»í5B¥8"ê¦æcjíÀ!ÜëÉÝëyt³^ÁGS_´3fË›¹~¾’^±ûÙC/“!e[#Ï$…64xv³(N™8‹r‹ÕÍr Ù¥;ÕƒqvDÆtÚ1`|§èèƒ{z>‡Ùrsý¯÷´®Z-›’«å)­ÓN4ºœã8˜Æóºí jW˜ÌGc°Cˆ㙓€xáh¬~ÿâävÕãvè5}àõæ£á@ãÝÍà Uô×t¯ïª/‰7|ÅErN)ož*Ø7352&¿âïía³‘endstream endobj 6 0 obj 1203 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:45+01:00 2014-01-29T08:09:45+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001527 00000 n 0000003407 00000 n 0000001468 00000 n 0000001308 00000 n 0000000015 00000 n 0000001288 00000 n 0000001592 00000 n 0000001846 00000 n 0000001781 00000 n 0000001713 00000 n 0000001633 00000 n 0000001663 00000 n 0000001928 00000 n 0000001984 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [<48354620CCCE20BCC4C6E30B2C7D5175><48354620CCCE20BCC4C6E30B2C7D5175>] >> startxref 3561 %%EOF curl-7.35.0/docs/libcurl/curl_slist_append.pdf0000644000175000017500000000735112272124471016275 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœuUÛnÛF}çW Ò‡†µæ.¹$·i ¨‰€8eU¢‹vaÐÔJbK‘ /PóùèÎ./¢,™{8sæÌ™Ù/` ¶ú´ßñÁ¸Yù°+ vƃêCh¿âü" P­ѼCÁgà ‡ƒA© >…ðd<šq]¤Ïeš”Õst<Êlód:O¤É‹:±&ŒÛĶ}ó.Êê(…q¸õwøÙ˜Ø„QŒczé‰àŠãA87ÌÅÔz‹Œñ”rÂ…ƒ¬ÂaÞͬðŸ_f×öaB™:¶Çï)¢Í"(«"ÉvPåe M´Aú æŸP:Ýú¯Åýr}»>ÃZŠmBó§$‹Óz#á•õFý!û_œ¹ºLYÇÕ@¸Ñd…å߬¨ÝÕÉ<âóV¸¾¤D}›¶€8Ï0D¼ Œ£q} î’.L£ÆeæîÙ¬E¬ð‡E—šÓùÃL‡e8’z ~?8æ46ܧBt”ë4…cždªÎaç“-n7 ÁB0ßüŠÊã´ÇŠ<Û]CŽÂ§¤ìí6àÀ8#1ë׆’$靖ÃM1ûsz·œ¿ZáN@x_ÕöQ¶I¥^=êñøÕ_ïóù;\•ݶÕgïÇ|¥ÿ»†7Ç"Ú¢Ÿß¨Ýö¶‹¯ñ2*¿>—²ÊÕ“Ùp¸Eè~> Ãå§ÙôãluÝÜÍûmÞóûGYlóâÐhPʺëŒÕE‚›+mdÝ]ZwÐ ´¡¯nöíõm”ë/«Ù ¦óõý.«Q—SѺü•Á}NDo6S€¾r&”R‚ë7_ëÃöê\»x[Ê9Ž7ñnÿ\gÀlÛѱ]¯»Ä© 4 ßñó?€…d«endstream endobj 6 0 obj 1006 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:45+01:00 2014-01-29T08:09:45+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001330 00000 n 0000003210 00000 n 0000001271 00000 n 0000001111 00000 n 0000000015 00000 n 0000001091 00000 n 0000001395 00000 n 0000001649 00000 n 0000001584 00000 n 0000001516 00000 n 0000001436 00000 n 0000001466 00000 n 0000001731 00000 n 0000001787 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [<7DF4F7DABC813681909BC74164D1D588><7DF4F7DABC813681909BC74164D1D588>] >> startxref 3364 %%EOF curl-7.35.0/docs/libcurl/curl_multi_info_read.pdf0000644000175000017500000001146312272124472016750 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœXÙnÜF}ï¯($f êYÜǃ4±(äDjO0Í®n1f“m.„`þÀ=çÖÂ¥e#VÌZîvî¹§ô…¹Üc.ý1?óýâì6f»vá²ÝâËÂS‹ÌüÈ÷ìŸklHèÃz»Ðg< §>OR¶ÞãHÈEÌÖÏ‹{'ï›òã¾/»âcQmëÌ6Žÿ°deñ‰—+ºÜucç:«ú¬dß=±üÏú—ÅÊ僕N¤p‚§!ùáGl}µpnΗoà7V½‡©ßÖ›…s}±\ÿ1ñZ¸IöÜ]'+¶©—"àiÎsEÎ?˲ä*| ß×»•™Á ˳×u5®ƒ#Û¾Ê)vö\”%àßõ ®`•ªO}]¼$æ‘­Ýs;Ö.àn`kçtM`e†vÅ^ž²¾êŠ—Ý|¸º¢ õípòËÚbWQñ•áz§Ü-É÷¥Y弪; Y²Øf{9D+ÀnÇ´Ÿ³ËNŸ)ª¶#’7çtJ' ®ÇŒˆ}.ÒÄVvÂS1m±9jf_™œ™[pIÇ£¤SwDh;úL¼DÜlÔQjt v¹?t…¥‹q´®ßljw©µp{syóóßæMÀù$6‘€èµp¨7Y—©’ -¯Ï4`«ûÏT°í›'›"G?à~`ú×瞈ÔÍO’åc@ëᬣv ‡6±[&5/%ÄÇAËŒYLIŠ˜†òŸ]¸ DÊCwÈïLï4K?FÊ@ÂÔ\tOàùðÙŒéQÓLä”|`‘º9²FýåËÊ’ÌÚ—¿ò 0Ûu¤°© ‚’zº…¨HoŒØx©£¨ðxZzªkG6/ hšR˜…ŒŸòÅrܰ-öÕ¶OY[äÓAª)Ê© ¢Œlk¾Üj/*Ss…A?…š  ª‡:ã»ùX>ÑGL"ßuí7 ËØ]i®M0½QëQAt›"Àg5«¯¾¿êYM£áTáö5]‘÷eÖ°(éFâükìÐ` Cc)²˜ìQ–òŒ¾õ-Mç¾UÎÞŸZ‰þ«ˆ«”uø(Á®_MZ7(¦ñàñV'pØÖR¡dåâ[@KBÈ ÛÌF+ðØQ™ ˜{Xª_¥6Ô8&>+Mÿ¤MáØêûÝÏ ãòíråÅAß9;aÏvB[NÞ¸-;9SÞÑy£xÙ‰ŠDçø-ÃYªU•á.Ç,QGß,œ¾¢bþ©˜BÏ(~¿‰œbÃNÈ9c?T†i¯§žûj⑲VcüR$©±4Í¥‰oÕd^|Í5ýÁW²–zû,_JTF ä,]Ê—™HZp¢,ƒ^4 \¹½ƒýïf¤CÁíóÆßjzÇP÷êobòP å0¾ cF˜²M*:çpn†¶I‹ö È›­ipññÝû› #(´šï‹î wÚ ÑÄx6ãäw}=Çñ^lÐPÅWÁc¢T;o›º‚ü¤†ìLˆTôd>ë(ÌÈu§‹Ÿp;·©:Gñ'ÜM£‘-ˆ!ˆš«xçUUÄ„Q´Ïê)1˜áùTäžNÞWÃ5ý ]0Æärãè¯Ê7Žôîå€ìmä×ÊX«ûrÛœi•ÚÃk®VO$ÙÎE9ahe‡ÊŸ¹4×Ê®”[CñV==8…®ÞãK»A½;<óÛI]åV!xì4K/Íïi ò‡†þþï..ØùÕÝûyƒNÒúZωÍ5H5Nç—ÁV 8ûCq„|zð„ÿïU3YtÍV=ØI-`P¿žL"™{i^Ä x°ð3¿@b1D÷1iB0„ƒ®~'s&\7P7‘¥Aî¹X/~ßÿ 5Ôendstream endobj 6 0 obj 2104 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:46+01:00 2014-01-29T08:09:46+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000002428 00000 n 0000004308 00000 n 0000002369 00000 n 0000002209 00000 n 0000000015 00000 n 0000002189 00000 n 0000002493 00000 n 0000002747 00000 n 0000002682 00000 n 0000002614 00000 n 0000002534 00000 n 0000002564 00000 n 0000002829 00000 n 0000002885 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 4462 %%EOF curl-7.35.0/docs/libcurl/curl_getenv.pdf0000644000175000017500000001013412272124471015071 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ}VÛnÛF}×W,Ò‡’µÙ ¯hQ@Iý Â±]›IØEA‘K‰ / /RüùèÎì’"e§—³çÌœsF_£œ0ü ÿ“rñæÎ'ÛvÁÈvñeÁõC2üKJò6‚~e ó'¾ ~(i’¨\XIßÿlU§*;úwápp&à\”.¸#©ã’è¸x°–|´I‘oð{)œ†¡´ÞÇUdVåïè…ÃBêJSex«/®MU¨hè"°¥ãr*²”ž~áz…‡žã.uñÐûKü~"$u˜O–\èÇçLu±À!ë°l¦Òõ¼ñ 3,U×79ØÂµâ¢W$«å$p \Ç:äM]•ªêH—J3=':Ôñ™H ô÷Ÿ®onï×÷y8 ¢#êŸò*)úT‘_ÿüCw¿i‰®Ñë+ÙÅ y=㇀Báck“ºj;bN ˆ8'.}0p×ÏPx*Ãñù£ýËôx$ă‚^&>¿_Þ¿»[ßFë›ëóaÌ(ý@R \îc¯:è)oILöuÓÅ›B‘cï÷ªÑmïvŠœjpˆï†S ï¤J(’õUÒåuuAJÃpºš¨²/âN‘¼kÉFíb›cǘ€Ö}Câ*%û¦¶¹3~ ˆv—ÌázáHgœ¨º<­çU§šÌæÌŠ#‘¸(H Àã.¯¶¤}j;U¶£WÈÆ\ãêó"mI]‘GËLóJŠG›—S&öÂ!º»Ã à stWÉdpƒçòQéë«ÕÛõÕ:út>%ð“tà‚‘õ˜6¸í`c#0Ú(Ò¨²ŒËµ8 èÉ­'I9óðYHEÎð0Í&§qêÈizÓÓ³šºÔSÞ÷›"ONíZÝ®¡Å ‹J¦³,©(YwTjWqŠàʆö*ƒEãC…7b8Ä' !å3py±Ô¯9Ðó³I[¨ÄWdóDZP 8©QI¢Z]ñ4 .ƨ©y1¿Ì‘§Ë,ðJ­Îɯ3ëTAÓï¤ ÷=*gaò`Ý]Fî®ÉG›KP®Ç­ÕÕ‡ËáÍ—Fd” #”uFÚ^SÈúₜ4ô¡Á8&äÜ[ŽDãR-|tN C’2&)ëLÛîU’Sé)5™;¥&%)ASÍ8jgªiî'äÂÈ.]–`°:A³Å°ý2d_äÛ]²!–‡uä ú|¦ ¬Sô¾/­ã&N>·èþS±KßSä|…Y÷——duuó?‹,O3÷ž)Vø0€pŒ^ðâ»GûBOÏ“æÉÒaÐoSk\-1Â^r7 `Ã[’‘Õ¾É "sÌÏÖÑûÇZ—ÑâOøü†o Oendstream endobj 6 0 obj 1377 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:45+01:00 2014-01-29T08:09:45+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001701 00000 n 0000003581 00000 n 0000001642 00000 n 0000001482 00000 n 0000000015 00000 n 0000001462 00000 n 0000001766 00000 n 0000002020 00000 n 0000001955 00000 n 0000001887 00000 n 0000001807 00000 n 0000001837 00000 n 0000002102 00000 n 0000002158 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 3735 %%EOF curl-7.35.0/docs/libcurl/symbols.pl0000755000175000017500000000542112213173003014102 00000000000000#!/usr/bin/perl #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 2011, 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. # ########################################################################### # # Experience has shown that the symbols-in-versions file is very useful to # applications that want to build with a wide range of libcurl versions. # It is however easy to get it wrong and the source gets a bit messy with all # the fixed numerical comparisions. # # The point of this script is to provide an easy-to-use macro for libcurl- # using applications to do preprocessor checks for specific libcurl defines, # and yet make the code clearly show what the macro is used for. # # Run this script and generate libcurl-symbols.h and then use that header in # a fashion similar to: # # #include "libcurl-symbols.h" # # #if LIBCURL_HAS(CURLOPT_MUTE) # has mute # #else # no mute # #endif # # open F, " #define LIBCURL_HAS(x) \\ (defined(x ## _FIRST) && (x ## _FIRST <= LIBCURL_VERSION_NUM) && \\ (!defined(x ## _LAST) || ( x ## _LAST >= LIBCURL_VERSION_NUM))) EOS ; while() { if(/^(CURL[^ ]*)[ \t]*(.*)/) { my ($sym, $vers)=($1, $2); my $intr; my $rm; my $dep; # is there removed info? if($vers =~ /([\d.]+)[ \t-]+([\d.]+)[ \t]+([\d.]+)/) { ($intr, $dep, $rm)=($1, $2, $3); } # is it a dep-only line? elsif($vers =~ /([\d.]+)[ \t-]+([\d.]+)/) { ($intr, $dep)=($1, $2); } else { $intr = $vers; } my $inum = str2num($intr); print <, 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. .\" * .\" ************************************************************************** .TH curl_share_setopt 3 "8 Aug 2003" "libcurl 7.10.7" "libcurl Manual" .SH NAME curl_share_setopt - Set options for a shared object .SH SYNOPSIS .B #include .sp CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option, parameter); .ad .SH DESCRIPTION Set the \fIoption\fP to \fIparameter\fP for the given \fIshare\fP. .SH OPTIONS .IP CURLSHOPT_LOCKFUNC The \fIparameter\fP must be a pointer to a function matching the following prototype: void lock_function(CURL *handle, curl_lock_data data, curl_lock_access access, void *userptr); \fIdata\fP defines what data libcurl wants to lock, and you must make sure that only one lock is given at any time for each kind of data. \fIaccess\fP defines what access type libcurl wants, shared or single. \fIuserptr\fP is the pointer you set with \fICURLSHOPT_USERDATA\fP. .IP CURLSHOPT_UNLOCKFUNC The \fIparameter\fP must be a pointer to a function matching the following prototype: void unlock_function(CURL *handle, curl_lock_data data, void *userptr); \fIdata\fP defines what data libcurl wants to unlock, and you must make sure that only one lock is given at any time for each kind of data. \fIuserptr\fP is the pointer you set with \fICURLSHOPT_USERDATA\fP. .IP CURLSHOPT_SHARE The \fIparameter\fP specifies a type of data that should be shared. This may be set to one of the values described below. .RS .IP CURL_LOCK_DATA_COOKIE Cookie data will be shared across the easy handles using this shared object. .IP CURL_LOCK_DATA_DNS Cached DNS hosts will be shared across the easy handles using this shared object. Note that when you use the multi interface, all easy handles added to the same multi handle will share DNS cache by default without this having to be used! .IP CURL_LOCK_DATA_SSL_SESSION SSL session IDs will be shared across the easy handles using this shared object. This will reduce the time spent in the SSL handshake when reconnecting to the same server. Note SSL session IDs are reused within the same easy handle by default. .RE .IP CURLSHOPT_UNSHARE This option does the opposite of \fICURLSHOPT_SHARE\fP. It specifies that the specified \fIparameter\fP will no longer be shared. Valid values are the same as those for \fICURLSHOPT_SHARE\fP. .IP CURLSHOPT_USERDATA The \fIparameter\fP allows you to specify a pointer to data that will be passed to the lock_function and unlock_function each time it is called. .SH RETURN VALUE CURLSHE_OK (zero) means that the option was set properly, non-zero means an error occurred as \fI\fP defines. See the \fIlibcurl-errors.3\fP man page for the full list with descriptions. .SH "SEE ALSO" .BR curl_share_cleanup "(3), " curl_share_init "(3)" curl-7.35.0/docs/libcurl/curl_multi_assign.html0000644000175000017500000000661312272124467016506 00000000000000 curl_multi_assign man page

NAME

curl_multi_assign - set data to association with an internal socket

SYNOPSIS

#include <curl/curl.h>

CURLMcode curl_multi_assign(CURLM *multi_handle, curl_socket_t sockfd,   void *sockptr);

DESCRIPTION

This function assigns 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(3) uses.

When set, the sockptr pointer will be passed to all future socket callbacks for the specific sockfd socket.

If the given sockfd isn't already in use by libcurl, this function will return an error.

libcurl only keeps one single pointer associated with a socket, so calling this function several times for the same socket will make the last set pointer get used.

The idea here being that this association (socket to private pointer) is something that just about every application that uses this API will need and then libcurl can just as well do it since it already has an internal hash table lookup for this.

RETURN VALUE

The standard CURLMcode for multi interface error codes.

TYPICAL USAGE

In a typical application you allocate a struct or at least use some kind of semi-dynamic data for each socket that we must wait for action on when using the curl_multi_socket(3) approach.

When our socket-callback gets called by libcurl and we get to know about yet another socket to wait for, we can use curl_multi_assign(3) to point out the particular data so that when we get updates about this same socket again, we don't have to find the struct associated with this socket by ourselves.

AVAILABILITY

This function was added in libcurl 7.15.5, although not deemed stable yet.

SEE ALSO

curl_multi_setopt (3) curl_multi_socket (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_easy_recv.pdf0000644000175000017500000001250712272124475015573 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ•X]oã¸}÷¯ ¶#bŽH}QÝ¢€7ë-ÒõØiì,:È"ˉ:²”•ädÜÿÐÿÜCRÔW<Û]ÌC&E^ž{ü•Ø”[þkþƇɇ›€.¦Û÷"å6uí€Ì—öŒn™üIRù¶dž\Sj;¡h}Iä §j(¤\„Âm†ªrð`aÈõ MVôJvr–Ž6¤6³Í =^G¤ÈI”“ïdTß‘¸Èó$®Ó"ׇé~Æ|Nmò©Pl>­Ö×›«M7µA©9óõ§4³ã.!‘'ÿ ÷˜¶EŸþªpæ®tûþκ¼½YÆ&ö𲀆¡Ã-•"§÷ê»7Ì6|ð<*š3)x{xu1!dè4Ó.^ZLBj~,ÒV׈rýu» R)ºœ< ðB/aöûv]:¶Í@Rž ùðm曨ªökAE/Ñé’ûú[‘qêŠQdö0ªÿ&ùyL\ê ›ý®Ý52ý}*¼fF>Ì¿G¹Ó}þyúý[&9>£Ü {Túq±¹¼¹ºÞ^­WÃ*êØäRÛók·OiEöÇ\ñô\ 9ÔÔO=ïÿWsh4‡r©Ól6(!î e®0sš€îTíËâ@ê§„$U=diõ”ìzõDɧ)³Á7áYÅ‘¢9V IkR ¾+ÉkZ?ù=“Úæ9„ž‚TI¾Ó’5,¤"`F%Ùl–$Éãòô,·ù³Ù0d©£/šµ¾bî:Ô1dMâNÔuC!Ìq™œ­2R&¤Ø«-O$O¦`{(lÏz,ê4R¼A½ô*©gZü¹çRa‡-äÇg:¬>ÃtYo¦€ÛÀì÷ºâ{mKPÈg؆ɵ>æˆ<i^#ýH*ɃüTr¸ešuTÊ‚ÎЕ½üä)ª5^ "ßÛjuB75_F0.ˆ]¯Yè)úwÐû €ÁÏèÏFƒ†xtßû!úšŽŠ#XŠôídaµ9 gƒŽŠ~bÊç¹FãaŠ>‡FHи«ÿ+ó¡ŽAÁÁ%Ó -ºí³‰µwbz™rmÓõÁ¨e4jpýVkFGuWI®dŽUºÞ¦)p‘ð°eˆæÇKBê.8—zÝ 5ŽóãáLXgÖôFY?#‚»‡~Îͧ:©LÊU—›9äàËž½›àÿð6JŒ ’ô-†ãz NY3Åè¡JrWr²æ†½ƒ¾igÚ¬¯·÷—ëÕjq¹½_¯–Ó&„ù¾õ©IDË(Jà÷ööÕÞ…H×¾€"ÄQ–AéFÍ K2'Í®Ä>ƒ6LI¶k5âàŒúmO²°ê¡á¶Å¶Í úk¥«>Μ YÔ‰¢ï(2§?sàm§N` LaÀ¥“k]RÑ8Dv§Ð-O6ò×´J4וªwUIŽëA,Ý–;eRË‘y’¾ªÓÉÿÅý| ‹[‹cým~µj ù8P(q+i³º§í4¿£B8×`l%»m7ئÒ ñPÒ¼ÈgÆ¥-8H_®Z¼@vjPYæ6Ú‹gÄ„Þvû:Ôw nU2"¶,–ýÄ<*’ÚÜADi¾/ÎH ÙvZ$•qâhÃ8؆|Ç«ÕOëûå|³Ý¬/^lGíˆ ú­irfLSñPGªµ4xá3(@`Z£œÛ šÔß+—£zxé€ÍzÕ©ª“ÙƒÅV§0SÒeéu(懒†Æ×ŒP (˜Z3Tëg‹-ßÌ Ù†wM?%ñéÀR]9Qÿ&ÊçÁßkMûUîO–›n ŒzB¼¹csN£3õ˜g»*”ù/dÞyh¤¦M½uµœÿpµ¼Ú~%(› N4ßí4=˜Ê鹋E·ýu³ØÞÞ¬È/Sæ¸2½Ö|y»q©»_àºîë^à ã8©ª ¢‹´²K0êø~\‹ûõÏÚÐÕ%j×óÛ ÷®Y²U²Ð ]CŪo88¥ÝÕ’éåÍN¿åà0…õ2‰.ÎÛ8ôvæ¶;|ÓÆ_{æ˜ò)¤»"_Dý¶Ýž»˜–é4$?£¸>*yQV/D&_©½9A/òØ´¾ÛL»¾f/´ÃqìÖÉÜÉtëêL3ôž6å*Ðè7ˆg8?ôç¤,qk‘¯ºBôCuÛ°®ör2ÚP*;í A]¨ez—UM§w}ÓƒÃâwh¾†ošSÐ5§¡ø¢÷¶}ï7U Û¸aOš€pó¦»<(Ø »½v¹E‹ïàÕiB&áÝÓL[L$§¾up/íj¢O·{;¸“l`åiê7>Þi…{¼ÁúòT¸æ5¨}pCµ~½êsb 8f’F»4–)HœÕðž®u™ú‚rû9så¥EƉzñïðͧ®T$†õ+Í ¥t0:®cj¢éÝé m72%é5OоlÒM­÷¡a]Ëð×”fòV"é&›Oûñ\&íÍå%-ŽÈk啹É“h—h]»}ƒªû©ðíÐèÊèÅEˆ¦êíjs{­ß¸$$j½}ÿ»^ßL}ÛÚ.~¼¿¾1´r•¦y=wˆN!ô3ÅzKÖýÛDØÕöåzyFñ8h÷_’ÿœ¼^ŽÞb;•·6I2ºsø4tº;‡|VÑOÐÁNýæ>IãQïÀÝO)Is‰Y9ÄÈ»âÜqõ!ùÉ7˜jœ/É4¨"˜öm=áD`o‘Ùè1°[.C{WÑŽ•?x£],È|¹Yëvð TÃæ^“5'PNìâ v¾oŸ±qš½âŸª¹ò0BN TÿÐÊʶÜ.Þ^~‚?°òè=m”¯¿ŒöðpMêúx´á¸y¶Ò¦d:c‡> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 13 0 obj <> endobj 9 0 obj <> endobj 14 0 obj <> endobj 8 0 obj <> endobj 15 0 obj <>stream 2014-01-29T08:09:49+01:00 2014-01-29T08:09:49+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 16 0000000000 65535 f 0000002868 00000 n 0000004820 00000 n 0000002809 00000 n 0000002649 00000 n 0000000015 00000 n 0000002629 00000 n 0000002933 00000 n 0000003331 00000 n 0000003194 00000 n 0000003054 00000 n 0000002974 00000 n 0000003004 00000 n 0000003138 00000 n 0000003275 00000 n 0000003397 00000 n trailer << /Size 16 /Root 1 0 R /Info 2 0 R /ID [<7986B40E46A946B09F49EE4EF4B5D235><7986B40E46A946B09F49EE4EF4B5D235>] >> startxref 4974 %%EOF curl-7.35.0/docs/libcurl/libcurl-share.html0000644000175000017500000000707512272124467015522 00000000000000 libcurl-share man page

NAME

libcurl-share - how to use the share interface

DESCRIPTION

This is an overview on how to use the libcurl share interface in your C programs. There are specific man pages for each function mentioned in here.

All functions in the share interface are prefixed with curl_share.

OBJECTIVES

The share interface was added to enable sharing of data between curl "handles".

ONE SET OF DATA - MANY TRANSFERS

You can have multiple easy handles share data between them. Have them update and use the same cookie database, DNS cache, TLS session cache! This way, each single transfer will take advantage from data updates made by the other transfer(s). The sharing interface, however, does not share active or persistent connections between different easy handles.

SHARE OBJECT

You create a shared object with curl_share_init(3). It returns a handle for a newly created one.

You tell the shared object what data you want it to share by using curl_share_setopt(3).

Since you can use this share from multiple threads, and libcurl has no internal thread synchronization, you must provide mutex callbacks if you're using this multi-threaded. You set lock and unlock functions with curl_share_setopt(3) too.

Then, you make an easy handle to use this share, you set the CURLOPT_SHARE option with curl_easy_setopt(3), and pass in share handle. You can make any number of easy handles share the same share handle.

To make an easy handle stop using that particular share, you set CURLOPT_SHARE to NULL for that easy handle. To make a handle stop sharing a particular data, you can CURLSHOPT_UNSHARE it.

When you're done using the share, make sure that no easy handle is still using it, and call curl_share_cleanup(3) on the handle.

SEE ALSO

curl_share_init (3) curl_share_setopt (3) curl_share_cleanup (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_version.pdf0000644000175000017500000000635712272124471015302 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ…”[o›0ÇßùGÚ TŠksG›&eÒ¤ tÒÔL§°iÁ¬ê>ýlcBºvš¸Øçò÷ïœÃ`DËK?óÆ8ßp×¨Mм©0åBz0F Aä 0‚´1Ì|èêÛ_Vúð=ä ƒ´0ˆ‹‘kCúhܘ´ë«–íLggA]í¥¹µ°=Œ0ÌËŒ Y :Æ÷ô³ábyc”SW‘MDÒ\hŠ„&yRÖÂuŠ`áøÊi½”¶Xšy‘£ƒ]Ær}>-$âÄ–Ûx«…Oç†t”ë—tÒÒBêw&³žw»Sx®MˆZ…JBòm½¹J.’QH¤…(%Â|S±¼ ïdšsyCå{ÅÖ…te¤gBb™up¦…F( ]âIÁÎzû?Ÿâäãöâ*½Ø¬Ÿ™…4¡'‰˜[}ú ʡɘ ‘Ù¾¦úÄðXñR¡Q@_—OqU ‰ ÍžvÐŽ3V@ß6T®U¼‡ª¹o;ž1y+^e¼W•ŸO vf]ýT\D³ÈJ;(£pê›ÍÜ®ðöV4ùž²$Y½(âÎB¯ óùv¤wcnãôz»†¯q\ùÄ\®®cå(´lÏ—HÍåý©¨Àñ¢ –^S[1.øðVÐþM»ÄWS±ŒÓBãF–Gôí«‚ hLØ÷<ãUžÕõˆ[›+§½Ìèà…î„f8ȵáãp(‘]–¤z¬å°§pè(-T 1f¾ïþ51û'U~™šv–'Dv`¾Fòù(Ä1,WÉæ_£0">­ÑmÅ–­“´:É;pÑÔ{æüÓ "‚ìOrP{S÷Ÿ´=©tt÷.çbùÈ™[+ëòlŒÉ8”"´¯wÔJœ_ÄõõhQendstream endobj 6 0 obj 692 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 10 0 obj <> endobj 11 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 12 0 obj <>stream 2014-01-29T08:09:45+01:00 2014-01-29T08:09:45+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 13 0000000000 65535 f 0000001015 00000 n 0000002744 00000 n 0000000956 00000 n 0000000796 00000 n 0000000015 00000 n 0000000777 00000 n 0000001080 00000 n 0000001255 00000 n 0000001190 00000 n 0000001121 00000 n 0000001151 00000 n 0000001321 00000 n trailer << /Size 13 /Root 1 0 R /Info 2 0 R /ID [<500D64BA9C16483CC5C66B2B7B4D14C6><500D64BA9C16483CC5C66B2B7B4D14C6>] >> startxref 2898 %%EOF curl-7.35.0/docs/libcurl/curl_mprintf.pdf0000644000175000017500000001344412272124472015270 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœíY[OÜF~ß_1RbGÙÉÌø®V‘Ò”HT@(ìK2ÞÙʼn×&¾ý ùÑ=sóe1É‚ÚEB°žÛw¾s™ïx?#‚)"âGÿM6³×'ZW3‚Ö³Ï3*‘þ“lЯ ˜Š‹ÕL­¡(`(ˆFh±™Q7À.üw3;³’¦Ì.®Ë4¯Wç–sn£,½Ïì9ó&$°㼉3´=ÑþkñûlN0£°SGFp$Žö ÊÇ¡œwúçчãÓýÓ~ªf_syfý”æIÖ,9úE@}­ù²©gá«7Ò\@#|G”ž[€¼‚gWq‰^‚ ¯O(1A8ÀI «²X `Øë#A:6Àާ§½Â­61>·ÏÁ$ªL“¸hVÎûýƒ="-í‘Cüi$ËI!ö:É€p×é š:>Á…À3ÿª±ŒB° c«ŽûŠÈ0uÐÀhHdƒè²Ñ³h¨Ìê ®: vBBÌ/'ñG˜ø„úÏŒ)å`Ѝ|G¦¼û3Uu«CpKÏTú7¿¨·8b ‡~dvßf<_×W“ǸGNÇç3qˆC½hÂ%ídÝØJW‡>¾p´à sñE–V÷Èõ°O SSά¸´n0?´Ö•,uý4„êÝú¼dÓyÙ~£ Q÷YV¡ïÈ”ïˆN1·kI œ’öi `'“q× ‘û|®îu<*ª†q¯²a¤Š¿^m]p®÷Hë¾!Ó‚;½º"jmª„z‘5M<õ§>;êǺ›ùžèœzÝýÛÞ黓ýãÅþ‡£q+ÓKo ‚ß—=ÄâŠWÅ%üfZ5yRƒº¯P}×èº,–MÂM·'IQ.Ó|êź›@U]ŠGq¾DëÔä¨äIt~w£ª~ÂÁ¾Üï)òx”ÝÔÁ$ò ‰åz£Tó-L¤ ͆çu…QgŠÏ3ÒŧhÕôMQÕÙJ²"ç*V`*G7<ËæŸòB,¥RÔ$žX竎ï&GïæU}—ñOÂlØø»IÀKŽò-y§´YzðlZ·×YœÇb8Rpw=j×{‘ˆ²âA0ÑaYÊâËLYè‚~ ÂÎ@iœîð„CÊ&ã _SÅkŽH™?‹—gÖ)ç;?‹í„+·ú_cë6á×ÒJ¼•2L¸û2h½ˆ9ëH`ËP?SùûÃùÄæ«Ýw_=aûj÷í«§lŸ{Ñw;ÒƒÃÙútç*w1 ²ª_䛪p×_a }‡…Ý@Í7Zù‹Ñr(n~`Þw¨ëËܾÐûyLÍ™ MÀ·¨%‰™Õ=lLí×bêc…5K?‰%>œE™ÊÇlA6‡ý©¹‹Ž*aÙX {ܱ¨oz˜r˜ö8]‰3­¯ '”9 ÷ƒ 4ØnëR!GÝLü’Eš†â¡ÖZ¯j^Êâqi3q¹¸¾Õ¬Ô[X+9(êã5OÒ/¼’S•`0U§»0ßaÖš×z#Q.ÌF„‰lϳ¶sp*ÒÚݹ}B ·ÈÃö)‰Ø>"Û§¤b»K. a#b¥ÈE±(ðDb¨¨Ñ©ÉDƒ!¢N„4™ÊLŠHK³ÔýÙ'ÃVZf졼ô¥°4×–¶áÁ¼ôáþ%äå@Õ´_ÏJû"cÌtJŠQ£{Æ™?òdb¼C (O@OÁ˜©X½àç×CÞ˜oj(ÁŽ˜.˜ècSÃu# dZÉë¦Ì••Z¹zAòdE"–@QR;éuÝC´pQtñØXi€ÒY•œë}.ïäq%OøXF »}œ) ƒž7ñ^¹W÷r)hã è 6oÞ…¢·†4+§|ç(r'xNF98}E®âyÛ£Ãè¨!t>Ù øCÏñ,!¸PkƒÀ'4ò´úG׬„ Ô1†Ž‰ÜZ/¥$„uò·A{ êzËTгxS4°®PùÈ»۷<÷rCK7`\êêy^ïÔÅ•)=¼(Æ—»OM‡ ¡PtU š¹©T›PK¥- âr …Öˆ`ÈU¡2ûúiÉ¿ä]Ÿì-Þ_œì¼µAñ¬w{ œA„r…Ö è 2SXï Ä£ï ðÕô%ã2˜sƒÓ Èã 8'ëBùRtC)wÉŒs|¿sS½’þZ¥û’Ç|±ÂëD©Áœ©}qùã¤pç÷êØÁ\ü©<©¿èB¦ÌžCã:س‚Þ¡bì’+×7ð©Øeo1û~þ¼;$¢endstream endobj 6 0 obj 1871 endobj 14 0 obj <> stream xœTËnœJÝó¥l’©tÓ<šåD™…£ÉãÚ8RäDQ46vü÷£SÝÀÌØq”ˆˆê:uªÎ©þ 90óÌï|缺Hà¦wÜ8?nƒ0¿ò¼Îè€4?²Ò™r8$$©@™B¶sx˜`H_÷ε›]ýmßUÍP~qÅêjkþy~1d,qß©fT5<=è}ÍÞ:>ÇHJÈr*™RIL#SUÄmL…¦Š»ú+ï%¦ƒÃ8â±Ê Ç=߬^ŸoγÏ^öý”v„"$`ŸÒ1ŽÜ|Rv«{ åØäCÕ6p_Õ5l5tzן¦™*œ'È"9W¹Ó&(06(¹“b SÎÁ¢4A6ea ·®ÝÁp«a?në*_«çP5  Ñª#*ÃØi"¶Ô*¥*ñBàáþX#B)‚9`¶1ÓHÕôƒV…ih§ ‹ç‹H Hù2 ÷…šû lŸUZß©C™ù±G†I8WQÛZ¿€íôíØåò¶Ð ò\÷=´Mý05„–jhÇ9aŸ±Ig.Ÿ×nS˜1ÑDzk’Ÿßü}§ÿÿéñ‰Zâêâ Xp©µå«‹õêÍ»5Ú (ÛnöSœ ±ž»e–t9v„ßA¡UÕ=NV9±›O~£L”Ÿ‹uvuñ>y\ƒ˜»«ÍÕÚ f3¦‰ÎÊMˆÖ|ÃBÓ‚ìÔäüÇ.ÅéAÕOpX¦4áÜyœ¹ ØcJ1iy@c(¤˜»ŸGG&'«ãí[J§ ­u¡©ÊE€Qr’<é}_?€ªë6W©ÐT÷æ ÚÞ_m6P•“Ř¹[NG~íV”DR—¦® ´t16´ÐäÖÖŠò=³1͸ÛR¬-!¿UʉlotM{ йX¶C=Ú@‘f?ÐÍC-´ã°‡ÁøMû Ž‘%GýÝËõV›ËÅ8ü9)ƒÅæön;{"dŒqÌ–%ëŸÍ—(å÷ßAÊ?€±ìÕ?€Ü="Øi¾˜§ð£(Äp2ãr—%ÈÏ'¥ÀÈ¥ÔAÖ0Z¹ÃxÑ(0HëÌùž_˜"°Nendstream endobj 15 0 obj 812 endobj 4 0 obj <> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R ] /Count 2 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 18 0 obj <> endobj 19 0 obj <>stream 2014-01-29T08:09:46+01:00 2014-01-29T08:09:46+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 20 0000000000 65535 f 0000003268 00000 n 0000005217 00000 n 0000003202 00000 n 0000002880 00000 n 0000000015 00000 n 0000001956 00000 n 0000003333 00000 n 0000003656 00000 n 0000003591 00000 n 0000003523 00000 n 0000003374 00000 n 0000003404 00000 n 0000003040 00000 n 0000001976 00000 n 0000002860 00000 n 0000003454 00000 n 0000003484 00000 n 0000003738 00000 n 0000003794 00000 n trailer << /Size 20 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 5371 %%EOF curl-7.35.0/docs/libcurl/curl_multi_setopt.pdf0000644000175000017500000002633712272124474016350 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœµZoÛÈýߟb›þ*°.³- ø·uë8n¬zH ƒ–h‹ŠÔ‘T÷3ä«ô;öÍÎî’”åäîÐC±#.wggÞ¼™7ºŸ„çJáÑýs¹9zù.wÝ‘'îŽ~:’ê¡Ð?–ñÝ Rú`q{ÄïH‘ø"É7ÍÄbs$eæ&bqôÞYîÚêz³«úòº+úfÛp‚3Q•7ôd6÷#Ïõ¼Äy“×»¼‡—Ïþ½øûÑÜs}‰í—8=Ãén‘A,çGÎÅÉì9 ÆS¹QÀ¨ÅêÈys:[ü82×÷ÜÐKÄ\úôØ#›(þ+ð‹ÀoeSwâ¶iE®,j•Xçõª*xã‘%s˜2—±›ª“¯~¸x{yuv5=_-Qg;¿/ëeµ[âO´õKúË]ÿ™–û¡ºÒ«ïß¿Y6XqÀ+ê¡xÁ]³EÇB}ÊvkóÅ6oó͇Ù៯˜ûúôêÕ»³ËÅÙÛ‹§,†ÿÓè°Ç>8ˆiÙ‰]W¬D߈¾¨*øLGyâ6±nÔÝ„6[ùAäf~ÄñzïÜ÷3?IÝ0 æFÅ]ÕGPÏDµXç´!Õ2pãÔ“úé§br@³³4ÔÝïÌÃP½)áȼù°£‡Œ"^♋‡êâ]Y߉~]ˆ|»m›m[æ}aqÒ7ì9éi×͇{¡ ùèVe2alǧ>á=Ó¦? ¦Ãù¦m eªlkvb™×b 7߯õÏÍæ)½™fn†æ¶ÝͰ¥tS/I§îxõ½ó©lv­¸_5ÂÌ~ÈûIhÝÙ< ±“ôÄßø%o Ê'NbßKÜ,ÎŒK¤ëÅÊúû²_“g÷\$®œÀ;îet6^qÛT• ƒLÝ8ÈÌîË›9•E_´{'¼ìU±fñd;ùF¸Q< ™Eöw1†ŽŒ­Eä${¦ŠÐ à3‡:;q“ØÓuª¦¾£çÄ¥‚áRǹ=rØJ†ð¨ÝêvW/l›²Öw~¼m€6}FÛi:1zjñ<ô“/„CðæÇbÙ‰}7ÎbsQêtGÜÍ"ã5•)Íííu?Ý% áô ³y†\fú‡-èoUl‹zEØÄ•ïÉóñn[,Ë/KGQÌà£,‹¤óúÎµmtdçŒWIaöFf’¼ÝUÕƒÈ;qƒ·Ëz»ëŧV{ðŸW»‚¶{À^ EË„àÆJ/]И¾|/vÃáR Ÿ£ M@Bž^ƒ„ÎÔ’|U=üNü ÂJ¨óVÈÆ¤ÐÔ0UÕ´ÚðLE¾\ ƒŨ›¦aåUå.t~ª+Ç[U4ž®sª&aÑõÕÛWÿ8]üåû‹W¦ÊXŒ–_ð[iø3R¾P>1#oæÖ~x»_®5AO±uÃÈ7é­ÀÕ5˳ ûFAäý5]õ&Çgšá"Œðm;Òïš+¸jò Ý7KsaºY„]õ– {ß%Çó̃þ:W÷²5b”8' -4I튲FÓ²éL©ªÊe®>ÏoÀt·]¡nu„•ä WÑ0òÁù‚î†ÑØ%I4°µï36WE·lËmß´(ü]Ÿ÷»ŽvÕÿk ìXð_-Wˆ- ?y¸SÝÁZ·4êd*P À0ÑÜ@‡øêQTÄ]9L#M|Cs\ñ7¡÷*þ{§.gA/¡Ë¬ûQK UKÓ{™iìF‘%9GqøÈQœ,4rÅw‰ GÇn31Þí6EÝ[Ð uè_#ö ãöƒ–˜´ÏV‘㨱ÓUÝäšß ”å%?ݶ…â"™EªpÃïå†ê£{À¬TqöÿÂì°BQ^Šƒ}¬ÞÛ,—R¼‹•+ÎnÕ5õ Sý0Ú » 4zõr\'pÇaeÈôñýùù1à+,ìî˪bb„7ýØfBìÊ{á›Â}UpÁ1o?ç.JÚ"Úí•<ØX˜¢L´äŠÌSg»GC`÷Ð,= 5É¥PCMábŸbà!6‘Úcå×:ÒAÂu_Rà•'£ÎƳ8Qw“|츙€%x=6mÑÕð2õÂ6ߊÇì™"ü߈±›ÙI»MÓ!C ÑçeÕ©¢S;¤’z NìÈ5LJš)OâdB]ó8ãJýÕŠ‡M“ä`Å£¾¦˜ì¦Šm`MRÄIú8)Ú‡qRx¶å§ÓRÎKt *#Ñ ¡©©y팪[–¶q Ý ó~Aa…ÍQ´§s27Í i6Äyá=«î#Û‚þ¨[§! 4ú­©ó}¼ï‡CÿÇìVJ·í´/–±B„NÕKôõµ01w¥vÿÕMϪÕÏ4y73Iô|g×sëÅ>œ÷ëv‡Žq^vɆXeî>MÇptþœžj„w4Ë¡MD†jêÑG}yvyz~vqvñ×_Ô˜¡[Õ½¿‚)IÕg-’þ*êü¥iæÑ?WeGÿvÅ)}N½Â¶ÜøE÷ìùtT@ì‹¶î#‡Çgª¡Zžf&>E9ÑűU·J8ÌÈ:_ÊQû®•|Þ÷Åf« Ý-uKâo‹Å¥¸ìÉ5eLÃ; S¾pÞÒŠmÓu%]‘¨¤oóº»-ÚÎ*d DkcÔ~Vp(ô®ƒtWºº¼HÅ|µ‚SºbÙÔ+Ñ?AUô,¼©­'eyÕBÁ8{=ÊV`+ßo§^×£ nfëÕ¾“ç#34QØ2Sm¿`ªQ¨Æ\ìÂÄ–€÷μ‡4 ÝX†N“ô zš¥ò.zŒh·‘B;W»¯&â"Œ-R½0fð ×^˜¡éÝ 2Šˆû¶„p+ú¥jífÜ7NÓ~tÅÉàhf¥‡HÏ%×.ÄÇ„CÎÆ8ÊÒÑxÎcÌ@ؘ ñ`x¬Œðöv衳¥¥¥Qiœs}/]?•ž¯ÊMÙ+\—<¹”nœ±:RPµ@6;¿|F±@YL7gLÄHáÛ]¿kX³.û]N£6›ŠW>­ºýq;e¸  ÅSs£o˜ ´êa8̹^›=Ò!‡X/Nô7Y¶7•ã9ï´Q ½aF©guã^OS¿kk,$vØ-—E×qH]šT¶mÓN÷I­‡ß>‘ãM¾·GêɳêU˺ëV.®1Ò-ÐÂcÃ[5ºA}@R*öê›ã=§¾¶{õ ±}³±ßïÓÛN›]&!Í x`ä‰^@*‘õT/0UdY‚zkŽúª$“¼ð½næÿ\E¿}0’,|<š(2è û=˜’af(÷Mf¿»øz+r@}IH+ÓÇ@úF{õc‚K-Ì­Öe»<ˆð'ßÑhÆÕ+F—4ðPeš§ò O¤k X­79É#ßyõý·„˜ê\²è×1æR€<%z7È80Wñ©e°€~º7}” 2€pO¾•œ‘OdƒP§‡²áÍÉ¿^½½¸8}µ¸ú…‚NúñTÐqïCª®Þmn”Be™ Üó”y“.7»È7ÍhE…êJ‚a^ƒ :x¾Ù‚ÿYD0«3-6²$ÓꇿKUÍ”ùúX}‚úãŠ×Å-²Âɱ3]zÌ—f¥²¬¨+=Èß¹ÓãÒò?¬ÑÔw¹òf‘w¦þ¤¹gF†‘ä|nâÅn3Nóÿ,ô_øW9}8š,ñ8!…ì"í=¸f8^7êfÞ™„ÏCПf.ÆQŸÍeʼnø¼]ö‡„Q§†±™BKÚçtqôOüù$»aendstream endobj 6 0 obj 3248 endobj 14 0 obj <> stream xœ­XÛrÛÈ}çWÌ›@1‹Áûf»˜•šRl¸’])ÅC1и˜áþCþ9ÝsAêfï¦T¶(b¦§/çœîÁWâPFüÑ¿³íä§yh'y˜|0ùè_Ù–¼KaAŒ_¤ë‰ÚÃHä’(ñhœt;a,¡I÷“[+ë›rµíË®Xµ¢«wÝåÝMIYÜã“©íuœÈúÀ«ž—äéåÓ¥À ¶’4¿À´õî@`IWT¤Û-ÅE]ÍÈ¡îIÆ+²kÄ4ý÷Ƹ’fæEÔ ÀY°`}“Ïü>¡nœÄ¾zpkU˜`!ƒÿÛâwAÖM½%M=u}š$ndíñÌ{1eu˜Z‡ºÊ妲ØzEî蕎۰†>±]_zO}éÿ?6¢¬û²œÉ¬¬[ÑÊÇu™‹¶#ukƺúQˆnRæ¾¢‰°ê·÷¢!õ2ždueKcnPŸ ¹®D†ÉmU.Š*ko! w`X ËQq¥ÇbÈ êF'‹J6¼ÊKq1½˜¸˜Y–„†‰v­íŸ£¾ç0õŒ{‰´ÞBBªò Ï¥~‰aC]âXÛ˜í6\¨xb*‹ùî[…A €DÒ‰f=eŽÅ3!‘Ónê¾ÌáAÛ žÃz¡k˜0êE±I‹&ð˜Ÿ>2Ç0Á§KL$ï?\\ߤ«oÿùþz¹œ¿O?©õq\:‘^­Ò%³i#N£d@‹ŒúÎz›çÝ"e!ENàZàƒ ÆÃ‘ô™«ËëOéJŸ|u½üt‚¹MÅqÃG(‰“næ†*Ý-᤬¡Ò$E>´5nöEY 0C9á ª[þŸbÛo ßÖ=   ÕXw^‰ºoËÀ4À“›<Ó@zž¯TC Î ¬dS·%™B–“8ð-@•JÕÇ¥±§áИ,ìÛ#<𸾯“%Úñ)O@Ó3£H*.é'GãgÆvç~í³£mŸúÉ`[†'áßïð Ûc1u‚BŒ†` “|"/V‘’A5Ô& XƒyùL~ ¢!‹G,&YEÊV&ÔÔ ¢Ë‘P¤¢Ä} ÿ/$®Òˈ™L~ã„Ô¤(ù=Ô'¢n)¹Zø¹º™/®–WË_ÐY6Sc‡ñ©ÈœT kRáŠ( ”¾µŒk…v2¾“ÇÄŠîD…|O"7}sk!bsôV:ÍŠäÛÔÙvBfñ²—²ëÌÈ~S–¶‚#ê6¼Ó9‡U­2­¤Ü± b×(Êe­ŒEžµ×:1H±G½ØÈ—Öb[Jÿ™3ê*­fFÖcù “p?Õ-âþžg_öR³š2Qow¼+èÒ怓©J¸½98"X•šª H‚d;@×s¥S…©ê!Ôì:Åü¾’9^ËfÑA¨Š{¤Ê7;†plŸgõÆæI¿Ðu=U@ xñ’jçç«Å|ùKzùƒúçÇÞÿEÿñµ‡îÝ¢ß|ˆ.?vÛ±2Ð}wÜoºCúóý„/àä±FÜŽS«ä‡´|«¹s5£âPæ)(¼¨;wÓäA,@48Ä¥$‡“Z1ÔĈò-Û¼“ÈQÐÓbÈe½y–‰]©Ñ±â,„)Æ”÷‡z®è[%r]ÝÁ¨xœ_FI¶ÿ[¶­,¨,[÷@³”áMÝtòd€¬§|7¦Q4@fiÒåDƒZ‡7¤í»ýLGŹƒ—Åïܦ¨8¤ü¬qú.Mâ×î0jTöü€â@¥Få'©s>%¹sùyù·æèûÝŸeLPJToÿ,u²M_}Q‰g`ו*±H€®rY^ I¸ á€q[TY£ÞÏÒ”mÀˆþÚ¬TDN6>  :Ê“Âì÷™<ÁUÝ”Íáƪ¿Âd`C¼“Žq Šƒ›Ÿb2Îþ,–LV2Ù|3&Ì$ˆÃáÒú•Oz’€O®c¯Ä ™ª£P3>ô«á¦ÿ숯§ó?Dí“·ŽGÃWßNP-O. ôGˆm=1¶.ÒùêÝâ‡?w4üÁØÖ4ü€cF¶á y@P—' ÿåçÅ…#–T/Z}ïí„Î^¬îK˜ÙñÂ_¡hxâ¬xÌHAŹ¡/•ºr`ƒßËññÝö»à„\¦é1]˜™UùSï 8î˜zrTsÇùMéiIÇ@_¹' AÒS¹Ä4_œgY)#Z%»Z¾†Á`²Rpõºhd S3™#_k¸}åËgj³ #‹9ä:ëˆ ·;隆袑y:ù;üüš÷Ýœendstream endobj 15 0 obj 2068 endobj 19 0 obj <> stream xœ¥WÛnÛF}×W ôbª6\Þé I 6jmٵ馀+j1áE!)ËFÑ?èGwfw)Ê®‹´(dÀ6¹;;sæœ3«¯`36}Ìï´¼º áS3°áÓà뀫—`~¥¼MpAD’õ@ïá:Æ.‹bHŠç1 !Ùn­tWç‹b—·Ù¢‘mµmï,÷ny¶¤7£‰ãÛ̶Cë\”;‘ÃËËG“ŸxÂÄ Y ¬éƒ(¶¹<%Ÿ>LžÚt Õd­\,s‘~ɳ¦½ýßÓ"î@r6°~Ðzúo…¹ ÷ûý(ð™ÍýØbñðÀ9«Ó’ïž¿—#nþÔ§³´*N¹ãzf‡5¿9;Ã&‡¬?^Óá”þBiÅÞÝ\_\&‹ËÙåôl6Ÿ.®gÉtñöl OK¹½6Áu¹Öõfµ’+ÈJ™‹("Nxa4á‹tÏãÏæ?.®§W£0fqì„Ö¯Ó+5`%×#në,ÊîGŽo‰|'©+Äê1ì7YºBв9ô Vï˪ώ=•‰ê书”’TTØVYÙ»*Hs‰‚z·Jt¢6vNð¢¢6ó8âøÌ)¥—lÑžgi]5ÕºÌfׯ}L‘­a‰|xx…êg>™ÞÉ·,ü×®‡ž!ÚÜ Œ'Cøúáqä… Òÿ憽ž¿ùm‘¨÷6óT#\ÔSÇPë"9¸ïž½9[¼»˜Ï§ï’ÙÅüÚìÕ ±Þý ×äN g”²ÁªS:âå®XbË÷Yž±w –"ÕùBÙt?’ðC±·f>b?³Üx aru|>Ò8ŠL²÷ÇœâŠú`â¡j°•åb™KÃÕl³õß´†7Êž?ëW[?šœcæ„ÑÓ …È›ù$»y²©…B*¶êXäef\”ynð’“’ŒNŠÆðƒÚßðRºöQ¡~dúuk½¯t0té½|j´ŽËÜÈîXz/Ÿ0sÀº®¥YaÝ“‚³ x‡³©ê–äBccEY¢^5zê¶Ù2˳öQ;+¢èûÑÆÚŠ}GºäžàHäVÍÕ–n#H´jšî]+Ð%Zd`«bW*„ä [^â<è„móÕ]ìuY•èüˆ*jò"à¸Óø˜@?én°/yì ~ˆñ»‹}ú:0¡[úÁo¯¦ÉÍ•6ËþC»Œ™h™+DG[!œºö´ZIX#Òjv€šˆª3˜íj`)€æ¾H%ȺÆõ´‰ß_‹×Z¶»i¥õe"ÜÜ“7óŸç#×ÌÌó¶åOœ¬v  ®]x ÁiFвb{̸õ=œVä$ŠNd«J6å‰f0Ó×ì0B!Š´_zÚ¡ô´Å;%U­·àœ9xgÕoðÐeâØ¼Xë‚ç¡wc•~È­”.“aƒìÑ„û~ZØ”‹´å¨Í?0àZ.Å™&ƒ_ðóuíYendstream endobj 20 0 obj 1649 endobj 24 0 obj <> stream xœ’OkÛ@Åïû)æÖ]¨¦»ÚÿG|pq m–@IŠQ%9U+ËI,“¯ß‘,ƒTz{XÐŒ~ï½™}‰ äp¦»<°Oß<<˜„'öÂÔX„é*p“¨! Òž]þQàsðQcˆL©ˆÒ{àåùµÝÎmßìNu|î¹~Ð6?‡ŠÈr+QJÏ¿ݹháÿíâGúÌ2…6H%©GRÇhÚAÚEiE¾º‡•ø@Þ©1—è¬ÊÉ`ªßlW7›í&}é÷> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 18 0 obj <> /Contents 19 0 R >> endobj 23 0 obj <> /Contents 24 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R 18 0 R 23 0 R ] /Count 4 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 21 0 obj <> endobj 22 0 obj <> endobj 26 0 obj <> endobj 27 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 28 0 obj <> endobj 29 0 obj <>stream 2014-01-29T08:09:48+01:00 2014-01-29T08:09:48+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 30 0000000000 65535 f 0000008477 00000 n 0000010579 00000 n 0000008397 00000 n 0000007751 00000 n 0000000015 00000 n 0000003333 00000 n 0000008542 00000 n 0000009005 00000 n 0000008940 00000 n 0000008872 00000 n 0000008583 00000 n 0000008613 00000 n 0000007911 00000 n 0000003353 00000 n 0000005493 00000 n 0000008663 00000 n 0000008693 00000 n 0000008073 00000 n 0000005514 00000 n 0000007235 00000 n 0000008734 00000 n 0000008764 00000 n 0000008235 00000 n 0000007256 00000 n 0000007731 00000 n 0000008803 00000 n 0000008833 00000 n 0000009087 00000 n 0000009156 00000 n trailer << /Size 30 /Root 1 0 R /Info 2 0 R /ID [<5AE9988119E3A1F5BC913A1FDADB1296><5AE9988119E3A1F5BC913A1FDADB1296>] >> startxref 10733 %%EOF curl-7.35.0/docs/libcurl/libcurl.pdf0000644000175000017500000003253312272124473014221 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ•XÙŽÛÈ}×Wü*°jXÅ=oÇHx‹­`0è 6U’S¤†K ýó+ó9·.jyƒ¶-·X¼û=÷Üú…ù\0Ÿ~ìgqZýð9a‡nå³ÃꗕЙý(NìÇ-¤ôÅv¿2ï–H–dO3¶=­D,¸ŸEl{YyUùP muï÷kfYoÿ·Ú@N+)3ž%¤lw+¯yTôÔ§'"ä"ÈRû¤},õ#<Êô«"â}z©¦×sÀ<˜©·j¥ÈèØŸ3øÀIÒ~µ ƒ€û‚m‚X¿õáÕ$.‚4§æýú~r_ú<ô¶’ûsÙo¬¨JU÷›®Ü)öŸÏïXßæu·Wmg„ÌõCïFÄ<ÕZþþæËëÏo?mß~ü°T§OU<ŽR­n{,;†?9ëŽMÛ³fÝ8æA‡ù³àf\¦Y^7Àké2´wÞ¥Yø=I3¯>®ÿ»ý—Ž¢I^Ê£ ²â…y65Ö/Å%<ó—Êf˜¢KG܃ɩN¹ZaeÍžš¡e¯Ù¹mm~ê8ÛU«XŽ¿ÝYå¯;å5;çÕ±}Ó2•Gù<Šƒ)j2M´‚ýP}ÙÔì„ áSíH‰KÏ«®aýQ™,ß}šq‘ÅÖkèFåÝÓXgSÎb‰ŠC{˜ÃÎΗ7ÄFšÊ+©§¡êË[b#îûSàdj÷{ò7AñØ£q7*éŽy»bŽ‚ÈÉ‹BuëÓ.{‡vZ Š0]³çÍcý c‡¶ìÑyy}xí(ŠF  b”;ï]Ó|cªêÔZ†T6»èP®vM1P[åºÁ DÓAE_ðÛ¿ŽåÇŽ9ÁסjòŠMMé홪סOExeÛÔ$Ò8Ù QeêÙpÖÕwÊKhD_Ž%4t³ØÕH8—Ò!9Á¦Iºýz„ˆÌ7“ Ñ$lÈ«ê (äÖz ü~ ‚òcå’¾¯Æ•¯e]ö7ª<…WãÀËÉ'àXŸvïMò,Ò‘c׺‚ˆ‡I|CYQÁÆá|C_–ò ‹Å¨ÐÖzÈ“$¹J+™¢ê_o"ß÷¾(ÅþñîãëÀæøÕ;öúã‡/Ûu&y–Ò{õaû…=¨ªÑ–cý!Q< |1¯GGAMe»cšã,qäéq9Äé­!ƒi±É,RSZ5%‡î{Â] häï•C"L=ŽìGƒ…!Ýù˜¹‚Ñ<¹©Ig€õ^ð µëißÎ¥*,(MÕX‡Ý‰Ùyãèc€A8Àkæ3Åg¿ÿfHüi‡…w»R€Lx}‰ÿ¦p*òº#ÇÍ„kX ´vIÆJMˆØE7ŽŒSˆ!(îŽÖ2ͦ Ý[8Aûpm‚ ý‡³’Ä&š`àéïÊhuk׈XÛŸ¤D³FdÛιBš¤ÂÙyy®0ÖiFŽšµ$¤Æöq1ô¶wª‚k÷ÞýšÂ=ÑwƒÚ”Tå–l{C‚ÂÁrà¡Ù³¡sçÕ´ïÄJ¯Q³}‡Æö´-&±æà^Þ•(˜Ù ß%ùRÛH`Q ¯6¢ªÉwÆkt°f[Büž× • ‰\GBÓ[•ï8#>¹ZCUlßlÝQ‹Ü ýÃM84m¾ÜMË S¥› Žf;×û¹1Ø™bENÅ$a(æÜÄ—.ÙȬ]²¡âjI¡ ÇÍ#{é4ÉÊ@Z§8Y.Œ3ž‰p Û ÕꆆàË+¢¯ØâeMŒþ\×D‰*Lú¡·ï§š€A¾›¡Þñw$xOùíˆx­¥Hdd©a ,òƒlòÒ^·`7ÔÛ‚¾ÀA“žòCY˜q#ŽwIwJÍÃAçQmâ2›¥±A‚Õmù Æqp=)©u]LþÔ͇?qœeyÉ$áé8ì%a9Ý¡üU["›D± ԫ꼪qØém| ‹‹jØY7;õ7ݳ+AËÊ×@MÕvxûž!ÑæNƒwÞAõm/ÄÂá˽õÆ3bQþN éÀ¾U7‚šïagUvýRE“¼§ #m¹²üVnìÐ÷¡ s:Rö5?Ÿ±û;“ÜðŸ…ôa˜epl%øÞi{ëož.­ÎàÌ&Œxz[yùòFæèI¼ãôŽAtlpÞxÑÇ Ü‚ÇëÀbzØœÞç-hŒÄòbî~bw!HÊ›íêßøù?>CÙýendstream endobj 6 0 obj 2615 endobj 14 0 obj <> stream xœ•YÙrÛH|çWô> Ü{p7ð({µ3Ú‘e¯DÇ„CÞ˜Á¦ˆ1ppˆâ?ø£7«¤¥=B‰îFYYY­?™Ë=æÒùïf?Ý öÔÎ\ö4ûs橇ÌüÊwìÝ úb¹™é=>iÀ“”-w3/ö¸›Fly˜9e±Êû¦üê_çÌ|˜/ÿ˜-ð>¬Èg¾ŸòTD8e¹ž9õ³¤§.=ñBîibž4Ï…zäÅRµÕ‹x`žÊq›Ð ôƒÉëiÅO÷),ç´3[„AÀ]-‚˜ÖºÊàÛ›»_oî~f¿Ý,a·7ïÞ¾¿Õ;­ÏX½ð|Úáq/j×ÇŠõUñ²(‹o´8à1=Èg¡à¡Æ¹ŒxêÚï³|[T²½dÝV6òâä€(ái§fe›uã “ÐÆ­.Y•íäš‘»‹¼®¾?ḬcO²kYQµ]V–x|(º-½‡5²íX½QÓÖvý†÷Á“Ȭ¾Z„~ÂcXaüÖ‘:leÅ.v™òØç*%aÈcÏõ­ÃÅ`mÊ…—¦ö6ç‚-ÛËfS7°œ«7E!ʉêž§Þ6ñ »²õÎt53¯ôh¢ÔDÂXÿH ÒäN'çÿZþC[ãûܽ!þm!+X¶ß—EžuE]µtzYTßtÈ tYV­ÙZž"Øu¹ïYœNœr?ImŠÈ]5\֧ˬ©X¶ª{•ÕEÆÜ ƒÓ(O_¼­'¡Žô?:‡nîG®S÷m´’nâb‹‰,þLèÎ}4N»ŠWíYð(€|uð‚Â’•ªŽ«os”‘ëŠÀAè꽎رîY%ubÆÐÑû¬éм/³†=Ï‘¢4u}ìl± TV“Ó·gNãÀ‹ùÅj((œ¡ÅÏppJQœšzчYìsö %Y£ËÙsM=Ç‚‹aËg_Ï’†-}T£;RÒ.«àØ“TÐÙô •/ÀÑeEÙê€{IÌ߆Üù<¡Ÿ'nBƒƒD2œ)ëÑŸûáè«+tº€´zbí±íäNWy»-ö#F[oSÝl*Ú®)VsŸRæ‡N¯ÓUo:Tðº®.TÈ"Å9~’p?²ÕÑíG‹\%³Œ¬LMÀ®; ¿XËRt5´#0mìŸ@ûÑé@[—l5÷Ð’Ѓ]¬-vûòh K·š¬9ê Ùšª§¨ô[êÝ®¦$f”„nKŒÒ7ûº•\9uJøDÝ ²DWawöðåû·ìNÙCœ«×f÷k¤ø¦r®`á¾_2þ*×Q5¦ÙdU†ÓÕ’&àzɲÑÈï/ºDìXbVeøûêM}ÌXY+;âßhd?Õd“g(ðü뜳/x 9Xl~¯Öj÷Ân·ÑÅÆú€Zaö5ãUÈÛºor óZÚòSk¾[èŠòÐ G¡GU{Ûl£Kˆe%©0ÖTK÷D¬½NÀNÖ¤c5†C-ñ­I±0ÔïV$ 6Ö0¢ßp%Š—Å®‡R¥Bl%Ú‘‹2\pÚ¨U°Ÿ“Ui,Ö,ã‡!}J#5³]Ý(®‚ ©¤±á,!ó8r4 —}t–ÈËSY¯JYÍCXêE)Ú^SWÄgtαѥòù"r]‡dÈÏ·ßÍ'¤¶suËÞ¼{XÎS…øÎÕÝòQ6ìoª.ˆbnUÊa3¬;ŒO§úãlÚq#úsh€Î§ëû‡›‡åõÝ’^wý~y+Þ*(Œªí8ŸH¸A{TTÈU%Ã;™‘j&â·&°4rAÉ=nQ-û Ó¸@ bì-Lk(7xß¶\´@û18ÆXé&g˘˜¦xÚjQ ‘å¥'¢óP”å@æŠ7Af [;-”‡ìØžE óškŒöÕ0 j½ƒ>Û[DÒ¤óJØ8û sÔã¤èñâ$!æ§ä•8Op`å")€¾=º wÛ^«”šÞñw3MfdëàR›±à:;ca0 õ™T;Å:4˜4—‡¡.JÙå—lšv>@‰z¶ó‚CNp„ëZ!ÀbÂÔæhšh-%]N%F2Q® 6 ¨ªÏR±R¹\”/ow¤Õ•'°šÜµâDˆÔ/˜ùÀ•¤:”œã"TJ[D\DÖ´ÃDú£RcáGí_a¥ânûÕˆ*$SgÔ«ôo[¬¨mÔeIÝ4Æ•7¥«kÓb‡dú¬y¶cŸÀC tÕÂèIá!ïCLÞHtpBLgØ-%4ç»ÿp{7IR%±ð@¤á0ÙBœ¤z2\ÖlL75¶Ðê-ŠŠ*þ”–š?¨ƒém’^bÁj60î:{ýa ÏÖ˜œ°´‹ÚóSÞžð½~V™¡‰ ‹IôÁ×YâRõ¸‚¶\Ö1âaú´(70O‰DLUYš‚´#gsœ(³žŽÕgd t>û^šú1 * ¸Î.#ˆmÕxiñõªXQɱ÷ Îî϶¦ìPt°¸T¤Vå ÍÄ’.•Ø8ªI¦,ÏÀøA‘šCÄWý~€Z:0Ÿ`èM&å†6ô•…öñ¨kwÚè¶IXé Ä1©ˆóä„ÇP§yY“^RCJPTmþ©Åµ Âñ”&r¨üxó´ù£~ ÍÚgœ=b,æA’Óœ÷=›Ñð’1UaVQ’1Ô ÇêÇ&7vŽP¹0ÍÕòíž® }­H‚é›fµ0ábòv-%¼¨ô-¢Kp/Pfª^nlkk22LiNò€>hr@ˆºOŠXM†¦jO®ŽS7l¶Éö¬n4MÊ+lÙF&é ‘+¬Ûqvc|%4jm™1ŸÖ‡¾–”Ó×êNîHI#7¤~BÏOÜ€9LxAÕb@ÑÙ"ok•…×&%s^”Œ“Ò££Å&´j$±‰/ü$QbóÍÛ’âFKºVɘf.Ïs²¦Ý‘ >ZˆæîL¢îÁ^»¬ qZ¸îŸ¶èŽ­ÆfgŠدoôÍCA{Û"ßÒû¦×ƒ–#H‹wu­&Iue+׿h¼½(kº,¢D·Äžäw€ÒÓž`5± Û7õS“íô˜¡šc6œ`Õ<0ÑIu¸©Õ(Ñäf7£ÔÛt7}U©¢ªÙ÷ªh·ô~…ß~b Ý«ði•ûí#²Ìö÷Z£t¬n!“ ¶‘'½ÅªO2Í\½d¤8‚O&㞰”æm¥LWw)º#•q/Ö$óðp‹Àì³UAì¹È”?ß}FJ¬7áq¬çÀ`¹ÿk!èßÖXG!Š®ó¡íÊlU«é®k$]Ó´ú*QCI…K}XË6oŠ0l€iú¢ê%rj¡¼tuNõ¡Zà&¯ð3¬áñ&¡ƒ1àCÖr>Z² I[½àÓ9×ËÙ?ñóoK„endstream endobj 15 0 obj 2958 endobj 19 0 obj <> stream xœ•ZÛ’ÛÆ}߯À›°ñÆÌàê7Ù•rœÈvÅY?¤´)Õ’H`‹(þƒ?:§ç†!wWÙ”Ê%kÌôtŸ>}ºgÿˆÒ„E)ý±7Ç›o+£Ýx“F»›?n˜~Ù¿šcôý=^¨è÷Ûó ‹J•µHª:º?Þ°‚%iG÷§›øÐ®›y8<Äâá6²ÿ¸½ÿx³Â~x£¹á¼Nê2Ç*÷››¸ÿ¬èiJOX–0QWöÉð¹ÕX!’¼ÖŸ²<öéé°|Vš̃`{zãÛßXjM_‰ºLR­D¡ß¤÷>ìýZ>´];=ÄîwØ2KŠ*efå4Éð}ÜŽÑ´WÑvîš©í;üCNѹŸ£ãã=ìY˱m¢a>(픦ïÆi˜aX·‹dô8ô»AëgZÕB-ÒÁiÇï¢àð«#„Uå3gãŸ'%ÙÑ„@`IQÔµýðî´`/O28ÔaoÚGòucðyá¢ø>þá÷ßÞ}øñݯßßò)Eüö݇·ïÞé Þ‰È¹]Y´l™äKð€GÁµ»v3áà.jGµi±攆’wÕ8Éaï¢Ó¾…OÛ‰<5Níáõ>Šðú $°ÔmtxXJâÎrFá§ýÖ ÑK\x‘ÐЧœeUR§Î-ÏDè¥÷ÛëÐ$’¢®,š˜Ã ²18µµ,<¶ºeyü¥5'WÝ’]\ð¤Âìz»Ï๻E|X^•±l»ç¼d½ŒÅ£ƒµ;¢~ë’˜}x–hwÿ»¿}¤ ƒ0@ƒ1«¹YpÅ“2s‡M“Ê&†ì4½DëHÃN8 ¶<·©}DP§ö¨pN szJ“‘¢¿)5Ù÷õÇÜŠ@3êc¿ºù¸ÆYú­=µWΉÍBS)Ùì#Ë‚£<*ó)Rê÷~"luoôAýŒNQ¸ƒNr9(€P•–VÞÇÍ4c“³3qc˜4WhX·óØÊêX•‹K$¸fínVg޾2“φ¸e7ÈAaiÉräÃ@דÉí j]1Y5Ê­I[È.ɹHñ^å¾¾oyQ'YÊãþ¬?Ñ¡ä,)ËÊùÇÕjÚJ'Õ$ã©ëm#L"Фôõò܇J¯Ø²Ú@à©'M¡ƒ†•X˜”ñâ ßxg® ,¦÷‰dÐZðÂpG.9‹¦ÝbéóÚ$ã&ûžR¡Ÿw{ƒ†'Á[”3ˆLF­iæ0€€Gòüœ›“/ám;b§3AûvlíA•Æl9ȡդ¥y¨Õ%PÜ×:­ÈÞÕÜŒ€°ÜJ¶8n…ç¾Î¬ ’Ë ïêp[Ѥ ì3®Å9!¨Ï«:5è3~êú` äpV¤ŽKNR(Â}mZâ´ÞtÚ»R0ÔÎ £d|aâ´è'‚‚ðú e¢æ^?]§ßØ‚Zµ\=ª*Öø¨šÖ¾ÑnpýÐÕHüx£´¨¥OøBoÝë·h-]ì–ío2‰ê¥E6 „¨”(<2SÃóaW:¤ŒŽýf&<¶ªÑET. h‘,»2gÚ¸0+QuÉÝêqò–![Ì#†Š çv+ÀX8ÚˆiwxçLÂVh5²€ã¡hL $·lz5:àôq/ÑÔx~™>]8vûQø>è”Ä,áËRën2G$÷LIƒ»´Èh ˆÖ*Ë^²è©IõµIxAÅŽYÈFXœZ’óK@Ô‹¶;Ï”É| pÐ#ºÓ0:å…ËŸ·V‰¢î…/kaøI4tæ¨ÛÌçàÔ=ŸÆ1€6ŽH=’sçhOËäkýpÚ÷ïòÄ4 \‡pU¢úÔØÌ&aü6@X¸§h>&¨áèŸÂePëê…6ÔúÌÅC7’Tµöò¢ÕË¡Ò=Õ‰$-Mt>ƒ–e -Šz1¥´âùŃ“ƒ{ô(ñ©»‹>ÒÆd4Õ"V!Ä…kÅÕ¡R"Êx¯è²ÁŒ^ëÆ¶ù¸ì ÐøøêkÝ!Ë/ÕL­NOîÃ4+Ѥ{RÊrãâ/£i?p6Á¬›†þp­7³âéMú1- m+bÏ,(ž¨V$hôêÔˆÏ š)è‰ é'eŠy»]Ô¿±z œ¶! ì;ßýˆP¼:ƒo½¾‘!ð*ÏBd©A/¬;µ¦[ei™da˜Ù†tT *Ó‘½|WòIŽkÆ®…Q\UÞâNÏ¿Þ j…Sÿc½è9ˆÕ…ž“àV­è^výs¯utURSË_Ïœ¤5[àiŽ#Ÿ,Œ¢e­ø  ¾0$±ÌÖŽf/»²²Ž(=³i¶ÃëçiO²1zˆƒq[‘‡+ê>]¢«ÚªAu U÷éŽ÷SÛØñÓíÑšŸ/²¢f…éëÈ®¾ùÆ"íΚþx¤)Z% Ó^»èe²>ãÕ?Mâ,:.5L7!˜>Þý_Þ£y •¨]}naÕÝf©ÉÇÏíÐwÔØºL4¦&¶w¨XaJå]Hß>†ãœT,…N؃»löƒLÀJ/÷´|3$Têñ{6ÊÈ@Di‘Íd' ýú£jœ©†"Q_Ú­$/-/iÿÜ1§~;¥g%uŽÐ}’:NMÑ&ÑOšºÄ „™«j58lHBc­¹!=º)Á¨†Æ·K­dÐ(.5ÏŸ¾¨„¾žÉì"£Ç3È|ÿó/z¼.X ¶ÕëÇÒeáïâÓ¾möÓy´¡$öšÙ4ShþªA ªLZ tá/O®¤m ¦Ê…wZa¿ƒ´ÃÆ:-™Ç® I…²òg£ÛsNÔËëøtP›î.ÝŒlIúz‘økÆ`€kF¼4 ±ý2áG–U<èMd·‘ñ©’ôub›#t@^€·‹a‘ùaRjÅŒ-ŒôåWI8¸5ÈŒÔʰ«vV‹6¿›Úéì‹£¹t²7S½Î ¨*Ý;[½|™’.Rñjš[‰!áe0/ÊKŸQP'ìùèÇöHý¡×ßÛù@˜á•/Om–ºnxŠ> stream xœMQËnÜ ÝówW[ªoƒ1ÛHÝDÊ¢•wISlOˆl˜OÒüC?º€I±@pÎ=xŠ hZe7+ùöSÁ9 gòLX¡lf…›!út1Ìä˜a 8(Ýb¯aX ëR-ax%Õb›ë¶¹ƒc®£‘÷º¥ÎÛå£N"sà v=bï¢+æW” UÔ€¦SÙàþýŸA¡Æ®n˜½¨˜†»ÓfSÊs0ѽÿ˜HBßò#®¿Á£Yendstream endobj 25 0 obj 384 endobj 4 0 obj <> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 18 0 obj <> /Contents 19 0 R >> endobj 23 0 obj <> /Contents 24 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R 18 0 R 23 0 R ] /Count 4 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 21 0 obj <> endobj 22 0 obj <> endobj 26 0 obj <> endobj 27 0 obj <> endobj 10 0 obj <> endobj 28 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 29 0 obj <> endobj 30 0 obj <>stream 2014-01-29T08:09:47+01:00 2014-01-29T08:09:47+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 31 0000000000 65535 f 0000010558 00000 n 0000012731 00000 n 0000010478 00000 n 0000009832 00000 n 0000000015 00000 n 0000002700 00000 n 0000010623 00000 n 0000011160 00000 n 0000011095 00000 n 0000010955 00000 n 0000010664 00000 n 0000010694 00000 n 0000009992 00000 n 0000002720 00000 n 0000005750 00000 n 0000010744 00000 n 0000010774 00000 n 0000010154 00000 n 0000005771 00000 n 0000009335 00000 n 0000010824 00000 n 0000010854 00000 n 0000010316 00000 n 0000009356 00000 n 0000009812 00000 n 0000010895 00000 n 0000010925 00000 n 0000011039 00000 n 0000011242 00000 n 0000011308 00000 n trailer << /Size 31 /Root 1 0 R /Info 2 0 R /ID [<09451CDE922D6106438DE4931466FF5A><09451CDE922D6106438DE4931466FF5A>] >> startxref 12885 %%EOF curl-7.35.0/docs/libcurl/curl_easy_duphandle.html0000644000175000017500000000522212272124467016770 00000000000000 curl_easy_duphandle man page

NAME

curl_easy_duphandle - Clone a libcurl session handle

SYNOPSIS

#include <curl/curl.h>

CURL *curl_easy_duphandle(CURL *handle );

DESCRIPTION

This function will return a new curl handle, a duplicate, using all the options previously set in the input curl handle. Both handles can subsequently be used independently and they must both be freed with curl_easy_cleanup(3).

All strings that the input handle has been told to point to (as opposed to copy) with previous calls to curl_easy_setopt(3) using char * inputs, will be pointed to by the new handle as well. You must therefore make sure to keep the data around until both handles have been cleaned up.

The new handle will not inherit any state information, no connections, no SSL sessions and no cookies.

Note that even in multi-threaded programs, this function must be called in a synchronous way, the input handle may not be in use when cloned.

RETURN VALUE

If this function returns NULL, something went wrong and no valid handle was returned.

SEE ALSO

curl_easy_init (3) curl_easy_cleanup (3) curl_global_init (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_share_cleanup.30000644000175000017500000000341112213173003015771 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_share_cleanup 3 "8 Aug 2003" "libcurl 7.10.7" "libcurl Manual" .SH NAME curl_share_cleanup - Clean up a shared object .SH SYNOPSIS .B #include .sp .BI "CURLSHcode curl_share_cleanup(CURLSH *" share_handle ");" .ad .SH DESCRIPTION This function deletes a shared object. The share handle cannot be used anymore when this function has been called. .SH RETURN VALUE CURLSHE_OK (zero) means that the option was set properly, non-zero means an error occurred as \fI\fP defines. See the \fIlibcurl-errors.3\fP man page for the full list with descriptions. If an error occurs, then the share object will not be deleted. .SH "SEE ALSO" .BR curl_share_init "(3), " curl_share_setopt "(3)" curl-7.35.0/docs/libcurl/ABI0000644000175000017500000000525712213173003012377 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| libcurl's binary interface ABI - Application Binary Interface First, allow me to define the word for this context: ABI describes the low-level interface between an application program and a library. Calling conventions, function arguments, return values, struct sizes/defines and more. For a longer description, see http://en.wikipedia.org/wiki/Application_binary_interface Upgrades In the vast majority of all cases, a typical libcurl upgrade does not break the ABI at all. Your application can remain using libcurl just as before, only with less bugs and possibly with added new features. You need to read the release notes, and if they mention an ABI break/soname bump, you may have to verify that your application still builds fine and uses libcurl as it now is defined to work. Version Numbers In libcurl land, you really can't tell by the libcurl version number if that libcurl is binary compatible or not with another libcurl version. Soname Bumps Whenever there are changes done to the library that will cause an ABI breakage, that may require your application to get attention or possibly be changed to adhere to new things, we will bump the soname. Then the library will get a different output name and thus can in fact be installed in parallel with an older installed lib (on most systems). Thus, old applications built against the previous ABI version will remain working and using the older lib, while newer applications build and use the newer one. During the first seven years of libcurl releases, there have only been four ABI breakages. Downgrades Going to an older libcurl version from one you're currently using can be a tricky thing. Mostly we add features and options to newer libcurls as that won't break ABI or hamper existing applications. This has the implication that going backwards may get you in a situation where you pick a libcurl that doesn't support the options your application needs. Or possibly you even downgrade so far so you cross an ABI break border and thus a different soname, and then your application may need to adapt to the modified ABI. History The previous major library soname number bumps (breaking backwards compatibility) have happened the following times: 0 - libcurl 7.1, August 2000 1 - libcurl 7.5 December 2000 2 - libcurl 7.7 March 2001 3 - libcurl 7.12.0 June 2004 4 - libcurl 7.16.0 October 2006 curl-7.35.0/docs/libcurl/curl_easy_strerror.30000644000175000017500000000317612213173003016073 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2012, 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. .\" * .\" ************************************************************************** .TH curl_easy_strerror 3 "26 Apr 2004" "libcurl 7.12" "libcurl Manual" .SH NAME curl_easy_strerror - return string describing error code .SH SYNOPSIS #include const char *curl_easy_strerror(CURLcode errornum); .SH DESCRIPTION The curl_easy_strerror() function returns a string describing the CURLcode error code passed in the argument \fIerrornum\fP. .SH AVAILABILITY This function was added in libcurl 7.12.0 .SH RETURN VALUE A pointer to a zero terminated string. .SH "SEE ALSO" .BR libcurl-errors "(3), " curl_multi_strerror "(3), " curl_share_strerror "(3)" curl-7.35.0/docs/libcurl/curl_formadd.pdf0000644000175000017500000002764412272124471015233 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœµYmsÛ¸þ®_¹~•±|ÚNgr9»Éc»¶ò!“t2´Yl(RGR§¦¿!?º»x#%ËÉe:Ì%–E‹Ýçe÷a”†Ü¿‹ÍäÅmNº #“ß&Ü|IÜ?‹ ùyHüÅ|5±ïp’ ’«˜JEæ› S*c2ßO>D‹][}Z5í¦X.?FñÇ)©Ê{üåt&RFË£·E½+*òèÉé?ç¿NfŒ «.`S›R•â¾qFæ—“èêåôÄ ßò”¦*†XæËIôö|:ÿ×(JÁhÂr2ã¿fÙA`dFðï‚tzÑ—MMú>lvU_n‹¶-‹¾ ¯çórs}7·ëšAD3žQi¸{u}s÷ænxÌíBˆþTÖ‹j·Ôä¯Ç ü‹®ÿ†‹OÆi.ŒsþüCôêÝíåÅõíÛE/ظ§"…Ü)ù|u}»[ôöÛußo·MדçÏM_Üræ3‘ š¥™ÍÓ‡èk;…0žd°@ÙëÍ™{!„¬h’ŹËëS›˜S†=8Kiι{§*üʹ˜Å*Gø„PJ?Nÿò´þr~÷êöÍÍüÍõÕa‡Ìr«SÈà•ÙuziŠ»ÝêzéËÝ‘ýZ×ä~ÊU2M¢]Y-Ëúá; õf£ûr£;“6ŒàrÂh&…X«WºmÝŽ¹½x%b)g]ÿ¥Òs×}œRòÒÆÒÔ:À¯èak\—ì꾬ȗf÷ €\à)‚=æ1M&Ã*·ßKˆŒ*.¸&“Ü<³\B ™SÌã…¾¨8RÒW'Í•¯Î¢€ØË®¸¯´ÁŠ=tS>ÀÃÚîfÂ=J72Hɽ>ùËùí‘#A,"$[h–©Ee ã'Ef³uQ¤Ï0'-þÃ6…Ü]¹0VOjm›’] !v=ZFqßìúSíŽéS(9ÇBlBðïL®šØ¾Ê!„oY+ ü„R\MclT¹ˆ^¾=7ÞTW×Wóó«ùYŽ’7V:ÍÚ@>p< MÓ’¯âݶjŠåø(EÕaoÞõ 6V°ÔÌ 3¡´"¡Ù Ó4g¦‰Žfó÷7~û‹7—ç¦}”À(ßÈÄT¸G!NJ~Ö•·ŽÌ‹(Ë·®€Ù‡÷gd?€êªü3‘~†_äÀrÿãx@+E‹]‡­'t{Í6ôaÆPã˜k ¶m³Õm0/}g\‚•g˜ûaí*û)ö² ª­õ.MÉá»ÖÔÔêº%J„rîƒAqƒ}ÄÔcQ6ÅgdbIejØ¿´j› Ôa¬.ø¦’Üq–ù„e8Dº`ù~„ë×m³{8¦˜ S.5s-û\|ˆÌ?cp"zwqq~ Eÿûüõ‘”qèf=¹,mýAô¹S>MÀðåa<¹6“ÉÝS£É0È}zu}ó©h3!FÃàß`ÄY¬BÏˤõˆ½õä@‹µØ¯K¤fkßa`ÓñðJjƒr©O5áÐd¸ ª¡y>šè„“`+ë–³n†-ØzõuÑtb0aU墘¬J] hmvÈugM#K7Î4 š›.Àî±éõ`bû«qÇu‰™míß]Î`£MY£ïŸ@O¹²Æ],˜‘™ãì9óÄ,ˆ3p°‚e5>g–Æ>ùå烷@T†&²PN…ÄÆ7‹úÞü-rÔ,†æ¦¹!wnUœ±Eùn@T¯»3#¦AùŽøú w°1?Uq r—‡2@ûj*Âú4ß°Uñe¥®cˆiÊø¡y¢¢l-ÉAw…í¢ÿ¸5Œ9 O§[£'Ú¢ HÈåB /Øš{BNu3¿uVmý6É2«ÌO³–»ñ` éÑ OÆw['‰š‰|ØÑ¶¦§ kifèÛ/š» 7:_%•ƒ·À nu_2õ(ë–#³Îõ-|À',dUjü“ƒ 0Ýo„ óßÄèÛê à²s—&îº!US?@ˆØ»€†ÆÁ mg<˜Ì5ŽÃÍÔÉ]ß§€]¹²F¬¾M<=i1W¡ýôÖˆ¹çç<„ïNøƒ^‰AZ•dÀµt8a"TÊÝÜÈáæâ0À|”ÅĦ`‡ƒ÷“, ‹2ˆ;;ɱaÍà“ö6©$6ÅÆ&•:æWÝßã—¹ë±üj†VÂQæ55Üœ>¢Ÿ€AMŒŽ0–,ŽzÃý͈€2XÖ|,¢œ‡+Y7}þŠ”ÊÓöù›…SšnFÒÇ‚úƒz«ÿ§ ÀÙȸ:­©ˆ…zÂe(€‚Èᆀª$9¼ÀY0ùa›i’ØÎô˜û°Ž|6ÏÃ\ Û¸~Ëo-×aFVÃdÅý øGn> stream xœ•YÛrÛF}×W`ŸVIÌàþè$ÒÚ)[ö*Lm¹¬-Ö Á eýƒ?:§{.¸J”r¥b“ÀL_NŸ>Ýüà „ôúcþ_nÎ~¼I½ûî,ðîÏþ8“ü¥gþWn¼Ÿ–x £–ë3ýŽôRå¥y(²Ü[nÎd‹,ô–gŸüò°o>¯Ûý¦¸»»õÃÛ…×Ô+úpq¡â@Aê¿+¶‡¢ñŽž\üoùëY˜xøoywæÿüûÍÛ«÷7ï>ÿüþzyy½üííåõ¿—¯ËÿóSRñSë¶iZúLf" ó æác)m‘ÿXÝy«'¯ðšv{ïÝ×ôhˆ4RjxTñ£_k<Ñ?T^Smïû¯]ó¿ÊvÛWÛ¾ÞuÛWø¨è=ØMýx#™,©4×¶ÿ¶¼¹|õN?kƒ˜çB†æv§_Ð×aš …cŽ'ß|ŽKëÎkw}Ýn=ümSlÝ?-’X2J|ÁÑ»àÀ$"›qõæí¥ â‹¢‡ðdñ4zß“bS{eqèªNGz}ë­*o_wŒòê¾sóð$>í<ØZxõV{±+ö½ð–ø+»m/»íÓ3Þ][u³ ‡™È²@šÐmÛ~X å¾þ䇾Ý}]Mó+ËvSiW¼Ã®ia1ßÓÕ›þž\cØàÇ… tpá;¸Þ·}€ wŽ*Jõ\Ì_lä:ÙÇÑÞ_¹Èó@…>GÝðØ á½+UOUlÝ(n*¦ MLÜÌéÓØ…‰ˆ²\6eœ‰ïUsG9¦BX{ñ"Dpò$vy*Où S5»=»æ"T¡sUå™)µ;øêܬ{p7©7[ä(AkWtyÕÆŠ>·N{C)™Km¡BŽ0WÓEÿ´C–õÙš.à/ð^ž¡•š0}eGcÓËåYlåYd±÷¾ è ä>È3[ù0˜+ÁÛÊzPáý–Qøe«+DÏFöé°Ë\Ä2ì×ņúqh´,‘†ŽMçívùñÃÌbòL†æñÛ…à›U@a:Å€³s"Ä Ú°Ú´Àܼª·7¸Çº? ªŒÐ]Ÿ ªbùQŽLE´"ǰ¾¸Š½møÂr,Àgjˆ¹¦á]Ë•KüWx]¿'à>>ÔŒa7G"É-_€Ó:“¬ˆ¤Ñ4W³i‚„øüwu]½CÔÛ®§fî(¶cê(ZT–051DýÓ4(׋tAœû¯Þ]:]e£Ÿ$Ù??ºÃsÑÑÓ—†j+Mÿ*úd^:Õ'ÒÀ-£¯š¦sú’Á¨”P ðy•P_?A÷QŠui×|¯D|‚í»±aæ\Ó˜(tÓÆ,JD>Ä๞r†Ru$OFx ¯‹²'õLOш(òä$~bý ’Ìÿýêêòæ a$'` X–‡ÊinIÇÈh=‡³]ÏüUA,’gy/ÖýHÞ˜JÖ!Ì2•64}ï⟉(2u ií>†‚§&–ºTÔé ­‘B©1æ´FÖU4$B¨]U(4Š<ð¶b„Fh³–Ô?ù‡õ,¨¦þºÚsH}d©µË©XÀÁN[,¦ä?gˆ 58ºËêòÑŠg¯ ¼òäDÄA-'aÄ4,x9 ¡If;0ì!³ °Ð]ë7Vkˆ°¤ ñ™îvº”ª;=üèÜ”üÝÙ”£‡a‡­õ¾BìÛ¾n¼b [ç1ƒµÒÕ ÏØUÑ=}.› c÷NÚÓi”t¦²M †Ñ¸DV~d‹(OäÀͺÜÚƒ¶ªhºV{!Wr˜uâ¹e4‚ ÃÙsé4C¾–…Ny€)„3*´%áÏiÚ6+„ ¹zêµúÔÙS+Õ@q©Æ±2Qf’¾Ì#‹º3<î}ÝÀ½4òI•ƒ÷,qœÎeºB™¤Â°æŠÓK‹as«™ZG£ô²rFå…'˜Šs2i®ýÏÒ‘I¹Ñ”ï}ÿaù—þrõûõÏË7ï¯åo'Ã]š©\VEù….º"i.¥gã õBã«)’=Ε¾=¢= ¡vù›M|®œrJ#§«y7lƃ3Mi–×x™aíþAk8“{™AÎ….÷ëqî#GŸ@{¤œ •›yJxoÖä­N,íñ*Úo("’uù±3rœ Ú/Ít·º²YÁè¦m¿ ¡_Œ©Ã!£›Ý TÃDŽ:C=Ùoé|nYcôz#ŠŽÙI«i•âÀ$qjzŠ $ƒý‰]`™ÔC>BœÉËÂ<HD†Z} ›ÅÇhüC-0·m%Žf “°ˆQ‘æÁóÙ14ÂY2?æxÇ:ò1ÊEj{€äÝ%Ùì€ë|¤’F-_3Å›ÈÚ·=Äkµ†¾íª²6§t¡÷Y·þ{½ð,îî4¿Ú’N•Ù?'I^Ýܼ³Ò”øäˆÞfø¯ÐW¨Fxüª›ºò¸µÐZƒ¯ïèßÓeõí«GÌ./T” Ë'džƈ1vR7 ñeç M + ’%Ò@‹×`¬e?˜F"v_<¹²òh—ù•u5® S·ËÉL/šC%¼KZŒŽÑ ˆ«¦Ú°ÄY…÷õA.ŽAªW$ä.½n–Ô´)0²{k®ÒH‹áØ5ô™@“î& ‡¹³}ßnŒ9¦Ákw†+Z캈_^ÿb梅«FZŒv#œö¦ñìæDÙÍI*íþÓÿZŒú‹uú)V  #úªrÿb£´¯Ižk_yiëqܹ¢,l)~+«f½)rø(=Z î'†íd´m}tnÍ}W5ëñõ1L®K×¾AìQ>oßÕ6Ø=EJËîäbwX¬ŸVNè^â"»Ú|–êý§ÎÐÆ¨~BžØG!›³ÍÜ1̤">¹ˆ7Ìö}âj²ˆbÎ7,"ª¿£®*ÞTböô¿õûÂLAÙÖðÖfã}xÿÛQR„µ†QôR:Pdd~c¥ß_Xâ‰>W.×Z×ÔˆfM°]妯Cw˜…óž=íž´óJO„õ0‡¡[š Å-‡s–~“>»Øoò”Æîaè6Ëh.r~Z önƒÆr£í*GÜÓ_dî«­¡…”fc‰]á£~§ø¨#Z@ákyÅ·1u?ÉâÈÿFŸAñ6zßÉjKÜÝÓÊŸtMP´=ZUkÚWk¡„· ÞwMEó=µAÛ,h~€o!3¾-~°Õ;RÉzÓ´«öuµ-ùÇ°Ä¦ÓØ´O^€‰‰Ô%ú_êõ¸í‡éV ÔèôŸ$Åm·¸»!·”·°çiG½îûÝòj˜h†‘XX1;šÑ­Ám'ÆDèÂØýfêßú,QN-!00F™BªúõrùÁ$–¶ÎnZð)CÓ‹@r1ý^c°&¥îšqoç:=v$æl:ìæâã¸Êœ–ûNªEæ`ĵÿ–Öó <_s)ÄÖ¼ Ø&§F‡,£¸åeDüG¿ÊDÙ˜‰æÁ1 t´,Eõ¥_ÛÊS`=1&¶Ã(:íryöüùž+ˆnendstream endobj 15 0 obj 3005 endobj 19 0 obj <> stream xœÅWÛnÛF}çW,ü“†´âò"’ˆÀµ•¦,»2]4 ¦V–^rUÇý†|tgv©«)'iDC{öÌÌÙ9³ô'bRFLüTÏ8ÕZ}Ü•šIî´O“‹¤zÄ)ù5€?„MíaijˆØÔH˜jÌv©o“ðAèñ¢HF“¼H£ñx¨ÛCƒ$³[üÑhZ®IMÓÓÏ£l%ä Ò¸ ßk@Ü´Û$kú4ÊÆ §Fx¯Y » „úç„Ì¡A`yúç('œÜò$—M“¶]Æš5:¦ #݃d2q¡Õ ¸XR“9àH“µ©ÈÞï„×ýùÓ`6Äh3ý¤{Ý‘Ü6uÚ¾¢XJÙ6™%C˜é*YޝBC$Üô é<ÊJÈ@$“IZ.u,ŸUIþÍW µüÀwª…âQLgÙyÀu; Ž·ÜƒìdJ’l,Ïšÿð"'© e„E^<É >&qržgcd9‰Èéu¿;z{Ñ??9;É“:ŽÃ–ÅIñõ8ÏJe‚Œù— ¨fb[}fVjxõØJóc<ä~Ñé…ÜRžÙ€^+¯wþ:9¿ìvr%°Oݕĥ(±PÍ3b>ÏKqDð›üBz×ÝîkÜŒàî>pm€eCÅÓ¨ Y”ò[Ã’Mj닉aU 6áÅàv ‚(sÚ;ƒ×²C.ÉAW'<»SØ ™ÀßC}ã)ÁÐX3È„n PhV›ŒàPƾ|v¨¦"M[Ëtü.<ᄅø0$®n[³[ã’¶.…'µ+p=ÿ²ö­#ÃáPù=°o¶ÎêK™J>}lN %“­G1§÷ó»Ýêm)ôc¾(P†g÷´ŽÌ$’-˜R°?Š/ ÕÁ)Ï,÷[Tºš9­¬;Ð`X¶­çc‰’Ë7—Îç)Z«ˆ'b iAæz”ùËÞè°œ• |>ÙÛ%ø;Ñ,Cso×à 0{“G˜#òÚ¾žÕØô6lvÔÂPŒuÅÌ vÛÇGQ‡CóP©§æ4 x–39˜±ç[˜‡¹QòXÌòŒ@€Ãʦò˜¶.ƒWhÔy…NmÈÙ„£itzqù¡gØUü“óNCYò ¡f³µQÀÖ¦Ó‹^Øé…W€¯ò8Ø íôΰýPpEUŒŸ«bùs¾YQ%Ù.µŽóñw¤Ì»ôgc™Ã\B×AÀµéªæý,Z¯F Ù uRH 梨9Ì-©qãhM_£ÂF]—a­Â7YÒ ðÊUnkœ®ojFÛí ¨jšÂ2mj[»Z@ž/$Tj¸JuAÔIÃ1õÿA“ÁJuh¾ë`®ÝNï·ðʧÉà]Ë·Vͺ¾û¾Ýg;jþLÐd£‡™˜Ž¦yRg·}¢®ï0TaßñÔðªÒëYŠJ³½$/ââj Á¥ø’ºÎgpµ_Ñòíï]ÄÊ;›U/AËû÷;*€ÔV{üx_;¼YÝñÖý\!nÝ[;¾ÃÛ¯£ÂWÿHÔ7àåÀ÷ =¤y¿È8±LÓ’Ûœ¶]9ÚF9:¡ö|þˆÚ¼endstream endobj 20 0 obj 1195 endobj 24 0 obj <> stream xœµUÛnÛ8}×W òÐJÅð¢+Š>¸YgÛ±]G}šÂP$ÊqW–\]ÚÍ?ô£—¤(ÉIÚn±èÂ2È3g†‡g8Ÿ#Xþô7Ùgk¶µak|6ˆÚýIöð*€@.D™ÑÅð)ø!CAÑÞ ÌEƒè«ñÁLÚ*ßdeµÓôÆd7ä»[¹hÙÔÅcß¼Œ‹6Îá Òú½5X€\°™Q* ”æÙ)LÓš¯VôÉ b7J ¢PÔ!0fùM®c¹J¦z#çPó¤Ù•œžIŒíRÊ}›P‰x\ì³CY7x–Çòsþ~=¿X®/7çËÕõÂb Cê›ÓËÙN»¤i+^ŸLº¢eYëyñf.Áû{;³ˆ8;q<3N8útØê@27¢Ó§A÷e[Y$ì’Šxñ/p™;ÆÎÜX/ŸÝUB¥ÀoP®­wÅvL5]¯§GdÄ%ÈñtÔõéHç Ÿ„}žN|*Cœ^%Sª^ÀQyP‰^Â^ȘôÅzn8Q©*@˜#Î[/UI!Ò{æ·œE`ûa£³v†êXɯ¤&ÿ!5ýnjMHǬå{ˆ=±y|£šDïëÅ]é{áÖ¢ÒVnh¶™EµC3^ASB{ÈË8•Ö—Æø™ÕÅ``m}W»¾ˆ÷\÷e_Yʧ^`¾¿¸˜­2›ø«H€+ž”UúïàùlñgôºÇor^l›».Ì|Ü Ïv‚’¬(AK_pžò„ÐÜqàE û¸úkH'Ô²ÉzþGÂ|ÒQ6A4”½xÈ?öZ Ìv=츽èЭ§¥¹ž> Š—±ã»íßqî¤,^4PfÂJ¸×âO!Ošƒ<&4Ü"®ùw_w)×ÿuDB]ÀOõ‘y¾\D³EtüðPaG·ÍädP&D8À¸ï't×wUò·R ãȆæŠ7JyØY©GwH×÷›š7ÂD7j¥£]®¢Íë(Z­–W‘ð]_`ˆë_ÆÉa¼:Ü?¾u£ 9[‡b¸¢Ð•óÕ¦bž0®ø(àÕlÓùÕr„Jœàî \\ì¶OÔœ—@5d'yˆ‡¼ÁJýmZÔ•†ÊÄòÅØaŽÉ¹º¢‘Ö ‘ë £ßJÔ€!&æ·xìµáôøÁ„Ë&n ^F×ù¶-8PŒ©âv<¦ÙÉ4‹Œwâ÷*)DBendstream endobj 25 0 obj 913 endobj 4 0 obj <> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 18 0 obj <> /Contents 19 0 R >> endobj 23 0 obj <> /Contents 24 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R 18 0 R 23 0 R ] /Count 4 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 21 0 obj <> endobj 22 0 obj <> endobj 26 0 obj <> endobj 27 0 obj <> endobj 10 0 obj <> endobj 28 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 29 0 obj <> endobj 30 0 obj <>stream 2014-01-29T08:09:45+01:00 2014-01-29T08:09:45+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 31 0000000000 65535 f 0000009087 00000 n 0000011268 00000 n 0000009007 00000 n 0000008361 00000 n 0000000015 00000 n 0000002950 00000 n 0000009152 00000 n 0000009707 00000 n 0000009642 00000 n 0000009502 00000 n 0000009193 00000 n 0000009223 00000 n 0000008521 00000 n 0000002970 00000 n 0000006047 00000 n 0000009273 00000 n 0000009303 00000 n 0000008683 00000 n 0000006068 00000 n 0000007335 00000 n 0000009353 00000 n 0000009383 00000 n 0000008845 00000 n 0000007356 00000 n 0000008341 00000 n 0000009433 00000 n 0000009463 00000 n 0000009586 00000 n 0000009789 00000 n 0000009845 00000 n trailer << /Size 31 /Root 1 0 R /Info 2 0 R /ID [<8B7797926A29D913F5E9BE215EE43547><8B7797926A29D913F5E9BE215EE43547>] >> startxref 11422 %%EOF curl-7.35.0/docs/libcurl/curl_formfree.pdf0000644000175000017500000000727112272124471015416 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœUÛnã6|×W •ŠŠ!©+±‹Ò­fáµ][)P$‹@‘åµZÝV— üýè’ºØNúR°’â™™3sô (a@åox&…q³ àkkPøj|3˜Ú„á‘ðK„B¹ ýƒ€C  ˆ ƒ9. ˆ^Œ3é›üéP5Å¡IÓGÓy´ ÏžåªesJós\öq¯Z_¢O†M gxo‚e–%“•¢¥a®n­)î2xÂA4ÑÞ0?/¬è¯3œœ—`3.·éØÀõˆ¡nR‹»D„žk~Ϫ¾ÍOðlqjöY¾‡¢Ï»¬Ž›îF¾¹»~‹¢ lÖ»’cœ• õVÁÚÌ'¡Â¶ûsµÞìîv¡ª# ùCV&y¿Oá½Dx#ÿÈñƒZïfÐ#7Î\âxgü~]ì>nï6ÑÝzuÙ„™"#¾´Ê‹qí´GÖBߦ{è*Hò4.¡¯AÉ,û‚÷±Ð%^04Z^ênž· m%BÙ¯î&®ë´Üã}/Yw|Å Bw 8a‰÷{í?,ç&+$g<|Ÿø>åÃ[$’Ç´9 D8¬‘HÑ£®Ï ¶í„¡¾wáA3‰ó\b;¦%tÇT=Æ-¾„+R‡Ÿq3KŽÐêLž>A¢´º´ÑúNt¸œ³IãöôT§êÞHif"0[3“©®FE4l7$ž¶´œÔ›º¾B!ÚºÊJD![¥²ƒŒ%‰6.æ½SÕC·CGqûÒöÜ(ðˆàãýv¹ÞDO2Q2P—hš.ƒ±óÔ ’ªî²ªuÒ®„A˜_Œâ?˜ÿ` ¨ŽGÛe]Z Ö˜¼êˆ¡–îÕÈèÐTÅ5ü€¸áÔý7½tf!d= 3C‡›KÄ )/ÂŒŸ_qýït² ŽƒÑ60Ý/ôæÁ©„`"TiÕíÄTO·„„ž•mŠ+í=tŠ˜‡Œîô( §I»¾)±ËJžaŠzr¾;:šÊUèW1ÿÿÈ—8ŽcL| «ûå’¼žMçÄæÙô`nÑývXò#%|fÞ.ï×½ŸGñª*Ó7®½ç‹Ü.wëÿçãwÕ05±«ržLÀdœ‰µ-<½n»>j ŸNH@˜<ĉj0§8©§QíßÎ ¿Äll›Y7YœRý*&/tÆwÔÒ"2~Çß¿†£êendstream endobj 6 0 obj 959 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 13 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:45+01:00 2014-01-29T08:09:45+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001282 00000 n 0000003162 00000 n 0000001223 00000 n 0000001063 00000 n 0000000015 00000 n 0000001044 00000 n 0000001347 00000 n 0000001673 00000 n 0000001608 00000 n 0000001468 00000 n 0000001388 00000 n 0000001418 00000 n 0000001552 00000 n 0000001739 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 3316 %%EOF curl-7.35.0/docs/libcurl/curl_getdate.pdf0000644000175000017500000001430412272124471015221 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ¥XÛnãF}×W4²C%R»›Ý¼i xm!q`9“‘ì`¼Hh©mq#‘ /v”o˜ýçTõ…É€“Íxf,“ìªSU§Ný a”†_öûz?ºø‘§jÄÈÓè—×7‰ý¶Þ“­à/¬Gæ '‘O¢DÐ8!«ýˆKFcAV/£OÞº)w?>©z“ÖêÞ÷c²ËðâxêŒ2y‹4oÒ9{rüŸÕ·£)£>«kpš€SšèW„du;òî.Çï'Üå XV›‘·˜Wÿí¡ô•,"Sîãm†ÈÀÈ”\9žw<@{‘¤L0n >+¼©%Ô“XÚeMR¢MTu™åO¤.HÞìTIŠGR©u‘o*¦‡~ÊyB…€Bk;Ëwß½_Þ,»Gm”³÷·,_ïš"ÿ@àøÝþ÷¥NEíÕõI×Û´$_BŽ.>pæJÆ ‹3ȵ)t™Æg¡QÜfaR·Yˆ©ŒÅö†qý¥ß:œF"qÏäÅË08Hìlßÿ~ž&_& tiºž/¯>ܼ_Ý|wwê¬M•ãÜÏJ.¼SJu¼%BßBÀÊûš¥ª›2¯H½UçÅ$TBé{óC±ÞNÈ·ÈßòHxUžDÐl¦ÿ’,×Ïý°º"XM0çÓ‘‘FQ¢½þVäjB‹RŸÑœJó>WÒ/ŸÍe¬÷_­e¥„¾‰Kô!-Ó½ª!¦ê ÖÙgUQ²:·Ì|* eNjwµKdŸ™Ì*’5i*µ™CZU$ÕA ä\|Òw?ÜÞbP¥¢¶õb~ÖèS]XWÿ÷—-Áb‡®ã?,oî¾&×Ú§LâRÒ¤‹ûrÕ•”‡‰kù’\Þ]“ÕÍb¾4M£º¬{á6™´ÝxùÅÀ˜Ç!g_L1¾À|¤N€=ušåø±R­A5àoI š =A,³ZíŠ S_« y8’—-\¬éZé‚’¢Üâ"Ìó'Ûïá@™¥;Úëø)—ð©'7—›~€O\€AOïöéÑEŸóžMÎbʃŽÿ³û¶v,dŽ·ésÑwÆ:Í(+į±Ï†â€‚Iët§ò Èî}fÈÙ ¢a×uqÀu(WiN”ë…Íii"¨ðã7Ç”D·ˆäóy«(±U”ô]¶€4mI­R‘5¸-òÝ}×ÛR©éNÕØA*ÚeÕ–¤¥öæ ­:YZgE^ML[>û¢'%Â7Sר–q~Se1=”êó¯cHpû‰¡jund ëmK|à ‘d“=euEÇÓ ”ÇÒ›ÿšî;UÍ É]¡…T€sݱ$&t¥~æýø–:^’H ;iÂø@ >y,œ‚]xÏÓDjpúGʸ ͵ZýnY`kê8 µÒ2~½ÁN@õYm¡5,£,j+Æb]ü” {6¨É€ÀÝ0>'G>è%|Äòþ88ƒžu‡èÇîÚi]!æXc.²o`äh¼,yÉ€`¡-žù©Ö´¹£Üw¶ S¸&ôtµì |Óëb ›‘o¾™-³åäd¶ŽŽÓPú®{ÍÞäÊݑ߃9àv–6“Y>\—&r·òýì™ê¬$ŸËª6Ž˜§·ÍL¯"M¯}»£©c IöOGB®5ä±0ûoºíV =Âéë-dá­™phÊþR‚ÍÓ¾t¨¼/²Žfvž¼A&f jk*˜!íÍ#V꺇~ê^°ŒHXòþ,××$=`ÎV¼•ë˘ƒ»*­Ú9¬% âÔ‰Ÿ˜úʀ㋅;¶7k…qcUí ´`ôSÝëE»ï Ö¦õÝú /õýlÎÿ}¹x;_³Ó[t»"ôz/€¹{™æ¯e¶Ââ™Lf""_/tëêZŠnSð ¥{–¡.¢íjÖëj§„ƒ¥b`_ ŸÐç{æ-pm6¯>ì°3µ°[“À©1Ȩ̈ÉÐÍ–$>"‚U¡ãàéÆtœ7ß™HÀ4ëùüƒ‘@rƒžÃ¿ÉŸ‰ÂD€PˆúC—aWrß–Üë; ä ‚Oä¦K”õ r’ø‘qo ¦ãÆ9t>Ì"{-Þ¾w9ôÞFÓeð4œÖâTœ"¤É´tíðð59OŽ)l`ì£Ìñð5h´µRà‚ M˜œJÞ‡ ¸.lbcɽç‹ð"‘--{ñîÿVˆ«ùë ñ—»mn¶†i$,Oñ—™ú1û‹KÖX„¿ï4&ÀûeóD`ïô=x;haís¾}_¿®vo{endstream endobj 6 0 obj 2131 endobj 14 0 obj <> stream xœ}U[³Ú6~÷¯Ø·ÈÓƒ¢‹¯¼Ñ“ÓI2ÉI>}9t2ÂpclbÉ¥ô7äGg%›¥3á¦]i÷»¬øŒr`î9~–ûàõ<…­ lƒo÷A?Ê=üZ`BæŠM0ìá HsI³Š}À#F3 Å1x&eßÕ_¶Ú®•ÕK"—!ÔÕÊ-†3ÊXJ>ª¦W5ü/3ü³xÈ&ø*ÖØH}s\ÀB@0§,žÆLXÊXXü`´ø€™Êb&¿d >•bŠ+¿0ü¾ ˆ[f9æßr ]’_ÏsÄLóØÁv-MxB3ר3YaŽX¢˜Ìß„2¢yÊ™Íß,<† ]~›ðhh–ð¢bW8¨ÎèŽ!w¤D9QŽ]e­nÀ¶°SͺÖà¸MÛí•5`º¬¾ë5T Ì»‡LX’ª)ë~]5[°; ýÁo38g^M’Ì3ÚŸ\í5üÛ6…ßÚîje­k«;ÊÄ Ë´+ÓÖÚbõÕi8›ÉÕuY³ÇÅ;¸…¤IÊ´DÈ,¥©HÐ+ˆåtb.À9ò,;JWuI°IL˜È<§BÄ/œù~øŠ62T§=à¶©Oø¦kJ$<£NÞÅï ‡º*•­ÚÆÀ^ 7šºB?ÓvþP<Íá;]Nfž~"«×²nú¦tõ Ó¶ï°ì„Ãq‡šV6aNóœ ITU§²7‡áU3¶Ci(|•îXawrYM¿_¡iÚ ]¶Íi0¾5²Ö¦ìª•^STADn ÐWƒãÈ»ß}Òªì±V&%’ÊTŽB¸\ás·x¾E÷áɉs2VïÑœ•ݰžœh_pÚì «ºÛöOºñ’"A±Ó]ä :09—‹Çrÿ@½DD4<¿í M[:ª”EƒY2ÌÄèµYž‰êòŒ2sÄc,ZcªΓ©¶ Zx„1й éÀá[…´8&LœËs6”ÿÛÍŒ‚$ºÂï¸lZ‹ËÛ^uª±zlЉi`¥]›‚EìËy£[N(09åÑ”¥ðTÜßÁ{w/v'àùc?n%¤í¾Â÷FÝNZ–‰[øŸn»myrgB‘’Þž3Ð88(HËþëyïFÃs6:^D9GçKÞÙ9‹eL†;üfFbáækókgà@àíäSªq'Rf4Jae‚F~Ëø¯)e©û³ŽCij~ë.ùØÇâ˜r>Æ„[y(‚Ïøü“õâtendstream endobj 15 0 obj 954 endobj 4 0 obj <> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R ] /Count 2 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 18 0 obj <> endobj 19 0 obj <>stream 2014-01-29T08:09:45+01:00 2014-01-29T08:09:45+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 20 0000000000 65535 f 0000003670 00000 n 0000005633 00000 n 0000003604 00000 n 0000003282 00000 n 0000000015 00000 n 0000002216 00000 n 0000003735 00000 n 0000004069 00000 n 0000004004 00000 n 0000003936 00000 n 0000003776 00000 n 0000003806 00000 n 0000003442 00000 n 0000002236 00000 n 0000003262 00000 n 0000003856 00000 n 0000003886 00000 n 0000004151 00000 n 0000004210 00000 n trailer << /Size 20 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 5787 %%EOF curl-7.35.0/docs/libcurl/curl_easy_perform.pdf0000644000175000017500000001045612272124470016302 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ…WmoÛ6þî_A`&1ËI”°a@Ûy@Š4Ég@á…bÓ‰ILE©Föú£w$E½Øé ‰AŽwÏ=÷Üù "˜"b>Ýÿm9{½è^ϺŸ}™Qûuÿ¶%z»ƒÄ¬÷3÷E‚!‘rœ¤h]Î( ±àh}˜m‚m[Ÿe¦Ÿ??Éz¯êòSÀ?ÍQ‘ß™'ó‹&D²ªÍ ô²ùüïõûÙ‚`FÁÿ®OázœF&£õÅ,¸|3ÿ"†§4ÂQÊ!ªõn|XÎ×ÿŒâe‡D eæ111ž†ˆèºû–¡o…DMUz/kçktùn_Ð'ö²›—W×7ç7ƒY`w]ðS^m‹v'ѯæÎ׿~øÍ˜³Ðd±~µ ÞÝ®.¶ l¦aÍY„ ãÀbbŒÐ+ Ëë%¾‚à(é2Ȫ]!§¡0Ãîñ§ù/§Ù0ÎqšŒ2ú}yónu~½>¿ºœâ8$E1%¶ÖÁú!×hßVÛ&W‚ïÛ¬(äeûFÖ¨y(¯òA\˜çsˆ?M0ciá¿–zj&Q$Μ½‰ƒ¹z‚w²Z¢2ÛÉ3{á!‡}y»›,¡˜Å´gŽ=k}ÁQ¦ÑNêmßA"ye³€X Aç‹(˜Sœ7¨luƒî¤Ïù7ÖXg¥<®KŽù uêÑ…: ÞUÒ„ÚÄ ˜¼zj•ñ= d€µ)qÊ1#áÁ ܵlÚº’;lí-Ó+ÁGm}ËmcQ8¦©/@»5¦®§À«HR47æ&  íàkìz'<6-æiøœ}ßIb”ª­¤öÈÕ­QG¬æ;!ÅD&è¥ÀßxÈ¡[W÷}=ãó=zV-€ÚHàˆ»yÁB ¬ŠG¬ Žß=)JÜjÀ R•4qfÝÆ9b–FNŠ€`Œv¡|•'jümg)fIšø~¬ä€ÃQÄý[ÕVµuv/M|m­°WOÇjȪBYÓÈò©16µ\´Zä³åÐ)ñ@ ¨UÔ鳪*é:à´oíUQ¨9 qš2,r]êú ,Z õèUPˆÌ6Ú[¢3!0eQ~¦§› î@Ip˜ŸÞYÑçÒ¡Ä„èX/µFï®o]• 1Óήž> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:44+01:00 2014-01-29T08:09:44+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001911 00000 n 0000003791 00000 n 0000001852 00000 n 0000001692 00000 n 0000000015 00000 n 0000001672 00000 n 0000001976 00000 n 0000002230 00000 n 0000002165 00000 n 0000002097 00000 n 0000002017 00000 n 0000002047 00000 n 0000002312 00000 n 0000002368 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 3945 %%EOF curl-7.35.0/docs/libcurl/curl_multi_socket_action.pdf0000644000175000017500000002264612272124475017657 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ­YëNÉý?OQR~¸1MUß+Eò²dÅ.ÆŠ,¡¦§a:ÌtÏöB”Gð«äs¾ºôe{¥D¶l4S—ïvÎw¾â7Æ]Á8ý1ÿgÛÙÑeÌî›g÷³ßfB}ÉÌÙ–ý¸Ä‚„>XÞÍôÁbÅÒwÉ–Û™“uõæfÛmÚ⦩²‡ùò³(p%V.W³$qc¶|š];y{“fmQ•_ÿËœmŠ[Ú8_x!w9iÙ¥¶Úß—¿Ìü0pãD¸wݶà®'`KS%LueHÖ.!Ý(a ?RÏßÓbNëDè†Ò7~8¡Ï/=îd½Œ ì ¢q>ÕbvÀôªuZ®6ù¡r#‰á¯¹×$C"])½(¡CZFŸÜ­YQ¶,Ÿ{¨Á$ œÇ›Û¢Ý¦Íƒ>‰Î8C¸±æ îʲ(ïÍMÍ—ùów{Qˆ]8 ÊO'WÇ—§—§çoÅ%r}JüÓÌùÛ:/Y»ÎYºÛmŠ,UŲN¶ÊÛÊ[QÞU7õ܇âžÒé †|À¡hèx(ݯ÷JHSÕè'šƒ&\ð´.²õ¸€÷Í$·³a¼aÌC· å+Ö<”û3ÕÔdAls€p“‚»®T{Fž×ÛJ7½%év˜irZ44©HÝ£Òúâ|Ý)†iÒn”í›106ZlÓ¦m§*oU²KU€úŸZcqQ(k&²nåžO·Ò—·iöÀ¬JCöb‘ˆz1hÓÀùpñqi(ü/ŸÎi`ÕNÐV*ò£JÁÜ'íà7}ÞbKVß•ÂÓdžU€‰ÖÂÆ]ŽeCH³®þB7‡~ÿT=wc°aIßV–ûM$•ÛJëi‚¬ÉtG÷0c°7Ó¶]kŠÊy,*œ@ÍB„ëE; ý‚X}Jeª„l šøºuüœë¦lû: ¹5"PuÀiX1Ôx¡ «)'ÔO/mJ¦(ádi²ENïA;ôàÓ÷óõfšt?Ñ´½<9Œ¬Îçj<ˆ~HžëfÖÕìhÅBãÞ”+t¼J”[jçÆu¥ 7¢s DpmYaù´W-1DPQd+%5@§ pœûb~J ÄÁ7Û úé6Ç*ƒWB¡ô£é•ãœêCþ¨Üx)iD@Hßä¨é;ÁkåA+.¹Ð¦ôè~}…>I"O~KN @Øç•Yt:j ÁbÉðJ²/ú ì̈ 3Š­ÐÖÐçq>}7„Ö%J?€[IcvM>8Õ—q‚¢Aò²ŽM:^)d 7ûaî ¦¯l¥“ǵ(GK7]N•¡Gs%){þÑó”aíð±÷´…`ú4û§-¿6‰¡ÁˆÇÃk€ya„{‡ìViÔƒÓéŠV“ïdÔ‡â‹Ãxzék#õ"3¢,nS¤›g [3ûMøâN—ªåÕÀIKB º„NÜ<ÓÄ‘‚¸‡ŽécáBpÊ0ؼý`ˆØ»/_ñ‚P-½X¿?;ûÑ=âªQ@¢øÒ·oïd#FVo£·bÛùõ§!긿G˵s²œKø Eæ¼?=»ÚäB 5Ñ~ûXŽ{±~¸3û§'`Ú=@bþ‰ú·Ð¾>;Ò¢)1mÕ>ïrL~£gRASýð€<Šh *¶§ADêÆ‡ Á˜)çZ½OŽ#ÍdMÔ/—ì€$šF‚¾Õ¢×9<ãMF´ƒ|ŒxÙ? 9#¹wp¤[ Ä\ì}ÿôŒ§il¤ =Ê’CšKç rîІ\A;T¨†¼Ê7•yyÒΠãûÖŸ§ƒÁè@ÅÐ|qdßãu-ƒÙùð4öXŸØ:*Vìé«wd ×¶ìêb ‹-bxÁ~í‘j:¦6%hË‘ ‡Q6²JÅäíîËüöªm¡ ù|˶k2n”cÞ<àÎáÐÁ2‘æù§³³oùÅD° Ì}‘X±Æc_‹5 NiÓ÷¥{—†^§ûÅ»q»˜Vð‘A ˆ#±¨QHïsñáÓÕÒ¼0þÚ¸2¨;L¶Ã+¦Ôþ/g$½Ú½Ù‘Ar±œ¼ŠL5˜yàÅ0µÊÑQ­LÀŽ]Z·EÖmÒ±$ õ.;¯Z³+%¹|oç—€~ÏG{”gnÙ¦Ï[È}U?è{š½¶„âwÅ÷d¯:ÝìS(©vÊXZæ*ÁóÈ$Ü5ƒ—(Ñqjö‡Úñ«Ò4à‘ëoGÄi±Å(¼æ}½³–é ìëNë„F=~f)ZóCŸÔ¦«[#NOÂ06Œ]ý{;ûˆ£ý¸|L¤`uY»å/“‡÷¤'ÒnÃ<Î#µÑ§w=»CÐG'ËÙ_ñç¿b4Ë’endstream endobj 6 0 obj 2901 endobj 14 0 obj <> stream xœ½XÙnãF}×WòÒÔ@ª°Š{ÞÜ=ÎÀ‰·qÓ4ìAS%‰cItHJŽþ!=çV±HJmw'&ðƒm²–»žs.e.Ì¥Ÿöw¾}±E=rÙbôëHè—¬ý•¯Ùû bzÎGf`‘dQâñ8aézääÛjõ°Þ®šâ¡.ó§qúßQèó+ÓÙ(ŽyÄÒ—Ñ£š‡,oŠrsïx÷c¶*iãx*—»nä\d›m¶bǧý'ýiä>bsàÑ9tÛÔ‹=Ælê…zEºTôøûáZÃcîí~³Ù,°ŽÉˆ·¯]clVi„³Ø®Õ¦aMÉš¥by¶Z=fù[f5+7Š•söûN[)qFšŒM¤5vG¹ú¹€‰õ"[mUýƒ¶^D!!›ŠÇú݇ۛó‡ë«óó‡Ë«ËSvï¸ÆOIZrçTj,Š›ç,ŠºQÕЙpß뮚lzÜöYÙ°bƒ] [gø“U*›U׸n¯š6°Q`zͶ³K,Ͳ¢³,B‚]×¾øÂ´Þ>c—Ç¥H’WíººMa˜ü {©ŠFý ËÎ.mÞß`ÛcÙ,Mä²ÍìYz70õæôâjì'<‰ßùD5èÃhÝ‹«·›×íž ¦Ò»c·øà Éµ9„HT¡ž+Ú—Oªó5>ðµy>l`4—Ø#Ѽx‰–F»ùm[ó(J¨µm;5ËØsU´wKèPðØÚSvYwwÂE”ƒH>—º{ؾܬý挄‡²=Fµ·î°§ïB˜&ÖÇJµÖ"òØÚ]QnëÕžÕªa/E³< esÅö¤tfu],z„ìGÀš$éî‰õ5·GŰ©Ì‹i ©.÷ýÄæÿDB/ͨÀÈ‚Ã#s‚€‘g{x1Š,t¿Ïº& Ô‚ìÓ­ÎÎælSv&”}TjC˜°n——𠈬~Ç0ϰlµ"_.oÏÏ9K—”g`yÄ“$䨗۪†Ó8ºí67æ¾e _Æ<„ã6 æž]‘+âƒìùyUäÑIhdHÑX€Ì„:™¡Œ'Mÿi„3Q~—]<•ÆÞ“”t~J`‘è’ƒP´ÜØ“ÀždÒTxhážÚ‚¿9Moo.Ù§±ð mB᜜ߞêªé½òùp‘—3tÉþYMØBmTm×j>¦cÈ| ’IdC—)¦ª ½A;MQR-žÈ#Ÿ,Iÿqç¼Wóí²Ó¼#"ᨪ†/,âýáUB¥ruÔ6‡JLúF‡fXâ¸ÌKlŸh?>œ€/nÏÇÒuÒ³‡ëÓ›¯n. òˆ,ˇLäÇý-“fÀ_Iâ ߃žNÔcV¤+÷l­2 %pÂTð¹uU€œëP8õ²Ü®fZ" è›ýH©6H¸]ô6ÏkíÞQ\ãÆ}·/èm¢oömüðM¾('„ŽxÖ0`ÀiHÑ™,,A©+íñ†äì£2­£e¤¥<ëfz-k5è÷Tûãíå‡ôìêRߌîðLÇ{ýqM±VåöÍcÒ³ 0F{Ê„ªx¡Œ6Ü”ãwhé™ü{’‡u^^†pF…TÝí…»± ô‡j.£áŽ Žô*¤Ê‰y!¯c_x„ÂÅf¡‹·¶j†8XF˜<–¾ývX§jCÆŽÏÙÉlÆTVïÛàÖÆ×áà1›=˜w÷ãUrOÞgè32B£)ëÁJtý&[¨>Mt±ˆ|°^Üu†0)Âwp‡FÜÖðˆfÍ5y†®]*dG­µ£Ú1*h×ëáîM•ÇV%@(vB‰§œcÛSÓ6®0T‚óBÏ; : kFÐ,«r»X’QÕpbИ2!Ì{Üç†=µŒ§ÁÚù ic„S•UžÛ|‰þWGèeÖ1å@Ü´íÑØ?ö]“+ÿ¡Žú±ô bãHˆÆBeña® :À9ŸèÂo{G×þÕmªoð±\óœŒÐö²3iâ¼}gbl±Lxv¤o÷"éœß[.‘!TB(:>kW<ù¸jްÍG{Ù"z3BNµÂoiAg3‚ »¹\ ÁϽäh¥…þZy€»[Ñcq¢Ö©·qöË8¦°I§“L;ºP àQtƒOCI2а³¶jpV Œ>ivÄžüôúGg»b(ÜÐ ,˜zº/Q’¦£ãçÔÌÊñendstream endobj 15 0 obj 2564 endobj 19 0 obj <> stream xœRËnƒ0¼û+öRÙø¶­”KÔªjÂ-©%$¡…QûýèÚò:E•–vÇ3ãÙÝEÔãUd0V°Ü K²%¬mÂñÊ*xŠ-@»B¼ ÝŠƒ2µ¸"^vØ•Iu(›"Ù×Ù—’H¢±ÈxN´Fñ7™zy“¤YSÔë™'f>”Ň{è<¤H©ò^Òõ!-á–í=JTº#¼áqjƒ±±Ñ„Îc ™ÁHC "§NÜ› ‡ðø> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 18 0 obj <> /Contents 19 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R 18 0 R ] /Count 3 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 21 0 obj <> endobj 22 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 23 0 obj <> endobj 8 0 obj <> endobj 24 0 obj <> endobj 25 0 obj <>stream 2014-01-29T08:09:49+01:00 2014-01-29T08:09:49+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 26 0000000000 65535 f 0000006700 00000 n 0000008811 00000 n 0000006627 00000 n 0000006143 00000 n 0000000015 00000 n 0000002986 00000 n 0000006765 00000 n 0000007240 00000 n 0000007103 00000 n 0000007035 00000 n 0000006806 00000 n 0000006836 00000 n 0000006303 00000 n 0000003006 00000 n 0000005642 00000 n 0000006886 00000 n 0000006916 00000 n 0000006465 00000 n 0000005663 00000 n 0000006123 00000 n 0000006966 00000 n 0000006996 00000 n 0000007184 00000 n 0000007322 00000 n 0000007388 00000 n trailer << /Size 26 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 8965 %%EOF curl-7.35.0/docs/libcurl/curl_formget.30000644000175000017500000000526412213173003014633 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_formget 3 "20 June 2006" "libcurl 7.15.5" "libcurl Manual" .SH NAME curl_formget - serialize a previously built multipart/formdata HTTP POST chain .SH SYNOPSIS .nf .B #include void curl_formget(struct curl_httppost * form, void *userp, curl_formget_callback append ); .SH DESCRIPTION curl_formget() is used to serialize data previously built/appended with \fIcurl_formadd(3)\fP. Accepts a void pointer as second argument named \fIuserp\fP which will be passed as the first argument to the curl_formget_callback function. .BI "typedef size_t (*curl_formget_callback)(void *" userp, " const char *" buf, .BI " size_t " len ");" The curl_formget_callback will be executed for each part of the HTTP POST chain. The character buffer passed to the callback must not be freed. The callback should return the buffer length passed to it on success. If the \fBCURLFORM_STREAM\fP option is used in the formpost, it will prevent \fIcurl_formget(3)\fP from working until you've performed the actual HTTP request as only then will libcurl get the actual read callback to use! .SH RETURN VALUE 0 means everything was ok, non-zero means an error occurred .SH EXAMPLE .nf size_t print_httppost_callback(void *arg, const char *buf, size_t len) { fwrite(buf, len, 1, stdout); (*(size_t *) arg) += len; return len; } size_t print_httppost(struct curl_httppost *post) { size_t total_size = 0; if(curl_formget(post, &total_size, print_httppost_callback)) { return (size_t) -1; } return total_size; } .SH AVAILABILITY This function was added in libcurl 7.15.5 .SH "SEE ALSO" .BR curl_formadd "(3) " curl-7.35.0/docs/libcurl/libcurl.html0000644000175000017500000003331512272124467014416 00000000000000 libcurl man page

NAME

libcurl - client-side URL transfers

DESCRIPTION

This is a short overview on how to use libcurl in your C programs. There are specific man pages for each function mentioned in here. There are also the libcurl-easy(3) man page, the libcurl-multi(3) man page, the libcurl-share(3) man page and the libcurl-tutorial(3) man page for in-depth understanding on how to program with libcurl.

There are more than thirty custom bindings available that bring libcurl access to your favourite language. Look elsewhere for documentation on those.

libcurl has a global constant environment that you must set up and maintain while using libcurl. This essentially means you call curl_global_init(3) at the start of your program and curl_global_cleanup(3) at the end. See GLOBAL CONSTANTS below for details.

To transfer files, you always set up an "easy handle" using curl_easy_init(3) for a single specific transfer (in either direction). You then set your desired set of options in that handle with curk_easy_setopt(3). Options you set with curl_easy_setopt(3) will be used on every repeated use of this handle until you either call the function again and change the option, or you reset them all with curl_easy_reset(3).

To actually transfer data you have the option of using the "easy" interface, or the "multi" interface.

The easy interface is a synchronous interface with which you call curl_easy_perform(3) and let it perform the transfer. When it is completed, the function returns and you can continue. More details are found in the libcurl-easy(3) man page.

The multi interface on the other hand is an asynchronous interface, that you call and that performs only a little piece of the transfer on each invoke. It is perfect if you want to do things while the transfer is in progress, or similar. The multi interface allows you to select() on libcurl action, and even to easily download multiple files simultaneously using a single thread. See further details in the libcurl-multi(3) man page.

You can have multiple easy handles share certain data, even if they are used in different threads. This magic is setup using the share interface, as described in the libcurl-share(3) man page.

There is also a series of other helpful functions to use, including these:

curl_version_info()

gets detailed libcurl (and other used libraries) version info

curl_getdate()

converts a date string to time_t

curl_easy_getinfo()

get information about a performed transfer

curl_formadd()

helps building an HTTP form POST

curl_formfree()

free a list built with curl_formadd(3)

curl_slist_append()

builds a linked list

curl_slist_free_all()

frees a whole curl_slist

LINKING WITH LIBCURL

On unix-like machines, there's a tool named curl-config that gets installed with the rest of the curl stuff when 'make install' is performed.

curl-config is added to make it easier for applications to link with libcurl and developers to learn about libcurl and how to use it.

Run 'curl-config --libs' to get the (additional) linker options you need to link with the particular version of libcurl you've installed. See the curl-config(1) man page for further details.

Unix-like operating system that ship libcurl as part of their distributions often don't provide the curl-config tool, but simply install the library and headers in the common path for this purpose.

LIBCURL SYMBOL NAMES

All public functions in the libcurl interface are prefixed with 'curl_' (with a lowercase c). You can find other functions in the library source code, but other prefixes indicate that the functions are private and may change without further notice in the next release.

Only use documented functions and functionality!

PORTABILITY

libcurl works exactly the same, on any of the platforms it compiles and builds on.

THREADS

Never ever call curl-functions simultaneously using the same handle from several threads. libcurl is thread-safe and can be used in any number of threads, but you must use separate curl handles if you want to use libcurl in more than one thread simultaneously.

The global environment functions are not thread-safe. See GLOBAL CONSTANTS below for details.

PERSISTENT CONNECTIONS

Persistent connections means that libcurl can re-use the same connection for several transfers, if the conditions are right.

libcurl will always attempt to use persistent connections. Whenever you use curl_easy_perform(3) or curl_multi_perform(3) etc, libcurl will attempt to use an existing connection to do the transfer, and if none exists it'll open a new one that will be subject for re-use on a possible following call to curl_easy_perform(3) or curl_multi_perform(3).

To allow libcurl to take full advantage of persistent connections, you should do as many of your file transfers as possible using the same handle.

If you use the easy interface, and you call curl_easy_cleanup(3), all the possibly open connections held by libcurl will be closed and forgotten.

When you've created a multi handle and are using the multi interface, the connection pool is instead kept in the multi handle so closing and creating new easy handles to do transfers will not affect them. Instead all added easy handles can take advantage of the single shared pool.

GLOBAL CONSTANTS

There are a variety of constants that libcurl uses, mainly through its internal use of other libraries, which are too complicated for the library loader to set up. Therefore, a program must call a library function after the program is loaded and running to finish setting up the library code. For example, when libcurl is built for SSL capability via the GNU TLS library, there is an elaborate tree inside that library that describes the SSL protocol.

curl_global_init() is the function that you must call. This may allocate resources (e.g. the memory for the GNU TLS tree mentioned above), so the companion function curl_global_cleanup() releases them.

The basic rule for constructing a program that uses libcurl is this: Call curl_global_init(), with a CURL_GLOBAL_ALL argument, immediately after the program starts, while it is still only one thread and before it uses libcurl at all. Call curl_global_cleanup() immediately before the program exits, when the program is again only one thread and after its last use of libcurl.

You can call both of these multiple times, as long as all calls meet these requirements and the number of calls to each is the same.

It isn't actually required that the functions be called at the beginning and end of the program -- that's just usually the easiest way to do it. It is required that the functions be called when no other thread in the program is running.

These global constant functions are not thread safe, so you must not call them when any other thread in the program is running. It isn't good enough that no other thread is using libcurl at the time, because these functions internally call similar functions of other libraries, and those functions are similarly thread-unsafe. You can't generally know what these libraries are, or whether other threads are using them.

The global constant situation merits special consideration when the code you are writing to use libcurl is not the main program, but rather a modular piece of a program, e.g. another library. As a module, your code doesn't know about other parts of the program -- it doesn't know whether they use libcurl or not. And its code doesn't necessarily run at the start and end of the whole program.

A module like this must have global constant functions of its own, just like curl_global_init() and curl_global_cleanup(). The module thus has control at the beginning and end of the program and has a place to call the libcurl functions. Note that if multiple modules in the program use libcurl, they all will separately call the libcurl functions, and that's OK because only the first curl_global_init() and the last curl_global_cleanup() in a program change anything. (libcurl uses a reference count in static memory).

In a C++ module, it is common to deal with the global constant situation by defining a special class that represents the global constant environment of the module. A program always has exactly one object of the class, in static storage. That way, the program automatically calls the constructor of the object as the program starts up and the destructor as it terminates. As the author of this libcurl-using module, you can make the constructor call curl_global_init() and the destructor call curl_global_cleanup() and satisfy libcurl's requirements without your user having to think about it.

curl_global_init() has an argument that tells what particular parts of the global constant environment to set up. In order to successfully use any value except CURL_GLOBAL_ALL (which says to set up the whole thing), you must have specific knowledge of internal workings of libcurl and all other parts of the program of which it is part.

A special part of the global constant environment is the identity of the memory allocator. curl_global_init() selects the system default memory allocator, but you can use curl_global_init_mem() to supply one of your own. However, there is no way to use curl_global_init_mem() in a modular program -- all modules in the program that might use libcurl would have to agree on one allocator.

There is a failsafe in libcurl that makes it usable in simple situations without you having to worry about the global constant environment at all: curl_easy_init() sets up the environment itself if it hasn't been done yet. The resources it acquires to do so get released by the operating system automatically when the program exits.

This failsafe feature exists mainly for backward compatibility because there was a time when the global functions didn't exist. Because it is sufficient only in the simplest of programs, it is not recommended for any program to rely on it.

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_escape.30000644000175000017500000000406712213173003014430 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_escape 3 "6 March 2002" "libcurl 7.9" "libcurl Manual" .SH NAME curl_escape - URL encodes the given string .SH SYNOPSIS .B #include .sp .BI "char *curl_escape( char *" url ", int "length " );" .ad .SH DESCRIPTION Obsolete function. Use \fIcurl_easy_escape(3)\fP instead! This function will convert the given input string to an URL encoded string and return that as a new allocated string. All input characters that are not a-z, A-Z or 0-9 will be converted to their "URL escaped" version (%NN where NN is a two-digit hexadecimal number). If the 'length' argument is set to 0, curl_escape() will use strlen() on the input 'url' string to find out the size. You must curl_free() the returned string when you're done with it. .SH AVAILABILITY Since 7.15.4, \fIcurl_easy_escape(3)\fP should be used. This function will be removed in a future release. .SH RETURN VALUE A pointer to a zero terminated string or NULL if it failed. .SH "SEE ALSO" .BR curl_unescape "(3), " curl_free "(3), " RFC 2396 curl-7.35.0/docs/libcurl/curl_multi_remove_handle.html0000644000175000017500000000407112272124467020026 00000000000000 curl_multi_remove_handle man page

NAME

curl_multi_remove_handle - remove an easy handle from a multi session

SYNOPSIS

#include <curl/curl.h>

CURLMcode curl_multi_remove_handle(CURLM *multi_handle, CURL *easy_handle);

DESCRIPTION

Removes a given easy_handle from the multi_handle. This will make the specified easy handle be removed from this multi handle's control.

When the easy handle has been removed from a multi stack, it is again perfectly legal to invoke curl_easy_perform() on this easy handle.

Removing an easy handle while being used, will effectively halt the transfer in progress involving that easy handle. All other easy handles and transfers will remain unaffected.

RETURN VALUE

CURLMcode type, general libcurl multi interface error code.

SEE ALSO

curl_multi_cleanup (3) curl_multi_init (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_multi_socket_action.30000644000175000017500000001604512262102134017227 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2012, 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. .\" * .\" ************************************************************************** .TH curl_multi_socket_action 3 "9 Jul 2006" "libcurl 7.16.0" "libcurl Manual" .SH NAME curl_multi_socket_action \- reads/writes available data given an action .SH SYNOPSIS .nf #include CURLMcode curl_multi_socket_action(CURLM * multi_handle, curl_socket_t sockfd, int ev_bitmask, int *running_handles); .fi .SH DESCRIPTION When the application has detected action on a socket handled by libcurl, it should call \fIcurl_multi_socket_action(3)\fP with the \fBsockfd\fP argument set to the socket with the action. When the events on a socket are known, they can be passed as an events bitmask \fBev_bitmask\fP by first setting \fBev_bitmask\fP to 0, and then adding using bitwise OR (|) any combination of events to be chosen from CURL_CSELECT_IN, CURL_CSELECT_OUT or CURL_CSELECT_ERR. When the events on a socket are unknown, pass 0 instead, and libcurl will test the descriptor internally. It is also permissible to pass CURL_SOCKET_TIMEOUT to the \fBsockfd\fP parameter in order to initiate the whole process or when a timeout occurs. At return, the integer \fBrunning_handles\fP points to will contain the number of running easy handles within the multi handle. When this number reaches zero, all transfers are complete/done. When you call \fIcurl_multi_socket_action(3)\fP on a specific socket and the counter decreases by one, it DOES NOT necessarily mean that this exact socket/transfer is the one that completed. Use \fIcurl_multi_info_read(3)\fP to figure out which easy handle that completed. The \fBcurl_multi_socket_action(3)\fP functions inform the application about updates in the socket (file descriptor) status by doing none, one, or multiple calls to the socket callback function set with the CURLMOPT_SOCKETFUNCTION option to \fIcurl_multi_setopt(3)\fP. They update the status with changes since the previous time the callback was called. Get the timeout time by setting the \fICURLMOPT_TIMERFUNCTION\fP option with \fIcurl_multi_setopt(3)\fP. Your application will then get called with information on how long to wait for socket actions at most before doing the timeout action: call the \fBcurl_multi_socket_action(3)\fP function with the \fBsockfd\fP argument set to CURL_SOCKET_TIMEOUT. You can also use the \fIcurl_multi_timeout(3)\fP function to poll the value at any given time, but for an event-based system using the callback is far better than relying on polling the timeout value. .SH "CALLBACK DETAILS" The socket \fBcallback\fP function uses a prototype like this .nf int curl_socket_callback(CURL *easy, /* easy handle */ curl_socket_t s, /* socket */ int action, /* see values below */ void *userp, /* private callback pointer */ void *socketp); /* private socket pointer, \fBNULL\fP if not previously assigned with \fBcurl_multi_assign(3)\fP */ .fi The callback MUST return 0. The \fIeasy\fP argument is a pointer to the easy handle that deals with this particular socket. Note that a single handle may work with several sockets simultaneously. The \fIs\fP argument is the actual socket value as you use it within your system. The \fIaction\fP argument to the callback has one of five values: .RS .IP "CURL_POLL_NONE (0)" register, not interested in readiness (yet) .IP "CURL_POLL_IN (1)" register, interested in read readiness .IP "CURL_POLL_OUT (2)" register, interested in write readiness .IP "CURL_POLL_INOUT (3)" register, interested in both read and write readiness .IP "CURL_POLL_REMOVE (4)" unregister .RE The \fIsocketp\fP argument is a private pointer you have previously set with \fIcurl_multi_assign(3)\fP to be associated with the \fIs\fP socket. If no pointer has been set, socketp will be NULL. This argument is of course a service to applications that want to keep certain data or structs that are strictly associated to the given socket. The \fIuserp\fP argument is a private pointer you have previously set with \fIcurl_multi_setopt(3)\fP and the CURLMOPT_SOCKETDATA option. .SH "RETURN VALUE" CURLMcode type, general libcurl multi interface error code. Before version 7.20.0: If you receive \fICURLM_CALL_MULTI_PERFORM\fP, this basically means that you should call \fIcurl_multi_socket_action(3)\fP again before you wait for more actions on libcurl's sockets. You don't have to do it immediately, but the return code means that libcurl may have more data available to return or that there may be more data to send off before it is "satisfied". The return code from this function is for the whole multi stack. Problems still might have occurred on individual transfers even when one of these functions return OK. .SH "TYPICAL USAGE" 1. Create a multi handle 2. Set the socket callback with CURLMOPT_SOCKETFUNCTION 3. Set the timeout callback with CURLMOPT_TIMERFUNCTION, to get to know what timeout value to use when waiting for socket activities. 4. Add easy handles with curl_multi_add_handle() 5. Provide some means to manage the sockets libcurl is using, so you can check them for activity. This can be done through your application code, or by way of an external library such as libevent or glib. 6. Call curl_multi_socket_action(..., CURL_SOCKET_TIMEOUT, 0, ...) to kickstart everything. To get one or more callbacks called. 7. Wait for activity on any of libcurl's sockets, use the timeout value your callback has been told. 8, When activity is detected, call curl_multi_socket_action() for the socket(s) that got action. If no activity is detected and the timeout expires, call \fIcurl_multi_socket_action(3)\fP with \fICURL_SOCKET_TIMEOUT\fP. .SH AVAILABILITY This function was added in libcurl 7.15.4, and is deemed stable since 7.16.0. .SH "SEE ALSO" .BR curl_multi_cleanup "(3), " curl_multi_init "(3), " .BR curl_multi_fdset "(3), " curl_multi_info_read "(3), " .BR "the hiperfifo.c example" curl-7.35.0/docs/libcurl/curl_version.html0000644000175000017500000000321012272124467015463 00000000000000 curl_version man page

NAME

curl_version - returns the libcurl version string

SYNOPSIS

#include <curl/curl.h>

char *curl_version( );

DESCRIPTION

Returns a human readable string with the version number of libcurl and some of its important components (like OpenSSL version).

RETURN VALUE

A pointer to a zero terminated string. The string resides in a statically allocated buffer and must not be freed by the caller.

SEE ALSO

curl_version_info (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_multi_assign.30000644000175000017500000000564012213173003015664 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_multi_assign 3 "9 Jul 2006" "libcurl 7.16.0" "libcurl Manual" .SH NAME curl_multi_assign \- set data to association with an internal socket .SH SYNOPSIS #include CURLMcode curl_multi_assign(CURLM *multi_handle, curl_socket_t sockfd, void *sockptr); .SH DESCRIPTION This function assigns an association in the multi handle between the given socket and a private pointer of the application. This is (only) useful for \fIcurl_multi_socket(3)\fP uses. When set, the \fIsockptr\fP pointer will be passed to all future socket callbacks for the specific \fIsockfd\fP socket. If the given \fIsockfd\fP isn't already in use by libcurl, this function will return an error. libcurl only keeps one single pointer associated with a socket, so calling this function several times for the same socket will make the last set pointer get used. The idea here being that this association (socket to private pointer) is something that just about every application that uses this API will need and then libcurl can just as well do it since it already has an internal hash table lookup for this. .SH "RETURN VALUE" The standard CURLMcode for multi interface error codes. .SH "TYPICAL USAGE" In a typical application you allocate a struct or at least use some kind of semi-dynamic data for each socket that we must wait for action on when using the \fIcurl_multi_socket(3)\fP approach. When our socket-callback gets called by libcurl and we get to know about yet another socket to wait for, we can use \fIcurl_multi_assign(3)\fP to point out the particular data so that when we get updates about this same socket again, we don't have to find the struct associated with this socket by ourselves. .SH AVAILABILITY This function was added in libcurl 7.15.5, although not deemed stable yet. .SH "SEE ALSO" .BR curl_multi_setopt "(3), " curl_multi_socket "(3) " curl-7.35.0/docs/libcurl/curl_multi_info_read.html0000644000175000017500000000775112272124467017154 00000000000000 curl_multi_info_read man page

NAME

curl_multi_info_read - read multi stack informationals

SYNOPSIS

#include <curl/curl.h>

CURLMsg *curl_multi_info_read( CURLM *multi_handle,   int *msgs_in_queue);

DESCRIPTION

Ask the multi handle if there are any messages/informationals from the individual transfers. Messages may include informationals such as an 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 NULL is returned as a signal that there is no more to get at this point. The integer pointed to with msgs_in_queue will contain the number of remaining messages after this function was called.

When you fetch a message using this function, it is removed from the internal queue so calling this function again will not return the same message again. It will instead return new messages at each new invoke until the queue is emptied.

WARNING: The data the returned pointer points to will not survive calling curl_multi_cleanup(3), curl_multi_remove_handle(3) or curl_easy_cleanup(3).

The 'CURLMsg' struct is very simple and only contains very basic information. If more involved information is wanted, the particular "easy handle" in present in that struct and can thus be used in subsequent regular curl_easy_getinfo(3) calls (or similar):

 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;  };

When msg is CURLMSG_DONE, the message identifies a transfer that is done, and then result contains the return code for the easy handle that just completed.

At this point, there are no other msg types defined.

RETURN VALUE

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.

SEE ALSO

curl_multi_cleanup (3) curl_multi_init (3) curl_multi_perform (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_multi_init.30000644000175000017500000000336612213173003015346 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_multi_init 3 "1 March 2002" "libcurl 7.9.5" "libcurl Manual" .SH NAME curl_multi_init - create a multi handle .SH SYNOPSIS .B #include .sp .BI "CURLM *curl_multi_init( );" .ad .SH DESCRIPTION This function returns a CURLM handle to be used as input to all the other multi-functions, sometimes referred to as a multi handle in some places in the documentation. This init call MUST have a corresponding call to \fIcurl_multi_cleanup(3)\fP when the operation is complete. .SH RETURN VALUE If this function returns NULL, something went wrong and you cannot use the other curl functions. .SH "SEE ALSO" .BR curl_multi_cleanup "(3)," curl_global_init "(3)," curl_easy_init "(3)" curl-7.35.0/docs/libcurl/curl_easy_pause.pdf0000644000175000017500000001644112272124475015752 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœµXÛnãÈ}×W4‡¡«‡Í[77AG»p¢±KžÅb4Õ’S¤–¤FQ¾a?z«úFJv²`ƒÆ6Éî®Ë©S§úgâSF|üg~æÛÑû;N6íÈ'›ÑÏ#¦^ó#ß’Kø@àƒåz¤×0ÂÂÓŠ”,·#D”q²<Œ¾xù¾)eÖwÙ¾•^ø0&eñ„ÏÇ“ ö©ïsïSVí³’¼õñøË¿Ž&> ìÃÑ)MÓO²œ¼ëéøX oYLã4‹–«‘÷i6^þs`kàÓÈçdÂ|í£}çæ‘ Ñ?³jEö•ùäuUɼ+êJï80a6LXB…:rñÓõÍíâjÑfÌ4‡z(ª¼Ü¯$ù3žüÿ£ÏÁσHùry7ÏkøàU,ð ù#xúþŽù6üqJydü}£K©ö¢q+å:§ö«‹¿PÑâ” ßæEÕi«ûÍM?0¯ŸŠn›µ/gžE4>3Ÿ<Œÿô:>‡à@abôq¶¸¼»º]^Ý\Ÿæ§£~¨üÜ·Eµ!ÝsÑ’õ¾R)¸ ÇzOò¬"ÊWÄ”ÅÚ\ÇÔºíÊ"/ºòH¶Yó)löU…[õ©$]M6²Ó _]¨”Û]êñ„‰9bö`£ç¬#‡1ó½¬%»FŽƒØûZÔûŽ×»S…âi‚÷¦¹ClŠSm¿O9~ö÷›£9OÒìCžŽdÿ:$¤nðM)»N¿“¤‘Ù ãèPYY>eùK ïº}ƒfKíž1¡~+#vM½“ DpSäv‘Âæƒ÷ *`:70@ >Þͦ¿¿¿¾|¼Ugø‘i@S‘ZÄMïY@E耴8«\°0‰"ûu~<§)Åðüï®–³7 0ö€ýv‡²0RzS2„w¢Ž 9Z ^hh0cô5Xt0[C6m±©²²E@bº€›¬9ê/‹B¾/WÕ;Ü;¤ ÷Ê-À km×97MDà[Ì^N¥4 Sa‰@æCç}WèY#I½†r8Y&ÔïC|\õkñ–ÚÅ]FÀjˆ….(åà ŸвÔáÂS·ÊW²,Lº˜ÊW”ÐÈÞû*ݱ)óå‹×@md›1 YD,ô²¢²Ñ´°'<Ö– P™upSí¦J'qL¡K cò"®sýãsQJLÇ6;’µ”%éäv‡]NÀc<9 ’7ą̂ˆÃthŒQUwE.u¨ Á#eøY™¯›z Kjð+kœ’¥:Zp¶MO­b˜Vi`ŸH(WŒ¿šH•;@šL}ˆwh RͦÙvWêPb”I ˆM#Û¶òƒ×JyVC˜Úö}­•]½ët“7%jÚ–-;ž‚5æïZÈa퀔õµ¯‹0ò¡¸ƒÙo~s»|¼½GJq„ÞÍw³ÅBu"Ìü Þ!tìP<5å~(*ògìÚi„]Ä›µ©+È"f+¡9@G‘'P†²¤,d'PŽhÌÓ7à\ã(RóÖ²L9„ÔlŠÙ}“(Z]Z °Xä˜Ü³°Æ°Ñ4 U qU8g hlïCtitãY .À;øð¹Ø<÷XŪV]þhÎ ´8´cn¥–>áIÚ䙆),1:h ÍéÝ@i0ACǽҨP+qÏaø’Ó¸*N¬ix³ßʪC_€æ€\p¶XÁ£b}´íSŸ ýÄ&<ŸkþÄ]…@ñdP&’þ(-C28Bªª3$BÊÏȯv ¤2õ–ë<8':Ì9ϡɸOÞô>áâÌû €Úa `ËV»ÚJõ›$•4ì«PWÇÐnlt}!2€<µ¸í N¸ãi˜€£àïu]–5J£Y©µfÝ D¾é•2"÷;ÅIJ\i| ‘qD)ûæ0læ0‰ô2c15rùù¤'Ppî¨ÛlÐVDì’èkæ×ÅKÕ™Â&+Eð]T_Ñ'ìsÊWÀ·* èhU­ÛŸÛÀ™Àpö Nù  7|Å+¨Š@”éCF`ŠG+j€Í=ú¼¸BW–Àr1fh ðTB4ÚЊ[ê¡èžë}§7… "^Ðá}{ñ†Ð|-HLÌ¢ž«);©fG‚ˆF ?í ƇÐ.|†L·¨µLr 8‰­Jzꀚ›©Ì”¬œj3tE ¯f< ÃaÃúv.f×ÿg²P8¶²ZýÔZ¬ïÚpü·‚èä‡<¤©“.óžµxrJ[¿5üg,0ãgr;5X$¸A¶Çä6~ œ'(0‹ø‚ QCÓeY_G'“î0ñ"M÷;%:Ÿ«•Ô_ê+…žŽizB ¯õ.è‰íx%©L“RýòÚ¬ŠF§¼Õ^$ˆìTüNn\Þ\/ÿ~˜NøÊ“× )?óê‹w7[Þß]“Ïc-$Ì›ÎïggÒ®¿eð©Hµ"ÀpÌoþ(ý·lê‡1Ùʬ2=± :«EÁ ¦úvÝ`ôÇvªgæò¨Ûg˜*6AǺ!ß»èË•q¸¨B¨âj‚Fœ ÜÚœ¶ÞJ¨¶j£Ù;Ô Ö{ãGÚ’CSCÔ9(m5­;Ù š:”EêiÄïÅþISAJY¥jšúa U#8O£t<‰ý0“x )Õ]‚޳+p(Ç®…™;¿‰lжZƒ×ÍlðY”xmÙ×ç*¨é¸ µétmA6ì²Ts :¶Þ–hp$%€S›7ÅN0»;Éåõuñ_îñæWŸ®4ÈaÌV#]cçv°ž.‡ ˆ%Žz€·§ÒlG$Øl\žX¨oP!Ø‘ÏQ35ãµlZ²ªÿ8ª  ˆÔ‹ö ðÕÕy]¶ý­“å‹ëÏ•ì.²øÂv} S‚›#¾ÝQ£" ]?uI³Œ@ÆB¼º ?¯-¬~&Sç@@Œˆ¿šO?\ͯ–?ÝtAÕFBô—,I,\‡ÂAóAê3äƒlµ¢OL‘º”ú”| {_ÇL Wë´|Q çq‚;†Ñ±€N"\F>¼×…´ïvuÓ)05d.—ô2Wí¶¨z!ù:J¾vëÔäñ„Å‘ˆ<ÆÉG™“JK™%¶ôn4[Žþÿ~e$·bendstream endobj 6 0 obj 2582 endobj 14 0 obj <> stream xœuWÛrÛ6}×Wì[¨Ž…àýÑIÕÆ­Omz2§ãIHb͋‹ýC?º»H‰q:~…Ë^Ξ= }—qpéÏ~fÕâç»¶ÝÂ…íâë‚ëM°YïS<ÓBºY˜;"Qâ±8´Zpá3AzX<:ÙЖOJvǧ½:õÅñ¾,¡,ži}¹Ë\7rnd=È~txùwú;:LÐ!Kòé…^cth?ýéÑy¸¿\>K"‘8¿­áóUúÒk¸y¸^&×yâ¤W«ûÛ¬S¸ú”®ï~ÕFW. ]i¶"Æ0(—4_8—–é?d?[ð€ 7‰íÆšÖO¹¯„1Á9¬¸ }ÎBÊŸ²~¯6M«ÆžHo"rßFSg#Æ=×;⢟nÅTíÑ#ÕDƒ„uD6·Xà¡ÌøV<—G?~í•{”†5ùMVûÒ`绂A2ÑöLQtUŸtU¹‹}BƒF[V¦s$´’ÚvjÓa¯ZtWÉ:Sø-Ëþ¸ ÒÏašÂת¼ÀÓ‘ß÷ÔCØEý¦M“Ò¦<ÑôP`NvR>`SãFQ©fèñ@±ÅºétûìǶç€}VBòçËw JòZ7ŠÐußèFØ ýÐbÏt¹/á{ð2v¸À‹ß5£µã‹Œ1øðpwýd”ð)½ºYß>¤Y&kxÖ…Ê¡¨*•+ÓhÖèì_¬ Ü §Œr‰0vd›w€ñR¯Î›·Ñ0m—6÷ÃÀ‘ˆ'ŠT®º¢U9{+ï¨Vè1Ć#:ܬonï(Á"/&¢ùØý<éò×Éó1 ü$´÷oÔ:d©äI]#™ŸI•Om•ÌáùˆŸ{Mk”P%·Ef×ͨ[›¶©ðø¡-z¥ ý,³­ÑÆD.{ (ß²¤¯GR ȱ\z‡EóXàrÛŠq<™®8×PýÏõŒ¢ˆkÝÏ%<ëÖ ™;q† ­éÖ»ôÑÁBtDŸeMº\ɺ“£þEPÀ"oÒ9ëì«i$ÀF‹C189l^ÎEÇGÛßG«Ô=S!ϧ&C å&øiúñÿo•¨dÔ}ÄW·fGÌB­Ï0kŸ&1¡ ºs;¦Î³ÉÊ4Á¬#]ô´¸2“(o–‚è{Ρ.Z§êfMµoUG­ƒm­#ê^´wžà+ÈZRÆ” ž´‚ÞÏn}S¡F“Ž€c¼Ú1f¼^Lï&Ühâ³+<ãA+‘©Šœé|î´jtGñ)­l7Ô/&“Þ(Z&³Ò:å󘤄âNv&a+`±Fõ¢ÈÕ ÔÆd#"¬eÖ%+6pl Dßç4 G¼bÚltlHßJaÑtéèêz(›þ‚b&-ÃEÔFM8x5o§~{zјNbgk²X×”A`SUƒ¤Ã…ÒtC$Q&O ÆïœOy?a<™Rf 4¾(ù4±'G#ºùÐŽ‚£ylîdÕ'¨º¤û¶y–z65áÛZ½ö™Ççl¯ä™f¼}WN½c°§lŒ¼Ú> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R ] /Count 2 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 18 0 obj <> endobj 19 0 obj <>stream 2014-01-29T08:09:49+01:00 2014-01-29T08:09:49+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 20 0000000000 65535 f 0000004801 00000 n 0000006750 00000 n 0000004735 00000 n 0000004413 00000 n 0000000015 00000 n 0000002667 00000 n 0000004866 00000 n 0000005189 00000 n 0000005124 00000 n 0000005056 00000 n 0000004907 00000 n 0000004937 00000 n 0000004573 00000 n 0000002687 00000 n 0000004392 00000 n 0000004987 00000 n 0000005017 00000 n 0000005271 00000 n 0000005327 00000 n trailer << /Size 20 /Root 1 0 R /Info 2 0 R /ID [<25CDBA812B9C929B5F6896DF84B957E2><25CDBA812B9C929B5F6896DF84B957E2>] >> startxref 6904 %%EOF curl-7.35.0/docs/libcurl/curl_multi_cleanup.html0000644000175000017500000000466012272124467016651 00000000000000 curl_multi_cleanup man page

NAME

curl_multi_cleanup - close down a multi session

SYNOPSIS

#include <curl/curl.h>

CURLMcode curl_multi_cleanup( CURLM *multi_handle );

DESCRIPTION

Cleans up and removes a whole multi stack. It does not free or touch any individual easy handles in any way - they still need to be closed individually, using the usual curl_easy_cleanup(3) way. The order of cleaning up should be:

1 - curl_multi_remove_handle(3) before any easy handles are cleaned up

2 - curl_easy_cleanup(3) can now be called independently since the easy handle is no longer connected to the multi handle

3 - curl_multi_cleanup(3) should be called when all easy handles are removed

RETURN VALUE

CURLMcode type, general libcurl multi interface error code. On success, CURLM_OK is returned.

SEE ALSO

curl_multi_init (3) curl_easy_cleanup (3) curl_easy_init (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_formfree.30000644000175000017500000000355712213173003015000 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_formfree 3 "6 April 2001" "libcurl 7.7.1" "libcurl Manual" .SH NAME curl_formfree - free a previously build multipart/formdata HTTP POST chain .SH SYNOPSIS .B #include .sp .BI "void curl_formfree(struct curl_httppost *" form); .ad .SH DESCRIPTION curl_formfree() is used to clean up data previously built/appended with \fIcurl_formadd(3)\fP. This must be called when the data has been used, which typically means after \fIcurl_easy_perform(3)\fP has been called. The pointer to free is the same pointer you passed to the \fBCURLOPT_HTTPPOST\fP option, which is the \fIfirstitem\fP pointer from the \fIcurl_formadd(3)\fP invoke(s). \fBform\fP is the pointer as returned from a previous call to \fIcurl_formadd(3)\fP and may be NULL. .SH RETURN VALUE None .SH "SEE ALSO" .BR curl_formadd "(3) " curl-7.35.0/docs/libcurl/curl_multi_perform.pdf0000644000175000017500000001302712272124473016473 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœYkoÛÈý®_1H?„ ¬ gøn‹Ù]·pk'©£t$E@S#‰‰tHÊ‚ûò£{î<øíMZ°r8sçž{îø+ó¹`>ý³¿‹ýìåuÂ6íÌg›Ù×™Ð/™ýUìÙOK,HéÁr=3ß–H–dO3¶ÜÏ„ÍÙ®¼¡Wó…Œ|îû‰w•W‡|ÇžX?ÿ÷òï³…Ï¥À  È`Ï"²!ˆÙòræ½~5›ñVD<Êص\ͼ«óùò·‘ÅÒ硟°…ôÚ'+1’-X£òUûòØ”jYN›Ðù‘> ”\&ö€;ýNœq‘fih_”»üf§Ø*ïr¶nê=Sy±ÅöžmójµSư‘' ‘&<Œa\ÌS½Ç»¯ß¼}wñnêC;û½?”U±;¬û39ñ’~ðí_h¹ uX~~}yUÔXñXhõ[öÂ<5V±²êØ‹æPUeµ±ÛOó?!¼Skƒ±¥¿œ¿ûùúâíòâÍë§Œýè-·eËÖ‡ªèʺ²QhY×äU»VMËð0ßíX·U,_­ÔjX²Í;V)<É»NUúó‹+VÕÕâfW_`,[Ï…ïåí¯¹†ŒÏ:9þu«ôúüövW¹5ÖÔ‡jÅêCG§6ê9¼”<¥çÞ…Òæ³]õ‰Àß=§üžà#å‰â‚LhÇI`x–³®Ü+²ŒìT»ü¶U«3Zª“~Ìð®ä‰4žŽ=l·õa·b…‰ê8ø]­nÎŽˆ¯²>íƒ Ogê~q)¥ñCŽühºq`‚À†âÉp¦=Š|2§5åf‹tÖ“=©¨²ÐíyTÞHBêöì ®Í %JO]ó OÔò'|Ó¨îÐT(ä–µ5Á¬Õ1Ÿ9Ì]Õ•âlŠÓU—UÝaõ×C‰E.d Yp9Üÿ¢“íîÉõ¼žÑ«b…<‰‚̺r?“^ò;€Ê@ ýû9F¡±k5 ÀÿÒI@¡Ð;÷ˆ‚âúíÐvTWEÞ" ;–»¶$‹y–¤b›=“N duØß¨†Õëiɶ]Iȳn¬ÀþôE«Š•—7s” :@êm{”ös]¸’f "W€åØï8Ël@>zÀ Ö÷ý »¨f.}óÿÅm 2ÃD>K£Ð3¬°P;ç‚8’À#“º‹µáž=H¡ƒ3†É„o©,N¿$u°Ÿ2ä”õ´á2FÄ&bÀD6¶î tÜ-p$a`&ﮬ­©×O’‡õØ[G³šÚÖw’…ñI)I4T„Ú)ûúð|Rߨ# œ}]{§X>.<ËÌ­é÷#bFM÷œeSþi~Fǰ/¦°‘Aú€ÀÀ7µãˆ,h‰t/úš"ŸQ…Ý}MÕÖ·‰g6îÏ8û Ïñ%H>¬ µ•0Ø6\áC HldÀk¾IwG=b}’çu—©C׈RÊj]næA⡾e2D¾@€6@”6Š*ŠxÈ0r~CŒ®¥@Y­4¢EòØ·('ëb“‹r¥Q½¿Ý©ŽbnAß„< e"œ …£†³|LÅ2Œ]B¥QAÚxHgမ ƒNÃ’8Š,fVZ´ŒT‚–ȳΠ¸a­›é¨I£ùf„á8õòrײ»¹ LûÒSÍ=q_v÷¶¶‰Iƒ_ø}Ÿ•s™Ä~äu{Ó¾5(¶¾’ˆô5ËÞCL;– @ˆIÇ¢£v,8zcŽJSO££°>é>šZÙºÓ©jD ÉÙ”øHx‘àÐ’©‡•LˆµÄѵ·ÔÇÑ™>•ÑO€ÕTSƒ!|´¶º²­ŒrGÄ0iôgCQU5ÛÕ ž†™Â(&ÚíyHÍÞOÚùÔ ­ê½¾ KS`Aš›±wÛÔ›µÊ*ܱf´Mäú|ùþú5û×\L,¼W—ïÏOÊj,"EÛÝßB®nT¥Š),'iÞA²PL5 8…¾4m"4¥-_|ô~Rk"‹ÚHµ-Õk©™ü‘OäÖ¨B•nvxœFÜùfJéSïû®ó[>ÿüêòòóÕûK´+oyñùíùõ_ß\_éÍÈÐìÑ3K˜¢j]9Jan(BÇRþ# ÜämYh)²WH™iÉðÂ$ Žè XæiÆS^ŒyD¥klx¨´¦N¥Ãò ½Ì0öUH'y œÞ˜ P”[µSE§…R »@®ÑÜé Ÿ²J µæäBbš ué;AÔmŒ2TÉ#áúÙBjmEu|ÇÔS=ÏZHD¾ªI/•û½Z• Á˜âÑk"è6†Ó…¦±Ò¾õÝ ÇP1Eý1Yj(ßL!®”5ÆG™ëžSߟpŸH˜8íA`÷C;ß÷gÇQôðL îê¡äDŒ!²¿#9iÓK­öÔZßQ3ÒÉÚæ;¸­AÏ VcȾ·›´Š¦2-ÀPQf‚QåR»“Ú»c)’؆, œ(g -ºoûM­ ~©IÌ«¾ŽË¼ÆÁ“7‚rÔÔweIrÙú²382BË'4ö{0*ýó&(І< mæ*Tö‘4 œ<Ò1Rß TZh'’ªÓSØ ôM9&ÏÄŸ—ÕÀ׿XÔB?uä0î‡É”¡"T!T¹]ÏDê;q¼A£EU=q™JJB-{Ü,kXá[eǨéïXoŠq<#mDÆMàh²yšà¾coH‰‰êСçû פãÍ?¦Ù¾ÔŽ·Éâ'}€õ!4iä°±ãÔ|,Of¥g†Áž9—ªÇ¦rä…Æ”¥ÃÝa$©aæéXªÓïæZÝÛð«+ð²uìfˆÐ bçåf\Ç.Y ¨çF¢¡ã¶Þ9‰ßvyñ…Ï@È-ôÞ65Ê}ßÚ o¯'zÒ¤3J°©« ( s‘R=@ó]¯< T\Ó+.‰ôeãöda¡¯~ œidJEâtò0&¨©¨PN?Õ…Á#7Õq‚ÙHN!; ¾û)€¡2‘>):P<,—[?ž‹Â¨—ô­:=„D™ßk‰Ç¦@H>5¡dØÒu8á:Ü·ÍÁÕcmeS½«o¢Üh§Ó ¨½Çrì@Ôæ6Sf¸=ÉÔª\qkÞX$&CÍ•V)~ô–Þ^€+Ùûw¯ô0ŸÈÌûÛÓ*1âi`ºÀUÝvãK¿Vßi°ÃðB鸽‚æ~„ùAè};u“Þé=žž¹SŒ×¦!0Iæ†ÃöÛ¸ ’¾ƒyti¬Ú¢)o;Ôôƃn&zjsÒcd®½4|¬U8ƒ˜—±ú¬é9kegš¸½wD×+ksåX ”*%QêÑHhw¤Ãž¦ß2´šÍ (ߦ~! šiÇYHH*_öÀ󜴾Xà2N0ð35wOhÛÉXgñh¹ØÞŽo¦ÖQ·¡+´ûyyg§C$ £ÿI%Ü ø‚ÝÚ>üØ€‘Àÿ àüœ½º|÷f©ÑŸF;¨ÅÃí NŸ#%mÜÙt3Ä'íÿž1ᓲ›î‡ ¦ÿc']CnÈ¢ïn•ŠÇin.ímñª'Kƒï”ë bŠýî)žUØ Ûè^llh±úªj ¢¹=9JÆP޽øé!°ˆ¥y¾a8>ƒ%ˆx̦~D0ß‹«ñD 3DÞ[&Aïæ¦þ9Æôä|9û'þý‹Bæendstream endobj 6 0 obj 2844 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:47+01:00 2014-01-29T08:09:47+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000003168 00000 n 0000005048 00000 n 0000003109 00000 n 0000002949 00000 n 0000000015 00000 n 0000002929 00000 n 0000003233 00000 n 0000003487 00000 n 0000003422 00000 n 0000003354 00000 n 0000003274 00000 n 0000003304 00000 n 0000003569 00000 n 0000003625 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 5202 %%EOF curl-7.35.0/docs/libcurl/curl_getenv.html0000644000175000017500000000470612272124467015301 00000000000000 curl_getenv man page

NAME

curl_getenv - return value for environment name

SYNOPSIS

#include <curl/curl.h>

char *curl_getenv(const char * name );

DESCRIPTION

curl_getenv() is a portable wrapper for the getenv() function, meant to emulate its behaviour and provide an identical interface for all operating systems libcurl builds on (including win32).

AVAILABILITY

This function will be removed from the public libcurl API in a near future. It will instead be made "available" by source code access only, and then as curlx_getenv().

RETURN VALUE

If successful, curl_getenv() returns a pointer to the value of the specified environment. The memory it refers to is malloc()ed so the application must free() this when the data is no longer needed. When curl_getenv(3) fails to find the specified name, it returns a null pointer.

NOTE

Under unix operating systems, there isn't any point in returning an allocated memory, although other systems won't work properly if this isn't done. The unix implementation thus has to suffer slightly from the drawbacks of other systems.

SEE ALSO

getenv (3C)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_multi_add_handle.30000644000175000017500000000536212262353672016464 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2013, 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. .\" * .\" ************************************************************************** .TH curl_multi_add_handle 3 "4 March 2002" "libcurl 7.9.5" "libcurl Manual" .SH NAME curl_multi_add_handle - add an easy handle to a multi session .SH SYNOPSIS #include CURLMcode curl_multi_add_handle(CURLM *multi_handle, CURL *easy_handle); .ad .SH DESCRIPTION Adds a standard easy handle to the multi stack. This function call will make this \fImulti_handle\fP control the specified \fIeasy_handle\fP. Furthermore, libcurl now initiates the connection associated with the specified \fIeasy_handle\fP. When an easy handle has been added to a multi stack, you can not and you must not use \fIcurl_easy_perform(3)\fP on that handle! If the easy handle is not set to use a shared (CURLOPT_SHARE) or global DNS cache (CURLOPT_DNS_USE_GLOBAL_CACHE), it will be made to use the DNS cache that is shared between all easy handles within the multi handle when \fIcurl_multi_add_handle(3)\fP is called. If you have CURLMOPT_TIMERFUNCTION set in the multi handle (and you really should if you're working event-based with \fIcurl_multi_socket_action(3)\fP and friends), that callback will be called from within this function to ask for an updated timer so that your main event loop will get the activity on this handle to get started. The easy handle will remain added until you remove it again with \fIcurl_multi_remove_handle(3)\fP. You should remove the easy handle from the multi stack before you terminate first the easy handle and then the multi handle: 1 - \fIcurl_multi_remove_handle(3)\fP 2 - \fIcurl_easy_cleanup(3)\fP 3 - \fIcurl_multi_cleanup(3)\fP .SH RETURN VALUE CURLMcode type, general libcurl multi interface error code. .SH "SEE ALSO" .BR curl_multi_cleanup "(3)," curl_multi_init "(3)" curl-7.35.0/docs/libcurl/libcurl-tutorial.pdf0000644000175000017500000021500012272124474016053 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœXÛ’ÛÆ|çWL¹Rµ k9Æà޼Ù.«âÔZr"¦œÔÚ 0$á140XšùåSòé3”ä—”JZ-.3çÒݧ¿± Ò÷³>­¾ú{Îã*d‡Õo+an2÷£>±o¶x   Ûýʾ#X±¼ŒyQ²íi%DÉË"eÛËê9èÚ]= ÝFOZ mÕýÄ?¯™»ºÞDiÈC‘çA†êtjûûì+ë_¶]mB ìQ#„!ð2¥(âŒmŸVÁۯ׈wEÊÓ2FdÛfüðÝzûë"æ(äI˜³ˆèvHa~%û¯‚-#ó·í‚‹6a#2^˜ßí~•µné)D,…'~âuO©eÂó(ôйNs›=`¯ŽSÕQDªëÝw¯&)ãP¸‡.ú3¯>¦ª—(·ÔúÊêN²»®³ÄfÍm*¿ç)ÛD‰­Q¹ÝCÁÔ{{ôý|X‹œ—eTòi”ÃËå0¢X—¡ÕǸ4ªi@ÁkÕz*M/ŒËæâÒÅD“ ÃQäòRS×`»«3XÓ¢°!H»j‡–W515RÒmOWvV#Q=_oÒ´àE˜?™ý(ŸÝŒd¬a’dCù!—Pœ<öðI K“¦åêƒ_ÈjŸžã,s1?_£…`ªl>­ENår¿¢êÓ¸'t5ª~D|£å‚ÛžU“&jÍ:g¡€]‰~‰ÅsjÏñsè„£ ðž ™UųÈ弡ë‹]]‚3j]µÝHü¨ˆ&g*¶UƒýÔ×ö7¯ ƒdÛ?2HF5Ê R;à×ñ¼”3ö8Íxæ÷Fyi÷WÉN7З<ÍÊr]‘©räŸÊg‡{áôó›©íû^·Äº&&eᔡ³ OUo¹X–¦n€UZfž×fÉFzÄ^o÷t=åEŠÌ]Cò†[t'Žyç> l[:©ºÝ­#¥2 (b0Û5Ðí­ÕY“À¶FlF°–Uìo¿ÿçfÔ×n–»Ð-€×!O£Ô§(ó"ðýÞÀ„Åj rˆR¢¥݆æ±]u¼Ž˜æMµ• ¬¢(‘ÈÈñã£ííSE ±Ø?UW'Âx’økÂssÂÏÙ¯“ÐFñÚª·£Êê¬ÍÇŽGÌéoÕéÜv^‡~´%#È nGåÜèà_êÖ7Ü3 05, &µYeî¥lL:/½y/†[0`Mx˜z »\n‹æ<›§2-jµÄ Š‚óT=¢Xà¹AZ§ê ’a8ªߨ²§iÔl”ÚVˆ¸"bôoVžÀ‡ù`CËsZ qºM±½…¸%.2Á£Ü¦Û×ݽ8WÄHô¬0ÞU„d(-ÀñÅÎ&eÌûÐ9“žhâ©?+½u:XÄ<žmÝï7[Wò¨€ãp76v•ϲbað"a£®'‘)9{³†w ÃL4_ˆ}ˆaœêq~&âeIŒ¼c²Ž- ߪ•½m=4TCKIaÕ%ƒh¼4Á¬Õ°${̇³ì"œ=µ/ègÄsz”zšñØL%hÃ0 ·ó‹¼ÿtÛÿÑ«f.Èã}TO¸¤óÊÖ&ÏÛÞ×´—Úå³#ˆ ã\ò½@ßTCÃÞ½_”€͹ƒ(%ä߀ÂÓ¢¡Ì(´ó¯ÐÉŽîMÚZ§ô(6Í}LêÃ-¦„‡…Oä0ö`f[ŸzR=b Ê ;Ó|•'½ƒ¯bI\Fä´À³evO]lñKïa‚דü?YŠªýI©¯€é[¥?¦cœwÇ?¯"n2•M&m‹Ã‚V§öß(6Ò¤1n,/R+Ýy‰’øÙ|]Hw +WxáÄ@æì]?;)HT°Xg¯öX›RÌz§Vé-öƒ:™AJfcj.„¨–¼9È»àn>'è@Eɸyž3yG²xÆkOç³´1(Ú§1"±·ÀÕ‹KÛ@*JÁ‘Yb NŃj»ýñ½Ùõ þÃ\Aåw’Ö£Gxº8Pf¥Ó›#1,ÌÙHdeP‘)ÔÖC%qh !Ñ.«2ÊMVÝžäã¬:Þ³ïÜÙGïÔ31+-™L³ÑÆ.Æ™G¢4I—/£¹¡K&aX¦K&¹~<Š?:ìÅZÔ¡_ ¾y†#½Ätpúƒ£ägãb²'-†Ü’Áºãœo“cQœÜLðRK2¥¿a¹¤Þ†¬sœø³qp!c@Â=†OÜ?5…u¥Á×€’§T€» ‚/wö]DOf%•WóS•½,XtçÀ„óà×ìiS̬û†$Ò ³K<\–­Œ’Ù|[àÐ)K£-4ètƒ>Þ¦˜VðGã Ñ¤Šíí@é7Û9 ‡:^D÷*hGŸ+žSƒšN°´¯lÍ]ú†€÷‹‰¬àþûÄs°Wë(!üÇAo?`˜T"Ìœ™‹Ï4®g'd9'î°7;úÐð ¥´sšôŦ,|ù¸BÄ{Å)qü§·ÁÝ ¦4¸ônÝ»¯OÕ¤p³‡–ÖƒºWfŒ;ìQºr÷1p£QE'ó¶_˜Hî<Lît†ªš\qöüa €u­:¸uWG“Òîõ‹òÌ×êñ²ŽÀö¨È©æ{v0¥\D3§öû9¦À팆T®íðØbn{p¶$¡O. ¨f©Õ!5S ‡ùkE£¼gIÑÿ>ùdwÇZÝŽéáj¦ÎÍ¥™±ÝšSCÅu»Qõø•«¥ÿÉO‰åuóÇ8\(ÛÀa)cüÍ·s®?.?=‰€-|y/­ ¡… °Îß®$Vãv8„)½´Érn§vCRvçM`8Cq‘/ò?TKs7IècWtå»íêoøó?¹JR‘endstream endobj 6 0 obj 2537 endobj 13 0 obj <> stream xœ•YÛŽÛF}Ÿ¯è7S‹—ݼï[d³^L6^g#°EµFŒ)R![£h¿Á½§ª/¢&F°¦È:uªü«Hb)úãþßîþú¶Oó]"žî~½“ü£pÿkâëG¼PуÇÝýFŠR‰²N㪇;)븮rñx¾{õݦ=MýÚœÌ8uMÿ!J?¬„{ºZ«<‰™GÇi|ššÃ¡žÄ?YýçñŸwë$Vw´0¡† q“i!î¢7ãê¬Æ¯RÆuVä0íqKOÈÉ4›^‹oÆ­Ý ñf¥èîBE£ûíݪÌâº,*<é·|ãÕU•ÅIžæb-Ÿ')=îµ8êñˆï7zß [o¿Ø7«Ç_Èf™[£p¸3)NíÇÏø–^²Vq%ëðŠ;ÿd`k;s·Õ›©wôIYÆU±|[òë;8#Ì(Í'zKÅ9ýÐÞeYœ%ʾé>\ZÇe.eix9ÓÏ+I±É Dâ“)\}3­d…‡e=iÑÆÓ`ĸÛnÇ¡’¸¢NÝIÑNOz0€,©â¢ ³éðÆPºçËlôa B§‡U†‹“2ž»i8cŽmîeÌŽ¨Œ“ý3%[Ååž.Cè¢Ó"¦ôJ¢$éuDÉ¢-dÊ ‡ssÐðÊ$3\¾qPn.‰¾Ǿ14Œ6ûÆ„c¦Ó0ã•XB„ÿÆ¡¿ˆç•ÌáT]EzºˆfØ0ëÂãÃv>\M/é Ÿ²n'‚ÁšCšÖ0±Z€1—-%¦^¬m”BKŽÊ)®¹¡g)e˜oÂ÷¹G@üz•&2N«2Ú]ØR¶µ"«*õAÉéKÜ7žÄ/§Ùx¸…#³2ÎëÊÃm¾:…“³LúËNÀzž:£Åe<‘‹¨Ï£¯H=Œ§§ý=ý„+l$9ˆg4´“nŒvè(2ÐOñetä¬ûð‹OÏ*“ü}¸ÁO’8ïÇS¿^¹$ÙÒ­ÁhÎèÈÌ‹â‘(AŸ"3ÙÐÝ48ø1½xÃTk• ¨UÅ• Áwý¸izñÕU¾*‹ô±±)|Á@i± Ÿ¼¸²CóÑ gvÿ¢G JèöÞíNCKGã sO|wqL‘s-)b–ÚÁ?Š—¹“E'粈dÝoqÁŠí8 }\N` ‡®è·¦5ö:° <’ˆŠEð8´ú^ Ä`ÆèIìG ¬œ~o‰ö2UÕ_(ÜR)¹f¸ùªŽñMå}º˜<Ê×ôÌ)ì£AG€æiÖ>€S3]nN•)Ø3\ÿp=5S"äÄ»f‹ž ІºËÚ+"—M-a¨ÇÓ¬—fÖÒ—M4˜n"‹v0 &Ç–J…´©›<:äe¶Ù8Í [—j 0ã³->v>DèµtÞâ%TV’9DTgƒr§&_–5ª[ÐéÚƒ¦Œ÷]»§[±Á»GÎã`éÈ nç€Æ3? ÅOl¥E>§ÓŠHÿñ/ï£o~zûðñ»‡¾^©Ü6Н>~õðð¢V F²Ì7£$.”ÍÀ¹m®’Šƒžæð/­='én•¢m¤U™îJ€5‰ªB B•Q?ø40H‹$[]ï´rNjŅ8ŒÛS¯ç{nx‡îio¨^ñ4Ž[±µÍ]¡副šæÔ»N ‰P£ÍÝäxϰ¼ª!7où¸Y6GEg\¿ ¦5uÛ}Ö[úËßøâ!¢#Ö¤Ql˜®‰@ü ájJÄ»×ÿJÇ,]”vŠcôXdpOÜŽšZ¾íŒYšÜ“@ƒ}gÕDJE̶aPd\¡ƒ+âImq€žcñn¯*Û­Õ-ïø;RiõG§-¹·Ų%õn D\«U\^©Œ˜²oÑWEÊUq*CÛXh.´ƒ*xsµ° nâ›s7¤ Þ~b)F@×àWsÚYà«,ÚÁW+—ð—΀z iNî[d{™#-úŸ)œåëe["¢£U*Ïâ"“Ác=õŽðŠÒöÁ `£ûËM_(ópWéäÒ‚äDÛ Ãh˜LÙ%pG­ ³5`G÷óM ›pUQÁlŸÿøç%hUy3ÀÕ®ç8TÁ¿ŽÉQ­FF­oIѲPLYe×}×r¿½‡q¢ÛÝð3ê*cëkŸ¨«6p2Ï7š)È=~­3,YœÍ$ˬbÀ«ðƒÉÍÌ¢&†¬]sñüq¥ýøãË:ÃP‘X—¾Pf$«X¥ HR9*ÏY5C„Ž]OŠÚ¬ì<—E§®7¯õ@Úi‹ˆÖ5eÕŠø{+ÆüUTV²eìé- —ôS{GÐS¡Bo‹¥fÓI¶ä¿\50.$ÄãŠq`C|M5Ñ%ãÄ©\^Ë…žÎ¬´ÞΔ&/inµ<ñKØÁk/aâàt…FÀÕ½5rs•QÜK6 Ø Š©íɘ„_ŒØ¨}j¹ÔA|yQã cŒfÑÖ›n6Ðôàº{ÙoU*_}¿×© ×~[Öq–çžë`ÉðÊv ²²¢R¢àÕšÍ2½ùUTªÊÊZ oÑYÁÍ…3KBÇ^Œ\§æ«æ·vêf¾|Dâi>û‚¡5îód…"¶G#îî:8;Ç’3_Ý63éÍG½”FµóˆqS?陚“>–YÝ­·Ã i‚X¼éa±¦\kŸ•#´'OÆc¯{:Óq„¿ ÀC×Ò—“njUòpCJÂÍvXF»©­ŸÜÍbf€ÎîÇá yav¿Ðò@ï8Âl·ÄF W†Ó1D*¸.ì¶&„Ÿf°ðñýy)™¥ 8 Iއ §$ÉäñxgšÇíÏÔúªý©²p$£™ØôX¼6–q ùÎl«Å¤oW3i Ÿç«î¾™èƉÕÅñ:iÂùîNŸÁ-×õKÐJpc¥þdee¡ß‘KäÜÚÍPª°Z‰|Oç‰ ‰ËÄî„ÞQ”m.ÉÚÛ|bp¨Uú§,ªJékó;¡"”ú?²Àº}­Bs*µì›¤]ÂoŠ¸Ì½bžÇE¾‚Æ#Ê$Ml¨þ0­ ¥ÿð2/UEîŠb£ÝtE âv½9Êà–@í ö6–Ùïv”ÜÓýÔýýf´Se6"9Ù=[¢x´ò´ófòPÉk°ò £âø|#.Óz†ù6ÒëBÑŽS-z]é”Àk¦¼¿lôlÖÇ C; ‰ðÈ×…‚&‹Id¢Æ5ñ´@]PÏ ô|ÛVÚAAlí+"°, zî $¬âW–«ÇÉÐX-¯o>¬bñõ…ÁK£á v1Û(é÷šï-Øžõ:àŒúŽwãu‰| E•Dz 6bþv¯ÛO¬† ¥©”ápÓ¡fÜeÒpv@df3Z«òB»çìË2뽤zè_ñù‰¶]t°lm÷!n¾Îox„X‹e8&Ç#í¬Ü2ô õøÑ[5ô-ZaXµß€`9I+ƒŒø<ñÉL˜S[¸ÊËÑÑ÷Gj¯vže– ôÄó6Uº=A‹Qþ+pÕ‚%;Ûz–'Pšr©èuž<“þüÏ„²Î#\GMÕ-øÜMžë^…nÿŠëηº‚9VouK³°÷Ëíg¶¥éáÒhg)Zsï®Z ˜º¥u,£È™ïGZén,0x„âwdB?ßÛvV34v—¼?i¢ÝëÀíå`àêE)¿„÷S¨q{T%][L®„F ÿƒ ûX%mà!%¬¹¸ÿ±c¶KE lßiI³;M\£˜„•[NŸ¡F~^I;nòde¨o’üäMØR˜ •ÉË4ò R©¸ªü1±Št=TÆà”x')nЖqî@xþß ,µ~ßLBÁ*›Ù,ö›çHÑ“oïþ?ÿ@{zØendstream endobj 14 0 obj 2953 endobj 19 0 obj <> stream xœ­Yk¯ÛÆý~ÅÂj*Ð]“Ë·‹¢p^­ 'n]Ap”´ºbL‘2¹ô­òü£{fäR¾H"0‚ØärvvæÌ™3«,ä éýÿîtóìMÎÝß|¼‰ôKfÿ·;±¯7XPЃÍáÆ|±\°¼ŒyQ²Íé&ŠJ^)Û<ÜÜM½Ý}s«FÕõuÕ¼ âw+fŸ®nEò0JƒsßÝ÷ÕéT·÷ìÑOV¿lþqgìÿmöpÖƒÏý ÖlèØ¹‘Õ Ù®kUÝŽ’õ²Ú“©C׳­TJöll÷Ë«–^ðÕæ×›Ûl³» Û¼º‰x™Úê¦cãê)m±»‰ ¥yCÒ¦<6Kîl¦Ž’a× «[Ø?¬":IÕN®Ù¥Ùi#Ùþ(IûA6VµæË#¼i$g?ëÓ‰¼„…lÞ«ÔîÀR+åžu­´ècÉjwÔVôQD™ó(OØm$è눋´tžCݵڣ‡e&ÏË jSˆïúg_WC½«šæbâÌsúÇÏ""•Ú¥`­÷2q1;˜ç°<»±Ù³q¹öÓ†:Jõw¢äi˜Ø?ÉÉ`ÉEQîEAx)‰Úísƒ€Á[²“Ú` ¢¸pÍaU_µÃAö=åa()a¸l´RŸov'Œx-¼<}ÄŸÁs4ÊRØǪ7HªÓtìºÅnªJ{ŒÁ.!O»%Äáã¿IuöP«£óÂ-£÷öõ_UÆ{zò¾nkõ.x·ú³ÀüAÈEnüR¡ÔØ·Ã{;P}¨c¥LˆûnG C”é4­ Eœò,žÀ|j«ÿQlPòüœ ¨,²2ž5´aDRìa¦Ú)`nàìmxk<´ÖüŒ:\û•’S±¦»¯wL¢ˆÕEƒ‡|Ï»Nó‚K.ËAöµXw˜žºƒÇ¥àç%£ž„…+XÉáu|—¡p'Li5¼B^‡¢M1Öõ¬SðØ&d¤0’µgo€(KŠE‰ƒº¢™†pÁŒa3|AÎi_g:$qèðÈ7¾›™ˆÜ‹£\|¿„êe7%xBGšNBiUß5ìØ-¬ÄϦÅÁƒš­Ð’°œöføäÇi2•˜§n4å•çI¬÷ñó5e op2;U{Àðµk/OÊ!¢ê¡´» ~^é8Ç"æå|¦W”Í…³"ãEîÊù²÷Ë +\ÅtíÓÅW(›È}¤Úù#4öÌEê.°œ‹zÐçÅ<ì}Á‚$›~ƒ;ã0]‚Usnu>7èÜ„ VHèl%a‘¿K~Ñ@„ÌÉ4Œ6_ݯщ5¨SÒÝRã÷ÙŽªè‹*áѿ޾y¥»jH®¦Eâ÷c‘n#¶âõÈíWÖm Áo°êõ?7ïi1¶ªØ¶…óC}ª› |Ñ=×µ3wÁ/Ae|[û¶ÖìÉQ©óógÏö Gëxö䑼’Êæ«°å :ˆ\+†ÊçÞ…NãÉHœŠ=kÝëm7}0b!²:«—;Y_I Ô”$ÎlfÌB„0au‘·³•tTÓÕ”Vï©c~¦NE<Ú)"®IÙÉÉëˆqA€ú²x.ò,6„}dA‘œý»nÝÇ} {˜µWoú¼¤MÓ§”뾑UTOsŒ¬_zÍ8ʸt¥`âéÅÐÕ¹V–MýÁJSk¹Â¼!¦BR«%'Š,èî½êŽyRLBUšŽ•ˆ¼ëŸ_XùˆˆjÆKõ^´åšÙÛ“[ЉÂ‰vëz /8ÃÌb›\g¢EAÕÜ"_Àe§šŸÎ£—?7¢±àåïÍ,Àg²ùéÍËÍwß¿ýñ›ÍË×?®ýX²qçöIç÷½ó §œ:ª½Õs-I¶†>­ lÛj÷a>à88ê>` 5û~…ãaÆŽ‚{hqʽj;,íÿ_ž;‚ài þ|ë¯O/BiÍIðPúbÃ^ø@Sž™wý'¿Áæsöµ¨i«æ=tȸS©'àç)ÄSb$¼7߸ÃÑò„‡‰ž +Œ]ô—“-lXoèï‘›Âwf†ªQözM‡˜tl¥zFG]µd4q —!í¥I;_F ½…3ÚiY aè¤É§ÎMÒFô»ç–ck{5»ß‚oÂàÒxŒèՎͦ¦øT\UtMáQ0ÄÇ% ÁSÆ”ò(#̦+ Älwd§ê1“âöˆ~Œ@ݱ³÷žÐürm?åy6mübã…‹Ç cÛ LÝÖ'—¸Y0ÓPØÝÀ\ÆÑ⺠oØ2žZœÐÍ%%q÷^&ÁVa^`žsUêTëAU®y%±©‹]gª}¹ÙâyØ"aoÅša}0ýÈjÍÉ 21õX5øa‰Âi¨“ZÛNÚP`Ç<ŸøHr Áí%ÇñŸqF”ñRÛG¢à±›KùK·J F‚­uùÁ7±dðJSÏ:Œ4ªØÆ‹{ÍyŒ¸ZÞ2e\,¯u¼ýiy¿|c#²¼^îî’RÇÇêú*Ið)qÞÅÔ*Ω_lIdQ4Çh†)óð¤Ò3­VÓXu’…‰eU3ܲÏͤڷ†¨L|úýËWß±¯žS´ ¬ØB°‚¥ÝÌ-µ½4È€Vív2ò°‘.ô[¹ϼÊ5ó¯½äISžÌmõGÇŒ™k¬åT\ÏrsEð€.m?=Á:`0›nÿd»,B÷‚` ¸û±êƒ3£ñŽ™9…Èuf*¯ú¨±Í÷¹¹½‘g¦SL½áX-€KstYL©Íì'ŸHÏH3%y&® K2L7ÍGÎþ0<]¸‰¼Æ"›æ›Îox0æëÆÃn@aÿœ›JÑñí^/4j°ÖEä€_šyJ:4×çz÷aàìÛÚ\àç©þÊ^·úŠf2:܉_ÖSÛ1é9Ó¸=1]^OÕ¨ -4?<(03W‹WäNÐ’O™öiKZG¨ïé2½E0¸*Ø^t±A+Ø£eD©w´Ôþ¢A¿Sp¶9ŽÃÚ²»råL-sYΔkÝühØmõ¦º5Ý’ç>ߢ½&ÓùQS´dÉÍ‹¶x¬k„EEL¼¸‹*r‡ 0°žbžy㣉ʮ¯†ãÕ•»ýQ€¦D¶bG™öR6ã¹óþÓ ÈYÚÔ{;Xvúâg–9i‚¡mž êmÖι˜Ð¿,±~DÄîOu¯Fú¥ã‹_&ñ%_ÿ0ñ 'dÓ;³„Ä}fˆ¦ÿ¤9<'Úcº÷Ë=¹ü€ñC„a©ß& /\oéÉw››áÏ—endstream endobj 20 0 obj 2898 endobj 24 0 obj <> stream xœYÙnÛH}÷WzB ¬2‹;3˜‡N'éÎÀIzlA<hª$qÌEÍ"£èú£çÜZ(Jq ˆ-Õr—sÏ=·ò;ó¹`>ý±ÿ–ÍÕÍ]ʶêÊg۫߯„þ’Ùʆ½ZaAF¬6Wf`iÀÒ<äYÎVÍ•9ϳ˜­WŸ½ºz,Ǿ^ãÐõUQ?xáÂÙOË ö¹/boßwÛ¾hšªÝ²g·,þ»ú×U˜°%þ®ÖWÞƒ·Xý–ˆØšò0ôý æÐ×?}º»ýøëêËowïVo^ÓÒ¥ÏÔ­Ê«,æiâvá+úÒ§/„ÏÝöíAŸÏÜõynÑ¡ Ui¨· ŸÎU›Ó¹‚‡yh><¡Õ™®od_ÙSÛ-‚QÈcïвBiWgž¥9R„öܳ·ïnßœÝ23õç–ðW'K¤ÈZâuÃŽµE#SCU×ì@ËÒ€çÓ]dlDÆÂÖ'V´k¶îذ“:8a³²”-E@k}½Ná<¬@œ–Ø{…Ã,Xýý³÷nÃŽÝøbJDêõ’j–wD€ìPµaÀ^ßÞ^ÓjöþÓý ˤ¾þ">A˜qáGÏeþí§?­Þ}ü`°2¥1D¦#ŸJÛÔ.•ó4ˆOÇ.µß‘Ÿ!,ÂùíýÌ’¿ ³€ÇçéÃù‰YóÙ[«<ôú£ö] ;Óù¾…Ôˆ¸!•r’ú¶—}%ÛR²²/ÔN*®7/…Ÿð,dKJ vò ÉuîV;‰TøÛmXÙ=¢Ý­11¥EåUN‘ŽÍÉ©˜ÇQ–9›;:e?T]«tpË¢¥_kä‹… Hä™c·r`EùĆyߘôN7>•çîà‚‘Â~ÔÊf˜Ü“¸¨îdÃêbý™éaÊßYÎoϪóT]rxaw¥&W®œ«i`晃[«Y¬-2EùyE”];Tí(É;`—å05ú¢UÙ¿t°éðÔX–R)öOFµðEêø‰Ü€-<úm‡Öòañ ´.ç§<³—8ô¬ rŸ§e>âDÛ«ñ£[YÎæ^6Ý ™ªym)€á{˜YôG,n“µÒ¹íñqåÈSã:È(ÀÓ=i¬ƒ÷™£Çw•F¦˜%¸Å…I]ÀÃ,žXÍ„<ÈyŒ"pÅøÛN¶òâzî'?¸ÕÄ;¡õ”Ê ›RùÙë«EˆÀú¸DŠ´†]ß9ã³ø/œï©õtñT»\ÛŠ¡¸fÕ€r©k¥ÃL?éâØŒmIõ„êaû^‚Àiâ}­ºQ¡‹ º8C Ÿ6ÅQ×V×JöxDþŠÁ•V¦­[æŽÅá½b˜“”20È4{{Ut=™èN?1„9gfb¢½ãÓéD³ÄrnÝ‘IÀ ÙWJ>‘ÿZÖáÅÆ ÎÎìÜ^QßhÆrGÿî;¥ªÇZÒÏÝfíüCÎþC‡ˆ 35sðA” zŸj¸4®ŸµëÆš?Œ}kjbleOôiœC˜~ºî YÔ¬úgh~ÃNWŠµÝ wiÂ(ã™s†nÕˆð¾.˜nªEÓ-‚µ1Í×.ŸSÍgÏܪÏ?,¨cIæ‘ã…RrMÕ\‚]¤u¥]oÌèÀ…vÌÔ±öêPA$€»eß#íe·–¦‰ 9(²*Nïw¥J®öµ$¶æˆ4‡Rw·ÇÓ6-±”ihȈœ&B¹†ÝU‹ß‘ÛJ-/®ÈcRYn¤‰¢“a©Ã{~x¥ÚØÝCËI†Â%}sÀ'"ŽÕ»q»c0‰ ºžZ˜ ÌiŒ7wwü¾àùÑw¯Ì‡<:õgêXÚÜOoß¾¹£T컪¬’‚Tˆ/r鲤›âãBèt¦Þ¸1•7jGêÔì ›w5ØÎš†ÔYÕ@}¸`»Uаë‚jÂ$³!úÞê 9Ⱥ6yurM¤ù¹\#·[ƒª,÷…W´¦;¸¤?L`Ô6é¦MèÞ#-~$¡‡|[sWñ$ŸX_¤PEÕrö¾uè+]+眞…<½$\Ú}É í~Î>XâÒÛKØÜK×¶!Ù’ðTòa`,ÑÀ$ß{¹¤ÌShLz\äÎð00úé[ ë<7qC’e«k¯)žŒ­Y  ÐÆ³ÔÙ*‹ysH'¥bã:o„Ó qÃs篧H¥!Žlgõ®ÓX ƒlö:Æ5‡ G/ à R.u¿¡ %ÎM¿q¥gE¥K÷¶C¹¡ÆlME§^ЫuçžÚ‹U¯ ]Õ ]ÙÕŠ„Æté¡­»bMÁ-aº«ÖݬûŽHB> Ó¯Ýì*†ú«mTôqʓٴ(‹òý 1 "²ª„˜\“iZ™¡æên»%kªöš¯Nûp!W–ÀŸu’@h˜4 ¥kV%[· éé% j]A>¡fš‚ÿhÑrŽÓ™½[MXC)œzæ`b`q,D×™ûÐlûa…@ ~6ÃŒÝ2Ù›±Ý3N³Zäìçê²E·åûYüLª9´ót*ù8‹¬¬Ø“£ð ¼jOóÈY§rNâÃäPjqàÀ%˳;’‰ÉÏ\GàäPTÐV­i-¸‹DŒ›iƒ42“sOñnºsQIË&`;zÆõõfÞ`²Ð“Öì­Ìš¢Ä¸¬ÇË¡‹8ö¸qshuNú>‹¸O,!i3sÈû±ªå°ë@­ï'¬ËäR£t Nð‡“cPä~ä†>öG¯hSUÉúÑpöD}ͨìXœ»á9û&îᤶm±+a[‚ál`êϧŒ˜™÷àú±íê |+ZiÕí®ÐÌ!Ârìƒ÷HMѤC€öTøAÛ$0xˆ|·w€O³AH, ž³x–DXff£þa&6$8T_‘ƒPQƒSœ}la(õ J«k­þͬ!±ëÔržY AmNªøx¦¿Ó©¼ÈûœNòUø¤<+KHß¹¦»4¬˜–æ:6ˆSsÌ‚ë¡&×$*5©h®!3ˆ²èjI¦|1Ôê55õ Ýù¥…p½ÑŠã‹ïk‡íe±ŸÔ¢±î{‹>Üog]€[×v64.‰;]35:j탗Žú¶×vô3:6 ¹‘6Y€ºÐ•ã(:ÒwÊ"Ö{_ô,ðýÜü7EDoâ&»zý›ÕÕ¿ñçÿÑcq endstream endobj 25 0 obj 3042 endobj 29 0 obj <> stream xœ­XÛŽÛÈ}×WtžL#.ï—}óe|Y8gFŽŒ£E¶F\Sl™MZÖ?8ÿœS}¡8Z'‚À°gLvWWW:uŠ_Yà‡, ?ögµ_ür›³µØÃâë"Ô/™ýQíÙ³5ô`½]˜=!Ë#–—±_”l½_„aé—EÊÖÇŽ×6›jìÛÕ0²oxûÉ‹?-™}º\EiàaêzùÐóý¾éØO·,ÿ±þmgl…¿ëzá½—-ïïîÞ.׿/"?e«(¡ç9õV|›^ÔŒWC#;ÅÆîK'—QŠÃ’Ì;v¾¶·šíôN\©öÂÜÿf‰_¿½ûXº÷îB!ØzcYÇ^Ï;uý ×Î]ïÝCÓ Ö(¶ÛöĆ]/x½R|+®ïjÖIÆëº¡óyËÔ ŠqØï­o>y=÷Ù‰(¤ÞÇèØ¨(?û±šC+¬yÅNrdj'ǶfJ x,Øó·ooÞ¯?¿»¹{óêŽEø%áÅZ µÙ§o™<;lÀÑVöŒ·-ÛÁÙV(Ÿ]£½aœQ¹Ùì‰þ´Ò~&a ÈålFÆjT„&ÿÃŽ=60‹ûæa7°ã2ĹAy²ÿÂ~ NbÂn™gÞ÷JÈqŽš½ã`âÒÉíd')mõØ“QºÝ‹ww¬•òËx`+vÜ5ÕNÇ âI!ÓºZ[oÞQ.Ÿ0éâ(Í=BÚ{îð^ŽÈÏæÄ6K]>IèM[Ïê×v¬ZÁ/ÅÔx øîÿH9§…=ïO樨eH ) ï[Sc W§®Úõ¸Î¨XÇ÷Â8뜲Qô`N¶:ìQ‚ˆ–…ËYZšœQ^n:¦ä^°CË$m¯®&7U³?{:ø¿íØiÀ“GÑã•ÐÊ ;¤ZÁk\‚¡QˆÖçÐåÇ(°ºÖ×¾÷ž¶J^ÑYÂ\Ýiúüáîúó«·7Ï–¡2ʸÏÏŸ.“À”Óó××;òsV,¦¹-As~™ÓﬢÂ/L]êrx3°R¨îÉÀ>.sØÏ³‚Àew;’¤¡yjÊ Õ xéqM:3)Š/ˆ-D¼#§w;¡Ÿf@Là Å<'Å6B£VŠðŠ:MlE϶ôQâñ¦Uº¾tÞpU%;Ÿýï nàkÊdÇ' §tn”~–df͹Þ7ÁÔÙ·ÌO⨸ðͳ\pä&ë»Æiè‡I|Kš&æ66ÿºh*Bôj²ÆÍ¸1æPf‚KGNTW#W´õbO`P¢ÿ¦K¼H°†½`/†±ïòn¥Þ­ôuM©jDy5ïk¬:´PP•ì¶£Î]d¦ìЏ}­‰°g¶•ù(zƒS“ì'ô’bšù– =%çÎÂs†£È’˜êA¶5êG°®K²öü€¢©’_ÿÀ½»¾}vsw='X˜}b œ|·÷2Is?'¦Äda¡c2Q‹dê È嬑kÄÆHx:!vvŸÔã|¢üŒ–ÃÔh¼Ý€ŽCÑd%[V‹AC´p‘®F25P›n=5«¦ÛJÝÃ,~+Ѹº18-#?.ëÆ·Ç>–šGÜËúpöQ/±1÷&_øÀ P 5‰‹GH¤¡/ÁQlñû6<ˆªÑ<ž{äËõûOKD{K˜x¢{X2›q`‹˜¯×ë÷Æç”^U‹,ðã$s8¹š1Aà'IáîR»¦´#6íÀÎÖÀe„Â(ò£ì"@ö°‹Éy€Ò w§ÃÒ'Mû Èr8 Nn‚£†±>é–bF_ªZñÈPev¶9y’ÿ$UýñìI‚†é4×P|â9èoF˜e @D÷þÝ#«PX~™¸<Ÿ†yÑÅ©µzïíiPãLJ"¸dÄ´_MýÝWÃõâ‹ÄC­ìQ/‰H“0­-¼¾~úâúV³E¨»)¹àZéÍl6ö zqÐ-ŠTÐfÙv9‚mZ±…îøhh”àvîn¢;_:òƒ¬œ^ Ù#k¤zµ86{ÐÞyͼãÍåǽ·‘†9öd-oH‚Jöã»~J|š|²L**èYt€ZÀ% +uÊÂçì–Ú)ô¨¹ÛÜ4LKÜ”Z$–úÓÍž^-íCè/*ûÚ˜@@´Y:qég:^H‹mZWKè»Dj:¥PdlÏ;ËT´…. C±ÃÏ©~ÄTgÔY²äºçXª ý(õÔ<0rí •j6 'ÈÓ_Q.gÆ÷‡Ç‚Éu ,©ÇJQ§y_ëÁÁI‹rjóv4öÐ_®ômFôDü´gZÐÚmsÐ"ä[òJÖV¶é:…Š´"¨”Õ ƒÊ^+VÝlyŽîäJîM‹b½XCs•YÃÄPU¿##O@Η·RP@"?ì®tΑ«^'M7.~n9D*Áeˉ¢øD€9X.câߢð¶µqD›€ÜK3ÇKbC&°3žv’»‘Å’îK&jüyRqÝØÆô¡Ÿ¸Ê¡9#ršmsÆSî§Xç€f=Ê/²dzÓ\U¼¸~á}xõòûçë77ï\X ƒyb‘W`d9ÓÁW(C›v‰X­¨¨†mQO¨¤zqtk´RL虚Ź3•¾{h¦•|B]Õ†²ÖÉ|ÜxâˆpsÙxbSyÿ¾ñÄÈr<Á¾p¤A²ÖŒÕmó†z†þ¤ƒ&ÁVV‹iŒÁD䊾0E_à· üIwÂø‘%g UX™¬uŸÁ§µFç–ADÓ±‘&ç~8‰fú}g|šÎŽ„À©Î{ï8,c¸“!F‚N3?Î\àˆÁ×vÍÝ™éù”I@ƒ^ßðÁ?Êñ0¹ÖíËçO5îAÎà±3Âh߈ž–™-Þÿ6ˆy­ä5{A…1Ö¸5Òÿ®1§ÿ| ‹ÒüÑ×)¤Lk}ô&-Ž5oˆÃœ,›nê%憜Կd{ ¯Ý¸¥¨kb¸µWÜ#ЄŽq9pPÅ«sZ;ÑÝ´¼'gkõtMR‹3©¢7™6ÏÙûkýAG¨ÁÄÏŽËŽø.úü€D§P4ÔòÑÝ@,Ê‘“ýC“­éÅŠi¾ž¤f´üÞ(]îxê³µk–nob¼œ² ¿“)öûÚæ‹žŒB ý".‹G´èäZ9{yVÙè/ ³Ñ‡^™®r$Eä>ÆéYPžÔƬʳ¹eÌMÜÍ'1ª`LÊl•B|kV-HÚ¸ÙHƒ(ѧP-[=i.úd1¼e>\$¸˜=#¥'×ëÅ_ñç_rÔ»endstream endobj 30 0 obj 2484 endobj 34 0 obj <> stream xœ•XkoÛÈý®_1І2$šïGú¥îÆ[¸pu$m²0hjd±I…ËêoØÝsçΔ7Øf‘IèáÌ}œ{Î~Ží ‡~é¿órv~‹ûvæˆûÙ·™«~(ô_y)þ¶Â‚„¬63~DZ'âÔ·“T¬Ê™ë¦vš„bu˜}±vÅ]Þ7»e×wuSd»¯–ÿu.ôÓùÒ ÛqCkßÔ÷MV–Eu/¾ûÊü—Õ?f~$–ø³ZÏ\Û \>áCQåRð»):)²Jdûý®È³®¨«ý ¬Û»>Ì).'ˆ-¹;ŠÃÜ¥£ƒÈʪΜ)ºZÜËNt[)úý®ÎÖbu™¸;Ь} àúVlêF-V*¦À‹Q„dÕóÕfKúÿÒõÔ“2{ gžÆb•ÏÜØFmR^þÅ’ÅÜKc•~·¦Zu§¶th±ïÚQ’&¼Ø±ƒ˜²µ¶Y§RjuDˆy¶ÛÝeùr_«§yßvu)öuQu²’;»ØgmKiÖ}sú6ÚJN!±Gë4uòéIí¶îwk±ÍÔ OH1©?Æì«Ñ±§u*/Ï·cßqõÞºîêî¸GVEYì²á½Rûºnh»(§pÅÚâ¿ò¶›¾Ê©¹_­|‹Õgwsϱú;kTù<[ãºÝ›E;€äP×Àt·¤Bï_Ge»Ø—!RkqÖ·²ÙÿE‚Úxvà›Ø°.õŸ¶²‘âN½ëø1&ŠVuÆ´ ªÔN®ïÛ^¢ ‚Õhb;‰ã …tÒ@jƒ7Ñü_ÑÆ¢B;»-ûi´(‹3ÎÁKD½Qÿ¾SŒ];ˆL p¨Øiêxt縞xîZN1hŒ5c€ÎîÚZíZfOEÙ—"+ëó„³Tdˆ6ÇD6²ë›Šâ4XDüÝÑ¢òÄKUß—C‰ Õ2:ý§Çºß·‡šŸpmÛ®és€®¯€¿oŠùK¬§0âE‹«ë`=fHRÛAB§‡|ºÔ| »ƒ”•Ê|Â6fx©Ä± d0ÌSB8@GíLE¹•Y{¼E.õ¾ûjѶØp`þôñæúÝûÕíÍåÅëŸ?¾ýiuõîíBïí0 &mP½þÀv¯©.ˆIÕà ìPózŠb­‹•¸0AÓ`%¨™ã™ÉúóP4 &NÌh[¿î$ÕJÇ…’+\z~bsòÖJNjÑiÚ±yħ8¬­{€ü+†klûáH?–þÇ÷×ïæ~È#~ñz!Ük3Þxˆ U¼c§¬‹N…Ñv C]Ÿ_@µäaÊv3×Ó%ÁVz 1^^ïZ䃕A`ûg ZW/éáë»òϺ»Ób›wä3"Æ;ÑР̱>T<†•öRsê4´½lH·À7—¸F}]WRqNÝwúiŒ ‚ŒL4ÇÉ!¼DóLS@:ªZ±Mâ„Ö¹7ÌÄ4),}Jó#Ÿ&HñÆé$–gqÜ˼“kÐ#ž->Ô‹A)5AšBÈIÎé'Wo¾º¾üpõïËÛë‹›¿_*¡ÇЪˆ©M0 A¢IÙ:T¬•(c?ÓJsH«\Ç89A?ˆSÎáž²rOˆÆ·*«Ôv"¤f ÖÌîÅÖÊöÈ•+ƒ³ºC˜gç,BÞ ç…ϧñyy23޲n|"<ë^1>¥v~ƒF³Œà tîc€!P²ûSëëL‰™Œ²T5º¢D€EÇ£ƒ>MlH¦*2?¼§ê*µ¾’¹lÛ¬9 B½âðV‘¸BÑÁà´LæN¨XKc±¨ P÷À=£Z[µEMjúùƒd$I¦ç¾?@ØZPÈ¢È$•2ަ$Sji”PJTNªk#Úž”HN\ÚÄÍžúV\mº™Ó"ŒÕ ú±ÒÀÑøZË>×¾#ƒ Öm[€KyÊAN„6æz”ߟ^ µ?­&ä%rB÷‡«þ¦œ_¬E6ǘÖÐj'ž³:,!A)x@ÍE€®(¹vö‘zóv,üíÐâ5× ’aáCÊpWPwŽÐ­ ƒ9©»mUh/…ùÑA‹ö:ÏݶqQܾ¼ƒõqÞ;ð  z€¨H¦còðŠ?dÜO¸@»<’‰À}på–}3•„Ÿªuù^g©Hˆ@¾U´Å}•ñLIŒ&t59 Më#KÐtUµõü&ÅhÛTíÍl©Ü\ºZþ>›†â„ahÒi[¾Â…ijÕÍšQ;’îiŒòñ†%ËǬãŽ\<•,µÄ3˜èŒɆM†S°G‰íy§XN:Å{ÕŒ'Á ²ä·¾€Ì*§CVXTY)‘sUFÁõº.Ž¡LH_I4z®7M¬Çb *œI h@ñÏ5”¢[)”ÖÚè{˜Ä=°/ºK#s ¡Šcòm]ä¯ñe¤/!Á©…О ¸›SÞÿxÀ†éľ••Wo!åÅæHç—¶¾o᪜º£¬$Nþ Ýî÷C{ˆë¦ã:’ÞLöz^R¢Ñ8ŒTýôà@â0L­ÜmìÓ{óZv°J{ ¡èÛ‚Yžc'LÅî4nÙqíÄ7ƒµš6ß]4i~Ó'ŒÊsj¢`:œ¿gôµ9 pc]ƒ)ΫósÖ+NFÑþ>B“› ;¯Ëó}ÖmÏ5<¦Zh)½Rp€|ʵ¶‚Ël> ÜzŒšëéôÒ ÝõõZì$RnŠŠ¡5bÓ5ô'‰c5Þ î%¡ä;4Õœú%«¼ØįúüY_\èhô Öu7ÿü™j 9< BZ/×Å=é=—ƒÒS¶pJÀ“Év†c‘ïXDG]ùWgÃg.¾›1$M¡1lá.ØZ´¥±at݆ «ûV˜Žà4TlÆ ý=0‚¢†¾¥’èoc!ùùÁ78¬!È2¢_h5+uiÀª‰Çå1@Wö¢j;úäC‚bV_¦vùã‡Ë›÷Ÿ^ëÜ8Þ¬™ƒWáøSë¾/Ñ&3óùæ7ÚMÇTO·•˜Jð'áO£G“43ýb‚á¡}Íú…-®`^ ÞU¥¾y=L?ùŽGìñ£ä“¶w~ô:ÉYˆå‘zö A·2‡j¿0—à“aò }_T5}QAÙÁ$ Ñg=7ôH=/‹û­òø4}4r¿í‚@MWÜÐZ†e[ó”R={œRuÅ’ù‹27 ȳŽ9 Ä÷8Hˆl¹ ÀóÓq¸¡ùd¾y¢ÛŒÑ±Ÿ*(–˜j·§rAþ—â0üy w ¿n‘ùæZ0ªt>’›Bïý_ö.).ß‘‘ÑwŸÇ8 –Ã=ÀúõgÉíMC²á'w6tRž°'ÄB»éÉßÁþ3ºöõÁ÷‡±¯!˜0´Ùÿáu‡ïL¦lÚK<ýnúyè{½`”™ˆž\®fÿįÿÀ ­‰endstream endobj 35 0 obj 2628 endobj 39 0 obj <> stream xœ½YÛnÜÈ}×W4„â34»ywžd¯ví/Š4Æ®aÅii¸âeLöx<@>ÁS}!gd/²  [&ÙÝU§ªNjbÏY@¿ìßesòä*e÷ÃIÀîO>pý’ٿʆ=[⃌,ïNÌÎRÁÒ<ô³œ-›Îs?Ïb¶Ü|ðêê¶ÜöõBmU×WE}ã…73fŸÎ"ü€ÇÞ¦ïîû¢iªöž}wÉìŸËŸOÂÌÙ"LØró°¿G~”Űÿ8HÕmÔGÿXíª–söüÝÕ«·—Ë—W³åo'‹Àز<á™ð±G@»xo¥W~ùA˜göÅûw×W—¿ü0g§Í¾-ùT­å Ë^ªÓ›Ùßô†<Ïüœ-D¤W,ײ—gô"öƒ$¦-E¢a¥·CQ' î‹ñ$áljËë༪ÉÞ½yù+;Ü(úÕ)ÛÑJ.RŸçÓšÄ\ìYwÇ‚ ËïÔ†mÙ3²x`Ø€mŠaØÍ’<¡×õ«a®ßÖ{Vµ Nih<ü8d .4º8*ÓFýåÅÛ×OüVª¾d_ké3øI?°aÝm뻕¬)V’múÊ¢,´ï<ülÄùs1zŸû<˳ȾPبƒ…b] ›`ñ g½,V¬RìÆ¤dE­¿”ìôZ"ð•ÚëE€Édz „6ýy×ÕJö…ªðÓ)+×ÅFÉþf6gÅ@Û6ÕýZ±²kUa °`aW!à‡°FÒ–¡øl›Z¯3ŽXó”{_”ï—­±;mVÜV5Œdª#ð¨8ƒ·;`´ZpQ|þõ~ÛKÖmÛ0Èm òØGqI¦í²çÜu=+ðºWU¹­‹ž­»ÖS:0XaILKÀÓµ´Œ¬m»¾AŽ’qdÒ«ïnÛ–]A^ÌÎuYRQ´QÁù”Ø™d)çµ>G ,.:~Ãv³éz5Œph{Û®]ü¸¼Duª+»zÀwåšÂôb¹¼ÔÁᙩ©ÐOìÙ<9 $ZÀ½®ÑƶðDÛjñЇ£r? §”åÄÜO²4ŸÌ7%@¶p®Ó.Lr? ø@ó©þLŽÌóæbyõœ˜ãScD<Æ#/½ÅœñWŽu¶øà# öYG5‹¸'û=»-†ª´‘¦g_Šfœ‘AëNCD;»@)q0ì† ̃b61€®Ìºëð3Íõaìɧ–GÂÔO'›¢\W-Öìu6ûU× tüÑÂy^ÝÝ£(³õOȲå_?x&·¹î ¹ÎmüæYj³u4¡Ò²%t^×LÓ5³Š] ªÓ,Ä×…,ò| z¤·ð>Kv;’øyì>pgHÙ²²°ãŽˆÿ€>$d7qÁ-}jr ¨çŒÊS±±VlßmÁ?D£ø÷±] 5¿5«2iDü¯{V®Ç¨n2K¦f¶U:s"s\Æ¢ !ú´+Ñɺ°ìmOOý(ŠìÆí&rçOÕd³0rŸ¸Í\±+%›"vYu ÛýÖݲ]¥ÖDk•Ò}°]Õ“pžø!Ó ¶O­nµ¡ŸšVr?çQö$`}9*£@¹‹O"t½ vJ SêÇq|TÙø#ðá{5áSFêÎãÉ=»;DžO_XP¨F¨m¨¾h‡;Ù¾ÝU“Þ‚Ç©Ÿe£\ÕéuËŽm¦}ñÉXùÖoCGå¡ífÂÖÒ®ýÖYÐa:ÖÑŸàíæ°üÒÌåòd•%ˆ(qÍÏö_GD06É&¦üclû÷‹÷—³\€dÐTϯ¯µ|xT™HšÔeÌþÀO1ùyÄaÆD-i£'W9ô3Q $ôBഈ’Q h%µùž829‚ÀŤ¬4£ˆQß¿—JQýÁˆÀ^~ÚVÄ £Û ÓõGr(ò,#(>û…ŠÓ#åªFÐi‰9=²LÓ­í‘æO@(Œ4¹_M9§?q¼PÝYŸ%OFM¥oÔ,e“È.öÐZ¬¬+z\T,îCAž!+jšZÚŠ|„0Bþ:]ˆä t!´ŠÕ…p Û^GèõkÝCp騾«Á£:ö$ ©[[RÞUhŒ7ÞÄ͘ŬdiŒ°_É;3jEãÜØôÂÐH¡b[+ƒîãø¸£Ý)ÏDZFÂcbmXZ×Ⱥ³g$RÎæÖZ¼d»rñû6D Y1I³tJ#ȇͳ×lNL1¶Ã…Ò|N­Ð>ù¢ìÌc| \“ƒ²z.¬Èè#=)%“h!Û²[ÉAKéwkÈVS,1Ì+­àu$s®ô)zšƒîÒÊq‡‰ÎÇhPÐnIgèY Ò«ZYÿ”i€æì‡êžLdo–¯^ãOÒ3Þ}‡œQ`­Ÿ®¯o&IoŸr:>pF]_¾¹øé­ÏÞƒ•èÄȳ™£$ÒbÌšÍÎÔ³G~ÔrܲalØ0KýÄÁù»C™¬í-_è™Ëˆ`p^ŽIá¿ÂnOæ9µŽÿp2èð…ÙŒjiïÝòÅÇ^þtq½t”¼˜ZF“í$®]Û×ùyõÊŽN÷—½e‘™Áæÿ|j\ïíL¶è›±úxóýƨʪÁÜdð ?˜JóñÀfhäU;(ŒÎƵ0Mü8ËŽû(¨Ç÷#‰Ë±‘› ’Ô×7w$X`Ùûsv?ìEÐ7!çX ÆæíÍÿlœÕßO*¸ƒô@w>ÈaHÙ{ÖF3iâ¯ëÎdCJA ¿óÔá±;ÈC8c2(“ 8¶¢`]ßîÙÛ+K ¾BÓ\›k ¬hÜpkO 1º¾\¨“<žD>ÉÕú¦*t®5˜Ò Æ\_LM}(7üU™D¤ä5»9[ÇE¹…~$&]gï“dÿD H»¨šA;m®,»ÚV±êhVÓHrŒ‘ë»Ð,Çò¥6eÛgi'ý<ûF’y}qXˆIâ¸iE#tßmÛÕBõÕÆ¸Ÿ"©xøh€À(åÈ”ÍÜ×Ã;jϹH©=ëÛ›J—OÇñûÿA}”Øö†L_œW>xS®“–ŸÈð_/ YéųYhKâüúåó±ø‡Ó·÷cg² nÓ—‡Øg‰I°= gî'G¡üVY‚\˜p´X%`r ÈݾœYG¬N"GÎß¼?ƒ¸ùЬ½ñ,=Rîˆ&¨épØÈ²úZš\†2ÒÐ8ÑÜ/ø£tÐ¥.bo7Œ9áz&/±âš)”§ñw²´ù½‹«¡HiòC»Â„gGœ²aœì£Ž´(Fjê‹aˆícb™«Â‘Ü=€™êMQŽN~o¨£¹¤ª‹ÛÚ°C¥¯Võ ìÀNo¡bNI}ÑUP‹´V¦I²j1–´öêqAü•‰ãf™‡bB´0Õh±]áEÿ°Í˜ë 4†ÀÌαHƒ êæéá¨üºè™€7Ú Ç9ÿRzr±<ù~ýÚÇݺendstream endobj 40 0 obj 2736 endobj 44 0 obj <> stream xœÅXÛnÛH}×Wôú!¦ ¹ÍæE$3›Ì&2'Î: ‚Ùx´¨–Ä E*¼DÑ~C>zOu7/6ò°—‡E€aWW×åÔ©*}a.Ì¥?ößl?»º‹Ø¶™¹l;û2úÙ²=ûk ˜>¤›™¹#Xä±(ñyœ°t?"áI²ô8ûèù*ëêâ²íÚªÎeqïø÷sf¿Î/½Ðå®C]mk¹ßçå–ýðÊüéox8ÁÃ< émÉÒX‰gҋΫ4}ËÞÞ¾Kç"æ® ºô­K—Ç,Í&fãê¥ðXºž ǤÁù Øvž~&}ÙÌÃ¥ëÁ5ˆ¸Ü3"ªe{Y’Ç#­Ñ‹¸»L#眾 I¸ÂtªióªlX­Hö¸!I>£ÔV×îÇI؃zMQÙUÓ—}Ÿ/ý$6c;÷¢ˆ'‰ïT¹vÚøás?˜ø%Ú‘¦éâÕ°cÞîú¨³v§²qP5;Ò‹"‚5om‘'k©Êf1Ì åéA.ô®íò†e;yhIi^: þ2Ám¯Ï„kðÒåeVtkÅÔÐø&÷‡B5¬k( « ¶®óÍÜ œ`élT­Ê–}…(ÒùŽªìj3ú¯d;¸Øt‡CU· בò#’K)bð½n­Â³Z¡59ÙdàF:|Øâi¿ƒˆG¸³h‡€ÄÜK<ÑC*öôgÕ~­_I ù‹¢å¬Pøuúá…ñ@_z•¾¾a¹bBýySÕû¿èÀzG,ÄÕiåªáìƒI `ÈÀê0M_2W]ÍEty‘ó5G^$;TyIÙl+ýúZ¶’ÉrÍZU#”*ÈÁà¼e²(zÙZí«–Bت§¦>³P Œ.)0P©Ùé|vVʽz¶–e®Š'€åg•µÏHùÙOœåΡŸ”lNŸÕV‡öÞ¡ÿì`P¡ìùû»›Û·é'ÊÖË_¯o^¼[hƒïç?ÍÏÿÝËøgÁÎvm{xzuE^í€;Žü]=Fm¨ ÊÉT$ÙÕ… ŠÄKb] ÷2äË¾ŠŽrš†pà!çô'vq¥3,âˆ{}¸ÀU¡!¨w•ª¬ºínÁvÝîgöµ¤Ø©ê¼Óñ×õ?u‘èÒ§¯? RKu+ÁÂ{Ùæ—c¼ ¤2äôÄhÈvÊ”…ñ’ ¬™‡òRŸt„аZ«/D‡|ˆÌØÂ»ýcÁšŠ ëùF›}œ ב¨ðM«¼”õÉ@N…,p…ôæ5ì ;í½}^§e{™Î#Ý•çtPOÙNÉ5à Ž€F¡u‡á@ôÜÏ(˜„í‰l/úçé¬Qª¾ÅˆÐd TÛÂq¾ª ¥{#SÒ+B±YiSW{¶R$¹2Q\ö.Tyï iVåXk8ü¾íjŪ®µŒôOE±3øð<î£Q MÎw B4jJÅŽ` Ñ|X°V‘‹‰7½ÇÙ;Õ¶º éÀE·lJè]W¥¢ÃÄ&’[Uª:Ïl2O†w-E<žPÍbfwÓjÒÅàLÜå…Ã6ØYuH£îDþÇr°PÓÑN• ÊÆÒ¤î†’5Þ´€ËedÚiÏ@ˆz—ž©˜}åª}öæýÍæò«ëÙDô“<T¹¾ïA# JÔµ4[¥Û ýÿ[{õm_h*{’ÓsÅò €óÿž÷Œ¦C[? -¼Ó×ËãôWźùß_þõï× æù7Ÿ¥ÜèöéÌJÔÁ¡2ùŸ?LÿÕõ//®ï½–ÿKG–v&ÙÔJ}{±/ÒwㆠðŒ2ª« å b3-}Øå…šN$Q‘Æ&¹ªQ”èYÇ5º–F¸Šešâc=U†Á̱o¸ŠÕ©Çñ†¦r/½Rk žsägLñ퉒KS@&1†€áAD“ùŒæMiZ’´S²ˆb.¼Äˆ3uŸp,Õ¯š»! Ê¥£l†e" ‚~ž9­GóHÄ璘ª<p §e˜v=÷Ýclvªý„„–|¹ŒGú¶ëMW 3dÝ2B‘n œ½þÁWnMÄØÖÕºËÔšIx ºoõL<×½ÉÁ}Ÿ3I.Ír“uÅ"„{êNM¾B .dMîó"²y%Á¥ÜÏ„xQ£'Üu•u{p,²­úîås/#vït\0øèùq|?ç,µAG5ÑÀÛ§óy'„­ï‰Xr»ÚÀÈ ‡Éj÷c˜V*“42Ø„ ʉÂ>:[Ô&\wIC§p ë£+@Ç Åèk5R êU2Û1û„éÔ P(]™k¾1Ýíº³QG;îÄr·/¸Ò–#›è84Ç1ušQuX3Ãó€Àïht”SÓH&K áfL2µ–Z!¶ú–!ši8zԌ㙩{<ö†)…nrÜÃR­—++8àÆuÍ:¡«Í.@l­š¬ÎW„ÆUeWÓ~ŽÁL¾LÌ1>IÉ£Y†:ö„b×C³nMÏ¥®oÚ\Õë~T3g4®­æÂB‡Ú;B1øÓºQÅÆÄ©6Læy±ï÷@ÇhfŒ6“Ö¸ l‚z‚‘¾é³Ôø£wXÈÚ¼AÉÛ‘ücr+±?F@µÓ^ Feä úJ®êé{ wG]“QÄÂQÀ‰ÙÖí”EÞ» ¦!/p¹¡¯WwH›ùmCOB½€n:M¹^›ŸQ´q’<üAdIì6´0þ~JœK1ìñvŒÂV°éʬÕ{)%ÚMÁÙÏt¬eÌc°ÕÃýžŒÁJsnžÏ1ëõS#´~[¹¤Wc€àÜU¨Y}× ëÜ âé¶¾©ŠÂLB8GRc;aßiÀyG»®‡Ab~§‰ôænsßLÀ üÞoz-1æ›.ÛNÚlk=×¥z(ˆ~è˜Ø!¢¹®“ÅÀ ‹q(•ì;éK†œ-óAøhyï¯ëÛÝ¡¨äº™„ )·¼_ë4ÂÒÚªcyA#¬©~,ZÈAôü1’žÈ‚=!™Ž}ý²±ù£CSØËۻןžß¾ýýÍŒ÷ËkŒz—?[hGÊ<¿}“^¿I1Ÿž™UÿÌŒrZàúÍ 3»]Fˆ ¥½¹ËiM³@Ó 8Ñc÷Äè¡ ôi€A¦ÿ%+¦/×éìoøó/‰wendstream endobj 45 0 obj 2389 endobj 49 0 obj <> stream xœÅWÛ’Û6}×W óPS†àÞÊCÖ–“IÍ-3ÊCʳ5…!!‰6EÊ$dYù†ýèín$5¶S[•­Úš »Ñ}úôÁGærÁ\üë>³íäâ>fëvâ²õäãDÐ"ë>²-ûç6$øÃr51g‹=§>OR¶ÜN„Hyš„ly˜¼sÊâ9Û7å\ïuݲ|tüÇ)ë~νÐå®]S¯¹ÝÕš}õÈô_Ë_'~ÂC6÷#¶Ì!<°ïàÆ§UÝlež?:ßïêVÏØ÷¥„éòýÄ÷ð€ððÀ;çõï÷Wooﯟ^ßÞýq3õCç§ëÅŒó÷*Óg3r‚»¯&§›_ßÞ,7ËØŒÏf¬_^ܼyœþcúÃd>vö¿ ¬¬×µ>îÔ¼ØÊµêâv¿½¼Zt‘´¸Ì ü˜»T£˜¡3O¹›¸nÒ-`x|W­¿r80QÂ#ͽ€v_œ³¥™Þ(†WbEµªÙùn5U²=>µJ×;ýèà—¬òRã·w˧_–Ë»»Û‡Qœ ÄëãÜõqÒð7Ș Çóh¯ gp¹S 4ö gÄ‹ g’N#´ÑpòÈ:<ÈÁ¡àaäzÝÂñ»îbsǼOÁ;ÌÁªQŠ’@Æs©%“ëi`„ïȢ£T¢¾úxäÑÙuwPÝMˆKø„âë}©‹l4¥w·L6Še0Ú²zÅp±eûûãúòz1oõ±T¬U° ¡M`•³’¹jZÎ.5Û* GõFj¦d¶au¥ÀÝšûAL~á.moDuNÖPiÉVŠJ•àNÌ‘à?›¼Í¼»QÜ% '¦íM `Z›rÕfMñlÒWTy1õà¤"çS‘ïeɲºÒªÒs„ûŒµÅŸŠ)q¶¤„b ¡ø" l±j5âq/‰Ón¡’Ïc½o¨”~’Bøžm8ÁýÄ£ÈÝ®,2©‹ºbºfˆ "kä £.Ú¾LY ™‹"žÚ>Ñp_"L›y àÁƱŒx¹]€0™ª¸oGyL–e=õQnèZ¼ÆÕî!Î#݇Ք97MœCEùtdûV×[ÊÔ\¤¬XØ»ºÜ‹cã©C‡1ˆÕ¨‰o+AŽPàì©pËÁÄ‘Á~ôA hLH#›²e[YuåŠcÂ&zÜwãrá×ôáNšë–Åð 7 R2óLcÁÝ8½¦r(¯/ªk.Iu+ ­¡þj* •©;Ÿåv?вdí¦î‚4ÅtCnÜ! 홵€Ç"M-ºi¤9õ‡{¤<ˆúf}Oee[¯Ý©¬øwF‰e‡ªè²0LÀ®žX ½2$äÇ<=óµºÙgš½´e›Ï;??Þü~uEl¹<Jýãhë€]U0ŒºE˜/¯»¦[N×t#tß+¦!q]w~ÖŸ·å’å, ÙøWÃ퇿3Û^ÎÞ¿;á0öY—Ȉ‹,ã¨Èú/‹ŸÞ,îg¶jtÆùæŒÿÿÍ¡oLf§¹OfSz\{ré‹?>cØ£»:3¨ºx1«€þS¢v硨2…DÅ`ØoÂxªJ†›Óè:ku‘}À8Dñ Œ,ñ‰ÔÌž#H€¼!Ï(%º€ÂúÐN6͘.\¯£ GmqÔb»´r«Ø¾ÒE‰£²Z«ü%SûÔ |AÕ·ª~çTÅÔR»±³:ɵçóÐõmLгy TX–hêâÜ%<÷Sp%§ð(cá”ÇS nÑIÌã¡ô³½¸ÜFOÿuü²•GV)¸-Ò†‚RÐð€/ëš=ËìÑ1Û•˜§ŸKÖ¨{e-VÄ:v=Ήœ(eiÂ=áŽfdwÞs€¬9œ˜¦4æÂw…-p6N¸6bå§QbtÏÇNØ`IÇ‚Mh›Z¼W&—ƒœÿ•í¬÷r†‰o+ ¾”£Wƒxì".I–øÚ™_ãU¬#Ô¼o/Woð¶gg¬n2µEçU­Ïtß®W«Z1¯Ñ†d¤˜ ²~êc4 ƒÐO,dùåÔ÷ÆiìèòD×pNa  Ó€'ãÒy1oå‡Q"üh äPà8w#0 ÃÔr-„ Ò›z\WŒE>¤ªßvÌÇ m»e4J€äw¦©Rh ꑾD"3í„'&¢˜ß(ÌÓ]3 PÖðƒrŠ}Gµ­C–†VƒÇ£…ÑÛÚDš¸‘í5Ñ7a³³ðÃ^ø¸r< ÏS ’Þº‘y°„ï @ˆquh! R†ØÞ°É ˜]ÓÔû¢ÔsèVzCø ß51i^ œ[Èp¶¦'¾EÝ *Hˆ\xÉ !„U%Eù`…Û ö+÷/¼•ipøà²ä£Y! CØä½“R95ñ|4Ïaž >8Nlgõ˜ÏÀœgÁ•ç !UUï×›Ù­ss{w?õQ~ºžsûóýâzèOÕÔð,@™gx€]±ˆÍÀ})é R34“«Õ4µÏ5xsñS” "@¾¦_ÄHÊ܇Ñakãö=XÙèAѲ ]<á1¼L/”ûødƒ/æÌ1apssŒÍÀ³ÂCI¬Ö¸y(êÒð[à*ðA©Jüñt@¬ÁsSƒÀ5œ°›jR´4«Mš}Ÿ»a8 Œ‘SÏï#53ªÝÕq 5œ™ÈúX;ÅVû*£âíjòCsi'[Ò˶mˆ#æ> stream xœmXÛrÓJ}÷Wtå%2ØZw1OLÎpH&˜â¦(Yj'šÈj£ ‰Ï©ù>zÖäP©ÄI«µ{_Ö^kw¾3Ÿ æÓ—ý,÷‹×)»é>»Y|_ýÙrÏþ¾Á†Œ6»…yG°4`iò,g›ýBˆœçYÌ6÷‹/^So˱kÖÃ8¨®.š¯^øuÉìêrÄ>÷Eì:uÓû}ÝÞ°_¾²üÏæ·E˜°5¾7œÓÖ뮓Kñ<RïflŠŽÕí »ËÀ.MÏîëáë;Õí‹¡V-+¶jØp+êd‹ß»¢íw²[Æùy\Dló~áó”Žó>Jó’vVö=+‹¦ÙåÛÙØ“ß_^m¾]]/Ïó(A‚Èažä¹¶rùÏë×?¾ùôábóîòg¯ÚŠ X+ØAiïÙ ðÇnlKòv¹ùïbmM­E0Eï ·ÅÀQy+{øU÷䨠†ãA¾¤—³5EPQ¦¤óû›óû«‡Dé䞪+ö¬ljdã°ÒÁDZ;ϫԸm$«˜/šY§'ïgOZ…ˆ×…/QʃØDîÝëý>-¯Íú³ãÌìæÙ—Ó2l±wÿuù7íÐ:NO!ù<: ïv¬hM¼© CDÆ“ÄÌé_¼#Œ¤>ªy»AÛÑ®‚Ç¡/Ü.”µn@EÑ-EJ»jlô ™Û;rÆ‚ê¾]¡@>€Õ4l+uùdÅÙV~v½1’Ù÷W3ç6µçdMƒÈÔÚ¡ýr¸<¯/y>d¶) –g( sã’AÕ?Œ9Á…ÎDà‡LºbáÒåñf*VÊÓÌ÷3‹_ÛpÖ‹¥ð=Õž›&1v¢„ÛlzÃ0ɸŸøÂ6§Æ8pzüâ:‹ð<&"Y‡Àa˜ T7ã™Þû8âçÏÍ;Žy©¨±³­Q! iÀÃéµ?i)>…öâ«Ê ¦¥n$ܺ,À§™ÔË,{öÂ’ÔdìÆ>²òø™æ4‹ú/ÞQ÷ý$óÔC-{môW¸÷y”[‘ýLþÞŽg(<¤Œe©ºÊúwÙAH÷ëÏË îûièÉ-ÐÛ½dgÙõ¤‰ãp ¹ýCVZ~ÊA/Á¬ vglk8‹y戈4£m6½bgØ«cvû\ÜÅlK[/#AÈ)¢¶„ÎÔvŽ+¶;õkÀ“Ì´¥ æƒkj§ù˜€ù³”Ô‡«$(üˆzéRÕ~D°5¦ ù($nûžN¢"@y椫NgL.™1è ‡RJJ*£Tû=ÒS=àØsv¡ö‡¢¥·Ôn!fÙM²ù‚½#äµ$P i¨]¢•v&Â9AhÁz”Ò4­]µ¹„‹a`|n;5ÞhÖ©;yÌÙ9œR¡UwÇŒôô”´±‡äèù,Ƚ5•EgéÎÍ5G£J•FûV³•Òs†4ý¯åß "HõX4¬“ßGIâ²4!XƮկí9Dv Š„ÎóDòýx8¨¾|¼¼ø×Gmâífsu ê3,ØMm¦ a@<óQü†@s²MmÌX¤ýtVÌE˜Zèy×ïI‘ïéiðÈó Ý lhuY­f ÑÿkÊêÁ jiΓ0}<©Í´b莶)KÕ¶m†_É’Mâ­Bë ¹¯¢k0½çn:¼*:_Æ–‰P£J…MžöéÏB'RÇ«ã)þ$˘#ì§.¨Ä…JoçÊ*(Ꮁ‡ï3KH¶ëUo„¸Š‚¦À1zò& ÌÚ!`*å:H2ž‡“4½Ñüò0ÉíÑiHéÞžNÆ„#rÇŽËæQ‡€:ÒøQ„Üâ¿öG÷xPŠã)¥qÙ.¿› ¢4ì"k&¶ÞÜŸÝ¥š£;&ÒÖ@‹½b&Êyùn.ð(Ÿ‡Cƒ¡L_Ñ”•Vš iüžë‡ˆÅ™ÓÌ:yÏÙ;vš$×pjõY(Gv†Î̱FãSáü02 Úʲc2ÂJ½ûÑ4¦šØôžì€=áœæ¸9¶ät(\'=A¿¡ùåÄ'{RŸ8Œ~QŸâí<*?žú„rÕÃD†I7ÇYd¹•}S,ÊøÆÜŸ’ §t¹gÕzu3èõ<0Mà¾âj[불EO—áíæê',.#W»À8åÝI6ã&ÜÁÂÀm™üÆôÆèRˆôîa¸À÷ƒÚ³7H)2¯uN>N´ˆC@$xšhÍ¡8̹[&Ò¡:ꃪºq«îh’ "³Óu¤©Ñ³íM¯ùÍÌuN(¯t™.f ×mª¥*LNH¢wnÐæsÁЧ›‹±$+ÇÒ;©E¡Žtrήä$²':ù ˜LmK4ÞŽtxi4.Dbà2®ãúŸ1" “Gzé#0ÈŠtîöïEÇßÏõS\+27쟖^oÿÆ×ÿPÃ$vendstream endobj 55 0 obj 2230 endobj 59 0 obj <> stream xœ½YÛrÛÈ}×WLéE KœÅýâ¼$ëxk½ñ®‹›Jr¹FàDD\—ùtN÷Ì ½—<¤R¾H"3}9}úôègáË@øôÇ~-w_½Ïĺ»ðÅúâç‹€ û¥Ü‰¯XÓ‹Õ…y'Y(²"’y!»‹ (d‘'bq¼¸÷¶Õcyh·óþÐ7m¥¶^ô0öÓÙ ÿå4ß4]/Ëf÷2÷sÿòaö'Þ4 "YbÆl°Œ’Œ·»mvZЋ•îD«>T­‡N·Bú®ûªT}ÕÔâQ¯:½W­ê5lq S9°“2#$˜Ñ1‚üfDƒë*«±d-š3DGtdB{ 2uŒ‹,$Ìo‘F·žÕ„ß‚ã‹3Óum„È­¥¸Z a"ó‡ ˜8 Çw-_Ù¨|šÇ€Ý_Ö3ª‰$=’íà¬X8Ô˜6“¡Q nGcQÈI:x~êF*››z@sŒASÞ»÷pŠ9rY­ ’Â[é–ðüE1 %Y4Vdà\Maæ»a'ZkwL±5úÈ¢g)Ù3bš·Èwpx/î½…ÁÉÑ!ósɳ¶DÙÔ=žÀ¦MsØ.éÛÉü™”Ï˯¾úp?hùypMIW’AˆÞí ÈÈHŽvùç;UnªZß¿¤&ýá’Ê ¾ºì¹“ ÄZny6VÕº†¬[ŠŠ¢îÈ™¯k–³ÏF•Úƒm¶PVò“¸¬H"×Λn¬^ä; 9U„Q›žMýò üT¦a8¢W¨Á ±ðBîl1 ×¶ÇZKÂŒæôÃéÇ©\sG#ÄÉ5õÛSaæ*UƶOMaoAQÂR¼“èÓÙ ÉãÐÂØ® O.Μ-ª«¯Œò*h1e  ¡ï» ?'Eî'.'vºª‹¥þT³(ÙV«¯Œ,SŠ­dˆPd,@æH…,²hè j?MT^DÎ"1Äp•í+Abúoal{ˆááØX¼ºŸ’xÅãî±Á‹ñ ,eÐÀ./Åœ¤ŸÞí{¿oÉùï6!qÊqõàÝÉÁ}¶Ä§i=5:Þ»½}ˮߘfʨš¨õ"ŠÍ=Ã-‹) T§oD¨;ÏûfÎßPìuIÍ•/ÖVµ“El.N BgÒs3©9÷á–ë;Cyc€p5ØQ0C×e{âîcf]wÅ€¦¹î® ½G‘L’|Òã̸nzZ9—È|œLWdòY•ÑH0ÎGÏÓÙtZb ^buˆ8Ò7Ãi6Ýí›®«§Fº‚ÕvARâJ\îúŠ.iú£Öõ¥í¢NYØvZIVD3dEjî`”©Ý„—4uÖ……U Å[¦Š(]SÔsÕ:S\å¡#E%ÞÔ(ve2_iÇ9˜]Ù¨Aó¢ŠS(GwdbŽD(ÅíhZeœ_˜”™&뇑״O¢9ß:žÞÇ $˜Ù—jÕ·Ãq!]¿¹v˜G 7Óy.Ÿfź’Â4Ò]gó­$‰@õgÐɧ€“„´'Æ.×xƒyåQóøGXÁA¬û0ói¹¤¶FDàð@W˜5¬á÷^ßªÕ ˜?•FMí¾ÛëÚN–TÆc¥ ’¥£ùh0q’~ÛÂÿ•óYl³j†Ëމ{4t žÙº§sŽåÆ­µÇcù&…(@UëÍ”eÌÝ"B¥ÚÐäûaá­Á¹|ýF1HIֆޓ õÔr §$ìu§ ›Qì¯ÞýðÃëW FÝÅgšA>xCrŒean¿Üo5$ŽØµbPàvŸ4ÿ …z]NPGc„ŸÂ4–­ÞÑpNþ¡ãZ¹‘ærlM7rñk]*šˆí¨U«ž›B õð­áq:c ðA݈j©ÕùmÛRõÊ^¹Y¸éŠæšA 3–û)>ÏÔ̵ùá±Õê ¤Þìô8 Ò=¸žnmEuFWƒî™Î§1ßǚϗÜ;ЧxSu¯ÖÚJ³’N[µÍξ.Œc€L-g›ö¯ÆœE’îYIfóøéP~=UŒsgݤ–<Ê­9G ‚Â1÷½ªÏörƒU§Æñ‰‘©f?›#Ñ–6Öb jhô£#uõoN°!÷)G‘Þ£öÛ$•šÎI÷Ü”5“J.`´0*pH⮯æ¶ÿÒ}ZðÙ|U›_@L&4ÎJ-â8‚€4­ÎÐ…½d5#•æíô5B=wƒ &a´äëP{?ä.có „6›å÷P ¡ïæ† ²Ãe-è£×‹‹¿ãÏL~häendstream endobj 60 0 obj 2931 endobj 64 0 obj <> stream xœYÛrÛF}çWLüpKœ`p‡óäuœŠ½Nì•™ÚMI[©!8"‚‹dí7ä£÷ô\PRÖ)Û¥ L÷tŸ>}ºý;ó¹`>ý±?‹Óê›Ë”ú•Ï«ßWBÉìâÄþ¾Å}°½Y™wK–æ!Ïr¶=­„ÈyžÅl{¿ºòªrWŒ]µÆ¡éJY]{áõšÙO×› ö¹/b¯íšC'O§²>°g_Yÿgûnµñy„s‹U˜° þm÷+o;®·¿ÁY|*|ž$~ð…Oö½ºV¹=vÍx8²]óù^b†yÆ6"ÐOó8ÆãW=SksßO„÷¹­dY«=“»Æ¹ ´ ©ÏƒØÚòîrŸ)V9²<‹ì—ÃäaÆÃH8½ÑyWö¬S¿eC7MÇ>}zφ†ÝÓ{"L¹ˆ{)¸©ïÕt·LÖ{ÖÜ ªfÚúäY"xóO\{êYÝͱ<œ_RýЕÅwàÆpT¬iU'7ÚLè§|9íÏP65+k8³Ÿïð-ûa»ýø‰ëxGlû~µýÛ•·=âºø{lÖAìÝ«ó°É!ã|Àã§¾wõ2ïYè óÅ•× Æåºz`CyR¬¥¤N.ܧòp:ØG–ÓлQÛ©Zý1ôtá‡fd¸~tL¶mU’îǧH|JÖ6t%JI’ë7³ Ä«î™d{ä´XÑà‹Bé¦kNOŽvaîÔ©;ÉâÔ]°r`ý¸ß+\Ec!  ¡Æª'«¾Á;¾köc¡z}ŠÜ•U9<Сû†ÕM½¡<˜’µž5ë¯çaÆcñ/á3PîäSÔÁ}Wä’öˆì´®Æèz2 y4c‹ÿ²]OiY! Dìf Éý ô$b7ö"!¾Ý•7 J‡!*ŽLöì{Ûª‘{JýVŒý€pÍé„j¡èx÷kÍOaìɇu ¼<“Ü¥¯kŽÀ\˜7ñ×\Û=‚mŽ`d‚6†þ“ø]y5ÕÔîÁ¤iº+Qiƒ§z8 µ¥O”:d¦ƒxï¤i&|¡ïg_ˆª(2xí‹®l Gr0?×h™H]|þ.I,¸p×5ôXñÄOg{¼÷À¡ ‹ÒJ úï‚G4¤ëvDiwj»š~RNºt 7%Øcjh9©íÍdÚ m 5p4‹¸Ð›e qtåÝëH¤ô†×‹òOÁS0ß5v¸Ê!B•õRí—nZ>Ú)öâ»·—o^o_Ç?ØŸj9²á¸öî%êà¤$®[7¶Üúc3V{:ô¾¿^_°çì*2ôáäœ^žGÙ3{œ‹ æ"™®ÞôÃ˶é† ]M¡l—A¤VjÒ¥‰v"S¯ýÇ]œ [·×VvCYŒ•ìtjËØÅw/>}xýOÈɹm+­žµŽ¯%3¯ió×ëe‡Z±rÅÑÏQê@šˆâeR²šü@öÕ²Vj‰/qM5›¾“6þæÝZ1¿ôª­.¢Áá8jÆÞ7ª¯¿¶’*Öš*Oyœ¹úeƒg¹Î=¶0Ç&7ší¦CÇ'ý,$y ÿ~m‹ô½68oÙÁ$I&é|å]ªM±¦σÔ{(*§»52iÔbfÖbý£GD˜¾<¥v²Ò›;¿ì½5«¡$Y¦ÇáY¥ëq]_ãÐØˆQ¯ÌfÝë'?¯0B£«JH’®†Í¾¹„‡æº)ñôäåŠY&xžÌsB’h_誛Å.‰ Ó¾Ã^ÿ+¦×s2Û¤Z ó F;ÇòÔÒNF‚ÿ†¥¤òÞÜ¡©*æ,}3/Àjyó8ΰ²ïš¶Uû Úp,¾" ïHĈÌÕbjÍr¿1™²ËÛꎂf÷§ç1’‡uäö>´ÑÑP0[?½”³¢"N§ä8…øõ‚p¨ÔçuV¿ K8œÏ‹(fºìÛï0ÞGÓÖpoP˜é\¤;”ô*>n'zÈï|±ÛHRT½ÞZÄLŸ,!Ðôr@øN06I3+E ð³® ?ËÜ>éú€KÆŽÉ7¦wjòwÌî EšÙçRb|Y-ƒ3ͳC íaõuõvÂ`D/ë6Ißâf œfÄïzD¯oØß–7F{¤šÔb‘Ÿ¹å(ªO/HI±î§ŸC³×Liyâ´øÐ-0Íú+¯D`U»ª)n'勾G#i3è®Ý©4‰êHÔ„63½­1ŠÀZÂ`^·^yªY£Ip?^}Z “2‡yY;߃§réáû¥´Ë&)I‘LU*z•£[†xŠÖ´SÖü§‚þG%ãd´N±BÙñf¤ñ/2Hðþ£Z&5K"@ÎETôÑ›íêŸøó?Rõ:%endstream endobj 65 0 obj 2905 endobj 69 0 obj <> stream xœ¥XÙ’ÛÆ}çWtñE kØFcGòdKtäÄÒÈ#ª—&¥‰& ËŒèoðGçÜ^p$¿$¥R I4ºïrî¹çöïÌ傹ôÏüÝW‹oïbvì.;.~_õ™?ûŠ}¿Å‚„~ØúÁbũϓ”m«…)O“mŸ²Øí‡¶\÷Cß´EVÞ;þýŠ™_Wk/t¹+BçÜ6Ç6«ª¢>²¯¾²úÏöŸ ?bküßæ0Níž•e³òBç‰Þ{Ëβ횺c}Ãv’•Íñ(sVÔ,ëY’¬Ë*Éú¢’\íælûÓÂZÈöÙþ$;öêí{VÓÂVvMùHãÓPöÝ í[e« ýýÂs=…ˆ,rd¹ÚþF†í)EšzúÁG§i†sÇšËØ¹•+/àx;E3tå†6+Ä,u=ßÅÃY[áIÏ㣬ëe» õÕÑN¬=áq?fkòVÜÂÑ>c¥ìz²>—}V”Ê a(*Dšì\#áÊá§< ´©.÷)®Î£dçÑñ8I³B=—í¡i«¬ÞK†¬vü}uPáo×wˆÓ…ee§‘å¹Î%á0ôC‹ "Œxä[Ûqz t^7È“Ywa§¬ÎKÉžŠ²D{Y{JÃÃJp‚È‘ò¬ö-v:³ðH(ÛÓÇ~j2ô´Ÿœ xè “!§©k¹ï ‚NVWá CžzBØøDÚBŠÐaÚ,äAä¦c ÍD&cO§æÃ÷}ÖI2”ÞíK"î…¡ÙݹdÓ–÷»¥ÓJé¡“¹2ÏOÈÀ„­á­ÈŽôsÊ}dÊ$Sp/JL™5g¿®„ŠYâ4¬©Y'MYHg*:¶Te°DÀû“zúòÃÝO·ï¶ŸÞ|÷ï—·oßn^nß³æLÁâ앜%°Ahpim1º<‰mÍ•´ôq…ȹ®P˜SæMŲZ—:÷i=j)å^!šáR-±@^…€9ì•7**T¤á˜ž$Ò ÏÊAÞà8 óÀ.ˆ Þ¨(×{Ê­æÐËšý6d*KkÏ àhôOûVF[Íú6AjP±H¸¯ò £3ð8Ž•5Û€za<‹¹/bϦQè%à‘K[0ľ©45©z#xÔà àÄ­Ìò “:Àiâ|.4ìG¨³{ž©º’Ö& yßK¹ëÙÀ>*Äú<ŠMmÞ1§ÞÏÓ!D2Ù¬ ç” ,jjÉþlaeqÐàSè¸Ð@uz…ŒSv>Ë‘ÅéåçE)ܘ‡cMæmÔd¯«+ŠSä±Û"júÉV¼XFO·âÔÀT„ù­=¤˜ÖêtÁÌl× *ð ÚNÖ“¥÷«…$ª®¼ÑŒ»#d÷*ø(¥õˆ‘Nþ{n¤vU…öÃÝæýëO¦ÖhÁÙÈ)ê´*Ê t{.Ú¢ŸNR4 Þ¹ªØ¯\–ü¸$èÜŸ —gm3 ¨ÎM×;4¤£$&_Û°ì@€¦}ív×i›oï¾ÿñÕ§»Í‡÷m2°üí] ™ÀÓ”õíµ—ì‘‹×Ûí;öEÃfèljE œ†ÍD‡é—J‘¼'¸ÛöSrµ±mB7¨]•D p“db€Pƒ³dç¬#Îo¨NáU[HÕ§OÆ´ %]ì!4.ºüHC0Ixà…¶ÅóW¾¡§¤N_©rR@ó¨(R‹ÀâxBôT=­%åûÖ9AÖ±irÕU%¡ÓÕª_ÙĪ—0NlKËæ}¢BÿNÛîG^‘_8ÓSŠ‘ÇNN½À¶‚VžË ä‚c[Y5×|โ@¨ÚÙçî³r)k,µñt”TE™:ͦr*ߣƚ^ѧÆ?¥ðõæ»W›;ÛgTQ+è@®½Fu\~d©Æõt6·DÖ:qDØ‚¢ÕÈR¨))”Ëk*‰ÁEá3® ½à+\WÍCí»£¬@Çúë·.bΡç'“ݦr—gš¡8 x0´;5C™SéRä”"T}ÅеçÅð!~Ö€ôNºá`'öí­#ôYù€¿œ©hõ¾rÙ©ÎMÛ³z¨v¿õaePì;êeG¶[ia8཭Ÿ¶E×7-m^àïö{yîWk ÁY~óí7K½ÊÙ|>£ÿ\%0@Œe7tÔ»Û÷ÛYÛítº)›<ã¥pÝ5Úøh€nÁ/Y÷ u …‚2¦\ØÊ<4V™ÎÝÚ.1±< Lr–·ÿZ²Jv]v”HÞ‘¤ ¢÷RæÖI¬s‹ð<ë¡ò3ÄR'‹Xµƒë/äØ*vIåÓB“o¿X«@ÈJsäRVX¸ì*ÐÏr ƒjÚ¶ÝÏ¡G :Ö×ü =1ñïKèôˆ?Èè[Õ¾Hüþ5óz¡ojÌH7p8³ÑóÅUAjñL=¸_Ômi"\6çJ*tæ˜žÔ …™j@}@°ûfß`†ÉðMÃ0 …3œÃZF8å³o³º#$P pWìz“'a”ÎØ"ÛïÈ æî8ã`‘!O5¡!íµüÈÃjuùÏz@Sê¾ÙʲÈvåd¨™µ¹D?ÍA¯šXH‹]Ìktº4s-çZNÿ¼—¥&I¯\kL§¤`á¤Ï—u7œµ¯Djš…íIðe“$¥áØÍÂycøðÅ5†¡÷ŒÝäk|ø4€&>$BÃþ¶ž5•B窽Χ}2‘†Åå }„¾9ˆæ:ÁQÊ\ó!2Û¬ÔY¹§ë|hZÕóSÏ·M+0Qáœß¯pTpÛ™!”«QŒFÑ8±¸ýµÑžÚs!æ}|¸ê^4ÉÃ41 žbÆæ'š”7ˆafŽÐ[‰£5 €ƒhb3M¥%詵‹ ÈÎzDÜXð4Ý_nj68@多Rb¶y½¼üB»NS‘:·oî6?+Ãh<ù°Á#{Ïb™ÐÕ‘©ág6¡B÷ý`ÃoÕáóö ÛíÉÅ>úLOÍ|ôbýÑisUHTPÆÐ©£%>˜q1 Í´`µ'^AÔãBæ?6[Ó·õÔƒü×ÎÍëyÛö¢1÷&`hxxwÖ3ÜT‡J5/ØL ­Ôœ¬›áx²¢îfTÍ*Tº‰‘käsB–EPh£É”ÚUÏHf/ô•žÙ9WÐ6bŒv{17>ÕÁ…`’8—êNäð7=3…öæ£CpúD·/ŸÐp¡Áîú¢obžYO@Jü`$JÍ${O†âch—³–à&îÈ{o~5øðC“±drÿö—+õ5>øè¼¥“-·ÒÉËûÕßDÔôxÁ$Âp"ÇI•îU;´6“ÕD5_‡¶ç º¼ù?ÀMØ6"ÁT’=‰  ^‡Ö¬2{ö(# éZcR> stream xœXmoãÆþ®_±ð—£æ—ïtÎʼnS8—ô¢ì ȕȚäê¸Ëó©¿¡?º3ûBJŽ‹ ãÎ2w¹3óÌ3ÏÌê (#þØßU¿z÷1#{¹ È~õiÅô"±¿ªž|· 9>ØìVæF²dEDó‚lúc-ò„lžW÷^×n«iì|5)1¶e÷àEkbŸ®ý0 hÀï0ŠýXö};ìÉ«¯¬ÿ±ùë*J‰ÿ658§{?‹ºÝÉ-/k>ÊõæŸz q‡w»Ùüêwí>i–1²©VQN³¼ÈÁiܸà iÈ‚Â,4„ˆ´ÿ£P¢$‡RJRÉÇ–K"v¤1V‰D5>¯YÑÄ©ÇGòÜðÔÂ呚¸T—¤jrÓ›u (AèœìFÎu€~Âh¹ „ ŒõÁÄ’èH .‘Ë%F‹È-Ü{½˜…þò5‹Áb˜y_ÔX.î7¥B‡àC;<‘+J®ëÝv;ZÜÿñR¯Œ›1ÀñÃX›—jœ*E0m²k¥"oíÛß~øýîîòî-i‡V!XøÏlûƒU ν}§ã‚£îV›·÷ž3üíÉåáÀ‡úÁ-^’‹[>ã}ô_À¿WAy~cváçãi„ÀbFŒ†‰…ðù˜²4í$ðùËÅÃúÜ1'4f3ϾÒÛ¿û²íº£_‰AñA]‘#—îHàÑÓH4|¯j’Jô¤‡æTRoVh÷nåik˜“GÉ•8¨ÿh€_¿$ïÿx÷˯›G¬‚Û›ëïo>^ºSÐè ÷É)>îÄØŸ;1s@—Aî€ÓRãƒw+²÷±ìº9Zû>×Ü7M`úmñ·Ü hšåšæ”R]íî„RôÑÀsZ@nÀÒ‘ìùÀÇRñšÌË©jH)ÉuUñà+Fr+$|¨ÅðFkeh J'ƒbO]é¨jÉ{@çÊñÄàëtGyHÓ4=+É{O•í ªKUjŸ×,ðÎð´G¢c¦a×¥^­Ê4àЕ7¶G"¡ HŸ²2™¢®¼¾’b.òk@Gù@yÇ/˘¯­+Z? {^Óþ ];ð C€C;–Ó\»ö=ï¸â¯K0£q¸~29u¶,ãÂûn,zCž[Õ1póa08B@Òù UD£ÕKh[F ƒœ¦…•oï3ŸSjT26 èP¬¹fÒäLîFÑ›\³ ZW1çš&QlØrtQ‚”ü`„&<àX;H± JÎòöY{Æ¢šHìúIi ?0$È<àÙÇPд‹$Oiü¯@œÿ.å§‘Å×K#X si7Gʺ•嶃âRðJ€Þ3Û®Mokå•ë;ÿ!å<+ûTûñ£†è5 @…xvø—«øYe#¦®†±ª-Eªr仩CžÈ¶FYhÅàú¬Å -¯–ÈcxVÔòW£ÉY˜»d_ÉçVt =:¨¯C3%œ6})¨Ž¹iGÍ%sïÝ ´:Úª™†§5 G¨™“Ú5+L¯öù½ódð*™ðN=i“xZºQƒL’Kí£í$–"Í8¤´Z«¸„~ïù7ÖþÕ‰³A³§á–¦C˜jX±P æ®ÂÈé7ƒ—8Ø,]ºaÏ”µ„|‚ˆ‹³‚`EB£8>«ˆj«øSUÀ´¦ÖPšÚ#Nˆ5‹®›0ôÀA£Eî1žéЉ²¾$ç™D  YñÒüµª‰\|ƒÛŠªÌÌ‘Zs¼9qPÝÌêœFiP8^¸»•})£iŽw›ÞýÙÝ*fî¹v FµÚh /;3u…IF¡”—¢È# ˆ‡/kÙ—jÚnÅ8è˜pXÜKb¯{vh,ß˧ƒ^’Ìå¶9ƒÆ/ÚN¥«¬@ÉÁé@÷{R+ô=׿µß,hœÎ<öæ hbíÆK_9q¨ ®¸j±-×gS6“S»ùõƒÿã7ûé—æéÙ£Gö¸¶üb¤ûxöÞ´Œ÷¢ïáÜy®›k$´sÝ¡H©2wO†fLæ«÷Ü,̽W5“©žrûRp àl:K±9”‡ôKÒ ñ"·ÅºàA?À‰†w3~!̆zÃ@¼“|yÉ^ëíSû˜°}„¶|î–<‚»^2§“y} 3™)qªÓ ¢èº¹þ’`Ë›ò¼±E ~câÊÔ\/§'_VÜ{ínZù€3aºëŽë4ñ¬Ô…D õ’„& ®-±‹cÍD–Ã=èÔëŸaÐ AJôjT@9X2ýÂÍfõ7øùW4*7endstream endobj 75 0 obj 2061 endobj 79 0 obj <> stream xœ…XÛnÜF}Ÿ¯èÕ‹9††fóÎ,ö!‘Ä»NäHc k!´fz4Œ8䘗Lôþè=ÕÕMrìK&ÙÝu9uêT/E@?ö÷æ°xs›‰§nˆ§Åç…4/…ýµ9ˆÖø §ëÝ‚×H‘…"+"?/Äú°²ð‹<ëÓâ“W•›¡­VýÐ7m©ª{/º_ ût¹ “ÀdâÛæ©U‡CY?‰¿\²üßúß ³ŠR±Þ.?L2:Á»Óõ–Vm†®obÓªÞv¢o„?®?ˆN·,׿/dšùIÂ^»>g u+ZÕX±W½xiQk½¥õ¶ÆS=mª—2½qêý©6}õ"Tg [¹ÍW2´ÛKÞ–VÈØ/Š0£#y§ ‹¼?zÓÓéú î½Û¯Š¤e럚f+ž†r«Å^·ú~y)`…1q£jÑÔ0`èfæ‘l¥s½Y5ïÞ©Y¾B>Íé)8ÒÇù&ˆí3v³®Ö}ÛT+ü®aW‰Çªjjí‹ï«J<—tL³;?R´úóP¶ZlU¯DY÷ºÝìUý¤É\ ýÊkÃ#}›ø lŸôA×=¹Ô5t‚2Fº˜±/-L¼“š6”~’:üxðÖ¸îLDQáçQ1 Ч±Û6¢Džç(xÁáñÍÆk‹(n€úzFéèU»”¾BïI÷³õ®¡7~U›´‡~“©‘̬™/ýdà§c꽈ßé–ÞºUaæG£ƒŸ¼Ën掎½¦ÄŸ1àZx»sRÀÇ Æ›ƒ§S‚”Ãþ{÷ˆI¿W¿½M+ºòPVª1¶åÓ¾' îÜ6ÀùˆH Ú/ꦪïõáH!´~žëר:랉á—J”Ý-YÀš~fÏ2µÅèÛ8&& ±©žï«Yõ$.ÝkµÕm'þ%(v]Uvýƒ:Ah÷î奸x{ýþšÂ³ê›…Ä•{ÀÉ™½Á·Ö^Ü/ÿi–…?²í,xóZUghMÐé†4¾¥hz lláÛë7†¥ cQåZu/î›cïÑøãKqõñöý͇õïKxo–qÀ¼¼¾¾ÖA²Ìd“Ó8í‡Ð!Œ‡ù†øVÀä7»þhøèdÖ+»˜Ã¸kµ~PU5Ò®¥çìyÌ^›Õ+ʳ bZ„Ì ïvî§eAõ] €ª-€ÚõX§d:zj’åÒõ¬¨`ºV5¿GQ€‚B¡ÌtDz|ã(Ì{“{ñ vàæc¥ájãïÊäÏekí,áÚ5eÔ4ÏâX© {ˆlЙ\ton+’ÄÏSoH}|Æ´“ŽÈ ?!u:#ñ©]‘IìÿÜÜ­ 2\íg¸1 Æá–o \Ñ©ƒ¶I ÓÜSL´†ÉÎä¹#ž5‘ ܺ¾…º0 ––]7°¶ 3&M„¤ ,I™›vËôe )¥3@¹Aêg±c„u©Ð!…º“Ún§“‹—LÏD‘M ]Ä™…Bºm9“Ñm:"ݶ„¬"¤ÕýÐÖØõQmžw89ºAl–!–¡Ë"÷–Èã”ì£Þ‚ŽÍ¥^Fqì'@ýaj(è@2 #÷‚–Â6¢¼‘4l(Ù´ê$õ›BšÚòlœÉ×?x*+Ñ ½0ÝçÜ»{8åŒB¾$ˆsæ¬=ÃÉÃõí­1Ò5 '=nnï—¾ø…ÚŠi¥©nkfæý4ãÊ¢ö6ñ¾Ì <Æ2À¡Ä‡h»‘;„–r®N Ž‘qÍad1N€¤%Hø¹Ìç €°‹ÄkúY¤Ÿ†ix.8v¨……i¢žÏv.Rzú8Çd*C§ˆ=8jé«â‰Ýó® t­«ÉÓ†ˆh‡ú/¨±Eb–˜w7˜´àÍcYkS£È‚a\j¹ùáæ-5Uœ]íy2Óåè´lÐ}ñn&±PFᤤvSìr@þØú2K¹±_ð u ©iáoÄ$ÍHšZðY}À+,¦,Êb?ŽÐùA¹BrüŠcpõñnÍÒ^ÞÍϷ׿.ÍØ%ÞÇk¼¢ðF鄲8OÏdƉ“© )Y4¬8ÜͤÆCð¤¼‡Ž°…ZÑpožC»A)æÉ&¥­þBl?Ë÷·bD†Ë û”ÓD/­O%ÀL‘8 Ë;“›ÂF¿Æv…"¹øåýÝú‚botжP ÷„$ (oÉëÚÊâ|Ö9»´%ùã24w …7˜1ÿÕ2¦€Ç’º%‹·†5+*Òă·âšI\UO5¨â\ׇƒÂðït²ÏR©€à!û yЊN9‡ÇU>Lý ¢ˆ;®öͦ©¸ñj_ùÎaROѬƹ½ÖxÇb‚Š–úDÍLÍàÛ…ÚèÛáv³)qÀjhõªšû¹Á¨€¢l¼B‰ól¼B¡VÄ 3ûòF&oØÈJŽÛh4;±“ò¦*\¾çÐã¤l¯HÊÞ±vGågTŠT5geÒ—“:Т%Ñ þ<Оt“aGòI¡Ùp=†ÎŽn±Ùkvö¨Ú¾Ü ^-ürR鳪 X "·¥äD(ÜfÏÊzS [« ê›Iù1–G…<™ƒí ¬\¥›„¢SÖæ^$á§£3–{6¯ ïQ£¤))h*æ+ž“P#“œˆZ­ª•eš<‚ƒöÞ¨Nc~qQd~–D…‹m@÷€'’€K”ÚM»¹alÐ"šN§ÍÔÈÀÒ`Û¬l5PïÐ<|0$òÒÜV?ØÀ|1·ÊH/}ðŧ2Æ÷cn#›$ˆ»(•_‘Äè|ó|A+ÚŽ£ÜˆçQ~h}p»£„]8‚&ébåŠWµšñiò×÷~Ôß Æ;®½ÙÀx§ûoò»íà.•Mšßä9óó(FYqÀÏNvÇh¯@ƒÜ¯†à¥…G`¶ÿJ9ãœElä29»(AÑ™±Dbì³ÂT>^—`L¢qz í'Äô' XŸÝ9$þHгê ý,¿%Ôv3×?IOÇX.áÒàÛd1Œ]§T3ìâH9*w#f<›Z¼Ë—ù‘!Ý@º«/s!;×óW77ÿygEz?1o×·@-wÑ-f Jß\ È<ô-]8‘kä”5.ÞŸU+B0«yk.­!2¡G×ëůøù?ñ£ºFendstream endobj 80 0 obj 2741 endobj 84 0 obj <> stream xœ…ZÛŽÛF}Ÿ¯hø%ÔbÔ&»yÝ`²ƒuÖ±geÀ^=5bF"’²2ùôžª¾šqAl‘Ý]]uêÔ©b~±LDLÿ¸ÿ®WÏßân¸ŠÅÝÕ¯W ?î?ëƒøç /”ôÃj{e×$¢P¢¨´,+±:\%I%«2«óÕûhßÜ®Oý~9žÆ®oÌþC¤?,„ûu±TY,ã$‹Ž}wכáiïÄ—,þ·úþJçb‰W›+ì{¿Xýr¥$ÎYÃJ™æ±‚-ô¬éQL*Y$Uåìšáïôh™2/ãD,UJbk+ú±6ÃÃÇ¡»ãø!¢¿ìL»Ù××âÛŸÞ¾zs³úøí›7ÿ~ùâZ2C=\‹qgFÑ ¢íFQ·Ýén'ÅÏ‹$‰£î$ÍÝng>?É™©Â®&ø|ÓŽbìÄæf7k³ß?ˆÁ°‡€öl™É’<åÖevݧÛÃ*©Â+ ª/vHr™&!6Ÿj[UVeêžõ³Ëâ(]•Ìíºû¦péZôõ¡k1Ôý'ZTŲB =z¶ Ed”ªÄ2Q!ÊÑÑ íщ‡ît-\„`Ž¥JI]ú££z˜ÛTêpÏS_Ãn¨ÅÚ™eø—º§¡Þ³^wýx†O»Vìá–Vÿzª‡q…±†}*RD—ø¦%ÿ"‹*]EæCÔaïoØvD‰QœLÆUÚû«°;QœÌd.s]…PºÓ¢ý^ìj³©û<×usÀ¢’q\|aëÆz­¢_°=Ò (}Zs +0+Ê'›¦Ÿ÷5ÇàLŽ£óC0ü¶…4³‹—V—¼º6¢Ÿ®VÊXù³q‚Í.ëìkÞv¬÷{¾•.b©³€ Yh‹-Ç:äÜî`{FkYÊ¢,ÂîQy éNCðÖ}¾#Pt'äÜ®Yï0ðâÇzämí¾º?ͽÊúã.`»í»ƒ87ãî}÷òÕ FèÕ’ÜY·ÂAO_ µp4û¡{0£Küº5·{—]Öq4=L LÎ;RüÔŽÍžÞY|uEö½B¤âÊôѪÁm¹¹öËq ¸Šß]/N-yo$4íºãªÝ¸“R™UŒ]hY¤…gÇóÜeâÁÑ1¿œ†QÜZ.Òà‡,ϧ¨ÇŠëSÔܵ]_o¤øWG/¦°–z ŸYò”Èð0}BdHE·}=çÉ ÌžùWœï#>ƒí±Ûf‘¬çnkﯮÛx÷º©û9Zýpè¨fCm<“æHÄuíUŽ úbX†x»-¿I™¾eOÃ'qh0+u X]:¸tjSÕÕ´Ð×­Ùû3 )@´·f}osÅíÈ´Ô¶"`„P€És‡ò3Ü5NFÃ;R¼³˜Ôº²‰„hÉúQ«ª <>1¾Ýmù‹é/¶* ¬Ç‰|7× jÕ^#£=uäÃTD²Ð “…]âè{n””ãjRÊ¥U‹ß¼u½älS«&ÖàNrc?=MÛâ*©Ò‹¼Eõ¦Ÿäí…R•«É‹ÏŸ¥yFR¤YyÐúçoq°@,5z¨,ÄuÖ¯÷µiOG;<àE~hs‹$M¢’Ô"a”$bV» Â†y%¿«I¹”‡oJ·õx®šÃi?6ǽEVLøÓ.êEŒòï¢$¥ŠWšyÛ9k¯[ LJXÃô½ï\Exþ¶Âe•±gÐFäšg¥,mUýnu#nŠ ƒ*ØÓ¾1}3ÒíÞù¢­-ÝjYM²­~=$ÔC ºzséÛ%ôyšs¥íú:{ìM;P‚3àxÝV«oož¿¼£Û¶^óÕ,ËÕbcFV9WiÆ•Êsª´\ÍË7ø& #XQâ´ÓÒš^ÌA5i:‘¼v¥“(ÏS<,XPQKTQØQ[uª!ã§ûé²´«m+!n­“ˆÂ‹œŸ¤íÖª™´âƒáhx,IºvæÔ²òx{Tš«BæÙeK¡Ñ¥»b†Ü4ÛÀËØ•Äýy2푾†ÒB3ö»;OÇðöâh7—;•ô]Mt¾Ð÷¾×áøSÃ`Ã=‹3¼r[†航aEf"Iž_ 98uÃjÆmDör?B³ §U‘GxðE1 úO3€Go¢ áMº°ÛË£q¥ø3š-×4Û9÷¼Èé¼ð¬Á@­·hS5SMÀ*¼íÄÀêÊ+5ß\zߡźþž|ÃûÆz¬;â“ÛzG5ús?…ßæ’=÷Ip6ó$Ȧqè~‚úÚ ™Ø•ŠÚŸÅ߬l-Ry>U¯0hº…V9ªFõ/g‚¶ðGÜ,f@ØR ¶åèb ãÀÒä0Ô®Óqç|Ô´{pöÅ÷ÏÒ(fÃ,h.lÐÀ¿­8éÖzƳæq§Ê}Ù9çüU:´½ ÛJU%‘i\ž¢ÕÕÂìƒë94„Ĭú HD*4nSÕ©¶2  )G*¨<Ìyqóãc¶£m¶¶ Ï[º2-l•­˜û\{pž'Z‘æ¡«èï ecO¤~í8¸`šúéÔaòܴÈÎHŠÂÒÏ5Ä¿u;PžŽ»p‘J•>œ;J¯æ®!ýE¥èê·$Ó¸@{†~üéÇù½‘)t™¡8§Ó #ú½î;&B˜†vØ}$¨N¬íÈŸ»;*¸ÄÖæÁÎÀ“K 4ûS·Ÿ}øV4¯TP_þ¨Ý4Q‡jÈЭNo¸™jÿ„*É _°ÿ(iøS„¥ 2—I\Î ¨ ÔÞ4ZrF ‘NgØ-Ko¶<º~Ñ£aztAµº bXý9¾§ñ7l'£H#X»®%±°ßw¡úž‡Ù†¬¨1GƒD¤Ci™ògœp·4×—Ãeº`Ã1’4ƒ…aš+›a¸±)C&™Í¦¯Û¤ÑÙ¢=n/‹Ø-³Ž£yÒ¢k[k«;j/Óôj†Ø›7oýËCè9síseÕM~Õ² #ÚÎëhQàÆÔ¹4\±Ÿ-Ÿ=š “&äž}x-üD«(ítJ'öµnx6—ÇEêÿ[Þ÷ŒŒ±%*ËåÜyêF²³JVùdV²M&ú´7=¶t5'ImÞ©Tú1Itý0·0Ceþ³ít¬ÐÜGí .˜¬D=;ꢹãÏC·ÿd u’¦Ö'‰¬âÔ#¹Ôê*‹:ãþXEíKþcšTÑ™Ê7Mºso¬CT×û9!ßg©+ú¤´TL0”€nVèç]z>¹B˜ÏG')áªE‡. õz üÏ­»Ç<*X»”+áBfY@D,½H•Å\8:ÉûŽrnÓy’~F€ÎIuåÈgÂÑÇ™õî]žý^ܼuMRžvf©g]ûÊÌSxõÜãÆô¯n\"¹ÕÈ?Äb´º¯.B1ª·ÔT¸"ãrqIç!&Z¼dÚâ:lÁŸ>“Ù§O4<¶ö1í¸Ø¥NÇÍæó/*(“ˆ¤@±b9=pÙØ­»ý@_›)ábdg>5Tî;¦ƒø¦ÜÈ–õ>ªUb¿PÐ,°ÿóJé]ž¹‘ }½K´¿ñ8gõ4|Œ:÷ý4VOk+ýOË,“öÛB %›_ÐtÊJèKü¼…ùI¯Pø©®¤ŸJEIN?½X]ýÿü-$endstream endobj 85 0 obj 3580 endobj 89 0 obj <> stream xœ}XÛrܸ}Ÿ¯ÀúEœ”D¼3yJ»Ö‰÷ïl¹RöÖÅÁh¸æcÔìüCò)ùÇœn¼ÈJÊU–D@_NŸ>/"ð¥èŸýY6/ßgâaØâaóe#ù¥°?ª“øËäô`wؘ5Rd¡ÈŠÈÏ ±;m¤,ü"OÄî²ùè5õ}5öÍu××eóÉ‹>m…}º½ “Àdâûî¡/O§º}Ï.Ùþ²û.p°_$tv”ŠÝ;X‰c¼oU¹Wý ^ËF¼ÛíÍÂJ|y'C±Ûo?Š]?u'%pªîª®è·­Œav,½Çz¯Ä‹£ÙòÅ­8)]ÞíK]ŠA˾Ôj/}wú¨DÛõ'I¯}±;ªA »R”½÷W±W6>–b#¼rlôv÷ÛæŽM–%‡Ìk;-ê¶jÆ=Ωۧ§ˆA÷ª<ÝŠ{ÚB¦™baàö`÷¼Q‹k7ŠªlÅ©üLF~@ïªMúY†Öņô Ã(·/Žê$ÊóY•½³aq8¹5(­)[¯~~Ç΄1m '‡Øw?ü¸ûõÛ×þëë÷BwBúôisæ|?K-NõÃQ‹{%rw‡— [›úI”8k/÷Óˆ_~˜#cöe{š]IüXÆÎ•yu›[Q^7«­òÈ—™ £7”Ë é´Ó}ÝÔúJŽ8$pd\Â'Pp¨Êv?ÆÁe€ÎJiÏ0Ìüè™~ž$y:%À@$ ý$If˜È4ç UeÓÜ—ÕçAìë}ŠJÊ¢¬°Ëª·‡Ò÷ìHâüóÿ9û'Ãi‘…Ì¡ëŸg~Å\Àš©ßËÓ¹Q„Qòé!UNXСªÕâÜÕ­V=Åé\ý¤¨tý¾nËþ*.}È9`â:§Òç<ö0Fч÷ow¯ ”EÞ=4ç‰uP:o¯+Tç@ü;GÏzÊ.´F×½j®sZc[éºkÉö^Uªæd8TÊD"§¢³{> ó¹1eS>=wFË-ù=¶„uòæçï_ÙŠ ¢.o÷ö‡ïÙñÀÏSÞm÷‡Þî¸& 8xÆ|ŠñäO×2)áÇ-#ÔÑÄ^þ$©[xe¥}ñV3€Ç (rO ¢Öœ'2Ëñ¯*‡ 'àІ8½ÜïE5ãeý@V*]ù”8&éHmñÂrø ÞåÍîG¡û²¼„i¾°Sô;=Ò&”ÞÌ– ísz$m8wí feÀ ½®6™ôÓ$q˜¿.Š=ô‹"²Ïä›Õ2J! ·L¯8"Ëì²^¥a+ ¤ûq™ë­iŠ1QsÝ G!,‘ùš1õU•è#jPJ+æË|†÷?ÊùŒÒ/¢"Ÿ<øFüé­Ó@7”}³ê¡w2Žˆ‹îÂÜÏyÑÝj·8Mœcƒ»m³Ø³©o[Tâ¡L=êQ„1vΚ:7á0¥@NDæ}¬V5šN‘7ÿ <]}Pà„C'~¡×fǹŸÑŠÙîŸHÈù²ŽÞ³)ƒYúœenØŒ*Èö’¿©J ½Füà6ìênš+û˜˜Mà@pöû»Ù1H¢0ŸI@Z5'öÄ…H6Ñ!²,.µ>"ó#×)Õ&²oÿ4µ=Yž"j²|™ÇàË FÞ©ÖõÃ1Åë2SiÄo§²µ€¢‡Õ&’~¸žtý¼,‰$“εºÝ¢;ˆ¾ÐwT[u#=øær¬Ñº3Ç”ƾœ;MÌÊåùRW;Sºtv!A‘ùl«ÝÁ°¸°y«4³Þ]”¤~g)Gr“ ŠBKœg:Qá]Tvï‚l™çœ,p7š¾séöèÊÃu‘hÑ/¬±PSïBîdè£i’XÛdÇSUJ_æ¦O÷·â²&ÉÔ£é(‹Ác]‰ß:.&Y$Þe ù…˜1ŽMË칕¯’I žt2ÈrW¿=¨É3!¨-}Q@’"ºA^é”;ËMAêgq1G»m´)½„Nµ…7AeÞïçn ŸÝœrÆo…°„… PBq=úÚ-Ë$†’3/ìçˆÜÙ1šQ8 DÚ\NÖ"o䆼ô,!9ÚÐyœº<–WÃä19¸c!×Z¡ˆ‚yÿh)pÊDÔ]’Ö3ÝFŸ›ôˆÁ‰8ÊôÅ6µ#†Ï‘ñ¾+[–0yÄE(s æY^Ñåä h³ùC Èõªéè7”Îe‹¶S„ivFÉ^ŽÊ|Fj9äZ¤4ÊLrå‘§Ðàh^Æê[a`9j& ‹<²¬ä…N ®2JŸS¯#Æ˯vÅÂ\Ã`†^![*%ÀõQ¡Ó®u1†•üé°–…ù×ÃÚíý2ÐÁÔ$?Ά£!ò"‘ăUCš–.µæ‘‡5jß:½Ž– Ô§²™!! ?˜l\öjtÀ cëékÁ‚qhû'C|Øf…1T•Ÿ[…açu;ž,qMrƵ>ÿñåËê¢|$©W~×oQï 3ïá¥AÑC×í!\yŠªëà¹ä Æ(Ã`1IÜ™UEÿ®† ÌéK¼Z¸x¡")¹fhAƒ í®Ÿ¼a$›+Ôϧ­ÁÒHÙšš£‡5¼C0פW’Ü } ÎÈV‚Ët6°´#ѵ&ä4%.®€âÂÞNñì¶2«µ³[K?ò}¼â## ™ÇAÐÎ@R¹çYø×’~ÇÁéÅp!ž¨0ÿÊ€2*fhYP˜g+PPhoÎà &z»99Å65ªA¤{˜ÑmK$‰B¨4Ž|p’–Úa`4×>¡cÇ®}i¬FÝÑZ™¼ƒP_FF¢™ÙÒÆ Ó‘•´52J©ÅÿæÂ€Ã†¢ËõF—*Ô¡!¢öƒXt1ª­Î"ïwͰ¨»f©ÃBÀ¶‚›> öÃíâþDb*4­™ër§fèÄ »ÞHºRiý¾ÆLˆ‡W,|÷ý›ŸÄ‰ç°=Õã$¢ZS™¬o6QN7îZÐT·}:ɉÈ}9X즸…ùæFiòœØ'ÉsêƒYB×ë¦ÿ&#ûn|8ÎaS˜h‚p–t¨áIX%Öµ‹6IÜck7x¦nqP}"˜ó¥%t~–N³lgù ÊèâIÁEZ5_¿Y’“»ŸJÿA¹K÷çééyjÚwíÍâ'ülV“z\_ZNƒ ×Â6Åû„ãrI“Gñ„ãž¹#­˜(ŠÐÉ.Ú„sô‘8À~nJR©ìEnÀ>ýuå¡ÂL4‚ A(›IAa ¡S¬±¹šÀ¬“-ƒõ`*øm„Hº‰Vfôèõnóüû/å4còendstream endobj 90 0 obj 2985 endobj 94 0 obj <> stream xœYÛrÛF}×WLå%à9ÂàWmí*²x£XZ‰Ù}°·R 8 €Vè‡ýôžž@É^§\¶d`8ÓÝsúôéææsÁ|úc~–»³óÛ”Ý÷g>»?ûp&ÔKf~”;öà 2z°ÜœéÏ–,ÍCžål¹;"çy³åãÙ;¯®Vå¡«Ãah»ª¨ß{áû3Og‹ ö¹/boßµ÷]±ÛUÍ=ûâGfÿYþã,LØ—k‡Ý½ËZ[Ζ¿Ÿ-àŽ,Ï‚œÇIžÃ,,óäô2àêU΃,Ï"ój¸¡W>½>OðF¿xç}ÿ8ʰÜk»u¯_ˆÇQD 6ø¥hh‡ûQ vɸÈ|aw9¶³ÐðHx›Aí Î .òȬò±c \ÙJ† mÙÖ½ëû}Û =ëe³fM±“¬À/{e ùå'< ¢q/¡ƒ›Ù¡‘MÙ÷ƒ\³¢g¥ Õ g"澟gÞ{ïý´\Þhç‚(åxlóygʰо*Yq¶²ª²ª¶™³×ËØŒ–QCˆÄ„v¾C+x”dÖÂ0ε…¯®Þ¾Z29”ïgœ½XÕ³3ñ‹ª4ƒâ©ÀRÝBû‘“¼³~@ÔõB±R‘@üÎ÷]e¡(èÄ!R?´Ð)&Сf„’\  âÝä»I ›'ÀÐûVÿ\~±i§Ì— ÛÁ¼óè‚…vÄ• ´‰F¯UUGääÚ 2ðsÒ1”D{:óÍ–ÔQ¨ƒãÔUH0˧ºÜ§ÓšW³*§H¼M_}.¼æ068!”“kƒ¼Irw÷£è©£Õ4Mü­ÐóÄÏ5A'Í Šv]nÖÉ#ÛŽá¤ò“eO÷¬V¡…Nû| ô£nÃ1YwhjF-A*@æ°B½ébYzB”Jƒ¼ Ì½ƒhxAiÖÞ*ÊRöý¤ƒïƉIÚÔi úøÓhEÄ1.…¿/é³0E&ÊÈ?s‚´w”ô¦C:§˜•?ÑCÈ{H9¸2gD’¬×J‘ûû˜¦cúź ýFæÔŠ)RtÏ“ }¦jn_½|sûÛÍíì{ò$Òu8á~b¤ÕbH»r½d×ã}#Ü`ÜùòúêN5jv{4 ·—FiE±Rw¿¦Ò°«†ê^]P„Úí[Æ*S.³ˆƒhŸªÄû9g©WTM?èBó`$†.e¦ ó4GýVª•™ mNGR·¡»IÕ|ÌŸIÌéïë*K+¡ìæŽ\Ÿž£¶fi~¤©¦[]ôÕÚõ¥‹CO>OD•]A{râ_¤¡©ô2]¼äcÕ4myh½ –¡ÜÍáÓ§ãJ••\=´ Tšd¯™JÓ•ù,ÒõROUxÙîÎäj¼A¢¥þ¨µmé¾>" p#{9ÌBäm’ALOGö‚'ndïÙŽ9C¹KÂÉôÃOM¿wÃ&·XL„{®:Ø“*h›mM@PÿF¤“2óå a{$W¸¨Ò@– Ník‚àøÉÓ ¢FêQj눪 4hïZU3 ® Íã46w©Ë hjPPpdõš ª)·²|0ªÚÅÈAA©¶ÐiBtŠM8ô‘U‰Q¨%ÅE]ÁèU„œ¾vZcÄTéEß´_øTjåÛý4= ytk[æ:¥|MÝ´ºó¥±†¬Õ,¦™OVε.¢"LÚè 3÷TmÆÆBõÇ4f‹TÛæ=jÁéd]3íP>¨f[#yßBˆh6xÖÅÈ^× ‚,µ,³"ž³×ZˆäôEƒi`ªB¾Å"²Êº”Z 1޲ ¯ô†{VˆÒŠâF¨û>çcµÖð Õך+(+ªwXÝo5$¢ñº]!Ù×G.Ó9O5Õ¬ƒòÙ×ÅQ…þêRŽòðK)@_®X)5Qjôh ˆë³Ð¤®Æ6ðR%¥ëbçZR$±Sì~h  K+´¯Ïæ‹M=ú=‘vx3ËÕW^¹wq÷/,ÛíèFÌlQŸð¢ú³íS TIjFgÍa·Â‘ê{Àg<ªGæpÂÜ“¾ZJÓ¶w³ÏÄÜÔÕ׺‘GDÑ·h8âÂlUל´Ô¬›&Ÿù³ÓFÐQõANŽßw™Ž2Š¡…#†²Âõü0 ÐéžL"%kè[æt2“ò~.ÄD½ÅÞ™•»"£G¯–gÿÄŸÿ` ¸¬endstream endobj 95 0 obj 3536 endobj 99 0 obj <> stream xœ­YkoÛFýî_1ßJ-¬1‡oºØ‡ÖuPoÝØÓ)ŠtaÐÔHâš"U’²šþÿè=w$å¸íb±#äðÎ}œ{îÃ?3— æÒó³Øžœ}ˆÙº;qÙúäç¡^2󣨲¿g8Ѓlu¢¿,öXœúËþMJ'óÀôbî% ÆO8Ë6yOwӽ׸W$žºw+! žÉñ=ëòºìË_ÉW«}](?¨W/U/ÛŽ5ûÞÊ$=ªòiöÕ‰Ç#’UœxAÀÃ81>‘bð‰ð¸ðDj^x1‡ÙÀWÙÕ_Ñ™Aßõ̱¾¾O¹Š44/ö+z‘p7q]{ÙKQÂó9EXþ¼/éDäóзҞçôhî'1¢ÁýO\íþ¼Â÷¯ý|~.NñÏ)sÏ]÷üÜÕÿƒäùós¥pá…Ö éà„Õj5±"HÒÄ@†nŽÕÍçñ Âëö»]UÊ%ëš­Ü4ôYÈ}:ºÄ›O?9‡ÇY舮ï|Î,վǽطW×ÚàÔ¸ƒ¼ïóâIyÝçqâ }Úåah2T¶ì0‰Øwš}µd@"rh—w Rç¥MjÝ¢Z9‰–ã«»bîljléYÌÃŒižÍ»r)–ÖL›–‹œ„k=ák*Hyä[q‹Ýèèâ{ƒ{b:]š¦­>Ï‹¦~Yï)ž/­4é&è«9îúo! Œ.€©À‘QÖ0o™÷9+óÚ"á&<ð¬“NMê@ø8Mkîu•çB¿>½Î§D5¦8Ê€蜪Ë_s[T”cà4‰J¶mwÆ%툫r[öšÇñ¼–ŠŽ;X/ÂÓ›4šÀϕ̭‡4!jlz øxHÏ«ÑYØÅæÙ(ŒÈPßlÈy#j`cEB=*0êì‡Ë»›kë|¼|øز[ä5ybßM@ù[=+Ãý$Bd- õ3«—NÛ±Z6Ú‰MmŠ¥á2èÒI¡noxz‰±lßïª&_¾ª×p8‚äÿ°‘5Û«3ü) …°rŠ^™Pä°u.ÿøàý¶é%ºTô^Å»9ŽTò$±Äô,'°òFXù ­B{h˾‡»Ùb·SŠFêd†@šƒ[êê¦7Fâ¾h¶e]À$ -¹†G5r= ¼7P}iœÔ详T?¥fßž1­¢Šðó) :!Wðv¦¡èê¤é(E3Óyr:¶e7××7:{#´Cyüáúæb1ƒñNvuó^W+ßDbŒc˜ø»šXÉ=îšzTf… ÷…$w½Ì—Ãà7ÃȶE³ÑïXÙw²ZN›)™ËÇ0ƒ<ðÒv=G÷t ºÅÒëÞPçØÓ|âÜZÍjðÃý{äRöáê"»üæa¡%ÄÚcBk2½Ï¾5¥ÖÀóè6ÄaE}§îúT€:¼U°‡¾IˆØ¤~ƒœBÁ}ª›™‡æÛM瀤—`Ž¥&;2\€cÒ¡7±eDIA“Œõ„/¦Ä”ø±¥w€\å¡\«þMàÐðN‰zئFíØ«Q`YvùcEQ™àh®Q-¸¥GLòÉÈ|•Xñ+h)6Qñ'q¿‹€ÃF¶’JÁIyûyÑœD×lè¦<6ÙblÙrœÄ ?ô†úh2!}X¼ÿѲ'¢a­ú6ËnMòênJ;$ÖË‹ûÑ˘ÔÀ/v–±}²XiÑøÆa«’éÁõ½©%Êäƒb‘€£Òßõ"íæïJòaŠ„(T-ëåL„º×ü¥gL¤ù91ªN!'Ô‚¿@Τ¤©NÔŽ6u ôÚ¡¿”DZHGUã©Gïï.µ‰« N©¯!ëÕÚŒO-íá*{7Yíç]Oœòªk ¿¢z‡_½ÓöƒI ˆŸ¦EÃr‚S˜¥„Ì(ÁO§Ô_È F®TOËËJiÖb,’D9èq‰ xÄn¼¼û»Ë»»ë‡ìƒîáÂ(Ð=\Ž·Nÿ±™öpñØ“¸‘f/ ©û_ÀLºˆè`‚‹þ˜½;FÃøe‘–û{(£ÍA$~eÆ{7ïµE b5*­wCåÐŒ ‚{(ßoÌŒèõRcWHPÓ•kˆ¿Ú¹øáoÄÿ¨è\4ÍSùåf"0Õæj…›Ô –CYƒ>q•šÛPפ.‰ÔT«šÓæ+Ú(P©SYÄv²¥òÒé~p›c>(›}7î$|šuïVXÈäj"‚„ær}ªÇpÔ7­íìµ®œI¾ælÓ÷»ó³³-¼À%XÔ™AlöK¾5­y<଒¼h¶gKYI d]¯w1µãÈ /Öå_õÙ?Ó°¼8®T¡-HÁ“· ’u3¢¨`‹g:\öâ£ÎØìýAÂù&¼o5²ßäõZ¶p5ã‹(còQÒî.nÕ{ݽ6u%Y››ýŒ›jR¥ÑÜæÁ¡˜Îã^”ŽnjÒq»Lh2€±µÂaWìÎé¢S Š"S¤\¡pVÔAƒ‚6š0‡»=4pžg ý0Ò¢ÐGôs\CŒ¿a:Ù´Ùä®mú¦h*º›öëZ.5^0·`Ä_‡Ô<;#@Ÿéü ìÏò¯—É¿œõÛÝYw­Cmûk½ÁÐj‡‰bs?@Ÿ£:p6Ù•S³:?<ÜÝ^b¹¾úþ*3ÍigfûqÊþôɱƒ¾¦ÊÀ43¶ƒŸP¥6ÛÇ,–è=+Õ ÂéW¦‰ze×kÃ,pSa&”ߥê"›’ÿ',û¼íUXQIS:;y,<¢ö&ø#áª>èò•R?Ng‘içAô Ó ŸŠ -CŠªéÞš*#ýŠÃ6©Þ0îgfþÕ4{5  ÐX²ßY.Q¸¸»¹øN±D„iÞ:y–š1gÞÝ¿¿PcUÜøKµ•ý éÝÍÃw——·3 Öu—ÅõÕÇËq2M®GC+›>×t‚ÓÇ¿m ”€Ž0=.­ß£eô½'OÇN]¨G—ÙÉ?ñç?0ƒvýendstream endobj 100 0 obj 3010 endobj 104 0 obj <> stream xœYÛrÛÈ}çWLéeÁ ã~Ù7­M¯µ%¯‰Þdc§\C`(b… ¥(ßàÎé¹í$å²EdO_NŸ>=ú“y®Ï<ú£ÍâÅMÊÇî.|ùéEÃ~Úâ½±Ý/Ôw|–,ÍC7ËÙ¶Yø~îæY̶‹N]íŠS_¯ÇÓØõ¯?9á§%Óï.×A칞;Ǿ»ëyÓTíûæW–ÿÜþ²À1ë0aÛÎIëM5VwËØõ¼4 > Æñ_‡Wí0²ñP îr{žs+Æ‘Lw­`ÝO«Ft§‘uDZêÚ=.¥×aìt§ºd¼ºé{ý½4“ò4Àø8òâÞ•þnøl[,‚ˆm¯Îe³ü\-~J(]ä¼ÒÇ(^WEÕ6ˆþaéGnž§‰#zVH/ ~„I;Vvò ?,9› ÈœóØÖ‡ï-«Ú/mEéhºS;RÌ%ùŠ»Q´#’Z?IãHÊrûÇbí§™x)[û2{‘4‰OÒ·ÑtýëzVVÃ=y²ìK]‹Òe&¹”Õ—n®ß½ß~~{ù÷×W×›Û«l>__Þü¼ÑyfÈXÛt&„ §=’äûnžä¹ È‹•Ÿ/Eé¼»ïKªÌQœÜ¬5Æ27M'ýëŪåYTí7›ËW››•Íëûw·Û×W›ëW·mrÞÈ<ï…Š–ÚN´¢'bÆþTŒ'€áܼè—DC‰sÙËïy1’!ÊΈ&¡ ´@ꥦ£„8‡ã£¯"N³e)ƒ=˜ÿް‡#‘lt oŽ0 _ T4K§*  ¼ØõÓ™ã4gøˆ­»Ÿ¨ºd˜=…Y «ˆ.Ë²Ò õRäùYÓ¢î¼f…1ò鋨K´ió4¶Ï€Êvà²wWž÷#Ó¬—'bÉ_y# Ð 9]&Ⱦ¦ô¥fÄ8dWÖÉMü3¯f‰œ;²Ùцò'…úÇCU mÂ}.û½áO²—ÌÑ~–¸>p¦±¼ª–a˜¸^ž;­rÒS…€ÀL²§ÊC»FàÔA +&³#D°ºl‹“¥& $!˜-™L£HÏË¢k@`]W˜äc×Õ˜ˆbP“ø”ËÖë£jkU¥%iÊíšNYMù¥ki®1ÏŽÝPQ´?êÒ°ŠÅõHÑÀuÛï,s}/>O­,“Ÿ¾lg9,΂‚⦼úõõ»Ï›×¯7/·W¿m>ãY¯q™cÝf!JÕ˜7.°}ß5piÐÅFmRßö˜d¼Ô1Vm%¢T‚3¾ »38Y~PX"ù= ¡Ü BDO 5AMk!ºÎ#LÇÔú컑R:¾¤¢ò\9EýØÍmÛ?tŹ›pU¥,ª3T»ª®Æ'šÙ|Ò]v€eAN˜Vx6B(HõM(‚NÝÀTËSzˆÂ<3ÃRiç…‹G> åÅŠ]|úÄ¡G…ŽAé„,vc;e‰ISP¸;>^¬4Q#ÏÄÀűo¼ >™›‡ I³ü+òõíÅŒOíˆspðpè‹ E=9Æ_ {ßçöRôcõÀµœãÙådÕ6@¨hä9hÖÎôámF³í‰óûÓ4Ä(¶³d3¹p{{ýù·ÍÍÕëßßo67Fu’r®¾Cãª1‚(qÃÈÑœŸÓœÈÎ —¦¹jö°  XüÔ'%UÊÐ$sQ´øÛžÑ0ÕR0§¢¥Ã¥ÄAZôƒ½J±Ÿr™ÉašªòJ ~hCŒ=´ìð$qƒó´„Úñ ŽÓr¤P3•…e _Šžk>EÉ·×·/5JŒ)=ÉgD!V:ïyÏQ"¹¨;Ù˜µHÏÜ:h?׃¤Kn%oÓ&¦’KÓO%—tÀÙ'’¾Óíã €F’c@ Û¢k[%X¿¡úC· ˆ5"ßy¤øþFÕø}é{Är!@öJM€p:ƒ-¼¹ƒ4ké_5 'L•°ä&§d»Q!|Öš‰gôB`Þaø¬!+>ç§è9zóV±>.¶ùHs¹¡žIÊY‡&pÖ@£Â¥ħ%©@ w¯ïZg–ŽÍMF!µ‚Üvôqì R&SzÔŒ”×ZDW-JبáÐíõê#+°Ö˜qÃÓÊí Öb(*j/#ýˆÑ,¢ú+kZ‘iºç‰JöO$^¨ ;½Zó¢ œ„ÊdpÕ݈F^©…;Jb%qIL8<³mÏ‹íæë]CŽ¿C‡Ž}e„B\ì†fk|à¼ù¼©‹Œµ†\»T×@‹ÐŠUh¤ÞOb¨J©‘acgåÒƒdsl¥äÚÁÊ%Ú@CIž0Í$&8pC?°]¦‘:ÉBRn” NF7¦h¬žó£"E7$AÌI¦4[}ps E×ÝWbøZ,¥´gØÛ—ï6®¾’É}e~=aeõ0Uì²dƒhiC˜k—0 šê+Ͼ'Sõf å¹™By”ËÓà2ñSicû\(c¥Ùþ}¥L7¨ ÓR1ÓœT»’'U¼íf¹‚àmºíiRfˆ ë×»=úH}6Ã?èKØ ðÍÓhÀ¿äø¬3œoå3<ô½àÿMŒîbÚ@QRyì x_^ô½Ð΂LÄŒ3äèØƒ­”Á†b^Ú¶ „½¸Éä1ÝVƒ °VN•ÀÛS=VGÔ}»)çiœ:´°ï‰·>ØU±¡O±+ì‹ýiÃæ|ªÎ8ÖxcIvœà*õÏ+£ÂU#dKÓ®Ýþ0YC¤Ö^/8co`Ó𠕺£é‡ÀÓJ†QJ]H¸Isj#Ý¿~hî Mâ'AÊRP\¤é‰ÏèÖ ²¤-Wê:È(ÈÇAáFÿ^XÝäDY¥¢#/”B¶ƒfï8“+’4“ºlÔï VV³…Q£Úï­ùñÐ ^ÊÛéÌ›G2&¹¸+aÐp³ †~ Ô_âÆ‘ÍZ¥¯^Ô/âCÃã0©ø<óÏ2LAP@(,˜D*拉O,ó9g€SyJÝœŠŠ‘â’fÖ*.Qšä‚•wKõ;ŸÈQlAýŠœ^ë¦Ô{½˜ß²1ˆ ú_b ›VÞý ®‰ô2û“=£B¾‡Ij!ª ’X uà83»×T«¯#ðn’åç•*ÖªÄ µ8'a*h_ÃÁ )fñr_µJM\¬ØPÑkÞ {C¸·w¯*Åö¦0’Dåc¿óŵ©’e®ŸN;õ-ïY.O1¿3³O½µÙ.þŠ?ÿûøàendstream endobj 105 0 obj 3152 endobj 109 0 obj <> stream xœYÛŽãÆ}Ÿ¯høe©@j³ygÞâ ŽƒìN³Æ‚"[3ôH¤ÌËÈãoØÎ©¾±©‘c±;³R³»ºêÔ©SÅ_XÈ éùYŸî¾|Ÿ³Çñ.dw¿Ü õ%3?êûê úàþp§Ÿ,X^Ƽ(ÙýéNˆ’—EÊî/wÁ±Ý×ópÜMóÔmuüÄ7Ì|ºÙEiÈC‘硪өíÙÍG6?Ýÿý.ÎØï›;Nce!¾¥5}®Óq¹Òŵ Õä.tòo',]6 ˜2ʯnRAŸŽR%¸z¤?OmßìçÐ8¶Ïpqš(ûrdWä¼øº6%‹-‰ÅØSeRE¨0DH6·3 _àØe³œgÉÛͤìÙcê}¿ÚL˜Ä¹µêEjØ“K$oY$æËmµJkgIÐ5„`¨²Ìæ©Neø¦SΪµ{+ƒHí]ER´Á—ïa’aø¤àEa­"^þ¤ùÔví¤™Y=`+B F–~(4€™ K?^Å0šžMßÍ‹j‰pö7ìŠVtæÙ…ó>é­nX'”§6M f£”±e=¤d$”«þc\õn¤$áQ–6¨±YŒÀ{!ÉôÂQ¤Ý°Qàô¡|…«2C%Jnì~XvO¹XPe7ïµõ©?I¤ÄÇ@ÅepœZøžbÐ)×·‘Є!Àz6P—Þg’|Á“TÜ ã?'€Dt³ÄÄ¡½xšù¸ÑäŽÔ²] þ*ÃuÅ#Tz\jªpÓUÈI`då (šZ#Þexno;\‚R`#ÿ7ŒQ°3Û,W"$}W¶*÷óÈÄÆ…<ßw t¹Š±¸sS€‚_¥óÞ*ÅikU7`å雦£úíÜc»§ßu±ëØ §yèPôêgˆ‹Îˆ T±Ü#íê¡?RÞ!*ƒLÊZÜ ‘cûØH{ƒ–ÅæL  ¯¨ÉÈ51 { EìôØ×Ï&ß oI·¨Œ´ÈP:Š ùX=J*ܾœÀƒ‚ÈÙ•‰¨4eÂÏ‹%¶†JÓ(²;Aiöbç³Ïø‹‹ÖC{†º„BØÛœ`‘“â¥ç®×5§†BîH‘b)ލâFŠ*+ð4á×ÊXV=nÒÃqTmÇÙ=Ý«:Žºº“TÎó2 º:izôÔU°ÑEWÿT@î.ç…QU««ß Çsß©¸Uµ.|}§CLV_ìGœÏÇv§¶ÜÙ=-ÅÖ=øN¡Kv”óh)ÙãèǶŒ­ˆ È} „Çqé¬Ìl!‡G¿4”ÇÙ¡dÒm3D!‰â UXïÅœ&˜Gâ²Øçþ8\Ðè¥í¡pIë®á§Õ…¶ s(½QáÄ1¬ù|<ú˜ ue¨„Qz%ÖÔCó‰´Ç‹v5D{…®eO o#IõKñó<ØÖó±ÞÑÂe̓ Ÿs£ÃtU™tî+¬-ŽÛFï »HÚfžLJõ(–®PPí;“i:/la"¨ŽKN_¹ÓÞð¨>Ê!éñ(ÉÂÈ ¨PW10µh*z©0RNúÍ’-ÿË “¶ÄÓFZt=FbEÖÕ¬IIJ_°åŸ‘`Öh-#’uoã xê('xoA5ȤäÿU–;£|/Z Î4Ó¶§“lZôX€šIÕ/I£‰»íjý NH»S)Aä®sª ‹AÐÐFKÄjÄÔ r7R]÷@'/q݈S— brÿ§‡à»ÃÒBQ)T M¥wêÏÌâd„WVꢺ µþ[f{ ÄâºRÇqŒÚãæižG‡ 0á”òÔ+cH ½HêÝŒD±[â¸ÝÒ¡@ÄŽßC[FÚu•a$Ü2îpÜ®òÔµ¦ºƒ0ô¼0ʃ—¶™Q}Gpö^žäi/Mû+'9z#_€‘ù £ç>ÕGYuóùÆ È[z;fBá)—Y]$¢ETKIy˜hyãØ8²Ï];>ÉfkF’s§gsl˜»ŽµtdZ®X{í_¯Gx¿Çëïl«p›Ô?n.>„©Ij¡IÊQr¦.GÖv³ò9>®ŸàéßäÐoõa™x!áà÷mׯTŒ´ãÖC¯p€²–¡³?=@;QE‚QuhÀ>ê à¯$ø#˜¶N•ÖO{]ÌO磜ü™°ê»¼þm¤ÿèÉ´jݾþ÷ûï•$ qH7×p³Ûy=™@â$®^@æF Ìâ ¯–z!Jž/%Ǩ.»dÑV—W?G–‡-G?Îu-G¥”­Í”u›?ÎÞjY$YÀ—KFmEªï‚fÓtÔ‡ßoÙ×òù3ZRU¨¤ÿT•á~CC…"+ƒ¡­ŸG¾Ä..¸“îÁÃèÕwº>KICÑ-„ú8ª9l?4ã–é¢#“"ö˵7@\Ë-> stream xœmVÛŽÛ6|×Wð-2°fHŠÅ×¢)Ò"-ÚTEìW¢mv%ÑéuÜoÈG÷”|ÙÆÂ ^ÎefÎÐ_Á‘ð™¿Û!{ý^ ­ËÚf_27ÑüÕè§Ôa¡ÙdéE‚!! \KÔ ¥˺DÍ1»Ï{óئ~íÞNFõyñ°BóêjÍJ‚ -óýd·“3nѯ¬>5¿eE…Öð×tÁE]„ ùßvÐÈïà¢CjÒhÔ«æßl ý@m&fê"áVþ7®Ãå6“˜Õ²æóæäÂ& ®“‚Î;ˆÛ!å Ê›Võýé&Œ¨á?VϧïÆë0ÅeÃzt4¡R4zoÐN]¯Ý4ü´ÄcéšÄ%aó5½¹ŽW•óz 0¶Ò+ZbB¸Ì¿ªaßkÔZûd´CÎ8Ùj`B¨uA*L$EkÊbš£J5DÔ(ÅeµTpŸŸüŠq U¹u1L,‡Q\UrÆ–¤ZVQyd\l7¦wqÙŒ^O› ”ó*W­ÆKMLðñõ{ ʲ âZWÀOAB‰®c‘¿Ø äFùÛÑz ¼¨“q`±®Î-ÞÓOá((^¢X”UÔЬ8$p` /¨WP+Pt#¦HÌ¢†É|ý:¾ÔUá‚Uìe A=šÞøò9@¦Ý!{],*No¤Ê1+ÅwR½Ï'¿â¬ÄUMsÛ^1Â1¹„ØÆ(¬0—zD¬ÝÌ{–æ P£Ûè) A\) _¿[Û…áõ¶Ê%¤×4+y¹‰(òƒé}ÔÂÁ…ñ‡.ÐÏïÞaôÖÆ"Y!€é9ÑñÖu@œœžÑ{^6ùwLÂ¥f¦;tºh¨À¢õ‹~í ðUVoqwÞô=ÀÜp„“èBJ&BãfƒN©7ãSbC!热&5VU™úÿ!Å‹âD¤ì (<ÚvkÇo[¹pnõ¨'˜%жñi eÀ¶[{ÖýC¥ÿüñëÇu°ÁèòX’¨yV‚ÕÕâƒWöÌÀÄ"ó“ózpðª®ÜÎú=·¾ú^w1Vq\³â²üìO¯õtee C±¤5ç´ ÖÂj ÿ û:3˜^M1åth½–’¦C.&Yð½äa„a¹ôw·»òù%¹êÀ…¾ÅWb€qÙ«-HVûÏóW\ÓÃ_ŽŠ¨z‚¶5Z”wEóg•/nìPg6I)¢ÊÁô@Ï‘Z€wÐKØùyדƒfC䅘ܡdF|–wª ¦7éAÅx!G]ò\õ¦ƒ–œð$±ÍinXÒ@+¸E8íF,ù;g˜×˘äA|Ÿµr§ÏN{»÷égÃ̓PS,Ï6‡‡<áHe…9Cë’ó$­ÁÝoßy£5txõàå¿íŒw ‰áAŠÎXXzÓdÁç•azêendstream endobj 115 0 obj 1188 endobj 4 0 obj <> /Contents 5 0 R >> endobj 12 0 obj <> /Contents 13 0 R >> endobj 18 0 obj <> /Contents 19 0 R >> endobj 23 0 obj <> /Contents 24 0 R >> endobj 28 0 obj <> /Contents 29 0 R >> endobj 33 0 obj <> /Contents 34 0 R >> endobj 38 0 obj <> /Contents 39 0 R >> endobj 43 0 obj <> /Contents 44 0 R >> endobj 48 0 obj <> /Contents 49 0 R >> endobj 53 0 obj <> /Contents 54 0 R >> endobj 58 0 obj <> /Contents 59 0 R >> endobj 63 0 obj <> /Contents 64 0 R >> endobj 68 0 obj <> /Contents 69 0 R >> endobj 73 0 obj <> /Contents 74 0 R >> endobj 78 0 obj <> /Contents 79 0 R >> endobj 83 0 obj <> /Contents 84 0 R >> endobj 88 0 obj <> /Contents 89 0 R >> endobj 93 0 obj <> /Contents 94 0 R >> endobj 98 0 obj <> /Contents 99 0 R >> endobj 103 0 obj <> /Contents 104 0 R >> endobj 108 0 obj <> /Contents 109 0 R >> endobj 113 0 obj <> /Contents 114 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 12 0 R 18 0 R 23 0 R 28 0 R 33 0 R 38 0 R 43 0 R 48 0 R 53 0 R 58 0 R 63 0 R 68 0 R 73 0 R 78 0 R 83 0 R 88 0 R 93 0 R 98 0 R 103 0 R 108 0 R 113 0 R ] /Count 22 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 10 0 obj <> endobj 11 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 21 0 obj <> endobj 22 0 obj <> endobj 26 0 obj <> endobj 27 0 obj <> endobj 31 0 obj <> endobj 32 0 obj <> endobj 36 0 obj <> endobj 37 0 obj <> endobj 41 0 obj <> endobj 42 0 obj <> endobj 46 0 obj <> endobj 47 0 obj <> endobj 51 0 obj <> endobj 52 0 obj <> endobj 56 0 obj <> endobj 57 0 obj <> endobj 61 0 obj <> endobj 62 0 obj <> endobj 66 0 obj <> endobj 67 0 obj <> endobj 71 0 obj <> endobj 72 0 obj <> endobj 76 0 obj <> endobj 77 0 obj <> endobj 81 0 obj <> endobj 82 0 obj <> endobj 86 0 obj <> endobj 87 0 obj <> endobj 91 0 obj <> endobj 92 0 obj <> endobj 96 0 obj <> endobj 97 0 obj <> endobj 101 0 obj <> endobj 102 0 obj <> endobj 106 0 obj <> endobj 107 0 obj <> endobj 111 0 obj <> endobj 112 0 obj <> endobj 116 0 obj <> endobj 117 0 obj <> endobj 15 0 obj <> endobj 9 0 obj <> endobj 118 0 obj <> endobj 8 0 obj <> endobj 119 0 obj <> endobj 120 0 obj <>stream 2014-01-29T08:09:48+01:00 2014-01-29T08:09:48+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 121 0000000000 65535 f 0000065959 00000 n 0000069462 00000 n 0000065749 00000 n 0000062173 00000 n 0000000015 00000 n 0000002622 00000 n 0000066025 00000 n 0000067875 00000 n 0000067736 00000 n 0000066066 00000 n 0000066096 00000 n 0000062333 00000 n 0000002642 00000 n 0000005667 00000 n 0000067668 00000 n 0000066135 00000 n 0000066165 00000 n 0000062495 00000 n 0000005688 00000 n 0000008658 00000 n 0000066215 00000 n 0000066245 00000 n 0000062657 00000 n 0000008679 00000 n 0000011793 00000 n 0000066286 00000 n 0000066316 00000 n 0000062819 00000 n 0000011814 00000 n 0000014370 00000 n 0000066366 00000 n 0000066396 00000 n 0000062981 00000 n 0000014391 00000 n 0000017091 00000 n 0000066435 00000 n 0000066465 00000 n 0000063143 00000 n 0000017112 00000 n 0000019920 00000 n 0000066515 00000 n 0000066545 00000 n 0000063305 00000 n 0000019941 00000 n 0000022402 00000 n 0000066584 00000 n 0000066614 00000 n 0000063467 00000 n 0000022423 00000 n 0000024642 00000 n 0000066664 00000 n 0000066694 00000 n 0000063629 00000 n 0000024663 00000 n 0000026965 00000 n 0000066744 00000 n 0000066774 00000 n 0000063791 00000 n 0000026986 00000 n 0000029989 00000 n 0000066813 00000 n 0000066843 00000 n 0000063953 00000 n 0000030010 00000 n 0000032987 00000 n 0000066873 00000 n 0000066903 00000 n 0000064115 00000 n 0000033008 00000 n 0000035855 00000 n 0000066953 00000 n 0000066983 00000 n 0000064277 00000 n 0000035876 00000 n 0000038009 00000 n 0000067022 00000 n 0000067052 00000 n 0000064439 00000 n 0000038030 00000 n 0000040843 00000 n 0000067082 00000 n 0000067112 00000 n 0000064601 00000 n 0000040864 00000 n 0000044516 00000 n 0000067162 00000 n 0000067192 00000 n 0000064763 00000 n 0000044537 00000 n 0000047594 00000 n 0000067242 00000 n 0000067272 00000 n 0000064925 00000 n 0000047615 00000 n 0000051223 00000 n 0000067311 00000 n 0000067341 00000 n 0000065087 00000 n 0000051244 00000 n 0000054327 00000 n 0000067371 00000 n 0000067402 00000 n 0000065251 00000 n 0000054349 00000 n 0000057575 00000 n 0000067433 00000 n 0000067464 00000 n 0000065417 00000 n 0000057597 00000 n 0000060867 00000 n 0000067504 00000 n 0000067535 00000 n 0000065583 00000 n 0000060889 00000 n 0000062151 00000 n 0000067586 00000 n 0000067617 00000 n 0000067818 00000 n 0000067958 00000 n 0000068038 00000 n trailer << /Size 121 /Root 1 0 R /Info 2 0 R /ID [<673B2011F8C2B02C1F1883B2DF7A8E4D><673B2011F8C2B02C1F1883B2DF7A8E4D>] >> startxref 69616 %%EOF curl-7.35.0/docs/libcurl/curl_formfree.html0000644000175000017500000000427412272124467015616 00000000000000 curl_formfree man page

NAME

curl_formfree - free a previously build multipart/formdata HTTP POST chain

SYNOPSIS

#include <curl/curl.h>

void curl_formfree(struct curl_httppost * form);

DESCRIPTION

curl_formfree() is used to clean up data previously built/appended with curl_formadd(3). This must be called when the data has been used, which typically means after curl_easy_perform(3) has been called.

The pointer to free is the same pointer you passed to the CURLOPT_HTTPPOST option, which is the firstitem pointer from the curl_formadd(3) invoke(s).

form is the pointer as returned from a previous call to curl_formadd(3) and may be NULL.

RETURN VALUE

None

SEE ALSO

curl_formadd (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_version_info.pdf0000644000175000017500000002036312272124471016306 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœÕX[oãÆ~ׯ¤¦ k<3¼ï¦Òd6pvS[MØ…A‘#‰»©pH+JÛÐÝsæBR–ÓÝ}h±€íå\Î9ßùÎm~!ŒrÂðŸýïf×·1Ù¨#›Ù/3®‰ý•ïÈŸ–°!ÁËõÌœá$$N}š¤d¹›yyßVOó凙i–ÅŒó”úœ,³{O¶ªlêDz^7žÿ0'U¹Â3ó…e,ö¾Ïê>«ˆ½è¯Ëïf~R?5w]€¢Œ òsP/õh¢†‹þŒS²ð#}ôÝ׸™á>Ò0õí•ß¿Áï£e‚Ñ€ÅdÁ.3£¸Õ‡‡S È‚´²ëÛZ‘¶¯]¹“Î 2ÙKp¯6åT?ÐkÁ#šh-î~~÷þ‡»·wF—Ôꢷh=¼?”u^õ…$_âý×øƒn¿ÒPdy3[^ŽZj(ý‰ªsÐ4±×<Y—‘K»3¥iúá‹;<òÍ_nožo²†pæà 8÷tǽ<µ ôÓÄ®?Ì_ËŒSߟ`ñí›»onßþ°|ûþÝ©kF8ÀB?F×x·ÖÙ7eÝÉ–t üçŸU% @ž¨®íóŽÊn«Ñî²’­š¾#†«ADC¸Ž¹›#}sÖ–M?qíZf J*¼Õº™ý0¸ŸÒè ‹!fRÊÓˆÛuµmúªÐP\C`Qlx·’DÉMê¶R“ \ëÇŽY;—Ьû:G«²ªìŽduÔ»µÒǦ'‡¶ìô_-ٷͦÍv”,ñØÁXàS «VvÔÐ8J0T'ibCÙ»ª†J( :ÐnÐ,ýeU‘¬²áÉñ@Èi Ö²1a!bNþQH(Ås*  qèî¶Ùƒ·­»mÖ˜Húº”º¬.Ô9lËJº%íADhÝ£CÉ®Ül;²œ3R”k”°„F±3{-[YwÖUfá4=%¨?æýøæöèûøî½†XÐÐXb*4—þtbŒ tàwTpרrLÒISƒÂM«¿ýÚ¬=jïn3‡²‘‘$”;¯ø²'IÊQVh§.`k#啾Ãç1å`f”Á60þH^Ì€ÞKû¡É??a¸£ù Á†Ki`¸í}½ßWe®ƒQ ¤WÒz©@þ}±#4Ûë ;xmß(U®À«°^4©›î NªNf†F¯`3ɛݭC‡Ý£¼=°Áu¾•ùG H¦Hq¬³]™_{sc.!Øó¬FoäÛ¬ÞèŒRȽ„è‘5É&FÐùÅ$/ÁM/bf2°¥mÕ4HûxB“þp4‘ÝດÆr³]˜´Óx" 8¾:íríü ÷„Ž®÷žIé<œV’mäk]‚™w} G’Bª¼-÷ÿ•¬šõ’”†.£.§ÌBýìµVN°€ŽºÁ凭¬É¼ àf†nÛBøÉÖd&@fWž¯FûcÈEŒ9Ér·Œ†ãùrÓHñi¦ &qvïUª!r¡¾Þ¯¥ê^‘ËkÇX¦CÁVßüÛ! Zr©kFˆ9ÓÉàZðÁµ'¯ÉµF%ÄÏl%oÛï€L-°3CÞ‚‡Ÿ—)5 ŠGGõµ*7µf\Gž{ì±îw(…ÀoÙ–9\º‡Ê¤4!c­0”×ÁDÿ-$t· ²§è”ßU /Á㨃+pÔ×G<º*»]¦>^iÖœ1%„Äö™Lá±OÓo­©R¶› Bʇ¤^D;þÐJžW5°4Jc4J\ÏÂÙD–ÃwAùT$$ LaÅÕ³ÒêÇ>ûŒÒG~“m3èCÿŒ˜úòÓoÏY¡ñI_N¯¹„ŠØ5yS¡WcͽZA,`z–Ý&¿2ŸòÅÿnŸZŸ6 H|ŸŒ‚1”0ð¤æ‚‹FðÌøTâ¿ÕRHò"Á>…”¡‚Þ”ŠðwùV5˜Ëã!ôÿ-^çvûÿ/A—`üÜOÍ(ôd'Ñ ˜„1w9hš"yÊIµýÓÅ#‚çîCñOÓžàÛ½yQl¥`:‚‡ØÍT^–.p'£¢{²ÙÏDä™è…»xÈÏÁL÷L™0 AO'·¯ø×@wèb-‡ÌÒpÖÑù;å‰!MJÙ0NL¦]ât¼ÚŒͯȗ ^­È.û€sŸ–ðùûø½¬_únç%mÿ™óöÈw‚’çX™€ånD·ÑË`ÚJWÚ·?0 fGö+‹YÊ»øPå'Ôâè\œKi54ôqÂóÂïz˜ê¡¥¦ÀD®rTõÍrögø÷/ȇߘendstream endobj 6 0 obj 2150 endobj 14 0 obj <> stream xœX]sÚJ}çWÌÛ·ÌD3£Ï}ÃI¸K0”¤ví-—c£!0›û²ÿy»g$0¶+)»ìÍtŸ>Ý}¦G߈M±ñ§þŸlzoæ>yP=›<ô¾õ˜~HêɆ\F° À/¢ûžÙÈω „$Úô¬dWfwýè¯w© ¢U± F¢}ïÆ’¥J‹ü.Íï‹[KÜöI–.qOÀ]›Ú¶o}Œó]œ‘ÚТ?z"p©­'ÐÕ›9³kTá;ÔÉ@xzùºP•YrÀRÇöcΦ,kd©"qNb•¤)QU™æD­‹>whúžµÇ/öë¸"h’ ÿrW€…Tømµu0dßg ]+VdÙ—aà:Ö.Í*ûtTœúè:é \ëúÐE‡}î ÚÌR+½ÒÆU€Ãü†…T%†5€Ü¹ø˜¹4ôl^?~”øPï ) ΄UÊY~'1IŠ|  ? -È€qMˆ!ãÇî”D%eº­HQ%+ÜW­e7œ‘yß±­Ç´,òÌ+ª·ÂMzÑï7Ö½Œ«]Ù>¤9`–TõÒ&1¡­q&Šu܉êÉcaØäM P”ä‡P™G}ˆµ^¡Ÿ¹¼ ðcØÒ2­FsÉ^éx a%Ͼ“•ü‘#?¸$.å?´{Ǧ¾ F`=ÐØ®>Í'wŸGóÅøzz7ž}öp”[Í ¥vÛmQ‚ñìÑ3{Çí7ÝýÿÍ/Gs¤ðzá˜j?Xº9šúj Êñ þ—²,”Cn­ýZæd§°0ßE3hÜÞqÖõµXLžƒ Àà‡(š-Þ€­4æ­5\­€Ž4'>e¶é´¬OÆ—ÿ~Î<zÿW² ò÷O»˜F“/ºÀ`5n[¥Þ»'Yx¿XLGï¯û¢®ìh<ì3Ƭhô|J´CØ8˜Ê>tH—°Š*ÅÏAx’œ oG—dëÓû'.ªðBîGU ¹oTeŸVk`¸Õœ$‰·ñ2ÍÒ*•ê— áË„÷ô†çÅ8‘>Î H^8‚ÜHhD’2N¾b%@ûÁ)hJ"TUøÝÄiZÜþJ–Ru‘LL»£Ê48Ö`¾Õ4`«Ë@xž.ÃÅ¿¦WÞNݪöï4l̆ïz&l´ë¢ÂóF¯¼ &êÈD]J œ;ßód "ZìÉã$YQ|ÝmÕ:i²&q–Áa„uæ„Ö^5“æ$ Á<«•ó¿qR™rw?bv¹–Ä*ÝÈbWaEÈŽÀ:pÒä³>B…3åô¹±ò¢/l®ëüËñŒ@w`7HÒ|¥Ï(æSW4ß V¸{*ƒ*œIœe…©‡–ª¡Æ­’›Q„&–,^BéBÝ}Á¥Ì‘ {ç{e }Åg0ïs4Ï`Ô„¸Œz^+·k¼5!ï”4þ\Dۭ룾ç@Tƒ†"ˆ”Ÿtòäzé`ï~‡™%Ë–0o<4¸¿>|F“ŰïºÖ§èÃÝb>ûõñ¯Í4Æ85ÔøŒ†5Á½µäPEp%«Ÿ´ðsvÀðó»/—§y·ù“áðé”1‡5y·ùKy×ͺ’Y3¸Ø&0¸£6ÿ¡­[¢uõ5Wuèi0›/A/ÈZf[YârßøS¶€cˆŸ! :0pýS’Ln'[8­Éƒ¾ýjÂç­k„ÊîÁy“R,È“û°ã7•l·ßP Wãqó†IÁb½ÞÊïp‡©À¼'AYžÝ“ã\ óe¡/|5³æÝüN?M&æ?8@rNŠÐLÎ}<Ý|¨+  þ±ƒû5·íÐ®×”ÇøGQïOøù?°+¹endstream endobj 15 0 obj 1880 endobj 19 0 obj <> stream xœmTËnÛ0¼ë+öHCRO݇n‚Úr/v02(%G”¤ßÐî’’âÔ)d@0Å™òåÀì3¾‹ƒwµLáÑx ½»0¾Š|ÉqCfò½7ÔpH¤2¤™„üà‘¢o«û_~þ쉘F¸!ßyœKrÈ_½ Ñ­)›ú¾¬÷Í–„[ªòÁÖøˆe,%ßTÝ« F Ÿùf1 å€õ À¶ºZr6² Â4¢©„ Lìö 1atëK*¥H2âªëþàOjI³$âCFE |KÝ“,ÐmY ¯»£®W«üòy„LŒŒp3&"¢ª^ƒ2°Ój½ƒ‡71ÛæY…ëý$ž”q|‚‰FÀ…#bIº[húã±i»KDCVøcôL¼@Ò /¿ØþídsgjèdŸIŽ9™ÌÉN©ªa¶úz} ¦kËú¶‰·ÚöB'Fí"µoýs5v¿åð™ôíz± #“ÓÔ&.•`Ù[?B;y,IÓ5ES™3ö£Y<†‚S&¤³ÊŠ€cSÖn¡k¬"Õ¶ê š=Oª…‹é«¹„¢©;UÖV©›±:hcÇ3ôÃ5Õ½kuëx0öž†Dã$Ò²%½±pUã ëPÌÉ«n e4Tº³]­U96›ÚŒ]ºl9üg£ójóš±(%M_a„4ô£TÖ°^.Ì1³Õí¡ œ?–ÑbˆA­º!€ÊùºîÚ7?AjYÄÉ4‰–RÇ'AY ͆),çùzy ?|bMÂÉl±ž»*Aqña®ÐùAfGë³ß1')—rÊØ‡ÁLœÇôýNuÊÆ¯ÇòzxG8¼wŽd5ŸÃl±º;; ':›ñN:»†ËãßL9õq$èÂiø)Å,ñ‡) '¸û¦¯5Ƥƒˆ’p¼žBËcž{ßñù ÁŽ}Ñendstream endobj 20 0 obj 717 endobj 4 0 obj <> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 18 0 obj <> /Contents 19 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R 18 0 R ] /Count 3 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 21 0 obj <> endobj 22 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 23 0 obj <> endobj 24 0 obj <>stream 2014-01-29T08:09:45+01:00 2014-01-29T08:09:45+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 25 0000000000 65535 f 0000005594 00000 n 0000007628 00000 n 0000005521 00000 n 0000005037 00000 n 0000000015 00000 n 0000002235 00000 n 0000005659 00000 n 0000006064 00000 n 0000005999 00000 n 0000005931 00000 n 0000005700 00000 n 0000005730 00000 n 0000005197 00000 n 0000002255 00000 n 0000004207 00000 n 0000005780 00000 n 0000005810 00000 n 0000005359 00000 n 0000004228 00000 n 0000005017 00000 n 0000005851 00000 n 0000005881 00000 n 0000006146 00000 n 0000006205 00000 n trailer << /Size 25 /Root 1 0 R /Info 2 0 R /ID [] >> startxref 7782 %%EOF curl-7.35.0/docs/libcurl/curl_multi_strerror.html0000644000175000017500000000356412272124467017106 00000000000000 curl_multi_strerror man page

NAME

curl_multi_strerror - return string describing error code

SYNOPSIS

#include <curl/curl.h> const char *curl_multi_strerror(CURLMcode errornum );

DESCRIPTION

The curl_multi_strerror() function returns a string describing the CURLMcode error code passed in the argument errornum.

AVAILABILITY

This function was added in libcurl 7.12.0

RETURN VALUE

A pointer to a zero terminated string.

SEE ALSO

libcurl-errors (3) curl_easy_strerror (3) curl_share_strerror (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/Makefile.am0000644000175000017500000001174412262353672014133 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2012, 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. # ########################################################################### AUTOMAKE_OPTIONS = foreign no-dependencies man_MANS = curl_easy_cleanup.3 curl_easy_getinfo.3 curl_easy_init.3 \ curl_easy_perform.3 curl_easy_setopt.3 curl_easy_duphandle.3 \ curl_formadd.3 curl_formfree.3 curl_getdate.3 curl_getenv.3 \ curl_slist_append.3 curl_slist_free_all.3 curl_version.3 \ curl_version_info.3 curl_escape.3 curl_unescape.3 curl_free.3 \ curl_strequal.3 curl_mprintf.3 curl_global_init.3 curl_global_cleanup.3 \ curl_multi_add_handle.3 curl_multi_cleanup.3 curl_multi_fdset.3 \ curl_multi_info_read.3 curl_multi_init.3 curl_multi_perform.3 \ curl_multi_remove_handle.3 curl_share_cleanup.3 curl_share_init.3 \ curl_share_setopt.3 libcurl.3 libcurl-easy.3 libcurl-multi.3 \ libcurl-share.3 libcurl-errors.3 curl_easy_strerror.3 \ curl_multi_strerror.3 curl_share_strerror.3 curl_global_init_mem.3 \ libcurl-tutorial.3 curl_easy_reset.3 curl_easy_escape.3 \ curl_easy_unescape.3 curl_multi_setopt.3 curl_multi_socket.3 \ curl_multi_timeout.3 curl_formget.3 curl_multi_assign.3 \ curl_easy_pause.3 curl_easy_recv.3 curl_easy_send.3 \ curl_multi_socket_action.3 curl_multi_wait.3 HTMLPAGES = curl_easy_cleanup.html curl_easy_getinfo.html \ curl_easy_init.html curl_easy_perform.html curl_easy_setopt.html \ curl_easy_duphandle.html curl_formadd.html curl_formfree.html \ curl_getdate.html curl_getenv.html curl_slist_append.html \ curl_slist_free_all.html curl_version.html curl_version_info.html \ curl_escape.html curl_unescape.html curl_free.html curl_strequal.html \ curl_mprintf.html curl_global_init.html curl_global_cleanup.html \ curl_multi_add_handle.html curl_multi_cleanup.html \ curl_multi_fdset.html curl_multi_info_read.html curl_multi_init.html \ curl_multi_perform.html curl_multi_remove_handle.html \ curl_share_cleanup.html curl_share_init.html curl_share_setopt.html \ libcurl.html libcurl-multi.html libcurl-easy.html libcurl-share.html \ libcurl-errors.html curl_easy_strerror.html curl_multi_strerror.html \ curl_share_strerror.html curl_global_init_mem.html \ libcurl-tutorial.html curl_easy_reset.html curl_easy_escape.html \ curl_easy_unescape.html curl_multi_setopt.html curl_multi_socket.html \ curl_multi_timeout.html curl_formget.html curl_multi_assign.html \ curl_easy_pause.html curl_easy_recv.html curl_easy_send.html \ curl_multi_socket_action.html curl_multi_wait.html PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf \ curl_easy_init.pdf curl_easy_perform.pdf curl_easy_setopt.pdf \ curl_easy_duphandle.pdf curl_formadd.pdf curl_formfree.pdf \ curl_getdate.pdf curl_getenv.pdf curl_slist_append.pdf \ curl_slist_free_all.pdf curl_version.pdf curl_version_info.pdf \ curl_escape.pdf curl_unescape.pdf curl_free.pdf curl_strequal.pdf \ curl_mprintf.pdf curl_global_init.pdf curl_global_cleanup.pdf \ curl_multi_add_handle.pdf curl_multi_cleanup.pdf curl_multi_fdset.pdf \ curl_multi_info_read.pdf curl_multi_init.pdf curl_multi_perform.pdf \ curl_multi_remove_handle.pdf curl_share_cleanup.pdf curl_share_init.pdf \ curl_share_setopt.pdf libcurl.pdf libcurl-multi.pdf libcurl-easy.pdf \ libcurl-share.pdf libcurl-errors.pdf curl_easy_strerror.pdf \ curl_multi_strerror.pdf curl_share_strerror.pdf \ curl_global_init_mem.pdf libcurl-tutorial.pdf curl_easy_reset.pdf \ curl_easy_escape.pdf curl_easy_unescape.pdf curl_multi_setopt.pdf \ curl_multi_socket.pdf curl_multi_timeout.pdf curl_formget.pdf \ curl_multi_assign.pdf curl_easy_pause.pdf curl_easy_recv.pdf \ curl_easy_send.pdf curl_multi_socket_action.pdf curl_multi_wait.pdf m4macrodir = $(datadir)/aclocal dist_m4macro_DATA = libcurl.m4 CLEANFILES = $(HTMLPAGES) $(PDFPAGES) EXTRA_DIST = $(man_MANS) $(HTMLPAGES) index.html $(PDFPAGES) ABI \ symbols-in-versions symbols.pl MAN2HTML= roffit --mandir=. < $< >$@ SUFFIXES = .3 .html html: $(HTMLPAGES) .3.html: $(MAN2HTML) pdf: $(PDFPAGES) .3.pdf: @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \ groff -Tps -man $< >$$foo.ps; \ ps2pdf $$foo.ps $@; \ rm $$foo.ps; \ echo "converted $< to $@") curl-7.35.0/docs/libcurl/Makefile.in0000644000175000017500000005664012272122666014146 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2012, 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. # ########################################################################### VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = docs/libcurl DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(dist_m4macro_DATA) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \ $(top_srcdir)/m4/curl-confopts.m4 \ $(top_srcdir)/m4/curl-functions.m4 \ $(top_srcdir)/m4/curl-openssl.m4 \ $(top_srcdir)/m4/curl-override.m4 \ $(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/xc-am-iface.m4 \ $(top_srcdir)/m4/xc-cc-check.m4 \ $(top_srcdir)/m4/xc-lt-iface.m4 \ $(top_srcdir)/m4/xc-translit.m4 \ $(top_srcdir)/m4/xc-val-flgs.m4 \ $(top_srcdir)/m4/zz40-xc-ovr.m4 \ $(top_srcdir)/m4/zz50-xc-ovr.m4 \ $(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \ $(top_builddir)/include/curl/curlbuild.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = depcomp = am__depfiles_maybe = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man3dir = $(mandir)/man3 am__installdirs = "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(m4macrodir)" MANS = $(man_MANS) DATA = $(dist_m4macro_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@ CURLVERSION = @CURLVERSION@ CURL_CA_BUNDLE = @CURL_CA_BUNDLE@ CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@ CURL_DISABLE_DICT = @CURL_DISABLE_DICT@ CURL_DISABLE_FILE = @CURL_DISABLE_FILE@ CURL_DISABLE_FTP = @CURL_DISABLE_FTP@ CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@ CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@ CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@ CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@ CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@ CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@ CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@ CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@ CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@ CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@ CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@ CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@ CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@ CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_SHARED = @ENABLE_SHARED@ ENABLE_STATIC = @ENABLE_STATIC@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@ HAVE_LDAP_SSL = @HAVE_LDAP_SSL@ HAVE_LIBZ = @HAVE_LIBZ@ HAVE_SSLEAY_SRP = @HAVE_SSLEAY_SRP@ IDN_ENABLED = @IDN_ENABLED@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IPV6_ENABLED = @IPV6_ENABLED@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@ LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@ LIBMETALINK_LIBS = @LIBMETALINK_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANOPT = @MANOPT@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NROFF = @NROFF@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGADD_NAME = @PKGADD_NAME@ PKGADD_PKG = @PKGADD_PKG@ PKGADD_VENDOR = @PKGADD_VENDOR@ PKGCONFIG = @PKGCONFIG@ RANDOM_FILE = @RANDOM_FILE@ RANLIB = @RANLIB@ REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_ENABLED = @SSL_ENABLED@ STRIP = @STRIP@ SUPPORT_FEATURES = @SUPPORT_FEATURES@ SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@ USE_ARES = @USE_ARES@ USE_AXTLS = @USE_AXTLS@ USE_CYASSL = @USE_CYASSL@ USE_DARWINSSL = @USE_DARWINSSL@ USE_GNUTLS = @USE_GNUTLS@ USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@ USE_LIBRTMP = @USE_LIBRTMP@ USE_LIBSSH2 = @USE_LIBSSH2@ USE_NGHTTP2 = @USE_NGHTTP2@ USE_NSS = @USE_NSS@ USE_OPENLDAP = @USE_OPENLDAP@ USE_POLARSSL = @USE_POLARSSL@ USE_SCHANNEL = @USE_SCHANNEL@ USE_SSLEAY = @USE_SSLEAY@ USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@ VERSION = @VERSION@ VERSIONNUM = @VERSIONNUM@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libext = @libext@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign no-dependencies man_MANS = curl_easy_cleanup.3 curl_easy_getinfo.3 curl_easy_init.3 \ curl_easy_perform.3 curl_easy_setopt.3 curl_easy_duphandle.3 \ curl_formadd.3 curl_formfree.3 curl_getdate.3 curl_getenv.3 \ curl_slist_append.3 curl_slist_free_all.3 curl_version.3 \ curl_version_info.3 curl_escape.3 curl_unescape.3 curl_free.3 \ curl_strequal.3 curl_mprintf.3 curl_global_init.3 curl_global_cleanup.3 \ curl_multi_add_handle.3 curl_multi_cleanup.3 curl_multi_fdset.3 \ curl_multi_info_read.3 curl_multi_init.3 curl_multi_perform.3 \ curl_multi_remove_handle.3 curl_share_cleanup.3 curl_share_init.3 \ curl_share_setopt.3 libcurl.3 libcurl-easy.3 libcurl-multi.3 \ libcurl-share.3 libcurl-errors.3 curl_easy_strerror.3 \ curl_multi_strerror.3 curl_share_strerror.3 curl_global_init_mem.3 \ libcurl-tutorial.3 curl_easy_reset.3 curl_easy_escape.3 \ curl_easy_unescape.3 curl_multi_setopt.3 curl_multi_socket.3 \ curl_multi_timeout.3 curl_formget.3 curl_multi_assign.3 \ curl_easy_pause.3 curl_easy_recv.3 curl_easy_send.3 \ curl_multi_socket_action.3 curl_multi_wait.3 HTMLPAGES = curl_easy_cleanup.html curl_easy_getinfo.html \ curl_easy_init.html curl_easy_perform.html curl_easy_setopt.html \ curl_easy_duphandle.html curl_formadd.html curl_formfree.html \ curl_getdate.html curl_getenv.html curl_slist_append.html \ curl_slist_free_all.html curl_version.html curl_version_info.html \ curl_escape.html curl_unescape.html curl_free.html curl_strequal.html \ curl_mprintf.html curl_global_init.html curl_global_cleanup.html \ curl_multi_add_handle.html curl_multi_cleanup.html \ curl_multi_fdset.html curl_multi_info_read.html curl_multi_init.html \ curl_multi_perform.html curl_multi_remove_handle.html \ curl_share_cleanup.html curl_share_init.html curl_share_setopt.html \ libcurl.html libcurl-multi.html libcurl-easy.html libcurl-share.html \ libcurl-errors.html curl_easy_strerror.html curl_multi_strerror.html \ curl_share_strerror.html curl_global_init_mem.html \ libcurl-tutorial.html curl_easy_reset.html curl_easy_escape.html \ curl_easy_unescape.html curl_multi_setopt.html curl_multi_socket.html \ curl_multi_timeout.html curl_formget.html curl_multi_assign.html \ curl_easy_pause.html curl_easy_recv.html curl_easy_send.html \ curl_multi_socket_action.html curl_multi_wait.html PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf \ curl_easy_init.pdf curl_easy_perform.pdf curl_easy_setopt.pdf \ curl_easy_duphandle.pdf curl_formadd.pdf curl_formfree.pdf \ curl_getdate.pdf curl_getenv.pdf curl_slist_append.pdf \ curl_slist_free_all.pdf curl_version.pdf curl_version_info.pdf \ curl_escape.pdf curl_unescape.pdf curl_free.pdf curl_strequal.pdf \ curl_mprintf.pdf curl_global_init.pdf curl_global_cleanup.pdf \ curl_multi_add_handle.pdf curl_multi_cleanup.pdf curl_multi_fdset.pdf \ curl_multi_info_read.pdf curl_multi_init.pdf curl_multi_perform.pdf \ curl_multi_remove_handle.pdf curl_share_cleanup.pdf curl_share_init.pdf \ curl_share_setopt.pdf libcurl.pdf libcurl-multi.pdf libcurl-easy.pdf \ libcurl-share.pdf libcurl-errors.pdf curl_easy_strerror.pdf \ curl_multi_strerror.pdf curl_share_strerror.pdf \ curl_global_init_mem.pdf libcurl-tutorial.pdf curl_easy_reset.pdf \ curl_easy_escape.pdf curl_easy_unescape.pdf curl_multi_setopt.pdf \ curl_multi_socket.pdf curl_multi_timeout.pdf curl_formget.pdf \ curl_multi_assign.pdf curl_easy_pause.pdf curl_easy_recv.pdf \ curl_easy_send.pdf curl_multi_socket_action.pdf curl_multi_wait.pdf m4macrodir = $(datadir)/aclocal dist_m4macro_DATA = libcurl.m4 CLEANFILES = $(HTMLPAGES) $(PDFPAGES) EXTRA_DIST = $(man_MANS) $(HTMLPAGES) index.html $(PDFPAGES) ABI \ symbols-in-versions symbols.pl MAN2HTML = roffit --mandir=. < $< >$@ SUFFIXES = .3 .html all: all-am .SUFFIXES: .SUFFIXES: .3 .html .pdf $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign docs/libcurl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign docs/libcurl/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man3: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man3dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.3[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ done; } uninstall-man3: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man3dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.3[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) install-dist_m4macroDATA: $(dist_m4macro_DATA) @$(NORMAL_INSTALL) @list='$(dist_m4macro_DATA)'; test -n "$(m4macrodir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(m4macrodir)'"; \ $(MKDIR_P) "$(DESTDIR)$(m4macrodir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(m4macrodir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(m4macrodir)" || exit $$?; \ done uninstall-dist_m4macroDATA: @$(NORMAL_UNINSTALL) @list='$(dist_m4macro_DATA)'; test -n "$(m4macrodir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(m4macrodir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(m4macrodir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html-am: info: info-am info-am: install-data-am: install-dist_m4macroDATA install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man3 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_m4macroDATA uninstall-man uninstall-man: uninstall-man3 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_m4macroDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man3 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-dist_m4macroDATA \ uninstall-man uninstall-man3 html: $(HTMLPAGES) .3.html: $(MAN2HTML) pdf: $(PDFPAGES) .3.pdf: @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \ groff -Tps -man $< >$$foo.ps; \ ps2pdf $$foo.ps $@; \ rm $$foo.ps; \ echo "converted $< to $@") # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: curl-7.35.0/docs/libcurl/curl_getdate.30000644000175000017500000001020012270035364014601 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2014, 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. .\" * .\" ************************************************************************** .TH curl_getdate 3 "12 Aug 2005" "libcurl 7.0" "libcurl Manual" .SH NAME curl_getdate - Convert a date string to number of seconds .SH SYNOPSIS .B #include .sp .BI "time_t curl_getdate(char *" datestring ", time_t *"now " );" .ad .SH DESCRIPTION \fIcurl_getdate(3)\fP returns the number of seconds since the Epoch, January 1st 1970 00:00:00 in the UTC time zone, for the date and time that the \fIdatestring\fP parameter specifies. The \fInow\fP parameter is not used, pass a NULL there. .SH PARSING DATES AND TIMES A "date" is a string containing several items separated by whitespace. The order of the items is immaterial. A date string may contain many flavors of items: .TP 0.8i .B calendar date items Can be specified several ways. Month names can only be three-letter english abbreviations, numbers can be zero-prefixed and the year may use 2 or 4 digits. Examples: 06 Nov 1994, 06-Nov-94 and Nov-94 6. .TP .B time of the day items This string specifies the time on a given day. You must specify it with 6 digits with two colons: HH:MM:SS. To not include the time in a date string, will make the function assume 00:00:00. Example: 18:19:21. .TP .B time zone items Specifies international time zone. There are a few acronyms supported, but in general you should instead use the specific relative time compared to UTC. Supported formats include: -1200, MST, +0100. .TP .B day of the week items Specifies a day of the week. Days of the week may be spelled out in full (using english): `Sunday', `Monday', etc or they may be abbreviated to their first three letters. This is usually not info that adds anything. .TP .B pure numbers If a decimal number of the form YYYYMMDD appears, then YYYY is read as the year, MM as the month number and DD as the day of the month, for the specified calendar date. .PP .SH EXAMPLES .nf Sun, 06 Nov 1994 08:49:37 GMT Sunday, 06-Nov-94 08:49:37 GMT Sun Nov 6 08:49:37 1994 06 Nov 1994 08:49:37 GMT 06-Nov-94 08:49:37 GMT Nov 6 08:49:37 1994 06 Nov 1994 08:49:37 06-Nov-94 08:49:37 1994 Nov 6 08:49:37 GMT 08:49:37 06-Nov-94 Sunday 94 6 Nov 08:49:37 1994 Nov 6 06-Nov-94 Sun Nov 6 94 1994.Nov.6 Sun/Nov/6/94/GMT Sun, 06 Nov 1994 08:49:37 CET 06 Nov 1994 08:49:37 EST Sun, 12 Sep 2004 15:05:58 -0700 Sat, 11 Sep 2004 21:32:11 +0200 20040912 15:05:58 -0700 20040911 +0200 .fi .SH STANDARDS This parser was written to handle date formats specified in RFC 822 (including the update in RFC 1123) using time zone name or time zone delta and RFC 850 (obsoleted by RFC 1036) and ANSI C's asctime() format. These formats are the only ones RFC2616 says HTTP applications may use. .SH RETURN VALUE This function returns -1 when it fails to parse the date string. Otherwise it returns the number of seconds as described. If the year is larger than 2037 on systems with 32 bit time_t, this function will return 0x7fffffff (since that is the largest possible signed 32 bit number). Having a 64 bit time_t is not a guarantee that dates beyond 03:14:07 UTC, January 19, 2038 will work fine. On systems with a 64 bit time_t but with a crippled mktime(), \fIcurl_getdate\fP will return -1 in this case. curl-7.35.0/docs/libcurl/curl_share_init.html0000644000175000017500000000431212272124467016127 00000000000000 curl_share_init man page

NAME

curl_share_init - Create a shared object

SYNOPSIS

#include <curl/curl.h>

CURLSH *curl_share_init( );

DESCRIPTION

This function returns a CURLSH handle to be used as input to all the other share-functions, sometimes referred to as a share handle in some places in the documentation. This init call MUST have a corresponding call to curl_share_cleanup when all operations using the share are complete.

This share handle is what you pass to curl using the CURLOPT_SHARE option with curl_easy_setopt(3), to make that specific curl handle use the data in this share.

RETURN VALUE

If this function returns NULL, something went wrong (out of memory, etc.) and therefore the share object was not created.

SEE ALSO

curl_share_cleanup (3) curl_share_setopt (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_version_info.html0000644000175000017500000002132412272124467016504 00000000000000 curl_version_info man page

NAME

curl_version_info - returns run-time libcurl version info

SYNOPSIS

#include <curl/curl.h>

curl_version_info_data *curl_version_info( CURLversion type );

DESCRIPTION

Returns a pointer to a filled in struct with information about various run-time features in libcurl. type should be set to the version of this functionality by the time you write your program. This way, libcurl will always return a proper struct that your program understands, while programs in the future might get a different struct. CURLVERSION_NOW will be the most recent one for the library you have installed:

  data = curl_version_info(CURLVERSION_NOW);

Applications should use this information to judge if things are possible to do or not, instead of using compile-time checks, as dynamic/DLL libraries can be changed independent of applications.

The curl_version_info_data struct looks like this

typedef struct {   CURLversion age; /* see description below */

  /* when 'age' is 0 or higher, the members below also exist: */   const char *version; /* human readable string */   unsigned int version_num; /* numeric representation */   const char *host; /* human readable string */   int features; /* bitmask, see below */   char *ssl_version; /* human readable string */   long ssl_version_num; /* not used, always zero */   const char *libz_version; /* human readable string */   const char **protocols; /* list of protocols */

  /* when 'age' is 1 or higher, the members below also exist: */   const char *ares; /* human readable string */   int ares_num; /* number */

  /* when 'age' is 2 or higher, the member below also exists: */   const char *libidn; /* human readable string */

  /* when 'age' is 3 or higher, the members below also exist: */   int iconv_ver_num; /* '_libiconv_version' if iconv support enabled */

  const char *libssh_version; /* human readable string */

} curl_version_info_data;

age describes what the age of this struct is. The number depends on how new the libcurl you're using is. You are however guaranteed to get a struct that you have a matching struct for in the header, as you tell libcurl your "age" with the input argument.

version is just an ascii string for the libcurl version.

version_num is a 24 bit number created like this: <8 bits major number> | <8 bits minor number> | <8 bits patch number>. Version 7.9.8 is therefore returned as 0x070908.

host is an ascii string showing what host information that this libcurl was built for. As discovered by a configure script or set by the build environment.

features can have none, one or more bits set, and the currently defined bits are:

CURL_VERSION_IPV6

supports IPv6

CURL_VERSION_KERBEROS4

supports kerberos4 (when using FTP)

CURL_VERSION_SSL

supports SSL (HTTPS/FTPS) (Added in 7.10)

CURL_VERSION_LIBZ

supports HTTP deflate using libz (Added in 7.10)

CURL_VERSION_NTLM

supports HTTP NTLM (added in 7.10.6)

CURL_VERSION_GSSNEGOTIATE

supports HTTP GSS-Negotiate (added in 7.10.6)

CURL_VERSION_DEBUG

libcurl was built with debug capabilities (added in 7.10.6)

CURL_VERSION_CURLDEBUG

libcurl was built with memory tracking debug capabilities. This is mainly of interest for libcurl hackers. (added in 7.19.6)

CURL_VERSION_ASYNCHDNS

libcurl was built with support for asynchronous name lookups, which allows more exact timeouts (even on Windows) and less blocking when using the multi interface. (added in 7.10.7)

CURL_VERSION_SPNEGO

libcurl was built with support for SPNEGO authentication (Simple and Protected GSS-API Negotiation Mechanism, defined in RFC 2478.) (added in 7.10.8)

CURL_VERSION_LARGEFILE

libcurl was built with support for large files. (Added in 7.11.1)

CURL_VERSION_IDN

libcurl was built with support for IDNA, domain names with international letters. (Added in 7.12.0)

CURL_VERSION_SSPI

libcurl was built with support for SSPI. This is only available on Windows and makes libcurl use Windows-provided functions for NTLM authentication. It also allows libcurl to use the current user and the current user's password without the app having to pass them on. (Added in 7.13.2)

CURL_VERSION_CONV

libcurl was built with support for character conversions, as provided by the CURLOPT_CONV_* callbacks. (Added in 7.15.4)

CURL_VERSION_TLSAUTH_SRP

libcurl was built with support for TLS-SRP. (Added in 7.21.4)

CURL_VERSION_NTLM_WB

libcurl was built with support for NTLM delegation to a winbind helper. (Added in 7.22.0)

ssl_version is an ASCII string for the OpenSSL version used. If libcurl has no SSL support, this is NULL.

ssl_version_num is the numerical OpenSSL version value as defined by the OpenSSL project. If libcurl has no SSL support, this is 0.

libz_version is an ASCII string (there is no numerical version). If libcurl has no libz support, this is NULL.

protocols is a pointer to an array of char * pointers, containing the names protocols that libcurl supports (using lowercase letters). The protocol names are the same as would be used in URLs. The array is terminated by a NULL entry.

RETURN VALUE

A pointer to a curl_version_info_data struct.

SEE ALSO

curl_version(3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_strequal.30000644000175000017500000000437312213173003015030 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_strequal 3 "30 April 2004" "libcurl 7.12" "libcurl Manual" .SH NAME curl_strequal, curl_strnequal - case insensitive string comparisons .SH SYNOPSIS .B #include .sp .BI "int curl_strequal(char *" str1 ", char *" str2 ");" .sp .BI "int curl_strenqual(char *" str1 ", char *" str2 ", size_t " len ");" .SH DESCRIPTION The .B curl_strequal() function compares the two strings \fIstr1\fP and \fIstr2\fP, ignoring the case of the characters. It returns a non-zero (TRUE) integer if the strings are identical. .sp The \fBcurl_strnequal()\fP function is similar, except it only compares the first \fIlen\fP characters of \fIstr1\fP. .sp These functions are provided by libcurl to enable applications to compare strings in a truly portable manner. There are no standard portable case insensitive string comparison functions. These two work on all platforms. .SH AVAILABILITY These functions will be removed from the public libcurl API in a near future. They will instead be made "available" by source code access only, and then as curlx_strequal() and curlx_strenqual(). .SH RETURN VALUE Non-zero if the strings are identical. Zero if they're not. .SH "SEE ALSO" .BR strcmp "(3), " strcasecmp "(3)" curl-7.35.0/docs/libcurl/curl_easy_getinfo.30000644000175000017500000003701712262353672015665 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2013, 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. .\" * .\" ************************************************************************** .\" .TH curl_easy_getinfo 3 "11 Feb 2009" "libcurl 7.19.4" "libcurl Manual" .SH NAME curl_easy_getinfo - extract information from a curl handle .SH SYNOPSIS .B #include .B "CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... );" .SH DESCRIPTION Request internal information from the curl session with this function. The third argument \fBMUST\fP be a pointer to a long, a pointer to a char *, a pointer to a struct curl_slist * or a pointer to a double (as this documentation describes further down). The data pointed-to will be filled in accordingly and can be relied upon only if the function returns CURLE_OK. Use this function AFTER a performed transfer if you want to get transfer- oriented data. You should not free the memory returned by this function unless it is explicitly mentioned below. .SH AVAILABLE INFORMATION The following information can be extracted: .IP CURLINFO_EFFECTIVE_URL Pass a pointer to a char pointer to receive the last used effective URL. .IP CURLINFO_RESPONSE_CODE Pass a pointer to a long to receive the last received HTTP, FTP or SMTP response code. This option was previously known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier. The value will be zero if no server response code has been received. Note that a proxy's CONNECT response should be read with \fICURLINFO_HTTP_CONNECTCODE\fP and not this. Support for SMTP responses added in 7.25.0. .IP CURLINFO_HTTP_CONNECTCODE Pass a pointer to a long to receive the last received proxy response code to a CONNECT request. .IP CURLINFO_FILETIME Pass a pointer to a long to receive the remote time of the retrieved document (in number of seconds since 1 jan 1970 in the GMT/UTC time zone). If you get -1, it can be because of many reasons (unknown, the server hides it or the server doesn't support the command that tells document time etc) and the time of the document is unknown. Note that you must tell the server to collect this information before the transfer is made, by using the CURLOPT_FILETIME option to \fIcurl_easy_setopt(3)\fP or you will unconditionally get a -1 back. (Added in 7.5) .IP CURLINFO_TOTAL_TIME Pass a pointer to a double to receive the total time in seconds for the previous transfer, including name resolving, TCP connect etc. .IP CURLINFO_NAMELOOKUP_TIME Pass a pointer to a double to receive the time, in seconds, it took from the start until the name resolving was completed. .IP CURLINFO_CONNECT_TIME Pass a pointer to a double to receive the time, in seconds, it took from the start until the connect to the remote host (or proxy) was completed. .IP CURLINFO_APPCONNECT_TIME Pass a pointer to a double to receive the time, in seconds, it took from the start until the SSL/SSH connect/handshake to the remote host was completed. This time is most often very near to the PRETRANSFER time, except for cases such as HTTP pippelining where the pretransfer time can be delayed due to waits in line for the pipeline and more. (Added in 7.19.0) .IP CURLINFO_PRETRANSFER_TIME Pass a pointer to a double to receive the time, in seconds, it took from the start until the file transfer is just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. It does \fInot\fP involve the sending of the protocol- specific request that triggers a transfer. .IP CURLINFO_STARTTRANSFER_TIME Pass a pointer to a double to receive the time, in seconds, it took from the start until the first byte is received by libcurl. This includes CURLINFO_PRETRANSFER_TIME and also the time the server needs to calculate the result. .IP CURLINFO_REDIRECT_TIME Pass a pointer to a double to receive the total time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started. CURLINFO_REDIRECT_TIME contains the complete execution time for multiple redirections. (Added in 7.9.7) .IP CURLINFO_REDIRECT_COUNT Pass a pointer to a long to receive the total number of redirections that were actually followed. (Added in 7.9.7) .IP CURLINFO_REDIRECT_URL Pass a pointer to a char pointer to receive the URL a redirect \fIwould\fP take you to if you would enable CURLOPT_FOLLOWLOCATION. This can come very handy if you think using the built-in libcurl redirect logic isn't good enough for you but you would still prefer to avoid implementing all the magic of figuring out the new URL. (Added in 7.18.2) .IP CURLINFO_SIZE_UPLOAD Pass a pointer to a double to receive the total amount of bytes that were uploaded. .IP CURLINFO_SIZE_DOWNLOAD Pass a pointer to a double to receive the total amount of bytes that were downloaded. The amount is only for the latest transfer and will be reset again for each new transfer. .IP CURLINFO_SPEED_DOWNLOAD Pass a pointer to a double to receive the average download speed that curl measured for the complete download. Measured in bytes/second. .IP CURLINFO_SPEED_UPLOAD Pass a pointer to a double to receive the average upload speed that curl measured for the complete upload. Measured in bytes/second. .IP CURLINFO_HEADER_SIZE Pass a pointer to a long to receive the total size of all the headers received. Measured in number of bytes. .IP CURLINFO_REQUEST_SIZE Pass a pointer to a long to receive the total size of the issued requests. This is so far only for HTTP requests. Note that this may be more than one request if FOLLOWLOCATION is true. .IP CURLINFO_SSL_VERIFYRESULT Pass a pointer to a long to receive the result of the certification verification that was requested (using the CURLOPT_SSL_VERIFYPEER option to \fIcurl_easy_setopt(3)\fP). .IP CURLINFO_SSL_ENGINES Pass the address of a 'struct curl_slist *' to receive a linked-list of OpenSSL crypto-engines supported. Note that engines are normally implemented in separate dynamic libraries. Hence not all the returned engines may be available at run-time. \fBNOTE:\fP you must call \fIcurl_slist_free_all(3)\fP on the list pointer once you're done with it, as libcurl will not free the data for you. (Added in 7.12.3) .IP CURLINFO_CONTENT_LENGTH_DOWNLOAD Pass a pointer to a double to receive the content-length of the download. This is the value read from the Content-Length: field. Since 7.19.4, this returns -1 if the size isn't known. .IP CURLINFO_CONTENT_LENGTH_UPLOAD Pass a pointer to a double to receive the specified size of the upload. Since 7.19.4, this returns -1 if the size isn't known. .IP CURLINFO_CONTENT_TYPE Pass a pointer to a char pointer to receive the content-type of the downloaded object. This is the value read from the Content-Type: field. If you get NULL, it means that the server didn't send a valid Content-Type header or that the protocol used doesn't support this. .IP CURLINFO_PRIVATE Pass a pointer to a char pointer to receive the pointer to the private data associated with the curl handle (set with the CURLOPT_PRIVATE option to \fIcurl_easy_setopt(3)\fP). Please note that for internal reasons, the value is returned as a char pointer, although effectively being a 'void *'. (Added in 7.10.3) .IP CURLINFO_HTTPAUTH_AVAIL Pass a pointer to a long to receive a bitmask indicating the authentication method(s) available. The meaning of the bits is explained in the CURLOPT_HTTPAUTH option for \fIcurl_easy_setopt(3)\fP. (Added in 7.10.8) .IP CURLINFO_PROXYAUTH_AVAIL Pass a pointer to a long to receive a bitmask indicating the authentication method(s) available for your proxy authentication. (Added in 7.10.8) .IP CURLINFO_OS_ERRNO Pass a pointer to a long to receive the errno variable from a connect failure. Note that the value is only set on failure, it is not reset upon a successful operation. (Added in 7.12.2) .IP CURLINFO_NUM_CONNECTS Pass a pointer to a long to receive how many new connections libcurl had to create to achieve the previous transfer (only the successful connects are counted). Combined with \fICURLINFO_REDIRECT_COUNT\fP you are able to know how many times libcurl successfully reused existing connection(s) or not. See the Connection Options of \fIcurl_easy_setopt(3)\fP to see how libcurl tries to make persistent connections to save time. (Added in 7.12.3) .IP CURLINFO_PRIMARY_IP Pass a pointer to a char pointer to receive the pointer to a zero-terminated string holding the IP address of the most recent connection done with this \fBcurl\fP handle. This string may be IPv6 if that's enabled. Note that you get a pointer to a memory area that will be re-used at next request so you need to copy the string if you want to keep the information. (Added in 7.19.0) .IP CURLINFO_PRIMARY_PORT Pass a pointer to a long to receive the destination port of the most recent connection done with this \fBcurl\fP handle. (Added in 7.21.0) .IP CURLINFO_LOCAL_IP Pass a pointer to a char pointer to receive the pointer to a zero-terminated string holding the local (source) IP address of the most recent connection done with this \fBcurl\fP handle. This string may be IPv6 if that's enabled. The same restrictions apply as to \fICURLINFO_PRIMARY_IP\fP. (Added in 7.21.0) .IP CURLINFO_LOCAL_PORT Pass a pointer to a long to receive the local (source) port of the most recent connection done with this \fBcurl\fP handle. (Added in 7.21.0) .IP CURLINFO_COOKIELIST Pass a pointer to a 'struct curl_slist *' to receive a linked-list of all cookies cURL knows (expired ones, too). Don't forget to \fIcurl_slist_free_all(3)\fP the list after it has been used. If there are no cookies (cookies for the handle have not been enabled or simply none have been received) 'struct curl_slist *' will be set to point to NULL. (Added in 7.14.1) .IP CURLINFO_LASTSOCKET Pass a pointer to a long to receive the last socket used by this curl session. If the socket is no longer valid, -1 is returned. When you finish working with the socket, you must call curl_easy_cleanup() as usual and let libcurl close the socket and cleanup other resources associated with the handle. This is typically used in combination with \fICURLOPT_CONNECT_ONLY\fP. (Added in 7.15.2) NOTE: this API is not really working on win64, since the SOCKET type on win64 is 64 bit large while its 'long' is only 32 bits. .IP CURLINFO_FTP_ENTRY_PATH Pass a pointer to a char pointer to receive a pointer to a string holding the path of the entry path. That is the initial path libcurl ended up in when logging on to the remote FTP server. This stores a NULL as pointer if something is wrong. (Added in 7.15.4) Also works for SFTP since 7.21.4 .IP CURLINFO_CERTINFO Pass a pointer to a 'struct curl_certinfo *' and you'll get it set to point to struct that holds a number of linked lists with info about the certificate chain, assuming you had CURLOPT_CERTINFO enabled when the previous request was done. The struct reports how many certs it found and then you can extract info for each of those certs by following the linked lists. The info chain is provided in a series of data in the format "name:content" where the content is for the specific named data. See also the certinfo.c example. NOTE: this option is only available in libcurl built with OpenSSL, NSS, GSKit or QsoSSL support. (Added in 7.19.1) .IP CURLINFO_TLS_SESSION Pass a pointer to a 'struct curl_tlsinfo *'. The pointer will be initialized to refer to a 'struct curl_tlsinfo *' that will contain an enum indicating the SSL library used for the handshake and the respective internal TLS session structure of this underlying SSL library. This may then be used to extract certificate information in a format convenient for further processing, such as manual validation. NOTE: this option may not be available for all SSL backends; unsupported SSL backends will return 'CURLSSLBACKEND_NONE' to indicate that they are not supported; this does not mean that no SSL backend was used. (Added in 7.34.0) .IP CURLINFO_CONDITION_UNMET Pass a pointer to a long to receive the number 1 if the condition provided in the previous request didn't match (see \fICURLOPT_TIMECONDITION\fP). Alas, if this returns a 1 you know that the reason you didn't get data in return is because it didn't fulfill the condition. The long ths argument points to will get a zero stored if the condition instead was met. (Added in 7.19.4) .IP CURLINFO_RTSP_SESSION_ID Pass a pointer to a char pointer to receive a pointer to a string holding the most recent RTSP Session ID. Applications wishing to resume an RTSP session on another connection should retrieve this info before closing the active connection. .IP CURLINFO_RTSP_CLIENT_CSEQ Pass a pointer to a long to receive the next CSeq that will be used by the application. .IP CURLINFO_RTSP_SERVER_CSEQ Pass a pointer to a long to receive the next server CSeq that will be expected by the application. \fI(NOTE: listening for server initiated requests is currently unimplemented).\fP Applications wishing to resume an RTSP session on another connection should retrieve this info before closing the active connection. .IP CURLINFO_RTSP_CSEQ_RECV Pass a pointer to a long to receive the most recently received CSeq from the server. If your application encounters a \fICURLE_RTSP_CSEQ_ERROR\fP then you may wish to troubleshoot and/or fix the CSeq mismatch by peeking at this value. .SH TIMES .nf An overview of the six time values available from curl_easy_getinfo() curl_easy_perform() | |--NAMELOOKUP |--|--CONNECT |--|--|--APPCONNECT |--|--|--|--PRETRANSFER |--|--|--|--|--STARTTRANSFER |--|--|--|--|--|--TOTAL |--|--|--|--|--|--REDIRECT .fi .IP NAMELOOKUP \fICURLINFO_NAMELOOKUP_TIME\fP. The time it took from the start until the name resolving was completed. .IP CONNECT \fICURLINFO_CONNECT_TIME\fP. The time it took from the start until the connect to the remote host (or proxy) was completed. .IP APPCONNECT \fICURLINFO_APPCONNECT_TIME\fP. The time it took from the start until the SSL connect/handshake with the remote host was completed. (Added in in 7.19.0) .IP PRETRANSFER \fICURLINFO_PRETRANSFER_TIME\fP. The time it took from the start until the file transfer is just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. .IP STARTTRANSFER \fICURLINFO_STARTTRANSFER_TIME\fP. The time it took from the start until the first byte is received by libcurl. .IP TOTAL \fICURLINFO_TOTAL_TIME\fP. Total time of the previous request. .IP REDIRECT \fICURLINFO_REDIRECT_TIME\fP. The time it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started. So, this is zero if no redirection took place. .SH RETURN VALUE If the operation was successful, CURLE_OK is returned. Otherwise an appropriate error code will be returned. .SH "SEE ALSO" .BR curl_easy_setopt "(3)" curl-7.35.0/docs/libcurl/curl_multi_remove_handle.pdf0000644000175000017500000000744512272124473017640 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ¥VÛnã6}×W Ї•1ËD‰hQ Ýúa‹\¶¶Ò¢pŠ@+Ó¶YÊJr‚üÃ~t‡ÔÝF‘‡Â€ms;3gŽô (a@ͧýMÎå2€]åPØ9ßf/¡ýIðK„¡9ˆ¶Nãà à(ABÑÁq“c™=ŽY>–úPÌ¢œ9Æ÷!J*•B¯hã¸/Ú\Rs¡Uè5!'܃èÕY»û8ßdúÁ3ÈÒ¯&ølÎ=E”îMœã N3þý6¤B*ÞÉ8ÉÓVÌ™2v—K…p‰ò â¹Ç="C˜ iÝn¯úxÌ'¾êòÜ,ÌùÐ)N‰G˜3n¯ÿ‹¨iOW5Ìá< %Í[k"¬ý‹†ØXqbm˜$\P֦ʇTŒ%zgëWoÐfÛ–Åb°õC¥«*-òî¸Sœâ_Ž% müÕ_·w_VŸWÓÎ`#»®üæIvÜhøÉôçÒ|‘ý϶^dõã~º_^ß$Zœ6ðÜá„zLïÏÛÆ„M¬æðÌ!|Ôˆ¹³›ýxŽI…}þºX}Z~þ}¾»ýOŒËÓ9qA‚¾Õm½œ^x^sï:j6HCrÉ›Û9·qRé L£à4CÖ3jg2ïnïÆ:x¼ß°†³mõXkÃÕ&ɇÑ(f†Ù¶7CI8,F‘×e‘›ƒQ„Šûo¹q¡TÚTîun5F³+D„瘤$,\¨&ضíPj¬ðÛy­ÝÉÖqòti ˆyâR/pã4‡g]nuRgoéNiË e®›Ö.>)C e¬Ý¬žù>%’2·H»0ž¥°G„ßÑj’¿@Ù¦òH‡èiãå’ÑvIp|œHɧ"iwÐ(ÊÃÛhó°X¦|IùX§Š¼™øhÍä:Ûvtý&N—@xT¦ùâ|2Ï×}j9j®Ž•Þ\4; í„Xˆk´µ¸¦áétäñÙ»ºîf&[V[.ÕeœW[]‚bYìJÔZü߉@C ”£Þù¥EAjÔ?³˜ê}\[T6ŒáH†ñÞ¬Ýnϯ]•”ã6 ¿òM_[«ÈpCµcogÈ¥x`{ 7ÄreªœV[Ù\»ËEt¿¼…?fL §dîÕõý¢õ:—Ðõè1P¿=£Zït®K| h_ÚHói33/ \†nœàn–eQ‚ñ|¯(wµXÀÕõênPý!=’Lã{Èó 5ƒ®Û÷Š‹i0ÜÖ“w/ÍÓzLâòøãP©ÀÔ>÷¼°­ºëž$s8áAçäÍ (rô’àÆe²|lóæ‘‹»Þ 3'‹Èù?ÿº£?endstream endobj 6 0 obj 1066 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:47+01:00 2014-01-29T08:09:47+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001390 00000 n 0000003270 00000 n 0000001331 00000 n 0000001171 00000 n 0000000015 00000 n 0000001151 00000 n 0000001455 00000 n 0000001709 00000 n 0000001644 00000 n 0000001576 00000 n 0000001496 00000 n 0000001526 00000 n 0000001791 00000 n 0000001847 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [<88867801258A46D7592B84F5D54FE3CE><88867801258A46D7592B84F5D54FE3CE>] >> startxref 3424 %%EOF curl-7.35.0/docs/libcurl/curl_multi_setopt.30000644000175000017500000002263612213173003015722 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_multi_setopt 3 "10 Oct 2006" "libcurl 7.16.0" "libcurl Manual" .SH NAME curl_multi_setopt \- set options for a curl multi handle .SH SYNOPSIS #include CURLMcode curl_multi_setopt(CURLM * multi_handle, CURLMoption option, param); .SH DESCRIPTION curl_multi_setopt() is used to tell a libcurl multi handle how to behave. By using the appropriate options to \fIcurl_multi_setopt(3)\fP, you can change libcurl's behaviour when using that multi handle. All options are set with the \fIoption\fP followed by the parameter \fIparam\fP. That parameter can be a \fBlong\fP, a \fBfunction pointer\fP, an \fBobject pointer\fP or a \fBcurl_off_t\fP type, depending on what the specific option expects. Read this manual carefully as bad input values may cause libcurl to behave badly! You can only set one option in each function call. .SH OPTIONS .IP CURLMOPT_SOCKETFUNCTION Pass a pointer to a function matching the \fBcurl_socket_callback\fP prototype. The \fIcurl_multi_socket_action(3)\fP function informs the application about updates in the socket (file descriptor) status by doing none, one, or multiple calls to the curl_socket_callback given in the \fBparam\fP argument. They update the status with changes since the previous time a \fIcurl_multi_socket(3)\fP function was called. If the given callback pointer is NULL, no callback will be called. Set the callback's \fBuserp\fP argument with \fICURLMOPT_SOCKETDATA\fP. See \fIcurl_multi_socket(3)\fP for more callback details. .IP CURLMOPT_SOCKETDATA Pass a pointer to whatever you want passed to the \fBcurl_socket_callback\fP's fourth argument, the userp pointer. This is not used by libcurl but only passed-thru as-is. Set the callback pointer with \fICURLMOPT_SOCKETFUNCTION\fP. .IP CURLMOPT_PIPELINING Pass a long set to 1 to enable or 0 to disable. Enabling pipelining on a multi handle will make it attempt to perform HTTP Pipelining as far as possible for transfers using this handle. This means that if you add a second request that can use an already existing connection, the second request will be \&"piped" on the same connection rather than being executed in parallel. (Added in 7.16.0) .IP CURLMOPT_TIMERFUNCTION Pass a pointer to a function matching the \fBcurl_multi_timer_callback\fP prototype: int curl_multi_timer_callback(CURLM *multi /* multi handle */, long timeout_ms /* timeout in milliseconds */, void *userp /* TIMERDATA */). This function will then be called when the timeout value changes. The timeout value is at what latest time the application should call one of the \&"performing" functions of the multi interface (\fIcurl_multi_socket_action(3)\fP and \fIcurl_multi_perform(3)\fP) - to allow libcurl to keep timeouts and retries etc to work. A timeout value of -1 means that there is no timeout at all, and 0 means that the timeout is already reached. Libcurl attempts to limit calling this only when the fixed future timeout time actually changes. See also \fICURLMOPT_TIMERDATA\fP. The callback should return 0 on success, and -1 on error. This callback can be used instead of, or in addition to, \fIcurl_multi_timeout(3)\fP. (Added in 7.16.0) .IP CURLMOPT_TIMERDATA Pass a pointer to whatever you want passed to the \fBcurl_multi_timer_callback\fP's third argument, the userp pointer. This is not used by libcurl but only passed-thru as-is. Set the callback pointer with \fICURLMOPT_TIMERFUNCTION\fP. (Added in 7.16.0) .IP CURLMOPT_MAXCONNECTS Pass a long. The set number will be used as the maximum amount of simultaneously open connections that libcurl may cache. Default is 10, and libcurl will enlarge the size for each added easy handle to make it fit 4 times the number of added easy handles. By setting this option, you can prevent the cache size from growing beyond the limit set by you. When the cache is full, curl closes the oldest one in the cache to prevent the number of open connections from increasing. This option is for the multi handle's use only, when using the easy interface you should instead use the \fICURLOPT_MAXCONNECTS\fP option. (Added in 7.16.3) .IP CURLMOPT_MAX_HOST_CONNECTIONS Pass a long. The set number will be used as the maximum amount of simultaneously open connections to a single host. For each new session to a host, libcurl will open a new connection up to the limit set by CURLMOPT_MAX_HOST_CONNECTIONS. When the limit is reached, the sessions will be pending until there are available connections. If CURLMOPT_PIPELINING is 1, libcurl will try to pipeline if the host is capable of it. The default value is 0, which means that there is no limit. However, for backwards compatibility, setting it to 0 when CURLMOPT_PIPELINING is 1 will not be treated as unlimited. Instead it will open only 1 connection and try to pipeline on it. (Added in 7.30.0) .IP CURLMOPT_MAX_PIPELINE_LENGTH Pass a long. The set number will be used as the maximum amount of requests in a pipelined connection. When this limit is reached, libcurl will use another connection to the same host (see CURLMOPT_MAX_HOST_CONNECTIONS), or queue the requests until one of the pipelines to the host is ready to accept a request. Thus, the total number of requests in-flight is CURLMOPT_MAX_HOST_CONNECTIONS * CURLMOPT_MAX_PIPELINE_LENGTH. The default value is 5. (Added in 7.30.0) .IP CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE Pass a long. If a pipelined connection is currently processing a request with a Content-Length larger than CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, that connection will not be considered for additional requests, even if it is shorter than CURLMOPT_MAX_PIPELINE_LENGTH. The default value is 0, which means that the penalization is inactive. (Added in 7.30.0) .IP CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE Pass a long. If a pipelined connection is currently processing a chunked (Transfer-encoding: chunked) request with a current chunk length larger than CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, that connection will not be considered for additional requests, even if it is shorter than CURLMOPT_MAX_PIPELINE_LENGTH. The default value is 0, which means that the penalization is inactive. (Added in 7.30.0) .IP CURLMOPT_PIPELINING_SITE_BL Pass an array of char *, ending with NULL. This is a list of sites that are blacklisted from pipelining, i.e sites that are known to not support HTTP pipelining. The array is copied by libcurl. The default value is NULL, which means that there is no blacklist. Pass a NULL pointer to clear the blacklist. Example: .nf site_blacklist[] = { "www.haxx.se", "www.example.com:1234", NULL }; curl_multi_setopt(m, CURLMOPT_PIPELINE_SITE_BL, site_blacklist); .fi (Added in 7.30.0) .IP CURLMOPT_PIPELINING_SERVER_BL Pass an array of char *, ending with NULL. This is a list of server types prefixes (in the Server: HTTP header) that are blacklisted from pipelining, i.e server types that are known to not support HTTP pipelining. The array is copied by libcurl. Note that the comparison matches if the Server: header begins with the string in the blacklist, i.e "Server: Ninja 1.2.3" and "Server: Ninja 1.4.0" can both be blacklisted by having "Ninja" in the backlist. The default value is NULL, which means that there is no blacklist. Pass a NULL pointer to clear the blacklist. Example: .nf server_blacklist[] = { "Microsoft-IIS/6.0", "nginx/0.8.54", NULL }; curl_multi_setopt(m, CURLMOPT_PIPELINE_SERVER_BL, server_blacklist); .fi (Added in 7.30.0) .IP CURLMOPT_MAX_TOTAL_CONNECTIONS Pass a long. The set number will be used as the maximum amount of simultaneously open connections in total. For each new session, libcurl will open a new connection up to the limit set by CURLMOPT_MAX_TOTAL_CONNECTIONS. When the limit is reached, the sessions will be pending until there are available connections. If CURLMOPT_PIPELINING is 1, libcurl will try to pipeline if the host is capable of it. The default value is 0, which means that there is no limit. However, for backwards compatibility, setting it to 0 when CURLMOPT_PIPELINING is 1 will not be treated as unlimited. Instead it will open only 1 connection and try to pipeline on it. (Added in 7.30.0) .SH RETURNS The standard CURLMcode for multi interface error codes. Note that it returns a CURLM_UNKNOWN_OPTION if you try setting an option that this version of libcurl doesn't know of. .SH AVAILABILITY This function was added in libcurl 7.15.4. .SH "SEE ALSO" .BR curl_multi_cleanup "(3), " curl_multi_init "(3), " .BR curl_multi_socket "(3), " curl_multi_info_read "(3)" curl-7.35.0/docs/libcurl/curl_easy_reset.pdf0000644000175000017500000000714312272124474015755 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœUÛŽ›H}ç+JÚ‡mV¡§»in»«•œŒ9ž¬ÍDŠ<«ˆ@{ ƒÁ10Vò ûÑ[MCÆxEZY¹/Uçœ:U|F90ýÞéÞºZpßX î­Ïï7ax¥{xãP/Ä;ËÜá"—†Ä{‹‹2⓵%iw,?¨¤ùòá¨ÕÞ÷Ά²ø¨×mGxŒ27IÕ%%|ï°ýOüÚrc§˜:ÂÔ4òtv“,-²šÙ¿"ZÜåõ"Å™EÞÌíøÓVÁ¨d8\èm¦ñ]ÂÌ;)K¨mQW Ô;HFÈШ¦ÁUÈ“*+•Ip†ÈAH÷iØ#ؼ_ݼÝ,6OÇÔòKQ¥e—)øS¿Òšÿ¥;ºÈHÈžâc=RŒhdømI‘+fóÕ^Ý®—ð[/ÜÕš³±TKˆA›Kø½>•ÃöýÇsj<Œ¨'ÀÁêz×óÍ«õâm¼¸YM•~bÈh½ÒkåUÑIY|UÍDàñG±zÒ傾8X豨»¦üº.¨|ÍA¥Å¿*ƒž¨¡m m® S;›3’te ¶4 ™G’²S …8/0[×6ð1IŒ³Æ¬ç¶Øj¸Iöøh“VAÒ@Ñ óhóºDÿ¯à”«j\×KŸº¦…ô¨ðF§¢Í/ "‚úÞ øS!µJÆùM}T=dƒ:„öqe@=+"d‚KÑBV£ÊUǽê9ì견máا¢ºGà»ú¸Ot!àÁFsEDZMéI…ß±ÆNä^oLߣ®”cµ<“š<*H56ÓŽ>•R~«èÔU¥Ò¾ô/ú›¡§×&i®úÕž 9 Âpڳ׫ÍÙ9Hëú¡ÐŽª2hòû׈é‡7/GƤAñ 3fï`ö 6 U¤^,g/ËEü~Z®é_@Û’Þa»®êé¡´ Âµ’,C# ªã( (”®øÄ-YÏãÛõ ÞÙÜE7ûœÌ–·óáÖó†#«ºÍ±°?›Ló9Ì–››N¦©/¬ÈÆ1¡múbƒKÊ}&žÙ:-ùÃ4R M…ÿ#Ñ8å硌…Iu{£žò;Ü“~6zÝᘌÉ^^é_®#Ícëoüý½äˆendstream endobj 6 0 obj 873 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:48+01:00 2014-01-29T08:09:48+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001196 00000 n 0000003076 00000 n 0000001137 00000 n 0000000977 00000 n 0000000015 00000 n 0000000958 00000 n 0000001261 00000 n 0000001515 00000 n 0000001450 00000 n 0000001382 00000 n 0000001302 00000 n 0000001332 00000 n 0000001597 00000 n 0000001653 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [<00CB25607BFAF2FB3C7F5032A0ACF0CA><00CB25607BFAF2FB3C7F5032A0ACF0CA>] >> startxref 3230 %%EOF curl-7.35.0/docs/libcurl/curl_easy_duphandle.30000644000175000017500000000441212213173003016147 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_easy_duphandle 3 "18 September 2001" "libcurl 7.9" "libcurl Manual" .SH NAME curl_easy_duphandle - Clone a libcurl session handle .SH SYNOPSIS .B #include .BI "CURL *curl_easy_duphandle(CURL *"handle ");" .SH DESCRIPTION This function will return a new curl handle, a duplicate, using all the options previously set in the input curl \fIhandle\fP. Both handles can subsequently be used independently and they must both be freed with \fIcurl_easy_cleanup(3)\fP. All strings that the input handle has been told to point to (as opposed to copy) with previous calls to \fIcurl_easy_setopt(3)\fP using char * inputs, will be pointed to by the new handle as well. You must therefore make sure to keep the data around until both handles have been cleaned up. The new handle will \fBnot\fP inherit any state information, no connections, no SSL sessions and no cookies. \fBNote\fP that even in multi-threaded programs, this function must be called in a synchronous way, the input handle may not be in use when cloned. .SH RETURN VALUE If this function returns NULL, something went wrong and no valid handle was returned. .SH "SEE ALSO" .BR curl_easy_init "(3)," curl_easy_cleanup "(3)," curl_global_init "(3) curl-7.35.0/docs/libcurl/curl_easy_escape.html0000644000175000017500000000474012272124467016270 00000000000000 curl_easy_escape man page

NAME

curl_easy_escape - URL encodes the given string

SYNOPSIS

#include <curl/curl.h>

char *curl_easy_escape( CURL * curl , char * url , int length );

DESCRIPTION

This function converts the given input string to an URL encoded string and returns that as a new allocated string. All input characters that are not a-z, A-Z, 0-9, '-', '.', '_' or '~' are converted to their "URL escaped" version (%NN where NN is a two-digit hexadecimal number).

If the length argument is set to 0 (zero), curl_easy_escape(3) uses strlen() on the input url to find out the size.

You must curl_free(3) the returned string when you're done with it.

AVAILABILITY

Added in 7.15.4 and replaces the old curl_escape(3) function.

RETURN VALUE

A pointer to a zero terminated string or NULL if it failed.

SEE ALSO

curl_easy_unescape (3) curl_free (3) RFC 2396

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_easy_pause.30000644000175000017500000001225312270035364015334 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2013, 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. .\" * .\" ************************************************************************** .TH curl_easy_pause 3 "17 Dec 2007" "libcurl 7.18.0" "libcurl Manual" .SH NAME curl_easy_pause - pause and unpause a connection .SH SYNOPSIS .B #include .BI "CURLcode curl_easy_pause(CURL *"handle ", int "bitmask " );" .SH DESCRIPTION Using this function, you can explicitly mark a running connection to get paused, and you can unpause a connection that was previously paused. A connection can be paused by using this function or by letting the read or the write callbacks return the proper magic return code (\fICURL_READFUNC_PAUSE\fP and \fICURL_WRITEFUNC_PAUSE\fP). A write callback that returns pause signals to the library that it couldn't take care of any data at all, and that data will then be delivered again to the callback when the writing is later unpaused. While it may feel tempting, take care and notice that you cannot call this function from another thread. To unpause, you may for example call it from the progress callback (see \fIcurl_easy_setopt(3)\fP's \fICURLOPT_PROGRESSFUNCTION\fP), which gets called at least once per second, even if the connection is paused. When this function is called to unpause reading, the chance is high that you will get your write callback called before this function returns. The \fBhandle\fP argument is of course identifying the handle that operates on the connection you want to pause or unpause. The \fBbitmask\fP argument is a set of bits that sets the new state of the connection. The following bits can be used: .IP CURLPAUSE_RECV Pause receiving data. There will be no data received on this connection until this function is called again without this bit set. Thus, the write callback (\fICURLOPT_WRITEFUNCTION\fP) won't be called. .IP CURLPAUSE_SEND Pause sending data. There will be no data sent on this connection until this function is called again without this bit set. Thus, the read callback (\fICURLOPT_READFUNCTION\fP) won't be called. .IP CURLPAUSE_ALL Convenience define that pauses both directions. .IP CURLPAUSE_CONT Convenience define that unpauses both directions .SH RETURN VALUE CURLE_OK (zero) means that the option was set properly, and a non-zero return code means something wrong occurred after the new state was set. See the \fIlibcurl-errors(3)\fP man page for the full list with descriptions. .SH LIMITATIONS The pausing of transfers does not work with protocols that work without network connectivity, like FILE://. Trying to pause such a transfer, in any direction, will cause problems in the worst case or an error in the best case. .SH AVAILABILITY This function was added in libcurl 7.18.0. Before this version, there was no explicit support for pausing transfers. .SH "USAGE WITH THE MULTI-SOCKET INTERFACE" Before libcurl 7.32.0, when a specific handle was unpaused with this function, there was no particular forced rechecking or similar of the socket's state, which made the continuation of the transfer get delayed until next multi-socket call invoke or even longer. Alternatively, the user could forcibly call for example curl_multi_socket_all(3) - with a rather hefty performance penalty. Starting in libcurl 7.32.0, unpausing a transfer will schedule a timeout trigger for that handle 1 millisecond into the future, so that a curl_multi_socket_action( ... CURL_SOCKET_TIMEOUT) can be used immediately afterwards to get the transfer going again as desired. .SH "MEMORY USE" When pausing a read by returning the magic return code from a write callback, the read data is already in libcurl's internal buffers so it'll have to keep it in an allocated buffer until the reading is again unpaused using this function. If the downloaded data is compressed and is asked to get uncompressed automatically on download, libcurl will continue to uncompress the entire downloaded chunk and it will cache the data uncompressed. This has the side- effect that if you download something that is compressed a lot, it can result in a very large data amount needing to be allocated to save the data during the pause. This said, you should probably consider not using paused reading if you allow libcurl to uncompress data automatically. .SH "SEE ALSO" .BR curl_easy_cleanup "(3), " curl_easy_reset "(3)" curl-7.35.0/docs/libcurl/curl_multi_fdset.html0000644000175000017500000001015012272124467016316 00000000000000 curl_multi_fdset man page

NAME

curl_multi_fdset - extracts file descriptor information from a multi handle

SYNOPSIS

#include <curl/curl.h>

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);

DESCRIPTION

This function extracts file descriptor information from a given multi_handle. libcurl returns its fd_set sets. The application can use these to select() on, but be sure to FD_ZERO them before calling this function as curl_multi_fdset(3) only adds its own descriptors, it doesn't zero or otherwise remove any others. The curl_multi_perform(3) function should be called as soon as one of them is ready to be read from or written to.

If no file descriptors are set by libcurl, max_fd will contain -1 when this function returns. Otherwise it will contain the higher descriptor number libcurl set. When libcurl returns -1 in max_fd, it is because libcurl currently does something that isn't possible for your application to monitor with a socket and unfortunately you can then not know exactly when the current action is completed using select(). When max_fd returns with -1, you need to wait a while and then proceed and call curl_multi_perform anyway. How long to wait? I would suggest 100 milliseconds at least, but you may want to test it out in your own particular conditions to find a suitable value.

When doing select(), you should use curl_multi_timeout to figure out how long to wait for action. Call curl_multi_perform even if no activity has been seen on the fd_sets after the timeout expires as otherwise internal retries and timeouts may not work as you'd think and want.

If one of the sockets used by libcurl happens to be larger than what can be set in an fd_set, which on POSIX systems means that the file descriptor is larger than FD_SETSIZE, then libcurl will try to not set it. Setting a too large file descriptor in an fd_set implies an out of bounds write which can cause crashes, or worse. The effect of NOT storing it will possibly save you from the crash, but will make your program NOT wait for sockets it should wait for...

RETURN VALUE

CURLMcode type, general libcurl multi interface error code. See libcurl-errors(3)

SEE ALSO

curl_multi_cleanup (3) curl_multi_init (3) curl_multi_timeout (3) curl_multi_perform (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_multi_strerror.pdf0000644000175000017500000000655112272124474016710 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœTÛn›@}ç+FêC¡*›Ýå¶«V•HêWÄIm)rªˆ`bSÙ8ᢨýúÎ.ØÆ—´·Ë™3gæ(a@ÕÕ=Ó•q6`^æÆ‹Áô!ttç1õ#~2Z‡@:DHˆWc.a>įÆÔL›rù°j–uþPÕeV–ëòÞtî-Xæê̲¹G ¥y™M²„·¬ñ7æ„3Ì‘"‰ˆô “E†9 ­÷ˆO™G<é ²xf˜—+þÙÃÌ)qi6ãê˜*œ§`‚ eV7eø'/æ0˪´ÌÕkk®gYº‡ÅF06ó‰Ð¹'w£«ëÉp²3ëðvÙÍwy‘.›YŸ„3u#‹/Ê\DFü9\U é")áÃ>P‹ B™ÇL´}W„]ÜŒ£KOÑv6ftÓ0)PÍÌT»¹ž¢ßA·¢Yuæ[ ‚ðŽÅ{ëÓq­Œ†ñÝ>“¨mÇÅ$}ýN‘˼ڑöjI"%÷…™ s³YËE7rÆ íµú”t§æxߌGpk1Ç%ÒgfÝ ´'^[ãqwÍðy[®€IÙ•³Î‹:+¡^c+gåðk•IàÚÖ’cánÐ!z5@M®Þš¨©Ù•i뙈®ý«ºç Â\ºU·Z1÷cbJßßXt›,Kª_íàa`éðƒÁ;ÈHâÓ þ;GµHzñ·cNñ÷lÂ%.G•õ²iMr‰ª¤ÒÝãGËÀBb¹ç&÷!|.Sê긮¿ÙŸLEÄÆw¼þ稚®endstream endobj 6 0 obj 715 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <>stream 2014-01-29T08:09:48+01:00 2014-01-29T08:09:48+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 14 0000000000 65535 f 0000001038 00000 n 0000002846 00000 n 0000000979 00000 n 0000000819 00000 n 0000000015 00000 n 0000000800 00000 n 0000001103 00000 n 0000001357 00000 n 0000001292 00000 n 0000001224 00000 n 0000001144 00000 n 0000001174 00000 n 0000001423 00000 n trailer << /Size 14 /Root 1 0 R /Info 2 0 R /ID [<2C9E44225925AB2401EED3A04074BF83><2C9E44225925AB2401EED3A04074BF83>] >> startxref 3000 %%EOF curl-7.35.0/docs/libcurl/curl_share_init.pdf0000644000175000017500000000735312272124473015741 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ}UÛnã6}×W Їʋˆ+R’hQÀM lŽ“Úr")E¦#muñêR#ÿÐîºØqv Á¶ÀËœ3gÎŒ¿‚K(¸ú~“Âú¸æðÒX.¼X_-j6aøI ø5ÂB/D{«¿C3àÒ#BBTXÔs ã­;éêü©IãZ=eeÖ>ÚÞã òìY¯Ï¸Äu¹}—]œÃ·ÏþŠ>[¤;Ah‰ÐDÝ !ZZöj>ûÙâ. H =dí,ûv1‹¾œqe.ñ]ezÛÕü.é×µŠ[1˜ÕTÏ_TÒö‘ΠÄvhH„Úü¹º»ßÜlNÇz˜ýCV&y·Sð³Fü¨¿Hú‹>Î|CôáÁ¾Þ®—›Oðaâ4£Â•€ÇÙOFŠÿañÛbs½¾¹nîVo3?¡„Ij2Ò¬}W&mV•P«¶«ËÓX¤q¹Ë´<+è"n +]«×â<‡6UPáWÝ+匱š+hªBµY¡MC/-—xRàZíU­•ÕqšQè0+Ím8äq¢4¢ÁÙUIW¨²5ÃÝÔ+ÑLn·›ï£ Ð'4ÐFðBŸp*z'¸$°ÿÑ…M4+c憃]*$Õªrçè}Ç‚„Âk—¬|é!ÛªW˜ºƒÄ>#AèÌó3£½Å*&¹B†Ž…ŒP*åÀà˜ªÒH[TmRmPz©5èeÒŸ¤*¹j1D)óIÈÀÑFÚõu½à†Æ—~8¢bxÀ#4ä¦i8ñ©Ë†m•NòPFBl˜~ݔ碡â N'‘QJ#RÇ4náµêà7.´–ä”Ë?ê»Dð¡X¦ îͧùú¢ƒ…æ<Õë`œ{ÌÚô²’„œŽùšj¨¸y}jT‹—ú©ò&.—Ä÷Ü!ûÊÈê3\”ã3)â¿MÛã3†Úµ“p½'娨֢9¨$û7éu¬Ž]Õ›;nãÞ訜©2y?n¸×;eêö{½ˆ¶ëü1£ž>¦ö|¹]\ìÔùØ€\š$nö=Ô»æ_m—Ë¡yS]©#vë _í ;¿ÚC¡Šª~íÂH€U‘£WêLq¡?¬Lþ Æ‚áÁho8€Eí«Z™þ4ƒuƒëàŽ‡å è4_ñYQ(%A8º)O†¦ˆ"Ç©`à*œ!fâï¾!z ôÛÙ˜_,`¾ÜÜ}oÌŸ·>v•”T~¿õ=4ÉDÒ˜òêm\„ §4Þ…ö†î}™Dž†Êdw‡a?3tºC>Ãÿ0p‚9ós[S=¯‡b~Ð7Î6º`®ë™{8éĸNõÊ"²~Çç?´°8Dendstream endobj 6 0 obj 1008 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:47+01:00 2014-01-29T08:09:47+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001332 00000 n 0000003212 00000 n 0000001273 00000 n 0000001113 00000 n 0000000015 00000 n 0000001093 00000 n 0000001397 00000 n 0000001651 00000 n 0000001586 00000 n 0000001518 00000 n 0000001438 00000 n 0000001468 00000 n 0000001733 00000 n 0000001789 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [<53EEFF153828987A4A5F818AE4B9B7E7><53EEFF153828987A4A5F818AE4B9B7E7>] >> startxref 3366 %%EOF curl-7.35.0/docs/libcurl/libcurl-multi.pdf0000644000175000017500000002226512272124473015352 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœYÛ’ÛÆ}߯˜òË‚®å3ƒkÞd{SQJ–‹IJµJ©°$¸‹,иôæô+yóæô\€IY.ÉÖ.IÌôåôéÓÍ_XÈ éýw½»úîç”=ôW!{¸úåJè7™ýg½c߯ðŒ^Xm¯Ì3‚¥’¥¹âYÎV»+!cžÊ˜­ŽWA]ݯ]½Üê¡ú¨ f_Z¬þs%EÎÃ8Æ« î£ôYÕ e·¥D1Y(ÌGü“‹uÉÎO§G–!ÇÁlµ†¡9 åyL¶.eq©b¶T ¼}EŸéƒ"æq®Ì%ÁO·ôúä¤ y¦l)ädæìfö?öØjxL§¥úJ}Ø]p2ƒö°ø÷ê¯æ69¾Ù—lx,ÙÌéœç¹L2rP?2wB(A?.EÂ3mí·ïøùõßV¯ß½› /ÉôQ½z¬z†¿EÃZ(¡ Ž2ž¨<³þ?—c\r.³<‹ìÝs¥ßR\Ù ©ÑËv¡TÈÃ0 šGm6eA.3ž‰<·¤GaJ{dƒTØ[©1-ÊÝà\°³ág§h!R¹GRÜê R5ì¥=tì¶ïÚ‡®Øõœ­Ë®dþë÷åºú¼f»¢ÑLx®r@X-#}Ô¾x({¶m;VëG¶=4ë¡j¶+ú·ÜÐEt¬=ýÚ8™ÑãEˆ@Ç.Î}19*‘ ecÔ}K^štŠÐåSðX¥ãg,‡ÃÐvUQèŸÆ<Ê#[:\cd½6¾`ëv·¯ËA_²T2åYMxI39w:Z·]Õ<°c5<ŽI(šÍsEñ$S'æ–EÿrÁÔDòTä—M=+Ü’aœÿq°Ê,»WË,Ø^aF<¦(Ðy€#ûMÈR¤,CvLÕ›EBæ¸>˜2ÿưÆêÛ»àU]¨é ,¿Wÿ›û®üüëBÀ´,Ž LŸ¬ù¤ŸãXB×¾cˆwßÿõö‡ÕëÞ¾ÿAÜ~ÇŠv ¶e׳¾tÅm’!€Üô+©¸ : ¨¸¯êj¨P=Ãc1h·)˜î>¡ÉCÇmÚ²o®õE"Q<¶hv%PêÚòø]!{Dðâ•• *Îüþ‚€îŠª©_þd‘¯Ð_Ø’²Du%BLpvÛ÷5RÀ¾Ùêú›Ë€ŽTä-J¤£m+öûºZ𴳇n;m@5ü~4ìƒâÁO UXÑ?Ÿ èÝU³æóPßõ%ÜCÁµ·\¨T¿'GÃu:Q㬯èÇ¢)Û‚ßM¯Si±×;âÔ®, ²ÚÀ=Q•Wƒ¡ ò¸£j&÷–‹ë+²ê 2O9~µXGDŒ1j4f8 KËŽúyÁ“Ä <§ î.(pµ.~îø[ =x™E”dž}Æ©㺫öà¨^’"gp#yž˜ªÏA¹H¥ÜÏ>åFÂQñÉYcÄ–$ âYîŠ&\Õ/‹$6àýZ)ÞïÞÞ²Ÿþñf‘™I¢‚Õkö—Wo|ƒW_½ýÀn_½ÿ`_xï -3Jæ¼j´éJ«–yM3èÇ(ÌG.K ]tQNȽ¡öˆwû}îð¿51ú¯Íˆo]^kˆX/Gª—‰àaêh`b¦OUS #ÛKžH5÷%¥ì;ið•_¸=9aTécɸcºµÂý¹8)ÔÜW÷@4U—fÞOu{~úv¢c]J]ÁðÌ-uø…@øµeC÷ÞpCE h ‰ ò¡ªQí{CÑè\šáŒÅœ}X ¸ˆid˜´»ÑîËOÛbéÚ=zï`×Þ8ó±Ý›62êï¾rÅ\WV•\jÑ`ùtÞ¡/4çˆ((‹ôØÕ¼¹¹ßâa9©…"íÊ];WX2#>ŸI,BIr®x7[ž•™²d_bÄO»ó¯#xßK…>ôÐ-TJ,- [Þ}.g°0=8âøã±ØßÍš± Gá-…Qa 0®#âë÷ÇQáÙê@{Ó—‚5ŽBó08ºÔ)¹:Bn£d²ÈH¼ŠjhÓ]įJ<’'\NÜG㻆°”¤ù ®žF±]žÖ_œ‚–.ÐéïLBÇv­¡L 7°Åñ±°3Ÿ gNì~2û[]}2P½LÑô;)!ÜR5O„ç¦\—}_t$ЬZÊ8Ó•ç(= _m6–þ¾ÊN4°¦´™|²Í™¨}9÷ùÏ“ÉéØÊ]¹»/;£Î1¶;ú Ñ€A½Y AJFÁåªnðƒÞ§LsŸÌ…Ù5ôä¦kSû¾îÝtÕÉ•ç\9¹fÃ!…éyø¿^²,u[1˜eô6Aøé…br BûÁç’M}êT©óüCóÐÝrM7ψ‡±pñ|n½ÑÏaééœX$Lˆ’ÜÇc z!Ã`i¢£ çè—6ðÁ 슫$>Å¡×oêÑT^år\!%V¦ÙëXAZW8yG«4:ÃϽіƒù+NÖ[!É‹1…á%¯ªÍÔÎpK®hÜ& Äü¨(økÿ”Vl83 I`$•ã^ç˜9âWÔéz`Û ›ý¼:)bIM_Öå>|\ Ú·u­¦ôè¥XÛmH´ì¡4ƒƒ»m‚[š¹ìSQšè§™m·ÙÈ„ÁñèoeR1$Mçn¨=[Ëù„´«(+Zh ƒù¦6Ԟ軂]a$$úq™xžöÅÝ‹¡PšIŽØ\(Se£OylùØ®ù͆Îì+òqg–)­ý.…öq´ŠÛO¢Ætu}¥#†fˆ¡0–ç˼ÁÛMb Ô™*»ÇbßëßiI9—±@}ýK; *¢@§.ÿË»ÕèÒçm’!Ǫ²}Ã|íÑܸ‰›0:‘oAÕ~V[K\ž œeõð¬ùˆ«‘q˜Ô,+z„K¯ÔÑoZÒBÉö ›îÐ4Z^ûвZ—¶©&—…Y–$ÈL¦ÓÍFûá@ßkõf7uo¿ø |èUq¢lS»4zÞ²0ìç‡zåK÷'Ã_Ä»íóºûn¨²ëEl—”ôûõ4ìÊÂtu³£€º o÷‡5 ÛCÍÙ»FCg×v£ÄŸnÖ3Žì‰qL¶ÒEAØõij]+¸É:“j,ä,ŒÜÆ-E¹P¤ò »~2ü¥KœF#“ ³èÍÀIü¡»³þªbä ‹Òˆ§™œ¯üôq­çÖäÏ4›'¶ŒbžøË=†qâÑÿê„V2öVõg_†^¹gšG?¦HAÙ×½r»ºú;þü|‘Ó> stream xœ½YÛrÛÈ}×WÌ[À”8ÂÌàºok—6Q"ËŽ×Ö–”RAàÄh\DóôÑ鞊ɾ$)?ØE=};§O¿Ÿ2âãów±»¸ºÉ¦»ðÉæâûS‰ù«Ø‘¼àÙúBÃHÌIœ š¤$Û]0Ò˜‡$;\xUùR mµÜ U_>yâiAÌO‹ì÷ ÎRê‡!˜ÈVp~ ^$eÝËv¯!e‰Ïô+SËy!É{ëøÉÒ§ ÉŠ‹%ç å"$Ká× Ò@}›5dƒoúøhì‹TŸA Ú¾ìÁ‹uÓîò¾lj’¿4COŠf·¯d/W¤oóº[˶»$}CÞ6C+ ¾Ñ E!»Ž4-©›žäõŠt宬òVEãà›:ɻĮî™or¹ xJC? KÆñ…Gc{V±=£+ÏíBÄžÌW:Òf›VÂg”Å&M4áã×m›¡Z‘IмªäŠ’"¯I+û¡…¨ÈœÍ7ÒÄ—8³•uþï[¹à¡÷Z6CçâUÇ H¬&ªr®œ·®ûÔçLeñ^îeŽù*kSŽ9bʘorî½6æÃg©ËÐ7©š„†Ü<"Mó°kìCe‘1Œ×½+oB#Á}ã,:¦Rãm%Yu¡j»Zï( IFG†º/+ÒoÝOäû IÊŽÈݾ?ÎŽæaL“Øf#s'ƒKLpó;˜š¶Ó±TÌ" )O#›8¯•…,m6Be%À‡åÿ«$cŒ, ‘/Ü;¾°1¶xjQ +ˆ ª.óîH¶Ð“•$ûFŒ¶e±EÈ.?’¡“ØÏå z \ÍÓéwýÉR‡ hœÀ‰¶öêhd+M$~¨óD#‰·ÉûPØd,l»ê¨É õ£4%Kè¸B–(ã¿n%¶nWÖtÈt&ÇáóRù9õžvPÔŠTr ¾Z!ˆ]cÅ9]Ÿß(ù ϱOcÙ„†,UC’j©¿{k»^{i^+¸kfä> ¬¡ølíRŒÒÖ7MmN½?”ýö„/Ay™tÎÈy‚ú,Š<ô%¥i À±|ÖÆÎÒç4pðAÖê1ÉEÕ@C”ý¹óS¨kØOÔñèñsQɼöŽŽ9PjБާ%1µ¸¸lÆL`ô‰khð¥óæÚ7]W¾TGÒpkKh"D´§ÖÄ¡™f9f6ËÞû³S®9úAýs³€¦ócÁ½¼¬uÔ:Q.l&ø4jt°0˯JÖÈÎ ‚ÀœÇB³µxrinGr ¡RŸ§â©KÁ€Ùè$@/»)c‘‚bnŠÊ ¡ò)¡-Uâ醴@‡@äSX=z–áÝ0Ø.;m³o›½l«ã"Òà0í‰]y«ÆRLÙŸ½›µš$‡óDz4ÕÊ%•“é£jyPfX̬ÂqxEZßuçHÚ|ãg†?~e A†Ž\ŽSr?m®pÚ ]¯Xœ¼cìPÇ’qâF–µËùÄuæz'8h0×бùrÝ6»÷è´ Ùì°æaäº/ÖÙ}T„ô4r_¾Æé½Í ҔǠÓê ü IëšèQCs6-iLÙ` Ù|{ˆ¬ÀwS¬Ø6e!ŸtEa 2UଋPb#—}úz»H< ˜—Ýß)Útϲ›O×÷øHo"0HÎä™XT_5Nð*!îÞ B‚ÎÔ)á@òVIšJ±æ¶+DZÄCæØlÓÀ Ñ, w(MÌD˜E\ï]ÐÇ ›<H2·#±¹¡èì ˆÚ}ôæ^Mo`¦‰ª•Œ9ÈØ÷Ž_˾„¾y‚-Ú,\+Ú²‡Q€ú£ßâ> ÜRS'J”ï‚À=yÁü,ˆ¼{À¬Z  1t ÅnVì2V­*¼ßh'·F³qAâLëɉjœ«$>ã bý=ÀÈVXNØŒáþÂF»±+µl9]Äñ&*Œ,Íû ÆMæbðÞæ£4«’fq…IÓ yÑ7þ¤ïõÄ¥89·£x¼p‰­5P ƒ)ÕŽãy¢eìâÜÁsž”hÜ{ã$v9)Q(A³tº$ÙÌÓ;]"B›g-Fñ¼ø½ ­ó)ÄÜÞ`'ÂP"nU‚†<šw”ØÅžJ`¶ÎzdÆ´¹:‰`ûÑÌ¥3ú¸vëˆïóñöM{8L•ºzÑ©gÙ}&2§W™ÀŽX„Æ/ƒqœüïäÐtj¤ –ë#ò„ZF ë%X ¥^ÝÁf™²èØÇF‘fÓ~u\<ï>$&uõˆ Â9‘“¾ÜÁ4ïM9•1?)Ò¾([Ù©‘ÖN玞Ì›ÛÍBmÂ[ „1ÝÓý˜Æñÿ9ÍNlv¹Ê5ÞœŒÃ´#«A‘˘£b¦úšƒK<5¶÷á¨àæî/Qìä.e¢­^ÛíV·?¨Tç£æK¦|•ÂV”:N3c pî.Šf¥zÁ\žéÑòRA÷à?ðéåÉVÊRAÝzay€¥ì ð£#áäú1ZÇI­“j¢SpÄ(òë¶Ä+ ©»–ÃLŽÄH!OµÉB¶=ìR0' "U«*­ê©‰Gé«P¼~û¡‡l Jõ)GÖC¼¨•×xÏî6¯ºÀ Ü®•Oy6ŒœîÀÿ;Xk£MU)Fðaär}õyPYד^/ „òÉõc×·¥ÖÈ?MnÆð/ƒ`oy7ú!ܽ”Uç°8‚‘¦zE,ª»ð ÿCC5Ã:AýßF¿E… WËÉ«-AÄㄇ$vªi°tSÚ\êó¬³çñÈÃÃíTíO95ñ׳&²ì ^[ü8’Ÿïî®?f¯0ò?2ö0-HF`ŒAÔÑÝ67(8>g!š/Ñ·óF½Jþtu5^áÍÜ:µ1û_…É:r}{wÍm,¡ñÕ„+xõ¬Ž221¦À*þ´-°-ñË,•c{ÊÂ!Rõ™H@á˜ß9þr]üþü p¨¬¥endstream endobj 15 0 obj 2849 endobj 4 0 obj <> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R ] /Count 2 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 18 0 obj <> endobj 19 0 obj <>stream 2014-01-29T08:09:47+01:00 2014-01-29T08:09:47+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 20 0000000000 65535 f 0000006710 00000 n 0000008690 00000 n 0000006644 00000 n 0000006322 00000 n 0000000015 00000 n 0000003360 00000 n 0000006775 00000 n 0000007109 00000 n 0000007044 00000 n 0000006976 00000 n 0000006816 00000 n 0000006846 00000 n 0000006482 00000 n 0000003380 00000 n 0000006301 00000 n 0000006896 00000 n 0000006926 00000 n 0000007191 00000 n 0000007267 00000 n trailer << /Size 20 /Root 1 0 R /Info 2 0 R /ID [<44276BA931AC4FA2FE79ED92A740A3AF><44276BA931AC4FA2FE79ED92A740A3AF>] >> startxref 8844 %%EOF curl-7.35.0/docs/libcurl/curl_unescape.30000644000175000017500000000412212213173003014763 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_unescape 3 "22 March 2001" "libcurl 7.7" "libcurl Manual" .SH NAME curl_unescape - URL decodes the given string .SH SYNOPSIS .B #include .sp .BI "char *curl_unescape( char *" url ", int "length " );" .ad .SH DESCRIPTION Obsolete function. Use \fIcurl_easy_unescape(3)\fP instead! This function will convert the given URL encoded input string to a "plain string" and return that as a new allocated string. All input characters that are URL encoded (%XX where XX is a two-digit hexadecimal number) will be converted to their plain text versions. If the 'length' argument is set to 0, curl_unescape() will use strlen() on the input 'url' string to find out the size. You must curl_free() the returned string when you're done with it. .SH AVAILABILITY Since 7.15.4, \fIcurl_easy_unescape(3)\fP should be used. This function will be removed in a future release. .SH RETURN VALUE A pointer to a zero terminated string or NULL if it failed. .SH "SEE ALSO" .I curl_easy_escape(3), curl_easy_unescape(3), curl_free(3), RFC 2396 curl-7.35.0/docs/libcurl/curl_version.30000644000175000017500000000312112213173003014643 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_version 3 "5 March 2001" "libcurl 7.0" "libcurl Manual" .SH NAME curl_version - returns the libcurl version string .SH SYNOPSIS .B #include .sp .BI "char *curl_version( );" .ad .SH DESCRIPTION Returns a human readable string with the version number of libcurl and some of its important components (like OpenSSL version). .SH RETURN VALUE A pointer to a zero terminated string. The string resides in a statically allocated buffer and must not be freed by the caller. .SH "SEE ALSO" .BR curl_version_info "(3)" curl-7.35.0/docs/libcurl/curl_multi_remove_handle.30000644000175000017500000000367412213173003017215 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, 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. .\" * .\" ************************************************************************** .TH curl_multi_remove_handle 3 "6 March 2002" "libcurl 7.9.5" "libcurl Manual" .SH NAME curl_multi_remove_handle - remove an easy handle from a multi session .SH SYNOPSIS #include CURLMcode curl_multi_remove_handle(CURLM *multi_handle, CURL *easy_handle); .ad .SH DESCRIPTION Removes a given easy_handle from the multi_handle. This will make the specified easy handle be removed from this multi handle's control. When the easy handle has been removed from a multi stack, it is again perfectly legal to invoke \fIcurl_easy_perform()\fP on this easy handle. Removing an easy handle while being used, will effectively halt the transfer in progress involving that easy handle. All other easy handles and transfers will remain unaffected. .SH RETURN VALUE CURLMcode type, general libcurl multi interface error code. .SH "SEE ALSO" .BR curl_multi_cleanup "(3)," curl_multi_init "(3)" curl-7.35.0/docs/libcurl/curl_version_info.30000644000175000017500000001456612213173003015675 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2009, 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. .\" * .\" ************************************************************************** .\" .TH curl_version_info 3 "10 June 2009" "libcurl 7.19.6" "libcurl Manual" .SH NAME curl_version_info - returns run-time libcurl version info .SH SYNOPSIS .B #include .sp .BI "curl_version_info_data *curl_version_info( CURLversion "type ");" .ad .SH DESCRIPTION Returns a pointer to a filled in struct with information about various run-time features in libcurl. \fItype\fP should be set to the version of this functionality by the time you write your program. This way, libcurl will always return a proper struct that your program understands, while programs in the future might get a different struct. CURLVERSION_NOW will be the most recent one for the library you have installed: data = curl_version_info(CURLVERSION_NOW); Applications should use this information to judge if things are possible to do or not, instead of using compile-time checks, as dynamic/DLL libraries can be changed independent of applications. The curl_version_info_data struct looks like this .nf typedef struct { CURLversion age; /* see description below */ /* when 'age' is 0 or higher, the members below also exist: */ const char *version; /* human readable string */ unsigned int version_num; /* numeric representation */ const char *host; /* human readable string */ int features; /* bitmask, see below */ char *ssl_version; /* human readable string */ long ssl_version_num; /* not used, always zero */ const char *libz_version; /* human readable string */ const char **protocols; /* list of protocols */ /* when 'age' is 1 or higher, the members below also exist: */ const char *ares; /* human readable string */ int ares_num; /* number */ /* when 'age' is 2 or higher, the member below also exists: */ const char *libidn; /* human readable string */ /* when 'age' is 3 or higher, the members below also exist: */ int iconv_ver_num; /* '_libiconv_version' if iconv support enabled */ const char *libssh_version; /* human readable string */ } curl_version_info_data; .fi \fIage\fP describes what the age of this struct is. The number depends on how new the libcurl you're using is. You are however guaranteed to get a struct that you have a matching struct for in the header, as you tell libcurl your "age" with the input argument. \fIversion\fP is just an ascii string for the libcurl version. \fIversion_num\fP is a 24 bit number created like this: <8 bits major number> | <8 bits minor number> | <8 bits patch number>. Version 7.9.8 is therefore returned as 0x070908. \fIhost\fP is an ascii string showing what host information that this libcurl was built for. As discovered by a configure script or set by the build environment. \fIfeatures\fP can have none, one or more bits set, and the currently defined bits are: .RS .IP CURL_VERSION_IPV6 supports IPv6 .IP CURL_VERSION_KERBEROS4 supports kerberos4 (when using FTP) .IP CURL_VERSION_SSL supports SSL (HTTPS/FTPS) (Added in 7.10) .IP CURL_VERSION_LIBZ supports HTTP deflate using libz (Added in 7.10) .IP CURL_VERSION_NTLM supports HTTP NTLM (added in 7.10.6) .IP CURL_VERSION_GSSNEGOTIATE supports HTTP GSS-Negotiate (added in 7.10.6) .IP CURL_VERSION_DEBUG libcurl was built with debug capabilities (added in 7.10.6) .IP CURL_VERSION_CURLDEBUG libcurl was built with memory tracking debug capabilities. This is mainly of interest for libcurl hackers. (added in 7.19.6) .IP CURL_VERSION_ASYNCHDNS libcurl was built with support for asynchronous name lookups, which allows more exact timeouts (even on Windows) and less blocking when using the multi interface. (added in 7.10.7) .IP CURL_VERSION_SPNEGO libcurl was built with support for SPNEGO authentication (Simple and Protected GSS-API Negotiation Mechanism, defined in RFC 2478.) (added in 7.10.8) .IP CURL_VERSION_LARGEFILE libcurl was built with support for large files. (Added in 7.11.1) .IP CURL_VERSION_IDN libcurl was built with support for IDNA, domain names with international letters. (Added in 7.12.0) .IP CURL_VERSION_SSPI libcurl was built with support for SSPI. This is only available on Windows and makes libcurl use Windows-provided functions for NTLM authentication. It also allows libcurl to use the current user and the current user's password without the app having to pass them on. (Added in 7.13.2) .IP CURL_VERSION_CONV libcurl was built with support for character conversions, as provided by the CURLOPT_CONV_* callbacks. (Added in 7.15.4) .IP CURL_VERSION_TLSAUTH_SRP libcurl was built with support for TLS-SRP. (Added in 7.21.4) .IP CURL_VERSION_NTLM_WB libcurl was built with support for NTLM delegation to a winbind helper. (Added in 7.22.0) .RE \fIssl_version\fP is an ASCII string for the OpenSSL version used. If libcurl has no SSL support, this is NULL. \fIssl_version_num\fP is the numerical OpenSSL version value as defined by the OpenSSL project. If libcurl has no SSL support, this is 0. \fIlibz_version\fP is an ASCII string (there is no numerical version). If libcurl has no libz support, this is NULL. \fIprotocols\fP is a pointer to an array of char * pointers, containing the names protocols that libcurl supports (using lowercase letters). The protocol names are the same as would be used in URLs. The array is terminated by a NULL entry. .SH RETURN VALUE A pointer to a curl_version_info_data struct. .SH "SEE ALSO" \fIcurl_version(3)\fP curl-7.35.0/docs/libcurl/curl_global_init_mem.pdf0000644000175000017500000000776312272124474016743 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœµVÛnã6}÷W°èC¥ÀfHê¾- ¤Û`‘"—m¬EQÄE KŒ­®,iE)núýçIÝ“í.Šv`’3gΜ9ä'D0EDþµßñaqzë¡X´[|ZPµˆÚ¯ø€~aƒ/ú EC^`a?@áŽPly(<.©²û]Vl£ì>ÍÓúþÀÃÚ˜(K·rÑ\1‡`B<ã*Ê›(C¯ž0 Z¬f²Ä"8p$ËEáå¸>3¿ܰJì` “…qun†¿P3‚mâ¡er™H¤/E+ôNýÒEr%²TDuZäè˜Ö{‹ê ÅQ–m£ø£Ð¹FàV€nE]ì+0ë_¯oÞ¯/Öö¶€ŽñušÇY“pôLy*?ðþ{¹]n¸\„'wÆÛ·—q{^f++ò¹r1þŠvb©˜cØéRÈûš€»ˆï;øè°”©ôÚC|²û”°–K·­r§ãa—A»¬¯|Û¡}I*X%—˜‹mŸÐ.Ø,·ÚâYØ™¤„Lƒ‰ºJšr8)F¨ãYÔŠLݾˆùíó.Q *wêÇóõÛÛ‹÷áÅÍõT?C³ö[+=ܧ=4y¬•aB`B©QTâ&µqXñG×ÙŠ„êÉé-%Ý$ÍÌoñÍ»ªõ?ÁàCxÖ \¢°4 ¥È"ç(J’T"yƒÒIBLæÀ˜Ùq¨ÞƲÌÒXë¸.൒ðJ#¶ˆ5%o¹¹âeÅ\Å)à£:¦‚£Fð&¤æU#ÓŽELjÀªý¶T0ŒŸ¨ˆŠ´C”£2ÚA¨\R“$%EÜx^kxE¥Rõ#¶¸*;tvÄ!óvœàß“èØe~w Ç!óA*•@ªÏ‡¢¾?!ãΨ¸¨1úeÏsôT4²z80ÒÀRÅèUU&õA5vª6(¼5ÚrÅ=°ú¨[äY8L2h©,©À l pÆQYuQ?•\ôäìR ì‘:Òÿ¤Þ‡9{Tu¨±‡%ÐYàÛíRË%홃D; v\#±/š,.Õñ^fübœXžR Ÿt47E¬£ ̬fcˆôO~_#ùÕŽ$DõåAð ÖñM±«ÅRhƒÐ`]L{°Zž­(u–¡›ÝÃt˜>ðÏ8ï$ЇjärúBt_ YEYWl{})Z™ëK°žT|ΪÆKm·ÇÛ_ªËîoÆ¥èÃúØÉâÕÆ€3šÏ¬¶Ûü¼ÐxUèdfï#ƒêg CþxtžÏä_Ñ¿¢éüo»Dÿ‹Âã ‰Ó[Ì÷gÐá±pfÊ'–ã1ヺÌôÕóü6£0ÇT%‚·XZ6Øo¾Ó3/ýE£×ãØ ›Œ…y~n1bd1 3›vò…ž¦ ¯¢mŽVôîw¯“~øâ-ÕÍFA=Û;AAž#¨8\,"®z”J4¶(éÌÿX åŽî­ 9Q”ì šRnûēɰl[ý•i„QG˜ä9ÝmÍTÀÐÈq³Ùà×QÅ¿zÞZ—a¢_Umkµ(Öççèìr}óêƒr~Nï@×Þ߻¾º$—ÓPÎÞNãhqÆáÑ^Î^&°}(eo ´‰àÁßK³{WÃg®¨cyàSDºŠžƒ‹j¸ívŽEe¨ópñ3üý jXn endstream endobj 6 0 obj 1272 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 13 0 obj <> endobj 8 0 obj <> endobj 14 0 obj <>stream 2014-01-29T08:09:48+01:00 2014-01-29T08:09:48+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 15 0000000000 65535 f 0000001596 00000 n 0000003476 00000 n 0000001537 00000 n 0000001377 00000 n 0000000015 00000 n 0000001357 00000 n 0000001661 00000 n 0000001987 00000 n 0000001850 00000 n 0000001782 00000 n 0000001702 00000 n 0000001732 00000 n 0000001931 00000 n 0000002053 00000 n trailer << /Size 15 /Root 1 0 R /Info 2 0 R /ID [<58027155F63039E614CC9A56840F22F7><58027155F63039E614CC9A56840F22F7>] >> startxref 3630 %%EOF curl-7.35.0/docs/libcurl/curl_share_setopt.html0000644000175000017500000001237412272124467016511 00000000000000 curl_share_setopt man page

NAME

curl_share_setopt - Set options for a shared object

SYNOPSIS

#include <curl/curl.h>

CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option, parameter);

DESCRIPTION

Set the option to parameter for the given share.

OPTIONS

CURLSHOPT_LOCKFUNC

The parameter must be a pointer to a function matching the following prototype:

void lock_function(CURL *handle, curl_lock_data data, curl_lock_access access, void *userptr);

data defines what data libcurl wants to lock, and you must make sure that only one lock is given at any time for each kind of data.

access defines what access type libcurl wants, shared or single.

userptr is the pointer you set with CURLSHOPT_USERDATA.

CURLSHOPT_UNLOCKFUNC

The parameter must be a pointer to a function matching the following prototype:

void unlock_function(CURL *handle, curl_lock_data data, void *userptr);

data defines what data libcurl wants to unlock, and you must make sure that only one lock is given at any time for each kind of data.

userptr is the pointer you set with CURLSHOPT_USERDATA.

CURLSHOPT_SHARE

The parameter specifies a type of data that should be shared. This may be set to one of the values described below.

CURL_LOCK_DATA_COOKIE

Cookie data will be shared across the easy handles using this shared object.

CURL_LOCK_DATA_DNS

Cached DNS hosts will be shared across the easy handles using this shared object. Note that when you use the multi interface, all easy handles added to the same multi handle will share DNS cache by default without this having to be used!

CURL_LOCK_DATA_SSL_SESSION

SSL session IDs will be shared across the easy handles using this shared object. This will reduce the time spent in the SSL handshake when reconnecting to the same server. Note SSL session IDs are reused within the same easy handle by default.

CURLSHOPT_UNSHARE

This option does the opposite of CURLSHOPT_SHARE. It specifies that the specified parameter will no longer be shared. Valid values are the same as those for CURLSHOPT_SHARE.

CURLSHOPT_USERDATA

The parameter allows you to specify a pointer to data that will be passed to the lock_function and unlock_function each time it is called.

RETURN VALUE

CURLSHE_OK (zero) means that the option was set properly, non-zero means an error occurred as <curl/curl.h> defines. See the libcurl-errors.3 man page for the full list with descriptions.

SEE ALSO

curl_share_cleanup (3) curl_share_init (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_easy_reset.html0000644000175000017500000000416112272124467016147 00000000000000 curl_easy_reset man page

NAME

curl_easy_reset - reset all options of a libcurl session handle

SYNOPSIS

#include <curl/curl.h>

void curl_easy_reset(CURL *handle );

DESCRIPTION

Re-initializes all options previously set on a specified CURL handle to the default values. This puts back the handle to the same state as it was in when it was just created with curl_easy_init(3).

It does not change the following information kept in the handle: live connections, the Session ID cache, the DNS cache, the cookies and shares.

AVAILABILITY

This function was added in libcurl 7.12.1

RETURN VALUE

Nothing

SEE ALSO

curl_easy_init (3) curl_easy_cleanup (3) curl_easy_setopt (3)

This HTML page was made with roffit. curl-7.35.0/docs/libcurl/curl_slist_free_all.html0000644000175000017500000000310112272124467016764 00000000000000 curl_slist_free_all man page

NAME

curl_slist_free_all - free an entire curl_slist list

SYNOPSIS

#include <curl/curl.h>

void curl_slist_free_all(struct curl_slist * list);

DESCRIPTION

curl_slist_free_all() removes all traces of a previously built curl_slist linked list.

RETURN VALUE

Nothing.

SEE ALSO

curl_slist_append (3)

This HTML page was made with roffit. curl-7.35.0/docs/curl-config.html0000644000175000017500000001263012272124467013533 00000000000000 curl-config man page

NAME

curl-config - Get information about a libcurl installation

SYNOPSIS

curl-config [options]

DESCRIPTION

curl-config displays information about the curl and libcurl installation.

OPTIONS

--ca

Displays the built-in path to the CA cert bundle this libcurl uses.

--cc

Displays the compiler used to build libcurl.

--cflags

Set of compiler options (CFLAGS) to use when compiling files that use libcurl. Currently that is only the include path to the curl include files.

--checkfor [version]

Specify the oldest possible libcurl version string you want, and this script will return 0 if the current installation is new enough or it returns 1 and outputs a text saying that the current version is not new enough. (Added in 7.15.4)

--configure

Displays the arguments given to configure when building curl.

--feature

Lists what particular main features the installed libcurl was built with. At the time of writing, this list may include SSL, KRB4 or IPv6. Do not assume any particular order. The keywords will be separated by newlines. There may be none, one, or several keywords in the list.

--help

Displays the available options.

--libs

Shows the complete set of libs and other linker options you will need in order to link your application with libcurl.

--prefix

This is the prefix used when libcurl was installed. Libcurl is then installed in $prefix/lib and its header files are installed in $prefix/include and so on. The prefix is set with "configure --prefix".

--protocols

Lists what particular protocols the installed libcurl was built to support. At the time of writing, this list may include HTTP, HTTPS, FTP, FTPS, FILE, TELNET, LDAP, DICT. Do not assume any particular order. The protocols will be listed using uppercase and are separated by newlines. There may be none, one, or several protocols in the list. (Added in 7.13.0)

--static-libs

Shows the complete set of libs and other linker options you will need in order to link your application with libcurl statically. (Added in 7.17.1)

--version

Outputs version information about the installed libcurl.

--vernum

Outputs version information about the installed libcurl, in numerical mode. This outputs the version number, in hexadecimal, with 8 bits for each part; major, minor, patch. So that libcurl 7.7.4 would appear as 070704 and libcurl 12.13.14 would appear as 0c0d0e... Note that the initial zero might be omitted. (This option was broken in the 7.15.0 release.)

EXAMPLES

What linker options do I need when I link with libcurl?

  $ curl-config --libs

What compiler options do I need when I compile using libcurl functions?

  $ curl-config --cflags

How do I know if libcurl was built with SSL support?

  $ curl-config --feature | grep SSL

What's the installed libcurl version?

  $ curl-config --version

How do I build a single file with a one-line command?

  $ `curl-config --cc --cflags` -o example example.c `curl-config --libs`

SEE ALSO

curl (1)

This HTML page was made with roffit. curl-7.35.0/docs/KNOWN_BUGS0000644000175000017500000003273512270035364012077 00000000000000These are problems known to exist at the time of this release. Feel free to join in and help us correct one or more of these! Also be sure to check the changelog of the current development status, as one or more of these problems may have been fixed since this was written! 87. -J/--remote-header-name doesn't decode %-encoded file names. RFC6266 details how it should be done. The can of worm is basically that we have no charset handling in curl and ascii >=128 is a challenge for us. Not to mention that decoding also means that we need to check for nastyness that is attempted, like "../" sequences and the like. Probably everything to the left of any embedded slashes should be cut off. http://curl.haxx.se/bug/view.cgi?id=1294 86. The disconnect commands (LOGOUT and QUIT) may not be sent by IMAP, POP3 and SMTP if a failure occures during the authentication phase of a connection. 85. Wrong STARTTRANSFER timer accounting for POST requests Timer works fine with GET requests, but while using POST the time for CURLINFO_STARTTRANSFER_TIME is wrong. While using POST CURLINFO_STARTTRANSFER_TIME minus CURLINFO_PRETRANSFER_TIME is near to zero every time. http://curl.haxx.se/bug/view.cgi?id=1213 84. CURLINFO_SSL_VERIFYRESULT is only implemented for the OpenSSL and NSS backends, so relying on this information in a generic app is flaky. 83. curl is unable to load non-default openssl engines, because openssl isn't initialized properly. This seems to require OpenSSL_config() or CONF_modules_load_file() to be used by libcurl but the first seems to not work and we've gotten not reports from tests with the latter. Possibly we need to discuss with OpenSSL developers how this is supposed to be done. We need users with actual external openssl engines for testing to work on this. http://curl.haxx.se/bug/view.cgi?id=1208 82. When building with the Windows Borland compiler, it fails because the "tlib" tool doesn't support hyphens (minus signs) in file names and we have such in the build. http://curl.haxx.se/bug/view.cgi?id=1222 81. When using -J (with -O), automaticly resumed downloading together with "-C -" fails. Without -J the same command line works! This happens because the resume logic is worked out before the target file name (and thus its pre-transfer size) has been figured out! http://curl.haxx.se/bug/view.cgi?id=1169 80. Curl doesn't recognize certificates in DER format in keychain, but it works with PEM. http://curl.haxx.se/bug/view.cgi?id=1065 79. SMTP. When sending data to multiple recipients, curl will abort and return failure if one of the recipients indicate failure (on the "RCPT TO" command). Ordinary mail programs would proceed and still send to the ones that can receive data. This is subject for change in the future. http://curl.haxx.se/bug/view.cgi?id=1116 78. curl and libcurl don't always signal the client properly when "sending" zero bytes files - it makes for example the command line client not creating any file at all. Like when using FTP. http://curl.haxx.se/bug/view.cgi?id=1063 77. CURLOPT_FORBID_REUSE on a handle prevents NTLM from working since it "abuses" the underlying connection re-use system and if connections are forced to close they break the NTLM support. 76. The SOCKET type in Win64 is 64 bits large (and thus so is curl_socket_t on that platform), and long is only 32 bits. It makes it impossible for curl_easy_getinfo() to return a socket properly with the CURLINFO_LASTSOCKET option as for all other operating systems. 75. NTLM authentication involving unicode user name or password only works properly if built with UNICODE defined together with the WinSSL/schannel backend. The original problem was mentioned in: http://curl.haxx.se/mail/lib-2009-10/0024.html http://curl.haxx.se/bug/view.cgi?id=896 The WinSSL/schannel version verified to work as mentioned in http://curl.haxx.se/mail/lib-2012-07/0073.html 73. if a connection is made to a FTP server but the server then just never sends the 220 response or otherwise is dead slow, libcurl will not acknowledge the connection timeout during that phase but only the "real" timeout - which may surprise users as it is probably considered to be the connect phase to most people. Brought up (and is being misunderstood) in: http://curl.haxx.se/bug/view.cgi?id=856 72. "Pausing pipeline problems." http://curl.haxx.se/mail/lib-2009-07/0214.html 70. Problem re-using easy handle after call to curl_multi_remove_handle http://curl.haxx.se/mail/lib-2009-07/0249.html 68. "More questions about ares behavior". http://curl.haxx.se/mail/lib-2009-08/0012.html 67. When creating multipart formposts. The file name part can be encoded with something beyond ascii but currently libcurl will only pass in the verbatim string the app provides. There are several browsers that already do this encoding. The key seems to be the updated draft to RFC2231: http://tools.ietf.org/html/draft-reschke-rfc2231-in-http-02 66. When using telnet, the time limitation options don't work. http://curl.haxx.se/bug/view.cgi?id=846 65. When doing FTP over a socks proxy or CONNECT through HTTP proxy and the multi interface is used, libcurl will fail if the (passive) TCP connection for the data transfer isn't more or less instant as the code does not properly wait for the connect to be confirmed. See test case 564 for a first shot at a test case. 63. When CURLOPT_CONNECT_ONLY is used, the handle cannot reliably be re-used for any further requests or transfers. The work-around is then to close that handle with curl_easy_cleanup() and create a new. Some more details: http://curl.haxx.se/mail/lib-2009-04/0300.html 61. If an upload using Expect: 100-continue receives an HTTP 417 response, it ought to be automatically resent without the Expect:. A workaround is for the client application to redo the transfer after disabling Expect:. http://curl.haxx.se/mail/archive-2008-02/0043.html 60. libcurl closes the connection if an HTTP 401 reply is received while it is waiting for the the 100-continue response. http://curl.haxx.se/mail/lib-2008-08/0462.html 58. It seems sensible to be able to use CURLOPT_NOBODY and CURLOPT_FAILONERROR with FTP to detect if a file exists or not, but it is not working: http://curl.haxx.se/mail/lib-2008-07/0295.html 56. When libcurl sends CURLOPT_POSTQUOTE commands when connected to a SFTP server using the multi interface, the commands are not being sent correctly and instead the connection is "cancelled" (the operation is considered done) prematurely. There is a half-baked (busy-looping) patch provided in the bug report but it cannot be accepted as-is. See http://curl.haxx.se/bug/view.cgi?id=748 55. libcurl fails to build with MIT Kerberos for Windows (KfW) due to KfW's library header files exporting symbols/macros that should be kept private to the KfW library. See ticket #5601 at http://krbdev.mit.edu/rt/ 52. Gautam Kachroo's issue that identifies a problem with the multi interface where a connection can be re-used without actually being properly SSL-negotiated: http://curl.haxx.se/mail/lib-2008-01/0277.html 49. If using --retry and the transfer timeouts (possibly due to using -m or -y/-Y) the next attempt doesn't resume the transfer properly from what was downloaded in the previous attempt but will truncate and restart at the original position where it was at before the previous failed attempt. See http://curl.haxx.se/mail/lib-2008-01/0080.html and Mandriva bug report https://qa.mandriva.com/show_bug.cgi?id=22565 48. If a CONNECT response-headers are larger than BUFSIZE (16KB) when the connection is meant to be kept alive (like for NTLM proxy auth), the function will return prematurely and will confuse the rest of the HTTP protocol code. This should be very rare. 43. There seems to be a problem when connecting to the Microsoft telnet server. http://curl.haxx.se/bug/view.cgi?id=649 41. When doing an operation over FTP that requires the ACCT command (but not when logging in), the operation will fail since libcurl doesn't detect this and thus fails to issue the correct command: http://curl.haxx.se/bug/view.cgi?id=635 39. Steffen Rumler's Race Condition in Curl_proxyCONNECT: http://curl.haxx.se/mail/lib-2007-01/0045.html 38. Kumar Swamy Bhatt's problem in ftp/ssl "LIST" operation: http://curl.haxx.se/mail/lib-2007-01/0103.html 35. Both SOCKS5 and SOCKS4 proxy connections are done blocking, which is very bad when used with the multi interface. 34. The SOCKS4 connection codes don't properly acknowledge (connect) timeouts. Also see #12. According to bug #1556528, even the SOCKS5 connect code does not do it right: http://curl.haxx.se/bug/view.cgi?id=604 31. "curl-config --libs" will include details set in LDFLAGS when configure is run that might be needed only for building libcurl. Further, curl-config --cflags suffers from the same effects with CFLAGS/CPPFLAGS. 30. You need to use -g to the command line tool in order to use RFC2732-style IPv6 numerical addresses in URLs. 29. IPv6 URLs with zone ID is not nicely supported. http://www.ietf.org/internet-drafts/draft-fenner-literal-zone-02.txt (expired) specifies the use of a plus sign instead of a percent when specifying zone IDs in URLs to get around the problem of percent signs being special. According to the reporter, Firefox deals with the URL _with_ a percent letter (which seems like a blatant URL spec violation). libcurl supports zone IDs where the percent sign is URL-escaped (i.e. %25): http://curl.haxx.se/bug/view.cgi?id=555 26. NTLM authentication using SSPI (on Windows) when (lib)curl is running in "system context" will make it use wrong(?) user name - at least when compared to what winhttp does. See http://curl.haxx.se/bug/view.cgi?id=535 23. SOCKS-related problems: B) libcurl doesn't support FTPS over a SOCKS proxy. E) libcurl doesn't support active FTP over a SOCKS proxy We probably have even more bugs and lack of features when a SOCKS proxy is used. 21. FTP ASCII transfers do not follow RFC959. They don't convert the data accordingly (not for sending nor for receiving). RFC 959 section 3.1.1.1 clearly describes how this should be done: The sender converts the data from an internal character representation to the standard 8-bit NVT-ASCII representation (see the Telnet specification). The receiver will convert the data from the standard form to his own internal form. Since 7.15.4 at least line endings are converted. 16. FTP URLs passed to curl may contain NUL (0x00) in the RFC 1738 , , and components, encoded as "%00". The problem is that curl_unescape does not detect this, but instead returns a shortened C string. From a strict FTP protocol standpoint, NUL is a valid character within RFC 959 , so the way to handle this correctly in curl would be to use a data structure other than a plain C string, one that can handle embedded NUL characters. From a practical standpoint, most FTP servers would not meaningfully support NUL characters within RFC 959 , anyway (e.g., UNIX pathnames may not contain NUL). 14. Test case 165 might fail on a system which has libidn present, but with an old iconv version (2.1.3 is a known bad version), since it doesn't recognize the charset when named ISO8859-1. Changing the name to ISO-8859-1 makes the test pass, but instead makes it fail on Solaris hosts that use its native iconv. 13. curl version 7.12.2 fails on AIX if compiled with --enable-ares. The workaround is to combine --enable-ares with --disable-shared 12. When connecting to a SOCKS proxy, the (connect) timeout is not properly acknowledged after the actual TCP connect (during the SOCKS "negotiate" phase). 10. To get HTTP Negotiate authentication to work fine, you need to provide a (fake) user name (this concerns both curl and the lib) because the code wrongly only considers authentication if there's a user name provided. http://curl.haxx.se/bug/view.cgi?id=440 How? http://curl.haxx.se/mail/lib-2004-08/0182.html 8. Doing resumed upload over HTTP does not work with '-C -', because curl doesn't do a HEAD first to get the initial size. This needs to be done manually for HTTP PUT resume to work, and then '-C [index]'. 6. libcurl ignores empty path parts in FTP URLs, whereas RFC1738 states that such parts should be sent to the server as 'CWD ' (without an argument). The only exception to this rule, is that we knowingly break this if the empty part is first in the path, as then we use the double slashes to indicate that the user wants to reach the root dir (this exception SHALL remain even when this bug is fixed). 5. libcurl doesn't treat the content-length of compressed data properly, as it seems HTTP servers send the *uncompressed* length in that header and libcurl thinks of it as the *compressed* length. Some explanations are here: http://curl.haxx.se/mail/lib-2003-06/0146.html 2. If a HTTP server responds to a HEAD request and includes a body (thus violating the RFC2616), curl won't wait to read the response but just stop reading and return back. If a second request (let's assume a GET) is then immediately made to the same server again, the connection will be re-used fine of course, and the second request will be sent off but when the response is to get read, the previous response-body is what curl will read and havoc is what happens. More details on this is found in this libcurl mailing list thread: http://curl.haxx.se/mail/lib-2002-08/0000.html curl-7.35.0/docs/SSLCERTS0000644000175000017500000001566112213173003011612 00000000000000 Peer SSL Certificate Verification ================================= (NOTE: If libcurl was built with Schannel or Secure Transport support, then this does not apply to you. Scroll down for details on how the OS-native engines handle SSL certificates. If you're not sure, then run "curl -V" and read the results. If the version string says "WinSSL" in it, then it was built with Schannel support.) libcurl performs peer SSL certificate verification by default. This is done by using CA cert bundle that the SSL library can use to make sure the peer's server certificate is valid. If you communicate with HTTPS or FTPS servers using certificates that are signed by CAs present in the bundle, you can be sure that the remote server really is the one it claims to be. Until 7.18.0, curl bundled a severely outdated ca bundle file that was installed by default. These days, the curl archives include no ca certs at all. You need to get them elsewhere. See below for example. If the remote server uses a self-signed certificate, if you don't install a CA cert bundle, if the server uses a certificate signed by a CA that isn't included in the bundle you use or if the remote host is an impostor impersonating your favorite site, and you want to transfer files from this server, do one of the following: 1. Tell libcurl to *not* verify the peer. With libcurl you disable this with curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE); With the curl command line tool, you disable this with -k/--insecure. 2. Get a CA certificate that can verify the remote server and use the proper option to point out this CA cert for verification when connecting. For libcurl hackers: curl_easy_setopt(curl, CURLOPT_CAPATH, capath); With the curl command line tool: --cacert [file] 3. Add the CA cert for your server to the existing default CA cert bundle. The default path of the CA bundle used can be changed by running configure with the --with-ca-bundle option pointing out the path of your choice. To do this, you need to get the CA cert for your server in PEM format and then append that to your CA cert bundle. If you use Internet Explorer, this is one way to get extract the CA cert for a particular server: o View the certificate by double-clicking the padlock o Find out where the CA certificate is kept (Certificate> Authority Information Access>URL) o Get a copy of the crt file using curl o Convert it from crt to PEM using the openssl tool: openssl x509 -inform DES -in yourdownloaded.crt \ -out outcert.pem -text o Append the 'outcert.pem' to the CA cert bundle or use it stand-alone as described below. If you use the 'openssl' tool, this is one way to get extract the CA cert for a particular server: o openssl s_client -connect xxxxx.com:443 |tee logfile o type "QUIT", followed by the "ENTER" key o The certificate will have "BEGIN CERTIFICATE" and "END CERTIFICATE" markers. o If you want to see the data in the certificate, you can do: "openssl x509 -inform PEM -in certfile -text -out certdata" where certfile is the cert you extracted from logfile. Look in certdata. o If you want to trust the certificate, you can append it to your cert_bundle or use it stand-alone as described. Just remember that the security is no better than the way you obtained the certificate. 4. If you're using the curl command line tool, you can specify your own CA cert path by setting the environment variable CURL_CA_BUNDLE to the path of your choice. If you're using the curl command line tool on Windows, curl will search for a CA cert file named "curl-ca-bundle.crt" in these directories and in this order: 1. application's directory 2. current working directory 3. Windows System directory (e.g. C:\windows\system32) 4. Windows Directory (e.g. C:\windows) 5. all directories along %PATH% 5. Get a better/different/newer CA cert bundle! One option is to extract the one a recent Firefox browser uses by running 'make ca-bundle' in the curl build tree root, or possibly download a version that was generated this way for you: http://curl.haxx.se/docs/caextract.html Neglecting to use one of the above methods when dealing with a server using a certificate that isn't signed by one of the certificates in the installed CA cert bundle, will cause SSL to report an error ("certificate verify failed") during the handshake and SSL will then refuse further communication with that server. Peer SSL Certificate Verification with NSS ========================================== If libcurl was built with NSS support, then depending on the OS distribution, it is probably required to take some additional steps to use the system-wide CA cert db. RedHat ships with an additional module, libnsspem.so, which enables NSS to read the OpenSSL PEM CA bundle. This library is missing in OpenSuSE, and without it, NSS can only work with its own internal formats. NSS also has a new database format: https://wiki.mozilla.org/NSS_Shared_DB Starting with version 7.19.7, libcurl will check for the NSS version it runs, and automatically add the 'sql:' prefix to the certdb directory (either the hardcoded default /etc/pki/nssdb or the directory configured with SSL_DIR environment variable) if version 3.12.0 or later is detected. To check which ertdb format your distribution provides, examine the default certdb location: /etc/pki/nssdb; the new certdb format can be identified by the filenames cert9.db, key4.db, pkcs11.txt; filenames of older versions are cert8.db, key3.db, modsec.db. Usually these cert databases are empty, but NSS also has built-in CAs which are provided through a shared library, libnssckbi.so; if you want to use these built-in CAs, then create a symlink to libnssckbi.so in /etc/pki/nssdb: ln -s /usr/lib[64]/libnssckbi.so /etc/pki/nssdb/libnssckbi.so Peer SSL Certificate Verification with Schannel and Secure Transport ==================================================================== If libcurl was built with Schannel (Microsoft's TLS/SSL engine) or Secure Transport (Apple's TLS/SSL engine) support, then libcurl will still perform peer certificate verification, but instead of using a CA cert bundle, it will use the certificates that are built into the OS. These are the same certificates that appear in the Internet Options control panel (under Windows) or Keychain Access application (under OS X). Any custom security rules for certificates will be honored. Schannel will run CRL checks on certificates unless peer verification is disabled. Secure Transport on iOS will run OCSP checks on certificates unless peer verification is disabled. Secure Transport on OS X will run either OCSP or CRL checks on certificates if those features are enabled, and this behavior can be adjusted in the preferences of Keychain Access. curl-7.35.0/docs/LICENSE-MIXING0000644000175000017500000001341312213173003012414 00000000000000 License Mixing with apps, libcurl and Third Party Libraries =========================================================== libcurl can be built to use a fair amount of various third party libraries, libraries that are written and provided by other parties that are distributed using their own licenses. Even libcurl itself contains code that may cause problems to some. This document attempts to describe what licenses libcurl and the other libraries use and what possible dilemmas linking and mixing them all can lead to for end users. I am not a lawyer and this is not legal advice! One common dilemma is that GPL[1]-licensed code is not allowed to be linked with code licensed under the Original BSD license (with the announcement clause). You may still build your own copies that use them all, but distributing them as binaries would be to violate the GPL license - unless you accompany your license with an exception[2]. This particular problem was addressed when the Modified BSD license was created, which does not have the announcement clause that collides with GPL. libcurl http://curl.haxx.se/docs/copyright.html Uses an MIT (or Modified BSD)-style license that is as liberal as possible. Some of the source files that deal with KRB4 have Original BSD-style announce-clause licenses. You may not distribute binaries with krb4-enabled libcurl that also link with GPL-licensed code! OpenSSL http://www.openssl.org/source/license.html (May be used for SSL/TLS support) Uses an Original BSD-style license with an announcement clause that makes it "incompatible" with GPL. You are not allowed to ship binaries that link with OpenSSL that includes GPL code (unless that specific GPL code includes an exception for OpenSSL - a habit that is growing more and more common). If OpenSSL's licensing is a problem for you, consider using GnuTLS or yassl instead. GnuTLS http://www.gnutls.org/ (May be used for SSL/TLS support) Uses the LGPL[3] license. If this is a problem for you, consider using OpenSSL instead. Also note that GnuTLS itself depends on and uses other libs (libgcrypt and libgpg-error) and they too are LGPL- or GPL-licensed. yassl http://www.yassl.com/ (May be used for SSL/TLS support) Uses the GPL[1] license. If this is a problem for you, consider using OpenSSL or GnuTLS instead. NSS http://www.mozilla.org/projects/security/pki/nss/ (May be used for SSL/TLS support) Is covered by the MPL[4] license, the GPL[1] license and the LGPL[3] license. You may choose to license the code under MPL terms, GPL terms, or LGPL terms. These licenses grant you different permissions and impose different obligations. You should select the license that best meets your needs. axTLS http://axtls.sourceforge.net/ (May be used for SSL/TLS support) Uses a Modified BSD-style license. c-ares http://daniel.haxx.se/projects/c-ares/license.html (Used for asynchronous name resolves) Uses an MIT license that is very liberal and imposes no restrictions on any other library or part you may link with. zlib http://www.gzip.org/zlib/zlib_license.html (Used for compressed Transfer-Encoding support) Uses an MIT-style license that shouldn't collide with any other library. krb4 While nothing in particular says that a Kerberos4 library must use any particular license, the one I've tried and used successfully so far (kth-krb4) is partly Original BSD-licensed with the announcement clause. Some of the code in libcurl that is written to deal with Kerberos4 is Modified BSD-licensed. MIT Kerberos http://web.mit.edu/kerberos/www/dist/ (May be used for GSS support) MIT licensed, that shouldn't collide with any other parts. Heimdal http://www.pdc.kth.se/heimdal/ (May be used for GSS support) Heimdal is Original BSD licensed with the announcement clause. GNU GSS http://www.gnu.org/software/gss/ (May be used for GSS support) GNU GSS is GPL licensed. Note that you may not distribute binary curl packages that uses this if you build curl to also link and use any Original BSD licensed libraries! fbopenssl (Used for SPNEGO support) Unclear license. Based on its name, I assume that it uses the OpenSSL license and thus shares the same issues as described for OpenSSL above. libidn http://josefsson.org/libidn/ (Used for IDNA support) Uses the GNU Lesser General Public License [3]. LGPL is a variation of GPL with slightly less aggressive "copyleft". This license requires more requirements to be met when distributing binaries, see the license for details. Also note that if you distribute a binary that includes this library, you must also include the full LGPL license text. Please properly point out what parts of the distributed package that the license addresses. OpenLDAP http://www.openldap.org/software/release/license.html (Used for LDAP support) Uses a Modified BSD-style license. Since libcurl uses OpenLDAP as a shared library only, I have not heard of anyone that ships OpenLDAP linked with libcurl in an app. libssh2 http://www.libssh2.org/ (Used for scp and sftp support) libssh2 uses a Modified BSD-style license. [1] = GPL - GNU General Public License: http://www.gnu.org/licenses/gpl.html [2] = http://www.fsf.org/licenses/gpl-faq.html#GPLIncompatibleLibs details on how to write such an exception to the GPL [3] = LGPL - GNU Lesser General Public License: http://www.gnu.org/licenses/lgpl.html [4] = MPL - Mozilla Public License: http://www.mozilla.org/MPL/ curl-7.35.0/docs/README.win320000644000175000017500000000157012213173003012240 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| README.win32 Read the README file first. Curl has been compiled, built and run on all sorts of Windows and win32 systems. While not being the main develop target, a fair share of curl users are win32-based. The unix-style man pages are tricky to read on windows, so therefore are all those pages converted to HTML as well as pdf, and included in the release archives. The main curl.1 man page is also "built-in" in the command line tool. Use a command line similar to this in order to extract a separate text file: curl -M >manual.txt Read the INSTALL file for instructions how to compile curl self. curl-7.35.0/docs/mk-ca-bundle.html0000644000175000017500000001071512272124467013564 00000000000000 mk-ca-bundle man page

NAME

mk-ca-bundle - convert mozilla's certdata.txt to PEM format

SYNOPSIS

mk-ca-bundle [bilnqtuv] [outputfile]

DESCRIPTION

The mk-ca-bundle tool downloads the certdata.txt file from Mozilla's source tree over HTTP, then parses certdata.txt and extracts CA Root Certificates into PEM format. These are then processed with the OpenSSL commandline tool to produce the final ca-bundle file.

The default outputfile name is ca-bundle.crt. By setting it to '-' (a single dash) you will get the output sent to STDOUT instead of a file.

The PEM format this scripts uses for output makes the result readily available for use by just about all OpenSSL or GnuTLS powered applications, such as curl, wget and more.

OPTIONS

The following options are supported:

-b

backup an existing version of outputfilename

-d [name]

specify which Mozilla tree to pull certdata.txt from (or a custom URL). Valid names are: aurora, beta, central, mozilla, nss, release (default). They are shortcuts for which source tree to get the cert data from.

-f

force rebuild even if certdata.txt is current (Added in version 1.17)

-i

print version info about used modules

-l

print license info about certdata.txt

-n

no download of certdata.txt (to use existing)

-q

be really quiet (no progress output at all)

-t

include plain text listing of certificates

-u

unlink (remove) certdata.txt after processing

-v

be verbose and print out processed CAs

EXIT STATUS

Returns 0 on success. Returns 1 if it fails to download data.

CERTDATA FORMAT

The file format used by Mozilla for this trust information seems to be documented here:

http://p11-glue.freedesktop.org/doc/storing-trust-policy/storing-trust-existing.html

SEE ALSO

curl (1)

HISTORY

mk-ca-bundle is a command line tool that is shipped as part of every curl and libcurl release (see http://curl.haxx.se/). It was originally based on the parse-certs script written by Roland Krikava and was later much improved by Guenter Knauf. This manual page was initially written by Jan Schaumann <jschauma@netmeister.org>.

This HTML page was made with roffit. curl-7.35.0/docs/index.html0000644000175000017500000000113012213173003012404 00000000000000 Index to Curl documentation

Index to Curl documentation

Programs

curl-config
curl

Tutorial

The Art Of Scripting HTTP Requests Using Curl (plain text)

libcurl

See the libcurl section curl-7.35.0/docs/INTERNALS0000644000175000017500000004632412270035364011721 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| INTERNALS The project is split in two. The library and the client. The client part uses the library, but the library is designed to allow other applications to use it. The largest amount of code and complexity is in the library part. GIT === All changes to the sources are committed to the git repository as soon as they're somewhat verified to work. Changes shall be committed as independently as possible so that individual changes can be easier spotted and tracked afterwards. Tagging shall be used extensively, and by the time we release new archives we should tag the sources with a name similar to the released version number. Portability =========== We write curl and libcurl to compile with C89 compilers. On 32bit and up machines. Most of libcurl assumes more or less POSIX compliance but that's not a requirement. We write libcurl to build and work with lots of third party tools, and we want it to remain functional and buildable with these and later versions (older versions may still work but is not what we work hard to maintain): OpenSSL 0.9.6 GnuTLS 1.2 zlib 1.1.4 libssh2 0.16 c-ares 1.6.0 libidn 0.4.1 cyassl 2.0.0 openldap 2.0 MIT krb5 lib 1.2.4 qsossl V5R3M0 NSS 3.14.x axTLS 1.2.7 Heimdal ? On systems where configure runs, we aim at working on them all - if they have a suitable C compiler. On systems that don't run configure, we strive to keep curl running fine on: Windows 98 AS/400 V5R3M0 Symbian 9.1 Windows CE ? TPF ? When writing code (mostly for generating stuff included in release tarballs) we use a few "build tools" and we make sure that we remain functional with these versions: GNU Libtool 1.4.2 GNU Autoconf 2.57 GNU Automake 1.7 (we currently avoid 1.10 due to Solaris-related bugs) GNU M4 1.4 perl 5.004 roffit 0.5 groff ? (any version that supports "groff -Tps -man [in] [out]") ps2pdf (gs) ? Windows vs Unix =============== There are a few differences in how to program curl the unix way compared to the Windows way. The four perhaps most notable details are: 1. Different function names for socket operations. In curl, this is solved with defines and macros, so that the source looks the same at all places except for the header file that defines them. The macros in use are sclose(), sread() and swrite(). 2. Windows requires a couple of init calls for the socket stuff. That's taken care of by the curl_global_init() call, but if other libs also do it etc there might be reasons for applications to alter that behaviour. 3. The file descriptors for network communication and file operations are not easily interchangeable as in unix. We avoid this by not trying any funny tricks on file descriptors. 4. When writing data to stdout, Windows makes end-of-lines the DOS way, thus destroying binary data, although you do want that conversion if it is text coming through... (sigh) We set stdout to binary under windows Inside the source code, We make an effort to avoid '#ifdef [Your OS]'. All conditionals that deal with features *should* instead be in the format '#ifdef HAVE_THAT_WEIRD_FUNCTION'. Since Windows can't run configure scripts, we maintain a curl_config-win32.h file in lib directory that is supposed to look exactly as a curl_config.h file would have looked like on a Windows machine! Generally speaking: always remember that this will be compiled on dozens of operating systems. Don't walk on the edge. Library ======= (See LIBCURL-STRUCTS for a separate document describing all major internal structs and their purposes.) There are plenty of entry points to the library, namely each publicly defined function that libcurl offers to applications. All of those functions are rather small and easy-to-follow. All the ones prefixed with 'curl_easy' are put in the lib/easy.c file. curl_global_init_() and curl_global_cleanup() should be called by the application to initialize and clean up global stuff in the library. As of today, it can handle the global SSL initing if SSL is enabled and it can init the socket layer on windows machines. libcurl itself has no "global" scope. All printf()-style functions use the supplied clones in lib/mprintf.c. This makes sure we stay absolutely platform independent. curl_easy_init() allocates an internal struct and makes some initializations. The returned handle does not reveal internals. This is the 'SessionHandle' struct which works as an "anchor" struct for all curl_easy functions. All connections performed will get connect-specific data allocated that should be used for things related to particular connections/requests. curl_easy_setopt() takes three arguments, where the option stuff must be passed in pairs: the parameter-ID and the parameter-value. The list of options is documented in the man page. This function mainly sets things in the 'SessionHandle' struct. curl_easy_perform() is just a wrapper function that makes use of the multi API. It basically curl_multi_init(), curl_multi_add_handle(), curl_multi_wait(), and curl_multi_perform() until the transfer is done and then returns. Some of the most important key functions in url.c are called from multi.c when certain key steps are to be made in the transfer operation. o Curl_connect() Analyzes the URL, it separates the different components and connects to the remote host. This may involve using a proxy and/or using SSL. The Curl_resolv() function in lib/hostip.c is used for looking up host names (it does then use the proper underlying method, which may vary between platforms and builds). When Curl_connect is done, we are connected to the remote site. Then it is time to tell the server to get a document/file. Curl_do() arranges this. This function makes sure there's an allocated and initiated 'connectdata' struct that is used for this particular connection only (although there may be several requests performed on the same connect). A bunch of things are inited/inherited from the SessionHandle struct. o Curl_do() Curl_do() makes sure the proper protocol-specific function is called. The functions are named after the protocols they handle. The protocol-specific functions of course deal with protocol-specific negotiations and setup. They have access to the Curl_sendf() (from lib/sendf.c) function to send printf-style formatted data to the remote host and when they're ready to make the actual file transfer they call the Curl_Transfer() function (in lib/transfer.c) to setup the transfer and returns. If this DO function fails and the connection is being re-used, libcurl will then close this connection, setup a new connection and re-issue the DO request on that. This is because there is no way to be perfectly sure that we have discovered a dead connection before the DO function and thus we might wrongly be re-using a connection that was closed by the remote peer. Some time during the DO function, the Curl_setup_transfer() function must be called with some basic info about the upcoming transfer: what socket(s) to read/write and the expected file transfer sizes (if known). o Curl_readwrite() Called during the transfer of the actual protocol payload. During transfer, the progress functions in lib/progress.c are called at a frequent interval (or at the user's choice, a specified callback might get called). The speedcheck functions in lib/speedcheck.c are also used to verify that the transfer is as fast as required. o Curl_done() Called after a transfer is done. This function takes care of everything that has to be done after a transfer. This function attempts to leave matters in a state so that Curl_do() should be possible to call again on the same connection (in a persistent connection case). It might also soon be closed with Curl_disconnect(). o Curl_disconnect() When doing normal connections and transfers, no one ever tries to close any connections so this is not normally called when curl_easy_perform() is used. This function is only used when we are certain that no more transfers is going to be made on the connection. It can be also closed by force, or it can be called to make sure that libcurl doesn't keep too many connections alive at the same time. This function cleans up all resources that are associated with a single connection. HTTP(S) HTTP offers a lot and is the protocol in curl that uses the most lines of code. There is a special file (lib/formdata.c) that offers all the multipart post functions. base64-functions for user+password stuff (and more) is in (lib/base64.c) and all functions for parsing and sending cookies are found in (lib/cookie.c). HTTPS uses in almost every means the same procedure as HTTP, with only two exceptions: the connect procedure is different and the function used to read or write from the socket is different, although the latter fact is hidden in the source by the use of Curl_read() for reading and Curl_write() for writing data to the remote server. http_chunks.c contains functions that understands HTTP 1.1 chunked transfer encoding. An interesting detail with the HTTP(S) request, is the Curl_add_buffer() series of functions we use. They append data to one single buffer, and when the building is done the entire request is sent off in one single write. This is done this way to overcome problems with flawed firewalls and lame servers. FTP The Curl_if2ip() function can be used for getting the IP number of a specified network interface, and it resides in lib/if2ip.c. Curl_ftpsendf() is used for sending FTP commands to the remote server. It was made a separate function to prevent us programmers from forgetting that they must be CRLF terminated. They must also be sent in one single write() to make firewalls and similar happy. Kerberos The kerberos support is mainly in lib/krb4.c and lib/security.c. TELNET Telnet is implemented in lib/telnet.c. FILE The file:// protocol is dealt with in lib/file.c. LDAP Everything LDAP is in lib/ldap.c and lib/openldap.c GENERAL URL encoding and decoding, called escaping and unescaping in the source code, is found in lib/escape.c. While transferring data in Transfer() a few functions might get used. curl_getdate() in lib/parsedate.c is for HTTP date comparisons (and more). lib/getenv.c offers curl_getenv() which is for reading environment variables in a neat platform independent way. That's used in the client, but also in lib/url.c when checking the proxy environment variables. Note that contrary to the normal unix getenv(), this returns an allocated buffer that must be free()ed after use. lib/netrc.c holds the .netrc parser lib/timeval.c features replacement functions for systems that don't have gettimeofday() and a few support functions for timeval conversions. A function named curl_version() that returns the full curl version string is found in lib/version.c. Persistent Connections ====================== The persistent connection support in libcurl requires some considerations on how to do things inside of the library. o The 'SessionHandle' struct returned in the curl_easy_init() call must never hold connection-oriented data. It is meant to hold the root data as well as all the options etc that the library-user may choose. o The 'SessionHandle' struct holds the "connection cache" (an array of pointers to 'connectdata' structs). o This enables the 'curl handle' to be reused on subsequent transfers. o When libcurl is told to perform a transfer, it first checks for an already existing connection in the cache that we can use. Otherwise it creates a new one and adds that the cache. If the cache is full already when a new conncetion is added added, it will first close the oldest unused one. o When the transfer operation is complete, the connection is left open. Particular options may tell libcurl not to, and protocols may signal closure on connections and then they won't be kept open of course. o When curl_easy_cleanup() is called, we close all still opened connections, unless of course the multi interface "owns" the connections. The curl handle must be re-used in order for the persistent connections to work. multi interface/non-blocking ============================ The multi interface is a non-blocking interface to the library. To make that interface work as good as possible, no low-level functions within libcurl must be written to work in a blocking manner. (There are still a few spots violating this rule.) One of the primary reasons we introduced c-ares support was to allow the name resolve phase to be perfectly non-blocking as well. The FTP and the SFTP/SCP protocols are examples of how we adapt and adjust the code to allow non-blocking operations even on multi-stage command- response protocols. They are built around state machines that return when they would otherwise block waiting for data. The DICT, LDAP and TELNET protocols are crappy examples and they are subject for rewrite in the future to better fit the libcurl protocol family. SSL libraries ============= Originally libcurl supported SSLeay for SSL/TLS transports, but that was then extended to its successor OpenSSL but has since also been extended to several other SSL/TLS libraries and we expect and hope to further extend the support in future libcurl versions. To deal with this internally in the best way possible, we have a generic SSL function API as provided by the vtls.[ch] system, and they are the only SSL functions we must use from within libcurl. vtls is then crafted to use the appropriate lower-level function calls to whatever SSL library that is in use. For example vtls/openssl.[ch] for the OpenSSL library. Library Symbols =============== All symbols used internally in libcurl must use a 'Curl_' prefix if they're used in more than a single file. Single-file symbols must be made static. Public ("exported") symbols must use a 'curl_' prefix. (There are exceptions, but they are to be changed to follow this pattern in future versions.) Public API functions are marked with CURL_EXTERN in the public header files so that all others can be hidden on platforms where this is possible. Return Codes and Informationals =============================== I've made things simple. Almost every function in libcurl returns a CURLcode, that must be CURLE_OK if everything is OK or otherwise a suitable error code as the curl/curl.h include file defines. The very spot that detects an error must use the Curl_failf() function to set the human-readable error description. In aiding the user to understand what's happening and to debug curl usage, we must supply a fair amount of informational messages by using the Curl_infof() function. Those messages are only displayed when the user explicitly asks for them. They are best used when revealing information that isn't otherwise obvious. API/ABI ======= We make an effort to not export or show internals or how internals work, as that makes it easier to keep a solid API/ABI over time. See docs/libcurl/ABI for our promise to users. Client ====== main() resides in src/tool_main.c. src/tool_hugehelp.c is automatically generated by the mkhelp.pl perl script to display the complete "manual" and the src/tool_urlglob.c file holds the functions used for the URL-"globbing" support. Globbing in the sense that the {} and [] expansion stuff is there. The client mostly messes around to setup its 'config' struct properly, then it calls the curl_easy_*() functions of the library and when it gets back control after the curl_easy_perform() it cleans up the library, checks status and exits. When the operation is done, the ourWriteOut() function in src/writeout.c may be called to report about the operation. That function is using the curl_easy_getinfo() function to extract useful information from the curl session. It may loop and do all this several times if many URLs were specified on the command line or config file. Memory Debugging ================ The file lib/memdebug.c contains debug-versions of a few functions. Functions such as malloc, free, fopen, fclose, etc that somehow deal with resources that might give us problems if we "leak" them. The functions in the memdebug system do nothing fancy, they do their normal function and then log information about what they just did. The logged data can then be analyzed after a complete session, memanalyze.pl is the perl script present in tests/ that analyzes a log file generated by the memory tracking system. It detects if resources are allocated but never freed and other kinds of errors related to resource management. Internally, definition of preprocessor symbol DEBUGBUILD restricts code which is only compiled for debug enabled builds. And symbol CURLDEBUG is used to differentiate code which is _only_ used for memory tracking/debugging. Use -DCURLDEBUG when compiling to enable memory debugging, this is also switched on by running configure with --enable-curldebug. Use -DDEBUGBUILD when compiling to enable a debug build or run configure with --enable-debug. curl --version will list 'Debug' feature for debug enabled builds, and will list 'TrackMemory' feature for curl debug memory tracking capable builds. These features are independent and can be controlled when running the configure script. When --enable-debug is given both features will be enabled, unless some restriction prevents memory tracking from being used. Test Suite ========== The test suite is placed in its own subdirectory directly off the root in the curl archive tree, and it contains a bunch of scripts and a lot of test case data. The main test script is runtests.pl that will invoke test servers like httpserver.pl and ftpserver.pl before all the test cases are performed. The test suite currently only runs on unix-like platforms. You'll find a description of the test suite in the tests/README file, and the test case data files in the tests/FILEFORMAT file. The test suite automatically detects if curl was built with the memory debugging enabled, and if it was it will detect memory leaks, too. Building Releases ================= There's no magic to this. When you consider everything stable enough to be released, do this: 1. Tag the source code accordingly. 2. run the 'maketgz' script (using 'make distcheck' will give you a pretty good view on the status of the current sources). maketgz requires a version number and creates the release archive. maketgz uses 'make dist' for the actual archive building, why you need to fill in the Makefile.am files properly for which files that should be included in the release archives. 3. When that's complete, sign the output files. 4. Upload 5. Update web site and changelog on site 6. Send announcement to the mailing lists NOTE: you must have curl checked out from git to be able to do a proper release build. The release tarballs do not have everything setup in order to do releases properly. curl-7.35.0/docs/THANKS0000644000175000017500000003725712262353672011365 00000000000000 This project has been alive for many years. Countless people have provided feedback that have improved curl. Here follows a list of people that have contributed (a-z order). If you have contributed but are missing here, please let us know! Aaron Oneal Aaron Orenstein Adam D. Moss Adam Light Adam Piggott Adam Tkac Adrian Schuur Adriano Meirelles Ajit Dhumale Aki Koskinen Akos Pasztory Alan Pinstein Albert Chin-A-Young Albert Choy Ale Vesely Alejandro Alvarez Aleksandar Milivojevic Aleksey Tulinov Alessandro Ghedini Alessandro Vesely Alex Bligh Alex Fishman Alex Gruz Alex McLellan Alex Neblett Alex Suykov Alex Vinnik Alex aka WindEagle Alexander Beedie Alexander Klauer Alexander Kourakos Alexander Krasnostavsky Alexander Lazic Alexander Zhuravlev Alexey Borzov Alexey Pesternikov Alexey Simak Alexey Zakhlestin Alexis Carvalho Alfred Gebert Allen Pulsifer Amol Pattekar Amr Shahin Anatoli Tubman Anders Gustafsson Anders Havn Andi Jahja Andre Guibert de Bruet Andreas Damm Andreas Faerber Andreas Farber Andreas Malzahn Andreas Ntaflos Andreas Olsson Andreas Rieke Andreas Schuldei Andreas Wurf Andrei Benea Andrei Cipu Andrej E Baranov Andres Garcia Andrew Benham Andrew Biggs Andrew Bushnell Andrew Francis Andrew Fuller Andrew Kurushin Andrew Moise Andrew Wansink Andrew de los Reyes Andrii Moiseiev Andrés García Andy Cedilnik Andy Serpa Andy Tsouladze Angus Mackay Anthony Bryan Anthony G. Basile Antoine Calando Anton Bychkov Anton Kalmykov Anton Malov Anton Yabchinskiy Arkadiusz Miskiewicz Armel Asselin Arnaud Compan Arnaud Ebalard Arthur Murray Arve Knudsen Ates Goral Augustus Saunders Avery Fay Axel Tillequin Balaji Parasuram Balint Szilakszi Bart Whiteley Bas Mevissen Ben Darnell Ben Greear Ben Madsen Ben Noordhuis Ben Van Hof Ben Winslow Benbuck Nason Benjamin Gerard Benjamin Gilbert Benjamin Johnson Benoit Sigoure Bernard Leak Bernhard Reutner-Fischer Bertrand Demiddelaer Bill Doyle Bill Egert Bill Hoffman Bill Middlecamp Bjoern Sikora Bjorn Augustsson Bjorn Reese Björn Stenberg Blaise Potard Bob Relyea Bob Richmond Bob Schader Bogdan Nicula Brad Burdick Brad Hards Brad King Bradford Bruce Brandon Wang Brendan Jurd Brent Beardsley Brian Akins Brian Dessent Brian J. Murrell Brian R Duffy Brian Ulm Brock Noland Bruce Mitchener Bruno de Carvalho Bryan Henderson Bryan Kemp Byrial Jensen Cameron Kaiser Camille Moncelier Caolan McNamara Carsten Lange Casey O'Donnell Cedric Deltheil Chad Monroe Chandrakant Bagul Charles Kerr Chih-Chung Chang Chris "Bob Bob" Chris Combes Chris Conlon Chris Conroy Chris Deidun Chris Flerackers Chris Gaukroger Chris Maltby Chris Mumford Chris Smowton Christian Grothoff Christian Hägele Christian Krause Christian Kurz Christian Robottom Reis Christian Schmitz Christian Vogt Christian Weisgerber Christophe Demory Christophe Legry Christopher Conroy Christopher Palow Christopher R. Palmer Christopher Stone Ciprian Badescu Claes Jakobsson Clarence Gardner Clemens Gruber Clifford Wolf Cody Jones Colby Ranger Colin Hogben Colin Watson Colm Buckley Constantine Sapuntzakis Cory Nelson Craig A West Craig Davison Craig Markwardt Cris Bailiff Cristian Rodríguez Curt Bogmine Cyrill Osterwalder Cédric Deltheil D. Flinkmann Dag Ekengren Dagobert Michelsen Damien Adant Dan Becker Dan C Dan Fandrich Dan Locks Dan Nelson Dan Petitt Dan Torop Dan Zitter Daniel Black Daniel Cater Daniel Egger Daniel Johnson Daniel Mentz Daniel Steinberg Daniel Stenberg Daniel Theron Daniel at touchtunes Darryl House Darshan Mody Dave Dribin Dave Halbakken Dave Hamilton Dave May Dave Reisner Dave Thompson Dave Vasilevsky David Bau David Binderman David Blaikie David Byron David Cohen David Eriksson David Houlder David Hull David J Meyer David James David Kierznowski David Kimdon David Lang David LeBlanc David McCreedy David Odin David Phillips David Rosenstrauch David Shaw David Strauss David Tarendash David Thiel David Walser David Wright David Yan Dengminwen Derek Higgins Detlef Schmier Didier Brisebourg Diego Casorran Dima Barsky Dima Tisnek Dimitre Dimitrov Dimitris Sarris Dinar Dirk Eddelbuettel Dirk Manske Dmitri Shubin Dmitriy Sergeyev Dmitry Bartsevich Dmitry Kurochkin Dmitry Popov Dmitry Rechkin Dolbneff A.V Domenico Andreoli Dominick Meglio Dominique Leuenberger Doug Kaufman Doug Porter Douglas E. Wegscheid Douglas Kilpatrick Douglas R. Horner Douglas Steinwand Dov Murik Duane Cathey Duncan Duncan Mac-Vicar Prett Dustin Boswell Dylan Ellicott Dylan Salisbury Early Ehlinger Ebenezer Ikonne Edin Kadribasic Eduard Bloch Edward Rudd Edward Sheldrake Eelco Dolstra Eetu Ojanen Eldar Zaitov Ellis Pritchard Elmira A Semenova Emanuele Bovisio Emil Romanus Emiliano Ida Enrico Scholz Enrik Berkhan Eric Cooper Eric Hu Eric Landes Eric Lavigne Eric Lubin Eric Melville Eric Mertens Eric Rautman Eric S. Raymond Eric Thelin Eric Vergnaud Eric Wong Eric Young Erick Nuwendam Erik Johansson Erwan Legrand Erwin Authried Eugene Kotlyarov Evan Jordan Evgeny Turnaev Eygene Ryabinkin Fabian Hiernaux Fabian Keil Fabrizio Ammollo Fedor Karpelevitch Felix Yan Felix von Leitner Feng Tu Florian Schoppmann Forrest Cahoon Francois Charlier Frank Hempel Frank Keeney Frank McGeough Frank Meier Frank Ticheler Frank Van Uffelen FrantiÅ¡ek KuÄera Fred Machado Fred New Fred Noz Frederic Lepied Fredrik Thulin Gabriel Kuri Gabriel Sjoberg Garrett Holmstrom Gary Maxwell Gautam Kachroo Gautam Mani Gavrie Philipson Gaz Iqbal Geoff Beier Georg Horn Georg Huettenegger Georg Lippitsch Georg Wicherski Gerd v. Egidy Gergely Nagy Gerhard Herre Gerrit Bruchhäuser Ghennadi Procopciuc Giancarlo Formicuccia Giaslas Georgios Gil Weber Gilad Gilbert Ramirez Jr. Gilles Blanc Gisle Vanem Giuseppe Attardi Giuseppe D'Ambrosio Glen Nakamura Glen Scott Gokhan Sengun Gordon Marler Gorilla Maguila Grant Erickson Greg Hewgill Greg Morse Greg Onufer Greg Zavertnik Grigory Entin Guenole Bescon Guenter Knauf Guido Berhoerster Guillaume Arluison Gustaf Hui Gwenole Beauchesne Götz Babin-Ebell Hamish Mackenzie Hang Kin Lau Hang Su Hanno Kranzhoff Hans Steegers Hans-Jurgen May Hardeep Singh Harshal Pradhan Hauke Duden He Qin Heikki Korpela Heinrich Ko Heinrich Schaefer Hendrik Visage Henrik Storner Henry Ludemann Herve Amblard Hidemoto Nakada Ho-chi Chen Hoi-Ho Chan Hongli Lai Howard Chu Hzhijun Ian D Allen Ian Ford Ian Gulliver Ian Lynagh Ian Turner Ian Wilkes Ignacio Vazquez-Abrams Igor Franchuk Igor Novoseltsev Igor Polyakov Ilguiz Latypov Ilja van Sprundel Immanuel Gregoire Ingmar Runge Ingo Ralf Blum Ingo Wilken Ishan SinghLevett Jack Zhang Jacky Lam Jacob Meuser Jacob Moshenko Jad Chamcham James Bursa James Cheng James Clancy James Cone James Dury James Gallagher James Griffiths James Housley James MacMillan Jamie Lokier Jamie Newton Jamie Wilkinson Jan Ehrhardt Jan Koen Annot Jan Kunder Jan Schaumann Jan Van Boghout Jared Jennings Jared Lundell Jari Sundell Jason Glasgow Jason Liu Jason McDonald Jason S. Priebe Javier Barroso Jay Austin Jayesh A Shah Jaz Fresh Jean Jacques Drouin Jean-Claude Chauve Jean-Francois Bertrand Jean-Louis Lemaire Jean-Marc Ranger Jean-Noel Rouvignac Jean-Philippe Barrette-LaPierre Jeff Connelly Jeff Johnson Jeff King Jeff Lawson Jeff Phillips Jeff Pohlmeyer Jeff Weber Jeffrey Pohlmeyer Jeremy Friesner Jeremy Huddleston Jerome Muffat-Meridol Jerome Vouillon Jerry Krinock Jerry Wu Jes Badwal Jesper Jensen Jesse Noller Jie He Jim Drash Jim Freeman Jim Hollinger Jim Meyering Jiri Hruska Jiri Jaburek Jocelyn Jaubert Joe Halpin Joe Malicki Joe Mason Joel Chen Jofell Gallardo Johan Anderson Johan Nilsson Johan van Selst Johannes Bauer John Bradshaw John Crow John Dennis John Dunn John E. Malmberg John Gardiner Myers John Janssen John Joseph Bachir John Kelly John Lask John Lightsey John Marino John McGowan John P. McCaskey John Suprock John Wilkinson John-Mark Bell Johnny Luong Jon Grubbs Jon Nelson Jon Sargeant Jon Travis Jon Turner Jonas Forsman Jonas Schnelli Jonatan Lander Jonathan Hseu Jonathan Nieder Jongki Suwandi Jose Kahan Josef Wolf Josh Kapell Joshua Kwan Josue Andrade Gomes Juan Barreto Juan F. Codagnone Juan Ignacio Hervás Judson Bishop Juergen Wilke Jukka Pihl Julian Noble Julian Taylor Julien Chaffraix Julien Royer Jun-ichiro itojun Hagino Jurij Smakov Justin Fletcher Justin Karneges Jörg Mueller-Tolk Jörn Hartroth Kai Engert Kai Sommerfeld Kai-Uwe Rommel Kalle Vahlman Kamil Dudka Kang-Jin Lee Karl M Karl Moerder Karol Pietrzak Kaspar Brand Katie Wang Kees Cook Keith MacDonald Keith McGuigan Keith Mok Ken Hirsch Ken Rastatter Kenny To Kent Boortz Keshav Krity Kevin Baughman Kevin Fisk Kevin Lussier Kevin Reed Kevin Roth Kim Rinnewitz Kim Vandry Kimmo Kinnunen Kjell Ericson Kjetil Jacobsen Klevtsov Vadim Konstantin Isakov Kris Kennaway Krishnendu Majumdar Krister Johansen Kristian Gunstone Kristian Köhntopp Kyle L. Huff Kyle Sallee Lachlan O'Dea Larry Campbell Larry Fahnoe Lars Buitinck Lars Gustafsson Lars J. Aas Lars Johannesen Lars Nilsson Lars Torben Wilson Lau Hang Kin Laurent Rabret Legoff Vincent Lehel Bernadt Len Krause Lenaic Lefever Lenny Rachitsky Liam Healy Lijo Antony Linas Vepstas Ling Thio Linus Nielsen Feltzing Lisa Xu Liza Alenchery Lluís Batlle i Rossell Loic Dachary Loren Kirkby Luca Altea Luca Alteas Lucas Adamski Ludovico Cavedon Lukasz Czekierda Luke Amery Luke Call Luong Dinh Dung Maciej Karpiuk Maciej W. Rozycki Mamoru Tasaka Mandy Wu Manfred Schwarb Manuel Massing Marc Boucher Marc Deslauriers Marc Doughty Marc Hoersken Marc Kleine-Budde Marcel Raad Marcel Roelofs Marcelo Juchem Marcin Adamski Marcin Gryszkalis Marcin Konicki Marco G. Salvagno Marco Maggi Marcus Sundberg Marcus Webster Mario Schroeder Mark Brand Mark Butler Mark Davies Mark Eichin Mark Incley Mark Karpeles Mark Lentczner Mark Salisbury Mark Snelling Mark Tully Markus Duft Markus Koetter Markus Moeller Markus Oberhumer Martijn Koster Martin C. Martin Martin Drasar Martin Hager Martin Hedenfalk Martin Jansen Martin Lemke Martin Skinner Martin Storsjo Marty Kuhrt Maruko Massimiliano Ziccardi Massimo Callegari Mateusz Loskot Mathias Axelsson Mats Lidell Matt Arsenault Matt Kraai Matt Veenstra Matt Witherspoon Matt Wixson Matteo Rocco Matthew Blain Matthew Clarke Matthias Bolte Maurice Barnum Mauro Iorio Max Katsev Maxim Ivanov Maxim Perenesenko Maxim Prohorov Maxime Larocque Mehmet Bozkurt Mekonikum Melissa Mears Mettgut Jamalla Michael Benedict Michael Calmer Michael Cronenworth Michael Curtis Michael Day Michael Goffioul Michael Jahn Michael Jerris Michael Mealling Michael Mueller Michael Osipov Michael Smith Michael Stillwell Michael Wallner Michal Bonino Michal Gorny Michal Kowalczyk Michal Marek Michele Bini Miguel Angel Mihai Ionescu Mikael Johansson Mikael Sennerholm Mike Bytnar Mike Crowe Mike Dobbs Mike Giancola Mike Hommey Mike Mio Mike Power Mike Protts Mike Revi Miklos Nemeth Mitz Wark Mohamed Lrhazi Mohun Biswas Moonesamy Myk Taylor Nach M. S. Nathan Coulter Nathan O'Sullivan Nathanael Nerode Naveen Chandran Naveen Noel Neil Bowers Neil Dunbar Neil Spring Nic Roets Nicholas Maniscalco Nick Gimbrone Nick Humfrey Nick Zitzmann Nico Baggus Nicolas Berloquin Nicolas Croiset Nicolas François Niels van Tongeren Nikita Schmidt Nikitinskit Dmitriy Niklas Angebrand Nikolai Kondrashov Nikos Mavrogiannopoulos Ning Dong Nir Soffer Nis Jorgensen Nodak Sodak Norbert Frese Norbert Novotny Ofer Olaf Flebbe Olaf Stueben Olaf Stüben Oliver Gondža Oliver Kuckertz Olivier Berger Oren Tirosh Ori Avtalion Oscar Koeroo Oscar Norlander P R Schaffner Paolo Piacentini Pascal Terjan Pasha Kuznetsov Pat Ray Patrice Guerin Patricia Muscalu Patrick Bihan-Faou Patrick Monnerat Patrick Scott Patrick Smith Patrik Thunstrom Pau Garcia i Quiles Paul Donohue Paul Harrington Paul Howarth Paul Marks Paul Marquis Paul Moore Paul Nolan Paul Querna Pavel Cenek Pavel Orehov Pavel Raiskup Pawel A. Gajda Pawel Kierski Pedro Larroy Pedro Neves Pete Su Peter Bray Peter Forret Peter Gal Peter Heuchert Peter Hjalmarsson Peter Korsgaard Peter Lamberg Peter O'Gorman Peter Pentchev Peter Silva Peter Su Peter Sylvester Peter Todd Peter Verhas Peter Wullinger Peteris Krumins Petr Bahula Petr Pisar Phil Blundell Phil Karn Phil Lisiecki Phil Pellouchoud Philip Craig Philip Gladstone Philip Langdale Philippe Hameau Philippe Raoult Philippe Vaucher Pierre Pierre Brico Pierre Chapuis Pierre Joye Pierre Ynard Pooyan McSporran Pramod Sharma Puneet Pawaia Quagmire Quanah Gibson-Mount Quinn Slack Rafa Muyo Rafael Sagula Rainer Canavan Rainer Jung Rainer Koenig Rajesh Naganathan Ralf S. Engelschall Ralph Beckmann Ralph Mitchell Ramana Mokkapati Randy McMurchy Ravi Pratap Ray Dassen Ray Pekowski Reinout van Schouwen Renato Botelho Renaud Chaillat Renaud Duhaut Renaud Guillard Rene Bernhardt Rene Rebe Reuven Wachtfogel Reza Arbab Ricardo Cadime Rich Gray Rich Rauenzahn Richard Archer Richard Atterer Richard Bramante Richard Clayton Richard Cooper Richard Gorton Richard Michael Richard Prescott Richard Silverman Rick Jones Rick Richardson Rob Crittenden Rob Jones Rob Stanzel Rob Ward Robert A. Monat Robert B. Harris Robert D. Young Robert Foreman Robert Iakobashvili Robert Olson Robert Schumann Robert Weaver Robert Wruck Robin Cornelius Robin Johnson Robin Kay Robson Braga Araujo Rodney Simmons Rodrigo Silva Roland Blom Roland Krikava Roland Zimmermann Rolland Dudemaine Roman Koifman Roman Mamedov Romulo A. Ceccon Ron Zapp Rosimildo da Silva Roy Shan Rune Kleveland Ruslan Gazizov Rutger Hofman Ryan Chan Ryan Nelson Ryan Schmidt Rémy Léone S. Moonesamy Salvador Dávila Salvatore Sorrentino Sam Deane Sam Listopad Sampo Kellomaki Samuel Díaz García Samuel Listopad Samuel Thibault Sander Gates Sandor Feldi Santhana Todatry Saqib Ali Sara Golemon Saran Neti Saul good Scott Bailey Scott Barrett Scott Cantor Scott Davis Scott McCreary Sebastian Rasmussen Sebastien Willemijns Senthil Raja Velu Sergei Nikulov Sergey Tatarincev Sergio Ballestrero Seshubabu Pasam Sh Diao Sharad Gupta Shard Shawn Landden Shawn Poulson Shmulik Regev Siddhartha Prakash Jain Sidney San Martin Siegfried Gyuricsko Simon Dick Simon Josefsson Simon Liu Song Ma Sonia Subramanian Spacen Jasset Spiridonoff A.V Stadler Stephan Stan van de Burgt Stanislav Ivochkin Stefan Esser Stefan Krause Stefan Neis Stefan Teleman Stefan Tomanek Stefan Ulrich Stephan Bergmann Stephen Collyer Stephen Kick Stephen More Sterling Hughes Steve Green Steve H Truong Steve Holme Steve Lhomme Steve Little Steve Marx Steve Oliphant Steve Roskowski Steven Bazyl Steven G. Johnson Steven Gu Steven M. Schweda Steven Parkes Stoned Elipot Sven Anders Sven Neuhaus Sven Wegener Sébastien Willemijns T. Bharath T. Yamada Taneli Vahakangas Tanguy Fautre Tatsuhiro Tsujikawa Temprimus Thomas J. Moore Thomas Klausner Thomas L. Shinnick Thomas Lopatic Thomas Schwinge Thomas Tonino Tim Ansell Tim Baker Tim Bartley Tim Chen Tim Costello Tim Harder Tim Heckman Tim Newsome Tim Sneddon Timo Sirainen Tinus van den Berg Tobias Rundström Toby Peterson Todd A Ouska Todd Kulesza Todd Ouska Todd Vierling Tom Benoist Tom Donovan Tom Grace Tom Lee Tom Mattison Tom Moers Tom Mueller Tom Regner Tom Wright Tom Zerucha Tomas Hoger Tomas Mlcoch Tomas Pospisek Tomas Szepe Tomasz Lacki Tommie Gannert Tommy Tam Ton Voon Toni Moreno Toon Verwaest Tor Arntsen Torsten Foertsch Toshio Kuratomi Toshiyuki Maezawa Traian Nicolescu Troels Walsted Hansen Troy Engel Tupone Alfredo Tyler Hall Ulf Härnhammar Ulf Samuelsson Ulrich Doehner Ulrich Zadow Venkat Akella Victor Snezhko Vikram Saxena Vilmos Nebehaj Vincent Bronner Vincent Le Normand Vincent Penquerc'h Vincent Sanders Vincent Torri Vlad Grachov Vlad Ureche Vladimir Grishchenko Vladimir Lazarenko Vojtech Janota Vojtech Minarik Vsevolod Novikov Walter J. Mack Ward Willats Wayne Haigh Werner Koch Wesley Laxton Wesley Miaw Wez Furlong Wilfredo Sanchez Will Dietz Willem Sparreboom Wojciech Zwiefka Wouter Van Rooy Wu Yongzheng Xavier Bouchoux Yaakov Selkowitz Yamada Yasuharu Yang Tse Yarram Sunil Yehoshua Hershberg Yi Huang Yukihiro Kawada Yuriy Sosov Yves Arrouye Yves Lejeune Zdenek Pavlas Zekun Ni Zmey Petroff Zvi Har'El nk swalkaus at yahoo.com tommink[at]post.pl curl-7.35.0/docs/HTTP-COOKIES0000644000175000017500000001070412213173003012212 00000000000000Updated: July 3, 2012 (http://curl.haxx.se/docs/http-cookies.html) _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| HTTP Cookies 1. HTTP Cookies 1.1 Cookie overview 1.2 Cookies saved to disk 1.3 Cookies with curl the command line tool 1.4 Cookies with libcurl 1.5 Cookies with javascript ============================================================================== 1. HTTP Cookies 1.1 Cookie overview HTTP cookies are pieces of 'name=contents' snippets that a server tells the client to hold and then the client sends back those the server on subsequent requests to the same domains/paths for which the cookies were set. Cookies are either "session cookies" which typically are forgotten when the session is over which is often translated to equal when browser quits, or the cookies aren't session cookies they have expiration dates after which the client will throw them away. Cookies are set to the client with the Set-Cookie: header and are sent to servers with the Cookie: header. For a very long time, the only spec explaining how to use cookies was the original Netscape spec from 1994: http://curl.haxx.se/rfc/cookie_spec.html In 2011, RFC6265 (http://www.ietf.org/rfc/rfc6265.txt) was finally published and details how cookies work within HTTP. 1.2 Cookies saved to disk Netscape once created a file format for storing cookies on disk so that they would survive browser restarts. curl adopted that file format to allow sharing the cookies with browsers, only to see browsers move away from that format. Modern browsers no longer use it, while curl still does. The netscape cookie file format stores one cookie per physical line in the file with a bunch of associated meta data, each field separated with TAB. That file is called the cookiejar in curl terminology. When libcurl saves a cookiejar, it creates a file header of its own in which there is a URL mention that will link to the web version of this document. 1.3 Cookies with curl the command line tool curl has a full cookie "engine" built in. If you just activate it, you can have curl receive and send cookies exactly as mandated in the specs. Command line options: -b, --cookie tell curl a file to read cookies from and start the cookie engine, or if it isn't a file it will pass on the given string. -b name=var works and so does -b cookiefile. -j, --junk-session-cookies when used in combination with -b, it will skip all "session cookies" on load so as to appear to start a new cookie session. -c, --cookie-jar tell curl to start the cookie engine and write cookies to the given file after the request(s) 1.4 Cookies with libcurl libcurl offers several ways to enable and interface the cookie engine. These options are the ones provided by the native API. libcurl bindings may offer access to them using other means. CURLOPT_COOKIE Is used when you want to specify the exact contents of a cookie header to send to the server. CURLOPT_COOKIEFILE Tell libcurl to activate the cookie engine, and to read the initial set of cookies from the given file. Read-only. CURLOPT_COOKIEJAR Tell libcurl to activate the cookie engine, and when the easy handle is closed save all known cookies to the given cookiejar file. Write-only. CURLOPT_COOKIELIST Provide detailed information about a single cookie to add to the internal storage of cookies. Pass in the cookie as a HTTP header with all the details set, or pass in a line from a netscape cookie file. This option can also be used to flush the cookies etc. CURLINFO_COOKIELIST Extract cookie information from the internal cookie storage as a linked list. 1.5 Cookies with javascript These days a lot of the web is built up by javascript. The webbrowser loads complete programs that render the page you see. These javascript programs can also set and access cookies. Since curl and libcurl are plain HTTP clients without any knowledge of or capability to handle javascript, such cookies will not be detected or used. Often, if you want to mimic what a browser does on such web sites, you can record web browser HTTP traffic when using such a site and then repeat the cookie operations using curl or libcurl. curl-7.35.0/docs/README.netware0000644000175000017500000000177712213173003012754 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| README.netware Read the README file first. Curl has been successfully compiled with gcc / nlmconv on different flavours of Linux as well as with the official Metrowerks CodeWarrior compiler. While not being the main development target, a continously growing share of curl users are NetWare-based, specially also consuming the lib from PHP. The unix-style man pages are tricky to read on windows, so therefore are all those pages converted to HTML as well as pdf, and included in the release archives. The main curl.1 man page is also "built-in" in the command line tool. Use a command line similar to this in order to extract a separate text file: curl -M >manual.txt Read the INSTALL file for instructions how to compile curl self. curl-7.35.0/docs/TheArtOfHttpScripting0000644000175000017500000006520012270035364014553 00000000000000Updated: Dec 24, 2013 (http://curl.haxx.se/docs/httpscripting.html) _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| The Art Of Scripting HTTP Requests Using Curl 1. HTTP Scripting 1.1 Background 1.2 The HTTP Protocol 1.3 See the Protocol 1.4 See the Timing 1.5 See the Response 2. URL 2.1 Spec 2.2 Host 2.3 Port number 2.4 User name and password 2.5 Path part 3. Fetch a page 3.1 GET 3.2 HEAD 4. HTML forms 4.1 Forms explained 4.2 GET 4.3 POST 4.4 File Upload POST 4.5 Hidden Fields 4.6 Figure Out What A POST Looks Like 5. HTTP upload 5.1 PUT 6. HTTP Authentication 6.1 Basic Authentication 6.2 Other Authentication 6.3 Proxy Authentication 6.4 Hiding credentials 7. More HTTP Headers 7.1 Referer 7.2 User Agent 8. Redirects 8.1 Location header 8.2 Other redirects 9. Cookies 9.1 Cookie Basics 9.2 Cookie options 10. HTTPS 10.1 HTTPS is HTTP secure 10.2 Certificates 11. Custom Request Elements 11.1 Modify method and headers 11.2 More on changed methods 12. Web Login 12.1 Some login tricks 13. Debug 13.1 Some debug tricks 14. References 14.1 Standards 14.2 Sites ============================================================================== 1. HTTP Scripting 1.1 Background This document assumes that you're familiar with HTML and general networking. The increasing amount of applications moving to the web has made "HTTP Scripting" more frequently requested and wanted. To be able to automatically extract information from the web, to fake users, to post or upload data to web servers are all important tasks today. Curl is a command line tool for doing all sorts of URL manipulations and transfers, but this particular document will focus on how to use it when doing HTTP requests for fun and profit. I'll assume that you know how to invoke 'curl --help' or 'curl --manual' to get basic information about it. Curl is not written to do everything for you. It makes the requests, it gets the data, it sends data and it retrieves the information. You probably need to glue everything together using some kind of script language or repeated manual invokes. 1.2 The HTTP Protocol HTTP is the protocol used to fetch data from web servers. It is a very simple protocol that is built upon TCP/IP. The protocol also allows information to get sent to the server from the client using a few different methods, as will be shown here. HTTP is plain ASCII text lines being sent by the client to a server to request a particular action, and then the server replies a few text lines before the actual requested content is sent to the client. The client, curl, sends a HTTP request. The request contains a method (like GET, POST, HEAD etc), a number of request headers and sometimes a request body. The HTTP server responds with a status line (indicating if things went well), response headers and most often also a response body. The "body" part is the plain data you requested, like the actual HTML or the image etc. 1.3 See the Protocol Using curl's option --verbose (-v as a short option) will display what kind of commands curl sends to the server, as well as a few other informational texts. --verbose is the single most useful option when it comes to debug or even understand the curl<->server interaction. Sometimes even --verbose is not enough. Then --trace and --trace-ascii offer even more details as they show EVERYTHING curl sends and receives. Use it like this: curl --trace-ascii debugdump.txt http://www.example.com/ 1.4 See the Timing Many times you may wonder what exactly is taking all the time, or you just want to know the amount of milliseconds between two points in a transfer. For those, and other similar situations, the --trace-time option is what you need. It'll prepend the time to each trace output line: curl --trace-ascii d.txt --trace-time http://example.com/ 1.5 See the Response By default curl sends the response to stdout. You need to redirect it somewhere to avoid that, most often that is done with -o or -O. 2. URL 2.1 Spec The Uniform Resource Locator format is how you specify the address of a particular resource on the Internet. You know these, you've seen URLs like http://curl.haxx.se or https://yourbank.com a million times. RFC 3986 is the canonical spec. 2.2 Host The host name is usually resolved using DNS or your /etc/hosts file to an IP address and that's what curl will communicate with. Alternatively you specify the IP address directly in the URL instead of a name. For development and other trying out situation, you can point out a different IP address for a host name than what would otherwise be used, by using curl's --resolve option: curl --resolve www.example.org:80:127.0.0.1 http://www.example.org/ 2.3 Port number Each protocol curl supports operate on a default port number, be it over TCP or in some cases UDP. Normally you don't have to take that into consideration, but at times you run test servers on other ports or similar. Then you can specify the port number in the URL with a colon and a number immediately following the host name. Like when doing HTTP to port 1234: curl http://www.example.org:1234/ The port number you specify in the URL is the number that the server uses to offer its services. Sometimes you may use a local proxy, and then you may need to specify that proxy's port number separate on what curl needs to connect to locally. Like when using a HTTP proxy on port 4321: curl --proxy http://proxy.example.org:4321 http://remote.example.org/ 2.4 User name and password Some services are setup to require HTTP authentication and then you need to provide name and password which then is transfered to the remote site in various ways depending on the exact authentication protocol used. You can opt to either insert the user and password in the URL or you can provide them separately: curl http://user:password@example.org/ or curl -u user:password http://example.org/ You need to pay attention that this kind of HTTP authentication is not what is usually done and requested by user-oriented web sites these days. They tend to use forms and cookies instead. 2.5 Path part The path part is just sent off to the server to request that it sends back the associated response. The path is what is to the right side of the slash that follows the host name and possibly port number. 3. Fetch a page 3.1 GET The simplest and most common request/operation made using HTTP is to get a URL. The URL could itself refer to a web page, an image or a file. The client issues a GET request to the server and receives the document it asked for. If you issue the command line curl http://curl.haxx.se you get a web page returned in your terminal window. The entire HTML document that that URL holds. All HTTP replies contain a set of response headers that are normally hidden, use curl's --include (-i) option to display them as well as the rest of the document. 3.2 HEAD You can ask the remote server for ONLY the headers by using the --head (-I) option which will make curl issue a HEAD request. In some special cases servers deny the HEAD method while others still work, which is a particular kind of annoyance. The HEAD method is defined and made so that the server returns the headers exactly the way it would do for a GET, but without a body. It means that you may see a Content-Length: in the response headers, but there must not be an actual body in the HEAD response. 4. HTML forms 4.1 Forms explained Forms are the general way a web site can present a HTML page with fields for the user to enter data in, and then press some kind of 'OK' or 'submit' button to get that data sent to the server. The server then typically uses the posted data to decide how to act. Like using the entered words to search in a database, or to add the info in a bug track system, display the entered address on a map or using the info as a login-prompt verifying that the user is allowed to see what it is about to see. Of course there has to be some kind of program in the server end to receive the data you send. You cannot just invent something out of the air. 4.2 GET A GET-form uses the method GET, as specified in HTML like: In your favorite browser, this form will appear with a text box to fill in and a press-button labeled "OK". If you fill in '1905' and press the OK button, your browser will then create a new URL to get for you. The URL will get "junk.cgi?birthyear=1905&press=OK" appended to the path part of the previous URL. If the original form was seen on the page "www.hotmail.com/when/birth.html", the second page you'll get will become "www.hotmail.com/when/junk.cgi?birthyear=1905&press=OK". Most search engines work this way. To make curl do the GET form post for you, just enter the expected created URL: curl "http://www.hotmail.com/when/junk.cgi?birthyear=1905&press=OK" 4.3 POST The GET method makes all input field names get displayed in the URL field of your browser. That's generally a good thing when you want to be able to bookmark that page with your given data, but it is an obvious disadvantage if you entered secret information in one of the fields or if there are a large amount of fields creating a very long and unreadable URL. The HTTP protocol then offers the POST method. This way the client sends the data separated from the URL and thus you won't see any of it in the URL address field. The form would look very similar to the previous one:
And to use curl to post this form with the same data filled in as before, we could do it like: curl --data "birthyear=1905&press=%20OK%20" \ http://www.example.com/when.cgi This kind of POST will use the Content-Type application/x-www-form-urlencoded and is the most widely used POST kind. The data you send to the server MUST already be properly encoded, curl will not do that for you. For example, if you want the data to contain a space, you need to replace that space with %20 etc. Failing to comply with this will most likely cause your data to be received wrongly and messed up. Recent curl versions can in fact url-encode POST data for you, like this: curl --data-urlencode "name=I am Daniel" http://www.example.com 4.4 File Upload POST Back in late 1995 they defined an additional way to post data over HTTP. It is documented in the RFC 1867, why this method sometimes is referred to as RFC1867-posting. This method is mainly designed to better support file uploads. A form that allows a user to upload a file could be written like this in HTML:
This clearly shows that the Content-Type about to be sent is multipart/form-data. To post to a form like this with curl, you enter a command line like: curl --form upload=@localfilename --form press=OK [URL] 4.5 Hidden Fields A very common way for HTML based application to pass state information between pages is to add hidden fields to the forms. Hidden fields are already filled in, they aren't displayed to the user and they get passed along just as all the other fields. A similar example form with one visible field, one hidden field and one submit button could look like:
To post this with curl, you won't have to think about if the fields are hidden or not. To curl they're all the same: curl --data "birthyear=1905&press=OK&person=daniel" [URL] 4.6 Figure Out What A POST Looks Like When you're about fill in a form and send to a server by using curl instead of a browser, you're of course very interested in sending a POST exactly the way your browser does. An easy way to get to see this, is to save the HTML page with the form on your local disk, modify the 'method' to a GET, and press the submit button (you could also change the action URL if you want to). You will then clearly see the data get appended to the URL, separated with a '?'-letter as GET forms are supposed to. 5. HTTP upload 5.1 PUT The perhaps best way to upload data to a HTTP server is to use PUT. Then again, this of course requires that someone put a program or script on the server end that knows how to receive a HTTP PUT stream. Put a file to a HTTP server with curl: curl --upload-file uploadfile http://www.example.com/receive.cgi 6. HTTP Authentication 6.1 Basic Authentication HTTP Authentication is the ability to tell the server your username and password so that it can verify that you're allowed to do the request you're doing. The Basic authentication used in HTTP (which is the type curl uses by default) is *plain* *text* based, which means it sends username and password only slightly obfuscated, but still fully readable by anyone that sniffs on the network between you and the remote server. To tell curl to use a user and password for authentication: curl --user name:password http://www.example.com 6.2 Other Authentication The site might require a different authentication method (check the headers returned by the server), and then --ntlm, --digest, --negotiate or even --anyauth might be options that suit you. 6.3 Proxy Authentication Sometimes your HTTP access is only available through the use of a HTTP proxy. This seems to be especially common at various companies. A HTTP proxy may require its own user and password to allow the client to get through to the Internet. To specify those with curl, run something like: curl --proxy-user proxyuser:proxypassword curl.haxx.se If your proxy requires the authentication to be done using the NTLM method, use --proxy-ntlm, if it requires Digest use --proxy-digest. If you use any one these user+password options but leave out the password part, curl will prompt for the password interactively. 6.4 Hiding credentials Do note that when a program is run, its parameters might be possible to see when listing the running processes of the system. Thus, other users may be able to watch your passwords if you pass them as plain command line options. There are ways to circumvent this. It is worth noting that while this is how HTTP Authentication works, very many web sites will not use this concept when they provide logins etc. See the Web Login chapter further below for more details on that. 7. More HTTP Headers 7.1 Referer A HTTP request may include a 'referer' field (yes it is misspelled), which can be used to tell from which URL the client got to this particular resource. Some programs/scripts check the referer field of requests to verify that this wasn't arriving from an external site or an unknown page. While this is a stupid way to check something so easily forged, many scripts still do it. Using curl, you can put anything you want in the referer-field and thus more easily be able to fool the server into serving your request. Use curl to set the referer field with: curl --referer http://www.example.come http://www.example.com 7.2 User Agent Very similar to the referer field, all HTTP requests may set the User-Agent field. It names what user agent (client) that is being used. Many applications use this information to decide how to display pages. Silly web programmers try to make different pages for users of different browsers to make them look the best possible for their particular browsers. They usually also do different kinds of javascript, vbscript etc. At times, you will see that getting a page with curl will not return the same page that you see when getting the page with your browser. Then you know it is time to set the User Agent field to fool the server into thinking you're one of those browsers. To make curl look like Internet Explorer 5 on a Windows 2000 box: curl --user-agent "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" [URL] Or why not look like you're using Netscape 4.73 on an old Linux box: curl --user-agent "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" [URL] 8. Redirects 8.1 Location header When a resource is requested from a server, the reply from the server may include a hint about where the browser should go next to find this page, or a new page keeping newly generated output. The header that tells the browser to redirect is Location:. Curl does not follow Location: headers by default, but will simply display such pages in the same manner it display all HTTP replies. It does however feature an option that will make it attempt to follow the Location: pointers. To tell curl to follow a Location: curl --location http://www.example.com If you use curl to POST to a site that immediately redirects you to another page, you can safely use --location (-L) and --data/--form together. Curl will only use POST in the first request, and then revert to GET in the following operations. 8.2 Other redirects Browser typically support at least two other ways of redirects that curl doesn't: first the html may contain a meta refresh tag that asks the browser to load a specific URL after a set number of seconds, or it may use javascript to do it. 9. Cookies 9.1 Cookie Basics The way the web browsers do "client side state control" is by using cookies. Cookies are just names with associated contents. The cookies are sent to the client by the server. The server tells the client for what path and host name it wants the cookie sent back, and it also sends an expiration date and a few more properties. When a client communicates with a server with a name and path as previously specified in a received cookie, the client sends back the cookies and their contents to the server, unless of course they are expired. Many applications and servers use this method to connect a series of requests into a single logical session. To be able to use curl in such occasions, we must be able to record and send back cookies the way the web application expects them. The same way browsers deal with them. 9.2 Cookie options The simplest way to send a few cookies to the server when getting a page with curl is to add them on the command line like: curl --cookie "name=Daniel" http://www.example.com Cookies are sent as common HTTP headers. This is practical as it allows curl to record cookies simply by recording headers. Record cookies with curl by using the --dump-header (-D) option like: curl --dump-header headers_and_cookies http://www.example.com (Take note that the --cookie-jar option described below is a better way to store cookies.) Curl has a full blown cookie parsing engine built-in that comes to use if you want to reconnect to a server and use cookies that were stored from a previous connection (or handicrafted manually to fool the server into believing you had a previous connection). To use previously stored cookies, you run curl like: curl --cookie stored_cookies_in_file http://www.example.com Curl's "cookie engine" gets enabled when you use the --cookie option. If you only want curl to understand received cookies, use --cookie with a file that doesn't exist. Example, if you want to let curl understand cookies from a page and follow a location (and thus possibly send back cookies it received), you can invoke it like: curl --cookie nada --location http://www.example.com Curl has the ability to read and write cookie files that use the same file format that Netscape and Mozilla once used. It is a convenient way to share cookies between scripts or invokes. The --cookie (-b) switch automatically detects if a given file is such a cookie file and parses it, and by using the --cookie-jar (-c) option you'll make curl write a new cookie file at the end of an operation: curl --cookie cookies.txt --cookie-jar newcookies.txt \ http://www.example.com 10. HTTPS 10.1 HTTPS is HTTP secure There are a few ways to do secure HTTP transfers. The by far most common protocol for doing this is what is generally known as HTTPS, HTTP over SSL. SSL encrypts all the data that is sent and received over the network and thus makes it harder for attackers to spy on sensitive information. SSL (or TLS as the latest version of the standard is called) offers a truckload of advanced features to allow all those encryptions and key infrastructure mechanisms encrypted HTTP requires. Curl supports encrypted fetches thanks to the freely available OpenSSL libraries. To get a page from a HTTPS server, simply run curl like: curl https://secure.example.com 10.2 Certificates In the HTTPS world, you use certificates to validate that you are the one you claim to be, as an addition to normal passwords. Curl supports client- side certificates. All certificates are locked with a pass phrase, which you need to enter before the certificate can be used by curl. The pass phrase can be specified on the command line or if not, entered interactively when curl queries for it. Use a certificate with curl on a HTTPS server like: curl --cert mycert.pem https://secure.example.com curl also tries to verify that the server is who it claims to be, by verifying the server's certificate against a locally stored CA cert bundle. Failing the verification will cause curl to deny the connection. You must then use --insecure (-k) in case you want to tell curl to ignore that the server can't be verified. More about server certificate verification and ca cert bundles can be read in the SSLCERTS document, available online here: http://curl.haxx.se/docs/sslcerts.html 11. Custom Request Elements 11.1 Modify method and headers Doing fancy stuff, you may need to add or change elements of a single curl request. For example, you can change the POST request to a PROPFIND and send the data as "Content-Type: text/xml" (instead of the default Content-Type) like this: curl --data "" --header "Content-Type: text/xml" \ --request PROPFIND url.com You can delete a default header by providing one without content. Like you can ruin the request by chopping off the Host: header: curl --header "Host:" http://www.example.com You can add headers the same way. Your server may want a "Destination:" header, and you can add it: curl --header "Destination: http://nowhere" http://example.com 11.2 More on changed methods It should be noted that curl selects which methods to use on its own depending on what action to ask for. -d will do POST, -I will do HEAD and so on. If you use the --request / -X option you can change the method keyword curl selects, but you will not modify curl's behavior. This means that if you for example use -d "data" to do a POST, you can modify the method to a PROPFIND with -X and curl will still think it sends a POST. You can change the normal GET to a POST method by simply adding -X POST in a command line like: curl -X POST http://example.org/ ... but curl will still think and act as if it sent a GET so it won't send any request body etc. 12. Web Login 12.1 Some login tricks While not strictly just HTTP related, it still cause a lot of people problems so here's the executive run-down of how the vast majority of all login forms work and how to login to them using curl. It can also be noted that to do this properly in an automated fashion, you will most certainly need to script things and do multiple curl invokes etc. First, servers mostly use cookies to track the logged-in status of the client, so you will need to capture the cookies you receive in the responses. Then, many sites also set a special cookie on the login page (to make sure you got there through their login page) so you should make a habit of first getting the login-form page to capture the cookies set there. Some web-based login systems features various amounts of javascript, and sometimes they use such code to set or modify cookie contents. Possibly they do that to prevent programmed logins, like this manual describes how to... Anyway, if reading the code isn't enough to let you repeat the behavior manually, capturing the HTTP requests done by your browers and analyzing the sent cookies is usually a working method to work out how to shortcut the javascript need. In the actual
tag for the login, lots of sites fill-in random/session or otherwise secretly generated hidden tags and you may need to first capture the HTML code for the login form and extract all the hidden fields to be able to do a proper login POST. Remember that the contents need to be URL encoded when sent in a normal POST. 13. Debug 13.1 Some debug tricks Many times when you run curl on a site, you'll notice that the site doesn't seem to respond the same way to your curl requests as it does to your browser's. Then you need to start making your curl requests more similar to your browser's requests: * Use the --trace-ascii option to store fully detailed logs of the requests for easier analyzing and better understanding * Make sure you check for and use cookies when needed (both reading with --cookie and writing with --cookie-jar) * Set user-agent to one like a recent popular browser does * Set referer like it is set by the browser * If you use POST, make sure you send all the fields and in the same order as the browser does it. A very good helper to make sure you do this right, is the LiveHTTPHeader tool that lets you view all headers you send and receive with Mozilla/Firefox (even when using HTTPS). Chrome features similar functionality out of the box among the developer's tools. A more raw approach is to capture the HTTP traffic on the network with tools such as ethereal or tcpdump and check what headers that were sent and received by the browser. (HTTPS makes this technique inefficient.) 14. References 14.1 Standards RFC 2616 is a must to read if you want in-depth understanding of the HTTP protocol RFC 3986 explains the URL syntax RFC 1867 defines the HTTP post upload format RFC 6525 defines how HTTP cookies work 14.2 Sites http://curl.haxx.se is the home of the cURL project curl-7.35.0/docs/INSTALL.devcpp0000644000175000017500000003012112213173003012722 00000000000000DevCpp-Mingw Install & Compilation Sept 2005 ================================== Reference Emails available at curl@haxx.se: Libcurl Install and Use Issues Awaiting an Answer for Win 32 Install res = curl_easy_perform(curl); Error Makefile Issues Having previously done a thorough review of what was available that met my requirements under GPL, I settled for Libcurl as the software of choice for many reasons not the least of which was the support. Background ---------- This quest started when I innocently tried to incorporate the libcurl library into my simple source code. I figured that a few easy steps would accomplish this without major headaches. I had no idea that I would be facing an almost insurmountable challenge. The main problem lies in two areas. First the bulk of support for libcurl exists for a Unix/linux command line environments. This is of little help when it comes to Windows O/S. Secondly the help that does exist for the Windows O/S focused around mingw through a command line argument environment. You may ask "Why is this a problem?" I'm using a Windows O/S with DevCpp. For those of you who are unfamiliar with DevCpp, it is a window shell GUI that replaces the command line environment for gcc. A definite improvement that I am unwilling to give up. However using DevCpp presented its own set of issues. Inadvertently I also made some careless errors such as compiling the 7.14 version of Makefile with an older version of source code. Thanks to Dan Fandrich for picking this up. I did eventually with the help of Daniel, Phillipe and others manage to implement successfully (the only mingw available version) curl-7.13.0-win32-ssl-devel-mingw32 into the DevCpp environment. Only the dynamic libcurl.dll libcurldll.a libraries worked. The static library which I was interested in did not. Furthermore when I tried to implement one of the examples included with the curl package (get info.c) it caused the executable to crash. Tracing the bug I found it in the code and function res = curl_easy_perform(curl);. At this point I had to make a choice as to whether invest my limited time-energy resource to fixing the bug or to compile the new version available. After searching the archives I found a very similar or the same bug reported from version 7.12x on. Daniel did inform me that he thought that this bug had been fixed with the latest version. So I proceeded to compile the latest SSL version where I faced other challenges. In order to make this process unremarkable for others using the same environment I decided to document the process so that others will find it routine. It would be a shame if newbies could not implement this excellent package for their use. I would like to thank the many others in this forum and in the DevCpp forum for their help. Without your help I may either have given up or it would have taken me many times longer to achieve success. The Cookbook Approach --------------------- This discussion will be confined to a SSL static library compilation and installation. Limited mention and comments will be inserted where appropriate to help with non-SSL, dynamic libraries and executables. Using Makefile from DevCpp to compile Libcurl libraries Preamble -------- Using the latest version release - curl-7.14.0.tar.gz. Curl source code is platform independent. This simply means that the source code can be compiled for any Operating System (Linux/Unix Windows etc. and variations of thereof). The first thing to note is that inside curl-7.14.0 you will find two folders lib and src. Both contain Makefile.m32 (required for win mingw library or exe compilation) files which are different. The main difference between these two folders and the makefiles is that the src folder contents are used to compile an executable file(curl.exe) while the lib folder contents are used to compile a static (libcurl.a) and dynamic (libcurl.dll & libcurldll.a) file that can be used to compile libcurl with your own source code so that one can use and access all libcurl functions. Before we start please make sure that DevCpp is installed properly. In particular make sure you have no spaces in the name of any of the directories and subdirectories where DevCpp is installed. Failure to comply with the install instructions may produce erratic behaviour in DevCpp. For further info check the following sites http://aditsu.freeunixhost.com/dev-cpp-faq.html http://sourceforge.net/forum/message.php?msg_id=3252213 As I have mentioned before I will confine this to the SSL Library compilations but the process is very similar for compilation of the executable - curl.exe; just substitute the src folder makefile in its stead. First use a text processor Notepad, or your own favourite text processor. To engage your favourite text processor, select Makefile.m32 click once with your mouse on file icon; icon turns blue, press the shift key and right-click on mouse, menu appears select "Open with", select your favourite text processor. Next read the contents of Makefile.m32. It includes instructions on its use. Method I - DOS Command Line --------------------------- Note - The only reason I have included this method is that Method II which is the preferred method for compiling does not allow for the setting of option switches (e.g. SSL = 1 or SSL =0). At least that's what they tell me at the Dev-Cpp forum. 1 - Make a copy of (D:\Dev-Cpp\bin) bin folder and name it "bin Original" place it in the Dev-Cpp installed directory (D:\Dev-Cpp\ for this example) 2 - Copy the entire contents of the LIB folder of curl-7.14.0.tar.gz or zip version into the bin folder above (D:\Dev-Cpp\bin). The reason being is that the make.exe file resides in this folder. Make.exe will use - Makefile.m32, Makefile.inc, and the source code included in the lib folder to compile the source code. There is a PATH issue with make.exe that remains unresolved at least for me. Unless the entire source code to be compiled is placed entirely within the directory of make.exe an error message will be generated - "file xxxx.yyy not available". 3- Go to Dev-Cpp\bin and double click on make .exe. You will see a DOS window quickly pop up and close very quickly. Not to worry! Please do not skip this step. 4- Click on the start button\Programs\MS-DOS Prompt.Once the DOS Window is up Type the disk drive letter (e.g. E: ) engage the enter button. The path should automatically take you to the directory of the make.exe file. 5- To compile the source code simply type at the DOS prompt make -f Makefile.m32 as per instructions contained in the Makefile.m32 file (use any text processor to read instructions). I don't believe that this makefile allows for the option of non SSL. Ignore any warnings. 6- Collect and make copies of libcurl.a, libcurl.dll, libcurldll.a and any *.o compilations you might need in another directory outside of the bin directory as you will need this files shortly to set up libcurl for use with Dev-cpp. For most apps *.o is not required. Later on we will show what to do with these files. 7- You are finished but before closing we need to do cleanup - erase the bin folder and rename the "bin Original" folder created in step 1 to bin. Note to compile a curl executable the process is probably similar but instead of using the LIB folder contents use the SRC folder contents and Makefiles in curl-7.14.0.tar.gz. File directories relative placements must be respected for compiling to take place successfully. This may not be possible with the PATH problem that make.exe experiences. If anyone has solved this PATH issue and please make sure it actually works on Win 9x/2000/XP before letting me know. Then please let me or Daniel in on the solution so that it can be included with these instructions. Thanks. or Method II - Dev-Cpp GUI ----------------------- 1- Copy the entire contents of the LIB folder of curl-7.14.0.tar.gz or zip version into any folder outside of (Dev-Cpp\bin). 2- Drop the File/New/click on Project. 3- New Project Dialogue box appears. Double click on the Static Library. 4- Create Project Dialogue box appears. Select the LIB folder location to place and locate your Project File Name. Placing the Project File Name elsewhere may cause problems (PATH issue problem again). 5- Drop down the Project/Project Options. Project Options Dialogue box appears. 6- Select the Makefile tab in the Project Options Dialogue Box. Check Box - Use Custom Makefile. Click on the Folder icon at the extreme right of the Check Box. Select Makefile.m32 in the folder wherever you have placed the contents of the LIB Folder. Press OK and close the Dialogue Box. 7- Drop the Menu Project/Click on Add to Project. Open File Dialogue Box appears. The Dialogue Box should open in the folder wherever you have placed the contents of the LIB Folder. If not go there. 8- Select Crtl-A to select all files in the LIB folder. Click on open to add files and close box. Wait till all files are added. This may take 30 seconds or longer. 9- Drop the Menu Execute/Click on Compile. 10- That's it. The following steps must be completed if Curl is to work properly ================================================================= LIB folder inclusions (*.a placement) ------------------------------------- 1- Refer to Method I - DOS Command Line point # 6 Take libcurl.a, libcurldll.a and install it in the directory C( or whichever drive Dev is installed) :\Dev-Cpp\lib. Include Folder -------------- 1- Create a new folder by the name of curl (do not change the name curl to some other name as it will cause major issues) in the directory C:\Dev-Cpp\include. 2- Copy the entire contents of the curl folder of curl-7.14.0.tar.gz or zip version into the newly created curl directory - C:\Dev-Cpp\include\curl. Links To Include And Lib Folder ------------------------------- 1- Drop the Menu - Tools\Compiler Options\Directories\Libraries. Make sure that C( or whichever drive Dev is installed):\DEV-CPP\lib is included. 2- Next select the Menu - Tools\Compiler Options\Directories\C Includes. Make sure that C:\DEV-CPP\include and C:\Dev-Cpp\include\curl are included. 3- Next select the Menu - Tools\Compiler Options\Directories\C++ Includes. Make sure that C:\DEV-CPP\include and C:\Dev-Cpp\include\curl are included. Linker Links ------------ 1- Drop the Menu - Tools\Compiler Options\Directories\Compiler. 2- Make sure that the box "Add these commands to the linker command line" is checked. 3- Include in the white space immediately below the box referred in 2 -lcurl -lws2_32. SSL Files --------- 1- Get the latest openSSL (as of time of this writing) openssl-0.9.7e-win32-bin.zip for the minimalist package of the openssl-0.9.7e binaries ported to MS Windows 95/98/NT/XP using the MingW32/GCC-3.1 development environment. The file may be downloaded at http://curl.haxx.se/download/. 2- Open the above zip file. You will find two files - SDL.dll, SDL_mixer.dll. Install them in the directory C:\WINDOWS\SYSTEM32 for Win 9x users and c:\winnt\system32 for NT-family users. Multithreading Files -------------------- To be completed #define ------- 1- Make sure that your program includes the following - #define CURL_STATICLIB must be declared FIRST before any other define functions may be added. Otherwise you may experience link errors. 2- Don't forget to include #include "curl/curl.h". e.g. #define CURL_STATICLIB #include #include "curl/curl.h" #include #include #include etc... Static or Dynamic Library ------------------------- The above steps apply for the use by a static library. Should you choose to use a dynamic library you will be required to perform these additional steps. 1- Refer to Method I - DOS Command Line point # 6. Install libcurl.dll in the directory C:\WINDOWS\SYSTEM32 for Win 9x users and c:\winnt\system32 for NT-family users. 2- Refer to Linker Links point 3 - Replace -lcurl with -lcurldll. Voila you're done. The non-SSL static Library build may not be possible to use at least as of the time of this writing - v7.14. Check reference emails - Phillipe and I found it impossible to fully compile as certain files were missing for linking. No big loss as SSL is a major plus. Hope this Helps Tom curl-7.35.0/docs/SECURITY0000644000175000017500000000772112262353672011635 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| CURL SECURITY FOR DEVELOPERS This document is intended to provide guidance to curl developers on how security vulnerabilities should be handled. PUBLISHING INFORMATION All known and public curl or libcurl related vulnerabilities are listed at http://curl.haxx.se/docs/security.html Security vulnerabilities should not be entered in the project's public bug tracker unless the necessary configuration is in place to limit access to the issue to only the reporter and the project's security team. VULNERABILITY HANDLING The typical process for handling a new security vulnerability is as follows. No information should be made public about a vulnerability until it is formally announced at the end of this process. That means, for example that a bug tracker entry must NOT be created to track the issue since that will make the issue public and it should not be discussed on any of the project's public mailing lists. Also messages associated with any commits should not make any reference to the security nature of the commit if done prior to the public announcement. - The person discovering the issue, the reporter, reports the vulnerability privately to curl-security@haxx.se. That's an email alias that reaches a handful of selected and trusted people. - Messages that do not relate to the reporting or managing of an undisclosed security vulnerability in curl or libcurl are ignored and no further action is required. - A person in the security team sends an e-mail to the original reporter to acknowledge the report. - The security team investigates the report and either rejects it or accepts it. - If the report is rejected, the team writes to the reporter to explain why. - If the report is accepted, the team writes to the reporter to let him/her know it is accepted and that they are working on a fix. - The security team discusses the problem, works out a fix, considers the impact of the problem and suggests a release schedule. This discussion should involve the reporter as much as possible. - The release of the information should be "as soon as possible" and is most often synced with an upcoming release that contains the fix. If the reporter, or anyone else, thinks the next planned release is too far away then a separate earlier release for security reasons should be considered. - Write a security advisory draft about the problem that explains what the problem is, its impact, which versions it affects, solutions or work-arounds, when the release is out and make sure to credit all contributors properly. - Request a CVE number from distros@openwall.org[1] when also informing and preparing them for the upcoming public security vulnerability announcement - attach the advisory draft for information. Note that 'distros' won't accept an embargo longer than 19 days. - Update the "security advisory" with the CVE number. - The security team commits the fix in a private branch. The commit message should ideally contain the CVE number. This fix is usually also distributed to the 'distros' mailing list to allow them to use the fix prior to the public announcement. - At the day of the next release, the private branch is merged into the master branch and pushed. Once pushed, the information is accessible to the public and the actual release should follow suit immediately afterwards. - The project team creates a release that includes the fix. - The project team announces the release and the vulnerability to the world in the same manner we always announce releases. It gets sent to the curl-announce, curl-library and curl-users mailing lists. - The security web page on the web site should get the new vulernability mentioned. [1] = http://oss-security.openwall.org/wiki/mailing-lists/distros curl-7.35.0/docs/examples/0000755000175000017500000000000012272124477012332 500000000000000curl-7.35.0/docs/examples/htmltidy.c0000644000175000017500000000777012213173003014247 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ /* Download a document and use libtidy to parse the HTML. * Written by Jeff Pohlmeyer * * LibTidy => http://tidy.sourceforge.net * * gcc -Wall -I/usr/local/include tidycurl.c -lcurl -ltidy -o tidycurl * */ #include #include #include #include /* curl write callback, to fill tidy's input buffer... */ uint write_cb(char *in, uint size, uint nmemb, TidyBuffer *out) { uint r; r = size * nmemb; tidyBufAppend( out, in, r ); return(r); } /* Traverse the document tree */ void dumpNode(TidyDoc doc, TidyNode tnod, int indent ) { TidyNode child; for ( child = tidyGetChild(tnod); child; child = tidyGetNext(child) ) { ctmbstr name = tidyNodeGetName( child ); if ( name ) { /* if it has a name, then it's an HTML tag ... */ TidyAttr attr; printf( "%*.*s%s ", indent, indent, "<", name); /* walk the attribute list */ for ( attr=tidyAttrFirst(child); attr; attr=tidyAttrNext(attr) ) { printf(tidyAttrName(attr)); tidyAttrValue(attr)?printf("=\"%s\" ", tidyAttrValue(attr)):printf(" "); } printf( ">\n"); } else { /* if it doesn't have a name, then it's probably text, cdata, etc... */ TidyBuffer buf; tidyBufInit(&buf); tidyNodeGetText(doc, child, &buf); printf("%*.*s\n", indent, indent, buf.bp?(char *)buf.bp:""); tidyBufFree(&buf); } dumpNode( doc, child, indent + 4 ); /* recursive */ } } int main(int argc, char **argv ) { CURL *curl; char curl_errbuf[CURL_ERROR_SIZE]; TidyDoc tdoc; TidyBuffer docbuf = {0}; TidyBuffer tidy_errbuf = {0}; int err; if ( argc == 2) { curl = curl_easy_init(); curl_easy_setopt(curl, CURLOPT_URL, argv[1]); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errbuf); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); tdoc = tidyCreate(); tidyOptSetBool(tdoc, TidyForceOutput, yes); /* try harder */ tidyOptSetInt(tdoc, TidyWrapLen, 4096); tidySetErrorBuffer( tdoc, &tidy_errbuf ); tidyBufInit(&docbuf); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &docbuf); err=curl_easy_perform(curl); if ( !err ) { err = tidyParseBuffer(tdoc, &docbuf); /* parse the input */ if ( err >= 0 ) { err = tidyCleanAndRepair(tdoc); /* fix any problems */ if ( err >= 0 ) { err = tidyRunDiagnostics(tdoc); /* load tidy error buffer */ if ( err >= 0 ) { dumpNode( tdoc, tidyGetRoot(tdoc), 0 ); /* walk the tree */ fprintf(stderr, "%s\n", tidy_errbuf.bp); /* show errors */ } } } } else fprintf(stderr, "%s\n", curl_errbuf); /* clean-up */ curl_easy_cleanup(curl); tidyBufFree(&docbuf); tidyBufFree(&tidy_errbuf); tidyRelease(tdoc); return(err); } else printf( "usage: %s \n", argv[0] ); return(0); } curl-7.35.0/docs/examples/evhiperfifo.c0000644000175000017500000002762012213173003014713 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ /* Example application source code using the multi socket interface to * download many files at once. * * This example features the same basic functionality as hiperfifo.c does, * but this uses libev instead of libevent. * * Written by Jeff Pohlmeyer, converted to use libev by Markus Koetter Requires libev and a (POSIX?) system that has mkfifo(). This is an adaptation of libcurl's "hipev.c" and libevent's "event-test.c" sample programs. When running, the program creates the named pipe "hiper.fifo" Whenever there is input into the fifo, the program reads the input as a list of URL's and creates some new easy handles to fetch each URL via the curl_multi "hiper" API. Thus, you can try a single URL: % echo http://www.yahoo.com > hiper.fifo Or a whole bunch of them: % cat my-url-list > hiper.fifo The fifo buffer is handled almost instantly, so you can even add more URL's while the previous requests are still being downloaded. Note: For the sake of simplicity, URL length is limited to 1023 char's ! This is purely a demo app, all retrieved data is simply discarded by the write callback. */ #include #include #include #include #include #include #include #include #include #include #include #include #define DPRINT(x...) printf(x) #define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */ /* Global information, common to all connections */ typedef struct _GlobalInfo { struct ev_loop *loop; struct ev_io fifo_event; struct ev_timer timer_event; CURLM *multi; int still_running; FILE* input; } GlobalInfo; /* Information associated with a specific easy handle */ typedef struct _ConnInfo { CURL *easy; char *url; GlobalInfo *global; char error[CURL_ERROR_SIZE]; } ConnInfo; /* Information associated with a specific socket */ typedef struct _SockInfo { curl_socket_t sockfd; CURL *easy; int action; long timeout; struct ev_io ev; int evset; GlobalInfo *global; } SockInfo; static void timer_cb(EV_P_ struct ev_timer *w, int revents); /* Update the event timer after curl_multi library calls */ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g) { DPRINT("%s %li\n", __PRETTY_FUNCTION__, timeout_ms); ev_timer_stop(g->loop, &g->timer_event); if (timeout_ms > 0) { double t = timeout_ms / 1000; ev_timer_init(&g->timer_event, timer_cb, t, 0.); ev_timer_start(g->loop, &g->timer_event); }else timer_cb(g->loop, &g->timer_event, 0); return 0; } /* Die if we get a bad CURLMcode somewhere */ static void mcode_or_die(const char *where, CURLMcode code) { if ( CURLM_OK != code ) { const char *s; switch ( code ) { case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break; case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break; case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break; case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break; case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break; case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break; case CURLM_LAST: s="CURLM_LAST"; break; default: s="CURLM_unknown"; break; case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET"; fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s); /* ignore this error */ return; } fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s); exit(code); } } /* Check for completed transfers, and remove their easy handles */ static void check_multi_info(GlobalInfo *g) { char *eff_url; CURLMsg *msg; int msgs_left; ConnInfo *conn; CURL *easy; CURLcode res; fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running); while ((msg = curl_multi_info_read(g->multi, &msgs_left))) { if (msg->msg == CURLMSG_DONE) { easy = msg->easy_handle; res = msg->data.result; curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn); curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url); fprintf(MSG_OUT, "DONE: %s => (%d) %s\n", eff_url, res, conn->error); curl_multi_remove_handle(g->multi, easy); free(conn->url); curl_easy_cleanup(easy); free(conn); } } } /* Called by libevent when we get action on a multi socket */ static void event_cb(EV_P_ struct ev_io *w, int revents) { DPRINT("%s w %p revents %i\n", __PRETTY_FUNCTION__, w, revents); GlobalInfo *g = (GlobalInfo*) w->data; CURLMcode rc; int action = (revents&EV_READ?CURL_POLL_IN:0)| (revents&EV_WRITE?CURL_POLL_OUT:0); rc = curl_multi_socket_action(g->multi, w->fd, action, &g->still_running); mcode_or_die("event_cb: curl_multi_socket_action", rc); check_multi_info(g); if ( g->still_running <= 0 ) { fprintf(MSG_OUT, "last transfer done, kill timeout\n"); ev_timer_stop(g->loop, &g->timer_event); } } /* Called by libevent when our timeout expires */ static void timer_cb(EV_P_ struct ev_timer *w, int revents) { DPRINT("%s w %p revents %i\n", __PRETTY_FUNCTION__, w, revents); GlobalInfo *g = (GlobalInfo *)w->data; CURLMcode rc; rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, &g->still_running); mcode_or_die("timer_cb: curl_multi_socket_action", rc); check_multi_info(g); } /* Clean up the SockInfo structure */ static void remsock(SockInfo *f, GlobalInfo *g) { printf("%s \n", __PRETTY_FUNCTION__); if ( f ) { if ( f->evset ) ev_io_stop(g->loop, &f->ev); free(f); } } /* Assign information to a SockInfo structure */ static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g) { printf("%s \n", __PRETTY_FUNCTION__); int kind = (act&CURL_POLL_IN?EV_READ:0)|(act&CURL_POLL_OUT?EV_WRITE:0); f->sockfd = s; f->action = act; f->easy = e; if ( f->evset ) ev_io_stop(g->loop, &f->ev); ev_io_init(&f->ev, event_cb, f->sockfd, kind); f->ev.data = g; f->evset=1; ev_io_start(g->loop, &f->ev); } /* Initialize a new SockInfo structure */ static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g) { SockInfo *fdp = calloc(sizeof(SockInfo), 1); fdp->global = g; setsock(fdp, s, easy, action, g); curl_multi_assign(g->multi, s, fdp); } /* CURLMOPT_SOCKETFUNCTION */ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { DPRINT("%s e %p s %i what %i cbp %p sockp %p\n", __PRETTY_FUNCTION__, e, s, what, cbp, sockp); GlobalInfo *g = (GlobalInfo*) cbp; SockInfo *fdp = (SockInfo*) sockp; const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE"}; fprintf(MSG_OUT, "socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); if ( what == CURL_POLL_REMOVE ) { fprintf(MSG_OUT, "\n"); remsock(fdp, g); } else { if ( !fdp ) { fprintf(MSG_OUT, "Adding data: %s\n", whatstr[what]); addsock(s, e, what, g); } else { fprintf(MSG_OUT, "Changing action from %s to %s\n", whatstr[fdp->action], whatstr[what]); setsock(fdp, s, e, what, g); } } return 0; } /* CURLOPT_WRITEFUNCTION */ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) { size_t realsize = size * nmemb; ConnInfo *conn = (ConnInfo*) data; (void)ptr; (void)conn; return realsize; } /* CURLOPT_PROGRESSFUNCTION */ static int prog_cb (void *p, double dltotal, double dlnow, double ult, double uln) { ConnInfo *conn = (ConnInfo *)p; (void)ult; (void)uln; fprintf(MSG_OUT, "Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal); return 0; } /* Create a new easy handle, and add it to the global curl_multi */ static void new_conn(char *url, GlobalInfo *g ) { ConnInfo *conn; CURLMcode rc; conn = calloc(1, sizeof(ConnInfo)); memset(conn, 0, sizeof(ConnInfo)); conn->error[0]='\0'; conn->easy = curl_easy_init(); if ( !conn->easy ) { fprintf(MSG_OUT, "curl_easy_init() failed, exiting!\n"); exit(2); } conn->global = g; conn->url = strdup(url); curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url); curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, conn); curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 1L); curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error); curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn); curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, 0L); curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb); curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn); curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 3L); curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 10L); fprintf(MSG_OUT, "Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url); rc = curl_multi_add_handle(g->multi, conn->easy); mcode_or_die("new_conn: curl_multi_add_handle", rc); /* note that the add_handle() will set a time-out to trigger very soon so that the necessary socket_action() call will be called by this app */ } /* This gets called whenever data is received from the fifo */ static void fifo_cb(EV_P_ struct ev_io *w, int revents) { char s[1024]; long int rv=0; int n=0; GlobalInfo *g = (GlobalInfo *)w->data; do { s[0]='\0'; rv=fscanf(g->input, "%1023s%n", s, &n); s[n]='\0'; if ( n && s[0] ) { new_conn(s,g); /* if we read a URL, go get it! */ } else break; } while ( rv != EOF ); } /* Create a named pipe and tell libevent to monitor it */ static int init_fifo (GlobalInfo *g) { struct stat st; static const char *fifo = "hiper.fifo"; curl_socket_t sockfd; fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo); if ( lstat (fifo, &st) == 0 ) { if ( (st.st_mode & S_IFMT) == S_IFREG ) { errno = EEXIST; perror("lstat"); exit (1); } } unlink(fifo); if ( mkfifo (fifo, 0600) == -1 ) { perror("mkfifo"); exit (1); } sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0); if ( sockfd == -1 ) { perror("open"); exit (1); } g->input = fdopen(sockfd, "r"); fprintf(MSG_OUT, "Now, pipe some URL's into > %s\n", fifo); ev_io_init(&g->fifo_event, fifo_cb, sockfd, EV_READ); ev_io_start(g->loop, &g->fifo_event); return(0); } int main(int argc, char **argv) { GlobalInfo g; CURLMcode rc; (void)argc; (void)argv; memset(&g, 0, sizeof(GlobalInfo)); g.loop = ev_default_loop(0); init_fifo(&g); g.multi = curl_multi_init(); ev_timer_init(&g.timer_event, timer_cb, 0., 0.); g.timer_event.data = &g; g.fifo_event.data = &g; curl_multi_setopt(g.multi, CURLMOPT_SOCKETFUNCTION, sock_cb); curl_multi_setopt(g.multi, CURLMOPT_SOCKETDATA, &g); curl_multi_setopt(g.multi, CURLMOPT_TIMERFUNCTION, multi_timer_cb); curl_multi_setopt(g.multi, CURLMOPT_TIMERDATA, &g); /* we don't call any curl_multi_socket*() function yet as we have no handles added! */ ev_loop(g.loop, 0); curl_multi_cleanup(g.multi); return 0; } curl-7.35.0/docs/examples/imap-store.c0000644000175000017500000000515212270035364014473 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include #include /* This is a simple example showing how to modify an existing mail using * libcurl's IMAP capabilities with the STORE command. * * Note that this example requires libcurl 7.30.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This is the mailbox folder to select */ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX"); /* Set the STORE command with the Deleted flag for message 1. Note that * you can use the STORE command to set other flags such as Seen, Answered, * Flagged, Draft and Recent. */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "STORE 1 +Flags \\Deleted"); /* Perform the custom request */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); else { /* Set the EXPUNGE command, although you can use the CLOSE command if you * don't want to know the result of the STORE */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "EXPUNGE"); /* Perform the second custom request */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); } /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } curl-7.35.0/docs/examples/version-check.pl0000755000175000017500000000522612213173003015337 00000000000000#!/usr/bin/env perl #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2010, 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. # ########################################################################### # This script accepts a source file as input on the command line. # # It first loads the 'symbols-in-versions' document and stores a lookup # table for all known symbols for which version they were introduced. # # It then scans the given source file to dig up all symbols starting with CURL. # Finally, it sorts the internal list of found symbols (using the version # number as sort key) and then it outputs the most recent version number and # the symbols from that version that are used. # # Usage: # # version-check.pl [source file] # open(S, "<../libcurl/symbols-in-versions") || die; my %doc; my %rem; while() { if(/(^CURL[^ \n]*) *(.*)/) { my ($sym, $rest)=($1, $2); my @a=split(/ +/, $rest); $doc{$sym}=$a[0]; # when it was introduced if($a[2]) { # this symbol is documented to have been present the last time # in this release $rem{$sym}=$a[2]; } } } close(S); sub age { my ($ver)=@_; my @s=split(/\./, $ver); return $s[0]*10000+$s[1]*100+$s[2]; } my %used; open(C, "<$ARGV[0]") || die; while() { if(/\W(CURL[_A-Z0-9v]+)\W/) { #print "$1\n"; $used{$1}++; } } close(C); sub sortversions { my $r = age($doc{$a}) <=> age($doc{$b}); if(!$r) { $r = $a cmp $b; } return $r; } my @recent = reverse sort sortversions keys %used; # the most recent symbol my $newsym = $recent[0]; # the most recent version my $newver = $doc{$newsym}; print "The scanned source uses these symbols introduced in $newver:\n"; for my $w (@recent) { if($doc{$w} eq $newver) { printf " $w\n"; next; } last; } curl-7.35.0/docs/examples/imap-delete.c0000644000175000017500000000376712270035364014613 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include #include /* This is a simple example showing how to delete an existing mailbox folder * using libcurl's IMAP capabilities. * * Note that this example requires libcurl 7.30.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This is just the server URL */ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com"); /* Set the DELETE command specifing the existing folder */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE FOLDER"); /* Perform the custom request */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } curl-7.35.0/docs/examples/Makefile.inc0000644000175000017500000000247612270035364014465 00000000000000# These are all libcurl example programs to be test compiled check_PROGRAMS = 10-at-a-time anyauthput cookie_interface debug fileupload \ fopen ftpget ftpgetresp ftpupload getinfo getinmemory http-post httpput \ https multi-app multi-debugcallback multi-double multi-post multi-single \ persistant post-callback postit2 sepheaders simple simplepost simplessl \ sendrecv httpcustomheader certinfo chkspeed ftpgetinfo ftp-wildcard \ smtp-mail smtp-multi smtp-ssl smtp-tls smtp-vrfy smtp-expn rtsp \ externalsocket resolve progressfunc pop3-retr pop3-list pop3-uidl pop3-dele \ pop3-top pop3-stat pop3-noop pop3-ssl pop3-tls pop3-multi imap-list \ imap-fetch imap-store imap-append imap-examine imap-search imap-create \ imap-delete imap-copy imap-noop imap-ssl imap-tls imap-multi url2file \ sftpget ftpsget postinmemory # These examples require external dependencies that may not be commonly # available on POSIX systems, so don't bother attempting to compile them here. COMPLICATED_EXAMPLES = curlgtk.c curlx.c htmltitle.cpp cacertinmem.c \ ftpuploadresume.c ghiper.c hiperfifo.c htmltidy.c multithread.c \ opensslthreadlock.c sampleconv.c synctime.c threaded-ssl.c evhiperfifo.c \ smooth-gtk-thread.c version-check.pl href_extractor.c asiohiper.cpp \ multi-uv.c xmlstream.c usercertinmem.c sessioninfo.c curl-7.35.0/docs/examples/imap-copy.c0000644000175000017500000000441012270035364014305 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include #include /* This is a simple example showing how to copy a mail from one mailbox folder * to another using libcurl's IMAP capabilities. * * Note that this example requires libcurl 7.30.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This is source mailbox folder to select */ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX"); /* Set the COPY command specifing the message ID and destination folder */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "COPY 1 FOLDER"); /* Note that to perform a move operation you will need to perform the copy, * then mark the original mail as Deleted and EXPUNGE or CLOSE. Please see * imap-store.c for more information on deleting messages. */ /* Perform the custom request */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } curl-7.35.0/docs/examples/README0000644000175000017500000000773212262353672013143 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| This directory is for libcurl programming examples. They are meant to show some simple steps on how you can build your own application to take full advantage of libcurl. If you end up with other small but still useful example sources, please mail them for submission in future packages and on the web site. BUILDING The Makefile.example is an example makefile that could be used to build these examples. Just edit the file according to your system and requirements first. Most examples should build fine using a command line like this: $ `curl-config --cc --cflags --libs` -o example example.c Some compilers don't like having the arguments in this order but instead want you do reorganize them like: $ `curl-config --cc` -o example example.c `curl-config --cflags --libs` *PLEASE* do not use the curl.haxx.se site as a test target for your libcurl applications/experiments. Even if some of the examples use that site as a URL at some places, it doesn't mean that the URLs work or that we expect you to actually torture our web site with your tests! Thanks. EXAMPLES anyauthput.c - HTTP PUT using "any" authentication method cacertinmem.c - Use a built-in PEM certificate to retrieve a https page cookie_interface.c - shows usage of simple cookie interface curlgtk.c - download using a GTK progress bar curlx.c - getting file info from the remote cert data debug.c - showing how to use the debug callback fileupload.c - uploading to a file:// URL fopen.c - fopen() layer that supports opening URLs and files ftpget.c - simple getting a file from FTP ftpgetresp.c - get the response strings from the FTP server ftpupload.c - upload a file to an FTP server ftpuploadresume.c - resume an upload to an FTP server getinfo.c - get the Content-Type from the recent transfer getinmemory.c - download a file to memory only ghiper.c - curl_multi_socket() using code with glib-2 hiperfifo.c - downloads all URLs written to the fifo, using curl_multi_socket() and libevent htmltidy.c - download a document and use libtidy to parse the HTML htmltitle.cc - download a HTML file and extract the tag from a HTML page using libxml http-post.c - HTTP POST httpput.c - HTTP PUT a local file https.c - simple HTTPS transfer imap.c - simple IMAP transfer multi-app.c - a multi-interface app multi-debugcallback.c - a multi-interface app using the debug callback multi-double.c - a multi-interface app doing two simultaneous transfers multi-post.c - a multi-interface app doing a multipart formpost multi-single.c - a multi-interface app getting a single file multi-uv.c - a multi-interface app using libuv multithread.c - an example using multi-treading transferring multiple files opensslthreadlock.c - show how to do locking when using OpenSSL multi-threaded persistant.c - request two URLs with a persistent connection pop3s.c - POP3S transfer pop3slist.c - POP3S LIST post-callback.c - send a HTTP POST using a callback postit2.c - send a HTTP multipart formpost sampleconv.c - showing how a program on a non-ASCII platform would invoke callbacks to do its own codeset conversions instead of using the built-in iconv functions in libcurl sepheaders.c - download headers to a separate file simple.c - the most simple download a URL source simplepost.c - HTTP POST simplessl.c - HTTPS example with certificates many options set synctime.c - Sync local time by extracting date from remote HTTP servers url2file.c - download a document and store it in a file xmlstream.c - Stream-parse a document using the streaming Expat parser 10-at-a-time.c - Download many files simultaneously, 10 at a time. ��������������������������������������curl-7.35.0/docs/examples/makefile.dj���������������������������������������������������������������0000644�0001750�0001750�00000003247�12213173003�014334� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://curl.haxx.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is # furnished to do so, under the terms of the COPYING file. # # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # ########################################################################### # # Adapted for djgpp / Watt-32 / DOS by # Gisle Vanem <gvanem@broadpark.no> # TOPDIR = ../.. include $(TOPDIR)/packages/DOS/common.dj CFLAGS += -DFALSE=0 -DTRUE=1 LIBS = $(TOPDIR)/lib/libcurl.a ifeq ($(USE_SSL),1) LIBS += $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a endif ifeq ($(USE_IDNA),1) LIBS += $(LIBIDN_ROOT)/lib/dj_obj/libidn.a -liconv endif LIBS += $(WATT32_ROOT)/lib/libwatt.a $(ZLIB_ROOT)/libz.a include Makefile.inc PROGRAMS = $(patsubst %,%.exe,$(check_PROGRAMS)) all: $(PROGRAMS) @echo Welcome to libcurl example program %.exe: %.c $(CC) $(CFLAGS) -o $@ $^ $(LIBS) @echo clean vclean realclean: - rm -f $(PROGRAMS) depend.dj -include depend.dj ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/ftpgetresp.c��������������������������������������������������������������0000644�0001750�0001750�00000005007�12213173003�014563� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* * Similar to ftpget.c but this also stores the received response-lines * in a separate file using our own callback! * * This functionality was introduced in libcurl 7.9.3. */ static size_t write_response(void *ptr, size_t size, size_t nmemb, void *data) { FILE *writehere = (FILE *)data; return fwrite(ptr, size, nmemb, writehere); } int main(void) { CURL *curl; CURLcode res; FILE *ftpfile; FILE *respfile; /* local file name to store the file as */ ftpfile = fopen("ftp-list", "wb"); /* b is binary, needed on win32 */ /* local file name to store the FTP server's response lines in */ respfile = fopen("ftp-responses", "wb"); /* b is binary, needed on win32 */ curl = curl_easy_init(); if(curl) { /* Get a file listing from sunet */ curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.example.com/"); curl_easy_setopt(curl, CURLOPT_WRITEDATA, ftpfile); /* If you intend to use this on windows with a libcurl DLL, you must use CURLOPT_WRITEFUNCTION as well */ curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_response); curl_easy_setopt(curl, CURLOPT_WRITEHEADER, respfile); res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); } fclose(ftpfile); /* close the local file */ fclose(respfile); /* close the response file */ return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/rtsp.c��������������������������������������������������������������������0000644�0001750�0001750�00000020462�12213173003�013372� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2011, Jim Hollinger * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Jim Hollinger nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #if defined (WIN32) # include <conio.h> /* _getch() */ #else # include <termios.h> # include <unistd.h> static int _getch(void) { struct termios oldt, newt; int ch; tcgetattr( STDIN_FILENO, &oldt ); newt = oldt; newt.c_lflag &= ~( ICANON | ECHO ); tcsetattr( STDIN_FILENO, TCSANOW, &newt ); ch = getchar(); tcsetattr( STDIN_FILENO, TCSANOW, &oldt ); return ch; } #endif #include <curl/curl.h> #define VERSION_STR "V1.0" /* error handling macros */ #define my_curl_easy_setopt(A, B, C) \ if ((res = curl_easy_setopt((A), (B), (C))) != CURLE_OK) \ fprintf(stderr, "curl_easy_setopt(%s, %s, %s) failed: %d\n", \ #A, #B, #C, res); #define my_curl_easy_perform(A) \ if ((res = curl_easy_perform((A))) != CURLE_OK) \ fprintf(stderr, "curl_easy_perform(%s) failed: %d\n", #A, res); /* send RTSP OPTIONS request */ static void rtsp_options(CURL *curl, const char *uri) { CURLcode res = CURLE_OK; printf("\nRTSP: OPTIONS %s\n", uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_OPTIONS); my_curl_easy_perform(curl); } /* send RTSP DESCRIBE request and write sdp response to a file */ static void rtsp_describe(CURL *curl, const char *uri, const char *sdp_filename) { CURLcode res = CURLE_OK; FILE *sdp_fp = fopen(sdp_filename, "wt"); printf("\nRTSP: DESCRIBE %s\n", uri); if (sdp_fp == NULL) { fprintf(stderr, "Could not open '%s' for writing\n", sdp_filename); sdp_fp = stdout; } else { printf("Writing SDP to '%s'\n", sdp_filename); } my_curl_easy_setopt(curl, CURLOPT_WRITEDATA, sdp_fp); my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_DESCRIBE); my_curl_easy_perform(curl); my_curl_easy_setopt(curl, CURLOPT_WRITEDATA, stdout); if (sdp_fp != stdout) { fclose(sdp_fp); } } /* send RTSP SETUP request */ static void rtsp_setup(CURL *curl, const char *uri, const char *transport) { CURLcode res = CURLE_OK; printf("\nRTSP: SETUP %s\n", uri); printf(" TRANSPORT %s\n", transport); my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_TRANSPORT, transport); my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_SETUP); my_curl_easy_perform(curl); } /* send RTSP PLAY request */ static void rtsp_play(CURL *curl, const char *uri, const char *range) { CURLcode res = CURLE_OK; printf("\nRTSP: PLAY %s\n", uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri); my_curl_easy_setopt(curl, CURLOPT_RANGE, range); my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_PLAY); my_curl_easy_perform(curl); } /* send RTSP TEARDOWN request */ static void rtsp_teardown(CURL *curl, const char *uri) { CURLcode res = CURLE_OK; printf("\nRTSP: TEARDOWN %s\n", uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_TEARDOWN); my_curl_easy_perform(curl); } /* convert url into an sdp filename */ static void get_sdp_filename(const char *url, char *sdp_filename) { const char *s = strrchr(url, '/'); strcpy(sdp_filename, "video.sdp"); if (s != NULL) { s++; if (s[0] != '\0') { sprintf(sdp_filename, "%s.sdp", s); } } } /* scan sdp file for media control attribute */ static void get_media_control_attribute(const char *sdp_filename, char *control) { int max_len = 256; char *s = malloc(max_len); FILE *sdp_fp = fopen(sdp_filename, "rt"); control[0] = '\0'; if (sdp_fp != NULL) { while (fgets(s, max_len - 2, sdp_fp) != NULL) { sscanf(s, " a = control: %s", control); } fclose(sdp_fp); } free(s); } /* main app */ int main(int argc, char * const argv[]) { #if 1 const char *transport = "RTP/AVP;unicast;client_port=1234-1235"; /* UDP */ #else const char *transport = "RTP/AVP/TCP;unicast;client_port=1234-1235"; /* TCP */ #endif const char *range = "0.000-"; int rc = EXIT_SUCCESS; char *base_name = NULL; printf("\nRTSP request %s\n", VERSION_STR); printf(" Project web site: http://code.google.com/p/rtsprequest/\n"); printf(" Requires cURL V7.20 or greater\n\n"); /* check command line */ if ((argc != 2) && (argc != 3)) { base_name = strrchr(argv[0], '/'); if (base_name == NULL) { base_name = strrchr(argv[0], '\\'); } if (base_name == NULL) { base_name = argv[0]; } else { base_name++; } printf("Usage: %s url [transport]\n", base_name); printf(" url of video server\n"); printf(" transport (optional) specifier for media stream protocol\n"); printf(" default transport: %s\n", transport); printf("Example: %s rtsp://192.168.0.2/media/video1\n\n", base_name); rc = EXIT_FAILURE; } else { const char *url = argv[1]; char *uri = malloc(strlen(url) + 32); char *sdp_filename = malloc(strlen(url) + 32); char *control = malloc(strlen(url) + 32); CURLcode res; get_sdp_filename(url, sdp_filename); if (argc == 3) { transport = argv[2]; } /* initialize curl */ res = curl_global_init(CURL_GLOBAL_ALL); if (res == CURLE_OK) { curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); CURL *curl; fprintf(stderr, " cURL V%s loaded\n", data->version); /* initialize this curl session */ curl = curl_easy_init(); if (curl != NULL) { my_curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L); my_curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); my_curl_easy_setopt(curl, CURLOPT_WRITEHEADER, stdout); my_curl_easy_setopt(curl, CURLOPT_URL, url); /* request server options */ sprintf(uri, "%s", url); rtsp_options(curl, uri); /* request session description and write response to sdp file */ rtsp_describe(curl, uri, sdp_filename); /* get media control attribute from sdp file */ get_media_control_attribute(sdp_filename, control); /* setup media stream */ sprintf(uri, "%s/%s", url, control); rtsp_setup(curl, uri, transport); /* start playing media stream */ sprintf(uri, "%s/", url); rtsp_play(curl, uri, range); printf("Playing video, press any key to stop ..."); _getch(); printf("\n"); /* teardown session */ rtsp_teardown(curl, uri); /* cleanup */ curl_easy_cleanup(curl); curl = NULL; } else { fprintf(stderr, "curl_easy_init() failed\n"); } curl_global_cleanup(); } else { fprintf(stderr, "curl_global_init(%s) failed: %d\n", "CURL_GLOBAL_ALL", res); } free(control); free(sdp_filename); free(uri); } return rc; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/cookie_interface.c��������������������������������������������������������0000644�0001750�0001750�00000007202�12213173003�015670� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* This example shows usage of simple cookie interface. */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <errno.h> #include <time.h> #include <curl/curl.h> static void print_cookies(CURL *curl) { CURLcode res; struct curl_slist *cookies; struct curl_slist *nc; int i; printf("Cookies, curl knows:\n"); res = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies); if (res != CURLE_OK) { fprintf(stderr, "Curl curl_easy_getinfo failed: %s\n", curl_easy_strerror(res)); exit(1); } nc = cookies, i = 1; while (nc) { printf("[%d]: %s\n", i, nc->data); nc = nc->next; i++; } if (i == 1) { printf("(none)\n"); } curl_slist_free_all(cookies); } int main(void) { CURL *curl; CURLcode res; curl_global_init(CURL_GLOBAL_ALL); curl = curl_easy_init(); if (curl) { char nline[256]; curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/"); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* just to start the cookie engine */ res = curl_easy_perform(curl); if (res != CURLE_OK) { fprintf(stderr, "Curl perform failed: %s\n", curl_easy_strerror(res)); return 1; } print_cookies(curl); printf("Erasing curl's knowledge of cookies!\n"); curl_easy_setopt(curl, CURLOPT_COOKIELIST, "ALL"); print_cookies(curl); printf("-----------------------------------------------\n" "Setting a cookie \"PREF\" via cookie interface:\n"); #ifdef WIN32 #define snprintf _snprintf #endif /* Netscape format cookie */ snprintf(nline, sizeof(nline), "%s\t%s\t%s\t%s\t%lu\t%s\t%s", ".google.com", "TRUE", "/", "FALSE", (unsigned long)time(NULL) + 31337UL, "PREF", "hello google, i like you very much!"); res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline); if (res != CURLE_OK) { fprintf(stderr, "Curl curl_easy_setopt failed: %s\n", curl_easy_strerror(res)); return 1; } /* HTTP-header style cookie */ snprintf(nline, sizeof(nline), "Set-Cookie: OLD_PREF=3d141414bf4209321; " "expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com"); res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline); if (res != CURLE_OK) { fprintf(stderr, "Curl curl_easy_setopt failed: %s\n", curl_easy_strerror(res)); return 1; } print_cookies(curl); res = curl_easy_perform(curl); if (res != CURLE_OK) { fprintf(stderr, "Curl perform failed: %s\n", curl_easy_strerror(res)); return 1; } } else { fprintf(stderr, "Curl init failed!\n"); return 1; } curl_global_cleanup(); return 0; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/sampleconv.c��������������������������������������������������������������0000644�0001750�0001750�00000006447�12213173003�014560� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* This is a simple example showing how a program on a non-ASCII platform would invoke callbacks to do its own codeset conversions instead of using the built-in iconv functions in libcurl. The IBM-1047 EBCDIC codeset is used for this example but the code would be similar for other non-ASCII codesets. Three callback functions are created below: my_conv_from_ascii_to_ebcdic, my_conv_from_ebcdic_to_ascii, and my_conv_from_utf8_to_ebcdic The "platform_xxx" calls represent platform-specific conversion routines. */ #include <stdio.h> #include <curl/curl.h> CURLcode my_conv_from_ascii_to_ebcdic(char *buffer, size_t length) { char *tempptrin, *tempptrout; size_t bytes = length; int rc; tempptrin = tempptrout = buffer; rc = platform_a2e(&tempptrin, &bytes, &tempptrout, &bytes); if (rc == PLATFORM_CONV_OK) { return(CURLE_OK); } else { return(CURLE_CONV_FAILED); } } CURLcode my_conv_from_ebcdic_to_ascii(char *buffer, size_t length) { char *tempptrin, *tempptrout; size_t bytes = length; int rc; tempptrin = tempptrout = buffer; rc = platform_e2a(&tempptrin, &bytes, &tempptrout, &bytes); if (rc == PLATFORM_CONV_OK) { return(CURLE_OK); } else { return(CURLE_CONV_FAILED); } } CURLcode my_conv_from_utf8_to_ebcdic(char *buffer, size_t length) { char *tempptrin, *tempptrout; size_t bytes = length; int rc; tempptrin = tempptrout = buffer; rc = platform_u2e(&tempptrin, &bytes, &tempptrout, &bytes); if (rc == PLATFORM_CONV_OK) { return(CURLE_OK); } else { return(CURLE_CONV_FAILED); } } int main(void) { CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* use platform-specific functions for codeset conversions */ curl_easy_setopt(curl, CURLOPT_CONV_FROM_NETWORK_FUNCTION, my_conv_from_ascii_to_ebcdic); curl_easy_setopt(curl, CURLOPT_CONV_TO_NETWORK_FUNCTION, my_conv_from_ebcdic_to_ascii); curl_easy_setopt(curl, CURLOPT_CONV_FROM_UTF8_FUNCTION, my_conv_from_utf8_to_ebcdic); res = curl_easy_perform(curl); /* always cleanup */ curl_easy_cleanup(curl); } return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/fileupload.c��������������������������������������������������������������0000644�0001750�0001750�00000005152�12213173003�014525� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> #include <sys/stat.h> #include <fcntl.h> int main(void) { CURL *curl; CURLcode res; struct stat file_info; double speed_upload, total_time; FILE *fd; fd = fopen("debugit", "rb"); /* open file to upload */ if(!fd) { return 1; /* can't continue */ } /* to get the file size */ if(fstat(fileno(fd), &file_info) != 0) { return 1; /* can't continue */ } curl = curl_easy_init(); if(curl) { /* upload to this place */ curl_easy_setopt(curl, CURLOPT_URL, "file:///home/dast/src/curl/debug/new"); /* tell it to "upload" to the URL */ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* set where to read from (on Windows you need to use READFUNCTION too) */ curl_easy_setopt(curl, CURLOPT_READDATA, fd); /* and give the size of the upload (optional) */ curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)file_info.st_size); /* enable verbose for easier tracing */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) { fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); } else { /* now extract transfer info */ curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD, &speed_upload); curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &total_time); fprintf(stderr, "Speed: %.3f bytes/sec during %.3f seconds\n", speed_upload, total_time); } /* always cleanup */ curl_easy_cleanup(curl); } return 0; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/httpput.c�����������������������������������������������������������������0000644�0001750�0001750�00000007113�12262353672�014130� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <fcntl.h> #include <sys/stat.h> #include <curl/curl.h> /* * This example shows a HTTP PUT operation. PUTs a file given as a command * line argument to the URL also given on the command line. * * This example also uses its own read callback. * * Here's an article on how to setup a PUT handler for Apache: * http://www.apacheweek.com/features/put */ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream) { size_t retcode; curl_off_t nread; /* in real-world cases, this would probably get this data differently as this fread() stuff is exactly what the library already would do by default internally */ retcode = fread(ptr, size, nmemb, stream); nread = (curl_off_t)retcode; fprintf(stderr, "*** We read %" CURL_FORMAT_CURL_OFF_T " bytes from file\n", nread); return retcode; } int main(int argc, char **argv) { CURL *curl; CURLcode res; FILE * hd_src ; struct stat file_info; char *file; char *url; if(argc < 3) return 1; file= argv[1]; url = argv[2]; /* get the file size of the local file */ stat(file, &file_info); /* get a FILE * of the same file, could also be made with fdopen() from the previous descriptor, but hey this is just an example! */ hd_src = fopen(file, "rb"); /* In windows, this will init the winsock stuff */ curl_global_init(CURL_GLOBAL_ALL); /* get a curl handle */ curl = curl_easy_init(); if(curl) { /* we want to use our own read function */ curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); /* enable uploading */ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* HTTP PUT please */ curl_easy_setopt(curl, CURLOPT_PUT, 1L); /* specify target URL, and note that this URL should include a file name, not only a directory */ curl_easy_setopt(curl, CURLOPT_URL, url); /* now specify which file to upload */ curl_easy_setopt(curl, CURLOPT_READDATA, hd_src); /* provide the size of the upload, we specicially typecast the value to curl_off_t since we must be sure to use the correct data size */ curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)file_info.st_size); /* Now run off and do what you've been told! */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); } fclose(hd_src); /* close the local file */ curl_global_cleanup(); return 0; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/debug.c�������������������������������������������������������������������0000644�0001750�0001750�00000010021�12213173003�013456� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> struct data { char trace_ascii; /* 1 or 0 */ }; static void dump(const char *text, FILE *stream, unsigned char *ptr, size_t size, char nohex) { size_t i; size_t c; unsigned int width=0x10; if(nohex) /* without the hex output, we can fit more on screen */ width = 0x40; fprintf(stream, "%s, %10.10ld bytes (0x%8.8lx)\n", text, (long)size, (long)size); for(i=0; i<size; i+= width) { fprintf(stream, "%4.4lx: ", (long)i); if(!nohex) { /* hex not disabled, show it */ for(c = 0; c < width; c++) if(i+c < size) fprintf(stream, "%02x ", ptr[i+c]); else fputs(" ", stream); } for(c = 0; (c < width) && (i+c < size); c++) { /* check for 0D0A; if found, skip past and start a new line of output */ if (nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) { i+=(c+2-width); break; } fprintf(stream, "%c", (ptr[i+c]>=0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.'); /* check again for 0D0A, to avoid an extra \n if it's at width */ if (nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) { i+=(c+3-width); break; } } fputc('\n', stream); /* newline */ } fflush(stream); } static int my_trace(CURL *handle, curl_infotype type, char *data, size_t size, void *userp) { struct data *config = (struct data *)userp; const char *text; (void)handle; /* prevent compiler warning */ switch (type) { case CURLINFO_TEXT: fprintf(stderr, "== Info: %s", data); default: /* in case a new one is introduced to shock us */ return 0; case CURLINFO_HEADER_OUT: text = "=> Send header"; break; case CURLINFO_DATA_OUT: text = "=> Send data"; break; case CURLINFO_SSL_DATA_OUT: text = "=> Send SSL data"; break; case CURLINFO_HEADER_IN: text = "<= Recv header"; break; case CURLINFO_DATA_IN: text = "<= Recv data"; break; case CURLINFO_SSL_DATA_IN: text = "<= Recv SSL data"; break; } dump(text, stderr, (unsigned char *)data, size, config->trace_ascii); return 0; } int main(void) { CURL *curl; CURLcode res; struct data config; config.trace_ascii = 1; /* enable ascii tracing */ curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace); curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &config); /* the DEBUGFUNCTION has no effect until we enable VERBOSE */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* example.com is redirected, so we tell libcurl to follow redirection */ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/"); res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); } return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/ftpget.c������������������������������������������������������������������0000644�0001750�0001750�00000005473�12213173003�013700� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* * This is an example showing how to get a single file from an FTP server. * It delays the actual destination file creation until the first write * callback so that it won't create an empty file in case the remote file * doesn't exist or something else fails. */ struct FtpFile { const char *filename; FILE *stream; }; static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) { struct FtpFile *out=(struct FtpFile *)stream; if(out && !out->stream) { /* open file for writing */ out->stream=fopen(out->filename, "wb"); if(!out->stream) return -1; /* failure, can't open file to write */ } return fwrite(buffer, size, nmemb, out->stream); } int main(void) { CURL *curl; CURLcode res; struct FtpFile ftpfile={ "curl.tar.gz", /* name to store the file as if succesful */ NULL }; curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(curl) { /* * You better replace the URL with one that works! */ curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.example.com/pub/www/utilities/curl/curl-7.9.2.tar.gz"); /* Define our callback to get called when there's data to be written */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite); /* Set a pointer to our struct to pass to the callback */ curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile); /* Switch on full protocol/debug output */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); res = curl_easy_perform(curl); /* always cleanup */ curl_easy_cleanup(curl); if(CURLE_OK != res) { /* we failed */ fprintf(stderr, "curl told us %d\n", res); } } if(ftpfile.stream) fclose(ftpfile.stream); /* close the local file */ curl_global_cleanup(); return 0; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/pop3-retr.c���������������������������������������������������������������0000644�0001750�0001750�00000003557�12270035364�014255� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to retrieve mail using libcurl's POP3 * capabilities. * * Note that this example requires libcurl 7.20.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This will retreive message 1 from the user's mailbox */ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com/1"); /* Perform the retr */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } �������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/pop3-stat.c���������������������������������������������������������������0000644�0001750�0001750�00000004071�12270035364�014244� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to obtain message statistics using * libcurl's POP3 capabilities. * * Note that this example requires libcurl 7.26.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This is just the server URL */ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com"); /* Set the STAT command */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "STAT"); /* Do not perform a transfer as the data is in the response */ curl_easy_setopt(curl, CURLOPT_NOBODY, 1L); /* Perform the custom request */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/ftpgetinfo.c��������������������������������������������������������������0000644�0001750�0001750�00000005653�12213173003�014554� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <string.h> #include <curl/curl.h> /* * This is an example showing how to check a single file's size and mtime * from an FTP server. */ static size_t throw_away(void *ptr, size_t size, size_t nmemb, void *data) { (void)ptr; (void)data; /* we are not interested in the headers itself, so we only return the size we would have saved ... */ return (size_t)(size * nmemb); } int main(void) { char ftpurl[] = "ftp://ftp.example.com/gnu/binutils/binutils-2.19.1.tar.bz2"; CURL *curl; CURLcode res; long filetime = -1; double filesize = 0.0; const char *filename = strrchr(ftpurl, '/') + 1; curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, ftpurl); /* No download if the file */ curl_easy_setopt(curl, CURLOPT_NOBODY, 1L); /* Ask for filetime */ curl_easy_setopt(curl, CURLOPT_FILETIME, 1L); /* No header output: TODO 14.1 http-style HEAD output for ftp */ curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, throw_away); curl_easy_setopt(curl, CURLOPT_HEADER, 0L); /* Switch on full protocol/debug output */ /* curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); */ res = curl_easy_perform(curl); if(CURLE_OK == res) { /* http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */ res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime); if((CURLE_OK == res) && (filetime >= 0)) { time_t file_time = (time_t)filetime; printf("filetime %s: %s", filename, ctime(&file_time)); } res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &filesize); if((CURLE_OK == res) && (filesize>0.0)) printf("filesize %s: %0.0f bytes\n", filename, filesize); } else { /* we failed */ fprintf(stderr, "curl told us %d\n", res); } /* always cleanup */ curl_easy_cleanup(curl); } curl_global_cleanup(); return 0; } �������������������������������������������������������������������������������������curl-7.35.0/docs/examples/cacertinmem.c�������������������������������������������������������������0000644�0001750�0001750�00000015161�12213173003�014671� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* Example using a "in core" PEM certificate to retrieve a https page. * Written by Theo Borm */ /* on a netBSD system with OPENSSL& LIBCURL installed from * pkgsrc (using default paths) this program can be compiled using: * gcc -I/usr/pkg/include -L/usr/pkg/lib -lcurl -Wl,-R/usr/pkg/lib -lssl * -lcrypto -lz -o curlcacerttest curlcacerttest.c * on other operating systems you may want to change paths to headers * and libraries */ #include <openssl/ssl.h> #include <curl/curl.h> #include <stdio.h> size_t writefunction( void *ptr, size_t size, size_t nmemb, void *stream) { fwrite(ptr,size,nmemb,stream); return(nmemb*size); } static CURLcode sslctx_function(CURL * curl, void * sslctx, void * parm) { X509_STORE * store; X509 * cert=NULL; BIO * bio; char * mypem = /* www.cacert.org */ "-----BEGIN CERTIFICATE-----\n"\ "MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290\n"\ "IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB\n"\ "IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA\n"\ "Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO\n"\ "BgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEi\n"\ "MCAGA1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJ\n"\ "ARYSc3VwcG9ydEBjYWNlcnQub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC\n"\ "CgKCAgEAziLA4kZ97DYoB1CW8qAzQIxL8TtmPzHlawI229Z89vGIj053NgVBlfkJ\n"\ "8BLPRoZzYLdufujAWGSuzbCtRRcMY/pnCujW0r8+55jE8Ez64AO7NV1sId6eINm6\n"\ "zWYyN3L69wj1x81YyY7nDl7qPv4coRQKFWyGhFtkZip6qUtTefWIonvuLwphK42y\n"\ "fk1WpRPs6tqSnqxEQR5YYGUFZvjARL3LlPdCfgv3ZWiYUQXw8wWRBB0bF4LsyFe7\n"\ "w2t6iPGwcswlWyCR7BYCEo8y6RcYSNDHBS4CMEK4JZwFaz+qOqfrU0j36NK2B5jc\n"\ "G8Y0f3/JHIJ6BVgrCFvzOKKrF11myZjXnhCLotLddJr3cQxyYN/Nb5gznZY0dj4k\n"\ "epKwDpUeb+agRThHqtdB7Uq3EvbXG4OKDy7YCbZZ16oE/9KTfWgu3YtLq1i6L43q\n"\ "laegw1SJpfvbi1EinbLDvhG+LJGGi5Z4rSDTii8aP8bQUWWHIbEZAWV/RRyH9XzQ\n"\ "QUxPKZgh/TMfdQwEUfoZd9vUFBzugcMd9Zi3aQaRIt0AUMyBMawSB3s42mhb5ivU\n"\ "fslfrejrckzzAeVLIL+aplfKkQABi6F1ITe1Yw1nPkZPcCBnzsXWWdsC4PDSy826\n"\ "YreQQejdIOQpvGQpQsgi3Hia/0PsmBsJUUtaWsJx8cTLc6nloQsCAwEAAaOCAc4w\n"\ "ggHKMB0GA1UdDgQWBBQWtTIb1Mfz4OaO873SsDrusjkY0TCBowYDVR0jBIGbMIGY\n"\ "gBQWtTIb1Mfz4OaO873SsDrusjkY0aF9pHsweTEQMA4GA1UEChMHUm9vdCBDQTEe\n"\ "MBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0\n"\ "IFNpZ25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2Vy\n"\ "dC5vcmeCAQAwDwYDVR0TAQH/BAUwAwEB/zAyBgNVHR8EKzApMCegJaAjhiFodHRw\n"\ "czovL3d3dy5jYWNlcnQub3JnL3Jldm9rZS5jcmwwMAYJYIZIAYb4QgEEBCMWIWh0\n"\ "dHBzOi8vd3d3LmNhY2VydC5vcmcvcmV2b2tlLmNybDA0BglghkgBhvhCAQgEJxYl\n"\ "aHR0cDovL3d3dy5jYWNlcnQub3JnL2luZGV4LnBocD9pZD0xMDBWBglghkgBhvhC\n"\ "AQ0ESRZHVG8gZ2V0IHlvdXIgb3duIGNlcnRpZmljYXRlIGZvciBGUkVFIGhlYWQg\n"\ "b3ZlciB0byBodHRwOi8vd3d3LmNhY2VydC5vcmcwDQYJKoZIhvcNAQEEBQADggIB\n"\ "ACjH7pyCArpcgBLKNQodgW+JapnM8mgPf6fhjViVPr3yBsOQWqy1YPaZQwGjiHCc\n"\ "nWKdpIevZ1gNMDY75q1I08t0AoZxPuIrA2jxNGJARjtT6ij0rPtmlVOKTV39O9lg\n"\ "18p5aTuxZZKmxoGCXJzN600BiqXfEVWqFcofN8CCmHBh22p8lqOOLlQ+TyGpkO/c\n"\ "gr/c6EWtTZBzCDyUZbAEmXZ/4rzCahWqlwQ3JNgelE5tDlG+1sSPypZt90Pf6DBl\n"\ "Jzt7u0NDY8RD97LsaMzhGY4i+5jhe1o+ATc7iwiwovOVThrLm82asduycPAtStvY\n"\ "sONvRUgzEv/+PDIqVPfE94rwiCPCR/5kenHA0R6mY7AHfqQv0wGP3J8rtsYIqQ+T\n"\ "SCX8Ev2fQtzzxD72V7DX3WnRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF\n"\ "CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum\n"\ "GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk\n"\ "zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW\n"\ "omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD\n"\ "-----END CERTIFICATE-----\n"; /* get a BIO */ bio=BIO_new_mem_buf(mypem, -1); /* use it to read the PEM formatted certificate from memory into an X509 * structure that SSL can use */ PEM_read_bio_X509(bio, &cert, 0, NULL); if (cert == NULL) printf("PEM_read_bio_X509 failed...\n"); /* get a pointer to the X509 certificate store (which may be empty!) */ store=SSL_CTX_get_cert_store((SSL_CTX *)sslctx); /* add our certificate to this store */ if (X509_STORE_add_cert(store, cert)==0) printf("error adding certificate\n"); /* all set to go */ return CURLE_OK ; } int main(void) { CURL * ch; CURLcode rv; rv=curl_global_init(CURL_GLOBAL_ALL); ch=curl_easy_init(); rv=curl_easy_setopt(ch,CURLOPT_VERBOSE, 0L); rv=curl_easy_setopt(ch,CURLOPT_HEADER, 0L); rv=curl_easy_setopt(ch,CURLOPT_NOPROGRESS, 1L); rv=curl_easy_setopt(ch,CURLOPT_NOSIGNAL, 1L); rv=curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction); rv=curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout); rv=curl_easy_setopt(ch,CURLOPT_HEADERFUNCTION, *writefunction); rv=curl_easy_setopt(ch,CURLOPT_WRITEHEADER, stderr); rv=curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM"); rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1L); rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/"); /* first try: retrieve page without cacerts' certificate -> will fail */ rv=curl_easy_perform(ch); if (rv==CURLE_OK) printf("*** transfer succeeded ***\n"); else printf("*** transfer failed ***\n"); /* second try: retrieve page using cacerts' certificate -> will succeed * load the certificate by installing a function doing the nescessary * "modifications" to the SSL CONTEXT just before link init */ rv=curl_easy_setopt(ch,CURLOPT_SSL_CTX_FUNCTION, *sslctx_function); rv=curl_easy_perform(ch); if (rv==CURLE_OK) printf("*** transfer succeeded ***\n"); else printf("*** transfer failed ***\n"); curl_easy_cleanup(ch); curl_global_cleanup(); return rv; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/pop3-dele.c���������������������������������������������������������������0000644�0001750�0001750�00000004124�12270035364�014201� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to delete an existing mail using * libcurl's POP3 capabilities. * * Note that this example requires libcurl 7.26.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* You can specify the message either in the URL or DELE command */ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com/1"); /* Set the DELE command */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELE"); /* Do not perform a transfer as DELE returns no data */ curl_easy_setopt(curl, CURLOPT_NOBODY, 1L); /* Perform the custom request */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/sepheaders.c��������������������������������������������������������������0000644�0001750�0001750�00000005053�12262353672�014544� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <curl/curl.h> static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) { int written = fwrite(ptr, size, nmemb, (FILE *)stream); return written; } int main(void) { CURL *curl_handle; static const char *headerfilename = "head.out"; FILE *headerfile; static const char *bodyfilename = "body.out"; FILE *bodyfile; curl_global_init(CURL_GLOBAL_ALL); /* init the curl session */ curl_handle = curl_easy_init(); /* set URL to get */ curl_easy_setopt(curl_handle, CURLOPT_URL, "http://example.com"); /* no progress meter please */ curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L); /* send all data to this function */ curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data); /* open the files */ headerfile = fopen(headerfilename,"wb"); if (headerfile == NULL) { curl_easy_cleanup(curl_handle); return -1; } bodyfile = fopen(bodyfilename,"wb"); if (bodyfile == NULL) { curl_easy_cleanup(curl_handle); return -1; } /* we want the headers be written to this file handle */ curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER, headerfile); /* we want the body be written to this file handle instead of stdout */ curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, bodyfile); /* get it! */ curl_easy_perform(curl_handle); /* close the header file */ fclose(headerfile); /* close the body file */ fclose(bodyfile); /* cleanup curl stuff */ curl_easy_cleanup(curl_handle); return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/pop3-uidl.c���������������������������������������������������������������0000644�0001750�0001750�00000003713�12270035364�014230� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example using libcurl's POP3 capabilities to list the * contents of a mailbox by unique ID. * * Note that this example requires libcurl 7.26.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This is just the server URL */ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com"); /* Set the UIDL command */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "UIDL"); /* Perform the custom request */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } �����������������������������������������������������curl-7.35.0/docs/examples/ghiper.c������������������������������������������������������������������0000644�0001750�0001750�00000027357�12213173003�013672� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* Example application source code using the multi socket interface to * download many files at once. * * Written by Jeff Pohlmeyer Requires glib-2.x and a (POSIX?) system that has mkfifo(). This is an adaptation of libcurl's "hipev.c" and libevent's "event-test.c" sample programs, adapted to use glib's g_io_channel in place of libevent. When running, the program creates the named pipe "hiper.fifo" Whenever there is input into the fifo, the program reads the input as a list of URL's and creates some new easy handles to fetch each URL via the curl_multi "hiper" API. Thus, you can try a single URL: % echo http://www.yahoo.com > hiper.fifo Or a whole bunch of them: % cat my-url-list > hiper.fifo The fifo buffer is handled almost instantly, so you can even add more URL's while the previous requests are still being downloaded. This is purely a demo app, all retrieved data is simply discarded by the write callback. */ #include <glib.h> #include <sys/stat.h> #include <unistd.h> #include <fcntl.h> #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <curl/curl.h> #define MSG_OUT g_print /* Change to "g_error" to write to stderr */ #define SHOW_VERBOSE 0 /* Set to non-zero for libcurl messages */ #define SHOW_PROGRESS 0 /* Set to non-zero to enable progress callback */ /* Global information, common to all connections */ typedef struct _GlobalInfo { CURLM *multi; guint timer_event; int still_running; } GlobalInfo; /* Information associated with a specific easy handle */ typedef struct _ConnInfo { CURL *easy; char *url; GlobalInfo *global; char error[CURL_ERROR_SIZE]; } ConnInfo; /* Information associated with a specific socket */ typedef struct _SockInfo { curl_socket_t sockfd; CURL *easy; int action; long timeout; GIOChannel *ch; guint ev; GlobalInfo *global; } SockInfo; /* Die if we get a bad CURLMcode somewhere */ static void mcode_or_die(const char *where, CURLMcode code) { if ( CURLM_OK != code ) { const char *s; switch (code) { case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break; case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break; case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break; case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break; case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break; case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET"; break; case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break; case CURLM_LAST: s="CURLM_LAST"; break; default: s="CURLM_unknown"; } MSG_OUT("ERROR: %s returns %s\n", where, s); exit(code); } } /* Check for completed transfers, and remove their easy handles */ static void check_multi_info(GlobalInfo *g) { char *eff_url; CURLMsg *msg; int msgs_left; ConnInfo *conn; CURL *easy; CURLcode res; MSG_OUT("REMAINING: %d\n", g->still_running); while ((msg = curl_multi_info_read(g->multi, &msgs_left))) { if (msg->msg == CURLMSG_DONE) { easy = msg->easy_handle; res = msg->data.result; curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn); curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url); MSG_OUT("DONE: %s => (%d) %s\n", eff_url, res, conn->error); curl_multi_remove_handle(g->multi, easy); free(conn->url); curl_easy_cleanup(easy); free(conn); } } } /* Called by glib when our timeout expires */ static gboolean timer_cb(gpointer data) { GlobalInfo *g = (GlobalInfo *)data; CURLMcode rc; rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, &g->still_running); mcode_or_die("timer_cb: curl_multi_socket_action", rc); check_multi_info(g); return FALSE; } /* Update the event timer after curl_multi library calls */ static int update_timeout_cb(CURLM *multi, long timeout_ms, void *userp) { struct timeval timeout; GlobalInfo *g=(GlobalInfo *)userp; timeout.tv_sec = timeout_ms/1000; timeout.tv_usec = (timeout_ms%1000)*1000; MSG_OUT("*** update_timeout_cb %ld => %ld:%ld ***\n", timeout_ms, timeout.tv_sec, timeout.tv_usec); g->timer_event = g_timeout_add(timeout_ms, timer_cb, g); return 0; } /* Called by glib when we get action on a multi socket */ static gboolean event_cb(GIOChannel *ch, GIOCondition condition, gpointer data) { GlobalInfo *g = (GlobalInfo*) data; CURLMcode rc; int fd=g_io_channel_unix_get_fd(ch); int action = (condition & G_IO_IN ? CURL_CSELECT_IN : 0) | (condition & G_IO_OUT ? CURL_CSELECT_OUT : 0); rc = curl_multi_socket_action(g->multi, fd, action, &g->still_running); mcode_or_die("event_cb: curl_multi_socket_action", rc); check_multi_info(g); if(g->still_running) { return TRUE; } else { MSG_OUT("last transfer done, kill timeout\n"); if (g->timer_event) { g_source_remove(g->timer_event); } return FALSE; } } /* Clean up the SockInfo structure */ static void remsock(SockInfo *f) { if (!f) { return; } if (f->ev) { g_source_remove(f->ev); } g_free(f); } /* Assign information to a SockInfo structure */ static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g) { GIOCondition kind = (act&CURL_POLL_IN?G_IO_IN:0)|(act&CURL_POLL_OUT?G_IO_OUT:0); f->sockfd = s; f->action = act; f->easy = e; if (f->ev) { g_source_remove(f->ev); } f->ev=g_io_add_watch(f->ch, kind, event_cb,g); } /* Initialize a new SockInfo structure */ static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g) { SockInfo *fdp = g_malloc0(sizeof(SockInfo)); fdp->global = g; fdp->ch=g_io_channel_unix_new(s); setsock(fdp, s, easy, action, g); curl_multi_assign(g->multi, s, fdp); } /* CURLMOPT_SOCKETFUNCTION */ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { GlobalInfo *g = (GlobalInfo*) cbp; SockInfo *fdp = (SockInfo*) sockp; static const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE" }; MSG_OUT("socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); if (what == CURL_POLL_REMOVE) { MSG_OUT("\n"); remsock(fdp); } else { if (!fdp) { MSG_OUT("Adding data: %s%s\n", what&CURL_POLL_IN?"READ":"", what&CURL_POLL_OUT?"WRITE":"" ); addsock(s, e, what, g); } else { MSG_OUT( "Changing action from %d to %d\n", fdp->action, what); setsock(fdp, s, e, what, g); } } return 0; } /* CURLOPT_WRITEFUNCTION */ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) { size_t realsize = size * nmemb; ConnInfo *conn = (ConnInfo*) data; (void)ptr; (void)conn; return realsize; } /* CURLOPT_PROGRESSFUNCTION */ static int prog_cb (void *p, double dltotal, double dlnow, double ult, double uln) { ConnInfo *conn = (ConnInfo *)p; MSG_OUT("Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal); return 0; } /* Create a new easy handle, and add it to the global curl_multi */ static void new_conn(char *url, GlobalInfo *g ) { ConnInfo *conn; CURLMcode rc; conn = g_malloc0(sizeof(ConnInfo)); conn->error[0]='\0'; conn->easy = curl_easy_init(); if (!conn->easy) { MSG_OUT("curl_easy_init() failed, exiting!\n"); exit(2); } conn->global = g; conn->url = g_strdup(url); curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url); curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn); curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, (long)SHOW_VERBOSE); curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error); curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn); curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, SHOW_PROGRESS?0L:1L); curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb); curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn); curl_easy_setopt(conn->easy, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(conn->easy, CURLOPT_CONNECTTIMEOUT, 30L); curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 1L); curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 30L); MSG_OUT("Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url); rc =curl_multi_add_handle(g->multi, conn->easy); mcode_or_die("new_conn: curl_multi_add_handle", rc); /* note that the add_handle() will set a time-out to trigger very soon so that the necessary socket_action() call will be called by this app */ } /* This gets called by glib whenever data is received from the fifo */ static gboolean fifo_cb (GIOChannel *ch, GIOCondition condition, gpointer data) { #define BUF_SIZE 1024 gsize len, tp; gchar *buf, *tmp, *all=NULL; GIOStatus rv; do { GError *err=NULL; rv = g_io_channel_read_line (ch,&buf,&len,&tp,&err); if ( buf ) { if (tp) { buf[tp]='\0'; } new_conn(buf,(GlobalInfo*)data); g_free(buf); } else { buf = g_malloc(BUF_SIZE+1); while (TRUE) { buf[BUF_SIZE]='\0'; g_io_channel_read_chars(ch,buf,BUF_SIZE,&len,&err); if (len) { buf[len]='\0'; if (all) { tmp=all; all=g_strdup_printf("%s%s", tmp, buf); g_free(tmp); } else { all = g_strdup(buf); } } else { break; } } if (all) { new_conn(all,(GlobalInfo*)data); g_free(all); } g_free(buf); } if ( err ) { g_error("fifo_cb: %s", err->message); g_free(err); break; } } while ( (len) && (rv == G_IO_STATUS_NORMAL) ); return TRUE; } int init_fifo(void) { struct stat st; const char *fifo = "hiper.fifo"; int socket; if (lstat (fifo, &st) == 0) { if ((st.st_mode & S_IFMT) == S_IFREG) { errno = EEXIST; perror("lstat"); exit (1); } } unlink (fifo); if (mkfifo (fifo, 0600) == -1) { perror("mkfifo"); exit (1); } socket = open (fifo, O_RDWR | O_NONBLOCK, 0); if (socket == -1) { perror("open"); exit (1); } MSG_OUT("Now, pipe some URL's into > %s\n", fifo); return socket; } int main(int argc, char **argv) { GlobalInfo *g; CURLMcode rc; GMainLoop*gmain; int fd; GIOChannel* ch; g=g_malloc0(sizeof(GlobalInfo)); fd=init_fifo(); ch=g_io_channel_unix_new(fd); g_io_add_watch(ch,G_IO_IN,fifo_cb,g); gmain=g_main_loop_new(NULL,FALSE); g->multi = curl_multi_init(); curl_multi_setopt(g->multi, CURLMOPT_SOCKETFUNCTION, sock_cb); curl_multi_setopt(g->multi, CURLMOPT_SOCKETDATA, g); curl_multi_setopt(g->multi, CURLMOPT_TIMERFUNCTION, update_timeout_cb); curl_multi_setopt(g->multi, CURLMOPT_TIMERDATA, g); /* we don't call any curl_multi_socket*() function yet as we have no handles added! */ g_main_loop_run(gmain); curl_multi_cleanup(g->multi); return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/persistant.c��������������������������������������������������������������0000644�0001750�0001750�00000004120�12213173003�014567� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <unistd.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; curl_global_init(CURL_GLOBAL_ALL); curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_HEADER, 1L); /* get the first document */ curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/"); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* get another document from the same server using the same connection */ curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/docs/"); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); } return 0; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/chkspeed.c����������������������������������������������������������������0000644�0001750�0001750�00000014223�12213173003�014166� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* Example source code to show how the callback function can be used to * download data into a chunk of memory instead of storing it in a file. * After successful download we use curl_easy_getinfo() calls to get the * amount of downloaded bytes, the time used for the whole download, and * the average download speed. * On Linux you can create the download test files with: * dd if=/dev/urandom of=file_1M.bin bs=1M count=1 * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <curl/curl.h> #define URL_BASE "http://speedtest.your.domain/" #define URL_1M URL_BASE "file_1M.bin" #define URL_2M URL_BASE "file_2M.bin" #define URL_5M URL_BASE "file_5M.bin" #define URL_10M URL_BASE "file_10M.bin" #define URL_20M URL_BASE "file_20M.bin" #define URL_50M URL_BASE "file_50M.bin" #define URL_100M URL_BASE "file_100M.bin" #define CHKSPEED_VERSION "1.0" static size_t WriteCallback(void *ptr, size_t size, size_t nmemb, void *data) { /* we are not interested in the downloaded bytes itself, so we only return the size we would have saved ... */ (void)ptr; /* unused */ (void)data; /* unused */ return (size_t)(size * nmemb); } int main(int argc, char *argv[]) { CURL *curl_handle; CURLcode res; int prtall = 0, prtsep = 0, prttime = 0; const char *url = URL_1M; char *appname = argv[0]; if (argc > 1) { /* parse input parameters */ for (argc--, argv++; *argv; argc--, argv++) { if (strncasecmp(*argv, "-", 1) == 0) { if (strncasecmp(*argv, "-H", 2) == 0) { fprintf(stderr, "\rUsage: %s [-m=1|2|5|10|20|50|100] [-t] [-x] [url]\n", appname); exit(1); } else if (strncasecmp(*argv, "-V", 2) == 0) { fprintf(stderr, "\r%s %s - %s\n", appname, CHKSPEED_VERSION, curl_version()); exit(1); } else if (strncasecmp(*argv, "-A", 2) == 0) { prtall = 1; } else if (strncasecmp(*argv, "-X", 2) == 0) { prtsep = 1; } else if (strncasecmp(*argv, "-T", 2) == 0) { prttime = 1; } else if (strncasecmp(*argv, "-M=", 3) == 0) { long m = strtol((*argv)+3, NULL, 10); switch(m) { case 1: url = URL_1M; break; case 2: url = URL_2M; break; case 5: url = URL_5M; break; case 10: url = URL_10M; break; case 20: url = URL_20M; break; case 50: url = URL_50M; break; case 100: url = URL_100M; break; default: fprintf(stderr, "\r%s: invalid parameter %s\n", appname, *argv + 3); exit(1); } } else { fprintf(stderr, "\r%s: invalid or unknown option %s\n", appname, *argv); exit(1); } } else { url = *argv; } } } /* print separator line */ if (prtsep) { printf("-------------------------------------------------\n"); } /* print localtime */ if (prttime) { time_t t = time(NULL); printf("Localtime: %s", ctime(&t)); } /* init libcurl */ curl_global_init(CURL_GLOBAL_ALL); /* init the curl session */ curl_handle = curl_easy_init(); /* specify URL to get */ curl_easy_setopt(curl_handle, CURLOPT_URL, url); /* send all data to this function */ curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteCallback); /* some servers don't like requests that are made without a user-agent field, so we provide one */ curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-speedchecker/" CHKSPEED_VERSION); /* get it! */ res = curl_easy_perform(curl_handle); if(CURLE_OK == res) { double val; /* check for bytes downloaded */ res = curl_easy_getinfo(curl_handle, CURLINFO_SIZE_DOWNLOAD, &val); if((CURLE_OK == res) && (val>0)) printf("Data downloaded: %0.0f bytes.\n", val); /* check for total download time */ res = curl_easy_getinfo(curl_handle, CURLINFO_TOTAL_TIME, &val); if((CURLE_OK == res) && (val>0)) printf("Total download time: %0.3f sec.\n", val); /* check for average download speed */ res = curl_easy_getinfo(curl_handle, CURLINFO_SPEED_DOWNLOAD, &val); if((CURLE_OK == res) && (val>0)) printf("Average download speed: %0.3f kbyte/sec.\n", val / 1024); if (prtall) { /* check for name resolution time */ res = curl_easy_getinfo(curl_handle, CURLINFO_NAMELOOKUP_TIME, &val); if((CURLE_OK == res) && (val>0)) printf("Name lookup time: %0.3f sec.\n", val); /* check for connect time */ res = curl_easy_getinfo(curl_handle, CURLINFO_CONNECT_TIME, &val); if((CURLE_OK == res) && (val>0)) printf("Connect time: %0.3f sec.\n", val); } } else { fprintf(stderr, "Error while fetching '%s' : %s\n", url, curl_easy_strerror(res)); } /* cleanup curl stuff */ curl_easy_cleanup(curl_handle); /* we're done with libcurl, so clean it up */ curl_global_cleanup(); return 0; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/externalsocket.c����������������������������������������������������������0000644�0001750�0001750�00000010630�12213173003�015431� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* * This is an example demonstrating how an application can pass in a custom * socket to libcurl to use. This example also handles the connect itself. */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <curl/curl.h> #ifdef WIN32 #include <windows.h> #include <winsock2.h> #include <ws2tcpip.h> #define close closesocket #else #include <sys/types.h> /* socket types */ #include <sys/socket.h> /* socket definitions */ #include <netinet/in.h> #include <arpa/inet.h> /* inet (3) funtions */ #include <unistd.h> /* misc. UNIX functions */ #endif #include <errno.h> /* The IP address and port number to connect to */ #define IPADDR "127.0.0.1" #define PORTNUM 80 #ifndef INADDR_NONE #define INADDR_NONE 0xffffffff #endif static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) { int written = fwrite(ptr, size, nmemb, (FILE *)stream); return written; } static curl_socket_t opensocket(void *clientp, curlsocktype purpose, struct curl_sockaddr *address) { curl_socket_t sockfd; (void)purpose; (void)address; sockfd = *(curl_socket_t *)clientp; /* the actual externally set socket is passed in via the OPENSOCKETDATA option */ return sockfd; } static int sockopt_callback(void *clientp, curl_socket_t curlfd, curlsocktype purpose) { (void)clientp; (void)curlfd; (void)purpose; /* This return code was added in libcurl 7.21.5 */ return CURL_SOCKOPT_ALREADY_CONNECTED; } int main(void) { CURL *curl; CURLcode res; struct sockaddr_in servaddr; /* socket address structure */ curl_socket_t sockfd; #ifdef WIN32 WSADATA wsaData; int initwsa; if((initwsa = WSAStartup(MAKEWORD(2,0), &wsaData)) != 0) { printf("WSAStartup failed: %d\n", initwsa); return 1; } #endif curl = curl_easy_init(); if(curl) { /* * Note that libcurl will internally think that you connect to the host * and port that you specify in the URL option. */ curl_easy_setopt(curl, CURLOPT_URL, "http://99.99.99.99:9999"); /* Create the socket "manually" */ if( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) == CURL_SOCKET_BAD ) { printf("Error creating listening socket.\n"); return 3; } memset(&servaddr, 0, sizeof(servaddr)); servaddr.sin_family = AF_INET; servaddr.sin_port = htons(PORTNUM); if (INADDR_NONE == (servaddr.sin_addr.s_addr = inet_addr(IPADDR))) return 2; if(connect(sockfd,(struct sockaddr *) &servaddr, sizeof(servaddr)) == -1) { close(sockfd); printf("client error: connect: %s\n", strerror(errno)); return 1; } /* no progress meter please */ curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); /* send all data to this function */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); /* call this function to get a socket */ curl_easy_setopt(curl, CURLOPT_OPENSOCKETFUNCTION, opensocket); curl_easy_setopt(curl, CURLOPT_OPENSOCKETDATA, &sockfd); /* call this function to set options for the socket */ curl_easy_setopt(curl, CURLOPT_SOCKOPTFUNCTION, sockopt_callback); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); res = curl_easy_perform(curl); curl_easy_cleanup(curl); if(res) { printf("libcurl error: %d\n", res); return 4; } } return 0; } ��������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/multi-double.c������������������������������������������������������������0000644�0001750�0001750�00000006534�12213173003�015010� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <string.h> /* somewhat unix-specific */ #include <sys/time.h> #include <unistd.h> /* curl stuff */ #include <curl/curl.h> /* * Simply download two HTTP files! */ int main(void) { CURL *http_handle; CURL *http_handle2; CURLM *multi_handle; int still_running; /* keep number of running handles */ http_handle = curl_easy_init(); http_handle2 = curl_easy_init(); /* set options */ curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/"); /* set options */ curl_easy_setopt(http_handle2, CURLOPT_URL, "http://localhost/"); /* init a multi stack */ multi_handle = curl_multi_init(); /* add the individual transfers */ curl_multi_add_handle(multi_handle, http_handle); curl_multi_add_handle(multi_handle, http_handle2); /* we start some action by calling perform right away */ curl_multi_perform(multi_handle, &still_running); do { struct timeval timeout; int rc; /* select() return code */ fd_set fdread; fd_set fdwrite; fd_set fdexcep; int maxfd = -1; long curl_timeo = -1; FD_ZERO(&fdread); FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); /* set a suitable timeout to play around with */ timeout.tv_sec = 1; timeout.tv_usec = 0; curl_multi_timeout(multi_handle, &curl_timeo); if(curl_timeo >= 0) { timeout.tv_sec = curl_timeo / 1000; if(timeout.tv_sec > 1) timeout.tv_sec = 1; else timeout.tv_usec = (curl_timeo % 1000) * 1000; } /* get file descriptors from the transfers */ curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd); /* In a real-world program you OF COURSE check the return code of the function calls. On success, the value of maxfd is guaranteed to be greater or equal than -1. We call select(maxfd + 1, ...), specially in case of (maxfd == -1), we call select(0, ...), which is basically equal to sleep. */ rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout); switch(rc) { case -1: /* select error */ break; case 0: default: /* timeout or readable/writable sockets */ curl_multi_perform(multi_handle, &still_running); break; } } while(still_running); curl_multi_cleanup(multi_handle); curl_easy_cleanup(http_handle); curl_easy_cleanup(http_handle2); return 0; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/imap-ssl.c����������������������������������������������������������������0000644�0001750�0001750�00000006270�12270035364�014142� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to fetch mail using libcurl's IMAP * capabilities. It builds on the imap-fetch.c example adding transport * security to protect the authentication details from being snooped. * * Note that this example requires libcurl 7.30.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This will fetch message 1 from the user's inbox. Note the use of * imaps:// rather than imap:// to request a SSL based connection. */ curl_easy_setopt(curl, CURLOPT_URL, "imaps://imap.example.com/INBOX/;UID=1"); /* If you want to connect to a site who isn't using a certificate that is * signed by one of the certs in the CA bundle you have, you can skip the * verification of the server's certificate. This makes the connection * A LOT LESS SECURE. * * If you have a CA cert for the server stored someplace else than in the * default bundle, then the CURLOPT_CAPATH option might come handy for * you. */ #ifdef SKIP_PEER_VERIFICATION curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); #endif /* If the site you're connecting to uses a different host name that what * they have mentioned in their server certificate's commonName (or * subjectAltName) fields, libcurl will refuse to connect. You can skip * this check, but this will make the connection less secure. */ #ifdef SKIP_HOSTNAME_VERFICATION curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); #endif /* Since the traffic will be encrypted, it is very useful to turn on debug * information within libcurl to see what is happening during the * transfer */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* Perform the fetch */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/imap-create.c�������������������������������������������������������������0000644�0001750�0001750�00000003761�12270035364�014606� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to create a new mailbox folder using * libcurl's IMAP capabilities. * * Note that this example requires libcurl 7.30.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This is just the server URL */ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com"); /* Set the CREATE command specifing the new folder name */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "CREATE FOLDER"); /* Perform the custom request */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } ���������������curl-7.35.0/docs/examples/multi-debugcallback.c�����������������������������������������������������0000644�0001750�0001750�00000012571�12213173003�016277� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* This is an example showing the multi interface and the debug callback. */ #include <stdio.h> #include <string.h> /* somewhat unix-specific */ #include <sys/time.h> #include <unistd.h> /* curl stuff */ #include <curl/curl.h> typedef char bool; #define TRUE 1 static void dump(const char *text, FILE *stream, unsigned char *ptr, size_t size, bool nohex) { size_t i; size_t c; unsigned int width=0x10; if(nohex) /* without the hex output, we can fit more on screen */ width = 0x40; fprintf(stream, "%s, %10.10ld bytes (0x%8.8lx)\n", text, (long)size, (long)size); for(i=0; i<size; i+= width) { fprintf(stream, "%4.4lx: ", (long)i); if(!nohex) { /* hex not disabled, show it */ for(c = 0; c < width; c++) if(i+c < size) fprintf(stream, "%02x ", ptr[i+c]); else fputs(" ", stream); } for(c = 0; (c < width) && (i+c < size); c++) { /* check for 0D0A; if found, skip past and start a new line of output */ if (nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) { i+=(c+2-width); break; } fprintf(stream, "%c", (ptr[i+c]>=0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.'); /* check again for 0D0A, to avoid an extra \n if it's at width */ if (nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) { i+=(c+3-width); break; } } fputc('\n', stream); /* newline */ } fflush(stream); } static int my_trace(CURL *handle, curl_infotype type, unsigned char *data, size_t size, void *userp) { const char *text; (void)userp; (void)handle; /* prevent compiler warning */ switch (type) { case CURLINFO_TEXT: fprintf(stderr, "== Info: %s", data); default: /* in case a new one is introduced to shock us */ return 0; case CURLINFO_HEADER_OUT: text = "=> Send header"; break; case CURLINFO_DATA_OUT: text = "=> Send data"; break; case CURLINFO_HEADER_IN: text = "<= Recv header"; break; case CURLINFO_DATA_IN: text = "<= Recv data"; break; } dump(text, stderr, data, size, TRUE); return 0; } /* * Simply download a HTTP file. */ int main(void) { CURL *http_handle; CURLM *multi_handle; int still_running; /* keep number of running handles */ http_handle = curl_easy_init(); /* set the options (I left out a few, you'll get the point anyway) */ curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/"); curl_easy_setopt(http_handle, CURLOPT_DEBUGFUNCTION, my_trace); curl_easy_setopt(http_handle, CURLOPT_VERBOSE, 1L); /* init a multi stack */ multi_handle = curl_multi_init(); /* add the individual transfers */ curl_multi_add_handle(multi_handle, http_handle); /* we start some action by calling perform right away */ curl_multi_perform(multi_handle, &still_running); do { struct timeval timeout; int rc; /* select() return code */ fd_set fdread; fd_set fdwrite; fd_set fdexcep; int maxfd = -1; long curl_timeo = -1; FD_ZERO(&fdread); FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); /* set a suitable timeout to play around with */ timeout.tv_sec = 1; timeout.tv_usec = 0; curl_multi_timeout(multi_handle, &curl_timeo); if(curl_timeo >= 0) { timeout.tv_sec = curl_timeo / 1000; if(timeout.tv_sec > 1) timeout.tv_sec = 1; else timeout.tv_usec = (curl_timeo % 1000) * 1000; } /* get file descriptors from the transfers */ curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd); /* In a real-world program you OF COURSE check the return code of the function calls. On success, the value of maxfd is guaranteed to be greater or equal than -1. We call select(maxfd + 1, ...), specially in case of (maxfd == -1), we call select(0, ...), which is basically equal to sleep. */ rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout); switch(rc) { case -1: /* select error */ still_running = 0; printf("select() returns error, this is badness\n"); break; case 0: default: /* timeout or readable/writable sockets */ curl_multi_perform(multi_handle, &still_running); break; } } while(still_running); curl_multi_cleanup(multi_handle); curl_easy_cleanup(http_handle); return 0; } ���������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/simplepost.c��������������������������������������������������������������0000644�0001750�0001750�00000003442�12213173003�014600� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <string.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; static const char *postthis="moo mooo moo moo"; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postthis); /* if we don't provide POSTFIELDSIZE, libcurl will strlen() by itself */ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(postthis)); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); } return 0; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/postinmemory.c������������������������������������������������������������0000644�0001750�0001750�00000006532�12262353672�015171� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <curl/curl.h> struct MemoryStruct { char *memory; size_t size; }; static size_t WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp) { size_t realsize = size * nmemb; struct MemoryStruct *mem = (struct MemoryStruct *)userp; mem->memory = realloc(mem->memory, mem->size + realsize + 1); if(mem->memory == NULL) { /* out of memory! */ printf("not enough memory (realloc returned NULL)\n"); return 0; } memcpy(&(mem->memory[mem->size]), contents, realsize); mem->size += realsize; mem->memory[mem->size] = 0; return realsize; } int main(void) { CURL *curl; CURLcode res; struct MemoryStruct chunk; static const char *postthis="Field=1&Field=2&Field=3"; chunk.memory = malloc(1); /* will be grown as needed by realloc above */ chunk.size = 0; /* no data at this point */ curl_global_init(CURL_GLOBAL_ALL); curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.org/"); /* send all data to this function */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); /* we pass our 'chunk' struct to the callback function */ curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk); /* some servers don't like requests that are made without a user-agent field, so we provide one */ curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-agent/1.0"); curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postthis); /* if we don't provide POSTFIELDSIZE, libcurl will strlen() by itself */ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(postthis)); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) { fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); } else { /* * Now, our chunk.memory points to a memory block that is chunk.size * bytes big and contains the remote file. * * Do something nice with it! */ printf("%s\n",chunk.memory); } /* always cleanup */ curl_easy_cleanup(curl); if(chunk.memory) free(chunk.memory); /* we're done with libcurl, so clean it up */ curl_global_cleanup(); } return 0; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/10-at-a-time.c������������������������������������������������������������0000644�0001750�0001750�00000012155�12213173003�014376� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* Example application source code using the multi interface to download many * files, but with a capped maximum amount of simultaneous transfers. * * Written by Michael Wallner */ #include <errno.h> #include <stdlib.h> #include <string.h> #ifndef WIN32 # include <unistd.h> #endif #include <curl/multi.h> static const char *urls[] = { "http://www.microsoft.com", "http://www.opensource.org", "http://www.google.com", "http://www.yahoo.com", "http://www.ibm.com", "http://www.mysql.com", "http://www.oracle.com", "http://www.ripe.net", "http://www.iana.org", "http://www.amazon.com", "http://www.netcraft.com", "http://www.heise.de", "http://www.chip.de", "http://www.ca.com", "http://www.cnet.com", "http://www.news.com", "http://www.cnn.com", "http://www.wikipedia.org", "http://www.dell.com", "http://www.hp.com", "http://www.cert.org", "http://www.mit.edu", "http://www.nist.gov", "http://www.ebay.com", "http://www.playstation.com", "http://www.uefa.com", "http://www.ieee.org", "http://www.apple.com", "http://www.sony.com", "http://www.symantec.com", "http://www.zdnet.com", "http://www.fujitsu.com", "http://www.supermicro.com", "http://www.hotmail.com", "http://www.ecma.com", "http://www.bbc.co.uk", "http://news.google.com", "http://www.foxnews.com", "http://www.msn.com", "http://www.wired.com", "http://www.sky.com", "http://www.usatoday.com", "http://www.cbs.com", "http://www.nbc.com", "http://slashdot.org", "http://www.bloglines.com", "http://www.techweb.com", "http://www.newslink.org", "http://www.un.org", }; #define MAX 10 /* number of simultaneous transfers */ #define CNT sizeof(urls)/sizeof(char*) /* total number of transfers to do */ static size_t cb(char *d, size_t n, size_t l, void *p) { /* take care of the data here, ignored in this example */ (void)d; (void)p; return n*l; } static void init(CURLM *cm, int i) { CURL *eh = curl_easy_init(); curl_easy_setopt(eh, CURLOPT_WRITEFUNCTION, cb); curl_easy_setopt(eh, CURLOPT_HEADER, 0L); curl_easy_setopt(eh, CURLOPT_URL, urls[i]); curl_easy_setopt(eh, CURLOPT_PRIVATE, urls[i]); curl_easy_setopt(eh, CURLOPT_VERBOSE, 0L); curl_multi_add_handle(cm, eh); } int main(void) { CURLM *cm; CURLMsg *msg; long L; unsigned int C=0; int M, Q, U = -1; fd_set R, W, E; struct timeval T; curl_global_init(CURL_GLOBAL_ALL); cm = curl_multi_init(); /* we can optionally limit the total amount of connections this multi handle uses */ curl_multi_setopt(cm, CURLMOPT_MAXCONNECTS, (long)MAX); for (C = 0; C < MAX; ++C) { init(cm, C); } while (U) { curl_multi_perform(cm, &U); if (U) { FD_ZERO(&R); FD_ZERO(&W); FD_ZERO(&E); if (curl_multi_fdset(cm, &R, &W, &E, &M)) { fprintf(stderr, "E: curl_multi_fdset\n"); return EXIT_FAILURE; } if (curl_multi_timeout(cm, &L)) { fprintf(stderr, "E: curl_multi_timeout\n"); return EXIT_FAILURE; } if (L == -1) L = 100; if (M == -1) { #ifdef WIN32 Sleep(L); #else sleep(L / 1000); #endif } else { T.tv_sec = L/1000; T.tv_usec = (L%1000)*1000; if (0 > select(M+1, &R, &W, &E, &T)) { fprintf(stderr, "E: select(%i,,,,%li): %i: %s\n", M+1, L, errno, strerror(errno)); return EXIT_FAILURE; } } } while ((msg = curl_multi_info_read(cm, &Q))) { if (msg->msg == CURLMSG_DONE) { char *url; CURL *e = msg->easy_handle; curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &url); fprintf(stderr, "R: %d - %s <%s>\n", msg->data.result, curl_easy_strerror(msg->data.result), url); curl_multi_remove_handle(cm, e); curl_easy_cleanup(e); } else { fprintf(stderr, "E: CURLMsg (%d)\n", msg->msg); } if (C < CNT) { init(cm, C++); U++; /* just to prevent it from remaining at 0 if there are more URLs to get */ } } } curl_multi_cleanup(cm); curl_global_cleanup(); return EXIT_SUCCESS; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/pop3-ssl.c����������������������������������������������������������������0000644�0001750�0001750�00000006263�12270035364�014077� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to retrieve mail using libcurl's POP3 * capabilities. It builds on the pop3-retr.c example adding transport * security to protect the authentication details from being snooped. * * Note that this example requires libcurl 7.20.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This will retreive message 1 from the user's mailbox. Note the use of * pop3s:// rather than pop3:// to request a SSL based connection. */ curl_easy_setopt(curl, CURLOPT_URL, "pop3s://pop.example.com/1"); /* If you want to connect to a site who isn't using a certificate that is * signed by one of the certs in the CA bundle you have, you can skip the * verification of the server's certificate. This makes the connection * A LOT LESS SECURE. * * If you have a CA cert for the server stored someplace else than in the * default bundle, then the CURLOPT_CAPATH option might come handy for * you. */ #ifdef SKIP_PEER_VERIFICATION curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); #endif /* If the site you're connecting to uses a different host name that what * they have mentioned in their server certificate's commonName (or * subjectAltName) fields, libcurl will refuse to connect. You can skip * this check, but this will make the connection less secure. */ #ifdef SKIP_HOSTNAME_VERFICATION curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); #endif /* Since the traffic will be encrypted, it is very useful to turn on debug * information within libcurl to see what is happening during the * transfer */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* Perform the retr */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/progressfunc.c������������������������������������������������������������0000644�0001750�0001750�00000007714�12262353672�015147� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> #define STOP_DOWNLOAD_AFTER_THIS_MANY_BYTES 6000 #define MINIMAL_PROGRESS_FUNCTIONALITY_INTERVAL 3 struct myprogress { double lastruntime; CURL *curl; }; /* this is how the CURLOPT_XFERINFOFUNCTION callback works */ static int xferinfo(void *p, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) { struct myprogress *myp = (struct myprogress *)p; CURL *curl = myp->curl; double curtime = 0; curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &curtime); /* under certain circumstances it may be desirable for certain functionality to only run every N seconds, in order to do this the transaction time can be used */ if((curtime - myp->lastruntime) >= MINIMAL_PROGRESS_FUNCTIONALITY_INTERVAL) { myp->lastruntime = curtime; fprintf(stderr, "TOTAL TIME: %f \r\n", curtime); } fprintf(stderr, "UP: %" CURL_FORMAT_CURL_OFF_T " of %" CURL_FORMAT_CURL_OFF_T " DOWN: %" CURL_FORMAT_CURL_OFF_T " of %" CURL_FORMAT_CURL_OFF_T "\r\n", ulnow, ultotal, dlnow, dltotal); if(dlnow > STOP_DOWNLOAD_AFTER_THIS_MANY_BYTES) return 1; return 0; } /* for libcurl older than 7.32.0 (CURLOPT_PROGRESSFUNCTION) */ static int older_progress(void *p, double dltotal, double dlnow, double ultotal, double ulnow) { return xferinfo(p, (curl_off_t)dltotal, (curl_off_t)dlnow, (curl_off_t)ultotal, (curl_off_t)ulnow); } int main(void) { CURL *curl; CURLcode res = CURLE_OK; struct myprogress prog; curl = curl_easy_init(); if(curl) { prog.lastruntime = 0; prog.curl = curl; curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/"); curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, older_progress); /* pass the struct pointer into the progress function */ curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, &prog); #if LIBCURL_VERSION_NUM >= 0x072000 /* xferinfo was introduced in 7.32.0, no earlier libcurl versions will compile as they won't have the symbols around. If built with a newer libcurl, but running with an older libcurl: curl_easy_setopt() will fail in run-time trying to set the new callback, making the older callback get used. New libcurls will prefer the new callback and instead use that one even if both callbacks are set. */ curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, xferinfo); /* pass the struct pointer into the xferinfo function, note that this is an alias to CURLOPT_PROGRESSDATA */ curl_easy_setopt(curl, CURLOPT_XFERINFODATA, &prog); #endif curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); res = curl_easy_perform(curl); if(res != CURLE_OK) fprintf(stderr, "%s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); } return (int)res; } ����������������������������������������������������curl-7.35.0/docs/examples/threaded-ssl.c������������������������������������������������������������0000644�0001750�0001750�00000010305�12213173003�014754� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* A multi-threaded example that uses pthreads and fetches 4 remote files at * once over HTTPS. The lock callbacks and stuff assume OpenSSL or GnuTLS * (libgcrypt) so far. * * OpenSSL docs for this: * http://www.openssl.org/docs/crypto/threads.html * gcrypt docs for this: * http://gnupg.org/documentation/manuals/gcrypt/Multi_002dThreading.html */ #define USE_OPENSSL /* or USE_GNUTLS accordingly */ #include <stdio.h> #include <pthread.h> #include <curl/curl.h> #define NUMT 4 /* we have this global to let the callback get easy access to it */ static pthread_mutex_t *lockarray; #ifdef USE_OPENSSL #include <openssl/crypto.h> static void lock_callback(int mode, int type, char *file, int line) { (void)file; (void)line; if (mode & CRYPTO_LOCK) { pthread_mutex_lock(&(lockarray[type])); } else { pthread_mutex_unlock(&(lockarray[type])); } } static unsigned long thread_id(void) { unsigned long ret; ret=(unsigned long)pthread_self(); return(ret); } static void init_locks(void) { int i; lockarray=(pthread_mutex_t *)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t)); for (i=0; i<CRYPTO_num_locks(); i++) { pthread_mutex_init(&(lockarray[i]),NULL); } CRYPTO_set_id_callback((unsigned long (*)())thread_id); CRYPTO_set_locking_callback((void (*)())lock_callback); } static void kill_locks(void) { int i; CRYPTO_set_locking_callback(NULL); for (i=0; i<CRYPTO_num_locks(); i++) pthread_mutex_destroy(&(lockarray[i])); OPENSSL_free(lockarray); } #endif #ifdef USE_GNUTLS #include <gcrypt.h> #include <errno.h> GCRY_THREAD_OPTION_PTHREAD_IMPL; void init_locks(void) { gcry_control(GCRYCTL_SET_THREAD_CBS); } #define kill_locks() #endif /* List of URLs to fetch.*/ const char * const urls[]= { "https://www.example.com/", "https://www2.example.com/", "https://www3.example.com/", "https://www4.example.com/", }; static void *pull_one_url(void *url) { CURL *curl; curl = curl_easy_init(); curl_easy_setopt(curl, CURLOPT_URL, url); /* this example doesn't verify the server's certificate, which means we might be downloading stuff from an impostor */ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); curl_easy_perform(curl); /* ignores error */ curl_easy_cleanup(curl); return NULL; } int main(int argc, char **argv) { pthread_t tid[NUMT]; int i; int error; (void)argc; /* we don't use any arguments in this example */ (void)argv; /* Must initialize libcurl before any threads are started */ curl_global_init(CURL_GLOBAL_ALL); init_locks(); for(i=0; i< NUMT; i++) { error = pthread_create(&tid[i], NULL, /* default attributes please */ pull_one_url, (void *)urls[i]); if(0 != error) fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error); else fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]); } /* now wait for all threads to terminate */ for(i=0; i< NUMT; i++) { error = pthread_join(tid[i], NULL); fprintf(stderr, "Thread %d terminated\n", i); } kill_locks(); return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/imap-search.c�������������������������������������������������������������0000644�0001750�0001750�00000004431�12270035364�014603� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to search for new messages using * libcurl's IMAP capabilities. * * Note that this example requires libcurl 7.30.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This is mailbox folder to select */ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX"); /* Set the SEARCH command specifing what we want to search for. Note that * this can contain a message sequence set and a number of search criteria * keywords including flags such as ANSWERED, DELETED, DRAFT, FLAGGED, NEW, * RECENT and SEEN. For more information about the search criteria please * see RFC-3501 section 6.4.4. */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "SEARCH NEW"); /* Perform the custom request */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/http-post.c���������������������������������������������������������������0000644�0001750�0001750�00000003660�12213173003�014345� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; /* In windows, this will init the winsock stuff */ curl_global_init(CURL_GLOBAL_ALL); /* get a curl handle */ curl = curl_easy_init(); if(curl) { /* First set the URL that is about to receive our POST. This URL can just as well be a https:// URL if that is what should receive the data. */ curl_easy_setopt(curl, CURLOPT_URL, "http://postit.example.com/moo.cgi"); /* Now specify the POST data */ curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "name=daniel&project=curl"); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); } curl_global_cleanup(); return 0; } ��������������������������������������������������������������������������������curl-7.35.0/docs/examples/getinmemory.c�������������������������������������������������������������0000644�0001750�0001750�00000006374�12262353672�014767� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* Example source code to show how the callback function can be used to * download data into a chunk of memory instead of storing it in a file. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <curl/curl.h> struct MemoryStruct { char *memory; size_t size; }; static size_t WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp) { size_t realsize = size * nmemb; struct MemoryStruct *mem = (struct MemoryStruct *)userp; mem->memory = realloc(mem->memory, mem->size + realsize + 1); if(mem->memory == NULL) { /* out of memory! */ printf("not enough memory (realloc returned NULL)\n"); return 0; } memcpy(&(mem->memory[mem->size]), contents, realsize); mem->size += realsize; mem->memory[mem->size] = 0; return realsize; } int main(void) { CURL *curl_handle; CURLcode res; struct MemoryStruct chunk; chunk.memory = malloc(1); /* will be grown as needed by the realloc above */ chunk.size = 0; /* no data at this point */ curl_global_init(CURL_GLOBAL_ALL); /* init the curl session */ curl_handle = curl_easy_init(); /* specify URL to get */ curl_easy_setopt(curl_handle, CURLOPT_URL, "http://www.example.com/"); /* send all data to this function */ curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); /* we pass our 'chunk' struct to the callback function */ curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk); /* some servers don't like requests that are made without a user-agent field, so we provide one */ curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0"); /* get it! */ res = curl_easy_perform(curl_handle); /* check for errors */ if(res != CURLE_OK) { fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); } else { /* * Now, our chunk.memory points to a memory block that is chunk.size * bytes big and contains the remote file. * * Do something nice with it! */ printf("%lu bytes retrieved\n", (long)chunk.size); } /* cleanup curl stuff */ curl_easy_cleanup(curl_handle); if(chunk.memory) free(chunk.memory); /* we're done with libcurl, so clean it up */ curl_global_cleanup(); return 0; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/getinfo.c�����������������������������������������������������������������0000644�0001750�0001750�00000003546�12213173003�014041� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; /* http://curl.haxx.se/libcurl/c/curl_easy_init.html */ curl = curl_easy_init(); if(curl) { /* http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTURL */ curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/"); /* http://curl.haxx.se/libcurl/c/curl_easy_perform.html */ res = curl_easy_perform(curl); if(CURLE_OK == res) { char *ct; /* ask for the content-type */ /* http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */ res = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct); if((CURLE_OK == res) && ct) printf("We received Content-Type: %s\n", ct); } /* always cleanup */ /* http://curl.haxx.se/libcurl/c/curl_easy_cleanup.html */ curl_easy_cleanup(curl); } return 0; } ����������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/sessioninfo.c�������������������������������������������������������������0000644�0001750�0001750�00000005753�12262353672�014767� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* Note that this example currently requires cURL to be linked against GnuTLS (and this program must also be linked against -lgnutls). */ #include <stdio.h> #include <curl/curl.h> #include <gnutls/gnutls.h> static CURL *curl; static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream) { const struct curl_tlssessioninfo *info; unsigned int cert_list_size; const gnutls_datum_t *chainp; CURLcode res; (void)stream; (void)ptr; res = curl_easy_getinfo(curl, CURLINFO_TLS_SESSION, &info); if(!res) { switch(info->backend) { case CURLSSLBACKEND_GNUTLS: /* info->internals is now the gnutls_session_t */ chainp = gnutls_certificate_get_peers(info->internals, &cert_list_size); if((chainp) && (cert_list_size)) { unsigned int i; for(i = 0; i < cert_list_size; i++) { gnutls_x509_crt_t cert; gnutls_datum_t dn; if(GNUTLS_E_SUCCESS == gnutls_x509_crt_init(&cert)) { if(GNUTLS_E_SUCCESS == gnutls_x509_crt_import(cert, &chainp[i], GNUTLS_X509_FMT_DER)) { if(GNUTLS_E_SUCCESS == gnutls_x509_crt_print(cert, GNUTLS_CRT_PRINT_FULL, &dn)) { fprintf(stderr, "Certificate #%d: %.*s", i, dn.size, dn.data); gnutls_free(dn.data); } } gnutls_x509_crt_deinit(cert); } } } break; case CURLSSLBACKEND_NONE: default: break; } } return size * nmemb; } int main(void) { curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, wrfu); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L); (void) curl_easy_perform(curl); curl_easy_cleanup(curl); } curl_global_cleanup(); return 0; } ���������������������curl-7.35.0/docs/examples/multi-post.c��������������������������������������������������������������0000644�0001750�0001750�00000011016�12213173003�014512� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* This is an example application source code using the multi interface * to do a multipart formpost without "blocking". */ #include <stdio.h> #include <string.h> #include <sys/time.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLM *multi_handle; int still_running; struct curl_httppost *formpost=NULL; struct curl_httppost *lastptr=NULL; struct curl_slist *headerlist=NULL; static const char buf[] = "Expect:"; /* Fill in the file upload field. This makes libcurl load data from the given file name when curl_easy_perform() is called. */ curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "sendfile", CURLFORM_FILE, "postit2.c", CURLFORM_END); /* Fill in the filename field */ curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "filename", CURLFORM_COPYCONTENTS, "postit2.c", CURLFORM_END); /* Fill in the submit field too, even if this is rarely needed */ curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "submit", CURLFORM_COPYCONTENTS, "send", CURLFORM_END); curl = curl_easy_init(); multi_handle = curl_multi_init(); /* initalize custom header list (stating that Expect: 100-continue is not wanted */ headerlist = curl_slist_append(headerlist, buf); if(curl && multi_handle) { /* what URL that receives this POST */ curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/upload.cgi"); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); curl_multi_add_handle(multi_handle, curl); curl_multi_perform(multi_handle, &still_running); do { struct timeval timeout; int rc; /* select() return code */ fd_set fdread; fd_set fdwrite; fd_set fdexcep; int maxfd = -1; long curl_timeo = -1; FD_ZERO(&fdread); FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); /* set a suitable timeout to play around with */ timeout.tv_sec = 1; timeout.tv_usec = 0; curl_multi_timeout(multi_handle, &curl_timeo); if(curl_timeo >= 0) { timeout.tv_sec = curl_timeo / 1000; if(timeout.tv_sec > 1) timeout.tv_sec = 1; else timeout.tv_usec = (curl_timeo % 1000) * 1000; } /* get file descriptors from the transfers */ curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd); /* In a real-world program you OF COURSE check the return code of the function calls. On success, the value of maxfd is guaranteed to be greater or equal than -1. We call select(maxfd + 1, ...), specially in case of (maxfd == -1), we call select(0, ...), which is basically equal to sleep. */ rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout); switch(rc) { case -1: /* select error */ break; case 0: default: /* timeout or readable/writable sockets */ printf("perform!\n"); curl_multi_perform(multi_handle, &still_running); printf("running: %d!\n", still_running); break; } } while(still_running); curl_multi_cleanup(multi_handle); /* always cleanup */ curl_easy_cleanup(curl); /* then cleanup the formpost chain */ curl_formfree(formpost); /* free slist */ curl_slist_free_all (headerlist); } return 0; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/ftp-wildcard.c������������������������������������������������������������0000644�0001750�0001750�00000010167�12213173003�014763� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <curl/curl.h> #include <stdio.h> struct callback_data { FILE *output; }; static long file_is_comming(struct curl_fileinfo *finfo, struct callback_data *data, int remains); static long file_is_downloaded(struct callback_data *data); static size_t write_it(char *buff, size_t size, size_t nmemb, void *cb_data); int main(int argc, char **argv) { int rc = CURLE_OK; /* curl easy handle */ CURL *handle; /* help data */ struct callback_data data = { 0 }; /* global initialization */ rc = curl_global_init(CURL_GLOBAL_ALL); if(rc) return rc; /* initialization of easy handle */ handle = curl_easy_init(); if(!handle) { curl_global_cleanup(); return CURLE_OUT_OF_MEMORY; } /* turn on wildcard matching */ curl_easy_setopt(handle, CURLOPT_WILDCARDMATCH, 1L); /* callback is called before download of concrete file started */ curl_easy_setopt(handle, CURLOPT_CHUNK_BGN_FUNCTION, file_is_comming); /* callback is called after data from the file have been transferred */ curl_easy_setopt(handle, CURLOPT_CHUNK_END_FUNCTION, file_is_downloaded); /* this callback will write contents into files */ curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, write_it); /* put transfer data into callbacks */ curl_easy_setopt(handle, CURLOPT_CHUNK_DATA, &data); curl_easy_setopt(handle, CURLOPT_WRITEDATA, &data); /* curl_easy_setopt(handle, CURLOPT_VERBOSE, 1L); */ /* set an URL containing wildcard pattern (only in the last part) */ if(argc == 2) curl_easy_setopt(handle, CURLOPT_URL, argv[1]); else curl_easy_setopt(handle, CURLOPT_URL, "ftp://example.com/test/*"); /* and start transfer! */ rc = curl_easy_perform(handle); curl_easy_cleanup(handle); curl_global_cleanup(); return rc; } static long file_is_comming(struct curl_fileinfo *finfo, struct callback_data *data, int remains) { printf("%3d %40s %10luB ", remains, finfo->filename, (unsigned long)finfo->size); switch(finfo->filetype) { case CURLFILETYPE_DIRECTORY: printf(" DIR\n"); break; case CURLFILETYPE_FILE: printf("FILE "); break; default: printf("OTHER\n"); break; } if(finfo->filetype == CURLFILETYPE_FILE) { /* do not transfer files >= 50B */ if(finfo->size > 50) { printf("SKIPPED\n"); return CURL_CHUNK_BGN_FUNC_SKIP; } data->output = fopen(finfo->filename, "w"); if(!data->output) { return CURL_CHUNK_BGN_FUNC_FAIL; } } return CURL_CHUNK_BGN_FUNC_OK; } static long file_is_downloaded(struct callback_data *data) { if(data->output) { printf("DOWNLOADED\n"); fclose(data->output); data->output = 0x0; } return CURL_CHUNK_END_FUNC_OK; } static size_t write_it(char *buff, size_t size, size_t nmemb, void *cb_data) { struct callback_data *data = cb_data; size_t written = 0; if(data->output) written = fwrite(buff, size, nmemb, data->output); else /* listing output */ written = fwrite(buff, size, nmemb, stdout); return written; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/pop3-tls.c����������������������������������������������������������������0000644�0001750�0001750�00000006645�12270035364�014104� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to retrieve mail using libcurl's POP3 * capabilities. It builds on the pop3-retr.c example adding transport * security to protect the authentication details from being snooped. * * Note that this example requires libcurl 7.20.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This will retreive message 1 from the user's mailbox */ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com/1"); /* In this example, we'll start with a plain text connection, and upgrade * to Transport Layer Security (TLS) using the STLS command. Be careful of * using CURLUSESSL_TRY here, because if TLS upgrade fails, the transfer * will continue anyway - see the security discussion in the libcurl * tutorial for more details. */ curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL); /* If your server doesn't have a valid certificate, then you can disable * part of the Transport Layer Security protection by setting the * CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST options to 0 (false). * curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); * curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); * That is, in general, a bad idea. It is still better than sending your * authentication details in plain text though. * Instead, you should get the issuer certificate (or the host certificate * if the certificate is self-signed) and add it to the set of certificates * that are known to libcurl using CURLOPT_CAINFO and/or CURLOPT_CAPATH. See * docs/SSLCERTS for more information. */ curl_easy_setopt(curl, CURLOPT_CAINFO, "/path/to/certificate.pem"); /* Since the traffic will be encrypted, it is very useful to turn on debug * information within libcurl to see what is happening during the * transfer */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* Perform the retr */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } �������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/ftpupload.c���������������������������������������������������������������0000644�0001750�0001750�00000011054�12213173003�014375� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <string.h> #include <curl/curl.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <errno.h> #ifdef WIN32 #include <io.h> #else #include <unistd.h> #endif /* * This example shows an FTP upload, with a rename of the file just after * a successful upload. * * Example based on source code provided by Erick Nuwendam. Thanks! */ #define LOCAL_FILE "/tmp/uploadthis.txt" #define UPLOAD_FILE_AS "while-uploading.txt" #define REMOTE_URL "ftp://example.com/" UPLOAD_FILE_AS #define RENAME_FILE_TO "renamed-and-fine.txt" /* NOTE: if you want this example to work on Windows with libcurl as a DLL, you MUST also provide a read callback with CURLOPT_READFUNCTION. Failing to do so will give you a crash since a DLL may not use the variable's memory when passed in to it from an app like this. */ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream) { curl_off_t nread; /* in real-world cases, this would probably get this data differently as this fread() stuff is exactly what the library already would do by default internally */ size_t retcode = fread(ptr, size, nmemb, stream); nread = (curl_off_t)retcode; fprintf(stderr, "*** We read %" CURL_FORMAT_CURL_OFF_T " bytes from file\n", nread); return retcode; } int main(void) { CURL *curl; CURLcode res; FILE *hd_src; struct stat file_info; curl_off_t fsize; struct curl_slist *headerlist=NULL; static const char buf_1 [] = "RNFR " UPLOAD_FILE_AS; static const char buf_2 [] = "RNTO " RENAME_FILE_TO; /* get the file size of the local file */ if(stat(LOCAL_FILE, &file_info)) { printf("Couldnt open '%s': %s\n", LOCAL_FILE, strerror(errno)); return 1; } fsize = (curl_off_t)file_info.st_size; printf("Local file size: %" CURL_FORMAT_CURL_OFF_T " bytes.\n", fsize); /* get a FILE * of the same file */ hd_src = fopen(LOCAL_FILE, "rb"); /* In windows, this will init the winsock stuff */ curl_global_init(CURL_GLOBAL_ALL); /* get a curl handle */ curl = curl_easy_init(); if(curl) { /* build a list of commands to pass to libcurl */ headerlist = curl_slist_append(headerlist, buf_1); headerlist = curl_slist_append(headerlist, buf_2); /* we want to use our own read function */ curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); /* enable uploading */ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* specify target */ curl_easy_setopt(curl,CURLOPT_URL, REMOTE_URL); /* pass in that last of FTP commands to run after the transfer */ curl_easy_setopt(curl, CURLOPT_POSTQUOTE, headerlist); /* now specify which file to upload */ curl_easy_setopt(curl, CURLOPT_READDATA, hd_src); /* Set the size of the file to upload (optional). If you give a *_LARGE option you MUST make sure that the type of the passed-in argument is a curl_off_t. If you use CURLOPT_INFILESIZE (without _LARGE) you must make sure that to pass in a type 'long' argument. */ curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)fsize); /* Now run off and do what you've been told! */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* clean up the FTP commands list */ curl_slist_free_all (headerlist); /* always cleanup */ curl_easy_cleanup(curl); } fclose(hd_src); /* close the local file */ curl_global_cleanup(); return 0; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/smtp-tls.c����������������������������������������������������������������0000644�0001750�0001750�00000014157�12270035364�014203� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <string.h> #include <curl/curl.h> /* This is a simple example showing how to send mail using libcurl's SMTP * capabilities. It builds on the smtp-mail.c example to add authentication * and, more importantly, transport security to protect the authentication * details from being snooped. * * Note that this example requires libcurl 7.20.0 or above. */ #define FROM "<sender@example.org>" #define TO "<addressee@example.net>" #define CC "<info@example.org>" static const char *payload_text[] = { "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n", "To: " TO "\r\n", "From: " FROM "(Example User)\r\n", "Cc: " CC "(Another example User)\r\n", "Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\r\n", "Subject: SMTP TLS example message\r\n", "\r\n", /* empty line to divide headers from body, see RFC5322 */ "The body of the message starts here.\r\n", "\r\n", "It could be a lot of lines, could be MIME encoded, whatever.\r\n", "Check RFC5322.\r\n", NULL }; struct upload_status { int lines_read; }; static size_t payload_source(void *ptr, size_t size, size_t nmemb, void *userp) { struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { return 0; } data = payload_text[upload_ctx->lines_read]; if(data) { size_t len = strlen(data); memcpy(ptr, data, len); upload_ctx->lines_read++; return len; } return 0; } int main(void) { CURL *curl; CURLcode res = CURLE_OK; struct curl_slist *recipients = NULL; struct upload_status upload_ctx; upload_ctx.lines_read = 0; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This is the URL for your mailserver. Note the use of port 587 here, * instead of the normal SMTP port (25). Port 587 is commonly used for * secure mail submission (see RFC4403), but you should use whatever * matches your server configuration. */ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mainserver.example.net:587"); /* In this example, we'll start with a plain text connection, and upgrade * to Transport Layer Security (TLS) using the STARTTLS command. Be careful * of using CURLUSESSL_TRY here, because if TLS upgrade fails, the transfer * will continue anyway - see the security discussion in the libcurl * tutorial for more details. */ curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL); /* If your server doesn't have a valid certificate, then you can disable * part of the Transport Layer Security protection by setting the * CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST options to 0 (false). * curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); * curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); * That is, in general, a bad idea. It is still better than sending your * authentication details in plain text though. * Instead, you should get the issuer certificate (or the host certificate * if the certificate is self-signed) and add it to the set of certificates * that are known to libcurl using CURLOPT_CAINFO and/or CURLOPT_CAPATH. See * docs/SSLCERTS for more information. */ curl_easy_setopt(curl, CURLOPT_CAINFO, "/path/to/certificate.pem"); /* Note that this option isn't strictly required, omitting it will result in * libcurl sending the MAIL FROM command with empty sender data. All * autoresponses should have an empty reverse-path, and should be directed * to the address in the reverse-path which triggered them. Otherwise, they * could cause an endless loop. See RFC 5321 Section 4.5.5 for more details. */ curl_easy_setopt(curl, CURLOPT_MAIL_FROM, FROM); /* Add two recipients, in this particular case they correspond to the * To: and Cc: addressees in the header, but they could be any kind of * recipient. */ recipients = curl_slist_append(recipients, TO); recipients = curl_slist_append(recipients, CC); curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients); /* We're using a callback function to specify the payload (the headers and * body of the message). You could just use the CURLOPT_READDATA option to * specify a FILE pointer to read from. */ curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source); curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* Since the traffic will be encrypted, it is very useful to turn on debug * information within libcurl to see what is happening during the transfer. */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* Send the message */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Free the list of recipients */ curl_slist_free_all(recipients); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/https.c�������������������������������������������������������������������0000644�0001750�0001750�00000004766�12213173003�013555� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); #ifdef SKIP_PEER_VERIFICATION /* * If you want to connect to a site who isn't using a certificate that is * signed by one of the certs in the CA bundle you have, you can skip the * verification of the server's certificate. This makes the connection * A LOT LESS SECURE. * * If you have a CA cert for the server stored someplace else than in the * default bundle, then the CURLOPT_CAPATH option might come handy for * you. */ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); #endif #ifdef SKIP_HOSTNAME_VERIFICATION /* * If the site you're connecting to uses a different host name that what * they have mentioned in their server certificate's commonName (or * subjectAltName) fields, libcurl will refuse to connect. You can skip * this check, but this will make the connection less secure. */ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); #endif /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); } curl_global_cleanup(); return 0; } ����������curl-7.35.0/docs/examples/resolve.c�����������������������������������������������������������������0000644�0001750�0001750�00000003421�12213173003�014055� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res = CURLE_OK; struct curl_slist *host = NULL; /* Each single name resolve string should be written using the format HOST:PORT:ADDRESS where HOST is the name libcurl will try to resolve, PORT is the port number of the service where libcurl wants to connect to the HOST and ADDRESS is the numerical IP address */ host = curl_slist_append(NULL, "example.com:80:127.0.0.1"); curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_RESOLVE, host); curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); res = curl_easy_perform(curl); /* always cleanup */ curl_easy_cleanup(curl); } curl_slist_free_all(host); return (int)res; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/imap-tls.c����������������������������������������������������������������0000644�0001750�0001750�00000006657�12270035364�014154� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to fetch mail using libcurl's IMAP * capabilities. It builds on the imap-fetch.c example adding transport * security to protect the authentication details from being snooped. * * Note that this example requires libcurl 7.30.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This will fetch message 1 from the user's inbox */ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX/;UID=1"); /* In this example, we'll start with a plain text connection, and upgrade * to Transport Layer Security (TLS) using the STARTTLS command. Be careful * of using CURLUSESSL_TRY here, because if TLS upgrade fails, the transfer * will continue anyway - see the security discussion in the libcurl * tutorial for more details. */ curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL); /* If your server doesn't have a valid certificate, then you can disable * part of the Transport Layer Security protection by setting the * CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST options to 0 (false). * curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); * curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); * That is, in general, a bad idea. It is still better than sending your * authentication details in plain text though. * Instead, you should get the issuer certificate (or the host certificate * if the certificate is self-signed) and add it to the set of certificates * that are known to libcurl using CURLOPT_CAINFO and/or CURLOPT_CAPATH. See * docs/SSLCERTS for more information. */ curl_easy_setopt(curl, CURLOPT_CAINFO, "/path/to/certificate.pem"); /* Since the traffic will be encrypted, it is very useful to turn on debug * information within libcurl to see what is happening during the * transfer */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* Perform the fetch */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } ���������������������������������������������������������������������������������curl-7.35.0/docs/examples/simple.c������������������������������������������������������������������0000644�0001750�0001750�00000003207�12213173003�013671� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* example.com is redirected, so we tell libcurl to follow redirection */ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); } return 0; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/multi-uv.c����������������������������������������������������������������0000644�0001750�0001750�00000013137�12213173003�014165� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* Example application code using the multi socket interface to download multiple files at once, but instead of using curl_multi_perform and curl_multi_wait, which uses select(), we use libuv. It supports epoll, kqueue, etc. on unixes and fast IO completion ports on Windows, which means, it should be very fast on all platforms.. Written by Clemens Gruber, based on an outdated example from uvbook and some tests from libuv. Requires libuv and (of course) libcurl. See http://nikhilm.github.com/uvbook/ for more information on libuv. */ #include <stdio.h> #include <stdlib.h> #include <uv.h> #include <curl/curl.h> uv_loop_t *loop; CURLM *curl_handle; uv_timer_t timeout; typedef struct curl_context_s { uv_poll_t poll_handle; curl_socket_t sockfd; } curl_context_t; curl_context_t* create_curl_context(curl_socket_t sockfd) { curl_context_t *context; context = (curl_context_t *) malloc(sizeof *context); context->sockfd = sockfd; uv_poll_init_socket(loop, &context->poll_handle, sockfd); context->poll_handle.data = context; return context; } void curl_close_cb(uv_handle_t *handle) { curl_context_t* context = (curl_context_t*) handle->data; free(context); } void destroy_curl_context(curl_context_t *context) { uv_close((uv_handle_t*) &context->poll_handle, curl_close_cb); } void add_download(const char *url, int num) { char filename[50]; FILE *file; CURL *handle; sprintf(filename, "%d.download", num); file = fopen(filename, "w"); if (file == NULL) { fprintf(stderr, "Error opening %s\n", filename); return; } handle = curl_easy_init(); curl_easy_setopt(handle, CURLOPT_WRITEDATA, file); curl_easy_setopt(handle, CURLOPT_URL, url); curl_multi_add_handle(curl_handle, handle); fprintf(stderr, "Added download %s -> %s\n", url, filename); } void curl_perform(uv_poll_t *req, int status, int events) { int running_handles; int flags = 0; curl_context_t *context; char *done_url; CURLMsg *message; int pending; uv_timer_stop(&timeout); if (events & UV_READABLE) flags |= CURL_CSELECT_IN; if (events & UV_WRITABLE) flags |= CURL_CSELECT_OUT; context = (curl_context_t*)req; curl_multi_socket_action(curl_handle, context->sockfd, flags, &running_handles); while ((message = curl_multi_info_read(curl_handle, &pending))) { switch (message->msg) { case CURLMSG_DONE: curl_easy_getinfo(message->easy_handle, CURLINFO_EFFECTIVE_URL, &done_url); printf("%s DONE\n", done_url); curl_multi_remove_handle(curl_handle, message->easy_handle); curl_easy_cleanup(message->easy_handle); break; default: fprintf(stderr, "CURLMSG default\n"); abort(); } } } void on_timeout(uv_timer_t *req, int status) { int running_handles; curl_multi_socket_action(curl_handle, CURL_SOCKET_TIMEOUT, 0, &running_handles); } void start_timeout(CURLM *multi, long timeout_ms, void *userp) { if (timeout_ms <= 0) timeout_ms = 1; /* 0 means directly call socket_action, but we'll do it in a bit */ uv_timer_start(&timeout, on_timeout, timeout_ms, 0); } int handle_socket(CURL *easy, curl_socket_t s, int action, void *userp, void *socketp) { curl_context_t *curl_context; if (action == CURL_POLL_IN || action == CURL_POLL_OUT) { if (socketp) { curl_context = (curl_context_t*) socketp; } else { curl_context = create_curl_context(s); } curl_multi_assign(curl_handle, s, (void *) curl_context); } switch (action) { case CURL_POLL_IN: uv_poll_start(&curl_context->poll_handle, UV_READABLE, curl_perform); break; case CURL_POLL_OUT: uv_poll_start(&curl_context->poll_handle, UV_WRITABLE, curl_perform); break; case CURL_POLL_REMOVE: if (socketp) { uv_poll_stop(&((curl_context_t*)socketp)->poll_handle); destroy_curl_context((curl_context_t*) socketp); curl_multi_assign(curl_handle, s, NULL); } break; default: abort(); } return 0; } int main(int argc, char **argv) { loop = uv_default_loop(); if (argc <= 1) return 0; if (curl_global_init(CURL_GLOBAL_ALL)) { fprintf(stderr, "Could not init cURL\n"); return 1; } uv_timer_init(loop, &timeout); curl_handle = curl_multi_init(); curl_multi_setopt(curl_handle, CURLMOPT_SOCKETFUNCTION, handle_socket); curl_multi_setopt(curl_handle, CURLMOPT_TIMERFUNCTION, start_timeout); while (argc-- > 1) { add_download(argv[argc], argc); } uv_run(loop, UV_RUN_DEFAULT); curl_multi_cleanup(curl_handle); return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/httpcustomheader.c��������������������������������������������������������0000644�0001750�0001750�00000004026�12213173003�015763� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { struct curl_slist *chunk = NULL; chunk = curl_slist_append(chunk, "Accept: moo"); chunk = curl_slist_append(chunk, "Another: yes"); /* request with the built-in Accept: */ curl_easy_setopt(curl, CURLOPT_URL, "localhost"); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* redo request with our own custom Accept: */ res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk); res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); /* free the custom headers */ curl_slist_free_all(chunk); } return 0; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/imap-fetch.c��������������������������������������������������������������0000644�0001750�0001750�00000003564�12270035364�014435� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to fetch mail using libcurl's IMAP * capabilities. * * Note that this example requires libcurl 7.30.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This will fetch message 1 from the user's inbox */ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX/;UID=1"); /* Perform the fetch */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } ��������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/pop3-multi.c��������������������������������������������������������������0000644�0001750�0001750�00000010141�12270035364�014416� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to retrieve mail using libcurl's POP3 * capabilities. It builds on the pop3-retr.c example to demonstrate how to use * libcurl's multi interface. * * Note that this example requires libcurl 7.20.0 or above. */ #define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000 static struct timeval tvnow(void) { struct timeval now; /* time() returns the value of time in seconds since the epoch */ now.tv_sec = (long)time(NULL); now.tv_usec = 0; return now; } static long tvdiff(struct timeval newer, struct timeval older) { return (newer.tv_sec - older.tv_sec) * 1000 + (newer.tv_usec - older.tv_usec) / 1000; } int main(void) { CURL *curl; CURLM *mcurl; int still_running = 1; struct timeval mp_start; curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(!curl) return 1; mcurl = curl_multi_init(); if(!mcurl) return 2; /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This will retreive message 1 from the user's mailbox */ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com/1"); /* Tell the multi stack about our easy handle */ curl_multi_add_handle(mcurl, curl); /* Record the start time which we can use later */ mp_start = tvnow(); /* We start some action by calling perform right away */ curl_multi_perform(mcurl, &still_running); while(still_running) { struct timeval timeout; fd_set fdread; fd_set fdwrite; fd_set fdexcep; int maxfd = -1; int rc; long curl_timeo = -1; /* Initialise the file descriptors */ FD_ZERO(&fdread); FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); /* Set a suitable timeout to play around with */ timeout.tv_sec = 1; timeout.tv_usec = 0; curl_multi_timeout(mcurl, &curl_timeo); if(curl_timeo >= 0) { timeout.tv_sec = curl_timeo / 1000; if(timeout.tv_sec > 1) timeout.tv_sec = 1; else timeout.tv_usec = (curl_timeo % 1000) * 1000; } /* Get file descriptors from the transfers */ curl_multi_fdset(mcurl, &fdread, &fdwrite, &fdexcep, &maxfd); /* In a real-world program you OF COURSE check the return code of the function calls. On success, the value of maxfd is guaranteed to be greater or equal than -1. We call select(maxfd + 1, ...), specially in case of (maxfd == -1), we call select(0, ...), which is basically equal to sleep. */ rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout); if(tvdiff(tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) { fprintf(stderr, "ABORTING: Since it seems that we would have run forever.\n"); break; } switch(rc) { case -1: /* select error */ break; case 0: /* timeout */ default: /* action */ curl_multi_perform(mcurl, &still_running); break; } } /* Always cleanup */ curl_multi_remove_handle(mcurl, curl); curl_multi_cleanup(mcurl); curl_easy_cleanup(curl); curl_global_cleanup(); return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/certinfo.c����������������������������������������������������������������0000644�0001750�0001750�00000004473�12213173003�014217� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream) { (void)stream; (void)ptr; return size * nmemb; } int main(void) { CURL *curl; CURLcode res; curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, wrfu); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L); curl_easy_setopt(curl, CURLOPT_CERTINFO, 1L); res = curl_easy_perform(curl); if(!res) { union { struct curl_slist *to_info; struct curl_certinfo *to_certinfo; } ptr; ptr.to_info = NULL; res = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ptr.to_info); if(!res && ptr.to_info) { int i; printf("%d certs!\n", ptr.to_certinfo->num_of_certs); for(i = 0; i < ptr.to_certinfo->num_of_certs; i++) { struct curl_slist *slist; for(slist = ptr.to_certinfo->certinfo[i]; slist; slist = slist->next) printf("%s\n", slist->data); } } } curl_easy_cleanup(curl); } curl_global_cleanup(); return 0; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/htmltitle.cpp�������������������������������������������������������������0000644�0001750�0001750�00000014233�12213173003�014747� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ // Get a web page, parse it with libxml. // // Written by Lars Nilsson // // GNU C++ compile command line suggestion (edit paths accordingly): // // g++ -Wall -I/opt/curl/include -I/opt/libxml/include/libxml2 htmltitle.cpp \ // -o htmltitle -L/opt/curl/lib -L/opt/libxml/lib -lcurl -lxml2 #include <stdio.h> #include <string.h> #include <stdlib.h> #include <string> #include <curl/curl.h> #include <libxml/HTMLparser.h> // // Case-insensitive string comparison // #ifdef _MSC_VER #define COMPARE(a, b) (!stricmp((a), (b))) #else #define COMPARE(a, b) (!strcasecmp((a), (b))) #endif // // libxml callback context structure // struct Context { Context(): addTitle(false) { } bool addTitle; std::string title; }; // // libcurl variables for error strings and returned data static char errorBuffer[CURL_ERROR_SIZE]; static std::string buffer; // // libcurl write callback function // static int writer(char *data, size_t size, size_t nmemb, std::string *writerData) { if (writerData == NULL) return 0; writerData->append(data, size*nmemb); return size * nmemb; } // // libcurl connection initialization // static bool init(CURL *&conn, char *url) { CURLcode code; conn = curl_easy_init(); if (conn == NULL) { fprintf(stderr, "Failed to create CURL connection\n"); exit(EXIT_FAILURE); } code = curl_easy_setopt(conn, CURLOPT_ERRORBUFFER, errorBuffer); if (code != CURLE_OK) { fprintf(stderr, "Failed to set error buffer [%d]\n", code); return false; } code = curl_easy_setopt(conn, CURLOPT_URL, url); if (code != CURLE_OK) { fprintf(stderr, "Failed to set URL [%s]\n", errorBuffer); return false; } code = curl_easy_setopt(conn, CURLOPT_FOLLOWLOCATION, 1L); if (code != CURLE_OK) { fprintf(stderr, "Failed to set redirect option [%s]\n", errorBuffer); return false; } code = curl_easy_setopt(conn, CURLOPT_WRITEFUNCTION, writer); if (code != CURLE_OK) { fprintf(stderr, "Failed to set writer [%s]\n", errorBuffer); return false; } code = curl_easy_setopt(conn, CURLOPT_WRITEDATA, &buffer); if (code != CURLE_OK) { fprintf(stderr, "Failed to set write data [%s]\n", errorBuffer); return false; } return true; } // // libxml start element callback function // static void StartElement(void *voidContext, const xmlChar *name, const xmlChar **attributes) { Context *context = (Context *)voidContext; if (COMPARE((char *)name, "TITLE")) { context->title = ""; context->addTitle = true; } (void) attributes; } // // libxml end element callback function // static void EndElement(void *voidContext, const xmlChar *name) { Context *context = (Context *)voidContext; if (COMPARE((char *)name, "TITLE")) context->addTitle = false; } // // Text handling helper function // static void handleCharacters(Context *context, const xmlChar *chars, int length) { if (context->addTitle) context->title.append((char *)chars, length); } // // libxml PCDATA callback function // static void Characters(void *voidContext, const xmlChar *chars, int length) { Context *context = (Context *)voidContext; handleCharacters(context, chars, length); } // // libxml CDATA callback function // static void cdata(void *voidContext, const xmlChar *chars, int length) { Context *context = (Context *)voidContext; handleCharacters(context, chars, length); } // // libxml SAX callback structure // static htmlSAXHandler saxHandler = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, StartElement, EndElement, NULL, Characters, NULL, NULL, NULL, NULL, NULL, NULL, NULL, cdata, NULL }; // // Parse given (assumed to be) HTML text and return the title // static void parseHtml(const std::string &html, std::string &title) { htmlParserCtxtPtr ctxt; Context context; ctxt = htmlCreatePushParserCtxt(&saxHandler, &context, "", 0, "", XML_CHAR_ENCODING_NONE); htmlParseChunk(ctxt, html.c_str(), html.size(), 0); htmlParseChunk(ctxt, "", 0, 1); htmlFreeParserCtxt(ctxt); title = context.title; } int main(int argc, char *argv[]) { CURL *conn = NULL; CURLcode code; std::string title; // Ensure one argument is given if (argc != 2) { fprintf(stderr, "Usage: %s <url>\n", argv[0]); exit(EXIT_FAILURE); } curl_global_init(CURL_GLOBAL_DEFAULT); // Initialize CURL connection if (!init(conn, argv[1])) { fprintf(stderr, "Connection initializion failed\n"); exit(EXIT_FAILURE); } // Retrieve content for the URL code = curl_easy_perform(conn); curl_easy_cleanup(conn); if (code != CURLE_OK) { fprintf(stderr, "Failed to get '%s' [%s]\n", argv[1], errorBuffer); exit(EXIT_FAILURE); } // Parse the (assumed) HTML code parseHtml(buffer, title); // Display the extracted title printf("Title: %s\n", title.c_str()); return EXIT_SUCCESS; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/simplessl.c���������������������������������������������������������������0000644�0001750�0001750�00000010734�12213173003�014416� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* some requirements for this to work: 1. set pCertFile to the file with the client certificate 2. if the key is passphrase protected, set pPassphrase to the passphrase you use 3. if you are using a crypto engine: 3.1. set a #define USE_ENGINE 3.2. set pEngine to the name of the crypto engine you use 3.3. set pKeyName to the key identifier you want to use 4. if you don't use a crypto engine: 4.1. set pKeyName to the file name of your client key 4.2. if the format of the key file is DER, set pKeyType to "DER" !! verify of the server certificate is not implemented here !! **** This example only works with libcurl 7.9.3 and later! **** */ int main(void) { int i; CURL *curl; CURLcode res; FILE *headerfile; const char *pPassphrase = NULL; static const char *pCertFile = "testcert.pem"; static const char *pCACertFile="cacert.pem"; const char *pKeyName; const char *pKeyType; const char *pEngine; #ifdef USE_ENGINE pKeyName = "rsa_test"; pKeyType = "ENG"; pEngine = "chil"; /* for nChiper HSM... */ #else pKeyName = "testkey.pem"; pKeyType = "PEM"; pEngine = NULL; #endif headerfile = fopen("dumpit", "w"); curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(curl) { /* what call to write: */ curl_easy_setopt(curl, CURLOPT_URL, "HTTPS://your.favourite.ssl.site"); curl_easy_setopt(curl, CURLOPT_WRITEHEADER, headerfile); for(i = 0; i < 1; i++) /* single-iteration loop, just to break out from */ { if (pEngine) /* use crypto engine */ { if (curl_easy_setopt(curl, CURLOPT_SSLENGINE,pEngine) != CURLE_OK) { /* load the crypto engine */ fprintf(stderr,"can't set crypto engine\n"); break; } if (curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT,1L) != CURLE_OK) { /* set the crypto engine as default */ /* only needed for the first time you load a engine in a curl object... */ fprintf(stderr,"can't set crypto engine as default\n"); break; } } /* cert is stored PEM coded in file... */ /* since PEM is default, we needn't set it for PEM */ curl_easy_setopt(curl,CURLOPT_SSLCERTTYPE,"PEM"); /* set the cert for client authentication */ curl_easy_setopt(curl,CURLOPT_SSLCERT,pCertFile); /* sorry, for engine we must set the passphrase (if the key has one...) */ if (pPassphrase) curl_easy_setopt(curl,CURLOPT_KEYPASSWD,pPassphrase); /* if we use a key stored in a crypto engine, we must set the key type to "ENG" */ curl_easy_setopt(curl,CURLOPT_SSLKEYTYPE,pKeyType); /* set the private key (file or ID in engine) */ curl_easy_setopt(curl,CURLOPT_SSLKEY,pKeyName); /* set the file with the certs vaildating the server */ curl_easy_setopt(curl,CURLOPT_CAINFO,pCACertFile); /* disconnect if we can't validate server's cert */ curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,1L); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* we are done... */ } /* always cleanup */ curl_easy_cleanup(curl); } curl_global_cleanup(); return 0; } ������������������������������������curl-7.35.0/docs/examples/ftpsget.c�����������������������������������������������������������������0000644�0001750�0001750�00000006140�12213173003�014053� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* * This is an example showing how to get a single file from an FTPS server. * It delays the actual destination file creation until the first write * callback so that it won't create an empty file in case the remote file * doesn't exist or something else fails. */ struct FtpFile { const char *filename; FILE *stream; }; static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) { struct FtpFile *out=(struct FtpFile *)stream; if(out && !out->stream) { /* open file for writing */ out->stream=fopen(out->filename, "wb"); if(!out->stream) return -1; /* failure, can't open file to write */ } return fwrite(buffer, size, nmemb, out->stream); } int main(void) { CURL *curl; CURLcode res; struct FtpFile ftpfile={ "yourfile.bin", /* name to store the file as if succesful */ NULL }; curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(curl) { /* * You better replace the URL with one that works! Note that we use an * FTP:// URL with standard explicit FTPS. You can also do FTPS:// URLs if * you want to do the rarer kind of transfers: implicit. */ curl_easy_setopt(curl, CURLOPT_URL, "ftp://user@server/home/user/file.txt"); /* Define our callback to get called when there's data to be written */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite); /* Set a pointer to our struct to pass to the callback */ curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile); /* We activate SSL and we require it for both control and data */ curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL); /* Switch on full protocol/debug output */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); res = curl_easy_perform(curl); /* always cleanup */ curl_easy_cleanup(curl); if(CURLE_OK != res) { /* we failed */ fprintf(stderr, "curl told us %d\n", res); } } if(ftpfile.stream) fclose(ftpfile.stream); /* close the local file */ curl_global_cleanup(); return 0; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/imap-examine.c������������������������������������������������������������0000644�0001750�0001750�00000004030�12270035364�014757� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to obtain information about a mailbox * folder using libcurl's IMAP capabilities via the EXAMINE command. * * Note that this example requires libcurl 7.30.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This is just the server URL */ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com"); /* Set the EXAMINE command specifing the mailbox folder */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "EXAMINE OUTBOX"); /* Perform the custom request */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/multithread.c�������������������������������������������������������������0000644�0001750�0001750�00000005126�12213173003�014724� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* A multi-threaded example that uses pthreads extensively to fetch * X remote files at once */ #include <stdio.h> #include <pthread.h> #include <curl/curl.h> #define NUMT 4 /* List of URLs to fetch. If you intend to use a SSL-based protocol here you MUST setup the OpenSSL callback functions as described here: http://www.openssl.org/docs/crypto/threads.html#DESCRIPTION */ const char * const urls[NUMT]= { "http://curl.haxx.se/", "ftp://cool.haxx.se/", "http://www.contactor.se/", "www.haxx.se" }; static void *pull_one_url(void *url) { CURL *curl; curl = curl_easy_init(); curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_perform(curl); /* ignores error */ curl_easy_cleanup(curl); return NULL; } /* int pthread_create(pthread_t *new_thread_ID, const pthread_attr_t *attr, void * (*start_func)(void *), void *arg); */ int main(int argc, char **argv) { pthread_t tid[NUMT]; int i; int error; /* Must initialize libcurl before any threads are started */ curl_global_init(CURL_GLOBAL_ALL); for(i=0; i< NUMT; i++) { error = pthread_create(&tid[i], NULL, /* default attributes please */ pull_one_url, (void *)urls[i]); if(0 != error) fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error); else fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]); } /* now wait for all threads to terminate */ for(i=0; i< NUMT; i++) { error = pthread_join(tid[i], NULL); fprintf(stderr, "Thread %d terminated\n", i); } return 0; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/multi-single.c������������������������������������������������������������0000644�0001750�0001750�00000006663�12213173003�015022� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* This is a very simple example using the multi interface. */ #include <stdio.h> #include <string.h> /* somewhat unix-specific */ #include <sys/time.h> #include <unistd.h> /* curl stuff */ #include <curl/curl.h> /* * Simply download a HTTP file. */ int main(void) { CURL *http_handle; CURLM *multi_handle; int still_running; /* keep number of running handles */ curl_global_init(CURL_GLOBAL_DEFAULT); http_handle = curl_easy_init(); /* set the options (I left out a few, you'll get the point anyway) */ curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/"); /* init a multi stack */ multi_handle = curl_multi_init(); /* add the individual transfers */ curl_multi_add_handle(multi_handle, http_handle); /* we start some action by calling perform right away */ curl_multi_perform(multi_handle, &still_running); do { struct timeval timeout; int rc; /* select() return code */ fd_set fdread; fd_set fdwrite; fd_set fdexcep; int maxfd = -1; long curl_timeo = -1; FD_ZERO(&fdread); FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); /* set a suitable timeout to play around with */ timeout.tv_sec = 1; timeout.tv_usec = 0; curl_multi_timeout(multi_handle, &curl_timeo); if(curl_timeo >= 0) { timeout.tv_sec = curl_timeo / 1000; if(timeout.tv_sec > 1) timeout.tv_sec = 1; else timeout.tv_usec = (curl_timeo % 1000) * 1000; } /* get file descriptors from the transfers */ curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd); /* In a real-world program you OF COURSE check the return code of the function calls. On success, the value of maxfd is guaranteed to be greater or equal than -1. We call select(maxfd + 1, ...), specially in case of (maxfd == -1), we call select(0, ...), which is basically equal to sleep. */ rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout); switch(rc) { case -1: /* select error */ still_running = 0; printf("select() returns error, this is badness\n"); break; case 0: default: /* timeout or readable/writable sockets */ curl_multi_perform(multi_handle, &still_running); break; } } while(still_running); curl_multi_remove_handle(multi_handle, http_handle); curl_easy_cleanup(http_handle); curl_multi_cleanup(multi_handle); curl_global_cleanup(); return 0; } �����������������������������������������������������������������������������curl-7.35.0/docs/examples/sftpget.c�����������������������������������������������������������������0000644�0001750�0001750�00000006310�12213173003�014052� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* define this to switch off the use of ssh-agent in this program */ #undef DISABLE_SSH_AGENT /* * This is an example showing how to get a single file from an SFTP server. * It delays the actual destination file creation until the first write * callback so that it won't create an empty file in case the remote file * doesn't exist or something else fails. */ struct FtpFile { const char *filename; FILE *stream; }; static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) { struct FtpFile *out=(struct FtpFile *)stream; if(out && !out->stream) { /* open file for writing */ out->stream=fopen(out->filename, "wb"); if(!out->stream) return -1; /* failure, can't open file to write */ } return fwrite(buffer, size, nmemb, out->stream); } int main(void) { CURL *curl; CURLcode res; struct FtpFile ftpfile={ "yourfile.bin", /* name to store the file as if succesful */ NULL }; curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(curl) { /* * You better replace the URL with one that works! */ curl_easy_setopt(curl, CURLOPT_URL, "sftp://user@server/home/user/file.txt"); /* Define our callback to get called when there's data to be written */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite); /* Set a pointer to our struct to pass to the callback */ curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile); #ifndef DISABLE_SSH_AGENT /* We activate ssh agent. For this to work you need to have ssh-agent running (type set | grep SSH_AGENT to check) or pageant on Windows (there is an icon in systray if so) */ curl_easy_setopt(curl, CURLOPT_SSH_AUTH_TYPES, CURLSSH_AUTH_AGENT); #endif /* Switch on full protocol/debug output */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); res = curl_easy_perform(curl); /* always cleanup */ curl_easy_cleanup(curl); if(CURLE_OK != res) { /* we failed */ fprintf(stderr, "curl told us %d\n", res); } } if(ftpfile.stream) fclose(ftpfile.stream); /* close the local file */ curl_global_cleanup(); return 0; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/imap-append.c�������������������������������������������������������������0000644�0001750�0001750�00000007037�12270035364�014612� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to send mail using libcurl's IMAP * capabilities. * * Note that this example requires libcurl 7.30.0 or above. */ #define FROM "<sender@example.org>" #define TO "<addressee@example.net>" #define CC "<info@example.org>" static const char *payload_text[] = { "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n", "To: " TO "\r\n", "From: " FROM "(Example User)\r\n", "Cc: " CC "(Another example User)\r\n", "Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\r\n", "Subject: IMAP example message\r\n", "\r\n", /* empty line to divide headers from body, see RFC5322 */ "The body of the message starts here.\r\n", "\r\n", "It could be a lot of lines, could be MIME encoded, whatever.\r\n", "Check RFC5322.\r\n", NULL }; struct upload_status { int lines_read; }; static size_t payload_source(void *ptr, size_t size, size_t nmemb, void *userp) { struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { return 0; } data = payload_text[upload_ctx->lines_read]; if(data) { size_t len = strlen(data); memcpy(ptr, data, len); upload_ctx->lines_read++; return len; } return 0; } int main(void) { CURL *curl; CURLcode res = CURLE_OK; struct upload_status upload_ctx; upload_ctx.lines_read = 0; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This will create a new message 100. Note that you should perform an * EXAMINE command to obtain the UID of the next message to create and a * SELECT to ensure you are creating the message in the OUTBOX. */ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/100"); /* In this case, we're using a callback function to specify the data. You * could just use the CURLOPT_READDATA option to specify a FILE pointer to * read from. */ curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source); curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* Perform the append */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/imap-noop.c���������������������������������������������������������������0000644�0001750�0001750�00000003673�12270035364�014320� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to perform a noop using libcurl's IMAP * capabilities. * * Note that this example requires libcurl 7.30.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This is just the server URL */ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com"); /* Set the NOOP command */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "NOOP"); /* Perform the custom request */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } ���������������������������������������������������������������������curl-7.35.0/docs/examples/postit2.c�����������������������������������������������������������������0000644�0001750�0001750�00000006742�12213173003�014013� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* Example code that uploads a file name 'foo' to a remote script that accepts * "HTML form based" (as described in RFC1738) uploads using HTTP POST. * * The imaginary form we'll fill in looks like: * * <form method="post" enctype="multipart/form-data" action="examplepost.cgi"> * Enter file: <input type="file" name="sendfile" size="40"> * Enter file name: <input type="text" name="filename" size="30"> * <input type="submit" value="send" name="submit"> * </form> * * This exact source code has not been verified to work. */ #include <stdio.h> #include <string.h> #include <curl/curl.h> int main(int argc, char *argv[]) { CURL *curl; CURLcode res; struct curl_httppost *formpost=NULL; struct curl_httppost *lastptr=NULL; struct curl_slist *headerlist=NULL; static const char buf[] = "Expect:"; curl_global_init(CURL_GLOBAL_ALL); /* Fill in the file upload field */ curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "sendfile", CURLFORM_FILE, "postit2.c", CURLFORM_END); /* Fill in the filename field */ curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "filename", CURLFORM_COPYCONTENTS, "postit2.c", CURLFORM_END); /* Fill in the submit field too, even if this is rarely needed */ curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "submit", CURLFORM_COPYCONTENTS, "send", CURLFORM_END); curl = curl_easy_init(); /* initalize custom header list (stating that Expect: 100-continue is not wanted */ headerlist = curl_slist_append(headerlist, buf); if(curl) { /* what URL that receives this POST */ curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/examplepost.cgi"); if ( (argc == 2) && (!strcmp(argv[1], "noexpectheader")) ) /* only disable 100-continue header if explicitly requested */ curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); /* then cleanup the formpost chain */ curl_formfree(formpost); /* free slist */ curl_slist_free_all (headerlist); } return 0; } ������������������������������curl-7.35.0/docs/examples/smtp-multi.c��������������������������������������������������������������0000644�0001750�0001750�00000014514�12270035364�014530� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <string.h> #include <curl/curl.h> /* This is an example showing how to send mail using libcurl's SMTP * capabilities. It builds on the smtp-mail.c example to demonstrate how to use * libcurl's multi interface. * * Note that this example requires libcurl 7.20.0 or above. */ #define FROM "<sender@example.com>" #define TO "<recipient@example.com>" #define CC "<info@example.com>" #define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000 static const char *payload_text[] = { "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n", "To: " TO "\r\n", "From: " FROM "(Example User)\r\n", "Cc: " CC "(Another example User)\r\n", "Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\r\n", "Subject: SMTP multi example message\r\n", "\r\n", /* empty line to divide headers from body, see RFC5322 */ "The body of the message starts here.\r\n", "\r\n", "It could be a lot of lines, could be MIME encoded, whatever.\r\n", "Check RFC5322.\r\n", NULL }; struct upload_status { int lines_read; }; static size_t payload_source(void *ptr, size_t size, size_t nmemb, void *userp) { struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { return 0; } data = payload_text[upload_ctx->lines_read]; if(data) { size_t len = strlen(data); memcpy(ptr, data, len); upload_ctx->lines_read++; return len; } return 0; } static struct timeval tvnow(void) { struct timeval now; /* time() returns the value of time in seconds since the epoch */ now.tv_sec = (long)time(NULL); now.tv_usec = 0; return now; } static long tvdiff(struct timeval newer, struct timeval older) { return (newer.tv_sec - older.tv_sec) * 1000 + (newer.tv_usec - older.tv_usec) / 1000; } int main(void) { CURL *curl; CURLM *mcurl; int still_running = 1; struct timeval mp_start; struct curl_slist *recipients = NULL; struct upload_status upload_ctx; upload_ctx.lines_read = 0; curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(!curl) return 1; mcurl = curl_multi_init(); if(!mcurl) return 2; /* This is the URL for your mailserver */ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com"); /* Note that this option isn't strictly required, omitting it will result in * libcurl sending the MAIL FROM command with empty sender data. All * autoresponses should have an empty reverse-path, and should be directed * to the address in the reverse-path which triggered them. Otherwise, they * could cause an endless loop. See RFC 5321 Section 4.5.5 for more details. */ curl_easy_setopt(curl, CURLOPT_MAIL_FROM, FROM); /* Add two recipients, in this particular case they correspond to the * To: and Cc: addressees in the header, but they could be any kind of * recipient. */ recipients = curl_slist_append(recipients, TO); recipients = curl_slist_append(recipients, CC); curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients); /* We're using a callback function to specify the payload (the headers and * body of the message). You could just use the CURLOPT_READDATA option to * specify a FILE pointer to read from. */ curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source); curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* Tell the multi stack about our easy handle */ curl_multi_add_handle(mcurl, curl); /* Record the start time which we can use later */ mp_start = tvnow(); /* We start some action by calling perform right away */ curl_multi_perform(mcurl, &still_running); while(still_running) { struct timeval timeout; fd_set fdread; fd_set fdwrite; fd_set fdexcep; int maxfd = -1; int rc; long curl_timeo = -1; /* Initialise the file descriptors */ FD_ZERO(&fdread); FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); /* Set a suitable timeout to play around with */ timeout.tv_sec = 1; timeout.tv_usec = 0; curl_multi_timeout(mcurl, &curl_timeo); if(curl_timeo >= 0) { timeout.tv_sec = curl_timeo / 1000; if(timeout.tv_sec > 1) timeout.tv_sec = 1; else timeout.tv_usec = (curl_timeo % 1000) * 1000; } /* Get file descriptors from the transfers */ curl_multi_fdset(mcurl, &fdread, &fdwrite, &fdexcep, &maxfd); /* In a real-world program you OF COURSE check the return code of the function calls. On success, the value of maxfd is guaranteed to be greater or equal than -1. We call select(maxfd + 1, ...), specially in case of (maxfd == -1), we call select(0, ...), which is basically equal to sleep. */ rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout); if(tvdiff(tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) { fprintf(stderr, "ABORTING: Since it seems that we would have run forever.\n"); break; } switch(rc) { case -1: /* select error */ break; case 0: /* timeout */ default: /* action */ curl_multi_perform(mcurl, &still_running); break; } } /* Free the list of recipients */ curl_slist_free_all(recipients); /* Always cleanup */ curl_multi_remove_handle(mcurl, curl); curl_multi_cleanup(mcurl); curl_easy_cleanup(curl); curl_global_cleanup(); return 0; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/smtp-mail.c���������������������������������������������������������������0000644�0001750�0001750�00000011244�12270035364�014315� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <string.h> #include <curl/curl.h> /* This is a simple example showing how to send mail using libcurl's SMTP * capabilities. For an exmaple of using the multi interface please see * smtp-multi.c. * * Note that this example requires libcurl 7.20.0 or above. */ #define FROM "<sender@example.org>" #define TO "<addressee@example.net>" #define CC "<info@example.org>" static const char *payload_text[] = { "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n", "To: " TO "\r\n", "From: " FROM "(Example User)\r\n", "Cc: " CC "(Another example User)\r\n", "Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\r\n", "Subject: SMTP example message\r\n", "\r\n", /* empty line to divide headers from body, see RFC5322 */ "The body of the message starts here.\r\n", "\r\n", "It could be a lot of lines, could be MIME encoded, whatever.\r\n", "Check RFC5322.\r\n", NULL }; struct upload_status { int lines_read; }; static size_t payload_source(void *ptr, size_t size, size_t nmemb, void *userp) { struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { return 0; } data = payload_text[upload_ctx->lines_read]; if(data) { size_t len = strlen(data); memcpy(ptr, data, len); upload_ctx->lines_read++; return len; } return 0; } int main(void) { CURL *curl; CURLcode res = CURLE_OK; struct curl_slist *recipients = NULL; struct upload_status upload_ctx; upload_ctx.lines_read = 0; curl = curl_easy_init(); if(curl) { /* This is the URL for your mailserver */ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com"); /* Note that this option isn't strictly required, omitting it will result in * libcurl sending the MAIL FROM command with empty sender data. All * autoresponses should have an empty reverse-path, and should be directed * to the address in the reverse-path which triggered them. Otherwise, they * could cause an endless loop. See RFC 5321 Section 4.5.5 for more details. */ curl_easy_setopt(curl, CURLOPT_MAIL_FROM, FROM); /* Add two recipients, in this particular case they correspond to the * To: and Cc: addressees in the header, but they could be any kind of * recipient. */ recipients = curl_slist_append(recipients, TO); recipients = curl_slist_append(recipients, CC); curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients); /* We're using a callback function to specify the payload (the headers and * body of the message). You could just use the CURLOPT_READDATA option to * specify a FILE pointer to read from. */ curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source); curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* Send the message */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Free the list of recipients */ curl_slist_free_all(recipients); /* curl won't send the QUIT command until you call cleanup, so you should be * able to re-use this connection for additional messages (setting * CURLOPT_MAIL_FROM and CURLOPT_MAIL_RCPT as required, and calling * curl_easy_perform() again. It may not be a good idea to keep the * connection open for a very long time though (more than a few minutes may * result in the server timing out the connection), and you do want to clean * up in the end. */ curl_easy_cleanup(curl); } return (int)res; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/curlgtk.c�����������������������������������������������������������������0000644�0001750�0001750�00000005615�12213173003�014060� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/***************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * */ /* Copyright (c) 2000 David Odin (aka DindinX) for MandrakeSoft */ /* an attempt to use the curl library in concert with a gtk-threaded application */ #include <stdio.h> #include <gtk/gtk.h> #include <curl/curl.h> GtkWidget *Bar; size_t my_write_func(void *ptr, size_t size, size_t nmemb, FILE *stream) { return fwrite(ptr, size, nmemb, stream); } size_t my_read_func(void *ptr, size_t size, size_t nmemb, FILE *stream) { return fread(ptr, size, nmemb, stream); } int my_progress_func(GtkWidget *bar, double t, /* dltotal */ double d, /* dlnow */ double ultotal, double ulnow) { /* printf("%d / %d (%g %%)\n", d, t, d*100.0/t);*/ gdk_threads_enter(); gtk_progress_set_value(GTK_PROGRESS(bar), d*100.0/t); gdk_threads_leave(); return 0; } void *my_thread(void *ptr) { CURL *curl; CURLcode res; FILE *outfile; gchar *url = ptr; curl = curl_easy_init(); if(curl) { outfile = fopen("test.curl", "w"); curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_write_func); curl_easy_setopt(curl, CURLOPT_READFUNCTION, my_read_func); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, my_progress_func); curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, Bar); res = curl_easy_perform(curl); fclose(outfile); /* always cleanup */ curl_easy_cleanup(curl); } return NULL; } int main(int argc, char **argv) { GtkWidget *Window, *Frame, *Frame2; GtkAdjustment *adj; /* Must initialize libcurl before any threads are started */ curl_global_init(CURL_GLOBAL_ALL); /* Init thread */ g_thread_init(NULL); gtk_init(&argc, &argv); Window = gtk_window_new(GTK_WINDOW_TOPLEVEL); Frame = gtk_frame_new(NULL); gtk_frame_set_shadow_type(GTK_FRAME(Frame), GTK_SHADOW_OUT); gtk_container_add(GTK_CONTAINER(Window), Frame); Frame2 = gtk_frame_new(NULL); gtk_frame_set_shadow_type(GTK_FRAME(Frame2), GTK_SHADOW_IN); gtk_container_add(GTK_CONTAINER(Frame), Frame2); gtk_container_set_border_width(GTK_CONTAINER(Frame2), 5); adj = (GtkAdjustment*)gtk_adjustment_new(0, 0, 100, 0, 0, 0); Bar = gtk_progress_bar_new_with_adjustment(adj); gtk_container_add(GTK_CONTAINER(Frame2), Bar); gtk_widget_show_all(Window); if (!g_thread_create(&my_thread, argv[1], FALSE, NULL) != 0) g_warning("can't create the thread"); gdk_threads_enter(); gtk_main(); gdk_threads_leave(); return 0; } �������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/xmlstream.c���������������������������������������������������������������0000644�0001750�0001750�00000011525�12262353672�014436� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* Stream-parse a document using the streaming Expat parser. * Written by David Strauss * * Expat => http://www.libexpat.org/ * * gcc -Wall -I/usr/local/include xmlstream.c -lcurl -lexpat -o xmlstream * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <expat.h> #include <curl/curl.h> struct MemoryStruct { char *memory; size_t size; }; struct ParserStruct { int ok; size_t tags; size_t depth; struct MemoryStruct characters; }; static void startElement(void *userData, const XML_Char *name, const XML_Char **atts) { struct ParserStruct *state = (struct ParserStruct *) userData; state->tags++; state->depth++; /* Get a clean slate for reading in character data. */ free(state->characters.memory); state->characters.memory = NULL; state->characters.size = 0; } static void characterDataHandler(void *userData, const XML_Char *s, int len) { struct ParserStruct *state = (struct ParserStruct *) userData; struct MemoryStruct *mem = &state->characters; mem->memory = realloc(mem->memory, mem->size + len + 1); if(mem->memory == NULL) { /* Out of memory. */ fprintf(stderr, "Not enough memory (realloc returned NULL).\n"); state->ok = 0; return; } memcpy(&(mem->memory[mem->size]), s, len); mem->size += len; mem->memory[mem->size] = 0; } static void endElement(void *userData, const XML_Char *name) { struct ParserStruct *state = (struct ParserStruct *) userData; state->depth--; printf("%5lu %10lu %s\n", state->depth, state->characters.size, name); } static size_t parseStreamCallback(void *contents, size_t length, size_t nmemb, void *userp) { XML_Parser parser = (XML_Parser) userp; size_t real_size = length * nmemb; struct ParserStruct *state = (struct ParserStruct *) XML_GetUserData(parser); /* Only parse if we're not already in a failure state. */ if (state->ok && XML_Parse(parser, contents, real_size, 0) == 0) { int error_code = XML_GetErrorCode(parser); fprintf(stderr, "Parsing response buffer of length %lu failed with error code %d (%s).\n", real_size, error_code, XML_ErrorString(error_code)); state->ok = 0; } return real_size; } int main(void) { CURL *curl_handle; CURLcode res; XML_Parser parser; struct ParserStruct state; /* Initialize the state structure for parsing. */ memset(&state, 0, sizeof(struct ParserStruct)); state.ok = 1; /* Initialize a namespace-aware parser. */ parser = XML_ParserCreateNS(NULL, '\0'); XML_SetUserData(parser, &state); XML_SetElementHandler(parser, startElement, endElement); XML_SetCharacterDataHandler(parser, characterDataHandler); /* Initalize a libcurl handle. */ curl_global_init(CURL_GLOBAL_ALL ^ CURL_GLOBAL_SSL); curl_handle = curl_easy_init(); curl_easy_setopt(curl_handle, CURLOPT_URL, "http://www.w3schools.com/xml/simple.xml"); curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, parseStreamCallback); curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)parser); printf("Depth Characters Closing Tag\n"); /* Perform the request and any follow-up parsing. */ res = curl_easy_perform(curl_handle); if(res != CURLE_OK) { fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); } else if (state.ok) { /* Expat requires one final call to finalize parsing. */ if (XML_Parse(parser, NULL, 0, 1) == 0) { int error_code = XML_GetErrorCode(parser); fprintf(stderr, "Finalizing parsing failed with error code %d (%s).\n", error_code, XML_ErrorString(error_code)); } else { printf(" --------------\n"); printf(" %lu tags total\n", state.tags); } } /* Clean up. */ free(state.characters.memory); XML_ParserFree(parser); curl_easy_cleanup(curl_handle); curl_global_cleanup(); return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/asiohiper.cpp�������������������������������������������������������������0000644�0001750�0001750�00000031536�12213173003�014731� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* * file: asiohiper.cpp * Example program to demonstrate the use of multi socket interface * with boost::asio * * This program is in c++ and uses boost::asio instead of libevent/libev. * Requires boost::asio, boost::bind and boost::system * * This is an adaptation of libcurl's "hiperfifo.c" and "evhiperfifo.c" * sample programs. This example implements a subset of the functionality from * hiperfifo.c, for full functionality refer hiperfifo.c or evhiperfifo.c * * Written by Lijo Antony based on hiperfifo.c by Jeff Pohlmeyer * * When running, the program creates an easy handle for a URL and * uses the curl_multi API to fetch it. * * Note: * For the sake of simplicity, URL is hard coded to "www.google.com" * * This is purely a demo app, all retrieved data is simply discarded by the write * callback. */ #include <curl/curl.h> #include <boost/asio.hpp> #include <boost/bind.hpp> #define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */ /* boost::asio related objects * using global variables for simplicity */ boost::asio::io_service io_service; boost::asio::deadline_timer timer(io_service); std::map<curl_socket_t, boost::asio::ip::tcp::socket *> socket_map; /* Global information, common to all connections */ typedef struct _GlobalInfo { CURLM *multi; int still_running; } GlobalInfo; /* Information associated with a specific easy handle */ typedef struct _ConnInfo { CURL *easy; char *url; GlobalInfo *global; char error[CURL_ERROR_SIZE]; } ConnInfo; static void timer_cb(const boost::system::error_code & error, GlobalInfo *g); /* Update the event timer after curl_multi library calls */ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g) { fprintf(MSG_OUT, "\nmulti_timer_cb: timeout_ms %ld", timeout_ms); /* cancel running timer */ timer.cancel(); if ( timeout_ms > 0 ) { /* update timer */ timer.expires_from_now(boost::posix_time::millisec(timeout_ms)); timer.async_wait(boost::bind(&timer_cb, _1, g)); } else { /* call timeout function immediately */ boost::system::error_code error; /*success*/ timer_cb(error, g); } return 0; } /* Die if we get a bad CURLMcode somewhere */ static void mcode_or_die(const char *where, CURLMcode code) { if ( CURLM_OK != code ) { const char *s; switch ( code ) { case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break; case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break; case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break; case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break; case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break; case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break; case CURLM_LAST: s="CURLM_LAST"; break; default: s="CURLM_unknown"; break; case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET"; fprintf(MSG_OUT, "\nERROR: %s returns %s", where, s); /* ignore this error */ return; } fprintf(MSG_OUT, "\nERROR: %s returns %s", where, s); exit(code); } } /* Check for completed transfers, and remove their easy handles */ static void check_multi_info(GlobalInfo *g) { char *eff_url; CURLMsg *msg; int msgs_left; ConnInfo *conn; CURL *easy; CURLcode res; fprintf(MSG_OUT, "\nREMAINING: %d", g->still_running); while ((msg = curl_multi_info_read(g->multi, &msgs_left))) { if (msg->msg == CURLMSG_DONE) { easy = msg->easy_handle; res = msg->data.result; curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn); curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url); fprintf(MSG_OUT, "\nDONE: %s => (%d) %s", eff_url, res, conn->error); curl_multi_remove_handle(g->multi, easy); free(conn->url); curl_easy_cleanup(easy); free(conn); } } } /* Called by asio when there is an action on a socket */ static void event_cb(GlobalInfo * g, boost::asio::ip::tcp::socket * tcp_socket, int action) { fprintf(MSG_OUT, "\nevent_cb: action=%d", action); CURLMcode rc; rc = curl_multi_socket_action(g->multi, tcp_socket->native_handle(), action, &g->still_running); mcode_or_die("event_cb: curl_multi_socket_action", rc); check_multi_info(g); if ( g->still_running <= 0 ) { fprintf(MSG_OUT, "\nlast transfer done, kill timeout"); timer.cancel(); } } /* Called by asio when our timeout expires */ static void timer_cb(const boost::system::error_code & error, GlobalInfo *g) { if ( !error) { fprintf(MSG_OUT, "\ntimer_cb: "); CURLMcode rc; rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, &g->still_running); mcode_or_die("timer_cb: curl_multi_socket_action", rc); check_multi_info(g); } } /* Clean up any data */ static void remsock(int *f, GlobalInfo *g) { fprintf(MSG_OUT, "\nremsock: "); if ( f ) { free(f); } } static void setsock(int *fdp, curl_socket_t s, CURL*e, int act, GlobalInfo*g) { fprintf(MSG_OUT, "\nsetsock: socket=%d, act=%d, fdp=%p", s, act, fdp); std::map<curl_socket_t, boost::asio::ip::tcp::socket *>::iterator it = socket_map.find(s); if ( it == socket_map.end() ) { fprintf(MSG_OUT, "\nsocket %d is a c-ares socket, ignoring", s); return; } boost::asio::ip::tcp::socket * tcp_socket = it->second; *fdp = act; if ( act == CURL_POLL_IN ) { fprintf(MSG_OUT, "\nwatching for socket to become readable"); tcp_socket->async_read_some(boost::asio::null_buffers(), boost::bind(&event_cb, g, tcp_socket, act)); } else if ( act == CURL_POLL_OUT ) { fprintf(MSG_OUT, "\nwatching for socket to become writable"); tcp_socket->async_write_some(boost::asio::null_buffers(), boost::bind(&event_cb, g, tcp_socket, act)); } else if ( act == CURL_POLL_INOUT ) { fprintf(MSG_OUT, "\nwatching for socket to become readable & writable"); tcp_socket->async_read_some(boost::asio::null_buffers(), boost::bind(&event_cb, g, tcp_socket, act)); tcp_socket->async_write_some(boost::asio::null_buffers(), boost::bind(&event_cb, g, tcp_socket, act)); } } static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g) { int *fdp = (int *)calloc(sizeof(int), 1); /* fdp is used to store current action */ setsock(fdp, s, easy, action, g); curl_multi_assign(g->multi, s, fdp); } /* CURLMOPT_SOCKETFUNCTION */ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { fprintf(MSG_OUT, "\nsock_cb: socket=%d, what=%d, sockp=%p", s, what, sockp); GlobalInfo *g = (GlobalInfo*) cbp; int *actionp = (int*) sockp; const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE"}; fprintf(MSG_OUT, "\nsocket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); if ( what == CURL_POLL_REMOVE ) { fprintf(MSG_OUT, "\n"); remsock(actionp, g); } else { if ( !actionp ) { fprintf(MSG_OUT, "\nAdding data: %s", whatstr[what]); addsock(s, e, what, g); } else { fprintf(MSG_OUT, "\nChanging action from %s to %s", whatstr[*actionp], whatstr[what]); setsock(actionp, s, e, what, g); } } return 0; } /* CURLOPT_WRITEFUNCTION */ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) { size_t written = size * nmemb; char* pBuffer = (char*)malloc(written + 1); strncpy(pBuffer, (const char *)ptr, written); pBuffer [written] = '\0'; fprintf(MSG_OUT, "%s", pBuffer); free(pBuffer); return written; } /* CURLOPT_PROGRESSFUNCTION */ static int prog_cb (void *p, double dltotal, double dlnow, double ult, double uln) { ConnInfo *conn = (ConnInfo *)p; (void)ult; (void)uln; fprintf(MSG_OUT, "\nProgress: %s (%g/%g)", conn->url, dlnow, dltotal); fprintf(MSG_OUT, "\nProgress: %s (%g)", conn->url, ult); return 0; } /* CURLOPT_OPENSOCKETFUNCTION */ static curl_socket_t opensocket(void *clientp, curlsocktype purpose, struct curl_sockaddr *address) { fprintf(MSG_OUT, "\nopensocket :"); curl_socket_t sockfd = CURL_SOCKET_BAD; /* restrict to ipv4 */ if (purpose == CURLSOCKTYPE_IPCXN && address->family == AF_INET) { /* create a tcp socket object */ boost::asio::ip::tcp::socket *tcp_socket = new boost::asio::ip::tcp::socket(io_service); /* open it and get the native handle*/ boost::system::error_code ec; tcp_socket->open(boost::asio::ip::tcp::v4(), ec); if (ec) { //An error occurred std::cout << std::endl << "Couldn't open socket [" << ec << "][" << ec.message() << "]"; fprintf(MSG_OUT, "\nERROR: Returning CURL_SOCKET_BAD to signal error"); } else { sockfd = tcp_socket->native_handle(); fprintf(MSG_OUT, "\nOpened socket %d", sockfd); /* save it for monitoring */ socket_map.insert(std::pair<curl_socket_t, boost::asio::ip::tcp::socket *>(sockfd, tcp_socket)); } } return sockfd; } /* CURLOPT_CLOSESOCKETFUNCTION */ static int closesocket(void *clientp, curl_socket_t item) { fprintf(MSG_OUT, "\nclosesocket : %d", item); std::map<curl_socket_t, boost::asio::ip::tcp::socket *>::iterator it = socket_map.find(item); if ( it != socket_map.end() ) { delete it->second; socket_map.erase(it); } return 0; } /* Create a new easy handle, and add it to the global curl_multi */ static void new_conn(char *url, GlobalInfo *g ) { ConnInfo *conn; CURLMcode rc; conn = (ConnInfo *)calloc(1, sizeof(ConnInfo)); memset(conn, 0, sizeof(ConnInfo)); conn->error[0]='\0'; conn->easy = curl_easy_init(); if ( !conn->easy ) { fprintf(MSG_OUT, "\ncurl_easy_init() failed, exiting!"); exit(2); } conn->global = g; conn->url = strdup(url); curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url); curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn); curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 1L); curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error); curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn); curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, 1L); curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb); curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn); curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 3L); curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 10L); /* call this function to get a socket */ curl_easy_setopt(conn->easy, CURLOPT_OPENSOCKETFUNCTION, opensocket); /* call this function to close a socket */ curl_easy_setopt(conn->easy, CURLOPT_CLOSESOCKETFUNCTION, closesocket); fprintf(MSG_OUT, "\nAdding easy %p to multi %p (%s)", conn->easy, g->multi, url); rc = curl_multi_add_handle(g->multi, conn->easy); mcode_or_die("new_conn: curl_multi_add_handle", rc); /* note that the add_handle() will set a time-out to trigger very soon so that the necessary socket_action() call will be called by this app */ } int main(int argc, char **argv) { GlobalInfo g; CURLMcode rc; (void)argc; (void)argv; memset(&g, 0, sizeof(GlobalInfo)); g.multi = curl_multi_init(); curl_multi_setopt(g.multi, CURLMOPT_SOCKETFUNCTION, sock_cb); curl_multi_setopt(g.multi, CURLMOPT_SOCKETDATA, &g); curl_multi_setopt(g.multi, CURLMOPT_TIMERFUNCTION, multi_timer_cb); curl_multi_setopt(g.multi, CURLMOPT_TIMERDATA, &g); new_conn((char *)"www.google.com", &g); /* add a URL */ /* enter io_service run loop */ io_service.run(); curl_multi_cleanup(g.multi); fprintf(MSG_OUT, "\ndone.\n"); return 0; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/curlx.c�������������������������������������������������������������������0000644�0001750�0001750�00000037264�12213173003�013547� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* curlx.c Authors: Peter Sylvester, Jean-Paul Merlin This is a little program to demonstrate the usage of - an ssl initialisation callback setting a user key and trustbases coming from a pkcs12 file - using an ssl application callback to find a URI in the certificate presented during ssl session establishment. */ /* * Copyright (c) 2003 The OpenEvidence Project. 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, 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. * ==================================================================== * * 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). * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <curl/curl.h> #include <openssl/x509v3.h> #include <openssl/x509_vfy.h> #include <openssl/crypto.h> #include <openssl/lhash.h> #include <openssl/objects.h> #include <openssl/err.h> #include <openssl/evp.h> #include <openssl/x509.h> #include <openssl/pkcs12.h> #include <openssl/bio.h> #include <openssl/ssl.h> static const char *curlx_usage[]={ "usage: curlx args\n", " -p12 arg - tia file ", " -envpass arg - environement variable which content the tia private key password", " -out arg - output file (response)- default stdout", " -in arg - input file (request)- default stdin", " -connect arg - URL of the server for the connection ex: www.openevidence.org", " -mimetype arg - MIME type for data in ex : application/timestamp-query or application/dvcs -default application/timestamp-query", " -acceptmime arg - MIME type acceptable for the response ex : application/timestamp-response or application/dvcs -default none", " -accesstype arg - an Object identifier in an AIA/SIA method, e.g. AD_DVCS or ad_timestamping", NULL }; /* ./curlx -p12 psy.p12 -envpass XX -in request -verbose -accesstype AD_DVCS -mimetype application/dvcs -acceptmime application/dvcs -out response */ /* * We use this ZERO_NULL to avoid picky compiler warnings, * when assigning a NULL pointer to a function pointer var. */ #define ZERO_NULL 0 /* This is a context that we pass to all callbacks */ typedef struct sslctxparm_st { unsigned char * p12file ; const char * pst ; PKCS12 * p12 ; EVP_PKEY * pkey ; X509 * usercert ; STACK_OF(X509) * ca ; CURL * curl; BIO * errorbio; int accesstype ; int verbose; } sslctxparm; /* some helper function. */ static char *i2s_ASN1_IA5STRING( ASN1_IA5STRING *ia5) { char *tmp; if(!ia5 || !ia5->length) return NULL; tmp = OPENSSL_malloc(ia5->length + 1); memcpy(tmp, ia5->data, ia5->length); tmp[ia5->length] = 0; return tmp; } /* A conveniance routine to get an access URI. */ static unsigned char *my_get_ext(X509 * cert, const int type, int extensiontype) { int i; STACK_OF(ACCESS_DESCRIPTION) * accessinfo ; accessinfo = X509_get_ext_d2i(cert, extensiontype, NULL, NULL) ; if (!sk_ACCESS_DESCRIPTION_num(accessinfo)) return NULL; for (i = 0; i < sk_ACCESS_DESCRIPTION_num(accessinfo); i++) { ACCESS_DESCRIPTION * ad = sk_ACCESS_DESCRIPTION_value(accessinfo, i); if (OBJ_obj2nid(ad->method) == type) { if (ad->location->type == GEN_URI) { return i2s_ASN1_IA5STRING(ad->location->d.ia5); } return NULL; } } return NULL; } /* This is an application verification call back, it does not perform any addition verification but tries to find a URL in the presented certificat. If found, this will become the URL to be used in the POST. */ static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg) { sslctxparm * p = (sslctxparm *) arg; int ok; if (p->verbose > 2) BIO_printf(p->errorbio,"entering ssl_app_verify_callback\n"); if ((ok= X509_verify_cert(ctx)) && ctx->cert) { unsigned char * accessinfo ; if (p->verbose > 1) X509_print_ex(p->errorbio,ctx->cert,0,0); if (accessinfo = my_get_ext(ctx->cert,p->accesstype ,NID_sinfo_access)) { if (p->verbose) BIO_printf(p->errorbio,"Setting URL from SIA to: %s\n", accessinfo); curl_easy_setopt(p->curl, CURLOPT_URL,accessinfo); } else if (accessinfo = my_get_ext(ctx->cert,p->accesstype, NID_info_access)) { if (p->verbose) BIO_printf(p->errorbio,"Setting URL from AIA to: %s\n", accessinfo); curl_easy_setopt(p->curl, CURLOPT_URL,accessinfo); } } if (p->verbose > 2) BIO_printf(p->errorbio,"leaving ssl_app_verify_callback with %d\n", ok); return(ok); } /* This is an example of an curl SSL initialisation call back. The callback sets: - a private key and certificate - a trusted ca certificate - a preferred cipherlist - an application verification callback (the function above) */ static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm) { sslctxparm * p = (sslctxparm *) parm; SSL_CTX * ctx = (SSL_CTX *) sslctx ; if (!SSL_CTX_use_certificate(ctx,p->usercert)) { BIO_printf(p->errorbio, "SSL_CTX_use_certificate problem\n"); goto err; } if (!SSL_CTX_use_PrivateKey(ctx,p->pkey)) { BIO_printf(p->errorbio, "SSL_CTX_use_PrivateKey\n"); goto err; } if (!SSL_CTX_check_private_key(ctx)) { BIO_printf(p->errorbio, "SSL_CTX_check_private_key\n"); goto err; } SSL_CTX_set_quiet_shutdown(ctx,1); SSL_CTX_set_cipher_list(ctx,"RC4-MD5"); SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY); X509_STORE_add_cert(SSL_CTX_get_cert_store(ctx), sk_X509_value(p->ca, sk_X509_num(p->ca)-1)); SSL_CTX_set_verify_depth(ctx,2); SSL_CTX_set_verify(ctx,SSL_VERIFY_PEER,ZERO_NULL); SSL_CTX_set_cert_verify_callback(ctx, ssl_app_verify_callback, parm); return CURLE_OK ; err: ERR_print_errors(p->errorbio); return CURLE_SSL_CERTPROBLEM; } int main(int argc, char **argv) { BIO* in=NULL; BIO* out=NULL; char * outfile = NULL; char * infile = NULL ; int tabLength=100; char *binaryptr; char* mimetype; char* mimetypeaccept=NULL; char* contenttype; const char** pp; unsigned char* hostporturl = NULL; BIO * p12bio ; char **args = argv + 1; unsigned char * serverurl; sslctxparm p; char *response; CURLcode res; struct curl_slist * headers=NULL; int badarg=0; binaryptr = malloc(tabLength); p.verbose = 0; p.errorbio = BIO_new_fp (stderr, BIO_NOCLOSE); curl_global_init(CURL_GLOBAL_DEFAULT); /* we need some more for the P12 decoding */ OpenSSL_add_all_ciphers(); OpenSSL_add_all_digests(); ERR_load_crypto_strings(); while (*args && *args[0] == '-') { if (!strcmp (*args, "-in")) { if (args[1]) { infile=*(++args); } else badarg=1; } else if (!strcmp (*args, "-out")) { if (args[1]) { outfile=*(++args); } else badarg=1; } else if (!strcmp (*args, "-p12")) { if (args[1]) { p.p12file = *(++args); } else badarg=1; } else if (strcmp(*args,"-envpass") == 0) { if (args[1]) { p.pst = getenv(*(++args)); } else badarg=1; } else if (strcmp(*args,"-connect") == 0) { if (args[1]) { hostporturl = *(++args); } else badarg=1; } else if (strcmp(*args,"-mimetype") == 0) { if (args[1]) { mimetype = *(++args); } else badarg=1; } else if (strcmp(*args,"-acceptmime") == 0) { if (args[1]) { mimetypeaccept = *(++args); } else badarg=1; } else if (strcmp(*args,"-accesstype") == 0) { if (args[1]) { if ((p.accesstype = OBJ_obj2nid(OBJ_txt2obj(*++args,0))) == 0) badarg=1; } else badarg=1; } else if (strcmp(*args,"-verbose") == 0) { p.verbose++; } else badarg=1; args++; } if (mimetype==NULL || mimetypeaccept == NULL) badarg = 1; if (badarg) { for (pp=curlx_usage; (*pp != NULL); pp++) BIO_printf(p.errorbio,"%s\n",*pp); BIO_printf(p.errorbio,"\n"); goto err; } /* set input */ if ((in=BIO_new(BIO_s_file())) == NULL) { BIO_printf(p.errorbio, "Error setting input bio\n"); goto err; } else if (infile == NULL) BIO_set_fp(in,stdin,BIO_NOCLOSE|BIO_FP_TEXT); else if (BIO_read_filename(in,infile) <= 0) { BIO_printf(p.errorbio, "Error opening input file %s\n", infile); BIO_free(in); goto err; } /* set output */ if ((out=BIO_new(BIO_s_file())) == NULL) { BIO_printf(p.errorbio, "Error setting output bio.\n"); goto err; } else if (outfile == NULL) BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT); else if (BIO_write_filename(out,outfile) <= 0) { BIO_printf(p.errorbio, "Error opening output file %s\n", outfile); BIO_free(out); goto err; } p.errorbio = BIO_new_fp (stderr, BIO_NOCLOSE); if (!(p.curl = curl_easy_init())) { BIO_printf(p.errorbio, "Cannot init curl lib\n"); goto err; } if (!(p12bio = BIO_new_file(p.p12file , "rb"))) { BIO_printf(p.errorbio, "Error opening P12 file %s\n", p.p12file); goto err; } if (!(p.p12 = d2i_PKCS12_bio (p12bio, NULL))) { BIO_printf(p.errorbio, "Cannot decode P12 structure %s\n", p.p12file); goto err; } p.ca= NULL; if (!(PKCS12_parse (p.p12, p.pst, &(p.pkey), &(p.usercert), &(p.ca) ) )) { BIO_printf(p.errorbio,"Invalid P12 structure in %s\n", p.p12file); goto err; } if (sk_X509_num(p.ca) <= 0) { BIO_printf(p.errorbio,"No trustworthy CA given.%s\n", p.p12file); goto err; } if (p.verbose > 1) X509_print_ex(p.errorbio,p.usercert,0,0); /* determine URL to go */ if (hostporturl) { serverurl = malloc(9+strlen(hostporturl)); sprintf(serverurl,"https://%s",hostporturl); } else if (p.accesstype != 0) { /* see whether we can find an AIA or SIA for a given access type */ if (!(serverurl = my_get_ext(p.usercert,p.accesstype,NID_info_access))) { int j=0; BIO_printf(p.errorbio,"no service URL in user cert " "cherching in others certificats\n"); for (j=0;j<sk_X509_num(p.ca);j++) { if ((serverurl = my_get_ext(sk_X509_value(p.ca,j),p.accesstype, NID_info_access))) break; if ((serverurl = my_get_ext(sk_X509_value(p.ca,j),p.accesstype, NID_sinfo_access))) break; } } } if (!serverurl) { BIO_printf(p.errorbio, "no service URL in certificats," " check '-accesstype (AD_DVCS | ad_timestamping)'" " or use '-connect'\n"); goto err; } if (p.verbose) BIO_printf(p.errorbio, "Service URL: <%s>\n", serverurl); curl_easy_setopt(p.curl, CURLOPT_URL, serverurl); /* Now specify the POST binary data */ curl_easy_setopt(p.curl, CURLOPT_POSTFIELDS, binaryptr); curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,(long)tabLength); /* pass our list of custom made headers */ contenttype = malloc(15+strlen(mimetype)); sprintf(contenttype,"Content-type: %s",mimetype); headers = curl_slist_append(headers,contenttype); curl_easy_setopt(p.curl, CURLOPT_HTTPHEADER, headers); if (p.verbose) BIO_printf(p.errorbio, "Service URL: <%s>\n", serverurl); { FILE *outfp; BIO_get_fp(out,&outfp); curl_easy_setopt(p.curl, CURLOPT_WRITEDATA, outfp); } res = curl_easy_setopt(p.curl, CURLOPT_SSL_CTX_FUNCTION, sslctxfun) ; if (res != CURLE_OK) BIO_printf(p.errorbio,"%d %s=%d %d\n", __LINE__, "CURLOPT_SSL_CTX_FUNCTION",CURLOPT_SSL_CTX_FUNCTION,res); curl_easy_setopt(p.curl, CURLOPT_SSL_CTX_DATA, &p); { int lu; int i=0; while ((lu = BIO_read (in,&binaryptr[i],tabLength-i)) >0 ) { i+=lu; if (i== tabLength) { tabLength+=100; binaryptr=realloc(binaryptr,tabLength); /* should be more careful */ } } tabLength = i; } /* Now specify the POST binary data */ curl_easy_setopt(p.curl, CURLOPT_POSTFIELDS, binaryptr); curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,(long)tabLength); /* Perform the request, res will get the return code */ BIO_printf(p.errorbio,"%d %s %d\n", __LINE__, "curl_easy_perform", res = curl_easy_perform(p.curl)); { int result =curl_easy_getinfo(p.curl,CURLINFO_CONTENT_TYPE,&response); if( mimetypeaccept && p.verbose) if(!strcmp(mimetypeaccept,response)) BIO_printf(p.errorbio,"the response has a correct mimetype : %s\n", response); else BIO_printf(p.errorbio,"the reponse doesn\'t has an acceptable " "mime type, it is %s instead of %s\n", response,mimetypeaccept); } /*** code d'erreur si accept mime ***, egalement code return HTTP != 200 ***/ /* free the header list*/ curl_slist_free_all(headers); /* always cleanup */ curl_easy_cleanup(p.curl); BIO_free(in); BIO_free(out); return (EXIT_SUCCESS); err: BIO_printf(p.errorbio,"error"); exit(1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/pop3-top.c����������������������������������������������������������������0000644�0001750�0001750�00000003773�12270035364�014103� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to retrieve only the headers of a mail * using libcurl's POP3 capabilities. * * Note that this example requires libcurl 7.26.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This is just the server URL */ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com"); /* Set the TOP command for message 1 to only include the headers */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "TOP 1 0"); /* Perform the custom request */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } �����curl-7.35.0/docs/examples/smtp-ssl.c����������������������������������������������������������������0000644�0001750�0001750�00000013230�12270035364�014171� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <string.h> #include <curl/curl.h> /* This is a simple example showing how to send mail using libcurl's SMTP * capabilities. It builds on the smtp-mail.c example to add authentication * and, more importantly, transport security to protect the authentication * details from being snooped. * * Note that this example requires libcurl 7.20.0 or above. */ #define FROM "<sender@example.org>" #define TO "<addressee@example.net>" #define CC "<info@example.org>" static const char *payload_text[] = { "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n", "To: " TO "\r\n", "From: " FROM "(Example User)\r\n", "Cc: " CC "(Another example User)\r\n", "Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\r\n", "Subject: SMTP SSL example message\r\n", "\r\n", /* empty line to divide headers from body, see RFC5322 */ "The body of the message starts here.\r\n", "\r\n", "It could be a lot of lines, could be MIME encoded, whatever.\r\n", "Check RFC5322.\r\n", NULL }; struct upload_status { int lines_read; }; static size_t payload_source(void *ptr, size_t size, size_t nmemb, void *userp) { struct upload_status *upload_ctx = (struct upload_status *)userp; const char *data; if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) { return 0; } data = payload_text[upload_ctx->lines_read]; if(data) { size_t len = strlen(data); memcpy(ptr, data, len); upload_ctx->lines_read++; return len; } return 0; } int main(void) { CURL *curl; CURLcode res = CURLE_OK; struct curl_slist *recipients = NULL; struct upload_status upload_ctx; upload_ctx.lines_read = 0; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This is the URL for your mailserver. Note the use of smtps:// rather * than smtp:// to request a SSL based connection. */ curl_easy_setopt(curl, CURLOPT_URL, "smtps://mainserver.example.net"); /* If you want to connect to a site who isn't using a certificate that is * signed by one of the certs in the CA bundle you have, you can skip the * verification of the server's certificate. This makes the connection * A LOT LESS SECURE. * * If you have a CA cert for the server stored someplace else than in the * default bundle, then the CURLOPT_CAPATH option might come handy for * you. */ #ifdef SKIP_PEER_VERIFICATION curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); #endif /* If the site you're connecting to uses a different host name that what * they have mentioned in their server certificate's commonName (or * subjectAltName) fields, libcurl will refuse to connect. You can skip * this check, but this will make the connection less secure. */ #ifdef SKIP_HOSTNAME_VERFICATION curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); #endif /* Note that this option isn't strictly required, omitting it will result in * libcurl sending the MAIL FROM command with empty sender data. All * autoresponses should have an empty reverse-path, and should be directed * to the address in the reverse-path which triggered them. Otherwise, they * could cause an endless loop. See RFC 5321 Section 4.5.5 for more details. */ curl_easy_setopt(curl, CURLOPT_MAIL_FROM, FROM); /* Add two recipients, in this particular case they correspond to the * To: and Cc: addressees in the header, but they could be any kind of * recipient. */ recipients = curl_slist_append(recipients, TO); recipients = curl_slist_append(recipients, CC); curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients); /* We're using a callback function to specify the payload (the headers and * body of the message). You could just use the CURLOPT_READDATA option to * specify a FILE pointer to read from. */ curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source); curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* Since the traffic will be encrypted, it is very useful to turn on debug * information within libcurl to see what is happening during the * transfer */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* Send the message */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Free the list of recipients */ curl_slist_free_all(recipients); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/Makefile.m32��������������������������������������������������������������0000644�0001750�0001750�00000016345�12262353672�014323� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://curl.haxx.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is # furnished to do so, under the terms of the COPYING file. # # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # ########################################################################### # ## Makefile for building curl examples with MingW (GCC-3.2 or later) ## and optionally OpenSSL (0.9.8), libssh2 (1.3), zlib (1.2.5), librtmp (2.3) ## ## Usage: mingw32-make -f Makefile.m32 CFG=-feature1[-feature2][-feature3][...] ## Example: mingw32-make -f Makefile.m32 CFG=-zlib-ssl-spi-winidn ## ## Hint: you can also set environment vars to control the build, f.e.: ## set ZLIB_PATH=c:/zlib-1.2.8 ## set ZLIB=1 # ########################################################################### # Edit the path below to point to the base of your Zlib sources. ifndef ZLIB_PATH ZLIB_PATH = ../../../zlib-1.2.8 endif # Edit the path below to point to the base of your OpenSSL package. ifndef OPENSSL_PATH OPENSSL_PATH = ../../../openssl-0.9.8y endif # Edit the path below to point to the base of your LibSSH2 package. ifndef LIBSSH2_PATH LIBSSH2_PATH = ../../../libssh2-1.4.3 endif # Edit the path below to point to the base of your librtmp package. ifndef LIBRTMP_PATH LIBRTMP_PATH = ../../../librtmp-2.3 endif # Edit the path below to point to the base of your libidn package. ifndef LIBIDN_PATH LIBIDN_PATH = ../../../libidn-1.18 endif # Edit the path below to point to the base of your MS IDN package. # Microsoft Internationalized Domain Names (IDN) Mitigation APIs 1.1 # http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ad6158d7-ddba-416a-9109-07607425a815 ifndef WINIDN_PATH WINIDN_PATH = ../../../Microsoft IDN Mitigation APIs endif # Edit the path below to point to the base of your Novell LDAP NDK. ifndef LDAP_SDK LDAP_SDK = c:/novell/ndk/cldapsdk/win32 endif PROOT = ../.. # Edit the path below to point to the base of your c-ares package. ifndef LIBCARES_PATH LIBCARES_PATH = $(PROOT)/ares endif # Edit the var below to set to your architecture or set environment var. ifndef ARCH ARCH = w32 endif CC = $(CROSSPREFIX)gcc CFLAGS = -g -O2 -Wall CFLAGS += -fno-strict-aliasing ifeq ($(ARCH),w64) CFLAGS += -D_AMD64_ endif # comment LDFLAGS below to keep debug info LDFLAGS = -s RC = $(CROSSPREFIX)windres RCFLAGS = --include-dir=$(PROOT)/include -O COFF -i # Platform-dependent helper tool macros ifeq ($(findstring /sh,$(SHELL)),/sh) DEL = rm -f $1 RMDIR = rm -fr $1 MKDIR = mkdir -p $1 COPY = -cp -afv $1 $2 #COPYR = -cp -afr $1/* $2 COPYR = -rsync -aC $1/* $2 TOUCH = touch $1 CAT = cat ECHONL = echo "" DL = ' else ifeq "$(OS)" "Windows_NT" DEL = -del 2>NUL /q /f $(subst /,\,$1) RMDIR = -rd 2>NUL /q /s $(subst /,\,$1) else DEL = -del 2>NUL $(subst /,\,$1) RMDIR = -deltree 2>NUL /y $(subst /,\,$1) endif MKDIR = -md 2>NUL $(subst /,\,$1) COPY = -copy 2>NUL /y $(subst /,\,$1) $(subst /,\,$2) COPYR = -xcopy 2>NUL /q /y /e $(subst /,\,$1) $(subst /,\,$2) TOUCH = copy 2>&1>NUL /b $(subst /,\,$1) +,, CAT = type ECHONL = $(ComSpec) /c echo. endif ######################################################## ## Nothing more to do below this line! ifeq ($(findstring -dyn,$(CFG)),-dyn) DYN = 1 endif ifeq ($(findstring -ares,$(CFG)),-ares) ARES = 1 endif ifeq ($(findstring -rtmp,$(CFG)),-rtmp) RTMP = 1 SSL = 1 ZLIB = 1 endif ifeq ($(findstring -ssh2,$(CFG)),-ssh2) SSH2 = 1 SSL = 1 ZLIB = 1 endif ifeq ($(findstring -ssl,$(CFG)),-ssl) SSL = 1 endif ifeq ($(findstring -zlib,$(CFG)),-zlib) ZLIB = 1 endif ifeq ($(findstring -idn,$(CFG)),-idn) IDN = 1 endif ifeq ($(findstring -winidn,$(CFG)),-winidn) WINIDN = 1 endif ifeq ($(findstring -sspi,$(CFG)),-sspi) SSPI = 1 endif ifeq ($(findstring -spnego,$(CFG)),-spnego) SPNEGO = 1 endif ifeq ($(findstring -ldaps,$(CFG)),-ldaps) LDAPS = 1 endif ifeq ($(findstring -ipv6,$(CFG)),-ipv6) IPV6 = 1 endif ifeq ($(findstring -metalink,$(CFG)),-metalink) METALINK = 1 endif ifeq ($(findstring -winssl,$(CFG)),-winssl) SCHANNEL = 1 SSPI = 1 endif INCLUDES = -I. -I$(PROOT) -I$(PROOT)/include -I$(PROOT)/lib ifdef DYN curl_DEPENDENCIES = $(PROOT)/lib/libcurldll.a $(PROOT)/lib/libcurl.dll curl_LDADD = -L$(PROOT)/lib -lcurldll else curl_DEPENDENCIES = $(PROOT)/lib/libcurl.a curl_LDADD = -L$(PROOT)/lib -lcurl CFLAGS += -DCURL_STATICLIB LDFLAGS += -static endif ifdef ARES ifndef DYN curl_DEPENDENCIES += $(LIBCARES_PATH)/libcares.a endif CFLAGS += -DUSE_ARES curl_LDADD += -L"$(LIBCARES_PATH)" -lcares endif ifdef RTMP CFLAGS += -DUSE_LIBRTMP curl_LDADD += -L"$(LIBRTMP_PATH)/librtmp" -lrtmp -lwinmm endif ifdef SSH2 CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H curl_LDADD += -L"$(LIBSSH2_PATH)/win32" -lssh2 endif ifdef SSL ifndef OPENSSL_LIBPATH OPENSSL_LIBS = -lssl -lcrypto ifeq "$(wildcard $(OPENSSL_PATH)/out)" "$(OPENSSL_PATH)/out" OPENSSL_LIBPATH = $(OPENSSL_PATH)/out ifdef DYN OPENSSL_LIBS = -lssl32 -leay32 endif endif ifeq "$(wildcard $(OPENSSL_PATH)/lib)" "$(OPENSSL_PATH)/lib" OPENSSL_LIBPATH = $(OPENSSL_PATH)/lib endif endif ifndef DYN OPENSSL_LIBS += -lgdi32 -lcrypt32 endif CFLAGS += -DUSE_SSLEAY curl_LDADD += -L"$(OPENSSL_LIBPATH)" $(OPENSSL_LIBS) endif ifdef ZLIB INCLUDES += -I"$(ZLIB_PATH)" CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H curl_LDADD += -L"$(ZLIB_PATH)" -lz endif ifdef IDN CFLAGS += -DUSE_LIBIDN curl_LDADD += -L"$(LIBIDN_PATH)/lib" -lidn else ifdef WINIDN CFLAGS += -DUSE_WIN32_IDN curl_LDADD += -L"$(WINIDN_PATH)" -lnormaliz endif endif ifdef SSPI CFLAGS += -DUSE_WINDOWS_SSPI ifdef SCHANNEL CFLAGS += -DUSE_SCHANNEL endif endif ifdef SPNEGO CFLAGS += -DHAVE_SPNEGO endif ifdef IPV6 CFLAGS += -DENABLE_IPV6 -D_WIN32_WINNT=0x0501 endif ifdef LDAPS CFLAGS += -DHAVE_LDAP_SSL endif ifdef USE_LDAP_NOVELL CFLAGS += -DCURL_HAS_NOVELL_LDAPSDK curl_LDADD += -L"$(LDAP_SDK)/lib/mscvc" -lldapsdk -lldapssl -lldapx endif ifdef USE_LDAP_OPENLDAP CFLAGS += -DCURL_HAS_OPENLDAP_LDAPSDK curl_LDADD += -L"$(LDAP_SDK)/lib" -lldap -llber endif ifndef USE_LDAP_NOVELL ifndef USE_LDAP_OPENLDAP curl_LDADD += -lwldap32 endif endif curl_LDADD += -lws2_32 # Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines include Makefile.inc check_PROGRAMS := $(patsubst %,%.exe,$(strip $(check_PROGRAMS))) check_PROGRAMS += ftpuploadresume.exe synctime.exe .PRECIOUS: %.o all: $(check_PROGRAMS) %.exe: %.o $(curl_DEPENDENCIES) $(CC) $(LDFLAGS) -o $@ $< $(curl_LDADD) %.o: %.c $(CC) $(INCLUDES) $(CFLAGS) -c $< %.res: %.rc $(RC) $(RCFLAGS) $< -o $@ clean: @$(call DEL, $(check_PROGRAMS:.exe=.o)) distclean vclean: clean @$(call DEL, $(check_PROGRAMS)) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/smtp-vrfy.c���������������������������������������������������������������0000644�0001750�0001750�00000005051�12270035364�014360� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <string.h> #include <curl/curl.h> /* This is a simple example showing how to verify an email address from an * SMTP server. * * Notes: * * 1) This example requires libcurl 7.34.0 or above. * 2) Not all email servers support this command and even if your email server * does support it, it may respond with a 252 response code even though the * address doesn't exist. */ int main(void) { CURL *curl; CURLcode res; struct curl_slist *recipients = NULL; curl = curl_easy_init(); if(curl) { /* This is the URL for your mailserver */ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com"); /* Note that the CURLOPT_MAIL_RCPT takes a list, not a char array */ recipients = curl_slist_append(recipients, "<recipient@example.com>"); curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients); /* Perform the VRFY */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Free the list of recipients */ curl_slist_free_all(recipients); /* Curl won't send the QUIT command until you call cleanup, so you should * be able to re-use this connection for additional requests. It may not be * a good idea to keep the connection open for a very long time though * (more than a few minutes may result in the server timing out the * connection) and you do want to clean up in the end. */ curl_easy_cleanup(curl); } return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/anyauthput.c��������������������������������������������������������������0000644�0001750�0001750�00000011765�12213173003�014612� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <fcntl.h> #ifdef WIN32 # include <io.h> #else # ifdef __VMS typedef int intptr_t; # endif # if !defined(_AIX) && !defined(__sgi) && !defined(__osf__) # include <stdint.h> # endif # include <unistd.h> #endif #include <sys/types.h> #include <sys/stat.h> #ifdef _MSC_VER # ifdef _WIN64 typedef __int64 intptr_t; # else typedef int intptr_t; # endif #endif #include <curl/curl.h> #if LIBCURL_VERSION_NUM < 0x070c03 #error "upgrade your libcurl to no less than 7.12.3" #endif #ifndef TRUE #define TRUE 1 #endif #if defined(_AIX) || defined(__sgi) || defined(__osf__) #ifndef intptr_t #define intptr_t long #endif #endif /* * This example shows a HTTP PUT operation with authentiction using "any" * type. It PUTs a file given as a command line argument to the URL also given * on the command line. * * Since libcurl 7.12.3, using "any" auth and POST/PUT requires a set ioctl * function. * * This example also uses its own read callback. */ /* ioctl callback function */ static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp) { intptr_t fd = (intptr_t)userp; (void)handle; /* not used in here */ switch(cmd) { case CURLIOCMD_RESTARTREAD: /* mr libcurl kindly asks as to rewind the read data stream to start */ if(-1 == lseek(fd, 0, SEEK_SET)) /* couldn't rewind */ return CURLIOE_FAILRESTART; break; default: /* ignore unknown commands */ return CURLIOE_UNKNOWNCMD; } return CURLIOE_OK; /* success! */ } /* read callback function, fread() look alike */ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream) { size_t retcode; curl_off_t nread; intptr_t fd = (intptr_t)stream; retcode = read(fd, ptr, size * nmemb); nread = (curl_off_t)retcode; fprintf(stderr, "*** We read %" CURL_FORMAT_CURL_OFF_T " bytes from file\n", nread); return retcode; } int main(int argc, char **argv) { CURL *curl; CURLcode res; intptr_t hd ; struct stat file_info; char *file; char *url; if(argc < 3) return 1; file= argv[1]; url = argv[2]; /* get the file size of the local file */ hd = open(file, O_RDONLY) ; fstat(hd, &file_info); /* In windows, this will init the winsock stuff */ curl_global_init(CURL_GLOBAL_ALL); /* get a curl handle */ curl = curl_easy_init(); if(curl) { /* we want to use our own read function */ curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); /* which file to upload */ curl_easy_setopt(curl, CURLOPT_READDATA, (void*)hd); /* set the ioctl function */ curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, my_ioctl); /* pass the file descriptor to the ioctl callback as well */ curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)hd); /* enable "uploading" (which means PUT when doing HTTP) */ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L) ; /* specify target URL, and note that this URL should also include a file name, not only a directory (as you can do with GTP uploads) */ curl_easy_setopt(curl,CURLOPT_URL, url); /* and give the size of the upload, this supports large file sizes on systems that have general support for it */ curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)file_info.st_size); /* tell libcurl we can use "any" auth, which lets the lib pick one, but it also costs one extra round-trip and possibly sending of all the PUT data twice!!! */ curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY); /* set user name and password for the authentication */ curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password"); /* Now run off and do what you've been told! */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); } close(hd); /* close the local file */ curl_global_cleanup(); return 0; } �����������curl-7.35.0/docs/examples/Makefile.netware����������������������������������������������������������0000644�0001750�0001750�00000025735�12262353672�015372� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������################################################################# # ## Makefile for building curl.nlm (NetWare version - gnu make) ## Use: make -f Makefile.netware ## ## Comments to: Guenter Knauf http://www.gknw.net/phpbb # ################################################################# # Edit the path below to point to the base of your Novell NDK. ifndef NDKBASE NDKBASE = c:/novell endif # Edit the path below to point to the base of your Zlib sources. ifndef ZLIB_PATH ZLIB_PATH = ../../../zlib-1.2.8 endif # Edit the path below to point to the base of your OpenSSL package. ifndef OPENSSL_PATH OPENSSL_PATH = ../../../openssl-0.9.8y endif # Edit the path below to point to the base of your LibSSH2 package. ifndef LIBSSH2_PATH LIBSSH2_PATH = ../../../libssh2-1.4.3 endif # Edit the path below to point to the base of your axTLS package. ifndef AXTLS_PATH AXTLS_PATH = ../../../axTLS-1.2.7 endif # Edit the path below to point to the base of your libidn package. ifndef LIBIDN_PATH LIBIDN_PATH = ../../../libidn-1.18 endif # Edit the path below to point to the base of your librtmp package. ifndef LIBRTMP_PATH LIBRTMP_PATH = ../../../librtmp-2.3 endif # Edit the path below to point to the base of your fbopenssl package. ifndef FBOPENSSL_PATH FBOPENSSL_PATH = ../../fbopenssl-0.4 endif # Edit the path below to point to the base of your c-ares package. ifndef LIBCARES_PATH LIBCARES_PATH = ../../ares endif ifndef INSTDIR INSTDIR = ..$(DS)..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw endif # Edit the vars below to change NLM target settings. TARGET = examples VERSION = $(LIBCURL_VERSION) COPYR = Copyright (C) $(LIBCURL_COPYRIGHT_STR) DESCR = cURL ($(LIBARCH)) MTSAFE = YES STACK = 8192 SCREEN = Example Program # Comment the line below if you dont want to load protected automatically. # LDRING = 3 # Uncomment the next line to enable linking with POSIX semantics. # POSIXFL = 1 # Edit the var below to point to your lib architecture. ifndef LIBARCH LIBARCH = LIBC endif # must be equal to NDEBUG or DEBUG, CURLDEBUG ifndef DB DB = NDEBUG endif # Optimization: -O<n> or debugging: -g ifeq ($(DB),NDEBUG) OPT = -O2 OBJDIR = release else OPT = -g OBJDIR = debug endif # The following lines defines your compiler. ifdef CWFolder METROWERKS = $(CWFolder) endif ifdef METROWERKS # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support CC = mwccnlm else CC = gcc endif PERL = perl # Here you can find a native Win32 binary of the original awk: # http://www.gknw.net/development/prgtools/awk-20100523.zip AWK = awk CP = cp -afv MKDIR = mkdir # RM = rm -f # If you want to mark the target as MTSAFE you will need a tool for # generating the xdc data for the linker; here's a minimal tool: # http://www.gknw.net/development/prgtools/mkxdc.zip MPKXDC = mkxdc # LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH)) LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH)) # Include the version info retrieved from curlver.h -include $(OBJDIR)/version.inc # Global flags for all compilers CFLAGS += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc ifeq ($(CC),mwccnlm) LD = mwldnlm LDFLAGS = -nostdlib $< $(PRELUDE) $(LDLIBS) -o $@ -commandfile LIBEXT = lib CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586 CFLAGS += -relax_pointers #CFLAGS += -w on ifeq ($(LIBARCH),LIBC) ifeq ($(POSIXFL),1) PRELUDE = $(NDK_LIBC)/imports/posixpre.o else PRELUDE = $(NDK_LIBC)/imports/libcpre.o endif CFLAGS += -align 4 else # PRELUDE = $(NDK_CLIB)/imports/clibpre.o # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj" # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h" CFLAGS += -align 1 endif else LD = nlmconv LDFLAGS = -T LIBEXT = a CFLAGS += -m32 CFLAGS += -fno-builtin -fno-strict-aliasing ifeq ($(findstring gcc,$(CC)),gcc) CFLAGS += -fpcc-struct-return endif CFLAGS += -Wall # -pedantic ifeq ($(LIBARCH),LIBC) ifeq ($(POSIXFL),1) PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o else PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o endif else # PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK # http://www.gknw.net/development/mk_nlm/gcc_pre.zip PRELUDE = $(NDK_ROOT)/pre/prelude.o CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h endif endif NDK_ROOT = $(NDKBASE)/ndk ifndef NDK_CLIB NDK_CLIB = $(NDK_ROOT)/nwsdk endif ifndef NDK_LIBC NDK_LIBC = $(NDK_ROOT)/libc endif ifndef NDK_LDAP NDK_LDAP = $(NDK_ROOT)/cldapsdk/netware endif CURL_INC = ../../include CURL_LIB = ../../lib INCLUDES = -I$(CURL_INC) ifeq ($(findstring -static,$(CFG)),-static) LINK_STATIC = 1 endif ifeq ($(findstring -ares,$(CFG)),-ares) WITH_ARES = 1 endif ifeq ($(findstring -rtmp,$(CFG)),-rtmp) WITH_RTMP = 1 WITH_SSL = 1 WITH_ZLIB = 1 endif ifeq ($(findstring -ssh2,$(CFG)),-ssh2) WITH_SSH2 = 1 WITH_SSL = 1 WITH_ZLIB = 1 endif ifeq ($(findstring -axtls,$(CFG)),-axtls) WITH_AXTLS = 1 WITH_SSL = else ifeq ($(findstring -ssl,$(CFG)),-ssl) WITH_SSL = 1 endif endif ifeq ($(findstring -zlib,$(CFG)),-zlib) WITH_ZLIB = 1 endif ifeq ($(findstring -idn,$(CFG)),-idn) WITH_IDN = 1 endif ifeq ($(findstring -spnego,$(CFG)),-spnego) WITH_SPNEGO = 1 endif ifeq ($(findstring -ipv6,$(CFG)),-ipv6) ENABLE_IPV6 = 1 endif ifdef LINK_STATIC LDLIBS = $(CURL_LIB)/libcurl.$(LIBEXT) ifdef WITH_ARES LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT) endif else MODULES = libcurl.nlm IMPORTS = @$(CURL_LIB)/libcurl.imp endif ifdef WITH_SSH2 # INCLUDES += -I$(LIBSSH2_PATH)/include ifdef LINK_STATIC LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT) else MODULES += libssh2.nlm IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp endif endif ifdef WITH_RTMP # INCLUDES += -I$(LIBRTMP_PATH) ifdef LINK_STATIC LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT) endif endif ifdef WITH_SSL INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L) LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT) LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT) IMPORTS += GetProcessSwitchCount RunningProcess ifdef WITH_SPNEGO # INCLUDES += -I$(FBOPENSSL_PATH)/include LDLIBS += $(FBOPENSSL_PATH)/nw/fbopenssl.$(LIBEXT) endif else ifdef WITH_AXTLS INCLUDES += -I$(AXTLS_PATH)/inc ifdef LINK_STATIC LDLIBS += $(AXTLS_PATH)/lib/libaxtls.$(LIBEXT) else MODULES += libaxtls.nlm IMPORTS += $(AXTLS_PATH)/lib/libaxtls.imp endif endif endif ifdef WITH_ZLIB # INCLUDES += -I$(ZLIB_PATH) ifdef LINK_STATIC LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT) else MODULES += libz.nlm IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp endif endif ifdef WITH_IDN # INCLUDES += -I$(LIBIDN_PATH)/include LDLIBS += $(LIBIDN_PATH)/lib/libidn.$(LIBEXT) endif ifeq ($(LIBARCH),LIBC) INCLUDES += -I$(NDK_LIBC)/include # INCLUDES += -I$(NDK_LIBC)/include/nks # INCLUDES += -I$(NDK_LIBC)/include/winsock CFLAGS += -D_POSIX_SOURCE else INCLUDES += -I$(NDK_CLIB)/include/nlm # INCLUDES += -I$(NDK_CLIB)/include endif ifndef DISABLE_LDAP # INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc endif CFLAGS += $(INCLUDES) ifeq ($(MTSAFE),YES) XDCOPT = -n endif ifeq ($(MTSAFE),NO) XDCOPT = -u endif ifdef XDCOPT XDCDATA = $(OBJDIR)/$(TARGET).xdc endif ifeq ($(findstring /sh,$(SHELL)),/sh) DL = ' DS = / PCT = % #-include $(NDKBASE)/nlmconv/ncpfs.inc else DS = \\ PCT = %% endif # Makefile.inc provides the CSOURCES and HHEADERS defines include Makefile.inc check_PROGRAMS := $(patsubst %,%.nlm,$(strip $(check_PROGRAMS))) .PRECIOUS: $(OBJDIR)/%.o $(OBJDIR)/%.def $(OBJDIR)/%.xdc all: prebuild $(check_PROGRAMS) prebuild: $(OBJDIR) $(OBJDIR)/version.inc $(OBJDIR)/%.o: %.c @echo Compiling $< $(CC) $(CFLAGS) -c $< -o $@ $(OBJDIR)/version.inc: $(CURL_INC)/curl/curlver.h $(OBJDIR) @echo Creating $@ @$(AWK) -f ../../packages/NetWare/get_ver.awk $< > $@ install: $(INSTDIR) all @$(CP) $(check_PROGRAMS) $(INSTDIR) clean: -$(RM) -r $(OBJDIR) distclean vclean: clean -$(RM) $(check_PROGRAMS) $(OBJDIR) $(INSTDIR): @$(MKDIR) $@ %.nlm: $(OBJDIR)/%.o $(OBJDIR)/%.def $(XDCDATA) @echo Linking $@ @-$(RM) $@ @$(LD) $(LDFLAGS) $(OBJDIR)/$(@:.nlm=.def) $(OBJDIR)/%.xdc: Makefile.netware @echo Creating $@ @$(MPKXDC) $(XDCOPT) $@ $(OBJDIR)/%.def: Makefile.netware @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@ @echo $(DL)# Do not edit this file - it is created by Make!$(DL) >> $@ @echo $(DL)# All your changes will be lost!!$(DL) >> $@ @echo $(DL)#$(DL) >> $@ @echo $(DL)copyright "$(COPYR)"$(DL) >> $@ @echo $(DL)description "$(DESCR) $(notdir $(@:.def=)) Example"$(DL) >> $@ @echo $(DL)version $(VERSION)$(DL) >> $@ ifdef NLMTYPE @echo $(DL)type $(NLMTYPE)$(DL) >> $@ endif ifdef STACK @echo $(DL)stack $(STACK)$(DL) >> $@ endif ifdef SCREEN @echo $(DL)screenname "$(DESCR) $(notdir $(@:.def=)) $(SCREEN)"$(DL) >> $@ else @echo $(DL)screenname "DEFAULT"$(DL) >> $@ endif ifneq ($(DB),NDEBUG) @echo $(DL)debug$(DL) >> $@ endif @echo $(DL)threadname "_$(notdir $(@:.def=))"$(DL) >> $@ ifdef XDCDATA @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@ endif ifeq ($(LDRING),0) @echo $(DL)flag_on 16$(DL) >> $@ endif ifeq ($(LDRING),3) @echo $(DL)flag_on 512$(DL) >> $@ endif ifeq ($(LIBARCH),CLIB) @echo $(DL)start _Prelude$(DL) >> $@ @echo $(DL)exit _Stop$(DL) >> $@ @echo $(DL)import @$(NDK_CLIB)/imports/clib.imp$(DL) >> $@ @echo $(DL)import @$(NDK_CLIB)/imports/threads.imp$(DL) >> $@ @echo $(DL)import @$(NDK_CLIB)/imports/nlmlib.imp$(DL) >> $@ @echo $(DL)import @$(NDK_CLIB)/imports/socklib.imp$(DL) >> $@ @echo $(DL)module clib$(DL) >> $@ ifndef DISABLE_LDAP @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@ @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@ # @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@ @echo $(DL)module ldapsdk ldapssl$(DL) >> $@ endif else ifeq ($(POSIXFL),1) @echo $(DL)flag_on 4194304$(DL) >> $@ endif @echo $(DL)flag_on 64$(DL) >> $@ @echo $(DL)pseudopreemption$(DL) >> $@ ifeq ($(findstring posixpre,$(PRELUDE)),posixpre) @echo $(DL)start POSIX_Start$(DL) >> $@ @echo $(DL)exit POSIX_Stop$(DL) >> $@ @echo $(DL)check POSIX_CheckUnload$(DL) >> $@ else @echo $(DL)start _LibCPrelude$(DL) >> $@ @echo $(DL)exit _LibCPostlude$(DL) >> $@ @echo $(DL)check _LibCCheckUnload$(DL) >> $@ endif @echo $(DL)import @$(NDK_LIBC)/imports/libc.imp$(DL) >> $@ @echo $(DL)import @$(NDK_LIBC)/imports/netware.imp$(DL) >> $@ @echo $(DL)module libc$(DL) >> $@ ifndef DISABLE_LDAP @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@ @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@ # @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@ @echo $(DL)module lldapsdk lldapssl$(DL) >> $@ endif endif ifdef MODULES @echo $(DL)module $(MODULES)$(DL) >> $@ endif ifdef EXPORTS @echo $(DL)export $(EXPORTS)$(DL) >> $@ endif ifdef IMPORTS @echo $(DL)import $(IMPORTS)$(DL) >> $@ endif ifeq ($(findstring nlmconv,$(LD)),nlmconv) @echo $(DL)input $(PRELUDE)$(DL) >> $@ @echo $(DL)input $(@:.def=.o)$(DL) >> $@ ifdef LDLIBS @echo $(DL)input $(LDLIBS)$(DL) >> $@ endif @echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@ endif �����������������������������������curl-7.35.0/docs/examples/url2file.c����������������������������������������������������������������0000644�0001750�0001750�00000004625�12213173003�014131� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <curl/curl.h> static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) { size_t written = fwrite(ptr, size, nmemb, (FILE *)stream); return written; } int main(int argc, char *argv[]) { CURL *curl_handle; static const char *pagefilename = "page.out"; FILE *pagefile; if(argc < 2 ) { printf("Usage: %s <URL>\n", argv[0]); return 1; } curl_global_init(CURL_GLOBAL_ALL); /* init the curl session */ curl_handle = curl_easy_init(); /* set URL to get here */ curl_easy_setopt(curl_handle, CURLOPT_URL, argv[1]); /* Switch on full protocol/debug output while testing */ curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, 1L); /* disable progress meter, set to 0L to enable and disable debug output */ curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L); /* send all data to this function */ curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data); /* open the file */ pagefile = fopen(pagefilename, "wb"); if (pagefile) { /* write the page body to this file handle. CURLOPT_FILE is also known as CURLOPT_WRITEDATA*/ curl_easy_setopt(curl_handle, CURLOPT_FILE, pagefile); /* get it! */ curl_easy_perform(curl_handle); /* close the header file */ fclose(pagefile); } /* cleanup curl stuff */ curl_easy_cleanup(curl_handle); return 0; } �����������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/synctime.c����������������������������������������������������������������0000644�0001750�0001750�00000031132�12213173003�014231� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* This example code only builds as-is on Windows. * * While Unix/Linux user, you do not need this software. * You can achieve the same result as synctime using curl, awk and date. * Set proxy as according to your network, but beware of proxy Cache-Control. * * To set your system clock, root access is required. * # date -s "`curl -sI http://nist.time.gov/timezone.cgi?UTC/s/0 \ * | awk -F': ' '/Date: / {print $2}'`" * * To view remote webserver date and time. * $ curl -sI http://nist.time.gov/timezone.cgi?UTC/s/0 \ * | awk -F': ' '/Date: / {print $2}' * * Synchronising your computer clock via Internet time server usually relies * on DAYTIME, TIME, or NTP protocols. These protocols provide good accurate * time synchronisation but it does not work very well through a * firewall/proxy. Some adjustment has to be made to the firewall/proxy for * these protocols to work properly. * * There is an indirect method. Since most webserver provide server time in * their HTTP header, therefore you could synchronise your computer clock * using HTTP protocol which has no problem with firewall/proxy. * * For this software to work, you should take note of these items. * 1. Your firewall/proxy must allow your computer to surf internet. * 2. Webserver system time must in sync with the NTP time server, * or at least provide an accurate time keeping. * 3. Webserver HTTP header does not provide the milliseconds units, * so there is no way to get very accurate time. * 4. This software could only provide an accuracy of +- a few seconds, * as Round-Trip delay time is not taken into consideration. * Compensation of network, firewall/proxy delay cannot be simply divide * the Round-Trip delay time by half. * 5. Win32 SetSystemTime() API will set your computer clock according to * GMT/UTC time. Therefore your computer timezone must be properly set. * 6. Webserver data should not be cached by the proxy server. Some * webserver provide Cache-Control to prevent caching. * * References: * http://tf.nist.gov/timefreq/service/its.htm * http://tf.nist.gov/timefreq/service/firewall.htm * * Usage: * This software will synchronise your computer clock only when you issue * it with --synctime. By default, it only display the webserver's clock. * * Written by: Frank (contributed to libcurl) * * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL THE AUTHOR OF THIS SOFTWARE BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * */ #include <stdio.h> #include <time.h> #ifndef __CYGWIN__ #include <windows.h> #endif #include <curl/curl.h> #define MAX_STRING 256 #define MAX_STRING1 MAX_STRING+1 typedef struct { char http_proxy[MAX_STRING1]; char proxy_user[MAX_STRING1]; char timeserver[MAX_STRING1]; } conf_t; const char DefaultTimeServer[4][MAX_STRING1] = { "http://nist.time.gov/timezone.cgi?UTC/s/0", "http://www.google.com/", "http://www.worldtimeserver.com/current_time_in_UTC.aspx", "http://www.worldtime.com/cgi-bin/wt.cgi" }; const char *DayStr[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; const char *MthStr[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; int ShowAllHeader; int AutoSyncTime; SYSTEMTIME SYSTime; SYSTEMTIME LOCALTime; #define HTTP_COMMAND_HEAD 0 #define HTTP_COMMAND_GET 1 size_t SyncTime_CURL_WriteOutput(void *ptr, size_t size, size_t nmemb, void *stream) { fwrite(ptr, size, nmemb, stream); return(nmemb*size); } size_t SyncTime_CURL_WriteHeader(void *ptr, size_t size, size_t nmemb, void *stream) { int i, RetVal; char TmpStr1[26], TmpStr2[26]; if (ShowAllHeader == 1) fprintf(stderr, "%s", (char *)(ptr)); if (strncmp((char *)(ptr), "Date:", 5) == 0) { if (ShowAllHeader == 0) fprintf(stderr, "HTTP Server. %s", (char *)(ptr)); if (AutoSyncTime == 1) { *TmpStr1 = 0; *TmpStr2 = 0; if (strlen((char *)(ptr)) > 50) /* Can prevent buffer overflow to TmpStr1 & 2? */ AutoSyncTime = 0; else { RetVal = sscanf ((char *)(ptr), "Date: %s %hu %s %hu %hu:%hu:%hu", TmpStr1, &SYSTime.wDay, TmpStr2, &SYSTime.wYear, &SYSTime.wHour, &SYSTime.wMinute, &SYSTime.wSecond); if (RetVal == 7) { SYSTime.wMilliseconds = 500; /* adjust to midpoint, 0.5 sec */ for (i=0; i<12; i++) { if (strcmp(MthStr[i], TmpStr2) == 0) { SYSTime.wMonth = i+1; break; } } AutoSyncTime = 3; /* Computer clock will be adjusted */ } else { AutoSyncTime = 0; /* Error in sscanf() fields conversion */ } } } } if (strncmp((char *)(ptr), "X-Cache: HIT", 12) == 0) { fprintf(stderr, "ERROR: HTTP Server data is cached." " Server Date is no longer valid.\n"); AutoSyncTime = 0; } return(nmemb*size); } void SyncTime_CURL_Init(CURL *curl, char *proxy_port, char *proxy_user_password) { if (strlen(proxy_port) > 0) curl_easy_setopt(curl, CURLOPT_PROXY, proxy_port); if (strlen(proxy_user_password) > 0) curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, proxy_user_password); /* Trick Webserver by claiming that you are using Microsoft WinXP SP2, IE6 */ curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, *SyncTime_CURL_WriteOutput); curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, *SyncTime_CURL_WriteHeader); } int SyncTime_CURL_Fetch(CURL *curl, char *URL_Str, char *OutFileName, int HttpGetBody) { FILE *outfile; CURLcode res; outfile = NULL; if (HttpGetBody == HTTP_COMMAND_HEAD) curl_easy_setopt(curl, CURLOPT_NOBODY, 1L); else { outfile = fopen(OutFileName, "wb"); curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile); } curl_easy_setopt(curl, CURLOPT_URL, URL_Str); res = curl_easy_perform(curl); if (outfile != NULL) fclose(outfile); return res; /* (CURLE_OK) */ } void showUsage(void) { fprintf(stderr, "SYNCTIME: Synchronising computer clock with time server" " using HTTP protocol.\n"); fprintf(stderr, "Usage : SYNCTIME [Option]\n"); fprintf(stderr, "Options :\n"); fprintf(stderr, " --server=WEBSERVER Use this time server instead" " of default.\n"); fprintf(stderr, " --showall Show all HTTP header.\n"); fprintf(stderr, " --synctime Synchronising computer clock" " with time server.\n"); fprintf(stderr, " --proxy-user=USER[:PASS] Set proxy username and" " password.\n"); fprintf(stderr, " --proxy=HOST[:PORT] Use HTTP proxy on given" " port.\n"); fprintf(stderr, " --help Print this help.\n"); fprintf(stderr, "\n"); return; } int conf_init(conf_t *conf) { int i; *conf->http_proxy = 0; for (i=0; i<MAX_STRING1; i++) conf->proxy_user[i] = 0; /* Clean up password from memory */ *conf->timeserver = 0; return 1; } int main(int argc, char *argv[]) { CURL *curl; conf_t conf[1]; int OptionIndex; struct tm *lt; struct tm *gmt; time_t tt; time_t tt_local; time_t tt_gmt; double tzonediffFloat; int tzonediffWord; char timeBuf[61]; char tzoneBuf[16]; int RetValue; OptionIndex = 0; ShowAllHeader = 0; /* Do not show HTTP Header */ AutoSyncTime = 0; /* Do not synchronise computer clock */ RetValue = 0; /* Successful Exit */ conf_init(conf); if (argc > 1) { while (OptionIndex < argc) { if (strncmp(argv[OptionIndex], "--server=", 9) == 0) snprintf(conf->timeserver, MAX_STRING, "%s", &argv[OptionIndex][9]); if (strcmp(argv[OptionIndex], "--showall") == 0) ShowAllHeader = 1; if (strcmp(argv[OptionIndex], "--synctime") == 0) AutoSyncTime = 1; if (strncmp(argv[OptionIndex], "--proxy-user=", 13) == 0) snprintf(conf->proxy_user, MAX_STRING, "%s", &argv[OptionIndex][13]); if (strncmp(argv[OptionIndex], "--proxy=", 8) == 0) snprintf(conf->http_proxy, MAX_STRING, "%s", &argv[OptionIndex][8]); if ((strcmp(argv[OptionIndex], "--help") == 0) || (strcmp(argv[OptionIndex], "/?") == 0)) { showUsage(); return 0; } OptionIndex++; } } if (*conf->timeserver == 0) /* Use default server for time information */ snprintf(conf->timeserver, MAX_STRING, "%s", DefaultTimeServer[0]); /* Init CURL before usage */ curl_global_init(CURL_GLOBAL_ALL); curl = curl_easy_init(); if (curl) { SyncTime_CURL_Init(curl, conf->http_proxy, conf->proxy_user); /* Calculating time diff between GMT and localtime */ tt = time(0); lt = localtime(&tt); tt_local = mktime(lt); gmt = gmtime(&tt); tt_gmt = mktime(gmt); tzonediffFloat = difftime(tt_local, tt_gmt); tzonediffWord = (int)(tzonediffFloat/3600.0); if ((double)(tzonediffWord * 3600) == tzonediffFloat) snprintf(tzoneBuf, 15, "%+03d'00'", tzonediffWord); else snprintf(tzoneBuf, 15, "%+03d'30'", tzonediffWord); /* Get current system time and local time */ GetSystemTime(&SYSTime); GetLocalTime(&LOCALTime); snprintf(timeBuf, 60, "%s, %02d %s %04d %02d:%02d:%02d.%03d, ", DayStr[LOCALTime.wDayOfWeek], LOCALTime.wDay, MthStr[LOCALTime.wMonth-1], LOCALTime.wYear, LOCALTime.wHour, LOCALTime.wMinute, LOCALTime.wSecond, LOCALTime.wMilliseconds); fprintf(stderr, "Fetch: %s\n\n", conf->timeserver); fprintf(stderr, "Before HTTP. Date: %s%s\n\n", timeBuf, tzoneBuf); /* HTTP HEAD command to the Webserver */ SyncTime_CURL_Fetch(curl, conf->timeserver, "index.htm", HTTP_COMMAND_HEAD); GetLocalTime(&LOCALTime); snprintf(timeBuf, 60, "%s, %02d %s %04d %02d:%02d:%02d.%03d, ", DayStr[LOCALTime.wDayOfWeek], LOCALTime.wDay, MthStr[LOCALTime.wMonth-1], LOCALTime.wYear, LOCALTime.wHour, LOCALTime.wMinute, LOCALTime.wSecond, LOCALTime.wMilliseconds); fprintf(stderr, "\nAfter HTTP. Date: %s%s\n", timeBuf, tzoneBuf); if (AutoSyncTime == 3) { /* Synchronising computer clock */ if (!SetSystemTime(&SYSTime)) { /* Set system time */ fprintf(stderr, "ERROR: Unable to set system time.\n"); RetValue = 1; } else { /* Successfully re-adjusted computer clock */ GetLocalTime(&LOCALTime); snprintf(timeBuf, 60, "%s, %02d %s %04d %02d:%02d:%02d.%03d, ", DayStr[LOCALTime.wDayOfWeek], LOCALTime.wDay, MthStr[LOCALTime.wMonth-1], LOCALTime.wYear, LOCALTime.wHour, LOCALTime.wMinute, LOCALTime.wSecond, LOCALTime.wMilliseconds); fprintf(stderr, "\nNew System's Date: %s%s\n", timeBuf, tzoneBuf); } } /* Cleanup before exit */ conf_init(conf); curl_easy_cleanup(curl); } return RetValue; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/fopen.c�������������������������������������������������������������������0000644�0001750�0001750�00000032107�12213173003�013510� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/***************************************************************************** * * This example source code introduces a c library buffered I/O interface to * URL reads it supports fopen(), fread(), fgets(), feof(), fclose(), * rewind(). Supported functions have identical prototypes to their normal c * lib namesakes and are preceaded by url_ . * * Using this code you can replace your program's fopen() with url_fopen() * and fread() with url_fread() and it become possible to read remote streams * instead of (only) local files. Local files (ie those that can be directly * fopened) will drop back to using the underlying clib implementations * * See the main() function at the bottom that shows an app that retrives from a * specified url using fgets() and fread() and saves as two output files. * * Copyright (c) 2003 Simtec Electronics * * Re-implemented by Vincent Sanders <vince@kyllikki.org> with extensive * reference to original curl example code * * 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. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. * * This example requires libcurl 7.9.7 or later. */ #include <stdio.h> #include <string.h> #ifndef WIN32 # include <sys/time.h> #endif #include <stdlib.h> #include <errno.h> #include <curl/curl.h> enum fcurl_type_e { CFTYPE_NONE=0, CFTYPE_FILE=1, CFTYPE_CURL=2 }; struct fcurl_data { enum fcurl_type_e type; /* type of handle */ union { CURL *curl; FILE *file; } handle; /* handle */ char *buffer; /* buffer to store cached data*/ size_t buffer_len; /* currently allocated buffers length */ size_t buffer_pos; /* end of data in buffer*/ int still_running; /* Is background url fetch still in progress */ }; typedef struct fcurl_data URL_FILE; /* exported functions */ URL_FILE *url_fopen(const char *url,const char *operation); int url_fclose(URL_FILE *file); int url_feof(URL_FILE *file); size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file); char * url_fgets(char *ptr, size_t size, URL_FILE *file); void url_rewind(URL_FILE *file); /* we use a global one for convenience */ CURLM *multi_handle; /* curl calls this routine to get more data */ static size_t write_callback(char *buffer, size_t size, size_t nitems, void *userp) { char *newbuff; size_t rembuff; URL_FILE *url = (URL_FILE *)userp; size *= nitems; rembuff=url->buffer_len - url->buffer_pos; /* remaining space in buffer */ if(size > rembuff) { /* not enough space in buffer */ newbuff=realloc(url->buffer,url->buffer_len + (size - rembuff)); if(newbuff==NULL) { fprintf(stderr,"callback buffer grow failed\n"); size=rembuff; } else { /* realloc suceeded increase buffer size*/ url->buffer_len+=size - rembuff; url->buffer=newbuff; } } memcpy(&url->buffer[url->buffer_pos], buffer, size); url->buffer_pos += size; return size; } /* use to attempt to fill the read buffer up to requested number of bytes */ static int fill_buffer(URL_FILE *file, size_t want) { fd_set fdread; fd_set fdwrite; fd_set fdexcep; struct timeval timeout; int rc; /* only attempt to fill buffer if transactions still running and buffer * doesnt exceed required size already */ if((!file->still_running) || (file->buffer_pos > want)) return 0; /* attempt to fill buffer */ do { int maxfd = -1; long curl_timeo = -1; FD_ZERO(&fdread); FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); /* set a suitable timeout to fail on */ timeout.tv_sec = 60; /* 1 minute */ timeout.tv_usec = 0; curl_multi_timeout(multi_handle, &curl_timeo); if(curl_timeo >= 0) { timeout.tv_sec = curl_timeo / 1000; if(timeout.tv_sec > 1) timeout.tv_sec = 1; else timeout.tv_usec = (curl_timeo % 1000) * 1000; } /* get file descriptors from the transfers */ curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd); /* In a real-world program you OF COURSE check the return code of the function calls. On success, the value of maxfd is guaranteed to be greater or equal than -1. We call select(maxfd + 1, ...), specially in case of (maxfd == -1), we call select(0, ...), which is basically equal to sleep. */ rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout); switch(rc) { case -1: /* select error */ break; case 0: default: /* timeout or readable/writable sockets */ curl_multi_perform(multi_handle, &file->still_running); break; } } while(file->still_running && (file->buffer_pos < want)); return 1; } /* use to remove want bytes from the front of a files buffer */ static int use_buffer(URL_FILE *file,int want) { /* sort out buffer */ if((file->buffer_pos - want) <=0) { /* ditch buffer - write will recreate */ if(file->buffer) free(file->buffer); file->buffer=NULL; file->buffer_pos=0; file->buffer_len=0; } else { /* move rest down make it available for later */ memmove(file->buffer, &file->buffer[want], (file->buffer_pos - want)); file->buffer_pos -= want; } return 0; } URL_FILE *url_fopen(const char *url,const char *operation) { /* this code could check for URLs or types in the 'url' and basicly use the real fopen() for standard files */ URL_FILE *file; (void)operation; file = malloc(sizeof(URL_FILE)); if(!file) return NULL; memset(file, 0, sizeof(URL_FILE)); if((file->handle.file=fopen(url,operation))) file->type = CFTYPE_FILE; /* marked as URL */ else { file->type = CFTYPE_CURL; /* marked as URL */ file->handle.curl = curl_easy_init(); curl_easy_setopt(file->handle.curl, CURLOPT_URL, url); curl_easy_setopt(file->handle.curl, CURLOPT_WRITEDATA, file); curl_easy_setopt(file->handle.curl, CURLOPT_VERBOSE, 0L); curl_easy_setopt(file->handle.curl, CURLOPT_WRITEFUNCTION, write_callback); if(!multi_handle) multi_handle = curl_multi_init(); curl_multi_add_handle(multi_handle, file->handle.curl); /* lets start the fetch */ curl_multi_perform(multi_handle, &file->still_running); if((file->buffer_pos == 0) && (!file->still_running)) { /* if still_running is 0 now, we should return NULL */ /* make sure the easy handle is not in the multi handle anymore */ curl_multi_remove_handle(multi_handle, file->handle.curl); /* cleanup */ curl_easy_cleanup(file->handle.curl); free(file); file = NULL; } } return file; } int url_fclose(URL_FILE *file) { int ret=0;/* default is good return */ switch(file->type) { case CFTYPE_FILE: ret=fclose(file->handle.file); /* passthrough */ break; case CFTYPE_CURL: /* make sure the easy handle is not in the multi handle anymore */ curl_multi_remove_handle(multi_handle, file->handle.curl); /* cleanup */ curl_easy_cleanup(file->handle.curl); break; default: /* unknown or supported type - oh dear */ ret=EOF; errno=EBADF; break; } if(file->buffer) free(file->buffer);/* free any allocated buffer space */ free(file); return ret; } int url_feof(URL_FILE *file) { int ret=0; switch(file->type) { case CFTYPE_FILE: ret=feof(file->handle.file); break; case CFTYPE_CURL: if((file->buffer_pos == 0) && (!file->still_running)) ret = 1; break; default: /* unknown or supported type - oh dear */ ret=-1; errno=EBADF; break; } return ret; } size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file) { size_t want; switch(file->type) { case CFTYPE_FILE: want=fread(ptr,size,nmemb,file->handle.file); break; case CFTYPE_CURL: want = nmemb * size; fill_buffer(file,want); /* check if theres data in the buffer - if not fill_buffer() * either errored or EOF */ if(!file->buffer_pos) return 0; /* ensure only available data is considered */ if(file->buffer_pos < want) want = file->buffer_pos; /* xfer data to caller */ memcpy(ptr, file->buffer, want); use_buffer(file,want); want = want / size; /* number of items */ break; default: /* unknown or supported type - oh dear */ want=0; errno=EBADF; break; } return want; } char *url_fgets(char *ptr, size_t size, URL_FILE *file) { size_t want = size - 1;/* always need to leave room for zero termination */ size_t loop; switch(file->type) { case CFTYPE_FILE: ptr = fgets(ptr,size,file->handle.file); break; case CFTYPE_CURL: fill_buffer(file,want); /* check if theres data in the buffer - if not fill either errored or * EOF */ if(!file->buffer_pos) return NULL; /* ensure only available data is considered */ if(file->buffer_pos < want) want = file->buffer_pos; /*buffer contains data */ /* look for newline or eof */ for(loop=0;loop < want;loop++) { if(file->buffer[loop] == '\n') { want=loop+1;/* include newline */ break; } } /* xfer data to caller */ memcpy(ptr, file->buffer, want); ptr[want]=0;/* allways null terminate */ use_buffer(file,want); break; default: /* unknown or supported type - oh dear */ ptr=NULL; errno=EBADF; break; } return ptr;/*success */ } void url_rewind(URL_FILE *file) { switch(file->type) { case CFTYPE_FILE: rewind(file->handle.file); /* passthrough */ break; case CFTYPE_CURL: /* halt transaction */ curl_multi_remove_handle(multi_handle, file->handle.curl); /* restart */ curl_multi_add_handle(multi_handle, file->handle.curl); /* ditch buffer - write will recreate - resets stream pos*/ if(file->buffer) free(file->buffer); file->buffer=NULL; file->buffer_pos=0; file->buffer_len=0; break; default: /* unknown or supported type - oh dear */ break; } } /* Small main program to retrive from a url using fgets and fread saving the * output to two test files (note the fgets method will corrupt binary files if * they contain 0 chars */ int main(int argc, char *argv[]) { URL_FILE *handle; FILE *outf; int nread; char buffer[256]; const char *url; if(argc < 2) url="http://192.168.7.3/testfile";/* default to testurl */ else url=argv[1];/* use passed url */ /* copy from url line by line with fgets */ outf=fopen("fgets.test","w+"); if(!outf) { perror("couldn't open fgets output file\n"); return 1; } handle = url_fopen(url, "r"); if(!handle) { printf("couldn't url_fopen() %s\n", url); fclose(outf); return 2; } while(!url_feof(handle)) { url_fgets(buffer,sizeof(buffer),handle); fwrite(buffer,1,strlen(buffer),outf); } url_fclose(handle); fclose(outf); /* Copy from url with fread */ outf=fopen("fread.test","w+"); if(!outf) { perror("couldn't open fread output file\n"); return 1; } handle = url_fopen("testfile", "r"); if(!handle) { printf("couldn't url_fopen() testfile\n"); fclose(outf); return 2; } do { nread = url_fread(buffer, 1,sizeof(buffer), handle); fwrite(buffer,1,nread,outf); } while(nread); url_fclose(handle); fclose(outf); /* Test rewind */ outf=fopen("rewind.test","w+"); if(!outf) { perror("couldn't open fread output file\n"); return 1; } handle = url_fopen("testfile", "r"); if(!handle) { printf("couldn't url_fopen() testfile\n"); fclose(outf); return 2; } nread = url_fread(buffer, 1,sizeof(buffer), handle); fwrite(buffer,1,nread,outf); url_rewind(handle); buffer[0]='\n'; fwrite(buffer,1,1,outf); nread = url_fread(buffer, 1,sizeof(buffer), handle); fwrite(buffer,1,nread,outf); url_fclose(handle); fclose(outf); return 0;/* all done */ } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/multi-app.c���������������������������������������������������������������0000644�0001750�0001750�00000010764�12213173003�014316� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* This is an example application source code using the multi interface. */ #include <stdio.h> #include <string.h> /* somewhat unix-specific */ #include <sys/time.h> #include <unistd.h> /* curl stuff */ #include <curl/curl.h> /* * Download a HTTP file and upload an FTP file simultaneously. */ #define HANDLECOUNT 2 /* Number of simultaneous transfers */ #define HTTP_HANDLE 0 /* Index for the HTTP transfer */ #define FTP_HANDLE 1 /* Index for the FTP transfer */ int main(void) { CURL *handles[HANDLECOUNT]; CURLM *multi_handle; int still_running; /* keep number of running handles */ int i; CURLMsg *msg; /* for picking up messages with the transfer status */ int msgs_left; /* how many messages are left */ /* Allocate one CURL handle per transfer */ for (i=0; i<HANDLECOUNT; i++) handles[i] = curl_easy_init(); /* set the options (I left out a few, you'll get the point anyway) */ curl_easy_setopt(handles[HTTP_HANDLE], CURLOPT_URL, "http://example.com"); curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_URL, "ftp://example.com"); curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_UPLOAD, 1L); /* init a multi stack */ multi_handle = curl_multi_init(); /* add the individual transfers */ for (i=0; i<HANDLECOUNT; i++) curl_multi_add_handle(multi_handle, handles[i]); /* we start some action by calling perform right away */ curl_multi_perform(multi_handle, &still_running); do { struct timeval timeout; int rc; /* select() return code */ fd_set fdread; fd_set fdwrite; fd_set fdexcep; int maxfd = -1; long curl_timeo = -1; FD_ZERO(&fdread); FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); /* set a suitable timeout to play around with */ timeout.tv_sec = 1; timeout.tv_usec = 0; curl_multi_timeout(multi_handle, &curl_timeo); if(curl_timeo >= 0) { timeout.tv_sec = curl_timeo / 1000; if(timeout.tv_sec > 1) timeout.tv_sec = 1; else timeout.tv_usec = (curl_timeo % 1000) * 1000; } /* get file descriptors from the transfers */ curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd); /* In a real-world program you OF COURSE check the return code of the function calls. On success, the value of maxfd is guaranteed to be greater or equal than -1. We call select(maxfd + 1, ...), specially in case of (maxfd == -1), we call select(0, ...), which is basically equal to sleep. */ rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout); switch(rc) { case -1: /* select error */ break; case 0: /* timeout */ default: /* action */ curl_multi_perform(multi_handle, &still_running); break; } } while(still_running); /* See how the transfers went */ while ((msg = curl_multi_info_read(multi_handle, &msgs_left))) { if (msg->msg == CURLMSG_DONE) { int idx, found = 0; /* Find out which handle this message is about */ for (idx=0; idx<HANDLECOUNT; idx++) { found = (msg->easy_handle == handles[idx]); if(found) break; } switch (idx) { case HTTP_HANDLE: printf("HTTP transfer completed with status %d\n", msg->data.result); break; case FTP_HANDLE: printf("FTP transfer completed with status %d\n", msg->data.result); break; } } } curl_multi_cleanup(multi_handle); /* Free the CURL handles */ for (i=0; i<HANDLECOUNT; i++) curl_easy_cleanup(handles[i]); return 0; } ������������curl-7.35.0/docs/examples/ftpuploadresume.c���������������������������������������������������������0000644�0001750�0001750�00000011373�12213173003�015622� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* Upload to FTP, resuming failed transfers * * Compile for MinGW like this: * gcc -Wall -pedantic -std=c99 ftpuploadwithresume.c -o ftpuploadresume.exe * -lcurl -lmsvcr70 * * Written by Philip Bock */ #include <stdlib.h> #include <stdio.h> #include <curl/curl.h> #if defined(_MSC_VER) && (_MSC_VER < 1300) # error _snscanf requires MSVC 7.0 or later. #endif /* The MinGW headers are missing a few Win32 function definitions, you shouldn't need this if you use VC++ */ #if defined(__MINGW32__) && !defined(__MINGW64__) int __cdecl _snscanf(const char * input, size_t length, const char * format, ...); #endif /* parse headers for Content-Length */ size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream) { int r; long len = 0; /* _snscanf() is Win32 specific */ r = _snscanf(ptr, size * nmemb, "Content-Length: %ld\n", &len); if (r) /* Microsoft: we don't read the specs */ *((long *) stream) = len; return size * nmemb; } /* discard downloaded data */ size_t discardfunc(void *ptr, size_t size, size_t nmemb, void *stream) { return size * nmemb; } /* read data to upload */ size_t readfunc(void *ptr, size_t size, size_t nmemb, void *stream) { FILE *f = stream; size_t n; if (ferror(f)) return CURL_READFUNC_ABORT; n = fread(ptr, size, nmemb, f) * size; return n; } int upload(CURL *curlhandle, const char * remotepath, const char * localpath, long timeout, long tries) { FILE *f; long uploaded_len = 0; CURLcode r = CURLE_GOT_NOTHING; int c; f = fopen(localpath, "rb"); if (f == NULL) { perror(NULL); return 0; } curl_easy_setopt(curlhandle, CURLOPT_UPLOAD, 1L); curl_easy_setopt(curlhandle, CURLOPT_URL, remotepath); if (timeout) curl_easy_setopt(curlhandle, CURLOPT_FTP_RESPONSE_TIMEOUT, timeout); curl_easy_setopt(curlhandle, CURLOPT_HEADERFUNCTION, getcontentlengthfunc); curl_easy_setopt(curlhandle, CURLOPT_HEADERDATA, &uploaded_len); curl_easy_setopt(curlhandle, CURLOPT_WRITEFUNCTION, discardfunc); curl_easy_setopt(curlhandle, CURLOPT_READFUNCTION, readfunc); curl_easy_setopt(curlhandle, CURLOPT_READDATA, f); curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-"); /* disable passive mode */ curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L); curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1L); for (c = 0; (r != CURLE_OK) && (c < tries); c++) { /* are we resuming? */ if (c) { /* yes */ /* determine the length of the file already written */ /* * With NOBODY and NOHEADER, libcurl will issue a SIZE * command, but the only way to retrieve the result is * to parse the returned Content-Length header. Thus, * getcontentlengthfunc(). We need discardfunc() above * because HEADER will dump the headers to stdout * without it. */ curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 1L); curl_easy_setopt(curlhandle, CURLOPT_HEADER, 1L); r = curl_easy_perform(curlhandle); if (r != CURLE_OK) continue; curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 0L); curl_easy_setopt(curlhandle, CURLOPT_HEADER, 0L); fseek(f, uploaded_len, SEEK_SET); curl_easy_setopt(curlhandle, CURLOPT_APPEND, 1L); } else { /* no */ curl_easy_setopt(curlhandle, CURLOPT_APPEND, 0L); } r = curl_easy_perform(curlhandle); } fclose(f); if (r == CURLE_OK) return 1; else { fprintf(stderr, "%s\n", curl_easy_strerror(r)); return 0; } } int main(int c, char **argv) { CURL *curlhandle = NULL; curl_global_init(CURL_GLOBAL_ALL); curlhandle = curl_easy_init(); upload(curlhandle, "ftp://user:pass@example.com/path/file", "C:\\file", 0, 3); curl_easy_cleanup(curlhandle); curl_global_cleanup(); return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/pop3-noop.c���������������������������������������������������������������0000644�0001750�0001750�00000004047�12270035364�014247� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to perform a noop using libcurl's POP3 * capabilities. * * Note that this example requires libcurl 7.26.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This is just the server URL */ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com"); /* Set the NOOP command */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "NOOP"); /* Do not perform a transfer as NOOP returns no data */ curl_easy_setopt(curl, CURLOPT_NOBODY, 1L); /* Perform the custom request */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/href_extractor.c����������������������������������������������������������0000644�0001750�0001750�00000005221�12213173003�015415� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* * This example uses the "Streaming HTML parser" to extract the href pieces in * a streaming manner from a downloaded HTML. Kindly donated by MichaÅ‚ * Kowalczyk. * * The parser is found at * http://code.google.com/p/htmlstreamparser/ */ #include <stdio.h> #include <curl/curl.h> #include <htmlstreamparser.h> static size_t write_callback(void *buffer, size_t size, size_t nmemb, void *hsp) { size_t realsize = size * nmemb, p; for (p = 0; p < realsize; p++) { html_parser_char_parse(hsp, ((char *)buffer)[p]); if (html_parser_cmp_tag(hsp, "a", 1)) if (html_parser_cmp_attr(hsp, "href", 4)) if (html_parser_is_in(hsp, HTML_VALUE_ENDED)) { html_parser_val(hsp)[html_parser_val_length(hsp)] = '\0'; printf("%s\n", html_parser_val(hsp)); } } return realsize; } int main(int argc, char *argv[]) { char tag[1], attr[4], val[128]; CURL *curl; HTMLSTREAMPARSER *hsp; if (argc != 2) { printf("Usage: %s URL\n", argv[0]); return EXIT_FAILURE; } curl = curl_easy_init(); hsp = html_parser_init(); html_parser_set_tag_to_lower(hsp, 1); html_parser_set_attr_to_lower(hsp, 1); html_parser_set_tag_buffer(hsp, tag, sizeof(tag)); html_parser_set_attr_buffer(hsp, attr, sizeof(attr)); html_parser_set_val_buffer(hsp, val, sizeof(val)-1); curl_easy_setopt(curl, CURLOPT_URL, argv[1]); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, hsp); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_perform(curl); curl_easy_cleanup(curl); html_parser_cleanup(hsp); return EXIT_SUCCESS; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/usercertinmem.c�����������������������������������������������������������0000644�0001750�0001750�00000021717�12262353672�015310� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* Example using an in memory PEM user certificate and RSA key to retrieve an * https page. * Written by Ishan SinghLevett, based on Theo Borm's cacertinmem.c. * Note that to maintain simplicity this example does not use a CA certificate * for peer verification. However, some form of peer verification * must be used in real circumstances when a secure connection is required. */ #include <openssl/ssl.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <curl/curl.h> #include <stdio.h> static size_t writefunction(void *ptr, size_t size, size_t nmemb, void *stream) { fwrite(ptr,size,nmemb,stream); return(nmemb*size); } static CURLcode sslctx_function(CURL *curl, void *sslctx, void *parm) { X509 *cert = NULL; BIO *bio = NULL; BIO *kbio = NULL; RSA *rsa = NULL; int ret; const char *mypem = /* www.cacert.org */ "-----BEGIN CERTIFICATE-----\n"\ "MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290\n"\ "IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB\n"\ "IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA\n"\ "Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO\n"\ "BgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEi\n"\ "MCAGA1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJ\n"\ "ARYSc3VwcG9ydEBjYWNlcnQub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC\n"\ "CgKCAgEAziLA4kZ97DYoB1CW8qAzQIxL8TtmPzHlawI229Z89vGIj053NgVBlfkJ\n"\ "8BLPRoZzYLdufujAWGSuzbCtRRcMY/pnCujW0r8+55jE8Ez64AO7NV1sId6eINm6\n"\ "zWYyN3L69wj1x81YyY7nDl7qPv4coRQKFWyGhFtkZip6qUtTefWIonvuLwphK42y\n"\ "fk1WpRPs6tqSnqxEQR5YYGUFZvjARL3LlPdCfgv3ZWiYUQXw8wWRBB0bF4LsyFe7\n"\ "w2t6iPGwcswlWyCR7BYCEo8y6RcYSNDHBS4CMEK4JZwFaz+qOqfrU0j36NK2B5jc\n"\ "G8Y0f3/JHIJ6BVgrCFvzOKKrF11myZjXnhCLotLddJr3cQxyYN/Nb5gznZY0dj4k\n"\ "epKwDpUeb+agRThHqtdB7Uq3EvbXG4OKDy7YCbZZ16oE/9KTfWgu3YtLq1i6L43q\n"\ "laegw1SJpfvbi1EinbLDvhG+LJGGi5Z4rSDTii8aP8bQUWWHIbEZAWV/RRyH9XzQ\n"\ "QUxPKZgh/TMfdQwEUfoZd9vUFBzugcMd9Zi3aQaRIt0AUMyBMawSB3s42mhb5ivU\n"\ "fslfrejrckzzAeVLIL+aplfKkQABi6F1ITe1Yw1nPkZPcCBnzsXWWdsC4PDSy826\n"\ "YreQQejdIOQpvGQpQsgi3Hia/0PsmBsJUUtaWsJx8cTLc6nloQsCAwEAAaOCAc4w\n"\ "ggHKMB0GA1UdDgQWBBQWtTIb1Mfz4OaO873SsDrusjkY0TCBowYDVR0jBIGbMIGY\n"\ "gBQWtTIb1Mfz4OaO873SsDrusjkY0aF9pHsweTEQMA4GA1UEChMHUm9vdCBDQTEe\n"\ "MBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0\n"\ "IFNpZ25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2Vy\n"\ "dC5vcmeCAQAwDwYDVR0TAQH/BAUwAwEB/zAyBgNVHR8EKzApMCegJaAjhiFodHRw\n"\ "czovL3d3dy5jYWNlcnQub3JnL3Jldm9rZS5jcmwwMAYJYIZIAYb4QgEEBCMWIWh0\n"\ "dHBzOi8vd3d3LmNhY2VydC5vcmcvcmV2b2tlLmNybDA0BglghkgBhvhCAQgEJxYl\n"\ "aHR0cDovL3d3dy5jYWNlcnQub3JnL2luZGV4LnBocD9pZD0xMDBWBglghkgBhvhC\n"\ "AQ0ESRZHVG8gZ2V0IHlvdXIgb3duIGNlcnRpZmljYXRlIGZvciBGUkVFIGhlYWQg\n"\ "b3ZlciB0byBodHRwOi8vd3d3LmNhY2VydC5vcmcwDQYJKoZIhvcNAQEEBQADggIB\n"\ "ACjH7pyCArpcgBLKNQodgW+JapnM8mgPf6fhjViVPr3yBsOQWqy1YPaZQwGjiHCc\n"\ "nWKdpIevZ1gNMDY75q1I08t0AoZxPuIrA2jxNGJARjtT6ij0rPtmlVOKTV39O9lg\n"\ "18p5aTuxZZKmxoGCXJzN600BiqXfEVWqFcofN8CCmHBh22p8lqOOLlQ+TyGpkO/c\n"\ "gr/c6EWtTZBzCDyUZbAEmXZ/4rzCahWqlwQ3JNgelE5tDlG+1sSPypZt90Pf6DBl\n"\ "Jzt7u0NDY8RD97LsaMzhGY4i+5jhe1o+ATc7iwiwovOVThrLm82asduycPAtStvY\n"\ "sONvRUgzEv/+PDIqVPfE94rwiCPCR/5kenHA0R6mY7AHfqQv0wGP3J8rtsYIqQ+T\n"\ "SCX8Ev2fQtzzxD72V7DX3WnRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF\n"\ "CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum\n"\ "GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk\n"\ "zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW\n"\ "omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD\n"\ "-----END CERTIFICATE-----\n"; /*replace the XXX with the actual RSA key*/ const char *mykey = "-----BEGIN RSA PRIVATE KEY-----\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"\ "-----END RSA PRIVATE KEY-----\n"; (void)curl; /* avoid warnings */ (void)parm; /* avoid warnings */ /* get a BIO */ bio = BIO_new_mem_buf((char *)mypem, -1); if (bio == NULL) { printf("BIO_new_mem_buf failed\n"); } /* use it to read the PEM formatted certificate from memory into an X509 * structure that SSL can use */ cert = PEM_read_bio_X509(bio, NULL, 0, NULL); if (cert == NULL) { printf("PEM_read_bio_X509 failed...\n"); } /*tell SSL to use the X509 certificate*/ ret = SSL_CTX_use_certificate((SSL_CTX*)sslctx, cert); if (ret != 1) { printf("Use certificate failed\n"); } /*create a bio for the RSA key*/ kbio = BIO_new_mem_buf((char *)mykey, -1); if (kbio == NULL) { printf("BIO_new_mem_buf failed\n"); } /*read the key bio into an RSA object*/ rsa = PEM_read_bio_RSAPrivateKey(kbio, NULL, 0, NULL); if (rsa == NULL) { printf("Failed to create key bio\n"); } /*tell SSL to use the RSA key from memory*/ ret = SSL_CTX_use_RSAPrivateKey((SSL_CTX*)sslctx, rsa); if (ret != 1) { printf("Use Key failed\n"); } /* free resources that have been allocated by openssl functions */ if (bio) BIO_free(bio); if (kbio) BIO_free(kbio); if (rsa) RSA_free(rsa); if (cert) X509_free(cert); /* all set to go */ return CURLE_OK ; } int main(void) { CURL *ch; CURLcode rv; rv = curl_global_init(CURL_GLOBAL_ALL); ch = curl_easy_init(); rv = curl_easy_setopt(ch,CURLOPT_VERBOSE, 0L); rv = curl_easy_setopt(ch,CURLOPT_HEADER, 0L); rv = curl_easy_setopt(ch,CURLOPT_NOPROGRESS, 1L); rv = curl_easy_setopt(ch,CURLOPT_NOSIGNAL, 1L); rv = curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction); rv = curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout); rv = curl_easy_setopt(ch,CURLOPT_HEADERFUNCTION, *writefunction); rv = curl_easy_setopt(ch,CURLOPT_WRITEHEADER, stderr); rv = curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM"); /* both VERIFYPEER and VERIFYHOST are set to 0 in this case because there is no CA certificate*/ rv = curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER, 0L); rv = curl_easy_setopt(ch,CURLOPT_SSL_VERIFYHOST, 0L); rv = curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/"); rv = curl_easy_setopt(ch, CURLOPT_SSLKEYTYPE, "PEM"); /* first try: retrieve page without user certificate and key -> will fail */ rv = curl_easy_perform(ch); if (rv==CURLE_OK) { printf("*** transfer succeeded ***\n"); } else { printf("*** transfer failed ***\n"); } /* second try: retrieve page using user certificate and key -> will succeed * load the certificate and key by installing a function doing the necessary * "modifications" to the SSL CONTEXT just before link init */ rv = curl_easy_setopt(ch,CURLOPT_SSL_CTX_FUNCTION, *sslctx_function); rv = curl_easy_perform(ch); if (rv==CURLE_OK) { printf("*** transfer succeeded ***\n"); } else { printf("*** transfer failed ***\n"); } curl_easy_cleanup(ch); curl_global_cleanup(); return rv; } �������������������������������������������������curl-7.35.0/docs/examples/imap-multi.c��������������������������������������������������������������0000644�0001750�0001750�00000010150�12270035364�014463� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to fetch mail using libcurl's IMAP * capabilities. It builds on the imap-fetch.c example to demonstrate how to * use libcurl's multi interface. * * Note that this example requires libcurl 7.30.0 or above. */ #define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000 static struct timeval tvnow(void) { struct timeval now; /* time() returns the value of time in seconds since the epoch */ now.tv_sec = (long)time(NULL); now.tv_usec = 0; return now; } static long tvdiff(struct timeval newer, struct timeval older) { return (newer.tv_sec - older.tv_sec) * 1000 + (newer.tv_usec - older.tv_usec) / 1000; } int main(void) { CURL *curl; CURLM *mcurl; int still_running = 1; struct timeval mp_start; curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(!curl) return 1; mcurl = curl_multi_init(); if(!mcurl) return 2; /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This will fetch message 1 from the user's inbox */ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX/;UID=1"); /* Tell the multi stack about our easy handle */ curl_multi_add_handle(mcurl, curl); /* Record the start time which we can use later */ mp_start = tvnow(); /* We start some action by calling perform right away */ curl_multi_perform(mcurl, &still_running); while(still_running) { struct timeval timeout; fd_set fdread; fd_set fdwrite; fd_set fdexcep; int maxfd = -1; int rc; long curl_timeo = -1; /* Initialise the file descriptors */ FD_ZERO(&fdread); FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); /* Set a suitable timeout to play around with */ timeout.tv_sec = 1; timeout.tv_usec = 0; curl_multi_timeout(mcurl, &curl_timeo); if(curl_timeo >= 0) { timeout.tv_sec = curl_timeo / 1000; if(timeout.tv_sec > 1) timeout.tv_sec = 1; else timeout.tv_usec = (curl_timeo % 1000) * 1000; } /* Get file descriptors from the transfers */ curl_multi_fdset(mcurl, &fdread, &fdwrite, &fdexcep, &maxfd); /* In a real-world program you OF COURSE check the return code of the function calls. On success, the value of maxfd is guaranteed to be greater or equal than -1. We call select(maxfd + 1, ...), specially in case of (maxfd == -1), we call select(0, ...), which is basically equal to sleep. */ rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout); if(tvdiff(tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) { fprintf(stderr, "ABORTING: Since it seems that we would have run forever.\n"); break; } switch(rc) { case -1: /* select error */ break; case 0: /* timeout */ default: /* action */ curl_multi_perform(mcurl, &still_running); break; } } /* Always cleanup */ curl_multi_remove_handle(mcurl, curl); curl_multi_cleanup(mcurl); curl_easy_cleanup(curl); curl_global_cleanup(); return 0; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/Makefile.am���������������������������������������������������������������0000644�0001750�0001750�00000004353�12213173003�014273� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://curl.haxx.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is # furnished to do so, under the terms of the COPYING file. # # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # ########################################################################### AUTOMAKE_OPTIONS = foreign nostdinc EXTRA_DIST = README Makefile.example Makefile.inc Makefile.m32 \ Makefile.netware makefile.dj $(COMPLICATED_EXAMPLES) # Specify our include paths here, and do it relative to $(top_srcdir) and # $(top_builddir), to ensure that these paths which belong to the library # being currently built and tested are searched before the library which # might possibly already be installed in the system. # # $(top_builddir)/include/curl for generated curlbuild.h included from curl.h # $(top_builddir)/include for generated curlbuild.h inc. from lib/curl_setup.h # $(top_srcdir)/include is for libcurl's external include files AM_CPPFLAGS = -I$(top_builddir)/include/curl \ -I$(top_builddir)/include \ -I$(top_srcdir)/include LIBDIR = $(top_builddir)/lib # Avoid libcurl obsolete stuff AM_CPPFLAGS += -DCURL_NO_OLDIES if USE_CPPFLAG_CURL_STATICLIB AM_CPPFLAGS += -DCURL_STATICLIB endif # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) # Dependencies if USE_EXPLICIT_LIB_DEPS LDADD = $(LIBDIR)/libcurl.la @LIBCURL_LIBS@ else LDADD = $(LIBDIR)/libcurl.la endif # Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines include Makefile.inc all: $(check_PROGRAMS) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/imap-list.c���������������������������������������������������������������0000644�0001750�0001750�00000004002�12270035364�014303� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example showing how to list the folders within an IMAP * mailbox. * * Note that this example requires libcurl 7.30.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This will list the folders within the user's mailbox. If you want to * list the folders within a specific folder, for example the inbox, then * specify the folder as a path in the URL such as /INBOX */ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com"); /* Perform the list */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/Makefile.in���������������������������������������������������������������0000644�0001750�0001750�00000201517�12272122666�014323� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://curl.haxx.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is # furnished to do so, under the terms of the COPYING file. # # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # ########################################################################### VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @USE_CPPFLAG_CURL_STATICLIB_TRUE@am__append_1 = -DCURL_STATICLIB DIST_COMMON = $(srcdir)/Makefile.inc $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/mkinstalldirs \ $(top_srcdir)/depcomp README check_PROGRAMS = 10-at-a-time$(EXEEXT) anyauthput$(EXEEXT) \ cookie_interface$(EXEEXT) debug$(EXEEXT) fileupload$(EXEEXT) \ fopen$(EXEEXT) ftpget$(EXEEXT) ftpgetresp$(EXEEXT) \ ftpupload$(EXEEXT) getinfo$(EXEEXT) getinmemory$(EXEEXT) \ http-post$(EXEEXT) httpput$(EXEEXT) https$(EXEEXT) \ multi-app$(EXEEXT) multi-debugcallback$(EXEEXT) \ multi-double$(EXEEXT) multi-post$(EXEEXT) \ multi-single$(EXEEXT) persistant$(EXEEXT) \ post-callback$(EXEEXT) postit2$(EXEEXT) sepheaders$(EXEEXT) \ simple$(EXEEXT) simplepost$(EXEEXT) simplessl$(EXEEXT) \ sendrecv$(EXEEXT) httpcustomheader$(EXEEXT) certinfo$(EXEEXT) \ chkspeed$(EXEEXT) ftpgetinfo$(EXEEXT) ftp-wildcard$(EXEEXT) \ smtp-mail$(EXEEXT) smtp-multi$(EXEEXT) smtp-ssl$(EXEEXT) \ smtp-tls$(EXEEXT) smtp-vrfy$(EXEEXT) smtp-expn$(EXEEXT) \ rtsp$(EXEEXT) externalsocket$(EXEEXT) resolve$(EXEEXT) \ progressfunc$(EXEEXT) pop3-retr$(EXEEXT) pop3-list$(EXEEXT) \ pop3-uidl$(EXEEXT) pop3-dele$(EXEEXT) pop3-top$(EXEEXT) \ pop3-stat$(EXEEXT) pop3-noop$(EXEEXT) pop3-ssl$(EXEEXT) \ pop3-tls$(EXEEXT) pop3-multi$(EXEEXT) imap-list$(EXEEXT) \ imap-fetch$(EXEEXT) imap-store$(EXEEXT) imap-append$(EXEEXT) \ imap-examine$(EXEEXT) imap-search$(EXEEXT) \ imap-create$(EXEEXT) imap-delete$(EXEEXT) imap-copy$(EXEEXT) \ imap-noop$(EXEEXT) imap-ssl$(EXEEXT) imap-tls$(EXEEXT) \ imap-multi$(EXEEXT) url2file$(EXEEXT) sftpget$(EXEEXT) \ ftpsget$(EXEEXT) postinmemory$(EXEEXT) subdir = docs/examples ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \ $(top_srcdir)/m4/curl-confopts.m4 \ $(top_srcdir)/m4/curl-functions.m4 \ $(top_srcdir)/m4/curl-openssl.m4 \ $(top_srcdir)/m4/curl-override.m4 \ $(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/xc-am-iface.m4 \ $(top_srcdir)/m4/xc-cc-check.m4 \ $(top_srcdir)/m4/xc-lt-iface.m4 \ $(top_srcdir)/m4/xc-translit.m4 \ $(top_srcdir)/m4/xc-val-flgs.m4 \ $(top_srcdir)/m4/zz40-xc-ovr.m4 \ $(top_srcdir)/m4/zz50-xc-ovr.m4 \ $(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \ $(top_builddir)/include/curl/curlbuild.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 10_at_a_time_SOURCES = 10-at-a-time.c 10_at_a_time_OBJECTS = 10-at-a-time.$(OBJEXT) 10_at_a_time_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@10_at_a_time_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@10_at_a_time_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = anyauthput_SOURCES = anyauthput.c anyauthput_OBJECTS = anyauthput.$(OBJEXT) anyauthput_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@anyauthput_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@anyauthput_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la certinfo_SOURCES = certinfo.c certinfo_OBJECTS = certinfo.$(OBJEXT) certinfo_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@certinfo_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@certinfo_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la chkspeed_SOURCES = chkspeed.c chkspeed_OBJECTS = chkspeed.$(OBJEXT) chkspeed_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@chkspeed_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@chkspeed_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la cookie_interface_SOURCES = cookie_interface.c cookie_interface_OBJECTS = cookie_interface.$(OBJEXT) cookie_interface_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@cookie_interface_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@cookie_interface_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la debug_SOURCES = debug.c debug_OBJECTS = debug.$(OBJEXT) debug_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@debug_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@debug_DEPENDENCIES = $(LIBDIR)/libcurl.la externalsocket_SOURCES = externalsocket.c externalsocket_OBJECTS = externalsocket.$(OBJEXT) externalsocket_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@externalsocket_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@externalsocket_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la fileupload_SOURCES = fileupload.c fileupload_OBJECTS = fileupload.$(OBJEXT) fileupload_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@fileupload_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@fileupload_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la fopen_SOURCES = fopen.c fopen_OBJECTS = fopen.$(OBJEXT) fopen_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@fopen_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@fopen_DEPENDENCIES = $(LIBDIR)/libcurl.la ftp_wildcard_SOURCES = ftp-wildcard.c ftp_wildcard_OBJECTS = ftp-wildcard.$(OBJEXT) ftp_wildcard_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@ftp_wildcard_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@ftp_wildcard_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la ftpget_SOURCES = ftpget.c ftpget_OBJECTS = ftpget.$(OBJEXT) ftpget_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@ftpget_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@ftpget_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la ftpgetinfo_SOURCES = ftpgetinfo.c ftpgetinfo_OBJECTS = ftpgetinfo.$(OBJEXT) ftpgetinfo_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@ftpgetinfo_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@ftpgetinfo_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la ftpgetresp_SOURCES = ftpgetresp.c ftpgetresp_OBJECTS = ftpgetresp.$(OBJEXT) ftpgetresp_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@ftpgetresp_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@ftpgetresp_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la ftpsget_SOURCES = ftpsget.c ftpsget_OBJECTS = ftpsget.$(OBJEXT) ftpsget_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@ftpsget_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@ftpsget_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la ftpupload_SOURCES = ftpupload.c ftpupload_OBJECTS = ftpupload.$(OBJEXT) ftpupload_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@ftpupload_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@ftpupload_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la getinfo_SOURCES = getinfo.c getinfo_OBJECTS = getinfo.$(OBJEXT) getinfo_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@getinfo_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@getinfo_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la getinmemory_SOURCES = getinmemory.c getinmemory_OBJECTS = getinmemory.$(OBJEXT) getinmemory_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@getinmemory_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@getinmemory_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la http_post_SOURCES = http-post.c http_post_OBJECTS = http-post.$(OBJEXT) http_post_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@http_post_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@http_post_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la httpcustomheader_SOURCES = httpcustomheader.c httpcustomheader_OBJECTS = httpcustomheader.$(OBJEXT) httpcustomheader_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@httpcustomheader_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@httpcustomheader_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la httpput_SOURCES = httpput.c httpput_OBJECTS = httpput.$(OBJEXT) httpput_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@httpput_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@httpput_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la https_SOURCES = https.c https_OBJECTS = https.$(OBJEXT) https_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@https_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@https_DEPENDENCIES = $(LIBDIR)/libcurl.la imap_append_SOURCES = imap-append.c imap_append_OBJECTS = imap-append.$(OBJEXT) imap_append_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@imap_append_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@imap_append_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la imap_copy_SOURCES = imap-copy.c imap_copy_OBJECTS = imap-copy.$(OBJEXT) imap_copy_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@imap_copy_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@imap_copy_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la imap_create_SOURCES = imap-create.c imap_create_OBJECTS = imap-create.$(OBJEXT) imap_create_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@imap_create_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@imap_create_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la imap_delete_SOURCES = imap-delete.c imap_delete_OBJECTS = imap-delete.$(OBJEXT) imap_delete_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@imap_delete_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@imap_delete_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la imap_examine_SOURCES = imap-examine.c imap_examine_OBJECTS = imap-examine.$(OBJEXT) imap_examine_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@imap_examine_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@imap_examine_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la imap_fetch_SOURCES = imap-fetch.c imap_fetch_OBJECTS = imap-fetch.$(OBJEXT) imap_fetch_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@imap_fetch_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@imap_fetch_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la imap_list_SOURCES = imap-list.c imap_list_OBJECTS = imap-list.$(OBJEXT) imap_list_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@imap_list_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@imap_list_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la imap_multi_SOURCES = imap-multi.c imap_multi_OBJECTS = imap-multi.$(OBJEXT) imap_multi_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@imap_multi_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@imap_multi_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la imap_noop_SOURCES = imap-noop.c imap_noop_OBJECTS = imap-noop.$(OBJEXT) imap_noop_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@imap_noop_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@imap_noop_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la imap_search_SOURCES = imap-search.c imap_search_OBJECTS = imap-search.$(OBJEXT) imap_search_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@imap_search_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@imap_search_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la imap_ssl_SOURCES = imap-ssl.c imap_ssl_OBJECTS = imap-ssl.$(OBJEXT) imap_ssl_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@imap_ssl_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@imap_ssl_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la imap_store_SOURCES = imap-store.c imap_store_OBJECTS = imap-store.$(OBJEXT) imap_store_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@imap_store_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@imap_store_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la imap_tls_SOURCES = imap-tls.c imap_tls_OBJECTS = imap-tls.$(OBJEXT) imap_tls_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@imap_tls_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@imap_tls_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la multi_app_SOURCES = multi-app.c multi_app_OBJECTS = multi-app.$(OBJEXT) multi_app_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@multi_app_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@multi_app_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la multi_debugcallback_SOURCES = multi-debugcallback.c multi_debugcallback_OBJECTS = multi-debugcallback.$(OBJEXT) multi_debugcallback_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@multi_debugcallback_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@multi_debugcallback_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la multi_double_SOURCES = multi-double.c multi_double_OBJECTS = multi-double.$(OBJEXT) multi_double_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@multi_double_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@multi_double_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la multi_post_SOURCES = multi-post.c multi_post_OBJECTS = multi-post.$(OBJEXT) multi_post_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@multi_post_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@multi_post_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la multi_single_SOURCES = multi-single.c multi_single_OBJECTS = multi-single.$(OBJEXT) multi_single_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@multi_single_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@multi_single_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la persistant_SOURCES = persistant.c persistant_OBJECTS = persistant.$(OBJEXT) persistant_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@persistant_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@persistant_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la pop3_dele_SOURCES = pop3-dele.c pop3_dele_OBJECTS = pop3-dele.$(OBJEXT) pop3_dele_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@pop3_dele_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@pop3_dele_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la pop3_list_SOURCES = pop3-list.c pop3_list_OBJECTS = pop3-list.$(OBJEXT) pop3_list_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@pop3_list_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@pop3_list_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la pop3_multi_SOURCES = pop3-multi.c pop3_multi_OBJECTS = pop3-multi.$(OBJEXT) pop3_multi_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@pop3_multi_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@pop3_multi_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la pop3_noop_SOURCES = pop3-noop.c pop3_noop_OBJECTS = pop3-noop.$(OBJEXT) pop3_noop_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@pop3_noop_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@pop3_noop_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la pop3_retr_SOURCES = pop3-retr.c pop3_retr_OBJECTS = pop3-retr.$(OBJEXT) pop3_retr_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@pop3_retr_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@pop3_retr_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la pop3_ssl_SOURCES = pop3-ssl.c pop3_ssl_OBJECTS = pop3-ssl.$(OBJEXT) pop3_ssl_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@pop3_ssl_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@pop3_ssl_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la pop3_stat_SOURCES = pop3-stat.c pop3_stat_OBJECTS = pop3-stat.$(OBJEXT) pop3_stat_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@pop3_stat_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@pop3_stat_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la pop3_tls_SOURCES = pop3-tls.c pop3_tls_OBJECTS = pop3-tls.$(OBJEXT) pop3_tls_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@pop3_tls_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@pop3_tls_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la pop3_top_SOURCES = pop3-top.c pop3_top_OBJECTS = pop3-top.$(OBJEXT) pop3_top_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@pop3_top_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@pop3_top_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la pop3_uidl_SOURCES = pop3-uidl.c pop3_uidl_OBJECTS = pop3-uidl.$(OBJEXT) pop3_uidl_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@pop3_uidl_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@pop3_uidl_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la post_callback_SOURCES = post-callback.c post_callback_OBJECTS = post-callback.$(OBJEXT) post_callback_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@post_callback_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@post_callback_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la postinmemory_SOURCES = postinmemory.c postinmemory_OBJECTS = postinmemory.$(OBJEXT) postinmemory_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@postinmemory_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@postinmemory_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la postit2_SOURCES = postit2.c postit2_OBJECTS = postit2.$(OBJEXT) postit2_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@postit2_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@postit2_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la progressfunc_SOURCES = progressfunc.c progressfunc_OBJECTS = progressfunc.$(OBJEXT) progressfunc_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@progressfunc_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@progressfunc_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la resolve_SOURCES = resolve.c resolve_OBJECTS = resolve.$(OBJEXT) resolve_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@resolve_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@resolve_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la rtsp_SOURCES = rtsp.c rtsp_OBJECTS = rtsp.$(OBJEXT) rtsp_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@rtsp_DEPENDENCIES = $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@rtsp_DEPENDENCIES = $(LIBDIR)/libcurl.la sendrecv_SOURCES = sendrecv.c sendrecv_OBJECTS = sendrecv.$(OBJEXT) sendrecv_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@sendrecv_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@sendrecv_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la sepheaders_SOURCES = sepheaders.c sepheaders_OBJECTS = sepheaders.$(OBJEXT) sepheaders_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@sepheaders_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@sepheaders_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la sftpget_SOURCES = sftpget.c sftpget_OBJECTS = sftpget.$(OBJEXT) sftpget_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@sftpget_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@sftpget_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la simple_SOURCES = simple.c simple_OBJECTS = simple.$(OBJEXT) simple_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@simple_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@simple_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la simplepost_SOURCES = simplepost.c simplepost_OBJECTS = simplepost.$(OBJEXT) simplepost_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@simplepost_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@simplepost_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la simplessl_SOURCES = simplessl.c simplessl_OBJECTS = simplessl.$(OBJEXT) simplessl_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@simplessl_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@simplessl_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la smtp_expn_SOURCES = smtp-expn.c smtp_expn_OBJECTS = smtp-expn.$(OBJEXT) smtp_expn_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@smtp_expn_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@smtp_expn_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la smtp_mail_SOURCES = smtp-mail.c smtp_mail_OBJECTS = smtp-mail.$(OBJEXT) smtp_mail_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@smtp_mail_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@smtp_mail_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la smtp_multi_SOURCES = smtp-multi.c smtp_multi_OBJECTS = smtp-multi.$(OBJEXT) smtp_multi_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@smtp_multi_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@smtp_multi_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la smtp_ssl_SOURCES = smtp-ssl.c smtp_ssl_OBJECTS = smtp-ssl.$(OBJEXT) smtp_ssl_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@smtp_ssl_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@smtp_ssl_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la smtp_tls_SOURCES = smtp-tls.c smtp_tls_OBJECTS = smtp-tls.$(OBJEXT) smtp_tls_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@smtp_tls_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@smtp_tls_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la smtp_vrfy_SOURCES = smtp-vrfy.c smtp_vrfy_OBJECTS = smtp-vrfy.$(OBJEXT) smtp_vrfy_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@smtp_vrfy_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@smtp_vrfy_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la url2file_SOURCES = url2file.c url2file_OBJECTS = url2file.$(OBJEXT) url2file_LDADD = $(LDADD) @USE_EXPLICIT_LIB_DEPS_FALSE@url2file_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la @USE_EXPLICIT_LIB_DEPS_TRUE@url2file_DEPENDENCIES = \ @USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = 10-at-a-time.c anyauthput.c certinfo.c chkspeed.c \ cookie_interface.c debug.c externalsocket.c fileupload.c \ fopen.c ftp-wildcard.c ftpget.c ftpgetinfo.c ftpgetresp.c \ ftpsget.c ftpupload.c getinfo.c getinmemory.c http-post.c \ httpcustomheader.c httpput.c https.c imap-append.c imap-copy.c \ imap-create.c imap-delete.c imap-examine.c imap-fetch.c \ imap-list.c imap-multi.c imap-noop.c imap-search.c imap-ssl.c \ imap-store.c imap-tls.c multi-app.c multi-debugcallback.c \ multi-double.c multi-post.c multi-single.c persistant.c \ pop3-dele.c pop3-list.c pop3-multi.c pop3-noop.c pop3-retr.c \ pop3-ssl.c pop3-stat.c pop3-tls.c pop3-top.c pop3-uidl.c \ post-callback.c postinmemory.c postit2.c progressfunc.c \ resolve.c rtsp.c sendrecv.c sepheaders.c sftpget.c simple.c \ simplepost.c simplessl.c smtp-expn.c smtp-mail.c smtp-multi.c \ smtp-ssl.c smtp-tls.c smtp-vrfy.c url2file.c DIST_SOURCES = 10-at-a-time.c anyauthput.c certinfo.c chkspeed.c \ cookie_interface.c debug.c externalsocket.c fileupload.c \ fopen.c ftp-wildcard.c ftpget.c ftpgetinfo.c ftpgetresp.c \ ftpsget.c ftpupload.c getinfo.c getinmemory.c http-post.c \ httpcustomheader.c httpput.c https.c imap-append.c imap-copy.c \ imap-create.c imap-delete.c imap-examine.c imap-fetch.c \ imap-list.c imap-multi.c imap-noop.c imap-search.c imap-ssl.c \ imap-store.c imap-tls.c multi-app.c multi-debugcallback.c \ multi-double.c multi-post.c multi-single.c persistant.c \ pop3-dele.c pop3-list.c pop3-multi.c pop3-noop.c pop3-retr.c \ pop3-ssl.c pop3-stat.c pop3-tls.c pop3-top.c pop3-uidl.c \ post-callback.c postinmemory.c postit2.c progressfunc.c \ resolve.c rtsp.c sendrecv.c sepheaders.c sftpget.c simple.c \ simplepost.c simplessl.c smtp-expn.c smtp-mail.c smtp-multi.c \ smtp-ssl.c smtp-tls.c smtp-vrfy.c url2file.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@ CURLVERSION = @CURLVERSION@ CURL_CA_BUNDLE = @CURL_CA_BUNDLE@ CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@ CURL_DISABLE_DICT = @CURL_DISABLE_DICT@ CURL_DISABLE_FILE = @CURL_DISABLE_FILE@ CURL_DISABLE_FTP = @CURL_DISABLE_FTP@ CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@ CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@ CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@ CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@ CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@ CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@ CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@ CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@ CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@ CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@ CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@ CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@ CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@ CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_SHARED = @ENABLE_SHARED@ ENABLE_STATIC = @ENABLE_STATIC@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@ HAVE_LDAP_SSL = @HAVE_LDAP_SSL@ HAVE_LIBZ = @HAVE_LIBZ@ HAVE_SSLEAY_SRP = @HAVE_SSLEAY_SRP@ IDN_ENABLED = @IDN_ENABLED@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IPV6_ENABLED = @IPV6_ENABLED@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@ LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@ LIBMETALINK_LIBS = @LIBMETALINK_LIBS@ LIBOBJS = @LIBOBJS@ # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANOPT = @MANOPT@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NROFF = @NROFF@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGADD_NAME = @PKGADD_NAME@ PKGADD_PKG = @PKGADD_PKG@ PKGADD_VENDOR = @PKGADD_VENDOR@ PKGCONFIG = @PKGCONFIG@ RANDOM_FILE = @RANDOM_FILE@ RANLIB = @RANLIB@ REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_ENABLED = @SSL_ENABLED@ STRIP = @STRIP@ SUPPORT_FEATURES = @SUPPORT_FEATURES@ SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@ USE_ARES = @USE_ARES@ USE_AXTLS = @USE_AXTLS@ USE_CYASSL = @USE_CYASSL@ USE_DARWINSSL = @USE_DARWINSSL@ USE_GNUTLS = @USE_GNUTLS@ USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@ USE_LIBRTMP = @USE_LIBRTMP@ USE_LIBSSH2 = @USE_LIBSSH2@ USE_NGHTTP2 = @USE_NGHTTP2@ USE_NSS = @USE_NSS@ USE_OPENLDAP = @USE_OPENLDAP@ USE_POLARSSL = @USE_POLARSSL@ USE_SCHANNEL = @USE_SCHANNEL@ USE_SSLEAY = @USE_SSLEAY@ USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@ VERSION = @VERSION@ VERSIONNUM = @VERSIONNUM@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libext = @libext@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign nostdinc EXTRA_DIST = README Makefile.example Makefile.inc Makefile.m32 \ Makefile.netware makefile.dj $(COMPLICATED_EXAMPLES) # Specify our include paths here, and do it relative to $(top_srcdir) and # $(top_builddir), to ensure that these paths which belong to the library # being currently built and tested are searched before the library which # might possibly already be installed in the system. # # $(top_builddir)/include/curl for generated curlbuild.h included from curl.h # $(top_builddir)/include for generated curlbuild.h inc. from lib/curl_setup.h # $(top_srcdir)/include is for libcurl's external include files # Avoid libcurl obsolete stuff AM_CPPFLAGS = -I$(top_builddir)/include/curl -I$(top_builddir)/include \ -I$(top_srcdir)/include -DCURL_NO_OLDIES $(am__append_1) LIBDIR = $(top_builddir)/lib @USE_EXPLICIT_LIB_DEPS_FALSE@LDADD = $(LIBDIR)/libcurl.la # Dependencies @USE_EXPLICIT_LIB_DEPS_TRUE@LDADD = $(LIBDIR)/libcurl.la @LIBCURL_LIBS@ # These examples require external dependencies that may not be commonly # available on POSIX systems, so don't bother attempting to compile them here. COMPLICATED_EXAMPLES = curlgtk.c curlx.c htmltitle.cpp cacertinmem.c \ ftpuploadresume.c ghiper.c hiperfifo.c htmltidy.c multithread.c \ opensslthreadlock.c sampleconv.c synctime.c threaded-ssl.c evhiperfifo.c \ smooth-gtk-thread.c version-check.pl href_extractor.c asiohiper.cpp \ multi-uv.c xmlstream.c usercertinmem.c sessioninfo.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Makefile.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign docs/examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign docs/examples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(srcdir)/Makefile.inc: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list 10-at-a-time$(EXEEXT): $(10_at_a_time_OBJECTS) $(10_at_a_time_DEPENDENCIES) $(EXTRA_10_at_a_time_DEPENDENCIES) @rm -f 10-at-a-time$(EXEEXT) $(AM_V_CCLD)$(LINK) $(10_at_a_time_OBJECTS) $(10_at_a_time_LDADD) $(LIBS) anyauthput$(EXEEXT): $(anyauthput_OBJECTS) $(anyauthput_DEPENDENCIES) $(EXTRA_anyauthput_DEPENDENCIES) @rm -f anyauthput$(EXEEXT) $(AM_V_CCLD)$(LINK) $(anyauthput_OBJECTS) $(anyauthput_LDADD) $(LIBS) certinfo$(EXEEXT): $(certinfo_OBJECTS) $(certinfo_DEPENDENCIES) $(EXTRA_certinfo_DEPENDENCIES) @rm -f certinfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(certinfo_OBJECTS) $(certinfo_LDADD) $(LIBS) chkspeed$(EXEEXT): $(chkspeed_OBJECTS) $(chkspeed_DEPENDENCIES) $(EXTRA_chkspeed_DEPENDENCIES) @rm -f chkspeed$(EXEEXT) $(AM_V_CCLD)$(LINK) $(chkspeed_OBJECTS) $(chkspeed_LDADD) $(LIBS) cookie_interface$(EXEEXT): $(cookie_interface_OBJECTS) $(cookie_interface_DEPENDENCIES) $(EXTRA_cookie_interface_DEPENDENCIES) @rm -f cookie_interface$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cookie_interface_OBJECTS) $(cookie_interface_LDADD) $(LIBS) debug$(EXEEXT): $(debug_OBJECTS) $(debug_DEPENDENCIES) $(EXTRA_debug_DEPENDENCIES) @rm -f debug$(EXEEXT) $(AM_V_CCLD)$(LINK) $(debug_OBJECTS) $(debug_LDADD) $(LIBS) externalsocket$(EXEEXT): $(externalsocket_OBJECTS) $(externalsocket_DEPENDENCIES) $(EXTRA_externalsocket_DEPENDENCIES) @rm -f externalsocket$(EXEEXT) $(AM_V_CCLD)$(LINK) $(externalsocket_OBJECTS) $(externalsocket_LDADD) $(LIBS) fileupload$(EXEEXT): $(fileupload_OBJECTS) $(fileupload_DEPENDENCIES) $(EXTRA_fileupload_DEPENDENCIES) @rm -f fileupload$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fileupload_OBJECTS) $(fileupload_LDADD) $(LIBS) fopen$(EXEEXT): $(fopen_OBJECTS) $(fopen_DEPENDENCIES) $(EXTRA_fopen_DEPENDENCIES) @rm -f fopen$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fopen_OBJECTS) $(fopen_LDADD) $(LIBS) ftp-wildcard$(EXEEXT): $(ftp_wildcard_OBJECTS) $(ftp_wildcard_DEPENDENCIES) $(EXTRA_ftp_wildcard_DEPENDENCIES) @rm -f ftp-wildcard$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ftp_wildcard_OBJECTS) $(ftp_wildcard_LDADD) $(LIBS) ftpget$(EXEEXT): $(ftpget_OBJECTS) $(ftpget_DEPENDENCIES) $(EXTRA_ftpget_DEPENDENCIES) @rm -f ftpget$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ftpget_OBJECTS) $(ftpget_LDADD) $(LIBS) ftpgetinfo$(EXEEXT): $(ftpgetinfo_OBJECTS) $(ftpgetinfo_DEPENDENCIES) $(EXTRA_ftpgetinfo_DEPENDENCIES) @rm -f ftpgetinfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ftpgetinfo_OBJECTS) $(ftpgetinfo_LDADD) $(LIBS) ftpgetresp$(EXEEXT): $(ftpgetresp_OBJECTS) $(ftpgetresp_DEPENDENCIES) $(EXTRA_ftpgetresp_DEPENDENCIES) @rm -f ftpgetresp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ftpgetresp_OBJECTS) $(ftpgetresp_LDADD) $(LIBS) ftpsget$(EXEEXT): $(ftpsget_OBJECTS) $(ftpsget_DEPENDENCIES) $(EXTRA_ftpsget_DEPENDENCIES) @rm -f ftpsget$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ftpsget_OBJECTS) $(ftpsget_LDADD) $(LIBS) ftpupload$(EXEEXT): $(ftpupload_OBJECTS) $(ftpupload_DEPENDENCIES) $(EXTRA_ftpupload_DEPENDENCIES) @rm -f ftpupload$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ftpupload_OBJECTS) $(ftpupload_LDADD) $(LIBS) getinfo$(EXEEXT): $(getinfo_OBJECTS) $(getinfo_DEPENDENCIES) $(EXTRA_getinfo_DEPENDENCIES) @rm -f getinfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getinfo_OBJECTS) $(getinfo_LDADD) $(LIBS) getinmemory$(EXEEXT): $(getinmemory_OBJECTS) $(getinmemory_DEPENDENCIES) $(EXTRA_getinmemory_DEPENDENCIES) @rm -f getinmemory$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getinmemory_OBJECTS) $(getinmemory_LDADD) $(LIBS) http-post$(EXEEXT): $(http_post_OBJECTS) $(http_post_DEPENDENCIES) $(EXTRA_http_post_DEPENDENCIES) @rm -f http-post$(EXEEXT) $(AM_V_CCLD)$(LINK) $(http_post_OBJECTS) $(http_post_LDADD) $(LIBS) httpcustomheader$(EXEEXT): $(httpcustomheader_OBJECTS) $(httpcustomheader_DEPENDENCIES) $(EXTRA_httpcustomheader_DEPENDENCIES) @rm -f httpcustomheader$(EXEEXT) $(AM_V_CCLD)$(LINK) $(httpcustomheader_OBJECTS) $(httpcustomheader_LDADD) $(LIBS) httpput$(EXEEXT): $(httpput_OBJECTS) $(httpput_DEPENDENCIES) $(EXTRA_httpput_DEPENDENCIES) @rm -f httpput$(EXEEXT) $(AM_V_CCLD)$(LINK) $(httpput_OBJECTS) $(httpput_LDADD) $(LIBS) https$(EXEEXT): $(https_OBJECTS) $(https_DEPENDENCIES) $(EXTRA_https_DEPENDENCIES) @rm -f https$(EXEEXT) $(AM_V_CCLD)$(LINK) $(https_OBJECTS) $(https_LDADD) $(LIBS) imap-append$(EXEEXT): $(imap_append_OBJECTS) $(imap_append_DEPENDENCIES) $(EXTRA_imap_append_DEPENDENCIES) @rm -f imap-append$(EXEEXT) $(AM_V_CCLD)$(LINK) $(imap_append_OBJECTS) $(imap_append_LDADD) $(LIBS) imap-copy$(EXEEXT): $(imap_copy_OBJECTS) $(imap_copy_DEPENDENCIES) $(EXTRA_imap_copy_DEPENDENCIES) @rm -f imap-copy$(EXEEXT) $(AM_V_CCLD)$(LINK) $(imap_copy_OBJECTS) $(imap_copy_LDADD) $(LIBS) imap-create$(EXEEXT): $(imap_create_OBJECTS) $(imap_create_DEPENDENCIES) $(EXTRA_imap_create_DEPENDENCIES) @rm -f imap-create$(EXEEXT) $(AM_V_CCLD)$(LINK) $(imap_create_OBJECTS) $(imap_create_LDADD) $(LIBS) imap-delete$(EXEEXT): $(imap_delete_OBJECTS) $(imap_delete_DEPENDENCIES) $(EXTRA_imap_delete_DEPENDENCIES) @rm -f imap-delete$(EXEEXT) $(AM_V_CCLD)$(LINK) $(imap_delete_OBJECTS) $(imap_delete_LDADD) $(LIBS) imap-examine$(EXEEXT): $(imap_examine_OBJECTS) $(imap_examine_DEPENDENCIES) $(EXTRA_imap_examine_DEPENDENCIES) @rm -f imap-examine$(EXEEXT) $(AM_V_CCLD)$(LINK) $(imap_examine_OBJECTS) $(imap_examine_LDADD) $(LIBS) imap-fetch$(EXEEXT): $(imap_fetch_OBJECTS) $(imap_fetch_DEPENDENCIES) $(EXTRA_imap_fetch_DEPENDENCIES) @rm -f imap-fetch$(EXEEXT) $(AM_V_CCLD)$(LINK) $(imap_fetch_OBJECTS) $(imap_fetch_LDADD) $(LIBS) imap-list$(EXEEXT): $(imap_list_OBJECTS) $(imap_list_DEPENDENCIES) $(EXTRA_imap_list_DEPENDENCIES) @rm -f imap-list$(EXEEXT) $(AM_V_CCLD)$(LINK) $(imap_list_OBJECTS) $(imap_list_LDADD) $(LIBS) imap-multi$(EXEEXT): $(imap_multi_OBJECTS) $(imap_multi_DEPENDENCIES) $(EXTRA_imap_multi_DEPENDENCIES) @rm -f imap-multi$(EXEEXT) $(AM_V_CCLD)$(LINK) $(imap_multi_OBJECTS) $(imap_multi_LDADD) $(LIBS) imap-noop$(EXEEXT): $(imap_noop_OBJECTS) $(imap_noop_DEPENDENCIES) $(EXTRA_imap_noop_DEPENDENCIES) @rm -f imap-noop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(imap_noop_OBJECTS) $(imap_noop_LDADD) $(LIBS) imap-search$(EXEEXT): $(imap_search_OBJECTS) $(imap_search_DEPENDENCIES) $(EXTRA_imap_search_DEPENDENCIES) @rm -f imap-search$(EXEEXT) $(AM_V_CCLD)$(LINK) $(imap_search_OBJECTS) $(imap_search_LDADD) $(LIBS) imap-ssl$(EXEEXT): $(imap_ssl_OBJECTS) $(imap_ssl_DEPENDENCIES) $(EXTRA_imap_ssl_DEPENDENCIES) @rm -f imap-ssl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(imap_ssl_OBJECTS) $(imap_ssl_LDADD) $(LIBS) imap-store$(EXEEXT): $(imap_store_OBJECTS) $(imap_store_DEPENDENCIES) $(EXTRA_imap_store_DEPENDENCIES) @rm -f imap-store$(EXEEXT) $(AM_V_CCLD)$(LINK) $(imap_store_OBJECTS) $(imap_store_LDADD) $(LIBS) imap-tls$(EXEEXT): $(imap_tls_OBJECTS) $(imap_tls_DEPENDENCIES) $(EXTRA_imap_tls_DEPENDENCIES) @rm -f imap-tls$(EXEEXT) $(AM_V_CCLD)$(LINK) $(imap_tls_OBJECTS) $(imap_tls_LDADD) $(LIBS) multi-app$(EXEEXT): $(multi_app_OBJECTS) $(multi_app_DEPENDENCIES) $(EXTRA_multi_app_DEPENDENCIES) @rm -f multi-app$(EXEEXT) $(AM_V_CCLD)$(LINK) $(multi_app_OBJECTS) $(multi_app_LDADD) $(LIBS) multi-debugcallback$(EXEEXT): $(multi_debugcallback_OBJECTS) $(multi_debugcallback_DEPENDENCIES) $(EXTRA_multi_debugcallback_DEPENDENCIES) @rm -f multi-debugcallback$(EXEEXT) $(AM_V_CCLD)$(LINK) $(multi_debugcallback_OBJECTS) $(multi_debugcallback_LDADD) $(LIBS) multi-double$(EXEEXT): $(multi_double_OBJECTS) $(multi_double_DEPENDENCIES) $(EXTRA_multi_double_DEPENDENCIES) @rm -f multi-double$(EXEEXT) $(AM_V_CCLD)$(LINK) $(multi_double_OBJECTS) $(multi_double_LDADD) $(LIBS) multi-post$(EXEEXT): $(multi_post_OBJECTS) $(multi_post_DEPENDENCIES) $(EXTRA_multi_post_DEPENDENCIES) @rm -f multi-post$(EXEEXT) $(AM_V_CCLD)$(LINK) $(multi_post_OBJECTS) $(multi_post_LDADD) $(LIBS) multi-single$(EXEEXT): $(multi_single_OBJECTS) $(multi_single_DEPENDENCIES) $(EXTRA_multi_single_DEPENDENCIES) @rm -f multi-single$(EXEEXT) $(AM_V_CCLD)$(LINK) $(multi_single_OBJECTS) $(multi_single_LDADD) $(LIBS) persistant$(EXEEXT): $(persistant_OBJECTS) $(persistant_DEPENDENCIES) $(EXTRA_persistant_DEPENDENCIES) @rm -f persistant$(EXEEXT) $(AM_V_CCLD)$(LINK) $(persistant_OBJECTS) $(persistant_LDADD) $(LIBS) pop3-dele$(EXEEXT): $(pop3_dele_OBJECTS) $(pop3_dele_DEPENDENCIES) $(EXTRA_pop3_dele_DEPENDENCIES) @rm -f pop3-dele$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pop3_dele_OBJECTS) $(pop3_dele_LDADD) $(LIBS) pop3-list$(EXEEXT): $(pop3_list_OBJECTS) $(pop3_list_DEPENDENCIES) $(EXTRA_pop3_list_DEPENDENCIES) @rm -f pop3-list$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pop3_list_OBJECTS) $(pop3_list_LDADD) $(LIBS) pop3-multi$(EXEEXT): $(pop3_multi_OBJECTS) $(pop3_multi_DEPENDENCIES) $(EXTRA_pop3_multi_DEPENDENCIES) @rm -f pop3-multi$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pop3_multi_OBJECTS) $(pop3_multi_LDADD) $(LIBS) pop3-noop$(EXEEXT): $(pop3_noop_OBJECTS) $(pop3_noop_DEPENDENCIES) $(EXTRA_pop3_noop_DEPENDENCIES) @rm -f pop3-noop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pop3_noop_OBJECTS) $(pop3_noop_LDADD) $(LIBS) pop3-retr$(EXEEXT): $(pop3_retr_OBJECTS) $(pop3_retr_DEPENDENCIES) $(EXTRA_pop3_retr_DEPENDENCIES) @rm -f pop3-retr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pop3_retr_OBJECTS) $(pop3_retr_LDADD) $(LIBS) pop3-ssl$(EXEEXT): $(pop3_ssl_OBJECTS) $(pop3_ssl_DEPENDENCIES) $(EXTRA_pop3_ssl_DEPENDENCIES) @rm -f pop3-ssl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pop3_ssl_OBJECTS) $(pop3_ssl_LDADD) $(LIBS) pop3-stat$(EXEEXT): $(pop3_stat_OBJECTS) $(pop3_stat_DEPENDENCIES) $(EXTRA_pop3_stat_DEPENDENCIES) @rm -f pop3-stat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pop3_stat_OBJECTS) $(pop3_stat_LDADD) $(LIBS) pop3-tls$(EXEEXT): $(pop3_tls_OBJECTS) $(pop3_tls_DEPENDENCIES) $(EXTRA_pop3_tls_DEPENDENCIES) @rm -f pop3-tls$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pop3_tls_OBJECTS) $(pop3_tls_LDADD) $(LIBS) pop3-top$(EXEEXT): $(pop3_top_OBJECTS) $(pop3_top_DEPENDENCIES) $(EXTRA_pop3_top_DEPENDENCIES) @rm -f pop3-top$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pop3_top_OBJECTS) $(pop3_top_LDADD) $(LIBS) pop3-uidl$(EXEEXT): $(pop3_uidl_OBJECTS) $(pop3_uidl_DEPENDENCIES) $(EXTRA_pop3_uidl_DEPENDENCIES) @rm -f pop3-uidl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pop3_uidl_OBJECTS) $(pop3_uidl_LDADD) $(LIBS) post-callback$(EXEEXT): $(post_callback_OBJECTS) $(post_callback_DEPENDENCIES) $(EXTRA_post_callback_DEPENDENCIES) @rm -f post-callback$(EXEEXT) $(AM_V_CCLD)$(LINK) $(post_callback_OBJECTS) $(post_callback_LDADD) $(LIBS) postinmemory$(EXEEXT): $(postinmemory_OBJECTS) $(postinmemory_DEPENDENCIES) $(EXTRA_postinmemory_DEPENDENCIES) @rm -f postinmemory$(EXEEXT) $(AM_V_CCLD)$(LINK) $(postinmemory_OBJECTS) $(postinmemory_LDADD) $(LIBS) postit2$(EXEEXT): $(postit2_OBJECTS) $(postit2_DEPENDENCIES) $(EXTRA_postit2_DEPENDENCIES) @rm -f postit2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(postit2_OBJECTS) $(postit2_LDADD) $(LIBS) progressfunc$(EXEEXT): $(progressfunc_OBJECTS) $(progressfunc_DEPENDENCIES) $(EXTRA_progressfunc_DEPENDENCIES) @rm -f progressfunc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(progressfunc_OBJECTS) $(progressfunc_LDADD) $(LIBS) resolve$(EXEEXT): $(resolve_OBJECTS) $(resolve_DEPENDENCIES) $(EXTRA_resolve_DEPENDENCIES) @rm -f resolve$(EXEEXT) $(AM_V_CCLD)$(LINK) $(resolve_OBJECTS) $(resolve_LDADD) $(LIBS) rtsp$(EXEEXT): $(rtsp_OBJECTS) $(rtsp_DEPENDENCIES) $(EXTRA_rtsp_DEPENDENCIES) @rm -f rtsp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rtsp_OBJECTS) $(rtsp_LDADD) $(LIBS) sendrecv$(EXEEXT): $(sendrecv_OBJECTS) $(sendrecv_DEPENDENCIES) $(EXTRA_sendrecv_DEPENDENCIES) @rm -f sendrecv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sendrecv_OBJECTS) $(sendrecv_LDADD) $(LIBS) sepheaders$(EXEEXT): $(sepheaders_OBJECTS) $(sepheaders_DEPENDENCIES) $(EXTRA_sepheaders_DEPENDENCIES) @rm -f sepheaders$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sepheaders_OBJECTS) $(sepheaders_LDADD) $(LIBS) sftpget$(EXEEXT): $(sftpget_OBJECTS) $(sftpget_DEPENDENCIES) $(EXTRA_sftpget_DEPENDENCIES) @rm -f sftpget$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sftpget_OBJECTS) $(sftpget_LDADD) $(LIBS) simple$(EXEEXT): $(simple_OBJECTS) $(simple_DEPENDENCIES) $(EXTRA_simple_DEPENDENCIES) @rm -f simple$(EXEEXT) $(AM_V_CCLD)$(LINK) $(simple_OBJECTS) $(simple_LDADD) $(LIBS) simplepost$(EXEEXT): $(simplepost_OBJECTS) $(simplepost_DEPENDENCIES) $(EXTRA_simplepost_DEPENDENCIES) @rm -f simplepost$(EXEEXT) $(AM_V_CCLD)$(LINK) $(simplepost_OBJECTS) $(simplepost_LDADD) $(LIBS) simplessl$(EXEEXT): $(simplessl_OBJECTS) $(simplessl_DEPENDENCIES) $(EXTRA_simplessl_DEPENDENCIES) @rm -f simplessl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(simplessl_OBJECTS) $(simplessl_LDADD) $(LIBS) smtp-expn$(EXEEXT): $(smtp_expn_OBJECTS) $(smtp_expn_DEPENDENCIES) $(EXTRA_smtp_expn_DEPENDENCIES) @rm -f smtp-expn$(EXEEXT) $(AM_V_CCLD)$(LINK) $(smtp_expn_OBJECTS) $(smtp_expn_LDADD) $(LIBS) smtp-mail$(EXEEXT): $(smtp_mail_OBJECTS) $(smtp_mail_DEPENDENCIES) $(EXTRA_smtp_mail_DEPENDENCIES) @rm -f smtp-mail$(EXEEXT) $(AM_V_CCLD)$(LINK) $(smtp_mail_OBJECTS) $(smtp_mail_LDADD) $(LIBS) smtp-multi$(EXEEXT): $(smtp_multi_OBJECTS) $(smtp_multi_DEPENDENCIES) $(EXTRA_smtp_multi_DEPENDENCIES) @rm -f smtp-multi$(EXEEXT) $(AM_V_CCLD)$(LINK) $(smtp_multi_OBJECTS) $(smtp_multi_LDADD) $(LIBS) smtp-ssl$(EXEEXT): $(smtp_ssl_OBJECTS) $(smtp_ssl_DEPENDENCIES) $(EXTRA_smtp_ssl_DEPENDENCIES) @rm -f smtp-ssl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(smtp_ssl_OBJECTS) $(smtp_ssl_LDADD) $(LIBS) smtp-tls$(EXEEXT): $(smtp_tls_OBJECTS) $(smtp_tls_DEPENDENCIES) $(EXTRA_smtp_tls_DEPENDENCIES) @rm -f smtp-tls$(EXEEXT) $(AM_V_CCLD)$(LINK) $(smtp_tls_OBJECTS) $(smtp_tls_LDADD) $(LIBS) smtp-vrfy$(EXEEXT): $(smtp_vrfy_OBJECTS) $(smtp_vrfy_DEPENDENCIES) $(EXTRA_smtp_vrfy_DEPENDENCIES) @rm -f smtp-vrfy$(EXEEXT) $(AM_V_CCLD)$(LINK) $(smtp_vrfy_OBJECTS) $(smtp_vrfy_LDADD) $(LIBS) url2file$(EXEEXT): $(url2file_OBJECTS) $(url2file_DEPENDENCIES) $(EXTRA_url2file_DEPENDENCIES) @rm -f url2file$(EXEEXT) $(AM_V_CCLD)$(LINK) $(url2file_OBJECTS) $(url2file_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/10-at-a-time.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anyauthput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/certinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chkspeed.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cookie_interface.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/externalsocket.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileupload.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fopen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftp-wildcard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftpget.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftpgetinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftpgetresp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftpsget.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftpupload.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getinmemory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http-post.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpcustomheader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/https.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-append.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-copy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-create.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-delete.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-examine.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-fetch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-multi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-noop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-search.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-ssl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-store.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-tls.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi-app.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi-debugcallback.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi-double.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi-post.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi-single.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/persistant.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-dele.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-multi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-noop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-retr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-ssl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-stat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-tls.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-top.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-uidl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/post-callback.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/postinmemory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/postit2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/progressfunc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtsp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendrecv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sepheaders.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftpget.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simplepost.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simplessl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp-expn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp-mail.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp-multi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp-ssl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp-tls.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp-vrfy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/url2file.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am # Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines all: $(check_PROGRAMS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/smtp-expn.c���������������������������������������������������������������0000644�0001750�0001750�00000004743�12270035364�014353� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <string.h> #include <curl/curl.h> /* This is a simple example showing how to expand an email mailing list. * * Notes: * * 1) This example requires libcurl 7.34.0 or above. * 2) Not all email servers support this command. */ int main(void) { CURL *curl; CURLcode res; struct curl_slist *recipients = NULL; curl = curl_easy_init(); if(curl) { /* This is the URL for your mailserver */ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com"); /* Note that the CURLOPT_MAIL_RCPT takes a list, not a char array */ recipients = curl_slist_append(recipients, "Friends"); curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients); /* Set the EXPN command */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "EXPN"); /* Perform the custom request */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Free the list of recipients */ curl_slist_free_all(recipients); /* Curl won't send the QUIT command until you call cleanup, so you should * be able to re-use this connection for additional requests. It may not be * a good idea to keep the connection open for a very long time though * (more than a few minutes may result in the server timing out the * connection) and you do want to clean up in the end. */ curl_easy_cleanup(curl); } return 0; } �����������������������������curl-7.35.0/docs/examples/hiperfifo.c���������������������������������������������������������������0000644�0001750�0001750�00000027220�12213173003�014354� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* Example application source code using the multi socket interface to download many files at once. Written by Jeff Pohlmeyer Requires libevent version 2 and a (POSIX?) system that has mkfifo(). This is an adaptation of libcurl's "hipev.c" and libevent's "event-test.c" sample programs. When running, the program creates the named pipe "hiper.fifo" Whenever there is input into the fifo, the program reads the input as a list of URL's and creates some new easy handles to fetch each URL via the curl_multi "hiper" API. Thus, you can try a single URL: % echo http://www.yahoo.com > hiper.fifo Or a whole bunch of them: % cat my-url-list > hiper.fifo The fifo buffer is handled almost instantly, so you can even add more URL's while the previous requests are still being downloaded. Note: For the sake of simplicity, URL length is limited to 1023 char's ! This is purely a demo app, all retrieved data is simply discarded by the write callback. */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <sys/time.h> #include <time.h> #include <unistd.h> #include <sys/poll.h> #include <curl/curl.h> #include <event2/event.h> #include <fcntl.h> #include <sys/stat.h> #include <errno.h> #define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */ /* Global information, common to all connections */ typedef struct _GlobalInfo { struct event_base *evbase; struct event *fifo_event; struct event *timer_event; CURLM *multi; int still_running; FILE* input; } GlobalInfo; /* Information associated with a specific easy handle */ typedef struct _ConnInfo { CURL *easy; char *url; GlobalInfo *global; char error[CURL_ERROR_SIZE]; } ConnInfo; /* Information associated with a specific socket */ typedef struct _SockInfo { curl_socket_t sockfd; CURL *easy; int action; long timeout; struct event *ev; int evset; GlobalInfo *global; } SockInfo; /* Update the event timer after curl_multi library calls */ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g) { struct timeval timeout; (void)multi; /* unused */ timeout.tv_sec = timeout_ms/1000; timeout.tv_usec = (timeout_ms%1000)*1000; fprintf(MSG_OUT, "multi_timer_cb: Setting timeout to %ld ms\n", timeout_ms); evtimer_add(g->timer_event, &timeout); return 0; } /* Die if we get a bad CURLMcode somewhere */ static void mcode_or_die(const char *where, CURLMcode code) { if ( CURLM_OK != code ) { const char *s; switch (code) { case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break; case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break; case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break; case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break; case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break; case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break; case CURLM_LAST: s="CURLM_LAST"; break; default: s="CURLM_unknown"; break; case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET"; fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s); /* ignore this error */ return; } fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s); exit(code); } } /* Check for completed transfers, and remove their easy handles */ static void check_multi_info(GlobalInfo *g) { char *eff_url; CURLMsg *msg; int msgs_left; ConnInfo *conn; CURL *easy; CURLcode res; fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running); while ((msg = curl_multi_info_read(g->multi, &msgs_left))) { if (msg->msg == CURLMSG_DONE) { easy = msg->easy_handle; res = msg->data.result; curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn); curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url); fprintf(MSG_OUT, "DONE: %s => (%d) %s\n", eff_url, res, conn->error); curl_multi_remove_handle(g->multi, easy); free(conn->url); curl_easy_cleanup(easy); free(conn); } } } /* Called by libevent when we get action on a multi socket */ static void event_cb(int fd, short kind, void *userp) { GlobalInfo *g = (GlobalInfo*) userp; CURLMcode rc; int action = (kind & EV_READ ? CURL_CSELECT_IN : 0) | (kind & EV_WRITE ? CURL_CSELECT_OUT : 0); rc = curl_multi_socket_action(g->multi, fd, action, &g->still_running); mcode_or_die("event_cb: curl_multi_socket_action", rc); check_multi_info(g); if ( g->still_running <= 0 ) { fprintf(MSG_OUT, "last transfer done, kill timeout\n"); if (evtimer_pending(g->timer_event, NULL)) { evtimer_del(g->timer_event); } } } /* Called by libevent when our timeout expires */ static void timer_cb(int fd, short kind, void *userp) { GlobalInfo *g = (GlobalInfo *)userp; CURLMcode rc; (void)fd; (void)kind; rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, &g->still_running); mcode_or_die("timer_cb: curl_multi_socket_action", rc); check_multi_info(g); } /* Clean up the SockInfo structure */ static void remsock(SockInfo *f) { if (f) { if (f->evset) event_free(f->ev); free(f); } } /* Assign information to a SockInfo structure */ static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g) { int kind = (act&CURL_POLL_IN?EV_READ:0)|(act&CURL_POLL_OUT?EV_WRITE:0)|EV_PERSIST; f->sockfd = s; f->action = act; f->easy = e; if (f->evset) event_free(f->ev); f->ev = event_new(g->evbase, f->sockfd, kind, event_cb, g); f->evset = 1; event_add(f->ev, NULL); } /* Initialize a new SockInfo structure */ static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g) { SockInfo *fdp = calloc(sizeof(SockInfo), 1); fdp->global = g; setsock(fdp, s, easy, action, g); curl_multi_assign(g->multi, s, fdp); } /* CURLMOPT_SOCKETFUNCTION */ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { GlobalInfo *g = (GlobalInfo*) cbp; SockInfo *fdp = (SockInfo*) sockp; const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE" }; fprintf(MSG_OUT, "socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); if (what == CURL_POLL_REMOVE) { fprintf(MSG_OUT, "\n"); remsock(fdp); } else { if (!fdp) { fprintf(MSG_OUT, "Adding data: %s\n", whatstr[what]); addsock(s, e, what, g); } else { fprintf(MSG_OUT, "Changing action from %s to %s\n", whatstr[fdp->action], whatstr[what]); setsock(fdp, s, e, what, g); } } return 0; } /* CURLOPT_WRITEFUNCTION */ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) { size_t realsize = size * nmemb; ConnInfo *conn = (ConnInfo*) data; (void)ptr; (void)conn; return realsize; } /* CURLOPT_PROGRESSFUNCTION */ static int prog_cb (void *p, double dltotal, double dlnow, double ult, double uln) { ConnInfo *conn = (ConnInfo *)p; (void)ult; (void)uln; fprintf(MSG_OUT, "Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal); return 0; } /* Create a new easy handle, and add it to the global curl_multi */ static void new_conn(char *url, GlobalInfo *g ) { ConnInfo *conn; CURLMcode rc; conn = calloc(1, sizeof(ConnInfo)); memset(conn, 0, sizeof(ConnInfo)); conn->error[0]='\0'; conn->easy = curl_easy_init(); if (!conn->easy) { fprintf(MSG_OUT, "curl_easy_init() failed, exiting!\n"); exit(2); } conn->global = g; conn->url = strdup(url); curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url); curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn); curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 1L); curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error); curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn); curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, 0L); curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb); curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn); fprintf(MSG_OUT, "Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url); rc = curl_multi_add_handle(g->multi, conn->easy); mcode_or_die("new_conn: curl_multi_add_handle", rc); /* note that the add_handle() will set a time-out to trigger very soon so that the necessary socket_action() call will be called by this app */ } /* This gets called whenever data is received from the fifo */ static void fifo_cb(int fd, short event, void *arg) { char s[1024]; long int rv=0; int n=0; GlobalInfo *g = (GlobalInfo *)arg; (void)fd; /* unused */ (void)event; /* unused */ do { s[0]='\0'; rv=fscanf(g->input, "%1023s%n", s, &n); s[n]='\0'; if ( n && s[0] ) { new_conn(s,arg); /* if we read a URL, go get it! */ } else break; } while ( rv != EOF); } /* Create a named pipe and tell libevent to monitor it */ static const char *fifo = "hiper.fifo"; static int init_fifo (GlobalInfo *g) { struct stat st; curl_socket_t sockfd; fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo); if (lstat (fifo, &st) == 0) { if ((st.st_mode & S_IFMT) == S_IFREG) { errno = EEXIST; perror("lstat"); exit (1); } } unlink(fifo); if (mkfifo (fifo, 0600) == -1) { perror("mkfifo"); exit (1); } sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0); if (sockfd == -1) { perror("open"); exit (1); } g->input = fdopen(sockfd, "r"); fprintf(MSG_OUT, "Now, pipe some URL's into > %s\n", fifo); g->fifo_event = event_new(g->evbase, sockfd, EV_READ|EV_PERSIST, fifo_cb, g); event_add(g->fifo_event, NULL); return (0); } static void clean_fifo(GlobalInfo *g) { event_free(g->fifo_event); fclose(g->input); unlink(fifo); } int main(int argc, char **argv) { GlobalInfo g; (void)argc; (void)argv; memset(&g, 0, sizeof(GlobalInfo)); g.evbase = event_base_new(); init_fifo(&g); g.multi = curl_multi_init(); g.timer_event = evtimer_new(g.evbase, timer_cb, &g); /* setup the generic multi interface options we want */ curl_multi_setopt(g.multi, CURLMOPT_SOCKETFUNCTION, sock_cb); curl_multi_setopt(g.multi, CURLMOPT_SOCKETDATA, &g); curl_multi_setopt(g.multi, CURLMOPT_TIMERFUNCTION, multi_timer_cb); curl_multi_setopt(g.multi, CURLMOPT_TIMERDATA, &g); /* we don't call any curl_multi_socket*() function yet as we have no handles added! */ event_base_dispatch(g.evbase); /* this, of course, won't get called since only way to stop this program is via ctrl-C, but it is here to show how cleanup /would/ be done. */ clean_fifo(&g); event_free(g.timer_event); event_base_free(g.evbase); curl_multi_cleanup(g.multi); return 0; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/pop3-list.c���������������������������������������������������������������0000644�0001750�0001750�00000003557�12270035364�014254� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* This is a simple example using libcurl's POP3 capabilities to list the * contents of a mailbox. * * Note that this example requires libcurl 7.20.0 or above. */ int main(void) { CURL *curl; CURLcode res = CURLE_OK; curl = curl_easy_init(); if(curl) { /* Set username and password */ curl_easy_setopt(curl, CURLOPT_USERNAME, "user"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); /* This will list every message of the given mailbox */ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com"); /* Perform the list */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* Always cleanup */ curl_easy_cleanup(curl); } return (int)res; } �������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/opensslthreadlock.c�������������������������������������������������������0000644�0001750�0001750�00000005342�12213173003�016126� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* Example source code to show one way to set the necessary OpenSSL locking * callbacks if you want to do multi-threaded transfers with HTTPS/FTPS with * libcurl built to use OpenSSL. * * This is not a complete stand-alone example. * * Author: Jeremy Brown */ #include <stdio.h> #include <pthread.h> #include <openssl/err.h> #define MUTEX_TYPE pthread_mutex_t #define MUTEX_SETUP(x) pthread_mutex_init(&(x), NULL) #define MUTEX_CLEANUP(x) pthread_mutex_destroy(&(x)) #define MUTEX_LOCK(x) pthread_mutex_lock(&(x)) #define MUTEX_UNLOCK(x) pthread_mutex_unlock(&(x)) #define THREAD_ID pthread_self( ) void handle_error(const char *file, int lineno, const char *msg){ fprintf(stderr, "** %s:%d %s\n", file, lineno, msg); ERR_print_errors_fp(stderr); /* exit(-1); */ } /* This array will store all of the mutexes available to OpenSSL. */ static MUTEX_TYPE *mutex_buf= NULL; static void locking_function(int mode, int n, const char * file, int line) { if (mode & CRYPTO_LOCK) MUTEX_LOCK(mutex_buf[n]); else MUTEX_UNLOCK(mutex_buf[n]); } static unsigned long id_function(void) { return ((unsigned long)THREAD_ID); } int thread_setup(void) { int i; mutex_buf = malloc(CRYPTO_num_locks( ) * sizeof(MUTEX_TYPE)); if (!mutex_buf) return 0; for (i = 0; i < CRYPTO_num_locks( ); i++) MUTEX_SETUP(mutex_buf[i]); CRYPTO_set_id_callback(id_function); CRYPTO_set_locking_callback(locking_function); return 1; } int thread_cleanup(void) { int i; if (!mutex_buf) return 0; CRYPTO_set_id_callback(NULL); CRYPTO_set_locking_callback(NULL); for (i = 0; i < CRYPTO_num_locks( ); i++) MUTEX_CLEANUP(mutex_buf[i]); free(mutex_buf); mutex_buf = NULL; return 1; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/sendrecv.c����������������������������������������������������������������0000644�0001750�0001750�00000007107�12213173003�014214� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* An example of curl_easy_send() and curl_easy_recv() usage. */ #include <stdio.h> #include <string.h> #include <curl/curl.h> /* Auxiliary function that waits on the socket. */ static int wait_on_socket(curl_socket_t sockfd, int for_recv, long timeout_ms) { struct timeval tv; fd_set infd, outfd, errfd; int res; tv.tv_sec = timeout_ms / 1000; tv.tv_usec= (timeout_ms % 1000) * 1000; FD_ZERO(&infd); FD_ZERO(&outfd); FD_ZERO(&errfd); FD_SET(sockfd, &errfd); /* always check for error */ if(for_recv) { FD_SET(sockfd, &infd); } else { FD_SET(sockfd, &outfd); } /* select() returns the number of signalled sockets or -1 */ res = select(sockfd + 1, &infd, &outfd, &errfd, &tv); return res; } int main(void) { CURL *curl; CURLcode res; /* Minimalistic http request */ const char *request = "GET / HTTP/1.0\r\nHost: example.com\r\n\r\n"; curl_socket_t sockfd; /* socket */ long sockextr; size_t iolen; curl_off_t nread; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* Do not do the transfer - only connect to host */ curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L); res = curl_easy_perform(curl); if(CURLE_OK != res) { printf("Error: %s\n", strerror(res)); return 1; } /* Extract the socket from the curl handle - we'll need it for waiting. * Note that this API takes a pointer to a 'long' while we use * curl_socket_t for sockets otherwise. */ res = curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, &sockextr); if(CURLE_OK != res) { printf("Error: %s\n", curl_easy_strerror(res)); return 1; } sockfd = sockextr; /* wait for the socket to become ready for sending */ if(!wait_on_socket(sockfd, 0, 60000L)) { printf("Error: timeout.\n"); return 1; } puts("Sending request."); /* Send the request. Real applications should check the iolen * to see if all the request has been sent */ res = curl_easy_send(curl, request, strlen(request), &iolen); if(CURLE_OK != res) { printf("Error: %s\n", curl_easy_strerror(res)); return 1; } puts("Reading response."); /* read the response */ for(;;) { char buf[1024]; wait_on_socket(sockfd, 1, 60000L); res = curl_easy_recv(curl, buf, 1024, &iolen); if(CURLE_OK != res) break; nread = (curl_off_t)iolen; printf("Received %" CURL_FORMAT_CURL_OFF_T " bytes.\n", nread); } /* always cleanup */ curl_easy_cleanup(curl); } return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/smooth-gtk-thread.c�������������������������������������������������������0000644�0001750�0001750�00000014121�12213173003�015736� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* This is a multi threaded application that uses a progress bar to show * status. It uses Gtk+ to make a smooth pulse. * * Written by Jud Bishop after studying the other examples provided with * libcurl. * * To compile (on a single line): * gcc -ggdb `pkg-config --cflags --libs gtk+-2.0` -lcurl -lssl -lcrypto * -lgthread-2.0 -dl smooth-gtk-thread.c -o smooth-gtk-thread */ #include <stdio.h> #include <gtk/gtk.h> #include <glib.h> #include <unistd.h> #include <pthread.h> #include <curl/curl.h> #define NUMT 4 pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; int j = 0; gint num_urls = 9; /* Just make sure this is less than urls[]*/ const char * const urls[]= { "90022", "90023", "90024", "90025", "90026", "90027", "90028", "90029", "90030" }; size_t write_file(void *ptr, size_t size, size_t nmemb, FILE *stream) { /* printf("write_file\n"); */ return fwrite(ptr, size, nmemb, stream); } /* http://xoap.weather.com/weather/local/46214?cc=*&dayf=5&unit=i */ void *pull_one_url(void *NaN) { CURL *curl; CURLcode res; gchar *http; FILE *outfile; /* Stop threads from entering unless j is incremented */ pthread_mutex_lock(&lock); while ( j < num_urls ) { printf("j = %d\n", j); http = g_strdup_printf("xoap.weather.com/weather/local/%s?cc=*&dayf=5&unit=i\n", urls[j]); printf( "http %s", http ); curl = curl_easy_init(); if(curl) { outfile = fopen(urls[j], "w"); /* printf("fopen\n"); */ /* Set the URL and transfer type */ curl_easy_setopt(curl, CURLOPT_URL, http); /* Write to the file */ curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_file); j++; /* critical line */ pthread_mutex_unlock(&lock); res = curl_easy_perform(curl); fclose(outfile); printf("fclose\n"); curl_easy_cleanup(curl); } g_free (http); /* Adds more latency, testing the mutex.*/ sleep(1); } /* end while */ return NULL; } gboolean pulse_bar(gpointer data) { gdk_threads_enter(); gtk_progress_bar_pulse (GTK_PROGRESS_BAR (data)); gdk_threads_leave(); /* Return true so the function will be called again; * returning false removes this timeout function. */ return TRUE; } void *create_thread(void *progress_bar) { pthread_t tid[NUMT]; int i; int error; /* Make sure I don't create more threads than urls. */ for(i=0; i < NUMT && i < num_urls ; i++) { error = pthread_create(&tid[i], NULL, /* default attributes please */ pull_one_url, NULL); if(0 != error) fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error); else fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]); } /* Wait for all threads to terminate. */ for(i=0; i < NUMT && i < num_urls; i++) { error = pthread_join(tid[i], NULL); fprintf(stderr, "Thread %d terminated\n", i); } /* This stops the pulsing if you have it turned on in the progress bar section */ g_source_remove(GPOINTER_TO_INT(g_object_get_data(G_OBJECT(progress_bar), "pulse_id"))); /* This destroys the progress bar */ gtk_widget_destroy(progress_bar); /* [Un]Comment this out to kill the program rather than pushing close. */ /* gtk_main_quit(); */ return NULL; } static gboolean cb_delete(GtkWidget *window, gpointer data) { gtk_main_quit(); return FALSE; } int main(int argc, char **argv) { GtkWidget *top_window, *outside_frame, *inside_frame, *progress_bar; /* Must initialize libcurl before any threads are started */ curl_global_init(CURL_GLOBAL_ALL); /* Init thread */ g_thread_init(NULL); gdk_threads_init (); gdk_threads_enter (); gtk_init(&argc, &argv); /* Base window */ top_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); /* Frame */ outside_frame = gtk_frame_new(NULL); gtk_frame_set_shadow_type(GTK_FRAME(outside_frame), GTK_SHADOW_OUT); gtk_container_add(GTK_CONTAINER(top_window), outside_frame); /* Frame */ inside_frame = gtk_frame_new(NULL); gtk_frame_set_shadow_type(GTK_FRAME(inside_frame), GTK_SHADOW_IN); gtk_container_set_border_width(GTK_CONTAINER(inside_frame), 5); gtk_container_add(GTK_CONTAINER(outside_frame), inside_frame); /* Progress bar */ progress_bar = gtk_progress_bar_new(); gtk_progress_bar_pulse (GTK_PROGRESS_BAR (progress_bar)); /* Make uniform pulsing */ gint pulse_ref = g_timeout_add (300, pulse_bar, progress_bar); g_object_set_data(G_OBJECT(progress_bar), "pulse_id", GINT_TO_POINTER(pulse_ref)); gtk_container_add(GTK_CONTAINER(inside_frame), progress_bar); gtk_widget_show_all(top_window); printf("gtk_widget_show_all\n"); g_signal_connect(G_OBJECT (top_window), "delete-event", G_CALLBACK(cb_delete), NULL); if (!g_thread_create(&create_thread, progress_bar, FALSE, NULL) != 0) g_warning("can't create the thread"); gtk_main(); gdk_threads_leave(); printf("gdk_threads_leave\n"); return 0; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/post-callback.c�����������������������������������������������������������0000644�0001750�0001750�00000011251�12213173003�015115� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* An example source code that issues a HTTP POST and we provide the actual * data through a read callback. */ #include <stdio.h> #include <string.h> #include <curl/curl.h> const char data[]="this is what we post to the silly web server"; struct WriteThis { const char *readptr; long sizeleft; }; static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp) { struct WriteThis *pooh = (struct WriteThis *)userp; if(size*nmemb < 1) return 0; if(pooh->sizeleft) { *(char *)ptr = pooh->readptr[0]; /* copy one single byte */ pooh->readptr++; /* advance pointer */ pooh->sizeleft--; /* less data left */ return 1; /* we return 1 byte at a time! */ } return 0; /* no more data left to deliver */ } int main(void) { CURL *curl; CURLcode res; struct WriteThis pooh; pooh.readptr = data; pooh.sizeleft = (long)strlen(data); /* In windows, this will init the winsock stuff */ res = curl_global_init(CURL_GLOBAL_DEFAULT); /* Check for errors */ if(res != CURLE_OK) { fprintf(stderr, "curl_global_init() failed: %s\n", curl_easy_strerror(res)); return 1; } /* get a curl handle */ curl = curl_easy_init(); if(curl) { /* First set the URL that is about to receive our POST. */ curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/index.cgi"); /* Now specify we want to POST data */ curl_easy_setopt(curl, CURLOPT_POST, 1L); /* we want to use our own read function */ curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); /* pointer to pass to our read function */ curl_easy_setopt(curl, CURLOPT_READDATA, &pooh); /* get verbose debug output please */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* If you use POST to a HTTP 1.1 server, you can send data without knowing the size before starting the POST if you use chunked encoding. You enable this by adding a header like "Transfer-Encoding: chunked" with CURLOPT_HTTPHEADER. With HTTP 1.0 or without chunked transfer, you must specify the size in the request. */ #ifdef USE_CHUNKED { struct curl_slist *chunk = NULL; chunk = curl_slist_append(chunk, "Transfer-Encoding: chunked"); res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk); /* use curl_slist_free_all() after the *perform() call to free this list again */ } #else /* Set the expected POST size. If you want to POST large amounts of data, consider CURLOPT_POSTFIELDSIZE_LARGE */ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, pooh.sizeleft); #endif #ifdef DISABLE_EXPECT /* Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with CURLOPT_HTTPHEADER as usual. NOTE: if you want chunked transfer too, you need to combine these two since you can only set one list of headers with CURLOPT_HTTPHEADER. */ /* A less good option would be to enforce HTTP 1.0, but that might also have other implications. */ { struct curl_slist *chunk = NULL; chunk = curl_slist_append(chunk, "Expect:"); res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk); /* use curl_slist_free_all() after the *perform() call to free this list again */ } #endif /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); } curl_global_cleanup(); return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/examples/Makefile.example����������������������������������������������������������0000644�0001750�0001750�00000003562�12213173003�015332� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://curl.haxx.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is # furnished to do so, under the terms of the COPYING file. # # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # ########################################################################### # What to call the final executable TARGET = example # Which object files that the executable consists of OBJS= ftpget.o # What compiler to use CC = gcc # Compiler flags, -g for debug, -c to make an object file CFLAGS = -c -g # This should point to a directory that holds libcurl, if it isn't # in the system's standard lib dir # We also set a -L to include the directory where we have the openssl # libraries LDFLAGS = -L/home/dast/lib -L/usr/local/ssl/lib # We need -lcurl for the curl stuff # We need -lsocket and -lnsl when on Solaris # We need -lssl and -lcrypto when using libcurl with SSL support # We need -lpthread for the pthread example LIBS = -lcurl -lsocket -lnsl -lssl -lcrypto # Link the target with all objects and libraries $(TARGET) : $(OBJS) $(CC) -o $(TARGET) $(OBJS) $(LDFLAGS) $(LIBS) # Compile the source files into object files ftpget.o : ftpget.c $(CC) $(CFLAGS) $< ����������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/curl.pdf���������������������������������������������������������������������������0000644�0001750�0001750�00000302152�12272124470�012070� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������%PDF-1.4 %Çì¢ 5 0 obj <</Length 6 0 R/Filter /FlateDecode>> stream xœµXÉrÛH¼ó+júÒàYBa‡o[n«CÛˆ˜ƒƒÖ$‹"FXh,¦Ùýþ•ùÇÉW…U^æ4áI&PõÖÌ|Ÿ˜É3é_û{›Í.|öTÍLö4û4ê!km3ö/ôA´Ÿé3‚ùóC›!‹²™ðø.‹N³µ±mÊô£!>ÎÙü5_ZNÈÃÀ5n⼉SÖ?ž?F¿Ï–&·îØÂD<tÉŠí±èzfܾžÿ ¯ðT¸Ü mXŽv3ãærý{ä“erÇôÙRXôØ$7”ì?¬.ã¼ÚË’Åì_×úØÈΆ–Âãºwõáöî~uµ^k}ioÖ—®‹cyõ¨_fûž‡P‚0h}\Ãçüñ[“¡§ßì¾½\½y¸º®înjú›¨mÏ´´=“{ŽŠ;©j])~ Ñïâ:fû²ÈXQÒƒ˜U²üL÷ /ä®Û:-KúÈæÂV%ña [ Æ¢¡‡º0g‡¢7M¯Ãv•äO¬È%+ö¬>HV5ÇcQÖrÇŽeQÛ"­ØGãíÕ›hbFø67}§3ón0#¸ƒ.£W×— ö.ºWgášv'è“¥c!St ³¸0µW8²Z°ßîîß_>,ØûHßàpÏÔÖM“e[¼¬;ÜF¡Ú‘ºåêæõô´‹—úL‹«qŠœáŽáôõ[uÖç–×?yqBöóî>Õ±Àˆ£žÙ„•îàÛ×cOM»,ÝßÝÛú'þó@/†&÷]¿ 榳*Ôù;] ,†kQ¡ÀììE«é 18ºNY£ÖÆ›û¹@P¦é¡N ñޏô½jKjq—Ž[HÀ`t|¯ÉݾݛɡI�?8bjvºQuŒ.¯o/#ç;ÁþÇ9Ÿ/]Ó4"tí¶È2z�$íd•<åè_@æ4W4f»FQ>³SRЦf pÄ’¼–e¼%Và:FÏâ–k: ä§!âêfÔì|Ì-‡‡¡@'!v3G aè £©Ò"Þ„p÷¾ŽËdû\±4yVw+m«€pœ ãDyWÀqzؔŗs‡Ä…ö7n€Î¼N¶1¹¬@Åš#™Õø`Ǣ»«•n?á[<´­ž_¹òW[ä¹TaW ¤­xN$þøšÊxJY5™\°YÇi’?/Tγ¢”œ½®Ø¹hÊ4I¶‘iÑö»§Êj;6X¿%ÁCßVfO VÁºÜ´ìž‰ÚWPƼÉ6p�yÜËx©îµÝ�ÝûB(ê>j'²øyÔT®?îpyÓR8À­hJv¨XuLò¿); TÓ%†×Õo‹Ž~:s þš¾mœd‰¾ÚœQ×z¼3ÇiÚ§n~7…ãËR¦1‘(âPÎr¶’Rõ –h—Ú+_ÈE@LÕyýѰ!Ðds‡Ê$iÅ¿£h¤‰Nõ |£Ok¼Àªs^Ç_T´-é/wò(ó:޳sвŠæWBThy°¿¢-âÖÄ ämËD -àÅÞ½apÞká]P\á¨)áC)¡c1.Z³ýAÑâå’ÛdfY“ÖÉ1UÎW$Ǹ¬+êõ*t*“š” QëJ¡^m�zôN\ÁÅWªò¨™;©ü¡®¯..ª¤–üOHã¢>õQ‹úPJùãè¸(ˆö(XF¡c WŸ$ÙýÔÈœÌÁ³8=0MeÔ@JÜ‘£àõãÈ£ñ{å ~òöhŒ²Ãö»Ká#¯¿(hQQ¯¡ÿj¤ûùAÓŽBÝ)5(t›w¤q–#äÞ²,*LŠYô[ vRYƒR#ñòÞ·q–ÖÆ­¬CzâØ/êaøX€\;,±»¤‚ qªB…¼çuÚóYöͪ‰Íé4­Ä‹ZV,—sÑâÁC$d¼=°ìZ¾j+jù¼—®â|Js¤³}kžyo¸s;›E9ñt—ÛC2õÚvÇ3ÃÝ^r†ŸUJÈñ"EíÇ êî?ãÅf±ý‹ê, m œî#ùPèîòëç°Ãô3ªåÕ #øé\ÐEÊ y ­NåÏñô¢~äËŠ&¯{Œ‚#ê‘pCg .à£ÉÍÂܵº è|OO¡×ßL:°‘àÚz{@_åqÛ\u“D@òHñu'ú¨¾gOem¨Ñ—ÂûŠ Šr.wÛ.ù?ðÜ«åÁ74…(J' "OèPô$±‡lN7Œ Œÿ£_ŒòÌnëC¯£%Ó l‰Nø ¹/xît:Í=ä3p„ñC–y%Z¢¡\h¦‰þþý+¾Ã¯¬áð˜ h ÑÝuµW ïD¢Ôk$Áþ–_¿,Ô>ªå?†­ì¨püÔÈ 4ˆ‡#êÎ,y:ÔLõŽcR½a²ÚÖ†Ê]i¢ê^é'Ûiwde†0Ý’vrC#†‘u5ƒMH«F1­Œ6©M\Qå€A-óeCÿ;`pcyœI]Œßý®f;Žvæˆw /И£§Ï/q-\Pé ·§§Þ›©Ð|à âuJ1û…Èû—qN+šÿôœ§ãD@È…‰ÅÏj£S‚ðZxhXÀUK «¼ºmW°ò»çÓDáªFtý¦èä&ùSë>‚’d¼Ä Ÿ6Ûôú µµK,ʲ¿B2[š“Óô „•Z1ÛwµlWO _/ÆÊƒ±j½ÍÀq |žàþ°àœ³ñ$kõPŒms4*’$Øã]ÏÿÃ'4Žl÷{°¦Áo€õt†› FGIò¦ª©rKÉØnå±Ö#â’¶u/¡Îµ^Ti„£RR_²Ñ¢ ªŸ¹Æ»V‡ª�(`”¥z*Ó™ƒ>ºB/.w…×åîëxUõEÇáä“hgŽJë¡(ýÚ® :«¯—1|‚ˇ/T„ß!¥ÔqQ¡{çÛ¨*vÁ0íªÖÕ⡫ШbûbʰGN …¥Ùw¾åચ|¡àÚáàžÍŽRî8»Û“�”Hu­Œ’&¢ewê˘œÒ\iÚö0ÓyÓN¤JiòžNµT­l™(~H£"š¬OôUIÌ „½âtƒ l,úÞ~î6;¡ƒìúíùGmúÝ…­‡ú…dmÜ?ÌmdÜ3]ãî·‡ËÕŠÝ\F—írô횬ÞЮyQf Û»¤:¦ñ™@r=•Äþ™$=Ý5¥úVëX´›n’ïÔêLt‚¾Šûa¤ëdÚìè·…þd9LÔ:ã´WT¸J¥l–djÃÃo ™ÝcùÆüÁATê J×êâ¥oT™Ï1Tšs¤Á‚»Zù÷AX¦°TäŽ×‰» Ó—ÑìŸø÷_j;ùsendstream endobj 6 0 obj 2499 endobj 14 0 obj <</Length 15 0 R/Filter /FlateDecode>> stream xœåXMoãȽëW4¼‡¥�±‡Ý¤ø‘C€$È`f1³vÖ r°÷Ð[23©%)Éþ³ÿ9¯úƒ¢4>d€Í)0fl‰dwÕ«W¯^ó7qÁ"úq¿×»Ù»_2¶ígÛÎ~› s‘¹_ëûë 7äôÅj3³Ï–I–1Ï ¶ÚÍD–ó<[²Õiö¬]ýˆÇ9ûþš‡2)x‘/ƒÏª9¨š—ç¿®~šÅ) ñoUÎ"ž¤ÅyVVý¾V¯=ž«ž•jPlhñA³Aw»ªÁRO¯¬Ô›9-%Y õ°`}˪ {m¬jÌaÄ%[­g2Yò"É=v Ží|õoº&èZÁÝ÷O3 "ø¢Ùšîˆè²H9²s7$öŠ•-S k÷ºSCÕ6øP²j`Y=µ‡·˜}d&yRä,Ò®üh•SW úÍìX†}÷‹ˆ<ö"ã…t �õTëÞÞãË,Í净ÖÚwí¶Ó}ÏvË2Õ³_w§ª×䉠+"í¡.qî<ìM}èwÕKÕl-ŒbÓî>þõH÷mÓÛ¤8E'¶ú„”c‘›‡>Úòœæ?Îâ„'"õÈÆÂ PÍÀÔuð›¶cV«;vw{¿bøp÷Ï6ûí û¡_˜­K‚±ÓeÕéõ`2ãq)Ù‚H¾¤Â†.�—T ¾žkN·DcªA­ìÐÖ?ëº>ïòüùq¾`a˾ÖúWŠ­¯vU­ºùrp‡-Øæ£!HÓÚ{µÙB¤ß#ÅþnUIõžÕ0aWÙjû\¿Gýˆ_ª™¤G�Ñ3üµ;çñ<Ž„»0-Ð5ëLÁÂX.…÷ÁWlßé Uù\š›'ÕÝ ÑúA#Þv㟋ĒY°=�[Àyñ(Êâ`a�™ÐZ¢žÕá—|¾Œ !p¡«tSr{k[y±¤»C™ Å(gІ¦'nïVo¾ÿ¦I|Áo÷„kÏúAuhˆjxfm£©„Ãi¬� yâ¢hË7H(°¢çìóEA’á¹ïÉ×v.—Q° f)¸‘ôwPë¹ˆÛ É‹*ËÊÔÿ8—‰iÙ@Õ ÂÏÅ2x!R£Ÿ=Ó ^ዽJ¬Ô¬ˆjÏ-Ò¼!×:,ó ‘nçKçö™KCFmrAòÅrÈ$f½µÛSOìÔ+{Òh 4Ÿ°3¿ ;ATµÖ¸>œ´n¬ºå\ O–VªÁ©g<qg’rðÅíK·9u@æ ¦jÚaû<nAŠ ÌÖínn –^ïÚ¦5m�é¢Ç o‰‰]Ñøê¢”iá™,ê­~S¶‡§ ¨€Mh:gcW¦bµDf Ÿ<sK¿Œ‹\æ…'ÓŸ+s»€C.móPò®Î~ͱÐ"ÎìÊ÷¦ÊGÛ…iè®'òxbM)ÛæG³Žä)=G�$\D^=†fª‰È|‡’ÆzŽ»'\e^vÔÒ(óß; clÛâJ c üÈÇž:T`5lFNU(hY©Aׯ–ð@¢ÈëµZ?Û¡6&“š­‹”§c2‹zŒ T¤ç~«¾Œ3P[X3_Œ¹‡Àöõš©šQCбßëuµyëiÿ°ð4ùdêIxƒÊ*ºðé8O]1m!a9⥌ ÛêZ_/ÌŠOm[ku.œ‚膦¾ë´0Ä µ h„4: ©}æJ÷0ÒdT#ŠîUƒeÛ¹ ªR5Ì‹óV®ý&Š• ¯zM^ 6<aîÏEÁÙŠ(Wõ ;]2Ô;;[¡4· ¨¨¸ò<B^F¬‘v1ÖÐßOsŒ¤¯/ÆËP°7熳­%C :xÑ>é‹f…%£ìG1ù¦Yq_fu§ƒ#³R"²Â­ç£b4ôaHmFCiŸ'=BÕl×öèÜ6øÏ|‡ZXl¢%ðé@°íž1¡´&xÓq §Éžö·gî1”aè€s‚€ááÁˆþŽÃÁ¬(º5±t?øÂ7íȼÓ\Ðô– ÆM#jˆe½qv×ÙÞ‰—¾Vžƒ°‰«öÐ#QJÚ àY|é$Ç4H>´Û-1°mÞµ›éŽ2.Ïß ¦)-Š8hº‹‰šŽ轆t”†XnÈY¿…9A PWgÇ™„Â2çÅÄC„?æ{ÏÂò˜’œ…þ³úb‹$ [¤œË‰ÝZOG%áÊŠ|<J¸ãÎÙZ)3*#7ã—ØûÚmÁ¹4¥êJ âÐU )e¥Öõxå£s¬[^¨Phòq)Û’„åý< {̵˔‚Ç€Ì8y«yæŒLqoŽw$Ì„·±ëG’MG8¬3 ߺipUƒˆpýêL&ÌõŸìóðGoDøÀĘ ‘BT½AÕä˜fBÐsú5Î_ÎÍÇ<rÇÚ·b•× B%„°mz´HÒË «¾?hƒ”?ñ8ðL&’šÐD?š 3ã)‘¼PW¿Ò½uõDëùC±°Œ¤³YpR$£×…û§:³(Òn)r¨j3†ûÃ~Ož&ôMLˆ†ËœÑTÑk¨ûã5¼¿ÿ4ÞÖm·Ö—å[}º7ep@¹²Ó3\“staÛ° ”¹4r‡»v°÷º›®`›®âMªI ´ïë£üÎ@qñÛ@å(=þ]Æ>Ðø4þßšP Õþ˜\w„·8qšøh*©=ù 0»­´¿=MD ;4fEBùñÎ¥aÚޤу§ç 6Ѿ–©6îwÇ4t‹ãüîXmÞ8¹¡9\ô¡ `Ú+©sèfÚ)Å䨇ycÂÄŽ‰ßÐô¿ò‚€(áY2…*uP¥ÿoP¥ß •"¨Ô~¯­™š‚%Sk±ƒ÷«»w÷ïØþ‹èmÏôâνvYØ7ާŠ<=½èñÙ•Ç7&ÎD0™£×“ð›´Í¶úk­§Ã®½ðŸY‘M¯í§üÆ~]8BÂmòe2É*s'gz‹hG)g­- ÝémNyÖš,sÿ"c|C4è©e¥w&Á <éÂÚj:‡À.uÆFñy¸Ì–0."ø™ßÀõ»ÚÊl¸’^Íö펔áƒÿ…cCt}®²¢Wš'‚HVͺ>””Í-àÆósWpAÃ$æNÑèå2ŒÌ0VÁ™ç|ÈŒýt€‰‘æ¡$õG}£Ý_ÍþŸÿ�©hœendstream endobj 15 0 obj 2404 endobj 19 0 obj <</Length 20 0 R/Filter /FlateDecode>> stream xœÍYÛrÛÈ}çWLô"0%À˜Á=ko•ÖëÝõ–í86;Cp(b4.R˜oÐG§»ç–í¤*)ïZ21èéé>}úôð3 ÎBüc~–ûÅ“w»é!»Y|^pzÈÌrÏ~ZÁ‚?XmúÎ2Á²" ò‚­ö žåAž%lu¿øè•cWòø§%{¿-}A‘'ÞkÙŒ²fîñò«ßQÊ|øµÍémÿúŠùþØ«n) ³ÈóåjöTÿ臮jn~tosAoi$´…OÞo«Õ[ØþýA•ÕöȆb¬A§°ÇÌZÖ«fƒ?q%¾ tw´ƒHEÂa ,¬þXDÇÊE^Â< ÞãÃpðBØí^±µÜÔG¶iÅžÿú²g[\[$AçzºÏÑ}OV5«è¹eiÍN-vUÏT½aUß\âRø¬\$QZ›ÞÐ;—Š M Ûƒ xØ‹×í¿ªº–Oâ ¼ØêÄPžQ’Ù#¨él"ˆ£‚[¯)å^S¶8d-›ÛžU …Q÷Šõc×µ#†×}Èî«aÇzø­&Ã>OyðÈ”Œ~ÛA±½ìn{p\ʆɺoÙ,ÁÈ ˜EOÞñÐ"4E¼×ýßN;%7:{8Ir{ÄÃPµ k·¬lÇ®W9&,‚ ˆ˜½Ü2нY ¿N7à -†zJ(Ö"‰1{§f)y‘ÛtP CµWý¦–ýÀ÷<Ö>ð( ’b“9¾ %âËfÉï(Ça÷E"9«ƒÕ23•¤êº§Äü?ÜŒbí80´Q•’εWîݰõ‘UC¯êí“?ðˆ\Ý·àj¯Jz¹¡ÏÈÜÿÕ‚‘®C¯S{L`_Á_e-«}O•6m7˜ŒÂT°ÕCf7-ÂC²N}ü÷-wª¼¥:…Í;ÕÚ¦Wþòѧ᧳K‘{vhû¾ZC¹UÍf,É^ìçq„‘Cn\è0ýsè$kÔp¿Ø"ͽ¶»e„Yàz˜\¥dWM?À~ˆÀà ýíàÁ7›œ ¹¬ÊÇc|ÅîwU¹cÇv$toZõ E˜®¨}-ûª<ŲȀ( põ’«³÷ 8›êfÉ B€ÉçÉL“|ÛØh†z¯¹‚à>ó"Fn°Ž^Éôñs ýfs^°hɹبez7íPÉA9GóšÕõ¥I¸"3ŠúDß°“ä ³DU/äÀ5!Žw!²¸œŠ ³Ü´À¬l÷{h ˜ð-¥R3êVn€½»vT¶©š+d±RA�Q ¶U§ÙÀnc�-!׿‘ƒÄJ ƒ.4ÜW`Aj†ÔÜYÖ>ÙP°L®k…ohË"N!KÇh–¬ÞÚF¥�ÍÈJ»v„!» ÷LkF3oÏúÑÓ'Ã(Íφ¦ô`<ÕiàAmˆ ]ùÄA†£<´[¶ím¥ØÓFîÕ3<÷Ô@gdÅûŽ«ÞÒ hWyVØqnJUö=9eCxÚ®y.eÚ4“=¥Þ‚2`Z‰x €ëãdâ�Ðy˜xwU;ö5æ°T•>‘%ô(A(âïQúFñàÀµ³¼‹Ìè -uAòö-¢½…Ž)ÙÅ{5øÏÉå¿\°ºj”Ž+îNB—n‘i­ìLš&¦ñnÛn ¿xƒîpèr‘Èlu]¿~ÁŸý}É#ÜÜ»~õáÿÁž5¢³ú´¼ÜáÃ{s=µ~Ð ¹-ïÞëšÊc²%.K‚z¥©IðºHÉkÀgÓ²Ëg—¬?î×m=cUÝáØWXMðùÐ) €ÎåC­D˜têCX �˃.‰(ʃ(Œ]Œ Í�6¥ýÐvÊdǬt�\{f Šè·Ô<ÅwrᤠˠØZ"‚ m•P @H±ÇýÀ$\jÙKå.�]ª[˜4m—Ž,‡Ê7ªBèÄIaì€åÝÍù•O8„L ]TƒÒåraw lº s0*ä½¼Õ¾ç¢Ð.¦ -…«r®i³°˜vÐJ•re‡ÊijèͰٷ6†ÈÀÜQkš 4MšÍx Ëu‘h¶½\&¨X¢ T„¡o DvYWå"#�u—˜J†Mصzø'yë¿BRª[Ý‚ÏÔ` 1ŒOÄ 6~…ȳ%Õjv}¨�5¥FÀ(;ëù& šO† „ÍYFµ°¶#«oÔЗò žUnâ8Û?ЮۢÞZýù£÷æ¯Ø1W/λ94‡0qR=M3=ÀQì9z‘�×È®×÷gŒ~:ïxQLûèŠBÜ@õQÙHÌÝaÝ÷¦u±ZW×',ÐØ(BljS…æ©ñ›\vƒJ–SµaAçnÖêç€M³Ô>Àì¾WVÊž7O€9hD®Ãå—Ó¹ý?äÙ‘Fn:´D§Õeüt0€™j¦î,käÉ—½¤émñ»³˜Dø4]ФxÇfsÌk|š&­÷®C´iŠO¡œ�M4«Ëí\ü!+8}éÿŒ!ÙŒûãƒUô9‘ö'3Ä€Ûÿ_s”çÿdn|Ù—Uu*M@‘ü²zûäÕÏúã@¤ÂC3‡_£`yÑ<»~ÿüåKèY²é·: jõ(ÍA¾g™¥ƒ_¦œag·AÜÀ†'/‚ª‡aÞééÁ½˜y–OC¸Vç²j€6JEsœ¦PxøáÝ+­‰AÛj0@ç�MŸ BbÖ‹†ãA=»¾0#IW)!f½Q¤`[TŒ8HjY‹=R‘ÀÉ“æ+7Db•¦Ãþ#Ô¾T7NÓM”ÚóÅYq*‰âp\d:ÈÉŒ‹•Nøÿ Íž aÓdGŠP¡ªõäXFŸ!t”u}Ô>Û½IåB“ÔØ¡m�$ÓàO"ô¢¢è´'碀RI¿ƒñ^×UÀÇõ*^„/)±ðoL›jë– 1M§‡7J è}?¡#D>yýÍ[ögdâ4:]°¸yð«ƒà7Ž~1VžL¥í¬z,œÛý†ù´Ë>Q~ZN÷>i1ÇåY`O‘*Q’~1ÒÄÙWï![£‡ð]Ä…¾rEäIÈÅì}‡W&�6×(åvÀ¡µÏ¡V(ŠÝ<èKÖé¹_ÙéO !€.±ÑåIħ^!Nä2)kÒ-rÒè24ñ{¨.Rä3£zbšãZ@TC×”§F'š¶'צ\ØTàþú I÷,PQäD–G38iðÐMó t�_H'Ó#‡‹$È€Û¦Õ¥ätc.<ÆÓÙŽaÔLý=pz”4›½ö1n8„æ‚4Ý#ZýB`ùZ1f'iîFbûÝ»ð/ts;×MÖ¡ŠÂÓ@‚µ4(Ʊ±7´û=òŽ8–1ÈÎð’›4x<o¼_™2>zƒš9ýä¦jÌ} À¤Êаì¢9…nžuŸë¦ÓÐ.49$…'©zÈS3®j_ñ{‡ïxŠŽš‰²ýŠòFË&ø†Ò̓db>3%hÂã š]B…‰wg1BÞ€mnì­ #ÐmVZ@P×K‘ÐÍ�_xT:€é+PŽª^_±Ò„ŒÕAACå~×~(ü³«*˜¿ªqg˜¼á”ûKØÄm*M8w6 øìyªÖ@¬¤‚g5oÌž‰Ûn.òÜi …WÃL_Ó.�jNg%•%ºÇª®ƒÝËZÉ®>êodDB³�p„ˆÝ€|˜kQLÀ¾¼Óè¿”:49 /³A&KÌEºì|cSõ0¾տЭÝWI(zóFDÐÄsWá4”ºR›µ,o©Ða{9Óö4Çë–+×$Ÿ°NÝý50ýÔm_ £tHû†v¾üHç¾'>zDHg éØ| ˆeªÕ%¡�€%žÈØï#B„\йãÔŒV^„V^¬ƒ?ÿ6‹à|endstream endobj 20 0 obj 3004 endobj 24 0 obj <</Length 25 0 R/Filter /FlateDecode>> stream xœÍYkoÛÈýî_1Ø~U˜#rø^ ´n²›…Ó¤–Òµ‹‚G7|…;úþÑ=w¢$'@¿ô V,rfîãÜsÏ|a÷™GÌ禾XÞ$ìa¸ðØÃÅ— _=dæcS³?®ñBJ_¬·zÏÁ’,àiÆÖõ…Ÿ¤<M"¶~º¸u6S_Ý9þÝ‚]á_ W„ÏÒÈyŸ7S^±ÃãÅ?Ö¿^1sñw]àpµÚ½ºd®»i›±l&éæ#{Ýn"âž—ÎvãO‡…¾P y…zñ•Y¶¼‘ÃTK–³®—zq–:e; ì¹’lìófØÊžaûq'ÙC©öt8±¹žÏ³8…£Øßy”‹õo÷"õ0ã"ÍÒÐ<lZzˆ•B=ôÕk¾y¸ÝÒCÄ<ô=?ÖÈd-þp¶Ö&è}´¡àÿ¹ãoéXVÊw¹ðCžežp¾æ›‘5S}/{ŽÀ\$éhá èvËî÷£¤§²ªØ½dÃç²ëdqÉ6íD‰x`Û¾­Õ)÷8†Ò Bç¡lz†=èÉÐNýFª´ÜËmÛKVjÛLŽzY(kȆk’õïo±U« 9à |,Û†/ÜÈóœw[6 ²€QãŽM]ÕæÅp©Þ}»þÈÙ?*Kü0v�€M[×yS°Õ»¿¿Ñ~4íH¾¨=î÷ ®\ Be�³T¥îÓ Ùîs`dŒ¬4¶é—|ÛFmòªÚ³gìßNÓNör¹k¯."ž*¤#›–§q!²Œ'Yä´:*y"䈅ÅN˜eÊ�qòÌÆŠÒM[g´* x%©Ý›¿S{g^âŒã¼·Ÿð M2ƒ˜lÈs… ¬ Œ¹/„…€sÓ„Gç"UðïâTŸH/x‡’w¦±›ÆeÙà'¡` �>?L½ÔàBä¸:Sd<ðášK‰À–ï?�JÛQö 2*gƒ<±0TÇöy/­ëÁKcYK”*pn#À¦µ~�—C„#F}ÒRpUÙ!±{]•´lËÌ?©²=ДÏãÐWß9«Õ5èqÕÉMù ‡Ÿvåfg—‘û8•²LØÈ·≳CX=á÷vÚîÙ£:2õ�ës^•…ΤùÚš“ ¯Èf+Înd^ dà:ƒ…æ}b!Ǽ¬z¤‚þéæúGÚvyã{¶3¨¥ÚÜc÷ãrùôô´HB"îØám'›a¨8pz^œ:Ë¢Ý Ë¼ë†¥>k¡:E9ßu¥P:·[€^XøójuˆDÄ”µ¢4 #Ì…lF!°Ô°0‚<£Šÿ¹™Ö×+Ôí„<ÛÈï OuŽ(æû`RŠ^½Ro®¦r•6c¿×=ņèÕq„@XØz4Az(G¾•Ââ›6•»†}ÕÛ&]x¿F â#‘B ~¬^ÖmñO„–Ó¿»*/Vû5òw*)ìéQߎ«òèûEõê¿ZSmÎ=à•ó"‚ 0EôËzýUt#¿Lhèõó"†®m:EµœkÚM^=´=ZC=h¶¦®kûV(†ü„<‚5ãrôy¨öŸÙ8ÓY„Ââ@ ¦ØbÅþÜ9½8ÖsjŽÌD¢@áͨZWÌc/ü^È8Õ-©©nd<²Á¦ýÝz¼Ò¨ycœÃz‰c „âRy­ùÔì`mÔö©ôô’–Ñè¿@\R]†7Ȍϒ¥(Ê¥lSŸ{=H|Uœ ‚èÆõ>ÿZÖS­àAõeÞ×|¿o'$©ju+‰ƒT9ãab¡õ47“8°í‹NHµ'ÌÉŒXÐÍŸÔNäS¤èëü³.í @5ÌKá$~(åˆ@ãý³“œ¶¹Te]ŽGM€ÎŽ<ô³IÝ.ä% í£€ˆß­É²8Ç�ÀÛ´¬&u8¨²YÂÓð�€ÀÓ±]•´#šºàÞåñ6¦‡êE˲ÀHç|³‘|(ÐIj”PJ$¯&*âû…ð´€›´h†ZœL+uCÀÁê^æº{aÇ©Ï7Z­ó0””É w|Ëû|„Yì GšD@Ã$³ÞÉ]ò”AÝ2 {ª7To”Æ'@ve‰"pëênSª—®$qÁÐÚ¤7²$â‘-h·¦y¤Î¿*xë7-qÆ>±ƒÕN:ÌF«�æÿ7©‚ŒÒ-Ê~8¯Í0Ò-íoF7àñ7–2Zééo+D=…±V{!߇ñÑi„4iƒµAÊ�¤˜£V-t3º8’5¶ø}WÊ>×Ú­/ ¬Ütuö6Ÿ¨›!/ÕÁ æà)À‰ØƒÀàš#À@áQm{†Le`*°©ÓëɉÂȈ¾ñÀ/$üŒ§"ø^€Þ‰ Ì ;ê[²B±3…žq÷R€>ú·¶…ª6] µæ§gŒßäµÔ¢ŸXÛ³r;{ˆqÌ8‰®RÁÿbOCcä|…`º´‹,þt€ njMß\ƒkݲ „„<ÄÉ ¡Ð˺å!û¥’Ç ’á`Þ ŸG£†V -*.çæð$§“~ÿ"„< ¼¹îvìP"J_¥Ð޶VfUz&œâ€g±g™‚îG#™‹îVU]µ]¸>ÕòV‰–«¶9½qHRÏ[}¿úGvý–úÖÕ >Q¡zÀå Ã(D,ÃüÌÞÿuÅeyw mUІQAE#÷küxѧ…m Zd­–0z«?ö­nŸ"qË‚îWhšoÞÓñµº@%äìJöcù¼¡¬ÞHë®Põ–‚9­O푳©­Aè ’šíÙ5‰s¥ê|¯Ú€kšÏ“ðŒú1 u’†ûƒF[Ј€àÝ+q0Àƒ^iE{…¢°å–ù'¦Q’N¬s>ç'æüês^ô?¦ÏWôol¸sþPšÕ1¿d<¹[h¼žh¹‚š]‘9{M?_ #Ó—|³ú^I-ÜŽZ³ZNýŸ}ü°Z#¼ZŸ Fë´£úMS~Puúú"P:Ooi¶:/KH”¹—8ͱT M’P“%áAÿ ÄkO T¹–1{ƒ£aá´?s¡sß«\ÓZj9Ó†Aá,†Z·d”Sœ{%Ùž«JGbù—õûkUJ®k‘o‚3ÝC!BC‘‡ˆ~Fó±¹õŒxP6 ›€âÄ<´+Á®oYsº$°N]>˜žDÁ?‘»¤â0,Â\]§æRa¥»ã¾Cw]Uê2[~u1´»ä‚‹eãͽŠl•ˆU]ñ c ê tŽ!)B ˜4ŽíKš‡:îÛ#âNìÛ—îô)ªjfneÐiƒƒD³ôâgGº>Å8¶àR}õ2üt»(°ìk.F~òálë6g¡=XïåæÃ¦,_©¢‘£­ã#f¿uøz)÷SÝþLò†Éë¥zÒléê…RÚM½Ä q_6¹îc‡“hÒ<\:—ûy4ÒÛe1±a×NAuÕ=Ï ¿)+>«9íቜ<—ËÁ£œ ‡ùÖSMÅF³õQÒƒˆ§ñ¬š?͇<9äôÖ¹¹vÕÔªå!Í#j¡Y(×Uö,áÍ‹Ôàiϳ3,:õE¡š6=Sò ç<„B‰è¿'Rj‹èÿ3Àž"áúyLì9"a¿NH@™)ÂØŠ½öy³¾ø þü fÛýiendstream endobj 25 0 obj 2755 endobj 29 0 obj <</Length 30 0 R/Filter /FlateDecode>> stream xœ­XÛ’ÛÆ}çWŒýàS‹1fp›IySJä\ì’EfJÚ<€Àì.¼ †@Qü}tº§1�AqSI*µK@wOŸÓ§»ñ+‹¸`þÿËÝêÛw9{ìW{\ýºî"ÿ•;ö‡ Ü ð‡ÍÊž,—,×1Wšmv+‘+®ò”mŽ«Ayèšû@ܯÙkø´e¢¹ViðSÑІM—×ÿÜü¸3aœ±MµŠx”Æh!øáízóËJò*WBñ4ŠÑ5Üø!8ÙµLS.• g&»¤àRdtZ“ÎÚ“é ³û¡¶mÏêžzS±í žŠ–Ù¶„Ë-|1¬/v†•v·+ÚŠ5uknÝÏU1l_›Òô¬ß›²þl* /Œ5Ï…,’|& àX7 Û¶3Þ˜dâÕ>²$IÜ]È` øèرžXÁz³/ºb¨ÛGöMØŸv[Ûp¶y:ô·8þzV¬…8甆­MÃàkÿ îî{èO7..Dòz¿c|ÁÑâe—+!¹Ú‡äÂ94{4­÷"ÙÛ~`åÓ¡}ÆD ¬±ö¹‡¬<È8+iÆULFs3[¸Ì¼õà,ÜoÎcå.X‘k.2¡ì¤yæYp²ÖE7Ì0¸4á·Æ ¤íAÔ¶²x†-Fÿ¹1.M`¸XT³…‡Îîn™íXÈêŒ�“óǹ#Ìæ7H°;®‘¶"ÓAÑ޵×mA„UÝröÓ¡ê=¸×=+ZEÓ[ŒÆs†³·Sq~¸ úò<ÓÞ¹½b7Ön‹îbŒFQ¢wÂø€†+Û—gäÛw"òEª2ž*9æ? Ñu.c™ó<ò�½"?xGŒÀ!„q1EÞ?c …7=ùdZFæ±´‹ÁI‡Ë,³S™8xñ”K2É”ç±VžMÃäÑU™–¾úŒ·ß®«‹GD~8tPÙX²­]€<åqpÄòí™/Ä~èêýRjwÙ sÁ“Ü…8LyúþsØíÃ'8°ë;ˆòw.-SôÁû®Œ£À¾³ƒ-mÃèn<?ÉȈ72Áq© SÉòæ òEª„™%ªNø<¨;bV' ê<Íáj?n™Ù%–&pí/›Í[Öcd½i+ X £z‚'©r© •\CrBçÆÊ‘]à~kźu¢TZH¯«º]ß ÂH‚LóD’|´gyËÂq{õ ¬'²*«L OÖ-‚Pº—” ch$I¢–<¢~yiïžù–³Ýð"ûl;‹yGSƒ9ZM È<8"„ëøš*ë©B>š3*ƒ¢)­’ñRWlçêɱԵwD"Få-Àù4ÃL±ö#]…ιždRp×lƒ÷ˆ•ëh�ÔŸ6o]·A?Ð…˜‚»=/&©¢HMõ‹OÀÝG¼#\(ŸðÑ „»‡jÕUáâkûxcPrÚ¯G}íŠÑ‰ÜG"Cϧê ß§\º ÖxŽéßd²-f ÎÑQ©…(lS3ñdXV›KXo1h ½rAt IhõÎôÔušºi0É »Zœó4@”§’aÑ—u;ÃÏ—Âò³¹d0(“>cpuË®Iy|N©€Üëå}!nä[·EwºÀ‡à>@ÁÍ©�=µ*³ið©(‡æÄŠy¢nÜZwüiè F˜•\¹AŸz{Q9q¤y¶„®¥×J‡OH„1LzÆ–+•ül¶¤Ó*牜æ4¥hšû~lo˜ã%±ÞÕ ©Hè›Æ@-èA˜#aœ‚Œ]*SÊ!WbÑž‰KdSP…<öZQYäݘj x”f?PÀÆ*¥¤ö+ðËÙaÓ2®ÚP8‹»Í¶Kx¤ñ%<ò :á:Jó4ÖKqîÝÐnÛeµÁdª³ÿH;«óŠW“FPvDõ,ç ÁÄ )ÔS÷1ç{©òÑjNëÍ…XÌöƒmj*W0ýSŸcŸ; ›Ó††Hµc&Peú²«·ŽL—³›TˆDÌEO«`"òiÕ¸>Ó%ç oÌND¿MB@ÀŒœƒ†nÚÒVæª �‘cA‡~In}!øÙǺef ýÖ5Õâ™N yk·wá´7݃ív½_è ̼{º�!£œÝ¿¯**Àú`‡t³ˆr¬uC–äJRkÜÀì —cžKÚU4:õ”3¯g^%À+VH9î±þƅݾ©aø"¬)IlB3iVÒ#„D Üh¢¥|_A¡¹€,倬Šh„+‰âÙŒä;ìi^awÁºgk”ú$]Ôìà¶ ÌŒ¤Ô4ƒá¹<.) ‚û¢ïÝ*JÍiØÖìƒ;öÈî9ÇîþÔŧµ@ƧI`úßÒ¤éHöfåýcþ§…<UÑQÈUÅ®x¦#n͇m2Q~OL9C$¸Ò^‘0Ɖ4 ûãbZð4Ä*<ò(A8#h¡y84¬·žq$ q¹:ÓnIAz‹(ºí ÉSc_æÊ3¹Ðé$MCM¢= ºt$æÁït…=¥{5¿¿ˆ¡Z©Iq¤&uo@nŠñ\.wnJ>¤¦­> Çb…Ò‰š6uÜQ€``(ŸëqvÊŽò‚K# ¨²Ë¢7¸{Ž„p«ÖWÔ>œpøqãÎ3àBQ„Ò×I a"pgHS(Çü: ÒL‹ÿ…·­™Ò °;F)…–à;HåËÎÕÚt¦l£àø¹‚TuqT÷zãêqõçÓÄÉV sbz•ó† 5ÍâQ’Ó[š—ÏíjúËÃÿÕº}•Hϼ…¾ÞH.°v& T3•ö'PÔÊhö úÓà†xZgiÀ¯0àÕ8Y]2 ËÅK)ÁG2 ¦Ù`™‘(òŒ�-ª³—)x¾ÇzÑÞE¡ì/Ú;:º2Í´ŸgOÐ5bé 1£CAc )FTß“1X!u6õíSëǦt4‡›P>ž“:™÷47»Ý¯oÏò<N˜¸½g`9Li¤ð ×¹çëÛ¿ý¼Yç èN&<DÖ,„>#Â7´ÐLaiŠÖ�T°¦2Ù„I_FBº§’Ì+GŠáüq³ú;üý /­Dendstream endobj 30 0 obj 2359 endobj 34 0 obj <</Length 35 0 R/Filter /FlateDecode>> stream xœÝYMsãÆ½ëWÌÍ`J€1ƒïªÄ•MVNloleEû"å�# Yà hþç?çõ| V^'•Sj☞žî×ïu?²0à,¤æïvõåûŒí†«í®>^qõ™?Û=ûÓ/äôÅúñJ¯á,,+¢ /Øzų<ȳ„­OW÷ÞöØ7X±?ãÓÊqyâý­leÃÜãÕ?Öß^ÁŒ¥l]]ym¹—ü¥‘ôwµþç¾ö¹ Gaâ=÷ÖOõÀNuÓ°}ùA½pz´½JÒ £¾‘-¹¥‡!=à"a¾ÇÞ¬éÊŠUåX²Ç¾Û³ñI²]M¯ûˆH¢–„aÆfɳ´ûpzV"/rû°ýeÚ' ²(4Ç\yÜHöàÕí¶9Vu»ce»°–FA‘ n¬[ã†HŒE¼fÊÓ´bÚ35u+‡‡Õ5ûñý;_¶Û®Rû"ƒxÃ$‰”GãS9êó—mÅå0°zd]ËêVãö‡»µv2¤Ø.΂Û#ë¹i*ḻ”R‹ýÈvr`ŸÉ”ó¡Þµ¬<d[Éêšõr86£¯¼äIŽXe“›O•›­ZäË÷<4èiÀ aONÛý)Õ‡®|€Çßví(Û‘Ö‰ '[Û9z2»<ø~’$J\ò"n°Ü’©xötÀŸ\ñ˜{?äv”;¶‘³øW Û>O‘8·g»÷ʦ—eu^¥X_ˆÌ ô{TøU^ù~%i€* �!-lœw¥s»¢ Œ¡ÎnL¾»ùéæÎa‡"²xwr¼ˆ(O‚dÂ’[8…,ÏCnC#"y”¨C Ì ûg:“ìÙ‰"L!VeÓtê\ ÄÅdEWÇIïʼnãwuñÚ‰=dçô$[ÚkÛíå@¶Žð†m{YuÙ ûq@BTE�>a.ÖôINõøÄþrw÷å‡áþFöÝ 3£“òîjý»{¯íZ¹Bš’Ô{Ûµ_¨ç8’ážhÊÏ8÷6ãŠ-T„BÁÒ `æ*— #ãö!^TÁjϬš›Qb©á"z¨ËYN_ è"ào>ðÞ;tM½]ñÄ;ãÌßÒ& ­v—$&Âû\Žp¢8ÖÈD~êGE:]Ûœé3ç‡ïü7wþÛ›w7yC&8E³˜­6€[ß°•;ÂÔ GËUß­„)E“7…Åz‹ª­·L“ Kí™åx­N%�a–/ àžêí“B-äe£îdU6{¦ã¡ƒœê ‹Œa˜;p§G‰9g]66·ô< ø §rΦ‰Ëù½wV~ **ïG°J[Õ”0Ôyª*ƒ¥¢ÀRÀÓ¸à5kÐjB5j«n‘Ò4ùmÀ‘6"æŒwÕ;9ŒF¾M SìÞ_×ë[ô7m¹i€ú/{«V°òˆ|¢b·¥‚%SJ_+ Y>bÃöIî -z¹¨p8Àc1©¥;ü„lCœ`S#!…�)ðkŠ$ATR dEQ‘ÛS$‘Ö¥®¯tã°‘$Q<c݉<Â"^:HDéKGúqæ!Ó©€iÜ#m§º—„øm#KdN:®ýyT솳P°Z"ÁMÝê0)ZS²Õõ{@=WR”od¼ð¦(ò‡‹„ï—.Õ� š&Ž—„nË “µ'@EÅ©(X©¥í0N+ô€EîDøv'ñ¨ºK§ íè#së–ߎÍþbÿ8ˆ]R¼ë 1KàÏ3‹x«8ôv”`”f7k #\cG/…1 Ä$A¾_¶gâÒU�ÖÆc׃-ìTŽAˆÇ1&HC ÁEº¢iç›G@D|B�+DrõÅ*DF$ŸÃu^k¬!„ךb)ý¿ôuwÒÚ5ŒeA_”î@eéËCo Ø5e<×y~ð¾V¼^¥…‘ûF·ôŠP´µ-¶"ö¤7·ï Y¥Y¡µ+®g ÇqÔOo“îUìL(é4"4VÜÕùzûi^·ß#±ƒnªN5àÛñ²Ùé%™Ý46›>Köõ\l“O8öû²|“nˆhMAZ÷e&„f!=¹èzT,>×ò#üœ,QM¦çAg–tjMç£b­f±¶ •²2E½¯^½¾fã<fŽ3§ (d.ìY¬|ŒÀ;ÂM$ëÍÜDžpë½D%(Þ·?,JSàÎvð ‡fÖšoŠKŽ£"5ÃÚY…S+‡y-3Ó«¤kê UÈ)2Æ"½I‘ÉñÑ–ÔºŸ¼È3{Èz÷„ Ï…F6*Òb‘©©+˜g‹‘ñê°›ùñ’Ð�λu^¥v¤ššªem„Eê²Æé‹Ú0&P"·­ö«&î=¤J’Ðh—BId;;¨h»¾ÞAJ†‚‡Ìvcçë^ADyÀÃx6›ç±ü»æZ1þ¾<åˆýŒõ?Є ØOÃBR#2Pây¡›¸£´Ô>yrà< ’<µÖD}èmR8ãîܦj.Øž øxl·ºiªÇ3 d ÕVÝ ½¾>yI4Y¶ncŸ¾ì Qæ¶ýšIáY`Èvu»d"×j ´vF;üÌt[>…¢`K½ ½-b8º‘Z(¿0‹0‰¢?­G°ŠÔçŸH× I°„Ä4-Ì}µå£ØY‰´¤®ë„ØvŸ8@b²p/™†®©Ë$–öÐøOr{©F“Å•?5»Z΢,#2‘$½Ò ýVY!ºq ’+¡Fq¦ Ýâ§Èm‡A*º<vRuŒ/å#+ÿÌÑsœ;ù˜ñ’˜Yù¸÷äS©Oòù\# Fµc’Oc@ðÍJ¤$,™÷xVoj“èø£<rФ·E#v4ÐEŒ¦FéÂ�ÖÄ\ƒOÔŠÕ¶å·òÂæŸüÏ­ÿûÉ̱I–O›éwºJ²36l¥mx0®Djô™—N§¸�½h°Ð;ÂlÆogE…z†½kßy’£%C·æq<ø‡î Q:7Œ¦ HÃDXOò1óõ+¦‘Ç×&ËáùÂ$eÀѲ™~"ˆâ•JX\a†v ²-½�ö¹C ½ó›šª»Ÿ¨ß'b™÷7:Ås„Š žºº0{\68Eò ÛßLŒN³ˆ Ï³+»Ü\ÙýZ{ƒÑ2[|¦¿y½­Ái7º¯¸Õ·ðÁ­zs÷“²"}áÇó ›’z=«DŽ[-1ýûdË@˜û³ÎtB9×Fº½!ÇVt}Bcz`& KhŠÑ„/愞;¶ýÏè(w+5ø¥¹WB^nHÒåŽgùÊ(»bš þB¾´¨ú^gÑrÎ1ÏÎ9á/'ê.ùõ%|é‚8I&‚2†^lÌ?ǯ _1öòä’_ã”»©À¸oø•l‡"zɯJôZäð8á“÷âÓôêJƒŠ_¡×ì%½¾¤Vº&Ÿ‘ÚÿZ£—©æhÄb1¿<X0Õ-­GÝg%…W‚‚?ûŽ`Žï¾²ñRMùD˜Þz>äæ&ÿB 3êw•‰!IWŠÇq§ðí÷w˜Â?å .yúî¸{rS�€b²¦g4rÄÜ9MSx ~=Ò:õ‹ÆØ]@º8».Ñ›ÀÖEÅ%z]ng‚°Hì0­/«à'¾)Ýuæ£ÜŽt”‡¹%Ùp<€èV`ìé”û#HrC,ÌMÜüçvJíéôũ§¶i Çè9œûeUõr°¡Š;z|µ˜®¾çq¡ÐÖ½ªÖrdM½QYP5‘'QâG6+aò{¬ñ%ýèÓ5ÏšáÝײM¹ýàÚpÊ¡2I'îK˲w7‚Òü’à®Nȹ­_’;Ƙ²Sk.Qä2ᮕÿ¦ªA0g¬¡ù ÒW ›‰8a÷ðû çà›Ð|eÙß‚TM�K nêVñüܦÖî}ù²úÍís¼�ð5ºé¨´Õ€¦oÔ®KujËQÚß7 Êz7¥²_‘Þ‘ðvÇ=Ý_Oݱ©žÉG¹b—ipé+«ÿ;`¬ü$ ½WÑA?ÎÑ£©M]ã`îÉ‚~ 9ÄÉûö“­œZ§öj5¥ݬ¯þŽÿÑ.ýendstream endobj 35 0 obj 3075 endobj 39 0 obj <</Length 40 0 R/Filter /FlateDecode>> stream xœíY[sÛÆ~ׯت;„]Ü]OfÚÄmœ*Žk2Óv¬Lg,)Ä À� õ7¸ÿ¹ßÙ �R™Ú}èx,ÑvÏý;ß9þ™…g!ý±¿ËýÅõ»Œí†‹í.~¾àú!³¿Ê=ûã/äôÅf{aÎp– –Ql³¿àYäYÂ6ï½òØ7·¿]±¯ði勸Š<ñ¾“íQ6lz¼úqóíE”27„ã´çûU;øõá!õeUõìe}ÐÔ0|¹Úütá‡AÆ6¥>Çó6Š„ômä ´£Û®Õñ#‘»«ÛŠ~/ïd÷ªe{ù¡nwìõÛ‡”}ýfÍzõóQ ãpņŽ÷rÄuò„u}½«}­’–jµ Z9*¶í»=Ö³Ò¶Á5²_ñ,(ŠHx»ã^µ#î»cS±;<ci”QÅÓž1ÛÜ]aJ26¿{ïmèîî0Ö]««ñ¶Q·©ï´Õ+íû(ñäÀîV" Â0‹¼cÝŒì±ï!gºæaÅ<±§zv'Ë+ŽWyœzŠ|FWÇáëÇÁXÔT/I°¶I+H¸1 åJ_’:ö2}O=h?vmó„ëÊ{|RÁÊOÂлõþPU ¯´, ¢(m~ø:Ði“sßÛôToæI…‡eD¯– ã2ÌĆ)·9ºV&¤M=Œ¬ÛêÐN·’‡èVJÅŽƒVk•¬èU:6<áŸ{V©­ M&›yqÀmêÉc3÷ Kâ(Èò›w&M<§Àë·.ÚjÐIA“|‘WADpbN–A$‚�õt(Ën¿—ȱ·ˆkû;²a/Ÿ˜lÅ&Md×ãè®¶ÅDj šBÜŸ £œ÷ Aι)*‘yl¶rª6.‘pwJ«}ýއ(Ò 9ÏìÓ/)y|£Ö—æU)~$ò E~/kȓ۹¨$ÒdvN 5û%x¾ºb¾ß«­ê¡çËÞÝh§ÎÉ3“ì·Þ7›Í[àñ¢àËwöäÛE ÷äN]Bè¶ë÷ÚJz•ΚÚЩžÆA$"UÕk¡A”iPÎÁ‹Â%D°™3…Ã÷™M~¼VÊÖä¥Îc‚Ñ”Ê"‰|‘GAÍF üC÷‰oÈþ{Ô¤ÑaΦDPœ #ë½÷o¹£ú*»c?h‹$ˆÂÄûá¾®m­m[ÈåQQnöoHXÓ•Ú1gâRɉ󞺣1íp 0_þ^ÇîÒ¹r ˜.>Ü8qÔ™†XÒô$ãÜ”¾/É.‘:T¹¬Â$¹³—r„RK]îƒÅºC¯VÂÂÛCÝF’tÿ«G¶íš¦ÃsïíŠÝX[_0ëb¤N•(,‚8Š%Îбˆ§8+ƒdy O‹Û9f{j¼ä2µ²A-\1uP<J‚">çä:¡ñÖ+Í7ŠÈÛ>i­µbîå¡ËL©êÚ/· Ü©Åoo|‚§SB¿÷àH(Z·õXƒÈÌÑLÏôh_„)Ž0Ÿ W½Þ:ŒÐ…OÚÄáÔ¸‚pôĶð9îö8Ö{N¢—¤¾Ñ*d/ŽõFGŸGYÄ']óåo©Ð^ÒÏú#¢«Þ¿8Èa˜q±ë«Ï[&TLS‡"ëõ @d³JÉ¿y&rù¦5TY„‘eS·™å±à5:Ývj)ìÒ|E¥O(³¾bÂOP+8¤*7­ ípuÏ €'Ƀ‡¾»²k £ZÈØá¸èùö/_­ 3 ¢±z IêZAg;¾€¡ “Q4¹¸دLÚÚgS}ÜÔgÔ|õݳk¥†8ˆyl /ÒæÑoLåªíRí®ÖøŸ}¸0y£¦žÍL tk‰¤…c…e’Ëd4ÝorZCþ<«Æaž¸b°ñº"°Éd H„Q¼ ±Ü׈À¨M@Qtê} Eö¦•cÌsâC}0]–Ë9V—:úú]Û½£%ÂX’ ®2ä²,çÊ ÅL` ùÃ)j µMÐè©§éI?gºÁ?W#†èkŸÐƒÄ/±ìZúMƒ@õäÜygã"çq Fçic14œ º_¢CS‹òé‘ ñs£3%@8ç`gªvûDæïQ;•¢ö…òmžV)µŒ"ŸÞ'„C&ÂàrVcA=Ñ«”z%wúh ƒyî‚ÚF.‰Zk·¿Y¯©Â‰±õ²×º´'YD]bTÓ@‡#m]~hå^9^nüo¦2+nJß$¶@¦Ãc‹°§n'ñ•% ˜ýÇ)~§µ@}®âÐ5ξkõÐö ›)CÙ×ò© åÿùõëwì– GÝxå.4ØžÈf­Æòúð¡¾n‡¡º»]Ìâ�©Fc³}W!ïÓÃÞ=¨}0t€fš4O2Wäx’²‚xd‚Q7ÚíyˆÕ#„á+�§$[x4všÞ6hB¥5&¤»J¾‚ij ÜÛ©XQ{rd²^Ž]oÚ5Æ«{œ=2ª_fô2‚]í Sû¢°â”ªRÊÐU.ƒëKúòã/€·ÖX‘ ;.çª0u°žCªN.Ô”bÂЇnáÀÜ•O]Q±oÑ£v”p‰©9=b;LŸRgFJ~vùâRƒo«Tå†Nke )»`/³¹°ewy{{9m)j ¥è–˜eÊn×Öÿ"B5°©ÑY’ênQ©¦Þ×£ev‰¹xŽ T‚׆†æ!`#Á··ã’©„¼˜b’¦mÿºµÐ÷Ü\Ì:™g‹5”ò`ŒÀÉϱ a±òãqI6&4ãˆÌ;ݤd°ÅŽh·^ýýšQøN– ÿ®g3ÔÔsXsS#`� b±ˆìH5 ‡e'b澋¡%fÀ@ÕšÜVå@N..¸¦>õÅ\ì£H˜|F—:k’`¬Sá¨>#þ‰Õ†M„¾æSb´ã’LLg­êó‚8ˆÂïÏ$b¤ãó]‹uÊx¾º½¢;tS–4 ºêŒBdq1×C\³¤ÏWmÙQý,üMÑ=oí<„¤ŸÓÚÏœ–`žʼn ‚¦m_F‹‘U$Š‚£Ó‘wÅ©ë 3é’pq1™[jòù(Š[8QôÈqËg LÒatJyŸƒ›ìס‘£¹„ÅÆO £žUÐSòâk^—2„œ½$EŸíURCƒ×ªÃõå߃-s)û§¼dOÛxM.ëó´*öÃpÎEÏÍ|ÎÞB ³Ÿ¶ÜDÝÒ¿t«Ìe„ü(B™L!÷îŽÏƒ¹A4ÿÊ'¹ýot–´ž�WÂ…šä´ð(0Ò²/û¶Þ9Ò.û”˃ϊìSdÞ1ê­!rQÌû~Ò1°#ÚénX󴙢=›ecáFÙw¯×_ÌÿæfÅÃÐû‡ÞŽ4¡�´wk-ë#†wÂúl/±¬ùeæ?Óz”9ß'Ñ0%\­û§å@Žy¾°¹ï–Œ¶xH~V»T´³™·DH#Çë½Ç¹40ñ4œör¨i꜖ݿŒÔ'IjGÓ¬Ú›“M YÅÞKô?¸¶"6º+Ú™ ¡8 ®÷v•Ohõ?ž¯"CÜba=Ï íuÓ³«³WíØw‡“½4Ï@nÝìþôçÙXí… B#ÎMÔ%5TÒþk©öäáÎ.wøð”ÙÔÏ_êï8AÍH ,Æ^žgèü,8Ü©€Ë¶t©ò5,tm«J[÷˜Íâóù²“ÈWžº ù~OÔ7’mJM(iz–4¶*b®W¦xC˜«èÿáØt„+ÄHäyx"cß›'ê&ôÝqꜙÑ=¯6ÅŸÿ�óZÌ™endstream endobj 40 0 obj 2915 endobj 44 0 obj <</Length 45 0 R/Filter /FlateDecode>> stream xœ½YÛ’ÛÆ}çWL) ¦ˆ0¸»ä”ìµäK$YÑÒ•mÊ…‡$, qÅ|ÃæoüéË �î*Žó’’¼»^ÓݧOŸîý*<é ÿ˜ïÅañô]"vÝ»ů Ÿ>æ[q_¯á±Þ.ø_$J$Y ÓL¬ ?IešDb}Z¼wŠ¡­nÿv)®á§¥«ÂLfiä¼Îë!¯ÄøñòëA,\øo½ãð¶ãº…n{·?µx†_ÿ²\ÿBOùŠž’^³[çææXY/ø­ûŽ®ªŽÎ§}Þ <©¼/ò^ :¯ßkql²‹‚PÌ¡ä¼ó±ÜèÍüŲe-ÅÛ¯Wâ›ïD^oÄ‹7ߊ¼Õ¢ÕE³sÑ?×g½dëòŸpÚîäÒ<Ïù~+ê¦ÝQå½Þ¬ð`´‘wÝpÐI¾©P¬_-ðÙ~Ÿ5Ǿlj|jèà¸N/¯.$<.™’*â(œ}ñè×R¥YšZ€½/º[UÞõ¢©µ8•U%î4+9Ž ‘QaÄ2¥W!9Â!ž]5ÃåQVü0|˜•˜ÒβÒ7hŠ|°̱¾¯4>òqéGÒóÃØÑm¹=sÚ´n£¥b¡_faj"”ë1tßD‚Ì|°çcùYMÝçe-CÕ—ÇŠÀrUHåM‰“I’.Âí¤XÃIÓ/nb< �$à‡b·M{È{)Þà÷ª:sз;B 0 Tj—$)Ùʪ·Àäb£·ølÊ8ñm 98LΩÿ€a˜%¢¬D×<d p¯,ÈâØÉ«^ãóPhŒrDd‘bz2UZXÿ™ë™¹Ž|î(º^ðj¦(™¶©ºî!q —Áim™ßku¤W×?½{õóõW?MæTæ;?½ùæÕ‹+QnEÙ£ŸîWT[à&Yà"UT»rÎx hàyé界³¾>NœÀ¼ny¿‡šÀøÂ"LÂ!Y¾!îPo�Èü)‹Ç苟¦2Rÿ¥üÞ;m ²Ò1è ’—¥$FÜU*‘~ \,~R$ÏgW‘x§²Þ4KzΩ35â%ÔHGŽmðaIçCß�M櫦ù@$cì¨&89¿ákPäîëqF< !#P´ýo+& ùtã$!ërÖb!PqÃÉbSgú¦=#ÐhDrÅØ…‘ŒFð>Ù<bY<pÁG‰LÒÔiKú1õºg®’dÒWÁX\×{,hB-²óïËÔcÈšöCYïÄ7ÖA#,Æ´¯XÍ~Ç´rêü’´uד©íú,¶#™ ‰K¦Ú�pyÕÔ;±'ãè²Îs3´â-+´ô}Š8’aœY‰øj=çºòǾc]YЉ^* ¡ï·3™RÄ;Å¢”ï–í,‚ÿÙ¥ÃÔ¾¹¹ ð¢*ïÚ|„.ÁÓÀ4hrh¡sVýèS áž-A0®(,sjçÛ¿^ßü ";4›¸y뀺ƒ.q]R[k½éL«Ídä'—�Aƒç†`Šr¢b@È«3ŸU§?'WY‘VYµ¥Gž–¾Ç(ƒ£ÃQ·Õy‡¬¦rƒf‘ý®='ÿÿ£m“´]¶í©(5ð˜sò¨ûÉoàSÉSçYjÇæ=fÒ=ìëè‰ô™B 0€·oÛúë‰Ö¡ŒRÛ>ÓÂI¾Á·¼<˜è�A¨2—ƒóüÞ©ç[G ›{wgHÏ1oA1AÀ­@ Ø=ùâ QËìÇJ¦©šŽàú}‚.ø_àWE_ƒ'·Ë‡ãB÷`T0DŽ¥£‡/žAyŒàvXn/‡ˆ,‚”Ø8ð Ó$lÁòà™‚ýñ¨kH&ÓgJù²Ï¶2€HÅöä˜Or²aÎA ÉyhÜѺÆÚ(t‡D:"WY"6F%½ˆ‘/~nõ>ïöbè˪ì!ÃñX•p�Ao<—â'<zúÎ÷Ì ¢¼@&£ÌXªóCvM RL²åz!Qx„>€f#'ÆGN?ÎÃ̲ÔR=qür"nßÐ-ÒŸë‚É`µÛ9丫šÏúâ=J³¾™kvŽìDŒ)«`†ÖÒR‚*ö °yÀàfG­û¢„îVa9A„>%ö/š[2à ™ù�¯UYM.°B—[›ÊùyŒGü‘óhL5ã7„‘×4ãB†Æ 3˜=h|¦pB“¶#y?²êcÍ¥y’XÏ3n¦â”g\£‹¬N~”É wåÓãäÕ0‰l¹«ñÍXŽ<¯~NÓýv@[Aÿ“ªsì0�z*¾ŒÿórOºm¤þ½ãnWÂu·Ð« ì«q«¶Â®¼Ì ûwëõ[Pö—<<âZV¢++&ЭS7¢úã�RÒc½À³�g§[ƒV1F¸Œ˜ ݶMÛ™IþšÜ ÷Ô™{Ü9tM}¶+ÚòØ›^nNœ­‘,º/font^±.Ð8•¡REUͬÁ@Rrxã�çKñ} »6nbsÜ*N{*¨Dƒò#ôž Âc4:0»ÑUy©Ž Ä? .qøxX…ünæJâÅ–Máš-VΩEA+É8è·¨2¬ÕýÐB©·¯_’}(ºž›lz·Îi_‚ 4Ûãª:ôÁ½£X©«’ÌA¹™uýœÏE'?ð$7 9* ·°²3²ÉÚÝ3ÿ•Çö² BˆylQÿ¹ ’ÎmÛ ëLûEîŒsK(Å̇ñ;À©wšcÓÀ®IH<Ýï› RoYx»õÂëvùVÓÁ¸©hºÀi `Ië‰~W7µÛ v²í€;ow„Qºp}£h»ª<ÎvS3}îÛfØíWBÓTD[³m�c5.bV˜ÊšwYÅý�4ÐêòÇf†Tj‡Ó Xò¢ ä¾uøÐSè%2»I‚ö&óaðålGÆìLYX¹³=˜íÕ.N!âîˆ_¢rC42ÂnavGò‹æ¨.”ˆJ÷fdÔ‡¡ÂÙ0‡êÓ…ˆŽ†ïÌß…­…y¤C*Ñ Aóåpw({su)PÖi½2ƒ0¦©ç<5Uì›FZät¯`gØ·?Þ¬Å&ïóiZפ»^&ÄšÈÁ+C¾+ÊÛþ):íÒ;yQ4í†ÞkÄ»—×Ï”±÷AÁ¹– V<èǪÉé XÓïÊ'ÜÀá¾�ÿŒTÆŠU £°‘ŒÙúèË4Êììåñ Ý´OãW&GWfB#+Dõþ=uo.½ü,„ém&»*3 +.î$´ <Ï¡5ì_fO’±ØÅ2š¶ªæ—ÉA2Ò©™f|3€³æNóòhœd©ð?碘¼ "œwMÅ~{xG2 ‘½svžñÀ½) ¯fSëFš˜Ûâ-x hAK9áÄúœêæ]’a©’î<8²áÒç©ÐÑûGþC_É‹=ÓÜq¡Çñ¢J…Gv/ïç8ó+¤zÅ™z6™ÀÛ< ×ãç§^ÜëjC¾ýòè:³¦‚¯ôÖøÂ„æüj…×:œ’^|ÊGDØÑi0@· ǼëNcbÛkXÂ~lý°°F©íd¼³Á:”)¾‘CM¶”X.ÆZœ‡–‘Æ^±AZ¬¼29à¼74q’F¸™Ñ4¼Á‹ÓGK?KÈS¨£§tîfœ–𲆮ò¦™Lé:*nö/™LƩƩ—3Lpl¿|~aâtZÂŽ%ç)¾WÚt²hvt zqíñ¦ejfù\7¢ JðÖh¬oežÑùf¬Jq׃ŽÜîð#�ËT®å.òÑbi²]£™6w ””á=ÕSš±Q7ô¸UÖâ¿ÛXÜ` ]BQxËé@Kùa€Æ¦ oa[™Jñ´ëÅßàÏ¿VÐVÑendstream endobj 45 0 obj 2940 endobj 49 0 obj <</Length 50 0 R/Filter /FlateDecode>> stream xœ•XÛrÛÈ}çWLé…`Šá~YÇ©u»â-ïÆ¡ÚJ¤}CY ¡µútNÏ �ŠÚuâ’ˤp™î9}Îé}b÷™G?ö³Ü/.¯Sö0,<ö°ø´ðõMf?Ê=ûk2ºPl查Kóg9+ö ?Íx–Ƭx\Ü:å±oîÿnÅ®ðmåQÎó,v~íQ4lº½ú¥øaeÜ0aEµpÊ®T,ÕÀWÅ®üŠrD¬ø°pþÕ­–‹€ÇtÉÇ-?Ï‘½w,éqÏÞÈÃ<37<“Žh™h†Ž)Ù˜àìq'»êZ%[å«éåAê<$S;’Ý?á£nØrågÜóÒÌQ¸ýz¹f5–c{Ѷ²gC½¯Ñã­ïôf.¯s‹’„Ü‹‘‰KéÓæ ¤ydÎÓi·ŽûŽ]<Êû×ß×m%W~ìüÆwjß¼Òq•¹¢.éÒÃZ¼ìö:¦;®3FêzgLÅ„^~=r+öòu%ÚZžF¤‡vÛuçQMq^DG™ý›ê4—ÈÄôãÜùíÐÔe­š'VîDû€Âì$£$ÙÙT¬Û¢_ÉŽ‡¦;ˆ^QÑ©• ·ôŽÖ¬©Õ ÛŒÂ0ãɘTSBf½±«‡ïžƒè†©Ï£ôÿ-§ÆI¼þ¾éJÑàÛ«1%ú¯nÝ fD5ÛÏ€|¿wqyjÇ %êv`Ëõ)Â^ʽdÄqÙ­´ØòÐé—zÛmºäãS¯ˆÅŠí0“ìÓ±S²"ôªîxßHW_4r¾çÈÔöÄŒ¿Š»»‹ |�Á÷üòuX¾‘Ý}©£O±çÈ'q/–_‹êñ( ÈMœŸ� ¸ÿ¨-ç ÕÃa¹f¢5EËixh–ÿÎS5 C?âÛ'k°®g÷¢üuhİcµÚÁˆ nû<D¶~0ùžcS›Ê,‡RLnÓ:Úg‹?Ý:)ÙöØc½þT„bhÀÑV¬’`_30•ýøæ§›UhóÍ®9âëªîZVBÔ 7­C£j,ÅT½—p÷å‚<ßõž™"¹[upEYvÇV±ÛJ(ñ ¥¦2{â9à¢}Ý9ïŠè-?ï$\£eø ²ï?Óó¾ñ$±D§WrÓ°+1ü:°-@¼ÃP” &¶ w‘eoì…özÃ𸢦åE)W±°<ôk ÐÆzú纒ÕZŸ81 ËÀ°ND›çÜÏF÷s¶Ç¹úÏBÏ…ª;¡ýFCÅ‘suUÀ öè?gwΛ ñ¨&)÷ÑplOu},½ŸX‰:© ¾éª †<LVb›ÓgyâŒrì \q­‰°·V‚h®¶Ü¶{‡)£—En€w+Tý,vòdÖìFwUçêRýÙbðCÿ„çõZS u<ã �GäÛªººA€ôn6o¯uÑ?je~`ÃÑ:¾!ЛÍf„,Z? RÄš \€ÇÊè*øY�QZovˆ®:Ù0 ¸̹úÖYàï­,urB z6âh¢Ãq7X±ó(eeì=ÔNÚÚÄgØÌ” Ñ‚ƒi »”X=$‰êÙ‡ÍSKȈó1é¥3L ä{¦Í˜Qððw(òîÔÍâ8ôG8}z[->nìx%XÙÔ¤Röªþ‚âȵ¹e ‹mŠ婯n‹Íûâ-4S¶‘ïÜ¿0Ô#UÕìFo`öRõµ<ÛP’ÂÔG§0y}†A͹G<NFJuï4¿{íÛ¾ÛëPsæç‚Œy Aê}оÐBÙK¼æVu?œ»•}bð忥åÁÉè*»¹þpÙd/´´‘ìšév¤»TÕÉ¡]ÚÞé‘-„q…ùHUžºŸxÓXxì{T˜™=k­tÝr4!OD†[M BMdo§®4MÃãY6ñs=à `âØ'vŒ‡*¢‚–Ü÷^îÄ*ðà®Ø5F?=ÄCn(íÖH öèåñ¼H¢Áƒ<9»±.:ùßÚˆ0˜§”Äü(”’ûƒ¢MQŒ…aæÓe;qø}=èQ4¨µ¯ìiåwÚ^ª]W±[óù¢£…Ñs—¢IßÙã‰}W§:ìº#†^:˜h6‹rgÇßnäóÁ c 1_éØ`doêŸEÚ*RœŒº¼8Ê£x嘂ЯÇ(¥?z‘óptͦáqI tOжIßKݺ­˶k̨d>Qâ<j ˜Âs}âT–&ÿ«!˜1Ý%Û¦‰tÂ_åcuyçÆl VÒp¤rÊ«ŸÿÆf!Ѥ qÖRÒÇ ;ù<<ï\4zES/ÑO^æÚÞÌHÇ<œÔ€¬ƒÛõÎޑؼ’òÀv5ò1JÊ<>6g }œàÅ“¦çùvÚ)ñÚ`¿—ðwfd™§ ¨ðDgWÛ;bzƒtŸóб~*Oí;Ǧl»gzÈÿ]göjWÉŽšŽO?^Ï«ÀhGW¡,Í÷îŠùi˜±A< t™éR/FRˆ’¡}<gןŠQÉíŠfb“@ÍÙ=ùÄQ™&`©FgØG©§`øˆo')2ÓBð ·žvªá¶› d …àsö´æ ô*xÍl,UÇ6ïÿývÍ®ß×k¶Ñ* ÈÓy1cñÿ¸fR•z9ã*…Áä©}mJ°í„/ý¥Á ÎW=" Óºé˜z!½óvzæÛšúÂôQNù¢îZÇz:ŽÃØÁ�8Ak-úUöî¢ÝÚ>AB{¤Cä hz¼¤ì‡#zM€©D¿aV0TÊ)÷·ÅâŸøù/TÎendstream endobj 50 0 obj 2121 endobj 54 0 obj <</Length 55 0 R/Filter /FlateDecode>> stream xœ•YÛrãÆ}çWLí Á”0 î;•²vÖµ±‰ë<hý�‘C 1Ð�¸2+•?ðGçôÜ�J¹Rë²$b0ÓÓ}úôéæ/,à! èŸù¹=,ÞÞeì©_ìiñË"T™ù±=°¿l° §6û…~'d™`Yñ¼`›Ã"Ìržg Û¼,¼í©«?{áç»Åo+_Ä/òÄû{ٜʚ¹Ç«Ÿ6ß-°¥l³[x}Õ<Õrû²[mþµÀg~(èó€‹4wf»Vö¬m$»ýç_ÙK5<³áY²ý©®ÙPv«0çAÄÞ“Ø®êävh»3+›-kX{”]9¨Ô{¿Õ’½iÚîPÖõù2‰Žý¸ð>{uõój¹<Í"¶Ù.ˆgy‘ãö°êÁ“ÕJ¤á5ƒz1 U"àQœ†z\œÅÚvœu8ÕC…û±mÙËÏ+Î6ÏUÏð_ßäJ$<ãÔ{y.vh;Éúf—Ý®gÛöp¬«²`sÙ°eÓb›%{TÇFtå<Ö'z§ÜçG‰àB8’ 9«= £¿Ž²)ëáÌÚ=[Zã–\½Ÿ¹wáˆw»Ü±ªaN¡Ã’0å¹r”ï,û/ðÖ,nôË mðÍf 8|ê%ò¾R'À7 9,yÆÎa‰yé üEë”Sîv‰Ý·Ýám§î³+‡nj¼jÎÖÊFŠFd<surs`öú\µJðŒ>Ñ«ìÙ^?8› å"ˆ.ŒR®šAvp-ÛÉý* ¼¾eò¹Tñ*bg©ÝñKÕvóóüØÇ7£�D„.ÎìD££"£bîÐÕÉ@\ðâ8´¬û!(¸(¬=rrC¼Çð]WÁá%;v#Xaý©W·z{†"R< l¢xþú­HÛ)çT爼»©¶”³9ÜBh¸ù"¢ØDû;3uË{6½(~S—ìåìŠEÂã<¿sGÚUQ×!xCuý ˆ¢>kªèúA9ƒ³OÍ®EÀ.L6@â_\$)œ•Û# s€Ö±EÐSë1I\¤ãš¥<™ØT¬úf©Ábœ‡…ܰ›BEäÍ)˶|×=®Bbã8$�ÛH©45VM?Èrg¯¢î¼m;¢ÐË‹ 噋ïÄ"b"çNïÆwåÈà p˜xQŠœ¶|Zi˜%^Y5\á¼ê‹œˆÃÂ[—“˜æ‰Í×Ë”8È[Q|M6ÄATØxe Ë6Y6=qð ÊÊUNããýúþGbêWu´‹¤E–ËÞÝÿ¨ê‘®.ù,íOÓXf‘°žkjÙ÷Úkc4h·Â÷wUO±öM! ,r¬ìÉ#xzæuAÖ¢HS‡E¸ÚðUÏ}Íø;ËøýÏ•¦}¿:^–ì,6lh¹³J waæÉZk�⡦%ÓPû°fån×ázêÏ^v_V�xQ$¡';ÖŸžžd?ôÄ ~`á±mèÝVm·Ôµ‹X¹3ŠG޶ף;Cže޵³X÷u˜&HìmB$™^¥"ûBU0妽�}0é4¥“¾½l_f7®]®¨ ê”u‡·ÏäžÞU9ì?tm=;gΗ1àK¨–˜¶ÚüáÁÛLØñ¹ìás†ªd |mXµgëîl~‘bŸDÝl¢ÎÚܰ÷£'S|lIÆ[ßM‰)äidÁ„veE`÷~"•ž$3Ž¢ ² néâd½*ÌMS•5¡È‰Á<C™“_Ej¸%rú“•Ô¤˜a²—rÉÖwï7.›åžÙZh?»i¨w%}öh5É»[Ù .†ÓF8çЦ²C]9àh^ßAoé,-òTù{×á.» ç—´¬®tMÛøV: !£Ü­«~@aêâýB—ÃÏÓQñÑNÕþ(ALƒ±&å‰VˆMÝ–;Ê1Ú…’$¾]nIdýnšOyjyË„ž8€.ùÊO‚`®A6¿éïÇ™~õŠXúÚßn·—á+Òk9y{{ §ßÖ²ìØ­qÅ-$r#k¬¸>!;õ &“B_¤‘¹±J¬ûûo7ïY]žÁ5å~ ÿŸˆ»!ŠKò¥æB»ËhT¦Ú`dò@peª6FÅéÔ¨½‡ŠH5²Ùvçã@jB%*J¿Êt;É[d¡6·gß+CBºÊ!†¤«ZñP£Ñ{·™Š‹‚" /÷B+� òFBRit7óö­µR¨4rªîeÂa4Ëjwø€p?t¨˜¥¡*rIb¢:äÂ¤ÆæÚ$%” :Ä×J*‹%®ÐiG‡‡WJÎã÷S„F¶¿ð¤¼(ž¡àa®xN�è“%óZ =Dn5%]‹hwÊæ^C•º$™kñ9I§¶‡ò¾_E¿:œ=ëæJJdÝÿ¥d½·¯èPsôûoþ¤^*çÅ„’’ ü³OšÒHË(�\h±F�å¯J²`”(<q‚L%©ˆª©†Ê”oí²pbº0ó4þºú‚À ®ãnnŒ.&­q\éyYQÏdôçàŠ°¢r5(È3ž¦ŽRaê ð€:²kQÕoç:+;y¤f¢[A$´ïÚƒfE»«3?HM;gŽVì Bf1mÈ$UI‚V´(¬òá›i„Ή”ŸWØ�¦Ût¾Ú‰•ÝÙ¦2–" F+“Ëá5”îxúFb¼„K+߬´ßùX+Òø‰|ráq(³ÂµÎúÞ‰Þòê⟽©„ÎóÂ"ßf¢Ñz Ç`ì°TvŠßÉNÍíóú„f"Kgrgж­-?D‹uûTu[•:êñä^ß(Õ[‘@5fŽÒ&Eíba‡Lž!êËÞ&ËlÉè%Äœ´Va^ñ”íô(ϹÎ+¨+¹.s¤=\ÉÒš×Z®cgØ O,>ÛVxÇ -µHKœ­)¨Foæì›iÒDZK›YSVµ†˜=˜äë49BÊäñ-M[XFƒCÝ>'<Õ5#Âʑ·~t°à‘+«Þéh{U@u¹pÃ1a¸ÈÄØ©qZ›e¨kM¸åÿ�øÐmdÙ0h5#H÷>®„!0‘ <´óþ7,7½2dnÄ÷ÅØfWiñ]xM¹Ÿˆo´ê‰]s¨ iSªÕú0�ƒçÙ< Úî�ùÙÑÜã«mÌ×ú?]¦ƒc“Û¨|¸¯U]vFpLJpŽûºVMŸ0£¥I«Š»¥c-ÿõõFgÛY´<ÚÑ„/D¶e}¢Ñªº€MIºn:ü$ég{ºÂ_j£„ýZŸ›jzœ“b%‘>ú#*±üóRÝò«%©Á¬«ô¿°å‡óQ~½´6U³å©0›ÙáHÕ9žF©›[éS‰« …<Ñcê í´í§Å ‹]lŒöŽr[•µsä¥"¯o WLÆÉªÔØ# F·…DD’ËW¢ƒÿÇi  ï$ª³9 ÎæN.µº ¢àã&}9ê„“±¨^ÛÖœÙq¼n†È¹.Řÿ�‡ôÕc…(ŸG˜0hÿE®ý(Ϩ—Ûj%@€}ª§'ðµ®Ù@†¸¿J{@ŒB¿—%%Zñý¥ ¢q˜öš{Æ6Ù€.L.’1-<ÿé†ùþSÝ>¶ÔÛ{:ÑçÕ©0Ê8è_ªaûìl’3UI °s‘:•;y§yØ.øæÓÝGFÇ>’Ï@ á7œý“f$4]ìå0ÏÞ¨çÔözÊ(¹ùtz”™ø`w;nCÍ-MjÔrPË¿ÿóð³_j A”‚Ëh( [°ð�æÔ…å4 v=ëFZCÖ{ξo•&,‡ÉW?ÀGžÙöãy%8’Tœþº¯–Â@ƒ¬;rx* zi#ý]Á¨°ëOÓÞ KÜ Τ‹c½­"öôW6f¾ev$Ît=wž%v‘Y8Á35M/R³%Õ·¢%#B?Ý}0Óõd‚`ÏÎø•Òàö¿Ux»ž±Ä…–ï Ä¡7³ñ¼ªg‡ògÍQE¡;ËH¸^Гåô*9u†ÝZ#;(á¡ ô›Ü)\’NÆ÷-œçïÈZzébÞœÓdÓ®º¹Ø#¡Ëä‘ËLzßÎËî<ß&IÉN{ýuÎ4¿AO"/æû�ƒ²1ýJŒü]¿½j:ѸÅq\8a—jÍZÍP‘–fTgÙ·ï7j\D³ˆÉb½þá~|¦²J5¯/0þ¢ ä^2›A‘26Ž2õ½bLàðàÑ7½4ÝÉx°Tôc≌}wUŠ  ½±“„a@»½ß,þÿÑ8endstream endobj 55 0 obj 3243 endobj 59 0 obj <</Length 60 0 R/Filter /FlateDecode>> stream xœ•XÙrÛÊ}çWLü"0EŒ°/Šë¦_ûJ·|Åf*IÙy�! Å´ò þ•ücNϺª,%K¤YzNwŸÓ=_˜Ã]æÐþÌëÕõû˜ú•ë/+W¾dú#¯Ù¶Ѓí~¥æ¸,öXœú<IÙ¶^¹q“8dÛó꣕]õÉr?­Ùk|[Û^ò4 ­_²fÌ*6½^ÿcûó ËØ~Ķ6—³Ç^œm‚Ù±sYUl'Xv:‰¦Z6àå_޿ûáÈ2võû+Ö‹SÖeCۭÀ§©[\.ïlûnåp?tiyënÏhV6,oë]ÙdCÙ6j%ûn#—¾ÿÓ‡íló²é‘ÿňÛ7¯~\_­\ö³:ñeýÀñDYàò MñìY{’;ã›4¨kÃ%�1_¥)ƒ Ð�Æú*ÖÛÏ„^p/I“@¿è�çP֢߰¶©¥Mß»~Àÿ„Y™°ÄWüÛ‰<Ã66E[6ýÓ›-­l»NÊ?d6™u‹Vôͽò¸´Ç‹x8®Þv¨'{\Ÿ;‘ãéÙÃlNÊ}ÿbªè/sžøf1íuÑôbÃvkÏáŽûÖ8°Çvdý±«‚ÎÕL~;ír!›UƒèȇÒÙ|žðX£ßKÜ¿ 63;åa”¦K†c[È]OØ DRÈ7ˆt$Ù¾Ûb`ñDɾÝ0Û>Â&ѱ—êóÚñ¬‘„A‰Zý“u»ÝÞ#'Þ|ºŒéYˆ#òÈ™ÎwàÜr;vÊ‚³¿¯]W"bÁ¬:{dýIäåþ‘e o%òÀøOAýØ\ÎI ÔÈ­z‡MÛ=k—ÒÄñ¬É[ŸSÿb¿C_�ŸèzÎþØ„{6°r?÷OVà‰Ým=†³^ú©ÏjÁúƒœí^>/鿊žÉ�QùØbéµío°óZâàØp¤hNBf'ðg ¨µÇÝ8P¨SË#5z1Ë ¥h"PQõŒA:s0½]{QX`{ÚVAe6ÕX¹<ŒÉÀ«µJ…�ãJ%<]“@B&ô®€<&œçÙ>Í\f|3\|ëò$œfueþPâpý0îóXîM;ï‡yº‰“šØ8f ›C¤ ê¦íj‰`ÑR<ÒÉ]„ëp£cËS_¡iÖ‰S•å@• ä±½ &Ù˜¥Hª¼¥üÓKJmÁ�>N¬3¥ÆIt{‘Xë,àÃ3…Üqµ5mtP â6ÎÞ‹º}B Q€­<#Ú•x!S¬Ñà®sSXSÎ "ó«j«MÄèèÚ=²C¹öÀNšX_eF+C¼ÔU¢Ï-åÒÒ@Õ¢¦ƒç-mˆÆePvåá8°¾,¦¼ÉÛªm6”LesÃì[öâ¶í‡›œÝéÄ„N©‘coËÄB&§&¥fi*å«ií¯Êdx=«F¡wèͰ¹M9ƒ³Ö$šÈ-|½¨KmN?æG²é_°çoŠO$·Z¯%3Ø·r­ß½ Ú“bÔâ0)¦ÃÓ(’³UTRÒRV]­|¸!"‡€ ÝÈsŸQôMžJ#õØiö Õ'#´À_×SÀöd›ò…DðÔµˆ;ÈNa·{»*Á^uÖÉôö¡#nl2’8ÊíM¦IÄ]oΉ²d¡m£4üú}ª+¬¡‘NâdR¯§,^$_©0$–‡ƒ2ÈG7˜`ÑÕAuƒ ‘J!ÝN*w¦“œ10ëºò£Y.QRiÂVí0vM/륙äƒkh¾Ñ¡óÅ!Ðc×è­E®”õ *Òäj•ƒ®“;¸d‰ìb-›Â“>’û¾5[^¿w²ß›Ôü£e¿"]»wS9agH;£‹ZæÅÕ¼bižâŽ].5PÖO¬�o¤—ÃÛs\bÁ>CÕ{Ú1ÁŽŽ“L–wk(œ,>üˆÊX‚Š,¿˜á{<¹T\ªŠìd`7îbÛY™™ƒÝäÕc5”§J¨Ò‘’qÿøqÎÕÉócî„ÿW1e™4£+ó¼ëÍ (ûÖ:»ºÙKüùuõ”NåÓ‡×÷×ÞÊê^V/¤ YOÁÞÑ,xV6ôÕ÷°µÒª>ˆ.•AªÄêìÊK+ÊxNuz!™;UcRïÊýòc¨PÖ+NF‰æ©£Èú±6yGH¢^¢3êZ:M"EO(ïgýi!éqd|;îª2gKg@:“Ð$’x\¬›ðh¿›|Ø©¢²&:E™KÕ§”¦²N½ä Žf¡RI*ôᔇޒ à9»-ù‘³OÖ«¢P=V zäÔêÑ\騋ïËJ akZ²+цãÓ�ˆ|E˜Sù|'gIû^ë™ïäLkrîúª°Š]žšDçÛ…>LíêÕg–ùXe¨ ÀìÇJRˆäëÚ ©fÝØÈ�{u‚„h†tŸGi¸Àä£åòoT(%”Fƒ}jÁÉe“·]¨ŸšO;}Ö û¯Ý¼$kè†y¨'kYOı•íÑ›–dhI´‡õ«±K!~úG5NILSª’UÈiTV,_ËikW¥©sÖ¨NúŒ"{ÜŸQ´BTi¥¡i|5=2,ˆÓ'€Rû°¡¾|ª‚Š6©nÚ(Õ’¤eðE28šÕˆΟÅëδoK°@R~4ëú-ýÞ½{ÔÞ Dø¯0#-ûz"c…r2Œ¸)@¼)Š)‚ö"ÆÎd]]“‘òò@R¤šö4ü?Z*äÅ"S’6úEÒqògPмö@õ8Ó|�•M0qöWªê¤HtNF‚O‡£ØÛèê^–_‹ö«({¨Ã£jæ0Åè?…Ä·Ê@u[”ßsu•B¢"YG‹›˜ø)ÿ©pÞ«fMµ×Kòñrøœ_«À=& !Ó©&S޽êšekü]òŽ\˜.â8¥…e#íЃ„ÚCAƒæCC?”6¨0»»'Qìˆú�1ᥜ%Thg¯ê¤Cu€oYM’—Kí¨ÚöA&‡ëXâF÷ê¡‘f곈áèܸì8 §›ëëóù|Á±CŸg'Á7׺§¸,ún–æ ö %þ/KäqédjÛç­³®9P„Á<­>SZ}›$COyŠoÑ›öO9ÉI’%'Éð”È”ᕼgë¨;×+°}‡Î%£k!ŠØÜ]žÉGaœ<Ó>Ÿ—¤n˜2ÚÑÝ ’`âÔvè5e‡˜F<Fb¸¬\û!Ú{ǵ†ÂD Œò }‰)K8®+è.AI!&„3剼°°^hÈÌ_è;…{Ö—¹ì¤Ùòþ€"Ä7GqS¢Ízý=­3õ¾I`nu3#öS@ýµì+‰9¥p>÷Õ�;©Yç~eNœßëàë詼¤1\t)[Ot4:Œžpý®S?…ý¹'ÚÄèER/n„æœÍ¥=œöùh² ýhÕ¥Õ5F5¯ÖfQðs^µ”=E«cdç¹ÑLF÷tGãÜjºèF±ƒêÌY#<jš,/f?ð–縞œ„¦;p]2øÍvõgüü®Òendstream endobj 60 0 obj 2702 endobj 64 0 obj <</Length 65 0 R/Filter /FlateDecode>> stream xœuXínÛ8ýŸ§ R‘£OK.vȶL;™I·q1 ŒU¦cmdÉ•è8~‡<ôž{IÊr:mÑÄ•HÞ¯sÏ=ô7ÈPô×þ.7gWŸ3qߟâþìÛYÈ/…ýUnÄ¿æXÓƒùêÌì E‰lË|&曳0Ëež¥b¾?ûÃ+w]½ðÂÅD¼Å§‰%39ËSï×¢Ùµ^Oþ;ÿxO…ó%Œónÿã¥ðýNmZ­üµ*–ª›„8`ežß5l #Þ&“öÞÏóù'˜¯«^´[]µÐª®{¡×j2ÿ¢F§)BÁžËFiM4•Qäž/Ø*owIHClNr»Ê™jÅ®WdKôª{¤y&ã<Ýil “éÑ8ËýV•Õ³ZŠ·m£U£ýwU¿m}ZéG³P΂tÕd¨¯ØÜs­È1Q5½FšD»j¦2²Ø{Ò]QꪹŰpÕµöîËçÉYŒ1¿9óækÕ©‹ÉÅY$³–JJ‚uæšI”Å2 c¯-x[ÀKb‰úgfU #ÚHÞi­6[MÉXª²]*ñÚïÕ·jJÕ‹…wPªvdÛµ“0!p$ÞcµDà« g/Eßbɱޛâ@Ë}vÀ¢r2~š:BÚØWz-º&:±kÔ`ã ¹Ö#+½IƒÏhšÊÜTä°€¬* •ë>[äÆØÂ»»»y¶±¥º*+]DQ×-[ ãPN“È%, fŒÚ}ÏA ÛªnÕvq ØeÛ4ðzQ4KÒ6ýJu½×uÍ@qgnN£Oÿn§DaJ„<ÀæW…Ô. ±dP|=�Ã*ÏÛkQªNWÏe¡ñŠS²OÓØ1å¢{»fY "ZœûõÀ^¹Å§UZªÕ$ L‹]­¥Iá¦xÀc Á'>ãsÊv8x”™Õ„Iaš{EU£Êµê{Îó¨É£l*3‡ã“ºNâ Dž²[†ÆNeÏ\cÃ-tôRšhâH†‰ð©iðîN) Ц®%:Õ·»®D›µXí:ßRix׿1ì1s܃v ¬µÞ¾¹º" Èuñô${uµlËþªïkÊ~/×zSŸÒ3:aÚ_(8dêù^üÝüÈÿùzÉy*±Îê öëª\‹a!¢#2aH`ÞœÒ4óîwpSÏBS£=ÈAžeî g)¸Ç<n†Ó7¦mÉ‹ò"cØÌÿö‡·!@sþœ±£­²hžû®`ÝaH+>V€^QqDÑ‹jŠσAYÈü”‡2˧6ˇ=¥‚‰ n‚W‡6ÌL£�^ƒ¥Ö°óÊ1à’ò‡¸÷"†N9KMkßnGM»VU'¶EÚÑè]±ÙõšbøßZ퉪ɥÃA†Švjn-J†èÚå3 3¶×o‹‹Ë¶n›KÒyàÞ°¯î)nZ´¶%+&@N²y€¶;C÷ŽöqjjÒ8ÃPHl™#9%‹åÙLâuž¸kªI4EÖÃÄkôhR£Iá@‡ˆÚŒº3>óÑT·ÜÒî4ÇQ5{Ëv÷;—E¿V&µ¨~ß^ò""·Q—ë‚æ åÛ¢ÉAÆf´%ý°bp`.³E:ÈæÐêÃC¥R)±{äP›@A ¸ðÚåh´`èsö—½Ò¬3Mûcñ^ï•j ¿O1W^éÈONZfÀ×$M½ñŒ(3\Þ‡•½n%ŨÉTÕpY ®s€Å$¯ÛÞ&;¾í ‘Åß)%Y&§S2¿7յχêV+Újš3ŒÅUK3"2I¦Þž†‘êËbK3ÊécfvCz ¹ q?Cfx:`†Ó›U]Àð±ÀŸKü<§š~4ô£ã”.ï)íBEˆÃÜN?O^=ÖÚ ×–º|èkÔ‚EYt'±L²1¨•jɳDCç¨ÖÅC{‚¨hxÁ¦VÚ ÞbFœ9Ïêxí6 iö“-SöÅ«‹#ÜN ºK\˜—z°ŸË8HN]óÐÓ8ÜĘf`Šü/@Ê&gkÌmz\Ú×KqÛ€|ˆ•i1k"±]O RïÐW%ÀDÐØ†·TbÀ>Ì5N€Õ½@÷x<Âð…AOIrèMM1ú]jUyÌy8–ð4y@ZFT÷e4*! h$[‘€­3·ß€oì)´Õ\>úØ[ åßuÉj¶QFª¹µ•>j´·î3GE¾OׯSá`œÖÈdû’!ß´šfL_m¶¶"N ’ƒD‰ Óž$àöâ \Þv5&bÛ>Ðh²Ž<'ôƈøqþCÕsŽŠÐ5ýñ;M{Ö"ðÆ &¾¡Lqõ.`Ü"4³LÇ»çjDq<Ѐ·dgíp·Û"ŒøYä°/ÆH<~ [Œ•›§ÉOÆÃ½îÛiæCR#Ð'Âׇr­À, AÒ»Â�gޱf©™î¤•G£“Š…3z ¤2e »äe®ZÈs£ÙŒô~yRÕ/U¸‘?ÁÇÛº 椀;¨sS_’ fnÓýß\lºJñˆy62Åoѕ˪;#>hËSÇ4ðÍ`ûóçÛ_ß;íd\á'Š`ç n€Ž‰+K³öéÀ³1nœ„®mˆhÄ£ $ÇÕ£«¨ 1¸~bÏs\~)ÕÛ™˜¬Wµi€B_šÎC0÷Jo÷»j¹ð$zâËoþã×Õƒ9ml2|LâT?ÆS8 ñ€Ëû† eäm§ô®kø Ai2u‚SÀ(CX¡Ñ¬H!©5‹a3C9|yqkßi5Ògƒ;6®<D?»®£\!T8¨=;º˜UcÔJÓøÈ5U³ä 3™ÆÁ ®Ãá’ËÉãB¾(õõ§OïŒÆá°àO”C [GñÔÞd¯çâÚ†¹PÃÐ ùN|Ï”ùÒÊHÑø¥Ž¢Ö£a„‘­ù×ÅyñúËÝûÏŸ>ObûõÓíOnÞ¿^,®·t»/xD½+tq!-ö£ q›ȸ¥› %ÆaŽÓ°²ý÷'õHWº“«;µ‡‘o2 NÒ¦¹ÓÚ—ÐÚˆ&ñtyTÚÈþ,ÈŽ¥tyn“¯m*]ŸÀsk Ñ:t§žÔX}¤ù±¶Qn½Üižfˆ‡yaÉ9m‰,Li¡Ÿÿ^´D…'=ÁˆaÕ`‡‘îD#u‹ñ+mچﴖ¤Q7EK¦”ï‹B‰MSP«�ð^ÑʵD> sT¼*à‚™ø¾ï[QÈsk]Æ^tVt”Ä”ÕHô?í·ÛŽÇñ\<ç¾â«]†¶¸Ù#þv€†&Ž:–¿,Í“Ðó‹{êb¬íwRü¿«Pçã í7€¯Š!ô @¾+¥ÁKtÉMº5ã6ÍRЮL *é _‘I¥\Z¢<—©eâãõ‹‚0bÛ‰ƒ±‡8éýüìßøûR¤cÍendstream endobj 65 0 obj 2637 endobj 69 0 obj <</Length 70 0 R/Filter /FlateDecode>> stream xœÍYÛrÜÆ}߯˜rˆMíq¿8Š«›±hÓ2#®UI©˜åÂÄe`I1ß Îé¹à²¤#WÊ•JI–h�ÓÓÓ}ÎéîÑfs‡ÙôKÿU‹ó7»í6»]|X8ò%ÓeûËÄô`³[¨5‹\%¶©Nó8 ØæañÎÊŽmùÞrÞ/Ù×øi¹vý„'q`ýÖÇ´dÃëå?6ß-`fí…l“cs¬¶ð’ý™}Añ}úñ#ïÄyÞdÝy•Ö‡ôVð}_•_,7¿,—m®ÖúÇåÙbóÇwV+v¢-­Þ÷ýáËóóºYº>mí[{¼Kû´,yÖTç_Ƚ]³…õ‡5LØô£cóسéˆpèµ^³‹:gÍŽ‰¥pÛ ëcZJÁ>á¿õz-í¬Í2•Z›}ѱæÐMͲ´f[ÁŽÈYu,û‚V÷E%:Ö7¬lÒÉ㬩?Ý’éŽÓ )0k'ä±ñænI‘ôÏâ–…Úy”çðî$¶«œ·î™§J¸c™~±¦ÍÙ‹N`·¼ûJns?¶í»¹2<=™ŽéI:ÑÃç½òž¥äm-2ùª"—çiE•5+rœf+vM+°¬Î‹ú–ÝÑNÂ<hWô)Ès×ãá‡;¡/ý¸ì0œÇ‰xxÚùª¾i›-‚šÖ¹Š]òÀóÆ#…Ž‚çp‚­è„€³ðo�Ê}‘Hïdh׿Iôŧγ¾úæ½ò@ùÉÙeÏ[�½u_>2±£E‰§·ÛQhg»ÁTà$ÉÓÝYî8ó ­ºÝ ×ƒ'Ѧ=å¦{ìzQ!ÓÒ9ò’ذ�´Zº¶¥±îÅ"VÀU\ÉÅvóõõ?¿¿¸¸¾üæê‚²1>x½ùùŠuMv·alÇ-Ñkpuì½U‰´&#WE}ü¸”2†½¼|»’;K} ¢¿º^ÿôVZ®€¯÷KΦ(ݧ«ЦI)E’;iäüc!‹Àk¤zÝ(~%nëdƒCj‘¿PæBE[©9<™ç`7pq'æ6¤òFºç ¢`ó�ñ§¨_î§Ñam<™e;ñy~žÍ-À*Õd%ƒ_¦BZ öP”¥Ñ`mÇŽuwYñIäêK½{®`ç†.ÌH lÊD¼ÖjrÏóFÉ/B›i%y*YR±fvxŽ(T#Ù ó•ð@*ënzpgrðG¥\.N•Kš|oÝÜ\ßܼB ºn ‹\éCód4ŸþŠù^°ß}°fdßàû§)Õ= [Q"X§•àìeYNjQÇ›#©å¡md]±#„GÐóOaW.£ìPý½<–ñеß¡ùƪûñ0Ø<¤M.%Ìvà4CÖ?p;æ`Sú~#¸]:ÚïmiÖñ þobð«¥ññ€ÒHJt!7X?T;Ñõ ²àÄ•¤h"Ì^ò,®üAŽ/¨‹€ŸœÝ­wìa_d{ùLˆ–OÕÎóø€1<žŠÎÓÀL>ªÂD²x7°¨ ý;œÆ#àá¸ðwI1†О‰ Šê7oVìúâ‡Õظ¨Q'¢uñú[–Rkr<š¶× Y7=5F½i×+3‚øÕ‚øÙÿáí–½(ç¼¢ðs›–¦åóäá;«Të½õ×Í5ð}Q§[ ìû¥Kåú–h·¢m“#¼­û"Ke�¨ÃS*Ã8ƒ˜7¥.z$;ògN¡k¢½ž8VMóë:®9ÊaA4°%šø\î×í›c™ÓSŠ—j[ Ahù¢p$¬¯'’³¬i{¶bgË@Ëm—î= –;§Ã¤%þ·iÙÙSùõýÏ`˜vR³g`¤rŽDqA§|’¥$àqÌK»Ë“Ày&&£"Çèþìļا²}$̪‚:±RþOiˆEHuøyž)¾ÄNãÎ #YÔhÓ|LÀÆ2(´âñh©ge±mÓö‘mÁ ÇMø¡³W¼~g‹²âû=SíWà¸i>%äÛ››—×—è²ðÃú51”QŒ9Ömƒ¤õèÿ uXtz(SÛMÏñ΢xÝ+n„m1ÅTUSsöS'N;DŒ·¾áðúçIÕŒÇ.pµž$Èó¨1å=úfǶ:„ä¤$šŽÊˆF ª*ÿ4úš#á4½�Ÿ¨ýVeËfà²èúuS—²vxOØ7ÈÉß¡Œ>¦C1ž²0Éú¦}œQÀñG X«)\tá)çd_�¡úaàÌ$î¨í’N±ûÂ%TtðB`v€a¤<�=£ü Áž<·~ Y$ÒÆœµbƒF4ˆ&‡wõ¸¹;–”ZŠ-¾nÙƒ~ì$¶ÒZöÖ¬J³}Q‹5:+¨}Qê½­O#ź¢ÎÔguÓVÈÞD5³Ê"EÇ>£¡P·?Ɉ·‡|<h€ exш®>Ó³¤Ôn‡®Œ ÷ÇisÍ!Uõ%¥ëz¨sÚæ¬lš;bïŽ|5eö%HËân²‡%ÜîfýçÄ3D~6µd)LQž__ÝlˆÂëqâ O(_Q½@˜·ò*¢§Ér¡„€ZräŨB~uy³YF¾ÅÕ-‘¬úpÇ Ìúºéŗ즩„Ì2è‘¶í$Ê™DÝåÐ`ˆ‹ÂØ0ë ò<×·P±j7¤xÜÿiŠ{ˆ²U­½®zÕŒÍï¬Ç|éÆ)K‹Ž4€>ð �•ǜڟíZƒG£ØöyìÌ¥¿-Ô¥ ë«mSNWßuZý‰ŽŠä×?^{†å­è[‰¿À3m}©+ ©�º×Ê]•l×6##+%m§Œ¦¤H±Ò©ÚµÃÀ»(ÌÕAOŽåCbß\lÞ U‚oèaŽeÚ*&?e*Åøt#3ÖÁ¼*w†»Z¸ÇÃ@H5õÂ9»ô òé}"°¢×Pê.ÐY¨ÔwÅ¿°ŽJ¾%< UÓ«°(ÃŽèl!$¹¬¦ˆþ´ý‡h{ÉxÛñ–”»]B “„@ûá(�Ù:¾_É=<îÒ³YÀF‡ÇÏIsàDZ7„)ó™kP·š9öÓå7W*\žsr]©Õ¤\§qźfLQ•ÊÌÉFF¾"Ù_º6úŒ¡eê&ær;tG‹ÔÍL] HõƒŸ`“îõ{xZôsÛŽCC¹ E7ë]cßfÍΤÜÜ¢ø“A¤ OwÓy<âÎ({=L0¡g™ÍãBvZHÜÉt;ÐwP!t‚fÇIѾ’E»QÍû¼fc]`Šö«Íæúœþ¸«/w#<‰÷ˆ}i›EJ(bBµ-=¶=¤ñâ@·sUsr­éCêçݰÏm²ùDÝò~éÛ3ú–æ£Ày0G&l…Ðd‡ö šôoÿé¹×às#ætoêôt'Œ/5—H~ôÂ/Ù(ÔÔL™÷öí¨êY“£]ÍZ3ÙFé{Äké.:)Û6¸Ùˆ̪q4à2°£áE0ùHàkÅ�ß Ô.÷õÕ²&²–“Z3‘¥6"Å»€Ùµ3^‰•i&Ô¡âê­$šrr§€>)Lô:òA9±.aºÈ¨%F?$7©nžÞQp×7n¬/É ÛœÁ™k‘�EÃÕÅj?%·ï؇([*/èÙdø|4&úØq¢ÎôïUÄdg Ƹ1dÍr#öÝbâJÄùa½ã‘¹‹ÍâoøõoW??^endstream endobj 70 0 obj 2796 endobj 74 0 obj <</Length 75 0 R/Filter /FlateDecode>> stream xœÍYÛnãF}×Wô>™Ú˜²y_ $A$“µXv(©%1æEáe4ú‡ùè=UÝMRv€ìÓb1Û°úR]uêÔ©òïÂ÷áÓ?ó}W¯ÞüœŠc¿òÅqõû*à…ù¶«Å×,Èè›ÃJï D*Eš‡^–‹M½ ÒÌËÒXl.«Gg7vÕ“<­Å7øiíÊ(÷ò,vÞÍXTbúxýëæûŽqÃDlö+ß‹ƒPŸÐ©ßGÕj/ÎÅQõâRV•Ø*ÑŸÚµŒ¼<OçÒxâß'Õˆbðm(wÅP¶({1öjÏ÷ˆ¶©®¢W;åЋ]§ö´¶¨z1´Ùˆ@ŠÍ0 õS2`ó×G§lJZ&Nm?xâÝA{ËNí1Ïk<)—IæÀ:¾§b_Ö2ö|?Ïœƒêpï¿ÇÝâÂ7É0ñ²,‚ñb§mîÖ›ßV¡'éâÝ*½ ÖŸ=:ÃvJßK2\RðfŸÖÈÐóÓHêUdrF&;ÛJ‘ e3¨n§Î½Ñ}q.úÞ¥k\ 8NpeŠ{°Ï¥wÃŒKKóéô‚ Ïíé .¢Ó»½'”ð¯}ósà<ľ—ù±Ùá¸nÕê@¸C7Rõr‹ÜœäRNº ¯“@”ýüѹ ë0ˆ¼ “N»[ø öRM«NEsÄëOeï‰_ÖAà#Ø0Š]шª¬Kí¢nGD¤=L‘$ð©nÅž £É%‡¶ªØ2éÅì—ÌKÂ<›ìÚ"ÎtMê\Ç…]©'gï±çú²92În½"s²ù<×­‹On·SœI¨‚}kΚ0vz¾`öa ›{‹ÓžÉÛ8¥"¡d¤Ã—a'' ãT?ŒA*#çÒ/q]4{v”I?J¥¦Å¯Å¹*ÊF|÷íF<Á3ÐY#³7$+|•ó©¨Ï€â‡<lV~ø×æiMøgûìãå�XÈ´œá{ÎHk"å¹Lñ h-º”à ö%åÿ}³ù€ûsÛôÊ&Y&½45†Ñ%œÕNÑ‹ÐîñEÞ“m¡rf›è¸vÛd]å–Ìù»vO—0Âã8±høÊÈóiñn•#%ãÔÄæºH,Z‘™€;¸÷úĪbtÊ%¶Zø)‘†ö=1óì­cF‹3ѵyNšxQšÛçh8ŽMÝîËÏ`ÖZ §v¯qÒ£AL6…Ë-[ôös¥¾äôœœB” ½ùÕù¬ J4™›ÎšÐü�€ÌþÀ´$±îöeStWí‡][ׄĪlàúéŠTfï¡Ñ˜çê7#úvå逛#Ô¡›7ë uå0¨Æ°¾øLty*` N¿#KÃ’R§|‚< Œ…‹Éôt”O^)M): †vÖ~—ì‡gT§ë]ôm$™Ú$u€³MùBͲ”ÍÆä’¬2¶¨…-raK‡z5”µêïùEU`Ë›sP§ÃÄ—7'Š»=«ù¼Œ•?ïã@lªÉd­^øj¿‡Ù ‰Ô”¨¼3ÃŒ ¿EÙ…W”xÛŸ•Ú¿†¹{8«]y¸òcÀe=Öb芦Gm|�#ƒS$É©$LuKê)[ža¨'6äêƒ*†±SÆ×‡±"2¡£Nųg°þÄoæÌŠ08y+½SÖºÔ†Òèˆ%+šò¬,ªïî(ò©"8ûùÌ| Äòy¹êÀ÷íu÷à°©\9„ÊÉoÄèÚ®$‡à‹-Lº”ûád* Ònª$i¤C²A(^@J&Hñ0» mxªþFh„‘­ G­Š‘am¯ƒêßôj×6PscS©žªU?¸6diæ|þD› f" píÆ)òß 9=Ü=ß×ßýp§ }”â-i:ƒLŸKÐŽ%®ë-ÜŠ.«–¹w5Ÿöþx|Öe ÊIBbÔº*Â/¾ö ¤Þì—ã’@ÂÙ'Ž9úr*‘ZwGmîwú+ô Çò¨åj$½Ä7õÍ),â²¥‚шã³=ñ­®Êýß„ôýPkF`ð›bLêW¦rã»Eˆc/‹_’FšÊ?ˆp·Ä`àO:U¦ÎÈóŽõØ Œ"Ò¤aðç©Ç´¡c…ïû±³ÅÏ€Ù‚Ýʲ7Háø8±n÷Þ­e ¹…Æd¨Ž2Ç>Uá]&˜Dêòx¢Rkêkž3',-Š5j‘nljOxFóÒ b»r-lÆ®w(I ÅÐQH,„ Qáÿœ¬»aòt*r7™èHp`2I9Q·—½†õ"ÒÞÿEaè–Ì”…3!²FM@…FéÌ4…þ&Yê!˜~^«bT'éÖûî/Úˆ<M5ÙåP½öÃ{wñäÌOýÐîbë*sÛ{ÄDcÉÔÛ YºðÞë8›*Ì\@mÞÒ�´L0obÛó’Ë¢ µ–AJS“¹Ó,¯1³ëÊó¹R³ÔL@š/d 4m6¡¹¯hcu]Ä!%O•æÑ¹ÖÜYç¡Óž�^–‹GGUga˜* ¥Î“NœÝ$ªöXîX×:m÷ŒžéŠ|°tô¿’*móBU˜ž&…¿Uh1+÷Léô4ý壋¯¿¾T¡&œÖŒçN!©²^oIAPÛíÆç >OÚÛ IÍÙ‡Ô C«ŸœþiÍ–…!š™p‚Sèëè§v0Ò’4 ¡WN¦¥ºg·—m¯T¬H ú/ú]AK] +[}šõÌ–\'e’fú©cXÉ~…*F`†A‡¡Ò¯Å»ú¶Vºd˜SnPˆµ´£maR×-[àX _ÀK=òpÓh/Èw#¹ 5›…ýä?2j<‹ÃTÚŠ²ÂËû—í¸™AÔ£Üå¯ðrÈp£ µƒŸjßЗ‡§µøQ‹'äQ>÷ϯ8:ÓŒû㽘¯3½MF¯^ð Z»©Ò9÷Û%?F³rM ÓÕá ”[ÆšÅ&Ìe¡"ʘ`’´©iF°aBBü Až O¤| 2èö܉Uzx¥ ˜ö¤„'³`D?NLÔA§×Åœ«5‚™~‹L o$ËfèÚý¸c¬*”Ær¸Šm§ŠÝɶå|Ø<f!Þ ˜òXjÒ$ÕBÃêtà;ÇR?—Âs p:kæÀÔK<{e–±/§€Í¡¢ô.¼€'ƒ™[$ÔÏéäùDïÒÉ^ôL <ZøºèËé§!a•ÝÞhHᦕÖåÖ!šïPb¢çaEÛ¿êz¢œ§ŸÎ{Ûépñ¦„áõštµ£©<t§xñœ™Ã²0aÉ¡(×"o¼œÚjÙR[¬ËD˜K# ÌØcz'M|4¯Ì^ž:wSÄš Ü›ªD$ó?« Í`ÕläeY6Ïb¢\‡‰ ÏßBû[»E?×µµ ! }H—Ÿ° ‡.Ô|gÓ-Ïu¿–MÔé\šÙWPës«A·•‘N}¡C÷ÜS> ÃÇÇ–®Ýó%yˆŒ·ëõ4©i<ñP6fFÒünÑ€$A ‘ž¢òüû›[ìh˜‹· ®Q¤>Ns±¢Õ$©¶fʹFS\[K9ØììN8qì =LœŒ!…G†–ůÅ:¤tô§ÒBÂ6RFÉ„YâÅ‹çè§ôԹӔɚ׳¬„íc€‘]ÙóôÒ}ß±æi.¿ e’:Á¤ñ\SP\sþ«!s<Wªå€4¤n]þß šEÐ%>o‹ýÕð5;È 2%íáýæŠ™Ž€‚?$³Ùi({y/gÁb–ò‚+ÍFÐeÉ®zxãÛ¿…´î»·5Ðhrˆ¢~4²Wm•žDVÅUßU HPÔ«îã:@÷Ú­ãXƒT KÝq:7ŸFÒ¸]'(Á/4éoHô1Zµ5|&ÑæÆŽLÅ÷cuÔ-èùklÃDdû·›Õ?ñï? Hh‡endstream endobj 75 0 obj 2956 endobj 79 0 obj <</Length 80 0 R/Filter /FlateDecode>> stream xœXÙnÜÈ}×Wüb2è.q_ #ÀÌÀB<=ŠÝ“™@l²Z͘K›d»­|ƒ?:çÖÂ¥%’À3²L²nÝõœSõ™9ÜeýÑçõÕõ‡˜=ôW{¸ú|åÊ—Lÿ•×ìÇ >HèÁf¥Ö¸,öXœú<IÙ¦¾rã„'qÈ6ç«{+?uÕÖr·6û ¿Ùk/Hyš„Ö»¬9e_ÛÿØü|åGlÿ76Çjk½®³²Zï»¶f¯³¢èDßÿÙÞüK~èzô¡µµ>¾ÛÜÁþÇ£ÈËý#ËX_6•`zÙ€‚=”´vPá\?}žÂ}²òEÐ+Ë)÷’4 ô«¦¦WŽ\âãêpõ‡öTìA ¬ÍÀÈU.wqÓ„1CÀÚÍŠB¬lXÌ=‡;™>“‘D<‘Q¼_×ß*Ñ—ÿìõîq—ñ:<ŒdnL¸V•õ©frÙÖÂr)’Òî‘dCËŠVÆè$ÜÕ!1WÕéÜTmVpöv/-Ò’N|>‰~ §{VeíÆ(X¢£¤6øQö²pÈ©'S·ÖæMu¾dcòRîNYuÔ®ÕI¬ä~C—5ývÏeU±¦E:‡¬XÖ²GÔóN §®Áïà ÕpÜ ²¾–ËÛB°ÈçÒ›ë©îϵÙT—áÞzÿ‹8ÖæÍ+ý¥éd?à^à›´±/“¼Ñ©‰Eȱ¬2]DQ%!÷Ý Ñ-qžÂu]$×ñÔ‹{ë±gŸšÖö೓&H7;veÛéºÈÇ^ «°’aïñ¶?år —©fíq(Û†2òD%Þõ]ä;.öäAÌC7M=NâÉhö"˜XÌ€G-?ŸûÞ“¸·šÒö}ÏÚrW š8ôÇaЉë(š¢g§#Û £ìw}ŸG“S²õ–Ýt9£‘ËSßKž¸è>3§Õ<÷®ãêð­².Î6d=o›\tMÏv-Zèfs'7óâÇQ0Ž˜t‹Jð—Íæn ©çÏ,�ªËÃÿP+vꑃ&«CÍÉ¢ÌYÙò¡Ü—ú÷ö q…ª–¿ZHtè’š¾ÎäºÑYû%Ò…²”®òÄ79\ cšÊ­ã›häóòXi`ëGŸ¿Ø^ÀÓÔñ¬¬* &äv#ͲnË àq¼Ì¨r°åì;Xˆ–pSúró§û§ñ5ãf_lž$^j‰®ü–gr&¶Öß>Üü®kTnk+XyÏN¨¾aûLa¹x«]¤5‹bLÿ ~(ZÄ@{a�áûˆ¢Í} öÃÍO!Zsk_„l¡_ê"+#ÿ»q.ë/d¬©[_äÁÖzóûÝûÿ)ÌuÛ³‘>é´•D÷â¦+i„_P^ܶMÑ6ë_öƒ‡&Ô3'ùƾåâÅ3•2L�@üÔ†óLÈ9|GáòëDQv={Ýœê'Ì»‘¢ [Ãyøp‡R ýr©ªÈzßV•‚U7v­3¢ìÜæHã,$ÙipMú6H r¬oWl½®ZÕcäÎD!Z7ò ü[Ð*ÅjÓyÖ¨P—ÇÁ„/܉‡ïd·4>Çn Ì!AÒ÷œçpyPô(%Ò,è4”AÏs‚¢¢Ù®?uÅ©F½~|dèBê1?´²S5¨vª1‰îzä¾…Žê–Ã8YNõ|Ψ2ó`õÚ¥Ÿuöi¦°\ມŽ{K”pYqbk¨&‚܈'µE>5 “ÆŒÓQ]IÕ2íª«ÿ9M=R)œR«ƒ*ÊZô:f£m„ º`Ú4,;X @ÇæÓ“Î <­'ÝÁQ) ,[ ëz…3Ç®Í é²K:Z_†€ÁSƶš_çª5˜:õÃ[šïwÚQIÚ[KÒáIÑNÊýÔpt(ö“8'½ TS#zcŒÑÕßn-à “0�çeèt<¶t$ýëÇVˆhü HC™¨ÄirÜãNbÈŸ6PID’Z¥Rë²ëZ ÊMº-NÂi¯ä1\0Éõv©ÿž,sI.=§~:4hè „ “,Ð'b¥x…tjLR‡³É‡;¶–Z#·Iî‰äZÄ9PšJ;eK…í1ŸA¨ïék«¬²]%ˆŠÞªw³ªoUbÚQ‡9~¨klŽЗ“bò,ÛR£ }„@¥¹ïÉÛ¬U¨°8p/Vå"EK„u¬Î$$ÄIJýʡ՞†V›OHYšƒì(¨´1ñö4!ŠakQ·Ý£|®Nm'_¨)ÕÖ %'°^)uÿˆö©g2Ëzó5#i*O4“ÀѺ–~¿N' yЕOƳq ÂJSÓC8°Ã0_]_ŸÏg› Õ‰}‹ÏŽ3rkŽŒ]ÏØ_=ñE·D"Ï\f'†.Wì²óÓ,Ũù’‘e`ËJ4ì¹ÌHÊnÞÞ¾¡¼mÞVÀ JÁõõÖ~¥xq<r™ 6ËÄ,¨óû™Q6U.(-φ}.:X!ϽuW‰ ž6T*yê/÷nS“•=†äjYy¬cgâÁ4t!o§²«L,r¤ïˆ"f¢ŠŽ)ªM[MEç®0¾œý@s7wIvɨ8€j<pb£82¥ ‰Ã–tºz=Y¡+s¬‡•²É«S!.Œ83#ä±:èt£ y”y€„b‰L‰¬ÕÅnÖ:Nòßìf\Òô©P§Ãò+‰øÐÐäê³þÛ‰<£B(û†�âëNÅyàÝaعÙ§©Z’O; ¥3= JxK¾ö¿0f©Î…èó®Ü©‡óX)|Ì"ÿ¤öÝÛ®Cô¢n„ÐËsNÌ9²³ÝT õ©¬–=ØrÆ£&š~Ð l7Î~ï²îÑŽ4p}YvqmHª6bèò‹óç;E·èo,ÃW9½Ò½”#qYi8î&fR9Ù·ÁiŽEV~q…âEôÜtÅÖº0Eœ16ͽõÏ?¶EˆÑ¤Ço=îÇfTÊFÓE¼è3ºõšaà^ê[ 9'ö¶Óýa.7<ÏXoqäS–¨…$EÕ>À&“ÆKƒ œ‰ú(I I~ÊúþŒ¶ÀV~lµÝ¬©‡Çc T©ÕÔ‘é›Í4&ûõýÛßå œ|!o¹èB]»“—¾ƒ’džæWùä>t T‹)p”ȳ´5^ž‰†`O&DvJÞ±uÌnäè–Vw«îòÂBV~>ÁaÏq=éMšü¹!{³¹ú+þüV'.ªendstream endobj 80 0 obj 2436 endobj 84 0 obj <</Length 85 0 R/Filter /FlateDecode>> stream xœYÛrÜÆ}çWLù…Ø”0Á î~óENäØŽ­r‰yÀX.",°Â…ó ú蜞€URª2i.ÐÓÓ}úôéÞ÷,à‚ôÏü,Ï7ü{ÊîÇ›€Ýß¼¿êCf~”göídô‡ýñF¿#X*Yš‡<ËÙþ|#ÒŒgiÌö7o½rÚ;OÜíØwømçË(çy{?Ý\´Ì}¼ûçþǘñÃ„í«›€'aH¼bžNu75e15}ÇÙ›ºÞíÿrãCšó,Ià^{ëuõ4ìDÆ ¯¼ó"czñ9Lx&eª_ðúakM%27Ÿ§‹öN=c-Èæí3ä©TžûUõT4íÈúŽÁmö±­þ|.&®îÏ›¶e]?±²?_Ú¢éXsÄ“ÅD'ø"޹H"æ ©M‹@›&;U_Ý-='yB/o"«KaœNÊHÀÕg"àa&õG¾ä2ÖÑ|`*|z$á"”ö"uÊÈñ¡¹?MìRçf÷‘ÝyÍÄÆS?·•ºÀ¡fuƒGö¸ÃYA #³­|†0Üý|ñ‡º¨ŠC[ßí8ÛÃhÝ©T„87&cÞCã+·Ã,~¤»»öeè»3²Ïv2ây.S¯²É¾úó_~ùkF6uŦž}ì*ôSF´š¡.§~xÚ%1²%ׇóDº¼ŒØþ§ï›÷»[˜ga`²*¸ ÇÈ…¹)ß±¶v‚|HB¯žØØ ¸ÓïA”{ õ‡þ¶G `>’¢Ó.Lp@xý¨žTçKdC¸dÖÓ|a…Æ,ðPX™uñ­ÇØCBc’xåÎaOfy¶ÜG�q*Ú¶'ÃäŸ=8´z傘Ë$·µ@ðÅÛ?ì_Ó ô¹(OM§ðäË,åy¼ÉžwêljWý0çÀ;À?([ë ¤èöü4ÖíQ#:Ö€L¸½žw[,Ž+GPã»ã¨qG©í‡ŠÝî∘%òƺêéÖ‚µíûw”­¦-xþµ “-x_¤ éø²nnÅ®½oû{”«öù™óéÔ@òP"{WÉ ZóûLŸáÿò‚ù~×û‡$qîÍGñc=h�%6ž‚ËTÓá÷ÍHðU¡8þb—%Oð_6¥°×t÷„Lz©Ÿ§ËŒRžPžgÎ^u(g0¸‰ÞIÎÃHXÔÈ4RÇöÅpš /ok2C>Yk¨b¨Ö äKPm¦5—ð³ýXe¼m<ºTã Xr�…©Óë¾ñ[q¦vàT«BcH†\†Ž›Õû5›0g˜ì ÄNÊ ‘ó”ØÕ|*ñ âv‰>³1Çw(¢U1 Ø(Os÷Á!zìê²ÇBu‰~déÎ]O¯¸®iŸ€IÊ ¿?¢ï-ö‹ah*–›¢>sG£ ­çªî#ýª,\`äì×(P…Ÿò4 LŽKú`ÒþBéÕ÷«4Ðô¥ ¦¡4ˆÒŒ X‡½Ã˜Fý—~2o+Û†¬¡ €^c Fí9й/V——KMÃÆ!A»©H¤êË™:D]qöûNèNäõ3+ Þ¬Úƒ)Æ…Gjw™åe(rM¸¤*âÌUáJ9@á„BÚvÛ£¡¡¹—tËzü0DÂq«ÿøž‰/½£y“pô‰øKª@¥3YƒÌ4^÷«tâ·…þ®:Jž£Ûrk,£¥˜n"”Œ¼Û´•lé/Ö°‹ÓL,•C/RÆ>”õÅÔÎòrzÝ2⇦RÁ¢3ÜyÅaìÛ°„êds…x¸äÑòÎÅ ìßzw»i'¡DÓºdZÚ,Y¹è)@"”º(ã4[2áÔ—ò_I8ÓV�+€S÷¨xeø÷^û–gZŒQÿ]:éªÅJ0¤pdeZï»} /uÙŸð?ÆQ¥(!Ë@7±E< ]`úURl¦¬~~uD«Ú0f”ò$²ø,‘xCÑ^G„<¶úq…U×M0†æ@ÝmyOÃtÃÕÔ Õ ª°mßRòÀ†»-Ɖ‚´Õéaì$1+IE¾óã ðî¼o*Ø'ÞNQ`<6ƒDxJ†¥ñ§%Õo'< Òì $Kª$<0y…^¨F …_4ËPX#Oóº_ÉØYIa^ËBL iòi">‘„¡@ùXKÅhy˹�zO–£žV ys/"MçR UýŠ H§@>”í<6›�¡%' gè�%:×(ã¯6¡>â,µ¦§ÇÏD…Ò[´#´í(åðt!?Ä̆~i‘· ’¯“ xo£EbT8) 2‡aM•äG‚‘*þ�(�KvÅÍΦ¡¡SìZÂo«1,àqìK®»§ž0ž'mTQ”fùçòr‘§ÿ•´ë³£<YFYzQ =¦k¼Ÿ‹w;j2žÑž\óÑ<÷Ÿ”& Û­#±‚bÆe`‡pš®H4IDÒÐÆp®³(•l’Ïfñzú€p7ÖÉ3w¡9Z'“¡zÆeO$ vßOM1ÕW2&@wÞŸ÷û×w;ö²ÓzüOoÞø¿˜i£°1À®×4¯MC÷蹞N}eÆi‘ÇT¡à‰æ¾MžØÏ˜”Éòå'ÐI+_¼rèÇþ8©ÕŽÃRŽ †óúÀŠË¥5@¾šè©ËМ1J£„ÏugAÅÏ—K?L´²`Á\Lcjl‰šäPã¨Ø4Ký‘‹L˜D:2Û33ᤂ0u.žˆ†U©*?‹¶Çd¢Ã uÂÕû:*œý s$GAäÄ{šñ„{ðRÓ©m‹ÙæÙm·QFǺf¯^î`ÕP rê¿þa¨ÿ]¼óÇK§sC“Ý}éâŸ>LZðêÍÁþo=ôR’4T¹L2"©t¡’Δc3“ÚSdñÊ@îÃÓÕ]_Pκgk– G/vQìÁÁ5 6p]X^¶:ßÓ˜㘧©ínˆ`Ò݆úýÜ Ô¡XÛ†õ¨C Ñ$ÒQU&vCÒN:‡@ö7¯_YÚµò§â~p›ZŸ`¢>S=üúÌeC3v^úM ©Œ+1؊ز˜ïX j;qCâó�éŽE—‹bÀOSᨗöY[2‚&ËHhpÒ+”4G¯‰z„ô—ÂßfÚÎFƲ‹·®ï:Ñ4–¯xö…‚Óy†˜Q%Bjˆâž’0]ÖZ(ñ\0%BšÜ<²¶›‰O‚‹!"™%^¦=­d¶‰\&Ý28ƒ©íìz”Óg+鳞ßĪ«OZæ/p·ó,^‘Hj–¾ê¼²¯” „ÜmŸôÂJÒçåM­³´3‰ÝB§î*ŠoÁný™}}K8¬»~¾?™î²ZEn¥dÆõ4v+„4´+ЇþüLcŠ¡›r)]P¯ÐELéôµ¦¾~Šî:9ìA�Û¯–MDp›7×ÁM1Ml”Ii™V¸Êz@K a¡Gd5m§BÅÀWÃ@®VÅ_ØÔœëqQçìã %¸5lôÆ8Ú¬¾híe� ‘_×—¢½ó¢ C©Ó+/|’ƒb¬ßn×a³ÇL§ÎúœqÀ•…Ãì~è¼`ƒì5Ð*ç¾vkýýw¯Î®«K]µÀúsUU#dˆ&JTK²ºsž-)Pc’Ë„!Óÿmc’Û}n_òÅ5I ¿„ùâšó‚\­I(²&¨×ÍI òÄ}á–#]z1‚J‰–/8¼wk„‘³Ó‰Ûìõ4£| šv ÌL¨uôjgÒûc­¾Ìhªëµ ½O¸óÞ¼ù ¢ÎÀJeðVSOD”ômS:fWcšäanÆ4cÌœé¿ú±¦Í²^ë 1ã>vGÙÐHûVãqVBM³i(ºñˆ¶£&äŠjÌv_b&Þ[6BïèÄš³X§×"¥EÌ*cË�" ¸Ûã¸%K®'˜+¸ß0oä®™oê‰fJTG1Mõˆ$¿{H *Öm|F¥í bÃÃhu¥D‹]ôä3€Š< ý;5IÆ …ee›¤æìNÙW_Óôµþ5ʘvœ• iR£xTû…ñe÷Ù¨@ýºCj>§F!_‹JµJ9}1¸ædódÊ~œÁŽ(#©òÅ"!k/÷7ÿÿ�¡ÆÕ.endstream endobj 85 0 obj 3148 endobj 89 0 obj <</Length 90 0 R/Filter /FlateDecode>> stream xœÝXkÛÆý®_1µQ,ˆcrø6‚­ã ¬“Ô+·ÖF@‘#‰]Š”9ÔÊBààþçœ;3$¥µ /ÖØ•ÅyÜǹçžË÷Ìã>óèÇþ-v³g¯¶Q3mfïg¾~ÈìŸbÇþ±Ä‚”¾X®gfÏÁ’,àiÆ–»™Ÿ¤<M"¶<ÎîœâÐÕoÿ휽À§¹+ÂŒgiä¼Ê›C^³ññüÝò§Žqƒ˜-K\ŽÝÎºíØ©=°¾eêPR–œ½uþ^–²dUÃîÇÜÃÞåg"dË›¼ôΟÛ^²~›÷øU)†ýV²Fίf®Ç=WÌ2 ?Ëà�.t69ãé<H³44µû¾jÖä;Éʶ8ìdÓ“5¿Í}Ï83‹¼Á5ÅJjž½ö½!R™ÏÓØÞåºJ*…«’.âF<‹=a—ÁmÙ …dXïÒR7ÌõÅ&:ɽþ÷ÛªÙp³0Æ¢˜§ö¦Ýwí‡û¾i]ýÉ­+Õÿ–ê•æ8d&~/ÚÝ.‡•û¼ËÉZÌÚ5Û¶ªW츭Š-âÀš¶'gYÎô™:@AHQ"áQš Q\Ts‘f<ô¤UGGÇÚG°³Ä®¢ûCƒ›FRÒÔ^Õ'zîFmΜ%òØ6õ‰«º,òHPú8ÁÓ‘ÀXL)¼rr5¦Ö÷‘ü(®´î"jµdß±b ‹^vÆ{`ó8CVÇé4ÁÃ0öí”]Þ[©X^×&X –7%“kÚäû)-®œµ,úJ§ ¨Õ€ô° ò b$Y­‹ËAÊJå«ZxŸå úÄ4à*ÑÈ_ž‡!¢Á#ÀÆ »jt¹X Q„4ÂÀ7·ãiÉrÅd…ë;  lw91ø(Ú¦ÇÿŒm ºcÁPÓç_°ªW²^sö£Æb”?Ñài}'öèhøF³?ä;[I„<$ƒ©>ÏŒ©wξƅu[ä5/Ú;ÎQ«™'Tk]¦Çg+Ÿ§žÉÛñxœÇ‘ÃÏ­æÂs½Æ>=&ìqÆGp<©[kšy`-Ü$Ξ5’-M’xH¾gQIØ¿›šö½„Ée]÷õαgœ÷,¾uþ¹\þ â}Ùˆü¼¼yÅò‚ßôU‘¡qFåô…l'ûm ÿõÙ¸/JÂé]£(+VJUm€`ub¯*ë²]='Kl6Š®Uíº×­4Kê××·ì(Wà¸îaŽ {¾Žìg×hš\ö]%û¼;Ñç¾-ÚzÁ:C²cùˆaIƒo–O–hó;%]ÙlªFÊÎRÔò¢Ó bdã¯ètÆíLð8 ¦TBXÊ84^ïðÉô*6ê~l•SZ*=YuÄ"Ô(¥ö×+J‚p_a;x%·9�È=/K‡ …¡¶ÌÇ•‰Y@½0 dS¶ð¶\èfj×˦h]¾‘Ì6EËAè/ø–Ït¶©ÌîÔ‚ªÛ–Òi1FíúXQmá²wXÕU¡ýŸZ§Á3ˆ:†µÝìË@ô2‡ [✪T=Ÿzÿò»;çz­]4u.âÔÉ›žé6J%`¬³¢¢3tù÷ ÊBó¥.’˜‹Q¸h¢ó]T— Y=ôñ B´B0�1H—¹d­fñ8ÕþêôZ}ÑÉ÷‡ª£öŽ»êï+Í{"âbêZq¦wªîe··7Ì~ÀpöFI£*&ñácS8ô÷ß¶GÐ1@9eÞ¶6wLwÊ£l,&øû€žè{Zj<ò5�ù™?i%Aêkcpk™é+U•ˆ±NÊ ·×Â'd°? È@ê¤(5}³,!/ûj'ѵ^ ¦ó©#c´ki˜×n¤ÕvÁ\·=ô{ðü÷Ÿjù™N×hsÿÓUšv%|׋°R½ª¾ÄSP™AfÞI\ ¹ÁþøHðîíZK*–Ý¡î+bŠ¡J”.X“SÑi¦3OP'±IÒëêé ]×­¡$vކÍrÖv+´eÝÕ¥5Í*ªÎ´-n”Z}4„/Ïå7òxÓЉê‡9�éyIàä]¥K j T&à}°@ã÷Ž!z_tYèÀF/¢Ž²¶ÂàÍ뤿‘ZapvSÝÈŠJA?CÉê,ý ÔÓð ynr›FýÊV™Gضï÷ÏŸ=ûHXôGàšzZì´¹B:µTp[öûý©ÏûýãE4œC‚„‚¯.Fò$ËþkȼÓФÑS¨öû¹ž#‚È‘ÏÍm¼ž@³î¼0 ]†úÈé÷ïFïFßú¿?OŒÿ˜ëHO¦ÿÖžÇÏ'ÉyØM¹á¤ÞPÕùI»{^™9)Àæü(Ïãñàû©ŸNòÎO¢‚¤½z3øD• çJ×Ç6¿TÄaÀ³oVº©by.žè5ŠLó»åµj5/i1‚RÄ9§ÝTàyhc[Vݘõ˜âî‹`¨ R¥Z¨šà ¦‹ŽŽÐ~jñ©ÞAñ·Ð1ÐM'H_´œºÖz*öÓ46NóÛsÁîûb"ÕðúD%BÇö±Ú+äA?j¨Š]¹WК9SfÐ)sµ…0Ô5kæËé²}E–$27üõ…‘òâÈNî0i»$ä?%“ä‹™Ûx ºôÔQjð›É‘¶ö<BþPáPò²xx°%¶¡ëõQGÉ6²'IýËÈöø¬\û‹Õ¦4bÀL\ëαaa&ª$†oŠ¢6BgÍí ‹Iy,/­Ñ“M¯E‘&6•ÏýÌl~ ¼áLi´.xçC¯‡Î’­;0Ý»©IÛ0å—´b‹î²š7S¨B͆öÁë› Dz;Àd­¤­˜!÷GbxÑ6 úƒÄÐ905ÄÀÕ¨¦„¤P4ÞðZƒªÀŒˆ6öCOP—E'Tœ—cîxÑ#¦,«yàÁýÈiúé­ðyûã»Ü74#ý’lÞÝ“»CÙlÇó,ïa’ÌFyïq µOg}:»…¤ÖÔÿ"ûJK LßJp-0­¿ðó"kI+¿9Ï;¥Ða±xb½Ø²¡ÁºZS¿XKíäcŸ¢Øª¢(‰vqÆåO§¶”ß›€G± xL¶È‹W%é ëÈ;Ä `ˆ©‹mÞlÎã®»hâw �`6UÍ!1?Ý01v¥ÃÝÂÜíÜãºÉ<Ì)áà,½ZÔALCŒ€Ù%ÿJD³6ÊÖ‘÷ “Íqb–='J»¤üÔG{ü¿|óÃ#àÄä\Ø¡öÈUzÓjQSÊ¢-uhˆ[ÍÀ7’…VˆU¨Ø_…GÚ°Õ/Uh'ÍjôΓÈLY6;“…ú6ór…\ ä¤çöžŽ_!ªRŒˆì°Gcv+ÝžG³.Eãÿ¿bAB”—€Ð›k–pi0G×)†#G$ì§ð|¡qFƒÍ~Bç¼\Îþ…Ÿ?q‚XYendstream endobj 90 0 obj 2609 endobj 94 0 obj <</Length 95 0 R/Filter /FlateDecode>> stream xœíYÛŽÛF}×W4übj#¶ÙÍ{p'v`ǃ}˜ñC‹j˜áEæeÆú‡ýè­ê)Ùò` ì`Æd³Y}êÔ©SÌGPFüc~–ÍêÙû”Ü «€Ü­>®˜ºI̲!?° à Å~¥Ÿa$å$ÍCšå¤hV,Íh–Ƥx\ÝxåÔ×·»]“ðÛÚçQNó,öÞŠv5q·×Š_VaB|ø¯Ø­<ßïÄ4¸¿•¢—ýºøCÝe\ݽõ^¿}~…9#R”+žRÎò¢Áûu/À, ‰¾Ð b•÷î*Üë·Å„u}”eµ?‘ñ Éê]¤À‡Y˜R–ÄfÃî¯Aèæß²%û®'ïðªÐ8ÆW…! bnV<ÿ}ÉòL߸ñŠW„Ó€ ²X³˜,J<x+W¶cUбêZJ ÂÞ’áf>Íxê°(:3Ç Y`ƒ¸— 88xˆ7s†yÙ@Újåyâ “z‰ —sšÆqnA‹#®@äŽT-)»ö©-1FòX܇!­h$y<T唢%[IÄö?ðœÈQô#éö¸czöž†D/uû>ÒD-°$㌆)³ÈwýÅãìì¶?maS6ƒÛ²¿Ø7¡a0»ï4Põ´½tU h.KФÈãˆ!3X€|ín¬B†4bñüeÙõ»ª½#cGÞÿô‚$iP9¾áÍÊ{ÈTÑaømBÀ¹~ªr«–sÊ-#¤ãWNyæÒêõPVcÕÈa£RS‹po!3U]cRp_}J¤8TϤ¢tÜß?öݧÓ8µ­¬ÏË. Q–).üû L^ÅQë]Ä·Þe~ 4ó ³tŠP$` ÿ“~—*⌆±Kð§ÓyžTù¸<Ý®7gH©c•ÞMÚ®õmDcWvõ€pcšã¨Oœ”‘££Q¤tʃuúİwßMwšÖædí0J±Cò6²—õ Š©¬FÜ~×)üºº×µ–G*W<ÇÒ¶rÑ-Å�¸ié~”½Ð¼Sõ>£î‡€’Çs¨!2BGK@‘ØÉ¹ Ùxñî×__¾(H/?N€äÄß«^(1.Î'êZ…f(¸Kïq0u¤/Z èJØÁ>åˆZÐâOD¶ëeÓ°k•ÞNÍjõ<®±Âƒ4ôD;ªœ\bÝéZð×­À#l)M³À²ÈÛøO@)œoøûñè«�¾»vø^‰y®Ø9ÏCæ­÷“êï¥Q­äå ™^i7^?(4%ÙÉýõ€çÌS=gª±c×?«+`O Pô] «±r nH"•<ˆA÷?å\‘'I [Ñ´˜ÙéSw<…–f,‡vR4BÑ0áAÚT¦4IÄдC•$, 1áeÐ Üë³þA’fŽÎÍ×-Ìž7^·“”¼nc¸k)7š ØãÈ(ëZçš`娖T[QÞ[f•u­ñ©LšE$ø ¶Y†³–Ï]G0=HCD@—¢ ÕE¥É¢êé³ÁFV—Å0œC€ŸIèä,5|†Iš:ÅÓK$Ð ï/Ou¡O>Èq:¢¬¾¾"—)»¡�òu¹°bañYqz¦"é\d8tS½CñÇFÐí¿U5¡êìͪø×Wµ£ì5…#eZJçÇôÖ°„JòDŽ‡à‰ Õ¸&ÝîÇaŒÛTiÈ"h§‰-šáõšÇJ¼+qæ:f £ê¦sùÀ—#Uo½ßÛꜧ>óèsð2q¶Æó>fà²$ƒ‚¢ììP˜ ¹ñ>uÉø‚F:Wlø_|CsZá JSâJºëQµŸ½¬9¯Zùùþ7ž¿öCž¤ÖõÒ8¤l¶»²œ©Ç–¦+îXa!ãЗ,¨¥Ú�(‡¨{ho'ݾ‘fªâºvÅrRÕµº`-¢`ç¾î^–¥Bš¸ ¿&«¸«nÊÉÉ«Al¡TÅ6}õî½nY {1èy`Õ°xœÁ• ]/%¾´.Ы“ÈõÝ\Äðp¶ùlTà- £B\ªvìŒ[5¨æåGÀø pÅ ÿàF‹ìiŒs±”ÇK/¯Ôɀ踸ÔS ³'(<�e±äuMƒ:²02¡y¨ gnDÙ®£˜Ó$˼Ób2!“ØŒâBÿº� ¬:ËçÅýÎ/ýxö¾´ Ä G}¹4Jp:û²ù܉¡ys¼•Š7Î3oèš3�t[%`tNzLÈ¢X$ðŠo¾Yzr8Kª]Âõ˲|-¼so”2á˜vL¶O¾½pÕÿþùá‰óDÕÝÁÎ=¶ò6ꦬkc°‹WJçÁîcTopZå¶ Ú;iH€6V7R´Z­ŒÝ%ÔÚ Ù÷]—À×=…èùÔŽÀÆE>ê–#ÈÄ¡Eù5c¸xd¦ÌÍ}¾h°MâÔæ €ÂçŠ+ ’ÙÛ]?Ô#0qüÂJÂhøPlÈvÍoÑP·h#µ<¡•*AŸ¬Óê«ááÜ«¦€£³¨ê †-`c©kDшnƒ2!ìü̵·ãN†F„ÄB„ØbŠªj$®ž“Âu`éLQòÝñÐC`ß_jÿ­w}ýæÙõõ+0–W®ÇÃz½ÓØc_‡ÆàENn¾`snI"ps38¹ç|§0Þ[½þ«2ýwO™`Їª÷rºDÎ(NÜz8Ê�z0fc–™§ £6ÌÈúQ Ò<aÉ3üèA¹òJ˜sèYWfôJÖ©ä×~FP7‚@^»éi@ƒÓ‘Ÿ_ÎWôW°ÇYÀ—ã1×P.ßá`ÅÑ�$¡÷ˆú!ŠV/õüä>óààŠ‡Ùʃ&+g)L].®(3¦ú¡ê¦^åm[Á07vÆ´%Û^¿+‹#˜Ýd‰:™qGfË9ØX»Î”Viz¼E LZ”;µÿ³)É´=©)HUej¦ � ýÎ(ôw£AB¥ÍM¢É'45©ajÚÀ N”¼2Á˜ÒHAºæ@Jf  äÎOø\… ÏÊb ™F¹¶Ì`?ýŠ~éXhZN“¹·¡9Ç7ðEeÍΡ¾˜¶Qlõ‡8˜)_~3ÉŒKÄÂ.{°Ìd˜À=‹KBœU(J=Pg?ÕÊìêrúBï #>ëšÿ¿®Ôþ˜xþ=Å7+Ϧ†[ïùn§¿ðA‡ƒ¿àªõÄô…ÊåÿŸ•Ëÿ©Ü*÷¼rsW¹¦O3Gâÿ}û’±†‚æYFc¼ø/DÆÆUn£Øº–á&/‹Õoðç¿KÅ/endstream endobj 95 0 obj 2520 endobj 99 0 obj <</Length 100 0 R/Filter /FlateDecode>> stream xœ¥XÛr#·}çWàm‡e;ÀÜSqª|Ëå8›5ý$åä€äØÃî\D)ßàÎi`®%y“ÒJär€îÆéÓÝüÄ\.˜K?Ýëî´xÿ1b‡zá²ÃâÓB˜‡¬{ÙØ×,ˆéƒÍ~a÷I%¶9-Dó8 Øæ²¸svm•ß;â~ɾÁ»åZú OâÀù‡*Z•³áñòß›^ÈÖøÝ¤ g½>—uã¹Þró›ù\HúÜ呈­å{ç‡Íæ o–‘Ë]!統Ț’Uº>ë]Ã>~ÿ “¡ß —{\2U¤¬(¶+ ãs“#ÖÝBz àÅ5þ49véAÂeœÄ¾}@$€S5ìÃ?ÙÀѧV×MͲnÿþÝø YÀ†+Çø±´¸uÁöež—Kéó$ =ç’¦Ž #iVá�YYp¶9j]¬é0[}T&r)" >ÄåÇÂÚ}ÈʶbYÍÚmö©Í𲥨ØEoÙ¶²¾âÀw.µ®ê«K™Å¢79˜`´Ô5kÁFÇêQ °&ñŨÝ9Uƒ°íKõ~)(_‘pT›7”«“vø%ëuV7ºØõ¹ „<êR#xÔõÄÙ]0Ò.‹¸+‘Ly¡‡Bð$LºÏÖÒ„½úén¯o¶z�н Ù¹¨VHG=J$< ‡ÓêêÁx<½‡2]á\O† H$̶4¥eEVû‰ «Ò„E¿XíX©ÛÝŸ\ù-ÏôÊôI«ÔÙ·9+‹ü‰jµ5>"oï? ·+XÏQÿú§[¯ór§ÈŽ]ÙWöº[ÙGh¢»w¾JS›"„Ï]Ô-ÆÔgÈã¾r«Iý«yÙ•yý·èˆ kÙÙLÙ=€Ò÷Œ·i5·µ6ôˉ)L£~@uS|Y“¡¡Tº©2=c…tÑr‚ž¡jâSLëZú¾uËÙ‡Á¼BææÖˆ‡‰”o˜sòVQ ¹Þ†WÙáØ¬ÈœÌ Ð"'MÁº®¶+O'0NŸUEV¦_™(”aArV¨“f8ü;•çïVðþ KôKp×MbA êþ£«’VŸJ˜:•i¶6Fîê’ûÚg_-ßM‹yôÖA³\msk“,P¬±TJ*¡©`Ç„#_ÌÉ&†Ü»‰gqø «SèˆçÙ©2Ò43¬¨# T^i•âèf™íZÔthî¸~d›N¶G?íƒ6PX¨kÖ:½_rà09"œ0üvôηÚ‘ä¶…'nO”§fl"€wh5wÎô„+ð÷T"whâ˜�`_•§ù¬Ü¿vhn2‰ÚG¯LÌìéCÿòEà-{ÜM™ƒïd‡¢¬(®!žg!Ü/WxZ¶‡#ÚÖö7ÀHT®¨´wjÝgM7°´¦™Y4 ¿¨_3°ì¸™•ƒñÊ-Eíü™gæûrš�´Õ1•ž&@ ÛyT§sþŒ³Òå‡$ ¶ïLc[bÄ$‰Hêpë}s®;Ì{D£ Ï+x4'_à–|C Wl»„#×<§mXšÕTKhj£Ý! (x=”þêØ`ãê zyVßuMjua=ÑRÓbÌÖ+ Þpù%í±>_ö¦rŒ7\Î9¿¿6ádr#ßé¦bRx—¶;¯2«£*†ÝT¤¯L¯‹0Є?š³÷R³zWegÌœ©V{ÓÐÆâ¦6‚Œvù1!ƒ?Ü¥$¸FÆÞ¹„|¡Q ©*h¼m=Mù%£iŒ²Þžá¨nÏ犒ÆYsT#Gº¶V{\xQ¯Qü04ÛŒZÑ)‹~Ñlp÷cTõ£ÌLbÔÉ€¯óPN‡qOâ ç`ºªÊjŽí0kHvBÜZ0ÃЂ9•%;Eø™vÊN }v&³“$GÚNuƒ5B)÷CȰ¡)…Ý ÷ÔGºV^ÓÜS5IEèªé:R§¶­ÙéG¶‰^oêFà :*Yµ1sÍÄ+­È uÞÝ–:k#ÍþWÁóçtŽ•‚£ äì­Y¯µˆ6Çiï“!¦t?¢/ç±õùtés>“9•†p¨Á]$V£zXÜ'ù& ×âÏv‰òñi­Š¥ ‹†/œ'Õ6Ç^ÏÿI èÊgðœí~'1Ž)H²J•fÕ+$0Ê*µÊ—¦F[˜'àœõÍ®.žÄ5œÝ\€ž|vyqŠ ~X1Åïñiº Ý1&»Ã7ã6š H,r±Ï=oÆÕ;çDJuAL Ò30&2r›JõWË÷t»Å] Y+Û"]cfž9›eÙ]«oÚª:Û}Q%ÔYpS™ÓEœ}Mö®³òYéÀMÍfùðy¯'„–ø× ö]eä×é>Oø]Ÿsj}uOBn°s2ÇÖ#^ãœóú ?\ÝÄÞ ¨Í´£ãN°1'WFâ5õ )Ó=™ÈT¢S@·ù£Y{2Úá&ëm¹"bÄ7¿Q"Æ9eꊿpk+Òì�~}-Hc¾B‹oÁÿ‹(/ïš2 ßâ–ˆg¼èö½Æ W„¯Ó"¦+õ; f¿Ð‡ ›K! Ùþîé¾@Ž¡ì08„1Y¸Ñb =´ØC ÅÑèÏl²±ì¾¤»™¸Ÿµ½CB›væ?3‰³o×<铽ˢÇ=鿞EZâÅWYö½œE»þð=ÍKÕíMÓ4}wä˜D? »£˜¤ñîFîòø`·*~Þ¥ñ¯ïÒ‚Ä5ê72M_™Ò°¸»dóÀ‘û±…¸”®f£ô�‰„úÝfñ/üüÇÅ–endstream endobj 100 0 obj 2111 endobj 104 0 obj <</Length 105 0 R/Filter /FlateDecode>> stream xœYÙŽÛÆ}×Wô›©ÜQ›ÝÜ#ÀdDZ=2‚`&0(ª5¢‡‹ÌŲþa>úVUwsÑè"a{LöRË©S§è¯Ì傹øËü•‹ç#vß.\v¿øºô’™¿²’ý¼†1>Xïz`‘dQâñ8aër!¢˜ÇQÀÖÇÅ­“õMq爻%{ ?-WÒOxÎïiÕ§^/ÿ^ÿºðB¶‚ßëíÂY­Mýý´ªº¢\®¿,V.Ø:£%BÒ’µÂ.>Mx€!ðTðPÒÕNQ´t<ëjÖ·Šý²^¿gïÖogißíUÕåYÚåuÅŽð–ÕeÙWô¨ºgǼÛ3XÄîss¹èv)yl¯r¾‘>2ÐFÈ8‰}ó²: Ö ½D?G¯fÛDÄÃØæ5ÿ4nƒ€ú~b^´tÙóÂ5±_y1ì„8Ûx¬†` ’!O¼$Ög¸—]Ý0U¥›¥x·)kTYwŠíë¶ãäu(õæ•y<ÍŠà.{A?áâÛuÓýýçÄCØT–?ª­N�n=ØH®#�»ÈÀ[‡_/ !‰çì:„¸á»Ò„ÅYÕ—Õ°¼eUÝ ÷\±¼ÃgiÛö%\›vzµpcWû%pÌg€EŠ B©Áº†“ëª8±m¾;ÐŒÄÙ©FU™bÕ ¥ÛãáÕ–œ#ŸÈVMw™=I” �±}õýŠaÉý˜ûžuÊ„dR[þwË+tªÛƒ;iשòеÙä“Lb.i£ïj‡^þñîÝë—kØÖÔý½†´¶ö˜…ÙîÞÌ’ÓÕY]°¼j;•nY½£m[µ[ —»Â´/:»CpòwE™Ÿà¤ß<ÌJ„6….÷‹êÄ^ØU¦|oðùaZàbR[§Ÿt#x «§>;wÎÍÍ/@7ï{@xÆæF„.÷/ñ8]Ľ`R.·N¡X•–гÿEM¨ˆß9¶ìT÷˜ØRÜu#Ïù–o>oØÁ^OÁ±÷‹X€ƒO®Ï§ÅàCœ[õU7Zæ¿ØØh_‰­:¤M uûX( oûÜM,¼ë†¬Á'ü˜Ù2ƒkY"¹œóšû”Ó`ì./U{E(Ò¶ƒzQLE›ó"øSD|5ô`|—nD.€udNÚÒ‘ ‰•ªƒÒ®+zŠäŒ”¥èê3*”@ËÒ‹,‰ ë7K8#‘ÒÉL=N(1ŠÌZ'««Ç{ öyüh÷xáè²`޵¥.XãA@æ¬~§{æõíÇ| =ää­êÒz–ñëZ¥èzMmUÚd{S·7Å' ÎrV€ðÖ¯=ú ¾3‚†RҔ̛õûç7ðÔͪÐw–6›¼kÒæ4D°Ž†™6«X»À æA8Á¬[Ï•&9žHªíˆK ±}îÃlÉCßâŒd™n®¾m4\=d×}BÝí[hèìç×oþøøš¬Ó«¨›u)Q€‚‰½$C]{-;)ûó¥ä¥;DîÏ«¼Ëîïÿ|5 ¯00è°="Ê]< NÐÚÁ«±rcîëØ’®µ# ,vG¾Å”h¾ü)M(B:ßÓ¬»[r¶Öúˆ{QŒ'v$n0'–c,C¨çÈ6íú°+áž7³Ê¦Ã.4%¦èØàwgç>÷ÆÛÕazN,ìåWДµ}–©¶ÝõÅYìÌ‘Bz<W‡)ë9¶#4êñ;¦§´še›¶{ölõŒ2£Ã€#y‰ ®¿µGëš±Dxr8Úú(½Œ•C¨ðÊšÕ˳²H"ý¹nËöiu¯´f8b]'®ôœºy@¶Í•uus2I–xhFºÁÖ¾«/<"Ö6ÄíFƒ¨ð5ÊÜ{bRònHö:ÒwN‹Ââ`ã:@Ý„÷ÙžAiPûÀ‚Ò¨í(§À$-â Îþ¢ØAm&ndCã†E=+ÓÓDkàÚª&±Eïœ&%1¶s iŸN0:„ˆåήµ*±Ì’ûÃÕ‘>`W£º¾©Z¦Õ 6i`Ù‚…æcó2úÆ­[ް¦>¨††C³ú–±f}sm€é†Bƒú:rSÔ"¯¶§ªƒŠ†1£(XL<1ÊÈt-ûøæ%K€¬¶ê±R¤ò`Y€¿E²¯Ÿa±bT3a¤é\5àÄeç ƒ¶˜º*j w›7 i¾íGÇn‰Ù”À@õÍ(Ãqšp=[øSæÇf «ß˜Sµ)À]�šx 1¶¢Fk,É€Y‚€x]~(Œ°%±ñBõiå@B„³?qzp¥TJ+CÑ2áyO E¤{’Ž=iN;˜ÓÎYy@;€h6yû�EòôN¸½Ô<2Ü â�¸5¼À# “ÐÆyüJBÐkyp·ê±3œiê0¶Ó‘mFF΄ۭSå—ç*˜Ô‹ [gâáD| (TnNOg�â7=JtõG-p“UTkF¥@߈QÚe ÙÕA"§*¶É+”váìSUäz^v]Ý*<ë0X3‰f4´ <XÓœf(»]³* ]V8WÙ4ã‰?ŒièW^AraÐ"¿Î%IÞµªØêÕ¢7Æ1e¶"ñ¬8Ù:±señ s›2u†Ï@ï|¢™ÞL¿ ÈÀDN~xQn†•–(ê‰lÞÙ«¢XµÝ ÞÃý ø C·ÈÄÍø5fŸêú�zŽGkØ0FcOÕº ØŒŠüaéÍFhŒÃÔä àIˆB®¥>RòSŠèšÊ…HÿhL}ø(r³ý}s`÷0ÚP?‘·‘& œêõR îsJŸwhïõ+Ë“&~[D»}@M`Ô¿´Ç$â¸XÿpëÀþá#‡Ù§6;‘Ïi´oaS™j¤iÉ—ÄÎ=4-k×¥Ù:Û—5pd½U—œö´Œ4NãJë4ü ¶ƒ[thüÖ:?ø€“$™LKŒÅ3é «³n4žì¦ º]/I½�\ðF´=€‰s¬öòÆ~ä}4ù4C›|ÒN¸éI6õ‘®„é¼Òzáßæ”î¿~e‰Q;yžSZ4KéôÉ¥Œ[12憋Á( Õ}“©ÏhZ5ˆJ*ñpg÷ùRXB/ÃRT4«¶§æã‡‘ 2c¡ŒR|³©ñk½’&ˆ×Ä(´×°¢6ŸD58�µ:ı´5jWs"sˆ– iGYûÃöuàEËlµ¹:“ÃÖyææ'¹0MsÒÃq»>Žbºþ5\cõ ž—nÚºè!F8Jë#^êA™Š?B#{ªÒCó H'S_ú– ›ð$bŒî“FáP¥fÏhŸ&ð©Íÿ‹†¹ee=ë¢=Ž·ª…\šÄ‚£óS,ÜbÏGKÇ ^�jSR‘®’PhÓˉÙe}ö­ËsÿQ˜8í8%Cïœh1ãýy Nj×|—‘øIá·j_‰ÿÏÀ qFÜ„2†qÉ‘ûµÉ-a¨&3ýÀ¶zéâA¯×‹ðë¿J?endstream endobj 105 0 obj 2671 endobj 109 0 obj <</Length 110 0 R/Filter /FlateDecode>> stream xœXksÛÆý®_±ÍbÅ×3mÆ™(£Ö©ÄL§µ:ˆXJhð ± þÿèž»�¤Çã‘(Ø»÷qî¹g÷ ¸`ý³ŸÛöêÕ]ÆžÔUÀž®>\ ýÙmËþºÁ 9}±Ù]™5‚e!ËŠˆçÛ´W"Ëyž%ls¼zïmCóà‰‡û­ü0.x‘'ÞßÊîP6lz¼úÏæ§+˜ñ£”m*lŽÕÞÐVõÀð#·c?œV›ÿ]á±/Bý C½‰·y–̼ºíÛ¶ì*6ȶ§·}„…w¶#åQžÀY¬ô^$= yê‡ó"íC5ÒÃÀ<HЏíì2¹Âd7â·ÚËmýQVìñÄÆ³çý^ðdÍöCïkWD˜ð0›¼7éy©+¬®GV+&ÛýxZ¥‰Çu2|jÊszý½§NmSw¿2Õ†­üïÇF²±V"ãE…Þ“é;½rΑw/%k:® ì:{ž?˜è¤<L‘Ú8×þ”€œGQäöˆž${­?Þèõ‚ÇA‘Ï%I¢L—äÁûq³ùùÕø¹§_?Üܾîä8Ôò¼2!6I2³EÀskàE²’=NŽ„1σ¨po%Q®ß:¨¼vêÁ«9-Ù—ÃXXU¿=´(6Ý }‹'Ú!ÁÅšÁ!Ö¦(IÄE*.ªB.3%‡—•H<9àe¬oú-ìR œÝÑžŠmËŽ=Êu‡÷ºCûHkv츯<)SÔWw…k]‰Û+/ðã¢X]/º* a¥±õqP#K‚�X¥"ïgc>–̵ÅK~›ú•/UrÛ£_¾Ê,þ|ͦüZG òôó&ߟÛÔ¦L%ûÝ ˆ8õvJŽŒŒ0jú]?Wš]¢Ä+‡ê"áç[~°öÅׄ£óNöu\äë»æôà}û°ÌA]PŠ,Ö)}~¦$w‹h#—¸³hƒ,2Ñ ÙôKÁ ì&ŠbM»'¿¿ë"Îã‚ b˜‰ ×ô½ššPpèô@¢ÕJ$ƒ6{œQçÅqÌÈ÷Mœú1û3ûû»UŒæIámÞ"Ïåˆ_ ÁcÝ`*”%->uš «ÆܾoNxo|F³µ‡f¬©çñµÚ÷’Ò™¡ínAQžRKo¾}ï½CÑ@ÐO Ûí3\ߎrPà ô <*É^j¯ljÝÈ´ûõ*IL+píx­a€/c€,Hðe¿¿feS)jw³Bï^¤<ËbÇV4xˆ­´߬2¬¥NÝXþÆÙÍŽˆ£ï̤pËm™ÀYBhÞÓÐxªÏØ4§œ†ÅÙœ‹xJë/æÜ{¯«WQ*xP^7j¿ Õ†<Ë3O{ºž«‹Yijy9\ŸmÒKܤUÃŒ"÷À.¢˜B“-›)<ÈôÐ9:]³JîeWÕÝ:îÌPPV§Hȃõ0s3ÆLLÒpB9îãÓX­{; ±;yäý«ïb�$……·@×XÏ ܇<ˆóÜ•3¥×áùsh*V6ª'¿KW=P±¢H©c¹l¡$ \viÍb2(’Üv H2×h§çå ²\Ìžäf`ÙÑfÛ…à™åÁ»ê«‘=—&5³JxîŠðÂØ¡¡;.÷ ÃOöò¨Iw²p^våcC…B t ÇgÙ±S00Î gáÅl-Ç‘„u24 `oñ…U×ÄÞE˜æ Pwj”e¥_¢ÒŸ{H7ÖÍ4…úH×ß4³©?õð6íUõ+˜Ì¼c×ô%õ)±€:ì÷ý`쪺Ý7Sã‚­r'ÉzúIãš–oô{TÙ82ê;iYÀDoMGoÄÜhkä¡zXq­Fˆî Ø•ƒºœhï·ßC]ЋNàÞßüû­Éw³3Ìiü!N€µ P�¶§‚!ÏÕoð©ò oƺ•j=ÏqŠjjMص �ÇñRÜ­™ï“ì¥O6.µºHM»ÿ“B†Ö ¾oË_ÍüIé-‚gȧ†óäö¬}âpÂ-)72ŠC[àŠºµ8˜ëˆÆ²Ý;Ž6^2¨åµL½3à­•maíƒ/ÐGA4±Hù²PÅÅœ5sR)ë†ZaŽÄMÒ0„‹cy°ÈÀ4 ’5â’D½Á;ÜQe»pÞåÍZ,óNš¼ê[Ÿ–¾Æ¯7—‰ÂÂ*òûû[ º{b×9®ìKà¶ÓûôzsPåXÖ1îQ÷³­<¾W8© ÀU©˜Ù’UåXrF‡/ú˦¶½5I¡¦ÔP„q%éÓLZ+»§È‚dcp‹ìw88¿Ðɤ3õÁES+õ“Ñ:"° &L3žMäïûRÂ{ª|wþ™µN”óÌÁÞô‡Éc`ÅòxE‰Ô̩ɣ?N9¤C’¸@1rU+*¾‚ÃÄ[˜Ì }Þ@So{3Àv:¹ .:MŒHƒÚa‚ËÎ<W„D “9Ç„(xFŒ¶(™¢”¢ÑØd¤’¬‘TGï©¡÷ 3<s,ißœ57"]â÷/UeÎ/šŠ‡V¼…!†zv7Óâá^¢-v - zEŸ–ôYî&’/¡ÝX©«®@Ùƒœ9T…˜Å„;¶çŸª¯ûe9¸‚h꺻[E�|¤½‘0+ºÞÈâ U4µxþ;Ígz¿æfÕ;…®ª)¤.Zœ„EfRqD %S²ÜêQÁÙ}Õ±gωt );M`P†tjìsË~¹»eåu¿lе ’bîŠêŽ2z%;oß-\*ïz”ÈÉËö€q@ƒê¿gþ7ö½L`‚‰™Ít½õ!‹eÞô 59»ÄF3UòTÏï –@-xà€šæ\ä@U}ó² ãˆtŽ«â른KæŸ{5~GÚ໲ª`B½1W'<Ñ>¸aðó ¯—tð ÁÓ"62 T‰’m‘0ºy0†.êHé飅Ⱦ¬u6ck¡o·|íˆ"vÞ*b£¦Bta2ƒ?åQ‘~fa”Æ"^ønÎ(èQº“3,™""YÌ’Â\Î òÃc g=2$L”ó%ˆ‹W7\\ö¤9ýL2£»Ç¯áXÃ~×­–Z¶¬Z¬æýL“¢9„î!ãùð80ä{;͈»á8�ôüJŽÛWTâqÍáãùÙ ’Mâ#³Ö š÷sV –‹”4'�Ï^˜«?«öœ®kj¢š©ö.I飆Q�9ðÆsPYl ÷hÌvÅÄ7ZâZÌí‡~ì·}£¿Ô�\*;zÝœBÂXÇæ‘.¿­ ¿YEPÓIzc{v\ÌsMc±“Fƒ.ˆâÇ©ƒÜe¨_žðøR@Ó½k-ÕïR'bœÆ¸éÃEûédÜÑÁ?®„¾-нÍðŵÖ¨öÚN߯ t•  3¬À9ažóÄ 3öÓ q�׋âÄ…ꋦ·›«àßÿÌc~endstream endobj 110 0 obj 2580 endobj 114 0 obj <</Length 115 0 R/Filter /FlateDecode>> stream xœÍYËnÜÈÝë+j6 ÒUE²Hƒ�ždñÀ“8VYHYPÝ%‰1›”I¶ÛÊ7$“̹õ"Ù’<Y$Aà…e‘¬ºsÏ=÷ú3ã‰`œþ¸¿w‡‹7 v?^pvñùB˜‡Ìýµ;°ï·x¡¤_lï.ì7‚’Uš”Û.DQ&e‘³íéâ:Ú‡ö&7ö[ü´‰eV%U™G?×ݱnYx¼ùËö§ §Šm÷¸_GÛ‡fdýãÔôÛÕ»Õì8ê=;ÔÝfû× ™à’Ý…Y’+Øï¢§‰žpó{žÈ’ ÷ 9è‘M=«÷çß«<Qó{Oóô‚ùíuÔëjwƠǾý²yÂE¦"ëcÉӄÙ™“n¢·û=¬m:V$R$)¼ÄÑäa,TRš—âxÐÓðľ뎇ßÐcóTÒ3‘ ’&ïîXͦ¡îÆFwÓÃÐ ¡Á§Ç¡Ã§Ý™Xâ­ÆÚø¨‡»~8øïô`NOTQ‘oIâ•òî]6›TIM'ã‹ñ_ÊD¥x{k*cMÓ¶Ì=Q~`ø­Xgã<)Òlö— “ÉÀ­†UšÝ7™²èKÓݳãc®ô4ÑÏÓƒö‡ÂŽl}26IQ&²Ê½9¼ÌŒ98Ôx¾ïY×Ã(7Ñé¡Ù=P”è¼½6æ‰qÊlªëc;Ýlc7OR†8-òD¨Â;m‡€‡ wV¸•Ï]§ä ño¦Ü8üš"—ûãtɀݷXöõ+aç±ïFÍvý^3|„g¿ßâa~þÐæ/u¨B¤¹ùÏ!åp±¾Å5™”—g9—Î9"î\G¾ÝAÊð�ùð7EH?½J‰¤üÿ}@=œ6¨åŠË4ª›‰õf£ÞõÝ.í)ê»#ÿð:þžvýéµ¥"Š"Ép`€I&Sã–Ï<ÑEûþxÛj“Cc™@QÊ2€ “60À@gÇnjZ:`Ðõîg«póqÂÆ6sü­vðhë'n¾3Œ'¥°†Ýêé¤ñ½Ž4Áß;÷³1Ø$K¤€QU:€àS‹ÐïŸ@[ä:^yóQpGž)¢§J_ ” â)eDIŒ­M­™o‘Ažfþ“§þÈöÍXÛ�z*¤ŒD_#à²ÅÞÖ;[?ǧÒ¥­×4IÉHB�/9wÖDwõŒ[iö÷í}Û2/*b{%›:àþ@e¬‘ó±?óV!®¢ª^u÷P)}g«2)Ôü Þ6ä–B?õü39ÈúÀ('0"!ϧ†­˜ N]¿‰)a8Ü3ö»;G×rð“i7£v! ETðÄ0ú¢ì gvˆgÙxiLmëÑVˆGl \¤E’gÏ[‚�ûÎÖÔxÖÐ@?ÙJ›@"Ç4t1½[v1^eƒ²p $æ[­­Ëõ¡GÝPS<MS9N1-f&öPÌ@H U&çóSW‘-5&`bÙ»,x¨3+5טÊ2K-–Fo"$x÷Pw÷zfï@5 í%¦‘syi‘½éi™©<­Â�ð¹ï |™/s‡´¶]C¢ïÚ' iÒĶDNÈf‡ªÌ8©¹;«™'E¡äk•pV�²BãM½­£)-‹žEÃÄï-ZPÓCoavðÉÈ ¡RHOñ"DR™ú R2M6"¸)¤�i3zg‚ŠZjQœå Ëä/ä Ï…o攃ÄñJ™dÕ±¼T¾<dùý·ŠöWÿûšõ,öZÙò$Âi[íUÞwrnÔ“/=²ÀtÙPqõ4éÃã”°®Gz»öddM~“¤¾‰F­Ï[À²âß…�:S‰W­¡*ŠÙJ«)ô‘µ=PXÛZµÞ€º_9Mï‘ITÆ,ªÊDAXPRÇÞÛ„Þ7+ÚEï+ò¼Z%1œ¾Nd×®‡€p/µŽ„ý¡ŸšE¸žP¯Y]X ¤™•¯˜-*_3œ^?-ì×¶O]ÚØ¡ˆ_Ä.ʼnÄç#é ŸÍC ]H ZÝéxÔù%iš¹­k™Tt tzš'sW¾‹4D 9"E Z}1¼Qwy]wÁYtW#–ªÔ’IanÓƒ›¶ôR&€1o€ÃMI!F¶­×Œ„R¢òÏmǃIÑ%Õà¶iÜL½ª‰—,žµÙ`.Ø-ETÔnrµT»yÐn¨Š©xZhƘ¼®7þÈ\€ÖBè[ºßüŸPÖH¡1›Ð%I¥ÜâóÊ<¥)åó±AL4–°ßõ¾JJ®, 0:›¦qalV¨ÐqúÕWêÙ=9=ÎyÀP-}wŒ†þ¬è‰fÌ! ZãXßÕõt²h¥†ÈŸÂÏŠ´†`  {çŠnļÐÚd¢™-IÎ|„L?­âÜ×SÍHv×ã'’˜Ë-W�¯þpÿÉ r¨‡µžÌ²$ w&¶gɾ¦Ê3û“*Åi‹9]Eq2b3M„Q·oÆiOƒá±k)ˆdø ÷Í w ¾ÉâBJ�"_µ²±Û¸Ö ¸Ž~è̤Ñt™+¬ t_½½zÏê#ÍU ÖšPlâœóuïNQú^z/· èHWŒ@ˆ¤¥J^E§Ø¤Ú¼¼½fì5ÕBÒò|ÆÀPY†ŽGûØ×=ð†$è.C¦ŸŒ®”ª k²ÁlÜr¨HBÛ<Õ¿¾êô"ü*þ•%:©·à«›xASr;†UQ7WˆÇ±ÝÄ¢,JíÇígE™™ =ùj¹ü°$àŠ‹ ¾ÓÌŠ‹?~H/Ù»Ÿß~pgÏÈèNV�W/Ÿrý¼ýp³ƒ“¶®  FW’¼ºzÿfûþÊLWT8ÀdÒmä8H+U¾Þ?®qŽ[ʦ¯Q9aYt²û:0nCMs_<¯™ÊeqšÕ™ãûú¨‡/f(.e…éRIS‹·¡­J»aY^¾Ä^jÖ¨Ãý0ù¾3° WQ˜x­Œš;fgÚYuÝM”ån@JdyÔ·çãnŽIŸ"¨€gÍÎlJø3¤åXNþ¼?;/ÓAÙg¥K(}{;— ÜržüÒÊHò(v5ZB³±!õƒvX)5—Ý«½ªi¼ÔÝnx²}z<ÈhÖ(AgÜ‹N�“ġР;]^¯VÃ'[aJ%±¤ì§ÎnhrÂè:>KOÙò²³&4Å|˜ºåÛº±V£9zÒ™D«b³²6½Åwb5ƒºXÐ ¥ +°èö¸"þ€ÇÅB.ì£yXÄÞ’T:ô놂x^h«¡ì›ÐPºúnAi˜ÛfÜOTz´îF¡Ö¡(ʤ”ëÎAp$®w–ÏìÂ1µÓ@õ2IHâµ|Îfá°YÉ}u­Ølqˆã²ißä/A«úKè™P…Û% çÕ£Hí:Ü´ÚÉm*æÝÜËmš®Šè:ZqS%‹gÜä›O5'rÅLB…VvNL¯VSQ@B-eeù¬¥" sþ’êì YfÕ ä„ž––¥×L7Q½¨)ÐÒ/Ö”/GË©ÔY|B¸ÝˆÊF÷8W¦Z ~}¹” u}Ö—þå’S?yÖòc»ºÌ!xn5äû™àAš”²>ÝDÈ05æå`¢ÛÖ 7›˜¥|ɳ"ê‡O¬ú#-ä™i ÍôÄþQûî§ Öe¦Œ ÷.’.%©ÍÙÔ‡AOgÊêéSR©W=!{ú©ßõíh³ƒ±2Ã^D8"užéO­×ü‘Åûþ‡·W[7·åvî‡nœ»KòÎM¦¹û¿?ÚÖûÜ­öK\e¡õ¬†-?¼Táüj–%Óq©ŠŠ4ªˆ²C<Æ õ„Š¥aœd‘+šª¤˜Ç6æ£-šœüBjv5M®Vû¥ÄÏ@BÆ-fÍd‚‚E%A*"Ž<’ûéˆ ”ÐgæóY©HI¦þ°½øþü ¸’íŸendstream endobj 115 0 obj 2948 endobj 119 0 obj <</Length 120 0 R/Filter /FlateDecode>> stream xœíXÛnÜ6}߯à[$À¢y%Ò ¤iZ¸MÓ4Þ¶Þ<È×V£•6ºØÞHþ¹CRÒ^²^/£@€À^H$gæÌ™Ã}DSDÌ_ÿ?]LNßÅ躙t=ù8¡ö%êÿ¥ ôãHó`:Ÿ¸=Å ÅŠc©Ðt1¡±Ä2hz7¹ôÒ®.fùè%üò*¬¤ð~OÊ.)ÐøÚ?ýuÇ<BÓlBpÄcwB^¶º®–ºN®ò"oWhYWW…^4è.ooPS-4ªŠL×èââ5ÊKx§Ë6ióªl0úǧԙ|ñîÍù›_ÎP{“7¨Zš÷¨¨ªF—µN𾆰Áª×Þh{\£ÁC0ê?›0 !¥“Hà0" Â7½“ÄŸþkö¤…C®dè^\ze†®V¨kòòÚYüœ\£UÕ¡¤ù€æU´O…wŸ¤m±‚I‹ý@âͼY¦3”—(ÆL`ÒcPJ°B°´¦ƒ ©ÒMˆžßTM{y¶¬êöýÆ€00ÁRÏ_F&¦f©ÓüñÇËß.BƒåýÊîÁŒ™((0¥CøÜçŒyóÖº`äsIúp>UÖ�œm@e·¸‚T@¼eÕŽæNPÞšgIÓt °ž´n5%’`c> "Ä¡ý¶gnAAf�¬e¡É“7ÝHcù €Â6C‚c*•ì3t«72Ää˜!¯®óLƒK¥=Ó%—‡X¬“»ZŽ[©YЃRkßä…Äܻͫ®$ç¢Ów”ôµ!�¨qOp‚‚`Yûa¿ÓÀn6ô†×%RÛ€^LL€)Ív"2Fx£7"ØŽqµ¦'¥Xña -ºJØg˜^)éݧ0Öñm€3Ž€†ÃéÒÈ9œÄ &I†Dq›Ë‹¼Lµa4„w²U‚ð«é ¼?wËÆ®3u’&¥ãÏ|…ÔsÝòÕ¾1·6g ä‡ ´$*´fGÜ B1VQØ3×ëy¿¡ec>Äi w×€Ç!æ| ¨—4kd –|¬kÖ:{vzjüm«´*à‡þtßS½_ßcäÏwñ�Be =võÅ r$µÍº9±Õ^$M‹ªR`E®´=¸w‚ÇX„{ä$9¬'¡P‡%Y+ ÃJH') mh SKJ·u%ÆRÀád°#ŸHWbÌ#vHX¤ÕXXü]R¾I¡8¤â %%9 )‚áÑ™-%1~ ö’\2L¡Z·HçZÑìêp@ žýïb #eÖAQLÑ#<óhŠ ÝÚ5îY­›ª¸u aV.—8pu»©³,\3qnæcdaÛÕ ìÁj§³8ZCÐw©ø–¥‚Èøé¤B ±– ) åŽÖšáüêŸö„„¸dŒyX'€ƒ¾ÉífbK8ÄÍCmŰsl½¸“É#Û‹ðˆá¼P¹‰ì(aÊÙ¬‘;†0E‡ÎÉxmIL•p$ÜÕUy]¬úY‡À<²S³Y•vf°3% :bƒ€³z©²É¨:§-½�$Ë¥.¡x±«ÙÀJÖ®ÄR6Š©’.æÃÒ +ßL™JP|èUÍ„Âq¤\$á}í•5E÷É §©©§Žý1À¤C¦™Ï"…c˜n·z)­êÐK™ Ìh"pdo€ Àn²¾‹á7 †O<Љ#G±/'0¦O`0hŽŸÀÄ‘Ø(mÇj%‡JÕ£¬þ*™4ƒú ƒè ã—kÝÜ/™œD8ŠÄkæ–s3ãÃïûg›)DȺÀÌé>3µFôºû«‹ƒ6er`Íül:/½J»¡Ï]!,’^UpÿÎßþ Ÿ§o/PU£×?ù!qÕóâ­O¡Ì‰ Ü•ó} îuÓ$Ë<ht}›ÛŸ÷?Œþ~Ñæ²¸¿ ¦€W¦ç¾S|æ%]ýd„•nó¯¯ûÂ}`Œb x4$–Å®9qR\§‹ìÔ.«*hPyxoA‡©¡ª�äùǬÄh3= •»Vö»ÆVn[¡ô&)¯µªÊu å-v—KOÿW÷‰ù|Úœ¡ñv´U˜˜¶3NC†¹z(廸î49JÁm3ì5†2H.íwW]a™jÑËN7p!€a2ÞTÌ(©ûÒ³Çãm]2$%ýzŸXƒö:ßjÖ’«Ûî‚pXb<sSÑN@ëM@§Ô’4ía(ÇÒ½ôÌ÷r£Ò1&>—I‰…Çbôk¥ÏeÖAóĹĸ9ìÕtò'üý:Sf\endstream endobj 120 0 obj 1690 endobj 124 0 obj <</Length 125 0 R/Filter /FlateDecode>> stream xœ­XÛrÛÈ|çWLéÅ`"Œp%€-ÙU¶V®x£ÈŠ'»±¶\ 0’á¶Ð\&•?ðG§Ï ù-¥*‰ær¦OŸ>=ü9ÜeýŒózqv±G¹pØãâ·…«^²ñO^³w)Äô }Xè9.‹<%>–Ö 7Šy…,Ý.>[ù¦¯î-÷~É.ðii{A“8´þ’5›¬bÓëå¯éO ,cû+–Ø\ÏΤlû$zÁ†'Áº¾ý}g7Y-XÑâMӬΆüi|[6yÙaYÁ—vè8Ö½õ¶(DÁʆEÜMxp¿äj3ÚÉvW<¦ý,Û–mþ,CûQʬ+íFäËôŸ 5ÆSqg5žé­d]Ö¬}PÛê¬K7´ۡ̆²mXFÑ"WÿÔm!X)Õ €'‰#EÁÙíû æ&+—Él')P9Î ¸ð@…KQ\!Š0ö) «˜|j7UÁÖÂì$ŠS¶^¾Z$1]’£cO¾TÀ×—¬�µÉUÝU¢Í Ã6¸|aÌÝ8¶RÌi;z«"9»u1ÿ^€Ãx±Þè³qé*7XY#šöˆvàó 0hZ3Œ÷tò=ÄɸÜH¬ªÚ¥Z[©bß4ÓYÙËßó§¬y&#ÇÀÔoŸξόU¬ã8 ÇPˆ¾gçß*ñ昡¨œÜŠ¢ì±1CÐlÛ— Z6NÅ' Nv"/¿a_¬„½å 2pàƒŽœž)zƒ+ P•!¸Wö«S†t—Ò §ý<m2ˆfÜ¥Ý m¯ÍÕÂRKb’NMßHl+†Ø¨w°9_$÷B ¸õUŒ ã1÷�@0¾èQRCY yª‚¬2 ò7‚mKœô£u9͵]?âa°œN™m¢jÄ`¡œ¼I_¥¬fÕ ¹‰g«u“͉MÒH@õÚ*émÞVœÝmº®í‰!fdÖ‹T|j!›�ÂRiúËÍåëóAôõv'9.××eC'ÞuBÊúùÇw7W/^ŸÿÌŠR"-»Ù„é«Ú\s §øl]_þýËåõß^Ÿë³öË�¥áD¾uj¯WÉ&𥝔1°¾–}ÛPA2Œ ô³¬/³u%^T®”bô¸‚/æÑˆÓ©=¡sßwœ±¬,{ÓUmVØDµ‰ÍnÌ“U’ì]Ô½;Ô>x3ôY#¡òÀtÜJQvÌD/jût{eÝkÕkÕ(%š ô|µ¹‘¶0¦= 9,qª:†æXÖu¢)4ù¦M•ȳë U7r­ô#²íÚ «7à(x‰*BôeU6ì ¤ÝX•ª'š¯$ÒÚ~G§éJxGœšË*â~´òŒ®ú㤯�`Ì=ÉÒ\w{1%ÏÝxšî¸®šN§Tq㥄 íU“Ô8 ž›çéýì *pš i¾ânàx{…"5SrZÊy¦¦]pd€ÅYJK«­êKWåóÒå\�<#H•+¡ÀD¯ûVxPc$¶�øÈ�-©A6¹U*D ²aJÓ›{ëî@Šþ+õOÑ«Á#]‡¬„aô0ñ(Þ3áÜ|JYÞÖu–¼ J(–ÕT÷H\¨õúÓx˜ †ûm!ctÁ³"“OˆMƒC òŽL­&c¥Zßðà ûju §Çÿ_Im¾íYÆèz‰~1Gp¨vö¶‚5p Õî`­0™M™ƒ†í{ñÔùýq­ÙUÀ~°ÂÁ¾Üh¥žð�ݲ-�A u[ÏJ†av„ÜØkTê3•jÁ¡:9uÎ*™òØê€Æg†°š¬¨Â‚VØ“ƒ¡Åu°1Û§²šö“†iNRÒ•JBÄTRt7ü…*ÙãÜ aŽ—nb�ÜäûdxÈ q Üó" ¨ªŽþ°S}ÏNÙêRd0žP*#+†€äî’ÞbäÕ.+{9Z*w…†íù F4“Þ•ïŽvM×- ø” æZ ²J¢áë6'ÙÉcÕ®×@àÄ l‹nQG·‰­Ç u“SV‹¬!œ&‘̳fæ-]ø˜Q‘ôÆõ¦J˜CâŽê¶/èDër®—C&¨zè© ¹ÙQ†¦V¬u9ÐÆE <ÉË+Së~ȃ•ch!†Yó*óŠ¢[yBL×Tµ¾jÐÉOþxÝSüòþsž†¡ûáìl»Ý.W¡î¾\ŸohIž$\Gæ´ìh®Pnçºïbâž-ßµIÎ'\»CæqtSXeýøÙµ]Çq~å%ëAE†ß¼+óaMF~2 æLGx¦kãðž2äÝ ¤`8Fñ ŽSºÙóÙá« U´X_ºo iÓ‹›/×¼¼z«j“;4‚æác8 Ï´`Ãí×S}Åê´¥¾JPµ«Ÿn ¸Fľ‰àø"2¹û"Å�voù¸ý\b\L ZÀÅoOWˆ­†iݪ» Z‹‚<B©FâaµÝK.ßåžÞí�Uº¹ È4ëY–ÿ‚/ýÙFh{:7û¾¾Úâb™¾G÷Z’…cô‘½»úó݇\Ã}o)Ù|_€ËKu;T¸+ydj7U³&¯-ufŽLó„ 4“ë©ÐŠlÈh<àyèÛEª‚Ñš9ÚÇ£® ÓïøæÒÆßá¬Ê—Z»Âtj’M¡áügKŒÍå“A9õŽ.8‡íV)¯`½©�¾™÷Îÿ÷EÄqÕEdŒá€tA}D‚Jf›á‰œ?;7ŸŽ®{h–¾n–*ñWwŒB`Ë|tBto óŠûõ ·BYéêAŸ[/5îØÝ«]¸ø-yt“!ðNînoNNU9`sÿi·ï/ô±aQÃxFViè„t»…%;*M?æž;m«��†ýѵ®fº–£G‹¸°Åû¯�°D—I¹mû%&B¸=«¿70 Â&%~2s)‰î²ýÌa¬i åEÆÎX›áxcˆÛ´ÎaúOÂb9F¿•ÁƒšfBÁã:äž ‰íZe‚ €0xÌLŠº¥€Tw–À߃“ -¨ÑO$ÐÃÅB> ~^@«]¦‹¿âç¿Û Nendstream endobj 125 0 obj 2302 endobj 129 0 obj <</Length 130 0 R/Filter /FlateDecode>> stream xœåX[oÛ6~÷¯ ò2y°8’ºwEnè°íÖ%ÚS²E¦mmºU”œæ?ìGï’’e¥íŠnе-‰çòïÜô–0Ê Ã?û™W«o®"²W+Fö«·+®oû‘W仈ñBº[™3œD‚D‰GㄤՊG1£€¤÷«'ºòÖá·kò=|[»ÂOhÎ묲’L·×¿¥/W ÆõB’nA¹>Ý7äâúêÍ]»cέó|»•[RÔ$¢‚SßžÃC.iŒGo×íKÕfJݯ9sšnKžš_¨Úç^z¦êsOqÊca”^ËžŒ§)c~¢E욎 J’û¢?þ Iúêšd|«û"Ïú¢©I%ûC³%ª•yñ'؉Ïj=ß\qf!ó˜G#îl Õ˜ŠRú‡V®ÓßW c¤ù ä€Ñ °ÏÓ+|ˆá\Ð8ð¸½!ßE'Þ4"ÊùäšÓ²o̬à æ&€gydÔê4ö˜oÑ•ª!w’(Ùÿ]Dâ„zx| ËIyŠÿ?ÓÞÎñ1jÑðãuVÉÏGýÜ] ztTþi GIüO1ŸS´éÖ^H“Dgk¹2ÙÒ þüp¤o¼ŒÀ‘Sv=xŠIÐß:×ׯ UЈ`XíðLd,hº\*¸Òƒƒ19®yàÈNa@@¹‡‘Z®¹9'gßô„«Þ›Pf¤“UÓ›³ì£IGÑM”ÖŒ Œæ|…ÎLcLnSP8øÇ;#&,ALáOa‰¨çS™˜½~ÎÍ íKòI�ðÏÀƒåÅ�?€ð)Í„8âß#‡øß‘Cçk·Ø"Ïqe7[0wÑC néÇ4}`]Aª—ò¦j¡X(PŸ¢ŽºßÚÕeµÚŸ”‰»/¬.ÀDµM ˆ 6µ$ÍN×ĬÜ7�WYäÕкÚròÉA[BÚ¦ëÕ†dõ– õh–´Íú ‚S”´å²X‹€2î‡Î5PqÐa@,}µzTwB�î«Ç\ê²\’§–òÙ²êx¾ëEÝ•ÀšŒì†x£Ol‡ªEÿ2¸R •hšÜ ý¾ÁhìÆg+UÞm_h×až 0üžð€#b$jhu%)Nr6‘y´«†æSé³2Rx1õ}ï P‘ÛŸk‚б{u‹TßH¨ˆa±·êfÞXÆCß=Ä(ùÂ}á^LáoÝ!­Ù™2î÷h²~ô¯Ÿû„I2ë#˜Ü= :) Uý®PÛ$¦tŒ4” EšV7ÛæLuàÁØ4õCã){äçÓu„‡�Óf”j…Dï–CRh°I®{œ!Qæ16ÞÚ¸“Êv:#»»FÉÅPvj X-;4›Í<6鑉ˆ ¥›©¼(MÚGW'‘?À—Lø]bšž ,´Û0°È3,“GœyŒ$Ô H¢’¿H»2ƒÚ‚•ྀ<¹“Z°¡uÄœ‹Æ‰ÿRF~(!Å)!?žâËÊGNL)×™ ÿަ•F1ôÅ¢Šª(³AZæ•Oc|ˆß¦Q¥ÏgaèHìÔ‘6w'G¼„O8‘RfKÜÃ(NΟœc¯Î°÷Ät ÄbDãa_“(¤|šçßµ§£Zz<‚ŸøvjîzCÕºxÍZ ×L8÷¦ñ=¿þþò–>xÌôT3A ¸·hŸ˜”\ö¤Êþ˜6JHUAfÀvc㈠�©Šý¡Ç¼”™*$Fkf—Éòª¨¡† Ú¿i®‹bûÕ—ZkUöœ‚¶ÊúæÙ³Êâñå&ñ¦“­¬·XWñ6¤x%8!³ü`«,ã8á``%%°ÄðIwÛBµeö Þ·ÿq3À¾ï¥È°!®{Ú¿ŸÌ^qDú•È·9µ|5¨ðbûjwì݃FE‹Â¸!ÓÛ•$ Bý¶D'›P–ÍŒ³Òǽ�S`6ÛC#Ó#Ì:þ/v}J~ÖüŒ}êGãžtƒË€žÍ“Øq­ï1pcìuF,økrªÆ=·FŒjÙŸvò|Ùî¡¢MµÛ7—´gb‘ÖFZääîˆÇBbí/¨ÍÚ,<|ÎuÁGŽ?4ø Ùû£¡w(@?[=ÏB°1<Òln;X�zLÇÑÓÅTb=êßc!K3Ø2ºßY`¯NöFQ8·ãÕäúúÍ%ìN8[l wEAÃB¶´²ÃþN~J_½^D}£…ä a‡ûå¸^ê-Šb Ué×7Ž’¥Ìûs8Œì%ÕÉÜF©‘µYjvdJ¦o]SWØ’ï°ëñ‡à.ëRÞ”Y*GA–{P´û*ԾÚJÔ%òäcugÄ©Å/Ð\tMG¢ß,5»E¾óªI‰óÉ`r�ߦúñŒÞøw5¨¥k¨ "†õ×y9€W‚q¡ÏùÁX×E€½HW¿Àß_? ñîendstream endobj 130 0 obj 1887 endobj 134 0 obj <</Length 135 0 R/Filter /FlateDecode>> stream xœÍXkÛ¸ýî_A Œ¼°‘z§iÐt7A³È«‰óa1S²Ì±µÑѨqŒbÿA~ôžKRòc’ök1ÀŒG"/y_çœë/Ì÷8óéÇþ-êÙã Ûô3Ÿmf_f\¿döOQ³¿/± ¥Ë»™ÙÃY"X’^š±e=ãIê¥IÄ–ûÙS ]uëðÛ9ûŸæ®3/K#çMÞ yŦ×ó-ÁŒÄl¹ž9ɵýëÛåë7WÞ|ùûÌå¸à²˜‰-_ÏœßÚùõ,ðD”ÒCŽ—<ËpÚ:´Á×/„g©yî{ ­ÞÏœ¼aC/™ÚJÖîTÙ6¸HÕnÊÆþÛ³]Þ)¦ZÖïdQÞØ®kU[´•y𭘪m®XØJ’͵¾ª@$xÊ\.̹\úÜõЕ͆‘g²Qe‘“ =W°/{<bmSØ«7Ïß“Ü6: YY÷ïîù^œŠÉ?.„>çÝû€åÍš}|³|Ïúa·ká͹ƒ¹õ±½£0˜�§™Ÿ^;á‰É!ëìþ²¹k»Ú^ü圇H¦Èœ¶cuÛÉÓ×,_µƒÒA¾ˆm%sD¿—’}xù3A.è“®�:û597"?ÚW/–/ÙºËï”ùíʼÛâö.ŠÇíkµs}ßS_»už¯×rk°Ä ¸çßÎ=Ô‰­™WäkÙÛ‹0|¢Œá"Xâ"z…4(*é{9E:óDš¥¡}Ñ¡`TYË~aüË{Jdû²ªÆJ°U$^"¦±—ÒÖÇý´`®‹‚úzpu`ŸÒï'»¼ï÷sî#”ëg:h›Š磭C:MojòZêØŒû<ßOÚLeKÕD0}Êe½iãXŸÅ:ʈʡôôÅÇï_¹²ÉW"CÍÉVe“w}ÖºeÔzÍ8²f.±+‹ÏlØ!¸6©^h jùÓó_ÉRíÈ]×Öd»c²1Åg�–l,÷›v¾/»¶©©}VÖ—õ=dW·ž5› k+¤}_ª­®“kr,zmÐÈvå~bO üü•ãRݳ§Ÿ>¼~F Žuâ{Â70ÖKÎ°Š’q'U±õØòüòuÛ+k‹øØ9Õ©Ük‡ãÀãa8ÆZøÜBç.Âú­ÓÜÑq9Ü|Û´»íÅœo•ÔÎ�T’P:½É ~¢ °Ó2öÀ›pýÐVéøõ •DPF…—:,£WI…]ÚžqCÂC>¾hT|G:irL‘ß}W*%Qå–2hÿãÜ0žÏGón»Ðþiäqb3ë¿ë wƒ2›Gö BÜ`tÏ–^÷3DäE¶ €ï?ºy#2B8²n•t©t­'‰79g ×Ö$§õtoØFoFñý1² w WêÁôâ†6øg"qd·j{s:'rÏ&Ë&<õDàó‰‡ òÈ^—¾.MjTÍ ú.Ç ª±ÿXåÕg�Žöalµ(ðâɰm6RÙÆóÞ3zq˜žÈ‚Ìðœéäùn¨4~®åj®]ò#gØ€Ä6`kV•èÓ^€èÖO®Ÿ]kÿA¢hÖèˆ'¸ž©Zæà¾«­ÌרÕu®ò+Ö[Ì"Ä\°ë§×ì{«:YÈs¯E j‹/œæAúÀég½šh–ÔÏœCa_[ˆPyñ€8Ðp4p“ AÙoK0)ñ=kÚNç$öb?Cíš2ÔÅ ?Cϧ&]Š´°çß ØO£³ùz]Z Fê8ËÈŠ(²›ÛÄ•ÅFM½EÝÛë ÓâiøÈ”O8å7‹Å„]ÿXB™ðöäœÖ€º5—‹²©±K꺲)ªa-Ï»8âàXeu¹Ù*³£¸¤»]ë.ðA huÒ"zCd!¬Úö3Å E8"Ãí£ÿ\$§Ä ¬j>Ÿ±R¯ˆCÖ­ì›kR?‘‰ÍÌ '$T"²R2ôóκÐpFyÏäiÛ„aœÕ¦¹]B6í°Ù¢_T^VÈ;˜ /©„âÞËȆhï žÄUÁ_8yq cªt"}ÇÔâ©1ä7JÒsó¾(Ë “nƨÿ#L•M¯Pžuõ‚žÚSrˆMÆ‘â‡ô~ãtüïIØÏÑl>cTs;hÁ�ËwöJ“è$èÝïø€ý‘¨¼$Ðï{¡I'p|hò2Î 0eÂ\C"RB^úÁÃOýöK=”:nO-Ò—Pí¼CÂภâ¡6¤` çŽÍ#OÈ™{ÁÑ5¦/C)Õ¨ˆ"/MOlbxý?Ø ëAê’8™=5‹VRœp#›z‘{Qj€ñù­AÖö6p`]ö» šE÷Úš¬`(A±“‚ú”JëÈ¡(dß›´;ÙÙ©i¹Õâ¼68›ëƒ­@‚hȽҳâ4_¢£Ð[ ¦'ú­ä„‘{êòëœGNÕØšµ,}ÓÚf2(¢ô 1ÖǤ¢îQ±NÞ•4ôæ¾ö6$òmfư«)Oøh&€ÈQ„fV+‚ÉÌÆ«…m#È,·Â>×hY UÞ1èC f£®,»ú’¬¹Ò±Ä~%«jš.´!+•LËÚ˜jãHKiÅ,eÆÜ«ã$8±2šÜ»7=Ê'¯§üŒ"Æ´½VÀZ5(CRÊX²yÉ«û:J•žæèK±½Ž”ûU™·ÊÍ\2.Ÿ‚ØÙþ›ZÐðl)ºrE˪µHët§ÂËDlO7Ù{H—cê3s1 ²Ñ8ÜÒú‹“œǷܰÒ¼;ÝæÑLir³‹þM©ûcL_Nb‚äÁ#«–8É䣓Q˜“(s¿‰LúÙZŸóÈc¿Í¹…c§Î£mi‚±¶×’cu0üÃno¡ßÑ9P9ßH:; ÞÞvF¦<øþAå+x ¤**¡Ç²1u1Q ½}7}gùâɦBà#ÊcR³r‘ì‘Ûê&Â�LÄe|fªn_6À4®ÁͧPÅGSü|ö]ØÑ%GÛåÔɦÐLƒ`›/¥ÀPGin\¬)ƨd€˜žøõ hbv¢(4êžöÊI%˜DŽ*"Ö•=±c~ÂŽüD‹—í¦2zb�Š ˜‡ã·$ôe!K<"¥9p^@%Eǯ4†Q¡Ï £ñ(“¡ËÙ?ñó'ÐÄendstream endobj 135 0 obj 2381 endobj 139 0 obj <</Length 140 0 R/Filter /FlateDecode>> stream xœ¥XÛrÜ6}Ÿ¯À›9[&L€÷Ç*);åõz£I탴5E‘ A“ fµßN7@ð" %e]N•!Ðݧqút߈GñðÏðw~Ú|ø%&÷ÝÆ#÷›o¦?’á¯üD~ØÁ‚Ø6f#1'qêÓ$%»Ó†Å MâìΛ'ïÛêÖa·[rÿÚº<Hiš„Î?²ºÏ*2~Þþg÷3NÃ`Ðõ#²+6N.k%jµWØî~›y.ñŒ«ÝQ+³ØÝmcí'p`‘¢àc+¾õ¢S¢ …Ìû¬{OJý©ä¼eõ¼4q²ŽdµŽÇõh8ò  ÞœGŠaxøû°ë³—¸,¢‰^öG%êì$öâp¹*q‹Y†mQ¬³«ÄÌØŒ¦`ˆkl4 ħáõ•*O™d0±gJ'‘œÛR‰ŽÈ^%)ÙËŽÀ²®ÉIduYßú ñêåe‡~ÑÇgðÁÒTûP²*`»1†ÿÈÐ9—êˆiÚ¾ƒ ™gŸ{4H¸rã¸n»õ#š¦œ;â$•p1Âá\-²ˆÑðì²5ç9YdÔã‰M똦WËC÷š²Án’#UÊš’Oê.ç4ÂùÆOuþŒÁî4æšÔÆ8:EúN@zô!ñ„ƒ]>ž€vPÖ$—§»²ÎÐÑ”‘%€4¦qâ±õ”EVˆv \cçRŠR>Qͺuþ^À[ˆ"¦<¤X0ÚóH?…”û3úT³†·û&SÇ˅è#¹ÊºT%Ô$®7$5:íô{>ŠšTòþˆ¬Br˜šB\ä§ÝWÒ‰öýøpŒ<‰l�nšÊ¢¦ªì‚E‚YHƒgãyuàËe±" Œ2Ï‘ÕPìm™¶Vt¬;Ap«©ž³.¥0˜mæz3HÁAöµŽ ÑVP¥ª-…­g­Ì}X–´O#4’oRÀš&Áð±ø8q0¤ géða·ûzë\ƒNšªp9˜Å“ø‰–Tç'\ØÁBÕfuw­!|’èH"”¬Ð†B?Ù~LhÌ‚1”:žBÑûS[U>.W”%”kàYUf…œ,¥/„^l‹© ÜÙÊÓIÏËêàtnÀ((㜳EÔÀ–s9˜Ê¦¨FÌnÒäRvG¹ØD4òíæ³º Ùˆ–¢©ÿ„2ØÌCé$}ët~¥CQhS—šø8§!jBFk¤ˆ{ëZyanZùßG¤ª4–«..SLWÿüòåÇ«íxO cu½[TIˆm_6k`Ÿµõé+ÉŠÂël›Õ»Q;ì'©ä GÐŒ Ycùél¡”º$ÏjrgifE‰-,?P øwôD¡4Þ� ‘íÊyèÈMœ¸ä<¾)ÞK‘¼@0m¹Ñ­óeô^ Ã]]ÊP¨–ºù¼y±© ÛäÅRÆÿD!ŒRAGd¾•‡[gV¬¾ïyÖÛ’-þóv“2hÃÌŒ.I9¢(áê±9ú²ÉYì73ð-nÒPLAàTvU%·<t΢˜À­ÚÆÈ µ<“Kuã˜1Ú½­¦ÙàQ¤¿aÿ¿±#u?‚tÛ †nâÅ Yãr/µÍDŸÎ8¦¹Ÿ±v BÝ0|\ˆ²ÆiZrœÛéÜaÂË&ë=äæ<ÝyA‰;9Y[fwÕ i0œÇOGšsYU“\jvøl”ì¥T†“Nf¹ÂÉý×_>ƒîØ3{:Èy�Û’}U,™Ïa&²Uöûœž0zá0:`|œk}êÅ {=ä. �½ÊðôÒùófKö œežéÞtô †I>*ß0ú<À·é127ÉÞôîÿb¶Aõ\ '\†òø)®ïFôã¼.Ó7NWþOì ‰­/ ˜ïœëJfÅŠVÌ®yJ* `v‚6©0¸»G¼ûL²QÍÐÖDAŸ\.—)Ó1 sùE}~ÉåífÜØc²{Ñù™njYIÀ› w(üƒRΕéÅ FGÑ7:ùë ó5ׯ�æ{Ý n„(ðЙ·zÞƒNA½EáÈËl1rsEòÂ5z1oß8mv¿äÑÌnÎp;îz2âV§ .zM%”Þ†¡qèÄ Y[¡Ã¨ˆCúRVÐYi j:Õñb6†d¼”y|”ÖrÀ¡Æ‚×r€Ì]HçÂ8û Y0(é U„É4$¿ŽN¾«öc­Ã|xÜ›–ÛõÕé=šFÑTù­^këîúú3©ÎE«Ê?r|yØ2,Å EøjÓ0bë'ø­x| ¢àHºi~ÞýíÆAóƒ©ØŸ›¬À`¥ëó”ÿÐWO»‘Ѿ—„G•'±Ïšfíæ0Þü¼d"�nz.L¡ý—øà#'úZ€Qw*å†-+›¤××?•[¹þpÌêÂÕ2Ý¡¿û/4QzÀ êF£u¤²ùÞy EžzÆQv&͘K âM©a0Ý,0tz^»U%þ÷dfwõÕfdùž16ed‚uë@YØ+—¾«%¡.a¾~ÚøÜSAHýó«ÕxÚqÎÝ_¥ß¡Ldõ€O5†®,ˆ†X]¥cC~¡9ëˆS ãMbMª=zì»âƇFëf™áßz8€ìffCAÊÍë².S‰WG[¦÷emŸ>ë¼ê Ы †Ü¦îhrpöã#o.­ð0ªøãÀ·G±{©J]óC“˰½6Â5Òo¶,¤?‘°Dj�]™÷U¦i£d.+ólcÆ#Ðpnïcö:ö gžØ¬@…ó\h9ó|Da˜õ˜Eø¸ŽƒbL½-!>a„ÉÏ= jÜc\ï B;@sýöóãnó/øó'ÌÕ™[endstream endobj 140 0 obj 2163 endobj 144 0 obj <</Length 145 0 R/Filter /FlateDecode>> stream xœµXkÛÆý¾¿b 0ÕJcÎðmA\g[;uâ­-§ v€’F+Æ)ó±Zýÿèž;’Z»ÝO…¯$gîãÜ{ÎOÌç‚ùôÏþ]ï/ž¾MØm{á³Û‹OB?döÏzÏþ¶Ä‚”~Xn/Ì;‚%’%YÀÓŒ-÷"IyšDly¼¸öÖ}SÞxâfÆ^àÓl!ÃŒgiäýœW}^²áñìÃò'lœÙ±á"ˆÙrƒ-ºb¯þhf"很„§6Åä˺³o:“p°Oïù\F‚lð–;Åh9+*Öªu]mZ|îXW×Ù¶nX^–¬¡}±]QcQ§-V¯Ë~£X•ï+±¶?ÌÞ^Ì–^É–¯é4¦C–¹ö*¼=g‡FuM^µ[…}« ¾¬Ž‚%°æs×õƒÜxœé¨‘—·8=o:µáÌ8»ÚGÁÓ(t‡‘©¬ÝÕ3qß—¡wlõÖëz(U§˜Òï,Wdb}!„Ï›Øx÷Š|ðéA²4´Ö½¶‡NÖ‘Ù÷eW`ÃixZÎn¼ç›Ú D´ÏBˆŒÇ"f Š vI¸<@RñpÌé©Yˆ˜§zvN»ê"dVOòh·óyh‚üX&›z¯c we}Õ¥ wÓvluBPŽt†Œàsœ:˜„©†*EþÏ óUÝÓŽÚ3·Öš"yl¯Ô؆RµÜ`Z“¸‡@ÈË¶Öæèàj;UsG§"à2°0qXØß\ô¡•Rô®fë¼\÷eÞ™}Õ"MüÑhwu——_DÙ†!Ƙ~%ÒÝ.ïô‰ÛST“k¸”yÛ™(X#F›¢]X¤aëC™Ÿ`ÿ±èvl…Ù˜ì¯K <>{ò_]@§øCm·„A!êXÀoð$Î2½»Ø£“@(}á<Í?ß¿}m|Ò¸ˆž;a™/.¶ª[ï`9ùérݲ} ´ìU^Õ-Š-;Õýgœ)»,äIh±3ìžwˆÓ`¨ˆx˜ñðܺÜèö8@mÕG‡uE¶­ËR?‘Ü•ò8ÈìQÞ±÷§þ£z­³öŒíT¾QMËM ‡’‹¡Aë÷_m8Yt†ñ©oV¹—ItÙ/CÞS‹% ¥ƒÈêj mlmðG‹r~í-îçl±84õý‰}w¿]½®ËgOŸ~¸ÆkͳCÞ¶Ç™ð½ºÙüðA¯Û!-×ÏuÓ}ø^÷À`hL×ÞûÖ–ÞA­‹ÏpH¿2‹#ëµä=µõ4H”˜ÓÛ®AžQyÙ<¼¯Áœ³‰eÄ�Ÿï©Jõ¢í •ß©¦BÐî!tœÌÒØ!C‰CÆaÌ\Âc™ j—hsÜ6{A¢ý‚ ?0L·õúc¶¹ý˜Ÿ#2Þ|ÙÑ7˜Þ¨O½j»I¬ÖìÝ›ÿ|Çîf"$® Ñ©ZÍõ˜DMS–E,µ¹¿Ôƒ±CØæl×u:ËtF4œÔ´&ºF¡»áQË^.—W:…ÒÌcSb7ì”iXŠ™wÌñÍÕðûÒ±ÍÇÈR8‡– í´„fj.áRðÄ0ØB‚Ì2ìrV0³ªß¯ÐàQUݰÀ>Ýèh¢Â: ¶ß›6G…Ÿú:…#ò\«¯ž' Ѧ¤x¤ê š‚¸Hé|Á|ï¾h;‚°ªf¡ùÆÞ]ÑÔÕ^UÒªs"YúqySä«’ˆše«º‰sp¹çÌ¥Qºÿ< W Á’‡YìlB‚ àq*AfN „´P†< CçUu7ñʉ–ba žf|lƒ¾Aùè†$oeâl&kµ×¹-u]å2CGµ»ÏOpØßê^×;9<8ûÍ7ô}Þåýy´RB�n•…q9LAHjiç=Ÿ« xÙˆŸ Ç7ŽIž}aÌW�‘Ïd¿xÕKm$d8ª!Xz´Ew2%©•̆T]y"Ü‚¸Øs?zœ :ƒ|*ê3[x /þjx=Eg½Þ`Ôrìu‰eLâb²µjºEø ó¬§±Ý·»N—-üÉ­7221ˆÓÑ|⽡“M+JÂÚ( hS­Æst_£ LÒcÁýì¼A¬ë«J‘Zmêþv7–×”ßQÇiæ’9G2#ªâÈkëI2Q´2K\)ÃOØÎÈ>á[I„leƒX�Í ÍÎB[=8Ú˜ô`ºŠQ{bh¨¦=x‡gô]9ÀŽ«Mëa›T™4¬´Ã¦ E€R:h¦Hšß›¯7V]$å6“´fuÒMܤà »åyÓÈI@ɈF'$ˆ`I&jÅKh¡ñt—7ш™Ú~½#:ú¶ï[:÷ÛÐ'æt/å(Š’†9 ù·Anè*[>Ð$Q¾Pä–B£H«ÄdhãxŸÓÄG³¨ž³$нüD&Akè&ãik—–±]ŸÛQN˜&ìÎ<O7eZ£jn<KÜèõtKFƒ5y’"cý2Ï&ÿCR>ùÿ)Ê 9S”Þâ7Bº“7ßa\ÞÃï5i :Q€¾LK¹ñ¨SÁÙw&M-eS"&M·Ç^u»zcywª¢!|ßWélÀÄ• Q2ÃЗÆð)pˆ±/¢I>K­]¸ã¦&/Ë©€ufL}Gz1åà £T¬‰Zc1u™E7ÞqW�ÔµÐH/Ç Ù’/ÿ¸\ÞÌÎ]h*Ú{K;þ@ººæj†Aº6Ø(tß²Õ¡ôJŸzå€éЖô=&Â*·w /4¼žo6ý‚ëý­¦ŽÝ>CžÒÌЦ»«¹z¿Ô‡þxùúry9g+sWŠƒÔN33ÃcÊoT©ef§Ö» Å{ ÉÊâ#½E”nÙº¾¥ú÷Tž‡ÉðûêGƒ8˜·½Az†<²‡>ÿu pK5’n \GÝn‡ÝcØìa5!¥eWouSM¿¹úû«_~œ³o®~×éÊppâ»ë„ùÀ˜‘/Ô÷Ïofú6.Þ¯—:lûºQçƒ0yPñÍýò¤;妮žh‘'Ú‡$ž¨i¯«¦2;Œ"÷@é.7t�ÎHì´PÑ-ˆ3lg7Û⟿œŽ³A:n¾|߯޼3i§ô;ÀhZ�×ïìŠ ˆ‡ñ¹púEjxúƒ¼4–é=î÷jÂÇšÄD]mVDÈÞ©Ÿ*«é|¡)m’Úa;ІÆebg9hHHpÒ0´Úðl$¨ ÐSu« €èBUßdÌ~6)7 â\ÛÆ¶ñÒãɦVF¼è‘U¯1œúRnhÕ1†9Â…s¥vNB‰á:"õSèºÃ‡ð®ÖÝ#KdÈã>§ÛL« ¦·¤Ýб}þÑLø<ôÍ¡°*nÒòq’†.ŠÓq°ÉüÐŽÒƒì%@4†Ápûâ7ó³n«ˆˆm?(£‡£GÛoÍ%lxŸ×¿Ï¨cÀEš*¥n fäÔ ÃÐì¸Þ[¼"n¢[™óK:Lkc+9]`öˆ-b‹ÁvtM¸?åÉêÙ“ û©X¤/¤>>ŒžeJ»\./þ…ÿqð´¬endstream endobj 145 0 obj 2657 endobj 149 0 obj <</Length 150 0 R/Filter /FlateDecode>> stream xœÍXÛnÜÈ}Ÿ¯hì‹9€Ø&›÷…aÀIl¬6¢•g7¤`A‘=&rL6-)ØOðGçT_HŽ­M²o†�i4$««OsªšYÀCÐý[7ϯ2v7nv·ù¸ õEfÿTGö§nÈé‹Ý~cž Y&XVD</Øî¸ ³œçYÂv÷›k¯š†öÆ o¶ìÏø´õE\ð"O¼÷e7•-›/oÿ±ûqƒ0~”²]ÅõÓ7Þ›Ý%žýp’UóYެÄ£ê ß³ª?Ë®fªgÓ(YÓJ–5ë÷ìÝÛ;v«û¦»cŸ[ÉÚfT#»oÔÞ†aȃ õ¸^YÄl÷nƒõ.ÿz=¹ ]ø_+ö»z½»âìÆ{U×²Æ ,ã"å6øŒÂ¿}ÿêéýÐ…'¯¢#€à@µÚˆ4ápN¿ñ¶»^Õ&çQ¹½²Ê t¸ÏYÌEÄ|ÚpM}xÿ;Ó…ÿ²á^¿»¤ ÿrõæïÙæ…ˆŸþ¡äâ9¹H J1'÷vÏÔ¡YRMß1|B5¥¾ŒÕ+‚‹Ä†ý$çõ .ò"í…\SÍQŽ .”£b}'A‡¶e·Ræ:le<‰™¦<×úþC©Ô@#»10§ˆ CÿF$Ë­�ÄA‘{Ÿˆný¤N“"ÐJ¢ÞÅÙ6”lÛQŸn�Ôƒd•T 4ˆ§G©ÊºT%¡#59£8ãE/kkmyJv„"2èÙÛüPèÄ)ëæV×&àE�ŸãH˜”9érjõyL«MRð,®\jUÇLDA²Ä úóÕ;*’Þ’..AýPßñ~hӖmR.¤ÀÀ¯ ¶•~ØA—zÃÈBh¦' âÉ$ÂÜe‡Uª¾ÊàD<Ír‡CÀã049ªÇ“ü:Ã#xñ«¾´J.ŒSJŽ3MB©+3>‚ýGX dÒõŠÓéÔÊU ÌO’؇W&<„ÿI¨Á¿`¥~”¸LÛò] WÂûrÞ2ì*Içêú ‘ ûiÆqrü ô}¾ÈWúÌxš/2¼ðGŸþx’²öI2ìý~I7RîÕ‚l–XdR `¶"A]ã»ïÚ>AX·ø6Æž³Ô»—À,!½mŽb·@‚pi”(cÍêi }•l•.7}mÄ‹e4Þ9@Nœòï;ßß~ëR4éédî$ü¿¼EÅ€Õußz‹]@î·aà•S«Î2uf²©k刽I¥ŠÎçùUض%‚;½z¾¶Ç¥g¢,+c2E‹RTwveH<³äÙ­Œƒ8>ôð5”ݸ—ÃÈ´5¦Ñ¤Fœ,÷¦Yäíe¥4üFRIf$AR¡«ó}µ,Ac³ÉdÆ#ú®C˜‘IUY-h¾Q›è;ØVGÊ5%!>œï=ö  VƒÂŒQ¬ :üʬ¤Ëÿ<Ç,CúD<s³ÁÃÚµy!¾µ–±îˆˆšaú*Î0í…þÇh.çq°Ö\"Œý;ÉÑJ©›è²íL_K0ÏòE‚¦»föŸÄ˜ ¶Ÿ!ñ€"~‰N7®©cWIJó¼õKacÊ —_©Î|>)-NfŠLãøœG³jÏ%;ëïœZ!6‹.¬Üo5²¨Gáz ¢€5{ãéR¹¢Æ<û¶xuíùÿ¾`¾Þ¾¯­ò‰þZÉ?œø2|ùÛ t¬—FúéBžÔÊúÆ£fûÜL×Wòã$‘…VˆŠÊ¹`´9ö5ÆÂiª…9’ˆ³Þ¸ Šè â„Yôq–.ŽRIäˆC5¥rЖ.h²$P(ã.8^déz'…n=ÞW™ÞÊ=Tz„g;$ìÒ],E™r'˜´0ÓÔ «°I¢D=Fðn¤qW?>*êL#%º4&3Îõlºg¬°;óÙëÔqA æQ’„Ît…ìJU€…‹‘êÈâØñö±9 ²T,1R£ DC®FP iUù/t6pEÄ +GSó®´Øc,ÆRÈÑÌFjUjÒÆ.rºcÉ3ÞxG‚›T>àø ùç œ}ò‰&¢ »}sVüõn«ˆQâIE+Þx‘=.†E¤ó<{íá„ÂNå2'™%±”ãu;š³ž/BÁó¹g8¬jËô>¨r0Û^È’b«ù<9çV>Kd}ž„—ã®çc÷@ï˜uí"£�ò’Ùé¯=Ùl£ˆNeÂù‚RÒ…¤±3s¼ô¬&iGdóÕtÄ|kXM>ÔÖ+9…À&Ä¢ï ‰ÂJVÝÆHtéPkÖ µè†eà¼1ås*ò…‘Ìœ¬%=|•g'MçIâuç‘äã•VkíBºÚ< ‹oî x ß=ÈödäŸGðŽÑ7È­ŸzOOõ›Žóç®íûÎþÒŒ§¶Ô;L6ΈÛÐÂö ,2ç¡ùúÇ'µ™‡ápêÀ_ מM m¹ûŽFüèÀ8ÑêS«:é…Ê­þÿÓœ«‰J^,­Ú0‘¤Ú‘<²áÏ@o›Ž^%TíT“ÛàëýÔRœg`\® Ï 3ifˆg#ÈiÉ‹ymÊ¥G„EC Ô#]JmdXÈø]XÀNj#VÒËÙÐã»E]QåÃB¡&ÏÙº«I•·­t,1—œ¸‰ÝÍ5fŸ7ÞH¶bß<}w9ôª¯0Åÿ¼b<ØÃJr?êŽsr7 ¹ò¤[½20ÇN/ ?Zà…T†§×}#K5Á´æeu–ð<_ià` ã £ÎŠííCOeÑïu/M;æáHb[V”Øþ>ŸÏø++X‘XgÉ`þN²åJ²áJ²MKpeaÄÈòð¼çÌ Z6}¯o¥×ˆ8ŒÄ†ÎôÞ‘ÞÂe<ØB@"Ïy≌ý8µL¡Ð8ƳñŠ‚‚¼Þm~ÂÏ�ôÛeendstream endobj 150 0 obj 2196 endobj 154 0 obj <</Length 155 0 R/Filter /FlateDecode>> stream xœµXÝnã¶¾÷S°WK#RÿEQ`Û$Û´Žã«§p…"Ó¶YrE9Ùô¢O°ÝR’Ç»=ç E.b“œáü|óÍп‡qâà_û?ÛŽÎnC²V#‡¬G¿¸Þ$í¿lK¾Mà@„ Éjdd8  c—E1I¶#F, }’<4Û×Ååwù>Y¶ðbG>½NË}Z~ÛzŸü05¶d9¢W³ÇÀJ~Ù K²,;zãç —óq•Ã.ãvkŸá–ÓnÄn™ M¡iIöJTLžòfCšM®˜¾Ã™ãÃi›,B‰}¨ï=ËæaÒá#YU5¹Lf$WDíw»ªnä’i£Ìd”|¹ óù„¢0¤ß'ÉlNÒr‰Rð¡–Çrx¾ÈpÇ¡o÷MµM›<#K™UÛ]-•Ê«’T+Ò}•Kò±ŠTZÞ†”é ²0lcð(቙ˆâÈk·êïáqÁáv9yå†Dø ž#2M&×–ÁO$Ý7Y‚½`3˜ù:.èß»ùÜžJ‹{,ŽEH×U“§ÔÛP›‹Vµ9y¼;r¬ )ñ?“[kìÍ=—÷Òýº»ÒàÂx&€ BĆ")Œè¯­°ïÑ}^40¨R8Ìq¬®ѲLï1)Û R,뺪õûÔnê4{È˵6+áȳŒ@ÀhXb”–­^îÇ w²É¹´¸OÁ_4È^Ê—YçŽÏ¼øEÖ×9/ª¬1eñü…)'Èk8@:}«žËls>ãö0)Ç¡ÑçꪬöŠ”éV€dU<‚`¹P©NäÎgÓ‹w7ǺÍ*Á¼ûŸJù_fx’ÖèZBQ¼‚ÔÁúV‰"R­t8V¤è„uIMaõ‹5ð…x÷íÉ›¯Î§XæÂ=u l›äe#ëR{4·„ÒÎK6õ’5€2fWÖ››œ GcSo¼ ¹Z‘çj¯iÌÔ ÀJÉ`{_¤ånÔú’±±é)/ŠaX5JŽÀ§‘ Z5Ìj8h´ ê]ªÔ“Åñ¡ @<•šLæöüvö*÷3rGç”Jr ЇÏ0Û½NÄ è„Îð™Äëz‡+NÝ|-›´Èˇ—W;Ì¯Š»ON'¶ÝWà8—$ð^W;íÁÖíåwćڿ³î¬1yÚäÙXYeu~•žc•+m‘Ã\(Â6”(¾IÕslû.0šãÓC"0m­¬vke€à{,ân[¯i^èþv(sØõ¸=Â+*}AëÜÞ)èª1Æi!‹yÛéFB6ÒŽ¨¸ªöà[ űѕ@À.Hÿ£Šï37­¨¬µ]®/˜pÝ>ÚªeÕ{©‰®5^hã=Îv]˜>¦’â’Ê ¤Ð;Kwž³Û† û8_@²9óÜAÒ/¯&ssŽ;íâúÐîzäýqÆ0æµå†H©Ít0C‹ ŸË•#oºªÏªòãc1†HÈV¶¿+ƒÁ‚Ú?މmk cSw‡±n`ÁT/vy¡N8( ûÞ\.¦ÿ¾ºµ\0És<z3½¾˜&¯<8 Ý ÜíÖÒr±m…}Ì«·XÏ–ÀþësšÖ¹iVÛ=L$;™å¡Ê€› 3Uð8`^È»FéžÑþœ¥JŠ©ý†=P¢¨ðMËë=šŽáo« ƒÀ“IÛ”rwÑHØ Ë ´nšf÷Ë®®><#€±²W÷!“;3(’7¸Í €×vGƒ<€ Ü¿�Þ¢E^ë¾h§”ÎÖ ã, ¦Â32?)ÓÑ1Ø^ËÇÁÆ¡£ 6i*ÍÑX`Æ£M[n ›( c‡JV2kЫ½¾�NcÏ弳ݶwµåÁ€ðáùP3‘Ó¤•—™ê€¬Xƒ/Q[Nƒ@/à_SeUñÕÙÙû¯7•j¾Y|…¬ùþ·ËF üÑ|ÑxØ:+Muˆ{œ‚-Žh9=ÅázLþevÛÒ†§Y#dnÔ—ØÍ†ó¾ÇœCõý¼89Ð~ÖÛ�vqøÿzs²-p@ë®}äN-=pÄ?äN ˜ëØ ˆÚzý¤WapäÕKã±Ýa“hEõ¢®ÁÃ7š—mµë6ú•µD ™%%?ÝNNí0çtžC•ðŽ!Ç—Ç¡}‚á“ÙÍÌ“«ë·³AäB¨©?7žBÁu2‚‰Þë¢:ž s¤ß‘½ÔùÛOæhv´90«0¬lqlÎ|8]O&Gp€î#‚þÉúwÞ‚®yÉþOèÎW¤¬ú Û&{éìî§7ÇÎñÿÖ¹¯Îá”ÑÇÞºÛÔVr—Ö)ÎE®œ×ÑSõñÑc^r�½Ï5ö†gͬm°ª6Õ¾X–o4Á\ÅMú"•ß±i³¶\°„ã‹k0= ΢€wkxþì×0.•&¡ù ß“¼£ÛçÝ0mx¤}}#OÅ`0 z–^Pve ˆ#ºRƒñ-+ݸëÇÊ‚«ØP*¨¬TÁ3#WäÍ—ot#|qEì1¿ù‚Žóö Ÿ6Û‚qÏëìO›lƒÏ½¢hç½ÐPTçÁ ­ ?°,(þÂCBtàyˆ(b>…aü‡=4háp¡ïôü®ƒz.’Ñ¿àïOE± endstream endobj 155 0 obj 1971 endobj 159 0 obj <</Length 160 0 R/Filter /FlateDecode>> stream xœÍYmsÛ¸þ®_~:ªc!øæ[ê:ÓÜäÆ®Í»KÇ阄$ö(B&©È¾ßÝ]�|³ìÆm§ÓŒ'cY €ÝgŸ}v—¹'>eÄÇ÷;ß-Þ\'dÓ.|²YÜ/˜Y$îW¾#Êà_dë…ÝÃHÂI’T¤$Û-X"¨H"’·^~hªÏû¼$çði¹âaJSy?Éú +2,/ÿžý§p0M#<;ˆIöqá]]/X¬|‚dù‚…”Çp\_,¼ËOËì N·ÁÙ s‹»ÂEØðÔ¬&4ÂЭ^_ºU–&no%­ffÕïxä|ôÊ;¿üH®®/ÞøtqƒÏ€¬B¾ó€¬7ÏÓÄg‰›²Î•q˜|Y¡>ãÜSM[êš$”3šœ‘n«È¾Ñ¤íš²Þ|$wŠ´{•—_UAŽe·%Ÿét®«·oÞÀgõõtÚ>´~$²êTSË®4˜¢‡úrÀ‰ÅÎÁ/jppÕ¯ô6­ýE-5@‡Œ…yäÚÔzx„”íhgYŸú¢R®Í×î‹B«¶þÂËi04…'bäLìvc ¦.®x½Ô“]Ž`´‡ý^7ܪk5ÅðXV• 2œÍ¼õ�×®Q7Ê–Èšü%Ë®ìÖeyÔÀ—ýñÖËÐäá’90þ%Ð2Myâ)8¨QxÞZW•^òÙzÇö­9ŽÅTZ·:ÿ­ !~à~0@ yñÛ2ųb‡•ñG݆hrÍrŒù}|‘T)e"=Ë+UwD¯-I™ïXÊ ì;<o½Õ ¬Yr(Ƙå’q 5 MXVÖú¢·^¢ùpòwg¿|ÑwjôJó·ß«ý«­n»ZîÔ©ª¯°:Ì|¹øô!#ç—~*¥£W>E`sRÓ ÿ‘»%Kmvj½&E¹67¦) XÄ{½ˆ7z±†½àŽj¢\˜¬u�•øwÓ¨v¯ë¥É>³Sm+7ðX·•Ñb¹ß+Ùâ€f´¥¿ë‰¶ÈN„³:÷–’w6]¹Shh·±<6°Zo¬b)[�¿ˆ™3®QobËUÀ|ßû¹žI‘!J2<ðÎÄÀOïPVÞcªÍÔtÚmajìýÃns‡ÇmµÅ"èëÄû)3Dä¾-+¸JNYƒ ²*W¦>¬ÂŸb{ë½Õ׿ îÞ©ÍE}¬;ù@ŽKÄ òŒ™ DÞ9«BS„̬z·ž–† †Úø¶6®€%à«Þc l¸-ePéù¸!´!Ãë•*¬c{Õ ­&4в¯È"Õâ! aÓÞbUË;.³Þøa‚k–þЮÐ8}Uæ+V�Å.N†VA†pkJÙU@æÖ v[ª§>7‘]!�Ds|HÃÈÔNÁO‡FOŠ'tŸºÐXv{ƒ1ÝU>ÃuØ…¶¹6…v!J…6L:#ú€tºƒ…Gƒ"$–ìšž“©è9ieˆÅ>¢wÝ«Ê;¤ê,.ñ”A‘cй>Tt RÚkXOˆ® ‡/™?ô9ªÕÕÛ$š=R<èžÚþ‚€„[0MÀ¸ ŒE/xͦ»Ø £¶qÆlʾ·´»SÆi:ë¼ÜÁ)åµ­'æàN_MÃ’ ¹ ÎAóÒX߆֣ [Ï0Œÿ§n_À ¶™þ(f<z£9obRoÔNwÊrŠËÅ”h‚äY(&'™™óJ©5¯A–ð#Þü‚Þ ‡ô{è$PV 񻮮 $D£öÕã4Œ#¹¾A­[¤•=*ÂSZ,d…줕øü4° [Ïž±Ý~Š%©,›ÖI7O°q‚RêZ §“ F #�èšÌs( Œu9ȹ5®kÜ©ôf=üívvÚöé²éÊüPÉÆîÐäF²‹+€n,N¨mra!D­q •NÖtòù–’Ÿzݩڈ .|[YoŒhÉñx[Ü2Á.�ìýž�šÐ"‚<BòPâ]vÒÂŒ"­šeYÕs ¢¦È)StϨrµL9à<ywsóQb D9Ÿ%åeJ‡1µB ®ÿ-:Ü>Ìí–f.VÖ:RÍZgŠaŸb°°™{Á¿tï—çÜÔï“ÿìÿêÞ/'îÁùÉ̽ðÄ=Îì­vTïü¥¤iÿ†™pæª*kõ„b¨öV°éÌÀhb`.çf€ &£€w›ÄAuVêÈù à1>(ýZ9ºIf%lÈ,Ô:£î[²Ywïz<¬d1 1Oªdêõ)þ°a@¿Ž<cZ£×we-›iýBpkàà‹¹w  Ž¼ÌŸ÷ÄÝŠS#놘;º­6²å,^G@1ÃwE™fâùjvõ\5ƒ^ûuòµ‚þñ²†FƒíL¢ðûyIíMj†jzRòXúzÌ g«AçlÓÇY1¢ZWZoúÂqÚO$‘é^ÑQ|v·~<×ʽ7º¾È®ÉgJP[îJ(KŸ—àÒn‡câÚÔœÐ$öîCˆg™Ç§Â~ÀVÅL“SLphyAß݆Yfô†™í½‚™¦†zf§Óu£wÏ ƒ­=P{ÊÀ™þ$dçÓÒÎh’ؙɾÿ‚×uRX<gH§ø.UÌYÿg×8 {Q íèU0å|¼Øæ®w[ëCm¦¨ÁÑ~а›—Ÿð·M~8 êôü¥¥ñ`œï¡KÆa>ô}<UÞéy[üôMÚ¼Ô“y8D[SímÚ$”yCÐ’òéKÆ*úì\­§b ´5ól5S`‰/†=@¼ù;f¥«oU[rh‘™fŠŠ ‰fâÈû’ükS>GJápüwíÅ$“§c ÞjzVÓ…U:·JÔ>IvdLº§Í ˆ™'Ñë%禹&‰tþ–¿¯ÍÁèþõD)BšLfÎì™bìÚ[LÇ›lÉ6:Ì»¼&z¯‰o ÎLpÌë4û°GYzÒÉD ñŠÝE¦…�­O¨¿„E.<h1~<�É8tÙvúïÿc š|‘-þ ?ÿË@¿êendstream endobj 160 0 obj 2327 endobj 164 0 obj <</Length 165 0 R/Filter /FlateDecode>> stream xœXÉrä6½×WÀ¾˜5!ap?MhÚ­p{ÔnY¢íC{‰RÁÍ¥šK—åoèv&´ä% •H ‘Ë{/õ‘„”‘ìߪÝýû.#ã.$»;¦_û§jÉKXãƒò°3{É8ÉŠˆæ)ÛËršg )Ï»÷A5ÍÏûyO^Á§ý% ZäIðVt³hÈòzÿÿòÛ]”’Kø-k8\ïæ)ìHÃ0¸“¢&rúA/äÌW»,£E¢°% ?îË_pgµcŒ2rûB ªŸG2€ Õ=’ÓÐ?4²).¿Ì ưô’¥4ÇåpjfO}7O¤?V¶ýðä\d4\íÓ«v9™ãŠÐØÑÛˆhš¾“ê;ðàã,ljö, „jdMµÕKÆ š°¹óá$³{R­ì牒ò(Éx’•ú,kýôX§úšœ÷:ÁQru„E¢ªúA?õd‚íUßÕ ­ŽÆsðÍ.ˆÂýWXBHÓ˜c%‚ëò–ܾ»Ã0#Êðaµ‹ Ê9+lÊÚ}N㜯&"mÂÄ«÷,E¸!å4å©KgY­–"š‘Ëgß¶¢«!{a‘0îL~×O˜e‚NŽrø´g øä0’q>úaÒQã¹gî`qgyü×Ûs/4\¢$‡_2î¡t‚*×=fWiÝx™G|p»/8Ëypuÿ#QÝ8¿0EG´»‚Ó±‰g ¸$¾êç¦î¾Â1 #À„Ñ4J\ʦه~Îâܾ%¹{}_n¶F) ³Äa·ôË–Æq±z›ðŽÆ¸áç?äÑZR5.oáã<äý�ðç>C眲̥/pɲTôbSE–ß”Xþ(ŸË� ŽÅ mT�Â0û¿´®~IjeÓêJ]ê¦óÐ Ãã,rÊsŸ²Qìûzêè/¸ ‰]rÿf9!§Q†¹Cz7É¡yD#—N5eç¤ÀØM�æ,N'"aAó­G‰õèþþ)ßÉêEŸ ö7éÓ0@3GÈÜxÝ/êX´ÑÒÈ)8ùD¼î÷é™EÁ¹kzxbPBÉ+ sßµ<¤ =§•žÍ°j†nRÝ,‰€Ìˆ¡Q@?ñ�¤—ëqEnsž!MÒ§Nõ¯ßܼ^8ç9“£°.Ýf¼â¥P×t‘}ˆés]!Ê,QP{û“ì´é·rhÕ8¢ ÿǸU€ºÛn¹Npóõ>Bæñ,¸Q]º÷ :` ¼ŠC|Šÿâ!'‡µ¬U*ÿF‹Ž¾êø¬®¸#f.=sWiãxü¡Ÿñü+ÝÚÔ�AjW .ÁàÁ-Öm©àiŽmiݹšçÖü•-ÜÄØ4¢ú�ö;"N§FÙ>:õM­GL©®´Îé·gÖéÇG©gðÏsèVëqåõ±œ†K3_a¡-ê¨=_Ïj:‚ö#¼Ob­„³€+1SPS¿¦qâ»eª30Y½ oE÷†Ñw0õêF˜u;R‹u“ùJ\ë<H-Ô s=Üq¦e.Ä«¥1e¿ÑK­žõë¸çkNEçí¡!/N?­,cù2Ì‹j€S5”ütÎz£VåÀè·äÂ`ᨠZñ«jç–ˆ 6Ùør’±%VìˆõC÷¡ëõ2DŠ´(ÜèÂ23ºœ;À–®þ:võ¤Qx®í@<„§Á1‘§~,ŒØ 9K5ÔÎì4ÐÅegÓõaJ*\ߣi†9ô¢4ߌµh¬Øó vÝAþ™Àf¬'åùþØdàœýųþ á; x+hÖØ§'Ùtr²Ž®$Jõqv;I9ld1ÃÁbñ~¼÷ûG±Ð&õsD`6¸¿ÿ†¼ý:!Ÿ¡%§ º¥BôÝÿ\õ H±ém ÷œ2S_¬YSŸmìè»Yú÷Ò}j``$ž¦# 킜 dñ(Iô¨Óª–¨vÂïÅØd:5²¿‘ß‹‡§TPvª“/Éaâf‰WFæG(Ëó¦ZtÖPoÅÜX¸Ic<—%ö^ ¯…æKqtwe§o€�,N:¤“°Å nXõ!I­>üÓ#fLÞ*©4‘YRŸ¼MéÿúXÈŒcí­¹ÆñE¨ã5«ñPæeÓAý…#¼0E‡ž€½Ç1za¾.ƒ:7W^\ï9š†ÎQ`Œ~×¹¡~3ø ³ >¶]•ˆ'¨8¯®¼MãLÊÙ‚\öú ©ëz¬£·/ÍÆ8 ±éÐãÈ¿>ò ÇV~4jmëP3hë?ÜÝØÀ¸KÁ(¶ <Z„Å1Ì:d/‰ÔBõ×JÊÚ/Òx¹éëi×Üt²éÜ6PcÚ©÷?É?í-ÍÁ£y²ÒÜM6_Ç4Úz¿ÌÌ–-¤qF‚÷<6SÓ'.­å^£]G§ Mÿ97&ª.ç¢Q£™¹_kºŸ"Í<!„Ž>& Ý}Ö/àú²;ªV5bØ~M€pU%O“–4;[ýaxÔ-§Ç¡Â«š#ã5¬Xu T¹½³¥UIøH×pjA†_‘Œr¸Êí!:cYðŒ|;ƒ$óq½%N\£‰8¦ãu¹û~~ɧ ìendstream endobj 165 0 obj 1993 endobj 169 0 obj <</Length 170 0 R/Filter /FlateDecode>> stream xœ­VÛnÛ8}÷WÌÛJ‹˜uW_ŠÔMÑtÓ&k+Hdh‰¶´‘)‡¢âöúÑ;¤$[N¶(°X‰sæÌÌ™3#>C(8úÓgÛÉlÁ¦™8°™<M¨9„þ+Û» býCºžt>"¢Ä#qévB£˜ÄQ�é~roe­¬,ú`ßì©ë'$‰ë3-«àplÿ•~šx!Lñ/Í1¸ñôǺár[6MY ØÉzUñ-àcú!½†Ëg›ú$IÜÈâÒâ8‘gICCz5I¿·"§G»nÔkÈËæšËøk°8ð_ƒÚƒ\V7¿Nâ`µÙK£±£9Á ¬ ³Ó¿'.1G ñâ$öû£*ÕGŽ> Ôœô:…zÇ%SX)ÑFÓù Ð`ÚU’#+‘Û§p+Em»}Žû¾%™hÖ\ÂåûQÚ^ïó¡¬8°Jr–~ î[Ù¨,ð`üüÞïK M›Ð"Eÿfôvó‚I–)4Êj1ðC;(ñ©ãöµ>ó qìÜ[Òôym':µ0¶¦œw¡¦ÔqHtBFøâ¶"Óô7 ùS[JZ7âuähg¯È}© ÐÄ–bªà°\^Áü2.R¶cªx ,ËxƒØå¦PÍÛ ã/EWÉ›º•™~ÀVr‘ñJaPoW×¼Q«¾ƒZ­ºƒ#°arδ¢Ùñ¬ü\ÊZBáÜaa·ò˜ëGT¿±ÅŠû·#‡8—½FÙˆ¾8š¦{ ERàpåZ•Z ØÁ3u�Ÿúö±¢ž×m•›Úªšå0ÇjTü Ìüc²˜ÿ^Öø°®å–ibYžwìD„&Äs²¿lšVK£àÙãKiýµEÏ×Íâ"Å‚¶[&r„¢N‡Ò“t¤…'œ-FÄòæ. ëÀÑ•4_ò'ívÅecTçÇù)+ÍÁ±ìš —9 Eñ³@Xù ðV0¸îîŽÉ¦c{JîÈÓ _}š­x„ŒUÕŠ!á’ïj©ý]’ãr9*Ø0½®QupG3ú<V oYéÏŒâzã@V¬8<µ¼Å™)¦ ¼q•_¿b4­Ïµäý€duŽóeÜÙnÇ™„‡PëcݪVꩬ8Ã0´*Nר©@††[΄ÒÌ ~º“¼˜’ž¬¤Ã»âd)eǾ"#a’ôNz-~¬-f‹ßÌøÂÐ/ç©ï¡šG+Ë:¿=bˆåEÃô¦¯K˜ÁüúKº¸|‡¢&Žç{ÖmjÓK ¨…¦‚ãÛßÅ…è…šL×À¿g¢ä,¨ßQEA‚œ‚¼·6¥m®‰gõúéRJˆ Å!s éf­*ê—PÇ÷åÙj¼‹|\@Zû¢î5ªeúR²\Ù4é:ÕªZ6P6¸FZqØ­ G…3Å!ýxþå¥V9é«3KcŸxcfïîît&GnôU¦§¥Pj÷f6ÓWR°oßHÃ;Û1¢±Ðp‚~ж6`øŸ4­à Áf»v5Ûï÷³V•U©JÞ˜X³_Y^\ÀùÕòúhö:Òi¸W\zП¹¶z#x^´û W/ôåïнîâ§ŒtÆZÙS×s‡¹Ô÷E\ÇnDðÚFC7ŽI`¹|j«ïà:Ô5}ñƒÍó4ÔE:ù?ÿ�›‰àSendstream endobj 170 0 obj 1267 endobj 4 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 11 0 R /Font 12 0 R >> /Contents 5 0 R >> endobj 13 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 16 0 R /Font 17 0 R >> /Contents 14 0 R >> endobj 18 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 21 0 R /Font 22 0 R >> /Contents 19 0 R >> endobj 23 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 26 0 R /Font 27 0 R >> /Contents 24 0 R >> endobj 28 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 31 0 R /Font 32 0 R >> /Contents 29 0 R >> endobj 33 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 36 0 R /Font 37 0 R >> /Contents 34 0 R >> endobj 38 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 41 0 R /Font 42 0 R >> /Contents 39 0 R >> endobj 43 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 46 0 R /Font 47 0 R >> /Contents 44 0 R >> endobj 48 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 51 0 R /Font 52 0 R >> /Contents 49 0 R >> endobj 53 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 56 0 R /Font 57 0 R >> /Contents 54 0 R >> endobj 58 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 61 0 R /Font 62 0 R >> /Contents 59 0 R >> endobj 63 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 66 0 R /Font 67 0 R >> /Contents 64 0 R >> endobj 68 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 71 0 R /Font 72 0 R >> /Contents 69 0 R >> endobj 73 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 76 0 R /Font 77 0 R >> /Contents 74 0 R >> endobj 78 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 81 0 R /Font 82 0 R >> /Contents 79 0 R >> endobj 83 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 86 0 R /Font 87 0 R >> /Contents 84 0 R >> endobj 88 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 91 0 R /Font 92 0 R >> /Contents 89 0 R >> endobj 93 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 96 0 R /Font 97 0 R >> /Contents 94 0 R >> endobj 98 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 101 0 R /Font 102 0 R >> /Contents 99 0 R >> endobj 103 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 106 0 R /Font 107 0 R >> /Contents 104 0 R >> endobj 108 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 111 0 R /Font 112 0 R >> /Contents 109 0 R >> endobj 113 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 116 0 R /Font 117 0 R >> /Contents 114 0 R >> endobj 118 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 121 0 R /Font 122 0 R >> /Contents 119 0 R >> endobj 123 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 126 0 R /Font 127 0 R >> /Contents 124 0 R >> endobj 128 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 131 0 R /Font 132 0 R >> /Contents 129 0 R >> endobj 133 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 136 0 R /Font 137 0 R >> /Contents 134 0 R >> endobj 138 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 141 0 R /Font 142 0 R >> /Contents 139 0 R >> endobj 143 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 146 0 R /Font 147 0 R >> /Contents 144 0 R >> endobj 148 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 151 0 R /Font 152 0 R >> /Contents 149 0 R >> endobj 153 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 156 0 R /Font 157 0 R >> /Contents 154 0 R >> endobj 158 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 161 0 R /Font 162 0 R >> /Contents 159 0 R >> endobj 163 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 166 0 R /Font 167 0 R >> /Contents 164 0 R >> endobj 168 0 obj <</Type/Page/MediaBox [0 0 595 842] /Rotate 0/Parent 3 0 R /Resources<</ProcSet[/PDF /Text] /ExtGState 171 0 R /Font 172 0 R >> /Contents 169 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R 18 0 R 23 0 R 28 0 R 33 0 R 38 0 R 43 0 R 48 0 R 53 0 R 58 0 R 63 0 R 68 0 R 73 0 R 78 0 R 83 0 R 88 0 R 93 0 R 98 0 R 103 0 R 108 0 R 113 0 R 118 0 R 123 0 R 128 0 R 133 0 R 138 0 R 143 0 R 148 0 R 153 0 R 158 0 R 163 0 R 168 0 R ] /Count 33 >> endobj 1 0 obj <</Type /Catalog /Pages 3 0 R /Metadata 176 0 R >> endobj 7 0 obj <</Type/ExtGState /OPM 1>>endobj 11 0 obj <</R7 7 0 R>> endobj 12 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 16 0 obj <</R7 7 0 R>> endobj 17 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 21 0 obj <</R7 7 0 R>> endobj 22 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 26 0 obj <</R7 7 0 R>> endobj 27 0 obj <</R10 10 0 R/R8 8 0 R>> endobj 31 0 obj <</R7 7 0 R>> endobj 32 0 obj <</R10 10 0 R/R8 8 0 R>> endobj 36 0 obj <</R7 7 0 R>> endobj 37 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 41 0 obj <</R7 7 0 R>> endobj 42 0 obj <</R10 10 0 R/R8 8 0 R>> endobj 46 0 obj <</R7 7 0 R>> endobj 47 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 51 0 obj <</R7 7 0 R>> endobj 52 0 obj <</R9 9 0 R/R8 8 0 R>> endobj 56 0 obj <</R7 7 0 R>> endobj 57 0 obj <</R10 10 0 R/R8 8 0 R>> endobj 61 0 obj <</R7 7 0 R>> endobj 62 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 66 0 obj <</R7 7 0 R>> endobj 67 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 71 0 obj <</R7 7 0 R>> endobj 72 0 obj <</R10 10 0 R/R8 8 0 R>> endobj 76 0 obj <</R7 7 0 R>> endobj 77 0 obj <</R10 10 0 R/R8 8 0 R>> endobj 81 0 obj <</R7 7 0 R>> endobj 82 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 86 0 obj <</R7 7 0 R>> endobj 87 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 91 0 obj <</R7 7 0 R>> endobj 92 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 96 0 obj <</R7 7 0 R>> endobj 97 0 obj <</R10 10 0 R/R8 8 0 R>> endobj 101 0 obj <</R7 7 0 R>> endobj 102 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 106 0 obj <</R7 7 0 R>> endobj 107 0 obj <</R10 10 0 R/R8 8 0 R>> endobj 111 0 obj <</R7 7 0 R>> endobj 112 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 116 0 obj <</R7 7 0 R>> endobj 117 0 obj <</R10 10 0 R/R8 8 0 R>> endobj 121 0 obj <</R7 7 0 R>> endobj 122 0 obj <</R10 10 0 R/R8 8 0 R>> endobj 126 0 obj <</R7 7 0 R>> endobj 127 0 obj <</R10 10 0 R/R8 8 0 R>> endobj 131 0 obj <</R7 7 0 R>> endobj 132 0 obj <</R10 10 0 R/R8 8 0 R>> endobj 136 0 obj <</R7 7 0 R>> endobj 137 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 141 0 obj <</R7 7 0 R>> endobj 142 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 146 0 obj <</R7 7 0 R>> endobj 147 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 151 0 obj <</R7 7 0 R>> endobj 152 0 obj <</R10 10 0 R/R8 8 0 R>> endobj 156 0 obj <</R7 7 0 R>> endobj 157 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 161 0 obj <</R7 7 0 R>> endobj 162 0 obj <</R10 10 0 R/R9 9 0 R/R8 8 0 R>> endobj 166 0 obj <</R7 7 0 R>> endobj 167 0 obj <</R8 8 0 R>> endobj 171 0 obj <</R7 7 0 R>> endobj 172 0 obj <</R9 9 0 R/R8 8 0 R>> endobj 10 0 obj <</BaseFont/Times-Italic/Type/Font /Encoding 173 0 R/Subtype/Type1>> endobj 173 0 obj <</Type/Encoding/Differences[ 126/tilde 140/fi]>> endobj 9 0 obj <</BaseFont/Times-Bold/Type/Font /Encoding 174 0 R/Subtype/Type1>> endobj 174 0 obj <</Type/Encoding/Differences[ 140/fi]>> endobj 8 0 obj <</BaseFont/Times-Roman/Type/Font /Encoding 175 0 R/Subtype/Type1>> endobj 175 0 obj <</Type/Encoding/Differences[ 140/fi/fl 173/minus 180/acute]>> endobj 176 0 obj <</Type/Metadata /Subtype/XML/Length 1346>>stream <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?> <?adobe-xap-filters esc="CRLF"?> <x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'> <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'> <rdf:Description rdf:about='uuid:e0e52b21-c0d0-11ee-0000-b799d317e05b' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.05'/> <rdf:Description rdf:about='uuid:e0e52b21-c0d0-11ee-0000-b799d317e05b' xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2014-01-29T08:09:44+01:00</xmp:ModifyDate> <xmp:CreateDate>2014-01-29T08:09:44+01:00</xmp:CreateDate> <xmp:CreatorTool>groff version 1.22.2</xmp:CreatorTool></rdf:Description> <rdf:Description rdf:about='uuid:e0e52b21-c0d0-11ee-0000-b799d317e05b' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:e0e52b21-c0d0-11ee-0000-b799d317e05b'/> <rdf:Description rdf:about='uuid:e0e52b21-c0d0-11ee-0000-b799d317e05b' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title></rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end='w'?> endstream endobj 2 0 obj <</Producer(GPL Ghostscript 9.05) /CreationDate(D:20140129080944+01'00') /ModDate(D:20140129080944+01'00') /Creator(groff version 1.22.2)>>endobj xref 0 177 0000000000 65535 f 0000091088 00000 n 0000095584 00000 n 0000090790 00000 n 0000085388 00000 n 0000000015 00000 n 0000002584 00000 n 0000091154 00000 n 0000093997 00000 n 0000093858 00000 n 0000093706 00000 n 0000091195 00000 n 0000091225 00000 n 0000085548 00000 n 0000002604 00000 n 0000005080 00000 n 0000091275 00000 n 0000091305 00000 n 0000085710 00000 n 0000005101 00000 n 0000008177 00000 n 0000091355 00000 n 0000091385 00000 n 0000085872 00000 n 0000008198 00000 n 0000011025 00000 n 0000091435 00000 n 0000091465 00000 n 0000086034 00000 n 0000011046 00000 n 0000013477 00000 n 0000091506 00000 n 0000091536 00000 n 0000086196 00000 n 0000013498 00000 n 0000016645 00000 n 0000091577 00000 n 0000091607 00000 n 0000086358 00000 n 0000016666 00000 n 0000019653 00000 n 0000091657 00000 n 0000091687 00000 n 0000086520 00000 n 0000019674 00000 n 0000022686 00000 n 0000091728 00000 n 0000091758 00000 n 0000086682 00000 n 0000022707 00000 n 0000024900 00000 n 0000091808 00000 n 0000091838 00000 n 0000086844 00000 n 0000024921 00000 n 0000028236 00000 n 0000091877 00000 n 0000091907 00000 n 0000087006 00000 n 0000028257 00000 n 0000031031 00000 n 0000091948 00000 n 0000091978 00000 n 0000087168 00000 n 0000031052 00000 n 0000033761 00000 n 0000092028 00000 n 0000092058 00000 n 0000087330 00000 n 0000033782 00000 n 0000036650 00000 n 0000092108 00000 n 0000092138 00000 n 0000087492 00000 n 0000036671 00000 n 0000039699 00000 n 0000092179 00000 n 0000092209 00000 n 0000087654 00000 n 0000039720 00000 n 0000042228 00000 n 0000092250 00000 n 0000092280 00000 n 0000087816 00000 n 0000042249 00000 n 0000045469 00000 n 0000092330 00000 n 0000092360 00000 n 0000087978 00000 n 0000045490 00000 n 0000048171 00000 n 0000092410 00000 n 0000092440 00000 n 0000088140 00000 n 0000048192 00000 n 0000050784 00000 n 0000092490 00000 n 0000092520 00000 n 0000088302 00000 n 0000050805 00000 n 0000052989 00000 n 0000092561 00000 n 0000092592 00000 n 0000088466 00000 n 0000053011 00000 n 0000055756 00000 n 0000092643 00000 n 0000092674 00000 n 0000088632 00000 n 0000055778 00000 n 0000058432 00000 n 0000092716 00000 n 0000092747 00000 n 0000088798 00000 n 0000058454 00000 n 0000061476 00000 n 0000092798 00000 n 0000092829 00000 n 0000088964 00000 n 0000061498 00000 n 0000063262 00000 n 0000092871 00000 n 0000092902 00000 n 0000089130 00000 n 0000063284 00000 n 0000065660 00000 n 0000092944 00000 n 0000092975 00000 n 0000089296 00000 n 0000065682 00000 n 0000067643 00000 n 0000093017 00000 n 0000093048 00000 n 0000089462 00000 n 0000067665 00000 n 0000070120 00000 n 0000093090 00000 n 0000093121 00000 n 0000089628 00000 n 0000070142 00000 n 0000072379 00000 n 0000093172 00000 n 0000093203 00000 n 0000089794 00000 n 0000072401 00000 n 0000075132 00000 n 0000093254 00000 n 0000093285 00000 n 0000089960 00000 n 0000075154 00000 n 0000077424 00000 n 0000093336 00000 n 0000093367 00000 n 0000090126 00000 n 0000077446 00000 n 0000079491 00000 n 0000093409 00000 n 0000093440 00000 n 0000090292 00000 n 0000079513 00000 n 0000081914 00000 n 0000093491 00000 n 0000093522 00000 n 0000090458 00000 n 0000081936 00000 n 0000084003 00000 n 0000093573 00000 n 0000093604 00000 n 0000090624 00000 n 0000084025 00000 n 0000085366 00000 n 0000093635 00000 n 0000093666 00000 n 0000093791 00000 n 0000093940 00000 n 0000094080 00000 n 0000094160 00000 n trailer << /Size 177 /Root 1 0 R /Info 2 0 R /ID [<FEB27ACDA043DF57AB0897ED2097BBC6><FEB27ACDA043DF57AB0897ED2097BBC6>] >> startxref 95738 %%EOF ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/curl.1�����������������������������������������������������������������������������0000644�0001750�0001750�00000267242�12262353672�011500� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * .\" * This software is licensed as described in the file COPYING, which .\" * you should have received as part of this distribution. The terms .\" * are also available at http://curl.haxx.se/docs/copyright.html. .\" * .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell .\" * copies of the Software, and permit persons to whom the Software is .\" * furnished to do so, under the terms of the COPYING file. .\" * .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY .\" * KIND, either express or implied. .\" * .\" ************************************************************************** .\" .TH curl 1 "27 July 2012" "Curl 7.27.0" "Curl Manual" .SH NAME curl \- transfer a URL .SH SYNOPSIS .B curl [options] .I [URL...] .SH DESCRIPTION .B curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction. curl offers a busload of useful tricks like proxy support, user authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer resume, Metalink, and more. As you will see below, the number of features will make your head spin! curl is powered by libcurl for all transfer-related features. See .BR libcurl (3) for details. .SH URL The URL syntax is protocol-dependent. You'll find a detailed description in RFC 3986. You can specify multiple URLs or parts of URLs by writing part sets within braces as in: http://site.{one,two,three}.com or you can get sequences of alphanumeric series by using [] as in: ftp://ftp.numericals.com/file[1-100].txt ftp://ftp.numericals.com/file[001-100].txt (with leading zeros) ftp://ftp.letters.com/file[a-z].txt Nested sequences are not supported, but you can use several ones next to each other: http://any.org/archive[1996-1999]/vol[1-4]/part{a,b,c}.html You can specify any amount of URLs on the command line. They will be fetched in a sequential manner in the specified order. You can specify a step counter for the ranges to get every Nth number or letter: http://www.numericals.com/file[1-100:10].txt http://www.letters.com/file[a-z:2].txt If you specify URL without protocol:// prefix, curl will attempt to guess what protocol you might want. It will then default to HTTP but try other protocols based on often-used host name prefixes. For example, for host names starting with "ftp." curl will assume you want to speak FTP. curl will do its best to use what you pass to it as a URL. It is not trying to validate it as a syntactically correct URL by any means but is instead \fBvery\fP liberal with what it accepts. curl will attempt to re-use connections for multiple file transfers, so that getting many files from the same server will not do multiple connects / handshakes. This improves speed. Of course this is only done on files specified on a single command line and cannot be used between separate curl invokes. .SH "PROGRESS METER" curl normally displays a progress meter during operations, indicating the amount of transferred data, transfer speeds and estimated time left, etc. curl displays this data to the terminal by default, so if you invoke curl to do an operation and it is about to write data to the terminal, it \fIdisables\fP the progress meter as otherwise it would mess up the output mixing progress meter and response data. If you want a progress meter for HTTP POST or PUT requests, you need to redirect the response output to a file, using shell redirect (>), -o [file] or similar. It is not the same case for FTP upload as that operation does not spit out any response data to the terminal. If you prefer a progress "bar" instead of the regular meter, \fI-#\fP is your friend. .SH OPTIONS Options start with one or two dashes. Many of the options require an addition value next to it. The short "single-dash" form of the options, -d for example, may be used with or without a space between it and its value, although a space is a recommended separator. The long "double-dash" form, --data for example, requires a space between it and its value. Short version options that don't need any additional values can be used immediately next to each other, like for example you can specify all the options -O, -L and -v at once as -OLv. In general, all boolean options are enabled with --\fBoption\fP and yet again disabled with --\fBno-\fPoption. That is, you use the exact same option name but prefix it with "no-". However, in this list we mostly only list and show the --option version of them. (This concept with --no options was added in 7.19.0. Previously most options were toggled on/off on repeated use of the same command line option.) .IP "-#, --progress-bar" Make curl display progress as a simple progress bar instead of the standard, more informational, meter. .IP "-0, --http1.0" (HTTP) Tells curl to use HTTP version 1.0 instead of using its internally preferred: HTTP 1.1. .IP "--http1.1" (HTTP) Tells curl to use HTTP version 1.1. This is the internal default version. (Added in 7.33.0) .IP "--http2.0" (HTTP) Tells curl to issue its requests using HTTP 2.0. This requires that the underlying libcurl was built to support it. (Added in 7.33.0) .IP "-1, --tlsv1" (SSL) Forces curl to use TLS version 1 when negotiating with a remote TLS server. .IP "-2, --sslv2" (SSL) Forces curl to use SSL version 2 when negotiating with a remote SSL server. .IP "-3, --sslv3" (SSL) Forces curl to use SSL version 3 when negotiating with a remote SSL server. .IP "-4, --ipv4" If curl is capable of resolving an address to multiple IP versions (which it is if it is IPv6-capable), this option tells curl to resolve names to IPv4 addresses only. .IP "-6, --ipv6" If curl is capable of resolving an address to multiple IP versions (which it is if it is IPv6-capable), this option tells curl to resolve names to IPv6 addresses only. .IP "-a, --append" (FTP/SFTP) When used in an upload, this will tell curl to append to the target file instead of overwriting it. If the file doesn't exist, it will be created. Note that this flag is ignored by some SSH servers (including OpenSSH). .IP "-A, --user-agent <agent string>" (HTTP) Specify the User-Agent string to send to the HTTP server. Some badly done CGIs fail if this field isn't set to "Mozilla/4.0". To encode blanks in the string, surround the string with single quote marks. This can also be set with the \fI-H, --header\fP option of course. If this option is used several times, the last one will be used. .IP "--anyauth" (HTTP) Tells curl to figure out authentication method by itself, and use the most secure one the remote site claims to support. This is done by first doing a request and checking the response-headers, thus possibly inducing an extra network round-trip. This is used instead of setting a specific authentication method, which you can do with \fI--basic\fP, \fI--digest\fP, \fI--ntlm\fP, and \fI--negotiate\fP. Note that using --anyauth is not recommended if you do uploads from stdin, since it may require data to be sent twice and then the client must be able to rewind. If the need should arise when uploading from stdin, the upload operation will fail. .IP "-b, --cookie <name=data>" (HTTP) Pass the data to the HTTP server as a cookie. It is supposedly the data previously received from the server in a "Set-Cookie:" line. The data should be in the format "NAME1=VALUE1; NAME2=VALUE2". If no '=' symbol is used in the line, it is treated as a filename to use to read previously stored cookie lines from, which should be used in this session if they match. Using this method also activates the "cookie parser" which will make curl record incoming cookies too, which may be handy if you're using this in combination with the \fI-L, --location\fP option. The file format of the file to read cookies from should be plain HTTP headers or the Netscape/Mozilla cookie file format. \fBNOTE\fP that the file specified with \fI-b, --cookie\fP is only used as input. No cookies will be stored in the file. To store cookies, use the \fI-c, --cookie-jar\fP option or you could even save the HTTP headers to a file using \fI-D, --dump-header\fP! If this option is used several times, the last one will be used. .IP "-B, --use-ascii" (FTP/LDAP) Enable ASCII transfer. For FTP, this can also be enforced by using an URL that ends with ";type=A". This option causes data sent to stdout to be in text mode for win32 systems. .IP "--basic" (HTTP) Tells curl to use HTTP Basic authentication. This is the default and this option is usually pointless, unless you use it to override a previously set option that sets a different authentication method (such as \fI--ntlm\fP, \fI--digest\fP, or \fI--negotiate\fP). .IP "-c, --cookie-jar <file name>" (HTTP) Specify to which file you want curl to write all cookies after a completed operation. Curl writes all cookies previously read from a specified file as well as all cookies received from remote server(s). If no cookies are known, no file will be written. The file will be written using the Netscape cookie file format. If you set the file name to a single dash, "-", the cookies will be written to stdout. This command line option will activate the cookie engine that makes curl record and use cookies. Another way to activate it is to use the \fI-b, --cookie\fP option. If the cookie jar can't be created or written to, the whole curl operation won't fail or even report an error clearly. Using -v will get a warning displayed, but that is the only visible feedback you get about this possibly lethal situation. If this option is used several times, the last specified file name will be used. .IP "-C, --continue-at <offset>" Continue/Resume a previous file transfer at the given offset. The given offset is the exact number of bytes that will be skipped, counting from the beginning of the source file before it is transferred to the destination. If used with uploads, the FTP server command SIZE will not be used by curl. Use "-C -" to tell curl to automatically find out where/how to resume the transfer. It then uses the given output/input files to figure that out. If this option is used several times, the last one will be used. .IP "--ciphers <list of ciphers>" (SSL) Specifies which ciphers to use in the connection. The list of ciphers must specify valid ciphers. Read up on SSL cipher list details on this URL: \fIhttp://www.openssl.org/docs/apps/ciphers.html\fP NSS ciphers are done differently than OpenSSL and GnuTLS. The full list of NSS ciphers is in the NSSCipherSuite entry at this URL: \fIhttp://git.fedorahosted.org/cgit/mod_nss.git/plain/docs/mod_nss.html#Directives\fP If this option is used several times, the last one will be used. .IP "--compressed" (HTTP) Request a compressed response using one of the algorithms curl supports, and save the uncompressed document. If this option is used and the server sends an unsupported encoding, curl will report an error. .IP "--connect-timeout <seconds>" Maximum time in seconds that you allow the connection to the server to take. This only limits the connection phase, once curl has connected this option is of no more use. Since 7.32.0, this option accepts decimal values, but the actual timeout will decrease in accuracy as the specified timeout increases in decimal precision. See also the \fI-m, --max-time\fP option. If this option is used several times, the last one will be used. .IP "--create-dirs" When used in conjunction with the \fI-o\fP option, curl will create the necessary local directory hierarchy as needed. This option creates the dirs mentioned with the \fI-o\fP option, nothing else. If the \fI-o\fP file name uses no dir or if the dirs it mentions already exist, no dir will be created. To create remote directories when using FTP or SFTP, try \fI--ftp-create-dirs\fP. .IP "--crlf" (FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390). .IP "--crlfile <file>" (HTTPS/FTPS) Provide a file using PEM format with a Certificate Revocation List that may specify peer certificates that are to be considered revoked. If this option is used several times, the last one will be used. (Added in 7.19.7) .IP "-d, --data <data>" (HTTP) Sends the specified data in a POST request to the HTTP server, in the same way that a browser does when a user has filled in an HTML form and presses the submit button. This will cause curl to pass the data to the server using the content-type application/x-www-form-urlencoded. Compare to \fI-F, --form\fP. \fI-d, --data\fP is the same as \fI--data-ascii\fP. To post data purely binary, you should instead use the \fI--data-binary\fP option. To URL-encode the value of a form field you may use \fI--data-urlencode\fP. If any of these options is used more than once on the same command line, the data pieces specified will be merged together with a separating &-symbol. Thus, using '-d name=daniel -d skill=lousy' would generate a post chunk that looks like \&'name=daniel&skill=lousy'. If you start the data with the letter @, the rest should be a file name to read the data from, or - if you want curl to read the data from stdin. Multiple files can also be specified. Posting data from a file named 'foobar' would thus be done with \fI--data\fP @foobar. When --data is told to read from a file like that, carriage returns and newlines will be stripped out. .IP "-D, --dump-header <file>" Write the protocol headers to the specified file. This option is handy to use when you want to store the headers that an HTTP site sends to you. Cookies from the headers could then be read in a second curl invocation by using the \fI-b, --cookie\fP option! The \fI-c, --cookie-jar\fP option is however a better way to store cookies. When used in FTP, the FTP server response lines are considered being "headers" and thus are saved there. If this option is used several times, the last one will be used. .IP "--data-ascii <data>" See \fI-d, --data\fP. .IP "--data-binary <data>" (HTTP) This posts data exactly as specified with no extra processing whatsoever. If you start the data with the letter @, the rest should be a filename. Data is posted in a similar manner as \fI--data-ascii\fP does, except that newlines and carriage returns are preserved and conversions are never done. If this option is used several times, the ones following the first will append data as described in \fI-d, --data\fP. .IP "--data-urlencode <data>" (HTTP) This posts data, similar to the other --data options with the exception that this performs URL-encoding. (Added in 7.18.0) To be CGI-compliant, the <data> part should begin with a \fIname\fP followed by a separator and a content specification. The <data> part can be passed to curl using one of the following syntaxes: .RS .IP "content" This will make curl URL-encode the content and pass that on. Just be careful so that the content doesn't contain any = or @ symbols, as that will then make the syntax match one of the other cases below! .IP "=content" This will make curl URL-encode the content and pass that on. The preceding = symbol is not included in the data. .IP "name=content" This will make curl URL-encode the content part and pass that on. Note that the name part is expected to be URL-encoded already. .IP "@filename" This will make curl load data from the given file (including any newlines), URL-encode that data and pass it on in the POST. .IP "name@filename" This will make curl load data from the given file (including any newlines), URL-encode that data and pass it on in the POST. The name part gets an equal sign appended, resulting in \fIname=urlencoded-file-content\fP. Note that the name is expected to be URL-encoded already. .RE .IP "--delegation LEVEL" Set \fILEVEL\fP to tell the server what it is allowed to delegate when it comes to user credentials. Used with GSS/kerberos. .RS .IP "none" Don't allow any delegation. .IP "policy" Delegates if and only if the OK-AS-DELEGATE flag is set in the Kerberos service ticket, which is a matter of realm policy. .IP "always" Unconditionally allow the server to delegate. .RE .IP "--digest" (HTTP) Enables HTTP Digest authentication. This is an authentication scheme that prevents the password from being sent over the wire in clear text. Use this in combination with the normal \fI-u, --user\fP option to set user name and password. See also \fI--ntlm\fP, \fI--negotiate\fP and \fI--anyauth\fP for related options. If this option is used several times, only the first one is used. .IP "--disable-eprt" (FTP) Tell curl to disable the use of the EPRT and LPRT commands when doing active FTP transfers. Curl will normally always first attempt to use EPRT, then LPRT before using PORT, but with this option, it will use PORT right away. EPRT and LPRT are extensions to the original FTP protocol, and may not work on all servers, but they enable more functionality in a better way than the traditional PORT command. \fB--eprt\fP can be used to explicitly enable EPRT again and \fB--no-eprt\fP is an alias for \fB--disable-eprt\fP. Disabling EPRT only changes the active behavior. If you want to switch to passive mode you need to not use \fI-P, --ftp-port\fP or force it with \fI--ftp-pasv\fP. .IP "--disable-epsv" (FTP) Tell curl to disable the use of the EPSV command when doing passive FTP transfers. Curl will normally always first attempt to use EPSV before PASV, but with this option, it will not try using EPSV. \fB--epsv\fP can be used to explicitly enable EPSV again and \fB--no-epsv\fP is an alias for \fB--disable-epsv\fP. Disabling EPSV only changes the passive behavior. If you want to switch to active mode you need to use \fI-P, --ftp-port\fP. .IP "--dns-interface <interface>" Tell curl to send outgoing DNS requests through <interface>. This option is a counterpart to \fI--interface\fP (which does not affect DNS). The supplied string must be an interface name (not an address). This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. (Added in 7.33.0) .IP "--dns-ipv4-addr <ip-address>" Tell curl to bind to <ip-address> when making IPv4 DNS requests, so that the DNS requests originate from this address. The argument should be a single IPv4 address. This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. (Added in 7.33.0) .IP "--dns-ipv6-addr <ip-address>" Tell curl to bind to <ip-address> when making IPv6 DNS requests, so that the DNS requests originate from this address. The argument should be a single IPv6 address. This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. (Added in 7.33.0) .IP "--dns-servers <ip-address,ip-address>" Set the list of DNS servers to be used instead of the system default. The list of IP addresses should be separated with commas. Port numbers may also optionally be given as \fI:<port-number>\fP after each IP address. This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. (Added in 7.33.0) .IP "-e, --referer <URL>" (HTTP) Sends the "Referer Page" information to the HTTP server. This can also be set with the \fI-H, --header\fP flag of course. When used with \fI-L, --location\fP you can append ";auto" to the --referer URL to make curl automatically set the previous URL when it follows a Location: header. The \&";auto" string can be used alone, even if you don't set an initial --referer. If this option is used several times, the last one will be used. .IP "-E, --cert <certificate[:password]>" (SSL) Tells curl to use the specified client certificate file when getting a file with HTTPS, FTPS or another SSL-based protocol. The certificate must be in PKCS#12 format if using Secure Transport, or PEM format if using any other engine. If the optional password isn't specified, it will be queried for on the terminal. Note that this option assumes a \&"certificate" file that is the private key and the private certificate concatenated! See \fI--cert\fP and \fI--key\fP to specify them independently. If curl is built against the NSS SSL library then this option can tell curl the nickname of the certificate to use within the NSS database defined by the environment variable SSL_DIR (or by default /etc/pki/nssdb). If the NSS PEM PKCS#11 module (libnsspem.so) is available then PEM files may be loaded. If you want to use a file from the current directory, please precede it with "./" prefix, in order to avoid confusion with a nickname. If the nickname contains ":", it needs to be preceded by "\\" so that it is not recognized as password delimiter. If the nickname contains "\\", it needs to be escaped as "\\\\" so that it is not recognized as an escape character. (iOS and Mac OS X only) If curl is built against Secure Transport, then the certificate string can either be the name of a certificate/private key in the system or user keychain, or the path to a PKCS#12-encoded certificate and private key. If you want to use a file from the current directory, please precede it with "./" prefix, in order to avoid confusion with a nickname. If this option is used several times, the last one will be used. .IP "--engine <name>" Select the OpenSSL crypto engine to use for cipher operations. Use \fI--engine list\fP to print a list of build-time supported engines. Note that not all (or none) of the engines may be available at run-time. .IP "--environment" (RISC OS ONLY) Sets a range of environment variables, using the names the \fI-w\fP option supports, to allow easier extraction of useful information after having run curl. .IP "--egd-file <file>" (SSL) Specify the path name to the Entropy Gathering Daemon socket. The socket is used to seed the random engine for SSL connections. See also the \fI--random-file\fP option. .IP "--cert-type <type>" (SSL) Tells curl what certificate type the provided certificate is in. PEM, DER and ENG are recognized types. If not specified, PEM is assumed. If this option is used several times, the last one will be used. .IP "--cacert <CA certificate>" (SSL) Tells curl to use the specified certificate file to verify the peer. The file may contain multiple CA certificates. The certificate(s) must be in PEM format. Normally curl is built to use a default file for this, so this option is typically used to alter that default file. curl recognizes the environment variable named 'CURL_CA_BUNDLE' if it is set, and uses the given path as a path to a CA cert bundle. This option overrides that variable. The windows version of curl will automatically look for a CA certs file named \'curl-ca-bundle.crt\', either in the same directory as curl.exe, or in the Current Working Directory, or in any folder along your PATH. If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module (libnsspem.so) needs to be available for this option to work properly. If this option is used several times, the last one will be used. .IP "--capath <CA certificate directory>" (SSL) Tells curl to use the specified certificate directory to verify the peer. Multiple paths can be provided by separating them with ":" (e.g. \&"path1:path2:path3"). The certificates must be in PEM format, and if curl is built against OpenSSL, the directory must have been processed using the c_rehash utility supplied with OpenSSL. Using \fI--capath\fP can allow OpenSSL-powered curl to make SSL-connections much more efficiently than using \fI--cacert\fP if the \fI--cacert\fP file contains many CA certificates. If this option is set, the default capath value will be ignored, and if it is used several times, the last one will be used. .IP "-f, --fail" (HTTP) Fail silently (no output at all) on server errors. This is mostly done to better enable scripts etc to better deal with failed attempts. In normal cases when an HTTP server fails to deliver a document, it returns an HTML document stating so (which often also describes why and more). This flag will prevent curl from outputting that and return error 22. This method is not fail-safe and there are occasions where non-successful response codes will slip through, especially when authentication is involved (response codes 401 and 407). .IP "-F, --form <name=content>" (HTTP) This lets curl emulate a filled-in form in which a user has pressed the submit button. This causes curl to POST data using the Content-Type multipart/form-data according to RFC 2388. This enables uploading of binary files etc. To force the 'content' part to be a file, prefix the file name with an @ sign. To just get the content part from a file, prefix the file name with the symbol <. The difference between @ and < is then that @ makes a file get attached in the post as a file upload, while the < makes a text field and just get the contents for that text field from a file. Example, to send your password file to the server, where \&'password' is the name of the form-field to which /etc/passwd will be the input: \fBcurl\fP -F password=@/etc/passwd www.mypasswords.com To read content from stdin instead of a file, use - as the filename. This goes for both @ and < constructs. You can also tell curl what Content-Type to use by using 'type=', in a manner similar to: \fBcurl\fP -F "web=@index.html;type=text/html" url.com or \fBcurl\fP -F "name=daniel;type=text/foo" url.com You can also explicitly change the name field of a file upload part by setting filename=, like this: \fBcurl\fP -F "file=@localfile;filename=nameinpost" url.com If filename/path contains ',' or ';', it must be quoted by double-quotes like: \fBcurl\fP -F "file=@\\"localfile\\";filename=\\"nameinpost\\"" url.com or \fBcurl\fP -F 'file=@"localfile";filename="nameinpost"' url.com Note that if a filename/path is quoted by double-quotes, any double-quote or backslash within the filename must be escaped by backslash. See further examples and details in the MANUAL. This option can be used multiple times. .IP "--ftp-account [data]" (FTP) When an FTP server asks for "account data" after user name and password has been provided, this data is sent off using the ACCT command. (Added in 7.13.0) If this option is used several times, the last one will be used. .IP "--ftp-alternative-to-user <command>" (FTP) If authenticating with the USER and PASS commands fails, send this command. When connecting to Tumbleweed's Secure Transport server over FTPS using a client certificate, using "SITE AUTH" will tell the server to retrieve the username from the certificate. (Added in 7.15.5) .IP "--ftp-create-dirs" (FTP/SFTP) When an FTP or SFTP URL/operation uses a path that doesn't currently exist on the server, the standard behavior of curl is to fail. Using this option, curl will instead attempt to create missing directories. .IP "--ftp-method [method]" (FTP) Control what method curl should use to reach a file on an FTP(S) server. The method argument should be one of the following alternatives: .RS .IP multicwd curl does a single CWD operation for each path part in the given URL. For deep hierarchies this means very many commands. This is how RFC 1738 says it should be done. This is the default but the slowest behavior. .IP nocwd curl does no CWD at all. curl will do SIZE, RETR, STOR etc and give a full path to the server for all these commands. This is the fastest behavior. .IP singlecwd curl does one CWD with the full target directory and then operates on the file \&"normally" (like in the multicwd case). This is somewhat more standards compliant than 'nocwd' but without the full penalty of 'multicwd'. .RE (Added in 7.15.1) .IP "--ftp-pasv" (FTP) Use passive mode for the data connection. Passive is the internal default behavior, but using this option can be used to override a previous \fI-P/-ftp-port\fP option. (Added in 7.11.0) If this option is used several times, only the first one is used. Undoing an enforced passive really isn't doable but you must then instead enforce the correct \fI-P, --ftp-port\fP again. Passive mode means that curl will try the EPSV command first and then PASV, unless \fI--disable-epsv\fP is used. .IP "--ftp-skip-pasv-ip" (FTP) Tell curl to not use the IP address the server suggests in its response to curl's PASV command when curl connects the data connection. Instead curl will re-use the same IP address it already uses for the control connection. (Added in 7.14.2) This option has no effect if PORT, EPRT or EPSV is used instead of PASV. .IP "--ftp-pret" (FTP) Tell curl to send a PRET command before PASV (and EPSV). Certain FTP servers, mainly drftpd, require this non-standard command for directory listings as well as up and downloads in PASV mode. (Added in 7.20.x) .IP "--ftp-ssl-ccc" (FTP) Use CCC (Clear Command Channel) Shuts down the SSL/TLS layer after authenticating. The rest of the control channel communication will be unencrypted. This allows NAT routers to follow the FTP transaction. The default mode is passive. See \fI--ftp-ssl-ccc-mode\fP for other modes. (Added in 7.16.1) .IP "--ftp-ssl-ccc-mode [active/passive]" (FTP) Use CCC (Clear Command Channel) Sets the CCC mode. The passive mode will not initiate the shutdown, but instead wait for the server to do it, and will not reply to the shutdown from the server. The active mode initiates the shutdown and waits for a reply from the server. (Added in 7.16.2) .IP "--ftp-ssl-control" (FTP) Require SSL/TLS for the FTP login, clear for transfer. Allows secure authentication, but non-encrypted data transfers for efficiency. Fails the transfer if the server doesn't support SSL/TLS. (Added in 7.16.0) that can still be used but will be removed in a future version. .IP "--form-string <name=string>" (HTTP) Similar to \fI--form\fP except that the value string for the named parameter is used literally. Leading \&'@' and \&'<' characters, and the \&';type=' string in the value have no special meaning. Use this in preference to \fI--form\fP if there's any possibility that the string value may accidentally trigger the \&'@' or \&'<' features of \fI--form\fP. .IP "-g, --globoff" This option switches off the "URL globbing parser". When you set this option, you can specify URLs that contain the letters {}[] without having them being interpreted by curl itself. Note that these letters are not normal legal URL contents but they should be encoded according to the URI standard. .IP "-G, --get" When used, this option will make all data specified with \fI-d, --data\fP, \fI--data-binary\fP or \fI--data-urlencode\fP to be used in an HTTP GET request instead of the POST request that otherwise would be used. The data will be appended to the URL with a '?' separator. If used in combination with -I, the POST data will instead be appended to the URL with a HEAD request. If this option is used several times, only the first one is used. This is because undoing a GET doesn't make sense, but you should then instead enforce the alternative method you prefer. .IP "-H, --header <header>" (HTTP) Extra header to use when getting a web page. You may specify any number of extra headers. Note that if you should add a custom header that has the same name as one of the internal ones curl would use, your externally set header will be used instead of the internal one. This allows you to make even trickier stuff than curl would normally do. You should not replace internally set headers without knowing perfectly well what you're doing. Remove an internal header by giving a replacement without content on the right side of the colon, as in: -H \&"Host:". If you send the custom header with no-value then its header must be terminated with a semicolon, such as \-H \&"X-Custom-Header;" to send "X-Custom-Header:". curl will make sure that each header you add/replace is sent with the proper end-of-line marker, you should thus \fBnot\fP add that as a part of the header content: do not add newlines or carriage returns, they will only mess things up for you. See also the \fI-A, --user-agent\fP and \fI-e, --referer\fP options. This option can be used multiple times to add/replace/remove multiple headers. .IP "--hostpubmd5 <md5>" (SCP/SFTP) Pass a string containing 32 hexadecimal digits. The string should be the 128 bit MD5 checksum of the remote host's public key, curl will refuse the connection with the host unless the md5sums match. (Added in 7.17.1) .IP "--ignore-content-length" (HTTP) Ignore the Content-Length header. This is particularly useful for servers running Apache 1.x, which will report incorrect Content-Length for files larger than 2 gigabytes. .IP "-i, --include" (HTTP) Include the HTTP-header in the output. The HTTP-header includes things like server-name, date of the document, HTTP-version and more... .IP "-I, --head" (HTTP/FTP/FILE) Fetch the HTTP-header only! HTTP-servers feature the command HEAD which this uses to get nothing but the header of a document. When used on an FTP or FILE file, curl displays the file size and last modification time only. .IP "--interface <name>" Perform an operation using a specified interface. You can enter interface name, IP address or host name. An example could look like: curl --interface eth0:1 http://www.netscape.com/ If this option is used several times, the last one will be used. .IP "-j, --junk-session-cookies" (HTTP) When curl is told to read cookies from a given file, this option will make it discard all "session cookies". This will basically have the same effect as if a new session is started. Typical browsers always discard session cookies when they're closed down. .IP "-J, --remote-header-name" (HTTP) This option tells the \fI-O, --remote-name\fP option to use the server-specified Content-Disposition filename instead of extracting a filename from the URL. There's no attempt to decode %-sequences (yet) in the provided file name, so this option may provide you with rather unexpected file names. .IP "-k, --insecure" (SSL) This option explicitly allows curl to perform "insecure" SSL connections and transfers. All SSL connections are attempted to be made secure by using the CA certificate bundle installed by default. This makes all connections considered "insecure" fail unless \fI-k, --insecure\fP is used. See this online resource for further details: \fBhttp://curl.haxx.se/docs/sslcerts.html\fP .IP "-K, --config <config file>" Specify which config file to read curl arguments from. The config file is a text file in which command line arguments can be written which then will be used as if they were written on the actual command line. Options and their parameters must be specified on the same config file line, separated by whitespace, colon, or the equals sign. Long option names can optionally be given in the config file without the initial double dashes and if so, the colon or equals characters can be used as separators. If the option is specified with one or two dashes, there can be no colon or equals character between the option and its parameter. If the parameter is to contain whitespace, the parameter must be enclosed within quotes. Within double quotes, the following escape sequences are available: \\\\, \\", \\t, \\n, \\r and \\v. A backslash preceding any other letter is ignored. If the first column of a config line is a '#' character, the rest of the line will be treated as a comment. Only write one option per physical line in the config file. Specify the filename to -K, --config as '-' to make curl read the file from stdin. Note that to be able to specify a URL in the config file, you need to specify it using the \fI--url\fP option, and not by simply writing the URL on its own line. So, it could look similar to this: url = "http://curl.haxx.se/docs/" When curl is invoked, it always (unless \fI-q\fP is used) checks for a default config file and uses it if found. The default config file is checked for in the following places in this order: 1) curl tries to find the "home dir": It first checks for the CURL_HOME and then the HOME environment variables. Failing that, it uses getpwuid() on UNIX-like systems (which returns the home dir given the current user in your system). On Windows, it then checks for the APPDATA variable, or as a last resort the '%USERPROFILE%\\Application Data'. 2) On windows, if there is no _curlrc file in the home dir, it checks for one in the same dir the curl executable is placed. On UNIX-like systems, it will simply try to load .curlrc from the determined home dir. .nf # --- Example file --- # this is a comment url = "curl.haxx.se" output = "curlhere.html" user-agent = "superagent/1.0" # and fetch another URL too url = "curl.haxx.se/docs/manpage.html" -O referer = "http://nowhereatall.com/" # --- End of example file --- .fi This option can be used multiple times to load multiple config files. .IP "--keepalive-time <seconds>" This option sets the time a connection needs to remain idle before sending keepalive probes and the time between individual keepalive probes. It is currently effective on operating systems offering the TCP_KEEPIDLE and TCP_KEEPINTVL socket options (meaning Linux, recent AIX, HP-UX and more). This option has no effect if \fI--no-keepalive\fP is used. (Added in 7.18.0) If this option is used several times, the last one will be used. If unspecified, the option defaults to 60 seconds. .IP "--key <key>" (SSL/SSH) Private key file name. Allows you to provide your private key in this separate file. If this option is used several times, the last one will be used. .IP "--key-type <type>" (SSL) Private key file type. Specify which type your \fI--key\fP provided private key is. DER, PEM, and ENG are supported. If not specified, PEM is assumed. If this option is used several times, the last one will be used. .IP "--krb <level>" (FTP) Enable Kerberos authentication and use. The level must be entered and should be one of 'clear', 'safe', 'confidential', or 'private'. Should you use a level that is not one of these, 'private' will instead be used. This option requires a library built with kerberos4 or GSSAPI (GSS-Negotiate) support. This is not very common. Use \fI-V, --version\fP to see if your curl supports it. If this option is used several times, the last one will be used. .IP "-l, --list-only" (FTP) When listing an FTP directory, this switch forces a name-only view. This is especially useful if the user wants to machine-parse the contents of an FTP directory since the normal directory view doesn't use a standard look or format. When used like this, the option causes a NLST command to be sent to the server instead of LIST. Note: Some FTP servers list only files in their response to NLST; they do not include sub-directories and symbolic links. (POP3) When retrieving a specific email from POP3, this switch forces a LIST command to be performed instead of RETR. This is particularly useful if the user wants to see if a specific message id exists on the server and what size it is. Note: When combined with \fI-X, --request <command>\fP, this option can be used to send an UIDL command instead, so the user may use the email's unique identifier rather than it's message id to make the request. (Added in 7.21.5) .IP "-L, --location" (HTTP/HTTPS) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request on the new place. If used together with \fI-i, --include\fP or \fI-I, --head\fP, headers from all requested pages will be shown. When authentication is used, curl only sends its credentials to the initial host. If a redirect takes curl to a different host, it won't be able to intercept the user+password. See also \fI--location-trusted\fP on how to change this. You can limit the amount of redirects to follow by using the \fI--max-redirs\fP option. When curl follows a redirect and the request is not a plain GET (for example POST or PUT), it will do the following request with a GET if the HTTP response was 301, 302, or 303. If the response code was any other 3xx code, curl will re-send the following request using the same unmodified method. .IP "--libcurl <file>" Append this option to any ordinary curl command line, and you will get a libcurl-using C source code written to the file that does the equivalent of what your command-line operation does! If this option is used several times, the last given file name will be used. (Added in 7.16.1) .IP "--limit-rate <speed>" Specify the maximum transfer rate you want curl to use. This feature is useful if you have a limited pipe and you'd like your transfer not to use your entire bandwidth. The given speed is measured in bytes/second, unless a suffix is appended. Appending 'k' or 'K' will count the number as kilobytes, 'm' or M' makes it megabytes, while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and 1G. The given rate is the average speed counted during the entire transfer. It means that curl might use higher transfer speeds in short bursts, but over time it uses no more than the given rate. If you also use the \fI-Y, --speed-limit\fP option, that option will take precedence and might cripple the rate-limiting slightly, to help keeping the speed-limit logic working. If this option is used several times, the last one will be used. .IP "--local-port <num>[-num]" Set a preferred number or range of local port numbers to use for the connection(s). Note that port numbers by nature are a scarce resource that will be busy at times so setting this range to something too narrow might cause unnecessary connection setup failures. (Added in 7.15.2) .IP "--location-trusted" (HTTP/HTTPS) Like \fI-L, --location\fP, but will allow sending the name + password to all hosts that the site may redirect to. This may or may not introduce a security breach if the site redirects you to a site to which you'll send your authentication info (which is plaintext in the case of HTTP Basic authentication). .IP "-m, --max-time <seconds>" Maximum time in seconds that you allow the whole operation to take. This is useful for preventing your batch jobs from hanging for hours due to slow networks or links going down. Since 7.32.0, this option accepts decimal values, but the actual timeout will decrease in accuracy as the specified timeout increases in decimal precision. See also the \fI--connect-timeout\fP option. If this option is used several times, the last one will be used. .IP "--mail-auth <address>" (SMTP) Specify a single address. This will be used to specify the authentication address (identity) of a submitted message that is being relayed to another server. (Added in 7.25.0) .IP "--mail-from <address>" (SMTP) Specify a single address that the given mail should get sent from. (Added in 7.20.0) .IP "--max-filesize <bytes>" Specify the maximum size (in bytes) of a file to download. If the file requested is larger than this value, the transfer will not start and curl will return with exit code 63. \fBNOTE:\fP The file size is not always known prior to download, and for such files this option has no effect even if the file transfer ends up being larger than this given limit. This concerns both FTP and HTTP transfers. .IP "--mail-rcpt <address>" (SMTP) Specify a single address, user name or mailing list name. When performing a mail transfer, the recipient should specify a valid email address to send the mail to. (Added in 7.20.0) When performing an address verification (VRFY command), the recipient should be specified as the user name or user name and domain (as per Section 3.5 of RFC5321). (Added in 7.34.0) When performing a mailing list expand (EXPN command), the recipient should be specified using the mailing list name, such as "Friends" or "London-Office". (Added in 7.34.0) .IP "--max-redirs <num>" Set maximum number of redirection-followings allowed. If \fI-L, --location\fP is used, this option can be used to prevent curl from following redirections \&"in absurdum". By default, the limit is set to 50 redirections. Set this option to -1 to make it limitless. If this option is used several times, the last one will be used. .IP "--metalink" This option can tell curl to parse and process a given URI as Metalink file (both version 3 and 4 (RFC 5854) are supported) and make use of the mirrors listed within for failover if there are errors (such as the file or server not being available). It will also verify the hash of the file after the download completes. The Metalink file itself is downloaded and processed in memory and not stored in the local file system. Example to use a remote Metalink file: \fBcurl\fP --metalink http://www.example.com/example.metalink To use a Metalink file in the local file system, use FILE protocol (file://): \fBcurl\fP --metalink file://example.metalink Please note that if FILE protocol is disabled, there is no way to use a local Metalink file at the time of this writing. Also note that if \fI--metalink\fP and \fI--include\fP are used together, \fI--include\fP will be ignored. This is because including headers in the response will break Metalink parser and if the headers are included in the file described in Metalink file, hash check will fail. (Added in 7.27.0, if built against the libmetalink library.) .IP "-n, --netrc" Makes curl scan the \fI.netrc\fP (\fI_netrc\fP on Windows) file in the user's home directory for login name and password. This is typically used for FTP on UNIX. If used with HTTP, curl will enable user authentication. See .BR netrc(4) or .BR ftp(1) for details on the file format. Curl will not complain if that file doesn't have the right permissions (it should not be either world- or group-readable). The environment variable "HOME" is used to find the home directory. A quick and very simple example of how to setup a \fI.netrc\fP to allow curl to FTP to the machine host.domain.com with user name \&'myself' and password \&'secret' should look similar to: .B "machine host.domain.com login myself password secret" .IP "-N, --no-buffer" Disables the buffering of the output stream. In normal work situations, curl will use a standard buffered output stream that will have the effect that it will output the data in chunks, not necessarily exactly when the data arrives. Using this option will disable that buffering. Note that this is the negated option name documented. You can thus use \fI--buffer\fP to enforce the buffering. .IP "--netrc-file" This option is similar to \fI--netrc\fP, except that you provide the path (absolute or relative) to the netrc file that Curl should use. You can only specify one netrc file per invocation. If several \fI--netrc-file\fP options are provided, only the \fBlast one\fP will be used. (Added in 7.21.5) This option overrides any use of \fI--netrc\fP as they are mutually exclusive. It will also abide by \fI--netrc-optional\fP if specified. .IP "--netrc-optional" Very similar to \fI--netrc\fP, but this option makes the .netrc usage \fBoptional\fP and not mandatory as the \fI--netrc\fP option does. .IP "--negotiate" (HTTP) Enables GSS-Negotiate authentication. The GSS-Negotiate method was designed by Microsoft and is used in their web applications. It is primarily meant as a support for Kerberos5 authentication but may be also used along with another authentication method. For more information see IETF draft draft-brezak-spnego-http-04.txt. If you want to enable Negotiate for your proxy authentication, then use \fI--proxy-negotiate\fP. This option requires a library built with GSSAPI support. This is not very common. Use \fI-V, --version\fP to see if your version supports GSS-Negotiate. When using this option, you must also provide a fake \fI-u, --user\fP option to activate the authentication code properly. Sending a '-u :' is enough as the user name and password from the \fI-u\fP option aren't actually used. If this option is used several times, only the first one is used. .IP "--no-keepalive" Disables the use of keepalive messages on the TCP connection, as by default curl enables them. Note that this is the negated option name documented. You can thus use \fI--keepalive\fP to enforce keepalive. .IP "--no-sessionid" (SSL) Disable curl's use of SSL session-ID caching. By default all transfers are done using the cache. Note that while nothing should ever get hurt by attempting to reuse SSL session-IDs, there seem to be broken SSL implementations in the wild that may require you to disable this in order for you to succeed. (Added in 7.16.0) Note that this is the negated option name documented. You can thus use \fI--sessionid\fP to enforce session-ID caching. .IP "--noproxy <no-proxy-list>" Comma-separated list of hosts which do not use a proxy, if one is specified. The only wildcard is a single * character, which matches all hosts, and effectively disables the proxy. Each name in this list is matched as either a domain which contains the hostname, or the hostname itself. For example, local.com would match local.com, local.com:80, and www.local.com, but not www.notlocal.com. (Added in 7.19.4). .IP "--ntlm" (HTTP) Enables NTLM authentication. The NTLM authentication method was designed by Microsoft and is used by IIS web servers. It is a proprietary protocol, reverse-engineered by clever people and implemented in curl based on their efforts. This kind of behavior should not be endorsed, you should encourage everyone who uses NTLM to switch to a public and documented authentication method instead, such as Digest. If you want to enable NTLM for your proxy authentication, then use \fI--proxy-ntlm\fP. This option requires a library built with SSL support. Use \fI-V, --version\fP to see if your curl supports NTLM. If this option is used several times, only the first one is used. .IP "-o, --output <file>" Write output to <file> instead of stdout. If you are using {} or [] to fetch multiple documents, you can use '#' followed by a number in the <file> specifier. That variable will be replaced with the current string for the URL being fetched. Like in: curl http://{one,two}.site.com -o "file_#1.txt" or use several variables like: curl http://{site,host}.host[1-5].com -o "#1_#2" You may use this option as many times as the number of URLs you have. See also the \fI--create-dirs\fP option to create the local directories dynamically. Specifying the output as '-' (a single dash) will force the output to be done to stdout. .IP "-O, --remote-name" Write output to a local file named like the remote file we get. (Only the file part of the remote file is used, the path is cut off.) The remote file name to use for saving is extracted from the given URL, nothing else. Consequentially, the file will be saved in the current working directory. If you want the file saved in a different directory, make sure you change current working directory before you invoke curl with the \fB-O, --remote-name\fP flag! There is no URL decoding done on the file name. If it has %20 or other URL encoded parts of the name, they will end up as-is as file name. You may use this option as many times as the number of URLs you have. .IP "--oauth2-bearer" (IMAP, POP3, SMTP) Specify the Bearer Token for OAUTH 2.0 server authentication. The Bearer Token is used in conjunction with the user name which can be specified as part of the \fI--url\fP or \fI-u, --user\fP options. The Bearer Token and user name are formatted according to RFC 6750. If this option is used several times, the last one will be used. .IP "-p, --proxytunnel" When an HTTP proxy is used (\fI-x, --proxy\fP), this option will cause non-HTTP protocols to attempt to tunnel through the proxy instead of merely using it to do HTTP-like operations. The tunnel approach is made with the HTTP proxy CONNECT request and requires that the proxy allows direct connect to the remote port number curl wants to tunnel through to. .IP "-P, --ftp-port <address>" (FTP) Reverses the default initiator/listener roles when connecting with FTP. This switch makes curl use active mode. In practice, curl then tells the server to connect back to the client's specified address and port, while passive mode asks the server to setup an IP address and port for it to connect to. <address> should be one of: .RS .IP interface i.e "eth0" to specify which interface's IP address you want to use (Unix only) .IP "IP address" i.e "192.168.10.1" to specify the exact IP address .IP "host name" i.e "my.host.domain" to specify the machine .IP "-" make curl pick the same IP address that is already used for the control connection .RE If this option is used several times, the last one will be used. Disable the use of PORT with \fI--ftp-pasv\fP. Disable the attempt to use the EPRT command instead of PORT by using \fI--disable-eprt\fP. EPRT is really PORT++. Starting in 7.19.5, you can append \&":[start]-[end]\&" to the right of the address, to tell curl what TCP port range to use. That means you specify a port range, from a lower to a higher number. A single number works as well, but do note that it increases the risk of failure since the port may not be available. .IP "--pass <phrase>" (SSL/SSH) Passphrase for the private key If this option is used several times, the last one will be used. .IP "--post301" (HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests into GET requests when following a 301 redirection. The non-RFC behaviour is ubiquitous in web browsers, so curl does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when using \fI-L, --location\fP (Added in 7.17.1) .IP "--post302" (HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests into GET requests when following a 302 redirection. The non-RFC behaviour is ubiquitous in web browsers, so curl does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when using \fI-L, --location\fP (Added in 7.19.1) .IP "--post303" (HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests into GET requests when following a 303 redirection. The non-RFC behaviour is ubiquitous in web browsers, so curl does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when using \fI-L, --location\fP (Added in 7.26.0) .IP "--proto <protocols>" Tells curl to use the listed protocols for its initial retrieval. Protocols are evaluated left to right, are comma separated, and are each a protocol name or 'all', optionally prefixed by zero or more modifiers. Available modifiers are: .RS .TP 3 .B + Permit this protocol in addition to protocols already permitted (this is the default if no modifier is used). .TP .B - Deny this protocol, removing it from the list of protocols already permitted. .TP .B = Permit only this protocol (ignoring the list already permitted), though subject to later modification by subsequent entries in the comma separated list. .RE .IP For example: .RS .TP 15 .B --proto -ftps uses the default protocols, but disables ftps .TP .B --proto -all,https,+http only enables http and https .TP .B --proto =http,https also only enables http and https .RE .IP Unknown protocols produce a warning. This allows scripts to safely rely on being able to disable potentially dangerous protocols, without relying upon support for that protocol being built into curl to avoid an error. This option can be used multiple times, in which case the effect is the same as concatenating the protocols into one instance of the option. (Added in 7.20.2) .IP "--proto-redir <protocols>" Tells curl to use the listed protocols after a redirect. See --proto for how protocols are represented. (Added in 7.20.2) .IP "--proxy-anyauth" Tells curl to pick a suitable authentication method when communicating with the given proxy. This might cause an extra request/response round-trip. (Added in 7.13.2) .IP "--proxy-basic" Tells curl to use HTTP Basic authentication when communicating with the given proxy. Use \fI--basic\fP for enabling HTTP Basic with a remote host. Basic is the default authentication method curl uses with proxies. .IP "--proxy-digest" Tells curl to use HTTP Digest authentication when communicating with the given proxy. Use \fI--digest\fP for enabling HTTP Digest with a remote host. .IP "--proxy-negotiate" Tells curl to use HTTP Negotiate authentication when communicating with the given proxy. Use \fI--negotiate\fP for enabling HTTP Negotiate with a remote host. (Added in 7.17.1) .IP "--proxy-ntlm" Tells curl to use HTTP NTLM authentication when communicating with the given proxy. Use \fI--ntlm\fP for enabling NTLM with a remote host. .IP "--proxy1.0 <proxyhost[:port]>" Use the specified HTTP 1.0 proxy. If the port number is not specified, it is assumed at port 1080. The only difference between this and the HTTP proxy option (\fI-x, --proxy\fP), is that attempts to use CONNECT through the proxy will specify an HTTP 1.0 protocol instead of the default HTTP 1.1. .IP "--pubkey <key>" (SSH) Public key file name. Allows you to provide your public key in this separate file. If this option is used several times, the last one will be used. .IP "-q" If used as the first parameter on the command line, the \fIcurlrc\fP config file will not be read and used. See the \fI-K, --config\fP for details on the default config file search path. .IP "-Q, --quote <command>" (FTP/SFTP) Send an arbitrary command to the remote FTP or SFTP server. Quote commands are sent BEFORE the transfer takes place (just after the initial PWD command in an FTP transfer, to be exact). To make commands take place after a successful transfer, prefix them with a dash '-'. To make commands be sent after curl has changed the working directory, just before the transfer command(s), prefix the command with a '+' (this is only supported for FTP). You may specify any number of commands. If the server returns failure for one of the commands, the entire operation will be aborted. You must send syntactically correct FTP commands as RFC 959 defines to FTP servers, or one of the commands listed below to SFTP servers. This option can be used multiple times. When speaking to an FTP server, prefix the command with an asterisk (*) to make curl continue even if the command fails as by default curl will stop at first failure. SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands itself before sending them to the server. File names may be quoted shell-style to embed spaces or special characters. Following is the list of all supported SFTP quote commands: .RS .IP "chgrp group file" The chgrp command sets the group ID of the file named by the file operand to the group ID specified by the group operand. The group operand is a decimal integer group ID. .IP "chmod mode file" The chmod command modifies the file mode bits of the specified file. The mode operand is an octal integer mode number. .IP "chown user file" The chown command sets the owner of the file named by the file operand to the user ID specified by the user operand. The user operand is a decimal integer user ID. .IP "ln source_file target_file" The ln and symlink commands create a symbolic link at the target_file location pointing to the source_file location. .IP "mkdir directory_name" The mkdir command creates the directory named by the directory_name operand. .IP "pwd" The pwd command returns the absolute pathname of the current working directory. .IP "rename source target" The rename command renames the file or directory named by the source operand to the destination path named by the target operand. .IP "rm file" The rm command removes the file specified by the file operand. .IP "rmdir directory" The rmdir command removes the directory entry specified by the directory operand, provided it is empty. .IP "symlink source_file target_file" See ln. .RE .IP "-r, --range <range>" (HTTP/FTP/SFTP/FILE) Retrieve a byte range (i.e a partial document) from a HTTP/1.1, FTP or SFTP server or a local FILE. Ranges can be specified in a number of ways. .RS .TP 10 .B 0-499 specifies the first 500 bytes .TP .B 500-999 specifies the second 500 bytes .TP .B -500 specifies the last 500 bytes .TP .B 9500- specifies the bytes from offset 9500 and forward .TP .B 0-0,-1 specifies the first and last byte only(*)(H) .TP .B 500-700,600-799 specifies 300 bytes from offset 500(H) .TP .B 100-199,500-599 specifies two separate 100-byte ranges(*)(H) .RE (*) = NOTE that this will cause the server to reply with a multipart response! Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the \&'start-stop' range syntax. If a non-digit character is given in the range, the server's response will be unspecified, depending on the server's configuration. You should also be aware that many HTTP/1.1 servers do not have this feature enabled, so that when you attempt to get a range, you'll instead get the whole document. FTP and SFTP range downloads only support the simple 'start-stop' syntax (optionally with one of the numbers omitted). FTP use depends on the extended FTP command SIZE. If this option is used several times, the last one will be used. .IP "-R, --remote-time" When used, this will make curl attempt to figure out the timestamp of the remote file, and if that is available make the local file get that same timestamp. .IP "--random-file <file>" (SSL) Specify the path name to file containing what will be considered as random data. The data is used to seed the random engine for SSL connections. See also the \fI--egd-file\fP option. .IP "--raw" (HTTP) When used, it disables all internal HTTP decoding of content or transfer encodings and instead makes them passed on unaltered, raw. (Added in 7.16.2) .IP "--remote-name-all" This option changes the default action for all given URLs to be dealt with as if \fI-O, --remote-name\fP were used for each one. So if you want to disable that for a specific URL after \fI--remote-name-all\fP has been used, you must use "-o -" or \fI--no-remote-name\fP. (Added in 7.19.0) .IP "--resolve <host:port:address>" Provide a custom address for a specific host and port pair. Using this, you can make the curl requests(s) use a specified address and prevent the otherwise normally resolved address to be used. Consider it a sort of /etc/hosts alternative provided on the command line. The port number should be the number used for the specific protocol the host will be used for. It means you need several entries if you want to provide address for the same host but different ports. This option can be used many times to add many host names to resolve. (Added in 7.21.3) .IP "--retry <num>" If a transient error is returned when curl tries to perform a transfer, it will retry this number of times before giving up. Setting the number to 0 makes curl do no retries (which is the default). Transient error means either: a timeout, an FTP 4xx response code or an HTTP 5xx response code. When curl is about to retry a transfer, it will first wait one second and then for all forthcoming retries it will double the waiting time until it reaches 10 minutes which then will be the delay between the rest of the retries. By using \fI--retry-delay\fP you disable this exponential backoff algorithm. See also \fI--retry-max-time\fP to limit the total time allowed for retries. (Added in 7.12.3) If this option is used several times, the last one will be used. .IP "--retry-delay <seconds>" Make curl sleep this amount of time before each retry when a transfer has failed with a transient error (it changes the default backoff time algorithm between retries). This option is only interesting if \fI--retry\fP is also used. Setting this delay to zero will make curl use the default backoff time. (Added in 7.12.3) If this option is used several times, the last one will be used. .IP "--retry-max-time <seconds>" The retry timer is reset before the first transfer attempt. Retries will be done as usual (see \fI--retry\fP) as long as the timer hasn't reached this given limit. Notice that if the timer hasn't reached the limit, the request will be made and while performing, it may take longer than this given time period. To limit a single request\'s maximum time, use \fI-m, --max-time\fP. Set this option to zero to not timeout retries. (Added in 7.12.3) If this option is used several times, the last one will be used. .IP "-s, --silent" Silent or quiet mode. Don't show progress meter or error messages. Makes Curl mute. It will still output the data you ask for, potentially even to the terminal/stdout unless you redirect it. .IP "--sasl-ir" Enable initial response in SASL authentication. (Added in 7.31.0) .IP "-S, --show-error" When used with \fI-s\fP it makes curl show an error message if it fails. .IP "--ssl" (FTP, POP3, IMAP, SMTP) Try to use SSL/TLS for the connection. Reverts to a non-secure connection if the server doesn't support SSL/TLS. See also \fI--ftp-ssl-control\fP and \fI--ssl-reqd\fP for different levels of encryption required. (Added in 7.20.0) This option was formerly known as \fI--ftp-ssl\fP (Added in 7.11.0). That option name can still be used but will be removed in a future version. .IP "--ssl-reqd" (FTP, POP3, IMAP, SMTP) Require SSL/TLS for the connection. Terminates the connection if the server doesn't support SSL/TLS. (Added in 7.20.0) This option was formerly known as \fI--ftp-ssl-reqd\fP (added in 7.15.5). That option name can still be used but will be removed in a future version. .IP "--ssl-allow-beast" (SSL) This option tells curl to not work around a security flaw in the SSL3 and TLS1.0 protocols known as BEAST. If this option isn't used, the SSL layer may use work-arounds known to cause interoperability problems with some older SSL implementations. WARNING: this option loosens the SSL security, and by using this flag you ask for exactly that. (Added in 7.25.0) .IP "--socks4 <host[:port]>" Use the specified SOCKS4 proxy. If the port number is not specified, it is assumed at port 1080. (Added in 7.15.2) This option overrides any previous use of \fI-x, --proxy\fP, as they are mutually exclusive. Since 7.21.7, this option is superfluous since you can specify a socks4 proxy with \fI-x, --proxy\fP using a socks4:// protocol prefix. If this option is used several times, the last one will be used. .IP "--socks4a <host[:port]>" Use the specified SOCKS4a proxy. If the port number is not specified, it is assumed at port 1080. (Added in 7.18.0) This option overrides any previous use of \fI-x, --proxy\fP, as they are mutually exclusive. Since 7.21.7, this option is superfluous since you can specify a socks4a proxy with \fI-x, --proxy\fP using a socks4a:// protocol prefix. If this option is used several times, the last one will be used. .IP "--socks5-hostname <host[:port]>" Use the specified SOCKS5 proxy (and let the proxy resolve the host name). If the port number is not specified, it is assumed at port 1080. (Added in 7.18.0) This option overrides any previous use of \fI-x, --proxy\fP, as they are mutually exclusive. Since 7.21.7, this option is superfluous since you can specify a socks5 hostname proxy with \fI-x, --proxy\fP using a socks5h:// protocol prefix. If this option is used several times, the last one will be used. (This option was previously wrongly documented and used as --socks without the number appended.) .IP "--socks5 <host[:port]>" Use the specified SOCKS5 proxy - but resolve the host name locally. If the port number is not specified, it is assumed at port 1080. This option overrides any previous use of \fI-x, --proxy\fP, as they are mutually exclusive. Since 7.21.7, this option is superfluous since you can specify a socks5 proxy with \fI-x, --proxy\fP using a socks5:// protocol prefix. If this option is used several times, the last one will be used. (This option was previously wrongly documented and used as --socks without the number appended.) This option (as well as \fI--socks4\fP) does not work with IPV6, FTPS or LDAP. .IP "--socks5-gssapi-service <servicename>" The default service name for a socks server is rcmd/server-fqdn. This option allows you to change it. Examples: --socks5 proxy-name \fI--socks5-gssapi-service\fP sockd would use sockd/proxy-name --socks5 proxy-name \fI--socks5-gssapi-service\fP sockd/real-name would use sockd/real-name for cases where the proxy-name does not match the principal name. (Added in 7.19.4). .IP "--socks5-gssapi-nec" As part of the gssapi negotiation a protection mode is negotiated. RFC 1961 says in section 4.3/4.4 it should be protected, but the NEC reference implementation does not. The option \fI--socks5-gssapi-nec\fP allows the unprotected exchange of the protection mode negotiation. (Added in 7.19.4). .IP "--stderr <file>" Redirect all writes to stderr to the specified file instead. If the file name is a plain '-', it is instead written to stdout. If this option is used several times, the last one will be used. .IP "-t, --telnet-option <OPT=val>" Pass options to the telnet protocol. Supported options are: TTYPE=<term> Sets the terminal type. XDISPLOC=<X display> Sets the X display location. NEW_ENV=<var,val> Sets an environment variable. .IP "-T, --upload-file <file>" This transfers the specified local file to the remote URL. If there is no file part in the specified URL, Curl will append the local file name. NOTE that you must use a trailing / on the last directory to really prove to Curl that there is no file name or curl will think that your last directory name is the remote file name to use. That will most likely cause the upload operation to fail. If this is used on an HTTP(S) server, the PUT command will be used. Use the file name "-" (a single dash) to use stdin instead of a given file. Alternately, the file name "." (a single period) may be specified instead of "-" to use stdin in non-blocking mode to allow reading server output while stdin is being uploaded. You can specify one -T for each URL on the command line. Each -T + URL pair specifies what to upload and to where. curl also supports "globbing" of the -T argument, meaning that you can upload multiple files to a single URL by using the same URL globbing style supported in the URL, like this: curl -T "{file1,file2}" http://www.uploadtothissite.com or even curl -T "img[1-1000].png" ftp://ftp.picturemania.com/upload/ .IP "--tcp-nodelay" Turn on the TCP_NODELAY option. See the \fIcurl_easy_setopt(3)\fP man page for details about this option. (Added in 7.11.2) .IP "--tftp-blksize <value>" (TFTP) Set TFTP BLKSIZE option (must be >512). This is the block size that curl will try to use when transferring data to or from a TFTP server. By default 512 bytes will be used. If this option is used several times, the last one will be used. (Added in 7.20.0) .IP "--tlsauthtype <authtype>" Set TLS authentication type. Currently, the only supported option is "SRP", for TLS-SRP (RFC 5054). If \fI--tlsuser\fP and \fI--tlspassword\fP are specified but \fI--tlsauthtype\fP is not, then this option defaults to "SRP". (Added in 7.21.4) .IP "--tlspassword <password>" Set password for use with the TLS authentication method specified with \fI--tlsauthtype\fP. Requires that \fI--tlsuser\fP also be set. (Added in 7.21.4) .IP "--tlsuser <user>" Set username for use with the TLS authentication method specified with \fI--tlsauthtype\fP. Requires that \fI--tlspassword\fP also be set. (Added in 7.21.4) .IP "--tlsv1.0" (SSL) Forces curl to use TLS version 1.0 when negotiating with a remote TLS server. (Added in 7.34.0) .IP "--tlsv1.1" (SSL) Forces curl to use TLS version 1.1 when negotiating with a remote TLS server. (Added in 7.34.0) .IP "--tlsv1.2" (SSL) Forces curl to use TLS version 1.2 when negotiating with a remote TLS server. (Added in 7.34.0) .IP "--tr-encoding" (HTTP) Request a compressed Transfer-Encoding response using one of the algorithms curl supports, and uncompress the data while receiving it. (Added in 7.21.6) .IP "--trace <file>" Enables a full trace dump of all incoming and outgoing data, including descriptive information, to the given output file. Use "-" as filename to have the output sent to stdout. This option overrides previous uses of \fI-v, --verbose\fP or \fI--trace-ascii\fP. If this option is used several times, the last one will be used. .IP "--trace-ascii <file>" Enables a full trace dump of all incoming and outgoing data, including descriptive information, to the given output file. Use "-" as filename to have the output sent to stdout. This is very similar to \fI--trace\fP, but leaves out the hex part and only shows the ASCII part of the dump. It makes smaller output that might be easier to read for untrained humans. This option overrides previous uses of \fI-v, --verbose\fP or \fI--trace\fP. If this option is used several times, the last one will be used. .IP "--trace-time" Prepends a time stamp to each trace or verbose line that curl displays. (Added in 7.14.0) .IP "-u, --user <user:password;options>" Specify the user name, password and optional login options to use for server authentication. Overrides \fI-n, --netrc\fP and \fI--netrc-optional\fP. If you simply specify the user name, with or without the login options, curl will prompt for a password. If you use an SSPI-enabled curl binary and perform NTLM authentication, you can force curl to select the user name and password from your environment by simply specifying a single colon with this option: "-u :" or by specfying the login options on their own, for example "-u ;auth=NTLM". You can use the optional login options part to specify protocol specific options that may be used during authentication. At present only IMAP, POP3 and SMTP support login options as part of the user login information. For more information about the login options please see RFC 2384, RFC 5092 and IETF draft draft-earhart-url-smtp-00.txt (Added in 7.31.0). If this option is used several times, the last one will be used. .IP "-U, --proxy-user <user:password>" Specify the user name and password to use for proxy authentication. If you use an SSPI-enabled curl binary and do NTLM authentication, you can force curl to pick up the user name and password from your environment by simply specifying a single colon with this option: "-U :". If this option is used several times, the last one will be used. .IP "--url <URL>" Specify a URL to fetch. This option is mostly handy when you want to specify URL(s) in a config file. This option may be used any number of times. To control where this URL is written, use the \fI-o, --output\fP or the \fI-O, --remote-name\fP options. .IP "-v, --verbose" Makes the fetching more verbose/talkative. Mostly useful for debugging. A line starting with '>' means "header data" sent by curl, '<' means "header data" received by curl that is hidden in normal cases, and a line starting with '*' means additional info provided by curl. Note that if you only want HTTP headers in the output, \fI-i, --include\fP might be the option you're looking for. If you think this option still doesn't give you enough details, consider using \fI--trace\fP or \fI--trace-ascii\fP instead. This option overrides previous uses of \fI--trace-ascii\fP or \fI--trace\fP. Use \fI-s, --silent\fP to make curl quiet. .IP "-w, --write-out <format>" Defines what to display on stdout after a completed and successful operation. The format is a string that may contain plain text mixed with any number of variables. The string can be specified as "string", to get read from a particular file you specify it "@filename" and to tell curl to read the format from stdin you write "@-". The variables present in the output format will be substituted by the value or text that curl thinks fit, as described below. All variables are specified as %{variable_name} and to output a normal % you just write them as %%. You can output a newline by using \\n, a carriage return with \\r and a tab space with \\t. .B NOTE: The %-symbol is a special symbol in the win32-environment, where all occurrences of % must be doubled when using this option. The variables available are: .RS .TP 15 .B content_type The Content-Type of the requested document, if there was any. .TP .B filename_effective The ultimate filename that curl writes out to. This is only meaningful if curl is told to write to a file with the \fI--remote-name\fP or \fI--output\fP option. It's most useful in combination with the \fI--remote-header-name\fP option. (Added in 7.25.1) .TP .B ftp_entry_path The initial path curl ended up in when logging on to the remote FTP server. (Added in 7.15.4) .TP .B http_code The numerical response code that was found in the last retrieved HTTP(S) or FTP(s) transfer. In 7.18.2 the alias \fBresponse_code\fP was added to show the same info. .TP .B http_connect The numerical code that was found in the last response (from a proxy) to a curl CONNECT request. (Added in 7.12.4) .TP .B local_ip The IP address of the local end of the most recently done connection - can be either IPv4 or IPv6 (Added in 7.29.0) .TP .B local_port The local port number of the most recently done connection (Added in 7.29.0) .TP .B num_connects Number of new connects made in the recent transfer. (Added in 7.12.3) .TP .B num_redirects Number of redirects that were followed in the request. (Added in 7.12.3) .TP .B redirect_url When an HTTP request was made without -L to follow redirects, this variable will show the actual URL a redirect \fIwould\fP take you to. (Added in 7.18.2) .TP .B remote_ip The remote IP address of the most recently done connection - can be either IPv4 or IPv6 (Added in 7.29.0) .TP .B remote_port The remote port number of the most recently done connection (Added in 7.29.0) .TP .B size_download The total amount of bytes that were downloaded. .TP .B size_header The total amount of bytes of the downloaded headers. .TP .B size_request The total amount of bytes that were sent in the HTTP request. .TP .B size_upload The total amount of bytes that were uploaded. .TP .B speed_download The average download speed that curl measured for the complete download. Bytes per second. .TP .B speed_upload The average upload speed that curl measured for the complete upload. Bytes per second. .TP .B ssl_verify_result The result of the SSL peer certificate verification that was requested. 0 means the verification was successful. (Added in 7.19.0) .TP .B time_appconnect The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed. (Added in 7.19.0) .TP .B time_connect The time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed. .TP .B time_namelookup The time, in seconds, it took from the start until the name resolving was completed. .TP .B time_pretransfer The time, in seconds, it took from the start until the file transfer was just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. .TP .B time_redirect The time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before the final transaction was started. time_redirect shows the complete execution time for multiple redirections. (Added in 7.12.3) .TP .B time_starttransfer The time, in seconds, it took from the start until the first byte was just about to be transferred. This includes time_pretransfer and also the time the server needed to calculate the result. .TP .B time_total The total time, in seconds, that the full operation lasted. The time will be displayed with millisecond resolution. .TP .B url_effective The URL that was fetched last. This is most meaningful if you've told curl to follow location: headers. .RE If this option is used several times, the last one will be used. .IP "-x, --proxy <[protocol://][user:password@]proxyhost[:port]>" Use the specified proxy. The proxy string can be specified with a protocol:// prefix to specify alternative proxy protocols. Use socks4://, socks4a://, socks5:// or socks5h:// to request the specific SOCKS version to be used. No protocol specified, http:// and all others will be treated as HTTP proxies. (The protocol support was added in curl 7.21.7) If the port number is not specified in the proxy string, it is assumed to be 1080. This option overrides existing environment variables that set the proxy to use. If there's an environment variable setting a proxy, you can set proxy to \&"" to override it. All operations that are performed over an HTTP proxy will transparently be converted to HTTP. It means that certain protocol specific operations might not be available. This is not the case if you can tunnel through the proxy, as one with the \fI-p, --proxytunnel\fP option. User and password that might be provided in the proxy string are URL decoded by curl. This allows you to pass in special characters such as @ by using %40 or pass in a colon with %3a. The proxy host can be specified the exact same way as the proxy environment variables, including the protocol prefix (http://) and the embedded user + password. If this option is used several times, the last one will be used. .IP "-X, --request <command>" (HTTP) Specifies a custom request method to use when communicating with the HTTP server. The specified request will be used instead of the method otherwise used (which defaults to GET). Read the HTTP 1.1 specification for details and explanations. Common additional HTTP requests include PUT and DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and more. Normally you don't need this option. All sorts of GET, HEAD, POST and PUT requests are rather invoked by using dedicated command line options. This option only changes the actual word used in the HTTP request, it does not alter the way curl behaves. So for example if you want to make a proper HEAD request, using -X HEAD will not suffice. You need to use the \fI-I, --head\fP option. (FTP) Specifies a custom FTP command to use instead of LIST when doing file lists with FTP. (POP3) Specifies a custom POP3 command to use instead of LIST or RETR. (Added in 7.26.0) (IMAP) Specifies a custom IMAP command to use insead of LIST. (Added in 7.30.0) (SMTP) Specifies a custom SMTP command to use instead of HELP or VRFY. (Added in 7.34.0) If this option is used several times, the last one will be used. .IP "--xattr" When saving output to a file, this option tells curl to store certain file metadata in extended file attributes. Currently, the URL is stored in the xdg.origin.url attribute and, for HTTP, the content type is stored in the mime_type attribute. If the file system does not support extended attributes, a warning is issued. .IP "-y, --speed-time <time>" If a download is slower than speed-limit bytes per second during a speed-time period, the download gets aborted. If speed-time is used, the default speed-limit will be 1 unless set with \fI-Y\fP. This option controls transfers and thus will not affect slow connects etc. If this is a concern for you, try the \fI--connect-timeout\fP option. If this option is used several times, the last one will be used. .IP "-Y, --speed-limit <speed>" If a download is slower than this given speed (in bytes per second) for speed-time seconds it gets aborted. speed-time is set with \fI-y\fP and is 30 if not set. If this option is used several times, the last one will be used. .IP "-z, --time-cond <date expression>|<file>" (HTTP/FTP) Request a file that has been modified later than the given time and date, or one that has been modified before that time. The <date expression> can be all sorts of date strings or if it doesn't match any internal ones, it is taken as a filename and tries to get the modification date (mtime) from <file> instead. See the \fIcurl_getdate(3)\fP man pages for date expression details. Start the date expression with a dash (-) to make it request for a document that is older than the given date/time, default is a document that is newer than the specified date/time. If this option is used several times, the last one will be used. .IP "-h, --help" Usage help. .IP "-M, --manual" Manual. Display the huge help text. .IP "-V, --version" Displays information about curl and the libcurl version it uses. The first line includes the full version of curl, libcurl and other 3rd party libraries linked with the executable. The second line (starts with "Protocols:") shows all protocols that libcurl reports to support. The third line (starts with "Features:") shows specific features libcurl reports to offer. Available features include: .RS .IP "IPv6" You can use IPv6 with this. .IP "krb4" Krb4 for FTP is supported. .IP "SSL" HTTPS and FTPS are supported. .IP "libz" Automatic decompression of compressed files over HTTP is supported. .IP "NTLM" NTLM authentication is supported. .IP "GSS-Negotiate" Negotiate authentication and krb5 for FTP is supported. .IP "Debug" This curl uses a libcurl built with Debug. This enables more error-tracking and memory debugging etc. For curl-developers only! .IP "AsynchDNS" This curl uses asynchronous name resolves. .IP "SPNEGO" SPNEGO Negotiate authentication is supported. .IP "Largefile" This curl supports transfers of large files, files larger than 2GB. .IP "IDN" This curl supports IDN - international domain names. .IP "SSPI" SSPI is supported. If you use NTLM and set a blank user name, curl will authenticate with your current user and password. .IP "TLS-SRP" SRP (Secure Remote Password) authentication is supported for TLS. .IP "Metalink" This curl supports Metalink (both version 3 and 4 (RFC 5854)), which describes mirrors and hashes. curl will use mirrors for failover if there are errors (such as the file or server not being available). .RE .SH FILES .I ~/.curlrc .RS Default config file, see \fI-K, --config\fP for details. .SH ENVIRONMENT The environment variables can be specified in lower case or upper case. The lower case version has precedence. http_proxy is an exception as it is only available in lower case. Using an environment variable to set the proxy has the same effect as using the \fI--proxy\fP option. .IP "http_proxy [protocol://]<host>[:port]" Sets the proxy server to use for HTTP. .IP "HTTPS_PROXY [protocol://]<host>[:port]" Sets the proxy server to use for HTTPS. .IP "[url-protocol]_PROXY [protocol://]<host>[:port]" Sets the proxy server to use for [url-protocol], where the protocol is a protocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP, SMTP, LDAP etc. .IP "ALL_PROXY [protocol://]<host>[:port]" Sets the proxy server to use if no protocol-specific proxy is set. .IP "NO_PROXY <comma-separated list of hosts>" list of host names that shouldn't go through any proxy. If set to a asterisk \&'*' only, it matches all hosts. .SH "PROXY PROTOCOL PREFIXES" Since curl version 7.21.7, the proxy string may be specified with a protocol:// prefix to specify alternative proxy protocols. If no protocol is specified in the proxy string or if the string doesn't match a supported one, the proxy will be treated as an HTTP proxy. The supported proxy protocol prefixes are as follows: .IP "socks4://" Makes it the equivalent of \fI--socks4\fP .IP "socks4a://" Makes it the equivalent of \fI--socks4a\fP .IP "socks5://" Makes it the equivalent of \fI--socks5\fP .IP "socks5h://" Makes it the equivalent of \fI--socks5-hostname\fP .SH EXIT CODES There are a bunch of different error codes and their corresponding error messages that may appear during bad conditions. At the time of this writing, the exit codes are: .IP 1 Unsupported protocol. This build of curl has no support for this protocol. .IP 2 Failed to initialize. .IP 3 URL malformed. The syntax was not correct. .IP 4 A feature or option that was needed to perform the desired request was not enabled or was explicitly disabled at build-time. To make curl able to do this, you probably need another build of libcurl! .IP 5 Couldn't resolve proxy. The given proxy host could not be resolved. .IP 6 Couldn't resolve host. The given remote host was not resolved. .IP 7 Failed to connect to host. .IP 8 FTP weird server reply. The server sent data curl couldn't parse. .IP 9 FTP access denied. The server denied login or denied access to the particular resource or directory you wanted to reach. Most often you tried to change to a directory that doesn't exist on the server. .IP 11 FTP weird PASS reply. Curl couldn't parse the reply sent to the PASS request. .IP 13 FTP weird PASV reply, Curl couldn't parse the reply sent to the PASV request. .IP 14 FTP weird 227 format. Curl couldn't parse the 227-line the server sent. .IP 15 FTP can't get host. Couldn't resolve the host IP we got in the 227-line. .IP 17 FTP couldn't set binary. Couldn't change transfer method to binary. .IP 18 Partial file. Only a part of the file was transferred. .IP 19 FTP couldn't download/access the given file, the RETR (or similar) command failed. .IP 21 FTP quote error. A quote command returned error from the server. .IP 22 HTTP page not retrieved. The requested url was not found or returned another error with the HTTP error code being 400 or above. This return code only appears if \fI-f, --fail\fP is used. .IP 23 Write error. Curl couldn't write data to a local filesystem or similar. .IP 25 FTP couldn't STOR file. The server denied the STOR operation, used for FTP uploading. .IP 26 Read error. Various reading problems. .IP 27 Out of memory. A memory allocation request failed. .IP 28 Operation timeout. The specified time-out period was reached according to the conditions. .IP 30 FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT command, try doing a transfer using PASV instead! .IP 31 FTP couldn't use REST. The REST command failed. This command is used for resumed FTP transfers. .IP 33 HTTP range error. The range "command" didn't work. .IP 34 HTTP post error. Internal post-request generation error. .IP 35 SSL connect error. The SSL handshaking failed. .IP 36 FTP bad download resume. Couldn't continue an earlier aborted download. .IP 37 FILE couldn't read file. Failed to open the file. Permissions? .IP 38 LDAP cannot bind. LDAP bind operation failed. .IP 39 LDAP search failed. .IP 41 Function not found. A required LDAP function was not found. .IP 42 Aborted by callback. An application told curl to abort the operation. .IP 43 Internal error. A function was called with a bad parameter. .IP 45 Interface error. A specified outgoing interface could not be used. .IP 47 Too many redirects. When following redirects, curl hit the maximum amount. .IP 48 Unknown option specified to libcurl. This indicates that you passed a weird option to curl that was passed on to libcurl and rejected. Read up in the manual! .IP 49 Malformed telnet option. .IP 51 The peer's SSL certificate or SSH MD5 fingerprint was not OK. .IP 52 The server didn't reply anything, which here is considered an error. .IP 53 SSL crypto engine not found. .IP 54 Cannot set SSL crypto engine as default. .IP 55 Failed sending network data. .IP 56 Failure in receiving network data. .IP 58 Problem with the local certificate. .IP 59 Couldn't use specified SSL cipher. .IP 60 Peer certificate cannot be authenticated with known CA certificates. .IP 61 Unrecognized transfer encoding. .IP 62 Invalid LDAP URL. .IP 63 Maximum file size exceeded. .IP 64 Requested FTP SSL level failed. .IP 65 Sending the data requires a rewind that failed. .IP 66 Failed to initialise SSL Engine. .IP 67 The user name, password, or similar was not accepted and curl failed to log in. .IP 68 File not found on TFTP server. .IP 69 Permission problem on TFTP server. .IP 70 Out of disk space on TFTP server. .IP 71 Illegal TFTP operation. .IP 72 Unknown TFTP transfer ID. .IP 73 File already exists (TFTP). .IP 74 No such user (TFTP). .IP 75 Character conversion failed. .IP 76 Character conversion functions required. .IP 77 Problem with reading the SSL CA cert (path? access rights?). .IP 78 The resource referenced in the URL does not exist. .IP 79 An unspecified error occurred during the SSH session. .IP 80 Failed to shut down the SSL connection. .IP 82 Could not load CRL file, missing or wrong format (added in 7.19.0). .IP 83 Issuer check failed (added in 7.19.0). .IP 84 The FTP PRET command failed .IP 85 RTSP: mismatch of CSeq numbers .IP 86 RTSP: mismatch of Session Identifiers .IP 87 unable to parse FTP file list .IP 88 FTP chunk callback reported error .IP 89 No connection available, the session will be queued .IP XX More error codes will appear here in future releases. The existing ones are meant to never change. .SH AUTHORS / CONTRIBUTORS Daniel Stenberg is the main author, but the whole list of contributors is found in the separate THANKS file. .SH WWW http://curl.haxx.se .SH FTP ftp://ftp.sunet.se/pub/www/utilities/curl/ .SH "SEE ALSO" .BR ftp (1), .BR wget (1) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/FAQ��������������������������������������������������������������������������������0000644�0001750�0001750�00000173401�12270035364�010766� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| FAQ 1. Philosophy 1.1 What is cURL? 1.2 What is libcurl? 1.3 What is curl not? 1.4 When will you make curl do XXXX ? 1.5 Who makes curl? 1.6 What do you get for making curl? 1.7 What about CURL from curl.com? 1.8 I have a problem who do I mail? 1.9 Where do I buy commercial support for curl? 1.10 How many are using curl? 1.11 Why don't you update ca-bundle.crt 1.12 I have a problem who can I chat with? 1.13 curl's ECCN number? 1.14 How do I submit my patch? 2. Install Related Problems 2.1 configure doesn't find OpenSSL even when it is installed 2.1.1 native linker doesn't find OpenSSL 2.1.2 only the libssl lib is missing 2.2 Does curl work/build with other SSL libraries? 2.3 Where can I find a copy of LIBEAY32.DLL? 2.4 Does curl support SOCKS (RFC 1928) ? 3. Usage Problems 3.1 curl: (1) SSL is disabled, https: not supported 3.2 How do I tell curl to resume a transfer? 3.3 Why doesn't my posting using -F work? 3.4 How do I tell curl to run custom FTP commands? 3.5 How can I disable the Accept: */* header? 3.6 Does curl support ASP, XML, XHTML or HTML version Y? 3.7 Can I use curl to delete/rename a file through FTP? 3.8 How do I tell curl to follow HTTP redirects? 3.9 How do I use curl in my favorite programming language? 3.10 What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP? 3.11 How do I POST with a different Content-Type? 3.12 Why do FTP specific features over HTTP proxy fail? 3.13 Why does my single/double quotes fail? 3.14 Does curl support Javascript or PAC (automated proxy config)? 3.15 Can I do recursive fetches with curl? 3.16 What certificates do I need when I use SSL? 3.17 How do I list the root dir of an FTP server? 3.18 Can I use curl to send a POST/PUT and not wait for a response? 3.19 How do I get HTTP from a host using a specific IP address? 3.20 How to SFTP from my user's home directory? 3.21 Protocol xxx not supported or disabled in libcurl 3.22 curl -X gives me HTTP problems 4. Running Problems 4.1 Problems connecting to SSL servers. 4.2 Why do I get problems when I use & or % in the URL? 4.3 How can I use {, }, [ or ] to specify multiple URLs? 4.4 Why do I get downloaded data even though the web page doesn't exist? 4.5 Why do I get return code XXX from a HTTP server? 4.5.1 "400 Bad Request" 4.5.2 "401 Unauthorized" 4.5.3 "403 Forbidden" 4.5.4 "404 Not Found" 4.5.5 "405 Method Not Allowed" 4.5.6 "301 Moved Permanently" 4.6 Can you tell me what error code 142 means? 4.7 How do I keep user names and passwords secret in Curl command lines? 4.8 I found a bug! 4.9 Curl can't authenticate to the server that requires NTLM? 4.10 My HTTP request using HEAD, PUT or DELETE doesn't work! 4.11 Why does my HTTP range requests return the full document? 4.12 Why do I get "certificate verify failed" ? 4.13 Why is curl -R on Windows one hour off? 4.14 Redirects work in browser but not with curl! 4.15 FTPS doesn't work 4.16 My HTTP POST or PUT requests are slow! 4.17 Non-functional connect timeouts on Windows 4.18 file:// URLs containing drive letters (Windows, NetWare) 4.19 Why doesn't cURL return an error when the network cable is unplugged? 5. libcurl Issues 5.1 Is libcurl thread-safe? 5.2 How can I receive all data into a large memory chunk? 5.3 How do I fetch multiple files with libcurl? 5.4 Does libcurl do Winsock initing on win32 systems? 5.5 Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on win32 ? 5.6 What about Keep-Alive or persistent connections? 5.7 Link errors when building libcurl on Windows! 5.8 libcurl.so.X: open failed: No such file or directory 5.9 How does libcurl resolve host names? 5.10 How do I prevent libcurl from writing the response to stdout? 5.11 How do I make libcurl not receive the whole HTTP response? 5.12 Can I make libcurl fake or hide my real IP address? 5.13 How do I stop an ongoing transfer? 5.14 Using C++ non-static functions for callbacks? 5.15 How do I get an FTP directory listing? 5.16 I want a different time-out! 5.17 Can I write a server with libcurl? 6. License Issues 6.1 I have a GPL program, can I use the libcurl library? 6.2 I have a closed-source program, can I use the libcurl library? 6.3 I have a BSD licensed program, can I use the libcurl library? 6.4 I have a program that uses LGPL libraries, can I use libcurl? 6.5 Can I modify curl/libcurl for my program and keep the changes secret? 6.6 Can you please change the curl/libcurl license to XXXX? 6.7 What are my obligations when using libcurl in my commercial apps? 7. PHP/CURL Issues 7.1 What is PHP/CURL? 7.2 Who wrote PHP/CURL? 7.3 Can I perform multiple requests using the same handle? ============================================================================== 1. Philosophy 1.1 What is cURL? cURL is the name of the project. The name is a play on 'Client for URLs', originally with URL spelled in uppercase to make it obvious it deals with URLs. The fact it can also be pronounced 'see URL' also helped, it works as an abbreviation for "Client URL Request Library" or why not the recursive version: "Curl URL Request Library". The cURL project produces two products: libcurl A free and easy-to-use client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP. libcurl 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 more! libcurl is highly portable, it builds and works identically on numerous platforms, including Solaris, NetBSD, FreeBSD, OpenBSD, Darwin, HPUX, IRIX, AIX, Tru64, Linux, UnixWare, HURD, Windows, Amiga, OS/2, BeOS, Mac OS X, Ultrix, QNX, OpenVMS, RISC OS, Novell NetWare, DOS, Symbian, OSF, Android, Minix, IBM TPF and more... libcurl is free, thread-safe, IPv6 compatible, feature rich, well supported and fast. curl A command line tool for getting or sending files using URL syntax. Since curl uses libcurl, curl supports the same wide range of common Internet protocols that libcurl does. We pronounce curl and cURL with an initial k sound: [kurl]. There are numerous sub-projects and related projects that also use the word curl in the project names in various combinations, but you should take notice that this FAQ is directed at the command-line tool named curl (and libcurl the library), and may therefore not be valid for other curl-related projects. (There is however a small section for the PHP/CURL in this FAQ.) 1.2 What is libcurl? libcurl is a reliable and portable library which provides you with an easy interface to a range of common Internet protocols. You can use libcurl for free in your application, be it open source, commercial or closed-source. libcurl is most probably the most portable, most powerful and most often used C-based multi-platform file transfer library on this planet - be it open source or commercial. 1.3 What is curl not? Curl is not a wget clone. That is a common misconception. Never, during curl's development, have we intended curl to replace wget or compete on its market. Curl is targeted at single-shot file transfers. Curl is not a web site mirroring program. If you want to use curl to mirror something: fine, go ahead and write a script that wraps around curl to make it reality (like curlmirror.pl does). Curl is not an FTP site mirroring program. Sure, get and send FTP with curl but if you want systematic and sequential behavior you should write a script (or write a new program that interfaces libcurl) and do it. Curl is not a PHP tool, even though it works perfectly well when used from or with PHP (when using the PHP/CURL module). Curl is not a program for a single operating system. Curl exists, compiles, builds and runs under a wide range of operating systems, including all modern Unixes (and a bunch of older ones too), Windows, Amiga, BeOS, OS/2, OS X, QNX etc. 1.4 When will you make curl do XXXX ? We love suggestions of what to change in order to make curl and libcurl better. We do however believe in a few rules when it comes to the future of curl: Curl -- the command line tool -- is to remain a non-graphical command line tool. If you want GUIs or fancy scripting capabilities, you should look for another tool that uses libcurl. We do not add things to curl that other small and available tools already do very fine at the side. Curl's output is fine to pipe into another program or redirect to another file for the next program to interpret. We focus on protocol related issues and improvements. If you wanna do more magic with the supported protocols than curl currently does, chances are big we will agree. If you wanna add more protocols, we may very well agree. If you want someone else to make all the work while you wait for us to implement it for you, that is not a very friendly attitude. We spend a considerable time already on maintaining and developing curl. In order to get more out of us, you should consider trading in some of your time and efforts in return. If you write the code, chances are bigger that it will get into curl faster. 1.5 Who makes curl? curl and libcurl are not made by any single individual. Daniel Stenberg is project leader and main developer, but other persons' submissions are important and crucial. Anyone can contribute and post their changes and improvements and have them inserted in the main sources (of course on the condition that developers agree on that the fixes are good). The full list of all contributors is found in the docs/THANKS file. curl is developed by a community, with Daniel at the wheel. 1.6 What do you get for making curl? Project cURL is entirely free and open. No person gets paid for developing (lib)curl on full or even part time. We do this voluntarily on our spare time. Occasionally companies pay individual developers to work on curl, but that's up to each company and developer. It is not controlled by nor supervised in any way by the project. We still get help from companies. Haxx provides web site, bandwidth, mailing lists etc, sourceforge.net hosts project services we take advantage from, like the bug tracker and github hosts the primary git repository. Also again, some companies have sponsored certain parts of the development in the past and I hope some will continue to do so in the future. If you want to support our project, consider a donation or a banner-program or even better: by helping us coding, documenting, testing etc. 1.7 What about CURL from curl.com? During the summer 2001, curl.com was busy advertising their client-side programming language for the web, named CURL. We are in no way associated with curl.com or their CURL programming language. Our project name curl has been in effective use since 1998. We were not the first computer related project to use the name "curl" and do not claim any rights to the name. We recognize that we will be living in parallel with curl.com and wish them every success. 1.8 I have a problem who do I mail? Please do not mail any single individual unless you really need to. Keep curl-related questions on a suitable mailing list. All available mailing lists are listed in the MANUAL document and online at http://curl.haxx.se/mail/ Keeping curl-related questions and discussions on mailing lists allows others to join in and help, to share their ideas, contribute their suggestions and spread their wisdom. Keeping discussions on public mailing lists also allows for others to learn from this (both current and future users thanks to the web based archives of the mailing lists), thus saving us from having to repeat ourselves even more. Thanks for respecting this. If you have found or simply suspect a security problem in curl or libcurl, mail curl-security at haxx.se (closed list of receivers, mails are not disclosed) and tell. Then we can produce a fix in a timely manner before the flaw is announced to the world, thus lessen the impact the problem will have on existing users. 1.9 Where do I buy commercial support for curl? curl is fully open source. It means you can hire any skilled engineer to fix your curl-related problems. We list available alternatives on the curl web site: http://curl.haxx.se/support.html 1.10 How many are using curl? It is impossible to tell. We don't know how many users that knowingly have installed and use curl. We don't know how many users that use curl without knowing that they are in fact using it. We don't know how many users that downloaded or installed curl and then never use it. In May 2012 Daniel did a counting game and came up with a number that may be completely wrong or somewhat accurate. Over 500 million! See http://daniel.haxx.se/blog/2012/05/16/300m-users/ 1.11 Why don't you update ca-bundle.crt The ca cert bundle that used to shipped with curl was very outdated and must be replaced with an up-to-date version by anyone who wants to verify peers. It is no longer provided by curl. The last curl release ever that shipped a ca cert bundle was curl 7.18.0. In the cURL project we've decided not to attempt to keep this file updated (or even present anymore) since deciding what to add to a ca cert bundle is an undertaking we've not been ready to accept, and the one we can get from Mozilla is perfectly fine so there's no need to duplicate that work. Today, with many services performed over HTTPS, every operating system should come with a default ca cert bundle that can be deemed somewhat trustworthy and that collection (if reasonably updated) should be deemed to be a lot better than a private curl version. If you want the most recent collection of ca certs that Mozilla Firefox uses, we recommend that you extract the collection yourself from Mozilla Firefox (by running 'make ca-bundle), or by using our online service setup for this purpose: http://curl.haxx.se/docs/caextract.html 1.12 I have a problem who can I chat with? There's a bunch of friendly people hanging out in the #curl channel on the IRC network irc.freenode.net. If you're polite and nice, chances are big that you can get -- or provide -- help instantly. 1.13 curl's ECCN number? The US government restricts exports of software that contains or uses cryptography. When doing so, the Export Control Classification Number (ECCN) is used to identify the level of export control etc. ASF gives a good explanation at http://www.apache.org/dev/crypto.html We believe curl's number might be ECCN 5D002, another possibility is 5D992. It seems necessary to write them, asking to confirm. Comprehensible explanations of the meaning of such numbers and how to obtain them (resp.) are here http://www.bis.doc.gov/licensing/exportingbasics.htm http://www.bis.doc.gov/licensing/do_i_needaneccn.html An incomprehensible description of the two numbers above is here http://www.access.gpo.gov/bis/ear/pdf/ccl5-pt2.pdf 1.14 How do I submit my patch? When you have made a patch or a change of whatever sort, and want to submit that to the project, there are a few different ways we prefer: o send a patch to the curl-library mailing list. We're many subscribers there and there are lots of people who can review patches, comment on them and "receive" them properly. o if your patch changes or fixes a bug, you can also opt to submit a bug report in the bug tracker and attach your patch there. There are less people involved there. Lots of more details are found in the CONTRIBUTE and INTERNALS docs. 2. Install Related Problems 2.1 configure doesn't find OpenSSL even when it is installed This may be because of several reasons. 2.1.1 native linker doesn't find openssl Affected platforms: Solaris (native cc compiler) HPUX (native cc compiler) SGI IRIX (native cc compiler) SCO UNIX (native cc compiler) When configuring curl, I specify --with-ssl. OpenSSL is installed in /usr/local/ssl Configure reports SSL in /usr/local/ssl, but fails to find CRYPTO_lock in -lcrypto Cause: The cc for this test places the -L/usr/local/ssl/lib AFTER -lcrypto, so ld can't find the library. This is due to a bug in the GNU autoconf tool. Workaround: Specifying "LDFLAGS=-L/usr/local/ssl/lib" in front of ./configure places the -L/usr/local/ssl/lib early enough in the command line to make things work 2.1.2 only the libssl lib is missing If all include files and the libcrypto lib is present, with only the libssl being missing according to configure, this is mostly likely because a few functions are left out from the libssl. If the function names missing include RSA or RSAREF you can be certain that this is because libssl requires the RSA and RSAREF libs to build. See the INSTALL file section that explains how to add those libs to configure. Make sure that you remove the config.cache file before you rerun configure with the new flags. 2.2 Does curl work/build with other SSL libraries? Curl has been written to use a generic SSL function layer internally, and that SSL functionality can then be provided by one out of many different SSL backends. curl can be built to use one of the following SSL alternatives: OpenSSL, GnuTLS, yassl, NSS, PolarSSL, axTLS, Secure Transport (native iOS/OS X), WinSSL (native Windows) or qssl (native IBM i). They all have their pros and cons, and we try to maintain a comparison of them here: http://curl.haxx.se/docs/ssl-compared.html 2.3 Where can I find a copy of LIBEAY32.DLL? That is an OpenSSL binary built for Windows. Curl can be built with OpenSSL to do the SSL stuff. The LIBEAY32.DLL is then what curl needs on a windows machine to do https:// etc. Check out the curl web site to find accurate and up-to-date pointers to recent OpenSSL DLLs and other binary packages. 2.4 Does curl support SOCKS (RFC 1928) ? Yes, SOCKS 4 and 5 are supported. 3. Usage problems 3.1 curl: (1) SSL is disabled, https: not supported If you get this output when trying to get anything from a https:// server, it means that the instance of curl/libcurl that you're using was built without support for this protocol. This could've happened if the configure script that was run at build time couldn't find all libs and include files curl requires for SSL to work. If the configure script fails to find them, curl is simply built without SSL support. To get the https:// support into a curl that was previously built but that reports that https:// is not supported, you should dig through the document and logs and check out why the configure script doesn't find the SSL libs and/or include files. Also, check out the other paragraph in this FAQ labelled "configure doesn't find OpenSSL even when it is installed". 3.2 How do I tell curl to resume a transfer? Curl supports resumed transfers both ways on both FTP and HTTP. Try the -C option. 3.3 Why doesn't my posting using -F work? You can't simply use -F or -d at your choice. The web server that will receive your post expects one of the formats. If the form you're trying to submit uses the type 'multipart/form-data', then and only then you must use the -F type. In all the most common cases, you should use -d which then causes a posting with the type 'application/x-www-form-urlencoded'. This is described in some detail in the MANUAL and TheArtOfHttpScripting documents, and if you don't understand it the first time, read it again before you post questions about this to the mailing list. Also, try reading through the mailing list archives for old postings and questions regarding this. 3.4 How do I tell curl to run custom FTP commands? You can tell curl to perform optional commands both before and/or after a file transfer. Study the -Q/--quote option. Since curl is used for file transfers, you don't normally use curl to perform FTP commands without transferring anything. Therefore you must always specify a URL to transfer to/from even when doing custom FTP commands, or use -I which implies the "no body" option sent to libcurl. 3.5 How can I disable the Accept: */* header? You can change all internally generated headers by adding a replacement with the -H/--header option. By adding a header with empty contents you safely disable that one. Use -H "Accept:" to disable that specific header. 3.6 Does curl support ASP, XML, XHTML or HTML version Y? To curl, all contents are alike. It doesn't matter how the page was generated. It may be ASP, PHP, Perl, shell-script, SSI or plain HTML files. There's no difference to curl and it doesn't even know what kind of language that generated the page. See also item 3.14 regarding javascript. 3.7 Can I use curl to delete/rename a file through FTP? Yes. You specify custom FTP commands with -Q/--quote. One example would be to delete a file after you have downloaded it: curl -O ftp://download.com/coolfile -Q '-DELE coolfile' or rename a file after upload: curl -T infile ftp://upload.com/dir/ -Q "-RNFR infile" -Q "-RNTO newname" 3.8 How do I tell curl to follow HTTP redirects? Curl does not follow so-called redirects by default. The Location: header that informs the client about this is only interpreted if you're using the -L/--location option. As in: curl -L http://redirector.com Not all redirects are HTTP ones, see 4.14 3.9 How do I use curl in my favorite programming language? There exist many language interfaces/bindings for curl that integrates it better with various languages. If you are fluid in a script language, you may very well opt to use such an interface instead of using the command line tool. Find out more about which languages that support curl directly, and how to install and use them, in the libcurl section of the curl web site: http://curl.haxx.se/libcurl/ All the various bindings to libcurl are made by other projects and people, outside of the cURL project. The cURL project itself only produces libcurl with its plain C API. If you don't find anywhere else to ask you can ask about bindings on the curl-library list too, but be prepared that people on that list may not know anything about bindings. In October 2009, there were interfaces available for the following languages: Ada95, Basic, C, C++, Ch, Cocoa, D, Dylan, Eiffel, Euphoria, Ferite, Gambas, glib/GTK+, Haskell, ILE/RPG, Java, Lisp, Lua, Mono, .NET, Object-Pascal, O'Caml, Pascal, Perl, PHP, PostgreSQL, Python, R, Rexx, Ruby, Scheme, S-Lang, Smalltalk, SP-Forth, SPL, Tcl, Visual Basic, Visual FoxPro, Q, wxwidgets and XBLite. By the time you read this, additional ones may have appeared! 3.10 What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP? Curl adheres to the HTTP spec, which basically means you can play with *any* protocol that is built on top of HTTP. Protocols such as SOAP, WEBDAV and XML-RPC are all such ones. You can use -X to set custom requests and -H to set custom headers (or replace internally generated ones). Using libcurl is of course just as fine and you'd just use the proper library options to do the same. 3.11 How do I POST with a different Content-Type? You can always replace the internally generated headers with -H/--header. To make a simple HTTP POST with text/xml as content-type, do something like: curl -d "datatopost" -H "Content-Type: text/xml" [URL] 3.12 Why do FTP specific features over HTTP proxy fail? Because when you use a HTTP proxy, the protocol spoken on the network will be HTTP, even if you specify a FTP URL. This effectively means that you normally can't use FTP specific features such as FTP upload and FTP quote etc. There is one exception to this rule, and that is if you can "tunnel through" the given HTTP proxy. Proxy tunneling is enabled with a special option (-p) and is generally not available as proxy admins usually disable tunneling to other ports than 443 (which is used for HTTPS access through proxies). 3.13 Why does my single/double quotes fail? To specify a command line option that includes spaces, you might need to put the entire option within quotes. Like in: curl -d " with spaces " url.com or perhaps curl -d ' with spaces ' url.com Exactly what kind of quotes and how to do this is entirely up to the shell or command line interpreter that you are using. For most unix shells, you can more or less pick either single (') or double (") quotes. For Windows/DOS prompts I believe you're forced to use double (") quotes. Please study the documentation for your particular environment. Examples in the curl docs will use a mix of both these ones as shown above. You must adjust them to work in your environment. Remember that curl works and runs on more operating systems than most single individuals have ever tried. 3.14 Does curl support Javascript or PAC (automated proxy config)? Many web pages do magic stuff using embedded Javascript. Curl and libcurl have no built-in support for that, so it will be treated just like any other contents. .pac files are a netscape invention and are sometimes used by organizations to allow them to differentiate which proxies to use. The .pac contents is just a Javascript program that gets invoked by the browser and that returns the name of the proxy to connect to. Since curl doesn't support Javascript, it can't support .pac proxy configuration either. Some workarounds usually suggested to overcome this Javascript dependency: Depending on the Javascript complexity, write up a script that translates it to another language and execute that. Read the Javascript code and rewrite the same logic in another language. Implement a Javascript interpreter, people have successfully used the Mozilla Javascript engine in the past. Ask your admins to stop this, for a static proxy setup or similar. 3.15 Can I do recursive fetches with curl? No. curl itself has no code that performs recursive operations, such as those performed by wget and similar tools. There exist wrapper scripts with that functionality (for example the curlmirror perl script), and you can write programs based on libcurl to do it, but the command line tool curl itself cannot. 3.16 What certificates do I need when I use SSL? There are three different kinds of "certificates" to keep track of when we talk about using SSL-based protocols (HTTPS or FTPS) using curl or libcurl. CLIENT CERTIFICATE The server you communicate may require that you can provide this in order to prove that you actually are who you claim to be. If the server doesn't require this, you don't need a client certificate. A client certificate is always used together with a private key, and the private key has a pass phrase that protects it. SERVER CERTIFICATE The server you communicate with has a server certificate. You can and should verify this certificate to make sure that you are truly talking to the real server and not a server impersonating it. CERTIFICATE AUTHORITY CERTIFICATE ("CA cert") You often have several CA certs in a CA cert bundle that can be used to verify a server certificate that was signed by one of the authorities in the bundle. curl does not come with a CA cert bundle but most curl installs provide one. You can also override the default. The server certificate verification process is made by using a Certificate Authority certificate ("CA cert") that was used to sign the server certificate. Server certificate verification is enabled by default in curl and libcurl and is often the reason for problems as explained in FAQ entry 4.12 and the SSLCERTS document (http://curl.haxx.se/docs/sslcerts.html). Server certificates that are "self-signed" or otherwise signed by a CA that you do not have a CA cert for, cannot be verified. If the verification during a connect fails, you are refused access. You then need to explicitly disable the verification to connect to the server. 3.17 How do I list the root dir of an FTP server? There are two ways. The way defined in the RFC is to use an encoded slash in the first path part. List the "/tmp" dir like this: curl ftp://ftp.sunet.se/%2ftmp/ or the not-quite-kosher-but-more-readable way, by simply starting the path section of the URL with a slash: curl ftp://ftp.sunet.se//tmp/ 3.18 Can I use curl to send a POST/PUT and not wait for a response? No. But you could easily write your own program using libcurl to do such stunts. 3.19 How do I get HTTP from a host using a specific IP address? For example, you may be trying out a web site installation that isn't yet in the DNS. Or you have a site using multiple IP addresses for a given host name and you want to address a specific one out of the set. Set a custom Host: header that identifies the server name you want to reach but use the target IP address in the URL: curl --header "Host: www.example.com" http://127.0.0.1/ You can also opt to add faked host name entries to curl with the --resolve option. That has the added benefit that things like redirects will also work properly. The above operation would instead be done as: curl --resolve www.example.com:80:127.0.0.1 http://www.example.com/ 3.20 How to SFTP from my user's home directory? Contrary to how FTP works, SFTP and SCP URLs specify the exact directory to work with. It means that if you don't specify that you want the user's home directory, you get the actual root directory. To specify a file in your user's home directory, you need to use the correct URL syntax which for sftp might look similar to: curl -O -u user:password sftp://example.com/~/file.txt and for SCP it is just a different protocol prefix: curl -O -u user:password scp://example.com/~/file.txt 3.21 Protocol xxx not supported or disabled in libcurl When passing on a URL to curl to use, it may respond that the particular protocol is not supported or disabled. The particular way this error message is phrased is because curl doesn't make a distinction internally of whether a particular protocol is not supported (i.e. never got any code added that knows how to speak that protocol) or if it was explicitly disabled. curl can be built to only support a given set of protocols, and the rest would then be disabled or not supported. Note that this error will also occur if you pass a wrongly spelled protocol part as in "htpt://example.com" or as in the less evident case if you prefix the protocol part with a space as in " http://example.com/". 3.22 curl -X gives me HTTP problems In normal circumstances, -X should hardly ever be used. By default you use curl without explicitly saying which request method to use when the URL identifies a HTTP transfer. If you just pass in a URL like "curl http://example.com" it will use GET. If you use -d or -F curl will use POST, -I will cause a HEAD and -T will make it a PUT. If for whatever reason you're not happy with these default choices that curl does for you, you can override those request methods by specifying -X [WHATEVER]. This way you can for example send a DELETE by doing "curl -X DELETE [URL]". It is thus pointless to do "curl -XGET [URL]" as GET would be used anyway. In the same vein it is pointless to do "curl -X POST -d data [URL]"... But you can make a fun and somewhat rare request that sends a request-body in a GET request with something like "curl -X GET -d data [URL]" Note that -X doesn't change curl's behavior. It only modifies the actual string sent in the request. Accordingly, by using -XPOST on a command line that for example would follow a 303 redirect, you will effectively prevent curl from behaving correctly. Be aware. 4. Running Problems 4.1 Problems connecting to SSL servers. It took a very long time before we could sort out why curl had problems to connect to certain SSL servers when using SSLeay or OpenSSL v0.9+. The error sometimes showed up similar to: 16570:error:1407D071:SSL routines:SSL2_READ:bad mac decode:s2_pkt.c:233: It turned out to be because many older SSL servers don't deal with SSLv3 requests properly. To correct this problem, tell curl to select SSLv2 from the command line (-2/--sslv2). There have also been examples where the remote server didn't like the SSLv2 request and instead you had to force curl to use SSLv3 with -3/--sslv3. 4.2 Why do I get problems when I use & or % in the URL? In general unix shells, the & symbol is treated specially and when used, it runs the specified command in the background. To safely send the & as a part of a URL, you should quote the entire URL by using single (') or double (") quotes around it. Similar problems can also occur on some shells with other characters, including ?*!$~(){}<>\|;`. When in doubt, quote the URL. An example that would invoke a remote CGI that uses &-symbols could be: curl 'http://www.altavista.com/cgi-bin/query?text=yes&q=curl' In Windows, the standard DOS shell treats the percent sign specially and you need to use TWO percent signs for each single one you want to use in the URL. If you want a literal percent sign to be part of the data you pass in a POST using -d/--data you must encode it as '%25' (which then also needs the percent sign doubled on Windows machines). 4.3 How can I use {, }, [ or ] to specify multiple URLs? Because those letters have a special meaning to the shell, and to be used in a URL specified to curl you must quote them. An example that downloads two URLs (sequentially) would do: curl '{curl,www}.haxx.se' To be able to use those letters as actual parts of the URL (without using them for the curl URL "globbing" system), use the -g/--globoff option: curl -g 'www.site.com/weirdname[].html' 4.4 Why do I get downloaded data even though the web page doesn't exist? Curl asks remote servers for the page you specify. If the page doesn't exist at the server, the HTTP protocol defines how the server should respond and that means that headers and a "page" will be returned. That's simply how HTTP works. By using the --fail option you can tell curl explicitly to not get any data if the HTTP return code doesn't say success. 4.5 Why do I get return code XXX from a HTTP server? RFC2616 clearly explains the return codes. This is a short transcript. Go read the RFC for exact details: 4.5.1 "400 Bad Request" The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications. 4.5.2 "401 Unauthorized" The request requires user authentication. 4.5.3 "403 Forbidden" The server understood the request, but is refusing to fulfil it. Authorization will not help and the request SHOULD NOT be repeated. 4.5.4 "404 Not Found" The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent. 4.5.5 "405 Method Not Allowed" The method specified in the Request-Line is not allowed for the resource identified by the Request-URI. The response MUST include an Allow header containing a list of valid methods for the requested resource. 4.5.6 "301 Moved Permanently" If you get this return code and an HTML output similar to this: <H1>Moved Permanently</H1> The document has moved <A HREF="http://same_url_now_with_a_trailing_slash/">here</A>. it might be because you request a directory URL but without the trailing slash. Try the same operation again _with_ the trailing URL, or use the -L/--location option to follow the redirection. 4.6 Can you tell me what error code 142 means? All curl error codes are described at the end of the man page, in the section called "EXIT CODES". Error codes that are larger than the highest documented error code means that curl has exited due to a crash. This is a serious error, and we appreciate a detailed bug report from you that describes how we could go ahead and repeat this! 4.7 How do I keep user names and passwords secret in Curl command lines? This problem has two sides: The first part is to avoid having clear-text passwords in the command line so that they don't appear in 'ps' outputs and similar. That is easily avoided by using the "-K" option to tell curl to read parameters from a file or stdin to which you can pass the secret info. curl itself will also attempt to "hide" the given password by blanking out the option - this doesn't work on all platforms. To keep the passwords in your account secret from the rest of the world is not a task that curl addresses. You could of course encrypt them somehow to at least hide them from being read by human eyes, but that is not what anyone would call security. Also note that regular HTTP (using Basic authentication) and FTP passwords are sent in clear across the network. All it takes for anyone to fetch them is to listen on the network. Eavesdropping is very easy. Use more secure authentication methods (like Digest, Negotiate or even NTLM) or consider the SSL-based alternatives HTTPS and FTPS. 4.8 I found a bug! It is not a bug if the behavior is documented. Read the docs first. Especially check out the KNOWN_BUGS file, it may be a documented bug! If it is a problem with a binary you've downloaded or a package for your particular platform, try contacting the person who built the package/archive you have. If there is a bug, read the BUGS document first. Then report it as described in there. 4.9 Curl can't authenticate to the server that requires NTLM? NTLM support requires OpenSSL, GnuTLS, NSS, Secure Transport, or Microsoft Windows libraries at build-time to provide this functionality. NTLM is a Microsoft proprietary protocol. Proprietary formats are evil. You should not use such ones. 4.10 My HTTP request using HEAD, PUT or DELETE doesn't work! Many web servers allow or demand that the administrator configures the server properly for these requests to work on the web server. Some servers seem to support HEAD only on certain kinds of URLs. To fully grasp this, try the documentation for the particular server software you're trying to interact with. This is not anything curl can do anything about. 4.11 Why does my HTTP range requests return the full document? Because the range may not be supported by the server, or the server may choose to ignore it and return the full document anyway. 4.12 Why do I get "certificate verify failed" ? You invoke curl 7.10 or later to communicate on a https:// URL and get an error back looking something similar to this: curl: (35) SSL: error:14090086:SSL routines: SSL3_GET_SERVER_CERTIFICATE:certificate verify failed Then it means that curl couldn't verify that the server's certificate was good. Curl verifies the certificate using the CA cert bundle that comes with the curl installation. To disable the verification (which makes it act like curl did before 7.10), use -k. This does however enable man-in-the-middle attacks. If you get this failure but are having a CA cert bundle installed and used, the server's certificate is not signed by one of the CA's in the bundle. It might for example be self-signed. You then correct this problem by obtaining a valid CA cert for the server. Or again, decrease the security by disabling this check. Details are also in the SSLCERTS file in the release archives, found online here: http://curl.haxx.se/docs/sslcerts.html 4.13 Why is curl -R on Windows one hour off? During daylight savings time, when -R is used, curl will set a time that appears one hour off. This happens due to a flaw in how Windows stores and uses file modification times and it is not easily worked around. For details on this problem, read this: http://www.codeproject.com/datetime/dstbugs.asp 4.14 Redirects work in browser but not with curl! curl supports HTTP redirects fine (see item 3.8). Browsers generally support at least two other ways to perform redirects that curl does not: Meta tags. You can write a HTML tag that will cause the browser to redirect to another given URL after a certain time. Javascript. You can write a Javascript program embedded in a HTML page that redirects the browser to another given URL. There is no way to make curl follow these redirects. You must either manually figure out what the page is set to do, or you write a script that parses the results and fetches the new URL. 4.15 FTPS doesn't work curl supports FTPS (sometimes known as FTP-SSL) both implicit and explicit mode. When a URL is used that starts with FTPS://, curl assumes implicit SSL on the control connection and will therefore immediately connect and try to speak SSL. FTPS:// connections default to port 990. To use explicit FTPS, you use a FTP:// URL and the --ftp-ssl option (or one of its related flavours). This is the most common method, and the one mandated by RFC4217. This kind of connection then of course uses the standard FTP port 21 by default. 4.16 My HTTP POST or PUT requests are slow! libcurl makes all POST and PUT requests (except for POST requests with a very tiny request body) use the "Expect: 100-continue" header. This header allows the server to deny the operation early so that libcurl can bail out already before having to send any data. This is useful in authentication cases and others. However, many servers don't implement the Expect: stuff properly and if the server doesn't respond (positively) within 1 second libcurl will continue and send off the data anyway. You can disable libcurl's use of the Expect: header the same way you disable any header, using -H / CURLOPT_HTTPHEADER, or by forcing it to use HTTP 1.0. 4.17 Non-functional connect timeouts In most Windows setups having a timeout longer than 21 seconds make no difference, as it will only send 3 TCP SYN packets and no more. The second packet sent three seconds after the first and the third six seconds after the second. No more than three packets are sent, no matter how long the timeout is set. See option TcpMaxConnectRetransmissions on this page: http://support.microsoft.com/?scid=kb%3Ben-us%3B175523&x=6&y=7 Also, even on non-Windows systems there may run a firewall or anti-virus software or similar that accepts the connection but does not actually do anything else. This will make (lib)curl to consider the connection connected and thus the connect timeout won't trigger. 4.18 file:// URLs containing drive letters (Windows, NetWare) When using cURL to try to download a local file, one might use a URL in this format: file://D:/blah.txt You'll find that even if D:\blah.txt does exist, cURL returns a 'file not found' error. According to RFC 1738 (http://www.faqs.org/rfcs/rfc1738.html), file:// URLs must contain a host component, but it is ignored by most implementations. In the above example, 'D:' is treated as the host component, and is taken away. Thus, cURL tries to open '/blah.txt'. If your system is installed to drive C:, that will resolve to 'C:\blah.txt', and if that doesn't exist you will get the not found error. To fix this problem, use file:// URLs with *three* leading slashes: file:///D:/blah.txt Alternatively, if it makes more sense, specify 'localhost' as the host component: file://localhost/D:/blah.txt In either case, cURL should now be looking for the correct file. 4.19 Why doesn't cURL return an error when the network cable is unplugged? Unplugging a cable is not an error situation. The TCP/IP protocol stack was designed to be fault tolerant, so even though there may be a physical break somewhere the connection shouldn't be affected, just possibly delayed. Eventually, the physical break will be fixed or the data will be re-routed around the physical problem through another path. In such cases, the TCP/IP stack is responsible for detecting when the network connection is irrevocably lost. Since with some protocols it is perfectly legal for the client wait indefinitely for data, the stack may never report a problem, and even when it does, it can take up to 20 minutes for it to detect an issue. The curl option --keepalive-time enables keep-alive support in the TCP/IP stack which makes it periodically probe the connection to make sure it is still available to send data. That should reliably detect any TCP/IP network failure. But even that won't detect the network going down before the TCP/IP connection is established (e.g. during a DNS lookup) or using protocols that don't use TCP. To handle those situations, curl offers a number of timeouts on its own. --speed-limit/--speed-time will abort if the data transfer rate falls too low, and --connect-timeout and --max-time can be used to put an overall timeout on the connection phase or the entire transfer. A libcurl-using application running in a known physical environment (e.g. an embedded device with only a single network connection) may want to act immediately if its lone network connection goes down. That can be achieved by having the application monitor the network connection on its own using an OS-specific mechanism, then signalling libcurl to abort (see also item 5.13). 5. libcurl Issues 5.1 Is libcurl thread-safe? Yes. We have written the libcurl code specifically adjusted for multi-threaded programs. libcurl will use thread-safe functions instead of non-safe ones if your system has such. Note that you must never share the same handle in multiple threads. If you use a OpenSSL-powered libcurl in a multi-threaded environment, you need to provide one or two locking functions: http://www.openssl.org/docs/crypto/threads.html If you use a GnuTLS-powered libcurl in a multi-threaded environment, you need to provide locking function(s) for libgcrypt (which is used by GnuTLS for the crypto functions). http://www.gnu.org/software/gnutls/manual/html_node/Multi_002dthreaded-applications.html No special locking is needed with a NSS-powered libcurl. NSS is thread-safe. 5.2 How can I receive all data into a large memory chunk? [ See also the examples/getinmemory.c source ] You are in full control of the callback function that gets called every time there is data received from the remote server. You can make that callback do whatever you want. You do not have to write the received data to a file. One solution to this problem could be to have a pointer to a struct that you pass to the callback function. You set the pointer using the CURLOPT_WRITEDATA option. Then that pointer will be passed to the callback instead of a FILE * to a file: /* imaginary struct */ struct MemoryStruct { char *memory; size_t size; }; /* imaginary callback function */ size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) { size_t realsize = size * nmemb; struct MemoryStruct *mem = (struct MemoryStruct *)data; mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1); if (mem->memory) { memcpy(&(mem->memory[mem->size]), ptr, realsize); mem->size += realsize; mem->memory[mem->size] = 0; } return realsize; } 5.3 How do I fetch multiple files with libcurl? libcurl has excellent support for transferring multiple files. You should just repeatedly set new URLs with curl_easy_setopt() and then transfer it with curl_easy_perform(). The handle you get from curl_easy_init() is not only reusable, but you're even encouraged to reuse it if you can, as that will enable libcurl to use persistent connections. 5.4 Does libcurl do Winsock initialization on win32 systems? Yes, if told to in the curl_global_init() call. 5.5 Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on win32 ? Yes, but you cannot open a FILE * and pass the pointer to a DLL and have that DLL use the FILE * (as the DLL and the client application cannot access each others' variable memory areas). If you set CURLOPT_WRITEDATA you must also use CURLOPT_WRITEFUNCTION as well to set a function that writes the file, even if that simply writes the data to the specified FILE *. Similarly, if you use CURLOPT_READDATA you must also specify CURLOPT_READFUNCTION. 5.6 What about Keep-Alive or persistent connections? curl and libcurl have excellent support for persistent connections when transferring several files from the same server. Curl will attempt to reuse connections for all URLs specified on the same command line/config file, and libcurl will reuse connections for all transfers that are made using the same libcurl handle. When you use the easy interface, the connection cache is kept within the easy handle. If you instead use the multi interface, the connection cache will be kept within the multi handle and will be shared among all the easy handles that are used within the same multi handle. 5.7 Link errors when building libcurl on Windows! You need to make sure that your project, and all the libraries (both static and dynamic) that it links against, are compiled/linked against the same run time library. This is determined by the /MD, /ML, /MT (and their corresponding /M?d) options to the command line compiler. /MD (linking against MSVCRT dll) seems to be the most commonly used option. When building an application that uses the static libcurl library, you must add -DCURL_STATICLIB to your CFLAGS. Otherwise the linker will look for dynamic import symbols. If you're using Visual Studio, you need to instead add CURL_STATICLIB in the "Preprocessor Definitions" section. If you get linker error like "unknown symbol __imp__curl_easy_init ..." you have linked against the wrong (static) library. If you want to use the libcurl.dll and import lib, you don't need any extra CFLAGS, but use one of the import libraries below. These are the libraries produced by the various lib/Makefile.* files: Target: static lib. import lib for libcurl*.dll. ----------------------------------------------------------- MingW: libcurl.a libcurldll.a MSVC (release): libcurl.lib libcurl_imp.lib MSVC (debug): libcurld.lib libcurld_imp.lib Borland: libcurl.lib libcurl_imp.lib 5.8 libcurl.so.X: open failed: No such file or directory This is an error message you might get when you try to run a program linked with a shared version of libcurl and your run-time linker (ld.so) couldn't find the shared library named libcurl.so.X. (Where X is the number of the current libcurl ABI, typically 3 or 4). You need to make sure that ld.so finds libcurl.so.X. You can do that multiple ways, and it differs somewhat between different operating systems, but they are usually: * Add an option to the linker command line that specify the hard-coded path the run-time linker should check for the lib (usually -R) * Set an environment variable (LD_LIBRARY_PATH for example) where ld.so should check for libs * Adjust the system's config to check for libs in the directory where you've put the dir (like Linux's /etc/ld.so.conf) 'man ld.so' and 'man ld' will tell you more details 5.9 How does libcurl resolve host names? libcurl supports a large a number of different name resolve functions. One of them is picked at build-time and will be used unconditionally. Thus, if you want to change name resolver function you must rebuild libcurl and tell it to use a different function. - The non-ipv6 resolver that can use one out of four host name resolve calls (depending on what your system supports): A - gethostbyname() B - gethostbyname_r() with 3 arguments C - gethostbyname_r() with 5 arguments D - gethostbyname_r() with 6 arguments - The ipv6-resolver that uses getaddrinfo() - The c-ares based name resolver that uses the c-ares library for resolves. Using this offers asynchronous name resolves. - The threaded resolver (default option on Windows). It uses: A - gethostbyname() on plain ipv4 hosts B - getaddrinfo() on ipv6-enabled hosts Also note that libcurl never resolves or reverse-lookups addresses given as pure numbers, such as 127.0.0.1 or ::1. 5.10 How do I prevent libcurl from writing the response to stdout? libcurl provides a default built-in write function that writes received data to stdout. Set the CURLOPT_WRITEFUNCTION to receive the data, or possibly set CURLOPT_WRITEDATA to a different FILE * handle. 5.11 How do I make libcurl not receive the whole HTTP response? You make the write callback (or progress callback) return an error and libcurl will then abort the transfer. 5.12 Can I make libcurl fake or hide my real IP address? No. libcurl operates on a higher level. Besides, faking IP address would imply sending IP packet with a made-up source address, and then you normally get a problem with receiving the packet sent back as they would then not be routed to you! If you use a proxy to access remote sites, the sites will not see your local IP address but instead the address of the proxy. Also note that on many networks NATs or other IP-munging techniques are used that makes you see and use a different IP address locally than what the remote server will see you coming from. You may also consider using http://www.torproject.org . 5.13 How do I stop an ongoing transfer? With the easy interface you make sure to return the correct error code from one of the callbacks, but none of them are instant. There is no function you can call from another thread or similar that will stop it immediately. Instead, you need to make sure that one of the callbacks you use returns an appropriate value that will stop the transfer. Suitable callbacks that you can do this with include the progress callback, the read callback and the write callback. If you're using the multi interface, you can also stop a transfer by removing the particular easy handle from the multi stack at any moment you think the transfer is done or when you wish to abort the transfer. 5.14 Using C++ non-static functions for callbacks? libcurl is a C library, it doesn't know anything about C++ member functions. You can overcome this "limitation" with a relative ease using a static member function that is passed a pointer to the class: // f is the pointer to your object. static YourClass::func(void *buffer, size_t sz, size_t n, void *f) { // Call non-static member function. static_cast<YourClass*>(f)->nonStaticFunction(); } // This is how you pass pointer to the static function: curl_easy_setopt(hcurl, CURLOPT_WRITEFUNCTION, YourClass:func); curl_easy_setopt(hcurl, CURLOPT_WRITEDATA, this); 5.15 How do I get an FTP directory listing? If you end the FTP URL you request with a slash, libcurl will provide you with a directory listing of that given directory. You can also set CURLOPT_CUSTOMREQUEST to alter what exact listing command libcurl would use to list the files. The follow-up question that tend to follow the previous one, is how a program is supposed to parse the directory listing. How does it know what's a file and what's a dir and what's a symlink etc. The harsh reality is that FTP provides no such fine and easy-to-parse output. The output format FTP servers respond to LIST commands are entirely at the server's own liking and the NLST output doesn't reveal any types and in many cases don't even include all the directory entries. Also, both LIST and NLST tend to hide unix-style hidden files (those that start with a dot) by default so you need to do "LIST -a" or similar to see them. The application thus needs to parse the LIST output. One such existing list parser is available at http://cr.yp.to/ftpparse.html Versions of libcurl since 7.21.0 also provide the ability to specify a wildcard to download multiple files from one FTP directory. 5.16 I want a different time-out! Time and time again users realize that CURLOPT_TIMEOUT and CURLOPT_CONNECTIMEOUT are not sufficiently advanced or flexible to cover all the various use cases and scenarios applications end up with. libcurl offers many more ways to time-out operations. A common alternative is to use the CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME options to specify the lowest possible speed to accept before to consider the transfer timed out. The most flexible way is by writing your own time-out logic and using CURLOPT_PROGRESSFUNCTION (perhaps in combination with other callbacks) and use that to figure out exactly when the right condition is met when the transfer should get stopped. 5.17 Can I write a server with libcurl? No. libcurl offers no functions or building blocks to build any kind of internet protocol server. libcurl is only a client-side library. For server libraries, you need to continue your search elsewhere but there exist many good open source ones out there for most protocols you could possibly want a server for. And there are really good stand-alone ones that have been tested and proven for many years. There's no need for you to reinvent them! 6. License Issues Curl and libcurl are released under a MIT/X derivate license. The license is very liberal and should not impose a problem for your project. This section is just a brief summary for the cases we get the most questions. (Parts of this section was much enhanced by Bjorn Reese.) We are not lawyers and this is not legal advice. You should probably consult one if you want true and accurate legal insights without our prejudice. Note especially that this section concerns the libcurl license only; compiling in features of libcurl that depend on other libraries (e.g. OpenSSL) may affect the licensing obligations of your application. 6.1 I have a GPL program, can I use the libcurl library? Yes! Since libcurl may be distributed under the MIT/X derivate license, it can be used together with GPL in any software. 6.2 I have a closed-source program, can I use the libcurl library? Yes! libcurl does not put any restrictions on the program that uses the library. 6.3 I have a BSD licensed program, can I use the libcurl library? Yes! libcurl does not put any restrictions on the program that uses the library. 6.4 I have a program that uses LGPL libraries, can I use libcurl? Yes! The LGPL license doesn't clash with other licenses. 6.5 Can I modify curl/libcurl for my program and keep the changes secret? Yes! The MIT/X derivate license practically allows you to do almost anything with the sources, on the condition that the copyright texts in the sources are left intact. 6.6 Can you please change the curl/libcurl license to XXXX? No. We have carefully picked this license after years of development and discussions and a large amount of people have contributed with source code knowing that this is the license we use. This license puts the restrictions we want on curl/libcurl and it does not spread to other programs or libraries that use it. It should be possible for everyone to use libcurl or curl in their projects, no matter what license they already have in use. 6.7 What are my obligations when using libcurl in my commercial apps? Next to none. All you need to adhere to is the MIT-style license (stated in the COPYING file) which basically says you have to include the copyright notice in "all copies" and that you may not use the copyright holder's name when promoting your software. You do not have to release any of your source code. You do not have to reveal or make public any changes to the libcurl source code. You do not have to broadcast to the world that you are using libcurl within your app. All we ask is that you disclose "the copyright notice and this permission notice" somewhere. Most probably like in the documentation or in the section where other third party dependencies already are mentioned and acknowledged. As can be seen here: http://curl.haxx.se/docs/companies.html and elsewhere, more and more companies are discovering the power of libcurl and take advantage of it even in commercial environments. 7. PHP/CURL Issues 7.1 What is PHP/CURL? The module for PHP that makes it possible for PHP programs to access curl- functions from within PHP. In the cURL project we call this module PHP/CURL to differentiate it from curl the command line tool and libcurl the library. The PHP team however does not refer to it like this (for unknown reasons). They call it plain CURL (often using all caps) or sometimes ext/curl, but both cause much confusion to users which in turn gives us a higher question load. 7.2 Who wrote PHP/CURL? PHP/CURL is a module that comes with the regular PHP package. It depends and uses libcurl, so you need to have libcurl installed properly first before PHP/CURL can be used. PHP/CURL was initially written by Sterling Hughes. 7.3 Can I perform multiple requests using the same handle? Yes - at least in PHP version 4.3.8 and later (this has been known to not work in earlier versions, but the exact version when it started to work is unknown to me). After a transfer, you just set new options in the handle and make another transfer. This will make libcurl to re-use the same connection if it can. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/INSTALL����������������������������������������������������������������������������0000644�0001750�0001750�00000127075�12271275507�011501� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| How To Compile Installing Binary Packages ========================== Lots of people download binary distributions of curl and libcurl. This document does not describe how to install curl or libcurl using such a binary package. This document describes how to compile, build and install curl and libcurl from source code. Building from git ================= If you get your code off a git repository, see the GIT-INFO file in the root directory for specific instructions on how to proceed. UNIX ==== A normal unix installation is made in three or four steps (after you've unpacked the source archive): ./configure make make test (optional) make install You probably need to be root when doing the last command. If you have checked out the sources from the git repository, read the GIT-INFO on how to proceed. Get a full listing of all available configure options by invoking it like: ./configure --help If you want to install curl in a different file hierarchy than /usr/local, you need to specify that already when running configure: ./configure --prefix=/path/to/curl/tree If you happen to have write permission in that directory, you can do 'make install' without being root. An example of this would be to make a local install in your own home directory: ./configure --prefix=$HOME make make install The configure script always tries to find a working SSL library unless explicitly told not to. If you have OpenSSL installed in the default search path for your compiler/linker, you don't need to do anything special. If you have OpenSSL installed in /usr/local/ssl, you can run configure like: ./configure --with-ssl If you have OpenSSL installed somewhere else (for example, /opt/OpenSSL) and you have pkg-config installed, set the pkg-config path first, like this: env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure --with-ssl Without pkg-config installed, use this: ./configure --with-ssl=/opt/OpenSSL If you insist on forcing a build without SSL support, even though you may have OpenSSL installed in your system, you can run configure like this: ./configure --without-ssl If you have OpenSSL installed, but with the libraries in one place and the header files somewhere else, you have to set the LDFLAGS and CPPFLAGS environment variables prior to running configure. Something like this should work: (with the Bourne shell and its clones): CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \ ./configure (with csh, tcsh and their clones): env CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \ ./configure If you have shared SSL libs installed in a directory where your run-time linker doesn't find them (which usually causes configure failures), you can provide the -R option to ld on some operating systems to set a hard-coded path to the run-time linker: env LDFLAGS=-R/usr/local/ssl/lib ./configure --with-ssl MORE OPTIONS ------------ To force configure to use the standard cc compiler if both cc and gcc are present, run configure like CC=cc ./configure or env CC=cc ./configure To force a static library compile, disable the shared library creation by running configure like: ./configure --disable-shared To tell the configure script to skip searching for thread-safe functions, add an option like: ./configure --disable-thread To build curl with kerberos4 support enabled, curl requires the krb4 libs and headers installed. You can then use a set of options to tell configure where those are: --with-krb4-includes[=DIR] Specify location of kerberos4 headers --with-krb4-libs[=DIR] Specify location of kerberos4 libs --with-krb4[=DIR] where to look for Kerberos4 In most cases, /usr/athena is the install prefix and then it works with ./configure --with-krb4=/usr/athena If you're a curl developer and use gcc, you might want to enable more debug options with the --enable-debug option. curl can be built to use a whole range of libraries to provide various useful services, and configure will try to auto-detect a decent default. But if you want to alter it, you can select how to deal with each individual library. To build with GnuTLS for SSL/TLS, use both --without-ssl and --with-gnutls. To build with Cyassl for SSL/TLS, use both --without-ssl and --with-cyassl. To build with NSS for SSL/TLS, use both --without-ssl and --with-nss. To build with PolarSSL for SSL/TLS, use both --without-ssl and --with-polarssl. To build with axTLS for SSL/TLS, use both --without-ssl and --with-axtls. To get GSSAPI support, build with --with-gssapi and have the MIT or Heimdal Kerberos 5 packages installed. To get support for SCP and SFTP, build with --with-libssh2 and have libssh2 0.16 or later installed. To get Metalink support, build with --with-libmetalink and have the libmetalink packages installed. SPECIAL CASES ------------- Some versions of uClibc require configuring with CPPFLAGS=-D_GNU_SOURCE=1 to get correct large file support. The Open Watcom C compiler on Linux requires configuring with the variables: ./configure CC=owcc AR="$WATCOM/binl/wlib" AR_FLAGS=-q \ RANLIB=/bin/true STRIP="$WATCOM/binl/wstrip" CFLAGS=-Wextra Win32 ===== Building Windows DLLs and C run-time (CRT) linkage issues --------------------------------------------------------- As a general rule, building a DLL with static CRT linkage is highly discouraged, and intermixing CRTs in the same app is something to avoid at any cost. Reading and comprehension of Microsoft Knowledge Base articles KB94248 and KB140584 is a must for any Windows developer. Especially important is full understanding if you are not going to follow the advice given above. KB94248 - How To Use the C Run-Time http://support.microsoft.com/kb/94248/en-us KB140584 - How to link with the correct C Run-Time (CRT) library http://support.microsoft.com/kb/140584/en-us KB190799 - Potential Errors Passing CRT Objects Across DLL Boundaries http://msdn.microsoft.com/en-us/library/ms235460 If your app is misbehaving in some strange way, or it is suffering from memory corruption, before asking for further help, please try first to rebuild every single library your app uses as well as your app using the debug multithreaded dynamic C runtime. If you get linkage errors read section 5.7 of the FAQ document. MingW32 ------- Make sure that MinGW32's bin dir is in the search path, for example: set PATH=c:\mingw32\bin;%PATH% then run 'mingw32-make mingw32' in the root dir. There are other make targets available to build libcurl with more features, use: 'mingw32-make mingw32-zlib' to build with Zlib support; 'mingw32-make mingw32-ssl-zlib' to build with SSL and Zlib enabled; 'mingw32-make mingw32-ssh2-ssl-zlib' to build with SSH2, SSL, Zlib; 'mingw32-make mingw32-ssh2-ssl-sspi-zlib' to build with SSH2, SSL, Zlib and SSPI support. If you have any problems linking libraries or finding header files, be sure to verify that the provided "Makefile.m32" files use the proper paths, and adjust as necessary. It is also possible to override these paths with environment variables, for example: set ZLIB_PATH=c:\zlib-1.2.8 set OPENSSL_PATH=c:\openssl-0.9.8y set LIBSSH2_PATH=c:\libssh2-1.4.3 ATTENTION: if you want to build with libssh2 support you have to use latest version 0.17 - previous versions will NOT work with 7.17.0 and later! Use 'mingw32-make mingw32-ssh2-ssl-zlib' to build with SSH2 and SSL enabled. It is now also possible to build with other LDAP SDKs than MS LDAP; currently it is possible to build with native Win32 OpenLDAP, or with the Novell CLDAP SDK. If you want to use these you need to set these vars: set LDAP_SDK=c:\openldap set USE_LDAP_OPENLDAP=1 or for using the Novell SDK: set USE_LDAP_NOVELL=1 If you want to enable LDAPS support then set LDAPS=1. - optional MingW32-built OpenLDAP SDK available from: http://www.gknw.net/mirror/openldap/ - optional recent Novell CLDAP SDK available from: http://developer.novell.com/ndk/cldap.htm Cygwin ------ Almost identical to the unix installation. Run the configure script in the curl root with 'sh configure'. Make sure you have the sh executable in /bin/ or you'll see the configure fail toward the end. Run 'make' Dev-Cpp ------- See the separate INSTALL.devcpp file for details. MSVC 6 caveats -------------- If you use MSVC 6 it is required that you use the February 2003 edition PSDK: http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm Building any software with MSVC 6 without having PSDK installed is just asking for trouble down the road once you have released it, you might notice the problems in the first corner or ten miles ahead, depending mostly on your choice of static vs dynamic runtime and third party libraries. Anyone using software built in such way will at some point regret having done so. When someone uses MSVC 6 without PSDK he is using a compiler back from 1998. If the compiler has been updated with the installation of a service pack as those mentioned in http://support.microsoft.com/kb/194022 the compiler can be safely used to read source code, translate and make it object code. But, even with the service packs mentioned above installed, the resulting software generated in such an environment will be using outdated system header files and libraries with bugs and security issues which have already been addressed and fixed long time ago. In order to make use of the updated system headers and fixed libraries for MSVC 6, it is required that 'Platform SDK', PSDK from now onwards, is installed. The specific PSDK that must be installed for MSVC 6 is the February 2003 edition, which is the latest one supporting the MSVC 6 compiler, this PSDK is also known as 'Windows Server 2003 PSDK' and can be downloaded from http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm So, building curl and libcurl with MSVC 6 without PSDK is absolutely discouraged for the benefit of anyone using software built in such environment. And it will not be supported in any way, as we could just be hunting bugs which have already been fixed way back in 2003. When building with MSVC 6 we attempt to detect if PSDK is not being used, and if this is the case the build process will fail hard with an error message stating that the February 2003 PSDK is required. This is done to protect the unsuspecting and avoid PEBKAC issues. Additionally it might happen that a die hard MSVC hacker still wants to build curl and libcurl with MSVC 6 without PSDK installed, even knowing that this is a highly discouraged and unsupported build environment. In this case the brave of heart will be able to build in such an environment with the requisite of defining preprocessor symbol ALLOW_MSVC6_WITHOUT_PSDK in lib/config-win32.h and knowing that LDAP and IPv6 support will be missing. MSVC from command line ---------------------- Run the 'vcvars32.bat' file to get a proper environment. The vcvars32.bat file is part of the Microsoft development environment and you may find it in 'C:\Program Files\Microsoft Visual Studio\vc98\bin' provided that you installed Visual C/C++ 6 in the default directory. Then run 'nmake vc' in curl's root directory. If you want to compile with zlib support, you will need to build zlib (http://www.gzip.org/zlib/) as well. Please read the zlib documentation on how to compile zlib. Define the ZLIB_PATH environment variable to the location of zlib.h and zlib.lib, for example: set ZLIB_PATH=c:\zlib-1.2.8 Then run 'nmake vc-zlib' in curl's root directory. If you want to compile with SSL support you need the OpenSSL package. Please read the OpenSSL documentation on how to compile and install the OpenSSL libraries. The build process of OpenSSL generates the libeay32.dll and ssleay32.dll files in the out32dll subdirectory in the OpenSSL home directory. OpenSSL static libraries (libeay32.lib, ssleay32.lib, RSAglue.lib) are created in the out32 subdirectory. Before running nmake define the OPENSSL_PATH environment variable with the root/base directory of OpenSSL, for example: set OPENSSL_PATH=c:\openssl-0.9.8y Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root directory. 'nmake vc-ssl' will create a libcurl static and dynamic libraries in the lib subdirectory, as well as a statically linked version of curl.exe in the src subdirectory. This statically linked version is a standalone executable not requiring any DLL at runtime. This make method requires that you have the static OpenSSL libraries available in OpenSSL's out32 subdirectory. 'nmake vc-ssl-dll' creates the libcurl dynamic library and links curl.exe against libcurl and OpenSSL dynamically. This executable requires libcurl.dll and the OpenSSL DLLs at runtime. Run 'nmake vc-ssl-zlib' to build with both ssl and zlib support. MSVC 6 IDE ---------- A minimal VC++ 6.0 reference workspace (vc6curl.dsw) is available with the source distribution archive to allow proper building of the two included projects, the libcurl library and the curl tool. 1) Open the vs/vc6/vc6curl.dsw workspace with MSVC6's IDE. 2) Select 'Build' from top menu. 3) Select 'Batch Build' from dropdown menu. 4) Make sure that the eight project configurations are 'checked'. 5) Click on the 'Build' button. 6) Once the eight project configurations are built you are done. Dynamic and static libcurl libraries are built in debug and release flavours, and can be located each one in its own subdirectory, dll-debug, dll-release, lib-debug and lib-release, all of them below the 'vs/vc6/lib' subdirectory. In the same way four curl executables are created, each using its respective library. The resulting curl executables are located in its own subdirectory, dll-debug, dll-release, lib-debug and lib-release, below 'vs/vc6/src' subdir. These reference VC++ 6.0 configurations are generated using the dynamic CRT. Intentionally, these reference VC++ 6.0 projects and configurations don't use third party libraries, such as OpenSSL or Zlib, to allow proper compilation and configuration for all new users without further requirements. If you need something more 'involved' you might adjust them for your own use, or explore the world of makefiles described above 'MSVC from command line'. Borland C++ compiler --------------------- Ensure that your build environment is properly set up to use the compiler and associated tools. PATH environment variable must include the path to bin subdirectory of your compiler installation, eg: c:\Borland\BCC55\bin It is advisable to set environment variable BCCDIR to the base path of the compiler installation. set BCCDIR=c:\Borland\BCC55 In order to build a plain vanilla version of curl and libcurl run the following command from curl's root directory: make borland To build curl and libcurl with zlib and OpenSSL support set environment variables ZLIB_PATH and OPENSSL_PATH to the base subdirectories of the already built zlib and OpenSSL libraries and from curl's root directory run command: make borland-ssl-zlib libcurl library will be built in 'lib' subdirectory while curl tool is built in 'src' subdirectory. In order to use libcurl library it is advisable to modify compiler's configuration file bcc32.cfg located in c:\Borland\BCC55\bin to reflect the location of libraries include paths for example the '-I' line could result in something like: -I"c:\Borland\BCC55\include;c:\curl\include;c:\openssl\inc32" bcc3.cfg '-L' line could also be modified to reflect the location of of libcurl library resulting for example: -L"c:\Borland\BCC55\lib;c:\curl\lib;c:\openssl\out32" In order to build sample program 'simple.c' from the docs\examples subdirectory run following command from mentioned subdirectory: bcc32 simple.c libcurl.lib cw32mt.lib In order to build sample program simplessl.c an SSL enabled libcurl is required, as well as the OpenSSL libeay32.lib and ssleay32.lib libraries. OTHER MSVC IDEs --------------- If you use VC++, Borland or similar compilers. Include all lib source files in a static lib "project" (all .c and .h files that is). (you should name it libcurl or similar) Make the sources in the src/ drawer be a "win32 console application" project. Name it curl. Disabling Specific Protocols in Win32 builds -------------------------------------------- The configure utility, unfortunately, is not available for the Windows environment, therefore, you cannot use the various disable-protocol options of the configure utility on this platform. However, you can use the following defines to disable specific protocols: HTTP_ONLY disables all protocols except HTTP CURL_DISABLE_FTP disables FTP CURL_DISABLE_LDAP disables LDAP CURL_DISABLE_TELNET disables TELNET CURL_DISABLE_DICT disables DICT CURL_DISABLE_FILE disables FILE CURL_DISABLE_TFTP disables TFTP CURL_DISABLE_HTTP disables HTTP If you want to set any of these defines you have the following possibilities: - Modify lib/config-win32.h - Modify lib/curl_setup.h - Modify lib/Makefile.vc6 - Add defines to Project/Settings/C/C++/General/Preprocessor Definitions in the vc6libcurl.dsw/vc6libcurl.dsp Visual C++ 6 IDE project. Using BSD-style lwIP instead of Winsock TCP/IP stack in Win32 builds -------------------------------------------------------------------- In order to compile libcurl and curl using BSD-style lwIP TCP/IP stack it is necessary to make definition of preprocessor symbol USE_LWIPSOCK visible to libcurl and curl compilation processes. To set this definition you have the following alternatives: - Modify lib/config-win32.h and src/config-win32.h - Modify lib/Makefile.vc6 - Add definition to Project/Settings/C/C++/General/Preprocessor Definitions in the vc6libcurl.dsw/vc6libcurl.dsp Visual C++ 6 IDE project. Once that libcurl has been built with BSD-style lwIP TCP/IP stack support, in order to use it with your program it is mandatory that your program includes lwIP header file <lwip/opt.h> (or another lwIP header that includes this) before including any libcurl header. Your program does not need the USE_LWIPSOCK preprocessor definition which is for libcurl internals only. Compilation has been verified with lwIP 1.4.0 and contrib-1.4.0 from: http://download.savannah.gnu.org/releases/lwip/lwip-1.4.0.zip http://download.savannah.gnu.org/releases/lwip/contrib-1.4.0.zip This BSD-style lwIP TCP/IP stack support must be considered experimental given that it has been verified that lwIP 1.4.0 still needs some polish, and libcurl might yet need some additional adjustment, caveat emptor. Important static libcurl usage note ----------------------------------- When building an application that uses the static libcurl library, you must add '-DCURL_STATICLIB' to your CFLAGS. Otherwise the linker will look for dynamic import symbols. Apple iOS and Mac OS X ====================== On recent Apple operating systems, curl can be built to use Apple's SSL/TLS implementation, Secure Transport, instead of OpenSSL. To build with Secure Transport for SSL/TLS, use the configure option --with-darwinssl. (It is not necessary to use the option --without-ssl.) This feature requires iOS 5.0 or later, or OS X 10.5 ("Leopard") or later. When Secure Transport is in use, the curl options --cacert and --capath and their libcurl equivalents, will be ignored, because Secure Transport uses the certificates stored in the Keychain to evaluate whether or not to trust the server. This, of course, includes the root certificates that ship with the OS. The --cert and --engine options, and their libcurl equivalents, are currently unimplemented in curl with Secure Transport. For OS X users: In OS X 10.8 ("Mountain Lion"), Apple made a major overhaul to the Secure Transport API that, among other things, added support for the newer TLS 1.1 and 1.2 protocols. To get curl to support TLS 1.1 and 1.2, you must build curl on Mountain Lion or later, or by using the equivalent SDK. If you set the MACOSX_DEPLOYMENT_TARGET environmental variable to an earlier version of OS X prior to building curl, then curl will use the new Secure Transport API on Mountain Lion and later, and fall back on the older API when the same curl binary is executed on older cats. For example, running these commands in curl's directory in the shell will build the code such that it will run on cats as old as OS X 10.6 ("Snow Leopard") (using bash): export MACOSX_DEPLOYMENT_TARGET="10.6" ./configure --with-darwinssl make IBM OS/2 ======== Building under OS/2 is not much different from building under unix. You need: - emx 0.9d - GNU make - GNU patch - ksh - GNU bison - GNU file utilities - GNU sed - autoconf 2.13 If you want to build with OpenSSL or OpenLDAP support, you'll need to download those libraries, too. Dirk Ohme has done some work to port SSL libraries under OS/2, but it looks like he doesn't care about emx. You'll find his patches on: http://come.to/Dirk_Ohme If during the linking you get an error about _errno being an undefined symbol referenced from the text segment, you need to add -D__ST_MT_ERRNO__ in your definitions. If everything seems to work fine but there's no curl.exe, you need to add -Zexe to your linker flags. If you're getting huge binaries, probably your makefiles have the -g in CFLAGS. VMS === (The VMS section is in whole contributed by the friendly Nico Baggus) Curl seems to work with FTP & HTTP other protocols are not tested. (the perl http/ftp testing server supplied as testing too cannot work on VMS because vms has no concept of fork(). [ I tried to give it a whack, but that's of no use. SSL stuff has not been ported. Telnet has about the same issues as for Win32. When the changes for Win32 are clear maybe they'll work for VMS too. The basic problem is that select ONLY works for sockets. Marked instances of fopen/[f]stat that might become a problem, especially for non stream files. In this regard, the files opened for writing will be created stream/lf and will thus be safe. Just keep in mind that non-binary read/wring from/to files will have a records size limit of 32767 bytes imposed. Stat to get the size of the files is again only safe for stream files & fixed record files without implied CC. -- My guess is that only allowing access to stream files is the quickest way to get around the most issues. Therefore all files need to to be checked to be sure they will be stream/lf before processing them. This is the easiest way out, I know. The reason for this is that code that needs to report the filesize will become a pain in the ass otherwise. Exit status.... Well we needed something done here, VMS has a structured exist status: | 3 | 2 | 1 | 0| |1098|765432109876|5432109876543|210| +----+------------+-------------+---+ |Ctrl| Facility | Error code |sev| +----+------------+-------------+---+ With the Ctrl-bits an application can tell if part or the whole message has already been printed from the program, DCL doesn't need to print it again. Facility - basically the program ID. A code assigned to the program the name can be fetched from external or internal message libraries Error code - the err codes assigned by the application Sev. - severity: Even = error, off = non error 0 = Warning 1 = Success 2 = Error 3 = Information 4 = Fatal <5-7> reserved. This all presents itself with: %<FACILITY>-<Sev>-<Errorname>, <Error message> See also the src/curlmsg.msg file, it has the source for the messages In src/main.c a section is devoted to message status values, the globalvalues create symbols with certain values, referenced from a compiled message file. Have all exit function use a exit status derived from a translation table with the compiled message codes. This was all compiled with: Compaq C V6.2-003 on OpenVMS Alpha V7.1-1H2 So far for porting notes as of: 13-jul-2001 N. Baggus QNX === (This section was graciously brought to us by David Bentham) As QNX is targeted for resource constrained environments, the QNX headers set conservative limits. This includes the FD_SETSIZE macro, set by default to 32. Socket descriptors returned within the CURL library may exceed this, resulting in memory faults/SIGSEGV crashes when passed into select(..) calls using fd_set macros. A good all-round solution to this is to override the default when building libcurl, by overriding CFLAGS during configure, example # configure CFLAGS='-DFD_SETSIZE=64 -g -O2' RISC OS ======= The library can be cross-compiled using gccsdk as follows: CC=riscos-gcc AR=riscos-ar RANLIB='riscos-ar -s' ./configure \ --host=arm-riscos-aof --without-random --disable-shared make where riscos-gcc and riscos-ar are links to the gccsdk tools. You can then link your program with curl/lib/.libs/libcurl.a AmigaOS ======= (This section was graciously brought to us by Diego Casorran) To build cURL/libcurl on AmigaOS just type 'make amiga' ... What you need is: (not tested with others versions) GeekGadgets / gcc 2.95.3 (http://www.geekgadgets.org/) AmiTCP SDK v4.3 (http://www.aminet.net/comm/tcp/AmiTCP-SDK-4.3.lha) Native Developer Kit (http://www.amiga.com/3.9/download/NDK3.9.lha) As no ixemul.library is required you will be able to build it for WarpOS/PowerPC (not tested by me), as well a MorphOS version should be possible with no problems. To enable SSL support, you need a OpenSSL native version (without ixemul), you can find a precompiled package at http://amiga.sourceforge.net/OpenSSL/ NetWare ======= To compile curl.nlm / libcurl.nlm you need: - either any gcc / nlmconv, or CodeWarrior 7 PDK 4 or later. - gnu make and awk running on the platform you compile on; native Win32 versions can be downloaded from: http://www.gknw.net/development/prgtools/ - recent Novell LibC SDK available from: http://developer.novell.com/ndk/libc.htm - or recent Novell CLib SDK available from: http://developer.novell.com/ndk/clib.htm - optional recent Novell CLDAP SDK available from: http://developer.novell.com/ndk/cldap.htm - optional zlib sources (static or dynamic linking with zlib.imp); sources with NetWare Makefile can be obtained from: http://www.gknw.net/mirror/zlib/ - optional OpenSSL sources (version 0.9.8 or later build with BSD sockets); you can find precompiled packages at: http://www.gknw.net/development/ossl/netware/ for CLIB-based builds OpenSSL 0.9.8h or later is required - earlier versions don't support building with CLIB BSD sockets. - optional SSH2 sources (version 0.17 or later); Set a search path to your compiler, linker and tools; on Linux make sure that the var OSTYPE contains the string 'linux'; set the var NDKBASE to point to the base of your Novell NDK; and then type 'make netware' from the top source directory; other targets available are 'netware-ssl', 'netware-ssl-zlib', 'netware-zlib' and 'netware-ares'; if you need other combinations you can control the build with the environment variables WITH_SSL, WITH_ZLIB, WITH_ARES, WITH_SSH2, and ENABLE_IPV6; you can set LINK_STATIC=1 to link curl.nlm statically. By default LDAP support is enabled, however currently you will need a patch in order to use the CLDAP NDK with BSD sockets (Novell Bug 300237): http://www.gknw.net/test/curl/cldap_ndk/ldap_ndk.diff I found on some Linux systems (RH9) that OS detection didn't work although a 'set | grep OSTYPE' shows the var present and set; I simply overwrote it with 'OSTYPE=linux-rh9-gnu' and the detection in the Makefile worked... Any help in testing appreciated! Builds automatically created 8 times a day from current git are here: http://www.gknw.net/mirror/curl/autobuilds/ the status of these builds can be viewed at the autobuild table: http://curl.haxx.se/dev/builds.html eCos ==== curl does not use the eCos build system, so you must first build eCos separately, then link curl to the resulting eCos library. Here's a sample configure line to do so on an x86 Linux box targeting x86: GCCLIB=`gcc -print-libgcc-file-name` && \ CFLAGS="-D__ECOS=1 -nostdinc -I$ECOS_INSTALL/include \ -I`dirname $GCCLIB`/include" \ LDFLAGS="-nostdlib -Wl,--gc-sections -Wl,-static \ -L$ECOS_INSTALL/lib -Ttarget.ld -ltarget" \ ./configure --host=i386 --disable-shared \ --without-ssl --without-zlib --disable-manual --disable-ldap In most cases, eCos users will be using libcurl from within a custom embedded application. Using the standard 'curl' executable from within eCos means facing the limitation of the standard eCos C startup code which does not allow passing arguments in main(). To run 'curl' from eCos and have it do something useful, you will need to either modify the eCos startup code to pass in some arguments, or modify the curl application itself to retrieve its arguments from some location set by the bootloader or hard-code them. Something like the following patch could be used to hard-code some arguments. The MTAB_ENTRY line mounts a RAM disk as the root filesystem (without mounting some kind of filesystem, eCos errors out all file operations which curl does not take to well). The next section synthesizes some command-line arguments for curl to use, in this case to direct curl to read further arguments from a file. It then creates that file on the RAM disk and places within it a URL to download: a file: URL that just happens to point to the configuration file itself. The results of running curl in this way is the contents of the configuration file printed to the console. --- src/main.c 19 Jul 2006 19:09:56 -0000 1.363 +++ src/main.c 24 Jul 2006 21:37:23 -0000 @@ -4286,11 +4286,31 @@ } +#ifdef __ECOS +#include <cyg/fileio/fileio.h> +MTAB_ENTRY( testfs_mte1, + "/", + "ramfs", + "", + 0); +#endif int main(int argc, char *argv[]) { int res; struct Configurable config; +#ifdef __ECOS + char *args[] = {"ecos-curl", "-K", "curlconf.txt"}; + FILE *f; + argc = sizeof(args)/sizeof(args[0]); + argv = args; + + f = fopen("curlconf.txt", "w"); + if (f) { + fprintf(f, "--url file:curlconf.txt"); + fclose(f); + } +#endif memset(&config, 0, sizeof(struct Configurable)); config.errors = stderr; /* default errors to stderr */ Minix ===== curl can be compiled on Minix 3 using gcc or ACK (starting with ver. 3.1.3). Ensure that GNU gawk and bash are both installed and available in the PATH. ACK --- Increase the heap sizes of the compiler with the command: binsizes xxl then configure and compile curl with: ./configure CC=cc LD=cc AR=/usr/bin/aal GREP=grep \ CPPFLAGS='-D_POSIX_SOURCE=1 -I/usr/local/include' make chmem =256000 src/curl GCC --- Make sure gcc is in your PATH with the command: export PATH=/usr/gnu/bin:$PATH then configure and compile curl with: ./configure CC=gcc AR=/usr/gnu/bin/gar GREP=grep make chmem =256000 src/curl Symbian OS ========== The Symbian OS port uses the Symbian build system to compile. From the packages/Symbian/group/ directory, run: bldmake bldfiles abld build to compile and install curl and libcurl using SBSv1. If your Symbian SDK doesn't include support for P.I.P.S., you will need to contact your SDK vendor to obtain that first. VxWorks ======== Build for VxWorks is performed using cross compilation. That means you build on Windows machine using VxWorks tools and run the built image on the VxWorks device. To build libcurl for VxWorks you need: - CYGWIN (free, http://cygwin.com/) - Wind River Workbench (commercial) If you have CYGWIN and Workbench installed on you machine follow after next steps: 1. Open the Command Prompt window and change directory ('cd') to the libcurl 'lib' folder. 2. Add CYGWIN 'bin' folder to the PATH environment variable. For example, type 'set PATH=C:/embedded/cygwin/bin;%PATH%'. 3. Adjust environment variables defined in 'Environment' section of the Makefile.vxworks file to point to your software folders. 4. Build the libcurl by typing 'make -f ./Makefile.vxworks' As a result the libcurl.a library should be created in the 'lib' folder. To clean the build results type 'make -f ./Makefile.vxworks clean'. Android ======= Method using the static makefile: - see the build notes in the packages/Android/Android.mk file. Method using a configure cross-compile (tested with Android NDK r7c, r8): - prepare the toolchain of the Android NDK for standalone use; this can be done by invoking the script: ./build/tools/make-standalone-toolchain.sh which creates a usual cross-compile toolchain. Lets assume that you put this toolchain below /opt then invoke configure with something like: export PATH=/opt/arm-linux-androideabi-4.4.3/bin:$PATH ./configure --host=arm-linux-androideabi [more configure options] make - if you want to compile directly from our GIT repo you might run into this issue with older automake stuff: checking host system type... Invalid configuration `arm-linux-androideabi': system `androideabi' not recognized configure: error: /bin/sh ./config.sub arm-linux-androideabi failed this issue can be fixed with using more recent versions of config.sub and config.guess which can be obtained here: http://git.savannah.gnu.org/gitweb/?p=config.git;a=tree you need to replace your system-own versions which usually can be found in your automake folder: find /usr -name config.sub Wrapper for pkg-config - In order to make proper use of pkg-config so that configure is able to find all dependencies you should create a wrapper script for pkg-config; file /opt/arm-linux-androideabi-4.4.3/bin/arm-linux-androideabi-pkg-config: #!/bin/sh SYSROOT=$(dirname ${0%/*})/sysroot export PKG_CONFIG_DIR= export PKG_CONFIG_LIBDIR=${SYSROOT}/usr/local/lib/pkgconfig:${SYSROOT}/usr/share/pkgconfig export PKG_CONFIG_SYSROOT_DIR=${SYSROOT} exec pkg-config "$@" also create a copy or symlink with name arm-unknown-linux-androideabi-pkg-config. CROSS COMPILE ============= (This section was graciously brought to us by Jim Duey, with additions by Dan Fandrich) Download and unpack the cURL package. 'cd' to the new directory. (e.g. cd curl-7.12.3) Set environment variables to point to the cross-compile toolchain and call configure with any options you need. Be sure and specify the '--host' and '--build' parameters at configuration time. The following script is an example of cross-compiling for the IBM 405GP PowerPC processor using the toolchain from MonteVista for Hardhat Linux. (begin script) #! /bin/sh export PATH=$PATH:/opt/hardhat/devkit/ppc/405/bin export CPPFLAGS="-I/opt/hardhat/devkit/ppc/405/target/usr/include" export AR=ppc_405-ar export AS=ppc_405-as export LD=ppc_405-ld export RANLIB=ppc_405-ranlib export CC=ppc_405-gcc export NM=ppc_405-nm ./configure --target=powerpc-hardhat-linux \ --host=powerpc-hardhat-linux \ --build=i586-pc-linux-gnu \ --prefix=/opt/hardhat/devkit/ppc/405/target/usr/local \ --exec-prefix=/usr/local (end script) You may also need to provide a parameter like '--with-random=/dev/urandom' to configure as it cannot detect the presence of a random number generating device for a target system. The '--prefix' parameter specifies where cURL will be installed. If 'configure' completes successfully, do 'make' and 'make install' as usual. In some cases, you may be able to simplify the above commands to as little as: ./configure --host=ARCH-OS REDUCING SIZE ============= There are a number of configure options that can be used to reduce the size of libcurl for embedded applications where binary size is an important factor. First, be sure to set the CFLAGS variable when configuring with any relevant compiler optimization flags to reduce the size of the binary. For gcc, this would mean at minimum the -Os option, and potentially the -march=X and -mdynamic-no-pic options as well, e.g. ./configure CFLAGS='-Os' ... Note that newer compilers often produce smaller code than older versions due to improved optimization. Be sure to specify as many --disable- and --without- flags on the configure command-line as you can to disable all the libcurl features that you know your application is not going to need. Besides specifying the --disable-PROTOCOL flags for all the types of URLs your application will not use, here are some other flags that can reduce the size of the library: --disable-ares (disables support for the C-ARES DNS library) --disable-cookies (disables support for HTTP cookies) --disable-crypto-auth (disables HTTP cryptographic authentication) --disable-ipv6 (disables support for IPv6) --disable-manual (disables support for the built-in documentation) --disable-proxy (disables support for HTTP and SOCKS proxies) --disable-verbose (eliminates debugging strings and error code strings) --enable-hidden-symbols (eliminates unneeded symbols in the shared library) --without-libidn (disables support for the libidn DNS library) --without-librtmp (disables support for RTMP) --without-ssl (disables support for SSL/TLS) --without-zlib (disables support for on-the-fly decompression) The GNU compiler and linker have a number of options that can reduce the size of the libcurl dynamic libraries on some platforms even further. Specify them by providing appropriate CFLAGS and LDFLAGS variables on the configure command-line, e.g. CFLAGS="-Os -ffunction-sections -fdata-sections \ -fno-unwind-tables -fno-asynchronous-unwind-tables" \ LDFLAGS="-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections" Be sure also to strip debugging symbols from your binaries after compiling using 'strip' (or the appropriate variant if cross-compiling). If space is really tight, you may be able to remove some unneeded sections of the shared library using the -R option to objcopy (e.g. the .comment section). Using these techniques it is possible to create a basic HTTP-only shared libcurl library for i386 Linux platforms that is only 114 KiB in size, and an FTP-only library that is 115 KiB in size (as of libcurl version 7.34.1, using gcc 4.8.2). You may find that statically linking libcurl to your application will result in a lower total size than dynamically linking. Note that the curl test harness can detect the use of some, but not all, of the --disable statements suggested above. Use will cause tests relying on those features to fail. The test harness can be manually forced to skip the relevant tests by specifying certain key words on the runtests.pl command line. Following is a list of appropriate key words: --disable-cookies !cookies --disable-crypto-auth !HTTP\ Digest\ auth !HTTP\ proxy\ Digest\ auth --disable-manual !--manual --disable-proxy !HTTP\ proxy !proxytunnel !SOCKS4 !SOCKS5 PORTS ===== This is a probably incomplete list of known hardware and operating systems that curl has been compiled for. If you know a system curl compiles and runs on, that isn't listed, please let us know! - Alpha DEC OSF 4 - Alpha Digital UNIX v3.2 - Alpha FreeBSD 4.1, 4.5 - Alpha Linux 2.2, 2.4 - Alpha NetBSD 1.5.2 - Alpha OpenBSD 3.0 - Alpha OpenVMS V7.1-1H2 - Alpha Tru64 v5.0 5.1 - AVR32 Linux - ARM Android 1.5, 2.1, 2.3, 3.2, 4.x - ARM INTEGRITY - ARM iOS - Cell Linux - Cell Cell OS - HP-PA HP-UX 9.X 10.X 11.X - HP-PA Linux - HP3000 MPE/iX - MicroBlaze uClinux - MIPS IRIX 6.2, 6.5 - MIPS Linux - OS/400 - Pocket PC/Win CE 3.0 - Power AIX 3.2.5, 4.2, 4.3.1, 4.3.2, 5.1, 5.2 - PowerPC Darwin 1.0 - PowerPC INTEGRITY - PowerPC Linux - PowerPC Mac OS 9 - PowerPC Mac OS X - SH4 Linux 2.6.X - SH4 OS21 - SINIX-Z v5 - Sparc Linux - Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8, 9, 10 - Sparc SunOS 4.1.X - StrongARM (and other ARM) RISC OS 3.1, 4.02 - StrongARM/ARM7/ARM9 Linux 2.4, 2.6 - StrongARM NetBSD 1.4.1 - Symbian OS (P.I.P.S.) 9.x - TPF - Ultrix 4.3a - UNICOS 9.0 - i386 BeOS - i386 DOS - i386 eCos 1.3.1 - i386 Esix 4.1 - i386 FreeBSD - i386 HURD - i386 Haiku OS - i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4, 2.6 - i386 Mac OS X - i386 MINIX 3.1 - i386 NetBSD - i386 Novell NetWare - i386 OS/2 - i386 OpenBSD - i386 QNX 6 - i386 SCO unix - i386 Solaris 2.7 - i386 Windows 95, 98, ME, NT, 2000, XP, 2003 - i486 ncr-sysv4.3.03 (NCR MP-RAS) - ia64 Linux 2.3.99 - m68k AmigaOS 3 - m68k Linux - m68k uClinux - m68k OpenBSD - m88k dg-dgux5.4R3.00 - s390 Linux - x86_64 Linux - XScale/PXA250 Linux 2.4 - Nios II uClinux Useful URLs =========== axTLS http://axtls.sourceforge.net/ c-ares http://c-ares.haxx.se/ GNU GSS http://www.gnu.org/software/gss/ GnuTLS http://www.gnu.org/software/gnutls/ Heimdal http://www.pdc.kth.se/heimdal/ libidn http://www.gnu.org/software/libidn/ libmetalink https://launchpad.net/libmetalink/ libssh2 http://www.libssh2.org/ MIT Kerberos http://web.mit.edu/kerberos/www/dist/ NSS http://www.mozilla.org/projects/security/pki/nss/ OpenLDAP http://www.openldap.org/ OpenSSL http://www.openssl.org/ PolarSSL http://polarssl.org/ yassl http://www.yassl.com/ Zlib http://www.zlib.net/ MingW http://www.mingw.org/ MinGW-w64 http://mingw-w64.sourceforge.net/ OpenWatcom http://www.openwatcom.org/ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������curl-7.35.0/docs/curl.html��������������������������������������������������������������������������0000644�0001750�0001750�00000405507�12272124467�012301� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head> <title>curl man page

NAME

curl - transfer a URL

SYNOPSIS

curl [options] [URL...]

DESCRIPTION

curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction.

curl offers a busload of useful tricks like proxy support, user authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer resume, Metalink, and more. As you will see below, the number of features will make your head spin!

curl is powered by libcurl for all transfer-related features. See libcurl (3) for details.

URL

The URL syntax is protocol-dependent. You'll find a detailed description in RFC 3986.

You can specify multiple URLs or parts of URLs by writing part sets within braces as in:

 http://site.{one,two,three}.com

or you can get sequences of alphanumeric series by using [] as in:

 ftp://ftp.numericals.com/file[1-100].txt  ftp://ftp.numericals.com/file[001-100].txt (with leading zeros)  ftp://ftp.letters.com/file[a-z].txt

Nested sequences are not supported, but you can use several ones next to each other:

 http://any.org/archive[1996-1999]/vol[1-4]/part{a,b,c}.html

You can specify any amount of URLs on the command line. They will be fetched in a sequential manner in the specified order.

You can specify a step counter for the ranges to get every Nth number or letter:

 http://www.numericals.com/file[1-100:10].txt  http://www.letters.com/file[a-z:2].txt

If you specify URL without protocol:// prefix, curl will attempt to guess what protocol you might want. It will then default to HTTP but try other protocols based on often-used host name prefixes. For example, for host names starting with "ftp." curl will assume you want to speak FTP.

curl will do its best to use what you pass to it as a URL. It is not trying to validate it as a syntactically correct URL by any means but is instead very liberal with what it accepts.

curl will attempt to re-use connections for multiple file transfers, so that getting many files from the same server will not do multiple connects / handshakes. This improves speed. Of course this is only done on files specified on a single command line and cannot be used between separate curl invokes.

PROGRESS METER

curl normally displays a progress meter during operations, indicating the amount of transferred data, transfer speeds and estimated time left, etc.

curl displays this data to the terminal by default, so if you invoke curl to do an operation and it is about to write data to the terminal, it disables the progress meter as otherwise it would mess up the output mixing progress meter and response data.

If you want a progress meter for HTTP POST or PUT requests, you need to redirect the response output to a file, using shell redirect (>), -o [file] or similar.

It is not the same case for FTP upload as that operation does not spit out any response data to the terminal.

If you prefer a progress "bar" instead of the regular meter, -# is your friend.

OPTIONS

Options start with one or two dashes. Many of the options require an addition value next to it.

The short "single-dash" form of the options, -d for example, may be used with or without a space between it and its value, although a space is a recommended separator. The long "double-dash" form, --data for example, requires a space between it and its value.

Short version options that don't need any additional values can be used immediately next to each other, like for example you can specify all the options -O, -L and -v at once as -OLv.

In general, all boolean options are enabled with --option and yet again disabled with --no-option. That is, you use the exact same option name but prefix it with "no-". However, in this list we mostly only list and show the --option version of them. (This concept with --no options was added in 7.19.0. Previously most options were toggled on/off on repeated use of the same command line option.)

-#, --progress-bar

Make curl display progress as a simple progress bar instead of the standard, more informational, meter.

-0, --http1.0

(HTTP) Tells curl to use HTTP version 1.0 instead of using its internally preferred: HTTP 1.1.

--http1.1

(HTTP) Tells curl to use HTTP version 1.1. This is the internal default version. (Added in 7.33.0)

--http2.0

(HTTP) Tells curl to issue its requests using HTTP 2.0. This requires that the underlying libcurl was built to support it. (Added in 7.33.0)

-1, --tlsv1

(SSL) Forces curl to use TLS version 1 when negotiating with a remote TLS server.

-2, --sslv2

(SSL) Forces curl to use SSL version 2 when negotiating with a remote SSL server.

-3, --sslv3

(SSL) Forces curl to use SSL version 3 when negotiating with a remote SSL server.

-4, --ipv4

If curl is capable of resolving an address to multiple IP versions (which it is if it is IPv6-capable), this option tells curl to resolve names to IPv4 addresses only.

-6, --ipv6

If curl is capable of resolving an address to multiple IP versions (which it is if it is IPv6-capable), this option tells curl to resolve names to IPv6 addresses only.

-a, --append

(FTP/SFTP) When used in an upload, this will tell curl to append to the target file instead of overwriting it. If the file doesn't exist, it will be created. Note that this flag is ignored by some SSH servers (including OpenSSH).

-A, --user-agent <agent string>

(HTTP) Specify the User-Agent string to send to the HTTP server. Some badly done CGIs fail if this field isn't set to "Mozilla/4.0". To encode blanks in the string, surround the string with single quote marks. This can also be set with the -H, --header option of course.

If this option is used several times, the last one will be used.

--anyauth

(HTTP) Tells curl to figure out authentication method by itself, and use the most secure one the remote site claims to support. This is done by first doing a request and checking the response-headers, thus possibly inducing an extra network round-trip. This is used instead of setting a specific authentication method, which you can do with --basic, --digest, --ntlm, and --negotiate.

Note that using --anyauth is not recommended if you do uploads from stdin, since it may require data to be sent twice and then the client must be able to rewind. If the need should arise when uploading from stdin, the upload operation will fail.

-b, --cookie <name=data>

(HTTP) Pass the data to the HTTP server as a cookie. It is supposedly the data previously received from the server in a "Set-Cookie:" line. The data should be in the format "NAME1=VALUE1; NAME2=VALUE2".

If no '=' symbol is used in the line, it is treated as a filename to use to read previously stored cookie lines from, which should be used in this session if they match. Using this method also activates the "cookie parser" which will make curl record incoming cookies too, which may be handy if you're using this in combination with the -L, --location option. The file format of the file to read cookies from should be plain HTTP headers or the Netscape/Mozilla cookie file format.

NOTE that the file specified with -b, --cookie is only used as input. No cookies will be stored in the file. To store cookies, use the -c, --cookie-jar option or you could even save the HTTP headers to a file using -D, --dump-header!

If this option is used several times, the last one will be used.

-B, --use-ascii

(FTP/LDAP) Enable ASCII transfer. For FTP, this can also be enforced by using an URL that ends with ";type=A". This option causes data sent to stdout to be in text mode for win32 systems.

--basic

(HTTP) Tells curl to use HTTP Basic authentication. This is the default and this option is usually pointless, unless you use it to override a previously set option that sets a different authentication method (such as --ntlm, --digest, or --negotiate).

-c, --cookie-jar <file name>

(HTTP) Specify to which file you want curl to write all cookies after a completed operation. Curl writes all cookies previously read from a specified file as well as all cookies received from remote server(s). If no cookies are known, no file will be written. The file will be written using the Netscape cookie file format. If you set the file name to a single dash, "-", the cookies will be written to stdout.

This command line option will activate the cookie engine that makes curl record and use cookies. Another way to activate it is to use the -b, --cookie option.

If the cookie jar can't be created or written to, the whole curl operation won't fail or even report an error clearly. Using -v will get a warning displayed, but that is the only visible feedback you get about this possibly lethal situation.

If this option is used several times, the last specified file name will be used.

-C, --continue-at <offset>

Continue/Resume a previous file transfer at the given offset. The given offset is the exact number of bytes that will be skipped, counting from the beginning of the source file before it is transferred to the destination. If used with uploads, the FTP server command SIZE will not be used by curl.

Use "-C -" to tell curl to automatically find out where/how to resume the transfer. It then uses the given output/input files to figure that out.

If this option is used several times, the last one will be used.

--ciphers <list of ciphers>

(SSL) Specifies which ciphers to use in the connection. The list of ciphers must specify valid ciphers. Read up on SSL cipher list details on this URL: http://www.openssl.org/docs/apps/ciphers.html

NSS ciphers are done differently than OpenSSL and GnuTLS. The full list of NSS ciphers is in the NSSCipherSuite entry at this URL: http://git.fedorahosted.org/cgit/mod_nss.git/plain/docs/mod_nss.html#Directives

If this option is used several times, the last one will be used.

--compressed

(HTTP) Request a compressed response using one of the algorithms curl supports, and save the uncompressed document. If this option is used and the server sends an unsupported encoding, curl will report an error.

--connect-timeout <seconds>

Maximum time in seconds that you allow the connection to the server to take. This only limits the connection phase, once curl has connected this option is of no more use. Since 7.32.0, this option accepts decimal values, but the actual timeout will decrease in accuracy as the specified timeout increases in decimal precision. See also the -m, --max-time option.

If this option is used several times, the last one will be used.

--create-dirs

When used in conjunction with the -o option, curl will create the necessary local directory hierarchy as needed. This option creates the dirs mentioned with the -o option, nothing else. If the -o file name uses no dir or if the dirs it mentions already exist, no dir will be created.

To create remote directories when using FTP or SFTP, try --ftp-create-dirs.

--crlf

(FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).

--crlfile <file>

(HTTPS/FTPS) Provide a file using PEM format with a Certificate Revocation List that may specify peer certificates that are to be considered revoked.

If this option is used several times, the last one will be used.

(Added in 7.19.7)

-d, --data <data>

(HTTP) Sends the specified data in a POST request to the HTTP server, in the same way that a browser does when a user has filled in an HTML form and presses the submit button. This will cause curl to pass the data to the server using the content-type application/x-www-form-urlencoded. Compare to -F, --form.

-d, --data is the same as --data-ascii. To post data purely binary, you should instead use the --data-binary option. To URL-encode the value of a form field you may use --data-urlencode.

If any of these options is used more than once on the same command line, the data pieces specified will be merged together with a separating &-symbol. Thus, using '-d name=daniel -d skill=lousy' would generate a post chunk that looks like 'name=daniel&skill=lousy'.

If you start the data with the letter @, the rest should be a file name to read the data from, or - if you want curl to read the data from stdin. Multiple files can also be specified. Posting data from a file named 'foobar' would thus be done with --data @foobar. When --data is told to read from a file like that, carriage returns and newlines will be stripped out.

-D, --dump-header <file>

Write the protocol headers to the specified file.

This option is handy to use when you want to store the headers that an HTTP site sends to you. Cookies from the headers could then be read in a second curl invocation by using the -b, --cookie option! The -c, --cookie-jar option is however a better way to store cookies.

When used in FTP, the FTP server response lines are considered being "headers" and thus are saved there.

If this option is used several times, the last one will be used.

--data-ascii <data>

See -d, --data.

--data-binary <data>

(HTTP) This posts data exactly as specified with no extra processing whatsoever.

If you start the data with the letter @, the rest should be a filename. Data is posted in a similar manner as --data-ascii does, except that newlines and carriage returns are preserved and conversions are never done.

If this option is used several times, the ones following the first will append data as described in -d, --data.

--data-urlencode <data>

(HTTP) This posts data, similar to the other --data options with the exception that this performs URL-encoding. (Added in 7.18.0)

To be CGI-compliant, the <data> part should begin with a name followed by a separator and a content specification. The <data> part can be passed to curl using one of the following syntaxes:

content

This will make curl URL-encode the content and pass that on. Just be careful so that the content doesn't contain any = or @ symbols, as that will then make the syntax match one of the other cases below!

=content

This will make curl URL-encode the content and pass that on. The preceding = symbol is not included in the data.

name=content

This will make curl URL-encode the content part and pass that on. Note that the name part is expected to be URL-encoded already.

@filename

This will make curl load data from the given file (including any newlines), URL-encode that data and pass it on in the POST.

name@filename

This will make curl load data from the given file (including any newlines), URL-encode that data and pass it on in the POST. The name part gets an equal sign appended, resulting in name=urlencoded-file-content. Note that the name is expected to be URL-encoded already.

--delegation LEVEL

Set LEVEL to tell the server what it is allowed to delegate when it comes to user credentials. Used with GSS/kerberos.

none

Don't allow any delegation.

policy

Delegates if and only if the OK-AS-DELEGATE flag is set in the Kerberos service ticket, which is a matter of realm policy.

always

Unconditionally allow the server to delegate.

--digest

(HTTP) Enables HTTP Digest authentication. This is an authentication scheme that prevents the password from being sent over the wire in clear text. Use this in combination with the normal -u, --user option to set user name and password. See also --ntlm, --negotiate and --anyauth for related options.

If this option is used several times, only the first one is used.

--disable-eprt

(FTP) Tell curl to disable the use of the EPRT and LPRT commands when doing active FTP transfers. Curl will normally always first attempt to use EPRT, then LPRT before using PORT, but with this option, it will use PORT right away. EPRT and LPRT are extensions to the original FTP protocol, and may not work on all servers, but they enable more functionality in a better way than the traditional PORT command.

--eprt can be used to explicitly enable EPRT again and --no-eprt is an alias for --disable-eprt.

Disabling EPRT only changes the active behavior. If you want to switch to passive mode you need to not use -P, --ftp-port or force it with --ftp-pasv.

--disable-epsv

(FTP) Tell curl to disable the use of the EPSV command when doing passive FTP transfers. Curl will normally always first attempt to use EPSV before PASV, but with this option, it will not try using EPSV.

--epsv can be used to explicitly enable EPSV again and --no-epsv is an alias for --disable-epsv.

Disabling EPSV only changes the passive behavior. If you want to switch to active mode you need to use -P, --ftp-port.

--dns-interface <interface>

Tell curl to send outgoing DNS requests through <interface>. This option is a counterpart to --interface (which does not affect DNS). The supplied string must be an interface name (not an address).

This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. (Added in 7.33.0)

--dns-ipv4-addr <ip-address>

Tell curl to bind to <ip-address> when making IPv4 DNS requests, so that the DNS requests originate from this address. The argument should be a single IPv4 address.

This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. (Added in 7.33.0)

--dns-ipv6-addr <ip-address>

Tell curl to bind to <ip-address> when making IPv6 DNS requests, so that the DNS requests originate from this address. The argument should be a single IPv6 address.

This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. (Added in 7.33.0)

--dns-servers <ip-address,ip-address>

Set the list of DNS servers to be used instead of the system default. The list of IP addresses should be separated with commas. Port numbers may also optionally be given as :<port-number> after each IP address.

This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. (Added in 7.33.0)

-e, --referer <URL>

(HTTP) Sends the "Referer Page" information to the HTTP server. This can also be set with the -H, --header flag of course. When used with -L, --location you can append ";auto" to the --referer URL to make curl automatically set the previous URL when it follows a Location: header. The ";auto" string can be used alone, even if you don't set an initial --referer.

If this option is used several times, the last one will be used.

-E, --cert <certificate[:password]>

(SSL) Tells curl to use the specified client certificate file when getting a file with HTTPS, FTPS or another SSL-based protocol. The certificate must be in PKCS#12 format if using Secure Transport, or PEM format if using any other engine. If the optional password isn't specified, it will be queried for on the terminal. Note that this option assumes a "certificate" file that is the private key and the private certificate concatenated! See --cert and --key to specify them independently.

If curl is built against the NSS SSL library then this option can tell curl the nickname of the certificate to use within the NSS database defined by the environment variable SSL_DIR (or by default /etc/pki/nssdb). If the NSS PEM PKCS#11 module (libnsspem.so) is available then PEM files may be loaded. If you want to use a file from the current directory, please precede it with "./" prefix, in order to avoid confusion with a nickname. If the nickname contains ":", it needs to be preceded by "\" so that it is not recognized as password delimiter. If the nickname contains "\", it needs to be escaped as "\\" so that it is not recognized as an escape character.

(iOS and Mac OS X only) If curl is built against Secure Transport, then the certificate string can either be the name of a certificate/private key in the system or user keychain, or the path to a PKCS#12-encoded certificate and private key. If you want to use a file from the current directory, please precede it with "./" prefix, in order to avoid confusion with a nickname.

If this option is used several times, the last one will be used.

--engine <name>

Select the OpenSSL crypto engine to use for cipher operations. Use --engine list to print a list of build-time supported engines. Note that not all (or none) of the engines may be available at run-time.

--environment

(RISC OS ONLY) Sets a range of environment variables, using the names the -w option supports, to allow easier extraction of useful information after having run curl.

--egd-file <file>

(SSL) Specify the path name to the Entropy Gathering Daemon socket. The socket is used to seed the random engine for SSL connections. See also the --random-file option.

--cert-type <type>

(SSL) Tells curl what certificate type the provided certificate is in. PEM, DER and ENG are recognized types. If not specified, PEM is assumed.

If this option is used several times, the last one will be used.

--cacert <CA certificate>

(SSL) Tells curl to use the specified certificate file to verify the peer. The file may contain multiple CA certificates. The certificate(s) must be in PEM format. Normally curl is built to use a default file for this, so this option is typically used to alter that default file.

curl recognizes the environment variable named 'CURL_CA_BUNDLE' if it is set, and uses the given path as a path to a CA cert bundle. This option overrides that variable.

The windows version of curl will automatically look for a CA certs file named ´curl-ca-bundle.crt´, either in the same directory as curl.exe, or in the Current Working Directory, or in any folder along your PATH.

If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module (libnsspem.so) needs to be available for this option to work properly.

If this option is used several times, the last one will be used.

--capath <CA certificate directory>

(SSL) Tells curl to use the specified certificate directory to verify the peer. Multiple paths can be provided by separating them with ":" (e.g. "path1:path2:path3"). The certificates must be in PEM format, and if curl is built against OpenSSL, the directory must have been processed using the c_rehash utility supplied with OpenSSL. Using --capath can allow OpenSSL-powered curl to make SSL-connections much more efficiently than using --cacert if the --cacert file contains many CA certificates.

If this option is set, the default capath value will be ignored, and if it is used several times, the last one will be used.

-f, --fail

(HTTP) Fail silently (no output at all) on server errors. This is mostly done to better enable scripts etc to better deal with failed attempts. In normal cases when an HTTP server fails to deliver a document, it returns an HTML document stating so (which often also describes why and more). This flag will prevent curl from outputting that and return error 22.

This method is not fail-safe and there are occasions where non-successful response codes will slip through, especially when authentication is involved (response codes 401 and 407).

-F, --form <name=content>

(HTTP) This lets curl emulate a filled-in form in which a user has pressed the submit button. This causes curl to POST data using the Content-Type multipart/form-data according to RFC 2388. This enables uploading of binary files etc. To force the 'content' part to be a file, prefix the file name with an @ sign. To just get the content part from a file, prefix the file name with the symbol <. The difference between @ and < is then that @ makes a file get attached in the post as a file upload, while the < makes a text field and just get the contents for that text field from a file.

Example, to send your password file to the server, where 'password' is the name of the form-field to which /etc/passwd will be the input:

curl -F password=@/etc/passwd www.mypasswords.com

To read content from stdin instead of a file, use - as the filename. This goes for both @ and < constructs.

You can also tell curl what Content-Type to use by using 'type=', in a manner similar to:

curl -F "web=@index.html;type=text/html" url.com

or

curl -F "name=daniel;type=text/foo" url.com

You can also explicitly change the name field of a file upload part by setting filename=, like this:

curl -F "file=@localfile;filename=nameinpost" url.com

If filename/path contains ',' or ';', it must be quoted by double-quotes like:

curl -F "file=@\"localfile\";filename=\"nameinpost\"" url.com

or

curl -F 'file=@"localfile";filename="nameinpost"' url.com

Note that if a filename/path is quoted by double-quotes, any double-quote or backslash within the filename must be escaped by backslash.

See further examples and details in the MANUAL.

This option can be used multiple times.

--ftp-account [data]

(FTP) When an FTP server asks for "account data" after user name and password has been provided, this data is sent off using the ACCT command. (Added in 7.13.0)

If this option is used several times, the last one will be used.

--ftp-alternative-to-user <command>

(FTP) If authenticating with the USER and PASS commands fails, send this command. When connecting to Tumbleweed's Secure Transport server over FTPS using a client certificate, using "SITE AUTH" will tell the server to retrieve the username from the certificate. (Added in 7.15.5)

--ftp-create-dirs

(FTP/SFTP) When an FTP or SFTP URL/operation uses a path that doesn't currently exist on the server, the standard behavior of curl is to fail. Using this option, curl will instead attempt to create missing directories.

--ftp-method [method]

(FTP) Control what method curl should use to reach a file on an FTP(S) server. The method argument should be one of the following alternatives:

multicwd

curl does a single CWD operation for each path part in the given URL. For deep hierarchies this means very many commands. This is how RFC 1738 says it should be done. This is the default but the slowest behavior.

nocwd

curl does no CWD at all. curl will do SIZE, RETR, STOR etc and give a full path to the server for all these commands. This is the fastest behavior.

singlecwd

curl does one CWD with the full target directory and then operates on the file "normally" (like in the multicwd case). This is somewhat more standards compliant than 'nocwd' but without the full penalty of 'multicwd'.

(Added in 7.15.1)

--ftp-pasv

(FTP) Use passive mode for the data connection. Passive is the internal default behavior, but using this option can be used to override a previous -P/-ftp-port option. (Added in 7.11.0)

If this option is used several times, only the first one is used. Undoing an enforced passive really isn't doable but you must then instead enforce the correct -P, --ftp-port again.

Passive mode means that curl will try the EPSV command first and then PASV, unless --disable-epsv is used.

--ftp-skip-pasv-ip

(FTP) Tell curl to not use the IP address the server suggests in its response to curl's PASV command when curl connects the data connection. Instead curl will re-use the same IP address it already uses for the control connection. (Added in 7.14.2)

This option has no effect if PORT, EPRT or EPSV is used instead of PASV.

--ftp-pret

(FTP) Tell curl to send a PRET command before PASV (and EPSV). Certain FTP servers, mainly drftpd, require this non-standard command for directory listings as well as up and downloads in PASV mode. (Added in 7.20.x)

--ftp-ssl-ccc

(FTP) Use CCC (Clear Command Channel) Shuts down the SSL/TLS layer after authenticating. The rest of the control channel communication will be unencrypted. This allows NAT routers to follow the FTP transaction. The default mode is passive. See --ftp-ssl-ccc-mode for other modes. (Added in 7.16.1)

--ftp-ssl-ccc-mode [active/passive]

(FTP) Use CCC (Clear Command Channel) Sets the CCC mode. The passive mode will not initiate the shutdown, but instead wait for the server to do it, and will not reply to the shutdown from the server. The active mode initiates the shutdown and waits for a reply from the server. (Added in 7.16.2)

--ftp-ssl-control

(FTP) Require SSL/TLS for the FTP login, clear for transfer. Allows secure authentication, but non-encrypted data transfers for efficiency. Fails the transfer if the server doesn't support SSL/TLS. (Added in 7.16.0) that can still be used but will be removed in a future version.

--form-string <name=string>

(HTTP) Similar to --form except that the value string for the named parameter is used literally. Leading '@' and '<' characters, and the ';type=' string in the value have no special meaning. Use this in preference to --form if there's any possibility that the string value may accidentally trigger the '@' or '<' features of --form.

-g, --globoff

This option switches off the "URL globbing parser". When you set this option, you can specify URLs that contain the letters {}[] without having them being interpreted by curl itself. Note that these letters are not normal legal URL contents but they should be encoded according to the URI standard.

-G, --get

When used, this option will make all data specified with -d, --data, --data-binary or --data-urlencode to be used in an HTTP GET request instead of the POST request that otherwise would be used. The data will be appended to the URL with a '?' separator.

If used in combination with -I, the POST data will instead be appended to the URL with a HEAD request.

If this option is used several times, only the first one is used. This is because undoing a GET doesn't make sense, but you should then instead enforce the alternative method you prefer.

-H, --header <header>

(HTTP) Extra header to use when getting a web page. You may specify any number of extra headers. Note that if you should add a custom header that has the same name as one of the internal ones curl would use, your externally set header will be used instead of the internal one. This allows you to make even trickier stuff than curl would normally do. You should not replace internally set headers without knowing perfectly well what you're doing. Remove an internal header by giving a replacement without content on the right side of the colon, as in: -H "Host:". If you send the custom header with no-value then its header must be terminated with a semicolon, such as -H "X-Custom-Header;" to send "X-Custom-Header:".

curl will make sure that each header you add/replace is sent with the proper end-of-line marker, you should thus not add that as a part of the header content: do not add newlines or carriage returns, they will only mess things up for you.

See also the -A, --user-agent and -e, --referer options.

This option can be used multiple times to add/replace/remove multiple headers.

--hostpubmd5 <md5>

(SCP/SFTP) Pass a string containing 32 hexadecimal digits. The string should be the 128 bit MD5 checksum of the remote host's public key, curl will refuse the connection with the host unless the md5sums match. (Added in 7.17.1)

--ignore-content-length

(HTTP) Ignore the Content-Length header. This is particularly useful for servers running Apache 1.x, which will report incorrect Content-Length for files larger than 2 gigabytes.

-i, --include

(HTTP) Include the HTTP-header in the output. The HTTP-header includes things like server-name, date of the document, HTTP-version and more...

-I, --head

(HTTP/FTP/FILE) Fetch the HTTP-header only! HTTP-servers feature the command HEAD which this uses to get nothing but the header of a document. When used on an FTP or FILE file, curl displays the file size and last modification time only.

--interface <name>

Perform an operation using a specified interface. You can enter interface name, IP address or host name. An example could look like:

 curl --interface eth0:1 http://www.netscape.com/

If this option is used several times, the last one will be used.

-j, --junk-session-cookies

(HTTP) When curl is told to read cookies from a given file, this option will make it discard all "session cookies". This will basically have the same effect as if a new session is started. Typical browsers always discard session cookies when they're closed down.

-J, --remote-header-name

(HTTP) This option tells the -O, --remote-name option to use the server-specified Content-Disposition filename instead of extracting a filename from the URL.

There's no attempt to decode %-sequences (yet) in the provided file name, so this option may provide you with rather unexpected file names.

-k, --insecure

(SSL) This option explicitly allows curl to perform "insecure" SSL connections and transfers. All SSL connections are attempted to be made secure by using the CA certificate bundle installed by default. This makes all connections considered "insecure" fail unless -k, --insecure is used.

See this online resource for further details: http://curl.haxx.se/docs/sslcerts.html

-K, --config <config file>

Specify which config file to read curl arguments from. The config file is a text file in which command line arguments can be written which then will be used as if they were written on the actual command line.

Options and their parameters must be specified on the same config file line, separated by whitespace, colon, or the equals sign. Long option names can optionally be given in the config file without the initial double dashes and if so, the colon or equals characters can be used as separators. If the option is specified with one or two dashes, there can be no colon or equals character between the option and its parameter.

If the parameter is to contain whitespace, the parameter must be enclosed within quotes. Within double quotes, the following escape sequences are available: \\, \", \t, \n, \r and \v. A backslash preceding any other letter is ignored. If the first column of a config line is a '#' character, the rest of the line will be treated as a comment. Only write one option per physical line in the config file.

Specify the filename to -K, --config as '-' to make curl read the file from stdin.

Note that to be able to specify a URL in the config file, you need to specify it using the --url option, and not by simply writing the URL on its own line. So, it could look similar to this:

url = "http://curl.haxx.se/docs/"

When curl is invoked, it always (unless -q is used) checks for a default config file and uses it if found. The default config file is checked for in the following places in this order:

1) curl tries to find the "home dir": It first checks for the CURL_HOME and then the HOME environment variables. Failing that, it uses getpwuid() on UNIX-like systems (which returns the home dir given the current user in your system). On Windows, it then checks for the APPDATA variable, or as a last resort the '%USERPROFILE%\Application Data'.

2) On windows, if there is no _curlrc file in the home dir, it checks for one in the same dir the curl executable is placed. On UNIX-like systems, it will simply try to load .curlrc from the determined home dir.

# --- Example file --- # this is a comment url = "curl.haxx.se" output = "curlhere.html" user-agent = "superagent/1.0"

# and fetch another URL too url = "curl.haxx.se/docs/manpage.html" -O referer = "http://nowhereatall.com/" # --- End of example file ---

This option can be used multiple times to load multiple config files.

--keepalive-time <seconds>

This option sets the time a connection needs to remain idle before sending keepalive probes and the time between individual keepalive probes. It is currently effective on operating systems offering the TCP_KEEPIDLE and TCP_KEEPINTVL socket options (meaning Linux, recent AIX, HP-UX and more). This option has no effect if --no-keepalive is used. (Added in 7.18.0)

If this option is used several times, the last one will be used. If unspecified, the option defaults to 60 seconds.

--key <key>

(SSL/SSH) Private key file name. Allows you to provide your private key in this separate file.

If this option is used several times, the last one will be used.

--key-type <type>

(SSL) Private key file type. Specify which type your --key provided private key is. DER, PEM, and ENG are supported. If not specified, PEM is assumed.

If this option is used several times, the last one will be used.

--krb <level>

(FTP) Enable Kerberos authentication and use. The level must be entered and should be one of 'clear', 'safe', 'confidential', or 'private'. Should you use a level that is not one of these, 'private' will instead be used.

This option requires a library built with kerberos4 or GSSAPI (GSS-Negotiate) support. This is not very common. Use -V, --version to see if your curl supports it.

If this option is used several times, the last one will be used.

-l, --list-only

(FTP) When listing an FTP directory, this switch forces a name-only view. This is especially useful if the user wants to machine-parse the contents of an FTP directory since the normal directory view doesn't use a standard look or format. When used like this, the option causes a NLST command to be sent to the server instead of LIST.

Note: Some FTP servers list only files in their response to NLST; they do not include sub-directories and symbolic links.

(POP3) When retrieving a specific email from POP3, this switch forces a LIST command to be performed instead of RETR. This is particularly useful if the user wants to see if a specific message id exists on the server and what size it is.

Note: When combined with -X, --request <command>, this option can be used to send an UIDL command instead, so the user may use the email's unique identifier rather than it's message id to make the request. (Added in 7.21.5)

-L, --location

(HTTP/HTTPS) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request on the new place. If used together with -i, --include or -I, --head, headers from all requested pages will be shown. When authentication is used, curl only sends its credentials to the initial host. If a redirect takes curl to a different host, it won't be able to intercept the user+password. See also --location-trusted on how to change this. You can limit the amount of redirects to follow by using the --max-redirs option.

When curl follows a redirect and the request is not a plain GET (for example POST or PUT), it will do the following request with a GET if the HTTP response was 301, 302, or 303. If the response code was any other 3xx code, curl will re-send the following request using the same unmodified method.

--libcurl <file>

Append this option to any ordinary curl command line, and you will get a libcurl-using C source code written to the file that does the equivalent of what your command-line operation does!

If this option is used several times, the last given file name will be used. (Added in 7.16.1)

--limit-rate <speed>

Specify the maximum transfer rate you want curl to use. This feature is useful if you have a limited pipe and you'd like your transfer not to use your entire bandwidth.

The given speed is measured in bytes/second, unless a suffix is appended. Appending 'k' or 'K' will count the number as kilobytes, 'm' or M' makes it megabytes, while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and 1G.

The given rate is the average speed counted during the entire transfer. It means that curl might use higher transfer speeds in short bursts, but over time it uses no more than the given rate.

If you also use the -Y, --speed-limit option, that option will take precedence and might cripple the rate-limiting slightly, to help keeping the speed-limit logic working.

If this option is used several times, the last one will be used.

--local-port <num>[-num]

Set a preferred number or range of local port numbers to use for the connection(s). Note that port numbers by nature are a scarce resource that will be busy at times so setting this range to something too narrow might cause unnecessary connection setup failures. (Added in 7.15.2)

--location-trusted

(HTTP/HTTPS) Like -L, --location, but will allow sending the name + password to all hosts that the site may redirect to. This may or may not introduce a security breach if the site redirects you to a site to which you'll send your authentication info (which is plaintext in the case of HTTP Basic authentication).

-m, --max-time <seconds>

Maximum time in seconds that you allow the whole operation to take. This is useful for preventing your batch jobs from hanging for hours due to slow networks or links going down. Since 7.32.0, this option accepts decimal values, but the actual timeout will decrease in accuracy as the specified timeout increases in decimal precision. See also the --connect-timeout option.

If this option is used several times, the last one will be used.

--mail-auth <address>

(SMTP) Specify a single address. This will be used to specify the authentication address (identity) of a submitted message that is being relayed to another server.

(Added in 7.25.0)

--mail-from <address>

(SMTP) Specify a single address that the given mail should get sent from.

(Added in 7.20.0)

--max-filesize <bytes>

Specify the maximum size (in bytes) of a file to download. If the file requested is larger than this value, the transfer will not start and curl will return with exit code 63.

NOTE: The file size is not always known prior to download, and for such files this option has no effect even if the file transfer ends up being larger than this given limit. This concerns both FTP and HTTP transfers.

--mail-rcpt <address>

(SMTP) Specify a single address, user name or mailing list name.

When performing a mail transfer, the recipient should specify a valid email address to send the mail to. (Added in 7.20.0)

When performing an address verification (VRFY command), the recipient should be specified as the user name or user name and domain (as per Section 3.5 of RFC 5321). (Added in 7.34.0)

When performing a mailing list expand (EXPN command), the recipient should be specified using the mailing list name, such as "Friends" or "London-Office". (Added in 7.34.0)

--max-redirs <num>

Set maximum number of redirection-followings allowed. If -L, --location is used, this option can be used to prevent curl from following redirections "in absurdum". By default, the limit is set to 50 redirections. Set this option to -1 to make it limitless.

If this option is used several times, the last one will be used.

--metalink

This option can tell curl to parse and process a given URI as Metalink file (both version 3 and 4 (RFC 5854) are supported) and make use of the mirrors listed within for failover if there are errors (such as the file or server not being available). It will also verify the hash of the file after the download completes. The Metalink file itself is downloaded and processed in memory and not stored in the local file system.

Example to use a remote Metalink file:

curl --metalink http://www.example.com/example.metalink

To use a Metalink file in the local file system, use FILE protocol (file://):

curl --metalink file://example.metalink

Please note that if FILE protocol is disabled, there is no way to use a local Metalink file at the time of this writing. Also note that if --metalink and --include are used together, --include will be ignored. This is because including headers in the response will break Metalink parser and if the headers are included in the file described in Metalink file, hash check will fail.

(Added in 7.27.0, if built against the libmetalink library.)

-n, --netrc

Makes curl scan the .netrc (_netrc on Windows) file in the user's home directory for login name and password. This is typically used for FTP on UNIX. If used with HTTP, curl will enable user authentication. See netrc(4) or ftp(1) for details on the file format. Curl will not complain if that file doesn't have the right permissions (it should not be either world- or group-readable). The environment variable "HOME" is used to find the home directory.

A quick and very simple example of how to setup a .netrc to allow curl to FTP to the machine host.domain.com with user name 'myself' and password 'secret' should look similar to:

machine host.domain.com login myself password secret

-N, --no-buffer

Disables the buffering of the output stream. In normal work situations, curl will use a standard buffered output stream that will have the effect that it will output the data in chunks, not necessarily exactly when the data arrives. Using this option will disable that buffering.

Note that this is the negated option name documented. You can thus use --buffer to enforce the buffering.

--netrc-file

This option is similar to --netrc, except that you provide the path (absolute or relative) to the netrc file that Curl should use. You can only specify one netrc file per invocation. If several --netrc-file options are provided, only the last one will be used. (Added in 7.21.5)

This option overrides any use of --netrc as they are mutually exclusive. It will also abide by --netrc-optional if specified.

--netrc-optional

Very similar to --netrc, but this option makes the .netrc usage optional and not mandatory as the --netrc option does.

--negotiate

(HTTP) Enables GSS-Negotiate authentication. The GSS-Negotiate method was designed by Microsoft and is used in their web applications. It is primarily meant as a support for Kerberos5 authentication but may be also used along with another authentication method. For more information see IETF draft draft-brezak-spnego-http-04.txt.

If you want to enable Negotiate for your proxy authentication, then use --proxy-negotiate.

This option requires a library built with GSSAPI support. This is not very common. Use -V, --version to see if your version supports GSS-Negotiate.

When using this option, you must also provide a fake -u, --user option to activate the authentication code properly. Sending a '-u :' is enough as the user name and password from the -u option aren't actually used.

If this option is used several times, only the first one is used.

--no-keepalive

Disables the use of keepalive messages on the TCP connection, as by default curl enables them.

Note that this is the negated option name documented. You can thus use --keepalive to enforce keepalive.

--no-sessionid

(SSL) Disable curl's use of SSL session-ID caching. By default all transfers are done using the cache. Note that while nothing should ever get hurt by attempting to reuse SSL session-IDs, there seem to be broken SSL implementations in the wild that may require you to disable this in order for you to succeed. (Added in 7.16.0)

Note that this is the negated option name documented. You can thus use --sessionid to enforce session-ID caching.

--noproxy <no-proxy-list>

Comma-separated list of hosts which do not use a proxy, if one is specified. The only wildcard is a single * character, which matches all hosts, and effectively disables the proxy. Each name in this list is matched as either a domain which contains the hostname, or the hostname itself. For example, local.com would match local.com, local.com:80, and www.local.com, but not www.notlocal.com. (Added in 7.19.4).

--ntlm

(HTTP) Enables NTLM authentication. The NTLM authentication method was designed by Microsoft and is used by IIS web servers. It is a proprietary protocol, reverse-engineered by clever people and implemented in curl based on their efforts. This kind of behavior should not be endorsed, you should encourage everyone who uses NTLM to switch to a public and documented authentication method instead, such as Digest.

If you want to enable NTLM for your proxy authentication, then use --proxy-ntlm.

This option requires a library built with SSL support. Use -V, --version to see if your curl supports NTLM.

If this option is used several times, only the first one is used.

-o, --output <file>

Write output to <file> instead of stdout. If you are using {} or [] to fetch multiple documents, you can use '#' followed by a number in the <file> specifier. That variable will be replaced with the current string for the URL being fetched. Like in:

  curl http://{one,two}.site.com -o "file_#1.txt"

or use several variables like:

  curl http://{site,host}.host[1-5].com -o "#1_#2"

You may use this option as many times as the number of URLs you have.

See also the --create-dirs option to create the local directories dynamically. Specifying the output as '-' (a single dash) will force the output to be done to stdout.

-O, --remote-name

Write output to a local file named like the remote file we get. (Only the file part of the remote file is used, the path is cut off.)

The remote file name to use for saving is extracted from the given URL, nothing else.

Consequentially, the file will be saved in the current working directory. If you want the file saved in a different directory, make sure you change current working directory before you invoke curl with the -O, --remote-name flag!

There is no URL decoding done on the file name. If it has %20 or other URL encoded parts of the name, they will end up as-is as file name.

You may use this option as many times as the number of URLs you have.

--oauth2-bearer

(IMAP, POP3, SMTP) Specify the Bearer Token for OAUTH 2.0 server authentication. The Bearer Token is used in conjunction with the user name which can be specified as part of the --url or -u, --user options.

The Bearer Token and user name are formatted according to RFC 6750.

If this option is used several times, the last one will be used.

-p, --proxytunnel

When an HTTP proxy is used (-x, --proxy), this option will cause non-HTTP protocols to attempt to tunnel through the proxy instead of merely using it to do HTTP-like operations. The tunnel approach is made with the HTTP proxy CONNECT request and requires that the proxy allows direct connect to the remote port number curl wants to tunnel through to.

-P, --ftp-port <address>

(FTP) Reverses the default initiator/listener roles when connecting with FTP. This switch makes curl use active mode. In practice, curl then tells the server to connect back to the client's specified address and port, while passive mode asks the server to setup an IP address and port for it to connect to. <address> should be one of:

interface

i.e "eth0" to specify which interface's IP address you want to use (Unix only)

IP address

i.e "192.168.10.1" to specify the exact IP address

host name

i.e "my.host.domain" to specify the machine

-

make curl pick the same IP address that is already used for the control connection

If this option is used several times, the last one will be used. Disable the use of PORT with --ftp-pasv. Disable the attempt to use the EPRT command instead of PORT by using --disable-eprt. EPRT is really PORT++.

Starting in 7.19.5, you can append ":[start]-[end]" to the right of the address, to tell curl what TCP port range to use. That means you specify a port range, from a lower to a higher number. A single number works as well, but do note that it increases the risk of failure since the port may not be available.

--pass <phrase>

(SSL/SSH) Passphrase for the private key

If this option is used several times, the last one will be used.

--post301

(HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests into GET requests when following a 301 redirection. The non-RFC behaviour is ubiquitous in web browsers, so curl does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when using -L, --location (Added in 7.17.1)

--post302

(HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests into GET requests when following a 302 redirection. The non-RFC behaviour is ubiquitous in web browsers, so curl does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when using -L, --location (Added in 7.19.1)

--post303

(HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests into GET requests when following a 303 redirection. The non-RFC behaviour is ubiquitous in web browsers, so curl does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when using -L, --location (Added in 7.26.0)

--proto <protocols>

Tells curl to use the listed protocols for its initial retrieval. Protocols are evaluated left to right, are comma separated, and are each a protocol name or 'all', optionally prefixed by zero or more modifiers. Available modifiers are:

+ Permit this protocol in addition to protocols already permitted (this is the default if no modifier is used).

- Deny this protocol, removing it from the list of protocols already permitted.

= Permit only this protocol (ignoring the list already permitted), though subject to later modification by subsequent entries in the comma separated list.

For example:

--proto -ftps uses the default protocols, but disables ftps

--proto -all,https,+http only enables http and https

--proto =http,https also only enables http and https

Unknown protocols produce a warning. This allows scripts to safely rely on being able to disable potentially dangerous protocols, without relying upon support for that protocol being built into curl to avoid an error.

This option can be used multiple times, in which case the effect is the same as concatenating the protocols into one instance of the option.

(Added in 7.20.2)

--proto-redir <protocols>

Tells curl to use the listed protocols after a redirect. See --proto for how protocols are represented.

(Added in 7.20.2)

--proxy-anyauth

Tells curl to pick a suitable authentication method when communicating with the given proxy. This might cause an extra request/response round-trip. (Added in 7.13.2)

--proxy-basic

Tells curl to use HTTP Basic authentication when communicating with the given proxy. Use --basic for enabling HTTP Basic with a remote host. Basic is the default authentication method curl uses with proxies.

--proxy-digest

Tells curl to use HTTP Digest authentication when communicating with the given proxy. Use --digest for enabling HTTP Digest with a remote host.

--proxy-negotiate

Tells curl to use HTTP Negotiate authentication when communicating with the given proxy. Use --negotiate for enabling HTTP Negotiate with a remote host. (Added in 7.17.1)

--proxy-ntlm

Tells curl to use HTTP NTLM authentication when communicating with the given proxy. Use --ntlm for enabling NTLM with a remote host.

--proxy1.0 <proxyhost[:port]>

Use the specified HTTP 1.0 proxy. If the port number is not specified, it is assumed at port 1080.

The only difference between this and the HTTP proxy option (-x, --proxy), is that attempts to use CONNECT through the proxy will specify an HTTP 1.0 protocol instead of the default HTTP 1.1.

--pubkey <key>

(SSH) Public key file name. Allows you to provide your public key in this separate file.

If this option is used several times, the last one will be used.

-q

If used as the first parameter on the command line, the curlrc config file will not be read and used. See the -K, --config for details on the default config file search path.

-Q, --quote <command>

(FTP/SFTP) Send an arbitrary command to the remote FTP or SFTP server. Quote commands are sent BEFORE the transfer takes place (just after the initial PWD command in an FTP transfer, to be exact). To make commands take place after a successful transfer, prefix them with a dash '-'. To make commands be sent after curl has changed the working directory, just before the transfer command(s), prefix the command with a '+' (this is only supported for FTP). You may specify any number of commands. If the server returns failure for one of the commands, the entire operation will be aborted. You must send syntactically correct FTP commands as RFC 959 defines to FTP servers, or one of the commands listed below to SFTP servers. This option can be used multiple times. When speaking to an FTP server, prefix the command with an asterisk (*) to make curl continue even if the command fails as by default curl will stop at first failure.

SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands itself before sending them to the server. File names may be quoted shell-style to embed spaces or special characters. Following is the list of all supported SFTP quote commands:

chgrp group file

The chgrp command sets the group ID of the file named by the file operand to the group ID specified by the group operand. The group operand is a decimal integer group ID.

chmod mode file

The chmod command modifies the file mode bits of the specified file. The mode operand is an octal integer mode number.

chown user file

The chown command sets the owner of the file named by the file operand to the user ID specified by the user operand. The user operand is a decimal integer user ID.

ln source_file target_file

The ln and symlink commands create a symbolic link at the target_file location pointing to the source_file location.

mkdir directory_name

The mkdir command creates the directory named by the directory_name operand.

pwd

The pwd command returns the absolute pathname of the current working directory.

rename source target

The rename command renames the file or directory named by the source operand to the destination path named by the target operand.

rm file

The rm command removes the file specified by the file operand.

rmdir directory

The rmdir command removes the directory entry specified by the directory operand, provided it is empty.

symlink source_file target_file

See ln.

-r, --range <range>

(HTTP/FTP/SFTP/FILE) Retrieve a byte range (i.e a partial document) from a HTTP/1.1, FTP or SFTP server or a local FILE. Ranges can be specified in a number of ways.

0-499 specifies the first 500 bytes

500-999 specifies the second 500 bytes

-500 specifies the last 500 bytes

9500- specifies the bytes from offset 9500 and forward

0-0,-1 specifies the first and last byte only(*)(H)

500-700,600-799 specifies 300 bytes from offset 500(H)

100-199,500-599 specifies two separate 100-byte ranges(*)(H)

(*) = NOTE that this will cause the server to reply with a multipart response!

Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the 'start-stop' range syntax. If a non-digit character is given in the range, the server's response will be unspecified, depending on the server's configuration.

You should also be aware that many HTTP/1.1 servers do not have this feature enabled, so that when you attempt to get a range, you'll instead get the whole document.

FTP and SFTP range downloads only support the simple 'start-stop' syntax (optionally with one of the numbers omitted). FTP use depends on the extended FTP command SIZE.

If this option is used several times, the last one will be used.

-R, --remote-time

When used, this will make curl attempt to figure out the timestamp of the remote file, and if that is available make the local file get that same timestamp.

--random-file <file>

(SSL) Specify the path name to file containing what will be considered as random data. The data is used to seed the random engine for SSL connections. See also the --egd-file option.

--raw

(HTTP) When used, it disables all internal HTTP decoding of content or transfer encodings and instead makes them passed on unaltered, raw. (Added in 7.16.2)

--remote-name-all

This option changes the default action for all given URLs to be dealt with as if -O, --remote-name were used for each one. So if you want to disable that for a specific URL after --remote-name-all has been used, you must use "-o -" or --no-remote-name. (Added in 7.19.0)

--resolve <host:port:address>

Provide a custom address for a specific host and port pair. Using this, you can make the curl requests(s) use a specified address and prevent the otherwise normally resolved address to be used. Consider it a sort of /etc/hosts alternative provided on the command line. The port number should be the number used for the specific protocol the host will be used for. It means you need several entries if you want to provide address for the same host but different ports.

This option can be used many times to add many host names to resolve.

(Added in 7.21.3)

--retry <num>

If a transient error is returned when curl tries to perform a transfer, it will retry this number of times before giving up. Setting the number to 0 makes curl do no retries (which is the default). Transient error means either: a timeout, an FTP 4xx response code or an HTTP 5xx response code.

When curl is about to retry a transfer, it will first wait one second and then for all forthcoming retries it will double the waiting time until it reaches 10 minutes which then will be the delay between the rest of the retries. By using --retry-delay you disable this exponential backoff algorithm. See also --retry-max-time to limit the total time allowed for retries. (Added in 7.12.3)

If this option is used several times, the last one will be used.

--retry-delay <seconds>

Make curl sleep this amount of time before each retry when a transfer has failed with a transient error (it changes the default backoff time algorithm between retries). This option is only interesting if --retry is also used. Setting this delay to zero will make curl use the default backoff time. (Added in 7.12.3)

If this option is used several times, the last one will be used.

--retry-max-time <seconds>

The retry timer is reset before the first transfer attempt. Retries will be done as usual (see --retry) as long as the timer hasn't reached this given limit. Notice that if the timer hasn't reached the limit, the request will be made and while performing, it may take longer than this given time period. To limit a single request´s maximum time, use -m, --max-time. Set this option to zero to not timeout retries. (Added in 7.12.3)

If this option is used several times, the last one will be used.

-s, --silent

Silent or quiet mode. Don't show progress meter or error messages. Makes Curl mute. It will still output the data you ask for, potentially even to the terminal/stdout unless you redirect it.

--sasl-ir

Enable initial response in SASL authentication. (Added in 7.31.0)

-S, --show-error

When used with -s it makes curl show an error message if it fails.

--ssl

(FTP, POP3, IMAP, SMTP) Try to use SSL/TLS for the connection. Reverts to a non-secure connection if the server doesn't support SSL/TLS. See also --ftp-ssl-control and --ssl-reqd for different levels of encryption required. (Added in 7.20.0)

This option was formerly known as --ftp-ssl (Added in 7.11.0). That option name can still be used but will be removed in a future version.

--ssl-reqd

(FTP, POP3, IMAP, SMTP) Require SSL/TLS for the connection. Terminates the connection if the server doesn't support SSL/TLS. (Added in 7.20.0)

This option was formerly known as --ftp-ssl-reqd (added in 7.15.5). That option name can still be used but will be removed in a future version.

--ssl-allow-beast

(SSL) This option tells curl to not work around a security flaw in the SSL3 and TLS1.0 protocols known as BEAST. If this option isn't used, the SSL layer may use work-arounds known to cause interoperability problems with some older SSL implementations. WARNING: this option loosens the SSL security, and by using this flag you ask for exactly that. (Added in 7.25.0)

--socks4 <host[:port]>

Use the specified SOCKS4 proxy. If the port number is not specified, it is assumed at port 1080. (Added in 7.15.2)

This option overrides any previous use of -x, --proxy, as they are mutually exclusive.

Since 7.21.7, this option is superfluous since you can specify a socks4 proxy with -x, --proxy using a socks4:// protocol prefix.

If this option is used several times, the last one will be used.

--socks4a <host[:port]>

Use the specified SOCKS4a proxy. If the port number is not specified, it is assumed at port 1080. (Added in 7.18.0)

This option overrides any previous use of -x, --proxy, as they are mutually exclusive.

Since 7.21.7, this option is superfluous since you can specify a socks4a proxy with -x, --proxy using a socks4a:// protocol prefix.

If this option is used several times, the last one will be used.

--socks5-hostname <host[:port]>

Use the specified SOCKS5 proxy (and let the proxy resolve the host name). If the port number is not specified, it is assumed at port 1080. (Added in 7.18.0)

This option overrides any previous use of -x, --proxy, as they are mutually exclusive.

Since 7.21.7, this option is superfluous since you can specify a socks5 hostname proxy with -x, --proxy using a socks5h:// protocol prefix.

If this option is used several times, the last one will be used. (This option was previously wrongly documented and used as --socks without the number appended.)

--socks5 <host[:port]>

Use the specified SOCKS5 proxy - but resolve the host name locally. If the port number is not specified, it is assumed at port 1080.

This option overrides any previous use of -x, --proxy, as they are mutually exclusive.

Since 7.21.7, this option is superfluous since you can specify a socks5 proxy with -x, --proxy using a socks5:// protocol prefix.

If this option is used several times, the last one will be used. (This option was previously wrongly documented and used as --socks without the number appended.)

This option (as well as --socks4) does not work with IPV6, FTPS or LDAP.

--socks5-gssapi-service <servicename>

The default service name for a socks server is rcmd/server-fqdn. This option allows you to change it.

Examples: --socks5 proxy-name --socks5-gssapi-service sockd would use sockd/proxy-name --socks5 proxy-name --socks5-gssapi-service sockd/real-name would use sockd/real-name for cases where the proxy-name does not match the principal name. (Added in 7.19.4).

--socks5-gssapi-nec

As part of the gssapi negotiation a protection mode is negotiated. RFC 1961 says in section 4.3/4.4 it should be protected, but the NEC reference implementation does not. The option --socks5-gssapi-nec allows the unprotected exchange of the protection mode negotiation. (Added in 7.19.4).

--stderr <file>

Redirect all writes to stderr to the specified file instead. If the file name is a plain '-', it is instead written to stdout.

If this option is used several times, the last one will be used.

-t, --telnet-option <OPT=val>

Pass options to the telnet protocol. Supported options are:

TTYPE=<term> Sets the terminal type.

XDISPLOC=<X display> Sets the X display location.

NEW_ENV=<var,val> Sets an environment variable.

-T, --upload-file <file>

This transfers the specified local file to the remote URL. If there is no file part in the specified URL, Curl will append the local file name. NOTE that you must use a trailing / on the last directory to really prove to Curl that there is no file name or curl will think that your last directory name is the remote file name to use. That will most likely cause the upload operation to fail. If this is used on an HTTP(S) server, the PUT command will be used.

Use the file name "-" (a single dash) to use stdin instead of a given file. Alternately, the file name "." (a single period) may be specified instead of "-" to use stdin in non-blocking mode to allow reading server output while stdin is being uploaded.

You can specify one -T for each URL on the command line. Each -T + URL pair specifies what to upload and to where. curl also supports "globbing" of the -T argument, meaning that you can upload multiple files to a single URL by using the same URL globbing style supported in the URL, like this:

curl -T "{file1,file2}" http://www.uploadtothissite.com

or even

curl -T "img[1-1000].png" ftp://ftp.picturemania.com/upload/

--tcp-nodelay

Turn on the TCP_NODELAY option. See the curl_easy_setopt(3) man page for details about this option. (Added in 7.11.2)

--tftp-blksize <value>

(TFTP) Set TFTP BLKSIZE option (must be >512). This is the block size that curl will try to use when transferring data to or from a TFTP server. By default 512 bytes will be used.

If this option is used several times, the last one will be used.

(Added in 7.20.0)

--tlsauthtype <authtype>

Set TLS authentication type. Currently, the only supported option is "SRP", for TLS-SRP (RFC 5054). If --tlsuser and --tlspassword are specified but --tlsauthtype is not, then this option defaults to "SRP". (Added in 7.21.4)

--tlspassword <password>

Set password for use with the TLS authentication method specified with --tlsauthtype. Requires that --tlsuser also be set. (Added in 7.21.4)

--tlsuser <user>

Set username for use with the TLS authentication method specified with --tlsauthtype. Requires that --tlspassword also be set. (Added in 7.21.4)

--tlsv1.0

(SSL) Forces curl to use TLS version 1.0 when negotiating with a remote TLS server. (Added in 7.34.0)

--tlsv1.1

(SSL) Forces curl to use TLS version 1.1 when negotiating with a remote TLS server. (Added in 7.34.0)

--tlsv1.2

(SSL) Forces curl to use TLS version 1.2 when negotiating with a remote TLS server. (Added in 7.34.0)

--tr-encoding

(HTTP) Request a compressed Transfer-Encoding response using one of the algorithms curl supports, and uncompress the data while receiving it.

(Added in 7.21.6)

--trace <file>

Enables a full trace dump of all incoming and outgoing data, including descriptive information, to the given output file. Use "-" as filename to have the output sent to stdout.

This option overrides previous uses of -v, --verbose or --trace-ascii.

If this option is used several times, the last one will be used.

--trace-ascii <file>

Enables a full trace dump of all incoming and outgoing data, including descriptive information, to the given output file. Use "-" as filename to have the output sent to stdout.

This is very similar to --trace, but leaves out the hex part and only shows the ASCII part of the dump. It makes smaller output that might be easier to read for untrained humans.

This option overrides previous uses of -v, --verbose or --trace.

If this option is used several times, the last one will be used.

--trace-time

Prepends a time stamp to each trace or verbose line that curl displays. (Added in 7.14.0)

-u, --user <user:password;options>

Specify the user name, password and optional login options to use for server authentication. Overrides -n, --netrc and --netrc-optional.

If you simply specify the user name, with or without the login options, curl will prompt for a password.

If you use an SSPI-enabled curl binary and perform NTLM authentication, you can force curl to select the user name and password from your environment by simply specifying a single colon with this option: "-u :" or by specfying the login options on their own, for example "-u ;auth=NTLM".

You can use the optional login options part to specify protocol specific options that may be used during authentication. At present only IMAP, POP3 and SMTP support login options as part of the user login information. For more information about the login options please see RFC 2384, RFC 5092 and IETF draft draft-earhart-url-smtp-00.txt (Added in 7.31.0).

If this option is used several times, the last one will be used.

-U, --proxy-user <user:password>

Specify the user name and password to use for proxy authentication.

If you use an SSPI-enabled curl binary and do NTLM authentication, you can force curl to pick up the user name and password from your environment by simply specifying a single colon with this option: "-U :".

If this option is used several times, the last one will be used.

--url <URL>

Specify a URL to fetch. This option is mostly handy when you want to specify URL(s) in a config file.

This option may be used any number of times. To control where this URL is written, use the -o, --output or the -O, --remote-name options.

-v, --verbose

Makes the fetching more verbose/talkative. Mostly useful for debugging. A line starting with '>' means "header data" sent by curl, '<' means "header data" received by curl that is hidden in normal cases, and a line starting with '*' means additional info provided by curl.

Note that if you only want HTTP headers in the output, -i, --include might be the option you're looking for.

If you think this option still doesn't give you enough details, consider using --trace or --trace-ascii instead.

This option overrides previous uses of --trace-ascii or --trace.

Use -s, --silent to make curl quiet.

-w, --write-out <format>

Defines what to display on stdout after a completed and successful operation. The format is a string that may contain plain text mixed with any number of variables. The string can be specified as "string", to get read from a particular file you specify it "@filename" and to tell curl to read the format from stdin you write "@-".

The variables present in the output format will be substituted by the value or text that curl thinks fit, as described below. All variables are specified as %{variable_name} and to output a normal % you just write them as %%. You can output a newline by using \n, a carriage return with \r and a tab space with \t.

NOTE: The %-symbol is a special symbol in the win32-environment, where all occurrences of % must be doubled when using this option.

The variables available are:

content_type The Content-Type of the requested document, if there was any.

filename_effective The ultimate filename that curl writes out to. This is only meaningful if curl is told to write to a file with the --remote-name or --output option. It's most useful in combination with the --remote-header-name option. (Added in 7.25.1)

ftp_entry_path The initial path curl ended up in when logging on to the remote FTP server. (Added in 7.15.4)

http_code The numerical response code that was found in the last retrieved HTTP(S) or FTP(s) transfer. In 7.18.2 the alias response_code was added to show the same info.

http_connect The numerical code that was found in the last response (from a proxy) to a curl CONNECT request. (Added in 7.12.4)

local_ip The IP address of the local end of the most recently done connection - can be either IPv4 or IPv6 (Added in 7.29.0)

local_port The local port number of the most recently done connection (Added in 7.29.0)

num_connects Number of new connects made in the recent transfer. (Added in 7.12.3)

num_redirects Number of redirects that were followed in the request. (Added in 7.12.3)

redirect_url When an HTTP request was made without -L to follow redirects, this variable will show the actual URL a redirect would take you to. (Added in 7.18.2)

remote_ip The remote IP address of the most recently done connection - can be either IPv4 or IPv6 (Added in 7.29.0)

remote_port The remote port number of the most recently done connection (Added in 7.29.0)

size_download The total amount of bytes that were downloaded.

size_header The total amount of bytes of the downloaded headers.

size_request The total amount of bytes that were sent in the HTTP request.

size_upload The total amount of bytes that were uploaded.

speed_download The average download speed that curl measured for the complete download. Bytes per second.

speed_upload The average upload speed that curl measured for the complete upload. Bytes per second.

ssl_verify_result The result of the SSL peer certificate verification that was requested. 0 means the verification was successful. (Added in 7.19.0)

time_appconnect The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed. (Added in 7.19.0)

time_connect The time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed.

time_namelookup The time, in seconds, it took from the start until the name resolving was completed.

time_pretransfer The time, in seconds, it took from the start until the file transfer was just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved.

time_redirect The time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before the final transaction was started. time_redirect shows the complete execution time for multiple redirections. (Added in 7.12.3)

time_starttransfer The time, in seconds, it took from the start until the first byte was just about to be transferred. This includes time_pretransfer and also the time the server needed to calculate the result.

time_total The total time, in seconds, that the full operation lasted. The time will be displayed with millisecond resolution.

url_effective The URL that was fetched last. This is most meaningful if you've told curl to follow location: headers.

If this option is used several times, the last one will be used.

-x, --proxy <[protocol://][user:password@]proxyhost[:port]>

Use the specified proxy.

The proxy string can be specified with a protocol:// prefix to specify alternative proxy protocols. Use socks4://, socks4a://, socks5:// or socks5h:// to request the specific SOCKS version to be used. No protocol specified, http:// and all others will be treated as HTTP proxies. (The protocol support was added in curl 7.21.7)

If the port number is not specified in the proxy string, it is assumed to be 1080.

This option overrides existing environment variables that set the proxy to use. If there's an environment variable setting a proxy, you can set proxy to "" to override it.

All operations that are performed over an HTTP proxy will transparently be converted to HTTP. It means that certain protocol specific operations might not be available. This is not the case if you can tunnel through the proxy, as one with the -p, --proxytunnel option.

User and password that might be provided in the proxy string are URL decoded by curl. This allows you to pass in special characters such as @ by using %40 or pass in a colon with %3a.

The proxy host can be specified the exact same way as the proxy environment variables, including the protocol prefix (http://) and the embedded user + password.

If this option is used several times, the last one will be used.

-X, --request <command>

(HTTP) Specifies a custom request method to use when communicating with the HTTP server. The specified request will be used instead of the method otherwise used (which defaults to GET). Read the HTTP 1.1 specification for details and explanations. Common additional HTTP requests include PUT and DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and more.

Normally you don't need this option. All sorts of GET, HEAD, POST and PUT requests are rather invoked by using dedicated command line options.

This option only changes the actual word used in the HTTP request, it does not alter the way curl behaves. So for example if you want to make a proper HEAD request, using -X HEAD will not suffice. You need to use the -I, --head option.

(FTP) Specifies a custom FTP command to use instead of LIST when doing file lists with FTP.

(POP3) Specifies a custom POP3 command to use instead of LIST or RETR. (Added in 7.26.0)

(IMAP) Specifies a custom IMAP command to use insead of LIST. (Added in 7.30.0)

(SMTP) Specifies a custom SMTP command to use instead of HELP or VRFY. (Added in 7.34.0)

If this option is used several times, the last one will be used.

--xattr

When saving output to a file, this option tells curl to store certain file metadata in extended file attributes. Currently, the URL is stored in the xdg.origin.url attribute and, for HTTP, the content type is stored in the mime_type attribute. If the file system does not support extended attributes, a warning is issued.

-y, --speed-time <time>

If a download is slower than speed-limit bytes per second during a speed-time period, the download gets aborted. If speed-time is used, the default speed-limit will be 1 unless set with -Y.

This option controls transfers and thus will not affect slow connects etc. If this is a concern for you, try the --connect-timeout option.

If this option is used several times, the last one will be used.

-Y, --speed-limit <speed>

If a download is slower than this given speed (in bytes per second) for speed-time seconds it gets aborted. speed-time is set with -y and is 30 if not set.

If this option is used several times, the last one will be used.

-z, --time-cond <date expression>|<file>

(HTTP/FTP) Request a file that has been modified later than the given time and date, or one that has been modified before that time. The <date expression> can be all sorts of date strings or if it doesn't match any internal ones, it is taken as a filename and tries to get the modification date (mtime) from <file> instead. See the curl_getdate(3) man pages for date expression details.

Start the date expression with a dash (-) to make it request for a document that is older than the given date/time, default is a document that is newer than the specified date/time.

If this option is used several times, the last one will be used.

-h, --help

Usage help.

-M, --manual

Manual. Display the huge help text.

-V, --version

Displays information about curl and the libcurl version it uses.

The first line includes the full version of curl, libcurl and other 3rd party libraries linked with the executable.

The second line (starts with "Protocols:") shows all protocols that libcurl reports to support.

The third line (starts with "Features:") shows specific features libcurl reports to offer. Available features include:

IPv6

You can use IPv6 with this.

krb4

Krb4 for FTP is supported.

SSL

HTTPS and FTPS are supported.

libz

Automatic decompression of compressed files over HTTP is supported.

NTLM

NTLM authentication is supported.

GSS-Negotiate

Negotiate authentication and krb5 for FTP is supported.

Debug

This curl uses a libcurl built with Debug. This enables more error-tracking and memory debugging etc. For curl-developers only!

AsynchDNS

This curl uses asynchronous name resolves.

SPNEGO

SPNEGO Negotiate authentication is supported.

Largefile

This curl supports transfers of large files, files larger than 2GB.

IDN

This curl supports IDN - international domain names.

SSPI

SSPI is supported. If you use NTLM and set a blank user name, curl will authenticate with your current user and password.

TLS-SRP

SRP (Secure Remote Password) authentication is supported for TLS.

Metalink

This curl supports Metalink (both version 3 and 4 (RFC 5854)), which describes mirrors and hashes. curl will use mirrors for failover if there are errors (such as the file or server not being available).

FILES

~/.curlrc

Default config file, see -K, --config for details.

ENVIRONMENT

The environment variables can be specified in lower case or upper case. The lower case version has precedence. http_proxy is an exception as it is only available in lower case.

Using an environment variable to set the proxy has the same effect as using the --proxy option.

http_proxy [protocol://]<host>[:port]

Sets the proxy server to use for HTTP.

HTTPS_PROXY [protocol://]<host>[:port]

Sets the proxy server to use for HTTPS.

[url-protocol]_PROXY [protocol://]<host>[:port]

Sets the proxy server to use for [url-protocol], where the protocol is a protocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP, SMTP, LDAP etc.

ALL_PROXY [protocol://]<host>[:port]

Sets the proxy server to use if no protocol-specific proxy is set.

NO_PROXY <comma-separated list of hosts>

list of host names that shouldn't go through any proxy. If set to a asterisk '*' only, it matches all hosts.

PROXY PROTOCOL PREFIXES

Since curl version 7.21.7, the proxy string may be specified with a protocol:// prefix to specify alternative proxy protocols.

If no protocol is specified in the proxy string or if the string doesn't match a supported one, the proxy will be treated as an HTTP proxy.

The supported proxy protocol prefixes are as follows:

socks4://

Makes it the equivalent of --socks4

socks4a://

Makes it the equivalent of --socks4a

socks5://

Makes it the equivalent of --socks5

socks5h://

Makes it the equivalent of --socks5-hostname

EXIT CODES

There are a bunch of different error codes and their corresponding error messages that may appear during bad conditions. At the time of this writing, the exit codes are:

1

Unsupported protocol. This build of curl has no support for this protocol.

2

Failed to initialize.

3

URL malformed. The syntax was not correct.

4

A feature or option that was needed to perform the desired request was not enabled or was explicitly disabled at build-time. To make curl able to do this, you probably need another build of libcurl!

5

Couldn't resolve proxy. The given proxy host could not be resolved.

6

Couldn't resolve host. The given remote host was not resolved.

7

Failed to connect to host.

8

FTP weird server reply. The server sent data curl couldn't parse.

9

FTP access denied. The server denied login or denied access to the particular resource or directory you wanted to reach. Most often you tried to change to a directory that doesn't exist on the server.

11

FTP weird PASS reply. Curl couldn't parse the reply sent to the PASS request.

13

FTP weird PASV reply, Curl couldn't parse the reply sent to the PASV request.

14

FTP weird 227 format. Curl couldn't parse the 227-line the server sent.

15

FTP can't get host. Couldn't resolve the host IP we got in the 227-line.

17

FTP couldn't set binary. Couldn't change transfer method to binary.

18

Partial file. Only a part of the file was transferred.

19

FTP couldn't download/access the given file, the RETR (or similar) command failed.

21

FTP quote error. A quote command returned error from the server.

22

HTTP page not retrieved. The requested url was not found or returned another error with the HTTP error code being 400 or above. This return code only appears if -f, --fail is used.

23

Write error. Curl couldn't write data to a local filesystem or similar.

25

FTP couldn't STOR file. The server denied the STOR operation, used for FTP uploading.

26

Read error. Various reading problems.

27

Out of memory. A memory allocation request failed.

28

Operation timeout. The specified time-out period was reached according to the conditions.

30

FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT command, try doing a transfer using PASV instead!

31

FTP couldn't use REST. The REST command failed. This command is used for resumed FTP transfers.

33

HTTP range error. The range "command" didn't work.

34

HTTP post error. Internal post-request generation error.

35

SSL connect error. The SSL handshaking failed.

36

FTP bad download resume. Couldn't continue an earlier aborted download.

37

FILE couldn't read file. Failed to open the file. Permissions?

38

LDAP cannot bind. LDAP bind operation failed.

39

LDAP search failed.

41

Function not found. A required LDAP function was not found.

42

Aborted by callback. An application told curl to abort the operation.

43

Internal error. A function was called with a bad parameter.

45

Interface error. A specified outgoing interface could not be used.

47

Too many redirects. When following redirects, curl hit the maximum amount.

48

Unknown option specified to libcurl. This indicates that you passed a weird option to curl that was passed on to libcurl and rejected. Read up in the manual!

49

Malformed telnet option.

51

The peer's SSL certificate or SSH MD5 fingerprint was not OK.

52

The server didn't reply anything, which here is considered an error.

53

SSL crypto engine not found.

54

Cannot set SSL crypto engine as default.

55

Failed sending network data.

56

Failure in receiving network data.

58

Problem with the local certificate.

59

Couldn't use specified SSL cipher.

60

Peer certificate cannot be authenticated with known CA certificates.

61

Unrecognized transfer encoding.

62

Invalid LDAP URL.

63

Maximum file size exceeded.

64

Requested FTP SSL level failed.

65

Sending the data requires a rewind that failed.

66

Failed to initialise SSL Engine.

67

The user name, password, or similar was not accepted and curl failed to log in.

68

File not found on TFTP server.

69

Permission problem on TFTP server.

70

Out of disk space on TFTP server.

71

Illegal TFTP operation.

72

Unknown TFTP transfer ID.

73

File already exists (TFTP).

74

No such user (TFTP).

75

Character conversion failed.

76

Character conversion functions required.

77

Problem with reading the SSL CA cert (path? access rights?).

78

The resource referenced in the URL does not exist.

79

An unspecified error occurred during the SSH session.

80

Failed to shut down the SSL connection.

82

Could not load CRL file, missing or wrong format (added in 7.19.0).

83

Issuer check failed (added in 7.19.0).

84

The FTP PRET command failed

85

RTSP: mismatch of CSeq numbers

86

RTSP: mismatch of Session Identifiers

87

unable to parse FTP file list

88

FTP chunk callback reported error

89

No connection available, the session will be queued

XX

More error codes will appear here in future releases. The existing ones are meant to never change.

AUTHORS / CONTRIBUTORS

Daniel Stenberg is the main author, but the whole list of contributors is found in the separate THANKS file.

WWW

http://curl.haxx.se

FTP

ftp://ftp.sunet.se/pub/www/utilities/curl/

SEE ALSO

ftp (1) wget (1)

This HTML page was made with roffit. curl-7.35.0/docs/curl-config.10000644000175000017500000001014312213173003012705 00000000000000.\" ************************************************************************** .\" * _ _ ____ _ .\" * Project ___| | | | _ \| | .\" * / __| | | | |_) | | .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2012, 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. .\" * .\" ************************************************************************** .\" .TH curl-config 1 "25 Oct 2007" "Curl 7.17.1" "curl-config manual" .SH NAME curl-config \- Get information about a libcurl installation .SH SYNOPSIS .B curl-config [options] .SH DESCRIPTION .B curl-config displays information about the curl and libcurl installation. .SH OPTIONS .IP "--ca" Displays the built-in path to the CA cert bundle this libcurl uses. .IP "--cc" Displays the compiler used to build libcurl. .IP "--cflags" Set of compiler options (CFLAGS) to use when compiling files that use libcurl. Currently that is only the include path to the curl include files. .IP "--checkfor [version]" Specify the oldest possible libcurl version string you want, and this script will return 0 if the current installation is new enough or it returns 1 and outputs a text saying that the current version is not new enough. (Added in 7.15.4) .IP "--configure" Displays the arguments given to configure when building curl. .IP "--feature" Lists what particular main features the installed libcurl was built with. At the time of writing, this list may include SSL, KRB4 or IPv6. Do not assume any particular order. The keywords will be separated by newlines. There may be none, one, or several keywords in the list. .IP "--help" Displays the available options. .IP "--libs" Shows the complete set of libs and other linker options you will need in order to link your application with libcurl. .IP "--prefix" This is the prefix used when libcurl was installed. Libcurl is then installed in $prefix/lib and its header files are installed in $prefix/include and so on. The prefix is set with "configure --prefix". .IP "--protocols" Lists what particular protocols the installed libcurl was built to support. At the time of writing, this list may include HTTP, HTTPS, FTP, FTPS, FILE, TELNET, LDAP, DICT. Do not assume any particular order. The protocols will be listed using uppercase and are separated by newlines. There may be none, one, or several protocols in the list. (Added in 7.13.0) .IP "--static-libs" Shows the complete set of libs and other linker options you will need in order to link your application with libcurl statically. (Added in 7.17.1) .IP "--version" Outputs version information about the installed libcurl. .IP "--vernum" Outputs version information about the installed libcurl, in numerical mode. This outputs the version number, in hexadecimal, with 8 bits for each part; major, minor, patch. So that libcurl 7.7.4 would appear as 070704 and libcurl 12.13.14 would appear as 0c0d0e... Note that the initial zero might be omitted. (This option was broken in the 7.15.0 release.) .SH "EXAMPLES" What linker options do I need when I link with libcurl? $ curl-config --libs What compiler options do I need when I compile using libcurl functions? $ curl-config --cflags How do I know if libcurl was built with SSL support? $ curl-config --feature | grep SSL What's the installed libcurl version? $ curl-config --version How do I build a single file with a one-line command? $ `curl-config --cc --cflags` -o example example.c `curl-config --libs` .SH "SEE ALSO" .BR curl (1) curl-7.35.0/docs/FEATURES0000644000175000017500000001334012270035364011570 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| FEATURES curl tool - config file support - multiple URLs in a single command line - range "globbing" support: [0-13], {one,two,three} - multiple file upload on a single command line - custom maximum transfer rate - redirectable stderr - metalink support (*13) libcurl - full URL syntax with no length limit - custom maximum download time - custom least download speed acceptable - custom output result after completion - guesses protocol from host name unless specified - uses .netrc - progress bar with time statistics while downloading - "standard" proxy environment variables support - compiles on win32 (reported builds on 40+ operating systems) - selectable network interface for outgoing traffic - IPv6 support on unix and Windows - persistent connections - socks5 support - supports user name and password in proxy environment variables - operations through proxy "tunnel" (using CONNECT) - support for large files (>2GB and >4GB) during upload and download - replaceable memory functions (malloc, free, realloc, etc) - asynchronous name resolving (*6) - both a push and a pull style interface - international domain names (*11) HTTP - HTTP/1.1 compliant (optionally uses 1.0) - GET - PUT - HEAD - POST - Pipelining - multipart formpost (RFC1867-style) - authentication: Basic, Digest, NTLM (*9), GSS-Negotiate/Negotiate (*3) and SPNEGO (*4) to server and proxy - resume (both GET and PUT) - follow redirects - maximum amount of redirects to follow - custom HTTP request - cookie get/send fully parsed - reads/writes the netscape cookie file format - custom headers (replace/remove internally generated headers) - custom user-agent string - custom referer string - range - proxy authentication - time conditions - via http-proxy - retrieve file modification date - Content-Encoding support for deflate and gzip - "Transfer-Encoding: chunked" support in uploads - data compression (*12) HTTPS (*1) - (all the HTTP features) - using client certificates - verify server certificate - via http-proxy - select desired encryption - force usage of a specific SSL version (SSLv2 (*7), SSLv3 (*10) or TLSv1) FTP - download - authentication - kerberos4 (*5) - kerberos5 (*3) - active/passive using PORT, EPRT, PASV or EPSV - single file size information (compare to HTTP HEAD) - 'type=' URL support - dir listing - dir listing names-only - upload - upload append - upload via http-proxy as HTTP PUT - download resume - upload resume - custom ftp commands (before and/or after the transfer) - simple "range" support - via http-proxy - all operations can be tunneled through a http-proxy - customizable to retrieve file modification date - no dir depth limit FTPS (*1) - implicit ftps:// support that use SSL on both connections - explicit "AUTH TLS" and "AUTH SSL" usage to "upgrade" plain ftp:// connection to use SSL for both or one of the connections SCP (*8) - both password and public key auth SFTP (*8) - both password and public key auth - with custom commands sent before/after the transfer TFTP - download - upload TELNET - connection negotiation - custom telnet options - stdin/stdout I/O LDAP (*2) - full LDAP URL support DICT - extended DICT URL support FILE - URL support - upload - resume SMTP - authentication: Plain, Login, CRAM-MD5, Digest-MD5 and NTLM (*9) - send e-mails - mail from support - mail size support - mail auth support for trusted server-to-server relaying - multiple recipients - via http-proxy SMTPS (*1) - implicit smtps:// support - explicit "STARTTLS" usage to "upgrade" plain smtp:// connections to use SSL - via http-proxy POP3 - authentication: Clear Text, APOP and SASL - SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5 and NTLM (*9) - list e-mails - retrieve e-mails - enhanced command support for: CAPA, DELE, TOP, STAT, UIDL and NOOP via custom requests - via http-proxy POP3S (*1) - implicit pop3s:// support - explicit "STLS" usage to "upgrade" plain pop3:// connections to use SSL - via http-proxy IMAP - authentication: Clear Text and SASL - SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5 and NTLM (*9) - list the folders of a mailbox - select a mailbox with support for verifing the UIDVALIDITY - fetch e-mails with support for specifing the UID and SECTION - upload e-mails via the append command - enhanced command support for: EXAMINE, CREATE, DELETE, RENAME, STATUS, STORE, COPY and UID via custom requests - via http-proxy IMAPS (*1) - implicit imaps:// support - explicit "STARTTLS" usage to "upgrade" plain imap:// connections to use SSL - via http-proxy FOOTNOTES ========= *1 = requires OpenSSL, GnuTLS, NSS, yassl, axTLS, PolarSSL, WinSSL (native Windows), Secure Transport (native iOS/OS X) or qssl (native IBM i) *2 = requires OpenLDAP *3 = requires a GSSAPI-compliant library, such as Heimdal or similar *4 = requires FBopenssl *5 = requires a krb4 library, such as the MIT one or similar *6 = requires c-ares *7 = requires OpenSSL, NSS, qssl, WinSSL or Secure Transport; GnuTLS, for example, only supports SSLv3 and TLSv1 *8 = requires libssh2 *9 = requires OpenSSL, GnuTLS, NSS, yassl, Secure Transport or SSPI (native Windows) *10 = requires any of the SSL libraries in (*1) above other than axTLS, which does not support SSLv3 *11 = requires libidn or Windows *12 = requires libz *13 = requires libmetalink, and either an Apple or Microsoft operating system, or OpenSSL, or GnuTLS, or NSS curl-7.35.0/docs/mk-ca-bundle.pdf0000644000175000017500000001203012272124470013353 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ…XÛrÛ8}×Wà-Ô–¼3µµµžÄ;ãŒg%fk§ì<@$d1¦H™-k¾!¿²ÿ¸Ý¸ˆ¤“LÊJH4ºÑ}Îé‰KqñÏüæ»Ùù2&÷ÝÌ%÷³ÇS/‰ùÉwä— $ø ÛÌ´ #±GâÔ§IJ²ÝÌÙ=,r¾Xϳ/3ß§Œ¥),ÊŠó\šD$;Ìœ¾.*qç°»9­f©KýH/vqÝ­^Hv¼îy5_0Ï÷£Óþ°ë¦Éh³ùçìÝláRA$9šB 4 1Ö…çù4HÈ<Àþ· téâ:Ò0õµ_çý%>Î^7&à_ßN½Ç¾‰ð$ojëž…¸k NgwžÄÉ]J½$Mó¢•d×üYV…+<ªŒF}XdÖtù+äÐw™y!ZYpÉ©|–D6äãå{²iÚ—ú ãã³8¦¡çˆh¢lW|¸ù¸ºZM ÙùÉQo×eU?Êþé³:ïù’¹®K#›ÇÛ¦—û^~­ÄçïãG¸ræíåêÍòêcvuóáGñ q¤Q‘mÅ 7,¥iâ¥&8Ù4)š¹ÀS7tuÕð¢#,òq¶ .²i›yo“‡„ |æ%ˆ¢Sþ»!ÿŒz~h«ÚômN[!HƒKNÅšF›7¿€ß†ÍHth­²ìãÄ ’E'@É“YBc?d–8¦P‘l+j²çm'Tô Àñ”NFq¬ÖMòÂ남hcŸÆi`bÁʼnÎý³ly.;òæ‚,›F’7`]~͹)ë é|G1MXŒëá­ÀJ@Xm“‹®9”r‹Ï4w¬S[ríòf/êÕê(¶%(ª²6…o°SÑçj[òµæ9!–‘Ôšªý½€d×!ÏÓBb35ó!mA`sËûÊ0hÀvLc°²e7Оb5pi8”¯æ;AÊn¿‚30±ô½uNN½XKóVêX•?¥bvÿ0¢qàzÖ˜þ2÷bÐ 7v޲Qh™ Ý“t)Ëúž”J^-^‘;‡“A^ ÞmAMe¨*r/¤Ê£>éD­²°ð\Ÿzn8©ŠÛ­²·7Ÿ2¨z'/H³!\絜úA|Jò€ pPv¤ËÛr êœøÂºÜñ(ø¤<ãF zŽÐ4nEå^”Õ‘pÃ;,è ,f'Ñå#Ñe#Ε_£€g¬äKßø×áU¥ a¸^ò0‚é¯uŸ]¯Èä&Ô y-`šï÷U Œ(›º;#]Ÿo ïHÞ·Õ9`’‘d»¦5¨œJ£<+‹7JÿB¢1¹›¦ªt,L–»Ù+çŠp]¿ß7­ÅkåMï}=ËþvëøPÔYóü¡ßC\À}†Ò0ç¹ìtžÔ¨h;Øêüð‡!ÈÝKr ¦‘/ÌÂဋBIÜI»b?Uµîö"/7GrØ–=£ÑZh‘ô= u"[JÊï( ‡Dwþ÷iy}7§ä?Ê tr“Á‹F¯Ê‚`˜*S¯ ïÛ¦åg¦úÚäÔ}0O!`-$?÷5(!TÔtï3RwPíVT‚¤îf:' “¡=ÅÝ@ÓSk(í¼2ºçÙˆ™ë«ˆ±ž[¨fÞKM nÔˆ ?–Ș"Ãà€zi0e0&O%ŽêêÐØ4R?pÀIޤ3€Ñ—öˆÉ°ƒÓ_d¥Éô;3ÊLºÝ­S—МQñ|g“T ´3´kÆ•-sZÈ6äô¢(€_eý-(ðÞ€0&Òxr˜“¤Î¾……Ɔ,Ƹ¬7!Mi=¥ZSOª‰=[ÔPã‘ÙŒƒYmèU7j&±ã*å½w¨¦(D†}a`Ùgޤv{´dÅr€HÉc_ ´®U¼e쬒r¥ccsiÎPÖyÕ‚ì+‰”#—x2Íy éëý ¡¯¡ ?€çVìšc/4Êarý1œ»ùdªõ†Ñf2l¤hí¼¡)¨27¦~8©ðÓœqy× Ž ·ºrXªaöxsÑýL€/ÿ{•AŸÓ^‘f6Oí´å\dãéE©>½PíÎ$IÚ½²oA¤]„.QQbŸ2Rn°moæH»Ð^V²»õ'•­ŸåÖys¹œêÎ:Ù[Cs&.®o O£ Pq‘‘áž´J¼Ø’ô_7Ë÷ói¢÷ÃqCêûn:•lW_uãÅY@‘ š¯Õw45ÈÛ1ò ×!E;!vêôPà¢Éûo¡á¾Vó†g›ÚVÊýëóó=c‹ûªt¢XˆîA6{Ú´s–8÷ç°Ã94 ÀÄýBùZì`µæõøâ­Ð‚‰Òð’nå®úxV——äâzuób<µoG‚)J`Ìô†K£¾Ô~s{ }½hTÛß®¤`œ¦À›å܇²DΣ|¹Óƒç‹úEÐ0ßNÿAªÛ”†Û1œŒæð-WBÝmËý /eDL®E0xCèþD¾w'>ªi‰h/kõtSKá✎ 2÷C´£[þüL;qŽí÷J’ƒ¢“Ä %¾/k%¥kŽX aßT·¦* UÉ¡-¥„›  uÙTØïmùÀO_Ôñü$¤aâÙÁ5ŠôüÄɨ±C…ÓÈ~˜õØð ¤¦“$¶w®¯n0âÓÕ- µUÅQw8a–;¶I²á2•Áô (FÓoºr±ž‡8uhŽ¿]Ù÷€Ä¶*=R®%¿×¼ß¨‘!‚ÝFWÄp¸žô7Hå½€“1ó­†ã%±”¥Êù(§ï`ô\å[Þƒ™ùŽÂà FހؿéôŠÖBîQ´óÐŒ–Úÿ Óv¤ tþrZžì(á¹£®…·7°²¾ }£x.ó•¡{ÇÖ‚á£Ëlöoøû?™ãBŠendstream endobj 6 0 obj 2231 endobj 4 0 obj <> /Contents 5 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R ] /Count 1 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 10 0 obj <> endobj 13 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 14 0 obj <> endobj 15 0 obj <>stream 2014-01-29T08:09:44+01:00 2014-01-29T08:09:44+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 16 0000000000 65535 f 0000002555 00000 n 0000004517 00000 n 0000002496 00000 n 0000002336 00000 n 0000000015 00000 n 0000002316 00000 n 0000002620 00000 n 0000002946 00000 n 0000002881 00000 n 0000002741 00000 n 0000002661 00000 n 0000002691 00000 n 0000002825 00000 n 0000003028 00000 n 0000003094 00000 n trailer << /Size 16 /Root 1 0 R /Info 2 0 R /ID [<3DD4B006D4BE0B169884326F2E4CEF45><3DD4B006D4BE0B169884326F2E4CEF45>] >> startxref 4671 %%EOF curl-7.35.0/docs/MANUAL0000644000175000017500000011270012213173003011315 00000000000000LATEST VERSION You always find news about what's going on as well as the latest versions from the curl web pages, located at: http://curl.haxx.se SIMPLE USAGE Get the main page from Netscape's web-server: curl http://www.netscape.com/ Get the README file the user's home directory at funet's ftp-server: curl ftp://ftp.funet.fi/README Get a web page from a server using port 8000: curl http://www.weirdserver.com:8000/ Get a directory listing of an FTP site: curl ftp://cool.haxx.se/ Get the definition of curl from a dictionary: curl dict://dict.org/m:curl Fetch two documents at once: curl ftp://cool.haxx.se/ http://www.weirdserver.com:8000/ Get a file off an FTPS server: curl ftps://files.are.secure.com/secrets.txt or use the more appropriate FTPS way to get the same file: curl --ftp-ssl ftp://files.are.secure.com/secrets.txt Get a file from an SSH server using SFTP: curl -u username sftp://shell.example.com/etc/issue Get a file from an SSH server using SCP using a private key to authenticate: curl -u username: --key ~/.ssh/id_dsa --pubkey ~/.ssh/id_dsa.pub \ scp://shell.example.com/~/personal.txt Get the main page from an IPv6 web server: curl -g "http://[2001:1890:1112:1::20]/" DOWNLOAD TO A FILE Get a web page and store in a local file with a specific name: curl -o thatpage.html http://www.netscape.com/ Get a web page and store in a local file, make the local file get the name of the remote document (if no file name part is specified in the URL, this will fail): curl -O http://www.netscape.com/index.html Fetch two files and store them with their remote names: curl -O www.haxx.se/index.html -O curl.haxx.se/download.html USING PASSWORDS FTP To ftp files using name+passwd, include them in the URL like: curl ftp://name:passwd@machine.domain:port/full/path/to/file or specify them with the -u flag like curl -u name:passwd ftp://machine.domain:port/full/path/to/file FTPS It is just like for FTP, but you may also want to specify and use SSL-specific options for certificates etc. Note that using FTPS:// as prefix is the "implicit" way as described in the standards while the recommended "explicit" way is done by using FTP:// and the --ftp-ssl option. SFTP / SCP This is similar to FTP, but you can specify a private key to use instead of a password. Note that the private key may itself be protected by a password that is unrelated to the login password of the remote system. If you provide a private key file you must also provide a public key file. HTTP Curl also supports user and password in HTTP URLs, thus you can pick a file like: curl http://name:passwd@machine.domain/full/path/to/file or specify user and password separately like in curl -u name:passwd http://machine.domain/full/path/to/file HTTP offers many different methods of authentication and curl supports several: Basic, Digest, NTLM and Negotiate. Without telling which method to use, curl defaults to Basic. You can also ask curl to pick the most secure ones out of the ones that the server accepts for the given URL, by using --anyauth. NOTE! According to the URL specification, HTTP URLs can not contain a user and password, so that style will not work when using curl via a proxy, even though curl allows it at other times. When using a proxy, you _must_ use the -u style for user and password. HTTPS Probably most commonly used with private certificates, as explained below. PROXY curl supports both HTTP and SOCKS proxy servers, with optional authentication. It does not have special support for FTP proxy servers since there are no standards for those, but it can still be made to work with many of them. You can also use both HTTP and SOCKS proxies to transfer files to and from FTP servers. Get an ftp file using an HTTP proxy named my-proxy that uses port 888: curl -x my-proxy:888 ftp://ftp.leachsite.com/README Get a file from an HTTP server that requires user and password, using the same proxy as above: curl -u user:passwd -x my-proxy:888 http://www.get.this/ Some proxies require special authentication. Specify by using -U as above: curl -U user:passwd -x my-proxy:888 http://www.get.this/ A comma-separated list of hosts and domains which do not use the proxy can be specified as: curl --noproxy localhost,get.this -x my-proxy:888 http://www.get.this/ If the proxy is specified with --proxy1.0 instead of --proxy or -x, then curl will use HTTP/1.0 instead of HTTP/1.1 for any CONNECT attempts. curl also supports SOCKS4 and SOCKS5 proxies with --socks4 and --socks5. See also the environment variables Curl supports that offer further proxy control. Most FTP proxy servers are set up to appear as a normal FTP server from the client's perspective, with special commands to select the remote FTP server. curl supports the -u, -Q and --ftp-account options that can be used to set up transfers through many FTP proxies. For example, a file can be uploaded to a remote FTP server using a Blue Coat FTP proxy with the options: curl -u "Remote-FTP-Username@remote.ftp.server Proxy-Username:Remote-Pass" \ --ftp-account Proxy-Password --upload-file local-file \ ftp://my-ftp.proxy.server:21/remote/upload/path/ See the manual for your FTP proxy to determine the form it expects to set up transfers, and curl's -v option to see exactly what curl is sending. RANGES HTTP 1.1 introduced byte-ranges. Using this, a client can request to get only one or more subparts of a specified document. Curl supports this with the -r flag. Get the first 100 bytes of a document: curl -r 0-99 http://www.get.this/ Get the last 500 bytes of a document: curl -r -500 http://www.get.this/ Curl also supports simple ranges for FTP files as well. Then you can only specify start and stop position. Get the first 100 bytes of a document using FTP: curl -r 0-99 ftp://www.get.this/README UPLOADING FTP / FTPS / SFTP / SCP Upload all data on stdin to a specified server: curl -T - ftp://ftp.upload.com/myfile Upload data from a specified file, login with user and password: curl -T uploadfile -u user:passwd ftp://ftp.upload.com/myfile Upload a local file to the remote site, and use the local file name at the remote site too: curl -T uploadfile -u user:passwd ftp://ftp.upload.com/ Upload a local file to get appended to the remote file: curl -T localfile -a ftp://ftp.upload.com/remotefile Curl also supports ftp upload through a proxy, but only if the proxy is configured to allow that kind of tunneling. If it does, you can run curl in a fashion similar to: curl --proxytunnel -x proxy:port -T localfile ftp.upload.com HTTP Upload all data on stdin to a specified HTTP site: curl -T - http://www.upload.com/myfile Note that the HTTP server must have been configured to accept PUT before this can be done successfully. For other ways to do HTTP data upload, see the POST section below. VERBOSE / DEBUG If curl fails where it isn't supposed to, if the servers don't let you in, if you can't understand the responses: use the -v flag to get verbose fetching. Curl will output lots of info and what it sends and receives in order to let the user see all client-server interaction (but it won't show you the actual data). curl -v ftp://ftp.upload.com/ To get even more details and information on what curl does, try using the --trace or --trace-ascii options with a given file name to log to, like this: curl --trace trace.txt www.haxx.se DETAILED INFORMATION Different protocols provide different ways of getting detailed information about specific files/documents. To get curl to show detailed information about a single file, you should use -I/--head option. It displays all available info on a single file for HTTP and FTP. The HTTP information is a lot more extensive. For HTTP, you can get the header information (the same as -I would show) shown before the data by using -i/--include. Curl understands the -D/--dump-header option when getting files from both FTP and HTTP, and it will then store the headers in the specified file. Store the HTTP headers in a separate file (headers.txt in the example): curl --dump-header headers.txt curl.haxx.se Note that headers stored in a separate file can be very useful at a later time if you want curl to use cookies sent by the server. More about that in the cookies section. POST (HTTP) It's easy to post data using curl. This is done using the -d option. The post data must be urlencoded. Post a simple "name" and "phone" guestbook. curl -d "name=Rafael%20Sagula&phone=3320780" \ http://www.where.com/guest.cgi How to post a form with curl, lesson #1: Dig out all the tags in the form that you want to fill in. (There's a perl program called formfind.pl on the curl site that helps with this). If there's a "normal" post, you use -d to post. -d takes a full "post string", which is in the format =&=&... The 'variable' names are the names set with "name=" in the tags, and the data is the contents you want to fill in for the inputs. The data *must* be properly URL encoded. That means you replace space with + and that you replace weird letters with %XX where XX is the hexadecimal representation of the letter's ASCII code. Example: (page located at http://www.formpost.com/getthis/ We want to enter user 'foobar' with password '12345'. To post to this, you enter a curl command line like: curl -d "user=foobar&pass=12345&id=blablabla&ding=submit" (continues) http://www.formpost.com/getthis/post.cgi While -d uses the application/x-www-form-urlencoded mime-type, generally understood by CGI's and similar, curl also supports the more capable multipart/form-data type. This latter type supports things like file upload. -F accepts parameters like -F "name=contents". If you want the contents to be read from a file, use <@filename> as contents. When specifying a file, you can also specify the file content type by appending ';type=' to the file name. You can also post the contents of several files in one field. For example, the field name 'coolfiles' is used to send three files, with different content types using the following syntax: curl -F "coolfiles=@fil1.gif;type=image/gif,fil2.txt,fil3.html" \ http://www.post.com/postit.cgi If the content-type is not specified, curl will try to guess from the file extension (it only knows a few), or use the previously specified type (from an earlier file if several files are specified in a list) or else it will use the default type 'application/octet-stream'. Emulate a fill-in form with -F. Let's say you fill in three fields in a form. One field is a file name which to post, one field is your name and one field is a file description. We want to post the file we have written named "cooltext.txt". To let curl do the posting of this data instead of your favourite browser, you have to read the HTML source of the form page and find the names of the input fields. In our example, the input field names are 'file', 'yourname' and 'filedescription'. curl -F "file=@cooltext.txt" -F "yourname=Daniel" \ -F "filedescription=Cool text file with cool text inside" \ http://www.post.com/postit.cgi To send two files in one post you can do it in two ways: 1. Send multiple files in a single "field" with a single field name: curl -F "pictures=@dog.gif,cat.gif" 2. Send two fields with two field names: curl -F "docpicture=@dog.gif" -F "catpicture=@cat.gif" To send a field value literally without interpreting a leading '@' or '<', or an embedded ';type=', use --form-string instead of -F. This is recommended when the value is obtained from a user or some other unpredictable source. Under these circumstances, using -F instead of --form-string would allow a user to trick curl into uploading a file. REFERRER An HTTP request has the option to include information about which address referred it to the actual page. Curl allows you to specify the referrer to be used on the command line. It is especially useful to fool or trick stupid servers or CGI scripts that rely on that information being available or contain certain data. curl -e www.coolsite.com http://www.showme.com/ NOTE: The Referer: [sic] field is defined in the HTTP spec to be a full URL. USER AGENT An HTTP request has the option to include information about the browser that generated the request. Curl allows it to be specified on the command line. It is especially useful to fool or trick stupid servers or CGI scripts that only accept certain browsers. Example: curl -A 'Mozilla/3.0 (Win95; I)' http://www.nationsbank.com/ Other common strings: 'Mozilla/3.0 (Win95; I)' Netscape Version 3 for Windows 95 'Mozilla/3.04 (Win95; U)' Netscape Version 3 for Windows 95 'Mozilla/2.02 (OS/2; U)' Netscape Version 2 for OS/2 'Mozilla/4.04 [en] (X11; U; AIX 4.2; Nav)' NS for AIX 'Mozilla/4.05 [en] (X11; U; Linux 2.0.32 i586)' NS for Linux Note that Internet Explorer tries hard to be compatible in every way: 'Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)' MSIE for W95 Mozilla is not the only possible User-Agent name: 'Konqueror/1.0' KDE File Manager desktop client 'Lynx/2.7.1 libwww-FM/2.14' Lynx command line browser COOKIES Cookies are generally used by web servers to keep state information at the client's side. The server sets cookies by sending a response line in the headers that looks like 'Set-Cookie: ' where the data part then typically contains a set of NAME=VALUE pairs (separated by semicolons ';' like "NAME1=VALUE1; NAME2=VALUE2;"). The server can also specify for what path the "cookie" should be used for (by specifying "path=value"), when the cookie should expire ("expire=DATE"), for what domain to use it ("domain=NAME") and if it should be used on secure connections only ("secure"). If you've received a page from a server that contains a header like: Set-Cookie: sessionid=boo123; path="/foo"; it means the server wants that first pair passed on when we get anything in a path beginning with "/foo". Example, get a page that wants my name passed in a cookie: curl -b "name=Daniel" www.sillypage.com Curl also has the ability to use previously received cookies in following sessions. If you get cookies from a server and store them in a file in a manner similar to: curl --dump-header headers www.example.com ... you can then in a second connect to that (or another) site, use the cookies from the 'headers' file like: curl -b headers www.example.com While saving headers to a file is a working way to store cookies, it is however error-prone and not the preferred way to do this. Instead, make curl save the incoming cookies using the well-known netscape cookie format like this: curl -c cookies.txt www.example.com Note that by specifying -b you enable the "cookie awareness" and with -L you can make curl follow a location: (which often is used in combination with cookies). So that if a site sends cookies and a location, you can use a non-existing file to trigger the cookie awareness like: curl -L -b empty.txt www.example.com The file to read cookies from must be formatted using plain HTTP headers OR as netscape's cookie file. Curl will determine what kind it is based on the file contents. In the above command, curl will parse the header and store the cookies received from www.example.com. curl will send to the server the stored cookies which match the request as it follows the location. The file "empty.txt" may be a nonexistent file. Alas, to both read and write cookies from a netscape cookie file, you can set both -b and -c to use the same file: curl -b cookies.txt -c cookies.txt www.example.com PROGRESS METER The progress meter exists to show a user that something actually is happening. The different fields in the output have the following meaning: % Total % Received % Xferd Average Speed Time Curr. Dload Upload Total Current Left Speed 0 151M 0 38608 0 0 9406 0 4:41:43 0:00:04 4:41:39 9287 From left-to-right: % - percentage completed of the whole transfer Total - total size of the whole expected transfer % - percentage completed of the download Received - currently downloaded amount of bytes % - percentage completed of the upload Xferd - currently uploaded amount of bytes Average Speed Dload - the average transfer speed of the download Average Speed Upload - the average transfer speed of the upload Time Total - expected time to complete the operation Time Current - time passed since the invoke Time Left - expected time left to completion Curr.Speed - the average transfer speed the last 5 seconds (the first 5 seconds of a transfer is based on less time of course.) The -# option will display a totally different progress bar that doesn't need much explanation! SPEED LIMIT Curl allows the user to set the transfer speed conditions that must be met to let the transfer keep going. By using the switch -y and -Y you can make curl abort transfers if the transfer speed is below the specified lowest limit for a specified time. To have curl abort the download if the speed is slower than 3000 bytes per second for 1 minute, run: curl -Y 3000 -y 60 www.far-away-site.com This can very well be used in combination with the overall time limit, so that the above operation must be completed in whole within 30 minutes: curl -m 1800 -Y 3000 -y 60 www.far-away-site.com Forcing curl not to transfer data faster than a given rate is also possible, which might be useful if you're using a limited bandwidth connection and you don't want your transfer to use all of it (sometimes referred to as "bandwidth throttle"). Make curl transfer data no faster than 10 kilobytes per second: curl --limit-rate 10K www.far-away-site.com or curl --limit-rate 10240 www.far-away-site.com Or prevent curl from uploading data faster than 1 megabyte per second: curl -T upload --limit-rate 1M ftp://uploadshereplease.com When using the --limit-rate option, the transfer rate is regulated on a per-second basis, which will cause the total transfer speed to become lower than the given number. Sometimes of course substantially lower, if your transfer stalls during periods. CONFIG FILE Curl automatically tries to read the .curlrc file (or _curlrc file on win32 systems) from the user's home dir on startup. The config file could be made up with normal command line switches, but you can also specify the long options without the dashes to make it more readable. You can separate the options and the parameter with spaces, or with = or :. Comments can be used within the file. If the first letter on a line is a '#'-symbol the rest of the line is treated as a comment. If you want the parameter to contain spaces, you must enclose the entire parameter within double quotes ("). Within those quotes, you specify a quote as \". NOTE: You must specify options and their arguments on the same line. Example, set default time out and proxy in a config file: # We want a 30 minute timeout: -m 1800 # ... and we use a proxy for all accesses: proxy = proxy.our.domain.com:8080 White spaces ARE significant at the end of lines, but all white spaces leading up to the first characters of each line are ignored. Prevent curl from reading the default file by using -q as the first command line parameter, like: curl -q www.thatsite.com Force curl to get and display a local help page in case it is invoked without URL by making a config file similar to: # default url to get url = "http://help.with.curl.com/curlhelp.html" You can specify another config file to be read by using the -K/--config flag. If you set config file name to "-" it'll read the config from stdin, which can be handy if you want to hide options from being visible in process tables etc: echo "user = user:passwd" | curl -K - http://that.secret.site.com EXTRA HEADERS When using curl in your own very special programs, you may end up needing to pass on your own custom headers when getting a web page. You can do this by using the -H flag. Example, send the header "X-you-and-me: yes" to the server when getting a page: curl -H "X-you-and-me: yes" www.love.com This can also be useful in case you want curl to send a different text in a header than it normally does. The -H header you specify then replaces the header curl would normally send. If you replace an internal header with an empty one, you prevent that header from being sent. To prevent the Host: header from being used: curl -H "Host:" www.server.com FTP and PATH NAMES Do note that when getting files with the ftp:// URL, the given path is relative the directory you enter. To get the file 'README' from your home directory at your ftp site, do: curl ftp://user:passwd@my.site.com/README But if you want the README file from the root directory of that very same site, you need to specify the absolute file name: curl ftp://user:passwd@my.site.com//README (I.e with an extra slash in front of the file name.) SFTP and SCP and PATH NAMES With sftp: and scp: URLs, the path name given is the absolute name on the server. To access a file relative to the remote user's home directory, prefix the file with /~/ , such as: curl -u $USER sftp://home.example.com/~/.bashrc FTP and firewalls The FTP protocol requires one of the involved parties to open a second connection as soon as data is about to get transferred. There are two ways to do this. The default way for curl is to issue the PASV command which causes the server to open another port and await another connection performed by the client. This is good if the client is behind a firewall that doesn't allow incoming connections. curl ftp.download.com If the server, for example, is behind a firewall that doesn't allow connections on ports other than 21 (or if it just doesn't support the PASV command), the other way to do it is to use the PORT command and instruct the server to connect to the client on the given IP number and port (as parameters to the PORT command). The -P flag to curl supports a few different options. Your machine may have several IP-addresses and/or network interfaces and curl allows you to select which of them to use. Default address can also be used: curl -P - ftp.download.com Download with PORT but use the IP address of our 'le0' interface (this does not work on windows): curl -P le0 ftp.download.com Download with PORT but use 192.168.0.10 as our IP address to use: curl -P 192.168.0.10 ftp.download.com NETWORK INTERFACE Get a web page from a server using a specified port for the interface: curl --interface eth0:1 http://www.netscape.com/ or curl --interface 192.168.1.10 http://www.netscape.com/ HTTPS Secure HTTP requires SSL libraries to be installed and used when curl is built. If that is done, curl is capable of retrieving and posting documents using the HTTPS protocol. Example: curl https://www.secure-site.com Curl is also capable of using your personal certificates to get/post files from sites that require valid certificates. The only drawback is that the certificate needs to be in PEM-format. PEM is a standard and open format to store certificates with, but it is not used by the most commonly used browsers (Netscape and MSIE both use the so called PKCS#12 format). If you want curl to use the certificates you use with your (favourite) browser, you may need to download/compile a converter that can convert your browser's formatted certificates to PEM formatted ones. This kind of converter is included in recent versions of OpenSSL, and for older versions Dr Stephen N. Henson has written a patch for SSLeay that adds this functionality. You can get his patch (that requires an SSLeay installation) from his site at: http://www.drh-consultancy.demon.co.uk/ Example on how to automatically retrieve a document using a certificate with a personal password: curl -E /path/to/cert.pem:password https://secure.site.com/ If you neglect to specify the password on the command line, you will be prompted for the correct password before any data can be received. Many older SSL-servers have problems with SSLv3 or TLS, which newer versions of OpenSSL etc use, therefore it is sometimes useful to specify what SSL-version curl should use. Use -3, -2 or -1 to specify that exact SSL version to use (for SSLv3, SSLv2 or TLSv1 respectively): curl -2 https://secure.site.com/ Otherwise, curl will first attempt to use v3 and then v2. To use OpenSSL to convert your favourite browser's certificate into a PEM formatted one that curl can use, do something like this: In Netscape, you start with hitting the 'Security' menu button. Select 'certificates->yours' and then pick a certificate in the list Press the 'Export' button enter your PIN code for the certs select a proper place to save it Run the 'openssl' application to convert the certificate. If you cd to the openssl installation, you can do it like: # ./apps/openssl pkcs12 -in [file you saved] -clcerts -out [PEMfile] In Firefox, select Options, then Advanced, then the Encryption tab, View Certificates. This opens the Certificate Manager, where you can Export. Be sure to select PEM for the Save as type. In Internet Explorer, select Internet Options, then the Content tab, then Certificates. Then you can Export, and depending on the format you may need to convert to PEM. In Chrome, select Settings, then Show Advanced Settings. Under HTTPS/SSL select Manage Certificates. RESUMING FILE TRANSFERS To continue a file transfer where it was previously aborted, curl supports resume on HTTP(S) downloads as well as FTP uploads and downloads. Continue downloading a document: curl -C - -o file ftp://ftp.server.com/path/file Continue uploading a document(*1): curl -C - -T file ftp://ftp.server.com/path/file Continue downloading a document from a web server(*2): curl -C - -o file http://www.server.com/ (*1) = This requires that the FTP server supports the non-standard command SIZE. If it doesn't, curl will say so. (*2) = This requires that the web server supports at least HTTP/1.1. If it doesn't, curl will say so. TIME CONDITIONS HTTP allows a client to specify a time condition for the document it requests. It is If-Modified-Since or If-Unmodified-Since. Curl allows you to specify them with the -z/--time-cond flag. For example, you can easily make a download that only gets performed if the remote file is newer than a local copy. It would be made like: curl -z local.html http://remote.server.com/remote.html Or you can download a file only if the local file is newer than the remote one. Do this by prepending the date string with a '-', as in: curl -z -local.html http://remote.server.com/remote.html You can specify a "free text" date as condition. Tell curl to only download the file if it was updated since January 12, 2012: curl -z "Jan 12 2012" http://remote.server.com/remote.html Curl will then accept a wide range of date formats. You always make the date check the other way around by prepending it with a dash '-'. DICT For fun try curl dict://dict.org/m:curl curl dict://dict.org/d:heisenbug:jargon curl dict://dict.org/d:daniel:web1913 Aliases for 'm' are 'match' and 'find', and aliases for 'd' are 'define' and 'lookup'. For example, curl dict://dict.org/find:curl Commands that break the URL description of the RFC (but not the DICT protocol) are curl dict://dict.org/show:db curl dict://dict.org/show:strat Authentication is still missing (but this is not required by the RFC) LDAP If you have installed the OpenLDAP library, curl can take advantage of it and offer ldap:// support. LDAP is a complex thing and writing an LDAP query is not an easy task. I do advise you to dig up the syntax description for that elsewhere. Two places that might suit you are: Netscape's "Netscape Directory SDK 3.0 for C Programmer's Guide Chapter 10: Working with LDAP URLs": http://developer.netscape.com/docs/manuals/dirsdk/csdk30/url.htm RFC 2255, "The LDAP URL Format" http://curl.haxx.se/rfc/rfc2255.txt To show you an example, this is how I can get all people from my local LDAP server that has a certain sub-domain in their email address: curl -B "ldap://ldap.frontec.se/o=frontec??sub?mail=*sth.frontec.se" If I want the same info in HTML format, I can get it by not using the -B (enforce ASCII) flag. ENVIRONMENT VARIABLES Curl reads and understands the following environment variables: http_proxy, HTTPS_PROXY, FTP_PROXY They should be set for protocol-specific proxies. General proxy should be set with ALL_PROXY A comma-separated list of host names that shouldn't go through any proxy is set in (only an asterisk, '*' matches all hosts) NO_PROXY If the host name matches one of these strings, or the host is within the domain of one of these strings, transactions with that node will not be proxied. The usage of the -x/--proxy flag overrides the environment variables. NETRC Unix introduced the .netrc concept a long time ago. It is a way for a user to specify name and password for commonly visited FTP sites in a file so that you don't have to type them in each time you visit those sites. You realize this is a big security risk if someone else gets hold of your passwords, so therefore most unix programs won't read this file unless it is only readable by yourself (curl doesn't care though). Curl supports .netrc files if told to (using the -n/--netrc and --netrc-optional options). This is not restricted to just FTP, so curl can use it for all protocols where authentication is used. A very simple .netrc file could look something like: machine curl.haxx.se login iamdaniel password mysecret CUSTOM OUTPUT To better allow script programmers to get to know about the progress of curl, the -w/--write-out option was introduced. Using this, you can specify what information from the previous transfer you want to extract. To display the amount of bytes downloaded together with some text and an ending newline: curl -w 'We downloaded %{size_download} bytes\n' www.download.com KERBEROS FTP TRANSFER Curl supports kerberos4 and kerberos5/GSSAPI for FTP transfers. You need the kerberos package installed and used at curl build time for it to be available. First, get the krb-ticket the normal way, like with the kinit/kauth tool. Then use curl in way similar to: curl --krb private ftp://krb4site.com -u username:fakepwd There's no use for a password on the -u switch, but a blank one will make curl ask for one and you already entered the real password to kinit/kauth. TELNET The curl telnet support is basic and very easy to use. Curl passes all data passed to it on stdin to the remote server. Connect to a remote telnet server using a command line similar to: curl telnet://remote.server.com And enter the data to pass to the server on stdin. The result will be sent to stdout or to the file you specify with -o. You might want the -N/--no-buffer option to switch off the buffered output for slow connections or similar. Pass options to the telnet protocol negotiation, by using the -t option. To tell the server we use a vt100 terminal, try something like: curl -tTTYPE=vt100 telnet://remote.server.com Other interesting options for it -t include: - XDISPLOC= Sets the X display location. - NEW_ENV= Sets an environment variable. NOTE: The telnet protocol does not specify any way to login with a specified user and password so curl can't do that automatically. To do that, you need to track when the login prompt is received and send the username and password accordingly. PERSISTENT CONNECTIONS Specifying multiple files on a single command line will make curl transfer all of them, one after the other in the specified order. libcurl will attempt to use persistent connections for the transfers so that the second transfer to the same host can use the same connection that was already initiated and was left open in the previous transfer. This greatly decreases connection time for all but the first transfer and it makes a far better use of the network. Note that curl cannot use persistent connections for transfers that are used in subsequence curl invokes. Try to stuff as many URLs as possible on the same command line if they are using the same host, as that'll make the transfers faster. If you use an HTTP proxy for file transfers, practically all transfers will be persistent. MULTIPLE TRANSFERS WITH A SINGLE COMMAND LINE As is mentioned above, you can download multiple files with one command line by simply adding more URLs. If you want those to get saved to a local file instead of just printed to stdout, you need to add one save option for each URL you specify. Note that this also goes for the -O option (but not --remote-name-all). For example: get two files and use -O for the first and a custom file name for the second: curl -O http://url.com/file.txt ftp://ftp.com/moo.exe -o moo.jpg You can also upload multiple files in a similar fashion: curl -T local1 ftp://ftp.com/moo.exe -T local2 ftp://ftp.com/moo2.txt IPv6 curl will connect to a server with IPv6 when a host lookup returns an IPv6 address and fall back to IPv4 if the connection fails. The --ipv4 and --ipv6 options can specify which address to use when both are available. IPv6 addresses can also be specified directly in URLs using the syntax: http://[2001:1890:1112:1::20]/overview.html When this style is used, the -g option must be given to stop curl from interpreting the square brackets as special globbing characters. Link local and site local addresses including a scope identifier, such as fe80::1234%1, may also be used, but the scope portion must be numeric and the percent character must be URL escaped. The previous example in an SFTP URL might look like: sftp://[fe80::1234%251]/ IPv6 addresses provided other than in URLs (e.g. to the --proxy, --interface or --ftp-port options) should not be URL encoded. METALINK Curl supports Metalink (both version 3 and 4 (RFC 5854) are supported), a way to list multiple URIs and hashes for a file. Curl will make use of the mirrors listed within for failover if there are errors (such as the file or server not being available). It will also verify the hash of the file after the download completes. The Metalink file itself is downloaded and processed in memory and not stored in the local file system. Example to use a remote Metalink file: curl --metalink http://www.example.com/example.metalink To use a Metalink file in the local file system, use FILE protocol (file://): curl --metalink file://example.metalink Please note that if FILE protocol is disabled, there is no way to use a local Metalink file at the time of this writing. Also note that if --metalink and --include are used together, --include will be ignored. This is because including headers in the response will break Metalink parser and if the headers are included in the file described in Metalink file, hash check will fail. MAILING LISTS For your convenience, we have several open mailing lists to discuss curl, its development and things relevant to this. Get all info at http://curl.haxx.se/mail/. Some of the lists available are: curl-users Users of the command line tool. How to use it, what doesn't work, new features, related tools, questions, news, installations, compilations, running, porting etc. curl-library Developers using or developing libcurl. Bugs, extensions, improvements. curl-announce Low-traffic. Only receives announcements of new public versions. At worst, that makes something like one or two mails per month, but usually only one mail every second month. curl-and-php Using the curl functions in PHP. Everything curl with a PHP angle. Or PHP with a curl angle. curl-and-python Python hackers using curl with or without the python binding pycurl. Please direct curl questions, feature requests and trouble reports to one of these mailing lists instead of mailing any individual. curl-7.35.0/docs/RESOURCES0000644000175000017500000000435712213173003011722 00000000000000 _ _ ____ _ Project ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| This document lists documents and standards used by curl. RFC 959 - The FTP protocol RFC 1635 - How to Use Anonymous FTP RFC 1738 - Uniform Resource Locators RFC 1777 - defines the LDAP protocol RFC 1808 - Relative Uniform Resource Locators RFC 1867 - Form-based File Upload in HTML RFC 1950 - ZLIB Compressed Data Format Specification RFC 1951 - DEFLATE Compressed Data Format Specification RFC 1952 - gzip compression format RFC 1959 - LDAP URL syntax RFC 2045-2049 - Everything you need to know about MIME! (needed for form based upload) RFC 2068 - HTTP 1.1 (obsoleted by RFC 2616) RFC 2104 - Keyed-Hashing for Message Authentication RFC 2109 - HTTP State Management Mechanism (cookie stuff) - Also, read Netscape's specification at http://curl.haxx.se/rfc/cookie_spec.html RFC 2183 - The Content-Disposition Header Field RFC 2195 - CRAM-MD5 authentication RFC 2229 - A Dictionary Server Protocol RFC 2255 - Newer LDAP URL syntax document. RFC 2231 - MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations RFC 2388 - "Returning Values from Forms: multipart/form-data" Use this as an addition to the RFC1867 RFC 2396 - "Uniform Resource Identifiers: Generic Syntax and Semantics" This one obsoletes RFC 1738, but since RFC 1738 is often mentioned I've left it in this list. RFC 2428 - FTP Extensions for IPv6 and NATs RFC 2577 - FTP Security Considerations RFC 2616 - HTTP 1.1, the latest RFC 2617 - HTTP Authentication RFC 2718 - Guidelines for new URL Schemes RFC 2732 - Format for Literal IPv6 Addresses in URL's RFC 2818 - HTTP Over TLS (TLS is the successor to SSL) RFC 2821 - SMTP protocol RFC 2964 - Use of HTTP State Management RFC 2965 - HTTP State Management Mechanism. Cookies. Obsoletes RFC2109 RFC 3207 - SMTP over TLS RFC 4616 - PLAIN authentication RFC 4954 - SMTP Authentication curl-7.35.0/docs/DISTRO-DILEMMA0000644000175000017500000001600212213173003012410 00000000000000 Date: February 11, 2007 Author: Daniel Stenberg URL: http://curl.haxx.se/legal/distro-dilemma.html Condition This document is written to describe the situation as it is right now. libcurl 7.16.1 is currently the latest version available. Things may of course change in the future. This document reflects my view and understanding of these things. Please tell me where and how you think I'm wrong, and I'll try to correct my mistakes. Background The Free Software Foundation has deemed the Original BSD license[1] to be "incompatible"[2] with GPL[3]. I'd rather say it is the other way around, but the point is the same: if you distribute a binary version of a GPL program, it MUST NOT be linked with any Original BSD-licensed parts or libraries. Doing so will violate the GPL license. For a long time, very many GPL licensed programs have avoided this license mess by adding an exception[8] to their license. And many others have just closed their eyes for this problem. libcurl is MIT-style[4] licensed - how on earth did this dilemma fall onto our plates? libcurl is only a little library. libcurl can be built to use OpenSSL for its SSL/TLS capabilities. OpenSSL is basically Original BSD licensed[5]. If libcurl built to use OpenSSL is used by a GPL-licensed application and you decide to distribute a binary version of it (Linux distros - for example - tend to), you have a clash. GPL vs Original BSD. This dilemma is not libcurl-specific nor is it specific to any particular Linux distro. (This article mentions and refers to Debian several times, but only because Debian seems to be the only Linux distro to have faced this issue yet since no other distro is shipping libcurl built with two SSL libraries.) Part of the Operating System This would not be a problem if the used lib would be considered part of the underlying operating system, as then the GPL license has an exception clause[6] that allows applications to use such libs without having to be allowed to distribute it or its sources. Possibly some distros will claim that OpenSSL is part of their operating system. Debian does however not take this stance and has officially(?) claimed that OpenSSL is not a required part of the Debian operating system Some people claim that this paragraph cannot be exploited this way by a Linux distro, but I am not a lawyer and that is a discussion left outside of this document. GnuTLS Since May 2005 libcurl can get built to use GnuTLS instead of OpenSSL. GnuTLS is an LGPL[7] licensed library that offers a matching set of features as OpenSSL does. Now, you can build and distribute an TLS/SSL capable libcurl without including any Original BSD licensed code. I believe Debian is the first (only?) distro that provides libcurl/GnutTLS packages. yassl libcurl can get also get built to use yassl for the TLS/SSL layer. yassl is a GPL[3] licensed library. GnuTLS vs OpenSSL vs yassl While these three libraries offer similar features, they are not equal. libcurl does not (yet) offer a standardized stable ABI if you decide to switch from using libcurl-openssl to libcurl-gnutls or vice versa. The GnuTLS and yassl support is very recent in libcurl and it has not been tested nor used very extensively, while the OpenSSL equivalent code has been used and thus matured since 1999. GnuTLS - LGPL licensened - supports SRP - lacks SSLv2 support - lacks MD2 support (used by at least some CA certs) - lacks the crypto functions libcurl uses for NTLM OpenSSL - Original BSD licensened - lacks SRP - supports SSLv2 - older and more widely used - provides crypto functions libcurl uses for NTLM - libcurl can do non-blocking connects with it in 7.15.4 and later yassl - GPL licensed - much untested and unproven in the real work by (lib)curl users so we don't know a lot about restrictions or benefits from using this The Better License, Original BSD, GPL or LGPL? It isn't obvious or without debate to any objective interested party that either of these licenses are the "better" or even the "preferred" one in a generic situation. Instead, I think we should accept the fact that the SSL/TLS libraries and their different licenses will fit different applications and their authors differently depending on the applications' licenses and their general usage pattern (considering how GPL and LGPL libraries for example can be burdensome for embedded systems usage). In Debian land, there seems to be a common opinion that LGPL is "maximally compatible" with apps while Original BSD is not. Like this: http://lists.debian.org/debian-devel/2005/09/msg01417.html More SSL Libraries In libcurl, there's no stopping us here. There are more Open Source/Free SSL/TLS libraries out there and we would very much like to support them as well, to offer application authors an even wider scope of choice. Application Angle of this Problem libcurl is built to use one SSL/TLS library. It uses a single fixed name (by default) on the built/created lib file, and applications are built/linked to use that single lib. Replacing one libcurl instance with another one that uses the other SSL/TLS library might break one or more applications (due to ABI differences and/or different feature set). You want your application to use the libcurl it was built for. Project cURL Angle of this Problem We distribute libcurl and everyone may build libcurl with either library at their choice. This problem is not directly a problem of ours. It merely affects users - GPL application authors only - of our lib as it comes included and delivered on some distros. libcurl has different ABI when built with different SSL/TLS libraries due to these reasons: 1. No one has worked on fixing this. The mutex/lock callbacks should be set with a generic libcurl function that should use the proper underlying functions. 2. The CURLOPT_SSL_CTX_FUNCTION option is not possible to "emulate" on GnuTLS but simply requires OpenSSL. 3. There might be some other subtle differences just because nobody has yet tried to make a fixed ABI like this. Distro Angle of this Problem To my knowledge there is only one distro that ships libcurl built with either OpenSSL or GnuTLS. Debian Linux is now (since mid September 2005) providing two different libcurl packages, one for libcurl built with OpenSSL and one built with GnuTLS. They use different .so names and can this both be installed in a single system simultaneously. This has been said to be a transitional system not desired to keep in the long run. Footnotes [1] = http://www.xfree86.org/3.3.6/COPYRIGHT2.html#6 [2] = http://www.fsf.org/licensing/essays/bsd.html [3] = http://www.fsf.org/licensing/licenses/gpl.html [4] = http://curl.haxx.se/docs/copyright.html [5] = http://www.openssl.org/source/license.html [6] = http://www.fsf.org/licensing/licenses/gpl.html end of section 3 [7] = http://www.fsf.org/licensing/licenses/lgpl.html [8] = http://en.wikipedia.org/wiki/OpenSSL_exception Feedback/Updates provided by Eric Cooper curl-7.35.0/docs/CONTRIBUTE0000644000175000017500000003005212262353672012035 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| When Contributing Source Code This document is intended to offer guidelines that can be useful to keep in mind when you decide to contribute to the project. This concerns new features as well as corrections to existing flaws or bugs. 1. Learning cURL 1.1 Join the Community 1.2 License 1.3 What To Read 2. cURL Coding Standards 2.1 Naming 2.2 Indenting 2.3 Commenting 2.4 Line Lengths 2.5 General Style 2.6 Non-clobbering All Over 2.7 Platform Dependent Code 2.8 Write Separate Patches 2.9 Patch Against Recent Sources 2.10 Document 2.11 Test Cases 3. Pushing Out Your Changes 3.1 Write Access to git Repository 3.2 How To Make a Patch with git 3.3 How To Make a Patch without git 3.4 How to get your changes into the main sources 3.5 Write good commit messages 3.6 Please don't send pull requests ============================================================================== 1. Learning cURL 1.1 Join the Community Skip over to http://curl.haxx.se/mail/ and join the appropriate mailing list(s). Read up on details before you post questions. Read this file before you start sending patches! We prefer patches and discussions being held on the mailing list(s), not sent to individuals. Before posting to one of the curl mailing lists, please read up on the mailing list etiquette: http://curl.haxx.se/mail/etiquette.html We also hang out on IRC in #curl on irc.freenode.net 1.2. License When contributing with code, you agree to put your changes and new code under the same license curl and libcurl is already using unless stated and agreed otherwise. If you add a larger piece of code, you can opt to make that file or set of files to use a different license as long as they don't enforce any changes to the rest of the package and they make sense. Such "separate parts" can not be GPL licensed (as we don't want copyleft to affect users of libcurl) but they must use "GPL compatible" licenses (as we want to allow users to use libcurl properly in GPL licensed environments). When changing existing source code, you do not alter the copyright of the original file(s). The copyright will still be owned by the original creator(s) or those who have been assigned copyright by the original author(s). By submitting a patch to the curl project, you are assumed to have the right to the code and to be allowed by your employer or whatever to hand over that patch/code to us. We will credit you for your changes as far as possible, to give credit but also to keep a trace back to who made what changes. Please always provide us with your full real name when contributing! 1.3 What To Read Source code, the man pages, the INTERNALS document, TODO, KNOWN_BUGS, the most recent CHANGES. Just lurking on the curl-library mailing list is gonna give you a lot of insights on what's going on right now. Asking there is a good idea too. 2. cURL Coding Standards 2.1 Naming Try using a non-confusing naming scheme for your new functions and variable names. It doesn't necessarily have to mean that you should use the same as in other places of the code, just that the names should be logical, understandable and be named according to what they're used for. File-local functions should be made static. We like lower case names. See the INTERNALS document on how we name non-exported library-global symbols. 2.2 Indenting Use the same indenting levels and bracing method as all the other code already does. It makes the source code easier to follow if all of it is written using the same style. We don't ask you to like it, we just ask you to follow the tradition! ;-) This mainly means: 2-level indents, using spaces only (no tabs) and having the opening brace ({) on the same line as the if() or while(). Also note that we use if() and while() with no space before the parenthesis. 2.3 Commenting Comment your source code extensively using C comments (/* comment */), DO NOT use C++ comments (// this style). Commented code is quality code and enables future modifications much more. Uncommented code risk having to be completely replaced when someone wants to extend things, since other persons' source code can get quite hard to read. 2.4 Line Lengths We write source lines shorter than 80 columns. 2.5 General Style Keep your functions small. If they're small you avoid a lot of mistakes and you don't accidentally mix up variables etc. 2.6 Non-clobbering All Over When you write new functionality or fix bugs, it is important that you don't fiddle all over the source files and functions. Remember that it is likely that other people have done changes in the same source files as you have and possibly even in the same functions. If you bring completely new functionality, try writing it in a new source file. If you fix bugs, try to fix one bug at a time and send them as separate patches. 2.7 Platform Dependent Code Use #ifdef HAVE_FEATURE to do conditional code. We avoid checking for particular operating systems or hardware in the #ifdef lines. The HAVE_FEATURE shall be generated by the configure script for unix-like systems and they are hard-coded in the config-[system].h files for the others. 2.8 Write Separate Patches It is annoying when you get a huge patch from someone that is said to fix 511 odd problems, but discussions and opinions don't agree with 510 of them - or 509 of them were already fixed in a different way. Then the patcher needs to extract the single interesting patch from somewhere within the huge pile of source, and that gives a lot of extra work. Preferably, all fixes that correct different problems should be in their own patch with an attached description exactly what they correct so that all patches can be selectively applied by the maintainer or other interested parties. Also, separate patches enable bisecting much better when we track problems in the future. 2.9 Patch Against Recent Sources Please try to get the latest available sources to make your patches against. It makes the life of the developers so much easier. The very best is if you get the most up-to-date sources from the git repository, but the latest release archive is quite OK as well! 2.10 Document Writing docs is dead boring and one of the big problems with many open source projects. Someone's gotta do it. It makes it a lot easier if you submit a small description of your fix or your new features with every contribution so that it can be swiftly added to the package documentation. The documentation is always made in man pages (nroff formatted) or plain ASCII files. All HTML files on the web site and in the release archives are generated from the nroff/ASCII versions. 2.11 Test Cases Since the introduction of the test suite, we can quickly verify that the main features are working as they're supposed to. To maintain this situation and improve it, all new features and functions that are added need to be tested in the test suite. Every feature that is added should get at least one valid test case that verifies that it works as documented. If every submitter also posts a few test cases, it won't end up as a heavy burden on a single person! If you don't have test cases or perhaps you have done something that is very hard to write tests for, do explain exactly how you have otherwise tested and verified your changes. 3. Pushing Out Your Changes 3.1 Write Access to git Repository If you are a frequent contributor, or have another good reason, you can of course get write access to the git repository and then you'll be able to push your changes straight into the git repo instead of sending changes by mail as patches. Just ask if this is what you'd want. You will be required to have posted a few quality patches first, before you can be granted push access. 3.2 How To Make a Patch with git You need to first checkout the repository: git clone git://github.com/bagder/curl.git You then proceed and edit all the files you like and you commit them to your local repository: git commit [file] As usual, group your commits so that you commit all changes that at once that constitutes a logical change. See also section "3.5 Write good commit messages". Once you have done all your commits and you're happy with what you see, you can make patches out of your changes that are suitable for mailing: git format-patch remotes/origin/master This creates files in your local directory named NNNN-[name].patch for each commit. Now send those patches off to the curl-library list. You can of course opt to do that with the 'git send-email' command. 3.3 How To Make a Patch without git Keep a copy of the unmodified curl sources. Make your changes in a separate source tree. When you think you have something that you want to offer the curl community, use GNU diff to generate patches. If you have modified a single file, try something like: diff -u unmodified-file.c my-changed-one.c > my-fixes.diff If you have modified several files, possibly in different directories, you can use diff recursively: diff -ur curl-original-dir curl-modified-sources-dir > my-fixes.diff The GNU diff and GNU patch tools exist for virtually all platforms, including all kinds of Unixes and Windows: For unix-like operating systems: http://www.gnu.org/software/patch/patch.html http://www.gnu.org/directory/diffutils.html For Windows: http://gnuwin32.sourceforge.net/packages/patch.htm http://gnuwin32.sourceforge.net/packages/diffutils.htm 3.4 How to get your changes into the main sources Submit your patch to the curl-library mailing list. Make the patch against as recent sources as possible. Make sure your patch adheres to the source indent and coding style of already existing source code. Failing to do so just adds more work for me. Respond to replies on the list about the patch and answer questions and/or fix nits/flaws. This is very important. I will take lack of replies as a sign that you're not very anxious to get your patch accepted and I tend to simply drop such patches from my TODO list. If you've followed the above paragraphs and your patch still hasn't been incorporated after some weeks, consider resubmitting it to the list. 3.5 Write good commit messages A short guide to how to do fine commit messages in the curl project. ---- start ---- [area]: [short line describing the main effect] [separate the above single line from the rest with an empty line] [full description, no wider than 72 columns that describe as much as possible as to why this change is made, and possibly what things it fixes and everything else that is related] ---- stop ---- Don't forget to use commit --author="" if you commit someone else's work, and make sure that you have your own user and email setup correctly in git before you commit 3.6 Please don't send pull requests With git (and especially github) it is easy and tempting to send a pull request to one or more people in the curl project to have changes merged this way instead of mailing patches to the curl-library mailing list. We don't like that. We want them mailed for these reasons: - Peer review. Anyone and everyone on the list can review, comment and improve on the patch. Pull requests limit this ability. - Anyone can merge the patch into their own trees for testing and those who have push rights can push it to the main repo. It doesn't have to be anyone the patch author knows beforehand. - Commit messages can be tweaked and changed if merged locally instead of using github. Merges directly on github requires the changes to be perfect already, which they seldom are. - Merges on github prevents rebases and even enforces --no-ff which is a git style we don't otherwise use in the project However: once patches have been reviewed and deemed fine on list they are perfectly OK to be pulled from a published git tree. curl-7.35.0/docs/Makefile.am0000644000175000017500000000372712262353672012501 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # ########################################################################### AUTOMAKE_OPTIONS = foreign no-dependencies man_MANS = curl.1 curl-config.1 noinst_man_MANS = mk-ca-bundle.1 GENHTMLPAGES = curl.html curl-config.html mk-ca-bundle.html PDFPAGES = curl.pdf curl-config.pdf mk-ca-bundle.pdf HTMLPAGES = $(GENHTMLPAGES) index.html SUBDIRS = examples libcurl CLEANFILES = $(GENHTMLPAGES) $(PDFPAGES) EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \ README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS VERSIONS \ KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) HISTORY INSTALL \ $(PDFPAGES) LICENSE-MIXING README.netware DISTRO-DILEMMA INSTALL.devcpp \ MAIL-ETIQUETTE HTTP-COOKIES LIBCURL-STRUCTS SECURITY RELEASE-PROCEDURE MAN2HTML= roffit < $< >$@ SUFFIXES = .1 .html .pdf html: $(HTMLPAGES) cd libcurl; make html pdf: $(PDFPAGES) cd libcurl; make pdf .1.html: $(MAN2HTML) .1.pdf: @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \ groff -Tps -man $< >$$foo.ps; \ ps2pdf $$foo.ps $@; \ rm $$foo.ps; \ echo "converted $< to $@") curl-7.35.0/docs/Makefile.in0000644000175000017500000006314312272122666012506 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # ########################################################################### VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = docs DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs INSTALL THANKS TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \ $(top_srcdir)/m4/curl-confopts.m4 \ $(top_srcdir)/m4/curl-functions.m4 \ $(top_srcdir)/m4/curl-openssl.m4 \ $(top_srcdir)/m4/curl-override.m4 \ $(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/xc-am-iface.m4 \ $(top_srcdir)/m4/xc-cc-check.m4 \ $(top_srcdir)/m4/xc-lt-iface.m4 \ $(top_srcdir)/m4/xc-translit.m4 \ $(top_srcdir)/m4/xc-val-flgs.m4 \ $(top_srcdir)/m4/zz40-xc-ovr.m4 \ $(top_srcdir)/m4/zz50-xc-ovr.m4 \ $(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \ $(top_builddir)/include/curl/curlbuild.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = depcomp = am__depfiles_maybe = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" MANS = $(man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@ CURLVERSION = @CURLVERSION@ CURL_CA_BUNDLE = @CURL_CA_BUNDLE@ CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@ CURL_DISABLE_DICT = @CURL_DISABLE_DICT@ CURL_DISABLE_FILE = @CURL_DISABLE_FILE@ CURL_DISABLE_FTP = @CURL_DISABLE_FTP@ CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@ CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@ CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@ CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@ CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@ CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@ CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@ CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@ CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@ CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@ CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@ CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@ CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@ CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_SHARED = @ENABLE_SHARED@ ENABLE_STATIC = @ENABLE_STATIC@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@ HAVE_LDAP_SSL = @HAVE_LDAP_SSL@ HAVE_LIBZ = @HAVE_LIBZ@ HAVE_SSLEAY_SRP = @HAVE_SSLEAY_SRP@ IDN_ENABLED = @IDN_ENABLED@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IPV6_ENABLED = @IPV6_ENABLED@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@ LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@ LIBMETALINK_LIBS = @LIBMETALINK_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANOPT = @MANOPT@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NROFF = @NROFF@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGADD_NAME = @PKGADD_NAME@ PKGADD_PKG = @PKGADD_PKG@ PKGADD_VENDOR = @PKGADD_VENDOR@ PKGCONFIG = @PKGCONFIG@ RANDOM_FILE = @RANDOM_FILE@ RANLIB = @RANLIB@ REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_ENABLED = @SSL_ENABLED@ STRIP = @STRIP@ SUPPORT_FEATURES = @SUPPORT_FEATURES@ SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@ USE_ARES = @USE_ARES@ USE_AXTLS = @USE_AXTLS@ USE_CYASSL = @USE_CYASSL@ USE_DARWINSSL = @USE_DARWINSSL@ USE_GNUTLS = @USE_GNUTLS@ USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@ USE_LIBRTMP = @USE_LIBRTMP@ USE_LIBSSH2 = @USE_LIBSSH2@ USE_NGHTTP2 = @USE_NGHTTP2@ USE_NSS = @USE_NSS@ USE_OPENLDAP = @USE_OPENLDAP@ USE_POLARSSL = @USE_POLARSSL@ USE_SCHANNEL = @USE_SCHANNEL@ USE_SSLEAY = @USE_SSLEAY@ USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@ VERSION = @VERSION@ VERSIONNUM = @VERSIONNUM@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libext = @libext@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign no-dependencies man_MANS = curl.1 curl-config.1 noinst_man_MANS = mk-ca-bundle.1 GENHTMLPAGES = curl.html curl-config.html mk-ca-bundle.html PDFPAGES = curl.pdf curl-config.pdf mk-ca-bundle.pdf HTMLPAGES = $(GENHTMLPAGES) index.html SUBDIRS = examples libcurl CLEANFILES = $(GENHTMLPAGES) $(PDFPAGES) EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \ README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS VERSIONS \ KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) HISTORY INSTALL \ $(PDFPAGES) LICENSE-MIXING README.netware DISTRO-DILEMMA INSTALL.devcpp \ MAIL-ETIQUETTE HTTP-COOKIES LIBCURL-STRUCTS SECURITY RELEASE-PROCEDURE MAN2HTML = roffit < $< >$@ SUFFIXES = .1 .html .pdf all: all-recursive .SUFFIXES: .SUFFIXES: .1 .html .pdf $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign docs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-man uninstall-man1 html: $(HTMLPAGES) cd libcurl; make html pdf: $(PDFPAGES) cd libcurl; make pdf .1.html: $(MAN2HTML) .1.pdf: @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \ groff -Tps -man $< >$$foo.ps; \ ps2pdf $$foo.ps $@; \ rm $$foo.ps; \ echo "converted $< to $@") # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: curl-7.35.0/docs/HISTORY0000644000175000017500000002033312262102134011502 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| How cURL Became Like This Towards the end of 1996, Daniel Stenberg came up with the idea to make currency-exchange calculations available to Internet Relay Chat (IRC) users. All the necessary data are published on the Web; he just needed to automate their retrieval. Daniel simply adopted an existing command-line open-source tool, httpget, that Brazilian Rafael Sagula had written and recently release version 0.1 of. After a few minor adjustments, it did just what he needed. HttpGet 1.0 was released on April 8th 1997 with brand new HTTP proxy support. We soon found and fixed support for getting currencies over GOPHER. Once FTP download support was added, the name of the project was changed and urlget 2.0 was released in August 1997. The http-only days were already passed. The project slowly grew bigger. When upload capabilities were added and the name once again was misleading, a second name change was made and on March 20, 1998 curl 4 was released. (The version numbering from the previous names was kept.) (Unrelated to this project a company called Curl Corporation registered a US trademark on the name "CURL" on May 18 1998. That company had then already registered the curl.com domain back in November of the previous year. All this was revealed to us much later.) SSL support was added, powered by the SSLeay library. August 1998, first announcement of curl on freshmeat.net. October 1998, with the curl 4.9 release and the introduction of cookie support, curl was no longer released under the GPL license. Now we're at 4000 lines of code, we switched over to the MPL license to restrict the effects of "copyleft". November 1998, configure script and reported successful compiles on several major operating systems. The never-quite-understood -F option was added and curl could now simulate quite a lot of a browser. TELNET support was added. Curl 5 was released in December 1998 and introduced the first ever curl man page. People started making Linux RPM packages out of it. January 1999, DICT support added. OpenSSL took over where SSLeay was abandoned. May 1999, first Debian package. August 1999, LDAP:// and FILE:// support added. The curl web site gets 1300 visits weekly. Released curl 6.0 in September. 15000 lines of code. December 28 1999, added the project on Sourceforge and started using its services for managing the project. Spring 2000, major internal overhaul to provide a suitable library interface. The first non-beta release was named 7.1 and arrived in August. This offered the easy interface and turned out to be the beginning of actually getting other software and programs to get based on and powered by libcurl. Almost 20000 lines of code. August 2000, the curl web site gets 4000 visits weekly. The PHP guys adopted libcurl already the same month, when the first ever third party libcurl binding showed up. CURL has been a supported module in PHP since the release of PHP 4.0.2. This would soon get followers. More than 16 different bindings exist at the time of this writing. September 2000, kerberos4 support was added. In November 2000 started the work on a test suite for curl. It was later re-written from scratch again. The libcurl major SONAME number was set to 1. January 2001, Daniel released curl 7.5.2 under a new license again: MIT (or MPL). The MIT license is extremely liberal and can be used combined with GPL in other projects. This would finally put an end to the "complaints" from people involved in GPLed projects that previously were prohibited from using libcurl while it was released under MPL only. (Due to the fact that MPL is deemed "GPL incompatible".) curl supports HTTP 1.1 starting with the release of 7.7, March 22 2001. This also introduced libcurl's ability to do persistent connections. 24000 lines of code. The libcurl major SONAME number was bumped to 2 due to this overhaul. The first experimental ftps:// support was added in March 2001. August 2001. curl is bundled in Mac OS X, 10.1. It was already becoming more and more of a standard utility of Linux distributions and a regular in the BSD ports collections. The curl web site gets 8000 visits weekly. Curl Corporation contacted Daniel to discuss "the name issue". After Daniel's reply, they have never since got in touch again. September 2001, libcurl 7.9 introduces cookie jar and curl_formadd(). During the forthcoming 7.9.x releases, we introduced the multi interface slowly and without much whistles. June 2002, the curl web site gets 13000 visits weekly. curl and libcurl is 35000 lines of code. Reported successful compiles on more than 40 combinations of CPUs and operating systems. To estimate number of users of the curl tool or libcurl library is next to impossible. Around 5000 downloaded packages each week from the main site gives a hint, but the packages are mirrored extensively, bundled with numerous OS distributions and otherwise retrieved as part of other software. September 2002, with the release of curl 7.10 it is released under the MIT license only. January 2003. Started working on the distributed curl tests. The autobuilds. February 2003, the curl site averages at 20000 visits weekly. At any given moment, there's an average of 3 people browsing the curl.haxx.se site. Multiple new authentication schemes are supported: Digest (May), NTLM (June) and Negotiate (June). November 2003: curl 7.10.8 is released. 45000 lines of code. ~55000 unique visitors to the curl.haxx.se site. Five official web mirrors. December 2003, full-fledged SSL for FTP is supported. January 2004: curl 7.11.0 introduced large file support. June 2004: curl 7.12.0 introduced IDN support. 10 official web mirrors. This release bumped the major SONAME to 3 due to the removal of the curl_formparse() function August 2004: Curl and libcurl 7.12.1 Public curl release number: 82 Releases counted from the very beginning: 109 Available command line options: 96 Available curl_easy_setopt() options: 120 Number of public functions in libcurl: 36 Amount of public web site mirrors: 12 Number of known libcurl bindings: 26 April 2005: GnuTLS can now optionally be used for the secure layer when curl is built. September 2005: TFTP support was added. More than 100,000 unique visitors of the curl web site. 25 mirrors. December 2005: security vulnerability: libcurl URL Buffer Overflow January 2006: We dropped support for Gopher. We found bugs in the implementation that turned out having been introduced years ago, so with the conclusion that nobody had found out in all this time we removed it instead of fixing it. March 2006: security vulnerability: libcurl TFTP Packet Buffer Overflow April 2006: Added the multi_socket() API September 2006: The major SONAME number for libcurl was bumped to 4 due to the removal of ftp third party transfer support. November 2006: Added SCP and SFTP support February 2007: Added support for the Mozilla NSS library to do the SSL/TLS stuff July 2007: security vulnerability: libcurl GnuTLS insufficient cert verification November 2008: Command line options: 128 curl_easy_setopt() options: 158 Public functions in libcurl: 58 Known libcurl bindings: 37 Contributors: 683 145,000 unique visitors. >100 GB downloaded. March 2009: security vulnerability: libcurl Arbitrary File Access August 2009: security vulnerability: libcurl embedded zero in cert name December 2009: Added support for IMAP, POP3 and SMTP January 2010: Added support for RTSP February 2010: security vulnerability: libcurl data callback excessive length March 2010: The project switched over to use git instead of CVS for source code control May 2010: Added support for RTMP Added support for PolarSSL to do the SSL/TLS stuff August 2010: Public curl releases: 117 Command line options: 138 curl_easy_setopt() options: 180 Public functions in libcurl: 58 Known libcurl bindings: 39 Contributors: 808 Gopher support added (re-added actually) curl-7.35.0/docs/TODO0000644000175000017500000005261512270035364011127 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| Things that could be nice to do in the future Things to do in project cURL. Please tell us what you think, contribute and send us patches that improve things! All bugs documented in the KNOWN_BUGS document are subject for fixing! 1. libcurl 1.2 More data sharing 1.3 struct lifreq 1.4 signal-based resolver timeouts 1.5 get rid of PATH_MAX 1.6 Modified buffer size approach 1.7 Detect when called from witin callbacks 1.8 Allow SSL (HTTPS) to proxy 2. libcurl - multi interface 2.1 More non-blocking 2.2 Fix HTTP Pipelining for PUT 3. Documentation 3.1 More and better 4. FTP 4.1 HOST 4.2 Alter passive/active on failure and retry 4.3 Earlier bad letter detection 4.4 REST for large files 4.5 ASCII support 5. HTTP 5.1 Better persistency for HTTP 1.0 5.2 support FF3 sqlite cookie files 5.3 Rearrange request header order 5.4 HTTP2/SPDY 5.5 auth= in URLs 6. TELNET 6.1 ditch stdin 6.2 ditch telnet-specific select 6.3 feature negotiation debug data 6.4 send data in chunks 7. SMTP 7.1 Pipelining 7.2 Enhanced capability support 8. POP3 8.1 Pipelining 8.2 Enhanced capability support 9. IMAP 9.1 Enhanced capability support 10. LDAP 10.1 SASL based authentication mechanisms 11. New protocols 11.1 RSYNC 12. SSL 12.1 Disable specific versions 12.2 Provide mutex locking API 12.3 Evaluate SSL patches 12.4 Cache OpenSSL contexts 12.5 Export session ids 12.6 Provide callback for cert verification 12.7 improve configure --with-ssl 12.8 Support DANE 13. GnuTLS 13.1 SSL engine stuff 13.2 check connection 14. SASL 14.1 Other authentication mechanisms 15. Client 15.1 sync 15.2 glob posts 15.3 prevent file overwriting 15.4 simultaneous parallel transfers 15.5 provide formpost headers 15.6 url-specific options 15.7 warning when setting an option 15.8 IPv6 addresses with globbing 16. Build 16.1 roffit 17. Test suite 17.1 SSL tunnel 17.2 nicer lacking perl message 17.3 more protocols supported 17.4 more platforms supported 18. Next SONAME bump 18.1 http-style HEAD output for ftp 18.2 combine error codes 18.3 extend CURLOPT_SOCKOPTFUNCTION prototype 19. Next major release 19.1 cleanup return codes 19.2 remove obsolete defines 19.3 size_t 19.4 remove several functions 19.5 remove CURLOPT_FAILONERROR 19.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE 19.7 remove progress meter from libcurl 19.8 remove 'curl_httppost' from public 19.9 have form functions use CURL handle argument 19.10 Add CURLOPT_MAIL_CLIENT option ============================================================================== 1. libcurl 1.2 More data sharing curl_share_* functions already exist and work, and they can be extended to share more. For example, enable sharing of the ares channel and the connection cache. 1.3 struct lifreq Use 'struct lifreq' and SIOCGLIFADDR instead of 'struct ifreq' and SIOCGIFADDR on newer Solaris versions as they claim the latter is obsolete. To support ipv6 interface addresses for network interfaces properly. 1.4 signal-based resolver timeouts libcurl built without an asynchronous resolver library uses alarm() to time out DNS lookups. When a timeout occurs, this causes libcurl to jump from the signal handler back into the library with a sigsetjmp, which effectively causes libcurl to continue running within the signal handler. This is non-portable and could cause problems on some platforms. A discussion on the problem is available at http://curl.haxx.se/mail/lib-2008-09/0197.html Also, alarm() provides timeout resolution only to the nearest second. alarm ought to be replaced by setitimer on systems that support it. 1.5 get rid of PATH_MAX Having code use and rely on PATH_MAX is not nice: http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html Currently the SSH based code uses it a bit, but to remove PATH_MAX from there we need libssh2 to properly tell us when we pass in a too small buffer and its current API (as of libssh2 1.2.7) doesn't. 1.6 Modified buffer size approach Current libcurl allocates a fixed 16K size buffer for download and an additional 16K for upload. They are always unconditionally part of the easy handle. If CRLF translations are requested, an additional 32K "scratch buffer" is allocated. A total of 64K transfer buffers in the worst case. First, while the handles are not actually in use these buffers could be freed so that lingering handles just kept in queues or whatever waste less memory. Secondly, SFTP is a protocol that needs to handle many ~30K blocks at once since each need to be individually acked and therefore libssh2 must be allowed to send (or receive) many separate ones in parallel to achieve high transfer speeds. A current libcurl build with a 16K buffer makes that impossible, but one with a 512K buffer will reach MUCH faster transfers. But allocating 512K unconditionally for all buffers just in case they would like to do fast SFTP transfers at some point is not a good solution either. Dynamically allocate buffer size depending on protocol in use in combination with freeing it after each individual transfer? Other suggestions? 1.7 Detect when called from witin callbacks We should set a state variable before calling callbacks, so that we subsequently can add code within libcurl that returns error if called within callbacks for when that's not supported. 1.8 Allow SSL (HTTPS) to proxy To prevent local users from snooping on your traffic to the proxy. Supported by Chrome already: http://www.chromium.org/developers/design-documents/secure-web-proxy 2. libcurl - multi interface 2.1 More non-blocking Make sure we don't ever loop because of non-blocking sockets returning EWOULDBLOCK or similar. Blocking cases include: - Name resolves on non-windows unless c-ares is used - NSS SSL connections - HTTP proxy CONNECT operations - SOCKS proxy handshakes - file:// transfers - TELNET transfers - The "DONE" operation (post transfer protocol-specific actions) for the protocols SFTP, SMTP, FTP. Fixing Curl_done() for this is a worthy task. 2.2 Fix HTTP Pipelining for PUT HTTP Pipelining can be a way to greatly enhance performance for multiple serial requests and currently libcurl only supports that for HEAD and GET requests but it should also be possible for PUT. 3. Documentation 3.1 More and better Exactly 4. FTP 4.1 HOST HOST is a suggested command in the works for a client to tell which host name to use, to offer FTP servers named-based virtual hosting: http://tools.ietf.org/html/draft-hethmon-mcmurray-ftp-hosts-11 4.2 Alter passive/active on failure and retry When trying to connect passively to a server which only supports active connections, libcurl returns CURLE_FTP_WEIRD_PASV_REPLY and closes the connection. There could be a way to fallback to an active connection (and vice versa). http://curl.haxx.se/bug/feature.cgi?id=1754793 4.3 Earlier bad letter detection Make the detection of (bad) %0d and %0a codes in FTP url parts earlier in the process to avoid doing a resolve and connect in vain. 4.4 REST for large files REST fix for servers not behaving well on >2GB requests. This should fail if the server doesn't set the pointer to the requested index. The tricky (impossible?) part is to figure out if the server did the right thing or not. 4.5 ASCII support FTP ASCII transfers do not follow RFC959. They don't convert the data accordingly. 5. HTTP 5.1 Better persistency for HTTP 1.0 "Better" support for persistent connections over HTTP 1.0 http://curl.haxx.se/bug/feature.cgi?id=1089001 5.2 support FF3 sqlite cookie files Firefox 3 is changing from its former format to a a sqlite database instead. We should consider how (lib)curl can/should support this. http://curl.haxx.se/bug/feature.cgi?id=1871388 5.3 Rearrange request header order Server implementors often make an effort to detect browser and to reject clients it can detect to not match. One of the last details we cannot yet control in libcurl's HTTP requests, which also can be exploited to detect that libcurl is in fact used even when it tries to impersonate a browser, is the order of the request headers. I propose that we introduce a new option in which you give headers a value, and then when the HTTP request is built it sorts the headers based on that number. We could then have internally created headers use a default value so only headers that need to be moved have to be specified. 5.4 HTTP2/SPDY The first drafts for HTTP2 have been published (http://tools.ietf.org/html/draft-ietf-httpbis-http2-03) and is so far based on SPDY (http://www.chromium.org/spdy) designs and experiences. Chances are it will end up in that style. Chrome and Firefox already support SPDY and lots of web services do. It would make sense to implement SPDY support now and later transition into or add HTTP2 support as well. We should base or HTTP2/SPDY work on a 3rd party library for the protocol fiddling. The Spindy library (http://spindly.haxx.se/) was an attempt to make such a library with an API suitable for use by libcurl but that effort has more or less stalled. spdylay (https://github.com/tatsuhiro-t/spdylay) may be a better option, either used directly or wrapped with a more spindly-like API. 5.5 auth= in URLs Add the ability to specify the preferred authentication mechanism to use by using ;auth= in the login part of the URL. For example: http://test:pass;auth=NTLM@example.com would be equivalent to specifing --user test:pass;auth=NTLM or --user test:pass --ntlm from the command line. Additionally this should be implemented for proxy base URLs as well. 6. TELNET 6.1 ditch stdin Reading input (to send to the remote server) on stdin is a crappy solution for library purposes. We need to invent a good way for the application to be able to provide the data to send. 6.2 ditch telnet-specific select Move the telnet support's network select() loop go away and merge the code into the main transfer loop. Until this is done, the multi interface won't work for telnet. 6.3 feature negotiation debug data Add telnet feature negotiation data to the debug callback as header data. 6.4 send data in chunks Currently, telnet sends data one byte at a time. This is fine for interactive use, but inefficient for any other. Sent data should be sent in larger chunks. 7. SMTP 7.1 Pipelining Add support for pipelining emails. 7.2 Enhanced capability support Add the ability, for an application that uses libcurl, to obtain the list of capabilities returned from the EHLO command. 8. POP3 8.1 Pipelining Add support for pipelining commands. 8.2 Enhanced capability support Add the ability, for an application that uses libcurl, to obtain the list of capabilities returned from the CAPA command. 9. IMAP 9.1 Enhanced capability support Add the ability, for an application that uses libcurl, to obtain the list of capabilities returned from the CAPABILITY command. 10. LDAP 10.1 SASL based authentication mechanisms Currently the LDAP module only supports ldap_simple_bind_s() in order to bind to an LDAP server. However, this function sends username and password details using the simple authentication mechanism (as clear text). However, it should be possible to use ldap_bind_s() instead specifing the security context information ourselves. 11. New protocols 11.1 RSYNC There's no RFC for the protocol or an URI/URL format. An implementation should most probably use an existing rsync library, such as librsync. 12. SSL 12.1 Disable specific versions Provide an option that allows for disabling specific SSL versions, such as SSLv2 http://curl.haxx.se/bug/feature.cgi?id=1767276 12.2 Provide mutex locking API Provide a libcurl API for setting mutex callbacks in the underlying SSL library, so that the same application code can use mutex-locking independently of OpenSSL or GnutTLS being used. 12.3 Evaluate SSL patches Evaluate/apply Gertjan van Wingerde's SSL patches: http://curl.haxx.se/mail/lib-2004-03/0087.html 12.4 Cache OpenSSL contexts "Look at SSL cafile - quick traces look to me like these are done on every request as well, when they should only be necessary once per ssl context (or once per handle)". The major improvement we can rather easily do is to make sure we don't create and kill a new SSL "context" for every request, but instead make one for every connection and re-use that SSL context in the same style connections are re-used. It will make us use slightly more memory but it will libcurl do less creations and deletions of SSL contexts. 12.5 Export session ids Add an interface to libcurl that enables "session IDs" to get exported/imported. Cris Bailiff said: "OpenSSL has functions which can serialise the current SSL state to a buffer of your choice, and recover/reset the state from such a buffer at a later date - this is used by mod_ssl for apache to implement and SSL session ID cache". 12.6 Provide callback for cert verification OpenSSL supports a callback for customised verification of the peer certificate, but this doesn't seem to be exposed in the libcurl APIs. Could it be? There's so much that could be done if it were! 12.7 improve configure --with-ssl make the configure --with-ssl option first check for OpenSSL, then GnuTLS, then NSS... 12.8 Support DANE DNS-Based Authentication of Named Entities (DANE) is a way to provide SSL keys and certs over DNS using DNSSEC as an alternative to the CA model. http://www.rfc-editor.org/rfc/rfc6698.txt An initial patch was posted by Suresh Krishnaswamy on March 7th 2013 (http://curl.haxx.se/mail/lib-2013-03/0075.html) but it was a too simple approach. See Daniel's comments: http://curl.haxx.se/mail/lib-2013-03/0103.html . libunbound may be the correct library to base this development on. 13. GnuTLS 13.1 SSL engine stuff Is this even possible? 13.2 check connection Add a way to check if the connection seems to be alive, to correspond to the SSL_peak() way we use with OpenSSL. 14. SASL 14.1 Other authentication mechanisms Add support for GSSAPI to SMTP, POP3 and IMAP. 15. Client 15.1 sync "curl --sync http://example.com/feed[1-100].rss" or "curl --sync http://example.net/{index,calendar,history}.html" Downloads a range or set of URLs using the remote name, but only if the remote file is newer than the local file. A Last-Modified HTTP date header should also be used to set the mod date on the downloaded file. 15.2 glob posts Globbing support for -d and -F, as in 'curl -d "name=foo[0-9]" URL'. This is easily scripted though. 15.3 prevent file overwriting Add an option that prevents cURL from overwriting existing local files. When used, and there already is an existing file with the target file name (either -O or -o), a number should be appended (and increased if already existing). So that index.html becomes first index.html.1 and then index.html.2 etc. 15.4 simultaneous parallel transfers The client could be told to use maximum N simultaneous parallel transfers and then just make sure that happens. It should of course not make more than one connection to the same remote host. This would require the client to use the multi interface. http://curl.haxx.se/bug/feature.cgi?id=1558595 15.5 provide formpost headers Extending the capabilities of the multipart formposting. How about leaving the ';type=foo' syntax as it is and adding an extra tag (headers) which works like this: curl -F "coolfiles=@fil1.txt;headers=@fil1.hdr" where fil1.hdr contains extra headers like Content-Type: text/plain; charset=KOI8-R" Content-Transfer-Encoding: base64 X-User-Comment: Please don't use browser specific HTML code which should overwrite the program reasonable defaults (plain/text, 8bit...) 15.6 url-specific options Provide a way to make options bound to a specific URL among several on the command line. Possibly by letting ':' separate options between URLs, similar to this: curl --data foo --url url.com : \ --url url2.com : \ --url url3.com --data foo3 (More details: http://curl.haxx.se/mail/archive-2004-07/0133.html) The example would do a POST-GET-POST combination on a single command line. 15.7 warning when setting an option Display a warning when libcurl returns an error when setting an option. This can be useful to tell when support for a particular feature hasn't been compiled into the library. 15.8 IPv6 addresses with globbing Currently the command line client needs to get url globbing disabled (with -g) for it to support IPv6 numerical addresses. This is a rather silly flaw that should be corrected. It probably involves a smarter detection of the '[' and ']' letters. 16. Build 16.1 roffit Consider extending 'roffit' to produce decent ASCII output, and use that instead of (g)nroff when building src/tool_hugehelp.c 17. Test suite 17.1 SSL tunnel Make our own version of stunnel for simple port forwarding to enable HTTPS and FTP-SSL tests without the stunnel dependency, and it could allow us to provide test tools built with either OpenSSL or GnuTLS 17.2 nicer lacking perl message If perl wasn't found by the configure script, don't attempt to run the tests but explain something nice why it doesn't. 17.3 more protocols supported Extend the test suite to include more protocols. The telnet could just do ftp or http operations (for which we have test servers). 17.4 more platforms supported Make the test suite work on more platforms. OpenBSD and Mac OS. Remove fork()s and it should become even more portable. 18. Next SONAME bump 18.1 http-style HEAD output for ftp #undef CURL_FTP_HTTPSTYLE_HEAD in lib/ftp.c to remove the HTTP-style headers from being output in NOBODY requests over ftp 18.2 combine error codes Combine some of the error codes to remove duplicates. The original numbering should not be changed, and the old identifiers would be macroed to the new ones in an CURL_NO_OLDIES section to help with backward compatibility. Candidates for removal and their replacements: CURLE_FILE_COULDNT_READ_FILE => CURLE_REMOTE_FILE_NOT_FOUND CURLE_FTP_COULDNT_RETR_FILE => CURLE_REMOTE_FILE_NOT_FOUND CURLE_FTP_COULDNT_USE_REST => CURLE_RANGE_ERROR CURLE_FUNCTION_NOT_FOUND => CURLE_FAILED_INIT CURLE_LDAP_INVALID_URL => CURLE_URL_MALFORMAT CURLE_TFTP_NOSUCHUSER => CURLE_TFTP_ILLEGAL CURLE_TFTP_NOTFOUND => CURLE_REMOTE_FILE_NOT_FOUND CURLE_TFTP_PERM => CURLE_REMOTE_ACCESS_DENIED 18.3 extend CURLOPT_SOCKOPTFUNCTION prototype The current prototype only provides 'purpose' that tells what the connection/socket is for, but not any protocol or similar. It makes it hard for applications to differentiate on TCP vs UDP and even HTTP vs FTP and similar. 10. Next major release 19.1 cleanup return codes curl_easy_cleanup() returns void, but curl_multi_cleanup() returns a CURLMcode. These should be changed to be the same. 19.2 remove obsolete defines remove obsolete defines from curl/curl.h 19.3 size_t make several functions use size_t instead of int in their APIs 19.4 remove several functions remove the following functions from the public API: curl_getenv curl_mprintf (and variations) curl_strequal curl_strnequal They will instead become curlx_ - alternatives. That makes the curl app still capable of using them, by building with them from source. These functions have no purpose anymore: curl_multi_socket curl_multi_socket_all 19.5 remove CURLOPT_FAILONERROR Remove support for CURLOPT_FAILONERROR, it has gotten too kludgy and weird internally. Let the app judge success or not for itself. 19.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE Remove support for a global DNS cache. Anything global is silly, and we already offer the share interface for the same functionality but done "right". 19.7 remove progress meter from libcurl The internally provided progress meter output doesn't belong in the library. Basically no application wants it (apart from curl) but instead applications can and should do their own progress meters using the progress callback. The progress callback should then be bumped as well to get proper 64bit variable types passed to it instead of doubles so that big files work correctly. 19.8 remove 'curl_httppost' from public curl_formadd() was made to fill in a public struct, but the fact that the struct is public is never really used by application for their own advantage but instead often restricts how the form functions can or can't be modified. Changing them to return a private handle will benefit the implementation and allow us much greater freedoms while still maintining a solid API and ABI. 19.9 have form functions use CURL handle argument curl_formadd() and curl_formget() both currently have no CURL handle argument, but both can use a callback that is set in the easy handle, and thus curl_formget() with callback cannot function without first having curl_easy_perform() (or similar) called - which is hard to grasp and a design mistake. 19.10 Add CURLOPT_MAIL_CLIENT option Rather than use the URL to specify the mail client string to present in the HELO and EHLO commands, libcurl should support a new CURLOPT specifically for specifing this data as the URL is non-standard and to be honest a bit of a hack ;-) Please see the following thread for more information: http://curl.haxx.se/mail/lib-2012-05/0178.html curl-7.35.0/docs/curl-config.pdf0000644000175000017500000001360012272124470013330 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœ¥XÛnÉ}çW4 d½Ýsäa¡•ä]%\I1 $ä‡á°EÎîp†;ÑÌ78Ÿ’LUuÏ”o6¬î®>UuêTõüÆ—Làù7ÙO¾{°m5l;ùm"i‘™’=ûaBüÅêe¢ÏHØ,ˆFlµŸH'äÂc«ãäÉJš2›'EþiûlÉç)ëÿ?ÛnģȱöqÞÄ;Û:ý°úód.¸-ÁhwFp'<¼ÖñÙj1±î¯¦˜°*=îE@Ym&ÖÏ·ÓÕ/¶à®Ø\Ú¸,Øû7ûQÕ,Í_Šr×i‘³x]45‹Y–®q¬Uuœe´¨M°ÌÌ\ú<¤»—ÿ¸x\Þ-ûm¯¹}xñSq@‹Õ‡ÿbóævyýþîqu÷pÿfǾ»!÷¥°Md6iuÈâSõ†·õNQXœoÞtœ_¢ ]m¼‡ú@(—c =Ì'k>Obȼp}릃W¯§%!ÇjÒ¬ž§9;ÄõŽÕ­^_±D•5í²š|“)øuZu8›JUœ£‘,&«?Ò]É[w%ÅþfªÄc¼b=•ÈD;ÀË;ïµA´ò¯x[ÓÀ £àí‹–@œâ¥7hÊž­ëw‹+Œ‚´îFƒƒüq µ7vܩܘHó-û”)„×´Øba×MYª¼ÎNz-­Ðú¼5?âv‘Ó.éK²f£F¡4yÕ xåuD8ŠÜN%¿GØÓ늋2£Ê ¼û@aés*¸çšhT’¾è«‹l£ªšŠªJ×Yç{¥ ¸÷í6&žk´BÛgU]bNEÃŽS)¬8¯gÄJJy•”é¡fÇ4ËX©ê¦ÌÁNúÒúFàl7@ÒœŸkÿ"›û½ou"0¦#šCdY®ðŒÃ%nJ&¡Çe†ÆÞ‘µê¸<ZÕÉ‹f»c±´6À*FÄ åuhê ¥¦³Ò“<òÝÖ1¡ÿkVÅ'ôRl<"„: ˜l‚ù'}´Ñ–sF€¼¨6÷¨ír×¢7=~'äö^m6PP„‡{]cŒaåî9(÷¹–œ¦ÔÔù¨àâr*…ÛìÁŸŠmÓVß%!”Âá](_‡Ø#n‡pT/=Yy=mûF‘ rͱQDí.ƒJ×–Ö –7Æ·/ï¹ $‡júô¢âúÂ%è!ŽNÓ"­À#¦è—uš4Y\²} á2'+S}Ä*ÕË)ÒY‰+#:¡ç’â¡ký•N{î ˱LkÀ;#êk}³QÝEH©Î Ü}êJz¹\ÌØ_Þÿà"ï_}În †Œˆ« ‚ŒD)ãtDŒ›¢$MÜO‡žz‡¡hˆ›á¶ÞݢܨRW‰±äWsÂâ«ÞT-ÅÀ¹_‰L]âî7Ͳ:µ‹©·ŽEoÓ†Úìø\n*­k¥k݃e?ÕÄ“U)ÈV\C:Ö'¬Û³Ž ¸ €lµSÀŒâZA¨r5cú¯’UjÌS3橸„ZÂ8sáfäý¿NØs­Úv„e5VîÊSp]ÚgEØ Tº¬l„®ò_ã'r€'Íb”oÓØô­RHî{ã[âÜꆑµÜt(“Óà¬áбo™ªD˜z(Ðj «%ü7§JÄ7ô{#šöƒ^K}³Ÿ+­YDMlwh—KYšÄºÈP\öL’~¬Á¾ûŸ·EðòPªO."ÉEäj~­°;¥Ú9Ú§Ç R ^°äƒ Bèô³E;oÑñ| àÏ·dí;°AñI몕½#ÖSŒÞÒЗêÍ“­4àéªjã Hl©JËû¦Usf\ý†ƒV\¡¨‹¤Èªs¡ý%…ìÎ}VI¯WÇHØZ!›Us8eý5i^—âøÓjõHêçép@ÔE«~³Ÿ†êgwý̹ÙƒÓË{6Hø<—^&0Ìx¢-ÓÙ»¡ðùÝïõÉ»Å팭n÷·«‘‰¦8¿0f #n«^kåæJ3„ÁtoáDæA&˜3vÓ£@ߣÖÇ»ëñÅÐÝ¿o›üfêx.Ã:è ¹BòexQK£žþ­'3vÉž¶Ôi9¼ÑFl@I9ñ%÷BÏ~³8¶×"%þ¶|2âO„j*ìñ@U&q¥yµqÙ`®ÂqÐ*ØÐ´èe3ЈÏ5ˆ¡ÎG0iy_ÓzôCU?›½.Ìì%ˆã1ꨕwT‰¤À4gž p¨Ëów(p[‘ÿ«ÞêËàø²à2íhÂi0ýÁ9î¶ìåÏVÑÚ°-Û†Aƒ?mÐ\4lT0I»8ŠJ3IŸ½fž¬3­Ÿ¿{>óf¾Ð13Wž?¨†÷æÍþâå›érxýï¼y†ÛªÄ0²}±Q|:÷|`‘ ujŸ"xþUcÀ×M[UP‹ô ‡¢0¹ÓËÊÐÖMœ`ÁUën´õ4릹'k–N^`/ßRðni B}|»RðB_Ožx[îcð‘8²5ôA†T';j3©ÿ¥èðøZýw:5™í‡ ï‹NWÓüüœzÔMG³Á\LÚ…¸N`h_úÁÖ—»Ãæ4ÉC™ì/Ny@3M4Ù«HFB7ü¸£O3x^¨î mg‡±ŠsÎî‹ZõoÊ4‡† üø§* S Ãx`Þ§Û]‚WìÓºÆ1åÙè ‹wJMüúuY Ô"oEÞÞÙ%ææ«Þø+R0ü€tû÷«Ÿ·_ø‚ô7j')ÚúìÄiS°;-L4wÝiMÊÌ÷ú VÈ~É{¿MF–®«Zýçºy'µ—¶´§ ÓÅW  0f‡iPm&_š<¡ßw#§çqM”kÍ'Ô4EåaA3|HjfC h úo÷̢ݷ«É_áç?”£yendstream endobj 6 0 obj 2210 endobj 13 0 obj <> stream xœSKo›@¾ó+æP©Ëa7; öµ•¥¶Š5FêÁ©d¼Æ˜–‡cpÝCBòŸ»ƒqÕ\*„óøf¾ofž€3nžóWÕÞÍC Eçq(¼'­ÎUÃûT$Æn=—ƒ ˆeÀ iía0Azò–DUmó\<|ôáòïSJ&e@ê¬9füêK?{‚iå…4˜AºñÈå§ßuoÚŠÈd Ý€vpSŒ@©zÉŠÎSœ¹@]Ñb|lùŒmPfR:”%9m|qÆyLÚO?l¶XN6ˆ4Ó|ÉâhL.M2ÙV—< ‘‹!¢\špò‘“¬ƒµF“cYõp*û,wÐ÷ûöÐßNE 1gIÂq¤ñšW*ló¬?rø Å!ßðJòu—õo'¬DÈ `ו$C­ÖÈg—CÙt}VUùª3»Ÿ>FŒc8#ù¡+Ûæš†HØŒOJ¿FcyÅÃ`žá,Úÿu=ª`É0T=€ dЕMQåð¬_; Ú&§UÙä ÚZ¯êævR‡’%¨ dV2z\Ç¡uµ›jXÐÐrC&“($¿²z¯K;ƒÙ g` VWZêne‰Üc™§Þýü´ð#endstream endobj 14 0 obj 559 endobj 4 0 obj <> /Contents 5 0 R >> endobj 12 0 obj <> /Contents 13 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 12 0 R ] /Count 2 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 10 0 obj <> endobj 11 0 obj <> endobj 15 0 obj <> endobj 16 0 obj <> endobj 9 0 obj <> endobj 17 0 obj <> endobj 8 0 obj <> endobj 18 0 obj <> endobj 19 0 obj <>stream 2014-01-29T08:09:44+01:00 2014-01-29T08:09:44+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 20 0000000000 65535 f 0000003354 00000 n 0000005309 00000 n 0000003288 00000 n 0000002966 00000 n 0000000015 00000 n 0000002295 00000 n 0000003419 00000 n 0000003735 00000 n 0000003598 00000 n 0000003460 00000 n 0000003490 00000 n 0000003126 00000 n 0000002315 00000 n 0000002946 00000 n 0000003529 00000 n 0000003559 00000 n 0000003679 00000 n 0000003817 00000 n 0000003886 00000 n trailer << /Size 20 /Root 1 0 R /Info 2 0 R /ID [<9558E2E6CA5260F69D4B8BB8CB0CBF0F><9558E2E6CA5260F69D4B8BB8CB0CBF0F>] >> startxref 5463 %%EOF curl-7.35.0/winbuild/0000755000175000017500000000000012272124475011377 500000000000000curl-7.35.0/winbuild/MakefileBuild.vc0000644000175000017500000003321112270035364014342 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1999 - 2014, 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. # #*************************************************************************** ########################################################################### # # Makefile for building libcurl with MSVC 6, 7, 8, 9, 10, 11 and 12 # # Usage: see usage message below # Should be invoked from winbuild 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. # ############################################################## CFGSET=FALSE WINBUILD_DIR=`cd` ZIP = zip.exe !IF "$(VC)"=="6" CC_NODEBUG = cl.exe /O2 /DNDEBUG CC_DEBUG = cl.exe /Od /Gm /Zi /D_DEBUG /GZ CFLAGS = /I. /I../lib /I../include /nologo /W3 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL !ELSE CC_NODEBUG = cl.exe /O2 /DNDEBUG CC_DEBUG = cl.exe /Od /D_DEBUG /RTC1 /Z7 /LDd /W3 CFLAGS = /I. /I ../lib /I../include /nologo /W3 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL !ENDIF LFLAGS = /nologo /machine:$(MACHINE) LNKDLL = link.exe /DLL LNKLIB = link.exe /lib CFLAGS_PDB = /Zi LFLAGS_PDB = /incremental:no /opt:ref,icf CFLAGS_LIBCURL_STATIC = /DCURL_STATICLIB WIN_LIBS = ws2_32.lib wldap32.lib advapi32.lib BASE_NAME = libcurl BASE_NAME_DEBUG = $(BASE_NAME)_debug BASE_NAME_STATIC = $(BASE_NAME)_a BASE_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC)_debug LIB_NAME_STATIC = $(BASE_NAME_STATIC).lib LIB_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC_DEBUG).lib LIB_NAME_DLL = $(BASE_NAME).dll LIB_NAME_IMP = $(BASE_NAME).lib LIB_NAME_DLL_DEBUG = $(BASE_NAME_DEBUG).dll LIB_NAME_IMP_DEBUG = $(BASE_NAME_DEBUG).lib PDB_NAME_STATIC = $(BASE_NAME_STATIC).pdb PDB_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC_DEBUG).pdb PDB_NAME_DLL = $(BASE_NAME).pdb PDB_NAME_DLL_DEBUG = $(BASE_NAME_DEBUG).pdb # CURL Command section PROGRAM_NAME = curl.exe CURL_CFLAGS = /I../lib /I../include /nologo /W3 /EHsc /DWIN32 /FD /c CURL_LFLAGS = /nologo /out:$(DIRDIST)\bin\$(PROGRAM_NAME) /subsystem:console /machine:$(MACHINE) CURL_RESFLAGS = /i../include ############################################################# ## Nothing more to do below this line! LIBCURL_SRC_DIR = ..\lib CURL_SRC_DIR = ..\src !IFNDEF WITH_DEVEL WITH_DEVEL = ../../deps !ENDIF DEVEL_INCLUDE = $(WITH_DEVEL)/include DEVEL_LIB = $(WITH_DEVEL)/lib DEVEL_BIN = $(WITH_DEVEL)/bin CFLAGS = $(CFLAGS) /I"$(DEVEL_INCLUDE)" LFLAGS = $(LFLAGS) "/LIBPATH:$(DEVEL_LIB)" !IF "$(WITH_SSL)"=="dll" SSL_LIBS = libeay32.lib ssleay32.lib USE_SSL = true SSL = dll !ELSEIF "$(WITH_SSL)"=="static" SSL_LIBS = libeay32.lib ssleay32.lib gdi32.lib user32.lib USE_SSL = true SSL = static !ENDIF !IFDEF USE_SSL SSL_CFLAGS = /DUSE_SSLEAY /I"$(DEVEL_INCLUDE)/openssl" !ENDIF !IF "$(WITH_ZLIB)"=="dll" ZLIB_LIBS = zlib.lib USE_ZLIB = true ZLIB = dll !ELSEIF "$(WITH_ZLIB)"=="static" ZLIB_LIBS = zlib_a.lib USE_ZLIB = true ZLIB = static !ENDIF !IFDEF USE_ZLIB ZLIB_CFLAGS = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ !ENDIF !IF "$(WITH_SSH2)"=="dll" SSH2_LIBS = libssh2.lib USE_SSH2 = true SSH2 = dll !ELSEIF "$(WITH_SSH2)"=="static" SSH2_LIBS = libssh2_a.lib user32.lib USE_SSH2 = true SSH2 = static !ENDIF !IFDEF USE_SSH2 SSH2_CFLAGS = /DHAVE_LIBSSH2 /DHAVE_LIBSSH2_H /DLIBSSH2_WIN32 /DLIBSSH2_LIBRARY /DUSE_LIBSSH2 SSH2_CFLAGS = $(SSH2_CFLAGS) /I$(WITH_DEVEL)/include/libssh2 !ENDIF !IFNDEF USE_IDN USE_IDN = true !ELSEIF "$(USE_IDN)"=="yes" USE_IDN = true !ENDIF !IF "$(USE_IDN)"=="true" IDN_CFLAGS = $(IDN_CFLAGS) /DUSE_WIN32_IDN /DWANT_IDN_PROTOTYPES WIN_LIBS = $(WIN_LIBS) Normaliz.lib !ENDIF !IFNDEF USE_IPV6 USE_IPV6 = true !ELSEIF "$(USE_IPV6)"=="yes" USE_IPV6 = true !ENDIF !IF "$(USE_IPV6)"=="true" IPV6_CFLAGS = $(IPV6_CFLAGS) /DUSE_IPV6 !ENDIF !IFNDEF USE_SSPI USE_SSPI = true !ELSEIF "$(USE_SSPI)"=="yes" USE_SSPI = true !ENDIF !IF "$(USE_SSPI)"=="true" SSPI_CFLAGS = $(SSPI_CFLAGS) /DUSE_WINDOWS_SSPI !ENDIF !IFNDEF USE_SPNEGO USE_SPNEGO = true !ELSEIF "$(USE_SPNEGO)"=="yes" USE_SPNEGO = true !ENDIF !IF "$(USE_SPNEGO)"=="true" SPNEGO_CFLAGS = $(SPNEGO_CFLAGS) /DHAVE_SPNEGO !ENDIF !IFNDEF USE_WINSSL !IF "$(USE_SSL)"=="true" USE_WINSSL = false !ELSE USE_WINSSL = $(USE_SSPI) !ENDIF !ELSEIF "$(USE_WINSSL)"=="yes" USE_WINSSL = true !ENDIF !IF "$(USE_WINSSL)"=="true" !IF "$(USE_SSPI)"!="true" !ERROR cannot build with WinSSL without SSPI !ENDIF SSPI_CFLAGS = $(SSPI_CFLAGS) /DUSE_SCHANNEL !ENDIF !IF "$(GEN_PDB)"=="yes" GEN_PDB = true !ENDIF !IFDEF EMBEND_MANIFEST MANIFESTTOOL = mt -manifest $(DIRDIST)\$(PROGRAM_NAME).manifest -outputresource:$(DIRDIST)\$(PROGRAM_NAME);1 !ENDIF # Runtime library configuration !IF "$(RTLIBCFG)"=="static" RTLIB = /MT RTLIB_DEBUG = /MTd !ELSE RTLIB = /MD RTLIB_DEBUG = /MDd !ENDIF !IF "$(MODE)"=="static" TARGET = $(LIB_NAME_STATIC) CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC) AS_DLL = false CFGSET = true !ELSEIF "$(MODE)"=="dll" TARGET = $(LIB_NAME_DLL) CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP) AS_DLL = true CFGSET = true !ENDIF !IF "$(CFGSET)" == "FALSE" !ERROR please choose a valid mode !ENDIF # CURL_XX macros are for the curl.exe command !IF "$(DEBUG)"=="yes" RC_FLAGS = /dDEBUGBUILD=1 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc CC = $(CC_DEBUG) $(RTLIB_DEBUG) CURL_CC = $(CC) CURL_RC_FLAGS = /i../include /dDEBUGBUILD=1 /Fo $@ $(CURL_SRC_DIR)\curl.rc !ELSE RC_FLAGS = /dDEBUGBUILD=0 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc CC = $(CC_NODEBUG) $(RTLIB) CURL_CC = $(CC) CURL_RC_FLAGS = /i../include /dDEBUGBUILD=0 /Fo $@ $(CURL_SRC_DIR)\curl.rc !ENDIF CURL_CC = $(CURL_CC) $(CURL_CFLAGS) !IF "$(AS_DLL)" == "true" LNK = $(LNKDLL) $(WIN_LIBS) /out:$(LIB_DIROBJ)\$(TARGET) !IF "$(DEBUG)"=="yes" TARGET = $(LIB_NAME_DLL_DEBUG) LNK = $(LNK) /DEBUG /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) PDB = $(PDB_NAME_DLL_DEBUG) CURL_LIBS = /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) !ELSE TARGET = $(LIB_NAME_DLL) LNK = $(LNK) /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP) PDB = $(PDB_NAME_DLL) CURL_LIBS = /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP) !ENDIF RESOURCE = $(LIB_DIROBJ)\libcurl.res # AS_DLL !ELSE !IF "$(DEBUG)"=="yes" TARGET = $(LIB_NAME_STATIC_DEBUG) PDB = $(PDB_NAME_STATIC_DEBUG) !ELSE TARGET = $(LIB_NAME_STATIC) PDB = $(PDB_NAME_STATIC) !ENDIF LNK = $(LNKLIB) $(WIN_LIBS) /out:$(LIB_DIROBJ)\$(TARGET) CC = $(CC) $(CFLAGS_LIBCURL_STATIC) # AS_DLL !ENDIF !IF "$(USE_SSL)"=="true" CFLAGS = $(CFLAGS) $(SSL_CFLAGS) LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(SSL_LIBS) !ENDIF !IF "$(USE_ZLIB)"=="true" CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS) LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS) $(ZLIB_LIBS) !ENDIF !IF "$(USE_SSH2)"=="true" CFLAGS = $(CFLAGS) $(SSH2_CFLAGS) LFLAGS = $(LFLAGS) $(SSH2_LFLAGS) $(SSH2_LIBS) !ENDIF !IF "$(USE_IDN)"=="true" CFLAGS = $(CFLAGS) $(IDN_CFLAGS) !ENDIF !IF "$(USE_IPV6)"=="true" CFLAGS = $(CFLAGS) $(IPV6_CFLAGS) !ENDIF !IF "$(USE_SSPI)"=="true" CFLAGS = $(CFLAGS) $(SSPI_CFLAGS) !ENDIF !IF "$(USE_SPNEGO)"=="true" CFLAGS = $(CFLAGS) $(SPNEGO_CFLAGS) !ENDIF !IF "$(GEN_PDB)"=="true" CFLAGS = $(CFLAGS) $(CFLAGS_PDB) /Fd"$(LIB_DIROBJ)\$(PDB)" LFLAGS = $(LFLAGS) $(LFLAGS_PDB) !ENDIF LIB_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\ # # curl.exe # CURL_LINK = link.exe /incremental:no /libpath:"$(DIRDIST)\lib" #!IF "$(CFG)" == "release-ssh2-ssl-dll-zlib" #TARGET = $(LIB_NAME_STATIC) #LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBS) $(SSH2LIBS) $(SSL_LFLAGS) $(ZLIB_LFLAGS) $(LFLAGSSSH) /out:$(LIB_DIROBJ)\$(TARGET) #CC = $(CCNODBG) $(RTLIB) $(SSL_CFLAGS) $(ZLIB_CFLAGS) $(CFLAGSLIB) $(SSH2_CFLAGS) #CFGSET = TRUE #!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 mode was provided, so the library can be built. # !include CURL_OBJS.inc !include LIBCURL_OBJS.inc !IF "$(AS_DLL)" == "true" LIB_OBJS = $(LIBCURL_OBJS) $(RESOURCE) !ELSE LIB_OBJS = $(LIBCURL_OBJS) !ENDIF EXE_OBJS = $(CURL_OBJS) $(CURL_DIROBJ)\curl.res all : $(TARGET) $(PROGRAM_NAME) package: $(TARGET) @cd $(DIRDIST) @-$(ZIP) -9 -q -r ..\$(CONFIG_NAME_LIB).zip .>nul 2<&1 @cd $(MAKEDIR) $(TARGET): $(LIB_OBJS) $(LIB_DIROBJ) $(DISTDIR) @echo Using SSL: $(USE_SSL) @echo Using SSH2: $(USE_SSH2) @echo Using ZLIB: $(USE_ZLIB) @echo Using IDN: $(USE_IDN) @echo Using IPv6: $(USE_IPV6) @echo Using SSPI: $(USE_SSPI) @echo Using SPNEGO: $(USE_SPNEGO) @echo Using WinSSL: $(USE_WINSSL) @echo CFLAGS: $(CFLAGS) @echo LFLAGS: $(LFLAGS) @echo GenPDB: $(GEN_PDB) @echo Debug: $(DEBUG) @echo Machine: $(MACHINE) $(LNK) $(LFLAGS) $(LIB_OBJS) @echo Copying libs... @if exist $(LIB_DIROBJ)\$(LIB_NAME_DLL) copy $(LIB_DIROBJ)\$(LIB_NAME_DLL) $(DIRDIST)\bin\ /y >nul 2<&1 @if exist $(LIB_DIROBJ)\$(LIB_NAME_STATIC) copy $(LIB_DIROBJ)\$(LIB_NAME_STATIC) $(DIRDIST)\lib\ /y >nul 2<&1 @if exist $(LIB_DIROBJ)\$(LIB_NAME_DLL_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_DLL_DEBUG) $(DIRDIST)\bin\ /y >nul 2<&1 @if exist $(LIB_DIROBJ)\$(LIB_NAME_STATIC_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_STATIC_DEBUG) $(DIRDIST)\lib\ /y >nul 2<&1 @if exist $(LIB_DIROBJ)\$(LIB_NAME_IMP) copy $(LIB_DIROBJ)\$(LIB_NAME_IMP) $(DIRDIST)\lib\ /y >nul 2<&1 @if exist $(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) $(DIRDIST)\lib >nul 2<&1 @-copy $(LIB_DIROBJ)\*.exp $(DIRDIST)\lib /y >nul 2<&1 @-copy $(LIB_DIROBJ)\*.pdb $(DIRDIST)\lib /y >nul 2<&1 @-copy ..\include\curl\*.h $(DIRDIST)\include\curl\ /y >nul 2<&1 $(LIB_OBJS): $(LIB_DIROBJ) $(DIRDIST) $(DIRDIST): @if not exist "$(DIRDIST)\bin" mkdir $(DIRDIST)\bin @if not exist "$(DIRDIST)\include" mkdir $(DIRDIST)\include @if not exist "$(DIRDIST)\include\curl" mkdir $(DIRDIST)\include\curl @if not exist "$(DIRDIST)\lib" mkdir $(DIRDIST)\lib $(LIB_DIROBJ): @if not exist "$(LIB_DIROBJ)" mkdir $(LIB_DIROBJ) @if not exist "$(LIB_DIROBJ)\vtls" mkdir $(LIB_DIROBJ)\vtls $(CURL_DIROBJ): @if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ) # we need a lib dir for the portability functions from libcurl # we use the .c directly here @if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ)\lib .SUFFIXES: .c .obj .res {$(LIBCURL_SRC_DIR)\}.c{$(LIB_DIROBJ)\}.obj: $(CC) $(CFLAGS) /Fo"$@" $< {$(LIBCURL_SRC_DIR)\vtls\}.c{$(LIB_DIROBJ)\vtls\}.obj: $(CC) $(CFLAGS) /Fo"$@" $< $(LIB_DIROBJ)\libcurl.res: $(LIBCURL_SRC_DIR)\libcurl.rc rc $(RC_FLAGS) # # curl.exe # !IF "$(MODE)"=="static" !IF "$(DEBUG)"=="yes" CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC_DEBUG) !ELSE CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC) !ENDIF !ELSEIF "$(MODE)"=="dll" !IF "$(DEBUG)"=="yes" CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP_DEBUG) !ELSE CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP) !ENDIF !ENDIF CURL_FROM_LIBCURL=$(CURL_DIROBJ)\tool_hugehelp.obj \ $(CURL_DIROBJ)\nonblock.obj \ $(CURL_DIROBJ)\rawstr.obj \ $(CURL_DIROBJ)\strtoofft.obj $(PROGRAM_NAME): $(CURL_DIROBJ) $(CURL_FROM_LIBCURL) $(EXE_OBJS) $(CURL_LINK) $(CURL_LFLAGS) $(CURL_LIBCURL_LIBNAME) $(WIN_LIBS) $(CURL_FROM_LIBCURL) $(EXE_OBJS) $(MANIFESTTOOL) {$(CURL_SRC_DIR)\}.c{$(CURL_DIROBJ)\}.obj: $(CC) $(CURL_CFLAGS) /Fo"$@" $< $(CURL_DIROBJ)\tool_hugehelp.obj: $(CURL_SRC_DIR)\tool_hugehelp.c $(CURL_CC) $(CURL_CFLAGS) /Zm200 /Fo"$@" $(CURL_SRC_DIR)\tool_hugehelp.c $(CURL_DIROBJ)\nonblock.obj: ../lib/nonblock.c $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/nonblock.c $(CURL_DIROBJ)\rawstr.obj: ../lib/rawstr.c $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/rawstr.c $(CURL_DIROBJ)\strtoofft.obj: ../lib/strtoofft.c $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/strtoofft.c $(CURL_DIROBJ)\curl.res: $(CURL_SRC_DIR)\curl.rc rc $(CURL_RC_FLAGS) !ENDIF # End of case where a config was provided. curl-7.35.0/winbuild/Makefile.msvc.names0000644000175000017500000000542112213173003015014 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1999 - 2010, 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. # #*************************************************************************** # # This file is included from MSVC makefiles located in lib and src, # providing libcurl common file names required by these makefiles. # # ------------------ # libcurl base name # ------------------ !IF !DEFINED(LIB_NAME) || "$(LIB_NAME)" == "" LIB_NAME = libcurl !ENDIF # ------------------------------------------------- # libcurl static and dynamic libraries common base # file names for release and debug configurations # ------------------------------------------------- !IF !DEFINED(LIB_NAME_STA_REL) || "$(LIB_NAME_STA_REL)" == "" LIB_NAME_STA_REL = $(LIB_NAME) !ENDIF !IF !DEFINED(LIB_NAME_STA_DBG) || "$(LIB_NAME_STA_DBG)" == "" LIB_NAME_STA_DBG = $(LIB_NAME_STA_REL)d !ENDIF !IF !DEFINED(LIB_NAME_DYN_REL) || "$(LIB_NAME_DYN_REL)" == "" LIB_NAME_DYN_REL = $(LIB_NAME) !ENDIF !IF !DEFINED(LIB_NAME_DYN_DBG) || "$(LIB_NAME_DYN_DBG)" == "" LIB_NAME_DYN_DBG = $(LIB_NAME_DYN_REL)d !ENDIF # -------------------------------------------- # Base names for libcurl DLL import libraries # -------------------------------------------- !IF !DEFINED(LIB_NAME_IMP_REL) || "$(LIB_NAME_IMP_REL)" == "" LIB_NAME_IMP_REL = $(LIB_NAME_DYN_REL)_imp !ENDIF !IF !DEFINED(LIB_NAME_IMP_DBG) || "$(LIB_NAME_IMP_DBG)" == "" LIB_NAME_IMP_DBG = $(LIB_NAME_DYN_DBG)_imp !ENDIF # -------------------------------------- # File names with extension and no path # -------------------------------------- LIBCURL_STA_LIB_REL = $(LIB_NAME_STA_REL).lib LIBCURL_STA_LIB_DBG = $(LIB_NAME_STA_DBG).lib LIBCURL_DYN_LIB_REL = $(LIB_NAME_DYN_REL).dll LIBCURL_DYN_LIB_DBG = $(LIB_NAME_DYN_DBG).dll LIBCURL_IMP_LIB_REL = $(LIB_NAME_IMP_REL).lib LIBCURL_IMP_LIB_DBG = $(LIB_NAME_IMP_DBG).lib LIBCURL_DYN_LIB_PDB = $(LIB_NAME_IMP_DBG).pdb # End of Makefile.msvc.names curl-7.35.0/winbuild/Makefile.vc0000644000175000017500000001251112270035364013362 00000000000000!IF "$(MODE)"=="static" TARGET = $(LIB_NAME_STATIC) AS_DLL = false CFGSET=true !ELSEIF "$(MODE)"=="dll" TARGET = $(LIB_NAME_DLL) AS_DLL = true CFGSET=true !ELSE !MESSAGE Invalid mode: $(MODE) ####################### # Usage # !MESSAGE Usage: nmake /f Makefile.vc mode= !MESSAGE where is one or many of: !MESSAGE VC=<6,7,8,9,10,11,12> - VC versions !MESSAGE WITH_DEVEL= - Paths for the development files (SSL, zlib, etc.) !MESSAGE Defaults to sibbling directory deps: ../deps !MESSAGE Libraries can be fetched at http://pecl2.php.net/downloads/php-windows-builds/ !MESSAGE Uncompress them into the deps folder. !MESSAGE WITH_SSL= - Enable OpenSSL support, DLL or static !MESSAGE WITH_ZLIB= - Enable zlib support, DLL or static !MESSAGE WITH_SSH2= - Enable libSSH2 support, DLL or static !MESSAGE ENABLE_IDN= - Enable use of Windows IDN APIs, defaults to yes !MESSAGE Requires Windows Vista or later, or installation from: !MESSAGE http://www.microsoft.com/downloads/details.aspx?FamilyID=AD6158D7-DDBA-416A-9109-07607425A815 !MESSAGE ENABLE_IPV6= - Enable IPv6, defaults to yes !MESSAGE ENABLE_SSPI= - Enable SSPI support, defaults to yes !MESSAGE ENABLE_SPNEGO= - Enable Simple and Protected GSSAPI Negotiation Mechanism, defaults to yes !MESSAGE ENABLE_WINSSL= - Enable native Windows SSL support, defaults to yes !MESSAGE GEN_PDB= - Generate Program Database (debug symbols for release build) !MESSAGE DEBUG= - Debug builds !MESSAGE MACHINE= - Target architecture (default x64 on AMD64, x86 on others) !ERROR please choose a valid mode !ENDIF !INCLUDE "../lib/Makefile.inc" LIBCURL_OBJS=$(CSOURCES:.c=.obj) !INCLUDE "../src/Makefile.inc" # tool_hugehelp has a special rule CURL_OBJS=$(CURL_CFILES:tool_hugehelp.c=) CURL_OBJS=$(CURL_OBJS:.c=.obj) # backwards compatible check for USE_SSPI !IFDEF USE_SSPI ENABLE_SSPI = $(USE_SSPI) !ENDIF # default options !IFNDEF MACHINE !IF "$(PROCESSOR_ARCHITECTURE)"=="AMD64" MACHINE = x64 !ELSE MACHINE = x86 !ENDIF !ENDIF !IFNDEF ENABLE_IDN USE_IDN = true !ELSEIF "$(ENABLE_IDN)"=="yes" USE_IDN = true !ELSEIF "$(ENABLE_IDN)"=="no" USE_IDN = false !ENDIF !IFNDEF ENABLE_IPV6 USE_IPV6 = true !ELSEIF "$(ENABLE_IPV6)"=="yes" USE_IPV6 = true !ELSEIF "$(ENABLE_IPV6)"=="no" USE_IPV6 = false !ENDIF !IFNDEF ENABLE_SSPI USE_SSPI = true !ELSEIF "$(ENABLE_SSPI)"=="yes" USE_SSPI = true !ELSEIF "$(ENABLE_SSPI)"=="no" USE_SSPI = false !ENDIF !IFNDEF ENABLE_SPNEGO USE_SPNEGO = true !ELSEIF "$(ENABLE_SPNEGO)"=="yes" USE_SPNEGO = true !ELSEIF "$(ENABLE_SPNEGO)"=="no" USE_SPNEGO = false !ENDIF !IFNDEF ENABLE_WINSSL USE_WINSSL = $(USE_SSPI) !ELSEIF "$(ENABLE_WINSSL)"=="yes" USE_WINSSL = true !ELSEIF "$(ENABLE_WINSSL)"=="no" USE_WINSSL = false !ENDIF CONFIG_NAME_LIB = libcurl !IF "$(WITH_SSL)"=="dll" USE_SSL = true SSL = dll !ELSEIF "$(WITH_SSL)"=="static" USE_SSL = true SSL = static !ENDIF !IF "$(WITH_ZLIB)"=="dll" USE_ZLIB = true ZLIB = dll !ELSEIF "$(WITH_ZLIB)"=="static" USE_ZLIB = true ZLIB = static !ENDIF !IF "$(WITH_SSH2)"=="dll" USE_SSH2 = true SSH2 = dll !ELSEIF "$(WITH_SSH2)"=="static" USE_SSH2 = true SSH2 = static !ENDIF CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-vc$(VC)-$(MACHINE) !IF "$(DEBUG)"=="yes" CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-debug !ELSE CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-release !ENDIF !IF "$(AS_DLL)"=="true" CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-dll !ELSE CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-static !ENDIF !IF "$(USE_SSL)"=="true" CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssl-$(SSL) !ENDIF !IF "$(USE_ZLIB)"=="true" CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-zlib-$(ZLIB) !ENDIF !IF "$(USE_SSH2)"=="true" CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssh2-$(SSH2) !ENDIF !IF "$(USE_IPV6)"=="true" CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ipv6 !ENDIF !IF "$(USE_SSPI)"=="true" CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-sspi !ENDIF !IF "$(USE_SPNEGO)"=="true" CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-spnego !ENDIF !IF "$(USE_WINSSL)"=="true" CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-winssl !ENDIF !MESSAGE configuration name: $(CONFIG_NAME_LIB) BUILD_DIR=../builds/$(CONFIG_NAME_LIB) LIBCURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\ $(MODE): @SET DIROBJ=$(LIBCURL_DIROBJ) @SET MACRO_NAME=LIBCURL_OBJS @SET OUTFILE=LIBCURL_OBJS.inc @gen_resp_file.bat $(LIBCURL_OBJS) @SET DIROBJ=$(CURL_DIROBJ) @SET MACRO_NAME=CURL_OBJS @SET OUTFILE=CURL_OBJS.inc @gen_resp_file.bat $(CURL_OBJS) @SET CONFIG_NAME_LIB=$(CONFIG_NAME_LIB) @SET MACHINE=$(MACHINE) @SET USE_IDN=$(USE_IDN) @SET USE_IPV6=$(USE_IPV6) @SET USE_SSPI=$(USE_SSPI) @SET USE_SPNEGO=$(USE_SPNEGO) @SET USE_WINSSL=$(USE_WINSSL) @$(MAKE) /NOLOGO /F MakefileBuild.vc copy_from_lib: echo copying .c... FOR %%i IN ($(CURLX_ONES:/=\)) DO copy %%i ..\src\ curl-7.35.0/winbuild/BUILD.WINDOWS.txt0000644000175000017500000000633712270035364014055 00000000000000Building with Visual C++, prerequises ===================================== This document describes how to compile, build and install curl and libcurl from sources using the Visual C++ build tool. To build with VC++, you will of course have to first install VC++. The minimum required version of VC is 6 (part of Visual Studio 6). However using a more recent version like 2008 (vc9) is strongly recommended. VC++ is also part of the Windows Platform SDK. You do not have to install the full Visual Studio or Visual C++ if all you want is to build curl. The Platform SDK can be fetched here, freely: http://msdn.microsoft.com/en-us/windows/bb980924 If you wish to support zlib, openssl, ssh2, you will have to download them separately and copy them to the deps directory as shown below: somedirectory\ |_curl-src | |_winbuild | |_deps |_ lib |_ include |_ bin It is also possible to create the deps directory in some other random places and tell the Makefile its location using the WITH_DEVEL option. Building with Visual C++ ======================== Open a Visual Studio Command prompt or the SDK CMD shell. Using the CMD Shell: choose the right environment via the setenv command (see setenv /?) for the full list of options. setenv /xp /x86 /release for example. Using the Visual Studio command prompt Shell: Everything is already pre-configured by calling one of the command prompt. Once you are in the console, go to the winbuild directory in the Curl sources: cd curl-src\winbuild Then you can call nmake /f Makefile.vc with the desired options (see below). The builds will be in the top src directory, builds\ directory, in a directory named using the options given to the nmake call. nmake /f Makefile.vc mode= where is one or many of: VC=<6,7,8,9,10,11,12> - VC versions WITH_DEVEL= - Paths for the development files (SSL, zlib, etc.) Defaults to sibbling directory deps: ../deps Libraries can be fetched at http://pecl2.php.net/downloads/php-windows-builds/ Uncompress them into the deps folder. WITH_SSL= - Enable OpenSSL support, DLL or static WITH_ZLIB= - Enable zlib support, DLL or static WITH_SSH2= - Enable libSSH2 support, DLL or static ENABLE_SSPI= - Enable SSPI support, defaults to yes ENABLE_IPV6= - Enable IPv6, defaults to yes ENABLE_IDN= - Enable use of Windows IDN APIs, defaults to yes Requires Windows Vista or later, or installation from: http://www.microsoft.com/downloads/details.aspx?FamilyID=AD6158D7-DDBA-416A-9109-07607425A815 ENABLE_WINSSL= - Enable native Windows SSL support, defaults to yes GEN_PDB= - Generate Program Database (debug symbols for release build) DEBUG= - Debug builds MACHINE= - Target architecture (default is x86)curl-7.35.0/winbuild/gen_resp_file.bat0000755000175000017500000000022112213173003014570 00000000000000@echo OFF @del %OUTFILE% @echo %MACRO_NAME% = \> %OUTFILE% @for %%i in (%*) do @echo %DIROBJ%/%%i \>> %OUTFILE% @echo. >> %OUTFILE% :END curl-7.35.0/README0000644000175000017500000000310712213173003010345 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| 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 for the latest news and downloads: http://curl.haxx.se/ GIT To download the very latest source off the GIT server do this: git clone git://github.com/bagder/curl.git (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. curl-7.35.0/configure.ac0000644000175000017500000031454412270035364011777 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2014, 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. # #*************************************************************************** dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) dnl We don't know the version number "statically" so we use a dash here AC_INIT([curl], [-], [a suitable curl mailing list: http://curl.haxx.se/mail/]) XC_OVR_ZZ50 XC_OVR_ZZ60 CURL_OVERRIDE_AUTOCONF dnl configure script copyright AC_COPYRIGHT([Copyright (c) 1998 - 2014 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/curl_config.h include/curl/curlbuild.h) AC_CONFIG_MACRO_DIR([m4]) AM_MAINTAINER_MODE CURL_CHECK_OPTION_DEBUG CURL_CHECK_OPTION_OPTIMIZE CURL_CHECK_OPTION_WARNINGS CURL_CHECK_OPTION_WERROR CURL_CHECK_OPTION_CURLDEBUG CURL_CHECK_OPTION_SYMBOL_HIDING CURL_CHECK_OPTION_ARES XC_CHECK_PATH_SEPARATOR # # save the configure arguments # CONFIGURE_OPTIONS="\"$ac_configure_args\"" AC_SUBST(CONFIGURE_OPTIONS) CURL_CFLAG_EXTRAS="" if test X"$want_werror" = Xyes; then CURL_CFLAG_EXTRAS="-Werror" fi AC_SUBST(CURL_CFLAG_EXTRAS) dnl SED is mandatory for configure process and libtool. dnl Set it now, allowing it to be changed later. if test -z "$SED"; then dnl allow it to be overridden AC_PATH_PROG([SED], [sed], [not_found], [$PATH:/usr/bin:/usr/local/bin]) if test -z "$SED" || test "$SED" = "not_found"; then AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.]) fi fi AC_SUBST([SED]) dnl GREP is mandatory for configure process and libtool. dnl Set it now, allowing it to be changed later. if test -z "$GREP"; then dnl allow it to be overridden AC_PATH_PROG([GREP], [grep], [not_found], [$PATH:/usr/bin:/usr/local/bin]) if test -z "$GREP" || test "$GREP" = "not_found"; then AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.]) fi fi AC_SUBST([GREP]) dnl EGREP is mandatory for configure process and libtool. dnl Set it now, allowing it to be changed later. if test -z "$EGREP"; then dnl allow it to be overridden if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then AC_MSG_CHECKING([for egrep]) EGREP="$GREP -E" AC_MSG_RESULT([$EGREP]) else AC_PATH_PROG([EGREP], [egrep], [not_found], [$PATH:/usr/bin:/usr/local/bin]) fi fi if test -z "$EGREP" || test "$EGREP" = "not_found"; then AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.]) fi AC_SUBST([EGREP]) dnl AR is mandatory for configure process and libtool. dnl This is target dependent, so check it as a tool. if test -z "$AR"; then dnl allow it to be overridden AC_PATH_TOOL([AR], [ar], [not_found], [$PATH:/usr/bin:/usr/local/bin]) if test -z "$AR" || test "$AR" = "not_found"; then AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.]) fi fi AC_SUBST([AR]) AC_SUBST(libext) dnl Remove non-configure distributed curlbuild.h if test -f ${srcdir}/include/curl/curlbuild.h; then rm -f ${srcdir}/include/curl/curlbuild.h fi dnl figure out the libcurl version CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h` XC_CHECK_PROG_CC XC_AUTOMAKE AC_MSG_CHECKING([curl version]) AC_MSG_RESULT($CURLVERSION) AC_SUBST(CURLVERSION) 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,gnutls,nss,polarssl,cyassl,axtls,winssl,darwinssl} )" curl_ssh_msg="no (--with-libssh2)" curl_zlib_msg="no (--with-zlib)" curl_gss_msg="no (--with-gssapi)" curl_spnego_msg="no (--with-spnego)" curl_tls_srp_msg="no (--enable-tls-srp)" curl_res_msg="default (--enable-ares / --enable-threaded-resolver)" curl_ipv6_msg="no (--enable-ipv6)" curl_idn_msg="no (--with-{libidn,winidn})" curl_manual_msg="no (--enable-manual)" curl_libcurl_msg="enabled (--disable-libcurl-option)" curl_verbose_msg="enabled (--disable-verbose)" curl_sspi_msg="no (--enable-sspi)" curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)" curl_ldaps_msg="no (--enable-ldaps)" curl_rtsp_msg="no (--enable-rtsp)" curl_rtmp_msg="no (--with-librtmp)" curl_mtlnk_msg="no (--with-libmetalink)" init_ssl_msg=${curl_ssl_msg} dnl dnl Save some initial values the user might have provided dnl INITIAL_LDFLAGS=$LDFLAGS INITIAL_LIBS=$LIBS 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 Checks for programs. dnl Our curl_off_t internal and external configure settings CURL_CONFIGURE_CURL_OFF_T dnl This defines _ALL_SOURCE for AIX CURL_CHECK_AIX_ALL_SOURCE dnl Our configure and build reentrant settings CURL_CONFIGURE_THREAD_SAFE CURL_CONFIGURE_REENTRANT dnl check for how to do large files AC_SYS_LARGEFILE XC_LIBTOOL # # Automake conditionals based on libtool related checks # AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO], [test "x$xc_lt_shlib_use_version_info" = 'xyes']) AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED], [test "x$xc_lt_shlib_use_no_undefined" = 'xyes']) AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT], [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes']) # # Due to libtool and automake machinery limitations of not allowing # specifying separate CPPFLAGS or CFLAGS when compiling objects for # inclusion of these in shared or static libraries, we are forced to # build using separate configure runs for shared and static libraries # on systems where different CPPFLAGS or CFLAGS are mandatory in order # to compile objects for each kind of library. Notice that relying on # the '-DPIC' CFLAG that libtool provides is not valid given that the # user might for example choose to build static libraries with PIC. # # # Make our Makefile.am files use the staticlib CPPFLAG only when strictly # targeting a static library and not building its shared counterpart. # AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB], [test "x$xc_lt_build_static_only" = 'xyes']) # # Make staticlib CPPFLAG variable and its definition visible in output # files unconditionally, providing an empty definition unless strictly # targeting a static library and not building its shared counterpart. # CPPFLAG_CURL_STATICLIB= if test "x$xc_lt_build_static_only" = 'xyes'; then CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB' fi AC_SUBST([CPPFLAG_CURL_STATICLIB]) # Determine whether all dependent libraries must be specified when linking if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno" then REQUIRE_LIB_DEPS=no else REQUIRE_LIB_DEPS=yes fi AC_SUBST(REQUIRE_LIB_DEPS) AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes) dnl check if there's a way to force code inline AC_C_INLINE dnl ********************************************************************** dnl platform/compiler/architecture specific checks/flags dnl ********************************************************************** CURL_CHECK_COMPILER CURL_SET_COMPILER_BASIC_OPTS CURL_SET_COMPILER_DEBUG_OPTS CURL_SET_COMPILER_OPTIMIZE_OPTS CURL_SET_COMPILER_WARNING_OPTS if test "$compiler_id" = "INTEL_UNIX_C"; then # if test "$compiler_num" -ge "1000"; then dnl icc 10.X or later CFLAGS="$CFLAGS -shared-intel" elif test "$compiler_num" -ge "900"; then dnl icc 9.X specific CFLAGS="$CFLAGS -i-dynamic" fi # fi CURL_CHECK_COMPILER_HALT_ON_ERROR CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH CURL_CHECK_COMPILER_SYMBOL_HIDING CURL_CHECK_CURLDEBUG AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes) supports_unittests=yes # cross-compilation of unit tests static library/programs fails when # libcurl shared library is built. This might be due to a libtool or # automake issue. In this case we disable unit tests. if test "x$cross_compiling" != "xno" && test "x$enable_shared" != "xno"; then supports_unittests=no fi # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to # a problem related with OpenSSL headers and library versions not matching. # Disable unit tests while time to further investigate this is found. case $host in mips-sgi-irix6.5) if test "$compiler_id" = "GNU_C"; then supports_unittests=no fi ;; esac # All AIX autobuilds fails unit tests linking against unittests library # due to unittests library being built with no symbols or members. Libtool ? # Disable unit tests while time to further investigate this is found. case $host_os in aix*) supports_unittests=no ;; esac dnl Build unit tests when option --enable-debug is given. if test "x$want_debug" = "xyes" && test "x$supports_unittests" = "xyes"; then want_unittests=yes else want_unittests=no fi AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes) dnl ********************************************************************** dnl Compilation based checks should not be done before this point. dnl ********************************************************************** 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_NATIVE_WINDOWS case X-"$ac_cv_native_windows" in X-yes) CURL_CHECK_HEADER_WINSOCK CURL_CHECK_HEADER_WINSOCK2 CURL_CHECK_HEADER_WS2TCPIP CURL_CHECK_HEADER_WINLDAP CURL_CHECK_HEADER_WINBER ;; *) ac_cv_header_winsock_h="no" ac_cv_header_winsock2_h="no" ac_cv_header_ws2tcpip_h="no" ac_cv_header_winldap_h="no" ac_cv_header_winber_h="no" ;; esac CURL_CHECK_WIN32_LARGEFILE 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 and RTSP]) AC_SUBST(CURL_DISABLE_HTTP, [1]) AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) AC_SUBST(CURL_DISABLE_RTSP, [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 ldaps]) AC_ARG_ENABLE(ldaps, AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support]) AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]), [ case "$enableval" in no) AC_MSG_RESULT(no) AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) AC_SUBST(CURL_DISABLE_LDAPS, [1]) ;; *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS) AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) AC_SUBST(CURL_DISABLE_LDAPS, [1]) else AC_MSG_RESULT(yes) AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) AC_SUBST(HAVE_LDAP_SSL, [1]) fi ;; esac ],[ if test "x$CURL_DISABLE_LDAP" = "x1" ; then AC_MSG_RESULT(no) AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) AC_SUBST(CURL_DISABLE_LDAPS, [1]) else AC_MSG_RESULT(yes) AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) AC_SUBST(HAVE_LDAP_SSL, [1]) fi ] ) AC_MSG_CHECKING([whether to support rtsp]) AC_ARG_ENABLE(rtsp, AC_HELP_STRING([--enable-rtsp],[Enable RTSP support]) AC_HELP_STRING([--disable-rtsp],[Disable RTSP support]), [ case "$enableval" in no) AC_MSG_RESULT(no) AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) AC_SUBST(CURL_DISABLE_RTSP, [1]) ;; *) if test x$CURL_DISABLE_HTTP = x1 ; then AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!) else AC_MSG_RESULT(yes) curl_rtsp_msg="enabled" fi ;; esac ], if test "x$CURL_DISABLE_HTTP" != "x1"; then AC_MSG_RESULT(yes) curl_rtsp_msg="enabled" else AC_MSG_RESULT(no) fi ) AC_MSG_CHECKING([whether to support proxies]) AC_ARG_ENABLE(proxy, AC_HELP_STRING([--enable-proxy],[Enable proxy support]) AC_HELP_STRING([--disable-proxy],[Disable proxy support]), [ case "$enableval" in no) AC_MSG_RESULT(no) AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies]) AC_SUBST(CURL_DISABLE_PROXY, [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) ) AC_MSG_CHECKING([whether to support pop3]) AC_ARG_ENABLE(pop3, AC_HELP_STRING([--enable-pop3],[Enable POP3 support]) AC_HELP_STRING([--disable-pop3],[Disable POP3 support]), [ case "$enableval" in no) AC_MSG_RESULT(no) AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3]) AC_SUBST(CURL_DISABLE_POP3, [1]) ;; *) AC_MSG_RESULT(yes) ;; esac ], AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support imap]) AC_ARG_ENABLE(imap, AC_HELP_STRING([--enable-imap],[Enable IMAP support]) AC_HELP_STRING([--disable-imap],[Disable IMAP support]), [ case "$enableval" in no) AC_MSG_RESULT(no) AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP]) AC_SUBST(CURL_DISABLE_IMAP, [1]) ;; *) AC_MSG_RESULT(yes) ;; esac ], AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support smtp]) AC_ARG_ENABLE(smtp, AC_HELP_STRING([--enable-smtp],[Enable SMTP support]) AC_HELP_STRING([--disable-smtp],[Disable SMTP support]), [ case "$enableval" in no) AC_MSG_RESULT(no) AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP]) AC_SUBST(CURL_DISABLE_SMTP, [1]) ;; *) AC_MSG_RESULT(yes) ;; esac ], AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support gopher]) AC_ARG_ENABLE(gopher, AC_HELP_STRING([--enable-gopher],[Enable Gopher support]) AC_HELP_STRING([--disable-gopher],[Disable Gopher support]), [ case "$enableval" in no) AC_MSG_RESULT(no) AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher]) AC_SUBST(CURL_DISABLE_GOPHER, [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 disable C code generation support dnl AC_MSG_CHECKING([whether to enable generation of C code]) AC_ARG_ENABLE(libcurl_option, AC_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support]) AC_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]), [ case "$enableval" in no) AC_MSG_RESULT(no) AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option]) curl_libcurl_msg="no" ;; *) AC_MSG_RESULT(yes) ;; esac ], AC_MSG_RESULT(yes) ) dnl ********************************************************************** dnl Checks for libraries. dnl ********************************************************************** 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="-lgcc $LIBS" AC_MSG_RESULT(yes) ;; *) AC_MSG_RESULT(no) ;; esac ], AC_MSG_RESULT(no) ) CURL_CHECK_LIB_XNET 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="-lnsl $LIBS" ]) ]) if test "$HAVE_GETHOSTBYNAME" != "1" then dnl gethostbyname in the socket lib? AC_CHECK_LIB(socket, gethostbyname, [HAVE_GETHOSTBYNAME="1" LIBS="-lsocket $LIBS" ]) fi if test "$HAVE_GETHOSTBYNAME" != "1" then dnl gethostbyname in the watt lib? AC_CHECK_LIB(watt, gethostbyname, [HAVE_GETHOSTBYNAME="1" CPPFLAGS="-I/dev/env/WATT_ROOT/inc" LDFLAGS="-L/dev/env/WATT_ROOT/lib" LIBS="-lwatt $LIBS" ]) 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_LINK_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ gethostbyname(); ]]) ],[ AC_MSG_RESULT([yes]) HAVE_GETHOSTBYNAME="1" ],[ AC_MSG_RESULT([no]) LIBS=$my_ac_save_LIBS ]) fi if test "$HAVE_GETHOSTBYNAME" != "1" then dnl This is for winsock systems if test "$ac_cv_header_windows_h" = "yes"; then if test "$ac_cv_header_winsock_h" = "yes"; then case $host in *-*-mingw32ce*) winsock_LIB="-lwinsock" ;; *) winsock_LIB="-lwsock32" ;; esac fi if test "$ac_cv_header_winsock2_h" = "yes"; then winsock_LIB="-lws2_32" fi if test ! -z "$winsock_LIB"; then my_ac_save_LIBS=$LIBS LIBS="$winsock_LIB $LIBS" AC_MSG_CHECKING([for gethostbyname in $winsock_LIB]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #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 ]],[[ gethostbyname("www.dummysite.com"); ]]) ],[ AC_MSG_RESULT([yes]) HAVE_GETHOSTBYNAME="1" ],[ AC_MSG_RESULT([no]) winsock_LIB="" LIBS=$my_ac_save_LIBS ]) fi fi fi if test "$HAVE_GETHOSTBYNAME" != "1" then dnl This is for Minix 3.1 AC_MSG_CHECKING([for gethostbyname for Minix 3]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ /* Older Minix versions may need here instead */ #include ]],[[ gethostbyname("www.dummysite.com"); ]]) ],[ AC_MSG_RESULT([yes]) HAVE_GETHOSTBYNAME="1" ],[ 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_LINK_IFELSE([ AC_LANG_PROGRAM([[ #include #include ]],[[ gethostbyname("www.dummysite.com"); ]]) ],[ AC_MSG_RESULT([yes]) HAVE_GETHOSTBYNAME="1" ],[ AC_MSG_RESULT([no]) ]) fi if test "$HAVE_GETHOSTBYNAME" != "1" then dnl gethostbyname in the network lib - for Haiku OS AC_CHECK_LIB(network, gethostbyname, [HAVE_GETHOSTBYNAME="1" LIBS="-lnetwork $LIBS" ]) fi if test "$HAVE_GETHOSTBYNAME" != "1" then dnl gethostbyname in the net lib - for BeOS AC_CHECK_LIB(net, gethostbyname, [HAVE_GETHOSTBYNAME="1" LIBS="-lnet $LIBS" ]) fi if test "$HAVE_GETHOSTBYNAME" != "1"; then 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 ac_cv_func_strcasecmp="no" CURL_CHECK_LIBS_CONNECT CURL_NETWORK_LIBS=$LIBS dnl ********************************************************************** dnl In case that function clock_gettime with monotonic timer is available, dnl check for additional required libraries. dnl ********************************************************************** CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC dnl ********************************************************************** dnl The preceding library checks are all potentially useful for test dnl servers and libtest cases which require networking and clock_gettime dnl support. Save the list of required libraries at this point for use dnl while linking those test servers and programs. dnl ********************************************************************** CURL_NETWORK_AND_TIME_LIBS=$LIBS dnl ********************************************************************** dnl Check for the presence of ZLIB libraries and headers dnl ********************************************************************** dnl Check for & handle argument to --with-zlib. clean_CPPFLAGS=$CPPFLAGS clean_LDFLAGS=$LDFLAGS clean_LIBS=$LIBS ZLIB_LIBS="" 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" LIBS="-lz $LIBS"], 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" LIBS="-lz $LIBS" ], [ CPPFLAGS=$clean_CPPFLAGS LDFLAGS=$clean_LDFLAGS]) fi ], [ dnl zlib.h was not found, restore the flags CPPFLAGS=$clean_CPPFLAGS LDFLAGS=$clean_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!]) HAVE_LIBZ="" CPPFLAGS=$clean_CPPFLAGS LDFLAGS=$clean_LDFLAGS LIBS=$clean_LIBS elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1" then AC_MSG_WARN([configure found only the libz header file, not the lib!]) CPPFLAGS=$clean_CPPFLAGS LDFLAGS=$clean_LDFLAGS LIBS=$clean_LIBS 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]) ZLIB_LIBS="-lz" LIBS="-lz $clean_LIBS" 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_SUBST(ZLIB_LIBS) dnl ********************************************************************** dnl Check for LDAP dnl ********************************************************************** LDAPLIBNAME="" AC_ARG_WITH(ldap-lib, AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]), [LDAPLIBNAME="$withval"]) LBERLIBNAME="" AC_ARG_WITH(lber-lib, AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]), [LBERLIBNAME="$withval"]) if test x$CURL_DISABLE_LDAP != x1 ; then CURL_CHECK_HEADER_LBER CURL_CHECK_HEADER_LDAP CURL_CHECK_HEADER_LDAPSSL CURL_CHECK_HEADER_LDAP_SSL if test -z "$LDAPLIBNAME" ; then if test "$ac_cv_native_windows" = "yes"; then dnl Windows uses a single and unique LDAP library name LDAPLIBNAME="wldap32" LBERLIBNAME="no" fi fi if test "$LDAPLIBNAME" ; then AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [ AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled]) AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) AC_SUBST(CURL_DISABLE_LDAP, [1]) AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) AC_SUBST(CURL_DISABLE_LDAPS, [1])]) else dnl Try to find the right ldap libraries for this system CURL_CHECK_LIBS_LDAP case X-"$curl_cv_ldap_LIBS" in X-unknown) AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled]) AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) AC_SUBST(CURL_DISABLE_LDAP, [1]) AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) AC_SUBST(CURL_DISABLE_LDAPS, [1]) ;; esac fi fi if test x$CURL_DISABLE_LDAP != x1 ; then if test "$LBERLIBNAME" ; then dnl If name is "no" then don't define this library at all dnl (it's only needed if libldap.so's dependencies are broken). if test "$LBERLIBNAME" != "no" ; then AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [ AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled]) AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) AC_SUBST(CURL_DISABLE_LDAP, [1]) AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) AC_SUBST(CURL_DISABLE_LDAPS, [1])]) fi fi fi if test x$CURL_DISABLE_LDAP != x1 ; then AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd]) if test "$LDAPLIBNAME" = "wldap32"; then curl_ldap_msg="enabled (winldap)" AC_DEFINE(CURL_LDAP_WIN, 1, [Use Windows LDAP implementation]) else curl_ldap_msg="enabled (OpenLDAP)" if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code]) AC_SUBST(USE_OPENLDAP, [1]) fi fi fi if test x$CURL_DISABLE_LDAPS != x1 ; then curl_ldaps_msg="enabled" fi 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 #include /* for exit() */ 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 # Check if struct sockaddr_in6 have sin6_scope_id member if test "$ipv6" = yes; then AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member]) AC_TRY_COMPILE([ #include #include ] , struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes) if test "$have_sin6_scope_id" = yes; then AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member]) else AC_MSG_RESULT([no]) fi fi 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_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 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 ********************************************************************** dnl check for gss stuff in the /usr as default GSSAPI_ROOT="/usr" 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" if test x"$GSSAPI_ROOT" = xyes; then dnl if yes, then use default root GSSAPI_ROOT="/usr" fi 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 or MIT AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1]) AC_CHECK_HEADERS( [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h], [], [not_mit=1], [ AC_INCLUDES_DEFAULT #ifdef HAVE_GSSAPI_GSSAPI_H #include #endif ]) if test "x$not_mit" = "x1"; then dnl MIT not found, check for Heimdal AC_CHECK_HEADER(gssapi.h, [ dnl found AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries]) ], [ dnl no header found, disabling GSS want_gss=no AC_MSG_WARN(disabling GSSAPI since no header files was found) ] ) else dnl MIT found AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries]) dnl check if we have a really old MIT kerberos (<= 1.2) AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include #include #include ]],[[ gss_import_name( (OM_uint32 *)0, (gss_buffer_t)0, GSS_C_NT_HOSTBASED_SERVICE, (gss_name_t *)0); ]]) ],[ AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) AC_DEFINE(HAVE_OLD_GSSMIT, 1, [if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE]) ]) fi ] ) 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" LIBS="-lgss $LIBS" elif test -z "$GSSAPI_LIB_DIR"; then case $host in *-*-darwin*) LIBS="-lgssapi_krb5 -lresolv $LIBS" ;; *-hp-hpux*) if test "$GSSAPI_ROOT" != "yes"; then LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" fi LIBS="-lgss $LIBS" ;; *) if test -f "$GSSAPI_ROOT/bin/krb5-config"; then dnl krb5-config doesn't have --libs-only-L or similar, put everything dnl into LIBS gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi` LIBS="$gss_libs $LIBS" elif test "$GSSAPI_ROOT" != "yes"; then LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" LIBS="-lgssapi $LIBS" else LIBS="-lgssapi $LIBS" fi ;; esac else LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" case $host in *-hp-hpux*) LIBS="-lgss $LIBS" ;; *) LIBS="-lgssapi $LIBS" ;; esac fi else CPPFLAGS="$save_CPPFLAGS" fi dnl ------------------------------------------------- dnl check winssl option before other SSL libraries dnl ------------------------------------------------- OPT_WINSSL=no AC_ARG_WITH(winssl,dnl AC_HELP_STRING([--with-winssl],[enable Windows native SSL/TLS]) AC_HELP_STRING([--without-winssl], [disable Windows native SSL/TLS]), OPT_WINSSL=$withval) AC_MSG_CHECKING([whether to enable Windows native SSL/TLS (Windows native builds only)]) if test "$curl_ssl_msg" = "$init_ssl_msg"; then if test "x$OPT_WINSSL" != "xno" && test "x$ac_cv_native_windows" = "xyes"; then AC_MSG_RESULT(yes) AC_DEFINE(USE_SCHANNEL, 1, [to enable Windows native SSL/TLS support]) AC_SUBST(USE_SCHANNEL, [1]) curl_ssl_msg="enabled (Windows-native)" WINSSL_ENABLED=1 # --with-winssl implies --enable-sspi AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support]) AC_SUBST(USE_WINDOWS_SSPI, [1]) curl_sspi_msg="enabled" else AC_MSG_RESULT(no) fi else AC_MSG_RESULT(no) fi OPT_DARWINSSL=no AC_ARG_WITH(darwinssl,dnl AC_HELP_STRING([--with-darwinssl],[enable iOS/Mac OS X native SSL/TLS]) AC_HELP_STRING([--without-darwinssl], [disable iOS/Mac OS X native SSL/TLS]), OPT_DARWINSSL=$withval) AC_MSG_CHECKING([whether to enable iOS/Mac OS X native SSL/TLS]) if test "$curl_ssl_msg" = "$init_ssl_msg"; then if test "x$OPT_DARWINSSL" != "xno" && test -d "/System/Library/Frameworks/Security.framework"; then AC_MSG_RESULT(yes) AC_DEFINE(USE_DARWINSSL, 1, [to enable iOS/Mac OS X native SSL/TLS support]) AC_SUBST(USE_DARWINSSL, [1]) curl_ssl_msg="enabled (iOS/Mac OS X-native)" DARWINSSL_ENABLED=1 LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security" else AC_MSG_RESULT(no) fi else AC_MSG_RESULT(no) 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 OpenSSL]), OPT_SSL=$withval) if test "$curl_ssl_msg" = "$init_ssl_msg" && 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 dnl Try pkg-config even when cross-compiling. Since we dnl specify PKG_CONFIG_LIBDIR we're only looking where dnl the user told us to look OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig" AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"]) if test -f "$OPENSSL_PCDIR/openssl.pc"; then PKGTEST="yes" fi dnl in case pkg-config comes up empty, use what we got dnl via --with-ssl LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" if test "$PREFIX_OPENSSL" != "/usr" ; then SSL_LDFLAGS="-L$LIB_OPENSSL" SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include" fi SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl" ;; esac if test "$PKGTEST" = "yes"; then CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR]) if test "$PKGCONFIG" != "no" ; then SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl $PKGCONFIG --libs-only-l openssl 2>/dev/null` SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl $PKGCONFIG --libs-only-L openssl 2>/dev/null` SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl $PKGCONFIG --cflags-only-I openssl 2>/dev/null` AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"]) AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"]) AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"]) LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'` dnl use the values pkg-config reported. This is here dnl instead of below with CPPFLAGS and LDFLAGS because we only dnl learn about this via pkg-config. If we only have dnl the argument to --with-ssl we don't know what dnl additional libs may be necessary. Hope that we dnl don't need any. LIBS="$SSL_LIBS $LIBS" fi fi dnl finally, set flags to use SSL CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS" LDFLAGS="$LDFLAGS $SSL_LDFLAGS" dnl This is for Msys/Mingw case $host in *-*-msys* | *-*-mingw*) 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="-lRSAglue -lrsaref $LIBS" 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 dnl yassl doesn't have SSL_get_shutdown AC_CHECK_FUNCS( RAND_status \ RAND_screen \ RAND_egd \ ENGINE_cleanup \ CRYPTO_cleanup_all_ex_data \ SSL_get_shutdown \ SSLv2_client_method ) dnl Make an attempt to detect if this is actually yassl's headers and dnl OpenSSL emulation layer. We still leave everything else believing dnl and acting like OpenSSL. AC_MSG_CHECKING([for yaSSL using OpenSSL compatibility mode]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include ]],[[ #if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER) int dummy = SSL_ERROR_NONE; #else Not the yaSSL OpenSSL compatibility header. #endif ]]) ],[ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1, [Define to 1 if using yaSSL in OpenSSL compatibility mode.]) curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)" ],[ AC_MSG_RESULT([no]) ]) 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 if test "x$cross_compiling" != "xyes"; then LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL" export LD_LIBRARY_PATH AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH]) fi fi CURL_CHECK_OPENSSL_API 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" ], [ if test x$cross_compiling != xyes; then dnl Check for random device AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] ) else AC_MSG_WARN([skipped the /dev/urandom detection when cross-compiling]) fi ] ) 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 We require OpenSSL with SRP support. dnl --- if test "$OPENSSL_ENABLED" = "1"; then AC_CHECK_LIB(crypto, SRP_Calc_client_key, [ AC_DEFINE(HAVE_SSLEAY_SRP, 1, [if you have the function SRP_Calc_client_key]) AC_SUBST(HAVE_SSLEAY_SRP, [1]) ]) fi dnl ---------------------------------------------------- dnl check for GnuTLS 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]) AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]), OPT_GNUTLS=$withval) if test "$curl_ssl_msg" = "$init_ssl_msg"; then if test X"$OPT_GNUTLS" != Xno; then addld="" addlib="" gtlslib="" version="" addcflags="" if test "x$OPT_GNUTLS" = "xyes"; then dnl this is with no partiular path given CURL_CHECK_PKGCONFIG(gnutls) if test "$PKGCONFIG" != "no" ; then addlib=`$PKGCONFIG --libs-only-l gnutls` addld=`$PKGCONFIG --libs-only-L gnutls` addcflags=`$PKGCONFIG --cflags-only-I gnutls` version=`$PKGCONFIG --modversion gnutls` gtlslib=`echo $addld | $SED -e 's/-L//'` else dnl without pkg-config, we try libgnutls-config as that was how it dnl used to be done check=`libgnutls-config --version 2>/dev/null` if test -n "$check"; then addlib=`libgnutls-config --libs` addcflags=`libgnutls-config --cflags` version=`libgnutls-config --version` gtlslib=`libgnutls-config --prefix`/lib$libsuff fi fi else dnl this is with a given path, first check if there's a libgnutls-config dnl there and if not, make an educated guess cfg=$OPT_GNUTLS/bin/libgnutls-config check=`$cfg --version 2>/dev/null` if test -n "$check"; then addlib=`$cfg --libs` addcflags=`$cfg --cflags` version=`$cfg --version` gtlslib=`$cfg --prefix`/lib$libsuff else dnl without pkg-config and libgnutls-config, we guess a lot! addlib=-lgnutls addld=-L$OPT_GNUTLS/lib$libsuff addcflags=-I$OPT_GNUTLS/include version="" # we just don't know gtlslib=$OPT_GNUTLS/lib$libsuff fi fi if test -z "$version"; then dnl lots of efforts, still no go version="unknown" fi if test -n "$addlib"; then CLEANLIBS="$LIBS" CLEANCPPFLAGS="$CPPFLAGS" CLEANLDFLAGS="$LDFLAGS" LIBS="$addlib $LIBS" LDFLAGS="$LDFLAGS $addld" 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]) GNUTLS_ENABLED=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]) if test -n "$gtlslib"; then 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 if test "x$cross_compiling" != "xyes"; then LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib" export LD_LIBRARY_PATH AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH]) fi fi fi fi fi dnl GNUTLS not disabled fi dnl --- dnl Check which crypto backend GnuTLS uses dnl --- if test "$GNUTLS_ENABLED" = "1"; then USE_GNUTLS_NETTLE= # First check if we can detect either crypto library via transitive linking AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ]) if test "$USE_GNUTLS_NETTLE" = ""; then AC_CHECK_LIB(gnutls, gcry_control, [ USE_GNUTLS_NETTLE=0 ]) fi # If not, try linking directly to both of them to see if they are available if test "$USE_GNUTLS_NETTLE" = ""; then AC_CHECK_LIB(nettle, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ]) fi if test "$USE_GNUTLS_NETTLE" = ""; then AC_CHECK_LIB(gcrypt, gcry_control, [ USE_GNUTLS_NETTLE=0 ]) fi if test "$USE_GNUTLS_NETTLE" = ""; then AC_MSG_ERROR([GnuTLS found, but neither gcrypt nor nettle found]) fi if test "$USE_GNUTLS_NETTLE" = "1"; then AC_DEFINE(USE_GNUTLS_NETTLE, 1, [if GnuTLS uses nettle as crypto backend]) AC_SUBST(USE_GNUTLS_NETTLE, [1]) LIBS="-lnettle $LIBS" else LIBS="-lgcrypt $LIBS" fi fi dnl --- dnl We require GnuTLS with SRP support. dnl --- if test "$GNUTLS_ENABLED" = "1"; then AC_CHECK_LIB(gnutls, gnutls_srp_verifier, [ AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier]) AC_SUBST(HAVE_GNUTLS_SRP, [1]) ]) fi dnl ---------------------------------------------------- dnl check for PolarSSL dnl ---------------------------------------------------- dnl Default to compiler & linker defaults for PolarSSL files & libraries. OPT_POLARSSL=no _cppflags=$CPPFLAGS _ldflags=$LDFLAGS AC_ARG_WITH(polarssl,dnl AC_HELP_STRING([--with-polarssl=PATH],[where to look for PolarSSL, PATH points to the installation root]) AC_HELP_STRING([--without-polarssl], [disable PolarSSL detection]), OPT_POLARSSL=$withval) if test "$curl_ssl_msg" = "$init_ssl_msg"; then if test X"$OPT_POLARSSL" != Xno; then if test "$OPT_POLARSSL" = "yes"; then OPT_POLARSSL="" fi if test -z "$OPT_POLARSSL" ; then dnl check for lib first without setting any new path AC_CHECK_LIB(polarssl, havege_init, dnl libpolarssl found, set the variable [ AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled]) AC_SUBST(USE_POLARSSL, [1]) POLARSSL_ENABLED=1 USE_POLARSSL="yes" curl_ssl_msg="enabled (PolarSSL)" ]) fi addld="" addlib="" addcflags="" polarssllib="" if test "x$USE_POLARSSL" != "xyes"; then dnl add the path and test again addld=-L$OPT_POLARSSL/lib$libsuff addcflags=-I$OPT_POLARSSL/include polarssllib=$OPT_POLARSSL/lib$libsuff LDFLAGS="$LDFLAGS $addld" if test "$addcflags" != "-I/usr/include"; then CPPFLAGS="$CPPFLAGS $addcflags" fi AC_CHECK_LIB(polarssl, ssl_init, [ AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled]) AC_SUBST(USE_POLARSSL, [1]) POLARSSL_ENABLED=1 USE_POLARSSL="yes" curl_ssl_msg="enabled (PolarSSL)" ], [ CPPFLAGS=$_cppflags LDFLAGS=$_ldflags ]) fi if test "x$USE_POLARSSL" = "xyes"; then AC_MSG_NOTICE([detected PolarSSL]) LIBS="-lpolarssl $LIBS" if test -n "$polarssllib"; then 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 if test "x$cross_compiling" != "xyes"; then LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib" export LD_LIBRARY_PATH AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH]) fi fi fi fi dnl PolarSSL not disabled fi dnl ---------------------------------------------------- dnl check for CyaSSL dnl ---------------------------------------------------- dnl Default to compiler & linker defaults for CyaSSL files & libraries. OPT_CYASSL=no _cppflags=$CPPFLAGS _ldflags=$LDFLAGS AC_ARG_WITH(cyassl,dnl AC_HELP_STRING([--with-cyassl=PATH],[where to look for CyaSSL, PATH points to the installation root (default: system lib default)]) AC_HELP_STRING([--without-cyassl], [disable CyaSSL detection]), OPT_CYASSL=$withval) if test "$curl_ssl_msg" = "$init_ssl_msg"; then if test X"$OPT_CYASSL" != Xno; then if test "$OPT_CYASSL" = "yes"; then OPT_CYASSL="" fi if test -z "$OPT_CYASSL" ; then dnl check for lib in system default first AC_CHECK_LIB(cyassl, CyaSSL_Init, dnl libcyassl found, set the variable [ AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled]) AC_SUBST(USE_CYASSL, [1]) CYASSL_ENABLED=1 USE_CYASSL="yes" curl_ssl_msg="enabled (CyaSSL)" ]) fi addld="" addlib="" addcflags="" cyassllib="" if test "x$USE_CYASSL" != "xyes"; then dnl add the path and test again addld=-L$OPT_CYASSL/lib$libsuff addcflags=-I$OPT_CYASSL/include cyassllib=$OPT_CYASSL/lib$libsuff LDFLAGS="$LDFLAGS $addld" if test "$addcflags" != "-I/usr/include"; then CPPFLAGS="$CPPFLAGS $addcflags" fi AC_CHECK_LIB(cyassl, CyaSSL_Init, [ AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled]) AC_SUBST(USE_CYASSL, [1]) CYASSL_ENABLED=1 USE_CYASSL="yes" curl_ssl_msg="enabled (CyaSSL)" ], [ CPPFLAGS=$_cppflags LDFLAGS=$_ldflags ]) fi if test "x$USE_CYASSL" = "xyes"; then AC_MSG_NOTICE([detected CyaSSL]) dnl cyassl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined! AC_CHECK_SIZEOF(long long) LIBS="-lcyassl -lm $LIBS" if test -n "$cyassllib"; then 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 if test "x$cross_compiling" != "xyes"; then LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$cyassllib" export LD_LIBRARY_PATH AC_MSG_NOTICE([Added $cyassllib to LD_LIBRARY_PATH]) fi fi fi fi dnl CyaSSL not disabled fi dnl ---------------------------------------------------- dnl NSS. Only check if GnuTLS and OpenSSL are not enabled dnl ---------------------------------------------------- dnl Default to compiler & linker defaults for NSS files & libraries. OPT_NSS=no AC_ARG_WITH(nss,dnl AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root]) AC_HELP_STRING([--without-nss], [disable NSS detection]), OPT_NSS=$withval) if test "$curl_ssl_msg" = "$init_ssl_msg"; then if test X"$OPT_NSS" != Xno; then addld="" addlib="" addcflags="" nssprefix="" version="" if test "x$OPT_NSS" = "xyes"; then CURL_CHECK_PKGCONFIG(nss) if test "$PKGCONFIG" != "no" ; then addlib=`$PKGCONFIG --libs nss` addcflags=`$PKGCONFIG --cflags nss` version=`$PKGCONFIG --modversion nss` nssprefix=`$PKGCONFIG --variable=prefix nss` else dnl Without pkg-config, we check for nss-config check=`nss-config --version 2>/dev/null` if test -n "$check"; then addlib=`nss-config --libs` addcflags=`nss-config --cflags` version=`nss-config --version` nssprefix=`nss-config --prefix` else addlib="-lnss3" addcflags="" version="unknown" fi fi else # Without pkg-config, we'll kludge in some defaults addlib="-L$OPT_NSS/lib -lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl" addcflags="-I$OPT_NSS/include" version="unknown" nssprefix=$OPT_NSS fi if test -n "$addlib"; then CLEANLIBS="$LIBS" CLEANCPPFLAGS="$CPPFLAGS" LIBS="$addlib $LIBS" if test "$addcflags" != "-I/usr/include"; then CPPFLAGS="$CPPFLAGS $addcflags" fi dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0 AC_CHECK_LIB(nss3, SSL_VersionRangeSet, [ AC_DEFINE(USE_NSS, 1, [if NSS is enabled]) AC_SUBST(USE_NSS, [1]) USE_NSS="yes" NSS_ENABLED=1 curl_ssl_msg="enabled (NSS)" ], [ LIBS="$CLEANLIBS" CPPFLAGS="$CLEANCPPFLAGS" ]) if test "x$USE_NSS" = "xyes"; then AC_MSG_NOTICE([detected NSS 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 if test "x$cross_compiling" != "xyes"; then LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff" export LD_LIBRARY_PATH AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH]) fi fi fi fi dnl NSS not disabled fi dnl curl_ssl_msg = init_ssl_msg OPT_AXTLS=off AC_ARG_WITH(axtls,dnl AC_HELP_STRING([--with-axtls=PATH],[Where to look for axTLS, PATH points to the axTLS installation prefix (default: /usr/local). Ignored if another SSL engine is selected.]) AC_HELP_STRING([--without-axtls], [disable axTLS]), OPT_AXTLS=$withval) if test "$curl_ssl_msg" = "$init_ssl_msg"; then if test X"$OPT_AXTLS" != Xno; then dnl backup the pre-axtls variables CLEANLDFLAGS="$LDFLAGS" CLEANCPPFLAGS="$CPPFLAGS" CLEANLIBS="$LIBS" case "$OPT_AXTLS" in yes) dnl --with-axtls (without path) used PREFIX_AXTLS=/usr/local LIB_AXTLS="$PREFIX_AXTLS/lib" LDFLAGS="$LDFLAGS -L$LIB_AXTLS" CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include" ;; off) dnl no --with-axtls option given, just check default places PREFIX_AXTLS= ;; *) dnl check the given --with-axtls spot PREFIX_AXTLS=$OPT_AXTLS LIB_AXTLS="$PREFIX_AXTLS/lib" LDFLAGS="$LDFLAGS -L$LIB_AXTLS" CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include" ;; esac AC_CHECK_LIB(axtls, ssl_version,[ LIBS="-laxtls $LIBS" AC_DEFINE(USE_AXTLS, 1, [if axTLS is enabled]) AC_SUBST(USE_AXTLS, [1]) AXTLS_ENABLED=1 USE_AXTLS="yes" curl_ssl_msg="enabled (axTLS)" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_AXTLS" export LD_LIBRARY_PATH AC_MSG_NOTICE([Added $LIB_AXTLS to LD_LIBRARY_PATH]) ],[ LDFLAGS="$CLEANLDFLAGS" CPPFLAGS="$CLEANCPPFLAGS" LIBS="$CLEANLIBS" ]) fi fi if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED$DARWINSSL_ENABLED" = "x"; then AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.]) AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, or --with-darwinssl to address this.]) else # SSL is enabled, genericly AC_SUBST(SSL_ENABLED) SSL_ENABLED="1" fi dnl ********************************************************************** dnl Check for the CA bundle dnl ********************************************************************** CURL_CHECK_CA_BUNDLE dnl ********************************************************************** dnl Check for libmetalink dnl ********************************************************************** OPT_LIBMETALINK=no AC_ARG_WITH(libmetalink,dnl AC_HELP_STRING([--with-libmetalink=PATH],[where to look for libmetalink, PATH points to the installation root]) AC_HELP_STRING([--without-libmetalink], [disable libmetalink detection]), OPT_LIBMETALINK=$withval) if test X"$OPT_LIBMETALINK" != Xno; then addld="" addlib="" addcflags="" version="" libmetalinklib="" PKGTEST="no" if test "x$OPT_LIBMETALINK" = "xyes"; then dnl this is with no partiular path given PKGTEST="yes" CURL_CHECK_PKGCONFIG(libmetalink) else dnl When particular path is given, set PKG_CONFIG_LIBDIR using the path. LIBMETALINK_PCDIR="$OPT_LIBMETALINK/lib/pkgconfig" AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$LIBMETALINK_PCDIR"]) if test -f "$LIBMETALINK_PCDIR/libmetalink.pc"; then PKGTEST="yes" fi if test "$PKGTEST" = "yes"; then CURL_CHECK_PKGCONFIG(libmetalink, [$LIBMETALINK_PCDIR]) fi fi if test "$PKGTEST" = "yes" && test "$PKGCONFIG" != "no"; then addlib=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl $PKGCONFIG --libs-only-l libmetalink` addld=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl $PKGCONFIG --libs-only-L libmetalink` addcflags=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl $PKGCONFIG --cflags-only-I libmetalink` version=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl $PKGCONFIG --modversion libmetalink` libmetalinklib=`echo $addld | $SED -e 's/-L//'` fi if test -n "$addlib"; then clean_CPPFLAGS="$CPPFLAGS" clean_LDFLAGS="$LDFLAGS" clean_LIBS="$LIBS" CPPFLAGS="$addcflags $clean_CPPFLAGS" LDFLAGS="$addld $clean_LDFLAGS" LIBS="$addlib $clean_LIBS" AC_MSG_CHECKING([if libmetalink is recent enough]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ # include ]],[[ if(0 != metalink_strerror(0)) /* added in 0.1.0 */ return 1; ]]) ],[ AC_MSG_RESULT([yes ($version)]) want_metalink="yes" ],[ AC_MSG_RESULT([no ($version)]) AC_MSG_NOTICE([libmetalink library defective or too old]) want_metalink="no" ]) CPPFLAGS="$clean_CPPFLAGS" LDFLAGS="$clean_LDFLAGS" LIBS="$clean_LIBS" if test "$want_metalink" = "yes"; then dnl finally libmetalink will be used AC_DEFINE(USE_METALINK, 1, [Define to enable metalink support]) LIBMETALINK_LIBS=$addlib LIBMETALINK_LDFLAGS=$addld LIBMETALINK_CPPFLAGS=$addcflags AC_SUBST([LIBMETALINK_LIBS]) AC_SUBST([LIBMETALINK_LDFLAGS]) AC_SUBST([LIBMETALINK_CPPFLAGS]) curl_mtlnk_msg="enabled" fi fi fi dnl ********************************************************************** dnl Check for the presence of LIBSSH2 libraries and headers dnl ********************************************************************** dnl Default to compiler & linker defaults for LIBSSH2 files & libraries. OPT_LIBSSH2=off AC_ARG_WITH(libssh2,dnl AC_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the LIBSSH2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) AC_HELP_STRING([--without-libssh2], [disable LIBSSH2]), OPT_LIBSSH2=$withval) if test X"$OPT_LIBSSH2" != Xno; then dnl backup the pre-libssh2 variables CLEANLDFLAGS="$LDFLAGS" CLEANCPPFLAGS="$CPPFLAGS" CLEANLIBS="$LIBS" case "$OPT_LIBSSH2" in yes) dnl --with-libssh2 (without path) used CURL_CHECK_PKGCONFIG(libssh2) if test "$PKGCONFIG" != "no" ; then LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2` LD_SSH2=`$PKGCONFIG --libs-only-L libssh2` CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2` version=`$PKGCONFIG --modversion libssh2` DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'` fi ;; off) dnl no --with-libssh2 option given, just check default places ;; *) dnl use the given --with-libssh2 spot PREFIX_SSH2=$OPT_LIBSSH2 ;; esac dnl if given with a prefix, we set -L and -I based on that if test -n "$PREFIX_SSH2"; then LIB_SSH2="-lssh2" LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff CPP_SSH2=-I${PREFIX_SSH2}/include DIR_SSH2=${PREFIX_SSH2}/lib$libsuff fi LDFLAGS="$LDFLAGS $LD_SSH2" CPPFLAGS="$CPPFLAGS $CPP_SSH2" LIBS="$LIB_SSH2 $LIBS" AC_CHECK_LIB(ssh2, libssh2_channel_open_ex) AC_CHECK_HEADERS(libssh2.h, curl_ssh_msg="enabled (libSSH2)" LIBSSH2_ENABLED=1 AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use]) AC_SUBST(USE_LIBSSH2, [1]) ) if test X"$OPT_LIBSSH2" != Xoff && test "$LIBSSH2_ENABLED" != "1"; then AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!]) fi if test "$LIBSSH2_ENABLED" = "1"; then if test -n "$DIR_SSH2"; then dnl when the libssh2 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 dnl libssh2_version is a post 1.0 addition dnl libssh2_init and libssh2_exit were added in 1.2.5 dnl libssh2_scp_send64 was added in 1.2.6 dnl libssh2_session_handshake was added in 1.2.8 AC_CHECK_FUNCS( libssh2_version libssh2_init libssh2_exit \ libssh2_scp_send64 libssh2_session_handshake) if test "x$cross_compiling" != "xyes"; then LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2" export LD_LIBRARY_PATH AC_MSG_NOTICE([Added $DIR_SSH2 to LD_LIBRARY_PATH]) fi fi else dnl no libssh2, revert back to clean variables LDFLAGS=$CLEANLDFLAGS CPPFLAGS=$CLEANCPPFLAGS LIBS=$CLEANLIBS fi fi dnl ********************************************************************** dnl Check for the presence of LIBRTMP libraries and headers dnl ********************************************************************** dnl Default to compiler & linker defaults for LIBRTMP files & libraries. OPT_LIBRTMP=off AC_ARG_WITH(librtmp,dnl AC_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to the LIBRTMP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]), OPT_LIBRTMP=$withval) if test X"$OPT_LIBRTMP" != Xno; then dnl backup the pre-librtmp variables CLEANLDFLAGS="$LDFLAGS" CLEANCPPFLAGS="$CPPFLAGS" CLEANLIBS="$LIBS" case "$OPT_LIBRTMP" in yes) dnl --with-librtmp (without path) used CURL_CHECK_PKGCONFIG(librtmp) if test "$PKGCONFIG" != "no" ; then LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp` LD_RTMP=`$PKGCONFIG --libs-only-L librtmp` CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp` version=`$PKGCONFIG --modversion librtmp` DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'` else dnl To avoid link errors, we do not allow --librtmp without dnl a pkgconfig file AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.]) fi ;; off) dnl no --with-librtmp option given, just check default places LIB_RTMP="-lrtmp" ;; *) dnl use the given --with-librtmp spot PREFIX_RTMP=$OPT_LIBRTMP ;; esac dnl if given with a prefix, we set -L and -I based on that if test -n "$PREFIX_RTMP"; then LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff CPP_RTMP=-I${PREFIX_RTMP}/include DIR_RTMP=${PREFIX_RTMP}/lib$libsuff fi LDFLAGS="$LDFLAGS $LD_RTMP" CPPFLAGS="$CPPFLAGS $CPP_RTMP" LIBS="$LIB_RTMP $LIBS" AC_CHECK_LIB(rtmp, RTMP_Init, [ AC_CHECK_HEADERS(librtmp/rtmp.h, curl_rtmp_msg="enabled (librtmp)" LIBRTMP_ENABLED=1 AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use]) AC_SUBST(USE_LIBRTMP, [1]) ) ], dnl not found, revert back to clean variables LDFLAGS=$CLEANLDFLAGS CPPFLAGS=$CLEANCPPFLAGS LIBS=$CLEANLIBS ) if test X"$OPT_LIBRTMP" != Xoff && test "$LIBRTMP_ENABLED" != "1"; then AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!]) fi fi dnl ********************************************************************** dnl Check for linker switch for versioned symbols dnl ********************************************************************** versioned_symbols_flavour= AC_MSG_CHECKING([whether versioned symbols are wanted]) AC_ARG_ENABLE(versioned-symbols, AC_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library]) AC_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]), [ case "$enableval" in yes) AC_MSG_RESULT(yes) AC_MSG_CHECKING([if libraries can be versioned]) GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` if test -z "$GLD"; then AC_MSG_RESULT(no) AC_MSG_WARN([You need an ld version supporting the --version-script option]) else AC_MSG_RESULT(yes) if test "x$OPENSSL_ENABLED" = "x1"; then versioned_symbols_flavour="OPENSSL_" elif test "x$GNUTLS_ENABLED" == "x1"; then versioned_symbols_flavour="GNUTLS_" elif test "x$NSS_ENABLED" == "x1"; then versioned_symbols_flavour="NSS_" elif test "x$POLARSSL_ENABLED" == "x1"; then versioned_symbols_flavour="POLARSSL_" elif test "x$CYASSL_ENABLED" == "x1"; then versioned_symbols_flavour="CYASSL_" elif test "x$AXTLS_ENABLED" == "x1"; then versioned_symbols_flavour="AXTLS_" elif test "x$WINSSL_ENABLED" == "x1"; then versioned_symbols_flavour="WINSSL_" elif test "x$DARWINSSL_ENABLED" == "x1"; then versioned_symbols_flavour="DARWINSSL_" else versioned_symbols_flavour="" fi versioned_symbols="yes" fi ;; *) AC_MSG_RESULT(no) ;; esac ], [ AC_MSG_RESULT(no) ] ) AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR], ["$versioned_symbols_flavour"]) AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS], [test "x$versioned_symbols" = 'xyes']) dnl ------------------------------------------------- dnl check winidn option before other IDN libraries dnl ------------------------------------------------- AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)]) OPT_WINIDN="default" AC_ARG_WITH(winidn, AC_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN]) AC_HELP_STRING([--without-winidn], [disable Windows native IDN]), OPT_WINIDN=$withval) case "$OPT_WINIDN" in no|default) dnl --without-winidn option used or configure option not specified want_winidn="no" AC_MSG_RESULT([no]) ;; yes) dnl --with-winidn option used without path want_winidn="yes" want_winidn_path="default" AC_MSG_RESULT([yes]) ;; *) dnl --with-winidn option used with path want_winidn="yes" want_winidn_path="$withval" AC_MSG_RESULT([yes ($withval)]) ;; esac if test "$want_winidn" = "yes"; then dnl winidn library support has been requested clean_CPPFLAGS="$CPPFLAGS" clean_LDFLAGS="$LDFLAGS" clean_LIBS="$LIBS" WINIDN_LIBS="-lnormaliz" # if test "$want_winidn_path" != "default"; then dnl path has been specified dnl pkg-config not available or provides no info WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff" WINIDN_CPPFLAGS="-I$want_winidn_path/include" WINIDN_DIR="$want_winidn_path/lib$libsuff" fi # CPPFLAGS="$WINIDN_CPPFLAGS $CPPFLAGS" LDFLAGS="$WINIDN_LDFLAGS $LDFLAGS" LIBS="$WINIDN_LIBS $LIBS" # AC_MSG_CHECKING([if IdnToUnicode can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([IdnToUnicode]) ],[ AC_MSG_RESULT([yes]) tst_links_winidn="yes" ],[ AC_MSG_RESULT([no]) tst_links_winidn="no" ]) # if test "$tst_links_winidn" = "yes"; then AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).]) AC_DEFINE(WANT_IDN_PROTOTYPES, 1, [Define to 1 to provide own prototypes.]) AC_SUBST([IDN_ENABLED], [1]) curl_idn_msg="enabled (Windows-native)" else AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled]) CPPFLAGS="$clean_CPPFLAGS" LDFLAGS="$clean_LDFLAGS" LIBS="$clean_LIBS" fi fi dnl ********************************************************************** dnl Check for the presence of IDN libraries and headers dnl ********************************************************************** AC_MSG_CHECKING([whether to build with libidn]) OPT_IDN="default" AC_ARG_WITH(libidn, AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage]) AC_HELP_STRING([--without-libidn],[Disable libidn usage]), [OPT_IDN=$withval]) case "$OPT_IDN" in no) dnl --without-libidn option used want_idn="no" AC_MSG_RESULT([no]) ;; default) dnl configure option not specified want_idn="yes" want_idn_path="default" AC_MSG_RESULT([(assumed) yes]) ;; yes) dnl --with-libidn option used without path want_idn="yes" want_idn_path="default" AC_MSG_RESULT([yes]) ;; *) dnl --with-libidn option used with path want_idn="yes" want_idn_path="$withval" AC_MSG_RESULT([yes ($withval)]) ;; esac if test "$want_idn" = "yes"; then dnl idn library support has been requested clean_CPPFLAGS="$CPPFLAGS" clean_LDFLAGS="$LDFLAGS" clean_LIBS="$LIBS" PKGCONFIG="no" # if test "$want_idn_path" != "default"; then dnl path has been specified IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig" CURL_CHECK_PKGCONFIG(libidn, [$IDN_PCDIR]) if test "$PKGCONFIG" != "no"; then IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl $PKGCONFIG --libs-only-l libidn 2>/dev/null` IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl $PKGCONFIG --libs-only-L libidn 2>/dev/null` IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl $PKGCONFIG --cflags-only-I libidn 2>/dev/null` IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'` else dnl pkg-config not available or provides no info IDN_LIBS="-lidn" IDN_LDFLAGS="-L$want_idn_path/lib$libsuff" IDN_CPPFLAGS="-I$want_idn_path/include" IDN_DIR="$want_idn_path/lib$libsuff" fi else dnl path not specified CURL_CHECK_PKGCONFIG(libidn) if test "$PKGCONFIG" != "no"; then IDN_LIBS=`$PKGCONFIG --libs-only-l libidn 2>/dev/null` IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn 2>/dev/null` IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn 2>/dev/null` IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'` else dnl pkg-config not available or provides no info IDN_LIBS="-lidn" fi fi # if test "$PKGCONFIG" != "no"; then AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"]) AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"]) AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"]) AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"]) else AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"]) AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"]) AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"]) AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"]) fi # CPPFLAGS="$IDN_CPPFLAGS $CPPFLAGS" LDFLAGS="$IDN_LDFLAGS $LDFLAGS" LIBS="$IDN_LIBS $LIBS" # AC_MSG_CHECKING([if idna_to_ascii_4i can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([idna_to_ascii_4i]) ],[ AC_MSG_RESULT([yes]) tst_links_libidn="yes" ],[ AC_MSG_RESULT([no]) tst_links_libidn="no" ]) if test "$tst_links_libidn" = "no"; then AC_MSG_CHECKING([if idna_to_ascii_lz can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([idna_to_ascii_lz]) ],[ AC_MSG_RESULT([yes]) tst_links_libidn="yes" ],[ AC_MSG_RESULT([no]) tst_links_libidn="no" ]) fi # if test "$tst_links_libidn" = "yes"; then AC_DEFINE(HAVE_LIBIDN, 1, [Define to 1 if you have the `idn' library (-lidn).]) 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 ) if test "x$ac_cv_header_tld_h" = "xyes"; then AC_SUBST([IDN_ENABLED], [1]) curl_idn_msg="enabled" if test -n "$IDN_DIR"; then LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR" export LD_LIBRARY_PATH AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH]) fi else AC_MSG_WARN([Libraries for IDN support too old: IDN disabled]) CPPFLAGS="$clean_CPPFLAGS" LDFLAGS="$clean_LDFLAGS" LIBS="$clean_LIBS" fi else AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled]) CPPFLAGS="$clean_CPPFLAGS" LDFLAGS="$clean_LDFLAGS" LIBS="$clean_LIBS" fi fi 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 dnl ********************************************************************** dnl Check for nghttp2 dnl ********************************************************************** AC_MSG_CHECKING([whether to build with nghttp2]) OPT_H2="no" AC_ARG_WITH(nghttp2, AC_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage]) AC_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]), [OPT_H2=$withval]) case "$OPT_H2" in no) dnl --without-nghttp2 option used want_idn="no" AC_MSG_RESULT([no]) ;; default) dnl configure option not specified want_h2="no" want_h2_path="default" AC_MSG_RESULT([no]) ;; yes) dnl --with-nghttp2 option used without path want_h2="yes" want_h2_path="" AC_MSG_RESULT([yes]) ;; *) dnl --with-nghttp2 option used with path want_h2="yes" want_h2_path="$withval" AC_MSG_RESULT([yes ($withval)]) ;; esac curl_h2_msg="disabled (--with-nghttp2)" if test X"$OPT_H2" != Xno; then dnl backup the pre-librtmp variables CLEANLDFLAGS="$LDFLAGS" CLEANCPPFLAGS="$CPPFLAGS" CLEANLIBS="$LIBS" h2pcdir=${want_h2_path}/lib/pkgconfig CURL_CHECK_PKGCONFIG(libnghttp2, $h2pcdir) if test "$PKGCONFIG" != "no" ; then LIB_H2=`CURL_EXPORT_PCDIR([$h2pcdir]) $PKGCONFIG --libs-only-l libnghttp2` AC_MSG_NOTICE([-l is $LIB_H2]) CPP_H2=`CURL_EXPORT_PCDIR([$h2pcdir]) dnl $PKGCONFIG --cflags-only-I libnghttp2` AC_MSG_NOTICE([-I is $CPP_H2]) LD_H2=`CURL_EXPORT_PCDIR([$h2pcdir]) $PKGCONFIG --libs-only-L libnghttp2` AC_MSG_NOTICE([-L is $LD_H2]) else dnl To avoid link errors, we do not allow --libnghttp2 without dnl a pkgconfig file AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.]) fi LDFLAGS="$LDFLAGS $LD_H2" CPPFLAGS="$CPPFLAGS $CPP_H2" LIBS="$LIB_H2 $LIBS" AC_CHECK_LIB(nghttp2, nghttp2_session_client_new, [ AC_CHECK_HEADERS(nghttp2/nghttp2.h, curl_h2_msg="enabled (nghttp2)" NGHTTP2_ENABLED=1 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use]) AC_SUBST(USE_NGHTTP2, [1]) ) ], dnl not found, revert back to clean variables LDFLAGS=$CLEANLDFLAGS CPPFLAGS=$CLEANCPPFLAGS LIBS=$CLEANLIBS ) fi dnl ********************************************************************** dnl Back to "normal" configuring dnl ********************************************************************** dnl Checks for header files. AC_HEADER_STDC CURL_CHECK_HEADER_MALLOC CURL_CHECK_HEADER_MEMORY 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 \ sys/uio.h \ assert.h \ unistd.h \ stdlib.h \ limits.h \ arpa/inet.h \ net/if.h \ netinet/in.h \ sys/un.h \ netinet/tcp.h \ netdb.h \ sys/sockio.h \ sys/stat.h \ sys/param.h \ termios.h \ termio.h \ sgtty.h \ fcntl.h \ alloca.h \ time.h \ io.h \ pwd.h \ utime.h \ sys/utime.h \ sys/poll.h \ poll.h \ socket.h \ sys/resource.h \ libgen.h \ locale.h \ errno.h \ stdbool.h \ arpa/tftp.h \ sys/filio.h \ sys/wait.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 #ifdef HAVE_SYS_UN_H #include #endif ] ) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST CURL_CHECK_VARIADIC_MACROS AC_TYPE_SIZE_T AC_HEADER_TIME CURL_CHECK_STRUCT_TIMEVAL CURL_VERIFY_RUNTIMELIBS AC_CHECK_SIZEOF(size_t) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(short) CURL_CONFIGURE_LONG AC_CHECK_SIZEOF(time_t) AC_CHECK_SIZEOF(off_t) soname_bump=no if test x"$ac_cv_native_windows" != "xyes" && test $ac_cv_sizeof_off_t -ne $curl_sizeof_curl_off_t; then AC_MSG_WARN([This libcurl built is probably not ABI compatible with previous]) AC_MSG_WARN([builds! You MUST read lib/README.curl_off_t to figure it out.]) soname_bump=yes fi AC_CHECK_TYPE(long long, [AC_DEFINE(HAVE_LONGLONG, 1, [Define to 1 if the compiler supports the 'long long' data type.])] longlong="yes" ) if test "xyes" = "x$longlong"; then AC_MSG_CHECKING([if numberLL works]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ long long val = 1000LL; ]]) ],[ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL]) ],[ 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 bool type AC_CHECK_TYPE([bool],[ AC_DEFINE(HAVE_BOOL_T, 1, [Define to 1 if bool is an available type.]) ], ,[ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDBOOL_H #include #endif ]) CURL_CONFIGURE_CURL_SOCKLEN_T CURL_CONFIGURE_PULL_SYS_POLL TYPE_IN_ADDR_T TYPE_SOCKADDR_STORAGE TYPE_SIG_ATOMIC_T AC_TYPE_SIGNAL CURL_CHECK_FUNC_SELECT CURL_CHECK_FUNC_RECV CURL_CHECK_FUNC_SEND CURL_CHECK_MSG_NOSIGNAL CURL_CHECK_FUNC_ALARM CURL_CHECK_FUNC_BASENAME CURL_CHECK_FUNC_CLOSESOCKET CURL_CHECK_FUNC_CLOSESOCKET_CAMEL CURL_CHECK_FUNC_CONNECT CURL_CHECK_FUNC_FCNTL CURL_CHECK_FUNC_FDOPEN CURL_CHECK_FUNC_FREEADDRINFO CURL_CHECK_FUNC_FREEIFADDRS CURL_CHECK_FUNC_FSETXATTR CURL_CHECK_FUNC_FTRUNCATE CURL_CHECK_FUNC_GETADDRINFO CURL_CHECK_FUNC_GAI_STRERROR CURL_CHECK_FUNC_GETHOSTBYADDR CURL_CHECK_FUNC_GETHOSTBYADDR_R CURL_CHECK_FUNC_GETHOSTBYNAME CURL_CHECK_FUNC_GETHOSTBYNAME_R CURL_CHECK_FUNC_GETHOSTNAME CURL_CHECK_FUNC_GETIFADDRS CURL_CHECK_FUNC_GETSERVBYPORT_R CURL_CHECK_FUNC_GMTIME_R CURL_CHECK_FUNC_INET_NTOA_R CURL_CHECK_FUNC_INET_NTOP CURL_CHECK_FUNC_INET_PTON CURL_CHECK_FUNC_IOCTL CURL_CHECK_FUNC_IOCTLSOCKET CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL CURL_CHECK_FUNC_LOCALTIME_R CURL_CHECK_FUNC_MEMRCHR CURL_CHECK_FUNC_POLL CURL_CHECK_FUNC_SETSOCKOPT CURL_CHECK_FUNC_SIGACTION CURL_CHECK_FUNC_SIGINTERRUPT CURL_CHECK_FUNC_SIGNAL CURL_CHECK_FUNC_SIGSETJMP CURL_CHECK_FUNC_SOCKET CURL_CHECK_FUNC_SOCKETPAIR CURL_CHECK_FUNC_STRCASECMP CURL_CHECK_FUNC_STRCMPI CURL_CHECK_FUNC_STRDUP CURL_CHECK_FUNC_STRERROR_R CURL_CHECK_FUNC_STRICMP CURL_CHECK_FUNC_STRNCASECMP CURL_CHECK_FUNC_STRNCMPI CURL_CHECK_FUNC_STRNICMP CURL_CHECK_FUNC_STRSTR CURL_CHECK_FUNC_STRTOK_R CURL_CHECK_FUNC_STRTOLL CURL_CHECK_FUNC_WRITEV 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([fork \ geteuid \ getpass_r \ getppid \ getprotobyname \ getpwuid \ getrlimit \ gettimeofday \ inet_addr \ perror \ pipe \ setlocale \ setmode \ setrlimit \ uname \ utime ],[ ],[ func="$ac_func" eval skipcheck=\$skipcheck_$func if test "x$skipcheck" != "xyes"; then AC_MSG_CHECKING([deeper for $func]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ $func (); ]]) ],[ AC_MSG_RESULT([yes]) eval "ac_cv_func_$func=yes" AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1], [Define to 1 if you have the $func function.]) ],[ AC_MSG_RESULT([but still no]) ]) fi ]) 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 if test "$ac_cv_func_getaddrinfo" = "yes"; then AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support]) IPV6_ENABLED=1 AC_SUBST(IPV6_ENABLED) fi CURL_CHECK_NI_WITHSCOPEID fi CURL_CHECK_NONBLOCKING_SOCKET dnl ************************************************************ dnl nroff tool stuff dnl 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) CURL_CHECK_LIB_ARES AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes) if test "x$ac_cv_native_windows" != "xyes" && test "x$enable_shared" = "xyes"; then build_libhostname=yes else build_libhostname=no fi AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes) CURL_CHECK_OPTION_THREADED_RESOLVER if test "x$want_thres" = xyes && test "x$want_ares" = xyes; then AC_MSG_ERROR( [Options --enable-threaded-resolver and --enable-ares are mutually exclusive]) fi if test "$want_thres" = "yes"; then AC_CHECK_HEADER(pthread.h, [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have ]) save_CFLAGS="$CFLAGS" dnl first check for function without lib AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] ) dnl if it wasn't found without lib, search for it in pthread lib if test "$USE_THREADS_POSIX" != "1" then CFLAGS="$CFLAGS -pthread" AC_CHECK_LIB(pthread, pthread_create, [USE_THREADS_POSIX=1], [ CFLAGS="$save_CFLAGS"]) fi if test "x$USE_THREADS_POSIX" = "x1" then AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup]) curl_res_msg="POSIX threaded" fi ]) fi 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]) 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 (Windows native builds only)]) AC_ARG_ENABLE(sspi, AC_HELP_STRING([--enable-sspi],[Enable SSPI]) AC_HELP_STRING([--disable-sspi],[Disable SSPI]), [ case "$enableval" in yes) if test "$ac_cv_native_windows" = "yes"; then AC_MSG_RESULT(yes) AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support]) AC_SUBST(USE_WINDOWS_SSPI, [1]) curl_sspi_msg="enabled" else AC_MSG_RESULT(no) AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.]) fi ;; *) if test "x$WINSSL_ENABLED" = "x1"; then # --with-winssl implies --enable-sspi AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi ;; esac ], if test "x$WINSSL_ENABLED" = "x1"; then # --with-winssl implies --enable-sspi AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi ) 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_MSG_RESULT(yes) ;; esac ], AC_MSG_RESULT(yes) ) CURL_CHECK_OPTION_NTLM_WB CURL_CHECK_NTLM_WB dnl ************************************************************ dnl disable TLS-SRP authentication dnl AC_MSG_CHECKING([whether to enable TLS-SRP authentication]) AC_ARG_ENABLE(tls-srp, AC_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication]) AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]), [ case "$enableval" in no) AC_MSG_RESULT(no) AC_DEFINE(CURL_DISABLE_TLS_SRP, 1, [to disable TLS-SRP authentication]) want_tls_srp=no ;; *) AC_MSG_RESULT(yes) want_tls_srp=yes ;; esac ], AC_MSG_RESULT(yes) want_tls_srp=yes ) if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_SSLEAY_SRP" = "x1") ; then AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication]) USE_TLS_SRP=1 curl_tls_srp_msg="enabled" fi 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_MSG_RESULT(yes) ;; esac ], AC_MSG_RESULT(yes) ) dnl ************************************************************ dnl hiding of library internal symbols dnl CURL_CONFIGURE_SYMBOL_HIDING dnl ************************************************************ dnl enforce SONAME bump dnl AC_MSG_CHECKING([whether to enforce SONAME bump]) AC_ARG_ENABLE(soname-bump, AC_HELP_STRING([--enable-soname-bump],[Enable enforced SONAME bump]) AC_HELP_STRING([--disable-soname-bump],[Disable enforced SONAME bump]), [ case "$enableval" in yes) AC_MSG_RESULT(yes) soname_bump=yes ;; *) AC_MSG_RESULT(no) ;; esac ], AC_MSG_RESULT($soname_bump) ) AM_CONDITIONAL(SONAME_BUMP, test x$soname_bump = xyes) dnl dnl All the library dependencies put into $LIB apply to libcurl only. dnl LIBCURL_LIBS=$LIBS AC_SUBST(LIBCURL_LIBS) AC_SUBST(CURL_NETWORK_LIBS) AC_SUBST(CURL_NETWORK_AND_TIME_LIBS) dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank dnl LIBS variable used in generated makefile at makefile processing dnl time. Doing this functionally prevents LIBS from being used for dnl all link targets in given makefile. BLANK_AT_MAKETIME= AC_SUBST(BLANK_AT_MAKETIME) AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes) dnl yes or no ENABLE_SHARED="$enable_shared" AC_SUBST(ENABLE_SHARED) dnl to let curl-config output the static libraries correctly ENABLE_STATIC="$enable_static" AC_SUBST(ENABLE_STATIC) dnl dnl For keeping supported features and protocols also in pkg-config file dnl since it is more cross-compile friendly than curl-config dnl if test "x$USE_SSLEAY" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES SSL" elif test -n "$SSL_ENABLED"; then SUPPORT_FEATURES="$SUPPORT_FEATURES SSL" fi if test "x$IPV6_ENABLED" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6" fi if test "x$HAVE_LIBZ" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES libz" fi if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS" fi if test "x$IDN_ENABLED" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES IDN" fi if test "x$USE_WINDOWS_SSPI" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI" fi if test "x$CURL_DISABLE_HTTP" != "x1"; then if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \ -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \ -o "x$DARWINSSL_ENABLED" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" if test "x$NTLM_WB_ENABLED" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB" fi fi fi if test "x$USE_TLS_SRP" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP" fi if test "x$USE_NGHTTP2" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2" fi AC_SUBST(SUPPORT_FEATURES) dnl For supported protocols in pkg-config file if test "x$CURL_DISABLE_HTTP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP" if test "x$SSL_ENABLED" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS" fi fi if test "x$CURL_DISABLE_FTP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP" if test "x$SSL_ENABLED" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS" fi fi if test "x$CURL_DISABLE_FILE" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE" fi if test "x$CURL_DISABLE_TELNET" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET" fi if test "x$CURL_DISABLE_LDAP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP" if test "x$CURL_DISABLE_LDAPS" != "x1"; then if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") || (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS" fi fi fi if test "x$CURL_DISABLE_DICT" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT" fi if test "x$CURL_DISABLE_TFTP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP" fi if test "x$CURL_DISABLE_GOPHER" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER" fi if test "x$CURL_DISABLE_POP3" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3" if test "x$SSL_ENABLED" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S" fi fi if test "x$CURL_DISABLE_IMAP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP" if test "x$SSL_ENABLED" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS" fi fi if test "x$CURL_DISABLE_SMTP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP" if test "x$SSL_ENABLED" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS" fi fi if test "x$USE_LIBSSH2" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP" SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" fi if test "x$CURL_DISABLE_RTSP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP" fi if test "x$USE_LIBRTMP" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP" fi dnl replace spaces with newlines dnl sort the lines dnl replace the newlines back to spaces SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '` AC_SUBST(SUPPORT_PROTOCOLS) dnl squeeze whitespace out of some variables squeeze CFLAGS squeeze CPPFLAGS squeeze DEFS squeeze LDFLAGS squeeze LIBS squeeze LIBCURL_LIBS squeeze CURL_NETWORK_LIBS squeeze CURL_NETWORK_AND_TIME_LIBS squeeze SUPPORT_FEATURES squeeze SUPPORT_PROTOCOLS XC_CHECK_BUILD_FLAGS if test "x$want_curldebug_assumed" = "xyes" && test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then ac_configure_args="$ac_configure_args --enable-curldebug" fi AC_CONFIG_FILES([Makefile \ docs/Makefile \ docs/examples/Makefile \ docs/libcurl/Makefile \ include/Makefile \ include/curl/Makefile \ src/Makefile \ lib/Makefile \ lib/libcurl.vers \ tests/Makefile \ tests/certs/Makefile \ tests/certs/scripts/Makefile \ tests/data/Makefile \ tests/server/Makefile \ tests/libtest/Makefile \ tests/unit/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/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 CURL_GENERATE_CONFIGUREHELP_PM XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples]) AC_MSG_NOTICE([Configured to build curl/libcurl: curl version: ${CURLVERSION} Host setup: ${host} Install prefix: ${prefix} Compiler: ${CC} SSL support: ${curl_ssl_msg} SSH support: ${curl_ssh_msg} zlib support: ${curl_zlib_msg} GSSAPI support: ${curl_gss_msg} SPNEGO support: ${curl_spnego_msg} TLS-SRP support: ${curl_tls_srp_msg} resolver: ${curl_res_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} --libcurl option: ${curl_libcurl_msg} Verbose errors: ${curl_verbose_msg} SSPI support: ${curl_sspi_msg} ca cert bundle: ${ca} ca cert path: ${capath} LDAP support: ${curl_ldap_msg} LDAPS support: ${curl_ldaps_msg} RTSP support: ${curl_rtsp_msg} RTMP support: ${curl_rtmp_msg} metalink support: ${curl_mtlnk_msg} HTTP2 support: ${curl_h2_msg} Protocols: ${SUPPORT_PROTOCOLS} ]) if test "x$soname_bump" = "xyes"; then cat < * Copyright (C) 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #include #include "urldata.h" #include "url.h" #include "progress.h" #include "multiif.h" #include "bundles.h" #include "sendf.h" #include "rawstr.h" #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" static void conn_llist_dtor(void *user, void *element) { struct connectdata *data = element; (void)user; data->bundle = NULL; } CURLcode Curl_bundle_create(struct SessionHandle *data, struct connectbundle **cb_ptr) { (void)data; DEBUGASSERT(*cb_ptr == NULL); *cb_ptr = malloc(sizeof(struct connectbundle)); if(!*cb_ptr) return CURLE_OUT_OF_MEMORY; (*cb_ptr)->num_connections = 0; (*cb_ptr)->server_supports_pipelining = FALSE; (*cb_ptr)->conn_list = Curl_llist_alloc((curl_llist_dtor) conn_llist_dtor); if(!(*cb_ptr)->conn_list) { Curl_safefree(*cb_ptr); return CURLE_OUT_OF_MEMORY; } return CURLE_OK; } void Curl_bundle_destroy(struct connectbundle *cb_ptr) { if(!cb_ptr) return; if(cb_ptr->conn_list) { Curl_llist_destroy(cb_ptr->conn_list, NULL); cb_ptr->conn_list = NULL; } Curl_safefree(cb_ptr); } /* Add a connection to a bundle */ CURLcode Curl_bundle_add_conn(struct connectbundle *cb_ptr, struct connectdata *conn) { if(!Curl_llist_insert_next(cb_ptr->conn_list, cb_ptr->conn_list->tail, conn)) return CURLE_OUT_OF_MEMORY; conn->bundle = cb_ptr; cb_ptr->num_connections++; return CURLE_OK; } /* Remove a connection from a bundle */ int Curl_bundle_remove_conn(struct connectbundle *cb_ptr, struct connectdata *conn) { struct curl_llist_element *curr; curr = cb_ptr->conn_list->head; while(curr) { if(curr->ptr == conn) { Curl_llist_remove(cb_ptr->conn_list, curr, NULL); cb_ptr->num_connections--; conn->bundle = NULL; return 1; /* we removed a handle */ } curr = curr->next; } return 0; } curl-7.35.0/lib/wildcard.h0000644000175000017500000000431712213173003012201 00000000000000#ifndef HEADER_CURL_WILDCARD_H #define HEADER_CURL_WILDCARD_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2010 - 2013, 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. * ***************************************************************************/ #include /* list of wildcard process states */ typedef enum { CURLWC_INIT = 0, CURLWC_MATCHING, /* library is trying to get list of addresses for downloading */ CURLWC_DOWNLOADING, CURLWC_CLEAN, /* deallocate resources and reset settings */ CURLWC_SKIP, /* skip over concrete file */ CURLWC_ERROR, /* error cases */ CURLWC_DONE /* if is wildcard->state == CURLWC_DONE wildcard loop will end */ } curl_wildcard_states; typedef void (*curl_wildcard_tmp_dtor)(void *ptr); /* struct keeping information about wildcard download process */ struct WildcardData { curl_wildcard_states state; char *path; /* path to the directory, where we trying wildcard-match */ char *pattern; /* wildcard pattern */ struct curl_llist *filelist; /* llist with struct Curl_fileinfo */ void *tmp; /* pointer to protocol specific temporary data */ curl_wildcard_tmp_dtor tmp_dtor; void *customptr; /* for CURLOPT_CHUNK_DATA pointer */ }; CURLcode Curl_wildcard_init(struct WildcardData *wc); void Curl_wildcard_dtor(struct WildcardData *wc); struct SessionHandle; #endif /* HEADER_CURL_WILDCARD_H */ curl-7.35.0/lib/timeval.h0000644000175000017500000000402212213173003012042 00000000000000#ifndef HEADER_CURL_TIMEVAL_H #define HEADER_CURL_TIMEVAL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2007, 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. * ***************************************************************************/ /* * 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 "curl_setup.h" 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 /* HEADER_CURL_TIMEVAL_H */ curl-7.35.0/lib/setup-os400.h0000644000175000017500000002507712262353672012441 00000000000000#ifndef HEADER_CURL_SETUP_OS400_H #define HEADER_CURL_SETUP_OS400_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* OS/400 netdb.h does not define NI_MAXHOST. */ #define NI_MAXHOST 1025 /* OS/400 netdb.h does not define NI_MAXSERV. */ #define NI_MAXSERV 32 /* No OS/400 header file defines u_int32_t. */ typedef unsigned long u_int32_t; /* System API wrapper prototypes & definitions to support ASCII parameters. */ #include #include #include #include #include #include extern int Curl_getaddrinfo_a(const char * nodename, const char * servname, const struct addrinfo * hints, struct addrinfo * * res); #define getaddrinfo Curl_getaddrinfo_a extern int Curl_getnameinfo_a(const struct sockaddr * sa, curl_socklen_t salen, char * nodename, curl_socklen_t nodenamelen, char * servname, curl_socklen_t servnamelen, int flags); #define getnameinfo Curl_getnameinfo_a /* SSL wrappers. */ extern int Curl_SSL_Init_Application_a(SSLInitApp * init_app); #define SSL_Init_Application Curl_SSL_Init_Application_a extern int Curl_SSL_Init_a(SSLInit * init); #define SSL_Init Curl_SSL_Init_a extern char * Curl_SSL_Strerror_a(int sslreturnvalue, SSLErrorMsg * serrmsgp); #define SSL_Strerror Curl_SSL_Strerror_a /* GSKit wrappers. */ extern int Curl_gsk_environment_open(gsk_handle * my_env_handle); #define gsk_environment_open Curl_gsk_environment_open extern int Curl_gsk_secure_soc_open(gsk_handle my_env_handle, gsk_handle * my_session_handle); #define gsk_secure_soc_open Curl_gsk_secure_soc_open extern int Curl_gsk_environment_close(gsk_handle * my_env_handle); #define gsk_environment_close Curl_gsk_environment_close extern int Curl_gsk_secure_soc_close(gsk_handle * my_session_handle); #define gsk_secure_soc_close Curl_gsk_secure_soc_close extern int Curl_gsk_environment_init(gsk_handle my_env_handle); #define gsk_environment_init Curl_gsk_environment_init extern int Curl_gsk_secure_soc_init(gsk_handle my_session_handle); #define gsk_secure_soc_init Curl_gsk_secure_soc_init extern int Curl_gsk_attribute_set_buffer_a(gsk_handle my_gsk_handle, GSK_BUF_ID bufID, const char * buffer, int bufSize); #define gsk_attribute_set_buffer Curl_gsk_attribute_set_buffer_a extern int Curl_gsk_attribute_set_enum(gsk_handle my_gsk_handle, GSK_ENUM_ID enumID, GSK_ENUM_VALUE enumValue); #define gsk_attribute_set_enum Curl_gsk_attribute_set_enum extern int Curl_gsk_attribute_set_numeric_value(gsk_handle my_gsk_handle, GSK_NUM_ID numID, int numValue); #define gsk_attribute_set_numeric_value Curl_gsk_attribute_set_numeric_value extern int Curl_gsk_attribute_set_callback(gsk_handle my_gsk_handle, GSK_CALLBACK_ID callBackID, void * callBackAreaPtr); #define gsk_attribute_set_callback Curl_gsk_attribute_set_callback extern int Curl_gsk_attribute_get_buffer_a(gsk_handle my_gsk_handle, GSK_BUF_ID bufID, const char * * buffer, int * bufSize); #define gsk_attribute_get_buffer Curl_gsk_attribute_get_buffer_a extern int Curl_gsk_attribute_get_enum(gsk_handle my_gsk_handle, GSK_ENUM_ID enumID, GSK_ENUM_VALUE * enumValue); #define gsk_attribute_get_enum Curl_gsk_attribute_get_enum extern int Curl_gsk_attribute_get_numeric_value(gsk_handle my_gsk_handle, GSK_NUM_ID numID, int * numValue); #define gsk_attribute_get_numeric_value Curl_gsk_attribute_get_numeric_value extern int Curl_gsk_attribute_get_cert_info(gsk_handle my_gsk_handle, GSK_CERT_ID certID, const gsk_cert_data_elem * * certDataElem, int * certDataElementCount); #define gsk_attribute_get_cert_info Curl_gsk_attribute_get_cert_info extern int Curl_gsk_secure_soc_misc(gsk_handle my_session_handle, GSK_MISC_ID miscID); #define gsk_secure_soc_misc Curl_gsk_secure_soc_misc extern int Curl_gsk_secure_soc_read(gsk_handle my_session_handle, char * readBuffer, int readBufSize, int * amtRead); #define gsk_secure_soc_read Curl_gsk_secure_soc_read extern int Curl_gsk_secure_soc_write(gsk_handle my_session_handle, char * writeBuffer, int writeBufSize, int * amtWritten); #define gsk_secure_soc_write Curl_gsk_secure_soc_write extern const char * Curl_gsk_strerror_a(int gsk_return_value); #define gsk_strerror Curl_gsk_strerror_a extern int Curl_gsk_secure_soc_startInit(gsk_handle my_session_handle, int IOCompletionPort, Qso_OverlappedIO_t * communicationsArea); #define gsk_secure_soc_startInit Curl_gsk_secure_soc_startInit /* GSSAPI wrappers. */ extern OM_uint32 Curl_gss_import_name_a(OM_uint32 * minor_status, gss_buffer_t in_name, gss_OID in_name_type, gss_name_t * out_name); #define gss_import_name Curl_gss_import_name_a extern OM_uint32 Curl_gss_display_status_a(OM_uint32 * minor_status, OM_uint32 status_value, int status_type, gss_OID mech_type, gss_msg_ctx_t * message_context, gss_buffer_t status_string); #define gss_display_status Curl_gss_display_status_a extern OM_uint32 Curl_gss_init_sec_context_a(OM_uint32 * minor_status, gss_cred_id_t cred_handle, gss_ctx_id_t * context_handle, gss_name_t target_name, gss_OID mech_type, gss_flags_t req_flags, OM_uint32 time_req, gss_channel_bindings_t input_chan_bindings, gss_buffer_t input_token, gss_OID * actual_mech_type, gss_buffer_t output_token, gss_flags_t * ret_flags, OM_uint32 * time_rec); #define gss_init_sec_context Curl_gss_init_sec_context_a extern OM_uint32 Curl_gss_delete_sec_context_a(OM_uint32 * minor_status, gss_ctx_id_t * context_handle, gss_buffer_t output_token); #define gss_delete_sec_context Curl_gss_delete_sec_context_a /* LDAP wrappers. */ #define BerValue struct berval #define ldap_url_parse ldap_url_parse_utf8 #define ldap_init Curl_ldap_init_a #define ldap_simple_bind_s Curl_ldap_simple_bind_s_a #define ldap_search_s Curl_ldap_search_s_a #define ldap_get_values_len Curl_ldap_get_values_len_a #define ldap_err2string Curl_ldap_err2string_a #define ldap_get_dn Curl_ldap_get_dn_a #define ldap_first_attribute Curl_ldap_first_attribute_a #define ldap_next_attribute Curl_ldap_next_attribute_a /* Some socket functions must be wrapped to process textual addresses like AF_UNIX. */ extern int Curl_os400_connect(int sd, struct sockaddr * destaddr, int addrlen); extern int Curl_os400_bind(int sd, struct sockaddr * localaddr, int addrlen); extern int Curl_os400_sendto(int sd, char * buffer, int buflen, int flags, struct sockaddr * dstaddr, int addrlen); extern int Curl_os400_recvfrom(int sd, char * buffer, int buflen, int flags, struct sockaddr * fromaddr, int * addrlen); #define connect Curl_os400_connect #define bind Curl_os400_bind #define sendto Curl_os400_sendto #define recvfrom Curl_os400_recvfrom #ifdef HAVE_LIBZ #define zlibVersion Curl_os400_zlibVersion #define inflateInit_ Curl_os400_inflateInit_ #define inflateInit2_ Curl_os400_inflateInit2_ #define inflate Curl_os400_inflate #define inflateEnd Curl_os400_inflateEnd #endif #endif /* HEADER_CURL_SETUP_OS400_H */ curl-7.35.0/lib/easy.c0000644000175000017500000007656712262353672011404 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" /* * See comment in curl_memory.h for the explanation of this sanity check. */ #ifdef CURLX_NO_MEMORY_CALLBACKS #error "libcurl shall not ever be built with CURLX_NO_MEMORY_CALLBACKS defined" #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_SYS_PARAM_H #include #endif #include "strequal.h" #include "urldata.h" #include #include "transfer.h" #include "vtls/vtls.h" #include "url.h" #include "getinfo.h" #include "hostip.h" #include "share.h" #include "strdup.h" #include "curl_memory.h" #include "progress.h" #include "easyif.h" #include "select.h" #include "sendf.h" /* for failf function prototype */ #include "curl_ntlm.h" #include "connect.h" /* for Curl_getconnectinfo */ #include "slist.h" #include "amigaos.h" #include "non-ascii.h" #include "warnless.h" #include "conncache.h" #include "multiif.h" #include "sigpipe.h" #define _MPRINTF_REPLACE /* use our functions only */ #include /* The last #include file should be: */ #include "memdebug.h" /* win32_cleanup() is for win32 socket cleanup functionality, the opposite of win32_init() */ static void win32_cleanup(void) { #ifdef USE_WINSOCK WSACleanup(); #endif #ifdef USE_WINDOWS_SSPI Curl_sspi_global_cleanup(); #endif } /* win32_init() performs win32 socket initialization to properly setup the stack to allow networking */ static CURLcode win32_init(void) { #ifdef USE_WINSOCK WORD wVersionRequested; WSADATA wsaData; int res; #if defined(ENABLE_IPV6) && (USE_WINSOCK < 2) Error IPV6_requires_winsock2 #endif wVersionRequested = MAKEWORD(USE_WINSOCK, USE_WINSOCK); res = WSAStartup(wVersionRequested, &wsaData); if(res != 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. */ #elif defined(USE_LWIPSOCK) lwip_init(); #endif #ifdef USE_WINDOWS_SSPI { CURLcode err = Curl_sspi_global_init(); if(err != CURLE_OK) return err; } #endif return CURLE_OK; } #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 defined(_MSC_VER) && defined(_DLL) && !defined(__POCC__) # pragma warning(disable:4232) /* MSVC extension, dllimport identity */ #endif #ifndef __SYMBIAN32__ /* * 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; #if defined(WIN32) && defined(UNICODE) curl_wcsdup_callback Curl_cwcsdup = (curl_wcsdup_callback)_wcsdup; #endif #else /* * Symbian OS doesn't support initialization to code in writeable static data. * Initialization will occur in the curl_global_init() call. */ curl_malloc_callback Curl_cmalloc; curl_free_callback Curl_cfree; curl_realloc_callback Curl_crealloc; curl_strdup_callback Curl_cstrdup; curl_calloc_callback Curl_ccalloc; #endif #if defined(_MSC_VER) && defined(_DLL) && !defined(__POCC__) # pragma warning(default:4232) /* MSVC extension, dllimport identity */ #endif /** * 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 defined(WIN32) && defined(UNICODE) Curl_cwcsdup = (curl_wcsdup_callback)_wcsdup; #endif if(flags & CURL_GLOBAL_SSL) if(!Curl_ssl_init()) { DEBUGF(fprintf(stderr, "Error: Curl_ssl_init failed\n")); return CURLE_FAILED_INIT; } if(flags & CURL_GLOBAL_WIN32) if(win32_init() != CURLE_OK) { DEBUGF(fprintf(stderr, "Error: win32_init failed\n")); return CURLE_FAILED_INIT; } #ifdef __AMIGA__ if(!Curl_amiga_init()) { DEBUGF(fprintf(stderr, "Error: Curl_amiga_init failed\n")); return CURLE_FAILED_INIT; } #endif #ifdef NETWARE if(netware_init()) { DEBUGF(fprintf(stderr, "Warning: LONG namespace not available\n")); } #endif #ifdef USE_LIBIDN idna_init(); #endif if(Curl_resolver_global_init() != CURLE_OK) { DEBUGF(fprintf(stderr, "Error: resolver_global_init failed\n")); return CURLE_FAILED_INIT; } #if defined(USE_LIBSSH2) && defined(HAVE_LIBSSH2_INIT) if(libssh2_init(0)) { DEBUGF(fprintf(stderr, "Error: libssh2_init failed\n")); return CURLE_FAILED_INIT; } #endif if(flags & CURL_GLOBAL_ACK_EINTR) Curl_ack_eintr = 1; 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(); Curl_resolver_global_cleanup(); if(init_flags & CURL_GLOBAL_WIN32) win32_cleanup(); Curl_amiga_cleanup(); #if defined(USE_LIBSSH2) && defined(HAVE_LIBSSH2_EXIT) (void)libssh2_exit(); #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 */ DEBUGF(fprintf(stderr, "Error: curl_global_init failed\n")); return NULL; } } /* We use curl_open() with undefined URL so far */ res = Curl_open(&data); if(res != CURLE_OK) { DEBUGF(fprintf(stderr, "Error: Curl_open failed\n")); return NULL; } return data; } /* * curl_easy_setopt() is the external interface for setting options on an * easy handle. */ #undef curl_easy_setopt 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 CURLDEBUG struct socketmonitor { struct socketmonitor *next; /* the next node in the list or NULL */ struct pollfd socket; /* socket info of what to monitor */ }; struct events { long ms; /* timeout, run the timeout function when reached */ bool msbump; /* set TRUE when timeout is set by callback */ int num_sockets; /* number of nodes in the monitor list */ struct socketmonitor *list; /* list of sockets to monitor */ int running_handles; /* store the returned number */ }; /* events_timer * * Callback that gets called with a new value when the timeout should be * updated. */ static int events_timer(CURLM *multi, /* multi handle */ long timeout_ms, /* see above */ void *userp) /* private callback pointer */ { struct events *ev = userp; (void)multi; if(timeout_ms == -1) /* timeout removed */ timeout_ms = 0; else if(timeout_ms == 0) /* timeout is already reached! */ timeout_ms = 1; /* trigger asap */ ev->ms = timeout_ms; ev->msbump = TRUE; return 0; } /* poll2cselect * * convert from poll() bit definitions to libcurl's CURL_CSELECT_* ones */ static int poll2cselect(int pollmask) { int omask=0; if(pollmask & POLLIN) omask |= CURL_CSELECT_IN; if(pollmask & POLLOUT) omask |= CURL_CSELECT_OUT; if(pollmask & POLLERR) omask |= CURL_CSELECT_ERR; return omask; } /* socketcb2poll * * convert from libcurl' CURL_POLL_* bit definitions to poll()'s */ static short socketcb2poll(int pollmask) { short omask=0; if(pollmask & CURL_POLL_IN) omask |= POLLIN; if(pollmask & CURL_POLL_OUT) omask |= POLLOUT; return omask; } /* events_socket * * Callback that gets called with information about socket activity to * monitor. */ static int events_socket(CURL *easy, /* easy handle */ curl_socket_t s, /* socket */ int what, /* see above */ void *userp, /* private callback pointer */ void *socketp) /* private socket pointer */ { struct events *ev = userp; struct socketmonitor *m; struct socketmonitor *prev=NULL; (void)socketp; m = ev->list; while(m) { if(m->socket.fd == s) { if(what == CURL_POLL_REMOVE) { struct socketmonitor *nxt = m->next; /* remove this node from the list of monitored sockets */ if(prev) prev->next = nxt; else ev->list = nxt; free(m); m = nxt; infof(easy, "socket cb: socket %d REMOVED\n", s); } else { /* The socket 's' is already being monitored, update the activity mask. Convert from libcurl bitmask to the poll one. */ m->socket.events = socketcb2poll(what); infof(easy, "socket cb: socket %d UPDATED as %s%s\n", s, what&CURL_POLL_IN?"IN":"", what&CURL_POLL_OUT?"OUT":""); } break; } prev = m; m = m->next; /* move to next node */ } if(!m) { if(what == CURL_POLL_REMOVE) { /* this happens a bit too often, libcurl fix perhaps? */ /* fprintf(stderr, "%s: socket %d asked to be REMOVED but not present!\n", __func__, s); */ } else { m = malloc(sizeof(struct socketmonitor)); m->next = ev->list; m->socket.fd = s; m->socket.events = socketcb2poll(what); m->socket.revents = 0; ev->list = m; infof(easy, "socket cb: socket %d ADDED as %s%s\n", s, what&CURL_POLL_IN?"IN":"", what&CURL_POLL_OUT?"OUT":""); } } return 0; } /* * events_setup() * * Do the multi handle setups that only event-based transfers need. */ static void events_setup(CURLM *multi, struct events *ev) { /* timer callback */ curl_multi_setopt(multi, CURLMOPT_TIMERFUNCTION, events_timer); curl_multi_setopt(multi, CURLMOPT_TIMERDATA, ev); /* socket callback */ curl_multi_setopt(multi, CURLMOPT_SOCKETFUNCTION, events_socket); curl_multi_setopt(multi, CURLMOPT_SOCKETDATA, ev); } /* wait_or_timeout() * * waits for activity on any of the given sockets, or the timeout to trigger. */ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) { bool done = FALSE; CURLMcode mcode; CURLcode rc = CURLE_OK; while(!done) { CURLMsg *msg; struct socketmonitor *m; struct pollfd *f; struct pollfd fds[4]; int numfds=0; int pollrc; int i; struct timeval before; struct timeval after; /* populate the fds[] array */ for(m = ev->list, f=&fds[0]; m; m = m->next) { f->fd = m->socket.fd; f->events = m->socket.events; f->revents = 0; /* fprintf(stderr, "poll() %d check socket %d\n", numfds, f->fd); */ f++; numfds++; } /* get the time stamp to use to figure out how long poll takes */ before = curlx_tvnow(); /* wait for activity or timeout */ pollrc = Curl_poll(fds, numfds, (int)ev->ms); after = curlx_tvnow(); ev->msbump = FALSE; /* reset here */ if(0 == pollrc) { /* timeout! */ ev->ms = 0; /* fprintf(stderr, "call curl_multi_socket_action( TIMEOUT )\n"); */ mcode = curl_multi_socket_action(multi, CURL_SOCKET_TIMEOUT, 0, &ev->running_handles); } else if(pollrc > 0) { /* loop over the monitored sockets to see which ones had activity */ for(i = 0; i< numfds; i++) { if(fds[i].revents) { /* socket activity, tell libcurl */ int act = poll2cselect(fds[i].revents); /* convert */ infof(multi->easyp, "call curl_multi_socket_action( socket %d )\n", fds[i].fd); mcode = curl_multi_socket_action(multi, fds[i].fd, act, &ev->running_handles); } } if(!ev->msbump) /* If nothing updated the timeout, we decrease it by the spent time. * If it was updated, it has the new timeout time stored already. */ ev->ms += curlx_tvdiff(after, before); } if(mcode) return CURLE_URL_MALFORMAT; /* TODO: return a proper error! */ /* we don't really care about the "msgs_in_queue" value returned in the second argument */ msg = curl_multi_info_read(multi, &pollrc); if(msg) { rc = msg->data.result; done = TRUE; } } return rc; } /* easy_events() * * Runs a transfer in a blocking manner using the events-based API */ static CURLcode easy_events(CURLM *multi) { struct events evs= {2, FALSE, 0, NULL, 0}; /* if running event-based, do some further multi inits */ events_setup(multi, &evs); return wait_or_timeout(multi, &evs); } #else /* CURLDEBUG */ /* when not built with debug, this function doesn't exist */ #define easy_events(x) CURLE_NOT_BUILT_IN #endif static CURLcode easy_transfer(CURLM *multi) { bool done = FALSE; CURLMcode mcode = CURLM_OK; CURLcode code = CURLE_OK; struct timeval before; int without_fds = 0; /* count number of consecutive returns from curl_multi_wait() without any filedescriptors */ while(!done && !mcode) { int still_running; int ret; before = curlx_tvnow(); mcode = curl_multi_wait(multi, NULL, 0, 1000, &ret); if(mcode == CURLM_OK) { if(ret == -1) { /* poll() failed not on EINTR, indicate a network problem */ code = CURLE_RECV_ERROR; break; } else if(ret == 0) { struct timeval after = curlx_tvnow(); /* If it returns without any filedescriptor instantly, we need to avoid busy-looping during periods where it has nothing particular to wait for */ if(curlx_tvdiff(after, before) <= 10) { without_fds++; if(without_fds > 2) { int sleep_ms = without_fds < 10 ? (1 << (without_fds-1)): 1000; Curl_wait_ms(sleep_ms); } } else /* it wasn't "instant", restart counter */ without_fds = 0; } else /* got file descriptor, restart counter */ without_fds = 0; mcode = curl_multi_perform(multi, &still_running); } /* only read 'still_running' if curl_multi_perform() return OK */ if((mcode == CURLM_OK) && !still_running) { int rc; CURLMsg *msg = curl_multi_info_read(multi, &rc); if(msg) { code = msg->data.result; done = TRUE; } } } return code; } /* * easy_perform() is the external interface that performs a blocking * transfer as previously setup. * * CONCEPT: This function 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. * * REALITY: it can't just create and destroy the multi handle that easily. It * needs to keep it around since if this easy handle is used again by this * function, the same multi handle must be re-used so that the same pools and * caches can be used. * * DEBUG: if 'events' is set TRUE, this function will use a replacement engine * instead of curl_multi_perform() and use curl_multi_socket_action(). */ static CURLcode easy_perform(struct SessionHandle *data, bool events) { CURLM *multi; CURLMcode mcode; CURLcode code = CURLE_OK; SIGPIPE_VARIABLE(pipe_st); if(!data) return CURLE_BAD_FUNCTION_ARGUMENT; if(data->multi) { failf(data, "easy handled already used in multi handle"); return CURLE_FAILED_INIT; } if(data->multi_easy) multi = data->multi_easy; else { /* this multi handle will only ever have a single easy handled attached to it, so make it use minimal hashes */ multi = Curl_multi_handle(1, 3); if(!multi) return CURLE_OUT_OF_MEMORY; data->multi_easy = multi; } /* Copy the MAXCONNECTS option to the multi handle */ curl_multi_setopt(multi, CURLMOPT_MAXCONNECTS, data->set.maxconnects); mcode = curl_multi_add_handle(multi, data); if(mcode) { curl_multi_cleanup(multi); if(mcode == CURLM_OUT_OF_MEMORY) return CURLE_OUT_OF_MEMORY; else return CURLE_FAILED_INIT; } sigpipe_ignore(data, &pipe_st); /* assign this after curl_multi_add_handle() since that function checks for it and rejects this handle otherwise */ data->multi = multi; /* run the transfer */ code = events ? easy_events(multi) : easy_transfer(multi); /* ignoring the return code isn't nice, but atm we can't really handle a failure here, room for future improvement! */ (void)curl_multi_remove_handle(multi, data); sigpipe_restore(&pipe_st); /* The multi handle is kept alive, owned by the easy handle */ return code; } /* * curl_easy_perform() is the external interface that performs a blocking * transfer as previously setup. */ CURLcode curl_easy_perform(CURL *easy) { return easy_perform(easy, FALSE); } #ifdef CURLDEBUG /* * curl_easy_perform_ev() is the external interface that performs a blocking * transfer using the event-based API internally. */ CURLcode curl_easy_perform_ev(CURL *easy) { return easy_perform(easy, TRUE); } #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; SIGPIPE_VARIABLE(pipe_st); if(!data) return; sigpipe_ignore(data, &pipe_st); Curl_close(data); sigpipe_restore(&pipe_st); } /* * curl_easy_getinfo() is an external interface that allows an app to retrieve * information from a performed transfer and similar. */ #undef curl_easy_getinfo CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...) { va_list arg; void *paramp; CURLcode ret; struct SessionHandle *data = (struct SessionHandle *)curl; va_start(arg, info); paramp = va_arg(arg, void *); ret = Curl_getinfo(data, info, paramp); va_end(arg); return ret; } /* * 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) { struct SessionHandle *data=(struct SessionHandle *)incurl; struct SessionHandle *outcurl = calloc(1, sizeof(struct SessionHandle)); if(NULL == outcurl) goto fail; /* * 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 = malloc(HEADERSIZE); if(!outcurl->state.headerbuff) goto fail; outcurl->state.headersize = HEADERSIZE; /* copy all userdefined values */ if(Curl_dupset(outcurl, data) != CURLE_OK) goto fail; /* the connection cache is setup on demand */ outcurl->state.conn_cache = NULL; outcurl->state.lastconnect = NULL; outcurl->progress.flags = data->progress.flags; outcurl->progress.callback = data->progress.callback; 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) goto fail; } /* duplicate all values in 'change' */ if(data->change.cookielist) { outcurl->change.cookielist = Curl_slist_duplicate(data->change.cookielist); if(!outcurl->change.cookielist) goto fail; } if(data->change.url) { outcurl->change.url = strdup(data->change.url); if(!outcurl->change.url) goto fail; outcurl->change.url_alloc = TRUE; } if(data->change.referer) { outcurl->change.referer = strdup(data->change.referer); if(!outcurl->change.referer) goto fail; outcurl->change.referer_alloc = TRUE; } /* Clone the resolver handle, if present, for the new handle */ if(Curl_resolver_duphandle(&outcurl->state.resolver, data->state.resolver) != CURLE_OK) goto fail; Curl_convert_setup(outcurl); outcurl->magic = CURLEASY_MAGIC_NUMBER; /* we reach this point and thus we are OK */ return outcurl; fail: if(outcurl) { curl_slist_free_all(outcurl->change.cookielist); outcurl->change.cookielist = NULL; Curl_safefree(outcurl->state.headerbuff); Curl_safefree(outcurl->change.url); Curl_safefree(outcurl->change.referer); Curl_freeset(outcurl); free(outcurl); } return NULL; } /* * 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->state.pathbuffer); data->state.path = NULL; Curl_free_request_state(data); /* zero out UserDefined data: */ Curl_freeset(data); memset(&data->set, 0, sizeof(struct UserDefined)); (void)Curl_init_userdefined(&data->set); /* zero out Progress data: */ memset(&data->progress, 0, sizeof(struct Progress)); data->progress.flags |= PGRS_HIDE; data->state.current_speed = -1; /* init to negative == impossible */ } /* * curl_easy_pause() allows an application to pause or unpause a specific * transfer and direction. This function sets the full new state for the * current connection this easy handle operates on. * * NOTE: if you have the receiving paused and you call this function to remove * the pausing, you may get your write callback called at this point. * * Action is a bitmask consisting of CURLPAUSE_* bits in curl/curl.h */ CURLcode curl_easy_pause(CURL *curl, int action) { struct SessionHandle *data = (struct SessionHandle *)curl; struct SingleRequest *k = &data->req; CURLcode result = CURLE_OK; /* first switch off both pause bits */ int newstate = k->keepon &~ (KEEP_RECV_PAUSE| KEEP_SEND_PAUSE); /* set the new desired pause bits */ newstate |= ((action & CURLPAUSE_RECV)?KEEP_RECV_PAUSE:0) | ((action & CURLPAUSE_SEND)?KEEP_SEND_PAUSE:0); /* put it back in the keepon */ k->keepon = newstate; if(!(newstate & KEEP_RECV_PAUSE) && data->state.tempwrite) { /* we have a buffer for sending that we now seem to be able to deliver since the receive pausing is lifted! */ /* get the pointer, type and length in local copies since the function may return PAUSE again and then we'll get a new copy allocted and stored in the tempwrite variables */ char *tempwrite = data->state.tempwrite; char *freewrite = tempwrite; /* store this pointer to free it later */ size_t tempsize = data->state.tempwritesize; int temptype = data->state.tempwritetype; size_t chunklen; /* clear tempwrite here just to make sure it gets cleared if there's no further use of it, and make sure we don't clear it after the function invoke as it may have been set to a new value by then */ data->state.tempwrite = NULL; /* since the write callback API is define to never exceed CURL_MAX_WRITE_SIZE bytes in a single call, and since we may in fact have more data than that in our buffer here, we must loop sending the data in multiple calls until there's no data left or we get another pause returned. A tricky part is that the function we call will "buffer" the data itself when it pauses on a particular buffer, so we may need to do some extra trickery if we get a pause return here. */ do { chunklen = (tempsize > CURL_MAX_WRITE_SIZE)?CURL_MAX_WRITE_SIZE:tempsize; result = Curl_client_write(data->easy_conn, temptype, tempwrite, chunklen); if(result) /* failures abort the loop at once */ break; if(data->state.tempwrite && (tempsize - chunklen)) { /* Ouch, the reading is again paused and the block we send is now "cached". If this is the final chunk we can leave it like this, but if we have more chunks that are cached after this, we need to free the newly cached one and put back a version that is truly the entire contents that is saved for later */ char *newptr; /* note that tempsize is still the size as before the callback was used, and thus the whole piece of data to keep */ newptr = realloc(data->state.tempwrite, tempsize); if(!newptr) { free(data->state.tempwrite); /* free old area */ data->state.tempwrite = NULL; result = CURLE_OUT_OF_MEMORY; /* tempwrite will be freed further down */ break; } data->state.tempwrite = newptr; /* store new pointer */ memcpy(newptr, tempwrite, tempsize); data->state.tempwritesize = tempsize; /* store new size */ /* tempwrite will be freed further down */ break; /* go back to pausing until further notice */ } else { tempsize -= chunklen; /* left after the call above */ tempwrite += chunklen; /* advance the pointer */ } } while((result == CURLE_OK) && tempsize); free(freewrite); /* this is unconditionally no longer used */ } /* if there's no error and we're not pausing both directions, we want to have this handle checked soon */ if(!result && ((newstate&(KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) != (KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) ) Curl_expire(data, 1); /* get this handle going again */ return result; } static CURLcode easy_connection(struct SessionHandle *data, curl_socket_t *sfd, struct connectdata **connp) { if(data == NULL) return CURLE_BAD_FUNCTION_ARGUMENT; /* only allow these to be called on handles with CURLOPT_CONNECT_ONLY */ if(!data->set.connect_only) { failf(data, "CONNECT_ONLY is required!"); return CURLE_UNSUPPORTED_PROTOCOL; } *sfd = Curl_getconnectinfo(data, connp); if(*sfd == CURL_SOCKET_BAD) { failf(data, "Failed to get recent socket"); return CURLE_UNSUPPORTED_PROTOCOL; } return CURLE_OK; } /* * Receives data from the connected socket. Use after successful * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. * Returns CURLE_OK on success, error code on error. */ CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, size_t *n) { curl_socket_t sfd; CURLcode ret; ssize_t n1; struct connectdata *c; struct SessionHandle *data = (struct SessionHandle *)curl; ret = easy_connection(data, &sfd, &c); if(ret) return ret; *n = 0; ret = Curl_read(c, sfd, buffer, buflen, &n1); if(ret != CURLE_OK) return ret; *n = (size_t)n1; return CURLE_OK; } /* * Sends data over the connected socket. Use after successful * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. */ CURLcode curl_easy_send(CURL *curl, const void *buffer, size_t buflen, size_t *n) { curl_socket_t sfd; CURLcode ret; ssize_t n1; struct connectdata *c = NULL; struct SessionHandle *data = (struct SessionHandle *)curl; ret = easy_connection(data, &sfd, &c); if(ret) return ret; *n = 0; ret = Curl_write(c, sfd, buffer, buflen, &n1); if(n1 == -1) return CURLE_SEND_ERROR; /* detect EAGAIN */ if((CURLE_OK == ret) && (0 == n1)) return CURLE_AGAIN; *n = (size_t)n1; return ret; } curl-7.35.0/lib/curl_setup.h0000644000175000017500000004221712270035364012610 00000000000000#ifndef HEADER_CURL_SETUP_H #define HEADER_CURL_SETUP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* * Define WIN32 when build target is Win32 API */ #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) && \ !defined(__SYMBIAN32__) #define WIN32 #endif /* * Include configuration script results or hand-crafted * configuration file for platforms which lack config tool. */ #ifdef HAVE_CONFIG_H #include "curl_config.h" #else /* HAVE_CONFIG_H */ #ifdef _WIN32_WCE # include "config-win32ce.h" #else # ifdef WIN32 # include "config-win32.h" # endif #endif #if defined(macintosh) && defined(__MRC__) # include "config-mac.h" #endif #ifdef __riscos__ # include "config-riscos.h" #endif #ifdef __AMIGA__ # include "config-amigaos.h" #endif #ifdef __SYMBIAN32__ # include "config-symbian.h" #endif #ifdef __OS400__ # include "config-os400.h" #endif #ifdef TPF # include "config-tpf.h" #endif #ifdef __VXWORKS__ # include "config-vxworks.h" #endif #endif /* HAVE_CONFIG_H */ /* ================================================================ */ /* Definition of preprocessor macros/symbols which modify compiler */ /* behavior or generated code characteristics must be done here, */ /* as appropriate, before any system header file is included. It is */ /* also possible to have them defined in the config file included */ /* before this point. As a result of all this we frown inclusion of */ /* system header files in our config files, avoid this at any cost. */ /* ================================================================ */ /* * AIX 4.3 and newer needs _THREAD_SAFE defined to build * proper reentrant code. Others may also need it. */ #ifdef NEED_THREAD_SAFE # ifndef _THREAD_SAFE # define _THREAD_SAFE # endif #endif /* * Tru64 needs _REENTRANT set for a few function prototypes and * things to appear in the system header files. Unixware needs it * to build proper reentrant code. Others may also need it. */ #ifdef NEED_REENTRANT # ifndef _REENTRANT # define _REENTRANT # endif #endif /* ================================================================ */ /* If you need to include a system header file for your platform, */ /* please, do it beyond the point further indicated in this file. */ /* ================================================================ */ /* * libcurl's external interface definitions are also used internally, * and might also include required system header files to define them. */ #include /* * Compile time sanity checks must also be done when building the library. */ #include /* * Ensure that no one is using the old SIZEOF_CURL_OFF_T macro */ #ifdef SIZEOF_CURL_OFF_T # error "SIZEOF_CURL_OFF_T shall not be defined!" Error Compilation_aborted_SIZEOF_CURL_OFF_T_shall_not_be_defined #endif /* * Disable other protocols when http is the only one desired. */ #ifdef HTTP_ONLY # ifndef CURL_DISABLE_TFTP # define CURL_DISABLE_TFTP # endif # ifndef CURL_DISABLE_FTP # define CURL_DISABLE_FTP # endif # ifndef CURL_DISABLE_LDAP # define CURL_DISABLE_LDAP # endif # ifndef CURL_DISABLE_TELNET # define CURL_DISABLE_TELNET # endif # ifndef CURL_DISABLE_DICT # define CURL_DISABLE_DICT # endif # ifndef CURL_DISABLE_FILE # define CURL_DISABLE_FILE # endif # ifndef CURL_DISABLE_RTSP # define CURL_DISABLE_RTSP # endif # ifndef CURL_DISABLE_POP3 # define CURL_DISABLE_POP3 # endif # ifndef CURL_DISABLE_IMAP # define CURL_DISABLE_IMAP # endif # ifndef CURL_DISABLE_SMTP # define CURL_DISABLE_SMTP # endif # ifndef CURL_DISABLE_RTSP # define CURL_DISABLE_RTSP # endif # ifndef CURL_DISABLE_RTMP # define CURL_DISABLE_RTMP # endif # ifndef CURL_DISABLE_GOPHER # define CURL_DISABLE_GOPHER # endif #endif /* * When http is disabled rtsp is not supported. */ #if defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_RTSP) # define CURL_DISABLE_RTSP #endif /* ================================================================ */ /* No system header file shall be included in this file before this */ /* point. The only allowed ones are those included from curlbuild.h */ /* ================================================================ */ /* * OS/400 setup file includes some system headers. */ #ifdef __OS400__ # include "setup-os400.h" #endif /* * VMS setup file includes some system headers. */ #ifdef __VMS # include "setup-vms.h" #endif /* * Include header files for windows builds before redefining anything. * Use this preprocessor 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 independent 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 # if defined(UNICODE) && !defined(_UNICODE) # define _UNICODE # endif # if defined(_UNICODE) && !defined(UNICODE) # define UNICODE # endif # 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 # ifdef UNICODE typedef wchar_t *(*curl_wcsdup_callback)(const wchar_t *str); # 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 #ifdef USE_LWIPSOCK # include # include # include #endif #ifdef HAVE_EXTRA_STRICMP_H # include #endif #ifdef HAVE_EXTRA_STRDUP_H # include #endif #ifdef TPF # 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 */ /* change which select is used for libcurl */ # define select(a,b,c,d,e) tpf_select_libcurl(a,b,c,d,e) #endif #ifdef __VXWORKS__ # include /* for generic BSD socket functions */ # include /* for basic I/O interface functions */ #endif #ifdef __AMIGA__ # ifndef __ixemul__ # include # include # include # include # define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0) # endif #endif #include #ifdef HAVE_ASSERT_H #include #endif #ifdef __TANDEM /* for nsr-tandem-nsk systems */ #include #endif #ifndef STDC_HEADERS /* no standard C headers! */ #include #endif #ifdef __POCC__ # include # include # define sys_nerr EILSEQ #endif /* * Salford-C kludge 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 /* * Large file (>2Gb) support using WIN32 functions. */ #ifdef USE_WIN32_LARGE_FILES # include # include # include # undef lseek # define lseek(fdes,offset,whence) _lseeki64(fdes, offset, whence) # undef fstat # define fstat(fdes,stp) _fstati64(fdes, stp) # undef stat # define stat(fname,stp) _stati64(fname, stp) # define struct_stat struct _stati64 # define LSEEK_ERROR (__int64)-1 #endif /* * Small file (<2Gb) support using WIN32 functions. */ #ifdef USE_WIN32_SMALL_FILES # include # include # include # ifndef _WIN32_WCE # undef lseek # define lseek(fdes,offset,whence) _lseek(fdes, (long)offset, whence) # define fstat(fdes,stp) _fstat(fdes, stp) # define stat(fname,stp) _stat(fname, stp) # define struct_stat struct _stat # endif # define LSEEK_ERROR (long)-1 #endif #ifndef struct_stat # define struct_stat struct stat #endif #ifndef LSEEK_ERROR # define LSEEK_ERROR (off_t)-1 #endif /* * Default sizeof(off_t) in case it hasn't been defined in config file. */ #ifndef SIZEOF_OFF_T # if defined(__VMS) && !defined(__VAX) # if defined(_LARGEFILE) # define SIZEOF_OFF_T 8 # endif # elif defined(__OS400__) && defined(__ILEC400__) # if defined(_LARGE_FILES) # define SIZEOF_OFF_T 8 # endif # elif defined(__MVS__) && defined(__IBMC__) # if defined(_LP64) || defined(_LARGE_FILES) # define SIZEOF_OFF_T 8 # endif # elif defined(__370__) && defined(__IBMC__) # if defined(_LP64) || defined(_LARGE_FILES) # define SIZEOF_OFF_T 8 # endif # endif # ifndef SIZEOF_OFF_T # define SIZEOF_OFF_T 4 # endif #endif /* * Arg 2 type for gethostname in case it hasn't been defined in config file. */ #ifndef GETHOSTNAME_TYPE_ARG2 # ifdef USE_WINSOCK # define GETHOSTNAME_TYPE_ARG2 int # else # define GETHOSTNAME_TYPE_ARG2 size_t # endif #endif /* Below we define some functions. They should 4. set the SIGALRM signal timeout 5. set dir/file naming defines */ #ifdef WIN32 # define DIR_CHAR "\\" # define DOT_CHAR "_" #else /* WIN32 */ # ifdef MSDOS /* Watt-32 */ # include # define select(n,r,w,x,t) select_s(n,r,w,x,t) # define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z)) # include # ifdef word # undef word # endif # ifdef byte # undef byte # endif # endif /* MSDOS */ # ifdef __minix /* Minix 3 versions up to at least 3.1.3 are missing these prototypes */ extern char * strtok_r(char *s, const char *delim, char **last); extern struct tm * gmtime_r(const time_t * const timep, struct tm *tmp); # 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 */ /* * msvc 6.0 requires PSDK in order to have INET6_ADDRSTRLEN * defined in ws2tcpip.h as well as to provide IPv6 support. */ #if defined(_MSC_VER) && !defined(__POCC__) # if !defined(HAVE_WS2TCPIP_H) || \ ((_MSC_VER < 1300) && !defined(INET6_ADDRSTRLEN)) # undef HAVE_GETADDRINFO_THREADSAFE # undef HAVE_FREEADDRINFO # undef HAVE_GETADDRINFO # undef HAVE_GETNAMEINFO # undef ENABLE_IPV6 # endif #endif /* ---------------------------------------------------------------- */ /* resolver specialty compile-time defines */ /* CURLRES_* defines to use in the host*.c sources */ /* ---------------------------------------------------------------- */ /* * lcc-win32 doesn't have _beginthreadex(), lacks threads support. */ #if defined(__LCC__) && defined(WIN32) # undef USE_THREADS_POSIX # undef USE_THREADS_WIN32 #endif /* * MSVC threads support requires a multi-threaded runtime library. * _beginthreadex() is not available in single-threaded ones. */ #if defined(_MSC_VER) && !defined(__POCC__) && !defined(_MT) # undef USE_THREADS_POSIX # undef USE_THREADS_WIN32 #endif /* * Mutually exclusive CURLRES_* definitions. */ #ifdef USE_ARES # define CURLRES_ASYNCH # define CURLRES_ARES /* now undef the stock libc functions just to avoid them being used */ # undef HAVE_GETADDRINFO # undef HAVE_GETHOSTBYNAME #elif defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) # define CURLRES_ASYNCH # define CURLRES_THREADED #else # define CURLRES_SYNCH #endif #ifdef ENABLE_IPV6 # define CURLRES_IPV6 #else # define CURLRES_IPV4 #endif /* ---------------------------------------------------------------- */ /* * When using WINSOCK, TELNET protocol requires WINSOCK2 API. */ #if defined(USE_WINSOCK) && (USE_WINSOCK != 2) # define CURL_DISABLE_TELNET 1 #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. */ #if defined(_MSC_VER) && !defined(__POCC__) # if !defined(HAVE_WINSOCK2_H) || ((_MSC_VER < 1300) && !defined(IPPROTO_ESP)) # undef HAVE_STRUCT_SOCKADDR_STORAGE # endif #endif /* * Intentionally fail to build when using msvc 6.0 without PSDK installed. * The brave of heart can circumvent this, defining ALLOW_MSVC6_WITHOUT_PSDK * in lib/config-win32.h although absolutely discouraged and unsupported. */ #if defined(_MSC_VER) && !defined(__POCC__) # if !defined(HAVE_WINDOWS_H) || ((_MSC_VER < 1300) && !defined(_FILETIME_)) # if !defined(ALLOW_MSVC6_WITHOUT_PSDK) # error MSVC 6.0 requires "February 2003 Platform SDK" a.k.a. \ "Windows Server 2003 PSDK" # else # define CURL_DISABLE_LDAP 1 # endif # endif #endif #ifdef NETWARE int netware_init(void); #ifndef __NOVELL_LIBC__ #include #include #endif #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" #if defined(USE_GNUTLS) || defined(USE_SSLEAY) || defined(USE_NSS) || \ defined(USE_QSOSSL) || defined(USE_POLARSSL) || defined(USE_AXTLS) || \ defined(USE_CYASSL) || defined(USE_SCHANNEL) || \ defined(USE_DARWINSSL) || defined(USE_GSKIT) #define USE_SSL /* SSL support has been enabled */ #endif #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) #define USE_HTTP_NEGOTIATE #endif /* Single point where USE_NTLM definition might be done */ #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_NTLM) #if defined(USE_SSLEAY) || defined(USE_WINDOWS_SSPI) || \ defined(USE_GNUTLS) || defined(USE_NSS) || defined(USE_DARWINSSL) #define USE_NTLM #endif #endif /* non-configure builds may define CURL_WANTS_CA_BUNDLE_ENV */ #if defined(CURL_WANTS_CA_BUNDLE_ENV) && !defined(CURL_CA_BUNDLE) #define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE") #endif /* * Provide a mechanism to silence picky compilers, such as gcc 4.6+. * Parameters should of course normally not be unused, but for example when * we have multiple implementations of the same interface it may happen. */ #if defined(__GNUC__) && ((__GNUC__ >= 3) || \ ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 7))) # define UNUSED_PARAM __attribute__((__unused__)) #else # define UNUSED_PARAM /*NOTHING*/ #endif /* * Include macros and defines that should only be processed once. */ #ifndef HEADER_CURL_SETUP_ONCE_H #include "curl_setup_once.h" #endif /* * Definition of our NOP statement Object-like macro */ #ifndef Curl_nop_stmt # define Curl_nop_stmt do { } WHILE_FALSE #endif /* * Ensure that Winsock and lwIP TCP/IP stacks are not mixed. */ #if defined(__LWIP_OPT_H__) # if defined(SOCKET) || \ defined(USE_WINSOCK) || \ defined(HAVE_WINSOCK_H) || \ defined(HAVE_WINSOCK2_H) || \ defined(HAVE_WS2TCPIP_H) # error "Winsock and lwIP TCP/IP stack definitions shall not coexist!" # endif #endif /* * Portable symbolic names for Winsock shutdown() mode flags. */ #ifdef USE_WINSOCK # define SHUT_RD 0x00 # define SHUT_WR 0x01 # define SHUT_RDWR 0x02 #endif /* Define S_ISREG if not defined by system headers, f.e. MSVC */ #if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG) #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif /* Define S_ISDIR if not defined by system headers, f.e. MSVC */ #if !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif #endif /* HEADER_CURL_SETUP_H */ curl-7.35.0/lib/imap.c0000644000175000017500000022507012270035364011344 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * * RFC2195 CRAM-MD5 authentication * RFC2595 Using TLS with IMAP, POP3 and ACAP * RFC2831 DIGEST-MD5 authentication * RFC3501 IMAPv4 protocol * RFC4422 Simple Authentication and Security Layer (SASL) * RFC4616 PLAIN authentication * RFC4959 IMAP Extension for SASL Initial Client Response * RFC5092 IMAP URL Scheme * RFC6749 OAuth 2.0 Authorization Framework * Draft LOGIN SASL Mechanism * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_IMAP #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 #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 "if2ip.h" #include "hostip.h" #include "progress.h" #include "transfer.h" #include "escape.h" #include "http.h" /* for HTTP proxy tunnel stuff */ #include "socks.h" #include "imap.h" #include "strtoofft.h" #include "strequal.h" #include "vtls/vtls.h" #include "connect.h" #include "strerror.h" #include "select.h" #include "multiif.h" #include "url.h" #include "rawstr.h" #include "curl_sasl.h" #include "warnless.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* Local API functions */ static CURLcode imap_regular_transfer(struct connectdata *conn, bool *done); static CURLcode imap_do(struct connectdata *conn, bool *done); static CURLcode imap_done(struct connectdata *conn, CURLcode status, bool premature); static CURLcode imap_connect(struct connectdata *conn, bool *done); static CURLcode imap_disconnect(struct connectdata *conn, bool dead); static CURLcode imap_multi_statemach(struct connectdata *conn, bool *done); static int imap_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks); static CURLcode imap_doing(struct connectdata *conn, bool *dophase_done); static CURLcode imap_setup_connection(struct connectdata *conn); static char *imap_atom(const char *str); static CURLcode imap_sendf(struct connectdata *conn, const char *fmt, ...); static CURLcode imap_parse_url_options(struct connectdata *conn); static CURLcode imap_parse_url_path(struct connectdata *conn); static CURLcode imap_parse_custom_request(struct connectdata *conn); static CURLcode imap_calc_sasl_details(struct connectdata *conn, const char **mech, char **initresp, size_t *len, imapstate *state1, imapstate *state2); /* * IMAP protocol handler. */ const struct Curl_handler Curl_handler_imap = { "IMAP", /* scheme */ imap_setup_connection, /* setup_connection */ imap_do, /* do_it */ imap_done, /* done */ ZERO_NULL, /* do_more */ imap_connect, /* connect_it */ imap_multi_statemach, /* connecting */ imap_doing, /* doing */ imap_getsock, /* proto_getsock */ imap_getsock, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ imap_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_IMAP, /* defport */ CURLPROTO_IMAP, /* protocol */ PROTOPT_CLOSEACTION | PROTOPT_NEEDSPWD | PROTOPT_NOURLQUERY /* flags */ }; #ifdef USE_SSL /* * IMAPS protocol handler. */ const struct Curl_handler Curl_handler_imaps = { "IMAPS", /* scheme */ imap_setup_connection, /* setup_connection */ imap_do, /* do_it */ imap_done, /* done */ ZERO_NULL, /* do_more */ imap_connect, /* connect_it */ imap_multi_statemach, /* connecting */ imap_doing, /* doing */ imap_getsock, /* proto_getsock */ imap_getsock, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ imap_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_IMAPS, /* defport */ CURLPROTO_IMAP | CURLPROTO_IMAPS, /* protocol */ PROTOPT_CLOSEACTION | PROTOPT_SSL | PROTOPT_NEEDSPWD | PROTOPT_NOURLQUERY /* flags */ }; #endif #ifndef CURL_DISABLE_HTTP /* * HTTP-proxyed IMAP protocol handler. */ static const struct Curl_handler Curl_handler_imap_proxy = { "IMAP", /* scheme */ Curl_http_setup_conn, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ ZERO_NULL, /* do_more */ ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_IMAP, /* defport */ CURLPROTO_HTTP, /* protocol */ PROTOPT_NONE /* flags */ }; #ifdef USE_SSL /* * HTTP-proxyed IMAPS protocol handler. */ static const struct Curl_handler Curl_handler_imaps_proxy = { "IMAPS", /* scheme */ Curl_http_setup_conn, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ ZERO_NULL, /* do_more */ ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_IMAPS, /* defport */ CURLPROTO_HTTP, /* protocol */ PROTOPT_NONE /* flags */ }; #endif #endif #ifdef USE_SSL static void imap_to_imaps(struct connectdata *conn) { conn->handler = &Curl_handler_imaps; } #else #define imap_to_imaps(x) Curl_nop_stmt #endif /*********************************************************************** * * imap_matchresp() * * Determines whether the untagged response is related to the specified * command by checking if it is in format "* ..." or * "* ...". * * The "* " marker is assumed to have already been checked by the caller. */ static bool imap_matchresp(const char *line, size_t len, const char *cmd) { const char *end = line + len; size_t cmd_len = strlen(cmd); /* Skip the untagged response marker */ line += 2; /* Do we have a number after the marker? */ if(line < end && ISDIGIT(*line)) { /* Skip the number */ do line++; while(line < end && ISDIGIT(*line)); /* Do we have the space character? */ if(line == end || *line != ' ') return FALSE; line++; } /* Does the command name match and is it followed by a space character or at the end of line? */ if(line + cmd_len <= end && Curl_raw_nequal(line, cmd, cmd_len) && (line[cmd_len] == ' ' || line + cmd_len == end)) return TRUE; return FALSE; } /*********************************************************************** * * imap_endofresp() * * Checks whether the given string is a valid tagged, untagged or continuation * response which can be processed by the response handler. */ static bool imap_endofresp(struct connectdata *conn, char *line, size_t len, int *resp) { struct IMAP *imap = conn->data->req.protop; struct imap_conn *imapc = &conn->proto.imapc; const char *id = imapc->resptag; size_t id_len = strlen(id); /* Do we have a tagged command response? */ if(len >= id_len + 1 && !memcmp(id, line, id_len) && line[id_len] == ' ') { line += id_len + 1; len -= id_len + 1; if(len >= 2 && !memcmp(line, "OK", 2)) *resp = 'O'; else if(len >= 2 && !memcmp(line, "NO", 2)) *resp = 'N'; else if(len >= 3 && !memcmp(line, "BAD", 3)) *resp = 'B'; else { failf(conn->data, "Bad tagged response"); *resp = -1; } return TRUE; } /* Do we have an untagged command response? */ if(len >= 2 && !memcmp("* ", line, 2)) { switch(imapc->state) { /* States which are interested in untagged responses */ case IMAP_CAPABILITY: if(!imap_matchresp(line, len, "CAPABILITY")) return FALSE; break; case IMAP_LIST: if((!imap->custom && !imap_matchresp(line, len, "LIST")) || (imap->custom && !imap_matchresp(line, len, imap->custom) && (strcmp(imap->custom, "STORE") || !imap_matchresp(line, len, "FETCH")) && strcmp(imap->custom, "SELECT") && strcmp(imap->custom, "EXAMINE") && strcmp(imap->custom, "SEARCH") && strcmp(imap->custom, "EXPUNGE") && strcmp(imap->custom, "LSUB") && strcmp(imap->custom, "UID") && strcmp(imap->custom, "NOOP"))) return FALSE; break; case IMAP_SELECT: /* SELECT is special in that its untagged responses do not have a common prefix so accept anything! */ break; case IMAP_FETCH: if(!imap_matchresp(line, len, "FETCH")) return FALSE; break; /* Ignore other untagged responses */ default: return FALSE; } *resp = '*'; return TRUE; } /* Do we have a continuation response? This should be a + symbol followed by a space and optionally some text as per RFC-3501 for the AUTHENTICATE and APPEND commands and as outlined in Section 4. Examples of RFC-4959 but some e-mail servers ignore this and only send a single + instead. */ if((len == 3 && !memcmp("+", line, 1)) || (len >= 2 && !memcmp("+ ", line, 2))) { switch(imapc->state) { /* States which are interested in continuation responses */ case IMAP_AUTHENTICATE_PLAIN: case IMAP_AUTHENTICATE_LOGIN: case IMAP_AUTHENTICATE_LOGIN_PASSWD: case IMAP_AUTHENTICATE_CRAMMD5: case IMAP_AUTHENTICATE_DIGESTMD5: case IMAP_AUTHENTICATE_DIGESTMD5_RESP: case IMAP_AUTHENTICATE_NTLM: case IMAP_AUTHENTICATE_NTLM_TYPE2MSG: case IMAP_AUTHENTICATE_XOAUTH2: case IMAP_AUTHENTICATE_FINAL: case IMAP_APPEND: *resp = '+'; break; default: failf(conn->data, "Unexpected continuation response"); *resp = -1; break; } return TRUE; } return FALSE; /* Nothing for us */ } /*********************************************************************** * * imap_get_message() * * Gets the authentication message from the response buffer. */ static void imap_get_message(char *buffer, char** outptr) { size_t len = 0; char* message = NULL; /* Find the start of the message */ for(message = buffer + 2; *message == ' ' || *message == '\t'; message++) ; /* Find the end of the message */ for(len = strlen(message); len--;) if(message[len] != '\r' && message[len] != '\n' && message[len] != ' ' && message[len] != '\t') break; /* Terminate the message */ if(++len) { message[len] = '\0'; } *outptr = message; } /*********************************************************************** * * state() * * This is the ONLY way to change IMAP state! */ static void state(struct connectdata *conn, imapstate newstate) { struct imap_conn *imapc = &conn->proto.imapc; #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) /* for debug purposes */ static const char * const names[]={ "STOP", "SERVERGREET", "CAPABILITY", "STARTTLS", "UPGRADETLS", "AUTHENTICATE_PLAIN", "AUTHENTICATE_LOGIN", "AUTHENTICATE_LOGIN_PASSWD", "AUTHENTICATE_CRAMMD5", "AUTHENTICATE_DIGESTMD5", "AUTHENTICATE_DIGESTMD5_RESP", "AUTHENTICATE_NTLM", "AUTHENTICATE_NTLM_TYPE2MSG", "AUTHENTICATE_XOAUTH2", "AUTHENTICATE_CANCEL", "AUTHENTICATE_FINAL", "LOGIN", "LIST", "SELECT", "FETCH", "FETCH_FINAL", "APPEND", "APPEND_FINAL", "LOGOUT", /* LAST */ }; if(imapc->state != newstate) infof(conn->data, "IMAP %p state change from %s to %s\n", (void *)imapc, names[imapc->state], names[newstate]); #endif imapc->state = newstate; } /*********************************************************************** * * imap_perform_capability() * * Sends the CAPABILITY command in order to obtain a list of server side * supported capabilities. */ static CURLcode imap_perform_capability(struct connectdata *conn) { CURLcode result = CURLE_OK; struct imap_conn *imapc = &conn->proto.imapc; imapc->authmechs = 0; /* No known authentication mechanisms yet */ imapc->authused = 0; /* Clear the authentication mechanism used */ imapc->tls_supported = FALSE; /* Clear the TLS capability */ /* Send the CAPABILITY command */ result = imap_sendf(conn, "CAPABILITY"); if(!result) state(conn, IMAP_CAPABILITY); return result; } /*********************************************************************** * * imap_perform_starttls() * * Sends the STARTTLS command to start the upgrade to TLS. */ static CURLcode imap_perform_starttls(struct connectdata *conn) { CURLcode result = CURLE_OK; /* Send the STARTTLS command */ result = imap_sendf(conn, "STARTTLS"); if(!result) state(conn, IMAP_STARTTLS); return result; } /*********************************************************************** * * imap_perform_upgrade_tls() * * Performs the upgrade to TLS. */ static CURLcode imap_perform_upgrade_tls(struct connectdata *conn) { CURLcode result = CURLE_OK; struct imap_conn *imapc = &conn->proto.imapc; /* Start the SSL connection */ result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &imapc->ssldone); if(!result) { if(imapc->state != IMAP_UPGRADETLS) state(conn, IMAP_UPGRADETLS); if(imapc->ssldone) { imap_to_imaps(conn); result = imap_perform_capability(conn); } } return result; } /*********************************************************************** * * imap_perform_login() * * Sends a clear text LOGIN command to authenticate with. */ static CURLcode imap_perform_login(struct connectdata *conn) { CURLcode result = CURLE_OK; char *user; char *passwd; /* Check we have a username and password to authenticate with and end the connect phase if we don't */ if(!conn->bits.user_passwd) { state(conn, IMAP_STOP); return result; } /* Make sure the username and password are in the correct atom format */ user = imap_atom(conn->user); passwd = imap_atom(conn->passwd); /* Send the LOGIN command */ result = imap_sendf(conn, "LOGIN %s %s", user ? user : "", passwd ? passwd : ""); Curl_safefree(user); Curl_safefree(passwd); if(!result) state(conn, IMAP_LOGIN); return result; } /*********************************************************************** * * imap_perform_authenticate() * * Sends an AUTHENTICATE command allowing the client to login with the given * SASL authentication mechanism. */ static CURLcode imap_perform_authenticate(struct connectdata *conn, const char *mech, const char *initresp, imapstate state1, imapstate state2) { CURLcode result = CURLE_OK; if(initresp) { /* Send the AUTHENTICATE command with the initial response */ result = imap_sendf(conn, "AUTHENTICATE %s %s", mech, initresp); if(!result) state(conn, state2); } else { /* Send the AUTHENTICATE command */ result = imap_sendf(conn, "AUTHENTICATE %s", mech); if(!result) state(conn, state1); } return result; } /*********************************************************************** * * imap_perform_authentication() * * Initiates the authentication sequence, with the appropriate SASL * authentication mechanism, falling back to clear text should a common * mechanism not be available between the client and server. */ static CURLcode imap_perform_authentication(struct connectdata *conn) { CURLcode result = CURLE_OK; struct imap_conn *imapc = &conn->proto.imapc; const char *mech = NULL; char *initresp = NULL; size_t len = 0; imapstate state1 = IMAP_STOP; imapstate state2 = IMAP_STOP; /* Check we have a username and password to authenticate with and end the connect phase if we don't */ if(!conn->bits.user_passwd) { state(conn, IMAP_STOP); return result; } /* Calculate the SASL login details */ result = imap_calc_sasl_details(conn, &mech, &initresp, &len, &state1, &state2); if(!result) { if(mech && (imapc->preftype & IMAP_TYPE_SASL)) { /* Perform SASL based authentication */ result = imap_perform_authenticate(conn, mech, initresp, state1, state2); Curl_safefree(initresp); } else if((!imapc->login_disabled) && (imapc->preftype & IMAP_TYPE_CLEARTEXT)) /* Perform clear text authentication */ result = imap_perform_login(conn); else { /* Other mechanisms not supported */ infof(conn->data, "No known authentication mechanisms supported!\n"); result = CURLE_LOGIN_DENIED; } } return result; } /*********************************************************************** * * imap_perform_list() * * Sends a LIST command or an alternative custom request. */ static CURLcode imap_perform_list(struct connectdata *conn) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct IMAP *imap = data->req.protop; char *mailbox; if(imap->custom) /* Send the custom request */ result = imap_sendf(conn, "%s%s", imap->custom, imap->custom_params ? imap->custom_params : ""); else { /* Make sure the mailbox is in the correct atom format */ mailbox = imap_atom(imap->mailbox ? imap->mailbox : ""); if(!mailbox) return CURLE_OUT_OF_MEMORY; /* Send the LIST command */ result = imap_sendf(conn, "LIST \"%s\" *", mailbox); Curl_safefree(mailbox); } if(!result) state(conn, IMAP_LIST); return result; } /*********************************************************************** * * imap_perform_select() * * Sends a SELECT command to ask the server to change the selected mailbox. */ static CURLcode imap_perform_select(struct connectdata *conn) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct IMAP *imap = data->req.protop; struct imap_conn *imapc = &conn->proto.imapc; char *mailbox; /* Invalidate old information as we are switching mailboxes */ Curl_safefree(imapc->mailbox); Curl_safefree(imapc->mailbox_uidvalidity); /* Check we have a mailbox */ if(!imap->mailbox) { failf(conn->data, "Cannot SELECT without a mailbox."); return CURLE_URL_MALFORMAT; } /* Make sure the mailbox is in the correct atom format */ mailbox = imap_atom(imap->mailbox); if(!mailbox) return CURLE_OUT_OF_MEMORY; /* Send the SELECT command */ result = imap_sendf(conn, "SELECT %s", mailbox); Curl_safefree(mailbox); if(!result) state(conn, IMAP_SELECT); return result; } /*********************************************************************** * * imap_perform_fetch() * * Sends a FETCH command to initiate the download of a message. */ static CURLcode imap_perform_fetch(struct connectdata *conn) { CURLcode result = CURLE_OK; struct IMAP *imap = conn->data->req.protop; /* Check we have a UID */ if(!imap->uid) { failf(conn->data, "Cannot FETCH without a UID."); return CURLE_URL_MALFORMAT; } /* Send the FETCH command */ result = imap_sendf(conn, "FETCH %s BODY[%s]", imap->uid, imap->section ? imap->section : ""); if(!result) state(conn, IMAP_FETCH); return result; } /*********************************************************************** * * imap_perform_append() * * Sends an APPEND command to initiate the upload of a message. */ static CURLcode imap_perform_append(struct connectdata *conn) { CURLcode result = CURLE_OK; struct IMAP *imap = conn->data->req.protop; char *mailbox; /* Check we have a mailbox */ if(!imap->mailbox) { failf(conn->data, "Cannot APPEND without a mailbox."); return CURLE_URL_MALFORMAT; } /* Check we know the size of the upload */ if(conn->data->set.infilesize < 0) { failf(conn->data, "Cannot APPEND with unknown input file size\n"); return CURLE_UPLOAD_FAILED; } /* Make sure the mailbox is in the correct atom format */ mailbox = imap_atom(imap->mailbox); if(!mailbox) return CURLE_OUT_OF_MEMORY; /* Send the APPEND command */ result = imap_sendf(conn, "APPEND %s (\\Seen) {%" CURL_FORMAT_CURL_OFF_T "}", mailbox, conn->data->set.infilesize); Curl_safefree(mailbox); if(!result) state(conn, IMAP_APPEND); return result; } /*********************************************************************** * * imap_perform_logout() * * Performs the logout action prior to sclose() being called. */ static CURLcode imap_perform_logout(struct connectdata *conn) { CURLcode result = CURLE_OK; /* Send the LOGOUT command */ result = imap_sendf(conn, "LOGOUT"); if(!result) state(conn, IMAP_LOGOUT); return result; } /* For the initial server greeting */ static CURLcode imap_state_servergreet_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(imapcode != 'O') { failf(data, "Got unexpected imap-server response"); result = CURLE_FTP_WEIRD_SERVER_REPLY; /* TODO: fix this code */ } else result = imap_perform_capability(conn); return result; } /* For CAPABILITY responses */ static CURLcode imap_state_capability_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct imap_conn *imapc = &conn->proto.imapc; const char *line = data->state.buffer; size_t wordlen; (void)instate; /* no use for this yet */ /* Do we have a untagged response? */ if(imapcode == '*') { line += 2; /* Loop through the data line */ for(;;) { while(*line && (*line == ' ' || *line == '\t' || *line == '\r' || *line == '\n')) { line++; } if(!*line) break; /* Extract the word */ for(wordlen = 0; line[wordlen] && line[wordlen] != ' ' && line[wordlen] != '\t' && line[wordlen] != '\r' && line[wordlen] != '\n';) wordlen++; /* Does the server support the STARTTLS capability? */ if(wordlen == 8 && !memcmp(line, "STARTTLS", 8)) imapc->tls_supported = TRUE; /* Has the server explicitly disabled clear text authentication? */ else if(wordlen == 13 && !memcmp(line, "LOGINDISABLED", 13)) imapc->login_disabled = TRUE; /* Does the server support the SASL-IR capability? */ else if(wordlen == 7 && !memcmp(line, "SASL-IR", 7)) imapc->ir_supported = TRUE; /* Do we have a SASL based authentication mechanism? */ else if(wordlen > 5 && !memcmp(line, "AUTH=", 5)) { line += 5; wordlen -= 5; /* Test the word for a matching authentication mechanism */ if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_LOGIN)) imapc->authmechs |= SASL_MECH_LOGIN; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_PLAIN)) imapc->authmechs |= SASL_MECH_PLAIN; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_CRAM_MD5)) imapc->authmechs |= SASL_MECH_CRAM_MD5; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_DIGEST_MD5)) imapc->authmechs |= SASL_MECH_DIGEST_MD5; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_GSSAPI)) imapc->authmechs |= SASL_MECH_GSSAPI; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_EXTERNAL)) imapc->authmechs |= SASL_MECH_EXTERNAL; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_NTLM)) imapc->authmechs |= SASL_MECH_NTLM; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_XOAUTH2)) imapc->authmechs |= SASL_MECH_XOAUTH2; } line += wordlen; } } else if(imapcode == 'O') { if(data->set.use_ssl && !conn->ssl[FIRSTSOCKET].use) { /* We don't have a SSL/TLS connection yet, but SSL is requested */ if(imapc->tls_supported) /* Switch to TLS connection now */ result = imap_perform_starttls(conn); else if(data->set.use_ssl == CURLUSESSL_TRY) /* Fallback and carry on with authentication */ result = imap_perform_authentication(conn); else { failf(data, "STARTTLS not supported."); result = CURLE_USE_SSL_FAILED; } } else result = imap_perform_authentication(conn); } else result = imap_perform_authentication(conn); return result; } /* For STARTTLS responses */ static CURLcode imap_state_starttls_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(imapcode != 'O') { if(data->set.use_ssl != CURLUSESSL_TRY) { failf(data, "STARTTLS denied. %c", imapcode); result = CURLE_USE_SSL_FAILED; } else result = imap_perform_authentication(conn); } else result = imap_perform_upgrade_tls(conn); return result; } /* For AUTHENTICATE PLAIN (without initial response) responses */ static CURLcode imap_state_auth_plain_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; size_t len = 0; char *plainauth = NULL; (void)instate; /* no use for this yet */ if(imapcode != '+') { failf(data, "Access denied. %c", imapcode); result = CURLE_LOGIN_DENIED; } else { /* Create the authorisation message */ result = Curl_sasl_create_plain_message(data, conn->user, conn->passwd, &plainauth, &len); if(!result && plainauth) { /* Send the message */ result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", plainauth); if(!result) state(conn, IMAP_AUTHENTICATE_FINAL); } } Curl_safefree(plainauth); return result; } /* For AUTHENTICATE LOGIN (without initial response) responses */ static CURLcode imap_state_auth_login_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; size_t len = 0; char *authuser = NULL; (void)instate; /* no use for this yet */ if(imapcode != '+') { failf(data, "Access denied: %d", imapcode); result = CURLE_LOGIN_DENIED; } else { /* Create the user message */ result = Curl_sasl_create_login_message(data, conn->user, &authuser, &len); if(!result && authuser) { /* Send the user */ result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", authuser); if(!result) state(conn, IMAP_AUTHENTICATE_LOGIN_PASSWD); } } Curl_safefree(authuser); return result; } /* For AUTHENTICATE LOGIN user entry responses */ static CURLcode imap_state_auth_login_password_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; size_t len = 0; char *authpasswd = NULL; (void)instate; /* no use for this yet */ if(imapcode != '+') { failf(data, "Access denied: %d", imapcode); result = CURLE_LOGIN_DENIED; } else { /* Create the password message */ result = Curl_sasl_create_login_message(data, conn->passwd, &authpasswd, &len); if(!result && authpasswd) { /* Send the password */ result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", authpasswd); if(!result) state(conn, IMAP_AUTHENTICATE_FINAL); } } Curl_safefree(authpasswd); return result; } #ifndef CURL_DISABLE_CRYPTO_AUTH /* For AUTHENTICATE CRAM-MD5 responses */ static CURLcode imap_state_auth_cram_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; char *chlg = NULL; char *chlg64 = NULL; char *rplyb64 = NULL; size_t len = 0; (void)instate; /* no use for this yet */ if(imapcode != '+') { failf(data, "Access denied: %d", imapcode); return CURLE_LOGIN_DENIED; } /* Get the challenge message */ imap_get_message(data->state.buffer, &chlg64); /* Decode the challenge message */ result = Curl_sasl_decode_cram_md5_message(chlg64, &chlg, &len); if(result) { /* Send the cancellation */ result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", "*"); if(!result) state(conn, IMAP_AUTHENTICATE_CANCEL); } else { /* Create the response message */ result = Curl_sasl_create_cram_md5_message(data, chlg, conn->user, conn->passwd, &rplyb64, &len); if(!result && rplyb64) { /* Send the response */ result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", rplyb64); if(!result) state(conn, IMAP_AUTHENTICATE_FINAL); } } Curl_safefree(chlg); Curl_safefree(rplyb64); return result; } /* For AUTHENTICATE DIGEST-MD5 challenge responses */ static CURLcode imap_state_auth_digest_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; char *chlg64 = NULL; char *rplyb64 = NULL; size_t len = 0; char nonce[64]; char realm[128]; char algorithm[64]; (void)instate; /* no use for this yet */ if(imapcode != '+') { failf(data, "Access denied: %d", imapcode); return CURLE_LOGIN_DENIED; } /* Get the challenge message */ imap_get_message(data->state.buffer, &chlg64); /* Decode the challange message */ result = Curl_sasl_decode_digest_md5_message(chlg64, nonce, sizeof(nonce), realm, sizeof(realm), algorithm, sizeof(algorithm)); if(result || strcmp(algorithm, "md5-sess") != 0) { /* Send the cancellation */ result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", "*"); if(!result) state(conn, IMAP_AUTHENTICATE_CANCEL); } else { /* Create the response message */ result = Curl_sasl_create_digest_md5_message(data, nonce, realm, conn->user, conn->passwd, "imap", &rplyb64, &len); if(!result && rplyb64) { /* Send the response */ result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", rplyb64); if(!result) state(conn, IMAP_AUTHENTICATE_DIGESTMD5_RESP); } } Curl_safefree(rplyb64); return result; } /* For AUTHENTICATE DIGEST-MD5 challenge-response responses */ static CURLcode imap_state_auth_digest_resp_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(imapcode != '+') { failf(data, "Authentication failed: %d", imapcode); result = CURLE_LOGIN_DENIED; } else { /* Send an empty response */ result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", ""); if(!result) state(conn, IMAP_AUTHENTICATE_FINAL); } return result; } #endif #ifdef USE_NTLM /* For AUTHENTICATE NTLM (without initial response) responses */ static CURLcode imap_state_auth_ntlm_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; size_t len = 0; char *type1msg = NULL; (void)instate; /* no use for this yet */ if(imapcode != '+') { failf(data, "Access denied: %d", imapcode); result = CURLE_LOGIN_DENIED; } else { /* Create the type-1 message */ result = Curl_sasl_create_ntlm_type1_message(conn->user, conn->passwd, &conn->ntlm, &type1msg, &len); if(!result && type1msg) { /* Send the message */ result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", type1msg); if(!result) state(conn, IMAP_AUTHENTICATE_NTLM_TYPE2MSG); } } Curl_safefree(type1msg); return result; } /* For NTLM type-2 responses (sent in reponse to our type-1 message) */ static CURLcode imap_state_auth_ntlm_type2msg_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; char *type2msg = NULL; char *type3msg = NULL; size_t len = 0; (void)instate; /* no use for this yet */ if(imapcode != '+') { failf(data, "Access denied: %d", imapcode); result = CURLE_LOGIN_DENIED; } else { /* Get the challenge message */ imap_get_message(data->state.buffer, &type2msg); /* Decode the type-2 message */ result = Curl_sasl_decode_ntlm_type2_message(data, type2msg, &conn->ntlm); if(result) { /* Send the cancellation */ result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", "*"); if(!result) state(conn, IMAP_AUTHENTICATE_CANCEL); } else { /* Create the type-3 message */ result = Curl_sasl_create_ntlm_type3_message(data, conn->user, conn->passwd, &conn->ntlm, &type3msg, &len); if(!result && type3msg) { /* Send the message */ result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", type3msg); if(!result) state(conn, IMAP_AUTHENTICATE_FINAL); } } } Curl_safefree(type3msg); return result; } #endif /* For AUTHENTICATE XOAUTH2 (without initial response) responses */ static CURLcode imap_state_auth_xoauth2_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; size_t len = 0; char *xoauth = NULL; (void)instate; /* no use for this yet */ if(imapcode != '+') { failf(data, "Access denied: %d", imapcode); result = CURLE_LOGIN_DENIED; } else { /* Create the authorisation message */ result = Curl_sasl_create_xoauth2_message(conn->data, conn->user, conn->xoauth2_bearer, &xoauth, &len); if(!result && xoauth) { /* Send the message */ result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", xoauth); if(!result) state(conn, IMAP_AUTHENTICATE_FINAL); } } Curl_safefree(xoauth); return result; } /* For AUTHENTICATE cancellation responses */ static CURLcode imap_state_auth_cancel_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct imap_conn *imapc = &conn->proto.imapc; const char *mech = NULL; char *initresp = NULL; size_t len = 0; imapstate state1 = IMAP_STOP; imapstate state2 = IMAP_STOP; (void)imapcode; (void)instate; /* no use for this yet */ /* Remove the offending mechanism from the supported list */ imapc->authmechs ^= imapc->authused; /* Calculate alternative SASL login details */ result = imap_calc_sasl_details(conn, &mech, &initresp, &len, &state1, &state2); if(!result) { /* Do we have any mechanisms left or can we fallback to clear text? */ if(mech) { /* Retry SASL based authentication */ result = imap_perform_authenticate(conn, mech, initresp, state1, state2); Curl_safefree(initresp); } else if((!imapc->login_disabled) && (imapc->preftype & IMAP_TYPE_CLEARTEXT)) /* Perform clear text authentication */ result = imap_perform_login(conn); else { failf(data, "Authentication cancelled"); result = CURLE_LOGIN_DENIED; } } return result; } /* For final responses in the AUTHENTICATE sequence */ static CURLcode imap_state_auth_final_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(imapcode != 'O') { failf(data, "Authentication failed: %d", imapcode); result = CURLE_LOGIN_DENIED; } else /* End of connect phase */ state(conn, IMAP_STOP); return result; } /* For LOGIN responses */ static CURLcode imap_state_login_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(imapcode != 'O') { failf(data, "Access denied. %c", imapcode); result = CURLE_LOGIN_DENIED; } else /* End of connect phase */ state(conn, IMAP_STOP); return result; } /* For LIST responses */ static CURLcode imap_state_list_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; char *line = conn->data->state.buffer; size_t len = strlen(line); (void)instate; /* No use for this yet */ if(imapcode == '*') { /* Temporarily add the LF character back and send as body to the client */ line[len] = '\n'; result = Curl_client_write(conn, CLIENTWRITE_BODY, line, len + 1); line[len] = '\0'; } else if(imapcode != 'O') result = CURLE_QUOTE_ERROR; /* TODO: Fix error code */ else /* End of DO phase */ state(conn, IMAP_STOP); return result; } /* For SELECT responses */ static CURLcode imap_state_select_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct IMAP *imap = conn->data->req.protop; struct imap_conn *imapc = &conn->proto.imapc; const char *line = data->state.buffer; char tmp[20]; (void)instate; /* no use for this yet */ if(imapcode == '*') { /* See if this is an UIDVALIDITY response */ if(sscanf(line + 2, "OK [UIDVALIDITY %19[0123456789]]", tmp) == 1) { Curl_safefree(imapc->mailbox_uidvalidity); imapc->mailbox_uidvalidity = strdup(tmp); } } else if(imapcode == 'O') { /* Check if the UIDVALIDITY has been specified and matches */ if(imap->uidvalidity && imapc->mailbox_uidvalidity && strcmp(imap->uidvalidity, imapc->mailbox_uidvalidity)) { failf(conn->data, "Mailbox UIDVALIDITY has changed"); result = CURLE_REMOTE_FILE_NOT_FOUND; } else { /* Note the currently opened mailbox on this connection */ imapc->mailbox = strdup(imap->mailbox); if(imap->custom) result = imap_perform_list(conn); else result = imap_perform_fetch(conn); } } else { failf(data, "Select failed"); result = CURLE_LOGIN_DENIED; } return result; } /* For the (first line of the) FETCH responses */ static CURLcode imap_state_fetch_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct imap_conn *imapc = &conn->proto.imapc; struct pingpong *pp = &imapc->pp; const char *ptr = data->state.buffer; bool parsed = FALSE; curl_off_t size; (void)instate; /* no use for this yet */ if(imapcode != '*') { Curl_pgrsSetDownloadSize(data, 0); state(conn, IMAP_STOP); return CURLE_REMOTE_FILE_NOT_FOUND; /* TODO: Fix error code */ } /* Something like this is received "* 1 FETCH (BODY[TEXT] {2021}\r" so parse the continuation data contained within the curly brackets */ while(*ptr && (*ptr != '{')) ptr++; if(*ptr == '{') { char *endptr; size = curlx_strtoofft(ptr + 1, &endptr, 10); if(endptr - ptr > 1 && endptr[0] == '}' && endptr[1] == '\r' && endptr[2] == '\0') parsed = TRUE; } if(parsed) { infof(data, "Found %" CURL_FORMAT_CURL_OFF_TU " bytes to download\n", size); Curl_pgrsSetDownloadSize(data, size); if(pp->cache) { /* At this point there is a bunch of data in the header "cache" that is actually body content, send it as body and then skip it. Do note that there may even be additional "headers" after the body. */ size_t chunk = pp->cache_size; if(chunk > (size_t)size) /* The conversion from curl_off_t to size_t is always fine here */ chunk = (size_t)size; result = Curl_client_write(conn, CLIENTWRITE_BODY, pp->cache, chunk); if(result) return result; data->req.bytecount += chunk; infof(data, "Written %" CURL_FORMAT_CURL_OFF_TU " bytes, %" CURL_FORMAT_CURL_OFF_TU " bytes are left for transfer\n", (curl_off_t)chunk, size - chunk); /* Have we used the entire cache or just part of it?*/ if(pp->cache_size > chunk) { /* Only part of it so shrink the cache to fit the trailing data */ memmove(pp->cache, pp->cache + chunk, pp->cache_size - chunk); pp->cache_size -= chunk; } else { /* Free the cache */ Curl_safefree(pp->cache); /* Reset the cache size */ pp->cache_size = 0; } } if(data->req.bytecount == size) /* The entire data is already transferred! */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); else { /* IMAP download */ data->req.maxdownload = size; Curl_setup_transfer(conn, FIRSTSOCKET, size, FALSE, NULL, -1, NULL); } } else { /* We don't know how to parse this line */ failf(pp->conn->data, "Failed to parse FETCH response."); result = CURLE_FTP_WEIRD_SERVER_REPLY; /* TODO: fix this code */ } /* End of DO phase */ state(conn, IMAP_STOP); return result; } /* For final FETCH responses performed after the download */ static CURLcode imap_state_fetch_final_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; (void)instate; /* No use for this yet */ if(imapcode != 'O') result = CURLE_FTP_WEIRD_SERVER_REPLY; /* TODO: Fix error code */ else /* End of DONE phase */ state(conn, IMAP_STOP); return result; } /* For APPEND responses */ static CURLcode imap_state_append_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* No use for this yet */ if(imapcode != '+') { result = CURLE_UPLOAD_FAILED; } else { /* Set the progress upload size */ Curl_pgrsSetUploadSize(data, data->set.infilesize); /* IMAP upload */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, FIRSTSOCKET, NULL); /* End of DO phase */ state(conn, IMAP_STOP); } return result; } /* For final APPEND responses performed after the upload */ static CURLcode imap_state_append_final_resp(struct connectdata *conn, int imapcode, imapstate instate) { CURLcode result = CURLE_OK; (void)instate; /* No use for this yet */ if(imapcode != 'O') result = CURLE_UPLOAD_FAILED; else /* End of DONE phase */ state(conn, IMAP_STOP); return result; } static CURLcode imap_statemach_act(struct connectdata *conn) { CURLcode result = CURLE_OK; curl_socket_t sock = conn->sock[FIRSTSOCKET]; int imapcode; struct imap_conn *imapc = &conn->proto.imapc; struct pingpong *pp = &imapc->pp; size_t nread = 0; /* Busy upgrading the connection; right now all I/O is SSL/TLS, not IMAP */ if(imapc->state == IMAP_UPGRADETLS) return imap_perform_upgrade_tls(conn); /* Flush any data that needs to be sent */ if(pp->sendleft) return Curl_pp_flushsend(pp); do { /* Read the response from the server */ result = Curl_pp_readresp(sock, pp, &imapcode, &nread); if(result) return result; /* Was there an error parsing the response line? */ if(imapcode == -1) return CURLE_FTP_WEIRD_SERVER_REPLY; if(!imapcode) break; /* We have now received a full IMAP server response */ switch(imapc->state) { case IMAP_SERVERGREET: result = imap_state_servergreet_resp(conn, imapcode, imapc->state); break; case IMAP_CAPABILITY: result = imap_state_capability_resp(conn, imapcode, imapc->state); break; case IMAP_STARTTLS: result = imap_state_starttls_resp(conn, imapcode, imapc->state); break; case IMAP_AUTHENTICATE_PLAIN: result = imap_state_auth_plain_resp(conn, imapcode, imapc->state); break; case IMAP_AUTHENTICATE_LOGIN: result = imap_state_auth_login_resp(conn, imapcode, imapc->state); break; case IMAP_AUTHENTICATE_LOGIN_PASSWD: result = imap_state_auth_login_password_resp(conn, imapcode, imapc->state); break; #ifndef CURL_DISABLE_CRYPTO_AUTH case IMAP_AUTHENTICATE_CRAMMD5: result = imap_state_auth_cram_resp(conn, imapcode, imapc->state); break; case IMAP_AUTHENTICATE_DIGESTMD5: result = imap_state_auth_digest_resp(conn, imapcode, imapc->state); break; case IMAP_AUTHENTICATE_DIGESTMD5_RESP: result = imap_state_auth_digest_resp_resp(conn, imapcode, imapc->state); break; #endif #ifdef USE_NTLM case IMAP_AUTHENTICATE_NTLM: result = imap_state_auth_ntlm_resp(conn, imapcode, imapc->state); break; case IMAP_AUTHENTICATE_NTLM_TYPE2MSG: result = imap_state_auth_ntlm_type2msg_resp(conn, imapcode, imapc->state); break; #endif case IMAP_AUTHENTICATE_XOAUTH2: result = imap_state_auth_xoauth2_resp(conn, imapcode, imapc->state); break; case IMAP_AUTHENTICATE_CANCEL: result = imap_state_auth_cancel_resp(conn, imapcode, imapc->state); break; case IMAP_AUTHENTICATE_FINAL: result = imap_state_auth_final_resp(conn, imapcode, imapc->state); break; case IMAP_LOGIN: result = imap_state_login_resp(conn, imapcode, imapc->state); break; case IMAP_LIST: result = imap_state_list_resp(conn, imapcode, imapc->state); break; case IMAP_SELECT: result = imap_state_select_resp(conn, imapcode, imapc->state); break; case IMAP_FETCH: result = imap_state_fetch_resp(conn, imapcode, imapc->state); break; case IMAP_FETCH_FINAL: result = imap_state_fetch_final_resp(conn, imapcode, imapc->state); break; case IMAP_APPEND: result = imap_state_append_resp(conn, imapcode, imapc->state); break; case IMAP_APPEND_FINAL: result = imap_state_append_final_resp(conn, imapcode, imapc->state); break; case IMAP_LOGOUT: /* fallthrough, just stop! */ default: /* internal error */ state(conn, IMAP_STOP); break; } } while(!result && imapc->state != IMAP_STOP && Curl_pp_moredata(pp)); return result; } /* Called repeatedly until done from multi.c */ static CURLcode imap_multi_statemach(struct connectdata *conn, bool *done) { CURLcode result = CURLE_OK; struct imap_conn *imapc = &conn->proto.imapc; if((conn->handler->flags & PROTOPT_SSL) && !imapc->ssldone) { result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &imapc->ssldone); if(result || !imapc->ssldone) return result; } result = Curl_pp_statemach(&imapc->pp, FALSE); *done = (imapc->state == IMAP_STOP) ? TRUE : FALSE; return result; } static CURLcode imap_block_statemach(struct connectdata *conn) { CURLcode result = CURLE_OK; struct imap_conn *imapc = &conn->proto.imapc; while(imapc->state != IMAP_STOP && !result) result = Curl_pp_statemach(&imapc->pp, TRUE); return result; } /* Allocate and initialize the struct IMAP for the current SessionHandle if required */ static CURLcode imap_init(struct connectdata *conn) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct IMAP *imap; imap = data->req.protop = calloc(sizeof(struct IMAP), 1); if(!imap) result = CURLE_OUT_OF_MEMORY; return result; } /* For the IMAP "protocol connect" and "doing" phases only */ static int imap_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { return Curl_pp_getsock(&conn->proto.imapc.pp, socks, numsocks); } /*********************************************************************** * * imap_connect() * * This function 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 if not. */ static CURLcode imap_connect(struct connectdata *conn, bool *done) { CURLcode result = CURLE_OK; struct imap_conn *imapc = &conn->proto.imapc; struct pingpong *pp = &imapc->pp; *done = FALSE; /* default to not done yet */ /* We always support persistent connections in IMAP */ conn->bits.close = FALSE; /* Set the default response time-out */ pp->response_time = RESP_TIMEOUT; pp->statemach_act = imap_statemach_act; pp->endofresp = imap_endofresp; pp->conn = conn; /* Set the default preferred authentication type and mechanism */ imapc->preftype = IMAP_TYPE_ANY; imapc->prefmech = SASL_AUTH_ANY; /* Initialise the pingpong layer */ Curl_pp_init(pp); /* Parse the URL options */ result = imap_parse_url_options(conn); if(result) return result; /* Start off waiting for the server greeting response */ state(conn, IMAP_SERVERGREET); /* Start off with an response id of '*' */ strcpy(imapc->resptag, "*"); result = imap_multi_statemach(conn, done); return result; } /*********************************************************************** * * imap_done() * * The DONE function. This does what needs to be done after a single DO has * performed. * * Input argument is already checked for validity. */ static CURLcode imap_done(struct connectdata *conn, CURLcode status, bool premature) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct IMAP *imap = data->req.protop; (void)premature; if(!imap) /* When the easy handle is removed from the multi interface while libcurl is still trying to resolve the host name, the IMAP struct is not yet initialized. However, the removal action calls Curl_done() which in turn calls this function, so we simply return success. */ return CURLE_OK; if(status) { conn->bits.close = TRUE; /* marked for closure */ result = status; /* use the already set error code */ } else if(!data->set.connect_only && !imap->custom && (imap->uid || data->set.upload)) { /* Handle responses after FETCH or APPEND transfer has finished */ if(!data->set.upload) state(conn, IMAP_FETCH_FINAL); else { /* End the APPEND command first by sending an empty line */ result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", ""); if(!result) state(conn, IMAP_APPEND_FINAL); } /* Run the state-machine TODO: when the multi interface is used, this _really_ should be using the imap_multi_statemach function but we have no general support for non-blocking DONE operations, not in the multi state machine and with Curl_done() invokes on several places in the code! */ if(!result) result = imap_block_statemach(conn); } /* Cleanup our per-request based variables */ Curl_safefree(imap->mailbox); Curl_safefree(imap->uidvalidity); Curl_safefree(imap->uid); Curl_safefree(imap->section); Curl_safefree(imap->custom); Curl_safefree(imap->custom_params); /* Clear the transfer mode for the next request */ imap->transfer = FTPTRANSFER_BODY; return result; } /*********************************************************************** * * imap_perform() * * This is the actual DO function for IMAP. Fetch or append a message, or do * other things according to the options previously setup. */ static CURLcode imap_perform(struct connectdata *conn, bool *connected, bool *dophase_done) { /* This is IMAP and no proxy */ CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct IMAP *imap = data->req.protop; struct imap_conn *imapc = &conn->proto.imapc; bool selected = FALSE; DEBUGF(infof(conn->data, "DO phase starts\n")); if(conn->data->set.opt_no_body) { /* Requested no body means no transfer */ imap->transfer = FTPTRANSFER_INFO; } *dophase_done = FALSE; /* not done yet */ /* Determine if the requested mailbox (with the same UIDVALIDITY if set) has already been selected on this connection */ if(imap->mailbox && imapc->mailbox && !strcmp(imap->mailbox, imapc->mailbox) && (!imap->uidvalidity || !imapc->mailbox_uidvalidity || !strcmp(imap->uidvalidity, imapc->mailbox_uidvalidity))) selected = TRUE; /* Start the first command in the DO phase */ if(conn->data->set.upload) /* APPEND can be executed directly */ result = imap_perform_append(conn); else if(imap->custom && (selected || !imap->mailbox)) /* Custom command using the same mailbox or no mailbox */ result = imap_perform_list(conn); else if(!imap->custom && selected && imap->uid) /* FETCH from the same mailbox */ result = imap_perform_fetch(conn); else if(imap->mailbox && !selected && (imap->custom || imap->uid)) /* SELECT the mailbox */ result = imap_perform_select(conn); else /* LIST */ result = imap_perform_list(conn); if(result) return result; /* Run the state-machine */ result = imap_multi_statemach(conn, dophase_done); *connected = conn->bits.tcpconnect[FIRSTSOCKET]; if(*dophase_done) DEBUGF(infof(conn->data, "DO phase is complete\n")); return result; } /*********************************************************************** * * imap_do() * * This function is registered as 'curl_do' function. It decodes the path * parts etc as a wrapper to the actual DO function (imap_perform). * * The input argument is already checked for validity. */ static CURLcode imap_do(struct connectdata *conn, bool *done) { CURLcode result = CURLE_OK; *done = FALSE; /* default to false */ /* Parse the URL path */ result = imap_parse_url_path(conn); if(result) return result; /* Parse the custom request */ result = imap_parse_custom_request(conn); if(result) return result; result = imap_regular_transfer(conn, done); return result; } /*********************************************************************** * * imap_disconnect() * * Disconnect from an IMAP server. Cleanup protocol-specific per-connection * resources. BLOCKING. */ static CURLcode imap_disconnect(struct connectdata *conn, bool dead_connection) { struct imap_conn *imapc = &conn->proto.imapc; /* 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. */ /* The IMAP session may or may not have been allocated/setup at this point! */ if(!dead_connection && imapc->pp.conn && imapc->pp.conn->bits.protoconnstart) if(!imap_perform_logout(conn)) (void)imap_block_statemach(conn); /* ignore errors on LOGOUT */ /* Disconnect from the server */ Curl_pp_disconnect(&imapc->pp); /* Cleanup the SASL module */ Curl_sasl_cleanup(conn, imapc->authused); /* Cleanup our connection based variables */ Curl_safefree(imapc->mailbox); Curl_safefree(imapc->mailbox_uidvalidity); return CURLE_OK; } /* Call this when the DO phase has completed */ static CURLcode imap_dophase_done(struct connectdata *conn, bool connected) { struct IMAP *imap = conn->data->req.protop; (void)connected; if(imap->transfer != FTPTRANSFER_BODY) /* no data to transfer */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); return CURLE_OK; } /* Called from multi.c while DOing */ static CURLcode imap_doing(struct connectdata *conn, bool *dophase_done) { CURLcode result = imap_multi_statemach(conn, dophase_done); if(result) DEBUGF(infof(conn->data, "DO phase failed\n")); else if(*dophase_done) { result = imap_dophase_done(conn, FALSE /* not connected */); DEBUGF(infof(conn->data, "DO phase is complete\n")); } return result; } /*********************************************************************** * * imap_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. */ static CURLcode imap_regular_transfer(struct connectdata *conn, bool *dophase_done) { CURLcode result = CURLE_OK; bool connected = FALSE; struct SessionHandle *data = conn->data; /* Make sure size is unknown at this point */ data->req.size = -1; /* Set the progress data */ Curl_pgrsSetUploadCounter(data, 0); Curl_pgrsSetDownloadCounter(data, 0); Curl_pgrsSetUploadSize(data, 0); Curl_pgrsSetDownloadSize(data, 0); /* Carry out the perform */ result = imap_perform(conn, &connected, dophase_done); /* Perform post DO phase operations if necessary */ if(!result && *dophase_done) result = imap_dophase_done(conn, connected); return result; } static CURLcode imap_setup_connection(struct connectdata *conn) { struct SessionHandle *data = conn->data; /* Initialise the IMAP layer */ CURLcode result = imap_init(conn); if(result) return result; if(conn->bits.httpproxy && !data->set.tunnel_thru_httpproxy) { /* Unless we have asked to tunnel IMAP operations through the proxy, we switch and use HTTP operations only */ #ifndef CURL_DISABLE_HTTP if(conn->handler == &Curl_handler_imap) conn->handler = &Curl_handler_imap_proxy; else { #ifdef USE_SSL conn->handler = &Curl_handler_imaps_proxy; #else failf(data, "IMAPS not supported!"); return CURLE_UNSUPPORTED_PROTOCOL; #endif } /* set it up as an HTTP connection instead */ return conn->handler->setup_connection(conn); #else failf(data, "IMAP over http proxy requires HTTP support built-in!"); return CURLE_UNSUPPORTED_PROTOCOL; #endif } data->state.path++; /* don't include the initial slash */ return CURLE_OK; } /*********************************************************************** * * imap_sendf() * * Sends the formated string as an IMAP command to the server. * * Designed to never block. */ static CURLcode imap_sendf(struct connectdata *conn, const char *fmt, ...) { CURLcode result = CURLE_OK; struct imap_conn *imapc = &conn->proto.imapc; char *taggedfmt; va_list ap; DEBUGASSERT(fmt); /* Calculate the next command ID wrapping at 3 digits */ imapc->cmdid = (imapc->cmdid + 1) % 1000; /* Calculate the tag based on the connection ID and command ID */ snprintf(imapc->resptag, sizeof(imapc->resptag), "%c%03d", 'A' + curlx_sltosi(conn->connection_id % 26), imapc->cmdid); /* Prefix the format with the tag */ taggedfmt = aprintf("%s %s", imapc->resptag, fmt); if(!taggedfmt) return CURLE_OUT_OF_MEMORY; /* Send the data with the tag */ va_start(ap, fmt); result = Curl_pp_vsendf(&imapc->pp, taggedfmt, ap); va_end(ap); Curl_safefree(taggedfmt); return result; } /*********************************************************************** * * imap_atom() * * Checks the input string for characters that need escaping and returns an * atom ready for sending to the server. * * The returned string needs to be freed. * */ static char *imap_atom(const char *str) { const char *p1; char *p2; size_t backsp_count = 0; size_t quote_count = 0; bool space_exists = FALSE; size_t newlen = 0; char *newstr = NULL; if(!str) return NULL; /* Count any unescapped characters */ p1 = str; while(*p1) { if(*p1 == '\\') backsp_count++; else if(*p1 == '"') quote_count++; else if(*p1 == ' ') space_exists = TRUE; p1++; } /* Does the input contain any unescapped characters? */ if(!backsp_count && !quote_count && !space_exists) return strdup(str); /* Calculate the new string length */ newlen = strlen(str) + backsp_count + quote_count + (space_exists ? 2 : 0); /* Allocate the new string */ newstr = (char *) malloc((newlen + 1) * sizeof(char)); if(!newstr) return NULL; /* Surround the string in quotes if necessary */ p2 = newstr; if(space_exists) { newstr[0] = '"'; newstr[newlen - 1] = '"'; p2++; } /* Copy the string, escaping backslash and quote characters along the way */ p1 = str; while(*p1) { if(*p1 == '\\' || *p1 == '"') { *p2 = '\\'; p2++; } *p2 = *p1; p1++; p2++; } /* Terminate the string */ newstr[newlen] = '\0'; return newstr; } /*********************************************************************** * * imap_is_bchar() * * Portable test of whether the specified char is a "bchar" as defined in the * grammar of RFC-5092. */ static bool imap_is_bchar(char ch) { switch(ch) { /* bchar */ case ':': case '@': case '/': /* bchar -> achar */ case '&': case '=': /* bchar -> achar -> uchar -> unreserved */ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': case '-': case '.': case '_': case '~': /* bchar -> achar -> uchar -> sub-delims-sh */ case '!': case '$': case '\'': case '(': case ')': case '*': case '+': case ',': /* bchar -> achar -> uchar -> pct-encoded */ case '%': /* HEXDIG chars are already included above */ return true; default: return false; } } /*********************************************************************** * * imap_parse_url_options() * * Parse the URL login options. */ static CURLcode imap_parse_url_options(struct connectdata *conn) { CURLcode result = CURLE_OK; struct imap_conn *imapc = &conn->proto.imapc; const char *options = conn->options; const char *ptr = options; bool reset = TRUE; while(ptr && *ptr) { const char *key = ptr; while(*ptr && *ptr != '=') ptr++; if(strnequal(key, "AUTH", 4)) { size_t len = 0; const char *value = ++ptr; if(reset) { reset = FALSE; imapc->preftype = IMAP_TYPE_NONE; imapc->prefmech = SASL_AUTH_NONE; } while(*ptr && *ptr != ';') { ptr++; len++; } if(strnequal(value, "*", len)) { imapc->preftype = IMAP_TYPE_ANY; imapc->prefmech = SASL_AUTH_ANY; } else if(strnequal(value, SASL_MECH_STRING_LOGIN, len)) { imapc->preftype = IMAP_TYPE_SASL; imapc->prefmech |= SASL_MECH_LOGIN; } else if(strnequal(value, SASL_MECH_STRING_PLAIN, len)) { imapc->preftype = IMAP_TYPE_SASL; imapc->prefmech |= SASL_MECH_PLAIN; } else if(strnequal(value, SASL_MECH_STRING_CRAM_MD5, len)) { imapc->preftype = IMAP_TYPE_SASL; imapc->prefmech |= SASL_MECH_CRAM_MD5; } else if(strnequal(value, SASL_MECH_STRING_DIGEST_MD5, len)) { imapc->preftype = IMAP_TYPE_SASL; imapc->prefmech |= SASL_MECH_DIGEST_MD5; } else if(strnequal(value, SASL_MECH_STRING_GSSAPI, len)) { imapc->preftype = IMAP_TYPE_SASL; imapc->prefmech |= SASL_MECH_GSSAPI; } else if(strnequal(value, SASL_MECH_STRING_NTLM, len)) { imapc->preftype = IMAP_TYPE_SASL; imapc->prefmech |= SASL_MECH_NTLM; } else if(strnequal(value, SASL_MECH_STRING_XOAUTH2, len)) { imapc->preftype = IMAP_TYPE_SASL; imapc->prefmech |= SASL_MECH_XOAUTH2; } if(*ptr == ';') ptr++; } else result = CURLE_URL_MALFORMAT; } return result; } /*********************************************************************** * * imap_parse_url_path() * * Parse the URL path into separate path components. * */ static CURLcode imap_parse_url_path(struct connectdata *conn) { /* The imap struct is already initialised in imap_connect() */ CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct IMAP *imap = data->req.protop; const char *begin = data->state.path; const char *ptr = begin; /* See how much of the URL is a valid path and decode it */ while(imap_is_bchar(*ptr)) ptr++; if(ptr != begin) { /* Remove the trailing slash if present */ const char *end = ptr; if(end > begin && end[-1] == '/') end--; result = Curl_urldecode(data, begin, end - begin, &imap->mailbox, NULL, TRUE); if(result) return result; } else imap->mailbox = NULL; /* There can be any number of parameters in the form ";NAME=VALUE" */ while(*ptr == ';') { char *name; char *value; size_t valuelen; /* Find the length of the name parameter */ begin = ++ptr; while(*ptr && *ptr != '=') ptr++; if(!*ptr) return CURLE_URL_MALFORMAT; /* Decode the name parameter */ result = Curl_urldecode(data, begin, ptr - begin, &name, NULL, TRUE); if(result) return result; /* Find the length of the value parameter */ begin = ++ptr; while(imap_is_bchar(*ptr)) ptr++; /* Decode the value parameter */ result = Curl_urldecode(data, begin, ptr - begin, &value, &valuelen, TRUE); if(result) { Curl_safefree(name); return result; } DEBUGF(infof(conn->data, "IMAP URL parameter '%s' = '%s'\n", name, value)); /* Process the known hierarchical parameters (UIDVALIDITY, UID and SECTION) stripping of the trailing slash character if it is present. Note: Unknown parameters trigger a URL_MALFORMAT error. */ if(Curl_raw_equal(name, "UIDVALIDITY") && !imap->uidvalidity) { if(valuelen > 0 && value[valuelen - 1] == '/') value[valuelen - 1] = '\0'; imap->uidvalidity = value; value = NULL; } else if(Curl_raw_equal(name, "UID") && !imap->uid) { if(valuelen > 0 && value[valuelen - 1] == '/') value[valuelen - 1] = '\0'; imap->uid = value; value = NULL; } else if(Curl_raw_equal(name, "SECTION") && !imap->section) { if(valuelen > 0 && value[valuelen - 1] == '/') value[valuelen - 1] = '\0'; imap->section = value; value = NULL; } else { Curl_safefree(name); Curl_safefree(value); return CURLE_URL_MALFORMAT; } Curl_safefree(name); Curl_safefree(value); } /* Any extra stuff at the end of the URL is an error */ if(*ptr) return CURLE_URL_MALFORMAT; return CURLE_OK; } /*********************************************************************** * * imap_parse_custom_request() * * Parse the custom request. */ static CURLcode imap_parse_custom_request(struct connectdata *conn) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct IMAP *imap = data->req.protop; const char *custom = data->set.str[STRING_CUSTOMREQUEST]; if(custom) { /* URL decode the custom request */ result = Curl_urldecode(data, custom, 0, &imap->custom, NULL, TRUE); /* Extract the parameters if specified */ if(!result) { const char *params = imap->custom; while(*params && *params != ' ') params++; if(*params) { imap->custom_params = strdup(params); imap->custom[params - imap->custom] = '\0'; if(!imap->custom_params) result = CURLE_OUT_OF_MEMORY; } } } return result; } /*********************************************************************** * * imap_calc_sasl_details() * * Calculate the required login details for SASL authentication. */ static CURLcode imap_calc_sasl_details(struct connectdata *conn, const char **mech, char **initresp, size_t *len, imapstate *state1, imapstate *state2) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct imap_conn *imapc = &conn->proto.imapc; /* Calculate the supported authentication mechanism, by decreasing order of security, as well as the initial response where appropriate */ #ifndef CURL_DISABLE_CRYPTO_AUTH if((imapc->authmechs & SASL_MECH_DIGEST_MD5) && (imapc->prefmech & SASL_MECH_DIGEST_MD5)) { *mech = SASL_MECH_STRING_DIGEST_MD5; *state1 = IMAP_AUTHENTICATE_DIGESTMD5; imapc->authused = SASL_MECH_DIGEST_MD5; } else if((imapc->authmechs & SASL_MECH_CRAM_MD5) && (imapc->prefmech & SASL_MECH_CRAM_MD5)) { *mech = SASL_MECH_STRING_CRAM_MD5; *state1 = IMAP_AUTHENTICATE_CRAMMD5; imapc->authused = SASL_MECH_CRAM_MD5; } else #endif #ifdef USE_NTLM if((imapc->authmechs & SASL_MECH_NTLM) && (imapc->prefmech & SASL_MECH_NTLM)) { *mech = SASL_MECH_STRING_NTLM; *state1 = IMAP_AUTHENTICATE_NTLM; *state2 = IMAP_AUTHENTICATE_NTLM_TYPE2MSG; imapc->authused = SASL_MECH_NTLM; if(imapc->ir_supported || data->set.sasl_ir) result = Curl_sasl_create_ntlm_type1_message(conn->user, conn->passwd, &conn->ntlm, initresp, len); } else #endif if(((imapc->authmechs & SASL_MECH_XOAUTH2) && (imapc->prefmech & SASL_MECH_XOAUTH2) && (imapc->prefmech != SASL_AUTH_ANY)) || conn->xoauth2_bearer) { *mech = SASL_MECH_STRING_XOAUTH2; *state1 = IMAP_AUTHENTICATE_XOAUTH2; *state2 = IMAP_AUTHENTICATE_FINAL; imapc->authused = SASL_MECH_XOAUTH2; if(imapc->ir_supported || data->set.sasl_ir) result = Curl_sasl_create_xoauth2_message(data, conn->user, conn->xoauth2_bearer, initresp, len); } else if((imapc->authmechs & SASL_MECH_LOGIN) && (imapc->prefmech & SASL_MECH_LOGIN)) { *mech = SASL_MECH_STRING_LOGIN; *state1 = IMAP_AUTHENTICATE_LOGIN; *state2 = IMAP_AUTHENTICATE_LOGIN_PASSWD; imapc->authused = SASL_MECH_LOGIN; if(imapc->ir_supported || data->set.sasl_ir) result = Curl_sasl_create_login_message(data, conn->user, initresp, len); } else if((imapc->authmechs & SASL_MECH_PLAIN) && (imapc->prefmech & SASL_MECH_PLAIN)) { *mech = SASL_MECH_STRING_PLAIN; *state1 = IMAP_AUTHENTICATE_PLAIN; *state2 = IMAP_AUTHENTICATE_FINAL; imapc->authused = SASL_MECH_PLAIN; if(imapc->ir_supported || data->set.sasl_ir) result = Curl_sasl_create_plain_message(data, conn->user, conn->passwd, initresp, len); } return result; } #endif /* CURL_DISABLE_IMAP */ curl-7.35.0/lib/strequal.c0000644000175000017500000000416612213173003012245 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_STRINGS_H #include #endif #include "strequal.h" /* * @unittest: 1301 */ 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 } /* * @unittest: 1301 */ int curl_strnequal(const char *first, const char *second, size_t max) { #if defined(HAVE_STRNCASECMP) return !strncasecmp(first, second, max); #elif defined(HAVE_STRNCMPI) return !strncmpi(first, second, max); #elif defined(HAVE_STRNICMP) 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-7.35.0/lib/inet_pton.h0000644000175000017500000000246412213173003012410 00000000000000#ifndef HEADER_CURL_INET_PTON_H #define HEADER_CURL_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. * ***************************************************************************/ #include "curl_setup.h" int Curl_inet_pton(int, const char *, void *); #ifdef HAVE_INET_PTON #ifdef HAVE_ARPA_INET_H #include #endif #define Curl_inet_pton(x,y,z) inet_pton(x,y,z) #endif #endif /* HEADER_CURL_INET_PTON_H */ curl-7.35.0/lib/ssh.h0000644000175000017500000001476612213173003011216 00000000000000#ifndef HEADER_CURL_SSH_H #define HEADER_CURL_SSH_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_LIBSSH2_H #include #include #endif /* HAVE_LIBSSH2_H */ /**************************************************************************** * SSH unique setup ***************************************************************************/ typedef enum { SSH_NO_STATE = -1, /* Used for "nextState" so say there is none */ SSH_STOP = 0, /* do nothing state, stops the state machine */ SSH_INIT, /* First state in SSH-CONNECT */ SSH_S_STARTUP, /* Session startup */ SSH_HOSTKEY, /* verify hostkey */ SSH_AUTHLIST, SSH_AUTH_PKEY_INIT, SSH_AUTH_PKEY, SSH_AUTH_PASS_INIT, SSH_AUTH_PASS, SSH_AUTH_AGENT_INIT,/* initialize then wait for connection to agent */ SSH_AUTH_AGENT_LIST,/* ask for list then wait for entire list to come */ SSH_AUTH_AGENT, /* attempt one key at a time */ SSH_AUTH_HOST_INIT, SSH_AUTH_HOST, SSH_AUTH_KEY_INIT, SSH_AUTH_KEY, SSH_AUTH_DONE, SSH_SFTP_INIT, SSH_SFTP_REALPATH, /* Last state in SSH-CONNECT */ SSH_SFTP_QUOTE_INIT, /* First state in SFTP-DO */ SSH_SFTP_POSTQUOTE_INIT, /* (Possibly) First state in SFTP-DONE */ SSH_SFTP_QUOTE, SSH_SFTP_NEXT_QUOTE, SSH_SFTP_QUOTE_STAT, SSH_SFTP_QUOTE_SETSTAT, SSH_SFTP_QUOTE_SYMLINK, SSH_SFTP_QUOTE_MKDIR, SSH_SFTP_QUOTE_RENAME, SSH_SFTP_QUOTE_RMDIR, SSH_SFTP_QUOTE_UNLINK, SSH_SFTP_TRANS_INIT, SSH_SFTP_UPLOAD_INIT, SSH_SFTP_CREATE_DIRS_INIT, SSH_SFTP_CREATE_DIRS, SSH_SFTP_CREATE_DIRS_MKDIR, SSH_SFTP_READDIR_INIT, SSH_SFTP_READDIR, SSH_SFTP_READDIR_LINK, SSH_SFTP_READDIR_BOTTOM, SSH_SFTP_READDIR_DONE, SSH_SFTP_DOWNLOAD_INIT, SSH_SFTP_DOWNLOAD_STAT, /* Last state in SFTP-DO */ SSH_SFTP_CLOSE, /* Last state in SFTP-DONE */ SSH_SFTP_SHUTDOWN, /* First state in SFTP-DISCONNECT */ SSH_SCP_TRANS_INIT, /* First state in SCP-DO */ SSH_SCP_UPLOAD_INIT, SSH_SCP_DOWNLOAD_INIT, SSH_SCP_DONE, SSH_SCP_SEND_EOF, SSH_SCP_WAIT_EOF, SSH_SCP_WAIT_CLOSE, SSH_SCP_CHANNEL_FREE, /* Last state in SCP-DONE */ SSH_SESSION_DISCONNECT, /* First state in SCP-DISCONNECT */ SSH_SESSION_FREE, /* Last state in SCP/SFTP-DISCONNECT */ SSH_QUIT, SSH_LAST /* never used */ } sshstate; /* this struct is used in the HandleData struct which is part of the SessionHandle, which means this is used on a per-easy handle basis. Everything that is strictly related to a connection is banned from this struct. */ struct SSHPROTO { char *path; /* the path we operate on */ }; /* ssh_conn is used for struct connection-oriented data in the connectdata struct */ struct ssh_conn { const char *authlist; /* List of auth. methods, managed by libssh2 */ #ifdef USE_LIBSSH2 const char *passphrase; /* pass-phrase to use */ char *rsa_pub; /* path name */ char *rsa; /* path name */ bool authed; /* the connection has been authenticated fine */ sshstate state; /* always use ssh.c:state() to change state! */ sshstate nextstate; /* the state to goto after stopping */ CURLcode actualcode; /* the actual error code */ struct curl_slist *quote_item; /* for the quote option */ char *quote_path1; /* two generic pointers for the QUOTE stuff */ char *quote_path2; LIBSSH2_SFTP_ATTRIBUTES quote_attrs; /* used by the SFTP_QUOTE state */ bool acceptfail; /* used by the SFTP_QUOTE (continue if quote command fails) */ char *homedir; /* when doing SFTP we figure out home dir in the connect phase */ /* Here's a set of struct members used by the SFTP_READDIR state */ LIBSSH2_SFTP_ATTRIBUTES readdir_attrs; char *readdir_filename; char *readdir_longentry; int readdir_len, readdir_totalLen, readdir_currLen; char *readdir_line; char *readdir_linkPath; /* end of READDIR stuff */ int secondCreateDirs; /* counter use by the code to see if the second attempt has been made to change to/create a directory */ char *slash_pos; /* used by the SFTP_CREATE_DIRS state */ LIBSSH2_SESSION *ssh_session; /* Secure Shell session */ LIBSSH2_CHANNEL *ssh_channel; /* Secure Shell channel handle */ LIBSSH2_SFTP *sftp_session; /* SFTP handle */ LIBSSH2_SFTP_HANDLE *sftp_handle; int orig_waitfor; /* default READ/WRITE bits wait for */ #ifdef HAVE_LIBSSH2_AGENT_API LIBSSH2_AGENT *ssh_agent; /* proxy to ssh-agent/pageant */ struct libssh2_agent_publickey *sshagent_identity, *sshagent_prev_identity; #endif /* note that HAVE_LIBSSH2_KNOWNHOST_API is a define set in the libssh2.h header */ #ifdef HAVE_LIBSSH2_KNOWNHOST_API LIBSSH2_KNOWNHOSTS *kh; #endif #endif /* USE_LIBSSH2 */ }; #ifdef USE_LIBSSH2 #if !defined(LIBSSH2_VERSION_NUM) || (LIBSSH2_VERSION_NUM < 0x001000) # error "SCP/SFTP protocols require libssh2 0.16 or later" #endif #if defined(LIBSSH2_VERSION_NUM) && (LIBSSH2_VERSION_NUM >= 0x010000) # define HAVE_LIBSSH2_SFTP_SEEK64 1 #else # undef HAVE_LIBSSH2_SFTP_SEEK64 #endif #if defined(LIBSSH2_VERSION_NUM) && (LIBSSH2_VERSION_NUM >= 0x010206) # define HAVE_LIBSSH2_SCP_SEND64 1 #else # undef HAVE_LIBSSH2_SCP_SEND64 #endif extern const struct Curl_handler Curl_handler_scp; extern const struct Curl_handler Curl_handler_sftp; #endif /* USE_LIBSSH2 */ #endif /* HEADER_CURL_SSH_H */ curl-7.35.0/lib/hostip6.c0000644000175000017500000001440212262353672012013 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef __VMS #include #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 #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /*********************************************************************** * Only for ipv6-enabled builds **********************************************************************/ #ifdef CURLRES_IPV6 #if defined(CURLDEBUG) && defined(HAVE_GETNAMEINFO) /* 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 want to include in memdebug.c */ /* * For CURLRES_ARS, this should be written using ares_gethostbyaddr() * (ignoring the fact c-ares doesn't return 'serv'). */ 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 */ curl_memlog("GETNAME %s:%d getnameinfo()\n", source, line); else curl_memlog("GETNAME %s:%d getnameinfo() failed = %d\n", source, line, res); return res; } #endif /* defined(CURLDEBUG) && defined(HAVE_GETNAMEINFO) */ /* * Curl_ipv6works() returns TRUE if ipv6 seems to work. */ bool Curl_ipv6works(void) { /* the nature of most system is that IPv6 status doesn't come and go during a program's lifetime so we only probe the first time and then we have the info kept for fast re-use */ static int ipv6_works = -1; if(-1 == ipv6_works) { /* probe to see if we have a working IPv6 stack */ curl_socket_t s = socket(PF_INET6, SOCK_DGRAM, 0); if(s == CURL_SOCKET_BAD) /* an ipv6 address was requested but we can't get/use one */ ipv6_works = 0; else { ipv6_works = 1; Curl_closesocket(NULL, s); } } return (ipv6_works>0)?TRUE:FALSE; } /* * Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've * been set and returns TRUE if they are OK. */ bool Curl_ipvalid(struct connectdata *conn) { if(conn->ip_version == CURL_IPRESOLVE_V6) return Curl_ipv6works(); return TRUE; } #if defined(CURLRES_SYNCH) #ifdef DEBUG_ADDRINFO static void dump_addrinfo(struct connectdata *conn, const Curl_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, SOCKERRNO)); } } #else #define dump_addrinfo(x,y) Curl_nop_stmt #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; Curl_addrinfo *res; int error; char sbuf[12]; char *sbufptr = NULL; char addrbuf[128]; int pf; struct SessionHandle *data = conn->data; *waitp = 0; /* synchronous response only */ /* * Check if a limited name resolve has been requested. */ switch(conn->ip_version) { case CURL_IPRESOLVE_V4: pf = PF_INET; break; case CURL_IPRESOLVE_V6: pf = PF_INET6; break; default: pf = PF_UNSPEC; break; } if((pf != PF_INET) && !Curl_ipv6works()) /* the stack seems to be a non-ipv6 one */ pf = PF_INET; 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(port) { snprintf(sbuf, sizeof(sbuf), "%d", port); sbufptr=sbuf; } error = Curl_getaddrinfo_ex(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 /* CURLRES_SYNCH */ #endif /* CURLRES_IPV6 */ curl-7.35.0/lib/splay.h0000644000175000017500000000522312213173003011535 00000000000000#ifndef HEADER_CURL_SPLAY_H #define HEADER_CURL_SPLAY_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1997 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" 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 */ struct timeval key; /* this node's "sort" key */ void *payload; /* data the splay code doesn't care about */ }; struct Curl_tree *Curl_splay(struct timeval i, struct Curl_tree *t); struct Curl_tree *Curl_splayinsert(struct timeval key, struct Curl_tree *t, struct Curl_tree *newnode); #if 0 struct Curl_tree *Curl_splayremove(struct timeval key, struct Curl_tree *t, struct Curl_tree **removed); #endif struct Curl_tree *Curl_splaygetbest(struct timeval key, struct Curl_tree *t, struct Curl_tree **removed); int Curl_splayremovebyaddr(struct Curl_tree *t, struct Curl_tree *removenode, struct Curl_tree **newroot); #define Curl_splaycomparekeys(i,j) ( ((i.tv_sec) < (j.tv_sec)) ? -1 : \ ( ((i.tv_sec) > (j.tv_sec)) ? 1 : \ ( ((i.tv_usec) < (j.tv_usec)) ? -1 : \ ( ((i.tv_usec) > (j.tv_usec)) ? 1 : 0 )))) #ifdef DEBUGBUILD void Curl_splayprint(struct Curl_tree * t, int d, char output); #else #define Curl_splayprint(x,y,z) Curl_nop_stmt #endif #endif /* HEADER_CURL_SPLAY_H */ curl-7.35.0/lib/hostcheck.h0000644000175000017500000000240312213173003012355 00000000000000#ifndef HEADER_CURL_HOSTCHECK_H #define HEADER_CURL_HOSTCHECK_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include #define CURL_HOST_NOMATCH 0 #define CURL_HOST_MATCH 1 int Curl_cert_hostcheck(const char *match_pattern, const char *hostname); #endif /* HEADER_CURL_HOSTCHECK_H */ curl-7.35.0/lib/hash.c0000644000175000017500000002173512262353672011351 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #include "hash.h" #include "llist.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.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; Curl_safefree(e->key); if(e->ptr) { h->dtor(e->ptr); e->ptr = NULL; } e->key_len = 0; free(e); } /* return 1 on error, 0 is fine */ int Curl_hash_init(struct curl_hash *h, int slots, hash_function hfunc, comp_function comparator, curl_hash_dtor dtor) { int i; if(!slots || !hfunc || !comparator ||!dtor) { return 1; /* failure */ } h->hash_func = hfunc; h->comp_func = comparator; h->dtor = dtor; h->size = 0; h->slots = slots; h->table = 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); h->table[i] = NULL; } free(h->table); h->table = NULL; h->slots = 0; return 1; /* failure */ } } return 0; /* fine */ } else { h->slots = 0; return 1; /* failure */ } } struct curl_hash * Curl_hash_alloc(int slots, hash_function hfunc, comp_function comparator, curl_hash_dtor dtor) { struct curl_hash *h; if(!slots || !hfunc || !comparator ||!dtor) { return NULL; /* failure */ } h = malloc(sizeof(struct curl_hash)); if(h) { if(Curl_hash_init(h, slots, hfunc, comparator, dtor)) { /* failure */ free(h); h = NULL; } } return h; } static struct curl_hash_element * mk_hash_element(const void *key, size_t key_len, const void *p) { struct curl_hash_element *he = malloc(sizeof(struct curl_hash_element)); if(he) { void *dupkey = malloc(key_len); if(dupkey) { /* copy the key */ memcpy(dupkey, key, key_len); he->key = dupkey; 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 FETCH_LIST(x,y,z) x->table[x->hash_func(y, z, x->slots)] /* Insert the data in the hash. If there already was a match in the hash, * that data is replaced. * * @unittest: 1305 */ void * Curl_hash_add(struct curl_hash *h, void *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(h->comp_func(he->key, he->key_len, key, key_len)) { Curl_llist_remove(l, le, (void *)h); --h->size; break; } } 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, void *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(h->comp_func(he->key, he->key_len, key, key_len)) { Curl_llist_remove(l, le, (void *) h); --h->size; return 0; } } return 1; } void * Curl_hash_pick(struct curl_hash *h, void *key, size_t key_len) { struct curl_llist_element *le; struct curl_hash_element *he; struct curl_llist *l; if(h) { l = FETCH_LIST(h, key, key_len); for(le = l->head; le; le = le->next) { he = le->ptr; if(h->comp_func(he->key, he->key_len, key, key_len)) { return he->ptr; } } } return NULL; } #if defined(DEBUGBUILD) && 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); h->table[i] = NULL; } Curl_safefree(h->table); h->size = 0; h->slots = 0; } 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; if(!h) return; 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); } size_t Curl_hash_str(void* key, size_t key_length, size_t slots_num) { const char* key_str = (const char *) key; const char *end = key_str + key_length; unsigned long h = 5381; while(key_str < end) { h += h << 5; h ^= (unsigned long) *key_str++; } return (h % slots_num); } size_t Curl_str_key_compare(void*k1, size_t key1_len, void*k2, size_t key2_len) { char *key1 = (char *)k1; char *key2 = (char *)k2; if(key1_len == key2_len && *key1 == *key2 && memcmp(key1, key2, key1_len) == 0) { return 1; } return 0; } void Curl_hash_start_iterate(struct curl_hash *hash, struct curl_hash_iterator *iter) { iter->hash = hash; iter->slot_index = 0; iter->current_element = NULL; } struct curl_hash_element * Curl_hash_next_element(struct curl_hash_iterator *iter) { int i; struct curl_hash *h = iter->hash; /* Get the next element in the current list, if any */ if(iter->current_element) iter->current_element = iter->current_element->next; /* If we have reached the end of the list, find the next one */ if(!iter->current_element) { for(i = iter->slot_index;i < h->slots;i++) { if(h->table[i]->head) { iter->current_element = h->table[i]->head; iter->slot_index = i+1; break; } } } if(iter->current_element) { struct curl_hash_element *he = iter->current_element->ptr; return he; } else { iter->current_element = NULL; return NULL; } } #if 0 /* useful function for debugging hashes and their contents */ void Curl_hash_print(struct curl_hash *h, void (*func)(void *)) { struct curl_hash_iterator iter; struct curl_hash_element *he; int last_index = -1; if(!h) return; fprintf(stderr, "=Hash dump=\n"); Curl_hash_start_iterate(h, &iter); he = Curl_hash_next_element(&iter); while(he) { if(iter.slot_index != last_index) { fprintf(stderr, "index %d:", iter.slot_index); if(last_index >= 0) { fprintf(stderr, "\n"); } last_index = iter.slot_index; } if(func) func(he->ptr); else fprintf(stderr, " [%p]", (void *)he->ptr); he = Curl_hash_next_element(&iter); } fprintf(stderr, "\n"); } #endif curl-7.35.0/lib/http_digest.h0000644000175000017500000000411412213173003012721 00000000000000#ifndef HEADER_CURL_HTTP_DIGEST_H #define HEADER_CURL_HTTP_DIGEST_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" 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, const char *header); /* this is for creating digest header output */ CURLcode Curl_output_digest(struct connectdata *conn, bool proxy, const unsigned char *request, const unsigned char *uripath); #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH) void Curl_digest_cleanup(struct SessionHandle *data); #else #define Curl_digest_cleanup(x) Curl_nop_stmt #endif #endif /* HEADER_CURL_HTTP_DIGEST_H */ curl-7.35.0/lib/Makefile.inc0000644000175000017500000000723112262353672012465 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # ########################################################################### VSOURCES=vtls/openssl.c vtls/gtls.c vtls/vtls.c vtls/nss.c vtls/qssl.c \ vtls/polarssl.c vtls/polarssl_threadlock.c vtls/axtls.c vtls/cyassl.c \ vtls/curl_schannel.c vtls/curl_darwinssl.c vtls/gskit.c VHEADERS= vtls/qssl.h vtls/openssl.h vtls/vtls.h vtls/gtls.h \ vtls/nssg.h vtls/polarssl.h vtls/polarssl_threadlock.h vtls/axtls.h \ vtls/cyassl.h vtls/curl_schannel.h vtls/curl_darwinssl.h vtls/gskit.h 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 version.c getenv.c escape.c mprintf.c telnet.c netrc.c \ getinfo.c transfer.c strequal.c easy.c security.c curl_fnmatch.c \ fileinfo.c ftplistparser.c wildcard.c krb5.c memdebug.c http_chunks.c \ strtok.c connect.c llist.c hash.c multi.c content_encoding.c share.c \ http_digest.c md4.c md5.c http_negotiate.c inet_pton.c strtoofft.c \ strerror.c amigaos.c hostasyn.c hostip4.c hostip6.c hostsyn.c \ inet_ntop.c parsedate.c select.c tftp.c splay.c strdup.c socks.c \ ssh.c rawstr.c curl_addrinfo.c socks_gssapi.c socks_sspi.c \ curl_sspi.c slist.c nonblock.c curl_memrchr.c imap.c pop3.c smtp.c \ pingpong.c rtsp.c curl_threads.c warnless.c hmac.c curl_rtmp.c \ openldap.c curl_gethostname.c gopher.c idn_win32.c \ http_negotiate_sspi.c http_proxy.c non-ascii.c asyn-ares.c \ asyn-thread.c curl_gssapi.c curl_ntlm.c curl_ntlm_wb.c \ curl_ntlm_core.c curl_ntlm_msgs.c curl_sasl.c curl_multibyte.c \ hostcheck.c bundles.c conncache.c pipeline.c dotdot.c x509asn1.c \ http2.c $(VSOURCES) HHEADERS = arpa_telnet.h netrc.h file.h timeval.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 curl_ldap.h escape.h telnet.h getinfo.h \ strequal.h curl_sec.h memdebug.h http_chunks.h curl_fnmatch.h \ wildcard.h fileinfo.h ftplistparser.h strtok.h connect.h llist.h \ hash.h content_encoding.h share.h curl_md4.h curl_md5.h http_digest.h \ http_negotiate.h inet_pton.h amigaos.h strtoofft.h strerror.h \ inet_ntop.h curlx.h curl_memory.h curl_setup.h transfer.h select.h \ easyif.h multiif.h parsedate.h tftp.h sockaddr.h splay.h strdup.h \ socks.h ssh.h curl_base64.h rawstr.h curl_addrinfo.h curl_sspi.h \ slist.h nonblock.h curl_memrchr.h imap.h pop3.h smtp.h pingpong.h \ rtsp.h curl_threads.h warnless.h curl_hmac.h curl_rtmp.h \ curl_gethostname.h gopher.h http_proxy.h non-ascii.h asyn.h \ curl_ntlm.h curl_gssapi.h curl_ntlm_wb.h curl_ntlm_core.h \ curl_ntlm_msgs.h curl_sasl.h curl_multibyte.h hostcheck.h bundles.h \ conncache.h curl_setup_once.h multihandle.h setup-vms.h pipeline.h \ dotdot.h x509asn1.h http2.h sigpipe.h $(VHEADERS) curl-7.35.0/lib/strtoofft.c0000644000175000017500000001046012213173003012431 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_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 /* Range tests can be used for alphanum decoding if characters are consecutive, like in ASCII. Else an array is scanned. Determine this condition now. */ #if('9' - '0') != 9 || ('Z' - 'A') != 25 || ('z' - 'a') != 25 #define NO_RANGE_TEST static const char valchars[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; #endif 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_OFF_T_MIN; else value = CURL_OFF_T_MAX; SET_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) { #ifndef NO_RANGE_TEST 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; } #else const char * cp; int value; cp = memchr(valchars, c, 10 + 26 + 26); if(!cp) return -1; value = cp - valchars; if(value >= 10 + 26) value -= 26; /* Lowercase. */ #endif if(value >= base) { value = -1; } return value; } #endif /* Only present if we need strtoll, but don't have it. */ curl-7.35.0/lib/http_proxy.h0000644000175000017500000000315412213173003012626 00000000000000#ifndef HEADER_CURL_HTTP_PROXY_H #define HEADER_CURL_HTTP_PROXY_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP) /* ftp can use this as well */ CURLcode Curl_proxyCONNECT(struct connectdata *conn, int tunnelsocket, const char *hostname, unsigned short remote_port); /* Default proxy timeout in milliseconds */ #define PROXY_TIMEOUT (3600*1000) CURLcode Curl_proxy_connect(struct connectdata *conn); #else #define Curl_proxyCONNECT(x,y,z,w) CURLE_NOT_BUILT_IN #define Curl_proxy_connect(x) CURLE_OK #endif #endif /* HEADER_CURL_HTTP_PROXY_H */ curl-7.35.0/lib/sockaddr.h0000644000175000017500000000270012213173003012174 00000000000000#ifndef HEADER_CURL_SOCKADDR_H #define HEADER_CURL_SOCKADDR_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2009, 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. * ***************************************************************************/ #include "curl_setup.h" struct Curl_sockaddr_storage { union { struct sockaddr sa; struct sockaddr_in sa_in; #ifdef ENABLE_IPV6 struct sockaddr_in6 sa_in6; #endif #ifdef HAVE_STRUCT_SOCKADDR_STORAGE struct sockaddr_storage sa_stor; #else char cbuf[256]; /* this should be big enough to fit a lot */ #endif } buffer; }; #endif /* HEADER_CURL_SOCKADDR_H */ curl-7.35.0/lib/curl_rtmp.h0000644000175000017500000000264212213173003012416 00000000000000#ifndef HEADER_CURL_RTMP_H #define HEADER_CURL_RTMP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2010, Howard Chu, * * 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. * ***************************************************************************/ #ifdef USE_LIBRTMP extern const struct Curl_handler Curl_handler_rtmp; extern const struct Curl_handler Curl_handler_rtmpt; extern const struct Curl_handler Curl_handler_rtmpe; extern const struct Curl_handler Curl_handler_rtmpte; extern const struct Curl_handler Curl_handler_rtmps; extern const struct Curl_handler Curl_handler_rtmpts; #endif #endif /* HEADER_CURL_RTMP_H */ curl-7.35.0/lib/README.pingpong0000644000175000017500000000174012213173003012734 00000000000000Date: December 5, 2009 Pingpong ======== Pingpong is just my (Daniel's) jestful collective name on the protocols that share a very similar kind of back-and-forth procedure with command and responses to and from the server. FTP was previously the only protocol in that family that libcurl supported, but when POP3, IMAP and SMTP joined the team I moved some of the internals into a separate pingpong module to be easier to get used by all these protocols to reduce code duplication and ease code re-use between these protocols. FTP In 7.20.0 we converted code to use the new pingpong code from previously having been all "native" FTP code. POP3 There's no support in the documented URL format to specify the exact mail to get, but we support that as the path specified in the URL. IMAP SMTP There's no official URL syntax defined for SMTP, but we use only the generic one and we provide two additional libcurl options to specify receivers and sender of the actual mail. curl-7.35.0/lib/makefile.dj0000644000175000017500000000157012213173003012331 00000000000000# # Adapted for djgpp2 / Watt-32 / DOS by # Gisle Vanem # DEPEND_PREREQ = curl_config.h TOPDIR = .. include ../packages/DOS/common.dj include Makefile.inc OBJECTS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(strip $(CSOURCES))) CURL_LIB = libcurl.a # NOTE: if ../include/curl/curlbuild.h is missing, you're probably building # this from a git checkout and then you need to run buildconf.bat first. all: $(OBJ_DIR) curl_config.h $(CURL_LIB) $(CURL_LIB): $(OBJECTS) ar rs $@ $? curl_config.h: config-dos.h $(COPY) $^ $@ # clean generated files # genclean: - $(DELETE) curl_config.h # clean object files and subdir # objclean: genclean - $(DELETE) $(OBJ_DIR)$(DS)*.o - $(RMDIR) $(OBJ_DIR) # clean without removing built library # clean: objclean - $(DELETE) depend.dj # clean everything # realclean vclean: clean - $(DELETE) $(CURL_LIB) -include depend.dj curl-7.35.0/lib/warnless.h0000644000175000017500000000467512213173003012255 00000000000000#ifndef HEADER_CURL_WARNLESS_H #define HEADER_CURL_WARNLESS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #ifdef USE_WINSOCK #include /* for curl_socket_t */ #endif unsigned short curlx_ultous(unsigned long ulnum); unsigned char curlx_ultouc(unsigned long ulnum); int curlx_ultosi(unsigned long ulnum); int curlx_uztosi(size_t uznum); unsigned long curlx_uztoul(size_t uznum); unsigned int curlx_uztoui(size_t uznum); int curlx_sltosi(long slnum); unsigned int curlx_sltoui(long slnum); unsigned short curlx_sltous(long slnum); ssize_t curlx_uztosz(size_t uznum); size_t curlx_sotouz(curl_off_t sonum); int curlx_sztosi(ssize_t sznum); size_t curlx_sitouz(int sinum); #ifdef USE_WINSOCK int curlx_sktosi(curl_socket_t s); curl_socket_t curlx_sitosk(int i); #endif /* USE_WINSOCK */ #if defined(__INTEL_COMPILER) && defined(__unix__) int curlx_FD_ISSET(int fd, fd_set *fdset); void curlx_FD_SET(int fd, fd_set *fdset); void curlx_FD_ZERO(fd_set *fdset); unsigned short curlx_htons(unsigned short usnum); unsigned short curlx_ntohs(unsigned short usnum); #ifndef BUILDING_WARNLESS_C # undef FD_ISSET # define FD_ISSET(a,b) curlx_FD_ISSET((a),(b)) # undef FD_SET # define FD_SET(a,b) curlx_FD_SET((a),(b)) # undef FD_ZERO # define FD_ZERO(a) curlx_FD_ZERO((a)) # undef htons # define htons(a) curlx_htons((a)) # undef ntohs # define ntohs(a) curlx_ntohs((a)) #endif #endif /* __INTEL_COMPILER && __unix__ */ #endif /* HEADER_CURL_WARNLESS_H */ curl-7.35.0/lib/curl_gethostname.c0000644000175000017500000000622112213173003013742 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #include "curl_gethostname.h" /* * Curl_gethostname() is a wrapper around gethostname() which allows * overriding the host name that the function would normally return. * This capability is used by the test suite to verify exact matching * of NTLM authentication, which exercises libcurl's MD4 and DES code * as well as by the SMTP module when a hostname is not provided. * * For libcurl debug enabled builds host name overriding takes place * when environment variable CURL_GETHOSTNAME is set, using the value * held by the variable to override returned host name. * * Note: The function always returns the un-qualified hostname rather * than being provider dependent. * * For libcurl shared library release builds the test suite preloads * another shared library named libhostname using the LD_PRELOAD * mechanism which intercepts, and might override, the gethostname() * function call. In this case a given platform must support the * LD_PRELOAD mechanism and additionally have environment variable * CURL_GETHOSTNAME set in order to override the returned host name. * * For libcurl static library release builds no overriding takes place. */ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) { #ifndef HAVE_GETHOSTNAME /* Allow compilation and return failure when unavailable */ (void) name; (void) namelen; return -1; #else int err; char* dot; #ifdef DEBUGBUILD /* Override host name when environment variable CURL_GETHOSTNAME is set */ const char *force_hostname = getenv("CURL_GETHOSTNAME"); if(force_hostname) { strncpy(name, force_hostname, namelen); err = 0; } else { name[0] = '\0'; err = gethostname(name, namelen); } #else /* DEBUGBUILD */ /* The call to system's gethostname() might get intercepted by the libhostname library when libcurl is built as a non-debug shared library when running the test suite. */ name[0] = '\0'; err = gethostname(name, namelen); #endif name[namelen - 1] = '\0'; if(err) return err; /* Truncate domain, leave only machine name */ dot = strchr(name, '.'); if(dot) *dot = '\0'; return 0; #endif } curl-7.35.0/lib/curl_gssapi.c0000644000175000017500000000467612213173003012726 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_GSSAPI #include "curl_gssapi.h" #include "sendf.h" OM_uint32 Curl_gss_init_sec_context( struct SessionHandle *data, OM_uint32 * minor_status, gss_ctx_id_t * context, gss_name_t target_name, gss_channel_bindings_t input_chan_bindings, gss_buffer_t input_token, gss_buffer_t output_token, OM_uint32 * ret_flags) { OM_uint32 req_flags = GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG; if(data->set.gssapi_delegation & CURLGSSAPI_DELEGATION_POLICY_FLAG) { #ifdef GSS_C_DELEG_POLICY_FLAG req_flags |= GSS_C_DELEG_POLICY_FLAG; #else infof(data, "warning: support for CURLGSSAPI_DELEGATION_POLICY_FLAG not " "compiled in\n"); #endif } if(data->set.gssapi_delegation & CURLGSSAPI_DELEGATION_FLAG) req_flags |= GSS_C_DELEG_FLAG; return gss_init_sec_context(minor_status, GSS_C_NO_CREDENTIAL, /* cred_handle */ context, target_name, GSS_C_NO_OID, /* mech_type */ req_flags, 0, /* time_req */ input_chan_bindings, input_token, NULL, /* actual_mech_type */ output_token, ret_flags, NULL /* time_rec */); } #endif /* HAVE_GSSAPI */ curl-7.35.0/lib/sendf.h0000644000175000017500000000646612213173003011516 00000000000000#ifndef HEADER_CURL_SENDF_H #define HEADER_CURL_SENDF_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" 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(HAVE_VARIADIC_MACROS_C99) #define infof(...) Curl_nop_stmt #elif defined(HAVE_VARIADIC_MACROS_GCC) #define infof(x...) Curl_nop_stmt #else #define infof (void) #endif #else /* CURL_DISABLE_VERBOSE_STRINGS */ #define infof Curl_infof #endif /* CURL_DISABLE_VERBOSE_STRINGS */ #define failf Curl_failf #define CLIENTWRITE_BODY (1<<0) #define CLIENTWRITE_HEADER (1<<1) #define CLIENTWRITE_BOTH (CLIENTWRITE_BODY|CLIENTWRITE_HEADER) CURLcode Curl_client_write(struct connectdata *conn, int type, char *ptr, size_t len); /* internal read-function, does plain socket only */ CURLcode Curl_read_plain(curl_socket_t sockfd, char *buf, size_t bytesfromsocket, ssize_t *n); ssize_t Curl_recv_plain(struct connectdata *conn, int num, char *buf, size_t len, CURLcode *code); ssize_t Curl_send_plain(struct connectdata *conn, int num, const void *mem, size_t len, CURLcode *code); /* internal read-function, does plain socket, SSL and krb4 */ CURLcode Curl_read(struct connectdata *conn, curl_socket_t sockfd, char *buf, size_t buffersize, ssize_t *n); /* internal write-function, does plain socket, SSL, SCP, SFTP and krb4 */ CURLcode Curl_write(struct connectdata *conn, curl_socket_t sockfd, const void *mem, size_t len, ssize_t *written); /* internal write-function, does plain sockets ONLY */ CURLcode Curl_write_plain(struct connectdata *conn, curl_socket_t sockfd, const 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 /* HEADER_CURL_SENDF_H */ curl-7.35.0/lib/hostip4.c0000644000175000017500000002462212262353672012016 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef __VMS #include #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 #include "curl_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 connectdata *conn) { if(conn->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 /* * 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; #ifdef CURL_DISABLE_VERBOSE_STRINGS (void)conn; #endif *waitp = 0; /* synchronous response only */ ai = Curl_ipv4_resolve_r(hostname, port); if(!ai) infof(conn->data, "Curl_ipv4_resolve_r failed for %s\n", hostname); return ai; } #endif /* CURLRES_SYNCH */ #endif /* CURLRES_IPV4 */ #if defined(CURLRES_IPV4) && !defined(CURLRES_ARES) /* * Curl_ipv4_resolve_r() - ipv4 threadsafe resolver function. * * This is used for both synchronous and asynchronous resolver builds, * implying that only threadsafe code and function calls may be used. * */ Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, int port) { #if !defined(HAVE_GETADDRINFO_THREADSAFE) && defined(HAVE_GETHOSTBYNAME_R_3) int res; #endif Curl_addrinfo *ai = NULL; struct hostent *h = NULL; struct in_addr in; struct hostent *buf = NULL; if(Curl_inet_pton(AF_INET, hostname, &in) > 0) /* This is a dotted IP address 123.123.123.123-style */ return Curl_ip2addr(AF_INET, &in, hostname, port); #if defined(HAVE_GETADDRINFO_THREADSAFE) else { struct addrinfo hints; char sbuf[12]; char *sbufptr = NULL; memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_INET; hints.ai_socktype = SOCK_STREAM; if(port) { snprintf(sbuf, sizeof(sbuf), "%d", port); sbufptr = sbuf; } (void)Curl_getaddrinfo_ex(hostname, sbufptr, &hints, &ai); #elif 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; buf = calloc(1, CURL_HOSTENT_SIZE); 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. */ #if defined(HAVE_GETHOSTBYNAME_R_5) /* Solaris, IRIX and more */ 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 #elif defined(HAVE_GETHOSTBYNAME_R_6) /* Linux */ (void)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 */ #elif defined(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 = SOCKERRNO; /* 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_...BYNAME_R_5 || HAVE_...BYNAME_R_6 || HAVE_...BYNAME_R_3 */ { h = NULL; /* set return code to NULL */ free(buf); } #else /* HAVE_GETADDRINFO_THREADSAFE || HAVE_GETHOSTBYNAME_R */ /* * Here is code for platforms that don't have a thread safe * getaddrinfo() nor gethostbyname_r() function or for which * gethostbyname() is the preferred one. */ else { h = gethostbyname((void*)hostname); #endif /* HAVE_GETADDRINFO_THREADSAFE || HAVE_GETHOSTBYNAME_R */ } if(h) { ai = Curl_he2ai(h, port); if(buf) /* used a *_r() function */ free(buf); } return ai; } #endif /* defined(CURLRES_IPV4) && !defined(CURLRES_ARES) */ curl-7.35.0/lib/tftp.h0000644000175000017500000000225612213173003011365 00000000000000#ifndef HEADER_CURL_TFTP_H #define HEADER_CURL_TFTP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2007, 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. * ***************************************************************************/ #ifndef CURL_DISABLE_TFTP extern const struct Curl_handler Curl_handler_tftp; #endif #endif /* HEADER_CURL_TFTP_H */ curl-7.35.0/lib/x509asn1.c0000644000175000017500000010322012270035364011676 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(USE_QSOSSL) || defined(USE_GSKIT) || defined(USE_NSS) #include #include "urldata.h" #include "strequal.h" #include "hostcheck.h" #include "vtls/vtls.h" #include "sendf.h" #include "inet_pton.h" #include "curl_base64.h" #include "x509asn1.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* ASN.1 OIDs. */ static const char cnOID[] = "2.5.4.3"; /* Common name. */ static const char sanOID[] = "2.5.29.17"; /* Subject alternative name. */ static const curl_OID OIDtable[] = { { "1.2.840.10040.4.1", "dsa" }, { "1.2.840.10040.4.3", "dsa-with-sha1" }, { "1.2.840.10045.2.1", "ecPublicKey" }, { "1.2.840.10045.3.0.1", "c2pnb163v1" }, { "1.2.840.10045.4.1", "ecdsa-with-SHA1" }, { "1.2.840.10046.2.1", "dhpublicnumber" }, { "1.2.840.113549.1.1.1", "rsaEncryption" }, { "1.2.840.113549.1.1.2", "md2WithRSAEncryption" }, { "1.2.840.113549.1.1.4", "md5WithRSAEncryption" }, { "1.2.840.113549.1.1.5", "sha1WithRSAEncryption" }, { "1.2.840.113549.1.1.10", "RSASSA-PSS" }, { "1.2.840.113549.1.1.14", "sha224WithRSAEncryption" }, { "1.2.840.113549.1.1.11", "sha256WithRSAEncryption" }, { "1.2.840.113549.1.1.12", "sha384WithRSAEncryption" }, { "1.2.840.113549.1.1.13", "sha512WithRSAEncryption" }, { "1.2.840.113549.2.2", "md2" }, { "1.2.840.113549.2.5", "md5" }, { "1.3.14.3.2.26", "sha1" }, { cnOID, "CN" }, { "2.5.4.4", "SN" }, { "2.5.4.5", "serialNumber" }, { "2.5.4.6", "C" }, { "2.5.4.7", "L" }, { "2.5.4.8", "ST" }, { "2.5.4.9", "streetAddress" }, { "2.5.4.10", "O" }, { "2.5.4.11", "OU" }, { "2.5.4.12", "title" }, { "2.5.4.13", "description" }, { "2.5.4.17", "postalCode" }, { "2.5.4.41", "name" }, { "2.5.4.42", "givenName" }, { "2.5.4.43", "initials" }, { "2.5.4.44", "generationQualifier" }, { "2.5.4.45", "X500UniqueIdentifier" }, { "2.5.4.46", "dnQualifier" }, { "2.5.4.65", "pseudonym" }, { "1.2.840.113549.1.9.1", "emailAddress" }, { "2.5.4.72", "role" }, { sanOID, "subjectAltName" }, { "2.5.29.18", "issuerAltName" }, { "2.5.29.19", "basicConstraints" }, { "2.16.840.1.101.3.4.2.4", "sha224" }, { "2.16.840.1.101.3.4.2.1", "sha256" }, { "2.16.840.1.101.3.4.2.2", "sha384" }, { "2.16.840.1.101.3.4.2.3", "sha512" }, { (const char *) NULL, (const char *) NULL } }; /* * Lightweight ASN.1 parser. * In particular, it does not check for syntactic/lexical errors. * It is intended to support certificate information gathering for SSL backends * that offer a mean to get certificates as a whole, but do not supply * entry points to get particular certificate sub-fields. * Please note there is no pretention here to rewrite a full SSL library. */ const char * Curl_getASN1Element(curl_asn1Element * elem, const char * beg, const char * end) { unsigned char b; unsigned long len; curl_asn1Element lelem; /* Get a single ASN.1 element into `elem', parse ASN.1 string at `beg' ending at `end'. Returns a pointer in source string after the parsed element, or NULL if an error occurs. */ if(beg >= end || !*beg) return (const char *) NULL; /* Process header byte. */ b = (unsigned char) *beg++; elem->constructed = (b & 0x20) != 0; elem->class = (b >> 6) & 3; b &= 0x1F; if(b == 0x1F) return (const char *) NULL; /* Long tag values not supported here. */ elem->tag = b; /* Process length. */ if(beg >= end) return (const char *) NULL; b = (unsigned char) *beg++; if(!(b & 0x80)) len = b; else if(!(b &= 0x7F)) { /* Unspecified length. Since we have all the data, we can determine the effective length by skipping element until an end element is found. */ if(!elem->constructed) return (const char *) NULL; elem->beg = beg; while(beg < end && *beg) { beg = Curl_getASN1Element(&lelem, beg, end); if(!beg) return (const char *) NULL; } if(beg >= end) return (const char *) NULL; elem->end = beg; return beg + 1; } else if(beg + b > end) return (const char *) NULL; /* Does not fit in source. */ else { /* Get long length. */ len = 0; do { if(len & 0xFF000000L) return (const char *) NULL; /* Lengths > 32 bits are not supported. */ len = (len << 8) | (unsigned char) *beg++; } while(--b); } if((unsigned long) (end - beg) < len) return (const char *) NULL; /* Element data does not fit in source. */ elem->beg = beg; elem->end = beg + len; return elem->end; } static const curl_OID * searchOID(const char * oid) { const curl_OID * op; /* Search the null terminated OID or OID identifier in local table. Return the table entry pointer or NULL if not found. */ for(op = OIDtable; op->numoid; op++) if(!strcmp(op->numoid, oid) || curl_strequal(op->textoid, oid)) return op; return (const curl_OID *) NULL; } static const char * bool2str(const char * beg, const char * end) { /* Convert an ASN.1 Boolean value into its string representation. Return the dynamically allocated string, or NULL if source is not an ASN.1 Boolean value. */ if(end - beg != 1) return (const char *) NULL; return strdup(*beg? "TRUE": "FALSE"); } static const char * octet2str(const char * beg, const char * end) { size_t n = end - beg; char * buf; /* Convert an ASN.1 octet string to a printable string. Return the dynamically allocated string, or NULL if an error occurs. */ buf = malloc(3 * n + 1); if(buf) for(n = 0; beg < end; n += 3) snprintf(buf + n, 4, "%02x:", *(const unsigned char *) beg++); return buf; } static const char * bit2str(const char * beg, const char * end) { /* Convert an ASN.1 bit string to a printable string. Return the dynamically allocated string, or NULL if an error occurs. */ if(++beg > end) return (const char *) NULL; return octet2str(beg, end); } static const char * int2str(const char * beg, const char * end) { long val = 0; size_t n = end - beg; /* Convert an ASN.1 integer value into its string representation. Return the dynamically allocated string, or NULL if source is not an ASN.1 integer value. */ if(!n) return (const char *) NULL; if(n > 4) return octet2str(beg, end); /* Represent integers <= 32-bit as a single value. */ if(*beg & 0x80) val = ~val; do val = (val << 8) | *(const unsigned char *) beg++; while(beg < end); return curl_maprintf("%s%lx", (val < 0 || val >= 10)? "0x": "", val); } static ssize_t utf8asn1str(char * * to, int type, const char * from, const char * end) { size_t inlength = end - from; int size = 1; size_t outlength; int charsize; unsigned int wc; char * buf; /* Perform a lazy conversion from an ASN.1 typed string to UTF8. Allocate the destination buffer dynamically. The allocation size will normally be too large: this is to avoid buffer overflows. Terminate the string with a nul byte and return the converted string length. */ *to = (char *) NULL; switch (type) { case CURL_ASN1_BMP_STRING: size = 2; break; case CURL_ASN1_UNIVERSAL_STRING: size = 4; break; case CURL_ASN1_NUMERIC_STRING: case CURL_ASN1_PRINTABLE_STRING: case CURL_ASN1_TELETEX_STRING: case CURL_ASN1_IA5_STRING: case CURL_ASN1_VISIBLE_STRING: case CURL_ASN1_UTF8_STRING: break; default: return -1; /* Conversion not supported. */ } if(inlength % size) return -1; /* Length inconsistent with character size. */ buf = malloc(4 * (inlength / size) + 1); if(!buf) return -1; /* Not enough memory. */ if(type == CURL_ASN1_UTF8_STRING) { /* Just copy. */ outlength = inlength; if(outlength) memcpy(buf, from, outlength); } else { for(outlength = 0; from < end;) { wc = 0; switch (size) { case 4: wc = (wc << 8) | *(const unsigned char *) from++; wc = (wc << 8) | *(const unsigned char *) from++; case 2: wc = (wc << 8) | *(const unsigned char *) from++; default: /* case 1: */ wc = (wc << 8) | *(const unsigned char *) from++; } charsize = 1; if(wc >= 0x00000080) { if(wc >= 0x00000800) { if(wc >= 0x00010000) { if(wc >= 0x00200000) { free(buf); return -1; /* Invalid char. size for target encoding. */ } buf[outlength + 3] = (char) (0x80 | (wc & 0x3F)); wc = (wc >> 6) | 0x00010000; charsize++; } buf[outlength + 2] = (char) (0x80 | (wc & 0x3F)); wc = (wc >> 6) | 0x00000800; charsize++; } buf[outlength + 1] = (char) (0x80 | (wc & 0x3F)); wc = (wc >> 6) | 0x000000C0; charsize++; } buf[outlength] = (char) wc; outlength += charsize; } } buf[outlength] = '\0'; *to = buf; return outlength; } static const char * string2str(int type, const char * beg, const char * end) { char * buf; /* Convert an ASN.1 String into its UTF-8 string representation. Return the dynamically allocated string, or NULL if an error occurs. */ if(utf8asn1str(&buf, type, beg, end) < 0) return (const char *) NULL; return buf; } static int encodeUint(char * buf, int n, unsigned int x) { int i = 0; unsigned int y = x / 10; /* Decimal ASCII encode unsigned integer `x' in the `n'-byte buffer at `buf'. Return the total number of encoded digits, even if larger than `n'. */ if(y) { i += encodeUint(buf, n, y); x -= y * 10; } if(i < n) buf[i] = (char) ('0' + x); i++; if(i < n) buf[i] = '\0'; /* Store a terminator if possible. */ return i; } static int encodeOID(char * buf, int n, const char * beg, const char * end) { int i = 0; unsigned int x; unsigned int y; /* Convert an ASN.1 OID into its dotted string representation. Store the result in th `n'-byte buffer at `buf'. Return the converted string length, or -1 if an error occurs. */ /* Process the first two numbers. */ y = *(const unsigned char *) beg++; x = y / 40; y -= x * 40; i += encodeUint(buf + i, n - i, x); if(i < n) buf[i] = '.'; i++; i += encodeUint(buf + i, n - i, y); /* Process the trailing numbers. */ while(beg < end) { if(i < n) buf[i] = '.'; i++; x = 0; do { if(x & 0xFF000000) return -1; y = *(const unsigned char *) beg++; x = (x << 7) | (y & 0x7F); } while(y & 0x80); i += encodeUint(buf + i, n - i, x); } if(i < n) buf[i] = '\0'; return i; } static const char * OID2str(const char * beg, const char * end, bool symbolic) { char * buf = (char *) NULL; const curl_OID * op; int n; /* Convert an ASN.1 OID into its dotted or symbolic string representation. Return the dynamically allocated string, or NULL if an error occurs. */ if(beg < end) { n = encodeOID((char *) NULL, -1, beg, end); if(n >= 0) { buf = malloc(n + 1); if(buf) { encodeOID(buf, n, beg, end); buf[n] = '\0'; if(symbolic) { op = searchOID(buf); if(op) { free(buf); buf = strdup(op->textoid); } } } } } return buf; } static const char * GTime2str(const char * beg, const char * end) { const char * tzp; const char * fracp; char sec1, sec2; size_t fracl; size_t tzl; const char * sep = ""; /* Convert an ASN.1 Generalized time to a printable string. Return the dynamically allocated string, or NULL if an error occurs. */ for(fracp = beg; fracp < end && *fracp >= '0' && *fracp <= '9'; fracp++) ; /* Get seconds digits. */ sec1 = '0'; switch (fracp - beg - 12) { case 0: sec2 = '0'; break; case 2: sec1 = fracp[-2]; case 1: sec2 = fracp[-1]; break; default: return (const char *) NULL; } /* Scan for timezone, measure fractional seconds. */ tzp = fracp; fracl = 0; if(fracp < end && (*fracp == '.' || *fracp == ',')) { fracp++; do tzp++; while(tzp < end && *tzp >= '0' && *tzp <= '9'); /* Strip leading zeroes in fractional seconds. */ for(fracl = tzp - fracp - 1; fracl && fracp[fracl - 1] == '0'; fracl--) ; } /* Process timezone. */ if(tzp >= end) ; /* Nothing to do. */ else if(*tzp == 'Z') { tzp = " GMT"; end = tzp + 4; } else { sep = " "; tzp++; } tzl = end - tzp; return curl_maprintf("%.4s-%.2s-%.2s %.2s:%.2s:%c%c%s%.*s%s%.*s", beg, beg + 4, beg + 6, beg + 8, beg + 10, sec1, sec2, fracl? ".": "", fracl, fracp, sep, tzl, tzp); } static const char * UTime2str(const char * beg, const char * end) { const char * tzp; size_t tzl; const char * sec; /* Convert an ASN.1 UTC time to a printable string. Return the dynamically allocated string, or NULL if an error occurs. */ for(tzp = beg; tzp < end && *tzp >= '0' && *tzp <= '9'; tzp++) ; /* Get the seconds. */ sec = beg + 10; switch (tzp - sec) { case 0: sec = "00"; case 2: break; default: return (const char *) NULL; } /* Process timezone. */ if(tzp >= end) return (const char *) NULL; if(*tzp == 'Z') { tzp = "GMT"; end = tzp + 3; } else tzp++; tzl = end - tzp; return curl_maprintf("%u%.2s-%.2s-%.2s %.2s:%.2s:%.2s %.*s", 20 - (*beg >= '5'), beg, beg + 2, beg + 4, beg + 6, beg + 8, sec, tzl, tzp); } const char * Curl_ASN1tostr(curl_asn1Element * elem, int type) { static const char zero = '\0'; /* Convert an ASN.1 element to a printable string. Return the dynamically allocated string, or NULL if an error occurs. */ if(elem->constructed) return (const char *) NULL; /* No conversion of structured elements. */ if(!type) type = elem->tag; /* Type not forced: use element tag as type. */ switch (type) { case CURL_ASN1_BOOLEAN: return bool2str(elem->beg, elem->end); case CURL_ASN1_INTEGER: case CURL_ASN1_ENUMERATED: return int2str(elem->beg, elem->end); case CURL_ASN1_BIT_STRING: return bit2str(elem->beg, elem->end); case CURL_ASN1_OCTET_STRING: return octet2str(elem->beg, elem->end); case CURL_ASN1_NULL: return strdup(&zero); case CURL_ASN1_OBJECT_IDENTIFIER: return OID2str(elem->beg, elem->end, TRUE); case CURL_ASN1_UTC_TIME: return UTime2str(elem->beg, elem->end); case CURL_ASN1_GENERALIZED_TIME: return GTime2str(elem->beg, elem->end); case CURL_ASN1_UTF8_STRING: case CURL_ASN1_NUMERIC_STRING: case CURL_ASN1_PRINTABLE_STRING: case CURL_ASN1_TELETEX_STRING: case CURL_ASN1_IA5_STRING: case CURL_ASN1_VISIBLE_STRING: case CURL_ASN1_UNIVERSAL_STRING: case CURL_ASN1_BMP_STRING: return string2str(type, elem->beg, elem->end); } return (const char *) NULL; /* Unsupported. */ } static ssize_t encodeDN(char * buf, size_t n, curl_asn1Element * dn) { curl_asn1Element rdn; curl_asn1Element atv; curl_asn1Element oid; curl_asn1Element value; size_t l = 0; const char * p1; const char * p2; const char * p3; const char * str; /* ASCII encode distinguished name at `dn' into the `n'-byte buffer at `buf'. Return the total string length, even if larger than `n'. */ for(p1 = dn->beg; p1 < dn->end;) { p1 = Curl_getASN1Element(&rdn, p1, dn->end); for(p2 = rdn.beg; p2 < rdn.end;) { p2 = Curl_getASN1Element(&atv, p2, rdn.end); p3 = Curl_getASN1Element(&oid, atv.beg, atv.end); Curl_getASN1Element(&value, p3, atv.end); str = Curl_ASN1tostr(&oid, 0); if(!str) return -1; /* Encode delimiter. If attribute has a short uppercase name, delimiter is ", ". */ if(l) { for(p3 = str; isupper(*p3); p3++) ; for(p3 = (*p3 || p3 - str > 2)? "/": ", "; *p3; p3++) { if(l < n) buf[l] = *p3; l++; } } /* Encode attribute name. */ for(p3 = str; *p3; p3++) { if(l < n) buf[l] = *p3; l++; } free((char *) str); /* Generate equal sign. */ if(l < n) buf[l] = '='; l++; /* Generate value. */ str = Curl_ASN1tostr(&value, 0); if(!str) return -1; for(p3 = str; *p3; p3++) { if(l < n) buf[l] = *p3; l++; } free((char *) str); } } return l; } const char * Curl_DNtostr(curl_asn1Element * dn) { char * buf = (char *) NULL; ssize_t n = encodeDN(buf, 0, dn); /* Convert an ASN.1 distinguished name into a printable string. Return the dynamically allocated string, or NULL if an error occurs. */ if(n >= 0) { buf = malloc(n + 1); if(buf) { encodeDN(buf, n + 1, dn); buf[n] = '\0'; } } return (const char *) buf; } static const char * checkOID(const char * beg, const char * end, const char * oid) { curl_asn1Element e; const char * ccp; const char * p; bool matched; /* Check if first ASN.1 element at `beg' is the given OID. Return a pointer in the source after the OID if found, else NULL. */ ccp = Curl_getASN1Element(&e, beg, end); if(!ccp || e.tag != CURL_ASN1_OBJECT_IDENTIFIER) return (const char *) NULL; p = OID2str(e.beg, e.end, FALSE); if(!p) return (const char *) NULL; matched = !strcmp(p, oid); free((char *) p); return matched? ccp: (const char *) NULL; } /* * X509 parser. */ void Curl_parseX509(curl_X509certificate * cert, const char * beg, const char * end) { curl_asn1Element elem; curl_asn1Element tbsCertificate; const char * ccp; static const char defaultVersion = 0; /* v1. */ /* ASN.1 parse an X509 certificate into structure subfields. Syntax is assumed to have already been checked by the SSL backend. See RFC 5280. */ cert->certificate.beg = beg; cert->certificate.end = end; /* Get the sequence content. */ Curl_getASN1Element(&elem, beg, end); beg = elem.beg; end = elem.end; /* Get tbsCertificate. */ beg = Curl_getASN1Element(&tbsCertificate, beg, end); /* Skip the signatureAlgorithm. */ beg = Curl_getASN1Element(&cert->signatureAlgorithm, beg, end); /* Get the signatureValue. */ Curl_getASN1Element(&cert->signature, beg, end); /* Parse TBSCertificate. */ beg = tbsCertificate.beg; end = tbsCertificate.end; /* Get optional version, get serialNumber. */ cert->version.beg = &defaultVersion; cert->version.end = &defaultVersion + sizeof defaultVersion;; beg = Curl_getASN1Element(&elem, beg, end); if(elem.tag == 0) { Curl_getASN1Element(&cert->version, elem.beg, elem.end); beg = Curl_getASN1Element(&elem, beg, end); } cert->serialNumber = elem; /* Get signature algorithm. */ beg = Curl_getASN1Element(&cert->signatureAlgorithm, beg, end); /* Get issuer. */ beg = Curl_getASN1Element(&cert->issuer, beg, end); /* Get notBefore and notAfter. */ beg = Curl_getASN1Element(&elem, beg, end); ccp = Curl_getASN1Element(&cert->notBefore, elem.beg, elem.end); Curl_getASN1Element(&cert->notAfter, ccp, elem.end); /* Get subject. */ beg = Curl_getASN1Element(&cert->subject, beg, end); /* Get subjectPublicKeyAlgorithm and subjectPublicKey. */ beg = Curl_getASN1Element(&elem, beg, end); ccp = Curl_getASN1Element(&cert->subjectPublicKeyAlgorithm, elem.beg, elem.end); Curl_getASN1Element(&cert->subjectPublicKey, ccp, elem.end); /* Get optional issuerUiqueID, subjectUniqueID and extensions. */ cert->issuerUniqueID.tag = cert->subjectUniqueID.tag = 0; cert->extensions.tag = elem.tag = 0; cert->issuerUniqueID.beg = cert->issuerUniqueID.end = ""; cert->subjectUniqueID.beg = cert->subjectUniqueID.end = ""; cert->extensions.beg = cert->extensions.end = ""; if(beg < end) beg = Curl_getASN1Element(&elem, beg, end); if(elem.tag == 1) { cert->issuerUniqueID = elem; if(beg < end) beg = Curl_getASN1Element(&elem, beg, end); } if(elem.tag == 2) { cert->subjectUniqueID = elem; if(beg < end) beg = Curl_getASN1Element(&elem, beg, end); } if(elem.tag == 3) Curl_getASN1Element(&cert->extensions, elem.beg, elem.end); } static size_t copySubstring(char * to, const char * from) { size_t i; /* Copy at most 64-characters, terminate with a newline and returns the effective number of stored characters. */ for(i = 0; i < 64; i++) { to[i] = *from; if(!*from++) break; } to[i++] = '\n'; return i; } static const char * dumpAlgo(curl_asn1Element * param, const char * beg, const char * end) { curl_asn1Element oid; /* Get algorithm parameters and return algorithm name. */ beg = Curl_getASN1Element(&oid, beg, end); param->tag = 0; param->beg = param->end = end; if(beg < end) Curl_getASN1Element(param, beg, end); return OID2str(oid.beg, oid.end, TRUE); } static void do_pubkey_field(struct SessionHandle * data, int certnum, const char * label, curl_asn1Element * elem) { const char * output; /* Generate a certificate information record for the public key. */ output = Curl_ASN1tostr(elem, 0); if(output) { if(data->set.ssl.certinfo) Curl_ssl_push_certinfo(data, certnum, label, output); if(!certnum) infof(data, " %s: %s\n", label, output); free((char *) output); } } static void do_pubkey(struct SessionHandle * data, int certnum, const char * algo, curl_asn1Element * param, curl_asn1Element * pubkey) { curl_asn1Element elem; curl_asn1Element pk; const char * p; const char * q; unsigned long len; unsigned int i; /* Generate all information records for the public key. */ /* Get the public key (single element). */ Curl_getASN1Element(&pk, pubkey->beg + 1, pubkey->end); if(curl_strequal(algo, "rsaEncryption")) { p = Curl_getASN1Element(&elem, pk.beg, pk.end); /* Compute key length. */ for(q = elem.beg; !*q && q < elem.end; q++) ; len = (elem.end - q) * 8; if(len) for(i = *(unsigned char *) q; !(i & 0x80); i <<= 1) len--; if(len > 32) elem.beg = q; /* Strip leading zero bytes. */ if(!certnum) infof(data, " RSA Public Key (%lu bits)\n", len); if(data->set.ssl.certinfo) { q = curl_maprintf("%lu", len); if(q) { Curl_ssl_push_certinfo(data, certnum, "RSA Public Key", q); free((char *) q); } } /* Generate coefficients. */ do_pubkey_field(data, certnum, "rsa(n)", &elem); Curl_getASN1Element(&elem, p, pk.end); do_pubkey_field(data, certnum, "rsa(e)", &elem); } else if(curl_strequal(algo, "dsa")) { p = Curl_getASN1Element(&elem, param->beg, param->end); do_pubkey_field(data, certnum, "dsa(p)", &elem); p = Curl_getASN1Element(&elem, p, param->end); do_pubkey_field(data, certnum, "dsa(q)", &elem); Curl_getASN1Element(&elem, p, param->end); do_pubkey_field(data, certnum, "dsa(g)", &elem); do_pubkey_field(data, certnum, "dsa(pub_key)", &pk); } else if(curl_strequal(algo, "dhpublicnumber")) { p = Curl_getASN1Element(&elem, param->beg, param->end); do_pubkey_field(data, certnum, "dh(p)", &elem); Curl_getASN1Element(&elem, param->beg, param->end); do_pubkey_field(data, certnum, "dh(g)", &elem); do_pubkey_field(data, certnum, "dh(pub_key)", &pk); } #if 0 /* Patent-encumbered. */ else if(curl_strequal(algo, "ecPublicKey")) { /* Left TODO. */ } #endif } CURLcode Curl_extract_certinfo(struct connectdata * conn, int certnum, const char * beg, const char * end) { curl_X509certificate cert; struct SessionHandle * data = conn->data; curl_asn1Element param; const char * ccp; char * cp1; size_t cl1; char * cp2; CURLcode cc; unsigned long version; size_t i; size_t j; if(!data->set.ssl.certinfo) if(certnum) return CURLE_OK; /* Prepare the certificate information for curl_easy_getinfo(). */ /* Extract the certificate ASN.1 elements. */ Curl_parseX509(&cert, beg, end); /* Subject. */ ccp = Curl_DNtostr(&cert.subject); if(!ccp) return CURLE_OUT_OF_MEMORY; if(data->set.ssl.certinfo) Curl_ssl_push_certinfo(data, certnum, "Subject", ccp); if(!certnum) infof(data, "%2d Subject: %s\n", certnum, ccp); free((char *) ccp); /* Issuer. */ ccp = Curl_DNtostr(&cert.issuer); if(!ccp) return CURLE_OUT_OF_MEMORY; if(data->set.ssl.certinfo) Curl_ssl_push_certinfo(data, certnum, "Issuer", ccp); if(!certnum) infof(data, " Issuer: %s\n", ccp); free((char *) ccp); /* Version (always fits in less than 32 bits). */ version = 0; for(ccp = cert.version.beg; ccp < cert.version.end; ccp++) version = (version << 8) | *(const unsigned char *) ccp; if(data->set.ssl.certinfo) { ccp = curl_maprintf("%lx", version); if(!ccp) return CURLE_OUT_OF_MEMORY; Curl_ssl_push_certinfo(data, certnum, "Version", ccp); free((char *) ccp); } if(!certnum) infof(data, " Version: %lu (0x%lx)\n", version + 1, version); /* Serial number. */ ccp = Curl_ASN1tostr(&cert.serialNumber, 0); if(!ccp) return CURLE_OUT_OF_MEMORY; if(data->set.ssl.certinfo) Curl_ssl_push_certinfo(data, certnum, "Serial Number", ccp); if(!certnum) infof(data, " Serial Number: %s\n", ccp); free((char *) ccp); /* Signature algorithm .*/ ccp = dumpAlgo(¶m, cert.signatureAlgorithm.beg, cert.signatureAlgorithm.end); if(!ccp) return CURLE_OUT_OF_MEMORY; if(data->set.ssl.certinfo) Curl_ssl_push_certinfo(data, certnum, "Signature Algorithm", ccp); if(!certnum) infof(data, " Signature Algorithm: %s\n", ccp); free((char *) ccp); /* Start Date. */ ccp = Curl_ASN1tostr(&cert.notBefore, 0); if(!ccp) return CURLE_OUT_OF_MEMORY; if(data->set.ssl.certinfo) Curl_ssl_push_certinfo(data, certnum, "Start Date", ccp); if(!certnum) infof(data, " Start Date: %s\n", ccp); free((char *) ccp); /* Expire Date. */ ccp = Curl_ASN1tostr(&cert.notAfter, 0); if(!ccp) return CURLE_OUT_OF_MEMORY; if(data->set.ssl.certinfo) Curl_ssl_push_certinfo(data, certnum, "Expire Date", ccp); if(!certnum) infof(data, " Expire Date: %s\n", ccp); free((char *) ccp); /* Public Key Algorithm. */ ccp = dumpAlgo(¶m, cert.subjectPublicKeyAlgorithm.beg, cert.subjectPublicKeyAlgorithm.end); if(!ccp) return CURLE_OUT_OF_MEMORY; if(data->set.ssl.certinfo) Curl_ssl_push_certinfo(data, certnum, "Public Key Algorithm", ccp); if(!certnum) infof(data, " Public Key Algorithm: %s\n", ccp); do_pubkey(data, certnum, ccp, ¶m, &cert.subjectPublicKey); free((char *) ccp); /* TODO: extensions. */ /* Signature. */ ccp = Curl_ASN1tostr(&cert.signature, 0); if(!ccp) return CURLE_OUT_OF_MEMORY; if(data->set.ssl.certinfo) Curl_ssl_push_certinfo(data, certnum, "Signature", ccp); if(!certnum) infof(data, " Signature: %s\n", ccp); free((char *) ccp); /* Generate PEM certificate. */ cc = Curl_base64_encode(data, cert.certificate.beg, cert.certificate.end - cert.certificate.beg, &cp1, &cl1); if(cc != CURLE_OK) return cc; /* Compute the number of characters in final certificate string. Format is: -----BEGIN CERTIFICATE-----\n \n . . . -----END CERTIFICATE-----\n */ i = 28 + cl1 + (cl1 + 64 - 1) / 64 + 26; cp2 = malloc(i + 1); if(!cp2) { free(cp1); return CURLE_OUT_OF_MEMORY; } /* Build the certificate string. */ i = copySubstring(cp2, "-----BEGIN CERTIFICATE-----"); for(j = 0; j < cl1; j += 64) i += copySubstring(cp2 + i, cp1 + j); i += copySubstring(cp2 + i, "-----END CERTIFICATE-----"); cp2[i] = '\0'; free(cp1); if(data->set.ssl.certinfo) Curl_ssl_push_certinfo(data, certnum, "Cert", cp2); if(!certnum) infof(data, "%s\n", cp2); free(cp2); return CURLE_OK; } CURLcode Curl_verifyhost(struct connectdata * conn, const char * beg, const char * end) { struct SessionHandle * data = conn->data; curl_X509certificate cert; curl_asn1Element dn; curl_asn1Element elem; curl_asn1Element ext; curl_asn1Element name; int i; const char * p; const char * q; char * dnsname; int matched = -1; size_t addrlen = (size_t) -1; ssize_t len; #ifdef ENABLE_IPV6 struct in6_addr addr; #else struct in_addr addr; #endif /* Verify that connection server matches info in X509 certificate at `beg'..`end'. */ if(!data->set.ssl.verifyhost) return CURLE_OK; if(!beg) return CURLE_PEER_FAILED_VERIFICATION; Curl_parseX509(&cert, beg, end); /* Get the server IP address. */ #ifdef ENABLE_IPV6 if(conn->bits.ipv6_ip && Curl_inet_pton(AF_INET6, conn->host.name, &addr)) addrlen = sizeof(struct in6_addr); else #endif if(Curl_inet_pton(AF_INET, conn->host.name, &addr)) addrlen = sizeof(struct in_addr); /* Process extensions. */ for(p = cert.extensions.beg; p < cert.extensions.end && matched != 1;) { p = Curl_getASN1Element(&ext, p, cert.extensions.end); /* Check if extension is a subjectAlternativeName. */ ext.beg = checkOID(ext.beg, ext.end, sanOID); if(ext.beg) { ext.beg = Curl_getASN1Element(&elem, ext.beg, ext.end); /* Skip critical if present. */ if(elem.tag == CURL_ASN1_BOOLEAN) ext.beg = Curl_getASN1Element(&elem, ext.beg, ext.end); /* Parse the octet string contents: is a single sequence. */ Curl_getASN1Element(&elem, elem.beg, elem.end); /* Check all GeneralNames. */ for(q = elem.beg; matched != 1 && q < elem.end;) { q = Curl_getASN1Element(&name, q, elem.end); switch (name.tag) { case 2: /* DNS name. */ i = 0; len = utf8asn1str(&dnsname, CURL_ASN1_IA5_STRING, name.beg, name.end); if(len > 0) if(strlen(dnsname) == (size_t) len) i = Curl_cert_hostcheck((const char *) dnsname, conn->host.name); if(dnsname) free(dnsname); if(!i) return CURLE_PEER_FAILED_VERIFICATION; matched = i; break; case 7: /* IP address. */ matched = (size_t) (name.end - q) == addrlen && !memcmp(&addr, q, addrlen); break; } } } } switch (matched) { case 1: /* an alternative name matched the server hostname */ infof(data, "\t subjectAltName: %s matched\n", conn->host.dispname); return CURLE_OK; case 0: /* an alternative name field existed, but didn't match and then we MUST fail */ infof(data, "\t subjectAltName does not match %s\n", conn->host.dispname); return CURLE_PEER_FAILED_VERIFICATION; } /* Process subject. */ name.beg = name.end = ""; q = cert.subject.beg; /* we have to look to the last occurrence of a commonName in the distinguished one to get the most significant one. */ while(q < cert.subject.end) { q = Curl_getASN1Element(&dn, q, cert.subject.end); for(p = dn.beg; p < dn.end;) { p = Curl_getASN1Element(&elem, p, dn.end); /* We have a DN's AttributeTypeAndValue: check it in case it's a CN. */ elem.beg = checkOID(elem.beg, elem.end, cnOID); if(elem.beg) name = elem; /* Latch CN. */ } } /* Check the CN if found. */ if(!Curl_getASN1Element(&elem, name.beg, name.end)) failf(data, "SSL: unable to obtain common name from peer certificate"); else { len = utf8asn1str(&dnsname, elem.tag, elem.beg, elem.end); if(len < 0) { free(dnsname); return CURLE_OUT_OF_MEMORY; } if(strlen(dnsname) != (size_t) len) /* Nul byte in string ? */ failf(data, "SSL: illegal cert name field"); else if(Curl_cert_hostcheck((const char *) dnsname, conn->host.name)) { infof(data, "\t common name: %s (matched)\n", dnsname); free(dnsname); return CURLE_OK; } else failf(data, "SSL: certificate subject name '%s' does not match " "target host name '%s'", dnsname, conn->host.dispname); free(dnsname); } return CURLE_PEER_FAILED_VERIFICATION; } #endif /* USE_QSOSSL or USE_GSKIT or USE_NSS */ curl-7.35.0/lib/rtsp.c0000644000175000017500000006060312270035364011405 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_RTSP #include "urldata.h" #include #include "transfer.h" #include "sendf.h" #include "multiif.h" #include "http.h" #include "url.h" #include "progress.h" #include "rtsp.h" #include "rawstr.h" #include "curl_memory.h" #include "select.h" #include "connect.h" #define _MPRINTF_REPLACE /* use our functions only */ #include /* The last #include file should be: */ #include "memdebug.h" /* * TODO (general) * -incoming server requests * -server CSeq counter * -digest authentication * -connect thru proxy * -pipelining? */ #define RTP_PKT_CHANNEL(p) ((int)((unsigned char)((p)[1]))) #define RTP_PKT_LENGTH(p) ((((int)((unsigned char)((p)[2]))) << 8) | \ ((int)((unsigned char)((p)[3])))) /* protocol-specific functions set up to be called by the main engine */ static CURLcode rtsp_do(struct connectdata *conn, bool *done); static CURLcode rtsp_done(struct connectdata *conn, CURLcode, bool premature); static CURLcode rtsp_connect(struct connectdata *conn, bool *done); static CURLcode rtsp_disconnect(struct connectdata *conn, bool dead); static int rtsp_getsock_do(struct connectdata *conn, curl_socket_t *socks, int numsocks); /* * Parse and write out any available RTP data. * * nread: amount of data left after k->str. will be modified if RTP * data is parsed and k->str is moved up * readmore: whether or not the RTP parser needs more data right away */ static CURLcode rtsp_rtp_readwrite(struct SessionHandle *data, struct connectdata *conn, ssize_t *nread, bool *readmore); static CURLcode rtsp_setup_connection(struct connectdata *conn); /* this returns the socket to wait for in the DO and DOING state for the multi interface and then we're always _sending_ a request and thus we wait for the single socket to become writable only */ static int rtsp_getsock_do(struct connectdata *conn, curl_socket_t *socks, int numsocks) { /* write mode */ (void)numsocks; /* unused, we trust it to be at least 1 */ socks[0] = conn->sock[FIRSTSOCKET]; return GETSOCK_WRITESOCK(0); } static CURLcode rtp_client_write(struct connectdata *conn, char *ptr, size_t len); /* * RTSP handler interface. */ const struct Curl_handler Curl_handler_rtsp = { "RTSP", /* scheme */ rtsp_setup_connection, /* setup_connection */ rtsp_do, /* do_it */ rtsp_done, /* done */ ZERO_NULL, /* do_more */ rtsp_connect, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ rtsp_getsock_do, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ rtsp_disconnect, /* disconnect */ rtsp_rtp_readwrite, /* readwrite */ PORT_RTSP, /* defport */ CURLPROTO_RTSP, /* protocol */ PROTOPT_NONE /* flags */ }; static CURLcode rtsp_setup_connection(struct connectdata *conn) { struct RTSP *rtsp; conn->data->req.protop = rtsp = calloc(1, sizeof(struct RTSP)); if(!rtsp) return CURLE_OUT_OF_MEMORY; return CURLE_OK; } /* * The server may send us RTP data at any point, and RTSPREQ_RECEIVE does not * want to block the application forever while receiving a stream. Therefore, * we cannot assume that an RTSP socket is dead just because it is readable. * * Instead, if it is readable, run Curl_getconnectinfo() to peek at the socket * and distinguish between closed and data. */ bool Curl_rtsp_connisdead(struct connectdata *check) { int sval; bool ret_val = TRUE; sval = Curl_socket_ready(check->sock[FIRSTSOCKET], CURL_SOCKET_BAD, 0); if(sval == 0) { /* timeout */ ret_val = FALSE; } else if(sval & CURL_CSELECT_ERR) { /* socket is in an error state */ ret_val = TRUE; } else if((sval & CURL_CSELECT_IN) && check->data) { /* readable with no error. could be closed or could be alive but we can only check if we have a proper SessionHandle for the connection */ curl_socket_t connectinfo = Curl_getconnectinfo(check->data, &check); if(connectinfo != CURL_SOCKET_BAD) ret_val = FALSE; } return ret_val; } static CURLcode rtsp_connect(struct connectdata *conn, bool *done) { CURLcode httpStatus; struct SessionHandle *data = conn->data; httpStatus = Curl_http_connect(conn, done); /* Initialize the CSeq if not already done */ if(data->state.rtsp_next_client_CSeq == 0) data->state.rtsp_next_client_CSeq = 1; if(data->state.rtsp_next_server_CSeq == 0) data->state.rtsp_next_server_CSeq = 1; conn->proto.rtspc.rtp_channel = -1; return httpStatus; } static CURLcode rtsp_disconnect(struct connectdata *conn, bool dead) { (void) dead; Curl_safefree(conn->proto.rtspc.rtp_buf); return CURLE_OK; } static CURLcode rtsp_done(struct connectdata *conn, CURLcode status, bool premature) { struct SessionHandle *data = conn->data; struct RTSP *rtsp = data->req.protop; CURLcode httpStatus; long CSeq_sent; long CSeq_recv; /* Bypass HTTP empty-reply checks on receive */ if(data->set.rtspreq == RTSPREQ_RECEIVE) premature = TRUE; httpStatus = Curl_http_done(conn, status, premature); if(rtsp) { /* Check the sequence numbers */ CSeq_sent = rtsp->CSeq_sent; CSeq_recv = rtsp->CSeq_recv; if((data->set.rtspreq != RTSPREQ_RECEIVE) && (CSeq_sent != CSeq_recv)) { failf(data, "The CSeq of this request %ld did not match the response %ld", CSeq_sent, CSeq_recv); return CURLE_RTSP_CSEQ_ERROR; } else if(data->set.rtspreq == RTSPREQ_RECEIVE && (conn->proto.rtspc.rtp_channel == -1)) { infof(data, "Got an RTP Receive with a CSeq of %ld\n", CSeq_recv); /* TODO CPC: Server -> Client logic here */ } } return httpStatus; } static CURLcode rtsp_do(struct connectdata *conn, bool *done) { struct SessionHandle *data = conn->data; CURLcode result=CURLE_OK; Curl_RtspReq rtspreq = data->set.rtspreq; struct RTSP *rtsp = data->req.protop; struct HTTP *http; Curl_send_buffer *req_buffer; curl_off_t postsize = 0; /* for ANNOUNCE and SET_PARAMETER */ curl_off_t putsize = 0; /* for ANNOUNCE and SET_PARAMETER */ const char *p_request = NULL; const char *p_session_id = NULL; const char *p_accept = NULL; const char *p_accept_encoding = NULL; const char *p_range = NULL; const char *p_referrer = NULL; const char *p_stream_uri = NULL; const char *p_transport = NULL; const char *p_uagent = NULL; *done = TRUE; http = &(rtsp->http_wrapper); /* Assert that no one has changed the RTSP struct in an evil way */ DEBUGASSERT((void *)http == (void *)rtsp); rtsp->CSeq_sent = data->state.rtsp_next_client_CSeq; rtsp->CSeq_recv = 0; /* Setup the 'p_request' pointer to the proper p_request string * Since all RTSP requests are included here, there is no need to * support custom requests like HTTP. **/ DEBUGASSERT((rtspreq > RTSPREQ_NONE && rtspreq < RTSPREQ_LAST)); data->set.opt_no_body = TRUE; /* most requests don't contain a body */ switch(rtspreq) { case RTSPREQ_NONE: failf(data, "Got invalid RTSP request: RTSPREQ_NONE"); return CURLE_BAD_FUNCTION_ARGUMENT; case RTSPREQ_OPTIONS: p_request = "OPTIONS"; break; case RTSPREQ_DESCRIBE: p_request = "DESCRIBE"; data->set.opt_no_body = FALSE; break; case RTSPREQ_ANNOUNCE: p_request = "ANNOUNCE"; break; case RTSPREQ_SETUP: p_request = "SETUP"; break; case RTSPREQ_PLAY: p_request = "PLAY"; break; case RTSPREQ_PAUSE: p_request = "PAUSE"; break; case RTSPREQ_TEARDOWN: p_request = "TEARDOWN"; break; case RTSPREQ_GET_PARAMETER: /* GET_PARAMETER's no_body status is determined later */ p_request = "GET_PARAMETER"; data->set.opt_no_body = FALSE; break; case RTSPREQ_SET_PARAMETER: p_request = "SET_PARAMETER"; break; case RTSPREQ_RECORD: p_request = "RECORD"; break; case RTSPREQ_RECEIVE: p_request = ""; /* Treat interleaved RTP as body*/ data->set.opt_no_body = FALSE; break; case RTSPREQ_LAST: failf(data, "Got invalid RTSP request: RTSPREQ_LAST"); return CURLE_BAD_FUNCTION_ARGUMENT; } if(rtspreq == RTSPREQ_RECEIVE) { Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, &http->readbytecount, -1, NULL); return result; } p_session_id = data->set.str[STRING_RTSP_SESSION_ID]; if(!p_session_id && (rtspreq & ~(RTSPREQ_OPTIONS | RTSPREQ_DESCRIBE | RTSPREQ_SETUP))) { failf(data, "Refusing to issue an RTSP request [%s] without a session ID.", p_request ? p_request : ""); return CURLE_BAD_FUNCTION_ARGUMENT; } /* TODO: auth? */ /* TODO: proxy? */ /* Stream URI. Default to server '*' if not specified */ if(data->set.str[STRING_RTSP_STREAM_URI]) { p_stream_uri = data->set.str[STRING_RTSP_STREAM_URI]; } else { p_stream_uri = "*"; } /* Transport Header for SETUP requests */ p_transport = Curl_checkheaders(data, "Transport:"); if(rtspreq == RTSPREQ_SETUP && !p_transport) { /* New Transport: setting? */ if(data->set.str[STRING_RTSP_TRANSPORT]) { Curl_safefree(conn->allocptr.rtsp_transport); conn->allocptr.rtsp_transport = aprintf("Transport: %s\r\n", data->set.str[STRING_RTSP_TRANSPORT]); if(!conn->allocptr.rtsp_transport) return CURLE_OUT_OF_MEMORY; } else { failf(data, "Refusing to issue an RTSP SETUP without a Transport: header."); return CURLE_BAD_FUNCTION_ARGUMENT; } p_transport = conn->allocptr.rtsp_transport; } /* Accept Headers for DESCRIBE requests */ if(rtspreq == RTSPREQ_DESCRIBE) { /* Accept Header */ p_accept = Curl_checkheaders(data, "Accept:")? NULL:"Accept: application/sdp\r\n"; /* Accept-Encoding header */ if(!Curl_checkheaders(data, "Accept-Encoding:") && data->set.str[STRING_ENCODING]) { Curl_safefree(conn->allocptr.accept_encoding); conn->allocptr.accept_encoding = aprintf("Accept-Encoding: %s\r\n", data->set.str[STRING_ENCODING]); if(!conn->allocptr.accept_encoding) return CURLE_OUT_OF_MEMORY; p_accept_encoding = conn->allocptr.accept_encoding; } } /* 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(Curl_checkheaders(data, "User-Agent:") && conn->allocptr.uagent) { Curl_safefree(conn->allocptr.uagent); conn->allocptr.uagent = NULL; } else if(!Curl_checkheaders(data, "User-Agent:") && data->set.str[STRING_USERAGENT]) { p_uagent = conn->allocptr.uagent; } /* Referrer */ Curl_safefree(conn->allocptr.ref); if(data->change.referer && !Curl_checkheaders(data, "Referer:")) conn->allocptr.ref = aprintf("Referer: %s\r\n", data->change.referer); else conn->allocptr.ref = NULL; p_referrer = conn->allocptr.ref; /* * Range Header * Only applies to PLAY, PAUSE, RECORD * * Go ahead and use the Range stuff supplied for HTTP */ if(data->state.use_range && (rtspreq & (RTSPREQ_PLAY | RTSPREQ_PAUSE | RTSPREQ_RECORD))) { /* Check to see if there is a range set in the custom headers */ if(!Curl_checkheaders(data, "Range:") && data->state.range) { Curl_safefree(conn->allocptr.rangeline); conn->allocptr.rangeline = aprintf("Range: %s\r\n", data->state.range); p_range = conn->allocptr.rangeline; } } /* * Sanity check the custom headers */ if(Curl_checkheaders(data, "CSeq:")) { failf(data, "CSeq cannot be set as a custom header."); return CURLE_RTSP_CSEQ_ERROR; } if(Curl_checkheaders(data, "Session:")) { failf(data, "Session ID cannot be set as a custom header."); return CURLE_BAD_FUNCTION_ARGUMENT; } /* Initialize a dynamic send buffer */ req_buffer = Curl_add_buffer_init(); if(!req_buffer) return CURLE_OUT_OF_MEMORY; result = Curl_add_bufferf(req_buffer, "%s %s RTSP/1.0\r\n" /* Request Stream-URI RTSP/1.0 */ "CSeq: %ld\r\n", /* CSeq */ (p_request ? p_request : ""), p_stream_uri, rtsp->CSeq_sent); if(result) return result; /* * Rather than do a normal alloc line, keep the session_id unformatted * to make comparison easier */ if(p_session_id) { result = Curl_add_bufferf(req_buffer, "Session: %s\r\n", p_session_id); if(result) return result; } /* * Shared HTTP-like options */ result = Curl_add_bufferf(req_buffer, "%s" /* transport */ "%s" /* accept */ "%s" /* accept-encoding */ "%s" /* range */ "%s" /* referrer */ "%s" /* user-agent */ , p_transport ? p_transport : "", p_accept ? p_accept : "", p_accept_encoding ? p_accept_encoding : "", p_range ? p_range : "", p_referrer ? p_referrer : "", p_uagent ? p_uagent : ""); if(result) return result; if((rtspreq == RTSPREQ_SETUP) || (rtspreq == RTSPREQ_DESCRIBE)) { result = Curl_add_timecondition(data, req_buffer); if(result) return result; } result = Curl_add_custom_headers(conn, req_buffer); if(result) return result; if(rtspreq == RTSPREQ_ANNOUNCE || rtspreq == RTSPREQ_SET_PARAMETER || rtspreq == RTSPREQ_GET_PARAMETER) { if(data->set.upload) { putsize = data->set.infilesize; data->set.httpreq = HTTPREQ_PUT; } else { postsize = (data->set.postfieldsize != -1)? data->set.postfieldsize: (data->set.postfields? (curl_off_t)strlen(data->set.postfields):0); data->set.httpreq = HTTPREQ_POST; } if(putsize > 0 || postsize > 0) { /* As stated in the http comments, it is probably not wise to * actually set a custom Content-Length in the headers */ if(!Curl_checkheaders(data, "Content-Length:")) { result = Curl_add_bufferf(req_buffer, "Content-Length: %" CURL_FORMAT_CURL_OFF_T"\r\n", (data->set.upload ? putsize : postsize)); if(result) return result; } if(rtspreq == RTSPREQ_SET_PARAMETER || rtspreq == RTSPREQ_GET_PARAMETER) { if(!Curl_checkheaders(data, "Content-Type:")) { result = Curl_add_bufferf(req_buffer, "Content-Type: text/parameters\r\n"); if(result) return result; } } if(rtspreq == RTSPREQ_ANNOUNCE) { if(!Curl_checkheaders(data, "Content-Type:")) { result = Curl_add_bufferf(req_buffer, "Content-Type: application/sdp\r\n"); if(result) return result; } } data->state.expect100header = FALSE; /* RTSP posts are simple/small */ } else if(rtspreq == RTSPREQ_GET_PARAMETER) { /* Check for an empty GET_PARAMETER (heartbeat) request */ data->set.httpreq = HTTPREQ_HEAD; data->set.opt_no_body = TRUE; } } /* RTSP never allows chunked transfer */ data->req.forbidchunk = TRUE; /* Finish the request buffer */ result = Curl_add_buffer(req_buffer, "\r\n", 2); if(result) return result; if(postsize > 0) { result = Curl_add_buffer(req_buffer, data->set.postfields, (size_t)postsize); if(result) return result; } /* issue the request */ result = Curl_add_buffer_send(req_buffer, conn, &data->info.request_size, 0, FIRSTSOCKET); if(result) { failf(data, "Failed sending RTSP request"); return result; } Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, &http->readbytecount, putsize?FIRSTSOCKET:-1, putsize?&http->writebytecount:NULL); /* Increment the CSeq on success */ data->state.rtsp_next_client_CSeq++; if(http->writebytecount) { /* if a request-body has been sent off, we make sure this progress is noted properly */ Curl_pgrsSetUploadCounter(data, http->writebytecount); if(Curl_pgrsUpdate(conn)) result = CURLE_ABORTED_BY_CALLBACK; } return result; } static CURLcode rtsp_rtp_readwrite(struct SessionHandle *data, struct connectdata *conn, ssize_t *nread, bool *readmore) { struct SingleRequest *k = &data->req; struct rtsp_conn *rtspc = &(conn->proto.rtspc); char *rtp; /* moving pointer to rtp data */ ssize_t rtp_dataleft; /* how much data left to parse in this round */ char *scratch; CURLcode result; if(rtspc->rtp_buf) { /* There was some leftover data the last time. Merge buffers */ char *newptr = realloc(rtspc->rtp_buf, rtspc->rtp_bufsize + *nread); if(!newptr) { Curl_safefree(rtspc->rtp_buf); rtspc->rtp_buf = NULL; rtspc->rtp_bufsize = 0; return CURLE_OUT_OF_MEMORY; } rtspc->rtp_buf = newptr; memcpy(rtspc->rtp_buf + rtspc->rtp_bufsize, k->str, *nread); rtspc->rtp_bufsize += *nread; rtp = rtspc->rtp_buf; rtp_dataleft = rtspc->rtp_bufsize; } else { /* Just parse the request buffer directly */ rtp = k->str; rtp_dataleft = *nread; } while((rtp_dataleft > 0) && (rtp[0] == '$')) { if(rtp_dataleft > 4) { int rtp_length; /* Parse the header */ /* The channel identifier immediately follows and is 1 byte */ rtspc->rtp_channel = RTP_PKT_CHANNEL(rtp); /* The length is two bytes */ rtp_length = RTP_PKT_LENGTH(rtp); if(rtp_dataleft < rtp_length + 4) { /* Need more - incomplete payload*/ *readmore = TRUE; break; } else { /* We have the full RTP interleaved packet * Write out the header including the leading '$' */ DEBUGF(infof(data, "RTP write channel %d rtp_length %d\n", rtspc->rtp_channel, rtp_length)); result = rtp_client_write(conn, &rtp[0], rtp_length + 4); if(result) { failf(data, "Got an error writing an RTP packet"); *readmore = FALSE; Curl_safefree(rtspc->rtp_buf); rtspc->rtp_buf = NULL; rtspc->rtp_bufsize = 0; return result; } /* Move forward in the buffer */ rtp_dataleft -= rtp_length + 4; rtp += rtp_length + 4; if(data->set.rtspreq == RTSPREQ_RECEIVE) { /* If we are in a passive receive, give control back * to the app as often as we can. */ k->keepon &= ~KEEP_RECV; } } } else { /* Need more - incomplete header */ *readmore = TRUE; break; } } if(rtp_dataleft != 0 && rtp[0] == '$') { DEBUGF(infof(data, "RTP Rewinding %zd %s\n", rtp_dataleft, *readmore ? "(READMORE)" : "")); /* Store the incomplete RTP packet for a "rewind" */ scratch = malloc(rtp_dataleft); if(!scratch) { Curl_safefree(rtspc->rtp_buf); rtspc->rtp_buf = NULL; rtspc->rtp_bufsize = 0; return CURLE_OUT_OF_MEMORY; } memcpy(scratch, rtp, rtp_dataleft); Curl_safefree(rtspc->rtp_buf); rtspc->rtp_buf = scratch; rtspc->rtp_bufsize = rtp_dataleft; /* As far as the transfer is concerned, this data is consumed */ *nread = 0; return CURLE_OK; } else { /* Fix up k->str to point just after the last RTP packet */ k->str += *nread - rtp_dataleft; /* either all of the data has been read or... * rtp now points at the next byte to parse */ if(rtp_dataleft > 0) DEBUGASSERT(k->str[0] == rtp[0]); DEBUGASSERT(rtp_dataleft <= *nread); /* sanity check */ *nread = rtp_dataleft; } /* If we get here, we have finished with the leftover/merge buffer */ Curl_safefree(rtspc->rtp_buf); rtspc->rtp_buf = NULL; rtspc->rtp_bufsize = 0; return CURLE_OK; } static CURLcode rtp_client_write(struct connectdata *conn, char *ptr, size_t len) { struct SessionHandle *data = conn->data; size_t wrote; curl_write_callback writeit; if(len == 0) { failf (data, "Cannot write a 0 size RTP packet."); return CURLE_WRITE_ERROR; } writeit = data->set.fwrite_rtp?data->set.fwrite_rtp:data->set.fwrite_func; wrote = writeit(ptr, 1, len, data->set.rtp_out); if(CURL_WRITEFUNC_PAUSE == wrote) { failf (data, "Cannot pause RTP"); return CURLE_WRITE_ERROR; } if(wrote != len) { failf (data, "Failed writing RTP data"); return CURLE_WRITE_ERROR; } return CURLE_OK; } CURLcode Curl_rtsp_parseheader(struct connectdata *conn, char *header) { struct SessionHandle *data = conn->data; long CSeq = 0; if(checkprefix("CSeq:", header)) { /* Store the received CSeq. Match is verified in rtsp_done */ int nc = sscanf(&header[4], ": %ld", &CSeq); if(nc == 1) { struct RTSP *rtsp = data->req.protop; rtsp->CSeq_recv = CSeq; /* mark the request */ data->state.rtsp_CSeq_recv = CSeq; /* update the handle */ } else { failf(data, "Unable to read the CSeq header: [%s]", header); return CURLE_RTSP_CSEQ_ERROR; } } else if(checkprefix("Session:", header)) { char *start; /* Find the first non-space letter */ start = header + 9; while(*start && ISSPACE(*start)) start++; if(!*start) { failf(data, "Got a blank Session ID"); } else if(data->set.str[STRING_RTSP_SESSION_ID]) { /* If the Session ID is set, then compare */ if(strncmp(start, data->set.str[STRING_RTSP_SESSION_ID], strlen(data->set.str[STRING_RTSP_SESSION_ID])) != 0) { failf(data, "Got RTSP Session ID Line [%s], but wanted ID [%s]", start, data->set.str[STRING_RTSP_SESSION_ID]); return CURLE_RTSP_SESSION_ERROR; } } else { /* If the Session ID is not set, and we find it in a response, then set it */ /* The session ID can be an alphanumeric or a 'safe' character * * RFC 2326 15.1 Base Syntax: * safe = "\$" | "-" | "_" | "." | "+" * */ char *end = start; while(*end && (ISALNUM(*end) || *end == '-' || *end == '_' || *end == '.' || *end == '+' || (*end == '\\' && *(end + 1) && *(end + 1) == '$' && (++end, 1)))) end++; /* Copy the id substring into a new buffer */ data->set.str[STRING_RTSP_SESSION_ID] = malloc(end - start + 1); if(data->set.str[STRING_RTSP_SESSION_ID] == NULL) return CURLE_OUT_OF_MEMORY; memcpy(data->set.str[STRING_RTSP_SESSION_ID], start, end - start); (data->set.str[STRING_RTSP_SESSION_ID])[end - start] = '\0'; } } return CURLE_OK; } #endif /* CURL_DISABLE_RTSP */ curl-7.35.0/lib/file.h0000644000175000017500000000313612213173003011325 00000000000000#ifndef HEADER_CURL_FILE_H #define HEADER_CURL_FILE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2009, 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. * ***************************************************************************/ /**************************************************************************** * 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! */ }; #ifndef CURL_DISABLE_FILE extern const struct Curl_handler Curl_handler_file; #endif #endif /* HEADER_CURL_FILE_H */ curl-7.35.0/lib/amigaos.h0000644000175000017500000000246512213173003012032 00000000000000#ifndef HEADER_CURL_AMIGAOS_H #define HEADER_CURL_AMIGAOS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(__AMIGA__) && !defined(__ixemul__) bool Curl_amiga_init(); void Curl_amiga_cleanup(); #else #define Curl_amiga_init() 1 #define Curl_amiga_cleanup() Curl_nop_stmt #endif #endif /* HEADER_CURL_AMIGAOS_H */ curl-7.35.0/lib/memdebug.c0000644000175000017500000003100412270035364012173 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef CURLDEBUG #include #define _MPRINTF_REPLACE #include #include "urldata.h" #define MEMDEBUG_NODEFINES /* don't redefine the standard functions */ #include "curl_memory.h" #include "memdebug.h" #ifndef HAVE_ASSERT_H # define assert(x) Curl_nop_stmt #endif /* * Until 2011-08-17 libcurl's Memory Tracking feature also performed * automatic malloc and free filling operations using 0xA5 and 0x13 * values. Our own preinitialization of dynamically allocated memory * might be useful when not using third party memory debuggers, but * on the other hand this would fool memory debuggers into thinking * that all dynamically allocated memory is properly initialized. * * As a default setting, libcurl's Memory Tracking feature no longer * performs preinitialization of dynamically allocated memory on its * own. If you know what you are doing, and really want to retain old * behavior, you can achieve this compiling with preprocessor symbols * CURL_MT_MALLOC_FILL and CURL_MT_FREE_FILL defined with appropriate * values. */ #ifdef CURL_MT_MALLOC_FILL # if (CURL_MT_MALLOC_FILL < 0) || (CURL_MT_MALLOC_FILL > 0xff) # error "invalid CURL_MT_MALLOC_FILL or out of range" # endif #endif #ifdef CURL_MT_FREE_FILL # if (CURL_MT_FREE_FILL < 0) || (CURL_MT_FREE_FILL > 0xff) # error "invalid CURL_MT_FREE_FILL or out of range" # endif #endif #if defined(CURL_MT_MALLOC_FILL) && defined(CURL_MT_FREE_FILL) # if (CURL_MT_MALLOC_FILL == CURL_MT_FREE_FILL) # error "CURL_MT_MALLOC_FILL same as CURL_MT_FREE_FILL" # endif #endif #ifdef CURL_MT_MALLOC_FILL # define mt_malloc_fill(buf,len) memset((buf), CURL_MT_MALLOC_FILL, (len)) #else # define mt_malloc_fill(buf,len) Curl_nop_stmt #endif #ifdef CURL_MT_FREE_FILL # define mt_free_fill(buf,len) memset((buf), CURL_MT_FREE_FILL, (len)) #else # define mt_free_fill(buf,len) Curl_nop_stmt #endif struct memdebug { size_t size; union { curl_off_t o; double d; void * p; } 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 = NULL; static bool memlimit = FALSE; /* enable memory limit */ static long memsize = 0; /* set number of mallocs allowed */ /* this sets the log file name */ void curl_memdebug(const char *logname) { if(!logfile) { if(logname && *logname) logfile = fopen(logname, "w"); else logfile = stderr; #ifdef MEMDEBUG_LOG_SYNC /* Flush the log file after every line so the log isn't lost in a crash */ setvbuf(logfile, (char *)NULL, _IOLBF, 0); #endif } } /* This function sets the number of malloc() calls that should return successfully! */ void curl_memlimit(long limit) { if(!memlimit) { 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(source) { /* log to file */ curl_memlog("LIMIT %s:%d %s reached memlimit\n", source, line, func); /* log to stderr also */ fprintf(stderr, "LIMIT %s:%d %s reached memlimit\n", source, line, func); } SET_ERRNO(ENOMEM); return TRUE; /* RETURN ERROR! */ } else memsize--; /* countdown */ /* log the countdown */ if(source) curl_memlog("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; assert(wantedsize != 0); if(countcheck("malloc", line, source)) return NULL; /* alloc at least 64 bytes */ size = sizeof(struct memdebug)+wantedsize; mem = (Curl_cmalloc)(size); if(mem) { /* fill memory with junk */ mt_malloc_fill(mem->mem, wantedsize); mem->size = wantedsize; } if(source) curl_memlog("MEM %s:%d malloc(%zu) = %p\n", source, line, wantedsize, mem ? (void *)mem->mem : (void *)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; assert(wanted_elements != 0); assert(wanted_size != 0); 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 = (Curl_ccalloc)(1, size); if(mem) mem->size = user_size; if(source) curl_memlog("MEM %s:%d calloc(%zu,%zu) = %p\n", source, line, wanted_elements, wanted_size, mem ? (void *)mem->mem : (void *)0); return (mem ? mem->mem : NULL); } char *curl_dostrdup(const char *str, int line, const char *source) { char *mem; size_t len; assert(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(source) curl_memlog("MEM %s:%d strdup(%p) (%zu) = %p\n", source, line, (void *)str, len, (void *)mem); return mem; } #if defined(WIN32) && defined(UNICODE) wchar_t *curl_dowcsdup(const wchar_t *str, int line, const char *source) { wchar_t *mem; size_t wsiz, bsiz; assert(str != NULL); if(countcheck("wcsdup", line, source)) return NULL; wsiz = wcslen(str) + 1; bsiz = wsiz * sizeof(wchar_t); mem = curl_domalloc(bsiz, 0, NULL); /* NULL prevents logging */ if(mem) memcpy(mem, str, bsiz); if(source) curl_memlog("MEM %s:%d wcsdup(%p) (%zu) = %p\n", source, line, (void *)str, bsiz, (void *)mem); return mem; } #endif /* 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; assert(wantedsize != 0); if(countcheck("realloc", line, source)) return NULL; #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:1684) /* 1684: conversion from pointer to same-sized integral type */ #endif if(ptr) mem = (void *)((char *)ptr - offsetof(struct memdebug, mem)); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif mem = (Curl_crealloc)(mem, size); if(source) curl_memlog("MEM %s:%d realloc(%p, %zu) = %p\n", source, line, (void *)ptr, wantedsize, mem ? (void *)mem->mem : (void *)0); if(mem) { mem->size = wantedsize; return mem->mem; } return NULL; } void curl_dofree(void *ptr, int line, const char *source) { struct memdebug *mem; if(ptr) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:1684) /* 1684: conversion from pointer to same-sized integral type */ #endif mem = (void *)((char *)ptr - offsetof(struct memdebug, mem)); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif /* destroy */ mt_free_fill(mem->mem, mem->size); /* free for real */ (Curl_cfree)(mem); } if(source) curl_memlog("MEM %s:%d free(%p)\n", source, line, (void *)ptr); } curl_socket_t curl_socket(int domain, int type, int protocol, int line, const char *source) { const char *fmt = (sizeof(curl_socket_t) == sizeof(int)) ? "FD %s:%d socket() = %d\n" : (sizeof(curl_socket_t) == sizeof(long)) ? "FD %s:%d socket() = %ld\n" : "FD %s:%d socket() = %zd\n" ; curl_socket_t sockfd = socket(domain, type, protocol); if(source && (sockfd != CURL_SOCKET_BAD)) curl_memlog(fmt, source, line, sockfd); return sockfd; } #ifdef HAVE_SOCKETPAIR int curl_socketpair(int domain, int type, int protocol, curl_socket_t socket_vector[2], int line, const char *source) { const char *fmt = (sizeof(curl_socket_t) == sizeof(int)) ? "FD %s:%d socketpair() = %d %d\n" : (sizeof(curl_socket_t) == sizeof(long)) ? "FD %s:%d socketpair() = %ld %ld\n" : "FD %s:%d socketpair() = %zd %zd\n" ; int res = socketpair(domain, type, protocol, socket_vector); if(source && (0 == res)) curl_memlog(fmt, source, line, socket_vector[0], socket_vector[1]); return res; } #endif curl_socket_t curl_accept(curl_socket_t s, void *saddr, void *saddrlen, int line, const char *source) { const char *fmt = (sizeof(curl_socket_t) == sizeof(int)) ? "FD %s:%d accept() = %d\n" : (sizeof(curl_socket_t) == sizeof(long)) ? "FD %s:%d accept() = %ld\n" : "FD %s:%d accept() = %zd\n" ; struct sockaddr *addr = (struct sockaddr *)saddr; curl_socklen_t *addrlen = (curl_socklen_t *)saddrlen; curl_socket_t sockfd = accept(s, addr, addrlen); if(source && (sockfd != CURL_SOCKET_BAD)) curl_memlog(fmt, source, line, sockfd); return sockfd; } /* separate function to allow libcurl to mark a "faked" close */ void curl_mark_sclose(curl_socket_t sockfd, int line, const char *source) { const char *fmt = (sizeof(curl_socket_t) == sizeof(int)) ? "FD %s:%d sclose(%d)\n" : (sizeof(curl_socket_t) == sizeof(long)) ? "FD %s:%d sclose(%ld)\n" : "FD %s:%d sclose(%zd)\n" ; if(source) curl_memlog(fmt, source, line, sockfd); } /* this is our own defined way to close sockets on *ALL* platforms */ int curl_sclose(curl_socket_t sockfd, int line, const char *source) { int res=sclose(sockfd); curl_mark_sclose(sockfd, line, source); return res; } FILE *curl_fopen(const char *file, const char *mode, int line, const char *source) { FILE *res=fopen(file, mode); if(source) curl_memlog("FILE %s:%d fopen(\"%s\",\"%s\") = %p\n", source, line, file, mode, (void *)res); return res; } #ifdef HAVE_FDOPEN FILE *curl_fdopen(int filedes, const char *mode, int line, const char *source) { FILE *res=fdopen(filedes, mode); if(source) curl_memlog("FILE %s:%d fdopen(\"%d\",\"%s\") = %p\n", source, line, filedes, mode, (void *)res); return res; } #endif int curl_fclose(FILE *file, int line, const char *source) { int res; assert(file != NULL); res=fclose(file); if(source) curl_memlog("FILE %s:%d fclose(%p)\n", source, line, (void *)file); return res; } #define LOGLINE_BUFSIZE 1024 /* this does the writting to the memory tracking log file */ void curl_memlog(const char *format, ...) { char *buf; int nchars; va_list ap; if(!logfile) return; buf = (Curl_cmalloc)(LOGLINE_BUFSIZE); if(!buf) return; va_start(ap, format); nchars = vsnprintf(buf, LOGLINE_BUFSIZE, format, ap); va_end(ap); if(nchars > LOGLINE_BUFSIZE - 1) nchars = LOGLINE_BUFSIZE - 1; if(nchars > 0) fwrite(buf, 1, nchars, logfile); (Curl_cfree)(buf); } #endif /* CURLDEBUG */ curl-7.35.0/lib/curl_fnmatch.c0000644000175000017500000002644712213173003013060 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #include "curl_fnmatch.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" #define CURLFNM_CHARSET_LEN (sizeof(char) * 256) #define CURLFNM_CHSET_SIZE (CURLFNM_CHARSET_LEN + 15) #define CURLFNM_NEGATE CURLFNM_CHARSET_LEN #define CURLFNM_ALNUM (CURLFNM_CHARSET_LEN + 1) #define CURLFNM_DIGIT (CURLFNM_CHARSET_LEN + 2) #define CURLFNM_XDIGIT (CURLFNM_CHARSET_LEN + 3) #define CURLFNM_ALPHA (CURLFNM_CHARSET_LEN + 4) #define CURLFNM_PRINT (CURLFNM_CHARSET_LEN + 5) #define CURLFNM_BLANK (CURLFNM_CHARSET_LEN + 6) #define CURLFNM_LOWER (CURLFNM_CHARSET_LEN + 7) #define CURLFNM_GRAPH (CURLFNM_CHARSET_LEN + 8) #define CURLFNM_SPACE (CURLFNM_CHARSET_LEN + 9) #define CURLFNM_UPPER (CURLFNM_CHARSET_LEN + 10) typedef enum { CURLFNM_LOOP_DEFAULT = 0, CURLFNM_LOOP_BACKSLASH } loop_state; typedef enum { CURLFNM_SCHS_DEFAULT = 0, CURLFNM_SCHS_MAYRANGE, CURLFNM_SCHS_MAYRANGE2, CURLFNM_SCHS_RIGHTBR, CURLFNM_SCHS_RIGHTBRLEFTBR } setcharset_state; typedef enum { CURLFNM_PKW_INIT = 0, CURLFNM_PKW_DDOT } parsekey_state; #define SETCHARSET_OK 1 #define SETCHARSET_FAIL 0 static int parsekeyword(unsigned char **pattern, unsigned char *charset) { parsekey_state state = CURLFNM_PKW_INIT; #define KEYLEN 10 char keyword[KEYLEN] = { 0 }; int found = FALSE; int i; unsigned char *p = *pattern; for(i = 0; !found; i++) { char c = *p++; if(i >= KEYLEN) return SETCHARSET_FAIL; switch(state) { case CURLFNM_PKW_INIT: if(ISALPHA(c) && ISLOWER(c)) keyword[i] = c; else if(c == ':') state = CURLFNM_PKW_DDOT; else return 0; break; case CURLFNM_PKW_DDOT: if(c == ']') found = TRUE; else return SETCHARSET_FAIL; } } #undef KEYLEN *pattern = p; /* move caller's pattern pointer */ if(strcmp(keyword, "digit") == 0) charset[CURLFNM_DIGIT] = 1; else if(strcmp(keyword, "alnum") == 0) charset[CURLFNM_ALNUM] = 1; else if(strcmp(keyword, "alpha") == 0) charset[CURLFNM_ALPHA] = 1; else if(strcmp(keyword, "xdigit") == 0) charset[CURLFNM_XDIGIT] = 1; else if(strcmp(keyword, "print") == 0) charset[CURLFNM_PRINT] = 1; else if(strcmp(keyword, "graph") == 0) charset[CURLFNM_GRAPH] = 1; else if(strcmp(keyword, "space") == 0) charset[CURLFNM_SPACE] = 1; else if(strcmp(keyword, "blank") == 0) charset[CURLFNM_BLANK] = 1; else if(strcmp(keyword, "upper") == 0) charset[CURLFNM_UPPER] = 1; else if(strcmp(keyword, "lower") == 0) charset[CURLFNM_LOWER] = 1; else return SETCHARSET_FAIL; return SETCHARSET_OK; } /* returns 1 (true) if pattern is OK, 0 if is bad ("p" is pattern pointer) */ static int setcharset(unsigned char **p, unsigned char *charset) { setcharset_state state = CURLFNM_SCHS_DEFAULT; unsigned char rangestart = 0; unsigned char lastchar = 0; bool something_found = FALSE; unsigned char c; for(;;) { c = **p; switch(state) { case CURLFNM_SCHS_DEFAULT: if(ISALNUM(c)) { /* ASCII value */ rangestart = c; charset[c] = 1; (*p)++; state = CURLFNM_SCHS_MAYRANGE; something_found = TRUE; } else if(c == ']') { if(something_found) return SETCHARSET_OK; else something_found = TRUE; state = CURLFNM_SCHS_RIGHTBR; charset[c] = 1; (*p)++; } else if(c == '[') { char c2 = *((*p)+1); if(c2 == ':') { /* there has to be a keyword */ (*p) += 2; if(parsekeyword(p, charset)) { state = CURLFNM_SCHS_DEFAULT; } else return SETCHARSET_FAIL; } else { charset[c] = 1; (*p)++; } something_found = TRUE; } else if(c == '?' || c == '*') { something_found = TRUE; charset[c] = 1; (*p)++; } else if(c == '^' || c == '!') { if(!something_found) { if(charset[CURLFNM_NEGATE]) { charset[c] = 1; something_found = TRUE; } else charset[CURLFNM_NEGATE] = 1; /* negate charset */ } else charset[c] = 1; (*p)++; } else if(c == '\\') { c = *(++(*p)); if(ISPRINT((c))) { something_found = TRUE; state = CURLFNM_SCHS_MAYRANGE; charset[c] = 1; rangestart = c; (*p)++; } else return SETCHARSET_FAIL; } else if(c == '\0') { return SETCHARSET_FAIL; } else { charset[c] = 1; (*p)++; something_found = TRUE; } break; case CURLFNM_SCHS_MAYRANGE: if(c == '-') { charset[c] = 1; (*p)++; lastchar = '-'; state = CURLFNM_SCHS_MAYRANGE2; } else if(c == '[') { state = CURLFNM_SCHS_DEFAULT; } else if(ISALNUM(c)) { charset[c] = 1; (*p)++; } else if(c == '\\') { c = *(++(*p)); if(ISPRINT(c)) { charset[c] = 1; (*p)++; } else return SETCHARSET_FAIL; } else if(c == ']') { return SETCHARSET_OK; } else return SETCHARSET_FAIL; break; case CURLFNM_SCHS_MAYRANGE2: if(c == '\\') { c = *(++(*p)); if(!ISPRINT(c)) return SETCHARSET_FAIL; } if(c == ']') { return SETCHARSET_OK; } else if(c == '\\') { c = *(++(*p)); if(ISPRINT(c)) { charset[c] = 1; state = CURLFNM_SCHS_DEFAULT; (*p)++; } else return SETCHARSET_FAIL; } if(c >= rangestart) { if((ISLOWER(c) && ISLOWER(rangestart)) || (ISDIGIT(c) && ISDIGIT(rangestart)) || (ISUPPER(c) && ISUPPER(rangestart))) { charset[lastchar] = 0; rangestart++; while(rangestart++ <= c) charset[rangestart-1] = 1; (*p)++; state = CURLFNM_SCHS_DEFAULT; } else return SETCHARSET_FAIL; } break; case CURLFNM_SCHS_RIGHTBR: if(c == '[') { state = CURLFNM_SCHS_RIGHTBRLEFTBR; charset[c] = 1; (*p)++; } else if(c == ']') { return SETCHARSET_OK; } else if(c == '\0') { return SETCHARSET_FAIL; } else if(ISPRINT(c)) { charset[c] = 1; (*p)++; state = CURLFNM_SCHS_DEFAULT; } else /* used 'goto fail' instead of 'return SETCHARSET_FAIL' to avoid a * nonsense warning 'statement not reached' at end of the fnc when * compiling on Solaris */ goto fail; break; case CURLFNM_SCHS_RIGHTBRLEFTBR: if(c == ']') { return SETCHARSET_OK; } else { state = CURLFNM_SCHS_DEFAULT; charset[c] = 1; (*p)++; } break; } } fail: return SETCHARSET_FAIL; } static int loop(const unsigned char *pattern, const unsigned char *string) { loop_state state = CURLFNM_LOOP_DEFAULT; unsigned char *p = (unsigned char *)pattern; unsigned char *s = (unsigned char *)string; unsigned char charset[CURLFNM_CHSET_SIZE] = { 0 }; int rc = 0; for(;;) { switch(state) { case CURLFNM_LOOP_DEFAULT: if(*p == '*') { while(*(p+1) == '*') /* eliminate multiple stars */ p++; if(*s == '\0' && *(p+1) == '\0') return CURL_FNMATCH_MATCH; rc = loop(p + 1, s); /* *.txt matches .txt <=> .txt matches .txt */ if(rc == CURL_FNMATCH_MATCH) return CURL_FNMATCH_MATCH; if(*s) /* let the star eat up one character */ s++; else return CURL_FNMATCH_NOMATCH; } else if(*p == '?') { if(ISPRINT(*s)) { s++; p++; } else if(*s == '\0') return CURL_FNMATCH_NOMATCH; else return CURL_FNMATCH_FAIL; /* cannot deal with other character */ } else if(*p == '\0') { if(*s == '\0') return CURL_FNMATCH_MATCH; else return CURL_FNMATCH_NOMATCH; } else if(*p == '\\') { state = CURLFNM_LOOP_BACKSLASH; p++; } else if(*p == '[') { unsigned char *pp = p+1; /* cannot handle with pointer to register */ if(setcharset(&pp, charset)) { int found = FALSE; if(charset[(unsigned int)*s]) found = TRUE; else if(charset[CURLFNM_ALNUM]) found = ISALNUM(*s); else if(charset[CURLFNM_ALPHA]) found = ISALPHA(*s); else if(charset[CURLFNM_DIGIT]) found = ISDIGIT(*s); else if(charset[CURLFNM_XDIGIT]) found = ISXDIGIT(*s); else if(charset[CURLFNM_PRINT]) found = ISPRINT(*s); else if(charset[CURLFNM_SPACE]) found = ISSPACE(*s); else if(charset[CURLFNM_UPPER]) found = ISUPPER(*s); else if(charset[CURLFNM_LOWER]) found = ISLOWER(*s); else if(charset[CURLFNM_BLANK]) found = ISBLANK(*s); else if(charset[CURLFNM_GRAPH]) found = ISGRAPH(*s); if(charset[CURLFNM_NEGATE]) found = !found; if(found) { p = pp+1; s++; memset(charset, 0, CURLFNM_CHSET_SIZE); } else return CURL_FNMATCH_NOMATCH; } else return CURL_FNMATCH_FAIL; } else { if(*p++ != *s++) return CURL_FNMATCH_NOMATCH; } break; case CURLFNM_LOOP_BACKSLASH: if(ISPRINT(*p)) { if(*p++ == *s++) state = CURLFNM_LOOP_DEFAULT; else return CURL_FNMATCH_NOMATCH; } else return CURL_FNMATCH_FAIL; break; } } } /* * @unittest: 1307 */ int Curl_fnmatch(void *ptr, const char *pattern, const char *string) { (void)ptr; /* the argument is specified by the curl_fnmatch_callback prototype, but not used by Curl_fnmatch() */ if(!pattern || !string) { return CURL_FNMATCH_FAIL; } return loop((unsigned char *)pattern, (unsigned char *)string); } curl-7.35.0/lib/nwos.c0000644000175000017500000000511012213173003011361 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef NETWARE /* Novell NetWare */ #ifdef __NOVELL_LIBC__ /* For native LibC-based NLM we need to do nothing. */ int netware_init ( void ) { return 0; } #else /* __NOVELL_LIBC__ */ /* For native CLib-based NLM we need to initialize the LONG namespace. */ #include #include #include /* Make the CLIB Ctx stuff link */ #include NETDB_DEFINE_CONTEXT /* Make the CLIB Inet stuff link */ #include #include NETINET_DEFINE_CONTEXT int netware_init ( void ) { int rc = 0; unsigned int myHandle = GetNLMHandle(); /* import UnAugmentAsterisk dynamically for NW4.x compatibility */ void (*pUnAugmentAsterisk)(int) = (void(*)(int)) ImportSymbol(myHandle, "UnAugmentAsterisk"); /* import UseAccurateCaseForPaths dynamically for NW3.x compatibility */ void (*pUseAccurateCaseForPaths)(int) = (void(*)(int)) ImportSymbol(myHandle, "UseAccurateCaseForPaths"); if(pUnAugmentAsterisk) pUnAugmentAsterisk(1); if(pUseAccurateCaseForPaths) pUseAccurateCaseForPaths(1); UnimportSymbol(myHandle, "UnAugmentAsterisk"); UnimportSymbol(myHandle, "UseAccurateCaseForPaths"); /* set long name space */ if((SetCurrentNameSpace(4) == 255)) { rc = 1; } if((SetTargetNameSpace(4) == 255)) { rc = rc + 2; } return rc; } /* dummy function to satisfy newer prelude */ int __init_environment ( void ) { return 0; } /* dummy function to satisfy newer prelude */ int __deinit_environment ( void ) { return 0; } #endif /* __NOVELL_LIBC__ */ #endif /* NETWARE */ curl-7.35.0/lib/conncache.c0000644000175000017500000001605512270035364012340 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2012, Linus Nielsen Feltzing, * Copyright (C) 2012 - 2014, 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. * ***************************************************************************/ #include "curl_setup.h" #include #include "urldata.h" #include "url.h" #include "progress.h" #include "multiif.h" #include "sendf.h" #include "rawstr.h" #include "bundles.h" #include "conncache.h" #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" static void free_bundle_hash_entry(void *freethis) { struct connectbundle *b = (struct connectbundle *) freethis; Curl_bundle_destroy(b); } struct conncache *Curl_conncache_init(int size) { struct conncache *connc; connc = calloc(1, sizeof(struct conncache)); if(!connc) return NULL; connc->hash = Curl_hash_alloc(size, Curl_hash_str, Curl_str_key_compare, free_bundle_hash_entry); if(!connc->hash) { free(connc); return NULL; } return connc; } void Curl_conncache_destroy(struct conncache *connc) { if(connc) { Curl_hash_destroy(connc->hash); connc->hash = NULL; free(connc); } } struct connectbundle *Curl_conncache_find_bundle(struct conncache *connc, char *hostname) { struct connectbundle *bundle = NULL; if(connc) bundle = Curl_hash_pick(connc->hash, hostname, strlen(hostname)+1); return bundle; } static bool conncache_add_bundle(struct conncache *connc, char *hostname, struct connectbundle *bundle) { void *p; p = Curl_hash_add(connc->hash, hostname, strlen(hostname)+1, bundle); return p?TRUE:FALSE; } static void conncache_remove_bundle(struct conncache *connc, struct connectbundle *bundle) { struct curl_hash_iterator iter; struct curl_hash_element *he; if(!connc) return; Curl_hash_start_iterate(connc->hash, &iter); he = Curl_hash_next_element(&iter); while(he) { if(he->ptr == bundle) { /* The bundle is destroyed by the hash destructor function, free_bundle_hash_entry() */ Curl_hash_delete(connc->hash, he->key, he->key_len); return; } he = Curl_hash_next_element(&iter); } } CURLcode Curl_conncache_add_conn(struct conncache *connc, struct connectdata *conn) { CURLcode result; struct connectbundle *bundle; struct connectbundle *new_bundle = NULL; struct SessionHandle *data = conn->data; bundle = Curl_conncache_find_bundle(data->state.conn_cache, conn->host.name); if(!bundle) { result = Curl_bundle_create(data, &new_bundle); if(result != CURLE_OK) return result; if(!conncache_add_bundle(data->state.conn_cache, conn->host.name, new_bundle)) { Curl_bundle_destroy(new_bundle); return CURLE_OUT_OF_MEMORY; } bundle = new_bundle; } result = Curl_bundle_add_conn(bundle, conn); if(result != CURLE_OK) { if(new_bundle) conncache_remove_bundle(data->state.conn_cache, new_bundle); return result; } connc->num_connections++; return CURLE_OK; } void Curl_conncache_remove_conn(struct conncache *connc, struct connectdata *conn) { struct connectbundle *bundle = conn->bundle; /* The bundle pointer can be NULL, since this function can be called due to a failed connection attempt, before being added to a bundle */ if(bundle) { Curl_bundle_remove_conn(bundle, conn); if(bundle->num_connections == 0) { conncache_remove_bundle(connc, bundle); } if(connc) { connc->num_connections--; DEBUGF(infof(conn->data, "The cache now contains %d members\n", connc->num_connections)); } } } /* This function iterates the entire connection cache and calls the function func() with the connection pointer as the first argument and the supplied 'param' argument as the other, Return 0 from func() to continue the loop, return 1 to abort it. */ void Curl_conncache_foreach(struct conncache *connc, void *param, int (*func)(struct connectdata *conn, void *param)) { struct curl_hash_iterator iter; struct curl_llist_element *curr; struct curl_hash_element *he; if(!connc) return; Curl_hash_start_iterate(connc->hash, &iter); he = Curl_hash_next_element(&iter); while(he) { struct connectbundle *bundle; struct connectdata *conn; bundle = he->ptr; curr = bundle->conn_list->head; while(curr) { /* Yes, we need to update curr before calling func(), because func() might decide to remove the connection */ conn = curr->ptr; curr = curr->next; if(1 == func(conn, param)) return; } he = Curl_hash_next_element(&iter); } } /* Return the first connection found in the cache. Used when closing all connections */ struct connectdata * Curl_conncache_find_first_connection(struct conncache *connc) { struct curl_hash_iterator iter; struct curl_llist_element *curr; struct curl_hash_element *he; struct connectbundle *bundle; Curl_hash_start_iterate(connc->hash, &iter); he = Curl_hash_next_element(&iter); while(he) { bundle = he->ptr; curr = bundle->conn_list->head; if(curr) { return curr->ptr; } he = Curl_hash_next_element(&iter); } return NULL; } #if 0 /* Useful for debugging the connection cache */ void Curl_conncache_print(struct conncache *connc) { struct curl_hash_iterator iter; struct curl_llist_element *curr; struct curl_hash_element *he; if(!connc) return; fprintf(stderr, "=Bundle cache=\n"); Curl_hash_start_iterate(connc->hash, &iter); he = Curl_hash_next_element(&iter); while(he) { struct connectbundle *bundle; struct connectdata *conn; bundle = he->ptr; fprintf(stderr, "%s -", he->key); curr = bundle->conn_list->head; while(curr) { conn = curr->ptr; fprintf(stderr, " [%p %d]", (void *)conn, conn->inuse); curr = curr->next; } fprintf(stderr, "\n"); he = Curl_hash_next_element(&iter); } } #endif curl-7.35.0/lib/url.c0000644000175000017500000054024412272122645011224 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef __VMS #include #include #endif #ifndef HAVE_SOCKET #error "We can't compile without socket() support!" #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef USE_LIBIDN #include #include #include #ifdef HAVE_IDN_FREE_H #include #else /* prototype from idn-free.h, not provided by libidn 0.4.5's make install! */ void idn_free (void *ptr); #endif #ifndef HAVE_IDN_FREE /* if idn_free() was not found in this version of libidn use free() instead */ #define idn_free(x) (free)(x) #endif #elif defined(USE_WIN32_IDN) /* prototype for curl_win32_idn_to_ascii() */ int curl_win32_idn_to_ascii(const char *in, char **out); #endif /* USE_LIBIDN */ #include "urldata.h" #include "netrc.h" #include "formdata.h" #include "vtls/vtls.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" #include "speedcheck.h" #include "rawstr.h" #include "warnless.h" #include "non-ascii.h" #include "inet_pton.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 "curl_ldap.h" #include "ssh.h" #include "imap.h" #include "url.h" #include "connect.h" #include "inet_ntop.h" #include "curl_ntlm.h" #include "curl_ntlm_wb.h" #include "socks.h" #include "curl_rtmp.h" #include "gopher.h" #include "http_proxy.h" #include "bundles.h" #include "conncache.h" #include "multihandle.h" #include "pipeline.h" #include "dotdot.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* Local static prototypes */ static struct connectdata * find_oldest_idle_connection(struct SessionHandle *data); static struct connectdata * find_oldest_idle_connection_in_bundle(struct SessionHandle *data, struct connectbundle *bundle); static void conn_free(struct connectdata *conn); static void signalPipeClose(struct curl_llist *pipeline, bool pipe_broke); static CURLcode do_init(struct connectdata *conn); static CURLcode parse_url_login(struct SessionHandle *data, struct connectdata *conn, char **userptr, char **passwdptr, char **optionsptr); static CURLcode parse_login_details(const char *login, const size_t len, char **userptr, char **passwdptr, char **optionsptr); /* * Protocol table. */ static const struct Curl_handler * const protocols[] = { #ifndef CURL_DISABLE_HTTP &Curl_handler_http, #endif #if defined(USE_SSL) && !defined(CURL_DISABLE_HTTP) &Curl_handler_https, #endif #ifndef CURL_DISABLE_FTP &Curl_handler_ftp, #endif #if defined(USE_SSL) && !defined(CURL_DISABLE_FTP) &Curl_handler_ftps, #endif #ifndef CURL_DISABLE_TELNET &Curl_handler_telnet, #endif #ifndef CURL_DISABLE_DICT &Curl_handler_dict, #endif #ifndef CURL_DISABLE_LDAP &Curl_handler_ldap, #if !defined(CURL_DISABLE_LDAPS) && \ ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \ (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))) &Curl_handler_ldaps, #endif #endif #ifndef CURL_DISABLE_FILE &Curl_handler_file, #endif #ifndef CURL_DISABLE_TFTP &Curl_handler_tftp, #endif #ifdef USE_LIBSSH2 &Curl_handler_scp, &Curl_handler_sftp, #endif #ifndef CURL_DISABLE_IMAP &Curl_handler_imap, #ifdef USE_SSL &Curl_handler_imaps, #endif #endif #ifndef CURL_DISABLE_POP3 &Curl_handler_pop3, #ifdef USE_SSL &Curl_handler_pop3s, #endif #endif #ifndef CURL_DISABLE_SMTP &Curl_handler_smtp, #ifdef USE_SSL &Curl_handler_smtps, #endif #endif #ifndef CURL_DISABLE_RTSP &Curl_handler_rtsp, #endif #ifndef CURL_DISABLE_GOPHER &Curl_handler_gopher, #endif #ifdef USE_LIBRTMP &Curl_handler_rtmp, &Curl_handler_rtmpt, &Curl_handler_rtmpe, &Curl_handler_rtmpte, &Curl_handler_rtmps, &Curl_handler_rtmpts, #endif (struct Curl_handler *) NULL }; /* * Dummy handler for undefined protocol schemes. */ static const struct Curl_handler Curl_handler_dummy = { "", /* scheme */ ZERO_NULL, /* setup_connection */ ZERO_NULL, /* do_it */ ZERO_NULL, /* done */ ZERO_NULL, /* do_more */ ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ 0, /* defport */ 0, /* protocol */ PROTOPT_NONE /* flags */ }; void Curl_freeset(struct SessionHandle *data) { /* Free all dynamic strings stored in the data->set substructure. */ enum dupstring i; for(i=(enum dupstring)0; i < STRING_LAST; i++) Curl_safefree(data->set.str[i]); if(data->change.referer_alloc) { Curl_safefree(data->change.referer); data->change.referer_alloc = FALSE; } data->change.referer = NULL; } static CURLcode setstropt(char **charp, char *s) { /* Release the previous storage at `charp' and replace by a dynamic storage copy of `s'. Return CURLE_OK or CURLE_OUT_OF_MEMORY. */ Curl_safefree(*charp); if(s) { s = strdup(s); if(!s) return CURLE_OUT_OF_MEMORY; *charp = s; } return CURLE_OK; } static CURLcode setstropt_userpwd(char *option, char **userp, char **passwdp) { CURLcode result = CURLE_OK; char *user = NULL; char *passwd = NULL; /* Parse the login details if specified. It not then we treat NULL as a hint to clear the existing data */ if(option) { result = parse_login_details(option, strlen(option), (userp ? &user : NULL), (passwdp ? &passwd : NULL), NULL); } if(!result) { /* Store the username part of option if required */ if(userp) { if(!user && option && option[0] == ':') { /* Allocate an empty string instead of returning NULL as user name */ user = strdup(""); if(!user) result = CURLE_OUT_OF_MEMORY; } Curl_safefree(*userp); *userp = user; } /* Store the password part of option if required */ if(passwdp) { Curl_safefree(*passwdp); *passwdp = passwd; } } return result; } CURLcode Curl_dupset(struct SessionHandle *dst, struct SessionHandle *src) { CURLcode r = CURLE_OK; enum dupstring i; /* Copy src->set into dst->set first, then deal with the strings afterwards */ dst->set = src->set; /* clear all string pointers first */ memset(dst->set.str, 0, STRING_LAST * sizeof(char *)); /* duplicate all strings */ for(i=(enum dupstring)0; i< STRING_LAST; i++) { r = setstropt(&dst->set.str[i], src->set.str[i]); if(r != CURLE_OK) break; } /* If a failure occurred, freeing has to be performed externally. */ return r; } /* * 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; if(!data) return CURLE_OK; Curl_expire(data, 0); /* shut off timers */ m = data->multi; if(m) /* This handle is still part of a multi handle, take care of this first and detach this handle from there. */ curl_multi_remove_handle(data->multi, data); if(data->multi_easy) /* when curl_easy_perform() is used, it creates its own multi handle to use and this is the one */ curl_multi_cleanup(data->multi_easy); /* Destroy the timeout list that is held in the easy handle. It is /normally/ done by curl_multi_remove_handle() but this is "just in case" */ if(data->state.timeoutlist) { Curl_llist_destroy(data->state.timeoutlist, NULL); data->state.timeoutlist = NULL; } 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.rangestringalloc) free(data->state.range); /* Free the pathbuffer */ Curl_safefree(data->state.pathbuffer); data->state.path = NULL; /* freed here just in case DONE wasn't called */ Curl_free_request_state(data); /* Close down all open SSL info and sessions */ Curl_ssl_close_all(data); Curl_safefree(data->state.first_host); Curl_safefree(data->state.scratch); Curl_ssl_free_certinfo(data); if(data->change.referer_alloc) { Curl_safefree(data->change.referer); data->change.referer_alloc = FALSE; } data->change.referer = NULL; if(data->change.url_alloc) { Curl_safefree(data->change.url); data->change.url_alloc = FALSE; } data->change.url = NULL; Curl_safefree(data->state.headerbuff); Curl_flush_cookies(data, 1); Curl_digest_cleanup(data); Curl_safefree(data->info.contenttype); Curl_safefree(data->info.wouldredirect); /* this destroys the channel and we cannot use it anymore after this */ Curl_resolver_cleanup(data->state.resolver); Curl_convert_close(data); /* No longer a dirty share, if it exists */ if(data->share) { Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE); data->share->dirty--; Curl_share_unlock(data, CURL_LOCK_DATA_SHARE); } Curl_freeset(data); free(data); return CURLE_OK; } /* * Initialize the UserDefined fields within a SessionHandle. * This may be safely called on a new or existing SessionHandle. */ CURLcode Curl_init_userdefined(struct UserDefined *set) { CURLcode res = CURLE_OK; set->out = stdout; /* default output to stdout */ set->in = stdin; /* default input from stdin */ set->err = stderr; /* default stderr to stderr */ /* use fwrite as default function to store output */ set->fwrite_func = (curl_write_callback)fwrite; /* use fread as default function to read input */ set->fread_func = (curl_read_callback)fread; set->is_fread_set = 0; set->is_fwrite_set = 0; set->seek_func = ZERO_NULL; set->seek_client = ZERO_NULL; /* conversion callbacks for non-ASCII hosts */ set->convfromnetwork = ZERO_NULL; set->convtonetwork = ZERO_NULL; set->convfromutf8 = ZERO_NULL; set->infilesize = -1; /* we don't know any size */ set->postfieldsize = -1; /* unknown size */ set->maxredirs = -1; /* allow any amount by default */ set->httpreq = HTTPREQ_GET; /* Default HTTP request */ set->rtspreq = RTSPREQ_OPTIONS; /* Default RTSP request */ set->ftp_use_epsv = TRUE; /* FTP defaults to EPSV operations */ set->ftp_use_eprt = TRUE; /* FTP defaults to EPRT operations */ set->ftp_use_pret = FALSE; /* mainly useful for drftpd servers */ set->ftp_filemethod = FTPFILE_MULTICWD; set->dns_cache_timeout = 60; /* Timeout every 60 seconds by default */ /* Set the default size of the SSL session ID cache */ set->ssl.max_ssl_sessions = 5; set->proxyport = CURL_DEFAULT_PROXY_PORT; /* from url.h */ set->proxytype = CURLPROXY_HTTP; /* defaults to HTTP proxy */ set->httpauth = CURLAUTH_BASIC; /* defaults to basic */ set->proxyauth = CURLAUTH_BASIC; /* defaults to basic */ /* make libcurl quiet by default: */ set->hide_progress = TRUE; /* CURLOPT_NOPROGRESS changes these */ /* * libcurl 7.10 introduced SSL verification *by default*! This needs to be * switched off unless wanted. */ set->ssl.verifypeer = TRUE; set->ssl.verifyhost = TRUE; #ifdef USE_TLS_SRP set->ssl.authtype = CURL_TLSAUTH_NONE; #endif set->ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth type */ set->ssl.sessionid = TRUE; /* session ID caching enabled by default */ set->new_file_perms = 0644; /* Default permissions */ set->new_directory_perms = 0755; /* Default permissions */ /* for the *protocols fields we don't use the CURLPROTO_ALL convenience define since we internally only use the lower 16 bits for the passed in bitmask to not conflict with the private bits */ set->allowed_protocols = CURLPROTO_ALL; set->redir_protocols = CURLPROTO_ALL & ~(CURLPROTO_FILE|CURLPROTO_SCP); /* not FILE or SCP */ #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) /* * disallow unprotected protection negotiation NEC reference implementation * seem not to follow rfc1961 section 4.3/4.4 */ set->socks5_gssapi_nec = FALSE; /* set default gssapi service name */ res = setstropt(&set->str[STRING_SOCKS5_GSSAPI_SERVICE], (char *) CURL_DEFAULT_SOCKS5_GSSAPI_SERVICE); if(res != CURLE_OK) return res; #endif /* This is our preferred CA cert bundle/path since install time */ #if defined(CURL_CA_BUNDLE) res = setstropt(&set->str[STRING_SSL_CAFILE], (char *) CURL_CA_BUNDLE); #elif defined(CURL_CA_PATH) res = setstropt(&set->str[STRING_SSL_CAPATH], (char *) CURL_CA_PATH); #endif set->wildcardmatch = FALSE; set->chunk_bgn = ZERO_NULL; set->chunk_end = ZERO_NULL; /* tcp keepalives are disabled by default, but provide reasonable values for * the interval and idle times. */ set->tcp_keepalive = FALSE; set->tcp_keepintvl = 60; set->tcp_keepidle = 60; return res; } /** * 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; CURLcode status; /* Very simple start-up: alloc the struct, init it with zeroes and return */ data = calloc(1, sizeof(struct SessionHandle)); if(!data) { /* this is a very serious error */ DEBUGF(fprintf(stderr, "Error: calloc of SessionHandle failed\n")); return CURLE_OUT_OF_MEMORY; } data->magic = CURLEASY_MAGIC_NUMBER; status = Curl_resolver_init(&data->state.resolver); if(status) { DEBUGF(fprintf(stderr, "Error: resolver_init failed\n")); free(data); return status; } /* We do some initial setup here, all those fields that can't be just 0 */ data->state.headerbuff = malloc(HEADERSIZE); if(!data->state.headerbuff) { DEBUGF(fprintf(stderr, "Error: malloc of headerbuff failed\n")); res = CURLE_OUT_OF_MEMORY; } else { res = Curl_init_userdefined(&data->set); data->state.headersize=HEADERSIZE; Curl_convert_init(data); /* most recent connection is not yet defined */ data->state.lastconnect = NULL; data->progress.flags |= PGRS_HIDE; data->state.current_speed = -1; /* init to negative == impossible */ data->wildcard.state = CURLWC_INIT; data->wildcard.filelist = NULL; data->set.fnmatch = ZERO_NULL; data->set.maxconnects = DEFAULT_CONNCACHE_SIZE; /* for easy handles */ } if(res) { Curl_resolver_cleanup(data->state.resolver); if(data->state.headerbuff) free(data->state.headerbuff); Curl_freeset(data); 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; long arg; #ifndef CURL_DISABLE_HTTP curl_off_t bigsize; #endif switch(option) { case CURLOPT_DNS_CACHE_TIMEOUT: data->set.dns_cache_timeout = va_arg(param, long); break; case CURLOPT_DNS_USE_GLOBAL_CACHE: /* remember we want this enabled */ arg = va_arg(param, long); data->set.global_dns_cache = (0 != arg)?TRUE:FALSE; break; case CURLOPT_SSL_CIPHER_LIST: /* set a list of cipher we want to use in the SSL connection */ result = setstropt(&data->set.str[STRING_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. */ result = setstropt(&data->set.str[STRING_SSL_RANDOM_FILE], va_arg(param, char *)); break; case CURLOPT_EGDSOCKET: /* * The Entropy Gathering Daemon socket pathname */ result = setstropt(&data->set.str[STRING_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. */ data->set.maxconnects = 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 = (0 != va_arg(param, long))?TRUE:FALSE; 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 = (0 != va_arg(param, long))?TRUE:FALSE; 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 = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_HEADER: /* * Set to include the header in the general data output stream. */ data->set.include_header = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_NOPROGRESS: /* * Shut off the internal supported progress meter */ data->set.hide_progress = (0 != va_arg(param, long))?TRUE:FALSE; 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 = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_FAILONERROR: /* * Don't output the >=300 error code HTML-page, but instead only * return error. */ data->set.http_fail_on_error = (0 != va_arg(param, long))?TRUE:FALSE; 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 = (0 != va_arg(param, long))?TRUE:FALSE; if(data->set.upload) { /* If this is HTTP, PUT is what's needed to "upload" */ data->set.httpreq = HTTPREQ_PUT; data->set.opt_no_body = FALSE; /* this is implied */ } else /* In HTTP, the opposite of upload is GET (unless NOBODY is true as then this can be changed to HEAD later on) */ data->set.httpreq = HTTPREQ_GET; 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 = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_FTP_CREATE_MISSING_DIRS: /* * An FTP option that modifies an upload to create missing directories on * the server. */ switch(va_arg(param, long)) { case 0: data->set.ftp_create_missing_dirs = 0; break; case 1: data->set.ftp_create_missing_dirs = 1; break; case 2: data->set.ftp_create_missing_dirs = 2; break; default: /* reserve other values for future use */ result = CURLE_UNKNOWN_OPTION; break; } break; case CURLOPT_SERVER_RESPONSE_TIMEOUT: /* * Option that specifies how quickly an server response must be obtained * before it is considered failure. For pingpong protocols. */ data->set.server_response_timeout = va_arg( param , long ) * 1000; break; case CURLOPT_TFTP_BLKSIZE: /* * TFTP option that specifies the block size to use for data transmission */ data->set.tftp_blksize = va_arg(param, long); break; case CURLOPT_DIRLISTONLY: /* * An option that changes the command to one that asks for a list * only, no file info details. */ data->set.ftp_list_only = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_APPEND: /* * We want to upload and append to an existing file. */ data->set.ftp_append = (0 != va_arg(param, long))?TRUE:FALSE; 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 */ result = setstropt(&data->set.str[STRING_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 = (0 != va_arg(param, long))?TRUE:FALSE; 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 = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_ACCEPT_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. * */ argptr = va_arg(param, char *); result = setstropt(&data->set.str[STRING_ENCODING], (argptr && !*argptr)? (char *) ALL_CONTENT_ENCODINGS: argptr); break; case CURLOPT_TRANSFER_ENCODING: data->set.http_transfer_encoding = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_FOLLOWLOCATION: /* * Follow Location: header hints on a HTTP-server. */ data->set.http_follow_location = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_UNRESTRICTED_AUTH: /* * Send authentication (user+password) when following locations, even when * hostname changed. */ data->set.http_disable_hostname_check_before_authentication = (0 != va_arg(param, long))?TRUE:FALSE; 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_POSTREDIR: { /* * Set the behaviour of POST when redirecting * CURL_REDIR_GET_ALL - POST is changed to GET after 301 and 302 * CURL_REDIR_POST_301 - POST is kept as POST after 301 * CURL_REDIR_POST_302 - POST is kept as POST after 302 * CURL_REDIR_POST_303 - POST is kept as POST after 303 * CURL_REDIR_POST_ALL - POST is kept as POST after 301, 302 and 303 * other - POST is kept as POST after 301 and 302 */ int postRedir = curlx_sltosi(va_arg(param, long)); data->set.keep_post = postRedir & CURL_REDIR_POST_ALL; } 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_COPYPOSTFIELDS: /* * A string with POST data. Makes curl HTTP POST. Even if it is NULL. * If needed, CURLOPT_POSTFIELDSIZE must have been set prior to * CURLOPT_COPYPOSTFIELDS and not altered later. */ argptr = va_arg(param, char *); if(!argptr || data->set.postfieldsize == -1) result = setstropt(&data->set.str[STRING_COPYPOSTFIELDS], argptr); else { /* * Check that requested length does not overflow the size_t type. */ if((data->set.postfieldsize < 0) || ((sizeof(curl_off_t) != sizeof(size_t)) && (data->set.postfieldsize > (curl_off_t)((size_t)-1)))) result = CURLE_OUT_OF_MEMORY; else { char * p; (void) setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL); /* Allocate even when size == 0. This satisfies the need of possible later address compare to detect the COPYPOSTFIELDS mode, and to mark that postfields is used rather than read function or form data. */ p = malloc((size_t)(data->set.postfieldsize? data->set.postfieldsize:1)); if(!p) result = CURLE_OUT_OF_MEMORY; else { if(data->set.postfieldsize) memcpy(p, argptr, (size_t)data->set.postfieldsize); data->set.str[STRING_COPYPOSTFIELDS] = p; } } } data->set.postfields = data->set.str[STRING_COPYPOSTFIELDS]; data->set.httpreq = HTTPREQ_POST; break; case CURLOPT_POSTFIELDS: /* * Like above, but use static data instead of copying it. */ data->set.postfields = va_arg(param, void *); /* Release old copied data. */ (void) setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL); 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. */ bigsize = va_arg(param, long); if(data->set.postfieldsize < bigsize && data->set.postfields == data->set.str[STRING_COPYPOSTFIELDS]) { /* Previous CURLOPT_COPYPOSTFIELDS is no longer valid. */ (void) setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL); data->set.postfields = NULL; } data->set.postfieldsize = bigsize; break; case CURLOPT_POSTFIELDSIZE_LARGE: /* * The size of the POSTFIELD data to prevent libcurl to do strlen() to * figure it out. Enables binary posts. */ bigsize = va_arg(param, curl_off_t); if(data->set.postfieldsize < bigsize && data->set.postfields == data->set.str[STRING_COPYPOSTFIELDS]) { /* Previous CURLOPT_COPYPOSTFIELDS is no longer valid. */ (void) setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL); data->set.postfields = NULL; } data->set.postfieldsize = bigsize; 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) { Curl_safefree(data->change.referer); data->change.referer_alloc = FALSE; } result = setstropt(&data->set.str[STRING_SET_REFERER], va_arg(param, char *)); data->change.referer = data->set.str[STRING_SET_REFERER]; break; case CURLOPT_USERAGENT: /* * String to use in the HTTP User-Agent field */ result = setstropt(&data->set.str[STRING_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. */ result = setstropt(&data->set.str[STRING_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) { curl_slist_free_all(data->change.cookielist); data->change.cookielist = NULL; return CURLE_OUT_OF_MEMORY; } data->change.cookielist = cl; /* store the list for later use */ } break; case CURLOPT_COOKIEJAR: /* * Set cookie file name to dump all cookies to when we're done. */ result = setstropt(&data->set.str[STRING_COOKIEJAR], va_arg(param, char *)); /* * 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 = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_COOKIELIST: argptr = va_arg(param, char *); if(argptr == NULL) break; Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); if(Curl_raw_equal(argptr, "ALL")) { /* clear all cookies */ Curl_cookie_clearall(data->cookies); } else if(Curl_raw_equal(argptr, "SESS")) { /* clear session cookies */ Curl_cookie_clearsess(data->cookies); } else if(Curl_raw_equal(argptr, "FLUSH")) { /* flush cookies to file */ Curl_flush_cookies(data, 0); } else { 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; } else { 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); } } Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); 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. */ arg = va_arg(param, long); #ifndef USE_NGHTTP2 if(arg == CURL_HTTP_VERSION_2_0) return CURLE_UNSUPPORTED_PROTOCOL; #endif data->set.httpversion = arg; break; case CURLOPT_HTTPAUTH: /* * Set HTTP Authentication type BITMASK. */ { int bitcheck; bool authbits; unsigned long auth = va_arg(param, unsigned long); if(auth == CURLAUTH_NONE) { data->set.httpauth = auth; break; } /* the DIGEST_IE bit is only used to set a special marker, for all the rest we need to handle it as normal DIGEST */ data->state.authhost.iestyle = (auth & CURLAUTH_DIGEST_IE)?TRUE:FALSE; if(auth & CURLAUTH_DIGEST_IE) { auth |= CURLAUTH_DIGEST; /* set standard digest bit */ auth &= ~CURLAUTH_DIGEST_IE; /* unset ie digest bit */ } /* switch off bits we can't support */ #ifndef USE_NTLM auth &= ~CURLAUTH_NTLM; /* no NTLM support */ auth &= ~CURLAUTH_NTLM_WB; /* no NTLM_WB support */ #elif !defined(NTLM_WB_ENABLED) auth &= ~CURLAUTH_NTLM_WB; /* no NTLM_WB support */ #endif #ifndef USE_HTTP_NEGOTIATE auth &= ~CURLAUTH_GSSNEGOTIATE; /* no GSS-Negotiate without GSSAPI or WINDOWS_SSPI */ #endif /* check if any auth bit lower than CURLAUTH_ONLY is still set */ bitcheck = 0; authbits = FALSE; while(bitcheck < 31) { if(auth & (1UL << bitcheck++)) { authbits = TRUE; break; } } if(!authbits) return CURLE_NOT_BUILT_IN; /* no supported types left! */ data->set.httpauth = auth; } break; #endif /* CURL_DISABLE_HTTP */ case CURLOPT_CUSTOMREQUEST: /* * Set a custom string to use as request */ result = setstropt(&data->set.str[STRING_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; #ifndef CURL_DISABLE_PROXY case CURLOPT_HTTPPROXYTUNNEL: /* * Tunnel operations through the proxy instead of normal proxy use */ data->set.tunnel_thru_httpproxy = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_PROXYPORT: /* * Explicitly set HTTP proxy port number. */ data->set.proxyport = va_arg(param, long); break; case CURLOPT_PROXYAUTH: /* * Set HTTP Authentication type BITMASK. */ { int bitcheck; bool authbits; unsigned long auth = va_arg(param, unsigned long); if(auth == CURLAUTH_NONE) { data->set.proxyauth = auth; break; } /* the DIGEST_IE bit is only used to set a special marker, for all the rest we need to handle it as normal DIGEST */ data->state.authproxy.iestyle = (auth & CURLAUTH_DIGEST_IE)?TRUE:FALSE; if(auth & CURLAUTH_DIGEST_IE) { auth |= CURLAUTH_DIGEST; /* set standard digest bit */ auth &= ~CURLAUTH_DIGEST_IE; /* unset ie digest bit */ } /* switch off bits we can't support */ #ifndef USE_NTLM auth &= ~CURLAUTH_NTLM; /* no NTLM support */ auth &= ~CURLAUTH_NTLM_WB; /* no NTLM_WB support */ #elif !defined(NTLM_WB_ENABLED) auth &= ~CURLAUTH_NTLM_WB; /* no NTLM_WB support */ #endif #ifndef USE_HTTP_NEGOTIATE auth &= ~CURLAUTH_GSSNEGOTIATE; /* no GSS-Negotiate without GSSAPI or WINDOWS_SSPI */ #endif /* check if any auth bit lower than CURLAUTH_ONLY is still set */ bitcheck = 0; authbits = FALSE; while(bitcheck < 31) { if(auth & (1UL << bitcheck++)) { authbits = TRUE; break; } } if(!authbits) return CURLE_NOT_BUILT_IN; /* no supported types left! */ data->set.proxyauth = auth; } break; 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. */ result = setstropt(&data->set.str[STRING_PROXY], va_arg(param, char *)); break; case CURLOPT_PROXYTYPE: /* * Set proxy type. HTTP/HTTP_1_0/SOCKS4/SOCKS4a/SOCKS5/SOCKS5_HOSTNAME */ data->set.proxytype = (curl_proxytype)va_arg(param, long); break; case CURLOPT_PROXY_TRANSFER_MODE: /* * set transfer mode (;type=) when doing FTP via an HTTP proxy */ switch (va_arg(param, long)) { case 0: data->set.proxy_transfer_mode = FALSE; break; case 1: data->set.proxy_transfer_mode = TRUE; break; default: /* reserve other values for future use */ result = CURLE_UNKNOWN_OPTION; break; } break; #endif /* CURL_DISABLE_PROXY */ #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) case CURLOPT_SOCKS5_GSSAPI_SERVICE: /* * Set gssapi service name */ result = setstropt(&data->set.str[STRING_SOCKS5_GSSAPI_SERVICE], va_arg(param, char *)); break; case CURLOPT_SOCKS5_GSSAPI_NEC: /* * set flag for nec socks5 support */ data->set.socks5_gssapi_nec = (0 != va_arg(param, long))?TRUE:FALSE; break; #endif 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 possibly * used as argument to the write callback. */ data->set.out = va_arg(param, void *); break; case CURLOPT_FTPPORT: /* * Use FTP PORT, this also specifies which IP address to use */ result = setstropt(&data->set.str[STRING_FTPPORT], va_arg(param, char *)); data->set.ftp_use_port = (NULL != data->set.str[STRING_FTPPORT]) ? TRUE:FALSE; break; case CURLOPT_FTP_USE_EPRT: data->set.ftp_use_eprt = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_FTP_USE_EPSV: data->set.ftp_use_epsv = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_FTP_USE_PRET: data->set.ftp_use_pret = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_FTP_SSL_CCC: data->set.ftp_ccc = (curl_ftpccc)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 = (0 != va_arg(param, long))?TRUE:FALSE; 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, void *); 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: /* * When transfer uploads are faster then CURLOPT_MAX_SEND_SPEED_LARGE * 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: /* * When receiving data faster than CURLOPT_MAX_RECV_SPEED_LARGE 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! */ Curl_safefree(data->change.url); data->change.url_alloc = FALSE; } result = setstropt(&data->set.str[STRING_SET_URL], va_arg(param, char *)); data->change.url = data->set.str[STRING_SET_URL]; 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) * 1000L; break; case CURLOPT_TIMEOUT_MS: 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) * 1000L; break; case CURLOPT_CONNECTTIMEOUT_MS: data->set.connecttimeout = va_arg(param, long); break; case CURLOPT_ACCEPTTIMEOUT_MS: /* * The maximum time you allow curl to wait for server connect */ data->set.accepttimeout = va_arg(param, long); break; case CURLOPT_USERPWD: /* * user:password to use in the operation */ result = setstropt_userpwd(va_arg(param, char *), &data->set.str[STRING_USERNAME], &data->set.str[STRING_PASSWORD]); break; case CURLOPT_USERNAME: /* * authentication user name to use in the operation */ result = setstropt(&data->set.str[STRING_USERNAME], va_arg(param, char *)); break; case CURLOPT_PASSWORD: /* * authentication password to use in the operation */ result = setstropt(&data->set.str[STRING_PASSWORD], va_arg(param, char *)); break; case CURLOPT_LOGIN_OPTIONS: /* * authentication options to use in the operation */ result = setstropt(&data->set.str[STRING_OPTIONS], va_arg(param, char *)); break; case CURLOPT_XOAUTH2_BEARER: /* * XOAUTH2 bearer token to use in the operation */ result = setstropt(&data->set.str[STRING_BEARER], 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_RESOLVE: /* * List of NAME:[address] names to populate the DNS cache with * Prefix the NAME with dash (-) to _remove_ the name from the cache. * * Names added with this API will remain in the cache until explicitly * removed or the handle is cleaned up. * * This API can remove any name from the DNS cache, but only entries * that aren't actually in use right now will be pruned immediately. */ data->set.resolve = va_arg(param, struct curl_slist *); data->change.resolve = data->set.resolve; 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_XFERINFOFUNCTION: /* * Transfer info callback function */ data->set.fxferinfo = va_arg(param, curl_xferinfo_callback); if(data->set.fxferinfo) 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; #ifndef CURL_DISABLE_PROXY case CURLOPT_PROXYUSERPWD: /* * user:password needed to use the proxy */ result = setstropt_userpwd(va_arg(param, char *), &data->set.str[STRING_PROXYUSERNAME], &data->set.str[STRING_PROXYPASSWORD]); break; case CURLOPT_PROXYUSERNAME: /* * authentication user name to use in the operation */ result = setstropt(&data->set.str[STRING_PROXYUSERNAME], va_arg(param, char *)); break; case CURLOPT_PROXYPASSWORD: /* * authentication password to use in the operation */ result = setstropt(&data->set.str[STRING_PROXYPASSWORD], va_arg(param, char *)); break; case CURLOPT_NOPROXY: /* * proxy exception list */ result = setstropt(&data->set.str[STRING_NOPROXY], va_arg(param, char *)); break; #endif case CURLOPT_RANGE: /* * What range of the file you want to transfer */ result = setstropt(&data->set.str[STRING_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_func = va_arg(param, curl_write_callback); if(!data->set.fwrite_func) { data->set.is_fwrite_set = 0; /* When set to NULL, reset to our internal default function */ data->set.fwrite_func = (curl_write_callback)fwrite; } else data->set.is_fwrite_set = 1; break; case CURLOPT_READFUNCTION: /* * Read data callback */ data->set.fread_func = va_arg(param, curl_read_callback); if(!data->set.fread_func) { data->set.is_fread_set = 0; /* When set to NULL, reset to our internal default function */ data->set.fread_func = (curl_read_callback)fread; } else data->set.is_fread_set = 1; break; case CURLOPT_SEEKFUNCTION: /* * Seek callback. Might be NULL. */ data->set.seek_func = va_arg(param, curl_seek_callback); break; case CURLOPT_SEEKDATA: /* * Seek control callback. Might be NULL. */ data->set.seek_client = va_arg(param, void *); 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_func = 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 */ result = setstropt(&data->set.str[STRING_CERT], va_arg(param, char *)); break; case CURLOPT_SSLCERTTYPE: /* * String that holds file type of the SSL certificate to use */ result = setstropt(&data->set.str[STRING_CERT_TYPE], va_arg(param, char *)); break; case CURLOPT_SSLKEY: /* * String that holds file name of the SSL key to use */ result = setstropt(&data->set.str[STRING_KEY], va_arg(param, char *)); break; case CURLOPT_SSLKEYTYPE: /* * String that holds file type of the SSL key to use */ result = setstropt(&data->set.str[STRING_KEY_TYPE], va_arg(param, char *)); break; case CURLOPT_KEYPASSWD: /* * String that holds the SSL or SSH private key password. */ result = setstropt(&data->set.str[STRING_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 = (0 != va_arg(param, long))?TRUE:FALSE; 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. */ result = setstropt(&data->set.str[STRING_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 = curlx_sltous(va_arg(param, long)); break; case CURLOPT_LOCALPORTRANGE: /* * Set number of local ports to try, starting with CURLOPT_LOCALPORT. */ data->set.localportrange = curlx_sltosi(va_arg(param, long)); break; case CURLOPT_KRBLEVEL: /* * A string that defines the kerberos security level. */ result = setstropt(&data->set.str[STRING_KRB_LEVEL], va_arg(param, char *)); data->set.krb = (NULL != data->set.str[STRING_KRB_LEVEL])?TRUE:FALSE; break; case CURLOPT_GSSAPI_DELEGATION: /* * GSSAPI credential delegation */ data->set.gssapi_delegation = va_arg(param, long); break; case CURLOPT_SSL_VERIFYPEER: /* * Enable peer SSL verifying. */ data->set.ssl.verifypeer = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_SSL_VERIFYHOST: /* * Enable verification of the host name in the peer certificate */ arg = va_arg(param, long); /* Obviously people are not reading documentation and too many thought this argument took a boolean when it wasn't and misused it. We thus ban 1 as a sensible input and we warn about its use. Then we only have the 2 action internally stored as TRUE. */ if(1 == arg) { failf(data, "CURLOPT_SSL_VERIFYHOST no longer supports 1 as value!"); return CURLE_BAD_FUNCTION_ARGUMENT; } data->set.ssl.verifyhost = (0 != arg)?TRUE:FALSE; break; #ifdef USE_SSLEAY /* since these two options are only possible to use on an OpenSSL- powered libcurl we #ifdef them on this condition so that libcurls built against other SSL libs will return a proper error when trying to set this option! */ 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; #endif #if defined(USE_SSLEAY) || defined(USE_QSOSSL) || defined(USE_GSKIT) || \ defined(USE_NSS) case CURLOPT_CERTINFO: data->set.ssl.certinfo = (0 != va_arg(param, long))?TRUE:FALSE; break; #endif case CURLOPT_CAINFO: /* * Set CA info for SSL connection. Specify file name of the CA certificate */ result = setstropt(&data->set.str[STRING_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. */ result = setstropt(&data->set.str[STRING_SSL_CAPATH], va_arg(param, char *)); break; case CURLOPT_CRLFILE: /* * Set CRL file info for SSL connection. Specify file name of the CRL * to check certificates revocation */ result = setstropt(&data->set.str[STRING_SSL_CRLFILE], va_arg(param, char *)); break; case CURLOPT_ISSUERCERT: /* * Set Issuer certificate file * to check certificates issuer */ result = setstropt(&data->set.str[STRING_SSL_ISSUERCERT], 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 = (0 != va_arg(param, long))?TRUE:FALSE; 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 !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) if(data->share->cookies == data->cookies) data->cookies = NULL; #endif if(data->share->sslsession == data->state.session) data->state.session = 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 */ 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); /* enable cookies since we now use a share that uses cookies! */ data->cookies = data->share->cookies; } #endif /* CURL_DISABLE_HTTP */ if(data->share->sslsession) { data->set.ssl.max_ssl_sessions = data->share->max_ssl_sessions; data->state.session = data->share->sslsession; } Curl_share_unlock(data, CURL_LOCK_DATA_SHARE); } /* check for host cache not needed, * it will be done by curl_easy_perform */ } break; case CURLOPT_PRIVATE: /* * Set private data pointer. */ data->set.private_data = va_arg(param, void *); break; case CURLOPT_MAXFILESIZE: /* * Set the maximum size of a file to download. */ data->set.max_filesize = va_arg(param, long); break; #ifdef USE_SSL case CURLOPT_USE_SSL: /* * Make transfers attempt to use SSL/TLS. */ data->set.use_ssl = (curl_usessl)va_arg(param, long); break; case CURLOPT_SSL_OPTIONS: arg = va_arg(param, long); data->set.ssl_enable_beast = arg&CURLSSLOPT_ALLOW_BEAST?TRUE:FALSE; break; #endif 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.ipver = 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 = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_FTP_ACCOUNT: result = setstropt(&data->set.str[STRING_FTP_ACCOUNT], va_arg(param, char *)); break; case CURLOPT_IGNORE_CONTENT_LENGTH: data->set.ignorecl = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_CONNECT_ONLY: /* * No data transfer, set up connection and let application use the socket */ data->set.connect_only = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_FTP_ALTERNATIVE_TO_USER: result = setstropt(&data->set.str[STRING_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_OPENSOCKETFUNCTION: /* * open/create socket callback function: called instead of socket(), * before connect() */ data->set.fopensocket = va_arg(param, curl_opensocket_callback); break; case CURLOPT_OPENSOCKETDATA: /* * socket callback data pointer. Might be NULL. */ data->set.opensocket_client = va_arg(param, void *); break; case CURLOPT_CLOSESOCKETFUNCTION: /* * close socket callback function: called instead of close() * when shutting down a connection */ data->set.fclosesocket = va_arg(param, curl_closesocket_callback); break; case CURLOPT_CLOSESOCKETDATA: /* * socket callback data pointer. Might be NULL. */ data->set.closesocket_client = va_arg(param, void *); break; case CURLOPT_SSL_SESSIONID_CACHE: data->set.ssl.sessionid = (0 != va_arg(param, long))?TRUE:FALSE; break; #ifdef USE_LIBSSH2 /* we only include SSH options if explicitly built to support SSH */ case CURLOPT_SSH_AUTH_TYPES: data->set.ssh_auth_types = va_arg(param, long); break; case CURLOPT_SSH_PUBLIC_KEYFILE: /* * Use this file instead of the $HOME/.ssh/id_dsa.pub file */ result = setstropt(&data->set.str[STRING_SSH_PUBLIC_KEY], va_arg(param, char *)); break; case CURLOPT_SSH_PRIVATE_KEYFILE: /* * Use this file instead of the $HOME/.ssh/id_dsa file */ result = setstropt(&data->set.str[STRING_SSH_PRIVATE_KEY], va_arg(param, char *)); break; case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5: /* * Option to allow for the MD5 of the host public key to be checked * for validation purposes. */ result = setstropt(&data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5], va_arg(param, char *)); break; #ifdef HAVE_LIBSSH2_KNOWNHOST_API case CURLOPT_SSH_KNOWNHOSTS: /* * Store the file name to read known hosts from. */ result = setstropt(&data->set.str[STRING_SSH_KNOWNHOSTS], va_arg(param, char *)); break; case CURLOPT_SSH_KEYFUNCTION: /* setting to NULL is fine since the ssh.c functions themselves will then rever to use the internal default */ data->set.ssh_keyfunc = va_arg(param, curl_sshkeycallback); break; case CURLOPT_SSH_KEYDATA: /* * Custom client data to pass to the SSH keyfunc callback */ data->set.ssh_keyfunc_userp = va_arg(param, void *); break; #endif /* HAVE_LIBSSH2_KNOWNHOST_API */ #endif /* USE_LIBSSH2 */ case CURLOPT_HTTP_TRANSFER_DECODING: /* * disable libcurl transfer encoding is used */ data->set.http_te_skip = (0 == va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_HTTP_CONTENT_DECODING: /* * raw data passed to the application when content encoding is used */ data->set.http_ce_skip = (0 == va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_NEW_FILE_PERMS: /* * Uses these permissions instead of 0644 */ data->set.new_file_perms = va_arg(param, long); break; case CURLOPT_NEW_DIRECTORY_PERMS: /* * Uses these permissions instead of 0755 */ data->set.new_directory_perms = va_arg(param, long); break; case CURLOPT_ADDRESS_SCOPE: /* * We always get longs when passed plain numericals, but for this value we * know that an unsigned int will always hold the value so we blindly * typecast to this type */ data->set.scope = curlx_sltoui(va_arg(param, long)); break; case CURLOPT_PROTOCOLS: /* set the bitmask for the protocols that are allowed to be used for the transfer, which thus helps the app which takes URLs from users or other external inputs and want to restrict what protocol(s) to deal with. Defaults to CURLPROTO_ALL. */ data->set.allowed_protocols = va_arg(param, long); break; case CURLOPT_REDIR_PROTOCOLS: /* set the bitmask for the protocols that libcurl is allowed to follow to, as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs to be set in both bitmasks to be allowed to get redirected to. Defaults to all protocols except FILE and SCP. */ data->set.redir_protocols = va_arg(param, long); break; case CURLOPT_MAIL_FROM: /* Set the SMTP mail originator */ result = setstropt(&data->set.str[STRING_MAIL_FROM], va_arg(param, char *)); break; case CURLOPT_MAIL_AUTH: /* Set the SMTP auth originator */ result = setstropt(&data->set.str[STRING_MAIL_AUTH], va_arg(param, char *)); break; case CURLOPT_MAIL_RCPT: /* Set the list of mail recipients */ data->set.mail_rcpt = va_arg(param, struct curl_slist *); break; case CURLOPT_SASL_IR: /* Enable/disable SASL initial response */ data->set.sasl_ir = (0 != va_arg(param, long)) ? TRUE : FALSE; break; case CURLOPT_RTSP_REQUEST: { /* * Set the RTSP request method (OPTIONS, SETUP, PLAY, etc...) * Would this be better if the RTSPREQ_* were just moved into here? */ long curl_rtspreq = va_arg(param, long); Curl_RtspReq rtspreq = RTSPREQ_NONE; switch(curl_rtspreq) { case CURL_RTSPREQ_OPTIONS: rtspreq = RTSPREQ_OPTIONS; break; case CURL_RTSPREQ_DESCRIBE: rtspreq = RTSPREQ_DESCRIBE; break; case CURL_RTSPREQ_ANNOUNCE: rtspreq = RTSPREQ_ANNOUNCE; break; case CURL_RTSPREQ_SETUP: rtspreq = RTSPREQ_SETUP; break; case CURL_RTSPREQ_PLAY: rtspreq = RTSPREQ_PLAY; break; case CURL_RTSPREQ_PAUSE: rtspreq = RTSPREQ_PAUSE; break; case CURL_RTSPREQ_TEARDOWN: rtspreq = RTSPREQ_TEARDOWN; break; case CURL_RTSPREQ_GET_PARAMETER: rtspreq = RTSPREQ_GET_PARAMETER; break; case CURL_RTSPREQ_SET_PARAMETER: rtspreq = RTSPREQ_SET_PARAMETER; break; case CURL_RTSPREQ_RECORD: rtspreq = RTSPREQ_RECORD; break; case CURL_RTSPREQ_RECEIVE: rtspreq = RTSPREQ_RECEIVE; break; default: rtspreq = RTSPREQ_NONE; } data->set.rtspreq = rtspreq; break; } case CURLOPT_RTSP_SESSION_ID: /* * Set the RTSP Session ID manually. Useful if the application is * resuming a previously established RTSP session */ result = setstropt(&data->set.str[STRING_RTSP_SESSION_ID], va_arg(param, char *)); break; case CURLOPT_RTSP_STREAM_URI: /* * Set the Stream URI for the RTSP request. Unless the request is * for generic server options, the application will need to set this. */ result = setstropt(&data->set.str[STRING_RTSP_STREAM_URI], va_arg(param, char *)); break; case CURLOPT_RTSP_TRANSPORT: /* * The content of the Transport: header for the RTSP request */ result = setstropt(&data->set.str[STRING_RTSP_TRANSPORT], va_arg(param, char *)); break; case CURLOPT_RTSP_CLIENT_CSEQ: /* * Set the CSEQ number to issue for the next RTSP request. Useful if the * application is resuming a previously broken connection. The CSEQ * will increment from this new number henceforth. */ data->state.rtsp_next_client_CSeq = va_arg(param, long); break; case CURLOPT_RTSP_SERVER_CSEQ: /* Same as the above, but for server-initiated requests */ data->state.rtsp_next_client_CSeq = va_arg(param, long); break; case CURLOPT_INTERLEAVEDATA: data->set.rtp_out = va_arg(param, void *); break; case CURLOPT_INTERLEAVEFUNCTION: /* Set the user defined RTP write function */ data->set.fwrite_rtp = va_arg(param, curl_write_callback); break; case CURLOPT_WILDCARDMATCH: data->set.wildcardmatch = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_CHUNK_BGN_FUNCTION: data->set.chunk_bgn = va_arg(param, curl_chunk_bgn_callback); break; case CURLOPT_CHUNK_END_FUNCTION: data->set.chunk_end = va_arg(param, curl_chunk_end_callback); break; case CURLOPT_FNMATCH_FUNCTION: data->set.fnmatch = va_arg(param, curl_fnmatch_callback); break; case CURLOPT_CHUNK_DATA: data->wildcard.customptr = va_arg(param, void *); break; case CURLOPT_FNMATCH_DATA: data->set.fnmatch_data = va_arg(param, void *); break; #ifdef USE_TLS_SRP case CURLOPT_TLSAUTH_USERNAME: result = setstropt(&data->set.str[STRING_TLSAUTH_USERNAME], va_arg(param, char *)); if(data->set.str[STRING_TLSAUTH_USERNAME] && !data->set.ssl.authtype) data->set.ssl.authtype = CURL_TLSAUTH_SRP; /* default to SRP */ break; case CURLOPT_TLSAUTH_PASSWORD: result = setstropt(&data->set.str[STRING_TLSAUTH_PASSWORD], va_arg(param, char *)); if(data->set.str[STRING_TLSAUTH_USERNAME] && !data->set.ssl.authtype) data->set.ssl.authtype = CURL_TLSAUTH_SRP; /* default to SRP */ break; case CURLOPT_TLSAUTH_TYPE: if(strnequal((char *)va_arg(param, char *), "SRP", strlen("SRP"))) data->set.ssl.authtype = CURL_TLSAUTH_SRP; else data->set.ssl.authtype = CURL_TLSAUTH_NONE; break; #endif case CURLOPT_DNS_SERVERS: result = Curl_set_dns_servers(data, va_arg(param, char *)); break; case CURLOPT_DNS_INTERFACE: result = Curl_set_dns_interface(data, va_arg(param, char *)); break; case CURLOPT_DNS_LOCAL_IP4: result = Curl_set_dns_local_ip4(data, va_arg(param, char *)); break; case CURLOPT_DNS_LOCAL_IP6: result = Curl_set_dns_local_ip6(data, va_arg(param, char *)); break; case CURLOPT_TCP_KEEPALIVE: data->set.tcp_keepalive = (0 != va_arg(param, long))?TRUE:FALSE; break; case CURLOPT_TCP_KEEPIDLE: data->set.tcp_keepidle = va_arg(param, long); break; case CURLOPT_TCP_KEEPINTVL: data->set.tcp_keepintvl = va_arg(param, long); break; default: /* unknown tag and its companion, just ignore: */ result = CURLE_UNKNOWN_OPTION; break; } return result; } static void conn_free(struct connectdata *conn) { if(!conn) return; /* possible left-overs from the async name resolvers */ Curl_resolver_cancel(conn); /* close the SSL stuff before we close any sockets since they will/may write to the sockets */ Curl_ssl_close(conn, FIRSTSOCKET); Curl_ssl_close(conn, SECONDARYSOCKET); /* close possibly still open sockets */ if(CURL_SOCKET_BAD != conn->sock[SECONDARYSOCKET]) Curl_closesocket(conn, conn->sock[SECONDARYSOCKET]); if(CURL_SOCKET_BAD != conn->sock[FIRSTSOCKET]) Curl_closesocket(conn, conn->sock[FIRSTSOCKET]); if(CURL_SOCKET_BAD != conn->tempsock[0]) Curl_closesocket(conn, conn->tempsock[0]); if(CURL_SOCKET_BAD != conn->tempsock[1]) Curl_closesocket(conn, conn->tempsock[1]); #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) Curl_ntlm_wb_cleanup(conn); #endif Curl_safefree(conn->user); Curl_safefree(conn->passwd); Curl_safefree(conn->xoauth2_bearer); Curl_safefree(conn->options); 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.te); Curl_safefree(conn->allocptr.rangeline); Curl_safefree(conn->allocptr.ref); Curl_safefree(conn->allocptr.host); Curl_safefree(conn->allocptr.cookiehost); Curl_safefree(conn->allocptr.rtsp_transport); Curl_safefree(conn->trailer); Curl_safefree(conn->host.rawalloc); /* host name buffer */ Curl_safefree(conn->proxy.rawalloc); /* proxy name buffer */ Curl_safefree(conn->master_buffer); Curl_llist_destroy(conn->send_pipe, NULL); Curl_llist_destroy(conn->recv_pipe, NULL); conn->send_pipe = NULL; conn->recv_pipe = NULL; Curl_safefree(conn->localdev); Curl_free_ssl_config(&conn->ssl_config); free(conn); /* free all the connection oriented data */ } CURLcode Curl_disconnect(struct connectdata *conn, bool dead_connection) { struct SessionHandle *data; if(!conn) return CURLE_OK; /* this is closed and fine already */ data = conn->data; if(!data) { DEBUGF(fprintf(stderr, "DISCONNECT without easy handle, ignoring\n")); return CURLE_OK; } if(conn->dns_entry != NULL) { Curl_resolv_unlock(data, conn->dns_entry); conn->dns_entry = NULL; } Curl_hostcache_prune(data); /* kill old DNS cache entries */ { int has_host_ntlm = (conn->ntlm.state != NTLMSTATE_NONE); int has_proxy_ntlm = (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. */ if(has_host_ntlm) { data->state.authhost.done = FALSE; data->state.authhost.picked = data->state.authhost.want; } if(has_proxy_ntlm) { data->state.authproxy.done = FALSE; data->state.authproxy.picked = data->state.authproxy.want; } if(has_host_ntlm || has_proxy_ntlm) data->state.authproblem = FALSE; } /* Cleanup NTLM connection-related data */ Curl_http_ntlm_cleanup(conn); /* Cleanup possible redirect junk */ if(data->req.newurl) { free(data->req.newurl); data->req.newurl = NULL; } if(conn->handler->disconnect) /* This is set if protocol-specific cleanups should be made */ conn->handler->disconnect(conn, dead_connection); /* unlink ourselves! */ infof(data, "Closing connection %ld\n", conn->connection_id); Curl_conncache_remove_conn(data->state.conn_cache, conn); #if defined(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 */ #elif defined(USE_WIN32_IDN) free(conn->host.encalloc); /* encoded host name buffer, must be freed with idn_free() since this was allocated by curl_win32_idn_to_ascii */ if(conn->proxy.encalloc) free(conn->proxy.encalloc); /* encoded proxy name buffer, must be freed with idn_free() since this was allocated by curl_win32_idn_to_ascii */ #endif Curl_ssl_close(conn, FIRSTSOCKET); /* Indicate to all handles on the pipe that we're dead */ if(Curl_multi_pipeline_enabled(data->multi)) { signalPipeClose(conn->send_pipe, TRUE); signalPipeClose(conn->recv_pipe, TRUE); } conn_free(conn); Curl_speedinit(data); 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_socket_ready(sock, CURL_SOCKET_BAD, 0); if(sval == 0) /* timeout */ ret_val = FALSE; return ret_val; } static bool IsPipeliningPossible(const struct SessionHandle *handle, const struct connectdata *conn) { if((conn->handler->protocol & CURLPROTO_HTTP) && Curl_multi_pipeline_enabled(handle->multi) && (handle->set.httpreq == HTTPREQ_GET || handle->set.httpreq == HTTPREQ_HEAD) && handle->set.httpversion != CURL_HTTP_VERSION_1_0) return TRUE; return FALSE; } bool Curl_isPipeliningEnabled(const struct SessionHandle *handle) { return Curl_multi_pipeline_enabled(handle->multi); } CURLcode Curl_addHandleToPipeline(struct SessionHandle *data, struct curl_llist *pipeline) { if(!Curl_llist_insert_next(pipeline, pipeline->tail, data)) return CURLE_OUT_OF_MEMORY; return CURLE_OK; } int Curl_removeHandleFromPipeline(struct SessionHandle *handle, struct curl_llist *pipeline) { struct curl_llist_element *curr; curr = pipeline->head; while(curr) { if(curr->ptr == handle) { Curl_llist_remove(pipeline, curr, NULL); return 1; /* we removed a handle */ } curr = curr->next; } return 0; } #if 0 /* this code is saved here as it is useful for debugging purposes */ static void Curl_printPipeline(struct curl_llist *pipeline) { struct curl_llist_element *curr; curr = pipeline->head; while(curr) { struct SessionHandle *data = (struct SessionHandle *) curr->ptr; infof(data, "Handle in pipeline: %s\n", data->state.path); curr = curr->next; } } #endif static struct SessionHandle* gethandleathead(struct curl_llist *pipeline) { struct curl_llist_element *curr = pipeline->head; if(curr) { return (struct SessionHandle *) curr->ptr; } return NULL; } /* remove the specified connection from all (possible) pipelines and related queues */ void Curl_getoff_all_pipelines(struct SessionHandle *data, struct connectdata *conn) { bool recv_head = (conn->readchannel_inuse && (gethandleathead(conn->recv_pipe) == data)) ? TRUE : FALSE; bool send_head = (conn->writechannel_inuse && (gethandleathead(conn->send_pipe) == data)) ? TRUE : FALSE; if(Curl_removeHandleFromPipeline(data, conn->recv_pipe) && recv_head) conn->readchannel_inuse = FALSE; if(Curl_removeHandleFromPipeline(data, conn->send_pipe) && send_head) conn->writechannel_inuse = FALSE; } static void signalPipeClose(struct curl_llist *pipeline, bool pipe_broke) { struct curl_llist_element *curr; if(!pipeline) return; curr = pipeline->head; while(curr) { struct curl_llist_element *next = curr->next; struct SessionHandle *data = (struct SessionHandle *) curr->ptr; #ifdef DEBUGBUILD /* debug-only code */ if(data->magic != CURLEASY_MAGIC_NUMBER) { /* MAJOR BADNESS */ infof(data, "signalPipeClose() found BAAD easy handle\n"); } #endif if(pipe_broke) data->state.pipe_broke = TRUE; Curl_multi_handlePipeBreak(data); Curl_llist_remove(pipeline, curr, NULL); curr = next; } } /* * This function finds the connection in the connection * cache that has been unused for the longest time. * * Returns the pointer to the oldest idle connection, or NULL if none was * found. */ static struct connectdata * find_oldest_idle_connection(struct SessionHandle *data) { struct conncache *bc = data->state.conn_cache; struct curl_hash_iterator iter; struct curl_llist_element *curr; struct curl_hash_element *he; long highscore=-1; long score; struct timeval now; struct connectdata *conn_candidate = NULL; struct connectbundle *bundle; now = Curl_tvnow(); Curl_hash_start_iterate(bc->hash, &iter); he = Curl_hash_next_element(&iter); while(he) { struct connectdata *conn; bundle = he->ptr; curr = bundle->conn_list->head; while(curr) { conn = curr->ptr; if(!conn->inuse) { /* Set higher score for the age passed since the connection was used */ score = Curl_tvdiff(now, conn->now); if(score > highscore) { highscore = score; conn_candidate = conn; } } curr = curr->next; } he = Curl_hash_next_element(&iter); } return conn_candidate; } /* * This function finds the connection in the connection * bundle that has been unused for the longest time. * * Returns the pointer to the oldest idle connection, or NULL if none was * found. */ static struct connectdata * find_oldest_idle_connection_in_bundle(struct SessionHandle *data, struct connectbundle *bundle) { struct curl_llist_element *curr; long highscore=-1; long score; struct timeval now; struct connectdata *conn_candidate = NULL; struct connectdata *conn; (void)data; now = Curl_tvnow(); curr = bundle->conn_list->head; while(curr) { conn = curr->ptr; if(!conn->inuse) { /* Set higher score for the age passed since the connection was used */ score = Curl_tvdiff(now, conn->now); if(score > highscore) { highscore = score; conn_candidate = conn; } } curr = curr->next; } return conn_candidate; } /* * 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. * * The force_reuse flag is set if the connection must be used, even if * the pipelining strategy wants to open a new connection instead of reusing. */ static bool ConnectionExists(struct SessionHandle *data, struct connectdata *needle, struct connectdata **usethis, bool *force_reuse) { struct connectdata *check; struct connectdata *chosen = 0; bool canPipeline = IsPipeliningPossible(data, needle); bool wantNTLM = (data->state.authhost.want & CURLAUTH_NTLM) || (data->state.authhost.want & CURLAUTH_NTLM_WB) ? TRUE : FALSE; struct connectbundle *bundle; *force_reuse = FALSE; /* We can't pipe if the site is blacklisted */ if(canPipeline && Curl_pipeline_site_blacklisted(data, needle)) { canPipeline = FALSE; } /* Look up the bundle with all the connections to this particular host */ bundle = Curl_conncache_find_bundle(data->state.conn_cache, needle->host.name); if(bundle) { size_t max_pipe_len = Curl_multi_max_pipeline_length(data->multi); size_t best_pipe_len = max_pipe_len; struct curl_llist_element *curr; infof(data, "Found bundle for host %s: %p\n", needle->host.name, (void *)bundle); /* We can't pipe if we don't know anything about the server */ if(canPipeline && !bundle->server_supports_pipelining) { infof(data, "Server doesn't support pipelining\n"); canPipeline = FALSE; } curr = bundle->conn_list->head; while(curr) { bool match = FALSE; bool credentialsMatch = FALSE; size_t pipeLen; /* * Note that if we use a HTTP proxy, we check connections to that * proxy and not to the actual remote server. */ check = curr->ptr; curr = curr->next; pipeLen = check->send_pipe->size + check->recv_pipe->size; if(!pipeLen && !check->inuse) { /* The check for a dead socket makes sense only if there are no handles in pipeline and the connection isn't already marked in use */ bool dead; if(check->handler->protocol & CURLPROTO_RTSP) /* RTSP is a special case due to RTP interleaving */ dead = Curl_rtsp_connisdead(check); else dead = SocketIsDead(check->sock[FIRSTSOCKET]); if(dead) { check->data = data; infof(data, "Connection %ld seems to be dead!\n", check->connection_id); /* disconnect resources */ Curl_disconnect(check, /* dead_connection */ TRUE); continue; } } if(canPipeline) { /* Make sure the pipe has only GET requests */ struct SessionHandle* sh = gethandleathead(check->send_pipe); struct SessionHandle* rh = gethandleathead(check->recv_pipe); if(sh) { if(!IsPipeliningPossible(sh, check)) continue; } else if(rh) { if(!IsPipeliningPossible(rh, check)) continue; } } else { if(pipeLen > 0) { /* can only happen within multi handles, and means that another easy handle is using this connection */ continue; } if(Curl_resolver_asynch()) { /* ip_addr_str[0] is NUL 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[0]) { infof(data, "Connection #%ld is still name resolving, can't reuse\n", check->connection_id); continue; } } if((check->sock[FIRSTSOCKET] == CURL_SOCKET_BAD) || check->bits.close) { /* Don't pick a connection that hasn't connected yet or that is going to get closed. */ infof(data, "Connection #%ld isn't open enough, can't reuse\n", check->connection_id); #ifdef DEBUGBUILD if(check->recv_pipe->size > 0) { infof(data, "BAD! Unconnected #%ld has a non-empty recv pipeline!\n", check->connection_id); } #endif continue; } } if((needle->handler->flags&PROTOPT_SSL) != (check->handler->flags&PROTOPT_SSL)) /* don't do mixed SSL and non-SSL connections */ if(!(needle->handler->protocol & check->handler->protocol)) /* except protocols that have been upgraded via TLS */ continue; if(needle->handler->flags&PROTOPT_SSL) { if((data->set.ssl.verifypeer != check->verifypeer) || (data->set.ssl.verifyhost != check->verifyhost)) continue; } if(needle->bits.proxy != check->bits.proxy) /* don't do mixed proxy and non-proxy connections */ continue; if(!canPipeline && check->inuse) /* this request can't be pipelined but the checked connection is already in use so we skip it */ continue; if(needle->localdev || needle->localport) { /* If we are bound to a specific local end (IP+port), we must not re-use a random other one, although if we didn't ask for a particular one we can reuse one that was bound. This comparison is a bit rough and too strict. Since the input parameters can be specified in numerous ways and still end up the same it would take a lot of processing to make it really accurate. Instead, this matching will assume that re-uses of bound connections will most likely also re-use the exact same binding parameters and missing out a few edge cases shouldn't hurt anyone very much. */ if((check->localport != needle->localport) || (check->localportrange != needle->localportrange) || !check->localdev || !needle->localdev || strcmp(check->localdev, needle->localdev)) continue; } if((needle->handler->protocol & CURLPROTO_FTP) || ((needle->handler->protocol & CURLPROTO_HTTP) && wantNTLM)) { /* 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; } credentialsMatch = TRUE; } if(!needle->bits.httpproxy || needle->handler->flags&PROTOPT_SSL || (needle->bits.httpproxy && check->bits.httpproxy && needle->bits.tunnel_proxy && check->bits.tunnel_proxy && Curl_raw_equal(needle->proxy.name, check->proxy.name) && (needle->port == check->port))) { /* The requested connection does not use a HTTP proxy or it uses SSL or it is a non-SSL protocol tunneled over the same http proxy name and port number or it is a non-SSL protocol which is allowed to be upgraded via TLS */ if((Curl_raw_equal(needle->handler->scheme, check->handler->scheme) || needle->handler->protocol & check->handler->protocol) && Curl_raw_equal(needle->host.name, check->host.name) && needle->remote_port == check->remote_port) { if(needle->handler->flags & PROTOPT_SSL) { /* This is a SSL connection so verify that we're using the same SSL options as well */ if(!Curl_ssl_config_matches(&needle->ssl_config, &check->ssl_config)) { DEBUGF(infof(data, "Connection #%ld has different SSL parameters, " "can't reuse\n", check->connection_id)); continue; } else if(check->ssl[FIRSTSOCKET].state != ssl_connection_complete) { DEBUGF(infof(data, "Connection #%ld has not started SSL connect, " "can't reuse\n", check->connection_id)); continue; } } match = TRUE; } } else { /* The requested needle connection is using a proxy, is the checked one using the same host, port and type? */ if(check->bits.proxy && (needle->proxytype == check->proxytype) && (needle->bits.tunnel_proxy == check->bits.tunnel_proxy) && Curl_raw_equal(needle->proxy.name, check->proxy.name) && needle->port == check->port) { /* This is the same proxy connection, use it! */ match = TRUE; } } if(match) { /* If we are looking for an NTLM connection, check if this is already authenticating with the right credentials. If not, keep looking so that we can reuse NTLM connections if possible. (Especially we must not reuse the same connection if partway through a handshake!) */ if(wantNTLM) { if(credentialsMatch && check->ntlm.state != NTLMSTATE_NONE) { chosen = check; /* We must use this connection, no other */ *force_reuse = TRUE; break; } else continue; } if(canPipeline) { /* We can pipeline if we want to. Let's continue looking for the optimal connection to use, i.e the shortest pipe that is not blacklisted. */ if(pipeLen == 0) { /* We have the optimal connection. Let's stop looking. */ chosen = check; break; } /* We can't use the connection if the pipe is full */ if(pipeLen >= max_pipe_len) continue; /* We can't use the connection if the pipe is penalized */ if(Curl_pipeline_penalized(data, check)) continue; if(pipeLen < best_pipe_len) { /* This connection has a shorter pipe so far. We'll pick this and continue searching */ chosen = check; best_pipe_len = pipeLen; continue; } } else { /* We have found a connection. Let's stop searching. */ chosen = check; break; } } } } if(chosen) { *usethis = chosen; return TRUE; /* yes, we found one to use! */ } return FALSE; /* no matching connecting exists */ } /* Mark the connection as 'idle', or close it if the cache is full. Returns TRUE if the connection is kept, or FALSE if it was closed. */ static bool ConnectionDone(struct SessionHandle *data, struct connectdata *conn) { /* data->multi->maxconnects can be negative, deal with it. */ size_t maxconnects = (data->multi->maxconnects < 0) ? 0 : data->multi->maxconnects; struct connectdata *conn_candidate = NULL; /* Mark the current connection as 'unused' */ conn->inuse = FALSE; if(maxconnects > 0 && data->state.conn_cache->num_connections > maxconnects) { infof(data, "Connection cache is full, closing the oldest one.\n"); conn_candidate = find_oldest_idle_connection(data); if(conn_candidate) { /* Set the connection's owner correctly */ conn_candidate->data = data; /* the winner gets the honour of being disconnected */ (void)Curl_disconnect(conn_candidate, /* dead_connection */ FALSE); } } return (conn_candidate == conn) ? FALSE : TRUE; } /* * The given input connection struct pointer is to be stored in the connection * cache. If the cache is already full, least interesting existing connection * (if any) gets closed. * * The given connection should be unique. That must've been checked prior to * this call. */ static CURLcode ConnectionStore(struct SessionHandle *data, struct connectdata *conn) { static int connection_id_counter = 0; CURLcode result; /* Assign a number to the connection for easier tracking in the log output */ conn->connection_id = connection_id_counter++; result = Curl_conncache_add_conn(data->state.conn_cache, conn); if(result != CURLE_OK) conn->connection_id = -1; return result; } /* after a TCP connection to the proxy has been verified, this function does the next magic step. Note: this function's sub-functions call failf() */ CURLcode Curl_connected_proxy(struct connectdata *conn, int sockindex) { if(!conn->bits.proxy || sockindex) /* this magic only works for the primary socket as the secondary is used for FTP only and it has FTP specific magic in ftp.c */ return CURLE_OK; switch(conn->proxytype) { #ifndef CURL_DISABLE_PROXY case CURLPROXY_SOCKS5: case CURLPROXY_SOCKS5_HOSTNAME: return Curl_SOCKS5(conn->proxyuser, conn->proxypasswd, conn->host.name, conn->remote_port, FIRSTSOCKET, conn); case CURLPROXY_SOCKS4: return Curl_SOCKS4(conn->proxyuser, conn->host.name, conn->remote_port, FIRSTSOCKET, conn, FALSE); case CURLPROXY_SOCKS4A: return Curl_SOCKS4(conn->proxyuser, conn->host.name, conn->remote_port, FIRSTSOCKET, conn, TRUE); #endif /* CURL_DISABLE_PROXY */ case CURLPROXY_HTTP: case CURLPROXY_HTTP_1_0: /* do nothing here. handled later. */ break; default: break; } /* switch proxytype */ return CURLE_OK; } /* * verboseconnect() displays verbose information after a connect */ #ifndef CURL_DISABLE_VERBOSE_STRINGS void Curl_verboseconnect(struct connectdata *conn) { if(conn->data->set.verbose) infof(conn->data, "Connected to %s (%s) port %ld (#%ld)\n", conn->bits.proxy ? conn->proxy.dispname : conn->host.dispname, conn->ip_addr_str, conn->port, conn->connection_id); } #endif int Curl_protocol_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { if(conn->handler->proto_getsock) return conn->handler->proto_getsock(conn, socks, numsocks); return GETSOCK_BLANK; } int Curl_doing_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { if(conn && conn->handler->doing_getsock) return conn->handler->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->handler->connecting) { *done = FALSE; result = conn->handler->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->handler->doing) { *done = FALSE; result = conn->handler->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; *protocol_done = FALSE; if(conn->bits.tcpconnect[FIRSTSOCKET] && 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->handler->connecting) *protocol_done = TRUE; return CURLE_OK; } if(!conn->bits.protoconnstart) { result = Curl_proxy_connect(conn); if(result) return result; if(conn->bits.tunnel_proxy && conn->bits.httpproxy && (conn->tunnel_state[FIRSTSOCKET] != TUNNEL_COMPLETE)) /* when using an HTTP tunnel proxy, await complete tunnel establishment before proceeding further. Return CURLE_OK so we'll be called again */ return CURLE_OK; if(conn->handler->connect_it) { /* is there a protocol-specific connect() procedure? */ /* Call the protocol-specific connect function */ result = conn->handler->connect_it(conn, protocol_done); } else *protocol_done = TRUE; /* it has started, possibly even completed but that knowledge isn't stored in this bit! */ if(!result) conn->bits.protoconnstart = TRUE; } return result; /* pass back status */ } /* * Helpers for IDNA convertions. */ 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; } #ifdef USE_LIBIDN /* * 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; #ifndef CURL_DISABLE_VERBOSE_STRINGS const char *tld_errmsg = ""; #else (void)data; #endif /* 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); #ifndef CURL_DISABLE_VERBOSE_STRINGS #ifdef HAVE_TLD_STRERROR if(rc != TLD_SUCCESS) tld_errmsg = tld_strerror((Tld_rc)rc); #endif if(rc == TLD_INVALID) infof(data, "WARNING: %s; pos %u = `%c'/0x%02X\n", tld_errmsg, 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, tld_errmsg); #endif /* CURL_DISABLE_VERBOSE_STRINGS */ if(uc_name) idn_free(uc_name); if(rc != TLD_SUCCESS) return FALSE; return TRUE; } #endif /* * Perform any necessary IDN conversion of hostname */ static void fix_hostname(struct SessionHandle *data, struct connectdata *conn, struct hostname *host) { #ifndef USE_LIBIDN (void)data; (void)conn; #elif defined(CURL_DISABLE_VERBOSE_STRINGS) (void)conn; #endif /* set the name we use to display the host name */ host->dispname = host->name; if(!is_ASCII_name(host->name)) { #ifdef USE_LIBIDN /************************************************************* * Check name for non-ASCII and convert hostname to ACE form. *************************************************************/ if(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; } } #elif defined(USE_WIN32_IDN) /************************************************************* * Check name for non-ASCII and convert hostname to ACE form. *************************************************************/ char *ace_hostname = NULL; int rc = curl_win32_idn_to_ascii(host->name, &ace_hostname); if(rc == 0) infof(data, "Failed to convert %s to ACE;\n", host->name); else { host->encalloc = ace_hostname; /* change the name pointer to point to the encoded hostname */ host->name = host->encalloc; } #else infof(data, "IDN support not present, can't parse Unicode domains\n"); #endif } } static void llist_dtor(void *user, void *element) { (void)user; (void)element; /* Do nothing */ } /* * Allocate and initialize a new connectdata object. */ static struct connectdata *allocate_conn(struct SessionHandle *data) { struct connectdata *conn = calloc(1, sizeof(struct connectdata)); if(!conn) return NULL; conn->handler = &Curl_handler_dummy; /* Be sure we have a handler defined already from start to avoid NULL situations and checks */ /* and we setup a few fields in case we end up actually using this struct */ conn->sock[FIRSTSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */ conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */ conn->tempsock[0] = CURL_SOCKET_BAD; /* no file descriptor */ conn->tempsock[1] = CURL_SOCKET_BAD; /* no file descriptor */ conn->connection_id = -1; /* no ID */ conn->port = -1; /* unknown at this point */ /* 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; /* Store creation time to help future close decision making */ conn->created = Curl_tvnow(); conn->data = data; /* Setup the association between this connection and the SessionHandle */ conn->proxytype = data->set.proxytype; /* type */ #ifdef CURL_DISABLE_PROXY conn->bits.proxy = FALSE; conn->bits.httpproxy = FALSE; conn->bits.proxy_user_passwd = FALSE; conn->bits.tunnel_proxy = FALSE; #else /* CURL_DISABLE_PROXY */ /* note that these two proxy bits are now just on what looks to be requested, they may be altered down the road */ conn->bits.proxy = (data->set.str[STRING_PROXY] && *data->set.str[STRING_PROXY])?TRUE:FALSE; conn->bits.httpproxy = (conn->bits.proxy && (conn->proxytype == CURLPROXY_HTTP || conn->proxytype == CURLPROXY_HTTP_1_0))?TRUE:FALSE; conn->bits.proxy_user_passwd = (NULL != data->set.str[STRING_PROXYUSERNAME])?TRUE:FALSE; conn->bits.tunnel_proxy = data->set.tunnel_thru_httpproxy; #endif /* CURL_DISABLE_PROXY */ conn->bits.user_passwd = (NULL != data->set.str[STRING_USERNAME])?TRUE:FALSE; conn->bits.ftp_use_epsv = data->set.ftp_use_epsv; conn->bits.ftp_use_eprt = data->set.ftp_use_eprt; conn->verifypeer = data->set.ssl.verifypeer; conn->verifyhost = data->set.ssl.verifyhost; conn->ip_version = data->set.ipver; #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) conn->ntlm_auth_hlpr_socket = CURL_SOCKET_BAD; conn->ntlm_auth_hlpr_pid = 0; conn->challenge_header = NULL; conn->response_header = NULL; #endif if(Curl_multi_pipeline_enabled(data->multi) && !conn->master_buffer) { /* Allocate master_buffer to be used for pipelining */ conn->master_buffer = calloc(BUFSIZE, sizeof (char)); if(!conn->master_buffer) goto error; } /* 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); if(!conn->send_pipe || !conn->recv_pipe) goto error; #ifdef HAVE_GSSAPI conn->data_prot = PROT_CLEAR; #endif /* Store the local bind parameters that will be used for this connection */ if(data->set.str[STRING_DEVICE]) { conn->localdev = strdup(data->set.str[STRING_DEVICE]); if(!conn->localdev) goto error; } conn->localportrange = data->set.localportrange; conn->localport = data->set.localport; /* the close socket stuff needs to be copied to the connection struct as it may live on without (this specific) SessionHandle */ conn->fclosesocket = data->set.fclosesocket; conn->closesocket_client = data->set.closesocket_client; return conn; error: Curl_llist_destroy(conn->send_pipe, NULL); Curl_llist_destroy(conn->recv_pipe, NULL); conn->send_pipe = NULL; conn->recv_pipe = NULL; Curl_safefree(conn->master_buffer); Curl_safefree(conn->localdev); Curl_safefree(conn); return NULL; } static CURLcode findprotocol(struct SessionHandle *data, struct connectdata *conn, const char *protostr) { const struct Curl_handler * const *pp; const struct Curl_handler *p; /* Scan protocol handler table and match against 'protostr' to set a few variables based on the URL. Now that the handler may be changed later when the protocol specific setup function is called. */ for(pp = protocols; (p = *pp) != NULL; pp++) { if(Curl_raw_equal(p->scheme, protostr)) { /* Protocol found in table. Check if allowed */ if(!(data->set.allowed_protocols & p->protocol)) /* nope, get out */ break; /* it is allowed for "normal" request, now do an extra check if this is the result of a redirect */ if(data->state.this_is_a_follow && !(data->set.redir_protocols & p->protocol)) /* nope, get out */ break; /* Perform setup complement if some. */ conn->handler = conn->given = p; /* 'port' and 'remote_port' are set in setup_connection_internals() */ return CURLE_OK; } } /* The protocol was not found in the table, but we don't have to assign it to anything since it is already assigned to a dummy-struct in the create_conn() function when the connectdata struct is allocated. */ failf(data, "Protocol %s not supported or disabled in " LIBCURL_NAME, protostr); return CURLE_UNSUPPORTED_PROTOCOL; } /* * Parse URL and fill in the relevant members of the connection struct. */ static CURLcode parseurlandfillconn(struct SessionHandle *data, struct connectdata *conn, bool *prot_missing, char **userp, char **passwdp, char **optionsp) { char *at; char *fragment; char *path = data->state.path; char *query; int rc; char protobuf[16]; const char *protop; CURLcode result; bool rebuild_url = FALSE; *prot_missing = FALSE; /************************************************************* * 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]", protobuf, path)) && Curl_raw_equal(protobuf, "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); } } protop = "file"; /* protocol string */ } else { /* clear path */ path[0]=0; if(2 > sscanf(data->change.url, "%15[^\n:]://%[^\n/?]%[^\n]", protobuf, conn->host.name, path)) { /* * The URL was badly formatted, let's try the browser-style _without_ * protocol specified like 'http://'. */ rc = sscanf(data->change.url, "%[^\n/?]%[^\n]", conn->host.name, path); if(1 > rc) { /* * We couldn't even get this format. * djgpp 2.04 has a sscanf() bug where 'conn->host.name' is * assigned, but the return value is EOF! */ #if defined(__DJGPP__) && (DJGPP_MINOR == 4) if(!(rc == -1 && *conn->host.name)) #endif { 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)) protop = "ftp"; else if(checkprefix("DICT.", conn->host.name)) protop = "DICT"; else if(checkprefix("LDAP.", conn->host.name)) protop = "LDAP"; else if(checkprefix("IMAP.", conn->host.name)) protop = "IMAP"; else if(checkprefix("SMTP.", conn->host.name)) protop = "smtp"; else if(checkprefix("POP3.", conn->host.name)) protop = "pop3"; else { protop = "http"; } *prot_missing = TRUE; /* not given in URL */ } else protop = protobuf; } /* 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) query = strchr(at+1, '?'); else query = strchr(conn->host.name, '?'); if(query) { /* 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(query); 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, query, hostlen); path[0]='/'; /* prepend the missing slash */ rebuild_url = TRUE; *query=0; /* now cut off the hostname at the ? */ } else if(!path[0]) { /* if there's no path set, use a single slash */ strcpy(path, "/"); rebuild_url = TRUE; } /* 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] = '/'; rebuild_url = TRUE; } else { /* sanitise paths and remove ../ and ./ sequences according to RFC3986 */ char *newp = Curl_dedotdotify(path); if(!newp) return CURLE_OUT_OF_MEMORY; if(strcmp(newp, path)) { rebuild_url = TRUE; free(data->state.pathbuffer); data->state.pathbuffer = newp; data->state.path = newp; path = newp; } else free(newp); } /* * "rebuild_url" means that one or more URL components have been modified so * we need to generate an updated full version. We need the corrected URL * when communicating over HTTP proxy and we don't know at this point if * we're using a proxy or not. */ if(rebuild_url) { char *reurl; size_t plen = strlen(path); /* new path, should be 1 byte longer than the original */ size_t urllen = strlen(data->change.url); /* original URL length */ size_t prefixlen = strlen(conn->host.name); if(!*prot_missing) prefixlen += strlen(protop) + strlen("://"); reurl = malloc(urllen + 2); /* 2 for zerobyte + slash */ if(!reurl) return CURLE_OUT_OF_MEMORY; /* copy the prefix */ memcpy(reurl, data->change.url, prefixlen); /* append the trailing piece + zerobyte */ memcpy(&reurl[prefixlen], path, plen + 1); /* possible free the old one */ if(data->change.url_alloc) { Curl_safefree(data->change.url); data->change.url_alloc = FALSE; } infof(data, "Rebuilt URL to: %s\n", reurl); data->change.url = reurl; data->change.url_alloc = TRUE; /* free this later */ } /* * Parse the login details from the URL and strip them out of * the host name */ result = parse_url_login(data, conn, userp, passwdp, optionsp); if(result != CURLE_OK) return result; if(conn->host.name[0] == '[') { /* This looks like an IPv6 address literal. See if there is an address scope. */ char *percent = strstr (conn->host.name, "%25"); if(percent) { char *endp; unsigned long scope = strtoul (percent + 3, &endp, 10); if(*endp == ']') { /* The address scope was well formed. Knock it out of the hostname. */ memmove(percent, endp, strlen(endp)+1); if(!data->state.this_is_a_follow) /* Don't honour a scope given in a Location: header */ conn->scope = (unsigned int)scope; } else infof(data, "Invalid IPv6 address format\n"); } } if(data->set.scope) /* Override any scope that was set above. */ conn->scope = data->set.scope; /* Remove the fragment part of the path. Per RFC 2396, this is always the last part of the URI. We are looking for the first '#' so that we deal gracefully with non conformant URI such as http://example.com#foo#bar. */ fragment = strchr(path, '#'); if(fragment) { *fragment = 0; /* we know the path part ended with a fragment, so we know the full URL string does too and we need to cut it off from there so it isn't used over proxy */ fragment = strchr(data->change.url, '#'); if(fragment) *fragment = 0; } /* * So if the URL was A://B/C#D, * protop is A * conn->host.name is B * data->state.path is /C */ return findprotocol(data, conn, protop); } /* * If we're doing a resumed transfer, we need to setup our stuff * properly. */ static CURLcode setup_range(struct SessionHandle *data) { struct UrlState *s = &data->state; s->resume_from = data->set.set_resume_from; if(s->resume_from || data->set.str[STRING_SET_RANGE]) { if(s->rangestringalloc) free(s->range); if(s->resume_from) s->range = aprintf("%" CURL_FORMAT_CURL_OFF_TU "-", s->resume_from); else s->range = strdup(data->set.str[STRING_SET_RANGE]); s->rangestringalloc = (s->range)?TRUE:FALSE; if(!s->range) return CURLE_OUT_OF_MEMORY; /* tell ourselves to fetch this range */ s->use_range = TRUE; /* enable range download */ } else s->use_range = FALSE; /* disable range download */ return CURLE_OK; } /* * setup_connection_internals() - * * Setup connection internals specific to the requested protocol in the * SessionHandle. This is inited and setup before the connection is made but * is about the particular protocol that is to be used. * * This MUST get called after proxy magic has been figured out. */ static CURLcode setup_connection_internals(struct connectdata *conn) { const struct Curl_handler * p; CURLcode result; /* in some case in the multi state-machine, we go back to the CONNECT state and then a second (or third or...) call to this function will be made without doing a DISCONNECT or DONE in between (since the connection is yet in place) and therefore this function needs to first make sure there's no lingering previous data allocated. */ Curl_free_request_state(conn->data); memset(&conn->data->req, 0, sizeof(struct SingleRequest)); conn->data->req.maxdownload = -1; conn->socktype = SOCK_STREAM; /* most of them are TCP streams */ /* Perform setup complement if some. */ p = conn->handler; if(p->setup_connection) { result = (*p->setup_connection)(conn); if(result != CURLE_OK) return result; p = conn->handler; /* May have changed. */ } if(conn->port < 0) /* we check for -1 here since if proxy was detected already, this was very likely already set to the proxy port */ conn->port = p->defport; /* only if remote_port was not already parsed off the URL we use the default port number */ if(!conn->remote_port) conn->remote_port = (unsigned short)conn->given->defport; return CURLE_OK; } /* * Curl_free_request_state() should free temp data that was allocated in the * SessionHandle for this single request. */ void Curl_free_request_state(struct SessionHandle *data) { Curl_safefree(data->req.protop); } #ifndef CURL_DISABLE_PROXY /**************************************************************** * Checks if the host is in the noproxy list. returns true if it matches * and therefore the proxy should NOT be used. ****************************************************************/ static bool check_noproxy(const char* name, const char* no_proxy) { /* 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) */ size_t tok_start; size_t tok_end; const char* separator = ", "; size_t no_proxy_len; size_t namelen; char *endptr; if(no_proxy && no_proxy[0]) { if(Curl_raw_equal("*", no_proxy)) { return TRUE; } /* NO_PROXY was specified and it wasn't just an asterisk */ no_proxy_len = strlen(no_proxy); endptr = strchr(name, ':'); if(endptr) namelen = endptr - name; else namelen = strlen(name); for(tok_start = 0; tok_start < no_proxy_len; tok_start = tok_end + 1) { while(tok_start < no_proxy_len && strchr(separator, no_proxy[tok_start]) != NULL) { /* Look for the beginning of the token. */ ++tok_start; } if(tok_start == no_proxy_len) break; /* It was all trailing separator chars, no more tokens. */ for(tok_end = tok_start; tok_end < no_proxy_len && strchr(separator, no_proxy[tok_end]) == NULL; ++tok_end) /* Look for the end of the token. */ ; /* To match previous behaviour, where it was necessary to specify * ".local.com" to prevent matching "notlocal.com", we will leave * the '.' off. */ if(no_proxy[tok_start] == '.') ++tok_start; if((tok_end - tok_start) <= namelen) { /* Match the last part of the name to the domain we are checking. */ const char *checkn = name + namelen - (tok_end - tok_start); if(Curl_raw_nequal(no_proxy + tok_start, checkn, tok_end - tok_start)) { if((tok_end - tok_start) == namelen || *(checkn - 1) == '.') { /* We either have an exact match, or the previous character is a . * so it is within the same domain, so no proxy for this host. */ return TRUE; } } } /* if((tok_end - tok_start) <= namelen) */ } /* for(tok_start = 0; tok_start < no_proxy_len; tok_start = tok_end + 1) */ } /* NO_PROXY was specified and it wasn't just an asterisk */ return FALSE; } /**************************************************************** * Detect what (if any) proxy to use. Remember that this selects a host * name and is not limited to HTTP proxies only. * The returned pointer must be freed by the caller (unless NULL) ****************************************************************/ static char *detect_proxy(struct connectdata *conn) { char *proxy = NULL; #ifndef CURL_DISABLE_HTTP /* 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 proxy_env[128]; no_proxy=curl_getenv("no_proxy"); if(!no_proxy) no_proxy=curl_getenv("NO_PROXY"); if(!check_noproxy(conn->host.name, no_proxy)) { /* It was not listed as without proxy */ const char *protop = conn->handler->scheme; 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 && !Curl_raw_equal("http_proxy", proxy_env)) { /* There was no lowercase variable, try the uppercase version: */ Curl_strntoupper(proxy_env, proxy_env, sizeof(proxy_env)); 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(!check_noproxy(conn->host.name, no_proxy)) - it wasn't specified non-proxy */ if(no_proxy) free(no_proxy); #else /* !CURL_DISABLE_HTTP */ (void)conn; #endif /* CURL_DISABLE_HTTP */ return proxy; } /* * If this is supposed to use a proxy, we need to figure out the proxy * host name, so that we can re-use an existing connection * that may exist registered to the same proxy host. * proxy will be freed before this function returns. */ static CURLcode parse_proxy(struct SessionHandle *data, struct connectdata *conn, char *proxy) { char *prox_portno; char *endofprot; /* We use 'proxyptr' to point to the proxy name from now on... */ char *proxyptr; char *portptr; char *atsign; /* We do the proxy host string parsing here. We want the host name and the * port name. Accept a protocol:// prefix */ /* Parse the protocol part if present */ endofprot = strstr(proxy, "://"); if(endofprot) { proxyptr = endofprot+3; if(checkprefix("socks5h", proxy)) conn->proxytype = CURLPROXY_SOCKS5_HOSTNAME; else if(checkprefix("socks5", proxy)) conn->proxytype = CURLPROXY_SOCKS5; else if(checkprefix("socks4a", proxy)) conn->proxytype = CURLPROXY_SOCKS4A; else if(checkprefix("socks4", proxy) || checkprefix("socks", proxy)) conn->proxytype = CURLPROXY_SOCKS4; /* Any other xxx:// : change to http proxy */ } else proxyptr = proxy; /* No xxx:// head: It's a HTTP proxy */ /* Is there a username and password given in this proxy url? */ atsign = strchr(proxyptr, '@'); if(atsign) { CURLcode res = CURLE_OK; char *proxyuser = NULL; char *proxypasswd = NULL; res = parse_login_details(proxyptr, atsign - proxyptr, &proxyuser, &proxypasswd, NULL); if(!res) { /* 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); if(proxyuser && strlen(proxyuser) < MAX_CURL_USER_LENGTH) conn->proxyuser = curl_easy_unescape(data, proxyuser, 0, NULL); else conn->proxyuser = strdup(""); if(!conn->proxyuser) res = CURLE_OUT_OF_MEMORY; else { Curl_safefree(conn->proxypasswd); if(proxypasswd && strlen(proxypasswd) < MAX_CURL_PASSWORD_LENGTH) conn->proxypasswd = curl_easy_unescape(data, proxypasswd, 0, NULL); else conn->proxypasswd = strdup(""); if(!conn->proxypasswd) res = CURLE_OUT_OF_MEMORY; } if(!res) { conn->bits.proxy_user_passwd = TRUE; /* enable it */ atsign++; /* the right side of the @-letter */ if(atsign) proxyptr = atsign; /* now use this instead */ else res = CURLE_OUT_OF_MEMORY; } } Curl_safefree(proxyuser); Curl_safefree(proxypasswd); if(res) 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 == '%') || (*ptr == '.'))) ptr++; if(*ptr == ']') /* yeps, it ended nicely with a bracket as well */ *ptr++ = 0; else infof(data, "Invalid IPv6 address format\n"); portptr = ptr; /* 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 = strtol(prox_portno, NULL, 10); } else { if(proxyptr[0]=='/') /* If the first character in the proxy string is a slash, fail immediately. The following code will otherwise clear the string which will lead to code running as if no proxy was set! */ return CURLE_COULDNT_RESOLVE_PROXY; /* without a port number after the host name, some people seem to use a slash so we strip everything from the first slash */ atsign = strchr(proxyptr, '/'); if(atsign) *atsign = 0x0; /* cut off path part from host name */ 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; if(!conn->proxy.rawalloc) return CURLE_OUT_OF_MEMORY; return CURLE_OK; } /* * Extract the user and password from the authentication string */ static CURLcode parse_proxy_auth(struct SessionHandle *data, struct connectdata *conn) { char proxyuser[MAX_CURL_USER_LENGTH]=""; char proxypasswd[MAX_CURL_PASSWORD_LENGTH]=""; if(data->set.str[STRING_PROXYUSERNAME] != NULL) { strncpy(proxyuser, data->set.str[STRING_PROXYUSERNAME], MAX_CURL_USER_LENGTH); proxyuser[MAX_CURL_USER_LENGTH-1] = '\0'; /*To be on safe side*/ } if(data->set.str[STRING_PROXYPASSWORD] != NULL) { strncpy(proxypasswd, data->set.str[STRING_PROXYPASSWORD], MAX_CURL_PASSWORD_LENGTH); proxypasswd[MAX_CURL_PASSWORD_LENGTH-1] = '\0'; /*To be on safe side*/ } 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; return CURLE_OK; } #endif /* CURL_DISABLE_PROXY */ /* * parse_url_login() * * Parse the login details (user name, password and options) from the URL and * strip them out of the host name * * Inputs: data->set.use_netrc (CURLOPT_NETRC) * conn->host.name * * Outputs: (almost :- all currently undefined) * conn->bits.user_passwd - non-zero if non-default passwords exist * user - non-zero length if defined * passwd - non-zero length if defined * options - non-zero length if defined * conn->host.name - remove user name and password */ static CURLcode parse_url_login(struct SessionHandle *data, struct connectdata *conn, char **user, char **passwd, char **options) { CURLcode result = CURLE_OK; char *userp = NULL; char *passwdp = NULL; char *optionsp = NULL; /* 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][;options]]@]hostname * * We need somewhere to put the embedded details, so do that first. */ char *ptr = strchr(conn->host.name, '@'); char *login = conn->host.name; DEBUGASSERT(!**user); DEBUGASSERT(!**passwd); DEBUGASSERT(!**options); if(!ptr) goto out; /* We will now try to extract the * possible login information in a string like: * ftp://user:password@ftp.my.site:8021/README */ 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) goto out; /* We could use the login information in the URL so extract it */ result = parse_login_details(login, ptr - login - 1, &userp, &passwdp, &optionsp); if(result != CURLE_OK) goto out; if(userp) { char *newname; /* We have a user in the URL */ conn->bits.userpwd_in_url = TRUE; conn->bits.user_passwd = TRUE; /* enable user+password */ /* Decode the user */ newname = curl_easy_unescape(data, userp, 0, NULL); if(!newname) { result = CURLE_OUT_OF_MEMORY; goto out; } free(*user); *user = newname; } if(passwdp) { /* We have a password in the URL so decode it */ char *newpasswd = curl_easy_unescape(data, passwdp, 0, NULL); if(!newpasswd) { result = CURLE_OUT_OF_MEMORY; goto out; } free(*passwd); *passwd = newpasswd; } if(optionsp) { /* We have an options list in the URL so decode it */ char *newoptions = curl_easy_unescape(data, optionsp, 0, NULL); if(!newoptions) { result = CURLE_OUT_OF_MEMORY; goto out; } free(*options); *options = newoptions; } out: Curl_safefree(userp); Curl_safefree(passwdp); Curl_safefree(optionsp); return result; } /* * parse_login_details() * * This is used to parse a login string for user name, password and options in * the following formats: * * user * user:password * user:password;options * user;options * user;options:password * :password * :password;options * ;options * ;options:password * * Parameters: * * login [in] - The login string. * len [in] - The length of the login string. * userp [in/out] - The address where a pointer to newly allocated memory * holding the user will be stored upon completion. * passdwp [in/out] - The address where a pointer to newly allocated memory * holding the password will be stored upon completion. * optionsp [in/out] - The address where a pointer to newly allocated memory * holding the options will be stored upon completion. * * Returns CURLE_OK on success. */ static CURLcode parse_login_details(const char *login, const size_t len, char **userp, char **passwdp, char **optionsp) { CURLcode result = CURLE_OK; char *ubuf = NULL; char *pbuf = NULL; char *obuf = NULL; const char *psep = NULL; const char *osep = NULL; size_t ulen; size_t plen; size_t olen; /* Attempt to find the password separator */ if(passwdp) { psep = strchr(login, ':'); /* Within the constraint of the login string */ if(psep >= login + len) psep = NULL; } /* Attempt to find the options separator */ if(optionsp) { osep = strchr(login, ';'); /* Within the constraint of the login string */ if(osep >= login + len) osep = NULL; } /* Calculate the portion lengths */ ulen = (psep ? (size_t)(osep && psep > osep ? osep - login : psep - login) : (osep ? (size_t)(osep - login) : len)); plen = (psep ? (osep && osep > psep ? (size_t)(osep - psep) : (size_t)(login + len - psep)) - 1 : 0); olen = (osep ? (psep && psep > osep ? (size_t)(psep - osep) : (size_t)(login + len - osep)) - 1 : 0); /* Allocate the user portion buffer */ if(userp && ulen) { ubuf = malloc(ulen + 1); if(!ubuf) result = CURLE_OUT_OF_MEMORY; } /* Allocate the password portion buffer */ if(!result && passwdp && plen) { pbuf = malloc(plen + 1); if(!pbuf) { Curl_safefree(ubuf); result = CURLE_OUT_OF_MEMORY; } } /* Allocate the options portion buffer */ if(!result && optionsp && olen) { obuf = malloc(olen + 1); if(!obuf) { Curl_safefree(pbuf); Curl_safefree(ubuf); result = CURLE_OUT_OF_MEMORY; } } if(!result) { /* Store the user portion if necessary */ if(ubuf) { memcpy(ubuf, login, ulen); ubuf[ulen] = '\0'; Curl_safefree(*userp); *userp = ubuf; } /* Store the password portion if necessary */ if(pbuf) { memcpy(pbuf, psep + 1, plen); pbuf[plen] = '\0'; Curl_safefree(*passwdp); *passwdp = pbuf; } /* Store the options portion if necessary */ if(obuf) { memcpy(obuf, osep + 1, olen); obuf[olen] = '\0'; Curl_safefree(*optionsp); *optionsp = obuf; } } return result; } /************************************************************* * Figure out the remote port number and fix it in the URL * * 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. * * The port number embedded in the URL is replaced, if necessary. *************************************************************/ static CURLcode parse_remote_port(struct SessionHandle *data, struct connectdata *conn) { char *portptr; char endbracket; /* Note that at this point, the IPv6 address cannot contain any scope suffix as that has already been removed in the parseurlandfillconn() function */ if((1 == sscanf(conn->host.name, "[%*45[0123456789abcdefABCDEF:.]%c", &endbracket)) && (']' == endbracket)) { /* this is a RFC2732-style specified IP-address */ conn->bits.ipv6_ip = TRUE; conn->host.name++; /* skip over the starting bracket */ portptr = strchr(conn->host.name, ']'); if(portptr) { *portptr++ = '\0'; /* zero terminate, killing the bracket */ if(':' != *portptr) portptr = NULL; /* no port number available */ } } else { #ifdef ENABLE_IPV6 struct in6_addr in6; if(Curl_inet_pton(AF_INET6, conn->host.name, &in6) > 0) { /* This is a numerical IPv6 address, meaning this is a wrongly formatted URL */ failf(data, "IPv6 numerical address used in URL without brackets"); return CURLE_URL_MALFORMAT; } #endif portptr = 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(portptr) *portptr = '\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; char type[12]=""; if(conn->bits.type_set) snprintf(type, sizeof(type), ";type=%c", data->set.prefer_ascii?'A': (data->set.ftp_list_only?'D':'I')); /* * This synthesized URL isn't always right--suffixes like ;type=A are * stripped off. It would be better to work directly from the original * URL and simply replace the port part of it. */ url = aprintf("%s://%s%s%s:%hu%s%s%s", conn->given->scheme, conn->bits.ipv6_ip?"[":"", conn->host.name, conn->bits.ipv6_ip?"]":"", conn->remote_port, data->state.slash_removed?"/":"", data->state.path, type); if(!url) return CURLE_OUT_OF_MEMORY; if(data->change.url_alloc) { Curl_safefree(data->change.url); data->change.url_alloc = FALSE; } data->change.url = url; data->change.url_alloc = TRUE; } } else if(portptr) { /* no CURLOPT_PORT given, extract the one from the URL */ char *rest; unsigned long port; port=strtoul(portptr+1, &rest, 10); /* Port number must be decimal */ if(rest != (portptr+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; } *portptr = '\0'; /* cut off the name there */ conn->remote_port = curlx_ultous(port); } else if(!port) /* Browser behavior adaptation. If there's a colon with no digits after, just cut off the name there which makes us ignore the colon and just use the default port. Firefox and Chrome both do that. */ *portptr = '\0'; } return CURLE_OK; } /* * Override the login details from the URL with that in the CURLOPT_USERPWD * option or a .netrc file, if applicable. */ static CURLcode override_login(struct SessionHandle *data, struct connectdata *conn, char **userp, char **passwdp, char **optionsp) { if(data->set.str[STRING_USERNAME]) { free(*userp); *userp = strdup(data->set.str[STRING_USERNAME]); if(!*userp) return CURLE_OUT_OF_MEMORY; } if(data->set.str[STRING_PASSWORD]) { free(*passwdp); *passwdp = strdup(data->set.str[STRING_PASSWORD]); if(!*passwdp) return CURLE_OUT_OF_MEMORY; } if(data->set.str[STRING_OPTIONS]) { free(*optionsp); *optionsp = strdup(data->set.str[STRING_OPTIONS]); if(!*optionsp) return CURLE_OUT_OF_MEMORY; } conn->bits.netrc = FALSE; if(data->set.use_netrc != CURL_NETRC_IGNORED) { if(Curl_parsenetrc(conn->host.name, userp, passwdp, data->set.str[STRING_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 = TRUE; /* enable user+password */ } } return CURLE_OK; } /* * Set the login details so they're available in the connection */ static CURLcode set_login(struct connectdata *conn, const char *user, const char *passwd, const char *options) { CURLcode result = CURLE_OK; /* If our protocol needs a password and we have none, use the defaults */ if((conn->handler->flags & PROTOPT_NEEDSPWD) && !conn->bits.user_passwd) { /* Store the default user */ conn->user = strdup(CURL_DEFAULT_USER); /* Store the default password */ if(conn->user) conn->passwd = strdup(CURL_DEFAULT_PASSWORD); else conn->passwd = NULL; /* This is the default password, so DON'T set conn->bits.user_passwd */ } else { /* Store the user, zero-length if not set */ conn->user = strdup(user); /* Store the password (only if user is present), zero-length if not set */ if(conn->user) conn->passwd = strdup(passwd); else conn->passwd = NULL; } if(!conn->user || !conn->passwd) result = CURLE_OUT_OF_MEMORY; /* Store the options, null if not set */ if(!result && options[0]) { conn->options = strdup(options); if(!conn->options) result = CURLE_OUT_OF_MEMORY; } return result; } /************************************************************* * Resolve the address of the server or proxy *************************************************************/ static CURLcode resolve_server(struct SessionHandle *data, struct connectdata *conn, bool *async) { CURLcode result=CURLE_OK; long timeout_ms = Curl_timeleft(data, NULL, TRUE); /************************************************************* * Resolve the name of the server or proxy *************************************************************/ if(conn->bits.reuse) /* We're reusing the connection - no need to resolve anything, and fix_hostname() was called already in create_conn() for the re-use case. */ *async = FALSE; else { /* this is a fresh connect */ int rc; struct Curl_dns_entry *hostaddr; /* set a pointer to the hostname we display */ fix_hostname(data, conn, &conn->host); if(!conn->proxy.name || !*conn->proxy.name) { /* 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_timeout(conn, conn->host.name, (int)conn->port, &hostaddr, timeout_ms); if(rc == CURLRESOLV_PENDING) *async = TRUE; else if(rc == CURLRESOLV_TIMEDOUT) result = CURLE_OPERATION_TIMEDOUT; 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_timeout(conn, conn->proxy.name, (int)conn->port, &hostaddr, timeout_ms); if(rc == CURLRESOLV_PENDING) *async = TRUE; else if(rc == CURLRESOLV_TIMEDOUT) result = CURLE_OPERATION_TIMEDOUT; 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 */ } } DEBUGASSERT(conn->dns_entry == NULL); conn->dns_entry = hostaddr; } return result; } /* * Cleanup the connection just allocated before we can move along and use the * previously existing one. All relevant data is copied over and old_conn is * ready for freeing once this function returns. */ static void reuse_conn(struct connectdata *old_conn, struct connectdata *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(&old_conn->ssl_config); 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 name 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 or if the case is different this time etc */ Curl_safefree(conn->host.rawalloc); conn->host=old_conn->host; /* persist connection info in session handle */ Curl_persistconninfo(conn); /* re-use init */ conn->bits.reuse = TRUE; /* yes, we're re-using here */ Curl_safefree(old_conn->user); Curl_safefree(old_conn->passwd); Curl_safefree(old_conn->proxyuser); Curl_safefree(old_conn->proxypasswd); Curl_safefree(old_conn->localdev); Curl_llist_destroy(old_conn->send_pipe, NULL); Curl_llist_destroy(old_conn->recv_pipe, NULL); old_conn->send_pipe = NULL; old_conn->recv_pipe = NULL; Curl_safefree(old_conn->master_buffer); } /** * create_conn() 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 async is set TRUE when an async DNS resolution is pending * @see Curl_setup_conn() * * *NOTE* this function assigns the conn->data pointer! */ static CURLcode create_conn(struct SessionHandle *data, struct connectdata **in_connect, bool *async) { CURLcode result = CURLE_OK; struct connectdata *conn; struct connectdata *conn_temp = NULL; size_t urllen; char *user = NULL; char *passwd = NULL; char *options = NULL; bool reuse; char *proxy = NULL; bool prot_missing = FALSE; bool no_connections_available = FALSE; bool force_reuse; size_t max_host_connections = Curl_multi_max_host_connections(data->multi); size_t max_total_connections = Curl_multi_max_total_connections(data->multi); *async = FALSE; /************************************************************* * Check input data *************************************************************/ if(!data->change.url) { result = CURLE_URL_MALFORMAT; goto out; } /* 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 = allocate_conn(data); if(!conn) { result = CURLE_OUT_OF_MEMORY; goto out; } /* 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; /* 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; /* * We malloc() the buffers below urllen+2 to make room for 2 possibilities: * 1 - an extra terminating zero * 2 - an extra slash (in case a syntax like "www.host.com?moo" is used) */ Curl_safefree(data->state.pathbuffer); data->state.path = NULL; data->state.pathbuffer = malloc(urllen+2); if(NULL == data->state.pathbuffer) { result = CURLE_OUT_OF_MEMORY; /* really bad error */ goto out; } data->state.path = data->state.pathbuffer; conn->host.rawalloc = malloc(urllen+2); if(NULL == conn->host.rawalloc) { Curl_safefree(data->state.pathbuffer); data->state.path = NULL; result = CURLE_OUT_OF_MEMORY; goto out; } conn->host.name = conn->host.rawalloc; conn->host.name[0] = 0; user = strdup(""); passwd = strdup(""); options = strdup(""); if(!user || !passwd || !options) { result = CURLE_OUT_OF_MEMORY; goto out; } result = parseurlandfillconn(data, conn, &prot_missing, &user, &passwd, &options); if(result != CURLE_OK) goto out; /************************************************************* * No protocol part in URL was used, add it! *************************************************************/ if(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->handler->scheme, data->change.url); if(!reurl) { result = CURLE_OUT_OF_MEMORY; goto out; } if(data->change.url_alloc) { Curl_safefree(data->change.url); data->change.url_alloc = FALSE; } data->change.url = reurl; data->change.url_alloc = TRUE; /* free this later */ } /************************************************************* * If the protocol can't handle url query strings, then cut * of the unhandable part *************************************************************/ if((conn->given->flags&PROTOPT_NOURLQUERY)) { char *path_q_sep = strchr(conn->data->state.path, '?'); if(path_q_sep) { /* according to rfc3986, allow the query (?foo=bar) also on protocols that can't handle it. cut the string-part after '?' */ /* terminate the string */ path_q_sep[0] = 0; } } if(data->set.str[STRING_BEARER]) { conn->xoauth2_bearer = strdup(data->set.str[STRING_BEARER]); if(!conn->xoauth2_bearer) { result = CURLE_OUT_OF_MEMORY; goto out; } } #ifndef CURL_DISABLE_PROXY /************************************************************* * Extract the user and password from the authentication string *************************************************************/ if(conn->bits.proxy_user_passwd) { result = parse_proxy_auth(data, conn); if(result != CURLE_OK) goto out; } /************************************************************* * Detect what (if any) proxy to use *************************************************************/ if(data->set.str[STRING_PROXY]) { proxy = strdup(data->set.str[STRING_PROXY]); /* if global proxy is set, this is it */ if(NULL == proxy) { failf(data, "memory shortage"); result = CURLE_OUT_OF_MEMORY; goto out; } } if(data->set.str[STRING_NOPROXY] && check_noproxy(conn->host.name, data->set.str[STRING_NOPROXY])) { if(proxy) { free(proxy); /* proxy is in exception list */ proxy = NULL; } } else if(!proxy) proxy = detect_proxy(conn); if(proxy && (!*proxy || (conn->handler->flags & PROTOPT_NONETWORK))) { free(proxy); /* Don't bother with an empty proxy string or if the protocol doesn't work with network */ proxy = NULL; } /*********************************************************************** * If this is supposed to use a proxy, we need to figure out the proxy host * name, proxy type and port number, so that we can re-use an existing * connection that may exist registered to the same proxy host. ***********************************************************************/ if(proxy) { result = parse_proxy(data, conn, proxy); Curl_safefree(proxy); /* parse_proxy copies the proxy string */ if(result) goto out; if((conn->proxytype == CURLPROXY_HTTP) || (conn->proxytype == CURLPROXY_HTTP_1_0)) { #ifdef CURL_DISABLE_HTTP /* asking for a HTTP proxy is a bit funny when HTTP is disabled... */ result = CURLE_UNSUPPORTED_PROTOCOL; goto out; #else /* force this connection's protocol to become HTTP if not already compatible - if it isn't tunneling through */ if(!(conn->handler->protocol & CURLPROTO_HTTP) && !conn->bits.tunnel_proxy) conn->handler = &Curl_handler_http; conn->bits.httpproxy = TRUE; #endif } else conn->bits.httpproxy = FALSE; /* not a HTTP proxy */ conn->bits.proxy = TRUE; } else { /* we aren't using the proxy after all... */ conn->bits.proxy = FALSE; conn->bits.httpproxy = FALSE; conn->bits.proxy_user_passwd = FALSE; conn->bits.tunnel_proxy = FALSE; } #endif /* CURL_DISABLE_PROXY */ /************************************************************* * If the protocol is using SSL and HTTP proxy is used, we set * the tunnel_proxy bit. *************************************************************/ if((conn->given->flags&PROTOPT_SSL) && conn->bits.httpproxy) conn->bits.tunnel_proxy = TRUE; /************************************************************* * Figure out the remote port number and fix it in the URL *************************************************************/ result = parse_remote_port(data, conn); if(result != CURLE_OK) goto out; /* Check for overridden login details and set them accordingly so they they are known when protocol->setup_connection is called! */ result = override_login(data, conn, &user, &passwd, &options); if(result != CURLE_OK) goto out; result = set_login(conn, user, passwd, options); if(result != CURLE_OK) goto out; /************************************************************* * Setup internals depending on protocol. Needs to be done after * we figured out what/if proxy to use. *************************************************************/ result = setup_connection_internals(conn); if(result != CURLE_OK) goto out; conn->recv[FIRSTSOCKET] = Curl_recv_plain; conn->send[FIRSTSOCKET] = Curl_send_plain; conn->recv[SECONDARYSOCKET] = Curl_recv_plain; conn->send[SECONDARYSOCKET] = Curl_send_plain; /*********************************************************************** * file: is a special case in that it doesn't need a network connection ***********************************************************************/ #ifndef CURL_DISABLE_FILE if(conn->handler->flags & PROTOPT_NONETWORK) { bool done; /* this is supposed to be the connect function so we better at least check that the file is present here! */ DEBUGASSERT(conn->handler->connect_it); result = conn->handler->connect_it(conn, &done); /* Setup a "faked" transfer that'll do nothing */ if(CURLE_OK == result) { conn->data = data; conn->bits.tcpconnect[FIRSTSOCKET] = TRUE; /* we are "connected */ ConnectionStore(data, conn); /* * Setup whatever necessary for a resumed transfer */ result = setup_range(data); if(result) { DEBUGASSERT(conn->handler->done); /* we ignore the return code for the protocol-specific DONE */ (void)conn->handler->done(conn, result, FALSE); goto out; } Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */ -1, NULL); /* no upload */ } /* since we skip do_init() */ do_init(conn); goto out; } #endif /* Get a cloned copy of the SSL config situation stored in the connection struct. But to get this going nicely, we must first make sure that the strings in the master copy are pointing to the correct strings in the session handle strings array! Keep in mind that the pointers in the master copy are pointing to strings that will be freed as part of the SessionHandle struct, but all cloned copies will be separately allocated. */ data->set.ssl.CApath = data->set.str[STRING_SSL_CAPATH]; data->set.ssl.CAfile = data->set.str[STRING_SSL_CAFILE]; data->set.ssl.CRLfile = data->set.str[STRING_SSL_CRLFILE]; data->set.ssl.issuercert = data->set.str[STRING_SSL_ISSUERCERT]; data->set.ssl.random_file = data->set.str[STRING_SSL_RANDOM_FILE]; data->set.ssl.egdsocket = data->set.str[STRING_SSL_EGDSOCKET]; data->set.ssl.cipher_list = data->set.str[STRING_SSL_CIPHER_LIST]; #ifdef USE_TLS_SRP data->set.ssl.username = data->set.str[STRING_TLSAUTH_USERNAME]; data->set.ssl.password = data->set.str[STRING_TLSAUTH_PASSWORD]; #endif if(!Curl_clone_ssl_config(&data->set.ssl, &conn->ssl_config)) { result = CURLE_OUT_OF_MEMORY; goto out; } /************************************************************* * 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. *************************************************************/ /* 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, &force_reuse); /* If we found a reusable connection, we may still want to open a new connection if we are pipelining. */ if(reuse && !force_reuse && IsPipeliningPossible(data, conn_temp)) { size_t pipelen = conn_temp->send_pipe->size + conn_temp->recv_pipe->size; if(pipelen > 0) { infof(data, "Found connection %ld, with requests in the pipe (%zu)\n", conn_temp->connection_id, pipelen); if(conn_temp->bundle->num_connections < max_host_connections && data->state.conn_cache->num_connections < max_total_connections) { /* We want a new connection anyway */ reuse = FALSE; infof(data, "We can reuse, but we want a new connection anyway\n"); } } } 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. */ conn_temp->inuse = TRUE; /* mark this as being in use so that no other handle in a multi stack may nick it */ reuse_conn(conn, conn_temp); free(conn); /* we don't need this anymore */ conn = conn_temp; *in_connect = conn; /* set a pointer to the hostname we display */ fix_hostname(data, conn, &conn->host); infof(data, "Re-using existing connection! (#%ld) with host %s\n", conn->connection_id, conn->proxy.name?conn->proxy.dispname:conn->host.dispname); } else { /* We have decided that we want a new connection. However, we may not be able to do that if we have reached the limit of how many connections we are allowed to open. */ struct connectbundle *bundle; bundle = Curl_conncache_find_bundle(data->state.conn_cache, conn->host.name); if(max_host_connections > 0 && bundle && (bundle->num_connections >= max_host_connections)) { struct connectdata *conn_candidate; /* The bundle is full. Let's see if we can kill a connection. */ conn_candidate = find_oldest_idle_connection_in_bundle(data, bundle); if(conn_candidate) { /* Set the connection's owner correctly, then kill it */ conn_candidate->data = data; (void)Curl_disconnect(conn_candidate, /* dead_connection */ FALSE); } else no_connections_available = TRUE; } if(max_total_connections > 0 && (data->state.conn_cache->num_connections >= max_total_connections)) { struct connectdata *conn_candidate; /* The cache is full. Let's see if we can kill a connection. */ conn_candidate = find_oldest_idle_connection(data); if(conn_candidate) { /* Set the connection's owner correctly, then kill it */ conn_candidate->data = data; (void)Curl_disconnect(conn_candidate, /* dead_connection */ FALSE); } else no_connections_available = TRUE; } if(no_connections_available) { infof(data, "No connections available.\n"); conn_free(conn); *in_connect = NULL; result = CURLE_NO_CONNECTION_AVAILABLE; goto out; } else { /* * This is a brand new connection, so let's store it in the connection * cache of ours! */ ConnectionStore(data, conn); } } /* Mark the connection as used */ conn->inuse = TRUE; /* Setup and init stuff before DO starts, in preparing for the transfer. */ do_init(conn); /* * Setup whatever necessary for a resumed transfer */ result = setup_range(data); if(result) goto out; /* Continue connectdata initialization here. */ /* * Inherit the proper values from the urldata struct AFTER we have arranged * the persistent connection stuff */ conn->fread_func = data->set.fread_func; conn->fread_in = data->set.in; conn->seek_func = data->set.seek_func; conn->seek_client = data->set.seek_client; /************************************************************* * Resolve the address of the server or proxy *************************************************************/ result = resolve_server(data, conn, async); out: Curl_safefree(options); Curl_safefree(passwd); Curl_safefree(user); Curl_safefree(proxy); return result; } /* Curl_setup_conn() is called after the name resolve initiated in * create_conn() is all done. * * Curl_setup_conn() also handles reused connections * * conn->data MUST already have been setup fine (in create_conn) */ CURLcode Curl_setup_conn(struct connectdata *conn, bool *protocol_done) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; Curl_pgrsTime(data, TIMER_NAMELOOKUP); if(conn->handler->flags & PROTOPT_NONETWORK) { /* nothing to setup when not using a network */ *protocol_done = TRUE; return result; } *protocol_done = FALSE; /* default to not done */ /* set proxy_connect_closed to false unconditionally already here since it is used strictly to provide extra information to a parent function in the case of proxy CONNECT failures and we must make sure we don't have it lingering set from a previous invoke */ conn->bits.proxy_connect_closed = FALSE; /* * Set user-agent. Used for HTTP, but since we can attempt to tunnel * basically anything through a http proxy we can't limit this based on * protocol. */ if(data->set.str[STRING_USERAGENT]) { Curl_safefree(conn->allocptr.uagent); conn->allocptr.uagent = aprintf("User-Agent: %s\r\n", data->set.str[STRING_USERAGENT]); if(!conn->allocptr.uagent) return CURLE_OUT_OF_MEMORY; } data->req.headerbytecount = 0; #ifdef CURL_DO_LINEEND_CONV data->state.crlf_conversions = 0; /* reset CRLF conversion counter */ #endif /* CURL_DO_LINEEND_CONV */ /* 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(); if(CURL_SOCKET_BAD == conn->sock[FIRSTSOCKET]) { conn->bits.tcpconnect[FIRSTSOCKET] = FALSE; result = Curl_connecthost(conn, conn->dns_entry); if(result) return result; } else { Curl_pgrsTime(data, TIMER_CONNECT); /* we're connected already */ Curl_pgrsTime(data, TIMER_APPCONNECT); /* we're connected already */ conn->bits.tcpconnect[FIRSTSOCKET] = TRUE; *protocol_done = TRUE; Curl_updateconninfo(conn, conn->sock[FIRSTSOCKET]); Curl_verboseconnect(conn); } conn->now = Curl_tvnow(); /* time this *after* the connect is done, we set this here perhaps a second time */ #ifdef __EMX__ /* * This 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 result; } CURLcode Curl_connect(struct SessionHandle *data, struct connectdata **in_connect, bool *asyncp, bool *protocol_done) { CURLcode code; *asyncp = FALSE; /* assume synchronous resolves by default */ /* call the stuff that needs to be called */ code = create_conn(data, in_connect, asyncp); if(CURLE_OK == code) { /* no error */ if((*in_connect)->send_pipe->size || (*in_connect)->recv_pipe->size) /* pipelining */ *protocol_done = TRUE; else if(!*asyncp) { /* DNS resolution is done: that's either because this is a reused connection, in which case DNS was unnecessary, or because DNS really did finish already (synch resolver/fast async resolve) */ code = Curl_setup_conn(*in_connect, protocol_done); } } if(code == CURLE_NO_CONNECTION_AVAILABLE) { *in_connect = NULL; return code; } if(code && *in_connect) { /* We're not allowed to return failure with memory left allocated in the connectdata struct, free those here */ Curl_disconnect(*in_connect, FALSE); /* close the connection */ *in_connect = NULL; /* return a NULL */ } return code; } CURLcode Curl_done(struct connectdata **connp, CURLcode status, /* an error if this is called after an error was detected */ bool premature) { CURLcode result; struct connectdata *conn; struct SessionHandle *data; DEBUGASSERT(*connp); conn = *connp; data = conn->data; if(conn->bits.done) /* Stop if Curl_done() has already been called */ return CURLE_OK; Curl_getoff_all_pipelines(data, conn); if((conn->send_pipe->size + conn->recv_pipe->size != 0 && !data->set.reuse_forbid && !conn->bits.close)) /* Stop if pipeline is not empty and we do not have to close connection. */ return CURLE_OK; conn->bits.done = TRUE; /* called just now! */ /* Cleanup possible redirect junk */ if(data->req.newurl) { free(data->req.newurl); data->req.newurl = NULL; } if(data->req.location) { free(data->req.location); data->req.location = NULL; } Curl_resolver_cancel(conn); if(conn->dns_entry) { Curl_resolv_unlock(data, conn->dns_entry); /* done with this */ conn->dns_entry = NULL; } switch(status) { case CURLE_ABORTED_BY_CALLBACK: case CURLE_READ_ERROR: case CURLE_WRITE_ERROR: /* When we're aborted due to a callback return code it basically have to be counted as premature as there is trouble ahead if we don't. We have many callbacks and protocols work differently, we could potentially do this more fine-grained in the future. */ premature = TRUE; default: break; } /* this calls the protocol-specific function pointer previously set */ if(conn->handler->done) result = conn->handler->done(conn, status, premature); else result = CURLE_OK; if(Curl_pgrsDone(conn) && !result) result = CURLE_ABORTED_BY_CALLBACK; /* if the transfer was completed in a paused state there can be buffered data left to write and then kill */ if(data->state.tempwrite) { free(data->state.tempwrite); data->state.tempwrite = NULL; } /* 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 premature is TRUE, it means this connection was said to be DONE before the entire request operation is complete and thus we can't know in what state it is for re-using, so we're forced to close it. In a perfect world we can add code that keep track of if we really must close it here or not, but currently we have no such detail knowledge. */ if(data->set.reuse_forbid || conn->bits.close || premature) { CURLcode res2 = Curl_disconnect(conn, premature); /* close connection */ /* 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 { /* the connection is no longer in use */ if(ConnectionDone(data, conn)) { /* remember the most recently used connection */ data->state.lastconnect = conn; infof(data, "Connection #%ld to host %s left intact\n", conn->connection_id, conn->bits.httpproxy?conn->proxy.dispname:conn->host.dispname); } else data->state.lastconnect = NULL; } *connp = NULL; /* to make the caller of this function better detect that this was either closed or handed over to the connection cache here, and therefore cannot be used from this point on */ Curl_free_request_state(data); return result; } /* * do_init() inits the readwrite session. This is inited each time (in the DO * function before the protocol-specific DO functions are invoked) for a * transfer, sometimes multiple times on the same SessionHandle. Make sure * nothing in here depends on stuff that are setup dynamically for the * transfer. */ static CURLcode do_init(struct connectdata *conn) { struct SessionHandle *data = conn->data; struct SingleRequest *k = &data->req; 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 */ data->state.expect100header = FALSE; if(data->set.opt_no_body) /* in HTTP lingo, no body means using the HEAD request... */ data->set.httpreq = HTTPREQ_HEAD; else if(HTTPREQ_HEAD == data->set.httpreq) /* ... but if unset there really is no perfect method that is the "opposite" of HEAD but in reality most people probably think GET then. The important thing is that we can't let it remain HEAD if the opt_no_body is set FALSE since then we'll behave wrong when getting HTTP. */ data->set.httpreq = HTTPREQ_GET; k->start = Curl_tvnow(); /* start time */ k->now = k->start; /* current time is now */ k->header = TRUE; /* assume header */ k->bytecount = 0; k->buf = data->state.buffer; k->uploadbuf = data->state.uploadbuffer; k->hbufp = data->state.headerbuff; k->ignorebody=FALSE; Curl_speedinit(data); Curl_pgrsSetUploadCounter(data, 0); Curl_pgrsSetDownloadCounter(data, 0); return CURLE_OK; } /* * do_complete is called when the DO actions are complete. * * We init chunking and trailer bits to their default values here immediately * before receiving any header data for the current request in the pipeline. */ static void do_complete(struct connectdata *conn) { conn->data->req.chunk=FALSE; conn->data->req.maxfd = (conn->sockfd>conn->writesockfd? conn->sockfd:conn->writesockfd)+1; Curl_pgrsTime(conn->data, TIMER_PRETRANSFER); } CURLcode Curl_do(struct connectdata **connp, bool *done) { CURLcode result=CURLE_OK; struct connectdata *conn = *connp; struct SessionHandle *data = conn->data; if(conn->handler->do_it) { /* generic protocol-specific function pointer set in curl_connect() */ result = conn->handler->do_it(conn, done); /* This was formerly done in transfer.c, but we better do it here */ if((CURLE_SEND_ERROR == result) && conn->bits.reuse) { /* * If the connection is using an easy handle, call reconnect * to re-establish the connection. Otherwise, let the multi logic * figure out how to re-establish the connection. */ if(!data->multi) { result = Curl_reconnect_request(connp); if(result == CURLE_OK) { /* ... finally back to actually retry the DO phase */ conn = *connp; /* re-assign conn since Curl_reconnect_request creates a new connection */ result = conn->handler->do_it(conn, done); } } else return result; } if((result == CURLE_OK) && *done) /* do_complete must be called after the protocol-specific DO function */ do_complete(conn); } return result; } /* * Curl_do_more() is called during the DO_MORE multi state. It is basically a * second stage DO state which (wrongly) was introduced to support FTP's * second connection. * * TODO: A future libcurl should be able to work away this state. * * 'complete' can return 0 for incomplete, 1 for done and -1 for go back to * DOING state there's more work to do! */ CURLcode Curl_do_more(struct connectdata *conn, int *complete) { CURLcode result=CURLE_OK; *complete = 0; if(conn->handler->do_more) result = conn->handler->do_more(conn, complete); if(!result && (*complete == 1)) /* do_complete must be called after the protocol-specific DO function */ do_complete(conn); return result; } curl-7.35.0/lib/strerror.h0000644000175000017500000000257312213173003012274 00000000000000#ifndef HEADER_CURL_STRERROR_H #define HEADER_CURL_STRERROR_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #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 #ifdef USE_WINDOWS_SSPI const char *Curl_sspi_strerror (struct connectdata *conn, int err); #endif #endif /* HEADER_CURL_STRERROR_H */ curl-7.35.0/lib/gopher.c0000644000175000017500000001254712213173003011673 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_GOPHER #include "urldata.h" #include #include "transfer.h" #include "sendf.h" #include "progress.h" #include "strequal.h" #include "gopher.h" #include "rawstr.h" #include "select.h" #include "url.h" #include "warnless.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* * Forward declarations. */ static CURLcode gopher_do(struct connectdata *conn, bool *done); /* * Gopher protocol handler. * This is also a nice simple template to build off for simple * connect-command-download protocols. */ const struct Curl_handler Curl_handler_gopher = { "GOPHER", /* scheme */ ZERO_NULL, /* setup_connection */ gopher_do, /* do_it */ ZERO_NULL, /* done */ ZERO_NULL, /* do_more */ ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_GOPHER, /* defport */ CURLPROTO_GOPHER, /* protocol */ PROTOPT_NONE /* flags */ }; static CURLcode gopher_do(struct connectdata *conn, bool *done) { CURLcode result=CURLE_OK; struct SessionHandle *data=conn->data; curl_socket_t sockfd = conn->sock[FIRSTSOCKET]; curl_off_t *bytecount = &data->req.bytecount; char *path = data->state.path; char *sel; char *sel_org = NULL; ssize_t amount, k; *done = TRUE; /* unconditionally */ /* Create selector. Degenerate cases: / and /1 => convert to "" */ if(strlen(path) <= 2) sel = (char *)""; else { char *newp; size_t j, i; int len; /* Otherwise, drop / and the first character (i.e., item type) ... */ newp = path; newp+=2; /* ... then turn ? into TAB for search servers, Veronica, etc. ... */ j = strlen(newp); for(i=0; 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) /* this is for creating ntlm header output by delegating challenge/response to Samba's winbind daemon helper ntlm_auth */ CURLcode Curl_output_ntlm_wb(struct connectdata *conn, bool proxy); void Curl_ntlm_wb_cleanup(struct connectdata *conn); #endif /* USE_NTLM && NTLM_WB_ENABLED */ #endif /* HEADER_CURL_NTLM_WB_H */ curl-7.35.0/lib/fileinfo.c0000644000175000017500000000317112213173003012173 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2010-2011, 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. * ***************************************************************************/ #include "curl_setup.h" #include "strdup.h" #include "fileinfo.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" struct curl_fileinfo *Curl_fileinfo_alloc(void) { struct curl_fileinfo *tmp = malloc(sizeof(struct curl_fileinfo)); if(!tmp) return NULL; memset(tmp, 0, sizeof(struct curl_fileinfo)); return tmp; } void Curl_fileinfo_dtor(void *user, void *element) { struct curl_fileinfo *finfo = element; (void) user; if(!finfo) return; Curl_safefree(finfo->b_data); free(finfo); } curl-7.35.0/lib/curl_ntlm_core.c0000644000175000017500000003124412267476320013432 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(USE_NTLM) && !defined(USE_WINDOWS_SSPI) /* * NTLM details: * * http://davenport.sourceforge.net/ntlm.html * http://www.innovation.ch/java/ntlm.html */ #ifdef USE_SSLEAY # ifdef USE_OPENSSL # include # ifndef OPENSSL_NO_MD4 # include # endif # include # include # include # else # include # ifndef OPENSSL_NO_MD4 # include # endif # include # include # include # endif # 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 # define DESKEY(x) x # define DESKEYARG(x) x # else # define DESKEYARG(x) *x # define DESKEY(x) &x # endif #elif defined(USE_GNUTLS_NETTLE) # include # include #elif defined(USE_GNUTLS) # include # define MD5_DIGEST_LENGTH 16 # define MD4_DIGEST_LENGTH 16 #elif defined(USE_NSS) # include # include # include # include "curl_md4.h" # define MD5_DIGEST_LENGTH MD5_LENGTH #elif defined(USE_DARWINSSL) # include # include #else # error "Can't compile NTLM support without a crypto library." #endif #include "urldata.h" #include "non-ascii.h" #include "rawstr.h" #include "curl_memory.h" #include "curl_ntlm_core.h" #define _MPRINTF_REPLACE /* use our functions only */ #include /* The last #include file should be: */ #include "memdebug.h" #ifdef USE_SSLEAY /* * 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(const 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); } #else /* defined(USE_SSLEAY) */ /* * Turns a 56 bit key into the 64 bit, odd parity key. Used by GnuTLS and NSS. */ static void extend_key_56_to_64(const unsigned char *key_56, char *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); } #if defined(USE_GNUTLS_NETTLE) static void setup_des_key(const unsigned char *key_56, struct des_ctx *des) { char key[8]; extend_key_56_to_64(key_56, key); des_set_key(des, (const uint8_t*)key); } #elif defined(USE_GNUTLS) /* * Turns a 56 bit key into the 64 bit, odd parity key and sets the key. */ static void setup_des_key(const unsigned char *key_56, gcry_cipher_hd_t *des) { char key[8]; extend_key_56_to_64(key_56, key); gcry_cipher_setkey(*des, key, 8); } #elif defined(USE_NSS) /* * Expands a 56 bit key KEY_56 to 64 bit and encrypts 64 bit of data, using * the expanded key. The caller is responsible for giving 64 bit of valid * data is IN and (at least) 64 bit large buffer as OUT. */ static bool encrypt_des(const unsigned char *in, unsigned char *out, const unsigned char *key_56) { const CK_MECHANISM_TYPE mech = CKM_DES_ECB; /* DES cipher in ECB mode */ PK11SlotInfo *slot = NULL; char key[8]; /* expanded 64 bit key */ SECItem key_item; PK11SymKey *symkey = NULL; SECItem *param = NULL; PK11Context *ctx = NULL; int out_len; /* not used, required by NSS */ bool rv = FALSE; /* use internal slot for DES encryption (requires NSS to be initialized) */ slot = PK11_GetInternalKeySlot(); if(!slot) return FALSE; /* expand the 56 bit key to 64 bit and wrap by NSS */ extend_key_56_to_64(key_56, key); key_item.data = (unsigned char *)key; key_item.len = /* hard-wired */ 8; symkey = PK11_ImportSymKey(slot, mech, PK11_OriginUnwrap, CKA_ENCRYPT, &key_item, NULL); if(!symkey) goto fail; /* create DES encryption context */ param = PK11_ParamFromIV(mech, /* no IV in ECB mode */ NULL); if(!param) goto fail; ctx = PK11_CreateContextBySymKey(mech, CKA_ENCRYPT, symkey, param); if(!ctx) goto fail; /* perform the encryption */ if(SECSuccess == PK11_CipherOp(ctx, out, &out_len, /* outbuflen */ 8, (unsigned char *)in, /* inbuflen */ 8) && SECSuccess == PK11_Finalize(ctx)) rv = /* all OK */ TRUE; fail: /* cleanup */ if(ctx) PK11_DestroyContext(ctx, PR_TRUE); if(symkey) PK11_FreeSymKey(symkey); if(param) SECITEM_FreeItem(param, PR_TRUE); PK11_FreeSlot(slot); return rv; } #elif defined(USE_DARWINSSL) static bool encrypt_des(const unsigned char *in, unsigned char *out, const unsigned char *key_56) { char key[8]; size_t out_len; CCCryptorStatus err; extend_key_56_to_64(key_56, key); err = CCCrypt(kCCEncrypt, kCCAlgorithmDES, kCCOptionECBMode, key, kCCKeySizeDES, NULL, in, 8 /* inbuflen */, out, 8 /* outbuflen */, &out_len); return err == kCCSuccess; } #endif /* defined(USE_DARWINSSL) */ #endif /* defined(USE_SSLEAY) */ /* * 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. */ void Curl_ntlm_core_lm_resp(const unsigned char *keys, const unsigned char *plaintext, unsigned char *results) { #ifdef USE_SSLEAY 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); #elif defined(USE_GNUTLS_NETTLE) struct des_ctx des; setup_des_key(keys, &des); des_encrypt(&des, 8, results, plaintext); setup_des_key(keys + 7, &des); des_encrypt(&des, 8, results + 8, plaintext); setup_des_key(keys + 14, &des); des_encrypt(&des, 8, results + 16, plaintext); #elif defined(USE_GNUTLS) gcry_cipher_hd_t des; gcry_cipher_open(&des, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0); setup_des_key(keys, &des); gcry_cipher_encrypt(des, results, 8, plaintext, 8); gcry_cipher_close(des); gcry_cipher_open(&des, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0); setup_des_key(keys + 7, &des); gcry_cipher_encrypt(des, results + 8, 8, plaintext, 8); gcry_cipher_close(des); gcry_cipher_open(&des, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0); setup_des_key(keys + 14, &des); gcry_cipher_encrypt(des, results + 16, 8, plaintext, 8); gcry_cipher_close(des); #elif defined(USE_NSS) || defined(USE_DARWINSSL) encrypt_des(plaintext, results, keys); encrypt_des(plaintext, results + 8, keys + 7); encrypt_des(plaintext, results + 16, keys + 14); #endif } /* * Set up lanmanager hashed password */ void Curl_ntlm_core_mk_lm_hash(struct SessionHandle *data, const char *password, unsigned char *lmbuffer /* 21 bytes */) { CURLcode res; unsigned char pw[14]; static const unsigned char magic[] = { 0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25 /* i.e. KGS!@#$% */ }; size_t len = CURLMIN(strlen(password), 14); Curl_strntoupper((char *)pw, password, len); memset(&pw[len], 0, 14 - len); /* * The LanManager hashed password needs to be created using the * password in the network encoding not the host encoding. */ res = Curl_convert_to_network(data, (char *)pw, 14); if(res) return; { /* Create LanManager hashed password. */ #ifdef USE_SSLEAY DES_key_schedule ks; setup_des_key(pw, DESKEY(ks)); DES_ecb_encrypt((DES_cblock *)magic, (DES_cblock *)lmbuffer, DESKEY(ks), DES_ENCRYPT); setup_des_key(pw + 7, DESKEY(ks)); DES_ecb_encrypt((DES_cblock *)magic, (DES_cblock *)(lmbuffer + 8), DESKEY(ks), DES_ENCRYPT); #elif defined(USE_GNUTLS_NETTLE) struct des_ctx des; setup_des_key(pw, &des); des_encrypt(&des, 8, lmbuffer, magic); setup_des_key(pw + 7, &des); des_encrypt(&des, 8, lmbuffer + 8, magic); #elif defined(USE_GNUTLS) gcry_cipher_hd_t des; gcry_cipher_open(&des, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0); setup_des_key(pw, &des); gcry_cipher_encrypt(des, lmbuffer, 8, magic, 8); gcry_cipher_close(des); gcry_cipher_open(&des, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0); setup_des_key(pw + 7, &des); gcry_cipher_encrypt(des, lmbuffer + 8, 8, magic, 8); gcry_cipher_close(des); #elif defined(USE_NSS) || defined(USE_DARWINSSL) encrypt_des(magic, lmbuffer, pw); encrypt_des(magic, lmbuffer + 8, pw + 7); #endif memset(lmbuffer + 16, 0, 21 - 16); } } #if USE_NTRESPONSES static void ascii_to_unicode_le(unsigned char *dest, const char *src, size_t srclen) { size_t i; for(i = 0; i < srclen; i++) { dest[2 * i] = (unsigned char)src[i]; dest[2 * i + 1] = '\0'; } } /* * Set up nt hashed passwords */ CURLcode Curl_ntlm_core_mk_nt_hash(struct SessionHandle *data, const char *password, unsigned char *ntbuffer /* 21 bytes */) { size_t len = strlen(password); unsigned char *pw = malloc(len * 2); CURLcode result; if(!pw) return CURLE_OUT_OF_MEMORY; ascii_to_unicode_le(pw, password, len); /* * The NT hashed password needs to be created using the password in the * network encoding not the host encoding. */ result = Curl_convert_to_network(data, (char *)pw, len * 2); if(result) return result; { /* Create NT hashed password. */ #ifdef USE_SSLEAY MD4_CTX MD4pw; MD4_Init(&MD4pw); MD4_Update(&MD4pw, pw, 2 * len); MD4_Final(ntbuffer, &MD4pw); #elif defined(USE_GNUTLS_NETTLE) struct md4_ctx MD4pw; md4_init(&MD4pw); md4_update(&MD4pw, (unsigned int)(2 * len), pw); md4_digest(&MD4pw, MD4_DIGEST_SIZE, ntbuffer); #elif defined(USE_GNUTLS) gcry_md_hd_t MD4pw; gcry_md_open(&MD4pw, GCRY_MD_MD4, 0); gcry_md_write(MD4pw, pw, 2 * len); memcpy (ntbuffer, gcry_md_read (MD4pw, 0), MD4_DIGEST_LENGTH); gcry_md_close(MD4pw); #elif defined(USE_NSS) Curl_md4it(ntbuffer, pw, 2 * len); #elif defined(USE_DARWINSSL) (void)CC_MD4(pw, (CC_LONG)(2 * len), ntbuffer); #endif memset(ntbuffer + 16, 0, 21 - 16); } free(pw); return CURLE_OK; } #endif /* USE_NTRESPONSES */ #endif /* USE_NTLM && !USE_WINDOWS_SSPI */ curl-7.35.0/lib/makefile.amiga0000644000175000017500000000062512213173003013012 00000000000000# # 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 include Makefile.inc OBJS = $(CSOURCES:.c=.o) all: $(OBJS) ar cru libcurl.a $(OBJS) ranlib libcurl.a install: $(INSTALL) -c ./libcurl.a /lib/libcurl.a curl-7.35.0/lib/netrc.c0000644000175000017500000001223712271241025011522 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_PWD_H #include #endif #include #include "netrc.h" #include "strequal.h" #include "strtok.h" #include "curl_memory.h" #include "rawstr.h" #define _MPRINTF_REPLACE /* use our functions only */ #include /* The last #include file should be: */ #include "memdebug.h" /* Get user and password from .netrc when given a machine name */ enum host_lookup_state { NOTHING, HOSTFOUND, /* the 'machine' keyword was found */ HOSTVALID /* this is "our" machine! */ }; /* * @unittest: 1304 * * *loginp and *passwordp MUST be allocated if they aren't NULL when passed * in. */ int Curl_parsenetrc(const char *host, char **loginp, char **passwordp, char *netrcfile) { FILE *file; int retcode=1; int specific_login = (**loginp != 0); bool netrc_alloc = FALSE; enum host_lookup_state 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" if(!netrcfile) { bool home_alloc = FALSE; char *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) { home = pw->pw_dir; } #endif } if(!home) return -1; netrcfile = curl_maprintf("%s%s%s", home, DIR_CHAR, NETRC); if(home_alloc) Curl_safefree(home); if(!netrcfile) { return -1; } netrc_alloc = TRUE; } file = fopen(netrcfile, "r"); if(netrc_alloc) Curl_safefree(netrcfile); if(file) { char *tok; char *tok_buf; bool done=FALSE; char netrcbuffer[256]; int netrcbuffsize = (int)sizeof(netrcbuffer); while(!done && fgets(netrcbuffer, netrcbuffsize, file)) { tok=strtok_r(netrcbuffer, " \t\n", &tok_buf); while(!done && tok) { if(**loginp && **passwordp) { done=TRUE; break; } switch(state) { case NOTHING: if(Curl_raw_equal("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(Curl_raw_equal(host, tok)) { /* and yes, this is our host! */ state=HOSTVALID; 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 = Curl_raw_equal(*loginp, tok); } else { free(*loginp); *loginp = strdup(tok); if(!*loginp) { retcode = -1; /* allocation failed */ goto out; } } state_login=0; } else if(state_password) { if(state_our_login || !specific_login) { free(*passwordp); *passwordp = strdup(tok); if(!*passwordp) { retcode = -1; /* allocation failed */ goto out; } } state_password=0; } else if(Curl_raw_equal("login", tok)) state_login=1; else if(Curl_raw_equal("password", tok)) state_password=1; else if(Curl_raw_equal("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() */ out: fclose(file); } return retcode; } curl-7.35.0/lib/README.pipelining0000644000175000017500000000341512213173003013252 00000000000000HTTP 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. curl-7.35.0/lib/imap.h0000644000175000017500000001004712262353672011353 00000000000000#ifndef HEADER_CURL_IMAP_H #define HEADER_CURL_IMAP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2009 - 2013, 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. * ***************************************************************************/ #include "pingpong.h" /**************************************************************************** * IMAP unique setup ***************************************************************************/ typedef enum { IMAP_STOP, /* do nothing state, stops the state machine */ IMAP_SERVERGREET, /* waiting for the initial greeting immediately after a connect */ IMAP_CAPABILITY, IMAP_STARTTLS, IMAP_UPGRADETLS, /* asynchronously upgrade the connection to SSL/TLS (multi mode only) */ IMAP_AUTHENTICATE_PLAIN, IMAP_AUTHENTICATE_LOGIN, IMAP_AUTHENTICATE_LOGIN_PASSWD, IMAP_AUTHENTICATE_CRAMMD5, IMAP_AUTHENTICATE_DIGESTMD5, IMAP_AUTHENTICATE_DIGESTMD5_RESP, IMAP_AUTHENTICATE_NTLM, IMAP_AUTHENTICATE_NTLM_TYPE2MSG, IMAP_AUTHENTICATE_XOAUTH2, IMAP_AUTHENTICATE_CANCEL, IMAP_AUTHENTICATE_FINAL, IMAP_LOGIN, IMAP_LIST, IMAP_SELECT, IMAP_FETCH, IMAP_FETCH_FINAL, IMAP_APPEND, IMAP_APPEND_FINAL, IMAP_LOGOUT, IMAP_LAST /* never used */ } imapstate; /* This IMAP struct is used in the SessionHandle. All IMAP data that is connection-oriented must be in imap_conn to properly deal with the fact that perhaps the SessionHandle is changed between the times the connection is used. */ struct IMAP { curl_pp_transfer transfer; char *mailbox; /* Mailbox to select */ char *uidvalidity; /* UIDVALIDITY to check in select */ char *uid; /* Message UID to fetch */ char *section; /* Message SECTION to fetch */ char *custom; /* Custom request */ char *custom_params; /* Parameters for the custom request */ }; /* imap_conn is used for struct connection-oriented data in the connectdata struct */ struct imap_conn { struct pingpong pp; imapstate state; /* Always use imap.c:state() to change state! */ bool ssldone; /* Is connect() over SSL done? */ unsigned int authmechs; /* Accepted authentication mechanisms */ unsigned int preftype; /* Preferred authentication type */ unsigned int prefmech; /* Preferred authentication mechanism */ unsigned int authused; /* Auth mechanism used for the connection */ int cmdid; /* Last used command ID */ char resptag[5]; /* Response tag to wait for */ bool tls_supported; /* StartTLS capability supported by server */ bool login_disabled; /* LOGIN command disabled by server */ bool ir_supported; /* Initial response supported by server */ char *mailbox; /* The last selected mailbox */ char *mailbox_uidvalidity; /* UIDVALIDITY parsed from select response */ }; extern const struct Curl_handler Curl_handler_imap; extern const struct Curl_handler Curl_handler_imaps; /* Authentication type flags */ #define IMAP_TYPE_CLEARTEXT (1 << 0) #define IMAP_TYPE_SASL (1 << 1) /* Authentication type values */ #define IMAP_TYPE_NONE 0 #define IMAP_TYPE_ANY ~0U #endif /* HEADER_CURL_IMAP_H */ curl-7.35.0/lib/libcurl.vers.in0000644000175000017500000000020212213173003013166 00000000000000HIDDEN { local: __*; _rest*; _save*; }; CURL_@CURL_LT_SHLIB_VERSIONED_FLAVOUR@4 { global: curl_*; local: *; }; curl-7.35.0/lib/strequal.h0000644000175000017500000000232612213173003012246 00000000000000#ifndef HEADER_CURL_STREQUAL_H #define HEADER_CURL_STREQUAL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include #define strequal(a,b) curl_strequal(a,b) #define strnequal(a,b,c) curl_strnequal(a,b,c) #endif /* HEADER_CURL_STREQUAL_H */ curl-7.35.0/lib/hash.h0000644000175000017500000000700112213173003011324 00000000000000#ifndef HEADER_CURL_HASH_H #define HEADER_CURL_HASH_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2007, 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. * ***************************************************************************/ #include "curl_setup.h" #include #include "llist.h" /* Hash function prototype */ typedef size_t (*hash_function) (void* key, size_t key_length, size_t slots_num); /* Comparator function prototype. Compares two keys. */ typedef size_t (*comp_function) (void* key1, size_t key1_len, void*key2, size_t key2_len); typedef void (*curl_hash_dtor)(void *); struct curl_hash { struct curl_llist **table; /* Hash function to be used for this hash table */ hash_function hash_func; /* Comparator function to compare keys */ comp_function comp_func; curl_hash_dtor dtor; int slots; size_t size; }; struct curl_hash_element { void *ptr; char *key; size_t key_len; }; struct curl_hash_iterator { struct curl_hash *hash; int slot_index; struct curl_llist_element *current_element; }; int Curl_hash_init(struct curl_hash *h, int slots, hash_function hfunc, comp_function comparator, curl_hash_dtor dtor); struct curl_hash *Curl_hash_alloc(int slots, hash_function hfunc, comp_function comparator, curl_hash_dtor dtor); void *Curl_hash_add(struct curl_hash *h, void *key, size_t key_len, void *p); int Curl_hash_delete(struct curl_hash *h, void *key, size_t key_len); void *Curl_hash_pick(struct curl_hash *, void * key, size_t key_len); void Curl_hash_apply(struct curl_hash *h, void *user, void (*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); size_t Curl_hash_str(void* key, size_t key_length, size_t slots_num); size_t Curl_str_key_compare(void*k1, size_t key1_len, void*k2, size_t key2_len); void Curl_hash_start_iterate(struct curl_hash *hash, struct curl_hash_iterator *iter); struct curl_hash_element * Curl_hash_next_element(struct curl_hash_iterator *iter); void Curl_hash_print(struct curl_hash *h, void (*func)(void *)); #endif /* HEADER_CURL_HASH_H */ curl-7.35.0/lib/md4.c0000644000175000017500000002037712213173003011073 00000000000000/*- Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD4 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. MD4 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 "curl_setup.h" /* NSS crypto library does not provide the MD4 hash algorithm, so that we have * a local implementation of it */ #ifdef USE_NSS #include "curl_md4.h" #include "warnless.h" typedef unsigned int UINT4; typedef struct MD4Context { UINT4 state[4]; /* state (ABCD) */ UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ } MD4_CTX; /* Constants for MD4Transform routine. */ #define S11 3 #define S12 7 #define S13 11 #define S14 19 #define S21 3 #define S22 5 #define S23 9 #define S24 13 #define S31 3 #define S32 9 #define S33 11 #define S34 15 static void MD4Transform(UINT4 [4], const unsigned char [64]); static void Encode(unsigned char *, UINT4 *, unsigned int); static void Decode(UINT4 *, const unsigned char *, unsigned int); static 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 and H are basic MD4 functions. */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) /* ROTATE_LEFT rotates x left n bits. */ #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) /* FF, GG and HH are transformations for rounds 1, 2 and 3 */ /* Rotation is separate from addition to prevent recomputation */ #define FF(a, b, c, d, x, s) { \ (a) += F ((b), (c), (d)) + (x); \ (a) = ROTATE_LEFT ((a), (s)); \ } #define GG(a, b, c, d, x, s) { \ (a) += G ((b), (c), (d)) + (x) + (UINT4)0x5a827999; \ (a) = ROTATE_LEFT ((a), (s)); \ } #define HH(a, b, c, d, x, s) { \ (a) += H ((b), (c), (d)) + (x) + (UINT4)0x6ed9eba1; \ (a) = ROTATE_LEFT ((a), (s)); \ } /* MD4 initialization. Begins an MD4 operation, writing a new context. */ static void MD4Init(MD4_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; } /* MD4 block update operation. Continues an MD4 message-digest operation, processing another message block, and updating the context. */ static void MD4Update(MD4_CTX *context, const unsigned char *input, unsigned int inputLen) { 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(&context->buffer[bufindex], input, partLen); MD4Transform (context->state, context->buffer); for(i = partLen; i + 63 < inputLen; i += 64) MD4Transform (context->state, &input[i]); bufindex = 0; } else i = 0; /* Buffer remaining input */ memcpy(&context->buffer[bufindex], &input[i], inputLen-i); } /* MD4 padding. */ static void MD4Pad(MD4_CTX *context) { unsigned char bits[8]; unsigned int bufindex, padLen; /* Save number of bits */ Encode (bits, context->count, 8); /* Pad out to 56 mod 64. */ bufindex = (unsigned int)((context->count[0] >> 3) & 0x3f); padLen = (bufindex < 56) ? (56 - bufindex) : (120 - bufindex); MD4Update (context, PADDING, padLen); /* Append length (before padding) */ MD4Update (context, bits, 8); } /* MD4 finalization. Ends an MD4 message-digest operation, writing the the message digest and zeroizing the context. */ static void MD4Final (unsigned char digest[16], MD4_CTX *context) { /* Do padding */ MD4Pad (context); /* Store state in digest */ Encode (digest, context->state, 16); /* Zeroize sensitive information. */ memset(context, 0, sizeof(*context)); } /* MD4 basic transformation. Transforms state based on block. */ static void MD4Transform (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); /* 1 */ FF (d, a, b, c, x[ 1], S12); /* 2 */ FF (c, d, a, b, x[ 2], S13); /* 3 */ FF (b, c, d, a, x[ 3], S14); /* 4 */ FF (a, b, c, d, x[ 4], S11); /* 5 */ FF (d, a, b, c, x[ 5], S12); /* 6 */ FF (c, d, a, b, x[ 6], S13); /* 7 */ FF (b, c, d, a, x[ 7], S14); /* 8 */ FF (a, b, c, d, x[ 8], S11); /* 9 */ FF (d, a, b, c, x[ 9], S12); /* 10 */ FF (c, d, a, b, x[10], S13); /* 11 */ FF (b, c, d, a, x[11], S14); /* 12 */ FF (a, b, c, d, x[12], S11); /* 13 */ FF (d, a, b, c, x[13], S12); /* 14 */ FF (c, d, a, b, x[14], S13); /* 15 */ FF (b, c, d, a, x[15], S14); /* 16 */ /* Round 2 */ GG (a, b, c, d, x[ 0], S21); /* 17 */ GG (d, a, b, c, x[ 4], S22); /* 18 */ GG (c, d, a, b, x[ 8], S23); /* 19 */ GG (b, c, d, a, x[12], S24); /* 20 */ GG (a, b, c, d, x[ 1], S21); /* 21 */ GG (d, a, b, c, x[ 5], S22); /* 22 */ GG (c, d, a, b, x[ 9], S23); /* 23 */ GG (b, c, d, a, x[13], S24); /* 24 */ GG (a, b, c, d, x[ 2], S21); /* 25 */ GG (d, a, b, c, x[ 6], S22); /* 26 */ GG (c, d, a, b, x[10], S23); /* 27 */ GG (b, c, d, a, x[14], S24); /* 28 */ GG (a, b, c, d, x[ 3], S21); /* 29 */ GG (d, a, b, c, x[ 7], S22); /* 30 */ GG (c, d, a, b, x[11], S23); /* 31 */ GG (b, c, d, a, x[15], S24); /* 32 */ /* Round 3 */ HH (a, b, c, d, x[ 0], S31); /* 33 */ HH (d, a, b, c, x[ 8], S32); /* 34 */ HH (c, d, a, b, x[ 4], S33); /* 35 */ HH (b, c, d, a, x[12], S34); /* 36 */ HH (a, b, c, d, x[ 2], S31); /* 37 */ HH (d, a, b, c, x[10], S32); /* 38 */ HH (c, d, a, b, x[ 6], S33); /* 39 */ HH (b, c, d, a, x[14], S34); /* 40 */ HH (a, b, c, d, x[ 1], S31); /* 41 */ HH (d, a, b, c, x[ 9], S32); /* 42 */ HH (c, d, a, b, x[ 5], S33); /* 43 */ HH (b, c, d, a, x[13], S34); /* 44 */ HH (a, b, c, d, x[ 3], S31); /* 45 */ HH (d, a, b, c, x[11], S32); /* 46 */ HH (c, d, a, b, x[ 7], S33); /* 47 */ HH (b, c, d, a, x[15], S34); /* 48 */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; /* Zeroize sensitive information. */ memset(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); } void Curl_md4it(unsigned char *output, const unsigned char *input, size_t len) { MD4_CTX ctx; MD4Init(&ctx); MD4Update(&ctx, input, curlx_uztoui(len)); MD4Final(output, &ctx); } #endif /* USE_NSS */ curl-7.35.0/lib/Makefile.Watcom0000644000175000017500000001233712262353672013151 00000000000000# # Watcom / OpenWatcom / Win32 makefile for libcurl. # G. Vanem # !ifndef %watcom !error WATCOM environment variable not set! !endif !ifdef %libname LIBNAME = $(%libname) !else LIBNAME = libcurl !endif TARGETS = $(LIBNAME).dll $(LIBNAME)_imp.lib $(LIBNAME).lib CC = wcc386 LD = wlink AR = wlib RC = wrc !ifdef __LOADDLL__ ! loaddll wcc386 wccd386 ! loaddll wpp386 wppd386 ! loaddll wlib wlibd ! if $(__VERSION__) > 1270 ! loaddll wlink wlinkd ! else ! loaddll wlink wlink ! endif !endif !ifdef __LINUX__ DS = / CP = cp MD = mkdir -p RD = rmdir -p RM = rm -f !else DS = $(X)\$(X) CP = copy 2>NUL MD = mkdir RD = rmdir /q /s 2>NUL !if $(__VERSION__) < 1250 RM = del /q /f 2>NUL !else RM = rm -f !endif !endif SYS_INCL = -I$(%watcom)$(DS)h$(DS)nt -I$(%watcom)$(DS)h SYS_LIBS = $(%watcom)$(DS)lib386$(DS)nt;$(%watcom)$(DS)lib386 CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm & -wcd=201 -bt=nt -d+ -dWIN32 -dCURL_WANTS_CA_BUNDLE_ENV & -dBUILDING_LIBCURL -dHAVE_SPNEGO=1 -I. -I..$(DS)include $(SYS_INCL) !ifdef %debug DEBUG = -dDEBUG=1 -dDEBUGBUILD CFLAGS += -d3 $(DEBUG) !else CFLAGS += -d0 !endif !ifdef %use_ipv6 CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6 !endif !ifdef %use_sspi CFLAGS += -dUSE_WINDOWS_SSPI !endif !ifdef %use_winidn CFLAGS += -dWINVER=0x0600 -dUSE_WIN32_IDN ! if $(__VERSION__) <= 1290 CFLAGS += -dWANT_IDN_PROTOTYPES ! endif !endif # # Change to suite. # !ifdef %zlib_root ZLIB_ROOT = $(%zlib_root) !else ZLIB_ROOT = ..$(DS)..$(DS)zlib-1.2.8 !endif !ifdef %libssh2_root LIBSSH2_ROOT = $(%libssh2_root) !else LIBSSH2_ROOT = ..$(DS)..$(DS)libssh2-1.4.3 !endif !ifdef %librtmp_root LIBRTMP_ROOT = $(%librtmp_root) !else LIBRTMP_ROOT = ..$(DS)..$(DS)rtmpdump-2.3 !endif !ifdef %openssl_root OPENSSL_ROOT = $(%openssl_root) !else OPENSSL_ROOT = ..$(DS)..$(DS)openssl-0.9.8y !endif !ifdef %ares_root ARES_ROOT = $(%ares_root) !else ARES_ROOT = ..$(DS)ares !endif !ifdef %use_zlib CFLAGS += -dHAVE_ZLIB_H -dHAVE_LIBZ -I$(ZLIB_ROOT) !endif !ifdef %use_rtmp CFLAGS += -dUSE_LIBRTMP -I$(LIBRTMP_ROOT) !endif !ifdef %use_ssh2 CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H -I$(LIBSSH2_ROOT)$(DS)include -I$(LIBSSH2_ROOT)$(DS)win32 !endif !ifdef %use_ssl CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_SSLEAY -I$(OPENSSL_ROOT)$(DS)inc32 !endif !ifdef %use_ares CFLAGS += -dUSE_ARES -I$(ARES_ROOT) !endif !ifdef %use_watt32 CFLAGS += -dUSE_WATT32 -I$(%watt_root)$(DS)inc !endif OBJ_BASE = WC_Win32.obj LINK_ARG = $(OBJ_BASE)$(DS)dyn$(DS)wlink.arg LIB_ARG = $(OBJ_BASE)$(DS)stat$(DS)wlib.arg # In order to process Makefile.inc wmake must be called with -u switch! !ifndef %MAKEFLAGS !error You MUST call wmake with the -u switch! !else !include Makefile.inc !endif OBJS = $(CSOURCES:.c=.obj) !ifdef __LINUX__ OBJS = $OBJ_DIR/$(OBJS: = $OBJ_DIR/) !else OBJS = $OBJ_DIR\$(OBJS: = $OBJ_DIR\) !endif # # Use $(OBJS) as a template to generate $(OBJS_STAT) and $(OBJS_DYN). # OBJ_DIR = $(OBJ_BASE)$(DS)stat OBJS_STAT = $+ $(OBJS) $- OBJ_DIR = $(OBJ_BASE)$(DS)dyn OBJS_DYN = $+ $(OBJS) $- CURLBUILDH = ..$(DS)include$(DS)curl$(DS)curlbuild.h RESOURCE = $(OBJ_BASE)$(DS)dyn$(DS)libcurl.res all: $(CURLBUILDH) $(OBJ_BASE) $(TARGETS) .SYMBOLIC @echo Welcome to libcurl clean: .SYMBOLIC -$(RM) $(OBJS_STAT) -$(RM) $(OBJS_DYN) -$(RM) $(RESOURCE) $(LINK_ARG) $(LIB_ARG) vclean distclean: clean .SYMBOLIC -$(RM) $(TARGETS) $(LIBNAME).map $(LIBNAME).sym -$(RD) $(OBJ_BASE)$(DS)stat -$(RD) $(OBJ_BASE)$(DS)dyn -$(RD) $(OBJ_BASE) $(OBJ_BASE): -$(MD) $^@ -$(MD) $^@$(DS)stat -$(MD) $^@$(DS)dyn $(CURLBUILDH): .EXISTSONLY $(CP) $^@.dist $^@ $(LIBNAME).dll: $(OBJS_DYN) $(RESOURCE) $(LINK_ARG) $(LD) name $^@ @$]@ $(LIBNAME).lib: $(OBJS_STAT) $(LIB_ARG) $(AR) -q -b -c $^@ @$]@ .ERASE $(RESOURCE): libcurl.rc $(RC) $(DEBUG) -q -r -zm -bt=nt -I..$(DS)include $(SYS_INCL) $[@ -fo=$^@ .ERASE .c{$(OBJ_BASE)$(DS)dyn}.obj: $(CC) $(CFLAGS) -bd -br $[@ -fo=$^@ .ERASE .c{$(OBJ_BASE)$(DS)stat}.obj: $(CC) $(CFLAGS) -DCURL_STATICLIB $[@ -fo=$^@ $(LINK_ARG): $(__MAKEFILES__) %create $^@ @%append $^@ system nt dll @%append $^@ file { $(OBJS_DYN) } !ifdef %debug @%append $^@ debug all @%append $^@ option symfile !endif @%append $^@ option quiet, map, caseexact, eliminate, implib=$(LIBNAME)_imp.lib, @%append $^@ res=$(RESOURCE) libpath $(SYS_LIBS) @%append $^@ library wldap32.lib !ifdef %use_watt32 @%append $^@ library $(%watt_root)$(DS)lib$(DS)wattcpw_imp.lib !else @%append $^@ library ws2_32.lib !endif !ifdef %use_zlib @%append $^@ library $(ZLIB_ROOT)$(DS)zlib.lib !endif !ifdef %use_rtmp @%append $^@ library $(LIBRTMP_ROOT)$(DS)librtmp$(DS)librtmp.lib !endif !ifdef %use_ssh2 @%append $^@ library $(LIBSSH2_ROOT)$(DS)win32$(DS)libssh2.lib !endif !ifdef %use_ssl @%append $^@ library $(OPENSSL_ROOT)$(DS)out32$(DS)libeay32.lib, $(OPENSSL_ROOT)$(DS)out32$(DS)ssleay32.lib !endif !ifdef %use_ares @%append $^@ library $(ARES_ROOT)$(DS)cares.lib !endif !ifdef %use_winidn ! if $(__VERSION__) > 1290 @%append $^@ library normaliz.lib ! else @%append $^@ import '_IdnToAscii@20' 'NORMALIZ.DLL'.'IdnToAscii' @%append $^@ import '_IdnToUnicode@20' 'NORMALIZ.DLL'.'IdnToUnicode' ! endif !endif $(LIB_ARG): $(__MAKEFILES__) %create $^@ @for %f in ($(OBJS_STAT)) do @%append $^@ +- %f curl-7.35.0/lib/strtoofft.h0000644000175000017500000000513312213173003012437 00000000000000#ifndef HEADER_CURL_STRTOOFFT_H #define HEADER_CURL_STRTOOFFT_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ #include "curl_setup.h" /* * Determine which string to integral data type conversion function we use * to implement string conversion to our curl_off_t integral data type. * * Notice that curl_off_t might be 64 or 32 bit wide, and that it might use * an underlying data type which might be 'long', 'int64_t', 'long long' or * '__int64' and more remotely other data types. * * On systems where the size of curl_off_t is greater than the size of 'long' * the conversion function to use is strtoll() if it is available, otherwise, * we emulate its functionality with our own clone. * * On systems where the size of curl_off_t is smaller or equal than the size * of 'long' the conversion function to use is strtol(). */ #if (CURL_SIZEOF_CURL_OFF_T > CURL_SIZEOF_LONG) # ifdef HAVE_STRTOLL # define curlx_strtoofft strtoll # else # if defined(_MSC_VER) && (_MSC_VER >= 1300) && (_INTEGRAL_MAX_BITS >= 64) _CRTIMP __int64 __cdecl _strtoi64(const char *, char **, int); # define curlx_strtoofft _strtoi64 # else curl_off_t curlx_strtoll(const char *nptr, char **endptr, int base); # define curlx_strtoofft curlx_strtoll # define NEED_CURL_STRTOLL 1 # endif # endif #else # define curlx_strtoofft strtol #endif #if (CURL_SIZEOF_CURL_OFF_T == 4) # define CURL_OFF_T_MAX CURL_OFF_T_C(0x7FFFFFFF) #else /* assume CURL_SIZEOF_CURL_OFF_T == 8 */ # define CURL_OFF_T_MAX CURL_OFF_T_C(0x7FFFFFFFFFFFFFFF) #endif #define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - CURL_OFF_T_C(1)) #endif /* HEADER_CURL_STRTOOFFT_H */ curl-7.35.0/lib/dict.c0000644000175000017500000001731512213173003011330 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_DICT #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #include "urldata.h" #include #include "transfer.h" #include "sendf.h" #include "progress.h" #include "strequal.h" #include "dict.h" #include "rawstr.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* * Forward declarations. */ static CURLcode dict_do(struct connectdata *conn, bool *done); /* * DICT protocol handler. */ const struct Curl_handler Curl_handler_dict = { "DICT", /* scheme */ ZERO_NULL, /* setup_connection */ dict_do, /* do_it */ ZERO_NULL, /* done */ ZERO_NULL, /* do_more */ ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_DICT, /* defport */ CURLPROTO_DICT, /* protocol */ PROTOPT_NONE | PROTOPT_NOURLQUERY /* flags */ }; static char *unescape_word(struct SessionHandle *data, const char *inputbuff) { char *newp; char *dictp; char *ptr; int len; char byte; int olen=0; newp = curl_easy_unescape(data, inputbuff, 0, &len); if(!newp) return NULL; dictp = malloc(((size_t)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 = *ptr) != 0; ptr++) { if((byte <= 32) || (byte == 127) || (byte == '\'') || (byte == '\"') || (byte == '\\')) { dictp[olen++] = '\\'; } dictp[olen++] = byte; } dictp[olen]=0; free(newp); } return dictp; } static CURLcode dict_do(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->state.path; curl_off_t *bytecount = &data->req.bytecount; *done = TRUE; /* unconditionally */ if(conn->bits.user_passwd) { /* AUTH is missing */ } if(Curl_raw_nequal(path, DICT_MATCH, sizeof(DICT_MATCH)-1) || Curl_raw_nequal(path, DICT_MATCH2, sizeof(DICT_MATCH2)-1) || Curl_raw_nequal(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)) { infof(data, "lookup word is missing\n"); word=(char *)"default"; } 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"); return result; } Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount, -1, NULL); /* no upload */ } else if(Curl_raw_nequal(path, DICT_DEFINE, sizeof(DICT_DEFINE)-1) || Curl_raw_nequal(path, DICT_DEFINE2, sizeof(DICT_DEFINE2)-1) || Curl_raw_nequal(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)) { infof(data, "lookup word is missing\n"); word=(char *)"default"; } 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"); return result; } Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount, -1, NULL); /* no upload */ } 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"); return result; } Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount, -1, NULL); } } return CURLE_OK; } #endif /*CURL_DISABLE_DICT*/ curl-7.35.0/lib/nwlib.c0000644000175000017500000002260012213173003011511 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef NETWARE /* Novell NetWare */ #ifdef __NOVELL_LIBC__ /* For native LibC-based NLM we need to register as a real lib. */ #include #include #include #include #include #include "curl_memory.h" /* The last #include file should be: */ #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 = 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 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 = 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); } } #else /* __NOVELL_LIBC__ */ /* For native CLib-based NLM seems we can do a bit more simple. */ #include int main ( void ) { /* initialize any globals here... */ /* do this if any global initializing was done SynchronizeStart(); */ ExitThread (TSR_THREAD, 0); return 0; } #endif /* __NOVELL_LIBC__ */ #else /* NETWARE */ #ifdef __POCC__ # pragma warn(disable:2024) /* Disable warning #2024: Empty input file */ #endif #endif /* NETWARE */ curl-7.35.0/lib/objnames-test10.sh0000755000175000017500000001263212213173003013511 00000000000000#!/bin/sh # *************************************************************************** # * _ _ ____ _ # * Project ___| | | | _ \| | # * / __| | | | |_) | | # * | (__| |_| | _ <| |___ # * \___|\___/|_| \_\_____| # * # * Copyright (C) 2013, 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. # * # *************************************************************************** # # This Bourne shell script file is used by test case 1221 to do # unit testing of curl_10char_object_name() shell function which # is defined in file objnames.inc and sourced by this file and # any other shell script that may use it. # # # argument validation # if test $# -eq 1; then : else echo "Usage: ${0} srcdir" exit 1 fi if test -f "${1}/runtests.pl"; then : else echo "${0}: Wrong srcdir" exit 1 fi srcdir=${1} if test -f "$srcdir/../lib/objnames.inc"; then : else echo "$0: Missing objnames.inc" exit 1 fi # # Some variables # logdir=log tstnum=1221 list_c=$logdir/${tstnum}_list_c list_obj=$logdir/${tstnum}_list_obj list_obj_c=$logdir/${tstnum}_list_obj_c list_obj_uniq=$logdir/${tstnum}_list_obj_uniq # # Source curl_10char_object_name() function definition # . $srcdir/../lib/objnames.inc # # Some curl_10char_object_name() unit tests # echo 'Testing curl_10char_object_name...' echo "" argstr=123__678__ABC__FGH__KLM__PQRSTUV expect=16AFKPQRST outstr=`curl_10char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123__678__ABC__FGH__KLM__PQ.S.UV expect=16AFKPQ outstr=`curl_10char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123__678__ABC..FGH..KLM..PQRSTUV expect=16ABC outstr=`curl_10char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123__678_.ABC._FGH__KLM__PQRSTUV expect=16 outstr=`curl_10char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123.567.90ABCDEFGHIJKLMNOPQRSTUV expect=123 outstr=`curl_10char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=1234567.90A.CDEFGHIJKLMNOPQRSTUV expect=1234567 outstr=`curl_10char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=1234567890.BCD.FGHIJKLMNOPQRSTUV expect=1234567890 outstr=`curl_10char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=12=45-78+0AB.DE.GHIJKLMNOPQRSTUV expect=1470AB outstr=`curl_10char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=1234567890ABCDEFGHIJKLMNOPQRSTUV expect=1234567890 outstr=`curl_10char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123_567_90A_CDE_GHIJKLMNOPQRSTUV expect=159CGHIJKL outstr=`curl_10char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123_567_90A_CDEFGHIJKLMNOPQRSTUV expect=159CDEFGHI outstr=`curl_10char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123_567_90ABCDEFGHIJKLMNOPQRSTUV expect=1590ABCDEF outstr=`curl_10char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123_567890ABCDEFGHIJKLMNOPQRSTUV expect=1567890ABC outstr=`curl_10char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=1234567890ABCDEFGHIJKLMNOPQRSTUV expect=1234567890 outstr=`curl_10char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" # # Verify that generated object name is distinct for # all *.c source files in lib and src subdirectories. # ls $srcdir/../lib/*.c > $list_c ls $srcdir/../src/*.c >> $list_c rm -f $list_obj for c_fname in `cat $list_c`; do obj_name=`curl_10char_object_name $c_fname` echo "$obj_name" >> $list_obj done sort -u $list_obj > $list_obj_uniq cnt_c=`cat $list_c | wc -l` cnt_u=`cat $list_obj_uniq | wc -l` echo "" echo "" echo "" if test $cnt_c -eq $cnt_u; then echo "10-characters-or-less generated object names are unique." obj_name_clash="no" else echo "10-characters-or-less generated object names are clashing..." obj_name_clash="yes" fi if test $obj_name_clash = "yes"; then # # Show clashing object names and respective source file names # echo "" paste $list_obj $list_c | sort > $list_obj_c prev_match="no" prev_line="unknown" prev_obj_name="unknown" while read this_line; do obj_name=`echo "$this_line" | cut -f1` if test "x$obj_name" = "x$prev_obj_name"; then if test "x$prev_match" != "xyes"; then echo "$prev_line" echo "$this_line" prev_match="yes" else echo "$this_line" fi else prev_match="no" fi prev_line=$this_line prev_obj_name=$obj_name done < $list_obj_c fi rm -f $list_c rm -f $list_obj rm -f $list_obj_c rm -f $list_obj_uniq # end of objnames-test10.sh curl-7.35.0/lib/rtsp.h0000644000175000017500000000446412213173003011403 00000000000000#ifndef HEADER_CURL_RTSP_H #define HEADER_CURL_RTSP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #ifndef CURL_DISABLE_RTSP extern const struct Curl_handler Curl_handler_rtsp; bool Curl_rtsp_connisdead(struct connectdata *check); CURLcode Curl_rtsp_parseheader(struct connectdata *conn, char *header); #else /* disabled */ #define Curl_rtsp_parseheader(x,y) CURLE_NOT_BUILT_IN #define Curl_rtsp_connisdead(x) TRUE #endif /* CURL_DISABLE_RTSP */ /* * RTSP Connection data * * Currently, only used for tracking incomplete RTP data reads */ struct rtsp_conn { char *rtp_buf; ssize_t rtp_bufsize; int rtp_channel; }; /**************************************************************************** * RTSP unique setup ***************************************************************************/ struct RTSP { /* * http_wrapper MUST be the first element of this structure for the wrap * logic to work. In this way, we get a cheap polymorphism because * &(data->state.proto.rtsp) == &(data->state.proto.http) per the C spec * * HTTP functions can safely treat this as an HTTP struct, but RTSP aware * functions can also index into the later elements. */ struct HTTP http_wrapper; /*wrap HTTP to do the heavy lifting */ long CSeq_sent; /* CSeq of this request */ long CSeq_recv; /* CSeq received */ }; #endif /* HEADER_CURL_RTSP_H */ curl-7.35.0/lib/sendf.c0000644000175000017500000004743412270035364011523 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #include #include "urldata.h" #include "sendf.h" #include "connect.h" #include "vtls/vtls.h" #include "ssh.h" #include "multiif.h" #include "non-ascii.h" #define _MPRINTF_REPLACE /* use the internal *printf() functions */ #include #include "curl_memory.h" #include "strerror.h" /* The last #include file should be: */ #include "memdebug.h" #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) { /* 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 */ memmove(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++; } 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[2048 + 1]; va_start(ap, fmt); vsnprintf(print_buffer, sizeof(print_buffer), 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; for(;;) { /* 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 data to the * server. Works with plain sockets, SCP, SSL or kerberos. * * If the write would block (CURLE_AGAIN), we return CURLE_OK and * (*written == 0). Otherwise we return regular CURLcode value. */ CURLcode Curl_write(struct connectdata *conn, curl_socket_t sockfd, const void *mem, size_t len, ssize_t *written) { ssize_t bytes_written; CURLcode curlcode = CURLE_OK; int num = (sockfd == conn->sock[SECONDARYSOCKET]); bytes_written = conn->send[num](conn, num, mem, len, &curlcode); *written = bytes_written; if(bytes_written >= 0) /* we completely ignore the curlcode value when subzero is not returned */ return CURLE_OK; /* handle CURLE_AGAIN or a send failure */ switch(curlcode) { case CURLE_AGAIN: *written = 0; return CURLE_OK; case CURLE_OK: /* general send failure */ return CURLE_SEND_ERROR; default: /* we got a specific curlcode, forward it */ return curlcode; } } ssize_t Curl_send_plain(struct connectdata *conn, int num, const void *mem, size_t len, CURLcode *code) { curl_socket_t sockfd = conn->sock[num]; ssize_t bytes_written = swrite(sockfd, mem, len); *code = CURLE_OK; if(-1 == bytes_written) { int err = SOCKERRNO; if( #ifdef WSAEWOULDBLOCK /* This is how Windows does it */ (WSAEWOULDBLOCK == err) #else /* 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; *code = CURLE_AGAIN; } else { failf(conn->data, "Send failure: %s", Curl_strerror(conn, err)); conn->data->state.os_errno = err; *code = CURLE_SEND_ERROR; } } return bytes_written; } /* * Curl_write_plain() is an internal write function that sends data to the * server using plain sockets only. Otherwise meant to have the exact same * proto as Curl_write() */ CURLcode Curl_write_plain(struct connectdata *conn, curl_socket_t sockfd, const void *mem, size_t len, ssize_t *written) { ssize_t bytes_written; CURLcode retcode; int num = (sockfd == conn->sock[SECONDARYSOCKET]); bytes_written = Curl_send_plain(conn, num, mem, len, &retcode); *written = bytes_written; return retcode; } ssize_t Curl_recv_plain(struct connectdata *conn, int num, char *buf, size_t len, CURLcode *code) { curl_socket_t sockfd = conn->sock[num]; ssize_t nread = sread(sockfd, buf, len); *code = CURLE_OK; if(-1 == nread) { int err = SOCKERRNO; if( #ifdef WSAEWOULDBLOCK /* This is how Windows does it */ (WSAEWOULDBLOCK == err) #else /* 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 */ *code = CURLE_AGAIN; } else { failf(conn->data, "Recv failure: %s", Curl_strerror(conn, err)); conn->data->state.os_errno = err; *code = CURLE_RECV_ERROR; } } return nread; } static CURLcode pausewrite(struct SessionHandle *data, int type, /* what type of data */ const char *ptr, size_t len) { /* signalled to pause sending on this connection, but since we have data we want to send we need to dup it to save a copy for when the sending is again enabled */ struct SingleRequest *k = &data->req; char *dupl = malloc(len); if(!dupl) return CURLE_OUT_OF_MEMORY; memcpy(dupl, ptr, len); /* store this information in the state struct for later use */ data->state.tempwrite = dupl; data->state.tempwritesize = len; data->state.tempwritetype = type; /* mark the connection as RECV paused */ k->keepon |= KEEP_RECV_PAUSE; DEBUGF(infof(data, "Pausing with %zu bytes in buffer for type %02x\n", len, type)); return CURLE_OK; } /* Curl_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. If CURL_DO_LINEEND_CONV is enabled, data is converted IN PLACE to the local character encoding. This is a problem and should be changed in the future to leave the original data alone. */ CURLcode Curl_client_write(struct connectdata *conn, int type, char *ptr, size_t len) { struct SessionHandle *data = conn->data; size_t wrote; if(0 == len) len = strlen(ptr); /* If reading is actually paused, we're forced to append this chunk of data to the already held data, but only if it is the same type as otherwise it can't work and it'll return error instead. */ if(data->req.keepon & KEEP_RECV_PAUSE) { size_t newlen; char *newptr; if(type != data->state.tempwritetype) /* major internal confusion */ return CURLE_RECV_ERROR; DEBUGASSERT(data->state.tempwrite); /* figure out the new size of the data to save */ newlen = len + data->state.tempwritesize; /* allocate the new memory area */ newptr = realloc(data->state.tempwrite, newlen); if(!newptr) return CURLE_OUT_OF_MEMORY; /* copy the new data to the end of the new area */ memcpy(newptr + data->state.tempwritesize, ptr, len); /* update the pointer and the size */ data->state.tempwrite = newptr; data->state.tempwritesize = newlen; return CURLE_OK; } if(type & CLIENTWRITE_BODY) { if((conn->handler->protocol&CURLPROTO_FTP) && conn->proto.ftpc.transfertype == 'A') { /* convert from the network encoding */ CURLcode rc = Curl_convert_from_network(data, ptr, len); /* Curl_convert_from_network calls failf if unsuccessful */ if(rc) return rc; #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_func(ptr, 1, len, data->set.out); } else { wrote = len; } if(CURL_WRITEFUNC_PAUSE == wrote) { if(conn->handler->flags & PROTOPT_NONETWORK) { /* Protocols that work without network cannot be paused. This is actually only FILE:// just now, and it can't pause since the transfer isn't done using the "normal" procedure. */ failf(data, "Write callback asked for PAUSE when not supported!"); return CURLE_WRITE_ERROR; } else return pausewrite(data, type, ptr, len); } else if(wrote != len) { failf(data, "Failed writing body (%zu != %zu)", wrote, len); 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_func; /* 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(CURL_WRITEFUNC_PAUSE == wrote) /* here we pass in the HEADER bit only since if this was body as well then it was passed already and clearly that didn't trigger the pause, so this is saved for later with the HEADER bit only */ return pausewrite(data, CLIENTWRITE_HEADER, ptr, len); if(wrote != len) { failf (data, "Failed writing header"); return CURLE_WRITE_ERROR; } } return CURLE_OK; } CURLcode Curl_read_plain(curl_socket_t sockfd, char *buf, size_t bytesfromsocket, ssize_t *n) { ssize_t nread = sread(sockfd, buf, bytesfromsocket); if(-1 == nread) { int err = SOCKERRNO; #ifdef USE_WINSOCK if(WSAEWOULDBLOCK == err) #else if((EWOULDBLOCK == err) || (EAGAIN == err) || (EINTR == err)) #endif return CURLE_AGAIN; else return CURLE_RECV_ERROR; } /* we only return number of bytes read when we return OK */ *n = nread; return CURLE_OK; } /* * Internal read-from-socket function. This is meant to deal with plain * sockets, SSL sockets and kerberos sockets. * * Returns a regular CURLcode value. */ CURLcode 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 */ { CURLcode curlcode = CURLE_RECV_ERROR; ssize_t nread = 0; size_t bytesfromsocket = 0; char *buffertofill = NULL; bool pipelining = Curl_multi_pipeline_enabled(conn->data->multi); /* 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 */ /* If session can pipeline, check connection buffer */ if(pipelining) { size_t bytestocopy = CURLMIN(conn->buf_len - conn->read_pos, sizerequested); /* 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 = CURLMIN(sizerequested, BUFSIZE * sizeof (char)); buffertofill = conn->master_buffer; } else { bytesfromsocket = CURLMIN((long)sizerequested, conn->data->set.buffer_size ? conn->data->set.buffer_size : BUFSIZE); buffertofill = buf; } nread = conn->recv[num](conn, num, buffertofill, bytesfromsocket, &curlcode); if(nread < 0) return curlcode; if(pipelining) { 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 s_infotype[CURLINFO_END][3] = { "* ", "< ", "> ", "{ ", "} ", "{ ", "} " }; #ifdef CURL_DOES_CONVERSIONS char buf[BUFSIZE+1]; size_t conv_size = 0; 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'; } conv_size = size; memcpy(buf, ptr, size); /* Special processing is needed for this block if it * contains both headers and data (separated by CRLFCRLF). * We want to convert just the headers, leaving the data as-is. */ if(size > 4) { size_t i; for(i = 0; i < size-4; i++) { if(memcmp(&buf[i], "\x0d\x0a\x0d\x0a", 4) == 0) { /* convert everything through this CRLFCRLF but no further */ conv_size = i + 4; break; } } } Curl_convert_from_network(data, buf, conv_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); #ifdef CURL_DOES_CONVERSIONS if(size != conv_size) { /* we had untranslated data so we need an explicit newline */ fwrite("\n", 1, 1, data->set.err); } #endif 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; } curl-7.35.0/lib/speedcheck.h0000644000175000017500000000245612213173003012510 00000000000000#ifndef HEADER_CURL_SPEEDCHECK_H #define HEADER_CURL_SPEEDCHECK_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ #include "curl_setup.h" #include "timeval.h" void Curl_speedinit(struct SessionHandle *data); CURLcode Curl_speedcheck(struct SessionHandle *data, struct timeval now); #endif /* HEADER_CURL_SPEEDCHECK_H */ curl-7.35.0/lib/hostcheck.c0000644000175000017500000000660112262353672012374 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(USE_SSLEAY) || defined(USE_AXTLS) || defined(USE_QSOSSL) || \ defined(USE_GSKIT) || defined(USE_NSS) /* these backends use functions from this file */ #include "hostcheck.h" #include "rawstr.h" /* * Match a hostname against a wildcard pattern. * E.g. * "foo.host.com" matches "*.host.com". * * We use the matching rule described in RFC6125, section 6.4.3. * http://tools.ietf.org/html/rfc6125#section-6.4.3 */ static int hostmatch(const char *hostname, const char *pattern) { const char *pattern_label_end, *pattern_wildcard, *hostname_label_end; int wildcard_enabled; size_t prefixlen, suffixlen; pattern_wildcard = strchr(pattern, '*'); if(pattern_wildcard == NULL) return Curl_raw_equal(pattern, hostname) ? CURL_HOST_MATCH : CURL_HOST_NOMATCH; /* We require at least 2 dots in pattern to avoid too wide wildcard match. */ wildcard_enabled = 1; pattern_label_end = strchr(pattern, '.'); if(pattern_label_end == NULL || strchr(pattern_label_end+1, '.') == NULL || pattern_wildcard > pattern_label_end || Curl_raw_nequal(pattern, "xn--", 4)) { wildcard_enabled = 0; } if(!wildcard_enabled) return Curl_raw_equal(pattern, hostname) ? CURL_HOST_MATCH : CURL_HOST_NOMATCH; hostname_label_end = strchr(hostname, '.'); if(hostname_label_end == NULL || !Curl_raw_equal(pattern_label_end, hostname_label_end)) return CURL_HOST_NOMATCH; /* The wildcard must match at least one character, so the left-most label of the hostname is at least as large as the left-most label of the pattern. */ if(hostname_label_end - hostname < pattern_label_end - pattern) return CURL_HOST_NOMATCH; prefixlen = pattern_wildcard - pattern; suffixlen = pattern_label_end - (pattern_wildcard+1); return Curl_raw_nequal(pattern, hostname, prefixlen) && Curl_raw_nequal(pattern_wildcard+1, hostname_label_end - suffixlen, suffixlen) ? CURL_HOST_MATCH : CURL_HOST_NOMATCH; } int Curl_cert_hostcheck(const char *match_pattern, const char *hostname) { if(!match_pattern || !*match_pattern || !hostname || !*hostname) /* sanity check */ return 0; if(Curl_raw_equal(hostname, match_pattern)) /* trivial case */ return 1; if(hostmatch(hostname,match_pattern) == CURL_HOST_MATCH) return 1; return 0; } #endif /* SSLEAY or AXTLS or QSOSSL or GSKIT or NSS */ curl-7.35.0/lib/connect.c0000644000175000017500000011471012272025072012042 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include /* may need it */ #endif #ifdef HAVE_SYS_UN_H #include /* for sockaddr_un */ #endif #ifdef HAVE_NETINET_TCP_H #include /* for TCP_NODELAY */ #endif #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_FCNTL_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #if (defined(HAVE_IOCTL_FIONBIO) && defined(NETWARE)) #include #endif #ifdef NETWARE #undef in_addr_t #define in_addr_t unsigned long #endif #ifdef __VMS #include #include #endif #define _MPRINTF_REPLACE /* use our functions only */ #include #include "urldata.h" #include "sendf.h" #include "if2ip.h" #include "strerror.h" #include "connect.h" #include "curl_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" #include "inet_pton.h" #include "vtls/vtls.h" /* for Curl_ssl_check_cxn() */ #include "progress.h" #include "warnless.h" #include "conncache.h" #include "multihandle.h" /* The last #include file should be: */ #include "memdebug.h" #ifdef __SYMBIAN32__ /* This isn't actually supported under Symbian OS */ #undef SO_NOSIGPIPE #endif static bool verifyconnect(curl_socket_t sockfd, int *error); #if defined(__DragonFly__) || defined(HAVE_WINSOCK_H) /* DragonFlyBSD and Windows use millisecond units */ #define KEEPALIVE_FACTOR(x) (x *= 1000) #else #define KEEPALIVE_FACTOR(x) #endif #if defined(HAVE_WINSOCK_H) && !defined(SIO_KEEPALIVE_VALS) #define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR,4) struct tcp_keepalive { u_long onoff; u_long keepalivetime; u_long keepaliveinterval; }; #endif static void tcpkeepalive(struct SessionHandle *data, curl_socket_t sockfd) { int optval = data->set.tcp_keepalive?1:0; /* only set IDLE and INTVL if setting KEEPALIVE is successful */ if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, (void *)&optval, sizeof(optval)) < 0) { infof(data, "Failed to set SO_KEEPALIVE on fd %d\n", sockfd); } else { #if defined(SIO_KEEPALIVE_VALS) struct tcp_keepalive vals; DWORD dummy; vals.onoff = 1; optval = curlx_sltosi(data->set.tcp_keepidle); KEEPALIVE_FACTOR(optval); vals.keepalivetime = optval; optval = curlx_sltosi(data->set.tcp_keepintvl); KEEPALIVE_FACTOR(optval); vals.keepaliveinterval = optval; if(WSAIoctl(sockfd, SIO_KEEPALIVE_VALS, (LPVOID) &vals, sizeof(vals), NULL, 0, &dummy, NULL, NULL) != 0) { infof(data, "Failed to set SIO_KEEPALIVE_VALS on fd %d: %d\n", (int)sockfd, WSAGetLastError()); } #else #ifdef TCP_KEEPIDLE optval = curlx_sltosi(data->set.tcp_keepidle); KEEPALIVE_FACTOR(optval); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE, (void *)&optval, sizeof(optval)) < 0) { infof(data, "Failed to set TCP_KEEPIDLE on fd %d\n", sockfd); } #endif #ifdef TCP_KEEPINTVL optval = curlx_sltosi(data->set.tcp_keepintvl); KEEPALIVE_FACTOR(optval); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL, (void *)&optval, sizeof(optval)) < 0) { infof(data, "Failed to set TCP_KEEPINTVL on fd %d\n", sockfd); } #endif #ifdef TCP_KEEPALIVE /* Mac OS X style */ optval = curlx_sltosi(data->set.tcp_keepidle); KEEPALIVE_FACTOR(optval); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE, (void *)&optval, sizeof(optval)) < 0) { infof(data, "Failed to set TCP_KEEPALIVE on fd %d\n", sockfd); } #endif #endif } } static CURLcode singleipconnect(struct connectdata *conn, const Curl_addrinfo *ai, /* start connecting to this */ curl_socket_t *sock); /* * Curl_timeleft() returns the amount of milliseconds left allowed for the * transfer/connection. If the value is negative, the timeout time has already * elapsed. * * The start time is stored in progress.t_startsingle - as set with * Curl_pgrsTime(..., TIMER_STARTSINGLE); * * If 'nowp' is non-NULL, it points to the current time. * 'duringconnect' is FALSE if not during a connect, as then of course the * connect timeout is not taken into account! * * @unittest: 1303 */ long Curl_timeleft(struct SessionHandle *data, struct timeval *nowp, bool duringconnect) { int timeout_set = 0; long timeout_ms = duringconnect?DEFAULT_CONNECT_TIMEOUT:0; struct timeval now; /* if a timeout is set, use the most restrictive one */ if(data->set.timeout > 0) timeout_set |= 1; if(duringconnect && (data->set.connecttimeout > 0)) timeout_set |= 2; switch (timeout_set) { case 1: timeout_ms = data->set.timeout; break; case 2: timeout_ms = data->set.connecttimeout; break; case 3: if(data->set.timeout < data->set.connecttimeout) timeout_ms = data->set.timeout; else timeout_ms = data->set.connecttimeout; break; default: /* use the default */ if(!duringconnect) /* if we're not during connect, there's no default timeout so if we're at zero we better just return zero and not make it a negative number by the math below */ return 0; break; } if(!nowp) { now = Curl_tvnow(); nowp = &now; } /* subtract elapsed time */ timeout_ms -= Curl_tvdiff(*nowp, data->progress.t_startsingle); if(!timeout_ms) /* avoid returning 0 as that means no timeout! */ return -1; return timeout_ms; } static CURLcode bindlocal(struct connectdata *conn, curl_socket_t sockfd, int af) { struct SessionHandle *data = conn->data; struct Curl_sockaddr_storage sa; struct sockaddr *sock = (struct sockaddr *)&sa; /* bind to this address */ curl_socklen_t sizeof_sa = 0; /* size of the data sock points to */ struct sockaddr_in *si4 = (struct sockaddr_in *)&sa; #ifdef ENABLE_IPV6 struct sockaddr_in6 *si6 = (struct sockaddr_in6 *)&sa; #endif struct Curl_dns_entry *h=NULL; 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; const char *dev = data->set.str[STRING_DEVICE]; int error; char myhost[256] = ""; int done = 0; /* -1 for error, 1 for address found */ bool is_interface = FALSE; bool is_host = FALSE; static const char *if_prefix = "if!"; static const char *host_prefix = "host!"; /************************************************************* * Select device to bind socket to *************************************************************/ if(!dev && !port) /* no local kind of binding was requested */ return CURLE_OK; memset(&sa, 0, sizeof(struct Curl_sockaddr_storage)); if(dev && (strlen(dev)<255) ) { if(strncmp(if_prefix, dev, strlen(if_prefix)) == 0) { dev += strlen(if_prefix); is_interface = TRUE; } else if(strncmp(host_prefix, dev, strlen(host_prefix)) == 0) { dev += strlen(host_prefix); is_host = TRUE; } /* interface */ if(!is_host) { switch(Curl_if2ip(af, conn->scope, dev, myhost, sizeof(myhost))) { case IF2IP_NOT_FOUND: if(is_interface) { /* Do not fall back to treating it as a host name */ failf(data, "Couldn't bind to interface '%s'", dev); return CURLE_INTERFACE_FAILED; } break; case IF2IP_AF_NOT_SUPPORTED: /* Signal the caller to try another address family if available */ return CURLE_UNSUPPORTED_PROTOCOL; case IF2IP_FOUND: is_interface = TRUE; /* * We now have the numerical IP address in the 'myhost' buffer */ infof(data, "Local Interface %s is ip %s using address family %i\n", dev, myhost, af); done = 1; #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. * * * Only bind to the interface when specified as interface, not just * as a hostname or ip address. */ if(setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, dev, (curl_socklen_t)strlen(dev)+1) != 0) { error = SOCKERRNO; infof(data, "SO_BINDTODEVICE %s failed with errno %d: %s;" " will do regular bind\n", dev, error, Curl_strerror(conn, error)); /* This is typically "errno 1, error: Operation not permitted" if you're not running as root or another suitable privileged user */ } #endif break; } } if(!is_interface) { /* * This was not an interface, resolve the name as a host name * or IP number * * Temporarily force name resolution to use only the address type * of the connection. The resolve functions should really be changed * to take a type parameter instead. */ long ipver = conn->ip_version; int rc; if(af == AF_INET) conn->ip_version = CURL_IPRESOLVE_V4; #ifdef ENABLE_IPV6 else if(af == AF_INET6) conn->ip_version = CURL_IPRESOLVE_V6; #endif rc = Curl_resolv(conn, dev, 0, &h); if(rc == CURLRESOLV_PENDING) (void)Curl_resolver_wait_resolv(conn, &h); conn->ip_version = ipver; if(h) { /* convert the resolved address, sizeof myhost >= INET_ADDRSTRLEN */ Curl_printable_address(h->addr, myhost, sizeof(myhost)); infof(data, "Name '%s' family %i resolved to '%s' family %i\n", dev, af, myhost, h->addr->ai_family); Curl_resolv_unlock(data, h); done = 1; } else { /* * provided dev was no interface (or interfaces are not supported * e.g. solaris) no ip address and no domain we fail here */ done = -1; } } if(done > 0) { #ifdef ENABLE_IPV6 /* ipv6 address */ if(af == AF_INET6) { #ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID char *scope_ptr = strchr(myhost, '%'); if(scope_ptr) *(scope_ptr++) = 0; #endif if(Curl_inet_pton(AF_INET6, myhost, &si6->sin6_addr) > 0) { si6->sin6_family = AF_INET6; si6->sin6_port = htons(port); #ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID if(scope_ptr) /* The "myhost" string either comes from Curl_if2ip or from Curl_printable_address. The latter returns only numeric scope IDs and the former returns none at all. So the scope ID, if present, is known to be numeric */ si6->sin6_scope_id = atoi(scope_ptr); #endif } sizeof_sa = sizeof(struct sockaddr_in6); } else #endif /* ipv4 address */ if((af == AF_INET) && (Curl_inet_pton(AF_INET, myhost, &si4->sin_addr) > 0)) { si4->sin_family = AF_INET; si4->sin_port = htons(port); sizeof_sa = sizeof(struct sockaddr_in); } } if(done < 1) { failf(data, "Couldn't bind to '%s'", dev); return CURLE_INTERFACE_FAILED; } } else { /* no device was given, prepare sa to match af's needs */ #ifdef ENABLE_IPV6 if(af == AF_INET6) { si6->sin6_family = AF_INET6; si6->sin6_port = htons(port); sizeof_sa = sizeof(struct sockaddr_in6); } else #endif if(af == AF_INET) { si4->sin_family = AF_INET; si4->sin_port = htons(port); sizeof_sa = sizeof(struct sockaddr_in); } } for(;;) { if(bind(sockfd, sock, sizeof_sa) >= 0) { /* we succeeded to bind */ struct Curl_sockaddr_storage add; curl_socklen_t size = sizeof(add); memset(&add, 0, sizeof(struct Curl_sockaddr_storage)); if(getsockname(sockfd, (struct sockaddr *) &add, &size) < 0) { data->state.os_errno = error = SOCKERRNO; failf(data, "getsockname() failed with errno %d: %s", error, Curl_strerror(conn, error)); return CURLE_INTERFACE_FAILED; } infof(data, "Local port: %hu\n", port); conn->bits.bound = TRUE; return CURLE_OK; } if(--portnum > 0) { infof(data, "Bind to local port %hu failed, trying next\n", port); port++; /* try next port */ /* We re-use/clobber the port variable here below */ if(sock->sa_family == AF_INET) si4->sin_port = ntohs(port); #ifdef ENABLE_IPV6 else si6->sin6_port = ntohs(port); #endif } else break; } data->state.os_errno = error = SOCKERRNO; failf(data, "bind failed with errno %d: %s", error, Curl_strerror(conn, error)); return CURLE_INTERFACE_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; curl_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(0 != getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void *)&err, &errSize)) err = SOCKERRNO; #ifdef _WIN32_WCE /* Old WinCE versions don't support SO_ERROR */ if(WSAENOPROTOOPT == err) { SET_SOCKERRNO(0); err = 0; } #endif #ifdef __minix /* Minix 3.1.x doesn't support getsockopt on UDP sockets */ if(EBADIOCTL == err) { SET_SOCKERRNO(0); 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 = SOCKERRNO; #endif return rc; } /* Used within the multi interface. Try next IP address, return TRUE if no more address exists or error */ static CURLcode trynextip(struct connectdata *conn, int sockindex, int tempindex) { CURLcode rc = CURLE_COULDNT_CONNECT; /* First clean up after the failed socket. Don't close it yet to ensure that the next IP's socket gets a different file descriptor, which can prevent bugs when the curl_multi_socket_action interface is used with certain select() replacements such as kqueue. */ curl_socket_t fd_to_close = conn->tempsock[tempindex]; conn->tempsock[tempindex] = CURL_SOCKET_BAD; if(sockindex == FIRSTSOCKET) { Curl_addrinfo *ai; int family; if(conn->tempaddr[tempindex]) { /* find next address in the same protocol family */ family = conn->tempaddr[tempindex]->ai_family; ai = conn->tempaddr[tempindex]->ai_next; } else { /* happy eyeballs - try the other protocol family */ int firstfamily = conn->tempaddr[0]->ai_family; #ifdef ENABLE_IPV6 family = (firstfamily == AF_INET) ? AF_INET6 : AF_INET; #else family = firstfamily; #endif ai = conn->tempaddr[0]->ai_next; } while(ai) { while(ai && ai->ai_family != family) ai = ai->ai_next; if(ai) { rc = singleipconnect(conn, ai, &conn->tempsock[tempindex]); conn->tempaddr[tempindex] = ai; if(rc == CURLE_COULDNT_CONNECT) { ai = ai->ai_next; continue; } } break; } } if(fd_to_close != CURL_SOCKET_BAD) Curl_closesocket(conn, fd_to_close); return rc; } /* Copies connection info into the session handle to make it available when the session handle is no longer associated with a connection. */ void Curl_persistconninfo(struct connectdata *conn) { memcpy(conn->data->info.conn_primary_ip, conn->primary_ip, MAX_IPADR_LEN); memcpy(conn->data->info.conn_local_ip, conn->local_ip, MAX_IPADR_LEN); conn->data->info.conn_primary_port = conn->primary_port; conn->data->info.conn_local_port = conn->local_port; } /* retrieves ip address and port from a sockaddr structure */ static bool getaddressinfo(struct sockaddr* sa, char* addr, long* port) { unsigned short us_port; struct sockaddr_in* si = NULL; #ifdef ENABLE_IPV6 struct sockaddr_in6* si6 = NULL; #endif #if defined(HAVE_SYS_UN_H) && defined(AF_UNIX) struct sockaddr_un* su = NULL; #endif switch (sa->sa_family) { case AF_INET: si = (struct sockaddr_in*) sa; if(Curl_inet_ntop(sa->sa_family, &si->sin_addr, addr, MAX_IPADR_LEN)) { us_port = ntohs(si->sin_port); *port = us_port; return TRUE; } break; #ifdef ENABLE_IPV6 case AF_INET6: si6 = (struct sockaddr_in6*)sa; if(Curl_inet_ntop(sa->sa_family, &si6->sin6_addr, addr, MAX_IPADR_LEN)) { us_port = ntohs(si6->sin6_port); *port = us_port; return TRUE; } break; #endif #if defined(HAVE_SYS_UN_H) && defined(AF_UNIX) case AF_UNIX: su = (struct sockaddr_un*)sa; snprintf(addr, MAX_IPADR_LEN, "%s", su->sun_path); *port = 0; return TRUE; #endif default: break; } addr[0] = '\0'; *port = 0; return FALSE; } /* retrieves the start/end point information of a socket of an established connection */ void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd) { int error; curl_socklen_t len; struct Curl_sockaddr_storage ssrem; struct Curl_sockaddr_storage ssloc; struct SessionHandle *data = conn->data; if(conn->socktype == SOCK_DGRAM) /* there's no connection! */ return; if(!conn->bits.reuse) { len = sizeof(struct Curl_sockaddr_storage); if(getpeername(sockfd, (struct sockaddr*) &ssrem, &len)) { error = SOCKERRNO; failf(data, "getpeername() failed with errno %d: %s", error, Curl_strerror(conn, error)); return; } len = sizeof(struct Curl_sockaddr_storage); if(getsockname(sockfd, (struct sockaddr*) &ssloc, &len)) { error = SOCKERRNO; failf(data, "getsockname() failed with errno %d: %s", error, Curl_strerror(conn, error)); return; } if(!getaddressinfo((struct sockaddr*)&ssrem, conn->primary_ip, &conn->primary_port)) { error = ERRNO; failf(data, "ssrem inet_ntop() failed with errno %d: %s", error, Curl_strerror(conn, error)); return; } memcpy(conn->ip_addr_str, conn->primary_ip, MAX_IPADR_LEN); if(!getaddressinfo((struct sockaddr*)&ssloc, conn->local_ip, &conn->local_port)) { error = ERRNO; failf(data, "ssloc inet_ntop() failed with errno %d: %s", error, Curl_strerror(conn, error)); return; } } /* persist connection info in session handle */ Curl_persistconninfo(conn); } /* * Curl_is_connected() checks if the socket has connected. */ CURLcode Curl_is_connected(struct connectdata *conn, int sockindex, bool *connected) { struct SessionHandle *data = conn->data; CURLcode code = CURLE_OK; long allow; int error = 0; struct timeval now; int result; int i; DEBUGASSERT(sockindex >= FIRSTSOCKET && sockindex <= SECONDARYSOCKET); *connected = FALSE; /* a very negative world view is best */ if(conn->bits.tcpconnect[sockindex]) { /* we are connected already! */ *connected = TRUE; return CURLE_OK; } now = Curl_tvnow(); /* figure out how long time we have left to connect */ allow = Curl_timeleft(data, &now, TRUE); if(allow < 0) { /* time-out, bail out, go home */ failf(data, "Connection time-out"); return CURLE_OPERATION_TIMEDOUT; } for(i=0; i<2; i++) { if(conn->tempsock[i] == CURL_SOCKET_BAD) continue; #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(conn->tempsock[i], NULL); #endif /* check socket for connect */ result = Curl_socket_ready(CURL_SOCKET_BAD, conn->tempsock[i], 0); if(result == 0) { /* no connection yet */ if(curlx_tvdiff(now, conn->connecttime) >= conn->timeoutms_per_addr) { infof(data, "After %ldms connect time, move on!\n", conn->timeoutms_per_addr); error = ETIMEDOUT; } /* should we try another protocol family? */ if(i == 0 && conn->tempaddr[1] == NULL && curlx_tvdiff(now, conn->connecttime) >= HAPPY_EYEBALLS_TIMEOUT) { trynextip(conn, sockindex, 1); } } else if(result == CURL_CSELECT_OUT) { if(verifyconnect(conn->tempsock[i], &error)) { /* we are connected with TCP, awesome! */ int other = i ^ 1; /* use this socket from now on */ conn->sock[sockindex] = conn->tempsock[i]; conn->ip_addr = conn->tempaddr[i]; conn->tempsock[i] = CURL_SOCKET_BAD; /* close the other socket, if open */ if(conn->tempsock[other] != CURL_SOCKET_BAD) { Curl_closesocket(conn, conn->tempsock[other]); conn->tempsock[other] = CURL_SOCKET_BAD; } /* see if we need to do any proxy magic first once we connected */ code = Curl_connected_proxy(conn, sockindex); if(code) return code; conn->bits.tcpconnect[sockindex] = TRUE; *connected = TRUE; if(sockindex == FIRSTSOCKET) Curl_pgrsTime(data, TIMER_CONNECT); /* connect done */ Curl_updateconninfo(conn, conn->sock[sockindex]); Curl_verboseconnect(conn); return CURLE_OK; } else infof(data, "Connection failed\n"); } else if(result & CURL_CSELECT_ERR) (void)verifyconnect(conn->tempsock[i], &error); /* * The connection failed here, we should attempt to connect to the "next * address" for the given host. But first remember the latest error. */ if(error) { char ipaddress[MAX_IPADR_LEN]; data->state.os_errno = error; SET_SOCKERRNO(error); Curl_printable_address(conn->tempaddr[i], ipaddress, MAX_IPADR_LEN); infof(data, "connect to %s port %ld failed: %s\n", ipaddress, conn->port, Curl_strerror(conn, error)); conn->timeoutms_per_addr = conn->tempaddr[i]->ai_next == NULL ? allow : allow / 2; code = trynextip(conn, sockindex, i); } } if(code) { /* no more addresses to try */ /* if the first address family runs out of addresses to try before the happy eyeball timeout, go ahead and try the next family now */ if(conn->tempaddr[1] == NULL) { int rc; rc = trynextip(conn, sockindex, 1); if(rc == CURLE_OK) return CURLE_OK; } failf(data, "Failed to connect to %s port %ld: %s", conn->bits.proxy?conn->proxy.name:conn->host.name, conn->port, Curl_strerror(conn, error)); } return code; } static void tcpnodelay(struct connectdata *conn, curl_socket_t sockfd) { #ifdef TCP_NODELAY struct SessionHandle *data= conn->data; curl_socklen_t onoff = (curl_socklen_t) data->set.tcp_nodelay; int level = IPPROTO_TCP; #if 0 /* The use of getprotobyname() is disabled since it isn't thread-safe on numerous systems. On these getprotobyname_r() should be used instead, but that exists in at least one 4 arg version and one 5 arg version, and since the proto number rarely changes anyway we now just use the hard coded number. The "proper" fix would need a configure check for the correct function much in the same style the gethostbyname_r versions are detected. */ struct protoent *pe = getprotobyname("tcp"); if(pe) level = pe->p_proto; #endif if(setsockopt(sockfd, level, TCP_NODELAY, (void *)&onoff, sizeof(onoff)) < 0) infof(data, "Could not set TCP_NODELAY: %s\n", Curl_strerror(conn, 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, SOCKERRNO)); } #else #define nosigpipe(x,y) Curl_nop_stmt #endif #ifdef USE_WINSOCK /* When you run a program that uses the Windows Sockets API, you may experience slow performance when you copy data to a TCP server. http://support.microsoft.com/kb/823764 Work-around: Make the Socket Send Buffer Size Larger Than the Program Send Buffer Size The problem described in this knowledge-base is applied only to pre-Vista Windows. Following function trying to detect OS version and skips SO_SNDBUF adjustment for Windows Vista and above. */ #define DETECT_OS_NONE 0 #define DETECT_OS_PREVISTA 1 #define DETECT_OS_VISTA_OR_LATER 2 void Curl_sndbufset(curl_socket_t sockfd) { int val = CURL_MAX_WRITE_SIZE + 32; int curval = 0; int curlen = sizeof(curval); DWORD majorVersion = 6; static int detectOsState = DETECT_OS_NONE; if(detectOsState == DETECT_OS_NONE) { #if !defined(_WIN32_WINNT) || !defined(_WIN32_WINNT_WIN2K) || \ (_WIN32_WINNT < _WIN32_WINNT_WIN2K) OSVERSIONINFO osver; memset(&osver, 0, sizeof(osver)); osver.dwOSVersionInfoSize = sizeof(osver); detectOsState = DETECT_OS_PREVISTA; if(GetVersionEx(&osver)) { if(osver.dwMajorVersion >= majorVersion) detectOsState = DETECT_OS_VISTA_OR_LATER; } #else ULONGLONG majorVersionMask; OSVERSIONINFOEX osver; memset(&osver, 0, sizeof(osver)); osver.dwOSVersionInfoSize = sizeof(osver); osver.dwMajorVersion = majorVersion; majorVersionMask = VerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL); if(VerifyVersionInfo(&osver, VER_MAJORVERSION, majorVersionMask)) detectOsState = DETECT_OS_VISTA_OR_LATER; else detectOsState = DETECT_OS_PREVISTA; #endif } if(detectOsState == DETECT_OS_VISTA_OR_LATER) return; if(getsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (char *)&curval, &curlen) == 0) if(curval > val) return; setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (const char *)&val, sizeof(val)); } #endif /* * singleipconnect() * * Note that even on connect fail it returns CURLE_OK, but with 'sock' set to * CURL_SOCKET_BAD. Other errors will however return proper errors. * * singleipconnect() connects to the given IP only, and it may return without * having connected. */ static CURLcode singleipconnect(struct connectdata *conn, const Curl_addrinfo *ai, curl_socket_t *sockp) { struct Curl_sockaddr_ex addr; int rc; int error = 0; bool isconnected = FALSE; struct SessionHandle *data = conn->data; curl_socket_t sockfd; CURLcode res = CURLE_OK; char ipaddress[MAX_IPADR_LEN]; long port; *sockp = CURL_SOCKET_BAD; res = Curl_socket(conn, ai, &addr, &sockfd); if(res) /* Failed to create the socket, but still return OK since we signal the lack of socket as well. This allows the parent function to keep looping over alternative addresses/socket families etc. */ return CURLE_OK; /* store remote address and port used in this connection attempt */ if(!getaddressinfo((struct sockaddr*)&addr.sa_addr, ipaddress, &port)) { /* malformed address or bug in inet_ntop, try next address */ error = ERRNO; failf(data, "sa_addr inet_ntop() failed with errno %d: %s", error, Curl_strerror(conn, error)); Curl_closesocket(conn, sockfd); return CURLE_OK; } infof(data, " Trying %s...\n", ipaddress); if(data->set.tcp_nodelay) tcpnodelay(conn, sockfd); nosigpipe(conn, sockfd); Curl_sndbufset(sockfd); if(data->set.tcp_keepalive) tcpkeepalive(data, sockfd); if(data->set.fsockopt) { /* activate callback for setting socket options */ error = data->set.fsockopt(data->set.sockopt_client, sockfd, CURLSOCKTYPE_IPCXN); if(error == CURL_SOCKOPT_ALREADY_CONNECTED) isconnected = TRUE; else if(error) { Curl_closesocket(conn, sockfd); /* close the socket and bail out */ return CURLE_ABORTED_BY_CALLBACK; } } /* possibly bind the local end to an IP, interface or port */ res = bindlocal(conn, sockfd, addr.family); if(res) { Curl_closesocket(conn, sockfd); /* close socket and bail out */ if(res == CURLE_UNSUPPORTED_PROTOCOL) { /* The address family is not supported on this interface. We can continue trying addresses */ return CURLE_OK; } return res; } /* set socket non-blocking */ curlx_nonblock(sockfd, TRUE); conn->connecttime = Curl_tvnow(); if(conn->num_addr > 1) Curl_expire(data, conn->timeoutms_per_addr); /* Connect TCP sockets, bind UDP */ if(!isconnected && (conn->socktype == SOCK_STREAM)) { rc = connect(sockfd, &addr.sa_addr, addr.addrlen); if(-1 == rc) error = SOCKERRNO; } else { *sockp = sockfd; return CURLE_OK; } #ifdef ENABLE_IPV6 conn->bits.ipv6 = (addr.family == AF_INET6)?TRUE:FALSE; #endif if(-1 == rc) { switch(error) { case EINPROGRESS: case EWOULDBLOCK: #if defined(EAGAIN) #if (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 #endif res = CURLE_OK; break; default: /* unknown error, fallthrough and try another address! */ infof(data, "Immediate connect fail for %s: %s\n", ipaddress, Curl_strerror(conn,error)); data->state.os_errno = error; /* connect failed */ Curl_closesocket(conn, sockfd); res = CURLE_COULDNT_CONNECT; } } if(!res) *sockp = sockfd; return res; } /* * 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) { struct SessionHandle *data = conn->data; struct timeval before = Curl_tvnow(); CURLcode res = CURLE_COULDNT_CONNECT; long timeout_ms = Curl_timeleft(data, &before, TRUE); if(timeout_ms < 0) { /* a precaution, no need to continue if time already is up */ failf(data, "Connection time-out"); return CURLE_OPERATION_TIMEDOUT; } conn->num_addr = Curl_num_addresses(remotehost->addr); conn->tempaddr[0] = remotehost->addr; conn->tempaddr[1] = NULL; conn->tempsock[0] = CURL_SOCKET_BAD; conn->tempsock[1] = CURL_SOCKET_BAD; Curl_expire(conn->data, HAPPY_EYEBALLS_TIMEOUT); /* Max time for the next connection attempt */ conn->timeoutms_per_addr = conn->tempaddr[0]->ai_next == NULL ? timeout_ms : timeout_ms / 2; /* start connecting to first IP */ while(conn->tempaddr[0]) { res = singleipconnect(conn, conn->tempaddr[0], &(conn->tempsock[0])); if(res == CURLE_OK) break; conn->tempaddr[0] = conn->tempaddr[0]->ai_next; } if(conn->tempsock[0] == CURL_SOCKET_BAD) return res; data->info.numconnects++; /* to track the number of connections made */ return CURLE_OK; } struct connfind { struct connectdata *tofind; bool found; }; static int conn_is_conn(struct connectdata *conn, void *param) { struct connfind *f = (struct connfind *)param; if(conn == f->tofind) { f->found = TRUE; return 1; } return 0; } /* * Used to extract socket and connectdata struct for the most recent * transfer on the given SessionHandle. * * The returned socket will be CURL_SOCKET_BAD in case of failure! */ curl_socket_t Curl_getconnectinfo(struct SessionHandle *data, struct connectdata **connp) { curl_socket_t sockfd; DEBUGASSERT(data); /* this only works for an easy handle that has been used for curl_easy_perform()! */ if(data->state.lastconnect && data->multi_easy) { struct connectdata *c = data->state.lastconnect; struct connfind find; find.tofind = data->state.lastconnect; find.found = FALSE; Curl_conncache_foreach(data->multi_easy->conn_cache, &find, conn_is_conn); if(!find.found) { data->state.lastconnect = NULL; return CURL_SOCKET_BAD; } if(connp) /* only store this if the caller cares for it */ *connp = c; sockfd = 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)) return CURL_SOCKET_BAD; /* FIN received */ } /* Minix 3.1 doesn't support any flags on recv; just assume socket is OK */ #ifdef MSG_PEEK else { /* use the socket */ char buf; if(recv((RECV_TYPE_ARG1)c->sock[FIRSTSOCKET], (RECV_TYPE_ARG2)&buf, (RECV_TYPE_ARG3)1, (RECV_TYPE_ARG4)MSG_PEEK) == 0) { return CURL_SOCKET_BAD; /* FIN received */ } } #endif } else return CURL_SOCKET_BAD; return sockfd; } /* * Close a socket. * * 'conn' can be NULL, beware! */ int Curl_closesocket(struct connectdata *conn, curl_socket_t sock) { if(conn && conn->fclosesocket) { if((sock == conn->sock[SECONDARYSOCKET]) && conn->sock_accepted[SECONDARYSOCKET]) /* if this socket matches the second socket, and that was created with accept, then we MUST NOT call the callback but clear the accepted status */ conn->sock_accepted[SECONDARYSOCKET] = FALSE; else return conn->fclosesocket(conn->closesocket_client, sock); } sclose(sock); if(conn) /* tell the multi-socket code about this */ Curl_multi_closed(conn, sock); return 0; } /* * Create a socket based on info from 'conn' and 'ai'. * * 'addr' should be a pointer to the correct struct to get data back, or NULL. * 'sockfd' must be a pointer to a socket descriptor. * * If the open socket callback is set, used that! * */ CURLcode Curl_socket(struct connectdata *conn, const Curl_addrinfo *ai, struct Curl_sockaddr_ex *addr, curl_socket_t *sockfd) { struct SessionHandle *data = conn->data; struct Curl_sockaddr_ex dummy; if(!addr) /* if the caller doesn't want info back, use a local temp copy */ addr = &dummy; /* * The Curl_sockaddr_ex structure is basically libcurl's external API * curl_sockaddr structure with enough space available to directly hold * any protocol-specific address structures. The variable declared here * will be used to pass / receive data to/from the fopensocket callback * if this has been set, before that, it is initialized from parameters. */ addr->family = ai->ai_family; addr->socktype = conn->socktype; addr->protocol = conn->socktype==SOCK_DGRAM?IPPROTO_UDP:ai->ai_protocol; addr->addrlen = ai->ai_addrlen; if(addr->addrlen > sizeof(struct Curl_sockaddr_storage)) addr->addrlen = sizeof(struct Curl_sockaddr_storage); memcpy(&addr->sa_addr, ai->ai_addr, addr->addrlen); if(data->set.fopensocket) /* * If the opensocket callback is set, all the destination address * information is passed to the callback. Depending on this information the * callback may opt to abort the connection, this is indicated returning * CURL_SOCKET_BAD; otherwise it will return a not-connected socket. When * the callback returns a valid socket the destination address information * might have been changed and this 'new' address will actually be used * here to connect. */ *sockfd = data->set.fopensocket(data->set.opensocket_client, CURLSOCKTYPE_IPCXN, (struct curl_sockaddr *)addr); else /* opensocket callback not set, so simply create the socket now */ *sockfd = socket(addr->family, addr->socktype, addr->protocol); if(*sockfd == CURL_SOCKET_BAD) /* no socket, no connection */ return CURLE_COULDNT_CONNECT; #if defined(ENABLE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) if(conn->scope && (addr->family == AF_INET6)) { struct sockaddr_in6 * const sa6 = (void *)&addr->sa_addr; sa6->sin6_scope_id = conn->scope; } #endif return CURLE_OK; } curl-7.35.0/lib/smtp.h0000644000175000017500000000751612262353672011417 00000000000000#ifndef HEADER_CURL_SMTP_H #define HEADER_CURL_SMTP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2009 - 2013, 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. * ***************************************************************************/ #include "pingpong.h" /**************************************************************************** * SMTP unique setup ***************************************************************************/ typedef enum { SMTP_STOP, /* do nothing state, stops the state machine */ SMTP_SERVERGREET, /* waiting for the initial greeting immediately after a connect */ SMTP_EHLO, SMTP_HELO, SMTP_STARTTLS, SMTP_UPGRADETLS, /* asynchronously upgrade the connection to SSL/TLS (multi mode only) */ SMTP_AUTH_PLAIN, SMTP_AUTH_LOGIN, SMTP_AUTH_LOGIN_PASSWD, SMTP_AUTH_CRAMMD5, SMTP_AUTH_DIGESTMD5, SMTP_AUTH_DIGESTMD5_RESP, SMTP_AUTH_NTLM, SMTP_AUTH_NTLM_TYPE2MSG, SMTP_AUTH_XOAUTH2, SMTP_AUTH_CANCEL, SMTP_AUTH_FINAL, SMTP_COMMAND, /* VRFY, EXPN, NOOP, RSET and HELP */ SMTP_MAIL, /* MAIL FROM */ SMTP_RCPT, /* RCPT TO */ SMTP_DATA, SMTP_POSTDATA, SMTP_QUIT, SMTP_LAST /* never used */ } smtpstate; /* This SMTP struct is used in the SessionHandle. All SMTP data that is connection-oriented must be in smtp_conn to properly deal with the fact that perhaps the SessionHandle is changed between the times the connection is used. */ struct SMTP { curl_pp_transfer transfer; char *custom; /* Custom Request */ struct curl_slist *rcpt; /* Recipient list */ size_t eob; /* Number of bytes of the EOB (End Of Body) that have been received so far */ bool trailing_crlf; /* Specifies if the tailing CRLF is present */ }; /* smtp_conn is used for struct connection-oriented data in the connectdata struct */ struct smtp_conn { struct pingpong pp; smtpstate state; /* Always use smtp.c:state() to change state! */ bool ssldone; /* Is connect() over SSL done? */ char *domain; /* Client address/name to send in the EHLO */ unsigned int authmechs; /* Accepted authentication mechanisms */ unsigned int prefmech; /* Preferred authentication mechanism */ unsigned int authused; /* Auth mechanism used for the connection */ bool tls_supported; /* StartTLS capability supported by server */ bool size_supported; /* If server supports SIZE extension according to RFC 1870 */ }; extern const struct Curl_handler Curl_handler_smtp; extern const struct Curl_handler Curl_handler_smtps; /* this is the 5-bytes End-Of-Body marker for SMTP */ #define SMTP_EOB "\x0d\x0a\x2e\x0d\x0a" #define SMTP_EOB_LEN 5 #define SMTP_EOB_FIND_LEN 3 /* if found in data, replace it with this string instead */ #define SMTP_EOB_REPL "\x0d\x0a\x2e\x2e" #define SMTP_EOB_REPL_LEN 4 CURLcode Curl_smtp_escape_eob(struct connectdata *conn, ssize_t nread); #endif /* HEADER_CURL_SMTP_H */ curl-7.35.0/lib/memdebug.h0000644000175000017500000001440612262353672012215 00000000000000#ifndef HEADER_CURL_MEMDEBUG_H #define HEADER_CURL_MEMDEBUG_H #ifdef CURLDEBUG /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* * 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 "curl_setup.h" #include #define CURL_MT_LOGFNAME_BUFSIZE 512 #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); #if defined(WIN32) && defined(UNICODE) CURL_EXTERN wchar_t *curl_dowcsdup(const wchar_t *str, int line, const char *source); #endif CURL_EXTERN void curl_memdebug(const char *logname); CURL_EXTERN void curl_memlimit(long limit); CURL_EXTERN void curl_memlog(const char *format, ...); /* file descriptor manipulators */ CURL_EXTERN curl_socket_t curl_socket(int domain, int type, int protocol, int line , const char *source); CURL_EXTERN void curl_mark_sclose(curl_socket_t sockfd, int line , const char *source); CURL_EXTERN int curl_sclose(curl_socket_t sockfd, int line , const char *source); CURL_EXTERN curl_socket_t curl_accept(curl_socket_t s, void *a, void *alen, int line, const char *source); #ifdef HAVE_SOCKETPAIR CURL_EXTERN int curl_socketpair(int domain, int type, int protocol, curl_socket_t socket_vector[2], int line , const char *source); #endif /* FILE functions */ CURL_EXTERN FILE *curl_fopen(const char *file, const char *mode, int line, const char *source); #ifdef HAVE_FDOPEN CURL_EXTERN FILE *curl_fdopen(int filedes, const char *mode, int line, const char *source); #endif 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__) #ifdef WIN32 # ifdef UNICODE # undef wcsdup # define wcsdup(ptr) curl_dowcsdup(ptr, __LINE__, __FILE__) # undef _wcsdup # define _wcsdup(ptr) curl_dowcsdup(ptr, __LINE__, __FILE__) # undef _tcsdup # define _tcsdup(ptr) curl_dowcsdup(ptr, __LINE__, __FILE__) # else # undef _tcsdup # define _tcsdup(ptr) curl_dostrdup(ptr, __LINE__, __FILE__) # endif #endif #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__) #ifdef HAVE_SOCKETPAIR #define socketpair(domain,type,protocol,socket_vector)\ curl_socketpair(domain,type,protocol,socket_vector,__LINE__,__FILE__) #endif #ifdef HAVE_GETADDRINFO #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 #endif /* HAVE_GETADDRINFO */ #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 /* HAVE_GETNAMEINFO */ #ifdef HAVE_FREEADDRINFO #undef freeaddrinfo #define freeaddrinfo(data) \ curl_dofreeaddrinfo(data,__LINE__,__FILE__) #endif /* HAVE_FREEADDRINFO */ /* sclose is probably already defined, redefine it! */ #undef sclose #define sclose(sockfd) curl_sclose(sockfd,__LINE__,__FILE__) #define fake_sclose(sockfd) curl_mark_sclose(sockfd,__LINE__,__FILE__) #undef fopen #define fopen(file,mode) curl_fopen(file,mode,__LINE__,__FILE__) #undef fdopen #define fdopen(file,mode) curl_fdopen(file,mode,__LINE__,__FILE__) #define fclose(file) curl_fclose(file,__LINE__,__FILE__) #endif /* MEMDEBUG_NODEFINES */ #endif /* CURLDEBUG */ /* ** Following section applies even when CURLDEBUG is not defined. */ #ifndef fake_sclose #define fake_sclose(x) Curl_nop_stmt #endif /* * Curl_safefree defined as a macro to allow MemoryTracking feature * to log free() calls at same location where Curl_safefree is used. * This macro also assigns NULL to given pointer when free'd. */ #define Curl_safefree(ptr) \ do {if((ptr)) {free((ptr)); (ptr) = NULL;}} WHILE_FALSE #endif /* HEADER_CURL_MEMDEBUG_H */ curl-7.35.0/lib/amigaos.c0000644000175000017500000000401412213173003012015 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(__AMIGA__) && !defined(__ixemul__) #include #include "amigaos.h" 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 Curl_amiga_cleanup() { if(SocketBase) { CloseLibrary(SocketBase); SocketBase = NULL; } } bool Curl_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_LOGTAGPTR), (ULONG) "cURL", TAG_DONE)) { __request("SocketBaseTags ERROR"); return FALSE; } #ifndef __libnix__ atexit(Curl_amiga_cleanup); #endif return TRUE; } #ifdef __libnix__ ADD2EXIT(Curl_amiga_cleanup,-50); #endif #endif /* __AMIGA__ && ! __ixemul__ */ curl-7.35.0/lib/config-win32.h0000644000175000017500000005043612262353672012640 00000000000000#ifndef HEADER_CURL_CONFIG_WIN32_H #define HEADER_CURL_CONFIG_WIN32_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ /* ================================================================ */ /* Hand crafted config file for Windows */ /* ================================================================ */ /* ---------------------------------------------------------------- */ /* HEADER FILES */ /* ---------------------------------------------------------------- */ /* 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_ERRNO_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. */ #if defined(__MINGW32__) || defined(__POCC__) #define HAVE_GETOPT_H 1 #endif /* 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 need header even with header file. */ #if !defined(__SALFORDC__) && !defined(__POCC__) #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_SIGNAL_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_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 /* Define if you have the header file. */ #ifndef __SALFORDC__ #define HAVE_WINSOCK2_H 1 #endif /* Define if you have the header file. */ #ifndef __SALFORDC__ #define HAVE_WS2TCPIP_H 1 #endif /* ---------------------------------------------------------------- */ /* OTHER HEADER INFO */ /* ---------------------------------------------------------------- */ /* Define if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T 1 /* 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 ftruncate function. */ #define HAVE_FTRUNCATE 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 ioctlsocket function. */ #define HAVE_IOCTLSOCKET 1 /* Define if you have a working ioctlsocket FIONBIO function. */ #define HAVE_IOCTLSOCKET_FIONBIO 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 `CRYPTO_cleanup_all_ex_data' function. This is present in OpenSSL versions after 0.9.6b */ #define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1 /* Define if you have the select function. */ #define HAVE_SELECT 1 /* Define if you have the setlocale function. */ #define HAVE_SETLOCALE 1 /* Define if you have the setmode function. */ #define HAVE_SETMODE 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 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 strncasecmp function. */ /* #define HAVE_STRNCASECMP 1 */ /* Define if you have the strnicmp function. */ #define HAVE_STRNICMP 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 utime function. */ #ifndef __BORLANDC__ #define HAVE_UTIME 1 #endif /* 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 recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 SOCKET /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 char /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 int /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 int /* Define to the function return type for recvfrom. */ #define RECVFROM_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 if in_addr_t is not an available 'typedefed' type. */ #define in_addr_t unsigned long /* Define to the return type of signal handlers (int or void). */ #define RETSIGTYPE void /* Define if ssize_t is not an available 'typedefed' type. */ #ifndef _SSIZE_T_DEFINED # if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \ defined(__POCC__) || \ defined(__MINGW32__) # elif defined(_WIN64) # define _SSIZE_T_DEFINED # define ssize_t __int64 # else # define _SSIZE_T_DEFINED # define ssize_t int # endif #endif /* ---------------------------------------------------------------- */ /* TYPE SIZES */ /* ---------------------------------------------------------------- */ /* Define to the size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* Define to the size of `long double', as computed by sizeof. */ #define SIZEOF_LONG_DOUBLE 16 /* Define to the size of `long long', as computed by sizeof. */ /* #define SIZEOF_LONG_LONG 8 */ /* Define to the size of `short', as computed by sizeof. */ #define SIZEOF_SHORT 2 /* Define to the size of `size_t', as computed by sizeof. */ #if defined(_WIN64) # define SIZEOF_SIZE_T 8 #else # define SIZEOF_SIZE_T 4 #endif /* ---------------------------------------------------------------- */ /* BSD-style lwIP TCP/IP stack SPECIFIC */ /* ---------------------------------------------------------------- */ /* Define to use BSD-style lwIP TCP/IP stack. */ /* #define USE_LWIPSOCK 1 */ #ifdef USE_LWIPSOCK # undef USE_WINSOCK # undef HAVE_WINSOCK_H # undef HAVE_WINSOCK2_H # undef HAVE_WS2TCPIP_H # undef HAVE_ERRNO_H # undef HAVE_GETHOSTNAME # undef HAVE_GETNAMEINFO # undef LWIP_POSIX_SOCKETS_IO_NAMES # undef RECV_TYPE_ARG1 # undef RECV_TYPE_ARG3 # undef SEND_TYPE_ARG1 # undef SEND_TYPE_ARG3 # define HAVE_FREEADDRINFO # define HAVE_GETADDRINFO # define HAVE_GETHOSTBYNAME # define HAVE_GETHOSTBYNAME_R # define HAVE_GETHOSTBYNAME_R_6 # define LWIP_POSIX_SOCKETS_IO_NAMES 0 # define RECV_TYPE_ARG1 int # define RECV_TYPE_ARG3 size_t # define SEND_TYPE_ARG1 int # define SEND_TYPE_ARG3 size_t #endif /* ---------------------------------------------------------------- */ /* Watt-32 tcp/ip SPECIFIC */ /* ---------------------------------------------------------------- */ #ifdef USE_WATT32 #include #undef byte #undef word #undef USE_WINSOCK #undef HAVE_WINSOCK_H #undef HAVE_WINSOCK2_H #undef HAVE_WS2TCPIP_H #define HAVE_GETADDRINFO #define HAVE_GETNAMEINFO #define HAVE_SYS_IOCTL_H #define HAVE_SYS_SOCKET_H #define HAVE_NETINET_IN_H #define HAVE_NETDB_H #define HAVE_ARPA_INET_H #define HAVE_FREEADDRINFO #define SOCKET int #endif /* ---------------------------------------------------------------- */ /* COMPILER SPECIFIC */ /* ---------------------------------------------------------------- */ /* Define to nothing if compiler does not support 'const' qualifier. */ /* #define const */ /* Define to nothing if compiler does not support 'volatile' qualifier. */ /* #define volatile */ /* Windows should not have HAVE_GMTIME_R defined */ /* #undef HAVE_GMTIME_R */ /* Define if the compiler supports C99 variadic macro style. */ #if defined(_MSC_VER) && (_MSC_VER >= 1400) #define HAVE_VARIADIC_MACROS_C99 1 #endif /* Define if the compiler supports the 'long long' data type. */ #if defined(__MINGW32__) || defined(__WATCOMC__) #define HAVE_LONGLONG 1 #endif /* Define to avoid VS2005 complaining about portable C functions. */ #if defined(_MSC_VER) && (_MSC_VER >= 1400) #define _CRT_SECURE_NO_DEPRECATE 1 #define _CRT_NONSTDC_NO_DEPRECATE 1 #endif /* VS2005 and later dafault size for time_t is 64-bit, unless _USE_32BIT_TIME_T has been defined to get a 32-bit time_t. */ #if defined(_MSC_VER) && (_MSC_VER >= 1400) # ifndef _USE_32BIT_TIME_T # define SIZEOF_TIME_T 8 # else # define SIZEOF_TIME_T 4 # endif #endif /* Officially, Microsoft's Windows SDK versions 6.X do not support Windows 2000 as a supported build target. VS2008 default installations provide an embedded Windows SDK v6.0A along with the claim that Windows 2000 is a valid build target for VS2008. Popular belief is that binaries built with VS2008 using Windows SDK versions 6.X and Windows 2000 as a build target are functional. */ #if defined(_MSC_VER) && (_MSC_VER >= 1500) # define VS2008_MIN_TARGET 0x0500 #endif /* When no build target is specified VS2008 default build target is Windows Vista, which leaves out even Winsows XP. If no build target has been given for VS2008 we will target the minimum Officially supported build target, which happens to be Windows XP. */ #if defined(_MSC_VER) && (_MSC_VER >= 1500) # define VS2008_DEF_TARGET 0x0501 #endif /* VS2008 default target settings and minimum build target check. */ #if defined(_MSC_VER) && (_MSC_VER >= 1500) # ifndef _WIN32_WINNT # define _WIN32_WINNT VS2008_DEF_TARGET # endif # ifndef WINVER # define WINVER VS2008_DEF_TARGET # endif # if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET) # error VS2008 does not support Windows build targets prior to Windows 2000 # endif #endif /* When no build target is specified Pelles C 5.00 and later default build target is Windows Vista. We override default target to be Windows 2000. */ #if defined(__POCC__) && (__POCC__ >= 500) # ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0500 # endif # ifndef WINVER # define WINVER 0x0500 # endif #endif /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is quite convoluted, compiler dependent and even build target dependent. */ #if defined(HAVE_WS2TCPIP_H) # if defined(__POCC__) # define HAVE_FREEADDRINFO 1 # define HAVE_GETADDRINFO 1 # define HAVE_GETADDRINFO_THREADSAFE 1 # define HAVE_GETNAMEINFO 1 # elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) # define HAVE_FREEADDRINFO 1 # define HAVE_GETADDRINFO 1 # define HAVE_GETADDRINFO_THREADSAFE 1 # define HAVE_GETNAMEINFO 1 # elif defined(_MSC_VER) && (_MSC_VER >= 1200) # define HAVE_FREEADDRINFO 1 # define HAVE_GETADDRINFO 1 # define HAVE_GETADDRINFO_THREADSAFE 1 # define HAVE_GETNAMEINFO 1 # endif #endif #if defined(__POCC__) # ifndef _MSC_VER # error Microsoft extensions /Ze compiler option is required # endif # ifndef __POCC__OLDNAMES # error Compatibility names /Go compiler option is required # endif #endif /* ---------------------------------------------------------------- */ /* STRUCT RELATED */ /* ---------------------------------------------------------------- */ /* Define if you have struct sockaddr_storage. */ #if !defined(__SALFORDC__) && !defined(__BORLANDC__) #define HAVE_STRUCT_SOCKADDR_STORAGE 1 #endif /* Define if you have struct timeval. */ #define HAVE_STRUCT_TIMEVAL 1 /* Define if struct sockaddr_in6 has the sin6_scope_id member. */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 #if HAVE_WINSOCK2_H && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600) #define HAVE_STRUCT_POLLFD 1 #endif /* ---------------------------------------------------------------- */ /* LARGE FILE SUPPORT */ /* ---------------------------------------------------------------- */ #if defined(_MSC_VER) && !defined(_WIN32_WCE) # if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64) # define USE_WIN32_LARGE_FILES # else # define USE_WIN32_SMALL_FILES # endif #endif #if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES) # define USE_WIN32_LARGE_FILES #endif #if defined(__WATCOMC__) && !defined(USE_WIN32_LARGE_FILES) # define USE_WIN32_LARGE_FILES #endif #if defined(__POCC__) # undef USE_WIN32_LARGE_FILES #endif #if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES) # define USE_WIN32_SMALL_FILES #endif /* ---------------------------------------------------------------- */ /* DNS RESOLVER SPECIALTY */ /* ---------------------------------------------------------------- */ /* * Undefine both USE_ARES and USE_THREADS_WIN32 for synchronous DNS. */ /* Define to enable c-ares asynchronous DNS lookups. */ /* #define USE_ARES 1 */ /* Default define to enable threaded asynchronous DNS lookups. */ #if !defined(USE_SYNC_DNS) && !defined(USE_ARES) && \ !defined(USE_THREADS_WIN32) # define USE_THREADS_WIN32 1 #endif #if defined(USE_ARES) && defined(USE_THREADS_WIN32) # error "Only one DNS lookup specialty may be defined at most" #endif /* ---------------------------------------------------------------- */ /* LDAP SUPPORT */ /* ---------------------------------------------------------------- */ #if defined(CURL_HAS_NOVELL_LDAPSDK) || defined(CURL_HAS_MOZILLA_LDAPSDK) #undef CURL_LDAP_WIN #define HAVE_LDAP_SSL_H 1 #define HAVE_LDAP_URL_PARSE 1 #elif defined(CURL_HAS_OPENLDAP_LDAPSDK) #undef CURL_LDAP_WIN #define HAVE_LDAP_URL_PARSE 1 #else #undef HAVE_LDAP_URL_PARSE #define CURL_LDAP_WIN 1 #endif #if defined(__WATCOMC__) && defined(CURL_LDAP_WIN) #if __WATCOMC__ < 1280 #define WINBERAPI __declspec(cdecl) #define WINLDAPAPI __declspec(cdecl) #endif #endif #if defined(__POCC__) && defined(CURL_LDAP_WIN) # define CURL_DISABLE_LDAP 1 #endif /* ---------------------------------------------------------------- */ /* ADDITIONAL DEFINITIONS */ /* ---------------------------------------------------------------- */ /* Define cpu-machine-OS */ #undef OS #if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */ #define OS "i386-pc-win32" #elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (MSVC >=2005 or gcc) */ #define OS "x86_64-pc-win32" #elif defined(_M_IA64) /* Itanium */ #define OS "ia64-pc-win32" #else #define OS "unknown-pc-win32" #endif /* Name of package */ #define PACKAGE "curl" /* If you want to build curl with the built-in manual */ #define USE_MANUAL 1 #if defined(__POCC__) || (USE_IPV6) # define ENABLE_IPV6 1 #endif #endif /* HEADER_CURL_CONFIG_WIN32_H */ curl-7.35.0/lib/strtok.c0000644000175000017500000000417712213173003011735 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2007, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef HAVE_STRTOK_R #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 */ curl-7.35.0/lib/curl_fnmatch.h0000644000175000017500000000336612213173003013060 00000000000000#ifndef HEADER_CURL_FNMATCH_H #define HEADER_CURL_FNMATCH_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2009, 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. * ***************************************************************************/ #define CURL_FNMATCH_MATCH 0 #define CURL_FNMATCH_NOMATCH 1 #define CURL_FNMATCH_FAIL 2 /* default pattern matching function * ================================= * Implemented with recursive backtracking, if you want to use Curl_fnmatch, * please note that there is not implemented UTF/UNICODE support. * * Implemented features: * '?' notation, does not match UTF characters * '*' can also work with UTF string * [a-zA-Z0-9] enumeration support * * keywords: alnum, digit, xdigit, alpha, print, blank, lower, graph, space * and upper (use as "[[:alnum:]]") */ int Curl_fnmatch(void *ptr, const char *pattern, const char *string); #endif /* HEADER_CURL_FNMATCH_H */ curl-7.35.0/lib/sigpipe.h0000644000175000017500000000517112262353672012067 00000000000000#ifndef HEADER_CURL_SIGPIPE_H #define HEADER_CURL_SIGPIPE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(HAVE_SIGNAL_H) && defined(HAVE_SIGACTION) && defined(USE_OPENSSL) #include struct sigpipe_ignore { struct sigaction old_pipe_act; bool no_signal; }; #define SIGPIPE_VARIABLE(x) struct sigpipe_ignore x /* * sigpipe_ignore() makes sure we ignore SIGPIPE while running libcurl * internals, and then sigpipe_restore() will restore the situation when we * return from libcurl again. */ static void sigpipe_ignore(struct SessionHandle *data, struct sigpipe_ignore *ig) { /* get a local copy of no_signal because the SessionHandle might not be around when we restore */ ig->no_signal = data->set.no_signal; if(!data->set.no_signal) { struct sigaction action; /* first, extract the existing situation */ memset(&ig->old_pipe_act, 0, sizeof(struct sigaction)); sigaction(SIGPIPE, NULL, &ig->old_pipe_act); action = ig->old_pipe_act; /* ignore this signal */ action.sa_handler = SIG_IGN; sigaction(SIGPIPE, &action, NULL); } } /* * sigpipe_restore() puts back the outside world's opinion of signal handler * and SIGPIPE handling. It MUST only be called after a corresponding * sigpipe_ignore() was used. */ static void sigpipe_restore(struct sigpipe_ignore *ig) { if(!ig->no_signal) /* restore the outside state */ sigaction(SIGPIPE, &ig->old_pipe_act, NULL); } #else /* for systems without sigaction */ #define sigpipe_ignore(x,y) Curl_nop_stmt #define sigpipe_restore(x) Curl_nop_stmt #define SIGPIPE_VARIABLE(x) #endif #endif /* HEADER_CURL_SIGPIPE_H */ curl-7.35.0/lib/connect.h0000644000175000017500000000734212262353672012062 00000000000000#ifndef HEADER_CURL_CONNECT_H #define HEADER_CURL_CONNECT_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #include "nonblock.h" /* for curlx_nonblock(), formerly Curl_nonblock() */ #include "sockaddr.h" CURLcode Curl_is_connected(struct connectdata *conn, int sockindex, bool *connected); CURLcode Curl_connecthost(struct connectdata *conn, const struct Curl_dns_entry *host); /* generic function that returns how much time there's left to run, according to the timeouts set */ long Curl_timeleft(struct SessionHandle *data, struct timeval *nowp, bool duringconnect); #define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */ #define HAPPY_EYEBALLS_TIMEOUT 200 /* milliseconds to wait between ipv4/ipv6 connection attempts */ /* * Used to extract socket and connectdata struct for the most recent * transfer on the given SessionHandle. * * The returned socket will be CURL_SOCKET_BAD in case of failure! */ curl_socket_t Curl_getconnectinfo(struct SessionHandle *data, struct connectdata **connp); #ifdef USE_WINSOCK /* When you run a program that uses the Windows Sockets API, you may experience slow performance when you copy data to a TCP server. http://support.microsoft.com/kb/823764 Work-around: Make the Socket Send Buffer Size Larger Than the Program Send Buffer Size */ void Curl_sndbufset(curl_socket_t sockfd); #else #define Curl_sndbufset(y) Curl_nop_stmt #endif void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd); void Curl_persistconninfo(struct connectdata *conn); int Curl_closesocket(struct connectdata *conn, curl_socket_t sock); /* * The Curl_sockaddr_ex structure is basically libcurl's external API * curl_sockaddr structure with enough space available to directly hold any * protocol-specific address structures. The variable declared here will be * used to pass / receive data to/from the fopensocket callback if this has * been set, before that, it is initialized from parameters. */ struct Curl_sockaddr_ex { int family; int socktype; int protocol; unsigned int addrlen; union { struct sockaddr addr; struct Curl_sockaddr_storage buff; } _sa_ex_u; }; #define sa_addr _sa_ex_u.addr /* * Create a socket based on info from 'conn' and 'ai'. * * Fill in 'addr' and 'sockfd' accordingly if OK is returned. If the open * socket callback is set, used that! * */ CURLcode Curl_socket(struct connectdata *conn, const Curl_addrinfo *ai, struct Curl_sockaddr_ex *addr, curl_socket_t *sockfd); #endif /* HEADER_CURL_CONNECT_H */ curl-7.35.0/lib/easyif.h0000644000175000017500000000236212262353672011706 00000000000000#ifndef HEADER_CURL_EASYIF_H #define HEADER_CURL_EASYIF_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* * Prototypes for library-wide functions provided by easy.c */ #ifdef CURLDEBUG CURL_EXTERN CURLcode curl_easy_perform_ev(CURL *easy); #endif #endif /* HEADER_CURL_EASYIF_H */ curl-7.35.0/lib/setup-vms.h0000644000175000017500000003161412262353672012373 00000000000000#ifndef HEADER_CURL_SETUP_VMS_H #define HEADER_CURL_SETUP_VMS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* */ /* JEM, 12/30/12, VMS now generates config.h, so only define wrappers for */ /* getenv(), getpwuid() and provide is_vms_shell() */ /* Also need upper case symbols for system services, and */ /* OpenSSL, and some Kerberos image */ #ifdef __DECC #pragma message save #pragma message disable dollarid #endif /* Hide the stuff we are overriding */ #define getenv decc_getenv #ifdef __DECC # if __INITIAL_POINTER_SIZE != 64 # define getpwuid decc_getpwuid # endif #endif #include char * decc$getenv(const char * __name); #include #include #include #undef getenv #undef getpwuid #define getenv vms_getenv #define getpwuid vms_getpwuid /* VAX needs these in upper case when compiling exact case */ #define sys$assign SYS$ASSIGN #define sys$dassgn SYS$DASSGN #define sys$qiow SYS$QIOW #ifdef __DECC # if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # endif #endif #if __USE_LONG_GID_T # define decc_getpwuid DECC$__LONG_GID_GETPWUID #else # if __INITIAL_POINTER_SIZE # define decc_getpwuid decc$__32_getpwuid # else # define decc_getpwuid decc$getpwuid # endif #endif struct passwd * decc_getpwuid(uid_t uid); #ifdef __DECC # if __INITIAL_POINTER_SIZE == 32 /* Translate the path, but only if the path is a VMS file specification */ /* The translation is usually only needed for older versions of VMS */ static char * vms_translate_path(const char * path) { char * unix_path; char * test_str; /* See if the result is in VMS format, if not, we are done */ /* Assume that this is a PATH, not just some data */ test_str = strpbrk(path, ":[<^"); if(test_str == NULL) { return (char *)path; } unix_path = decc$translate_vms(path); if((int)unix_path <= 0) { /* We can not translate it, so return the original string */ return (char *)path; } } # else /* VMS translate path is actually not needed on the current 64 bit */ /* VMS platforms, so instead of figuring out the pointer settings */ /* Change it to a noop */ # define vms_translate_path(__path) __path # endif #endif #ifdef __DECC # if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore # endif #endif static char * vms_getenv(const char * envvar) { char * result; char * vms_path; /* first use the DECC getenv() function */ result = decc$getenv(envvar); if(result == NULL) { return result; } vms_path = result; result = vms_translate_path(vms_path); /* note that if you backport this to use VAX C RTL, that the VAX C RTL */ /* may do a malloc(2048) for each call to getenv(), so you will need */ /* to add a free(vms_path) */ /* Do not do a free() for DEC C RTL builds, which should be used for */ /* VMS 5.5-2 and later, even if using GCC */ return result; } static struct passwd vms_passwd_cache; static struct passwd * vms_getpwuid(uid_t uid) { struct passwd * my_passwd; /* Hack needed to support 64 bit builds, decc_getpwnam is 32 bit only */ #ifdef __DECC # if __INITIAL_POINTER_SIZE __char_ptr32 unix_path; # else char * unix_path; # endif #else char * unix_path; #endif my_passwd = decc_getpwuid(uid); if(my_passwd == NULL) { return my_passwd; } unix_path = vms_translate_path(my_passwd->pw_dir); if((long)unix_path <= 0) { /* We can not translate it, so return the original string */ return my_passwd; } /* If no changes needed just return it */ if(unix_path == my_passwd->pw_dir) { return my_passwd; } /* Need to copy the structure returned */ /* Since curl is only using pw_dir, no need to fix up * /* the pw_shell when running under Bash */ vms_passwd_cache.pw_name = my_passwd->pw_name; vms_passwd_cache.pw_uid = my_passwd->pw_uid; vms_passwd_cache.pw_gid = my_passwd->pw_uid; vms_passwd_cache.pw_dir = unix_path; vms_passwd_cache.pw_shell = my_passwd->pw_shell; return &vms_passwd_cache; } #ifdef __DECC #pragma message restore #endif /* Bug - VMS OpenSSL and Kerberos universal symbols are in uppercase only */ /* VMS libraries should have universal symbols in exact and uppercase */ #define ASN1_INTEGER_get ASN1_INTEGER_GET #define ASN1_STRING_data ASN1_STRING_DATA #define ASN1_STRING_length ASN1_STRING_LENGTH #define ASN1_STRING_print ASN1_STRING_PRINT #define ASN1_STRING_to_UTF8 ASN1_STRING_TO_UTF8 #define ASN1_STRING_type ASN1_STRING_TYPE #define BIO_ctrl BIO_CTRL #define BIO_free BIO_FREE #define BIO_new BIO_NEW #define BIO_s_mem BIO_S_MEM #define BN_bn2bin BN_BN2BIN #define BN_num_bits BN_NUM_BITS #define CRYPTO_cleanup_all_ex_data CRYPTO_CLEANUP_ALL_EX_DATA #define CRYPTO_free CRYPTO_FREE #define CRYPTO_malloc CRYPTO_MALLOC #define DES_ecb_encrypt DES_ECB_ENCRYPT #define DES_set_key DES_SET_KEY #define DES_set_odd_parity DES_SET_ODD_PARITY #define ENGINE_ctrl ENGINE_CTRL #define ENGINE_ctrl_cmd ENGINE_CTRL_CMD #define ENGINE_finish ENGINE_FINISH #define ENGINE_free ENGINE_FREE #define ENGINE_get_first ENGINE_GET_FIRST #define ENGINE_get_id ENGINE_GET_ID #define ENGINE_get_next ENGINE_GET_NEXT #define ENGINE_init ENGINE_INIT #define ENGINE_load_builtin_engines ENGINE_LOAD_BUILTIN_ENGINES #define ENGINE_load_private_key ENGINE_LOAD_PRIVATE_KEY #define ENGINE_set_default ENGINE_SET_DEFAULT #define ERR_clear_error ERR_CLEAR_ERROR #define ERR_error_string ERR_ERROR_STRING #define ERR_error_string_n ERR_ERROR_STRING_N #define ERR_free_strings ERR_FREE_STRINGS #define ERR_get_error ERR_GET_ERROR #define ERR_peek_error ERR_PEEK_ERROR #define ERR_remove_state ERR_REMOVE_STATE #define EVP_PKEY_copy_parameters EVP_PKEY_COPY_PARAMETERS #define EVP_PKEY_free EVP_PKEY_FREE #define EVP_cleanup EVP_CLEANUP #define GENERAL_NAMES_free GENERAL_NAMES_FREE #define MD4_Final MD4_FINAL #define MD4_Init MD4_INIT #define MD4_Update MD4_UPDATE #define MD5_Final MD5_FINAL #define MD5_Init MD5_INIT #define MD5_Update MD5_UPDATE #define OPENSSL_add_all_algo_noconf OPENSSL_ADD_ALL_ALGO_NOCONF #define PEM_read_X509 PEM_READ_X509 #define PEM_write_bio_X509 PEM_WRITE_BIO_X509 #define PKCS12_PBE_add PKCS12_PBE_ADD #define PKCS12_free PKCS12_FREE #define PKCS12_parse PKCS12_PARSE #define RAND_add RAND_ADD #define RAND_bytes RAND_BYTES #define RAND_egd RAND_EGD #define RAND_file_name RAND_FILE_NAME #define RAND_load_file RAND_LOAD_FILE #define RAND_status RAND_STATUS #define SSL_CIPHER_get_name SSL_CIPHER_GET_NAME #define SSL_CTX_add_client_CA SSL_CTX_ADD_CLIENT_CA #define SSL_CTX_callback_ctrl SSL_CTX_CALLBACK_CTRL #define SSL_CTX_check_private_key SSL_CTX_CHECK_PRIVATE_KEY #define SSL_CTX_ctrl SSL_CTX_CTRL #define SSL_CTX_free SSL_CTX_FREE #define SSL_CTX_get_cert_store SSL_CTX_GET_CERT_STORE #define SSL_CTX_load_verify_locations SSL_CTX_LOAD_VERIFY_LOCATIONS #define SSL_CTX_new SSL_CTX_NEW #define SSL_CTX_set_cipher_list SSL_CTX_SET_CIPHER_LIST #define SSL_CTX_set_def_passwd_cb_ud SSL_CTX_SET_DEF_PASSWD_CB_UD #define SSL_CTX_set_default_passwd_cb SSL_CTX_SET_DEFAULT_PASSWD_CB #define SSL_CTX_set_verify SSL_CTX_SET_VERIFY #define SSL_CTX_use_PrivateKey SSL_CTX_USE_PRIVATEKEY #define SSL_CTX_use_PrivateKey_file SSL_CTX_USE_PRIVATEKEY_FILE #define SSL_CTX_use_cert_chain_file SSL_CTX_USE_CERT_CHAIN_FILE #define SSL_CTX_use_certificate SSL_CTX_USE_CERTIFICATE #define SSL_CTX_use_certificate_file SSL_CTX_USE_CERTIFICATE_FILE #define SSL_SESSION_free SSL_SESSION_FREE #define SSL_connect SSL_CONNECT #define SSL_free SSL_FREE #define SSL_get1_session SSL_GET1_SESSION #define SSL_get_certificate SSL_GET_CERTIFICATE #define SSL_get_current_cipher SSL_GET_CURRENT_CIPHER #define SSL_get_error SSL_GET_ERROR #define SSL_get_peer_cert_chain SSL_GET_PEER_CERT_CHAIN #define SSL_get_peer_certificate SSL_GET_PEER_CERTIFICATE #define SSL_get_privatekey SSL_GET_PRIVATEKEY #define SSL_get_shutdown SSL_GET_SHUTDOWN #define SSL_get_verify_result SSL_GET_VERIFY_RESULT #define SSL_library_init SSL_LIBRARY_INIT #define SSL_load_error_strings SSL_LOAD_ERROR_STRINGS #define SSL_new SSL_NEW #define SSL_peek SSL_PEEK #define SSL_pending SSL_PENDING #define SSL_read SSL_READ #define SSL_set_connect_state SSL_SET_CONNECT_STATE #define SSL_set_fd SSL_SET_FD #define SSL_set_session SSL_SET_SESSION #define SSL_shutdown SSL_SHUTDOWN #define SSL_write SSL_WRITE #define SSLeay SSLEAY #define SSLv23_client_method SSLV23_CLIENT_METHOD #define SSLv3_client_method SSLV3_CLIENT_METHOD #define TLSv1_client_method TLSV1_CLIENT_METHOD #define UI_OpenSSL UI_OPENSSL #define X509V3_EXT_print X509V3_EXT_PRINT #define X509_EXTENSION_get_critical X509_EXTENSION_GET_CRITICAL #define X509_EXTENSION_get_object X509_EXTENSION_GET_OBJECT #define X509_LOOKUP_file X509_LOOKUP_FILE #define X509_NAME_ENTRY_get_data X509_NAME_ENTRY_GET_DATA #define X509_NAME_get_entry X509_NAME_GET_ENTRY #define X509_NAME_get_index_by_NID X509_NAME_GET_INDEX_BY_NID #define X509_NAME_print_ex X509_NAME_PRINT_EX #define X509_STORE_CTX_get_current_cert X509_STORE_CTX_GET_CURRENT_CERT #define X509_STORE_add_lookup X509_STORE_ADD_LOOKUP #define X509_STORE_set_flags X509_STORE_SET_FLAGS #define X509_check_issued X509_CHECK_ISSUED #define X509_free X509_FREE #define X509_get_ext_d2i X509_GET_EXT_D2I #define X509_get_issuer_name X509_GET_ISSUER_NAME #define X509_get_pubkey X509_GET_PUBKEY #define X509_get_serialNumber X509_GET_SERIALNUMBER #define X509_get_subject_name X509_GET_SUBJECT_NAME #define X509_load_crl_file X509_LOAD_CRL_FILE #define X509_verify_cert_error_string X509_VERIFY_CERT_ERROR_STRING #define d2i_PKCS12_fp D2I_PKCS12_FP #define i2t_ASN1_OBJECT I2T_ASN1_OBJECT #define sk_num SK_NUM #define sk_pop SK_POP #define sk_pop_free SK_POP_FREE #define sk_value SK_VALUE #define USE_UPPERCASE_GSSAPI 1 #define gss_seal GSS_SEAL #define gss_unseal GSS_UNSEAL #define USE_UPPERCASE_KRBAPI 1 /* AI_NUMERICHOST needed for IP V6 support in Curl */ #ifdef HAVE_NETDB_H #include #ifndef AI_NUMERICHOST #ifdef ENABLE_IPV6 #undef ENABLE_IPV6 #endif #endif #endif /* VAX symbols are always in uppercase */ #ifdef __VAX #define inflate INFLATE #define inflateEnd INFLATEEND #define inflateInit2_ INFLATEINIT2_ #define inflateInit_ INFLATEINIT_ #define zlibVersion ZLIBVERSION #endif /* Older VAX OpenSSL port defines these as Macros */ /* Need to include the headers first and then redefine */ /* that way a newer port will also work if some one has one */ #ifdef __VAX # if (OPENSSL_VERSION_NUMBER < 0x00907001L) # define des_set_odd_parity DES_SET_ODD_PARITY # define des_set_key DES_SET_KEY # define des_ecb_encrypt DES_ECB_ENCRYPT # endif # include # ifndef OpenSSL_add_all_algorithms # define OpenSSL_add_all_algorithms OPENSSL_ADD_ALL_ALGORITHMS void OPENSSL_ADD_ALL_ALGORITHMS(void); # endif /* Curl defines these to lower case and VAX needs them in upper case */ /* So we need static routines */ # if (OPENSSL_VERSION_NUMBER < 0x00907001L) # undef des_set_odd_parity # undef DES_set_odd_parity # undef des_set_key # undef DES_set_key # undef des_ecb_encrypt # undef DES_ecb_encrypt static void des_set_odd_parity(des_cblock *key) { DES_SET_ODD_PARITY(key); } static int des_set_key(const_des_cblock *key, des_key_schedule schedule) { return DES_SET_KEY(key, schedule); } static void des_ecb_encrypt(const_des_cblock *input, des_cblock *output, des_key_schedule ks,int enc) { DES_ECB_ENCRYPT(input, output, ks, enc); } #endif /* Need this to stop a macro redefinition error */ #if OPENSSL_VERSION_NUMBER < 0x00907000L # ifdef X509_STORE_set_flags # undef X509_STORE_set_flags # define X509_STORE_set_flags(x,y) Curl_nop_stmt # endif #endif #endif #endif /* HEADER_CURL_SETUP_VMS_H */ curl-7.35.0/lib/cookie.h0000644000175000017500000001005612262353672011676 00000000000000#ifndef HEADER_CURL_COOKIE_H #define HEADER_CURL_COOKIE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #include struct Cookie { struct Cookie *next; /* next in the chain */ char *name; /* = value */ char *value; /* name = */ char *path; /* path = which is in Set-Cookie: */ char *spath; /* sanitized cookie 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 */ bool httponly; /* true if the httponly directive is present */ }; 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 *lineptr, const char *domain, const char *path); struct Cookie *Curl_cookie_getlist(struct CookieInfo *, const char *, const char *, bool); void Curl_cookie_freelist(struct Cookie *cookies, bool cookiestoo); void Curl_cookie_clearall(struct CookieInfo *cookies); void Curl_cookie_clearsess(struct CookieInfo *cookies); #if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_COOKIES) #define Curl_cookie_list(x) NULL #define Curl_cookie_loadfiles(x) Curl_nop_stmt #define Curl_cookie_init(x,y,z,w) NULL #define Curl_cookie_cleanup(x) Curl_nop_stmt #define Curl_flush_cookies(x,y) Curl_nop_stmt #else void Curl_flush_cookies(struct SessionHandle *data, int cleanup); void Curl_cookie_cleanup(struct CookieInfo *); struct CookieInfo *Curl_cookie_init(struct SessionHandle *data, const char *, struct CookieInfo *, bool); struct curl_slist *Curl_cookie_list(struct SessionHandle *data); void Curl_cookie_loadfiles(struct SessionHandle *data); #endif #endif /* HEADER_CURL_COOKIE_H */ curl-7.35.0/lib/curl_config.h.cmake0000644000175000017500000007675112213173003013774 00000000000000/* lib/curl_config.h.in. Generated somehow by cmake. */ /* when building libcurl itself */ #cmakedefine BUILDING_LIBCURL ${BUILDING_LIBCURL} /* Location of default ca bundle */ #cmakedefine CURL_CA_BUNDLE ${CURL_CA_BUNDLE} /* Location of default ca path */ #cmakedefine CURL_CA_PATH ${CURL_CA_PATH} /* to disable cookies support */ #cmakedefine CURL_DISABLE_COOKIES ${CURL_DISABLE_COOKIES} /* to disable cryptographic authentication */ #cmakedefine CURL_DISABLE_CRYPTO_AUTH ${CURL_DISABLE_CRYPTO_AUTH} /* to disable DICT */ #cmakedefine CURL_DISABLE_DICT ${CURL_DISABLE_DICT} /* to disable FILE */ #cmakedefine CURL_DISABLE_FILE ${CURL_DISABLE_FILE} /* to disable FTP */ #cmakedefine CURL_DISABLE_FTP ${CURL_DISABLE_FTP} /* to disable HTTP */ #cmakedefine CURL_DISABLE_HTTP ${CURL_DISABLE_HTTP} /* to disable LDAP */ #cmakedefine CURL_DISABLE_LDAP ${CURL_DISABLE_LDAP} /* to disable LDAPS */ #cmakedefine CURL_DISABLE_LDAPS ${CURL_DISABLE_LDAPS} /* to disable proxies */ #cmakedefine CURL_DISABLE_PROXY ${CURL_DISABLE_PROXY} /* to disable TELNET */ #cmakedefine CURL_DISABLE_TELNET ${CURL_DISABLE_TELNET} /* to disable TFTP */ #cmakedefine CURL_DISABLE_TFTP ${CURL_DISABLE_TFTP} /* to disable verbose strings */ #cmakedefine CURL_DISABLE_VERBOSE_STRINGS ${CURL_DISABLE_VERBOSE_STRINGS} /* to make a symbol visible */ #cmakedefine CURL_EXTERN_SYMBOL ${CURL_EXTERN_SYMBOL} /* Ensure using CURL_EXTERN_SYMBOL is possible */ #ifndef CURL_EXTERN_SYMBOL #define CURL_EXTERN_SYMBOL #endif /* Use Windows LDAP implementation */ #cmakedefine CURL_LDAP_WIN ${CURL_LDAP_WIN} /* when not building a shared library */ #cmakedefine CURL_STATICLIB ${CURL_STATICLIB} /* Set to explicitly specify we don't want to use thread-safe functions */ #cmakedefine DISABLED_THREADSAFE ${DISABLED_THREADSAFE} /* your Entropy Gathering Daemon socket pathname */ #cmakedefine EGD_SOCKET ${EGD_SOCKET} /* Define if you want to enable IPv6 support */ #cmakedefine ENABLE_IPV6 ${ENABLE_IPV6} /* Define to the type qualifier of arg 1 for getnameinfo. */ #cmakedefine GETNAMEINFO_QUAL_ARG1 ${GETNAMEINFO_QUAL_ARG1} /* Define to the type of arg 1 for getnameinfo. */ #cmakedefine GETNAMEINFO_TYPE_ARG1 ${GETNAMEINFO_TYPE_ARG1} /* Define to the type of arg 2 for getnameinfo. */ #cmakedefine GETNAMEINFO_TYPE_ARG2 ${GETNAMEINFO_TYPE_ARG2} /* Define to the type of args 4 and 6 for getnameinfo. */ #cmakedefine GETNAMEINFO_TYPE_ARG46 ${GETNAMEINFO_TYPE_ARG46} /* Define to the type of arg 7 for getnameinfo. */ #cmakedefine GETNAMEINFO_TYPE_ARG7 ${GETNAMEINFO_TYPE_ARG7} /* Specifies the number of arguments to getservbyport_r */ #cmakedefine GETSERVBYPORT_R_ARGS ${GETSERVBYPORT_R_ARGS} /* Specifies the size of the buffer to pass to getservbyport_r */ #cmakedefine GETSERVBYPORT_R_BUFSIZE ${GETSERVBYPORT_R_BUFSIZE} /* Define to 1 if you have the alarm function. */ #cmakedefine HAVE_ALARM ${HAVE_ALARM} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ALLOCA_H ${HAVE_ALLOCA_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ARPA_INET_H ${HAVE_ARPA_INET_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ARPA_TFTP_H ${HAVE_ARPA_TFTP_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ASSERT_H ${HAVE_ASSERT_H} /* Define to 1 if you have the `basename' function. */ #cmakedefine HAVE_BASENAME ${HAVE_BASENAME} /* Define to 1 if bool is an available type. */ #cmakedefine HAVE_BOOL_T ${HAVE_BOOL_T} /* Define to 1 if you have the clock_gettime function and monotonic timer. */ #cmakedefine HAVE_CLOCK_GETTIME_MONOTONIC ${HAVE_CLOCK_GETTIME_MONOTONIC} /* Define to 1 if you have the `closesocket' function. */ #cmakedefine HAVE_CLOSESOCKET ${HAVE_CLOSESOCKET} /* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */ #cmakedefine HAVE_CRYPTO_CLEANUP_ALL_EX_DATA ${HAVE_CRYPTO_CLEANUP_ALL_EX_DATA} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_CRYPTO_H ${HAVE_CRYPTO_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_DES_H ${HAVE_DES_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_DLFCN_H ${HAVE_DLFCN_H} /* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */ #cmakedefine HAVE_ENGINE_LOAD_BUILTIN_ENGINES ${HAVE_ENGINE_LOAD_BUILTIN_ENGINES} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ERRNO_H ${HAVE_ERRNO_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ERR_H ${HAVE_ERR_H} /* Define to 1 if you have the fcntl function. */ #cmakedefine HAVE_FCNTL ${HAVE_FCNTL} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_FCNTL_H ${HAVE_FCNTL_H} /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ #cmakedefine HAVE_FCNTL_O_NONBLOCK ${HAVE_FCNTL_O_NONBLOCK} /* Define to 1 if you have the fdopen function. */ #cmakedefine HAVE_FDOPEN ${HAVE_FDOPEN} /* Define to 1 if you have the `fork' function. */ #cmakedefine HAVE_FORK ${HAVE_FORK} /* Define to 1 if you have the freeaddrinfo function. */ #cmakedefine HAVE_FREEADDRINFO ${HAVE_FREEADDRINFO} /* Define to 1 if you have the freeifaddrs function. */ #cmakedefine HAVE_FREEIFADDRS ${HAVE_FREEIFADDRS} /* Define to 1 if you have the ftruncate function. */ #cmakedefine HAVE_FTRUNCATE ${HAVE_FTRUNCATE} /* Define to 1 if you have a working getaddrinfo function. */ #cmakedefine HAVE_GETADDRINFO ${HAVE_GETADDRINFO} /* Define to 1 if you have the `geteuid' function. */ #cmakedefine HAVE_GETEUID ${HAVE_GETEUID} /* Define to 1 if you have the gethostbyaddr function. */ #cmakedefine HAVE_GETHOSTBYADDR ${HAVE_GETHOSTBYADDR} /* Define to 1 if you have the gethostbyaddr_r function. */ #cmakedefine HAVE_GETHOSTBYADDR_R ${HAVE_GETHOSTBYADDR_R} /* gethostbyaddr_r() takes 5 args */ #cmakedefine HAVE_GETHOSTBYADDR_R_5 ${HAVE_GETHOSTBYADDR_R_5} /* gethostbyaddr_r() takes 7 args */ #cmakedefine HAVE_GETHOSTBYADDR_R_7 ${HAVE_GETHOSTBYADDR_R_7} /* gethostbyaddr_r() takes 8 args */ #cmakedefine HAVE_GETHOSTBYADDR_R_8 ${HAVE_GETHOSTBYADDR_R_8} /* Define to 1 if you have the gethostbyname function. */ #cmakedefine HAVE_GETHOSTBYNAME ${HAVE_GETHOSTBYNAME} /* Define to 1 if you have the gethostbyname_r function. */ #cmakedefine HAVE_GETHOSTBYNAME_R ${HAVE_GETHOSTBYNAME_R} /* gethostbyname_r() takes 3 args */ #cmakedefine HAVE_GETHOSTBYNAME_R_3 ${HAVE_GETHOSTBYNAME_R_3} /* gethostbyname_r() takes 5 args */ #cmakedefine HAVE_GETHOSTBYNAME_R_5 ${HAVE_GETHOSTBYNAME_R_5} /* gethostbyname_r() takes 6 args */ #cmakedefine HAVE_GETHOSTBYNAME_R_6 ${HAVE_GETHOSTBYNAME_R_6} /* Define to 1 if you have the gethostname function. */ #cmakedefine HAVE_GETHOSTNAME ${HAVE_GETHOSTNAME} /* Define to 1 if you have a working getifaddrs function. */ #cmakedefine HAVE_GETIFADDRS ${HAVE_GETIFADDRS} /* Define to 1 if you have the getnameinfo function. */ #cmakedefine HAVE_GETNAMEINFO ${HAVE_GETNAMEINFO} /* Define to 1 if you have the `getpass_r' function. */ #cmakedefine HAVE_GETPASS_R ${HAVE_GETPASS_R} /* Define to 1 if you have the `getppid' function. */ #cmakedefine HAVE_GETPPID ${HAVE_GETPPID} /* Define to 1 if you have the `getprotobyname' function. */ #cmakedefine HAVE_GETPROTOBYNAME ${HAVE_GETPROTOBYNAME} /* Define to 1 if you have the `getpwuid' function. */ #cmakedefine HAVE_GETPWUID ${HAVE_GETPWUID} /* Define to 1 if you have the `getrlimit' function. */ #cmakedefine HAVE_GETRLIMIT ${HAVE_GETRLIMIT} /* Define to 1 if you have the getservbyport_r function. */ #cmakedefine HAVE_GETSERVBYPORT_R ${HAVE_GETSERVBYPORT_R} /* Define to 1 if you have the `gettimeofday' function. */ #cmakedefine HAVE_GETTIMEOFDAY ${HAVE_GETTIMEOFDAY} /* Define to 1 if you have a working glibc-style strerror_r function. */ #cmakedefine HAVE_GLIBC_STRERROR_R ${HAVE_GLIBC_STRERROR_R} /* Define to 1 if you have a working gmtime_r function. */ #cmakedefine HAVE_GMTIME_R ${HAVE_GMTIME_R} /* if you have the gssapi libraries */ #cmakedefine HAVE_GSSAPI ${HAVE_GSSAPI} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_GSSAPI_GSSAPI_GENERIC_H ${HAVE_GSSAPI_GSSAPI_GENERIC_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_GSSAPI_GSSAPI_H ${HAVE_GSSAPI_GSSAPI_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_GSSAPI_GSSAPI_KRB5_H ${HAVE_GSSAPI_GSSAPI_KRB5_H} /* if you have the GNU gssapi libraries */ #cmakedefine HAVE_GSSGNU ${HAVE_GSSGNU} /* if you have the Heimdal gssapi libraries */ #cmakedefine HAVE_GSSHEIMDAL ${HAVE_GSSHEIMDAL} /* if you have the MIT gssapi libraries */ #cmakedefine HAVE_GSSMIT ${HAVE_GSSMIT} /* Define to 1 if you have the `idna_strerror' function. */ #cmakedefine HAVE_IDNA_STRERROR ${HAVE_IDNA_STRERROR} /* Define to 1 if you have the `idn_free' function. */ #cmakedefine HAVE_IDN_FREE ${HAVE_IDN_FREE} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_IDN_FREE_H ${HAVE_IDN_FREE_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_IFADDRS_H ${HAVE_IFADDRS_H} /* Define to 1 if you have the `inet_addr' function. */ #cmakedefine HAVE_INET_ADDR ${HAVE_INET_ADDR} /* Define to 1 if you have the inet_ntoa_r function. */ #cmakedefine HAVE_INET_NTOA_R ${HAVE_INET_NTOA_R} /* inet_ntoa_r() takes 2 args */ #cmakedefine HAVE_INET_NTOA_R_2 ${HAVE_INET_NTOA_R_2} /* inet_ntoa_r() takes 3 args */ #cmakedefine HAVE_INET_NTOA_R_3 ${HAVE_INET_NTOA_R_3} /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ #cmakedefine HAVE_INET_NTOP ${HAVE_INET_NTOP} /* Define to 1 if you have a IPv6 capable working inet_pton function. */ #cmakedefine HAVE_INET_PTON ${HAVE_INET_PTON} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H} /* Define to 1 if you have the ioctl function. */ #cmakedefine HAVE_IOCTL ${HAVE_IOCTL} /* Define to 1 if you have the ioctlsocket function. */ #cmakedefine HAVE_IOCTLSOCKET ${HAVE_IOCTLSOCKET} /* Define to 1 if you have the IoctlSocket camel case function. */ #cmakedefine HAVE_IOCTLSOCKET_CAMEL ${HAVE_IOCTLSOCKET_CAMEL} /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. */ #cmakedefine HAVE_IOCTLSOCKET_CAMEL_FIONBIO ${HAVE_IOCTLSOCKET_CAMEL_FIONBIO} /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ #cmakedefine HAVE_IOCTLSOCKET_FIONBIO ${HAVE_IOCTLSOCKET_FIONBIO} /* Define to 1 if you have a working ioctl FIONBIO function. */ #cmakedefine HAVE_IOCTL_FIONBIO ${HAVE_IOCTL_FIONBIO} /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ #cmakedefine HAVE_IOCTL_SIOCGIFADDR ${HAVE_IOCTL_SIOCGIFADDR} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_IO_H ${HAVE_IO_H} /* if you have the Kerberos4 libraries (including -ldes) */ #cmakedefine HAVE_KRB4 ${HAVE_KRB4} /* Define to 1 if you have the `krb_get_our_ip_for_realm' function. */ #cmakedefine HAVE_KRB_GET_OUR_IP_FOR_REALM ${HAVE_KRB_GET_OUR_IP_FOR_REALM} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_KRB_H ${HAVE_KRB_H} /* Define to 1 if you have the lber.h header file. */ #cmakedefine HAVE_LBER_H ${HAVE_LBER_H} /* Define to 1 if you have the ldapssl.h header file. */ #cmakedefine HAVE_LDAPSSL_H ${HAVE_LDAPSSL_H} /* Define to 1 if you have the ldap.h header file. */ #cmakedefine HAVE_LDAP_H ${HAVE_LDAP_H} /* Use LDAPS implementation */ #cmakedefine HAVE_LDAP_SSL ${HAVE_LDAP_SSL} /* Define to 1 if you have the ldap_ssl.h header file. */ #cmakedefine HAVE_LDAP_SSL_H ${HAVE_LDAP_SSL_H} /* Define to 1 if you have the `ldap_url_parse' function. */ #cmakedefine HAVE_LDAP_URL_PARSE ${HAVE_LDAP_URL_PARSE} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LIBGEN_H ${HAVE_LIBGEN_H} /* Define to 1 if you have the `idn' library (-lidn). */ #cmakedefine HAVE_LIBIDN ${HAVE_LIBIDN} /* Define to 1 if you have the `resolv' library (-lresolv). */ #cmakedefine HAVE_LIBRESOLV ${HAVE_LIBRESOLV} /* Define to 1 if you have the `resolve' library (-lresolve). */ #cmakedefine HAVE_LIBRESOLVE ${HAVE_LIBRESOLVE} /* Define to 1 if you have the `socket' library (-lsocket). */ #cmakedefine HAVE_LIBSOCKET ${HAVE_LIBSOCKET} /* Define to 1 if you have the `ssh2' library (-lssh2). */ #cmakedefine HAVE_LIBSSH2 ${HAVE_LIBSSH2} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LIBSSH2_H ${HAVE_LIBSSH2_H} /* Define to 1 if you have the `ssl' library (-lssl). */ #cmakedefine HAVE_LIBSSL ${HAVE_LIBSSL} /* if zlib is available */ #cmakedefine HAVE_LIBZ ${HAVE_LIBZ} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LIMITS_H ${HAVE_LIMITS_H} /* if your compiler supports LL */ #cmakedefine HAVE_LL ${HAVE_LL} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LOCALE_H ${HAVE_LOCALE_H} /* Define to 1 if you have a working localtime_r function. */ #cmakedefine HAVE_LOCALTIME_R ${HAVE_LOCALTIME_R} /* Define to 1 if the compiler supports the 'long long' data type. */ #cmakedefine HAVE_LONGLONG ${HAVE_LONGLONG} /* Define to 1 if you have the malloc.h header file. */ #cmakedefine HAVE_MALLOC_H ${HAVE_MALLOC_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_MEMORY_H ${HAVE_MEMORY_H} /* Define to 1 if you have the MSG_NOSIGNAL flag. */ #cmakedefine HAVE_MSG_NOSIGNAL ${HAVE_MSG_NOSIGNAL} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NETDB_H ${HAVE_NETDB_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NETINET_IN_H ${HAVE_NETINET_IN_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NETINET_TCP_H ${HAVE_NETINET_TCP_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NET_IF_H ${HAVE_NET_IF_H} /* Define to 1 if NI_WITHSCOPEID exists and works. */ #cmakedefine HAVE_NI_WITHSCOPEID ${HAVE_NI_WITHSCOPEID} /* if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE */ #cmakedefine HAVE_OLD_GSSMIT ${HAVE_OLD_GSSMIT} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_OPENSSL_CRYPTO_H ${HAVE_OPENSSL_CRYPTO_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_OPENSSL_ENGINE_H ${HAVE_OPENSSL_ENGINE_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_OPENSSL_ERR_H ${HAVE_OPENSSL_ERR_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_OPENSSL_PEM_H ${HAVE_OPENSSL_PEM_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_OPENSSL_PKCS12_H ${HAVE_OPENSSL_PKCS12_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_OPENSSL_RSA_H ${HAVE_OPENSSL_RSA_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_OPENSSL_SSL_H ${HAVE_OPENSSL_SSL_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_OPENSSL_X509_H ${HAVE_OPENSSL_X509_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_PEM_H ${HAVE_PEM_H} /* Define to 1 if you have the `perror' function. */ #cmakedefine HAVE_PERROR ${HAVE_PERROR} /* Define to 1 if you have the `pipe' function. */ #cmakedefine HAVE_PIPE ${HAVE_PIPE} /* Define to 1 if you have a working poll function. */ #cmakedefine HAVE_POLL ${HAVE_POLL} /* If you have a fine poll */ #cmakedefine HAVE_POLL_FINE ${HAVE_POLL_FINE} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_POLL_H ${HAVE_POLL_H} /* Define to 1 if you have a working POSIX-style strerror_r function. */ #cmakedefine HAVE_POSIX_STRERROR_R ${HAVE_POSIX_STRERROR_R} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_PWD_H ${HAVE_PWD_H} /* Define to 1 if you have the `RAND_egd' function. */ #cmakedefine HAVE_RAND_EGD ${HAVE_RAND_EGD} /* Define to 1 if you have the `RAND_screen' function. */ #cmakedefine HAVE_RAND_SCREEN ${HAVE_RAND_SCREEN} /* Define to 1 if you have the `RAND_status' function. */ #cmakedefine HAVE_RAND_STATUS ${HAVE_RAND_STATUS} /* Define to 1 if you have the recv function. */ #cmakedefine HAVE_RECV ${HAVE_RECV} /* Define to 1 if you have the recvfrom function. */ #cmakedefine HAVE_RECVFROM ${HAVE_RECVFROM} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_RSA_H ${HAVE_RSA_H} /* Define to 1 if you have the select function. */ #cmakedefine HAVE_SELECT ${HAVE_SELECT} /* Define to 1 if you have the send function. */ #cmakedefine HAVE_SEND ${HAVE_SEND} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SETJMP_H ${HAVE_SETJMP_H} /* Define to 1 if you have the `setlocale' function. */ #cmakedefine HAVE_SETLOCALE ${HAVE_SETLOCALE} /* Define to 1 if you have the `setmode' function. */ #cmakedefine HAVE_SETMODE ${HAVE_SETMODE} /* Define to 1 if you have the `setrlimit' function. */ #cmakedefine HAVE_SETRLIMIT ${HAVE_SETRLIMIT} /* Define to 1 if you have the setsockopt function. */ #cmakedefine HAVE_SETSOCKOPT ${HAVE_SETSOCKOPT} /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ #cmakedefine HAVE_SETSOCKOPT_SO_NONBLOCK ${HAVE_SETSOCKOPT_SO_NONBLOCK} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SGTTY_H ${HAVE_SGTTY_H} /* Define to 1 if you have the sigaction function. */ #cmakedefine HAVE_SIGACTION ${HAVE_SIGACTION} /* Define to 1 if you have the siginterrupt function. */ #cmakedefine HAVE_SIGINTERRUPT ${HAVE_SIGINTERRUPT} /* Define to 1 if you have the signal function. */ #cmakedefine HAVE_SIGNAL ${HAVE_SIGNAL} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SIGNAL_H ${HAVE_SIGNAL_H} /* Define to 1 if you have the sigsetjmp function or macro. */ #cmakedefine HAVE_SIGSETJMP ${HAVE_SIGSETJMP} /* Define to 1 if sig_atomic_t is an available typedef. */ #cmakedefine HAVE_SIG_ATOMIC_T ${HAVE_SIG_ATOMIC_T} /* Define to 1 if sig_atomic_t is already defined as volatile. */ #cmakedefine HAVE_SIG_ATOMIC_T_VOLATILE ${HAVE_SIG_ATOMIC_T_VOLATILE} /* Define to 1 if struct sockaddr_in6 has the sin6_scope_id member */ #cmakedefine HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID ${HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID} /* Define to 1 if you have the `socket' function. */ #cmakedefine HAVE_SOCKET ${HAVE_SOCKET} /* Define this if you have the SPNEGO library fbopenssl */ #cmakedefine HAVE_SPNEGO ${HAVE_SPNEGO} /* Define to 1 if you have the `SSL_get_shutdown' function. */ #cmakedefine HAVE_SSL_GET_SHUTDOWN ${HAVE_SSL_GET_SHUTDOWN} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SSL_H ${HAVE_SSL_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDBOOL_H ${HAVE_STDBOOL_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDIO_H ${HAVE_STDIO_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDLIB_H ${HAVE_STDLIB_H} /* Define to 1 if you have the strcasecmp function. */ #cmakedefine HAVE_STRCASECMP ${HAVE_STRCASECMP} /* Define to 1 if you have the strcasestr function. */ #cmakedefine HAVE_STRCASESTR ${HAVE_STRCASESTR} /* Define to 1 if you have the strcmpi function. */ #cmakedefine HAVE_STRCMPI ${HAVE_STRCMPI} /* Define to 1 if you have the strdup function. */ #cmakedefine HAVE_STRDUP ${HAVE_STRDUP} /* Define to 1 if you have the strerror_r function. */ #cmakedefine HAVE_STRERROR_R ${HAVE_STRERROR_R} /* Define to 1 if you have the stricmp function. */ #cmakedefine HAVE_STRICMP ${HAVE_STRICMP} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRINGS_H ${HAVE_STRINGS_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRING_H ${HAVE_STRING_H} /* Define to 1 if you have the strlcat function. */ #cmakedefine HAVE_STRLCAT ${HAVE_STRLCAT} /* Define to 1 if you have the `strlcpy' function. */ #cmakedefine HAVE_STRLCPY ${HAVE_STRLCPY} /* Define to 1 if you have the strncasecmp function. */ #cmakedefine HAVE_STRNCASECMP ${HAVE_STRNCASECMP} /* Define to 1 if you have the strncmpi function. */ #cmakedefine HAVE_STRNCMPI ${HAVE_STRNCMPI} /* Define to 1 if you have the strnicmp function. */ #cmakedefine HAVE_STRNICMP ${HAVE_STRNICMP} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STROPTS_H ${HAVE_STROPTS_H} /* Define to 1 if you have the strstr function. */ #cmakedefine HAVE_STRSTR ${HAVE_STRSTR} /* Define to 1 if you have the strtok_r function. */ #cmakedefine HAVE_STRTOK_R ${HAVE_STRTOK_R} /* Define to 1 if you have the strtoll function. */ #cmakedefine HAVE_STRTOLL ${HAVE_STRTOLL} /* if struct sockaddr_storage is defined */ #cmakedefine HAVE_STRUCT_SOCKADDR_STORAGE ${HAVE_STRUCT_SOCKADDR_STORAGE} /* Define to 1 if you have the timeval struct. */ #cmakedefine HAVE_STRUCT_TIMEVAL ${HAVE_STRUCT_TIMEVAL} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_FILIO_H ${HAVE_SYS_FILIO_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_IOCTL_H ${HAVE_SYS_IOCTL_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_PARAM_H ${HAVE_SYS_PARAM_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_POLL_H ${HAVE_SYS_POLL_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_RESOURCE_H ${HAVE_SYS_RESOURCE_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_SELECT_H ${HAVE_SYS_SELECT_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_SOCKET_H ${HAVE_SYS_SOCKET_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_SOCKIO_H ${HAVE_SYS_SOCKIO_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_STAT_H ${HAVE_SYS_STAT_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TIME_H ${HAVE_SYS_TIME_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TYPES_H ${HAVE_SYS_TYPES_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_UIO_H ${HAVE_SYS_UIO_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_UN_H ${HAVE_SYS_UN_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_UTIME_H ${HAVE_SYS_UTIME_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_TERMIOS_H ${HAVE_TERMIOS_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_TERMIO_H ${HAVE_TERMIO_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_TIME_H ${HAVE_TIME_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_TLD_H ${HAVE_TLD_H} /* Define to 1 if you have the `tld_strerror' function. */ #cmakedefine HAVE_TLD_STRERROR ${HAVE_TLD_STRERROR} /* Define to 1 if you have the `uname' function. */ #cmakedefine HAVE_UNAME ${HAVE_UNAME} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UNISTD_H ${HAVE_UNISTD_H} /* Define to 1 if you have the `utime' function. */ #cmakedefine HAVE_UTIME ${HAVE_UTIME} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UTIME_H ${HAVE_UTIME_H} /* Define to 1 if compiler supports C99 variadic macro style. */ #cmakedefine HAVE_VARIADIC_MACROS_C99 ${HAVE_VARIADIC_MACROS_C99} /* Define to 1 if compiler supports old gcc variadic macro style. */ #cmakedefine HAVE_VARIADIC_MACROS_GCC ${HAVE_VARIADIC_MACROS_GCC} /* Define to 1 if you have the winber.h header file. */ #cmakedefine HAVE_WINBER_H ${HAVE_WINBER_H} /* Define to 1 if you have the windows.h header file. */ #cmakedefine HAVE_WINDOWS_H ${HAVE_WINDOWS_H} /* Define to 1 if you have the winldap.h header file. */ #cmakedefine HAVE_WINLDAP_H ${HAVE_WINLDAP_H} /* Define to 1 if you have the winsock2.h header file. */ #cmakedefine HAVE_WINSOCK2_H ${HAVE_WINSOCK2_H} /* Define to 1 if you have the winsock.h header file. */ #cmakedefine HAVE_WINSOCK_H ${HAVE_WINSOCK_H} /* Define this symbol if your OS supports changing the contents of argv */ #cmakedefine HAVE_WRITABLE_ARGV ${HAVE_WRITABLE_ARGV} /* Define to 1 if you have the writev function. */ #cmakedefine HAVE_WRITEV ${HAVE_WRITEV} /* Define to 1 if you have the ws2tcpip.h header file. */ #cmakedefine HAVE_WS2TCPIP_H ${HAVE_WS2TCPIP_H} /* Define to 1 if you have the header file. */ #cmakedefine HAVE_X509_H ${HAVE_X509_H} /* Define if you have the header file. */ #cmakedefine HAVE_PROCESS_H ${HAVE_PROCESS_H} /* if you have the zlib.h header file */ #cmakedefine HAVE_ZLIB_H ${HAVE_ZLIB_H} /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #cmakedefine LT_OBJDIR ${LT_OBJDIR} /* If you lack a fine basename() prototype */ #cmakedefine NEED_BASENAME_PROTO ${NEED_BASENAME_PROTO} /* Define to 1 if you need the lber.h header file even with ldap.h */ #cmakedefine NEED_LBER_H ${NEED_LBER_H} /* Define to 1 if you need the malloc.h header file even with stdlib.h */ #cmakedefine NEED_MALLOC_H ${NEED_MALLOC_H} /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ #cmakedefine NEED_REENTRANT ${NEED_REENTRANT} /* cpu-machine-OS */ #cmakedefine OS ${OS} /* Name of package */ #cmakedefine PACKAGE ${PACKAGE} /* Define to the address where bug reports for this package should be sent. */ #cmakedefine PACKAGE_BUGREPORT ${PACKAGE_BUGREPORT} /* Define to the full name of this package. */ #cmakedefine PACKAGE_NAME ${PACKAGE_NAME} /* Define to the full name and version of this package. */ #cmakedefine PACKAGE_STRING ${PACKAGE_STRING} /* Define to the one symbol short name of this package. */ #cmakedefine PACKAGE_TARNAME ${PACKAGE_TARNAME} /* Define to the version of this package. */ #cmakedefine PACKAGE_VERSION ${PACKAGE_VERSION} /* a suitable file to read random data from */ #cmakedefine RANDOM_FILE "${RANDOM_FILE}" /* Define to the type of arg 1 for recvfrom. */ #cmakedefine RECVFROM_TYPE_ARG1 ${RECVFROM_TYPE_ARG1} /* Define to the type pointed by arg 2 for recvfrom. */ #cmakedefine RECVFROM_TYPE_ARG2 ${RECVFROM_TYPE_ARG2} /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ #cmakedefine RECVFROM_TYPE_ARG2_IS_VOID ${RECVFROM_TYPE_ARG2_IS_VOID} /* Define to the type of arg 3 for recvfrom. */ #cmakedefine RECVFROM_TYPE_ARG3 ${RECVFROM_TYPE_ARG3} /* Define to the type of arg 4 for recvfrom. */ #cmakedefine RECVFROM_TYPE_ARG4 ${RECVFROM_TYPE_ARG4} /* Define to the type pointed by arg 5 for recvfrom. */ #cmakedefine RECVFROM_TYPE_ARG5 ${RECVFROM_TYPE_ARG5} /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ #cmakedefine RECVFROM_TYPE_ARG5_IS_VOID ${RECVFROM_TYPE_ARG5_IS_VOID} /* Define to the type pointed by arg 6 for recvfrom. */ #cmakedefine RECVFROM_TYPE_ARG6 ${RECVFROM_TYPE_ARG6} /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ #cmakedefine RECVFROM_TYPE_ARG6_IS_VOID ${RECVFROM_TYPE_ARG6_IS_VOID} /* Define to the function return type for recvfrom. */ #cmakedefine RECVFROM_TYPE_RETV ${RECVFROM_TYPE_RETV} /* Define to the type of arg 1 for recv. */ #cmakedefine RECV_TYPE_ARG1 ${RECV_TYPE_ARG1} /* Define to the type of arg 2 for recv. */ #cmakedefine RECV_TYPE_ARG2 ${RECV_TYPE_ARG2} /* Define to the type of arg 3 for recv. */ #cmakedefine RECV_TYPE_ARG3 ${RECV_TYPE_ARG3} /* Define to the type of arg 4 for recv. */ #cmakedefine RECV_TYPE_ARG4 ${RECV_TYPE_ARG4} /* Define to the function return type for recv. */ #cmakedefine RECV_TYPE_RETV ${RECV_TYPE_RETV} /* Define as the return type of signal handlers (`int' or `void'). */ #cmakedefine RETSIGTYPE ${RETSIGTYPE} /* Define to the type qualifier of arg 5 for select. */ #cmakedefine SELECT_QUAL_ARG5 ${SELECT_QUAL_ARG5} /* Define to the type of arg 1 for select. */ #cmakedefine SELECT_TYPE_ARG1 ${SELECT_TYPE_ARG1} /* Define to the type of args 2, 3 and 4 for select. */ #cmakedefine SELECT_TYPE_ARG234 ${SELECT_TYPE_ARG234} /* Define to the type of arg 5 for select. */ #cmakedefine SELECT_TYPE_ARG5 ${SELECT_TYPE_ARG5} /* Define to the function return type for select. */ #cmakedefine SELECT_TYPE_RETV ${SELECT_TYPE_RETV} /* Define to the type qualifier of arg 2 for send. */ #cmakedefine SEND_QUAL_ARG2 ${SEND_QUAL_ARG2} /* Define to the type of arg 1 for send. */ #cmakedefine SEND_TYPE_ARG1 ${SEND_TYPE_ARG1} /* Define to the type of arg 2 for send. */ #cmakedefine SEND_TYPE_ARG2 ${SEND_TYPE_ARG2} /* Define to the type of arg 3 for send. */ #cmakedefine SEND_TYPE_ARG3 ${SEND_TYPE_ARG3} /* Define to the type of arg 4 for send. */ #cmakedefine SEND_TYPE_ARG4 ${SEND_TYPE_ARG4} /* Define to the function return type for send. */ #cmakedefine SEND_TYPE_RETV ${SEND_TYPE_RETV} /* The size of `int', as computed by sizeof. */ #cmakedefine SIZEOF_INT ${SIZEOF_INT} /* The size of `short', as computed by sizeof. */ #cmakedefine SIZEOF_SHORT ${SIZEOF_SHORT} /* The size of `long', as computed by sizeof. */ #cmakedefine SIZEOF_LONG ${SIZEOF_LONG} /* The size of `off_t', as computed by sizeof. */ #cmakedefine SIZEOF_OFF_T ${SIZEOF_OFF_T} /* The size of `size_t', as computed by sizeof. */ #cmakedefine SIZEOF_SIZE_T ${SIZEOF_SIZE_T} /* The size of `time_t', as computed by sizeof. */ #cmakedefine SIZEOF_TIME_T ${SIZEOF_TIME_T} /* The size of `void*', as computed by sizeof. */ #cmakedefine SIZEOF_VOIDP ${SIZEOF_VOIDP} /* Define to 1 if you have the ANSI C header files. */ #cmakedefine STDC_HEADERS ${STDC_HEADERS} /* Define to the type of arg 3 for strerror_r. */ #cmakedefine STRERROR_R_TYPE_ARG3 ${STRERROR_R_TYPE_ARG3} /* Define to 1 if you can safely include both and . */ #cmakedefine TIME_WITH_SYS_TIME ${TIME_WITH_SYS_TIME} /* Define if you want to enable c-ares support */ #cmakedefine USE_ARES ${USE_ARES} /* Define to disable non-blocking sockets. */ #cmakedefine USE_BLOCKING_SOCKETS ${USE_BLOCKING_SOCKETS} /* if GnuTLS is enabled */ #cmakedefine USE_GNUTLS ${USE_GNUTLS} /* if PolarSSL is enabled */ #cmakedefine USE_POLARSSL ${USE_POLARSSL} /* if libSSH2 is in use */ #cmakedefine USE_LIBSSH2 ${USE_LIBSSH2} /* If you want to build curl with the built-in manual */ #cmakedefine USE_MANUAL ${USE_MANUAL} /* if NSS is enabled */ #cmakedefine USE_NSS ${USE_NSS} /* if OpenSSL is in use */ #cmakedefine USE_OPENSSL ${USE_OPENSSL} /* if SSL is enabled */ #cmakedefine USE_SSLEAY ${USE_SSLEAY} /* Define to 1 if you are building a Windows target without large file support. */ #cmakedefine USE_WIN32_LARGE_FILES ${USE_WIN32_LARGE_FILES} /* to enable SSPI support */ #cmakedefine USE_WINDOWS_SSPI ${USE_WINDOWS_SSPI} /* Define to 1 if using yaSSL in OpenSSL compatibility mode. */ #cmakedefine USE_YASSLEMUL ${USE_YASSLEMUL} /* Version number of package */ #cmakedefine VERSION ${VERSION} /* Define to avoid automatic inclusion of winsock.h */ #cmakedefine WIN32_LEAN_AND_MEAN ${WIN32_LEAN_AND_MEAN} /* Define to 1 if OS is AIX. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Number of bits in a file offset, on hosts where this is settable. */ #cmakedefine _FILE_OFFSET_BITS ${_FILE_OFFSET_BITS} /* Define for large files, on AIX-style hosts. */ #cmakedefine _LARGE_FILES ${_LARGE_FILES} /* define this if you need it to compile thread-safe code */ #cmakedefine _THREAD_SAFE ${_THREAD_SAFE} /* Define to empty if `const' does not conform to ANSI C. */ #cmakedefine const ${const} /* Type to use in place of in_addr_t when system does not provide it. */ #cmakedefine in_addr_t ${in_addr_t} /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `unsigned int' if does not define. */ #cmakedefine size_t ${size_t} /* the signed version of size_t */ #cmakedefine ssize_t ${ssize_t} curl-7.35.0/lib/pingpong.h0000644000175000017500000001251312213173003012226 00000000000000#ifndef HEADER_CURL_PINGPONG_H #define HEADER_CURL_PINGPONG_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_FTP) || \ !defined(CURL_DISABLE_POP3) || !defined(CURL_DISABLE_SMTP) #define USE_PINGPONG #endif /* forward-declaration, this is defined in urldata.h */ struct connectdata; typedef enum { FTPTRANSFER_BODY, /* yes do transfer a body */ FTPTRANSFER_INFO, /* do still go through to get info/headers */ FTPTRANSFER_NONE, /* don't get anything and don't get info */ FTPTRANSFER_LAST /* end of list marker, never used */ } curl_pp_transfer; /* * 'pingpong' is the generic struct used for protocols doing server<->client * conversations in a back-and-forth style such as FTP, IMAP, POP3, SMTP etc. * * It holds response cache and non-blocking sending data. */ struct pingpong { char *cache; /* data cache between getresponse()-calls */ size_t cache_size; /* size of cache in bytes */ size_t nread_resp; /* number of bytes currently read of a server response */ char *linestart_resp; /* line start pointer for the server response reader function */ bool pending_resp; /* set TRUE when a server response is pending or in progress, and is cleared once the last response is read */ char *sendthis; /* allocated pointer to a buffer that is to be sent to the 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 */ long response_time; /* When no timeout is given, this is the amount of milliseconds we await for a server response. */ struct connectdata *conn; /* points to the connectdata struct that this belongs to */ /* Function pointers the protocols MUST implement and provide for the pingpong layer to function */ CURLcode (*statemach_act)(struct connectdata *conn); bool (*endofresp)(struct connectdata *conn, char *ptr, size_t len, int *code); }; /* * Curl_pp_statemach() * * called repeatedly until done. Set 'wait' to make it wait a while on the * socket if there's no traffic. */ CURLcode Curl_pp_statemach(struct pingpong *pp, bool block); /* initialize stuff to prepare for reading a fresh new response */ void Curl_pp_init(struct pingpong *pp); /* Returns timeout in ms. 0 or negative number means the timeout has already triggered */ long Curl_pp_state_timeout(struct pingpong *pp); /*********************************************************************** * * Curl_pp_sendf() * * Send the formated string as a command to a pingpong server. Note that * the string should not have any CRLF appended, as this function will * append the necessary things itself. * * made to never block */ CURLcode Curl_pp_sendf(struct pingpong *pp, const char *fmt, ...); /*********************************************************************** * * Curl_pp_vsendf() * * Send the formated string as a command to a pingpong server. Note that * the string should not have any CRLF appended, as this function will * append the necessary things itself. * * made to never block */ CURLcode Curl_pp_vsendf(struct pingpong *pp, const char *fmt, va_list args); /* * Curl_pp_readresp() * * Reads a piece of a server response. */ CURLcode Curl_pp_readresp(curl_socket_t sockfd, struct pingpong *pp, int *code, /* return the server code if done */ size_t *size); /* size of the response */ CURLcode Curl_pp_flushsend(struct pingpong *pp); /* call this when a pingpong connection is disconnected */ CURLcode Curl_pp_disconnect(struct pingpong *pp); int Curl_pp_getsock(struct pingpong *pp, curl_socket_t *socks, int numsocks); /*********************************************************************** * * Curl_pp_moredata() * * Returns whether there are still more data in the cache and so a call * to Curl_pp_readresp() will not block. */ bool Curl_pp_moredata(struct pingpong *pp); #endif /* HEADER_CURL_PINGPONG_H */ curl-7.35.0/lib/url.h0000644000175000017500000000712412262353672011231 00000000000000#ifndef HEADER_CURL_URL_H #define HEADER_CURL_URL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" /* * Prototypes for library-wide functions provided by url.c */ CURLcode Curl_open(struct SessionHandle **curl); CURLcode Curl_init_userdefined(struct UserDefined *set); CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, va_list arg); CURLcode Curl_dupset(struct SessionHandle * dst, struct SessionHandle * src); void Curl_freeset(struct SessionHandle * data); CURLcode Curl_close(struct SessionHandle *data); /* opposite of curl_open() */ CURLcode Curl_connect(struct SessionHandle *, struct connectdata **, bool *async, bool *protocol_connect); CURLcode Curl_do(struct connectdata **, bool *done); CURLcode Curl_do_more(struct connectdata *, int *completed); CURLcode Curl_done(struct connectdata **, CURLcode, bool premature); CURLcode Curl_disconnect(struct connectdata *, bool dead_connection); 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); CURLcode Curl_setup_conn(struct connectdata *conn, bool *protocol_done); void Curl_free_request_state(struct SessionHandle *data); 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); bool Curl_isPipeliningEnabled(const struct SessionHandle *handle); CURLcode Curl_addHandleToPipeline(struct SessionHandle *handle, struct curl_llist *pipeline); int Curl_removeHandleFromPipeline(struct SessionHandle *handle, struct curl_llist *pipeline); /* remove the specified connection from all (possible) pipelines and related queues */ void Curl_getoff_all_pipelines(struct SessionHandle *data, struct connectdata *conn); void Curl_close_connections(struct SessionHandle *data); #define CURL_DEFAULT_PROXY_PORT 1080 /* default proxy port unless specified */ #define CURL_DEFAULT_SOCKS5_GSSAPI_SERVICE "rcmd" /* default socks5 gssapi service */ CURLcode Curl_connected_proxy(struct connectdata *conn, int sockindex); #ifdef CURL_DISABLE_VERBOSE_STRINGS #define Curl_verboseconnect(x) Curl_nop_stmt #else void Curl_verboseconnect(struct connectdata *conn); #endif #endif /* HEADER_CURL_URL_H */ curl-7.35.0/lib/Makefile.vc80000644000175000017500000005233112272124477012415 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1999 - 2014, 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. # #*************************************************************************** # All files in the Makefile.vc* series are generated automatically from the # one made for MSVC version 6. Alas, if you want to do changes to any of the # files and send back to the project, edit the version six, make your diff and # mail curl-library. ########################################################################### # # Makefile for building libcurl with MSVC8 # # 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. # ############################################################## # ---------------------------------------------- # Verify that current subdir is libcurl's 'lib' # ---------------------------------------------- !IF ! EXIST(.\curl_addrinfo.c) ! MESSAGE Can not process this makefile from outside of libcurl's 'lib' subdirectory. ! MESSAGE Change to libcurl's 'lib' subdirectory, and try again. ! ERROR See previous message. !ENDIF # ------------------------------------------------ # Makefile.msvc.names provides libcurl file names # ------------------------------------------------ !INCLUDE ..\winbuild\Makefile.msvc.names !IFNDEF OPENSSL_PATH OPENSSL_PATH = ../../openssl-0.9.8y !ENDIF !IFNDEF LIBSSH2_PATH LIBSSH2_PATH = ../../libssh2-1.4.3 !ENDIF !IFNDEF ZLIB_PATH ZLIB_PATH = ../../zlib-1.2.8 !ENDIF !IFNDEF MACHINE MACHINE = X86 !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". Since at least with MSVC8 the sspi.h # header is broken it is either required to install the Windows SDK, # or to fix sspi.h with adding this define at the beginning of sspi.h: # #define FreeCredentialHandle FreeCredentialsHandle # # 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/ # WINDOWS_SSPI = 1 !IFDEF WINDOWS_SSPI !IFNDEF WINDOWS_SDK_PATH WINDOWS_SDK_PATH = "$(PROGRAMFILES)\Microsoft SDK" !ENDIF !ENDIF ############################################################# ## Nothing more to do below this line! CCNODBG = cl.exe /O2 /DNDEBUG CCDEBUG = cl.exe /Od /Gm /Zi /D_DEBUG /RTC1 CFLAGSSSL = /DUSE_SSLEAY /DUSE_OPENSSL /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl" CFLAGSWINSSL = /DUSE_SCHANNEL CFLAGSSSH2 = /DUSE_LIBSSH2 /DCURL_DISABLE_LDAP /DHAVE_LIBSSH2 /DHAVE_LIBSSH2_H /DLIBSSH2_WIN32 /DLIBSSH2_LIBRARY /I "$(LIBSSH2_PATH)/include" CFLAGSZLIB = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I "$(ZLIB_PATH)" CFLAGS = /I. /I../include /nologo /W3 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL /D_BIND_TO_CURRENT_VCLIBS_VERSION=1 CFLAGSLIB = /DCURL_STATICLIB LNKDLL = link.exe /DLL LNKLIB = link.exe /lib LFLAGS = /nologo /machine:$(MACHINE) SSLLIBS = libeay32.lib ssleay32.lib ZLIBLIBSDLL = zdll.lib ZLIBLIBS = zlib.lib WINLIBS = ws2_32.lib bufferoverflowu.lib wldap32.lib advapi32.lib CFLAGS = $(CFLAGS) CFGSET = FALSE !IFDEF WINDOWS_SSPI CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include !ENDIF !IFDEF USE_IPV6 CFLAGS = $(CFLAGS) /DUSE_IPV6 !ENDIF ############################################################## # Runtime library configuration RTLIB = /MD RTLIBD = /MDd !IF "$(RTLIBCFG)" == "static" RTLIB = /MT RTLIBD = /MTd !ENDIF ###################### # release !IF "$(CFG)" == "release" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl !IF "$(CFG)" == "release-ssl" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-winssl !IF "$(CFG)" == "release-winssl" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSWINSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-zlib !IF "$(CFG)" == "release-zlib" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl-zlib !IF "$(CFG)" == "release-ssl-zlib" TARGET = $(LIBCURL_STA_LIB_REL) 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-winssl-zlib !IF "$(CFG)" == "release-winssl-zlib" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSWINSSL) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl-ssh2-zlib !IF "$(CFG)" == "release-ssl-ssh2-zlib" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" LFLAGSSSH2 = "/LIBPATH:$(LIBSSH2_PATH)" LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(LFLAGSSSL) $(LFLAGSSSH2) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSSSH2) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl-dll !IF "$(CFG)" == "release-ssl-dll" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-zlib-dll !IF "$(CFG)" == "release-zlib-dll" TARGET = $(LIBCURL_STA_LIB_REL) 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 = $(LIBCURL_STA_LIB_REL) 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 !IF "$(CFG)" == "release-dll" TARGET = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LNK = $(LNKDLL) $(WINLIBS) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) CC = $(CCNODBG) $(RTLIB) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # release-dll-ssl-dll !IF "$(CFG)" == "release-dll-ssl-dll" TARGET = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # release-dll-zlib-dll !IF "$(CFG)" == "release-dll-zlib-dll" TARGET = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKDLL) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) 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 = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSZLIB) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # debug !IF "$(CFG)" == "debug" TARGET = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-ssl !IF "$(CFG)" == "debug-ssl" TARGET = $(LIBCURL_STA_LIB_DBG) 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 = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-ssl-zlib !IF "$(CFG)" == "debug-ssl-zlib" TARGET = $(LIBCURL_STA_LIB_DBG) 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-ssl-ssh2-zlib !IF "$(CFG)" == "debug-ssl-ssh2-zlib" TARGET = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LFLAGSSSH2 = "/LIBPATH:$(LIBSSH2_PATH)" LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSSSL) $(LFLAGSSSH2) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSSSH2) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-ssl-dll !IF "$(CFG)" == "debug-ssl-dll" TARGET = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)\out32dll LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-zlib-dll !IF "$(CFG)" == "debug-zlib-dll" TARGET = $(LIBCURL_STA_LIB_DBG) 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 = $(LIBCURL_STA_LIB_DBG) 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 = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LNK = $(LNKDLL) $(WINLIBS) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_PDB) CC = $(CCDEBUG) $(RTLIBD) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # debug-dll-ssl-dll !IF "$(CFG)" == "debug-dll-ssl-dll" TARGET = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_PDB) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # debug-dll-zlib-dll !IF "$(CFG)" == "debug-dll-zlib-dll" TARGET = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKDLL) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_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 = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_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-ssh2-zlib - release static library with ssl, ssh2 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-ssh2-zlib - debug static library with ssl, ssh2 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)\amigaos.obj \ $(DIROBJ)\asyn-ares.obj \ $(DIROBJ)\asyn-thread.obj \ $(DIROBJ)\axtls.obj \ $(DIROBJ)\base64.obj \ $(DIROBJ)\bundles.obj \ $(DIROBJ)\conncache.obj \ $(DIROBJ)\connect.obj \ $(DIROBJ)\content_encoding.obj \ $(DIROBJ)\cookie.obj \ $(DIROBJ)\curl_addrinfo.obj \ $(DIROBJ)\curl_darwinssl.obj \ $(DIROBJ)\curl_fnmatch.obj \ $(DIROBJ)\curl_gethostname.obj \ $(DIROBJ)\curl_gssapi.obj \ $(DIROBJ)\curl_memrchr.obj \ $(DIROBJ)\curl_multibyte.obj \ $(DIROBJ)\curl_ntlm.obj \ $(DIROBJ)\curl_ntlm_core.obj \ $(DIROBJ)\curl_ntlm_msgs.obj \ $(DIROBJ)\curl_ntlm_wb.obj \ $(DIROBJ)\curl_rtmp.obj \ $(DIROBJ)\curl_sasl.obj \ $(DIROBJ)\curl_schannel.obj \ $(DIROBJ)\curl_sspi.obj \ $(DIROBJ)\curl_threads.obj \ $(DIROBJ)\cyassl.obj \ $(DIROBJ)\dict.obj \ $(DIROBJ)\dotdot.obj \ $(DIROBJ)\easy.obj \ $(DIROBJ)\escape.obj \ $(DIROBJ)\file.obj \ $(DIROBJ)\fileinfo.obj \ $(DIROBJ)\formdata.obj \ $(DIROBJ)\ftp.obj \ $(DIROBJ)\ftplistparser.obj \ $(DIROBJ)\getenv.obj \ $(DIROBJ)\getinfo.obj \ $(DIROBJ)\gopher.obj \ $(DIROBJ)\gtls.obj \ $(DIROBJ)\hash.obj \ $(DIROBJ)\hmac.obj \ $(DIROBJ)\hostasyn.obj \ $(DIROBJ)\hostcheck.obj \ $(DIROBJ)\hostip.obj \ $(DIROBJ)\hostip4.obj \ $(DIROBJ)\hostip6.obj \ $(DIROBJ)\hostsyn.obj \ $(DIROBJ)\http.obj \ $(DIROBJ)\http_chunks.obj \ $(DIROBJ)\http_digest.obj \ $(DIROBJ)\http_negotiate.obj \ $(DIROBJ)\http_negotiate_sspi.obj \ $(DIROBJ)\http_proxy.obj \ $(DIROBJ)\idn_win32.obj \ $(DIROBJ)\if2ip.obj \ $(DIROBJ)\imap.obj \ $(DIROBJ)\inet_ntop.obj \ $(DIROBJ)\inet_pton.obj \ $(DIROBJ)\krb5.obj \ $(DIROBJ)\ldap.obj \ $(DIROBJ)\llist.obj \ $(DIROBJ)\md4.obj \ $(DIROBJ)\md5.obj \ $(DIROBJ)\memdebug.obj \ $(DIROBJ)\mprintf.obj \ $(DIROBJ)\multi.obj \ $(DIROBJ)\netrc.obj \ $(DIROBJ)\non-ascii.obj \ $(DIROBJ)\nonblock.obj \ $(DIROBJ)\nss.obj \ $(DIROBJ)\openldap.obj \ $(DIROBJ)\parsedate.obj \ $(DIROBJ)\pingpong.obj \ $(DIROBJ)\pipeline.obj \ $(DIROBJ)\polarssl.obj \ $(DIROBJ)\polarssl_threadlock.obj \ $(DIROBJ)\pop3.obj \ $(DIROBJ)\progress.obj \ $(DIROBJ)\qssl.obj \ $(DIROBJ)\rawstr.obj \ $(DIROBJ)\rtsp.obj \ $(DIROBJ)\security.obj \ $(DIROBJ)\select.obj \ $(DIROBJ)\sendf.obj \ $(DIROBJ)\share.obj \ $(DIROBJ)\slist.obj \ $(DIROBJ)\smtp.obj \ $(DIROBJ)\socks.obj \ $(DIROBJ)\socks_gssapi.obj \ $(DIROBJ)\socks_sspi.obj \ $(DIROBJ)\speedcheck.obj \ $(DIROBJ)\splay.obj \ $(DIROBJ)\ssh.obj \ $(DIROBJ)\vtls.obj \ $(DIROBJ)\openssl.obj \ $(DIROBJ)\strdup.obj \ $(DIROBJ)\strequal.obj \ $(DIROBJ)\strerror.obj \ $(DIROBJ)\strtok.obj \ $(DIROBJ)\strtoofft.obj \ $(DIROBJ)\telnet.obj \ $(DIROBJ)\tftp.obj \ $(DIROBJ)\timeval.obj \ $(DIROBJ)\transfer.obj \ $(DIROBJ)\url.obj \ $(DIROBJ)\version.obj \ $(DIROBJ)\warnless.obj \ $(DIROBJ)\wildcard.obj \ $(RESOURCE) all : $(TARGET) $(TARGET): $(X_OBJS) $(LNK) $(LFLAGS) $(X_OBJS) -xcopy $(DIROBJ)\$(LIBCURL_STA_LIB_REL) . /y -xcopy $(DIROBJ)\$(LIBCURL_STA_LIB_DBG) . /y -xcopy $(DIROBJ)\$(LIBCURL_DYN_LIB_REL) . /y -xcopy $(DIROBJ)\$(LIBCURL_DYN_LIB_DBG) . /y -xcopy $(DIROBJ)\$(LIBCURL_IMP_LIB_REL) . /y -xcopy $(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) . /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"$@" $< {.\vtls\}.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 /dDEBUGBUILD=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 /dDEBUGBUILD=0 /Fo $@ libcurl.rc !ENDIF # End of case where a config was provided. curl-7.35.0/lib/ssh.c0000644000175000017500000031571312270035364011217 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* #define CURL_LIBSSH2_DEBUG */ #include "curl_setup.h" #ifdef USE_LIBSSH2 #ifdef HAVE_LIMITS_H # include #endif #include #include #ifdef HAVE_FCNTL_H #include #endif #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 #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 "hostip.h" #include "progress.h" #include "transfer.h" #include "escape.h" #include "http.h" /* for HTTP proxy tunnel stuff */ #include "ssh.h" #include "url.h" #include "speedcheck.h" #include "getinfo.h" #include "strequal.h" #include "vtls/vtls.h" #include "connect.h" #include "strerror.h" #include "inet_ntop.h" #include "parsedate.h" /* for the week day and month names */ #include "sockaddr.h" /* required for Curl_sockaddr_storage */ #include "strtoofft.h" #include "multiif.h" #include "select.h" #include "warnless.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" #ifdef WIN32 # undef PATH_MAX # define PATH_MAX MAX_PATH #endif #ifndef PATH_MAX #define PATH_MAX 1024 /* just an extra precaution since there are systems that have their definition hidden well */ #endif #define sftp_libssh2_last_error(s) curlx_ultosi(libssh2_sftp_last_error(s)) #define sftp_libssh2_realpath(s,p,t,m) \ libssh2_sftp_symlink_ex((s), (p), curlx_uztoui(strlen(p)), \ (t), (m), LIBSSH2_SFTP_REALPATH) /* Local functions: */ static const char *sftp_libssh2_strerror(int err); static LIBSSH2_ALLOC_FUNC(my_libssh2_malloc); static LIBSSH2_REALLOC_FUNC(my_libssh2_realloc); static LIBSSH2_FREE_FUNC(my_libssh2_free); static CURLcode get_pathname(const char **cpp, char **path); static CURLcode ssh_connect(struct connectdata *conn, bool *done); static CURLcode ssh_multi_statemach(struct connectdata *conn, bool *done); static CURLcode ssh_do(struct connectdata *conn, bool *done); static CURLcode ssh_getworkingpath(struct connectdata *conn, char *homedir, /* when SFTP is used */ char **path); static CURLcode scp_done(struct connectdata *conn, CURLcode, bool premature); static CURLcode scp_doing(struct connectdata *conn, bool *dophase_done); static CURLcode scp_disconnect(struct connectdata *conn, bool dead_connection); static CURLcode sftp_done(struct connectdata *conn, CURLcode, bool premature); static CURLcode sftp_doing(struct connectdata *conn, bool *dophase_done); static CURLcode sftp_disconnect(struct connectdata *conn, bool dead); static CURLcode sftp_perform(struct connectdata *conn, bool *connected, bool *dophase_done); static int ssh_getsock(struct connectdata *conn, curl_socket_t *sock, /* points to numsocks number of sockets */ int numsocks); static int ssh_perform_getsock(const struct connectdata *conn, curl_socket_t *sock, /* points to numsocks number of sockets */ int numsocks); static CURLcode ssh_setup_connection(struct connectdata *conn); /* * SCP protocol handler. */ const struct Curl_handler Curl_handler_scp = { "SCP", /* scheme */ ssh_setup_connection, /* setup_connection */ ssh_do, /* do_it */ scp_done, /* done */ ZERO_NULL, /* do_more */ ssh_connect, /* connect_it */ ssh_multi_statemach, /* connecting */ scp_doing, /* doing */ ssh_getsock, /* proto_getsock */ ssh_getsock, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ssh_perform_getsock, /* perform_getsock */ scp_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_SSH, /* defport */ CURLPROTO_SCP, /* protocol */ PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION | PROTOPT_NOURLQUERY /* flags */ }; /* * SFTP protocol handler. */ const struct Curl_handler Curl_handler_sftp = { "SFTP", /* scheme */ ssh_setup_connection, /* setup_connection */ ssh_do, /* do_it */ sftp_done, /* done */ ZERO_NULL, /* do_more */ ssh_connect, /* connect_it */ ssh_multi_statemach, /* connecting */ sftp_doing, /* doing */ ssh_getsock, /* proto_getsock */ ssh_getsock, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ssh_perform_getsock, /* perform_getsock */ sftp_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_SSH, /* defport */ CURLPROTO_SFTP, /* protocol */ PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION | PROTOPT_NOURLQUERY /* flags */ }; static void kbd_callback(const char *name, int name_len, const char *instruction, int instruction_len, int num_prompts, const LIBSSH2_USERAUTH_KBDINT_PROMPT *prompts, LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses, void **abstract) { struct connectdata *conn = (struct connectdata *)*abstract; #ifdef CURL_LIBSSH2_DEBUG fprintf(stderr, "name=%s\n", name); fprintf(stderr, "name_len=%d\n", name_len); fprintf(stderr, "instruction=%s\n", instruction); fprintf(stderr, "instruction_len=%d\n", instruction_len); fprintf(stderr, "num_prompts=%d\n", num_prompts); #else (void)name; (void)name_len; (void)instruction; (void)instruction_len; #endif /* CURL_LIBSSH2_DEBUG */ if(num_prompts == 1) { responses[0].text = strdup(conn->passwd); responses[0].length = curlx_uztoui(strlen(conn->passwd)); } (void)prompts; (void)abstract; } /* kbd_callback */ static CURLcode sftp_libssh2_error_to_CURLE(int err) { switch (err) { case LIBSSH2_FX_OK: return CURLE_OK; case LIBSSH2_FX_NO_SUCH_FILE: case LIBSSH2_FX_NO_SUCH_PATH: return CURLE_REMOTE_FILE_NOT_FOUND; case LIBSSH2_FX_PERMISSION_DENIED: case LIBSSH2_FX_WRITE_PROTECT: case LIBSSH2_FX_LOCK_CONFlICT: return CURLE_REMOTE_ACCESS_DENIED; case LIBSSH2_FX_NO_SPACE_ON_FILESYSTEM: case LIBSSH2_FX_QUOTA_EXCEEDED: return CURLE_REMOTE_DISK_FULL; case LIBSSH2_FX_FILE_ALREADY_EXISTS: return CURLE_REMOTE_FILE_EXISTS; case LIBSSH2_FX_DIR_NOT_EMPTY: return CURLE_QUOTE_ERROR; default: break; } return CURLE_SSH; } static CURLcode libssh2_session_error_to_CURLE(int err) { switch (err) { /* Ordered by order of appearance in libssh2.h */ case LIBSSH2_ERROR_NONE: return CURLE_OK; case LIBSSH2_ERROR_SOCKET_NONE: return CURLE_COULDNT_CONNECT; case LIBSSH2_ERROR_ALLOC: return CURLE_OUT_OF_MEMORY; case LIBSSH2_ERROR_SOCKET_SEND: return CURLE_SEND_ERROR; case LIBSSH2_ERROR_HOSTKEY_INIT: case LIBSSH2_ERROR_HOSTKEY_SIGN: case LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED: case LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED: return CURLE_PEER_FAILED_VERIFICATION; case LIBSSH2_ERROR_PASSWORD_EXPIRED: return CURLE_LOGIN_DENIED; case LIBSSH2_ERROR_SOCKET_TIMEOUT: case LIBSSH2_ERROR_TIMEOUT: return CURLE_OPERATION_TIMEDOUT; case LIBSSH2_ERROR_EAGAIN: return CURLE_AGAIN; } /* TODO: map some more of the libssh2 errors to the more appropriate CURLcode error code, and possibly add a few new SSH-related one. We must however not return or even depend on libssh2 errors in the public libcurl API */ return CURLE_SSH; } static LIBSSH2_ALLOC_FUNC(my_libssh2_malloc) { (void)abstract; /* arg not used */ return malloc(count); } static LIBSSH2_REALLOC_FUNC(my_libssh2_realloc) { (void)abstract; /* arg not used */ return realloc(ptr, count); } static LIBSSH2_FREE_FUNC(my_libssh2_free) { (void)abstract; /* arg not used */ if(ptr) /* ssh2 agent sometimes call free with null ptr */ free(ptr); } /* * SSH State machine related code */ /* This is the ONLY way to change SSH state! */ static void state(struct connectdata *conn, sshstate nowstate) { #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) /* for debug purposes */ static const char * const names[] = { "SSH_STOP", "SSH_INIT", "SSH_S_STARTUP", "SSH_HOSTKEY", "SSH_AUTHLIST", "SSH_AUTH_PKEY_INIT", "SSH_AUTH_PKEY", "SSH_AUTH_PASS_INIT", "SSH_AUTH_PASS", "SSH_AUTH_AGENT_INIT", "SSH_AUTH_AGENT_LIST", "SSH_AUTH_AGENT", "SSH_AUTH_HOST_INIT", "SSH_AUTH_HOST", "SSH_AUTH_KEY_INIT", "SSH_AUTH_KEY", "SSH_AUTH_DONE", "SSH_SFTP_INIT", "SSH_SFTP_REALPATH", "SSH_SFTP_QUOTE_INIT", "SSH_SFTP_POSTQUOTE_INIT", "SSH_SFTP_QUOTE", "SSH_SFTP_NEXT_QUOTE", "SSH_SFTP_QUOTE_STAT", "SSH_SFTP_QUOTE_SETSTAT", "SSH_SFTP_QUOTE_SYMLINK", "SSH_SFTP_QUOTE_MKDIR", "SSH_SFTP_QUOTE_RENAME", "SSH_SFTP_QUOTE_RMDIR", "SSH_SFTP_QUOTE_UNLINK", "SSH_SFTP_TRANS_INIT", "SSH_SFTP_UPLOAD_INIT", "SSH_SFTP_CREATE_DIRS_INIT", "SSH_SFTP_CREATE_DIRS", "SSH_SFTP_CREATE_DIRS_MKDIR", "SSH_SFTP_READDIR_INIT", "SSH_SFTP_READDIR", "SSH_SFTP_READDIR_LINK", "SSH_SFTP_READDIR_BOTTOM", "SSH_SFTP_READDIR_DONE", "SSH_SFTP_DOWNLOAD_INIT", "SSH_SFTP_DOWNLOAD_STAT", "SSH_SFTP_CLOSE", "SSH_SFTP_SHUTDOWN", "SSH_SCP_TRANS_INIT", "SSH_SCP_UPLOAD_INIT", "SSH_SCP_DOWNLOAD_INIT", "SSH_SCP_DONE", "SSH_SCP_SEND_EOF", "SSH_SCP_WAIT_EOF", "SSH_SCP_WAIT_CLOSE", "SSH_SCP_CHANNEL_FREE", "SSH_SESSION_DISCONNECT", "SSH_SESSION_FREE", "QUIT" }; #endif struct ssh_conn *sshc = &conn->proto.sshc; #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) if(sshc->state != nowstate) { infof(conn->data, "SFTP %p state change from %s to %s\n", (void *)sshc, names[sshc->state], names[nowstate]); } #endif sshc->state = nowstate; } /* figure out the path to work with in this particular request */ static CURLcode ssh_getworkingpath(struct connectdata *conn, char *homedir, /* when SFTP is used */ char **path) /* returns the allocated real path to work with */ { struct SessionHandle *data = conn->data; char *real_path = NULL; char *working_path; int working_path_len; working_path = curl_easy_unescape(data, data->state.path, 0, &working_path_len); if(!working_path) return CURLE_OUT_OF_MEMORY; /* Check for /~/ , indicating relative to the user's home directory */ if(conn->handler->protocol & CURLPROTO_SCP) { real_path = malloc(working_path_len+1); if(real_path == NULL) { free(working_path); return CURLE_OUT_OF_MEMORY; } if((working_path_len > 3) && (!memcmp(working_path, "/~/", 3))) /* It is referenced to the home directory, so strip the leading '/~/' */ memcpy(real_path, working_path+3, 4 + working_path_len-3); else memcpy(real_path, working_path, 1 + working_path_len); } else if(conn->handler->protocol & CURLPROTO_SFTP) { if((working_path_len > 1) && (working_path[1] == '~')) { size_t homelen = strlen(homedir); real_path = malloc(homelen + working_path_len + 1); if(real_path == NULL) { free(working_path); return CURLE_OUT_OF_MEMORY; } /* It is referenced to the home directory, so strip the leading '/' */ memcpy(real_path, homedir, homelen); real_path[homelen] = '/'; real_path[homelen+1] = '\0'; if(working_path_len > 3) { memcpy(real_path+homelen+1, working_path + 3, 1 + working_path_len -3); } } else { real_path = malloc(working_path_len+1); if(real_path == NULL) { free(working_path); return CURLE_OUT_OF_MEMORY; } memcpy(real_path, working_path, 1+working_path_len); } } free(working_path); /* store the pointer for the caller to receive */ *path = real_path; return CURLE_OK; } #ifdef HAVE_LIBSSH2_KNOWNHOST_API static int sshkeycallback(CURL *easy, const struct curl_khkey *knownkey, /* known */ const struct curl_khkey *foundkey, /* found */ enum curl_khmatch match, void *clientp) { (void)easy; (void)knownkey; (void)foundkey; (void)clientp; /* we only allow perfect matches, and we reject everything else */ return (match != CURLKHMATCH_OK)?CURLKHSTAT_REJECT:CURLKHSTAT_FINE; } #endif /* * Earlier libssh2 versions didn't have the ability to seek to 64bit positions * with 32bit size_t. */ #ifdef HAVE_LIBSSH2_SFTP_SEEK64 #define SFTP_SEEK(x,y) libssh2_sftp_seek64(x, (libssh2_uint64_t)y) #else #define SFTP_SEEK(x,y) libssh2_sftp_seek(x, (size_t)y) #endif /* * Earlier libssh2 versions didn't do SCP properly beyond 32bit sizes on 32bit * architectures so we check of the necessary function is present. */ #ifndef HAVE_LIBSSH2_SCP_SEND64 #define SCP_SEND(a,b,c,d) libssh2_scp_send_ex(a, b, (int)(c), (size_t)d, 0, 0) #else #define SCP_SEND(a,b,c,d) libssh2_scp_send64(a, b, (int)(c), \ (libssh2_uint64_t)d, 0, 0) #endif /* * libssh2 1.2.8 fixed the problem with 32bit ints used for sockets on win64. */ #ifdef HAVE_LIBSSH2_SESSION_HANDSHAKE #define libssh2_session_startup(x,y) libssh2_session_handshake(x,y) #endif static CURLcode ssh_knownhost(struct connectdata *conn) { CURLcode result = CURLE_OK; #ifdef HAVE_LIBSSH2_KNOWNHOST_API struct SessionHandle *data = conn->data; if(data->set.str[STRING_SSH_KNOWNHOSTS]) { /* we're asked to verify the host against a file */ struct ssh_conn *sshc = &conn->proto.sshc; int rc; int keytype; size_t keylen; const char *remotekey = libssh2_session_hostkey(sshc->ssh_session, &keylen, &keytype); int keycheck = LIBSSH2_KNOWNHOST_CHECK_FAILURE; int keybit = 0; if(remotekey) { /* * A subject to figure out is what host name we need to pass in here. * What host name does OpenSSH store in its file if an IDN name is * used? */ struct libssh2_knownhost *host; enum curl_khmatch keymatch; curl_sshkeycallback func = data->set.ssh_keyfunc?data->set.ssh_keyfunc:sshkeycallback; struct curl_khkey knownkey; struct curl_khkey *knownkeyp = NULL; struct curl_khkey foundkey; keybit = (keytype == LIBSSH2_HOSTKEY_TYPE_RSA)? LIBSSH2_KNOWNHOST_KEY_SSHRSA:LIBSSH2_KNOWNHOST_KEY_SSHDSS; keycheck = libssh2_knownhost_check(sshc->kh, conn->host.name, remotekey, keylen, LIBSSH2_KNOWNHOST_TYPE_PLAIN| LIBSSH2_KNOWNHOST_KEYENC_RAW| keybit, &host); infof(data, "SSH host check: %d, key: %s\n", keycheck, (keycheck <= LIBSSH2_KNOWNHOST_CHECK_MISMATCH)? host->key:""); /* setup 'knownkey' */ if(keycheck <= LIBSSH2_KNOWNHOST_CHECK_MISMATCH) { knownkey.key = host->key; knownkey.len = 0; knownkey.keytype = (keytype == LIBSSH2_HOSTKEY_TYPE_RSA)? CURLKHTYPE_RSA : CURLKHTYPE_DSS; knownkeyp = &knownkey; } /* setup 'foundkey' */ foundkey.key = remotekey; foundkey.len = keylen; foundkey.keytype = (keytype == LIBSSH2_HOSTKEY_TYPE_RSA)? CURLKHTYPE_RSA : CURLKHTYPE_DSS; /* * if any of the LIBSSH2_KNOWNHOST_CHECK_* defines and the * curl_khmatch enum are ever modified, we need to introduce a * translation table here! */ keymatch = (enum curl_khmatch)keycheck; /* Ask the callback how to behave */ rc = func(data, knownkeyp, /* from the knownhosts file */ &foundkey, /* from the remote host */ keymatch, data->set.ssh_keyfunc_userp); } else /* no remotekey means failure! */ rc = CURLKHSTAT_REJECT; switch(rc) { default: /* unknown return codes will equal reject */ case CURLKHSTAT_REJECT: state(conn, SSH_SESSION_FREE); case CURLKHSTAT_DEFER: /* DEFER means bail out but keep the SSH_HOSTKEY state */ result = sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION; break; case CURLKHSTAT_FINE: case CURLKHSTAT_FINE_ADD_TO_FILE: /* proceed */ if(keycheck != LIBSSH2_KNOWNHOST_CHECK_MATCH) { /* the found host+key didn't match but has been told to be fine anyway so we add it in memory */ int addrc = libssh2_knownhost_add(sshc->kh, conn->host.name, NULL, remotekey, keylen, LIBSSH2_KNOWNHOST_TYPE_PLAIN| LIBSSH2_KNOWNHOST_KEYENC_RAW| keybit, NULL); if(addrc) infof(data, "Warning adding the known host %s failed!\n", conn->host.name); else if(rc == CURLKHSTAT_FINE_ADD_TO_FILE) { /* now we write the entire in-memory list of known hosts to the known_hosts file */ int wrc = libssh2_knownhost_writefile(sshc->kh, data->set.str[STRING_SSH_KNOWNHOSTS], LIBSSH2_KNOWNHOST_FILE_OPENSSH); if(wrc) { infof(data, "Warning, writing %s failed!\n", data->set.str[STRING_SSH_KNOWNHOSTS]); } } } break; } } #else /* HAVE_LIBSSH2_KNOWNHOST_API */ (void)conn; #endif return result; } static CURLcode ssh_check_fingerprint(struct connectdata *conn) { struct ssh_conn *sshc = &conn->proto.sshc; struct SessionHandle *data = conn->data; const char *pubkey_md5 = data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5]; char md5buffer[33]; int i; const char *fingerprint = libssh2_hostkey_hash(sshc->ssh_session, LIBSSH2_HOSTKEY_HASH_MD5); if(fingerprint) { /* The fingerprint points to static storage (!), don't free() it. */ for(i = 0; i < 16; i++) snprintf(&md5buffer[i*2], 3, "%02x", (unsigned char) fingerprint[i]); infof(data, "SSH MD5 fingerprint: %s\n", md5buffer); } /* Before we authenticate we check the hostkey's MD5 fingerprint * against a known fingerprint, if available. */ if(pubkey_md5 && strlen(pubkey_md5) == 32) { if(!fingerprint || !strequal(md5buffer, pubkey_md5)) { if(fingerprint) failf(data, "Denied establishing ssh session: mismatch md5 fingerprint. " "Remote %s is not equal to %s", md5buffer, pubkey_md5); else failf(data, "Denied establishing ssh session: md5 fingerprint not available"); state(conn, SSH_SESSION_FREE); sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION; return sshc->actualcode; } else { infof(data, "MD5 checksum match!\n"); /* as we already matched, we skip the check for known hosts */ return CURLE_OK; } } else return ssh_knownhost(conn); } /* * ssh_statemach_act() runs the SSH state machine as far as it can without * blocking and without reaching the end. The data the pointer 'block' points * to will be set to TRUE if the libssh2 function returns LIBSSH2_ERROR_EAGAIN * meaning it wants to be called again when the socket is ready */ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct SSHPROTO *sftp_scp = data->req.protop; struct ssh_conn *sshc = &conn->proto.sshc; curl_socket_t sock = conn->sock[FIRSTSOCKET]; char *new_readdir_line; int rc = LIBSSH2_ERROR_NONE; int err; int seekerr = CURL_SEEKFUNC_OK; *block = 0; /* we're not blocking by default */ do { switch(sshc->state) { case SSH_INIT: sshc->secondCreateDirs = 0; sshc->nextstate = SSH_NO_STATE; sshc->actualcode = CURLE_OK; /* Set libssh2 to non-blocking, since everything internally is non-blocking */ libssh2_session_set_blocking(sshc->ssh_session, 0); state(conn, SSH_S_STARTUP); /* fall-through */ case SSH_S_STARTUP: rc = libssh2_session_startup(sshc->ssh_session, (int)sock); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc) { failf(data, "Failure establishing ssh session"); state(conn, SSH_SESSION_FREE); sshc->actualcode = CURLE_FAILED_INIT; break; } state(conn, SSH_HOSTKEY); /* fall-through */ case SSH_HOSTKEY: /* * Before we authenticate we should check the hostkey's fingerprint * against our known hosts. How that is handled (reading from file, * whatever) is up to us. */ result = ssh_check_fingerprint(conn); if(result == CURLE_OK) state(conn, SSH_AUTHLIST); break; case SSH_AUTHLIST: /* * Figure out authentication methods * NB: As soon as we have provided a username to an openssh server we * must never change it later. Thus, always specify the correct username * here, even though the libssh2 docs kind of indicate that it should be * possible to get a 'generic' list (not user-specific) of authentication * methods, presumably with a blank username. That won't work in my * experience. * So always specify it here. */ sshc->authlist = libssh2_userauth_list(sshc->ssh_session, conn->user, curlx_uztoui(strlen(conn->user))); if(!sshc->authlist) { if(libssh2_userauth_authenticated(sshc->ssh_session)) { sshc->authed = TRUE; infof(data, "SSH user accepted with no authentication\n"); state(conn, SSH_AUTH_DONE); break; } else if((err = libssh2_session_last_errno(sshc->ssh_session)) == LIBSSH2_ERROR_EAGAIN) { rc = LIBSSH2_ERROR_EAGAIN; break; } else { state(conn, SSH_SESSION_FREE); sshc->actualcode = libssh2_session_error_to_CURLE(err); break; } } infof(data, "SSH authentication methods available: %s\n", sshc->authlist); state(conn, SSH_AUTH_PKEY_INIT); break; case SSH_AUTH_PKEY_INIT: /* * Check the supported auth types in the order I feel is most secure * with the requested type of authentication */ sshc->authed = FALSE; if((data->set.ssh_auth_types & CURLSSH_AUTH_PUBLICKEY) && (strstr(sshc->authlist, "publickey") != NULL)) { char *home = NULL; bool rsa_pub_empty_but_ok = FALSE; sshc->rsa_pub = sshc->rsa = NULL; /* To ponder about: should really the lib be messing about with the HOME environment variable etc? */ home = curl_getenv("HOME"); if(data->set.str[STRING_SSH_PUBLIC_KEY] && !*data->set.str[STRING_SSH_PUBLIC_KEY]) rsa_pub_empty_but_ok = true; else if(data->set.str[STRING_SSH_PUBLIC_KEY]) sshc->rsa_pub = aprintf("%s", data->set.str[STRING_SSH_PUBLIC_KEY]); else if(home) sshc->rsa_pub = aprintf("%s/.ssh/id_dsa.pub", home); else /* as a final resort, try current dir! */ sshc->rsa_pub = strdup("id_dsa.pub"); if(!rsa_pub_empty_but_ok && (sshc->rsa_pub == NULL)) { Curl_safefree(home); state(conn, SSH_SESSION_FREE); sshc->actualcode = CURLE_OUT_OF_MEMORY; break; } if(data->set.str[STRING_SSH_PRIVATE_KEY]) sshc->rsa = aprintf("%s", data->set.str[STRING_SSH_PRIVATE_KEY]); else if(home) sshc->rsa = aprintf("%s/.ssh/id_dsa", home); else /* as a final resort, try current dir! */ sshc->rsa = strdup("id_dsa"); if(sshc->rsa == NULL) { Curl_safefree(home); Curl_safefree(sshc->rsa_pub); state(conn, SSH_SESSION_FREE); sshc->actualcode = CURLE_OUT_OF_MEMORY; break; } sshc->passphrase = data->set.str[STRING_KEY_PASSWD]; if(!sshc->passphrase) sshc->passphrase = ""; Curl_safefree(home); infof(data, "Using ssh public key file %s\n", sshc->rsa_pub); infof(data, "Using ssh private key file %s\n", sshc->rsa); state(conn, SSH_AUTH_PKEY); } else { state(conn, SSH_AUTH_PASS_INIT); } break; case SSH_AUTH_PKEY: /* The function below checks if the files exists, no need to stat() here. */ rc = libssh2_userauth_publickey_fromfile_ex(sshc->ssh_session, conn->user, curlx_uztoui( strlen(conn->user)), sshc->rsa_pub, sshc->rsa, sshc->passphrase); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } Curl_safefree(sshc->rsa_pub); Curl_safefree(sshc->rsa); if(rc == 0) { sshc->authed = TRUE; infof(data, "Initialized SSH public key authentication\n"); state(conn, SSH_AUTH_DONE); } else { char *err_msg; (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); infof(data, "SSH public key authentication failed: %s\n", err_msg); state(conn, SSH_AUTH_PASS_INIT); } break; case SSH_AUTH_PASS_INIT: if((data->set.ssh_auth_types & CURLSSH_AUTH_PASSWORD) && (strstr(sshc->authlist, "password") != NULL)) { state(conn, SSH_AUTH_PASS); } else { state(conn, SSH_AUTH_HOST_INIT); } break; case SSH_AUTH_PASS: rc = libssh2_userauth_password_ex(sshc->ssh_session, conn->user, curlx_uztoui(strlen(conn->user)), conn->passwd, curlx_uztoui(strlen(conn->passwd)), NULL); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc == 0) { sshc->authed = TRUE; infof(data, "Initialized password authentication\n"); state(conn, SSH_AUTH_DONE); } else { state(conn, SSH_AUTH_HOST_INIT); } break; case SSH_AUTH_HOST_INIT: if((data->set.ssh_auth_types & CURLSSH_AUTH_HOST) && (strstr(sshc->authlist, "hostbased") != NULL)) { state(conn, SSH_AUTH_HOST); } else { state(conn, SSH_AUTH_AGENT_INIT); } break; case SSH_AUTH_HOST: state(conn, SSH_AUTH_AGENT_INIT); break; case SSH_AUTH_AGENT_INIT: #ifdef HAVE_LIBSSH2_AGENT_API if((data->set.ssh_auth_types & CURLSSH_AUTH_AGENT) && (strstr(sshc->authlist, "publickey") != NULL)) { /* Connect to the ssh-agent */ /* The agent could be shared by a curl thread i believe but nothing obvious as keys can be added/removed at any time */ if(!sshc->ssh_agent) { sshc->ssh_agent = libssh2_agent_init(sshc->ssh_session); if(!sshc->ssh_agent) { infof(data, "Could not create agent object\n"); state(conn, SSH_AUTH_KEY_INIT); } } rc = libssh2_agent_connect(sshc->ssh_agent); if(rc == LIBSSH2_ERROR_EAGAIN) break; if(rc < 0) { infof(data, "Failure connecting to agent\n"); state(conn, SSH_AUTH_KEY_INIT); } else { state(conn, SSH_AUTH_AGENT_LIST); } } else #endif /* HAVE_LIBSSH2_AGENT_API */ state(conn, SSH_AUTH_KEY_INIT); break; case SSH_AUTH_AGENT_LIST: #ifdef HAVE_LIBSSH2_AGENT_API rc = libssh2_agent_list_identities(sshc->ssh_agent); if(rc == LIBSSH2_ERROR_EAGAIN) break; if(rc < 0) { infof(data, "Failure requesting identities to agent\n"); state(conn, SSH_AUTH_KEY_INIT); } else { state(conn, SSH_AUTH_AGENT); sshc->sshagent_prev_identity = NULL; } #endif break; case SSH_AUTH_AGENT: #ifdef HAVE_LIBSSH2_AGENT_API /* as prev_identity evolves only after an identity user auth finished we can safely request it again as long as EAGAIN is returned here or by libssh2_agent_userauth */ rc = libssh2_agent_get_identity(sshc->ssh_agent, &sshc->sshagent_identity, sshc->sshagent_prev_identity); if(rc == LIBSSH2_ERROR_EAGAIN) break; if(rc == 0) { rc = libssh2_agent_userauth(sshc->ssh_agent, conn->user, sshc->sshagent_identity); if(rc < 0) { if(rc != LIBSSH2_ERROR_EAGAIN) { /* tried and failed? go to next identity */ sshc->sshagent_prev_identity = sshc->sshagent_identity; } break; } } if(rc < 0) infof(data, "Failure requesting identities to agent\n"); else if(rc == 1) infof(data, "No identity would match\n"); if(rc == LIBSSH2_ERROR_NONE) { sshc->authed = TRUE; infof(data, "Agent based authentication successful\n"); state(conn, SSH_AUTH_DONE); } else state(conn, SSH_AUTH_KEY_INIT); #endif break; case SSH_AUTH_KEY_INIT: if((data->set.ssh_auth_types & CURLSSH_AUTH_KEYBOARD) && (strstr(sshc->authlist, "keyboard-interactive") != NULL)) { state(conn, SSH_AUTH_KEY); } else { state(conn, SSH_AUTH_DONE); } break; case SSH_AUTH_KEY: /* Authentication failed. Continue with keyboard-interactive now. */ rc = libssh2_userauth_keyboard_interactive_ex(sshc->ssh_session, conn->user, curlx_uztoui( strlen(conn->user)), &kbd_callback); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc == 0) { sshc->authed = TRUE; infof(data, "Initialized keyboard interactive authentication\n"); } state(conn, SSH_AUTH_DONE); break; case SSH_AUTH_DONE: if(!sshc->authed) { failf(data, "Authentication failure"); state(conn, SSH_SESSION_FREE); sshc->actualcode = CURLE_LOGIN_DENIED; break; } /* * At this point we have an authenticated ssh session. */ infof(data, "Authentication complete\n"); Curl_pgrsTime(conn->data, TIMER_APPCONNECT); /* SSH is connected */ conn->sockfd = sock; conn->writesockfd = CURL_SOCKET_BAD; if(conn->handler->protocol == CURLPROTO_SFTP) { state(conn, SSH_SFTP_INIT); break; } infof(data, "SSH CONNECT phase done\n"); state(conn, SSH_STOP); break; case SSH_SFTP_INIT: /* * Start the libssh2 sftp session */ sshc->sftp_session = libssh2_sftp_init(sshc->ssh_session); if(!sshc->sftp_session) { if(libssh2_session_last_errno(sshc->ssh_session) == LIBSSH2_ERROR_EAGAIN) { rc = LIBSSH2_ERROR_EAGAIN; break; } else { char *err_msg; (void)libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0); failf(data, "Failure initializing sftp session: %s", err_msg); state(conn, SSH_SESSION_FREE); sshc->actualcode = CURLE_FAILED_INIT; break; } } state(conn, SSH_SFTP_REALPATH); break; case SSH_SFTP_REALPATH: { char tempHome[PATH_MAX]; /* * Get the "home" directory */ rc = sftp_libssh2_realpath(sshc->sftp_session, ".", tempHome, PATH_MAX-1); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc > 0) { /* It seems that this string is not always NULL terminated */ tempHome[rc] = '\0'; sshc->homedir = strdup(tempHome); if(!sshc->homedir) { state(conn, SSH_SFTP_CLOSE); sshc->actualcode = CURLE_OUT_OF_MEMORY; break; } conn->data->state.most_recent_ftp_entrypath = sshc->homedir; } else { /* Return the error type */ err = sftp_libssh2_last_error(sshc->sftp_session); result = sftp_libssh2_error_to_CURLE(err); sshc->actualcode = result?result:CURLE_SSH; DEBUGF(infof(data, "error = %d makes libcurl = %d\n", err, (int)result)); state(conn, SSH_STOP); break; } } /* This is the last step in the SFTP connect phase. Do note that while we get the homedir here, we get the "workingpath" in the DO action since the homedir will remain the same between request but the working path will not. */ DEBUGF(infof(data, "SSH CONNECT phase done\n")); state(conn, SSH_STOP); break; case SSH_SFTP_QUOTE_INIT: result = ssh_getworkingpath(conn, sshc->homedir, &sftp_scp->path); if(result) { sshc->actualcode = result; state(conn, SSH_STOP); break; } if(data->set.quote) { infof(data, "Sending quote commands\n"); sshc->quote_item = data->set.quote; state(conn, SSH_SFTP_QUOTE); } else { state(conn, SSH_SFTP_TRANS_INIT); } break; case SSH_SFTP_POSTQUOTE_INIT: if(data->set.postquote) { infof(data, "Sending quote commands\n"); sshc->quote_item = data->set.postquote; state(conn, SSH_SFTP_QUOTE); } else { state(conn, SSH_STOP); } break; case SSH_SFTP_QUOTE: /* Send any quote commands */ { const char *cp; /* * Support some of the "FTP" commands */ char *cmd = sshc->quote_item->data; sshc->acceptfail = FALSE; /* if a command starts with an asterisk, which a legal SFTP command never can, the command will be allowed to fail without it causing any aborts or cancels etc. It will cause libcurl to act as if the command is successful, whatever the server reponds. */ if(cmd[0] == '*') { cmd++; sshc->acceptfail = TRUE; } if(curl_strequal("pwd", cmd)) { /* output debug output if that is requested */ char *tmp = aprintf("257 \"%s\" is current directory.\n", sftp_scp->path); if(!tmp) { result = CURLE_OUT_OF_MEMORY; state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; break; } if(data->set.verbose) { Curl_debug(data, CURLINFO_HEADER_OUT, (char *)"PWD\n", 4, conn); Curl_debug(data, CURLINFO_HEADER_IN, tmp, strlen(tmp), conn); } /* this sends an FTP-like "header" to the header callback so that the current directory can be read very similar to how it is read when using ordinary FTP. */ result = Curl_client_write(conn, CLIENTWRITE_HEADER, tmp, strlen(tmp)); free(tmp); state(conn, SSH_SFTP_NEXT_QUOTE); break; } else if(cmd) { /* * the arguments following the command must be separated from the * command with a space so we can check for it unconditionally */ cp = strchr(cmd, ' '); if(cp == NULL) { failf(data, "Syntax error in SFTP command. Supply parameter(s)!"); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = CURLE_QUOTE_ERROR; break; } /* * also, every command takes at least one argument so we get that * first argument right now */ result = get_pathname(&cp, &sshc->quote_path1); if(result) { if(result == CURLE_OUT_OF_MEMORY) failf(data, "Out of memory"); else failf(data, "Syntax error: Bad first parameter"); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = result; break; } /* * SFTP is a binary protocol, so we don't send text commands to * the server. Instead, we scan for commands for commands used by * OpenSSH's sftp program and call the appropriate libssh2 * functions. */ if(curl_strnequal(cmd, "chgrp ", 6) || curl_strnequal(cmd, "chmod ", 6) || curl_strnequal(cmd, "chown ", 6) ) { /* attribute change */ /* sshc->quote_path1 contains the mode to set */ /* get the destination */ result = get_pathname(&cp, &sshc->quote_path2); if(result) { if(result == CURLE_OUT_OF_MEMORY) failf(data, "Out of memory"); else failf(data, "Syntax error in chgrp/chmod/chown: " "Bad second parameter"); Curl_safefree(sshc->quote_path1); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = result; break; } memset(&sshc->quote_attrs, 0, sizeof(LIBSSH2_SFTP_ATTRIBUTES)); state(conn, SSH_SFTP_QUOTE_STAT); break; } else if(curl_strnequal(cmd, "ln ", 3) || curl_strnequal(cmd, "symlink ", 8)) { /* symbolic linking */ /* sshc->quote_path1 is the source */ /* get the destination */ result = get_pathname(&cp, &sshc->quote_path2); if(result) { if(result == CURLE_OUT_OF_MEMORY) failf(data, "Out of memory"); else failf(data, "Syntax error in ln/symlink: Bad second parameter"); Curl_safefree(sshc->quote_path1); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = result; break; } state(conn, SSH_SFTP_QUOTE_SYMLINK); break; } else if(curl_strnequal(cmd, "mkdir ", 6)) { /* create dir */ state(conn, SSH_SFTP_QUOTE_MKDIR); break; } else if(curl_strnequal(cmd, "rename ", 7)) { /* rename file */ /* first param is the source path */ /* second param is the dest. path */ result = get_pathname(&cp, &sshc->quote_path2); if(result) { if(result == CURLE_OUT_OF_MEMORY) failf(data, "Out of memory"); else failf(data, "Syntax error in rename: Bad second parameter"); Curl_safefree(sshc->quote_path1); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = result; break; } state(conn, SSH_SFTP_QUOTE_RENAME); break; } else if(curl_strnequal(cmd, "rmdir ", 6)) { /* delete dir */ state(conn, SSH_SFTP_QUOTE_RMDIR); break; } else if(curl_strnequal(cmd, "rm ", 3)) { state(conn, SSH_SFTP_QUOTE_UNLINK); break; } failf(data, "Unknown SFTP command"); Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = CURLE_QUOTE_ERROR; break; } } if(!sshc->quote_item) { state(conn, SSH_SFTP_TRANS_INIT); } break; case SSH_SFTP_NEXT_QUOTE: Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); sshc->quote_item = sshc->quote_item->next; if(sshc->quote_item) { state(conn, SSH_SFTP_QUOTE); } else { if(sshc->nextstate != SSH_NO_STATE) { state(conn, sshc->nextstate); sshc->nextstate = SSH_NO_STATE; } else { state(conn, SSH_SFTP_TRANS_INIT); } } break; case SSH_SFTP_QUOTE_STAT: { char *cmd = sshc->quote_item->data; sshc->acceptfail = FALSE; /* if a command starts with an asterisk, which a legal SFTP command never can, the command will be allowed to fail without it causing any aborts or cancels etc. It will cause libcurl to act as if the command is successful, whatever the server reponds. */ if(cmd[0] == '*') { cmd++; sshc->acceptfail = TRUE; } if(!curl_strnequal(cmd, "chmod", 5)) { /* Since chown and chgrp only set owner OR group but libssh2 wants to * set them both at once, we need to obtain the current ownership * first. This takes an extra protocol round trip. */ rc = libssh2_sftp_stat_ex(sshc->sftp_session, sshc->quote_path2, curlx_uztoui(strlen(sshc->quote_path2)), LIBSSH2_SFTP_STAT, &sshc->quote_attrs); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc != 0 && !sshc->acceptfail) { /* get those attributes */ err = sftp_libssh2_last_error(sshc->sftp_session); Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); failf(data, "Attempt to get SFTP stats failed: %s", sftp_libssh2_strerror(err)); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = CURLE_QUOTE_ERROR; break; } } /* Now set the new attributes... */ if(curl_strnequal(cmd, "chgrp", 5)) { sshc->quote_attrs.gid = strtoul(sshc->quote_path1, NULL, 10); sshc->quote_attrs.flags = LIBSSH2_SFTP_ATTR_UIDGID; if(sshc->quote_attrs.gid == 0 && !ISDIGIT(sshc->quote_path1[0]) && !sshc->acceptfail) { Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); failf(data, "Syntax error: chgrp gid not a number"); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = CURLE_QUOTE_ERROR; break; } } else if(curl_strnequal(cmd, "chmod", 5)) { sshc->quote_attrs.permissions = strtoul(sshc->quote_path1, NULL, 8); sshc->quote_attrs.flags = LIBSSH2_SFTP_ATTR_PERMISSIONS; /* permissions are octal */ if(sshc->quote_attrs.permissions == 0 && !ISDIGIT(sshc->quote_path1[0])) { Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); failf(data, "Syntax error: chmod permissions not a number"); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = CURLE_QUOTE_ERROR; break; } } else if(curl_strnequal(cmd, "chown", 5)) { sshc->quote_attrs.uid = strtoul(sshc->quote_path1, NULL, 10); sshc->quote_attrs.flags = LIBSSH2_SFTP_ATTR_UIDGID; if(sshc->quote_attrs.uid == 0 && !ISDIGIT(sshc->quote_path1[0]) && !sshc->acceptfail) { Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); failf(data, "Syntax error: chown uid not a number"); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = CURLE_QUOTE_ERROR; break; } } /* Now send the completed structure... */ state(conn, SSH_SFTP_QUOTE_SETSTAT); break; } case SSH_SFTP_QUOTE_SETSTAT: rc = libssh2_sftp_stat_ex(sshc->sftp_session, sshc->quote_path2, curlx_uztoui(strlen(sshc->quote_path2)), LIBSSH2_SFTP_SETSTAT, &sshc->quote_attrs); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc != 0 && !sshc->acceptfail) { err = sftp_libssh2_last_error(sshc->sftp_session); Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); failf(data, "Attempt to set SFTP stats failed: %s", sftp_libssh2_strerror(err)); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = CURLE_QUOTE_ERROR; break; } state(conn, SSH_SFTP_NEXT_QUOTE); break; case SSH_SFTP_QUOTE_SYMLINK: rc = libssh2_sftp_symlink_ex(sshc->sftp_session, sshc->quote_path1, curlx_uztoui(strlen(sshc->quote_path1)), sshc->quote_path2, curlx_uztoui(strlen(sshc->quote_path2)), LIBSSH2_SFTP_SYMLINK); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc != 0 && !sshc->acceptfail) { err = sftp_libssh2_last_error(sshc->sftp_session); Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); failf(data, "symlink command failed: %s", sftp_libssh2_strerror(err)); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = CURLE_QUOTE_ERROR; break; } state(conn, SSH_SFTP_NEXT_QUOTE); break; case SSH_SFTP_QUOTE_MKDIR: rc = libssh2_sftp_mkdir_ex(sshc->sftp_session, sshc->quote_path1, curlx_uztoui(strlen(sshc->quote_path1)), data->set.new_directory_perms); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc != 0 && !sshc->acceptfail) { err = sftp_libssh2_last_error(sshc->sftp_session); Curl_safefree(sshc->quote_path1); failf(data, "mkdir command failed: %s", sftp_libssh2_strerror(err)); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = CURLE_QUOTE_ERROR; break; } state(conn, SSH_SFTP_NEXT_QUOTE); break; case SSH_SFTP_QUOTE_RENAME: rc = libssh2_sftp_rename_ex(sshc->sftp_session, sshc->quote_path1, curlx_uztoui(strlen(sshc->quote_path1)), sshc->quote_path2, curlx_uztoui(strlen(sshc->quote_path2)), LIBSSH2_SFTP_RENAME_OVERWRITE | LIBSSH2_SFTP_RENAME_ATOMIC | LIBSSH2_SFTP_RENAME_NATIVE); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc != 0 && !sshc->acceptfail) { err = sftp_libssh2_last_error(sshc->sftp_session); Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); failf(data, "rename command failed: %s", sftp_libssh2_strerror(err)); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = CURLE_QUOTE_ERROR; break; } state(conn, SSH_SFTP_NEXT_QUOTE); break; case SSH_SFTP_QUOTE_RMDIR: rc = libssh2_sftp_rmdir_ex(sshc->sftp_session, sshc->quote_path1, curlx_uztoui(strlen(sshc->quote_path1))); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc != 0 && !sshc->acceptfail) { err = sftp_libssh2_last_error(sshc->sftp_session); Curl_safefree(sshc->quote_path1); failf(data, "rmdir command failed: %s", sftp_libssh2_strerror(err)); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = CURLE_QUOTE_ERROR; break; } state(conn, SSH_SFTP_NEXT_QUOTE); break; case SSH_SFTP_QUOTE_UNLINK: rc = libssh2_sftp_unlink_ex(sshc->sftp_session, sshc->quote_path1, curlx_uztoui(strlen(sshc->quote_path1))); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc != 0 && !sshc->acceptfail) { err = sftp_libssh2_last_error(sshc->sftp_session); Curl_safefree(sshc->quote_path1); failf(data, "rm command failed: %s", sftp_libssh2_strerror(err)); state(conn, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = CURLE_QUOTE_ERROR; break; } state(conn, SSH_SFTP_NEXT_QUOTE); break; case SSH_SFTP_TRANS_INIT: if(data->set.upload) state(conn, SSH_SFTP_UPLOAD_INIT); else { if(sftp_scp->path[strlen(sftp_scp->path)-1] == '/') state(conn, SSH_SFTP_READDIR_INIT); else state(conn, SSH_SFTP_DOWNLOAD_INIT); } break; case SSH_SFTP_UPLOAD_INIT: { unsigned long flags; /* * NOTE!!! libssh2 requires that the destination path is a full path * that includes the destination file and name OR ends in a "/" * If this is not done the destination file will be named the * same name as the last directory in the path. */ if(data->state.resume_from != 0) { LIBSSH2_SFTP_ATTRIBUTES attrs; if(data->state.resume_from < 0) { rc = libssh2_sftp_stat_ex(sshc->sftp_session, sftp_scp->path, curlx_uztoui(strlen(sftp_scp->path)), LIBSSH2_SFTP_STAT, &attrs); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc) { data->state.resume_from = 0; } else { curl_off_t size = attrs.filesize; if(size < 0) { failf(data, "Bad file size (%" CURL_FORMAT_CURL_OFF_T ")", size); return CURLE_BAD_DOWNLOAD_RESUME; } data->state.resume_from = attrs.filesize; } } } if(data->set.ftp_append) /* Try to open for append, but create if nonexisting */ flags = LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_APPEND; else if(data->state.resume_from > 0) /* If we have restart position then open for append */ flags = LIBSSH2_FXF_WRITE|LIBSSH2_FXF_APPEND; else /* Clear file before writing (normal behaviour) */ flags = LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_TRUNC; sshc->sftp_handle = libssh2_sftp_open_ex(sshc->sftp_session, sftp_scp->path, curlx_uztoui(strlen(sftp_scp->path)), flags, data->set.new_file_perms, LIBSSH2_SFTP_OPENFILE); if(!sshc->sftp_handle) { rc = libssh2_session_last_errno(sshc->ssh_session); if(LIBSSH2_ERROR_EAGAIN == rc) break; else { if(LIBSSH2_ERROR_SFTP_PROTOCOL == rc) /* only when there was an SFTP protocol error can we extract the sftp error! */ err = sftp_libssh2_last_error(sshc->sftp_session); else err = -1; /* not an sftp error at all */ if(sshc->secondCreateDirs) { state(conn, SSH_SFTP_CLOSE); sshc->actualcode = err>= LIBSSH2_FX_OK? sftp_libssh2_error_to_CURLE(err):CURLE_SSH; failf(data, "Creating the dir/file failed: %s", sftp_libssh2_strerror(err)); break; } else if(((err == LIBSSH2_FX_NO_SUCH_FILE) || (err == LIBSSH2_FX_FAILURE) || (err == LIBSSH2_FX_NO_SUCH_PATH)) && (data->set.ftp_create_missing_dirs && (strlen(sftp_scp->path) > 1))) { /* try to create the path remotely */ sshc->secondCreateDirs = 1; state(conn, SSH_SFTP_CREATE_DIRS_INIT); break; } state(conn, SSH_SFTP_CLOSE); sshc->actualcode = err>= LIBSSH2_FX_OK? sftp_libssh2_error_to_CURLE(err):CURLE_SSH; if(!sshc->actualcode) { /* Sometimes, for some reason libssh2_sftp_last_error() returns zero even though libssh2_sftp_open() failed previously! We need to work around that! */ sshc->actualcode = CURLE_SSH; err=-1; } failf(data, "Upload failed: %s (%d/%d)", err>= LIBSSH2_FX_OK?sftp_libssh2_strerror(err):"ssh error", err, rc); break; } } /* If we have restart point then we need to seek to the correct position. */ if(data->state.resume_from > 0) { /* Let's read off the proper amount of bytes from the input. */ if(conn->seek_func) { seekerr = conn->seek_func(conn->seek_client, data->state.resume_from, SEEK_SET); } if(seekerr != CURL_SEEKFUNC_OK) { if(seekerr != CURL_SEEKFUNC_CANTSEEK) { failf(data, "Could not seek stream"); return CURLE_FTP_COULDNT_USE_REST; } /* seekerr == CURL_SEEKFUNC_CANTSEEK (can't seek to offset) */ else { curl_off_t passed=0; do { size_t readthisamountnow = (data->state.resume_from - passed > CURL_OFF_T_C(BUFSIZE)) ? BUFSIZE : curlx_sotouz(data->state.resume_from - passed); size_t actuallyread = conn->fread_func(data->state.buffer, 1, readthisamountnow, conn->fread_in); passed += actuallyread; if((actuallyread == 0) || (actuallyread > readthisamountnow)) { /* this checks for greater-than only to make sure that the CURL_READFUNC_ABORT return code still aborts */ failf(data, "Failed to read data"); return CURLE_FTP_COULDNT_USE_REST; } } while(passed < data->state.resume_from); } } /* now, decrease the size of the read */ if(data->set.infilesize > 0) { data->set.infilesize -= data->state.resume_from; data->req.size = data->set.infilesize; Curl_pgrsSetUploadSize(data, data->set.infilesize); } SFTP_SEEK(sshc->sftp_handle, data->state.resume_from); } if(data->set.infilesize > 0) { data->req.size = data->set.infilesize; Curl_pgrsSetUploadSize(data, data->set.infilesize); } /* upload data */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, FIRSTSOCKET, NULL); /* not set by Curl_setup_transfer to preserve keepon bits */ conn->sockfd = conn->writesockfd; if(result) { state(conn, SSH_SFTP_CLOSE); sshc->actualcode = result; } else { /* store this original bitmask setup to use later on if we can't figure out a "real" bitmask */ sshc->orig_waitfor = data->req.keepon; /* we want to use the _sending_ function even when the socket turns out readable as the underlying libssh2 sftp send function will deal with both accordingly */ conn->cselect_bits = CURL_CSELECT_OUT; /* since we don't really wait for anything at this point, we want the state machine to move on as soon as possible so we set a very short timeout here */ Curl_expire(data, 1); state(conn, SSH_STOP); } break; } case SSH_SFTP_CREATE_DIRS_INIT: if(strlen(sftp_scp->path) > 1) { sshc->slash_pos = sftp_scp->path + 1; /* ignore the leading '/' */ state(conn, SSH_SFTP_CREATE_DIRS); } else { state(conn, SSH_SFTP_UPLOAD_INIT); } break; case SSH_SFTP_CREATE_DIRS: if((sshc->slash_pos = strchr(sshc->slash_pos, '/')) != NULL) { *sshc->slash_pos = 0; infof(data, "Creating directory '%s'\n", sftp_scp->path); state(conn, SSH_SFTP_CREATE_DIRS_MKDIR); break; } else { state(conn, SSH_SFTP_UPLOAD_INIT); } break; case SSH_SFTP_CREATE_DIRS_MKDIR: /* 'mode' - parameter is preliminary - default to 0644 */ rc = libssh2_sftp_mkdir_ex(sshc->sftp_session, sftp_scp->path, curlx_uztoui(strlen(sftp_scp->path)), data->set.new_directory_perms); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } *sshc->slash_pos = '/'; ++sshc->slash_pos; if(rc == -1) { /* * Abort if failure wasn't that the dir already exists or the * permission was denied (creation might succeed further down the * path) - retry on unspecific FAILURE also */ err = sftp_libssh2_last_error(sshc->sftp_session); if((err != LIBSSH2_FX_FILE_ALREADY_EXISTS) && (err != LIBSSH2_FX_FAILURE) && (err != LIBSSH2_FX_PERMISSION_DENIED)) { result = sftp_libssh2_error_to_CURLE(err); state(conn, SSH_SFTP_CLOSE); sshc->actualcode = result?result:CURLE_SSH; break; } } state(conn, SSH_SFTP_CREATE_DIRS); break; case SSH_SFTP_READDIR_INIT: Curl_pgrsSetDownloadSize(data, -1); if(data->set.opt_no_body) state(conn, SSH_STOP); /* * This is a directory that we are trying to get, so produce a directory * listing */ sshc->sftp_handle = libssh2_sftp_open_ex(sshc->sftp_session, sftp_scp->path, curlx_uztoui( strlen(sftp_scp->path)), 0, 0, LIBSSH2_SFTP_OPENDIR); if(!sshc->sftp_handle) { if(libssh2_session_last_errno(sshc->ssh_session) == LIBSSH2_ERROR_EAGAIN) { rc = LIBSSH2_ERROR_EAGAIN; break; } else { err = sftp_libssh2_last_error(sshc->sftp_session); failf(data, "Could not open directory for reading: %s", sftp_libssh2_strerror(err)); state(conn, SSH_SFTP_CLOSE); result = sftp_libssh2_error_to_CURLE(err); sshc->actualcode = result?result:CURLE_SSH; break; } } if((sshc->readdir_filename = malloc(PATH_MAX+1)) == NULL) { state(conn, SSH_SFTP_CLOSE); sshc->actualcode = CURLE_OUT_OF_MEMORY; break; } if((sshc->readdir_longentry = malloc(PATH_MAX+1)) == NULL) { Curl_safefree(sshc->readdir_filename); state(conn, SSH_SFTP_CLOSE); sshc->actualcode = CURLE_OUT_OF_MEMORY; break; } state(conn, SSH_SFTP_READDIR); break; case SSH_SFTP_READDIR: sshc->readdir_len = libssh2_sftp_readdir_ex(sshc->sftp_handle, sshc->readdir_filename, PATH_MAX, sshc->readdir_longentry, PATH_MAX, &sshc->readdir_attrs); if(sshc->readdir_len == LIBSSH2_ERROR_EAGAIN) { rc = LIBSSH2_ERROR_EAGAIN; break; } if(sshc->readdir_len > 0) { sshc->readdir_filename[sshc->readdir_len] = '\0'; if(data->set.ftp_list_only) { char *tmpLine; tmpLine = aprintf("%s\n", sshc->readdir_filename); if(tmpLine == NULL) { state(conn, SSH_SFTP_CLOSE); sshc->actualcode = CURLE_OUT_OF_MEMORY; break; } result = Curl_client_write(conn, CLIENTWRITE_BODY, tmpLine, sshc->readdir_len+1); Curl_safefree(tmpLine); if(result) { state(conn, SSH_STOP); break; } /* since this counts what we send to the client, we include the newline in this counter */ data->req.bytecount += sshc->readdir_len+1; /* output debug output if that is requested */ if(data->set.verbose) { Curl_debug(data, CURLINFO_DATA_OUT, sshc->readdir_filename, sshc->readdir_len, conn); } } else { sshc->readdir_currLen = (int)strlen(sshc->readdir_longentry); sshc->readdir_totalLen = 80 + sshc->readdir_currLen; sshc->readdir_line = calloc(sshc->readdir_totalLen, 1); if(!sshc->readdir_line) { Curl_safefree(sshc->readdir_filename); Curl_safefree(sshc->readdir_longentry); state(conn, SSH_SFTP_CLOSE); sshc->actualcode = CURLE_OUT_OF_MEMORY; break; } memcpy(sshc->readdir_line, sshc->readdir_longentry, sshc->readdir_currLen); if((sshc->readdir_attrs.flags & LIBSSH2_SFTP_ATTR_PERMISSIONS) && ((sshc->readdir_attrs.permissions & LIBSSH2_SFTP_S_IFMT) == LIBSSH2_SFTP_S_IFLNK)) { sshc->readdir_linkPath = malloc(PATH_MAX + 1); if(sshc->readdir_linkPath == NULL) { Curl_safefree(sshc->readdir_filename); Curl_safefree(sshc->readdir_longentry); state(conn, SSH_SFTP_CLOSE); sshc->actualcode = CURLE_OUT_OF_MEMORY; break; } snprintf(sshc->readdir_linkPath, PATH_MAX, "%s%s", sftp_scp->path, sshc->readdir_filename); state(conn, SSH_SFTP_READDIR_LINK); break; } state(conn, SSH_SFTP_READDIR_BOTTOM); break; } } else if(sshc->readdir_len == 0) { Curl_safefree(sshc->readdir_filename); Curl_safefree(sshc->readdir_longentry); state(conn, SSH_SFTP_READDIR_DONE); break; } else if(sshc->readdir_len <= 0) { err = sftp_libssh2_last_error(sshc->sftp_session); result = sftp_libssh2_error_to_CURLE(err); sshc->actualcode = result?result:CURLE_SSH; failf(data, "Could not open remote file for reading: %s :: %d", sftp_libssh2_strerror(err), libssh2_session_last_errno(sshc->ssh_session)); Curl_safefree(sshc->readdir_filename); Curl_safefree(sshc->readdir_longentry); state(conn, SSH_SFTP_CLOSE); break; } break; case SSH_SFTP_READDIR_LINK: sshc->readdir_len = libssh2_sftp_symlink_ex(sshc->sftp_session, sshc->readdir_linkPath, curlx_uztoui(strlen(sshc->readdir_linkPath)), sshc->readdir_filename, PATH_MAX, LIBSSH2_SFTP_READLINK); if(sshc->readdir_len == LIBSSH2_ERROR_EAGAIN) { rc = LIBSSH2_ERROR_EAGAIN; break; } Curl_safefree(sshc->readdir_linkPath); /* get room for the filename and extra output */ sshc->readdir_totalLen += 4 + sshc->readdir_len; new_readdir_line = realloc(sshc->readdir_line, sshc->readdir_totalLen); if(!new_readdir_line) { Curl_safefree(sshc->readdir_line); Curl_safefree(sshc->readdir_filename); Curl_safefree(sshc->readdir_longentry); state(conn, SSH_SFTP_CLOSE); sshc->actualcode = CURLE_OUT_OF_MEMORY; break; } sshc->readdir_line = new_readdir_line; sshc->readdir_currLen += snprintf(sshc->readdir_line + sshc->readdir_currLen, sshc->readdir_totalLen - sshc->readdir_currLen, " -> %s", sshc->readdir_filename); state(conn, SSH_SFTP_READDIR_BOTTOM); break; case SSH_SFTP_READDIR_BOTTOM: sshc->readdir_currLen += snprintf(sshc->readdir_line + sshc->readdir_currLen, sshc->readdir_totalLen - sshc->readdir_currLen, "\n"); result = Curl_client_write(conn, CLIENTWRITE_BODY, sshc->readdir_line, sshc->readdir_currLen); if(result == CURLE_OK) { /* output debug output if that is requested */ if(data->set.verbose) { Curl_debug(data, CURLINFO_DATA_OUT, sshc->readdir_line, sshc->readdir_currLen, conn); } data->req.bytecount += sshc->readdir_currLen; } Curl_safefree(sshc->readdir_line); if(result) { state(conn, SSH_STOP); } else state(conn, SSH_SFTP_READDIR); break; case SSH_SFTP_READDIR_DONE: if(libssh2_sftp_closedir(sshc->sftp_handle) == LIBSSH2_ERROR_EAGAIN) { rc = LIBSSH2_ERROR_EAGAIN; break; } sshc->sftp_handle = NULL; Curl_safefree(sshc->readdir_filename); Curl_safefree(sshc->readdir_longentry); /* no data to transfer */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); state(conn, SSH_STOP); break; case SSH_SFTP_DOWNLOAD_INIT: /* * Work on getting the specified file */ sshc->sftp_handle = libssh2_sftp_open_ex(sshc->sftp_session, sftp_scp->path, curlx_uztoui(strlen(sftp_scp->path)), LIBSSH2_FXF_READ, data->set.new_file_perms, LIBSSH2_SFTP_OPENFILE); if(!sshc->sftp_handle) { if(libssh2_session_last_errno(sshc->ssh_session) == LIBSSH2_ERROR_EAGAIN) { rc = LIBSSH2_ERROR_EAGAIN; break; } else { err = sftp_libssh2_last_error(sshc->sftp_session); failf(data, "Could not open remote file for reading: %s", sftp_libssh2_strerror(err)); state(conn, SSH_SFTP_CLOSE); result = sftp_libssh2_error_to_CURLE(err); sshc->actualcode = result?result:CURLE_SSH; break; } } state(conn, SSH_SFTP_DOWNLOAD_STAT); break; case SSH_SFTP_DOWNLOAD_STAT: { LIBSSH2_SFTP_ATTRIBUTES attrs; rc = libssh2_sftp_stat_ex(sshc->sftp_session, sftp_scp->path, curlx_uztoui(strlen(sftp_scp->path)), LIBSSH2_SFTP_STAT, &attrs); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc) { /* * libssh2_sftp_open() didn't return an error, so maybe the server * just doesn't support stat() */ data->req.size = -1; data->req.maxdownload = -1; Curl_pgrsSetDownloadSize(data, -1); } else { curl_off_t size = attrs.filesize; if(size < 0) { failf(data, "Bad file size (%" CURL_FORMAT_CURL_OFF_T ")", size); return CURLE_BAD_DOWNLOAD_RESUME; } if(conn->data->state.use_range) { curl_off_t from, to; char *ptr; char *ptr2; from=curlx_strtoofft(conn->data->state.range, &ptr, 0); while(*ptr && (ISSPACE(*ptr) || (*ptr=='-'))) ptr++; to=curlx_strtoofft(ptr, &ptr2, 0); if((ptr == ptr2) /* no "to" value given */ || (to >= size)) { to = size - 1; } if(from < 0) { /* from is relative to end of file */ from += size; } if(from >= size) { failf(data, "Offset (%" CURL_FORMAT_CURL_OFF_T ") was beyond file size (%" CURL_FORMAT_CURL_OFF_T ")", from, attrs.filesize); return CURLE_BAD_DOWNLOAD_RESUME; } if(from > to) { from = to; size = 0; } else { size = to - from + 1; } SFTP_SEEK(conn->proto.sshc.sftp_handle, from); } data->req.size = size; data->req.maxdownload = size; Curl_pgrsSetDownloadSize(data, size); } /* We can resume if we can seek to the resume position */ if(data->state.resume_from) { if(data->state.resume_from < 0) { /* We're supposed to download the last abs(from) bytes */ if((curl_off_t)attrs.filesize < -data->state.resume_from) { failf(data, "Offset (%" CURL_FORMAT_CURL_OFF_T ") was beyond file size (%" CURL_FORMAT_CURL_OFF_T ")", data->state.resume_from, attrs.filesize); return CURLE_BAD_DOWNLOAD_RESUME; } /* download from where? */ data->state.resume_from += attrs.filesize; } else { if((curl_off_t)attrs.filesize < data->state.resume_from) { failf(data, "Offset (%" CURL_FORMAT_CURL_OFF_T ") was beyond file size (%" CURL_FORMAT_CURL_OFF_T ")", data->state.resume_from, attrs.filesize); return CURLE_BAD_DOWNLOAD_RESUME; } } /* Does a completed file need to be seeked and started or closed ? */ /* Now store the number of bytes we are expected to download */ data->req.size = attrs.filesize - data->state.resume_from; data->req.maxdownload = attrs.filesize - data->state.resume_from; Curl_pgrsSetDownloadSize(data, attrs.filesize - data->state.resume_from); SFTP_SEEK(sshc->sftp_handle, data->state.resume_from); } } if(data->set.opt_no_body) state(conn, SSH_SFTP_CLOSE); /* Setup the actual download */ if(data->req.size == 0) { /* no data to transfer */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); infof(data, "File already completely downloaded\n"); state(conn, SSH_STOP); break; } else { Curl_setup_transfer(conn, FIRSTSOCKET, data->req.size, FALSE, NULL, -1, NULL); /* not set by Curl_setup_transfer to preserve keepon bits */ conn->writesockfd = conn->sockfd; /* we want to use the _receiving_ function even when the socket turns out writableable as the underlying libssh2 recv function will deal with both accordingly */ conn->cselect_bits = CURL_CSELECT_IN; } if(result) { state(conn, SSH_SFTP_CLOSE); sshc->actualcode = result; } else { state(conn, SSH_STOP); } break; case SSH_SFTP_CLOSE: if(sshc->sftp_handle) { rc = libssh2_sftp_close(sshc->sftp_handle); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc < 0) { infof(data, "Failed to close libssh2 file\n"); } sshc->sftp_handle = NULL; } if(sftp_scp) Curl_safefree(sftp_scp->path); DEBUGF(infof(data, "SFTP DONE done\n")); /* Check if nextstate is set and move .nextstate could be POSTQUOTE_INIT After nextstate is executed,the control should come back to SSH_SFTP_CLOSE to pass the correct result back */ if(sshc->nextstate != SSH_NO_STATE) { state(conn, sshc->nextstate); sshc->nextstate = SSH_SFTP_CLOSE; } else { state(conn, SSH_STOP); result = sshc->actualcode; } break; case SSH_SFTP_SHUTDOWN: /* during times we get here due to a broken transfer and then the sftp_handle might not have been taken down so make sure that is done before we proceed */ if(sshc->sftp_handle) { rc = libssh2_sftp_close(sshc->sftp_handle); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc < 0) { infof(data, "Failed to close libssh2 file\n"); } sshc->sftp_handle = NULL; } if(sshc->sftp_session) { rc = libssh2_sftp_shutdown(sshc->sftp_session); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc < 0) { infof(data, "Failed to stop libssh2 sftp subsystem\n"); } sshc->sftp_session = NULL; } Curl_safefree(sshc->homedir); conn->data->state.most_recent_ftp_entrypath = NULL; state(conn, SSH_SESSION_DISCONNECT); break; case SSH_SCP_TRANS_INIT: result = ssh_getworkingpath(conn, sshc->homedir, &sftp_scp->path); if(result) { sshc->actualcode = result; state(conn, SSH_STOP); break; } if(data->set.upload) { if(data->set.infilesize < 0) { failf(data, "SCP requires a known file size for upload"); sshc->actualcode = CURLE_UPLOAD_FAILED; state(conn, SSH_SCP_CHANNEL_FREE); break; } state(conn, SSH_SCP_UPLOAD_INIT); } else { state(conn, SSH_SCP_DOWNLOAD_INIT); } break; case SSH_SCP_UPLOAD_INIT: /* * libssh2 requires that the destination path is a full path that * includes the destination file and name OR ends in a "/" . If this is * not done the destination file will be named the same name as the last * directory in the path. */ sshc->ssh_channel = SCP_SEND(sshc->ssh_session, sftp_scp->path, data->set.new_file_perms, data->set.infilesize); if(!sshc->ssh_channel) { if(libssh2_session_last_errno(sshc->ssh_session) == LIBSSH2_ERROR_EAGAIN) { rc = LIBSSH2_ERROR_EAGAIN; break; } else { int ssh_err; char *err_msg; ssh_err = (int)(libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0)); failf(conn->data, "%s", err_msg); state(conn, SSH_SCP_CHANNEL_FREE); sshc->actualcode = libssh2_session_error_to_CURLE(ssh_err); break; } } /* upload data */ Curl_setup_transfer(conn, -1, data->req.size, FALSE, NULL, FIRSTSOCKET, NULL); /* not set by Curl_setup_transfer to preserve keepon bits */ conn->sockfd = conn->writesockfd; if(result) { state(conn, SSH_SCP_CHANNEL_FREE); sshc->actualcode = result; } else { /* store this original bitmask setup to use later on if we can't figure out a "real" bitmask */ sshc->orig_waitfor = data->req.keepon; /* we want to use the _sending_ function even when the socket turns out readable as the underlying libssh2 scp send function will deal with both accordingly */ conn->cselect_bits = CURL_CSELECT_OUT; state(conn, SSH_STOP); } break; case SSH_SCP_DOWNLOAD_INIT: { /* * We must check the remote file; if it is a directory no values will * be set in sb */ struct stat sb; curl_off_t bytecount; /* clear the struct scp recv will fill in */ memset(&sb, 0, sizeof(struct stat)); /* get a fresh new channel from the ssh layer */ sshc->ssh_channel = libssh2_scp_recv(sshc->ssh_session, sftp_scp->path, &sb); if(!sshc->ssh_channel) { if(libssh2_session_last_errno(sshc->ssh_session) == LIBSSH2_ERROR_EAGAIN) { rc = LIBSSH2_ERROR_EAGAIN; break; } else { int ssh_err; char *err_msg; ssh_err = (int)(libssh2_session_last_error(sshc->ssh_session, &err_msg, NULL, 0)); failf(conn->data, "%s", err_msg); state(conn, SSH_SCP_CHANNEL_FREE); sshc->actualcode = libssh2_session_error_to_CURLE(ssh_err); break; } } /* download data */ bytecount = (curl_off_t)sb.st_size; data->req.maxdownload = (curl_off_t)sb.st_size; Curl_setup_transfer(conn, FIRSTSOCKET, bytecount, FALSE, NULL, -1, NULL); /* not set by Curl_setup_transfer to preserve keepon bits */ conn->writesockfd = conn->sockfd; /* we want to use the _receiving_ function even when the socket turns out writableable as the underlying libssh2 recv function will deal with both accordingly */ conn->cselect_bits = CURL_CSELECT_IN; if(result) { state(conn, SSH_SCP_CHANNEL_FREE); sshc->actualcode = result; } else state(conn, SSH_STOP); } break; case SSH_SCP_DONE: if(data->set.upload) state(conn, SSH_SCP_SEND_EOF); else state(conn, SSH_SCP_CHANNEL_FREE); break; case SSH_SCP_SEND_EOF: if(sshc->ssh_channel) { rc = libssh2_channel_send_eof(sshc->ssh_channel); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc) { infof(data, "Failed to send libssh2 channel EOF\n"); } } state(conn, SSH_SCP_WAIT_EOF); break; case SSH_SCP_WAIT_EOF: if(sshc->ssh_channel) { rc = libssh2_channel_wait_eof(sshc->ssh_channel); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc) { infof(data, "Failed to get channel EOF: %d\n", rc); } } state(conn, SSH_SCP_WAIT_CLOSE); break; case SSH_SCP_WAIT_CLOSE: if(sshc->ssh_channel) { rc = libssh2_channel_wait_closed(sshc->ssh_channel); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc) { infof(data, "Channel failed to close: %d\n", rc); } } state(conn, SSH_SCP_CHANNEL_FREE); break; case SSH_SCP_CHANNEL_FREE: if(sshc->ssh_channel) { rc = libssh2_channel_free(sshc->ssh_channel); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc < 0) { infof(data, "Failed to free libssh2 scp subsystem\n"); } sshc->ssh_channel = NULL; } DEBUGF(infof(data, "SCP DONE phase complete\n")); #if 0 /* PREV */ state(conn, SSH_SESSION_DISCONNECT); #endif state(conn, SSH_STOP); result = sshc->actualcode; break; case SSH_SESSION_DISCONNECT: /* during weird times when we've been prematurely aborted, the channel is still alive when we reach this state and we MUST kill the channel properly first */ if(sshc->ssh_channel) { rc = libssh2_channel_free(sshc->ssh_channel); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc < 0) { infof(data, "Failed to free libssh2 scp subsystem\n"); } sshc->ssh_channel = NULL; } if(sshc->ssh_session) { rc = libssh2_session_disconnect(sshc->ssh_session, "Shutdown"); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc < 0) { infof(data, "Failed to disconnect libssh2 session\n"); } } Curl_safefree(sshc->homedir); conn->data->state.most_recent_ftp_entrypath = NULL; state(conn, SSH_SESSION_FREE); break; case SSH_SESSION_FREE: #ifdef HAVE_LIBSSH2_KNOWNHOST_API if(sshc->kh) { libssh2_knownhost_free(sshc->kh); sshc->kh = NULL; } #endif #ifdef HAVE_LIBSSH2_AGENT_API if(sshc->ssh_agent) { rc = libssh2_agent_disconnect(sshc->ssh_agent); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc < 0) { infof(data, "Failed to disconnect from libssh2 agent\n"); } libssh2_agent_free (sshc->ssh_agent); sshc->ssh_agent = NULL; /* NB: there is no need to free identities, they are part of internal agent stuff */ sshc->sshagent_identity = NULL; sshc->sshagent_prev_identity = NULL; } #endif if(sshc->ssh_session) { rc = libssh2_session_free(sshc->ssh_session); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } else if(rc < 0) { infof(data, "Failed to free libssh2 session\n"); } sshc->ssh_session = NULL; } /* worst-case scenario cleanup */ DEBUGASSERT(sshc->ssh_session == NULL); DEBUGASSERT(sshc->ssh_channel == NULL); DEBUGASSERT(sshc->sftp_session == NULL); DEBUGASSERT(sshc->sftp_handle == NULL); #ifdef HAVE_LIBSSH2_KNOWNHOST_API DEBUGASSERT(sshc->kh == NULL); #endif #ifdef HAVE_LIBSSH2_AGENT_API DEBUGASSERT(sshc->ssh_agent == NULL); #endif Curl_safefree(sshc->rsa_pub); Curl_safefree(sshc->rsa); Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); Curl_safefree(sshc->homedir); Curl_safefree(sshc->readdir_filename); Curl_safefree(sshc->readdir_longentry); Curl_safefree(sshc->readdir_line); Curl_safefree(sshc->readdir_linkPath); /* the code we are about to return */ result = sshc->actualcode; memset(sshc, 0, sizeof(struct ssh_conn)); conn->bits.close = TRUE; sshc->state = SSH_SESSION_FREE; /* current */ sshc->nextstate = SSH_NO_STATE; state(conn, SSH_STOP); break; case SSH_QUIT: /* fallthrough, just stop! */ default: /* internal error */ sshc->nextstate = SSH_NO_STATE; state(conn, SSH_STOP); break; } } while(!rc && (sshc->state != SSH_STOP)); if(rc == LIBSSH2_ERROR_EAGAIN) { /* we would block, we need to wait for the socket to be ready (in the right direction too)! */ *block = TRUE; } return result; } /* called by the multi interface to figure out what socket(s) to wait for and for what actions in the DO_DONE, PERFORM and WAITPERFORM states */ static int ssh_perform_getsock(const struct connectdata *conn, curl_socket_t *sock, /* points to numsocks number of sockets */ int numsocks) { #ifdef HAVE_LIBSSH2_SESSION_BLOCK_DIRECTION int bitmap = GETSOCK_BLANK; (void)numsocks; sock[0] = conn->sock[FIRSTSOCKET]; if(conn->waitfor & KEEP_RECV) bitmap |= GETSOCK_READSOCK(FIRSTSOCKET); if(conn->waitfor & KEEP_SEND) bitmap |= GETSOCK_WRITESOCK(FIRSTSOCKET); return bitmap; #else /* if we don't know the direction we can use the generic *_getsock() function even for the protocol_connect and doing states */ return Curl_single_getsock(conn, sock, numsocks); #endif } /* Generic function called by the multi interface to figure out what socket(s) to wait for and for what actions during the DOING and PROTOCONNECT states*/ static int ssh_getsock(struct connectdata *conn, curl_socket_t *sock, /* points to numsocks number of sockets */ int numsocks) { #ifndef HAVE_LIBSSH2_SESSION_BLOCK_DIRECTION (void)conn; (void)sock; (void)numsocks; /* if we don't know any direction we can just play along as we used to and not provide any sensible info */ return GETSOCK_BLANK; #else /* if we know the direction we can use the generic *_getsock() function even for the protocol_connect and doing states */ return ssh_perform_getsock(conn, sock, numsocks); #endif } #ifdef HAVE_LIBSSH2_SESSION_BLOCK_DIRECTION /* * When one of the libssh2 functions has returned LIBSSH2_ERROR_EAGAIN this * function is used to figure out in what direction and stores this info so * that the multi interface can take advantage of it. Make sure to call this * function in all cases so that when it _doesn't_ return EAGAIN we can * restore the default wait bits. */ static void ssh_block2waitfor(struct connectdata *conn, bool block) { struct ssh_conn *sshc = &conn->proto.sshc; int dir; if(block && (dir = libssh2_session_block_directions(sshc->ssh_session))) { /* translate the libssh2 define bits into our own bit defines */ conn->waitfor = ((dir&LIBSSH2_SESSION_BLOCK_INBOUND)?KEEP_RECV:0) | ((dir&LIBSSH2_SESSION_BLOCK_OUTBOUND)?KEEP_SEND:0); } else /* It didn't block or libssh2 didn't reveal in which direction, put back the original set */ conn->waitfor = sshc->orig_waitfor; } #else /* no libssh2 directional support so we simply don't know */ #define ssh_block2waitfor(x,y) Curl_nop_stmt #endif /* called repeatedly until done from multi.c */ static CURLcode ssh_multi_statemach(struct connectdata *conn, bool *done) { struct ssh_conn *sshc = &conn->proto.sshc; CURLcode result = CURLE_OK; bool block; /* we store the status and use that to provide a ssh_getsock() implementation */ result = ssh_statemach_act(conn, &block); *done = (sshc->state == SSH_STOP) ? TRUE : FALSE; ssh_block2waitfor(conn, block); return result; } static CURLcode ssh_block_statemach(struct connectdata *conn, bool duringconnect) { struct ssh_conn *sshc = &conn->proto.sshc; CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; while((sshc->state != SSH_STOP) && !result) { bool block; long left; result = ssh_statemach_act(conn, &block); if(result) break; if(Curl_pgrsUpdate(conn)) return CURLE_ABORTED_BY_CALLBACK; else { struct timeval now = Curl_tvnow(); result = Curl_speedcheck(data, now); if(result) break; } left = Curl_timeleft(data, NULL, duringconnect); if(left < 0) { failf(data, "Operation timed out"); return CURLE_OPERATION_TIMEDOUT; } #ifdef HAVE_LIBSSH2_SESSION_BLOCK_DIRECTION if((CURLE_OK == result) && block) { int dir = libssh2_session_block_directions(sshc->ssh_session); curl_socket_t sock = conn->sock[FIRSTSOCKET]; curl_socket_t fd_read = CURL_SOCKET_BAD; curl_socket_t fd_write = CURL_SOCKET_BAD; if(LIBSSH2_SESSION_BLOCK_INBOUND & dir) fd_read = sock; if(LIBSSH2_SESSION_BLOCK_OUTBOUND & dir) fd_write = sock; /* wait for the socket to become ready */ Curl_socket_ready(fd_read, fd_write, left>1000?1000:left); /* ignore result */ } #endif } return result; } /* * SSH setup and connection */ static CURLcode ssh_setup_connection(struct connectdata *conn) { struct SSHPROTO *ssh; conn->data->req.protop = ssh = calloc(1, sizeof(struct SSHPROTO)); if(!ssh) return CURLE_OUT_OF_MEMORY; return CURLE_OK; } static Curl_recv scp_recv, sftp_recv; static Curl_send scp_send, sftp_send; /* * Curl_ssh_connect() gets called from Curl_protocol_connect() to allow us to * do protocol-specific actions at connect-time. */ static CURLcode ssh_connect(struct connectdata *conn, bool *done) { #ifdef CURL_LIBSSH2_DEBUG curl_socket_t sock; #endif struct ssh_conn *ssh; CURLcode result; struct SessionHandle *data = conn->data; /* initialize per-handle data if not already */ if(!data->req.protop) ssh_setup_connection(conn); /* We default to persistent connections. We set this already in this connect function to make the re-use checks properly be able to check this bit. */ conn->bits.close = FALSE; if(conn->handler->protocol & CURLPROTO_SCP) { conn->recv[FIRSTSOCKET] = scp_recv; conn->send[FIRSTSOCKET] = scp_send; } else { conn->recv[FIRSTSOCKET] = sftp_recv; conn->send[FIRSTSOCKET] = sftp_send; } ssh = &conn->proto.sshc; #ifdef CURL_LIBSSH2_DEBUG if(conn->user) { infof(data, "User: %s\n", conn->user); } if(conn->passwd) { infof(data, "Password: %s\n", conn->passwd); } sock = conn->sock[FIRSTSOCKET]; #endif /* CURL_LIBSSH2_DEBUG */ ssh->ssh_session = libssh2_session_init_ex(my_libssh2_malloc, my_libssh2_free, my_libssh2_realloc, conn); if(ssh->ssh_session == NULL) { failf(data, "Failure initialising ssh session"); return CURLE_FAILED_INIT; } #ifdef HAVE_LIBSSH2_KNOWNHOST_API if(data->set.str[STRING_SSH_KNOWNHOSTS]) { int rc; ssh->kh = libssh2_knownhost_init(ssh->ssh_session); if(!ssh->kh) { /* eeek. TODO: free the ssh_session! */ return CURLE_FAILED_INIT; } /* read all known hosts from there */ rc = libssh2_knownhost_readfile(ssh->kh, data->set.str[STRING_SSH_KNOWNHOSTS], LIBSSH2_KNOWNHOST_FILE_OPENSSH); if(rc < 0) infof(data, "Failed to read known hosts from %s\n", data->set.str[STRING_SSH_KNOWNHOSTS]); } #endif /* HAVE_LIBSSH2_KNOWNHOST_API */ #ifdef CURL_LIBSSH2_DEBUG libssh2_trace(ssh->ssh_session, ~0); infof(data, "SSH socket: %d\n", (int)sock); #endif /* CURL_LIBSSH2_DEBUG */ state(conn, SSH_INIT); result = ssh_multi_statemach(conn, done); return result; } /* *********************************************************************** * * scp_perform() * * This is the actual DO function for SCP. Get a file according to * the options previously setup. */ static CURLcode scp_perform(struct connectdata *conn, bool *connected, bool *dophase_done) { 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 */ state(conn, SSH_SCP_TRANS_INIT); /* run the state-machine */ result = ssh_multi_statemach(conn, dophase_done); *connected = conn->bits.tcpconnect[FIRSTSOCKET]; if(*dophase_done) { DEBUGF(infof(conn->data, "DO phase is complete\n")); } return result; } /* called from multi.c while DOing */ static CURLcode scp_doing(struct connectdata *conn, bool *dophase_done) { CURLcode result; result = ssh_multi_statemach(conn, dophase_done); if(*dophase_done) { DEBUGF(infof(conn->data, "DO phase is complete\n")); } return result; } /* * The DO function is generic for both protocols. There was previously two * separate ones but this way means less duplicated code. */ static CURLcode ssh_do(struct connectdata *conn, bool *done) { CURLcode res; bool connected = 0; struct SessionHandle *data = conn->data; struct ssh_conn *sshc = &conn->proto.sshc; *done = FALSE; /* default to false */ data->req.size = -1; /* make sure this is unknown at this point */ sshc->actualcode = CURLE_OK; /* reset error code */ sshc->secondCreateDirs =0; /* reset the create dir attempt state variable */ Curl_pgrsSetUploadCounter(data, 0); Curl_pgrsSetDownloadCounter(data, 0); Curl_pgrsSetUploadSize(data, 0); Curl_pgrsSetDownloadSize(data, 0); if(conn->handler->protocol & CURLPROTO_SCP) res = scp_perform(conn, &connected, done); else res = sftp_perform(conn, &connected, done); return res; } /* BLOCKING, but the function is using the state machine so the only reason this is still blocking is that the multi interface code has no support for disconnecting operations that takes a while */ static CURLcode scp_disconnect(struct connectdata *conn, bool dead_connection) { CURLcode result = CURLE_OK; struct ssh_conn *ssh = &conn->proto.sshc; (void) dead_connection; Curl_safefree(conn->data->req.protop); if(ssh->ssh_session) { /* only if there's a session still around to use! */ state(conn, SSH_SESSION_DISCONNECT); result = ssh_block_statemach(conn, FALSE); } return result; } /* generic done function for both SCP and SFTP called from their specific done functions */ static CURLcode ssh_done(struct connectdata *conn, CURLcode status) { CURLcode result = CURLE_OK; struct SSHPROTO *sftp_scp = conn->data->req.protop; if(status == CURLE_OK) { /* run the state-machine TODO: when the multi interface is used, this _really_ should be using the ssh_multi_statemach function but we have no general support for non-blocking DONE operations, not in the multi state machine and with Curl_done() invokes on several places in the code! */ result = ssh_block_statemach(conn, FALSE); } else result = status; if(sftp_scp) Curl_safefree(sftp_scp->path); if(Curl_pgrsDone(conn)) return CURLE_ABORTED_BY_CALLBACK; conn->data->req.keepon = 0; /* clear all bits */ return result; } static CURLcode scp_done(struct connectdata *conn, CURLcode status, bool premature) { (void)premature; /* not used */ if(status == CURLE_OK) state(conn, SSH_SCP_DONE); return ssh_done(conn, status); } /* return number of received (decrypted) bytes */ static ssize_t scp_send(struct connectdata *conn, int sockindex, const void *mem, size_t len, CURLcode *err) { ssize_t nwrite; (void)sockindex; /* we only support SCP on the fixed known primary socket */ /* libssh2_channel_write() returns int! */ nwrite = (ssize_t) libssh2_channel_write(conn->proto.sshc.ssh_channel, mem, len); ssh_block2waitfor(conn, (nwrite == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE); if(nwrite == LIBSSH2_ERROR_EAGAIN) { *err = CURLE_AGAIN; nwrite = 0; } else if(nwrite < LIBSSH2_ERROR_NONE) { *err = libssh2_session_error_to_CURLE((int)nwrite); nwrite = -1; } return nwrite; } /* * If the read would block (EWOULDBLOCK) we return -1. Otherwise we return * a regular CURLcode value. */ static ssize_t scp_recv(struct connectdata *conn, int sockindex, char *mem, size_t len, CURLcode *err) { ssize_t nread; (void)sockindex; /* we only support SCP on the fixed known primary socket */ /* libssh2_channel_read() returns int */ nread = (ssize_t) libssh2_channel_read(conn->proto.sshc.ssh_channel, mem, len); ssh_block2waitfor(conn, (nread == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE); if(nread == LIBSSH2_ERROR_EAGAIN) { *err = CURLE_AGAIN; nread = -1; } return nread; } /* * =============== SFTP =============== */ /* *********************************************************************** * * sftp_perform() * * This is the actual DO function for SFTP. Get a file/directory according to * the options previously setup. */ static CURLcode sftp_perform(struct connectdata *conn, bool *connected, bool *dophase_done) { 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 */ state(conn, SSH_SFTP_QUOTE_INIT); /* run the state-machine */ result = ssh_multi_statemach(conn, dophase_done); *connected = conn->bits.tcpconnect[FIRSTSOCKET]; if(*dophase_done) { DEBUGF(infof(conn->data, "DO phase is complete\n")); } return result; } /* called from multi.c while DOing */ static CURLcode sftp_doing(struct connectdata *conn, bool *dophase_done) { CURLcode result; result = ssh_multi_statemach(conn, dophase_done); if(*dophase_done) { DEBUGF(infof(conn->data, "DO phase is complete\n")); } return result; } /* BLOCKING, but the function is using the state machine so the only reason this is still blocking is that the multi interface code has no support for disconnecting operations that takes a while */ static CURLcode sftp_disconnect(struct connectdata *conn, bool dead_connection) { CURLcode result = CURLE_OK; (void) dead_connection; DEBUGF(infof(conn->data, "SSH DISCONNECT starts now\n")); Curl_safefree(conn->data->req.protop); if(conn->proto.sshc.ssh_session) { /* only if there's a session still around to use! */ state(conn, SSH_SFTP_SHUTDOWN); result = ssh_block_statemach(conn, FALSE); } DEBUGF(infof(conn->data, "SSH DISCONNECT is done\n")); return result; } static CURLcode sftp_done(struct connectdata *conn, CURLcode status, bool premature) { struct ssh_conn *sshc = &conn->proto.sshc; if(status == CURLE_OK) { /* Post quote commands are executed after the SFTP_CLOSE state to avoid errors that could happen due to open file handles during POSTQUOTE operation */ if(!status && !premature && conn->data->set.postquote) { sshc->nextstate = SSH_SFTP_POSTQUOTE_INIT; state(conn, SSH_SFTP_CLOSE); } else state(conn, SSH_SFTP_CLOSE); } return ssh_done(conn, status); } /* return number of sent bytes */ static ssize_t sftp_send(struct connectdata *conn, int sockindex, const void *mem, size_t len, CURLcode *err) { ssize_t nwrite; /* libssh2_sftp_write() used to return size_t in 0.14 but is changed to ssize_t in 0.15. These days we don't support libssh2 0.15*/ (void)sockindex; nwrite = libssh2_sftp_write(conn->proto.sshc.sftp_handle, mem, len); ssh_block2waitfor(conn, (nwrite == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE); if(nwrite == LIBSSH2_ERROR_EAGAIN) { *err = CURLE_AGAIN; nwrite = 0; } else if(nwrite < LIBSSH2_ERROR_NONE) { *err = libssh2_session_error_to_CURLE((int)nwrite); nwrite = -1; } return nwrite; } /* * Return number of received (decrypted) bytes */ static ssize_t sftp_recv(struct connectdata *conn, int sockindex, char *mem, size_t len, CURLcode *err) { ssize_t nread; (void)sockindex; nread = libssh2_sftp_read(conn->proto.sshc.sftp_handle, mem, len); ssh_block2waitfor(conn, (nread == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE); if(nread == LIBSSH2_ERROR_EAGAIN) { *err = CURLE_AGAIN; nread = -1; } return nread; } /* The get_pathname() function is being borrowed from OpenSSH sftp.c version 4.6p1. */ /* * Copyright (c) 2001-2004 Damien Miller * * 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 THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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. */ static CURLcode get_pathname(const char **cpp, char **path) { const char *cp = *cpp, *end; char quot; unsigned int i, j; static const char WHITESPACE[] = " \t\r\n"; cp += strspn(cp, WHITESPACE); if(!*cp) { *cpp = cp; *path = NULL; return CURLE_QUOTE_ERROR; } *path = malloc(strlen(cp) + 1); if(*path == NULL) return CURLE_OUT_OF_MEMORY; /* Check for quoted filenames */ if(*cp == '\"' || *cp == '\'') { quot = *cp++; /* Search for terminating quote, unescape some chars */ for(i = j = 0; i <= strlen(cp); i++) { if(cp[i] == quot) { /* Found quote */ i++; (*path)[j] = '\0'; break; } if(cp[i] == '\0') { /* End of string */ /*error("Unterminated quote");*/ goto fail; } if(cp[i] == '\\') { /* Escaped characters */ i++; if(cp[i] != '\'' && cp[i] != '\"' && cp[i] != '\\') { /*error("Bad escaped character '\\%c'", cp[i]);*/ goto fail; } } (*path)[j++] = cp[i]; } if(j == 0) { /*error("Empty quotes");*/ goto fail; } *cpp = cp + i + strspn(cp + i, WHITESPACE); } else { /* Read to end of filename */ end = strpbrk(cp, WHITESPACE); if(end == NULL) end = strchr(cp, '\0'); *cpp = end + strspn(end, WHITESPACE); memcpy(*path, cp, end - cp); (*path)[end - cp] = '\0'; } return CURLE_OK; fail: Curl_safefree(*path); return CURLE_QUOTE_ERROR; } static const char *sftp_libssh2_strerror(int err) { switch (err) { case LIBSSH2_FX_NO_SUCH_FILE: return "No such file or directory"; case LIBSSH2_FX_PERMISSION_DENIED: return "Permission denied"; case LIBSSH2_FX_FAILURE: return "Operation failed"; case LIBSSH2_FX_BAD_MESSAGE: return "Bad message from SFTP server"; case LIBSSH2_FX_NO_CONNECTION: return "Not connected to SFTP server"; case LIBSSH2_FX_CONNECTION_LOST: return "Connection to SFTP server lost"; case LIBSSH2_FX_OP_UNSUPPORTED: return "Operation not supported by SFTP server"; case LIBSSH2_FX_INVALID_HANDLE: return "Invalid handle"; case LIBSSH2_FX_NO_SUCH_PATH: return "No such file or directory"; case LIBSSH2_FX_FILE_ALREADY_EXISTS: return "File already exists"; case LIBSSH2_FX_WRITE_PROTECT: return "File is write protected"; case LIBSSH2_FX_NO_MEDIA: return "No media"; case LIBSSH2_FX_NO_SPACE_ON_FILESYSTEM: return "Disk full"; case LIBSSH2_FX_QUOTA_EXCEEDED: return "User quota exceeded"; case LIBSSH2_FX_UNKNOWN_PRINCIPLE: return "Unknown principle"; case LIBSSH2_FX_LOCK_CONFlICT: return "File lock conflict"; case LIBSSH2_FX_DIR_NOT_EMPTY: return "Directory not empty"; case LIBSSH2_FX_NOT_A_DIRECTORY: return "Not a directory"; case LIBSSH2_FX_INVALID_FILENAME: return "Invalid filename"; case LIBSSH2_FX_LINK_LOOP: return "Link points to itself"; } return "Unknown error in libssh2"; } #endif /* USE_LIBSSH2 */ curl-7.35.0/lib/transfer.c0000644000175000017500000017564412270035364012255 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include "curl_setup.h" #include "strtoofft.h" #include "strequal.h" #include "rawstr.h" #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_SIGNAL_H #include #endif #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 #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 "vtls/vtls.h" #include "http_digest.h" #include "curl_ntlm.h" #include "http_negotiate.h" #include "share.h" #include "curl_memory.h" #include "select.h" #include "multiif.h" #include "connect.h" #include "non-ascii.h" #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; #ifdef CURL_DOES_CONVERSIONS bool sending_http_headers = FALSE; if(conn->handler->protocol&(CURLPROTO_HTTP|CURLPROTO_RTSP)) { const struct HTTP *http = data->req.protop; if(http->sending == HTTPSEND_REQUEST) /* We're sending the HTTP request headers, not the data. Remember that so we don't re-translate them into garbage. */ sending_http_headers = TRUE; } #endif if(data->req.upload_chunky) { /* if chunked Transfer-Encoding */ buffersize -= (8 + 2 + 2); /* 32bit hex + CRLF + CRLF */ data->req.upload_fromhere += (8 + 2); /* 32bit hex + CRLF */ } /* this function returns a size_t, so we typecast to int to prevent warnings with picky compilers */ nread = (int)conn->fread_func(data->req.upload_fromhere, 1, buffersize, conn->fread_in); if(nread == CURL_READFUNC_ABORT) { failf(data, "operation aborted by callback"); *nreadp = 0; return CURLE_ABORTED_BY_CALLBACK; } else if(nread == CURL_READFUNC_PAUSE) { if(conn->handler->flags & PROTOPT_NONETWORK) { /* protocols that work without network cannot be paused. This is actually only FILE:// just now, and it can't pause since the transfer isn't done using the "normal" procedure. */ failf(data, "Read callback asked for PAUSE when not supported!"); return CURLE_READ_ERROR; } else { struct SingleRequest *k = &data->req; /* CURL_READFUNC_PAUSE pauses read callbacks that feed socket writes */ k->keepon |= KEEP_SEND_PAUSE; /* mark socket send as paused */ if(data->req.upload_chunky) { /* Back out the preallocation done above */ data->req.upload_fromhere -= (8 + 2); } *nreadp = 0; } return CURLE_OK; /* nothing was read */ } else if((size_t)nread > buffersize) { /* the read function returned a too large value */ *nreadp = 0; failf(data, "read function returned funny value"); return CURLE_READ_ERROR; } if(!data->req.forbidchunk && data->req.upload_chunky) { /* if chunked Transfer-Encoding * build chunk: * * CRLF * CRLF */ /* On non-ASCII platforms the may or may not be translated based on set.prefer_ascii while the protocol portion must always be translated to the network encoding. To further complicate matters, line end conversion might be done later on, so we need to prevent CRLFs from becoming CRCRLFs if that's the case. To do this we use bare LFs here, knowing they'll become CRLFs later on. */ char hexbuffer[11]; const char *endofline_native; const char *endofline_network; int hexlen; if( #ifdef CURL_DO_LINEEND_CONV (data->set.prefer_ascii) || #endif (data->set.crlf)) { /* \n will become \r\n later on */ endofline_native = "\n"; endofline_network = "\x0a"; } else { endofline_native = "\r\n"; endofline_network = "\x0d\x0a"; } hexlen = snprintf(hexbuffer, sizeof(hexbuffer), "%x%s", nread, endofline_native); /* move buffer pointer */ data->req.upload_fromhere -= hexlen; nread += hexlen; /* copy the prefix to the buffer, leaving out the NUL */ memcpy(data->req.upload_fromhere, hexbuffer, hexlen); /* always append ASCII CRLF to the data */ memcpy(data->req.upload_fromhere + nread, endofline_network, strlen(endofline_network)); #ifdef CURL_DOES_CONVERSIONS CURLcode res; int length; if(data->set.prefer_ascii) { /* translate the protocol and data */ length = nread; } else { /* just translate the protocol portion */ length = strlen(hexbuffer); } res = Curl_convert_to_network(data, data->req.upload_fromhere, length); /* Curl_convert_to_network calls failf if unsuccessful */ if(res) return(res); #endif /* CURL_DOES_CONVERSIONS */ if((nread - hexlen) == 0) /* mark this as done once this chunk is transferred */ data->req.upload_done = TRUE; nread+=(int)strlen(endofline_native); /* for the added end of line */ } #ifdef CURL_DOES_CONVERSIONS else if((data->set.prefer_ascii) && (!sending_http_headers)) { CURLcode res; res = Curl_convert_to_network(data, data->req.upload_fromhere, nread); /* Curl_convert_to_network calls failf if unsuccessful */ if(res != CURLE_OK) return(res); } #endif /* CURL_DOES_CONVERSIONS */ *nreadp = nread; return CURLE_OK; } /* * Curl_readrewind() rewinds the read stream. This is typically 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 */ /* explicitly switch off sending data on this connection now since we are about to restart a new transfer and thus we want to avoid inadvertently sending more data on the existing connection until the next transfer starts */ data->req.keepon &= ~KEEP_SEND; /* 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.seek_func) { int err; err = (data->set.seek_func)(data->set.seek_client, 0, SEEK_SET); if(err) { failf(data, "seek callback returned error %d", (int)err); return CURLE_SEND_FAIL_REWIND; } } else if(data->set.ioctl_func) { curlioerr err; err = (data->set.ioctl_func)(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", (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 ourselves with fseek() */ if(data->set.fread_func == (curl_read_callback)fread) { if(-1 != fseek(data->set.in, 0, SEEK_SET)) /* successful rewind */ return CURLE_OK; } /* no callback set or failure above, makes us fail at once */ failf(data, "necessary data rewind wasn't possible"); return CURLE_SEND_FAIL_REWIND; } } return CURLE_OK; } static int data_pending(const struct connectdata *conn) { /* in the case of libssh2, we can never be really sure that we have emptied its internal buffers so we MUST always try until we get EAGAIN back */ return conn->handler->protocol&(CURLPROTO_SCP|CURLPROTO_SFTP) || Curl_ssl_data_pending(conn, FIRSTSOCKET); } static void read_rewind(struct connectdata *conn, size_t thismuch) { DEBUGASSERT(conn->read_pos >= thismuch); conn->read_pos -= thismuch; conn->bits.stream_was_rewound = TRUE; #ifdef DEBUGBUILD { char buf[512 + 1]; size_t show; show = CURLMIN(conn->buf_len - conn->read_pos, sizeof(buf)-1); if(conn->master_buffer) { memcpy(buf, conn->master_buffer + conn->read_pos, show); buf[show] = '\0'; } else { buf[0] = '\0'; } DEBUGF(infof(conn->data, "Buffer after stream rewind (read_pos = %zu): [%s]\n", conn->read_pos, buf)); } #endif } /* * Check to see if CURLOPT_TIMECONDITION was met by comparing the time of the * remote document with the time provided by CURLOPT_TIMEVAL */ bool Curl_meets_timecondition(struct SessionHandle *data, time_t timeofdoc) { if((timeofdoc == 0) || (data->set.timevalue == 0)) return TRUE; switch(data->set.timecondition) { case CURL_TIMECOND_IFMODSINCE: default: if(timeofdoc <= data->set.timevalue) { infof(data, "The requested document is not new enough\n"); data->info.timecond = TRUE; return FALSE; } break; case CURL_TIMECOND_IFUNMODSINCE: if(timeofdoc >= data->set.timevalue) { infof(data, "The requested document is not old enough\n"); data->info.timecond = TRUE; return FALSE; } break; } return TRUE; } /* * 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) */ static CURLcode readwrite_data(struct SessionHandle *data, struct connectdata *conn, struct SingleRequest *k, int *didwhat, bool *done) { CURLcode result = CURLE_OK; ssize_t nread; /* number of bytes read */ size_t excess = 0; /* excess bytes read */ bool is_empty_data = FALSE; bool readmore = FALSE; /* used by RTP to signal for more data */ *done = FALSE; /* This is where we loop until we have read everything there is to read or we get a CURLE_AGAIN */ do { size_t buffersize = data->set.buffer_size? data->set.buffer_size : BUFSIZE; size_t bytestoread = buffersize; if(k->size != -1 && !k->header) { /* make sure we don't read "too much" if we can help it since we might be pipelining and then someone else might want to read what follows! */ curl_off_t totalleft = k->size - k->bytecount; if(totalleft < (curl_off_t)bytestoread) bytestoread = (size_t)totalleft; } if(bytestoread) { /* receive data from the network! */ result = Curl_read(conn, conn->sockfd, k->buf, bytestoread, &nread); /* read would've blocked */ if(CURLE_AGAIN == result) break; /* get out of loop */ if(result>0) return result; } else { /* read nothing but since we wanted nothing we consider this an OK situation to proceed from */ nread = 0; } if((k->bytecount == 0) && (k->writebytecount == 0)) { Curl_pgrsTime(data, TIMER_STARTTRANSFER); if(k->exp100 > EXP100_SEND_DATA) /* set time stamp to compare with when waiting for the 100 */ k->start100 = Curl_tvnow(); } *didwhat |= KEEP_RECV; /* indicates data of zero size, i.e. empty file */ is_empty_data = ((nread == 0) && (k->bodywrites == 0)) ? TRUE : FALSE; /* NUL 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! */ DEBUGF(infof(data, "nread <= 0, server closed connection, bailing\n")); k->keepon &= ~KEEP_RECV; 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; if(conn->handler->readwrite) { result = conn->handler->readwrite(data, conn, &nread, &readmore); if(result) return result; if(readmore) break; } #ifndef CURL_DISABLE_HTTP /* 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; result = Curl_http_readwrite_headers(data, conn, &nread, &stop_reading); if(result) return result; if(conn->handler->readwrite && (k->maxdownload <= 0 && nread > 0)) { result = conn->handler->readwrite(data, conn, &nread, &readmore); if(result) return result; if(readmore) break; } if(stop_reading) { /* We've stopped dealing with input, get out of the do-while loop */ if(nread > 0) { if(Curl_multi_pipeline_enabled(conn->data->multi)) { infof(data, "Rewinding stream by : %zd" " bytes on url %s (zero-length body)\n", nread, data->state.path); read_rewind(conn, (size_t)nread); } else { infof(data, "Excess found in a non pipelined read:" " excess = %zd" " url = %s (zero-length body)\n", nread, data->state.path); } } break; } } #endif /* CURL_DISABLE_HTTP */ /* 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)) { #ifndef CURL_DISABLE_HTTP 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->handler->protocol&(CURLPROTO_HTTP|CURLPROTO_RTSP)) { /* HTTP-only checks */ if(data->req.newurl) { if(conn->bits.close) { /* Abort after the headers if "follow Location" is set and we're set to close anyway. */ k->keepon &= ~KEEP_RECV; *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->state.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_RANGE_ERROR; } if(data->set.timecondition && !data->state.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(!Curl_meets_timecondition(data, k->timeofdoc)) { *done = TRUE; /* We're simulating a http 304 from server so we return what should have been returned from the server */ data->info.httpcode = 304; infof(data, "Simulate a HTTP 304 response!\n"); /* we abort the transfer before it is completed == we ruin the re-use ability. Close the connection */ conn->bits.close = TRUE; return CURLE_OK; } } /* we have a time condition */ } /* this is HTTP or RTSP */ } /* this is the first time we write a body part */ #endif /* CURL_DISABLE_HTTP */ 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(k->chunk) { /* * 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, "Problem (%d) in the Chunked-Encoded data", (int)res); return CURLE_RECV_ERROR; } else if(CHUNKE_STOP == res) { size_t dataleft; /* we're done reading chunks! */ k->keepon &= ~KEEP_RECV; /* 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. We DO care about this data if we are pipelining. Push it back to be read on the next pass. */ dataleft = conn->chunk.dataleft; if(dataleft != 0) { infof(conn->data, "Leftovers after chunking: %zu bytes\n", dataleft); if(Curl_multi_pipeline_enabled(conn->data->multi)) { /* only attempt the rewind if we truly are pipelining */ infof(conn->data, "Rewinding %zu bytes\n",dataleft); read_rewind(conn, dataleft); } } } /* If it returned OK, we just keep going */ } #endif /* CURL_DISABLE_HTTP */ /* Account for body content stored in the header buffer */ if(k->badheader && !k->ignorebody) { DEBUGF(infof(data, "Increasing bytecount by %zu from hbuflen\n", k->hbuflen)); k->bytecount += k->hbuflen; } if((-1 != k->maxdownload) && (k->bytecount + nread >= k->maxdownload)) { excess = (size_t)(k->bytecount + nread - k->maxdownload); if(excess > 0 && !k->ignorebody) { if(Curl_multi_pipeline_enabled(conn->data->multi)) { /* The 'excess' amount below can't be more than BUFSIZE which always will fit in a size_t */ infof(data, "Rewinding stream by : %zu" " bytes on url %s (size = %" CURL_FORMAT_CURL_OFF_T ", maxdownload = %" CURL_FORMAT_CURL_OFF_T ", bytecount = %" CURL_FORMAT_CURL_OFF_T ", nread = %zd)\n", excess, data->state.path, k->size, k->maxdownload, k->bytecount, nread); read_rewind(conn, excess); } else { infof(data, "Excess found in a non pipelined read:" " excess = %zu" ", size = %" CURL_FORMAT_CURL_OFF_T ", maxdownload = %" CURL_FORMAT_CURL_OFF_T ", bytecount = %" CURL_FORMAT_CURL_OFF_T "\n", excess, k->size, k->maxdownload, k->bytecount); } } nread = (ssize_t) (k->maxdownload - k->bytecount); if(nread < 0 ) /* this should be unusual */ nread = 0; k->keepon &= ~KEEP_RECV; /* we're done reading */ } k->bytecount += nread; Curl_pgrsSetDownloadCounter(data, k->bytecount); if(!k->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 */ /* Don't let excess data pollute body writes */ if(k->maxdownload == -1 || (curl_off_t)k->hbuflen <= k->maxdownload) result = Curl_client_write(conn, CLIENTWRITE_BODY, data->state.headerbuff, k->hbuflen); else result = Curl_client_write(conn, CLIENTWRITE_BODY, data->state.headerbuff, (size_t)k->maxdownload); 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 (conn->data->set.http_ce_skip ? IDENTITY : k->auto_decoding) { case IDENTITY: #endif /* This is the default when the server sends no Content-Encoding header. See Curl_readwrite_init; the memset() call initializes k->auto_decoding to zero. */ if(!k->ignorebody) { #ifndef CURL_DISABLE_POP3 if(conn->handler->protocol&CURLPROTO_POP3) result = Curl_pop3_write(conn, k->str, nread); else #endif /* CURL_DISABLE_POP3 */ 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(conn->handler->readwrite && (excess > 0 && !conn->bits.stream_was_rewound)) { /* Parse the excess data */ k->str += nread; nread = (ssize_t)excess; result = conn->handler->readwrite(data, conn, &nread, &readmore); if(result) return result; if(readmore) k->keepon |= KEEP_RECV; /* we're not done reading */ break; } if(is_empty_data) { /* if we received nothing, the server closed the connection and we are done */ k->keepon &= ~KEEP_RECV; } } while(data_pending(conn)); if(((k->keepon & (KEEP_RECV|KEEP_SEND)) == KEEP_SEND) && conn->bits.close ) { /* When we've read the entire thing and the close bit is set, the server may now close the connection. If there's now any kind of sending going on from our side, we need to stop that immediately. */ infof(data, "we are done reading and this is set to close, stop send\n"); k->keepon &= ~KEEP_SEND; /* no writing anymore either */ } return CURLE_OK; } /* * Send data to upload to the server, when the socket is writable. */ static CURLcode readwrite_upload(struct SessionHandle *data, struct connectdata *conn, struct SingleRequest *k, int *didwhat) { ssize_t i, si; ssize_t bytes_written; CURLcode result; ssize_t nread; /* number of bytes read */ bool sending_http_headers = FALSE; if((k->bytecount == 0) && (k->writebytecount == 0)) Curl_pgrsTime(data, TIMER_STARTTRANSFER); *didwhat |= KEEP_SEND; /* * We loop here to do the READ and SEND loop until we run out of * data to send or until we get EWOULDBLOCK back * * FIXME: above comment is misleading. Currently no looping is * actually done in do-while loop below. */ do { /* only read more data if there's no upload data already present in the upload buffer */ if(0 == data->req.upload_present) { /* init the "upload from here" pointer */ data->req.upload_fromhere = k->uploadbuf; if(!k->upload_done) { /* HTTP pollution, this should be written nicer to become more protocol agnostic. */ int fillcount; struct HTTP *http = data->req.protop; if((k->exp100 == EXP100_SENDING_REQUEST) && (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->exp100 = EXP100_AWAITING_CONTINUE; /* wait for the header */ k->keepon &= ~KEEP_SEND; /* disable writing */ k->start100 = Curl_tvnow(); /* timeout count starts now */ *didwhat &= ~KEEP_SEND; /* we didn't write anything actually */ /* set a timeout for the multi interface */ Curl_expire(data, CURL_TIMEOUT_EXPECT_100); break; } if(conn->handler->protocol&(CURLPROTO_HTTP|CURLPROTO_RTSP)) { if(http->sending == HTTPSEND_REQUEST) /* We're sending the HTTP request headers, not the data. Remember that so we don't change the line endings. */ sending_http_headers = TRUE; else sending_http_headers = FALSE; } result = Curl_fillreadbuffer(conn, BUFSIZE, &fillcount); if(result) return result; nread = (ssize_t)fillcount; } else nread = 0; /* we're done uploading/reading */ if(!nread && (k->keepon & KEEP_SEND_PAUSE)) { /* this is a paused transfer */ break; } else if(nread<=0) { /* done */ k->keepon &= ~KEEP_SEND; /* we're done writing */ if(conn->bits.rewindaftersend) { result = Curl_readrewind(conn); if(result) return result; } break; } /* store number of bytes available for upload */ data->req.upload_present = nread; #ifndef CURL_DISABLE_SMTP if(conn->handler->protocol & CURLPROTO_SMTP) { result = Curl_smtp_escape_eob(conn, nread); if(result) return result; } else #endif /* CURL_DISABLE_SMTP */ /* convert LF to CRLF if so asked */ if((!sending_http_headers) && ( #ifdef CURL_DO_LINEEND_CONV /* always convert if we're FTPing in ASCII mode */ (data->set.prefer_ascii) || #endif (data->set.crlf))) { 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->req.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->req.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->req.upload_fromhere = data->state.scratch; /* set the new amount too */ data->req.upload_present = nread; } } } /* if 0 == data->req.upload_present */ 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->req.upload_fromhere, /* buffer pointer */ data->req.upload_present, /* buffer size */ &bytes_written); /* actually sent */ 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->req.upload_fromhere, (size_t)bytes_written, conn); k->writebytecount += bytes_written; if(k->writebytecount == data->set.infilesize) { /* we have sent all data we were supposed to */ k->upload_done = TRUE; infof(data, "We are completely uploaded and fine\n"); } if(data->req.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->req.upload_present -= bytes_written; /* advance the pointer where to find the buffer when the next send is to happen */ data->req.upload_fromhere += bytes_written; } else { /* we've uploaded that buffer now */ data->req.upload_fromhere = k->uploadbuf; data->req.upload_present = 0; /* no more bytes left */ if(k->upload_done) { /* switch off writing, we're done! */ k->keepon &= ~KEEP_SEND; /* we're done writing */ } } Curl_pgrsSetUploadCounter(data, k->writebytecount); } WHILE_FALSE; /* just to break out from! */ return CURLE_OK; } /* * 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 SingleRequest *k = &data->req; CURLcode result; int didwhat=0; curl_socket_t fd_read; curl_socket_t fd_write; int select_res = conn->cselect_bits; conn->cselect_bits = 0; /* only use the proper socket if the *_HOLD bit is not set simultaneously as then we are in rate limiting state in that transfer direction */ if((k->keepon & KEEP_RECVBITS) == KEEP_RECV) fd_read = conn->sockfd; else fd_read = CURL_SOCKET_BAD; if((k->keepon & KEEP_SENDBITS) == KEEP_SEND) fd_write = conn->writesockfd; else fd_write = CURL_SOCKET_BAD; if(!select_res) /* Call for select()/poll() only, if read/write/error status is not known. */ select_res = Curl_socket_ready(fd_read, fd_write, 0); if(select_res == CURL_CSELECT_ERR) { failf(data, "select/poll returned error"); return CURLE_SEND_ERROR; } /* 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_RECV) && ((select_res & CURL_CSELECT_IN) || conn->bits.stream_was_rewound)) { result = readwrite_data(data, conn, k, &didwhat, done); if(result || *done) return result; } /* If we still have writing to do, we check if we have a writable socket. */ if((k->keepon & KEEP_SEND) && (select_res & CURL_CSELECT_OUT)) { /* write */ result = readwrite_upload(data, conn, k, &didwhat); if(result) return result; } 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->exp100 == EXP100_AWAITING_CONTINUE) { /* This should allow some time for the header to arrive, but only a very short time as otherwise it'll be too much wasted time 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->exp100 = EXP100_SEND_DATA; k->keepon |= KEEP_SEND; infof(data, "Done waiting for 100-continue\n"); } } } if(Curl_pgrsUpdate(conn)) result = CURLE_ABORTED_BY_CALLBACK; else result = Curl_speedcheck(data, k->now); if(result) return result; if(k->keepon) { if(0 > Curl_timeleft(data, &k->now, FALSE)) { if(k->size != -1) { failf(data, "Operation timed out after %ld milliseconds with %" CURL_FORMAT_CURL_OFF_T " out of %" CURL_FORMAT_CURL_OFF_T " bytes received", Curl_tvdiff(k->now, data->progress.t_startsingle), k->bytecount, k->size); } else { failf(data, "Operation timed out after %ld milliseconds with %" CURL_FORMAT_CURL_OFF_T " bytes received", Curl_tvdiff(k->now, data->progress.t_startsingle), k->bytecount); } return CURLE_OPERATION_TIMEDOUT; } } else { /* * The transfer has been performed. Just make some general checks before * returning. */ if(!(data->set.opt_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->req.newurl) { failf(data, "transfer closed with %" CURL_FORMAT_CURL_OFF_T " bytes remaining to read", k->size - k->bytecount); return CURLE_PARTIAL_FILE; } else if(!(data->set.opt_no_body) && k->chunk && (conn->chunk.state != CHUNK_STOP)) { /* * In chunked mode, return an error if the connection is closed prior to * the empty (terminating) 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 = (0 == (k->keepon&(KEEP_RECV|KEEP_SEND| KEEP_RECV_PAUSE|KEEP_SEND_PAUSE))) ? TRUE : FALSE; 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(const struct connectdata *conn, curl_socket_t *sock, /* points to numsocks number of sockets */ int numsocks) { const struct SessionHandle *data = conn->data; int bitmap = GETSOCK_BLANK; unsigned sockindex = 0; if(conn->handler->perform_getsock) return conn->handler->perform_getsock(conn, sock, numsocks); if(numsocks < 2) /* simple check but we might need two slots */ return GETSOCK_BLANK; /* don't include HOLD and PAUSE connections */ if((data->req.keepon & KEEP_RECVBITS) == KEEP_RECV) { DEBUGASSERT(conn->sockfd != CURL_SOCKET_BAD); bitmap |= GETSOCK_READSOCK(sockindex); sock[sockindex] = conn->sockfd; } /* don't include HOLD and PAUSE connections */ if((data->req.keepon & KEEP_SENDBITS) == KEEP_SEND) { if((conn->sockfd != conn->writesockfd) || !(data->req.keepon & KEEP_RECV)) { /* only if they are not the same socket or we didn't have a readable one, we increase index */ if(data->req.keepon & KEEP_RECV) sockindex++; /* increase index if we need two entries */ DEBUGASSERT(conn->writesockfd != CURL_SOCKET_BAD); sock[sockindex] = conn->writesockfd; } bitmap |= GETSOCK_WRITESOCK(sockindex); } return bitmap; } /* * Determine optimum sleep time based on configured rate, current rate, * and packet size. * Returns value in milliseconds. * * The basic idea is to adjust the desired rate up/down in this method * based on whether we are running too slow or too fast. Then, calculate * how many milliseconds to wait for the next packet to achieve this new * rate. */ long Curl_sleep_time(curl_off_t rate_bps, curl_off_t cur_rate_bps, int pkt_size) { curl_off_t min_sleep = 0; curl_off_t rv = 0; if(rate_bps == 0) return 0; /* If running faster than about .1% of the desired speed, slow * us down a bit. Use shift instead of division as the 0.1% * cutoff is arbitrary anyway. */ if(cur_rate_bps > (rate_bps + (rate_bps >> 10))) { /* running too fast, decrease target rate by 1/64th of rate */ rate_bps -= rate_bps >> 6; min_sleep = 1; } else if(cur_rate_bps < (rate_bps - (rate_bps >> 10))) { /* running too slow, increase target rate by 1/64th of rate */ rate_bps += rate_bps >> 6; } /* Determine number of milliseconds to wait until we do * the next packet at the adjusted rate. We should wait * longer when using larger packets, for instance. */ rv = ((curl_off_t)((pkt_size * 8) * 1000) / rate_bps); /* Catch rounding errors and always slow down at least 1ms if * we are running too fast. */ if(rv < min_sleep) rv = min_sleep; /* Bound value to fit in 'long' on 32-bit platform. That's * plenty long enough anyway! */ if(rv > 0x7fffffff) rv = 0x7fffffff; return (long)rv; } /* * 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 without URL */ failf(data, "No URL set!"); 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 specify the size of the cache) but before any transfer takes place. */ res = Curl_ssl_initsessions(data, data->set.ssl.max_ssl_sessions); 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.httpversion = 0; /* don't assume any particular server version */ data->state.ssl_connect_retry = FALSE; data->state.authproblem = FALSE; data->state.authhost.want = data->set.httpauth; data->state.authproxy.want = data->set.proxyauth; Curl_safefree(data->info.wouldredirect); data->info.wouldredirect = NULL; /* If there is a list of cookie files to read, do it now! */ if(data->change.cookielist) Curl_cookie_loadfiles(data); /* If there is a list of host pairs to deal with */ if(data->change.resolve) res = Curl_loadhostpairs(data); if(!res) { /* 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); if(data->set.timeout) Curl_expire(data, data->set.timeout); if(data->set.connecttimeout) Curl_expire(data, data->set.connecttimeout); /* In case the handle is re-used and an authentication method was picked in the session we need to make sure we only use the one(s) we now consider to be fine */ data->state.authhost.picked &= data->state.authhost.want; data->state.authproxy.picked &= data->state.authproxy.want; } return res; } /* * 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 return CURLE_OK; } #ifndef CURL_DISABLE_HTTP /* * strlen_url() returns the length of the given URL if the spaces within the * URL were properly URL encoded. */ static size_t strlen_url(const char *url) { const char *ptr; size_t newlen=0; bool left=TRUE; /* left side of the ? */ for(ptr=url; *ptr; ptr++) { switch(*ptr) { case '?': left=FALSE; /* fall through */ 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, const char *url) { /* we must add this with whitespace-replacing */ bool left=TRUE; const char *iptr; char *optr = output; for(iptr = url; /* read from here */ *iptr; /* until zero byte */ iptr++) { switch(*iptr) { case '?': left=FALSE; /* fall through */ 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 */ } /* * Returns true if the given URL is absolute (as opposed to relative) */ static bool is_absolute_url(const char *url) { char prot[16]; /* URL protocol string storage */ char letter; /* used for a silly sscanf */ return (2 == sscanf(url, "%15[^?&/:]://%c", prot, &letter)) ? TRUE : FALSE; } /* * Concatenate a relative URL to a base URL making it absolute. * URL-encodes any spaces. * The returned pointer must be freed by the caller unless NULL * (returns NULL on out of memory). */ static char *concat_url(const char *base, const char *relurl) { /*** 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 *newest; char *protsep; char *pathsep; size_t newlen; const char *useurl = relurl; 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(base); if(!url_clone) return NULL; /* 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('/' != relurl[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, or if the new URL is just a query string (starts with a '?') we append the new one at the end of the entire currently worked out URL */ if(useurl[0] != '?') { 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 */ if((relurl[0] == '/') && (relurl[1] == '/')) { /* the new URL starts with //, just keep the protocol part from the original one */ *protsep=0; useurl = &relurl[2]; /* we keep the slashes from the original, so we skip the new ones */ } else { /* cut off the original URL from the first slash, or deal with URLs without 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 = malloc(urllen + 1 + /* possible slash */ newlen + 1 /* zero byte */); if(!newest) { free(url_clone); /* don't leak this */ return NULL; } /* copy over the root url part */ memcpy(newest, url_clone, urllen); /* check if we need to append a slash */ if(('/' == useurl[0]) || (protsep && !*protsep) || ('?' == useurl[0])) ; else newest[urllen++]='/'; /* then append the new piece on the right side */ strcpy_url(&newest[urllen], useurl); free(url_clone); return newest; } #endif /* CURL_DISABLE_HTTP */ /* * 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 */ followtype type) /* see transfer.h */ { #ifdef CURL_DISABLE_HTTP (void)data; (void)newurl; (void)type; /* Location: following will not happen when HTTP is disabled */ return CURLE_TOO_MANY_REDIRECTS; #else /* Location: redirect */ bool disallowport = FALSE; if(type == FOLLOW_REDIR) { if((data->set.maxredirs != -1) && (data->set.followlocation >= data->set.maxredirs)) { failf(data,"Maximum (%ld) 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) { Curl_safefree(data->change.referer); data->change.referer_alloc = FALSE; } data->change.referer = strdup(data->change.url); if(!data->change.referer) return CURLE_OUT_OF_MEMORY; data->change.referer_alloc = TRUE; /* yes, free this later */ } } if(!is_absolute_url(newurl)) { /*** *DANG* this is an RFC 2068 violation. The URL is supposed to be absolute and this doesn't seem to be that! */ char *absolute = concat_url(data->change.url, newurl); if(!absolute) return CURLE_OUT_OF_MEMORY; free(newurl); newurl = absolute; } else { /* This is an absolute URL, don't allow the custom port number */ disallowport = TRUE; 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". */ char *newest; size_t newlen = strlen_url(newurl); newest = malloc(newlen+1); /* get memory for this */ if(!newest) return CURLE_OUT_OF_MEMORY; strcpy_url(newest, newurl); /* create a space-free URL */ free(newurl); /* that was no good */ newurl = newest; /* use this instead now */ } } if(type == FOLLOW_FAKE) { /* we're only figuring out the new url if we would've followed locations but now we're done so we can get out! */ data->info.wouldredirect = newurl; return CURLE_OK; } if(disallowport) data->state.allow_port = FALSE; if(data->change.url_alloc) { Curl_safefree(data->change.url); data->change.url_alloc = FALSE; } data->change.url = newurl; data->change.url_alloc = TRUE; 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-Authenticate, we keep on moving and do the Authorization: XXXX header in the HTTP request code snippet */ /* 407 - Act on a Proxy-Authenticate, 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): * * 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. * * ---- * * As most of the important user agents do this obvious RFC2616 violation, * many webservers expect this. 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. * * This behavior can be overridden with CURLOPT_POSTREDIR. */ if((data->set.httpreq == HTTPREQ_POST || data->set.httpreq == HTTPREQ_POST_FORM) && !(data->set.keep_post & CURL_REDIR_POST_301)) { 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. This behavior can be overridden with CURLOPT_POSTREDIR */ if((data->set.httpreq == HTTPREQ_POST || data->set.httpreq == HTTPREQ_POST_FORM) && !(data->set.keep_post & CURL_REDIR_POST_302)) { infof(data, "Violate RFC 2616/10.3.3 and switch from POST to GET\n"); data->set.httpreq = HTTPREQ_GET; } break; case 303: /* See Other */ /* Disable both types of POSTs, unless the user explicitely asks for POST after POST */ if(data->set.httpreq != HTTPREQ_GET && !(data->set.keep_post & CURL_REDIR_POST_303)) { 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_pgrsResetTimesSizes(data); return CURLE_OK; #endif /* CURL_DISABLE_HTTP */ } CURLcode Curl_reconnect_request(struct connectdata **connp) { CURLcode result = CURLE_OK; struct connectdata *conn = *connp; struct SessionHandle *data = conn->data; /* 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, FALSE); /* we are so done with this */ /* conn may no longer be a good pointer, clear it to avoid mistakes by parent functions */ *connp = NULL; /* * 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_resolver_wait_resolv(conn, NULL); if(result) return result; /* Resolved, continue with the connection */ result = Curl_async_resolved(conn, &protocol_done); if(result) return result; } } } return result; } /* Returns CURLE_OK *and* sets '*url' if a request retry is wanted. NOTE: that the *url is malloc()ed. */ CURLcode Curl_retry_request(struct connectdata *conn, char **url) { struct SessionHandle *data = conn->data; *url = NULL; /* if we're talking upload, we can't do the checks below, unless the protocol is HTTP as when uploading over HTTP we will still get a response */ if(data->set.upload && !(conn->handler->protocol&(CURLPROTO_HTTP|CURLPROTO_RTSP))) return CURLE_OK; if(/* workaround for broken TLS servers */ data->state.ssl_connect_retry || ((data->req.bytecount + data->req.headerbytecount == 0) && conn->bits.reuse && !data->set.opt_no_body && data->set.rtspreq != RTSPREQ_RECEIVE)) { /* 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); if(!*url) return CURLE_OUT_OF_MEMORY; 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 transferred! */ if(conn->handler->protocol&CURLPROTO_HTTP) { struct HTTP *http = data->req.protop; if(http->writebytecount) return Curl_readrewind(conn); } } return CURLE_OK; } /* * Curl_setup_transfer() is called to setup some basic properties for the * upcoming transfer. */ void Curl_setup_transfer( struct connectdata *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 SessionHandle *data; struct SingleRequest *k; DEBUGASSERT(conn != NULL); data = conn->data; k = &data->req; DEBUGASSERT((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]; k->getheader = getheader; k->size = size; k->bytecountp = bytecountp; k->writebytecountp = writecountp; /* The code sequence below is placed in this function just because all necessary input is not always known in do_complete() as this function may be called after that */ if(!k->getheader) { k->header = FALSE; if(size > 0) Curl_pgrsSetDownloadSize(data, size); } /* we want header and/or body, if neither then don't do this! */ if(k->getheader || !data->set.opt_no_body) { if(conn->sockfd != CURL_SOCKET_BAD) k->keepon |= KEEP_RECV; if(conn->writesockfd != CURL_SOCKET_BAD) { struct HTTP *http = data->req.protop; /* 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) && (conn->handler->protocol&CURLPROTO_HTTP) && (http->sending == HTTPSEND_BODY)) { /* wait with write until we either got 100-continue or a timeout */ k->exp100 = EXP100_AWAITING_CONTINUE; k->start100 = Curl_tvnow(); /* Set a timeout for the multi interface. Add the inaccuracy margin so that we don't fire slightly too early and get denied to run. */ Curl_expire(data, CURL_TIMEOUT_EXPECT_100); } else { if(data->state.expect100header) /* when we've sent off the rest of the headers, we must await a 100-continue but first finish sending the request */ k->exp100 = EXP100_SENDING_REQUEST; /* enable the write bit when we're not waiting for continue */ k->keepon |= KEEP_SEND; } } /* if(conn->writesockfd != CURL_SOCKET_BAD) */ } /* if(k->getheader || !data->set.opt_no_body) */ } curl-7.35.0/lib/select.c0000644000175000017500000003231712213173003011663 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_SYS_SELECT_H #include #endif #if !defined(HAVE_SELECT) && !defined(HAVE_POLL_FINE) #error "We can't compile without select() or poll() support." #endif #if defined(__BEOS__) && !defined(__HAIKU__) /* BeOS has FD_SET defined in socket.h */ #include #endif #ifdef MSDOS #include /* delay() */ #endif #include #include "urldata.h" #include "connect.h" #include "select.h" #include "warnless.h" /* Convenience local macros */ #define elapsed_ms (int)curlx_tvdiff(curlx_tvnow(), initial_tv) int Curl_ack_eintr = 0; #define error_not_EINTR (Curl_ack_eintr || error != EINTR) /* * Internal function used for waiting a specific amount of ms * in Curl_socket_ready() and Curl_poll() when no file descriptor * is provided to wait on, just being used to delay execution. * WinSock select() and poll() timeout mechanisms need a valid * socket descriptor in a not null file descriptor set to work. * Waiting indefinitely with this function is not allowed, a * zero or negative timeout value will return immediately. * Timeout resolution, accuracy, as well as maximum supported * value is system dependent, neither factor is a citical issue * for the intended use of this function in the library. * * Return values: * -1 = system call error, invalid timeout value, or interrupted * 0 = specified timeout has elapsed */ int Curl_wait_ms(int timeout_ms) { #if !defined(MSDOS) && !defined(USE_WINSOCK) #ifndef HAVE_POLL_FINE struct timeval pending_tv; #endif struct timeval initial_tv; int pending_ms; int error; #endif int r = 0; if(!timeout_ms) return 0; if(timeout_ms < 0) { SET_SOCKERRNO(EINVAL); return -1; } #if defined(MSDOS) delay(timeout_ms); #elif defined(USE_WINSOCK) Sleep(timeout_ms); #else pending_ms = timeout_ms; initial_tv = curlx_tvnow(); do { #if defined(HAVE_POLL_FINE) r = poll(NULL, 0, pending_ms); #else pending_tv.tv_sec = pending_ms / 1000; pending_tv.tv_usec = (pending_ms % 1000) * 1000; r = select(0, NULL, NULL, NULL, &pending_tv); #endif /* HAVE_POLL_FINE */ if(r != -1) break; error = SOCKERRNO; if(error && error_not_EINTR) break; pending_ms = timeout_ms - elapsed_ms; if(pending_ms <= 0) break; } while(r == -1); #endif /* USE_WINSOCK */ if(r) r = -1; return r; } /* * Wait for read or write events on a set of file descriptors. It uses poll() * when a fine poll() is available, in order to avoid limits with FD_SETSIZE, * otherwise select() is used. An error is returned if select() is being used * and a file descriptor is too large for FD_SETSIZE. * * A negative timeout value makes this function wait indefinitely, * unles no valid file descriptor is given, when this happens the * negative timeout is ignored and the function times out immediately. * * Return values: * -1 = system call error or fd >= FD_SETSIZE * 0 = timeout * [bitmask] = action as described below * * CURL_CSELECT_IN - first socket is readable * CURL_CSELECT_IN2 - second socket is readable * CURL_CSELECT_OUT - write socket is writable * CURL_CSELECT_ERR - an error condition occurred */ int Curl_socket_check(curl_socket_t readfd0, /* two sockets to read from */ curl_socket_t readfd1, curl_socket_t writefd, /* socket to write to */ long timeout_ms) /* milliseconds to wait */ { #ifdef HAVE_POLL_FINE struct pollfd pfd[3]; int num; #else struct timeval pending_tv; struct timeval *ptimeout; fd_set fds_read; fd_set fds_write; fd_set fds_err; curl_socket_t maxfd; #endif struct timeval initial_tv = {0,0}; int pending_ms = 0; int error; int r; int ret; if((readfd0 == CURL_SOCKET_BAD) && (readfd1 == CURL_SOCKET_BAD) && (writefd == CURL_SOCKET_BAD)) { /* no sockets, just wait */ r = Curl_wait_ms((int)timeout_ms); return r; } /* Avoid initial timestamp, avoid curlx_tvnow() call, when elapsed time in this function does not need to be measured. This happens when function is called with a zero timeout or a negative timeout value indicating a blocking call should be performed. */ if(timeout_ms > 0) { pending_ms = (int)timeout_ms; initial_tv = curlx_tvnow(); } #ifdef HAVE_POLL_FINE num = 0; if(readfd0 != CURL_SOCKET_BAD) { pfd[num].fd = readfd0; pfd[num].events = POLLRDNORM|POLLIN|POLLRDBAND|POLLPRI; pfd[num].revents = 0; num++; } if(readfd1 != CURL_SOCKET_BAD) { pfd[num].fd = readfd1; pfd[num].events = POLLRDNORM|POLLIN|POLLRDBAND|POLLPRI; pfd[num].revents = 0; num++; } if(writefd != CURL_SOCKET_BAD) { pfd[num].fd = writefd; pfd[num].events = POLLWRNORM|POLLOUT; pfd[num].revents = 0; num++; } do { if(timeout_ms < 0) pending_ms = -1; else if(!timeout_ms) pending_ms = 0; r = poll(pfd, num, pending_ms); if(r != -1) break; error = SOCKERRNO; if(error && error_not_EINTR) break; if(timeout_ms > 0) { pending_ms = (int)(timeout_ms - elapsed_ms); if(pending_ms <= 0) { r = 0; /* Simulate a "call timed out" case */ break; } } } while(r == -1); if(r < 0) return -1; if(r == 0) return 0; ret = 0; num = 0; if(readfd0 != CURL_SOCKET_BAD) { if(pfd[num].revents & (POLLRDNORM|POLLIN|POLLERR|POLLHUP)) ret |= CURL_CSELECT_IN; if(pfd[num].revents & (POLLRDBAND|POLLPRI|POLLNVAL)) ret |= CURL_CSELECT_ERR; num++; } if(readfd1 != CURL_SOCKET_BAD) { if(pfd[num].revents & (POLLRDNORM|POLLIN|POLLERR|POLLHUP)) ret |= CURL_CSELECT_IN2; if(pfd[num].revents & (POLLRDBAND|POLLPRI|POLLNVAL)) ret |= CURL_CSELECT_ERR; num++; } if(writefd != CURL_SOCKET_BAD) { if(pfd[num].revents & (POLLWRNORM|POLLOUT)) ret |= CURL_CSELECT_OUT; if(pfd[num].revents & (POLLERR|POLLHUP|POLLNVAL)) ret |= CURL_CSELECT_ERR; } return ret; #else /* HAVE_POLL_FINE */ FD_ZERO(&fds_err); maxfd = (curl_socket_t)-1; FD_ZERO(&fds_read); if(readfd0 != CURL_SOCKET_BAD) { VERIFY_SOCK(readfd0); FD_SET(readfd0, &fds_read); FD_SET(readfd0, &fds_err); maxfd = readfd0; } if(readfd1 != CURL_SOCKET_BAD) { VERIFY_SOCK(readfd1); FD_SET(readfd1, &fds_read); FD_SET(readfd1, &fds_err); if(readfd1 > maxfd) maxfd = readfd1; } 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; } ptimeout = (timeout_ms < 0) ? NULL : &pending_tv; do { if(timeout_ms > 0) { pending_tv.tv_sec = pending_ms / 1000; pending_tv.tv_usec = (pending_ms % 1000) * 1000; } else if(!timeout_ms) { pending_tv.tv_sec = 0; pending_tv.tv_usec = 0; } r = select((int)maxfd + 1, &fds_read, &fds_write, &fds_err, ptimeout); if(r != -1) break; error = SOCKERRNO; if(error && error_not_EINTR) break; if(timeout_ms > 0) { pending_ms = timeout_ms - elapsed_ms; if(pending_ms <= 0) { r = 0; /* Simulate a "call timed out" case */ break; } } } while(r == -1); if(r < 0) return -1; if(r == 0) return 0; ret = 0; if(readfd0 != CURL_SOCKET_BAD) { if(FD_ISSET(readfd0, &fds_read)) ret |= CURL_CSELECT_IN; if(FD_ISSET(readfd0, &fds_err)) ret |= CURL_CSELECT_ERR; } if(readfd1 != CURL_SOCKET_BAD) { if(FD_ISSET(readfd1, &fds_read)) ret |= CURL_CSELECT_IN2; if(FD_ISSET(readfd1, &fds_err)) ret |= CURL_CSELECT_ERR; } if(writefd != CURL_SOCKET_BAD) { if(FD_ISSET(writefd, &fds_write)) ret |= CURL_CSELECT_OUT; if(FD_ISSET(writefd, &fds_err)) ret |= CURL_CSELECT_ERR; } return ret; #endif /* HAVE_POLL_FINE */ } /* * 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 is too large for FD_SETSIZE. * A negative timeout value makes this function wait indefinitely, * unles no valid file descriptor is given, when this happens the * negative timeout is ignored and the function times out immediately. * * Return values: * -1 = system call error or fd >= FD_SETSIZE * 0 = timeout * N = number of structures with non zero revent fields */ int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms) { #ifndef HAVE_POLL_FINE struct timeval pending_tv; struct timeval *ptimeout; fd_set fds_read; fd_set fds_write; fd_set fds_err; curl_socket_t maxfd; #endif struct timeval initial_tv = {0,0}; bool fds_none = TRUE; unsigned int i; int pending_ms = 0; int error; int r; if(ufds) { for(i = 0; i < nfds; i++) { if(ufds[i].fd != CURL_SOCKET_BAD) { fds_none = FALSE; break; } } } if(fds_none) { r = Curl_wait_ms(timeout_ms); return r; } /* Avoid initial timestamp, avoid curlx_tvnow() call, when elapsed time in this function does not need to be measured. This happens when function is called with a zero timeout or a negative timeout value indicating a blocking call should be performed. */ if(timeout_ms > 0) { pending_ms = timeout_ms; initial_tv = curlx_tvnow(); } #ifdef HAVE_POLL_FINE do { if(timeout_ms < 0) pending_ms = -1; else if(!timeout_ms) pending_ms = 0; r = poll(ufds, nfds, pending_ms); if(r != -1) break; error = SOCKERRNO; if(error && error_not_EINTR) break; if(timeout_ms > 0) { pending_ms = timeout_ms - elapsed_ms; if(pending_ms <= 0) break; } } while(r == -1); if(r < 0) return -1; if(r == 0) return 0; for(i = 0; i < nfds; i++) { if(ufds[i].fd == CURL_SOCKET_BAD) continue; if(ufds[i].revents & POLLHUP) ufds[i].revents |= POLLIN; if(ufds[i].revents & POLLERR) ufds[i].revents |= (POLLIN|POLLOUT); } #else /* HAVE_POLL_FINE */ FD_ZERO(&fds_read); FD_ZERO(&fds_write); FD_ZERO(&fds_err); maxfd = (curl_socket_t)-1; for(i = 0; i < nfds; i++) { ufds[i].revents = 0; if(ufds[i].fd == CURL_SOCKET_BAD) continue; VERIFY_SOCK(ufds[i].fd); if(ufds[i].events & (POLLIN|POLLOUT|POLLPRI| POLLRDNORM|POLLWRNORM|POLLRDBAND)) { if(ufds[i].fd > maxfd) maxfd = ufds[i].fd; if(ufds[i].events & (POLLRDNORM|POLLIN)) FD_SET(ufds[i].fd, &fds_read); if(ufds[i].events & (POLLWRNORM|POLLOUT)) FD_SET(ufds[i].fd, &fds_write); if(ufds[i].events & (POLLRDBAND|POLLPRI)) FD_SET(ufds[i].fd, &fds_err); } } ptimeout = (timeout_ms < 0) ? NULL : &pending_tv; do { if(timeout_ms > 0) { pending_tv.tv_sec = pending_ms / 1000; pending_tv.tv_usec = (pending_ms % 1000) * 1000; } else if(!timeout_ms) { pending_tv.tv_sec = 0; pending_tv.tv_usec = 0; } r = select((int)maxfd + 1, &fds_read, &fds_write, &fds_err, ptimeout); if(r != -1) break; error = SOCKERRNO; if(error && error_not_EINTR) break; if(timeout_ms > 0) { pending_ms = timeout_ms - elapsed_ms; if(pending_ms <= 0) break; } } while(r == -1); 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 |= POLLPRI; if(ufds[i].revents != 0) r++; } #endif /* HAVE_POLL_FINE */ 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 */ curl-7.35.0/lib/inet_ntop.c0000644000175000017500000001253312213173003012401 00000000000000/* * 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 "curl_setup.h" #ifndef HAVE_INET_NTOP #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #define _MPRINTF_REPLACE /* use our functions only */ #include #include "inet_ntop.h" #define IN6ADDRSZ 16 #define INADDRSZ 4 #define INT16SZ 2 /* * 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) { char tmp[sizeof "255.255.255.255"]; size_t len; DEBUGASSERT(size >= 16); tmp[0] = '\0'; (void)snprintf(tmp, sizeof(tmp), "%d.%d.%d.%d", ((int)((unsigned char)src[0])) & 0xff, ((int)((unsigned char)src[1])) & 0xff, ((int)((unsigned char)src[2])) & 0xff, ((int)((unsigned char)src[3])) & 0xff); len = strlen(tmp); if(len == 0 || len >= size) { SET_ERRNO(ENOSPC); return (NULL); } strcpy(dst, tmp); return dst; } #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); } strcpy(dst, tmp); return dst; } #endif /* ENABLE_IPV6 */ /* * Convert a network format address to presentation format. * * Returns pointer to presentation format address (`buf'). * Returns NULL on error and errno set with the specific * error, EAFNOSUPPORT or ENOSPC. * * On Windows we store the error in the thread errno, not * in the winsock error code. This is to avoid losing the * actual last winsock error. So use macro ERRNO to fetch the * errno this function sets when returning NULL, not SOCKERRNO. */ 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 */ curl-7.35.0/lib/Makefile.vc100000644000175000017500000005231012272124477012463 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1999 - 2014, 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. # #*************************************************************************** # All files in the Makefile.vc* series are generated automatically from the # one made for MSVC version 6. Alas, if you want to do changes to any of the # files and send back to the project, edit the version six, make your diff and # mail curl-library. ########################################################################### # # Makefile for building libcurl with MSVC10 # # 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. # ############################################################## # ---------------------------------------------- # Verify that current subdir is libcurl's 'lib' # ---------------------------------------------- !IF ! EXIST(.\curl_addrinfo.c) ! MESSAGE Can not process this makefile from outside of libcurl's 'lib' subdirectory. ! MESSAGE Change to libcurl's 'lib' subdirectory, and try again. ! ERROR See previous message. !ENDIF # ------------------------------------------------ # Makefile.msvc.names provides libcurl file names # ------------------------------------------------ !INCLUDE ..\winbuild\Makefile.msvc.names !IFNDEF OPENSSL_PATH OPENSSL_PATH = ../../openssl-0.9.8y !ENDIF !IFNDEF LIBSSH2_PATH LIBSSH2_PATH = ../../libssh2-1.4.3 !ENDIF !IFNDEF ZLIB_PATH ZLIB_PATH = ../../zlib-1.2.8 !ENDIF !IFNDEF MACHINE MACHINE = X86 !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". Since at least with MSVC10 the sspi.h # header is broken it is either required to install the Windows SDK, # or to fix sspi.h with adding this define at the beginning of sspi.h: # #define FreeCredentialHandle FreeCredentialsHandle # # 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/ # WINDOWS_SSPI = 1 !IFDEF WINDOWS_SSPI !IFNDEF WINDOWS_SDK_PATH WINDOWS_SDK_PATH = "$(PROGRAMFILES)\Microsoft SDK" !ENDIF !ENDIF ############################################################# ## Nothing more to do below this line! CCNODBG = cl.exe /O2 /DNDEBUG CCDEBUG = cl.exe /Od /Gm /Zi /D_DEBUG /RTC1 CFLAGSSSL = /DUSE_SSLEAY /DUSE_OPENSSL /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl" CFLAGSWINSSL = /DUSE_SCHANNEL CFLAGSSSH2 = /DUSE_LIBSSH2 /DCURL_DISABLE_LDAP /DHAVE_LIBSSH2 /DHAVE_LIBSSH2_H /DLIBSSH2_WIN32 /DLIBSSH2_LIBRARY /I "$(LIBSSH2_PATH)/include" CFLAGSZLIB = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I "$(ZLIB_PATH)" CFLAGS = /I. /I../include /nologo /W3 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL /D_BIND_TO_CURRENT_VCLIBS_VERSION=1 CFLAGSLIB = /DCURL_STATICLIB LNKDLL = link.exe /DLL LNKLIB = link.exe /lib LFLAGS = /nologo /machine:$(MACHINE) SSLLIBS = libeay32.lib ssleay32.lib ZLIBLIBSDLL = zdll.lib ZLIBLIBS = zlib.lib WINLIBS = ws2_32.lib wldap32.lib advapi32.lib CFLAGS = $(CFLAGS) CFGSET = FALSE !IFDEF WINDOWS_SSPI CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include !ENDIF !IFDEF USE_IPV6 CFLAGS = $(CFLAGS) /DUSE_IPV6 !ENDIF ############################################################## # Runtime library configuration RTLIB = /MD RTLIBD = /MDd !IF "$(RTLIBCFG)" == "static" RTLIB = /MT RTLIBD = /MTd !ENDIF ###################### # release !IF "$(CFG)" == "release" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl !IF "$(CFG)" == "release-ssl" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-winssl !IF "$(CFG)" == "release-winssl" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSWINSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-zlib !IF "$(CFG)" == "release-zlib" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl-zlib !IF "$(CFG)" == "release-ssl-zlib" TARGET = $(LIBCURL_STA_LIB_REL) 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-winssl-zlib !IF "$(CFG)" == "release-winssl-zlib" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSWINSSL) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl-ssh2-zlib !IF "$(CFG)" == "release-ssl-ssh2-zlib" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" LFLAGSSSH2 = "/LIBPATH:$(LIBSSH2_PATH)" LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(LFLAGSSSL) $(LFLAGSSSH2) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSSSH2) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl-dll !IF "$(CFG)" == "release-ssl-dll" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-zlib-dll !IF "$(CFG)" == "release-zlib-dll" TARGET = $(LIBCURL_STA_LIB_REL) 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 = $(LIBCURL_STA_LIB_REL) 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 !IF "$(CFG)" == "release-dll" TARGET = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LNK = $(LNKDLL) $(WINLIBS) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) CC = $(CCNODBG) $(RTLIB) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # release-dll-ssl-dll !IF "$(CFG)" == "release-dll-ssl-dll" TARGET = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # release-dll-zlib-dll !IF "$(CFG)" == "release-dll-zlib-dll" TARGET = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKDLL) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) 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 = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSZLIB) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # debug !IF "$(CFG)" == "debug" TARGET = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-ssl !IF "$(CFG)" == "debug-ssl" TARGET = $(LIBCURL_STA_LIB_DBG) 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 = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-ssl-zlib !IF "$(CFG)" == "debug-ssl-zlib" TARGET = $(LIBCURL_STA_LIB_DBG) 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-ssl-ssh2-zlib !IF "$(CFG)" == "debug-ssl-ssh2-zlib" TARGET = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LFLAGSSSH2 = "/LIBPATH:$(LIBSSH2_PATH)" LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSSSL) $(LFLAGSSSH2) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSSSH2) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-ssl-dll !IF "$(CFG)" == "debug-ssl-dll" TARGET = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)\out32dll LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-zlib-dll !IF "$(CFG)" == "debug-zlib-dll" TARGET = $(LIBCURL_STA_LIB_DBG) 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 = $(LIBCURL_STA_LIB_DBG) 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 = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LNK = $(LNKDLL) $(WINLIBS) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_PDB) CC = $(CCDEBUG) $(RTLIBD) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # debug-dll-ssl-dll !IF "$(CFG)" == "debug-dll-ssl-dll" TARGET = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_PDB) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # debug-dll-zlib-dll !IF "$(CFG)" == "debug-dll-zlib-dll" TARGET = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKDLL) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_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 = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_PDB) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSZLIB) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ####################### # Usage # !IF "$(CFGSET)" == "FALSE" && "$(CFG)" != "" !MESSAGE Usage: nmake /f makefile.vc10 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-ssh2-zlib - release static library with ssl, ssh2 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-ssh2-zlib - debug static library with ssl, ssh2 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)\amigaos.obj \ $(DIROBJ)\asyn-ares.obj \ $(DIROBJ)\asyn-thread.obj \ $(DIROBJ)\axtls.obj \ $(DIROBJ)\base64.obj \ $(DIROBJ)\bundles.obj \ $(DIROBJ)\conncache.obj \ $(DIROBJ)\connect.obj \ $(DIROBJ)\content_encoding.obj \ $(DIROBJ)\cookie.obj \ $(DIROBJ)\curl_addrinfo.obj \ $(DIROBJ)\curl_darwinssl.obj \ $(DIROBJ)\curl_fnmatch.obj \ $(DIROBJ)\curl_gethostname.obj \ $(DIROBJ)\curl_gssapi.obj \ $(DIROBJ)\curl_memrchr.obj \ $(DIROBJ)\curl_multibyte.obj \ $(DIROBJ)\curl_ntlm.obj \ $(DIROBJ)\curl_ntlm_core.obj \ $(DIROBJ)\curl_ntlm_msgs.obj \ $(DIROBJ)\curl_ntlm_wb.obj \ $(DIROBJ)\curl_rtmp.obj \ $(DIROBJ)\curl_sasl.obj \ $(DIROBJ)\curl_schannel.obj \ $(DIROBJ)\curl_sspi.obj \ $(DIROBJ)\curl_threads.obj \ $(DIROBJ)\cyassl.obj \ $(DIROBJ)\dict.obj \ $(DIROBJ)\dotdot.obj \ $(DIROBJ)\easy.obj \ $(DIROBJ)\escape.obj \ $(DIROBJ)\file.obj \ $(DIROBJ)\fileinfo.obj \ $(DIROBJ)\formdata.obj \ $(DIROBJ)\ftp.obj \ $(DIROBJ)\ftplistparser.obj \ $(DIROBJ)\getenv.obj \ $(DIROBJ)\getinfo.obj \ $(DIROBJ)\gopher.obj \ $(DIROBJ)\gtls.obj \ $(DIROBJ)\hash.obj \ $(DIROBJ)\hmac.obj \ $(DIROBJ)\hostasyn.obj \ $(DIROBJ)\hostcheck.obj \ $(DIROBJ)\hostip.obj \ $(DIROBJ)\hostip4.obj \ $(DIROBJ)\hostip6.obj \ $(DIROBJ)\hostsyn.obj \ $(DIROBJ)\http.obj \ $(DIROBJ)\http_chunks.obj \ $(DIROBJ)\http_digest.obj \ $(DIROBJ)\http_negotiate.obj \ $(DIROBJ)\http_negotiate_sspi.obj \ $(DIROBJ)\http_proxy.obj \ $(DIROBJ)\idn_win32.obj \ $(DIROBJ)\if2ip.obj \ $(DIROBJ)\imap.obj \ $(DIROBJ)\inet_ntop.obj \ $(DIROBJ)\inet_pton.obj \ $(DIROBJ)\krb5.obj \ $(DIROBJ)\ldap.obj \ $(DIROBJ)\llist.obj \ $(DIROBJ)\md4.obj \ $(DIROBJ)\md5.obj \ $(DIROBJ)\memdebug.obj \ $(DIROBJ)\mprintf.obj \ $(DIROBJ)\multi.obj \ $(DIROBJ)\netrc.obj \ $(DIROBJ)\non-ascii.obj \ $(DIROBJ)\nonblock.obj \ $(DIROBJ)\nss.obj \ $(DIROBJ)\openldap.obj \ $(DIROBJ)\parsedate.obj \ $(DIROBJ)\pingpong.obj \ $(DIROBJ)\pipeline.obj \ $(DIROBJ)\polarssl.obj \ $(DIROBJ)\polarssl_threadlock.obj \ $(DIROBJ)\pop3.obj \ $(DIROBJ)\progress.obj \ $(DIROBJ)\qssl.obj \ $(DIROBJ)\rawstr.obj \ $(DIROBJ)\rtsp.obj \ $(DIROBJ)\security.obj \ $(DIROBJ)\select.obj \ $(DIROBJ)\sendf.obj \ $(DIROBJ)\share.obj \ $(DIROBJ)\slist.obj \ $(DIROBJ)\smtp.obj \ $(DIROBJ)\socks.obj \ $(DIROBJ)\socks_gssapi.obj \ $(DIROBJ)\socks_sspi.obj \ $(DIROBJ)\speedcheck.obj \ $(DIROBJ)\splay.obj \ $(DIROBJ)\ssh.obj \ $(DIROBJ)\vtls.obj \ $(DIROBJ)\openssl.obj \ $(DIROBJ)\strdup.obj \ $(DIROBJ)\strequal.obj \ $(DIROBJ)\strerror.obj \ $(DIROBJ)\strtok.obj \ $(DIROBJ)\strtoofft.obj \ $(DIROBJ)\telnet.obj \ $(DIROBJ)\tftp.obj \ $(DIROBJ)\timeval.obj \ $(DIROBJ)\transfer.obj \ $(DIROBJ)\url.obj \ $(DIROBJ)\version.obj \ $(DIROBJ)\warnless.obj \ $(DIROBJ)\wildcard.obj \ $(RESOURCE) all : $(TARGET) $(TARGET): $(X_OBJS) $(LNK) $(LFLAGS) $(X_OBJS) -xcopy $(DIROBJ)\$(LIBCURL_STA_LIB_REL) . /y -xcopy $(DIROBJ)\$(LIBCURL_STA_LIB_DBG) . /y -xcopy $(DIROBJ)\$(LIBCURL_DYN_LIB_REL) . /y -xcopy $(DIROBJ)\$(LIBCURL_DYN_LIB_DBG) . /y -xcopy $(DIROBJ)\$(LIBCURL_IMP_LIB_REL) . /y -xcopy $(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) . /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"$@" $< {.\vtls\}.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 /dDEBUGBUILD=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 /dDEBUGBUILD=0 /Fo $@ libcurl.rc !ENDIF # End of case where a config was provided. curl-7.35.0/lib/curl_sspi.c0000644000175000017500000001154212270035364012416 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_WINDOWS_SSPI #include #include "curl_sspi.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* We use our own typedef here since some headers might lack these */ typedef PSecurityFunctionTable (APIENTRY *INITSECURITYINTERFACE_FN)(VOID); /* See definition of SECURITY_ENTRYPOINT in sspi.h */ #ifdef UNICODE # ifdef _WIN32_WCE # define SECURITYENTRYPOINT L"InitSecurityInterfaceW" # else # define SECURITYENTRYPOINT "InitSecurityInterfaceW" # endif #else # define SECURITYENTRYPOINT "InitSecurityInterfaceA" #endif /* Handle of security.dll or secur32.dll, depending on Windows version */ HMODULE s_hSecDll = NULL; /* Pointer to SSPI dispatch table */ PSecurityFunctionTable s_pSecFn = NULL; /* * Curl_sspi_global_init() * * This is used to load the Security Service Provider Interface (SSPI) * dynamic link library portably across all Windows versions, without * the need to directly link libcurl, nor the application using it, at * build time. * * Once this function has been executed, Windows SSPI functions can be * called through the Security Service Provider Interface dispatch table. */ CURLcode Curl_sspi_global_init(void) { bool securityDll = FALSE; INITSECURITYINTERFACE_FN pInitSecurityInterface; /* If security interface is not yet initialized try to do this */ if(!s_hSecDll) { /* Security Service Provider Interface (SSPI) functions are located in * security.dll on WinNT 4.0 and in secur32.dll on Win9x. Win2K and XP * have both these DLLs (security.dll forwards calls to secur32.dll) */ DWORD majorVersion = 4; DWORD platformId = VER_PLATFORM_WIN32_NT; #if !defined(_WIN32_WINNT) || !defined(_WIN32_WINNT_WIN2K) || \ (_WIN32_WINNT < _WIN32_WINNT_WIN2K) OSVERSIONINFO osver; memset(&osver, 0, sizeof(osver)); osver.dwOSVersionInfoSize = sizeof(osver); /* Find out Windows version */ if(!GetVersionEx(&osver)) return CURLE_FAILED_INIT; /* Verify the major version number == 4 and platform id == WIN_NT */ if(osver.dwMajorVersion == majorVersion && osver.dwPlatformId == platformId) securityDll = TRUE; #else ULONGLONG majorVersionMask; ULONGLONG platformIdMask; OSVERSIONINFOEX osver; memset(&osver, 0, sizeof(osver)); osver.dwOSVersionInfoSize = sizeof(osver); osver.dwMajorVersion = majorVersion; osver.dwPlatformId = platformId; majorVersionMask = VerSetConditionMask(0, VER_MAJORVERSION, VER_EQUAL); platformIdMask = VerSetConditionMask(0, VER_PLATFORMID, VER_EQUAL); /* Verify the major version number == 4 and platform id == WIN_NT */ if(VerifyVersionInfo(&osver, VER_MAJORVERSION, majorVersionMask) && VerifyVersionInfo(&osver, VER_PLATFORMID, platformIdMask)) securityDll = TRUE; #endif /* Load SSPI dll into the address space of the calling process */ if(securityDll) s_hSecDll = LoadLibrary(TEXT("security.dll")); else s_hSecDll = LoadLibrary(TEXT("secur32.dll")); if(!s_hSecDll) return CURLE_FAILED_INIT; /* Get address of the InitSecurityInterfaceA function from the SSPI dll */ pInitSecurityInterface = (INITSECURITYINTERFACE_FN) GetProcAddress(s_hSecDll, SECURITYENTRYPOINT); if(!pInitSecurityInterface) return CURLE_FAILED_INIT; /* Get pointer to Security Service Provider Interface dispatch table */ s_pSecFn = pInitSecurityInterface(); if(!s_pSecFn) return CURLE_FAILED_INIT; } return CURLE_OK; } /* * Curl_sspi_global_cleanup() * * This deinitializes the Security Service Provider Interface from libcurl. */ void Curl_sspi_global_cleanup(void) { if(s_hSecDll) { FreeLibrary(s_hSecDll); s_hSecDll = NULL; s_pSecFn = NULL; } } #endif /* USE_WINDOWS_SSPI */ curl-7.35.0/lib/smtp.c0000644000175000017500000017504112270035364011403 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * * RFC1870 SMTP Service Extension for Message Size * RFC2195 CRAM-MD5 authentication * RFC2831 DIGEST-MD5 authentication * RFC3207 SMTP over TLS * RFC4422 Simple Authentication and Security Layer (SASL) * RFC4616 PLAIN authentication * RFC4954 SMTP Authentication * RFC5321 SMTP protocol * RFC6749 OAuth 2.0 Authorization Framework * Draft SMTP URL Interface * Draft LOGIN SASL Mechanism * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_SMTP #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 #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 "if2ip.h" #include "hostip.h" #include "progress.h" #include "transfer.h" #include "escape.h" #include "http.h" /* for HTTP proxy tunnel stuff */ #include "socks.h" #include "smtp.h" #include "strtoofft.h" #include "strequal.h" #include "vtls/vtls.h" #include "connect.h" #include "strerror.h" #include "select.h" #include "multiif.h" #include "url.h" #include "rawstr.h" #include "curl_gethostname.h" #include "curl_sasl.h" #include "warnless.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* Local API functions */ static CURLcode smtp_regular_transfer(struct connectdata *conn, bool *done); static CURLcode smtp_do(struct connectdata *conn, bool *done); static CURLcode smtp_done(struct connectdata *conn, CURLcode status, bool premature); static CURLcode smtp_connect(struct connectdata *conn, bool *done); static CURLcode smtp_disconnect(struct connectdata *conn, bool dead); static CURLcode smtp_multi_statemach(struct connectdata *conn, bool *done); static int smtp_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks); static CURLcode smtp_doing(struct connectdata *conn, bool *dophase_done); static CURLcode smtp_setup_connection(struct connectdata *conn); static CURLcode smtp_parse_url_options(struct connectdata *conn); static CURLcode smtp_parse_url_path(struct connectdata *conn); static CURLcode smtp_parse_custom_request(struct connectdata *conn); static CURLcode smtp_calc_sasl_details(struct connectdata *conn, const char **mech, char **initresp, size_t *len, smtpstate *state1, smtpstate *state2); /* * SMTP protocol handler. */ const struct Curl_handler Curl_handler_smtp = { "SMTP", /* scheme */ smtp_setup_connection, /* setup_connection */ smtp_do, /* do_it */ smtp_done, /* done */ ZERO_NULL, /* do_more */ smtp_connect, /* connect_it */ smtp_multi_statemach, /* connecting */ smtp_doing, /* doing */ smtp_getsock, /* proto_getsock */ smtp_getsock, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ smtp_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_SMTP, /* defport */ CURLPROTO_SMTP, /* protocol */ PROTOPT_CLOSEACTION | PROTOPT_NOURLQUERY /* flags */ }; #ifdef USE_SSL /* * SMTPS protocol handler. */ const struct Curl_handler Curl_handler_smtps = { "SMTPS", /* scheme */ smtp_setup_connection, /* setup_connection */ smtp_do, /* do_it */ smtp_done, /* done */ ZERO_NULL, /* do_more */ smtp_connect, /* connect_it */ smtp_multi_statemach, /* connecting */ smtp_doing, /* doing */ smtp_getsock, /* proto_getsock */ smtp_getsock, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ smtp_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_SMTPS, /* defport */ CURLPROTO_SMTP | CURLPROTO_SMTPS, /* protocol */ PROTOPT_CLOSEACTION | PROTOPT_SSL | PROTOPT_NOURLQUERY /* flags */ }; #endif #ifndef CURL_DISABLE_HTTP /* * HTTP-proxyed SMTP protocol handler. */ static const struct Curl_handler Curl_handler_smtp_proxy = { "SMTP", /* scheme */ Curl_http_setup_conn, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ ZERO_NULL, /* do_more */ ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_SMTP, /* defport */ CURLPROTO_HTTP, /* protocol */ PROTOPT_NONE /* flags */ }; #ifdef USE_SSL /* * HTTP-proxyed SMTPS protocol handler. */ static const struct Curl_handler Curl_handler_smtps_proxy = { "SMTPS", /* scheme */ Curl_http_setup_conn, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ ZERO_NULL, /* do_more */ ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_SMTPS, /* defport */ CURLPROTO_HTTP, /* protocol */ PROTOPT_NONE /* flags */ }; #endif #endif #ifdef USE_SSL static void smtp_to_smtps(struct connectdata *conn) { conn->handler = &Curl_handler_smtps; } #else #define smtp_to_smtps(x) Curl_nop_stmt #endif /*********************************************************************** * * smtp_endofresp() * * Checks for an ending SMTP status code at the start of the given string, but * also detects various capabilities from the EHLO response including the * supported authentication mechanisms. */ static bool smtp_endofresp(struct connectdata *conn, char *line, size_t len, int *resp) { struct smtp_conn *smtpc = &conn->proto.smtpc; bool result = FALSE; /* Nothing for us */ if(len < 4 || !ISDIGIT(line[0]) || !ISDIGIT(line[1]) || !ISDIGIT(line[2])) return FALSE; /* Do we have a command response? This should be the response code followed by a space and optionally some text as per RFC-5321 and as outlined in Section 4. Examples of RFC-4954 but some e-mail servers ignore this and only send the response code instead as per Section 4.2. */ if(line[3] == ' ' || len == 5) { result = TRUE; *resp = curlx_sltosi(strtol(line, NULL, 10)); /* Make sure real server never sends internal value */ if(*resp == 1) *resp = 0; } /* Do we have a multiline (continuation) response? */ else if(line[3] == '-' && (smtpc->state == SMTP_EHLO || smtpc->state == SMTP_COMMAND)) { result = TRUE; *resp = 1; /* Internal response code */ } return result; } /*********************************************************************** * * smtp_get_message() * * Gets the authentication message from the response buffer. */ static void smtp_get_message(char *buffer, char** outptr) { size_t len = 0; char* message = NULL; /* Find the start of the message */ for(message = buffer + 4; *message == ' ' || *message == '\t'; message++) ; /* Find the end of the message */ for(len = strlen(message); len--;) if(message[len] != '\r' && message[len] != '\n' && message[len] != ' ' && message[len] != '\t') break; /* Terminate the message */ if(++len) { message[len] = '\0'; } *outptr = message; } /*********************************************************************** * * state() * * This is the ONLY way to change SMTP state! */ static void state(struct connectdata *conn, smtpstate newstate) { struct smtp_conn *smtpc = &conn->proto.smtpc; #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) /* for debug purposes */ static const char * const names[] = { "STOP", "SERVERGREET", "EHLO", "HELO", "STARTTLS", "UPGRADETLS", "AUTH_PLAIN", "AUTH_LOGIN", "AUTH_LOGIN_PASSWD", "AUTH_CRAMMD5", "AUTH_DIGESTMD5", "AUTH_DIGESTMD5_RESP", "AUTH_NTLM", "AUTH_NTLM_TYPE2MSG", "AUTH_XOAUTH2", "AUTH_CANCEL", "AUTH_FINAL", "COMMAND", "MAIL", "RCPT", "DATA", "POSTDATA", "QUIT", /* LAST */ }; if(smtpc->state != newstate) infof(conn->data, "SMTP %p state change from %s to %s\n", (void *)smtpc, names[smtpc->state], names[newstate]); #endif smtpc->state = newstate; } /*********************************************************************** * * smtp_perform_ehlo() * * Sends the EHLO command to not only initialise communication with the ESMTP * server but to also obtain a list of server side supported capabilities. */ static CURLcode smtp_perform_ehlo(struct connectdata *conn) { CURLcode result = CURLE_OK; struct smtp_conn *smtpc = &conn->proto.smtpc; smtpc->authmechs = 0; /* No known authentication mechanisms yet */ smtpc->authused = 0; /* Clear the authentication mechanism used for esmtp connections */ smtpc->tls_supported = FALSE; /* Clear the TLS capability */ /* Send the EHLO command */ result = Curl_pp_sendf(&smtpc->pp, "EHLO %s", smtpc->domain); if(!result) state(conn, SMTP_EHLO); return result; } /*********************************************************************** * * smtp_perform_helo() * * Sends the HELO command to initialise communication with the SMTP server. */ static CURLcode smtp_perform_helo(struct connectdata *conn) { CURLcode result = CURLE_OK; struct smtp_conn *smtpc = &conn->proto.smtpc; smtpc->authused = 0; /* No authentication mechanism used in smtp connections */ /* Send the HELO command */ result = Curl_pp_sendf(&smtpc->pp, "HELO %s", smtpc->domain); if(!result) state(conn, SMTP_HELO); return result; } /*********************************************************************** * * smtp_perform_starttls() * * Sends the STLS command to start the upgrade to TLS. */ static CURLcode smtp_perform_starttls(struct connectdata *conn) { CURLcode result = CURLE_OK; /* Send the STARTTLS command */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "STARTTLS"); if(!result) state(conn, SMTP_STARTTLS); return result; } /*********************************************************************** * * smtp_perform_upgrade_tls() * * Performs the upgrade to TLS. */ static CURLcode smtp_perform_upgrade_tls(struct connectdata *conn) { CURLcode result = CURLE_OK; struct smtp_conn *smtpc = &conn->proto.smtpc; /* Start the SSL connection */ result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &smtpc->ssldone); if(!result) { if(smtpc->state != SMTP_UPGRADETLS) state(conn, SMTP_UPGRADETLS); if(smtpc->ssldone) { smtp_to_smtps(conn); result = smtp_perform_ehlo(conn); } } return result; } /*********************************************************************** * * smtp_perform_auth() * * Sends an AUTH command allowing the client to login with the given SASL * authentication mechanism. */ static CURLcode smtp_perform_auth(struct connectdata *conn, const char *mech, const char *initresp, size_t len, smtpstate state1, smtpstate state2) { CURLcode result = CURLE_OK; struct smtp_conn *smtpc = &conn->proto.smtpc; if(initresp && 8 + strlen(mech) + len <= 512) { /* AUTH ... */ /* Send the AUTH command with the initial response */ result = Curl_pp_sendf(&smtpc->pp, "AUTH %s %s", mech, initresp); if(!result) state(conn, state2); } else { /* Send the AUTH command */ result = Curl_pp_sendf(&smtpc->pp, "AUTH %s", mech); if(!result) state(conn, state1); } return result; } /*********************************************************************** * * smtp_perform_authentication() * * Initiates the authentication sequence, with the appropriate SASL * authentication mechanism. */ static CURLcode smtp_perform_authentication(struct connectdata *conn) { CURLcode result = CURLE_OK; const char *mech = NULL; char *initresp = NULL; size_t len = 0; smtpstate state1 = SMTP_STOP; smtpstate state2 = SMTP_STOP; /* Check we have a username and password to authenticate with and end the connect phase if we don't */ if(!conn->bits.user_passwd) { state(conn, SMTP_STOP); return result; } /* Calculate the SASL login details */ result = smtp_calc_sasl_details(conn, &mech, &initresp, &len, &state1, &state2); if(!result) { if(mech) { /* Perform SASL based authentication */ result = smtp_perform_auth(conn, mech, initresp, len, state1, state2); Curl_safefree(initresp); } else { /* Other mechanisms not supported */ infof(conn->data, "No known authentication mechanisms supported!\n"); result = CURLE_LOGIN_DENIED; } } return result; } /*********************************************************************** * * smtp_perform_command() * * Sends a SMTP based command. */ static CURLcode smtp_perform_command(struct connectdata *conn) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct SMTP *smtp = data->req.protop; /* Send the command */ if(smtp->rcpt) result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s %s", smtp->custom && smtp->custom[0] != '\0' ? smtp->custom : "VRFY", smtp->rcpt->data); else result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", smtp->custom && smtp->custom[0] != '\0' ? smtp->custom : "HELP"); if(!result) state(conn, SMTP_COMMAND); return result; } /*********************************************************************** * * smtp_perform_mail() * * Sends an MAIL command to initiate the upload of a message. */ static CURLcode smtp_perform_mail(struct connectdata *conn) { char *from = NULL; char *auth = NULL; char *size = NULL; CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; /* Calculate the FROM parameter */ if(!data->set.str[STRING_MAIL_FROM]) /* Null reverse-path, RFC-5321, sect. 3.6.3 */ from = strdup("<>"); else if(data->set.str[STRING_MAIL_FROM][0] == '<') from = aprintf("%s", data->set.str[STRING_MAIL_FROM]); else from = aprintf("<%s>", data->set.str[STRING_MAIL_FROM]); if(!from) return CURLE_OUT_OF_MEMORY; /* Calculate the optional AUTH parameter */ if(data->set.str[STRING_MAIL_AUTH] && conn->proto.smtpc.authused) { if(data->set.str[STRING_MAIL_AUTH][0] != '\0') auth = aprintf("%s", data->set.str[STRING_MAIL_AUTH]); else /* Empty AUTH, RFC-2554, sect. 5 */ auth = strdup("<>"); if(!auth) { Curl_safefree(from); return CURLE_OUT_OF_MEMORY; } } /* Calculate the optional SIZE parameter */ if(conn->proto.smtpc.size_supported && conn->data->set.infilesize > 0) { size = aprintf("%" CURL_FORMAT_CURL_OFF_T, data->set.infilesize); if(!size) { Curl_safefree(from); Curl_safefree(auth); return CURLE_OUT_OF_MEMORY; } } /* Send the MAIL command */ if(!auth && !size) result = Curl_pp_sendf(&conn->proto.smtpc.pp, "MAIL FROM:%s", from); else if(auth && !size) result = Curl_pp_sendf(&conn->proto.smtpc.pp, "MAIL FROM:%s AUTH=%s", from, auth); else if(auth && size) result = Curl_pp_sendf(&conn->proto.smtpc.pp, "MAIL FROM:%s AUTH=%s SIZE=%s", from, auth, size); else result = Curl_pp_sendf(&conn->proto.smtpc.pp, "MAIL FROM:%s SIZE=%s", from, size); Curl_safefree(from); Curl_safefree(auth); Curl_safefree(size); if(!result) state(conn, SMTP_MAIL); return result; } /*********************************************************************** * * smtp_perform_rcpt_to() * * Sends a RCPT TO command for a given recipient as part of the message upload * process. */ static CURLcode smtp_perform_rcpt_to(struct connectdata *conn) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct SMTP *smtp = data->req.protop; /* Send the RCPT TO command */ if(smtp->rcpt->data[0] == '<') result = Curl_pp_sendf(&conn->proto.smtpc.pp, "RCPT TO:%s", smtp->rcpt->data); else result = Curl_pp_sendf(&conn->proto.smtpc.pp, "RCPT TO:<%s>", smtp->rcpt->data); if(!result) state(conn, SMTP_RCPT); return result; } /*********************************************************************** * * smtp_perform_quit() * * Performs the quit action prior to sclose() being called. */ static CURLcode smtp_perform_quit(struct connectdata *conn) { CURLcode result = CURLE_OK; /* Send the QUIT command */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "QUIT"); if(!result) state(conn, SMTP_QUIT); return result; } /* For the initial server greeting */ static CURLcode smtp_state_servergreet_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(smtpcode/100 != 2) { failf(data, "Got unexpected smtp-server response: %d", smtpcode); result = CURLE_FTP_WEIRD_SERVER_REPLY; } else result = smtp_perform_ehlo(conn); return result; } /* For STARTTLS responses */ static CURLcode smtp_state_starttls_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(smtpcode != 220) { if(data->set.use_ssl != CURLUSESSL_TRY) { failf(data, "STARTTLS denied. %c", smtpcode); result = CURLE_USE_SSL_FAILED; } else result = smtp_perform_authentication(conn); } else result = smtp_perform_upgrade_tls(conn); return result; } /* For EHLO responses */ static CURLcode smtp_state_ehlo_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct smtp_conn *smtpc = &conn->proto.smtpc; const char *line = data->state.buffer; size_t len = strlen(line); size_t wordlen; (void)instate; /* no use for this yet */ if(smtpcode/100 != 2 && smtpcode != 1) { if((data->set.use_ssl <= CURLUSESSL_TRY || conn->ssl[FIRSTSOCKET].use) && !conn->bits.user_passwd) result = smtp_perform_helo(conn); else { failf(data, "Remote access denied: %d", smtpcode); result = CURLE_REMOTE_ACCESS_DENIED; } } else { line += 4; len -= 4; /* Does the server support the STARTTLS capability? */ if(len >= 8 && !memcmp(line, "STARTTLS", 8)) smtpc->tls_supported = TRUE; /* Does the server support the SIZE capability? */ else if(len >= 4 && !memcmp(line, "SIZE", 4)) smtpc->size_supported = TRUE; /* Do we have the authentication mechanism list? */ else if(len >= 5 && !memcmp(line, "AUTH ", 5)) { line += 5; len -= 5; /* Loop through the data line */ for(;;) { while(len && (*line == ' ' || *line == '\t' || *line == '\r' || *line == '\n')) { line++; len--; } if(!len) break; /* Extract the word */ for(wordlen = 0; wordlen < len && line[wordlen] != ' ' && line[wordlen] != '\t' && line[wordlen] != '\r' && line[wordlen] != '\n';) wordlen++; /* Test the word for a matching authentication mechanism */ if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_LOGIN)) smtpc->authmechs |= SASL_MECH_LOGIN; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_PLAIN)) smtpc->authmechs |= SASL_MECH_PLAIN; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_CRAM_MD5)) smtpc->authmechs |= SASL_MECH_CRAM_MD5; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_DIGEST_MD5)) smtpc->authmechs |= SASL_MECH_DIGEST_MD5; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_GSSAPI)) smtpc->authmechs |= SASL_MECH_GSSAPI; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_EXTERNAL)) smtpc->authmechs |= SASL_MECH_EXTERNAL; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_NTLM)) smtpc->authmechs |= SASL_MECH_NTLM; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_XOAUTH2)) smtpc->authmechs |= SASL_MECH_XOAUTH2; line += wordlen; len -= wordlen; } } if(smtpcode != 1) { if(data->set.use_ssl && !conn->ssl[FIRSTSOCKET].use) { /* We don't have a SSL/TLS connection yet, but SSL is requested */ if(smtpc->tls_supported) /* Switch to TLS connection now */ result = smtp_perform_starttls(conn); else if(data->set.use_ssl == CURLUSESSL_TRY) /* Fallback and carry on with authentication */ result = smtp_perform_authentication(conn); else { failf(data, "STARTTLS not supported."); result = CURLE_USE_SSL_FAILED; } } else result = smtp_perform_authentication(conn); } } return result; } /* For HELO responses */ static CURLcode smtp_state_helo_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(smtpcode/100 != 2) { failf(data, "Remote access denied: %d", smtpcode); result = CURLE_REMOTE_ACCESS_DENIED; } else /* End of connect phase */ state(conn, SMTP_STOP); return result; } /* For AUTH PLAIN (without initial response) responses */ static CURLcode smtp_state_auth_plain_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; size_t len = 0; char *plainauth = NULL; (void)instate; /* no use for this yet */ if(smtpcode != 334) { failf(data, "Access denied: %d", smtpcode); result = CURLE_LOGIN_DENIED; } else { /* Create the authorisation message */ result = Curl_sasl_create_plain_message(conn->data, conn->user, conn->passwd, &plainauth, &len); if(!result && plainauth) { /* Send the message */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", plainauth); if(!result) state(conn, SMTP_AUTH_FINAL); } } Curl_safefree(plainauth); return result; } /* For AUTH LOGIN (without initial response) responses */ static CURLcode smtp_state_auth_login_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; size_t len = 0; char *authuser = NULL; (void)instate; /* no use for this yet */ if(smtpcode != 334) { failf(data, "Access denied: %d", smtpcode); result = CURLE_LOGIN_DENIED; } else { /* Create the user message */ result = Curl_sasl_create_login_message(conn->data, conn->user, &authuser, &len); if(!result && authuser) { /* Send the user */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", authuser); if(!result) state(conn, SMTP_AUTH_LOGIN_PASSWD); } } Curl_safefree(authuser); return result; } /* For AUTH LOGIN user entry responses */ static CURLcode smtp_state_auth_login_password_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; size_t len = 0; char *authpasswd = NULL; (void)instate; /* no use for this yet */ if(smtpcode != 334) { failf(data, "Access denied: %d", smtpcode); result = CURLE_LOGIN_DENIED; } else { /* Create the password message */ result = Curl_sasl_create_login_message(conn->data, conn->passwd, &authpasswd, &len); if(!result && authpasswd) { /* Send the password */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", authpasswd); if(!result) state(conn, SMTP_AUTH_FINAL); } } Curl_safefree(authpasswd); return result; } #ifndef CURL_DISABLE_CRYPTO_AUTH /* For AUTH CRAM-MD5 responses */ static CURLcode smtp_state_auth_cram_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; char *chlg = NULL; char *chlg64 = NULL; char *rplyb64 = NULL; size_t len = 0; (void)instate; /* no use for this yet */ if(smtpcode != 334) { failf(data, "Access denied: %d", smtpcode); return CURLE_LOGIN_DENIED; } /* Get the challenge message */ smtp_get_message(data->state.buffer, &chlg64); /* Decode the challenge message */ result = Curl_sasl_decode_cram_md5_message(chlg64, &chlg, &len); if(result) { /* Send the cancellation */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "*"); if(!result) state(conn, SMTP_AUTH_CANCEL); } else { /* Create the response message */ result = Curl_sasl_create_cram_md5_message(data, chlg, conn->user, conn->passwd, &rplyb64, &len); if(!result && rplyb64) { /* Send the response */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", rplyb64); if(!result) state(conn, SMTP_AUTH_FINAL); } } Curl_safefree(chlg); Curl_safefree(rplyb64); return result; } /* For AUTH DIGEST-MD5 challenge responses */ static CURLcode smtp_state_auth_digest_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; char *chlg64 = NULL; char *rplyb64 = NULL; size_t len = 0; char nonce[64]; char realm[128]; char algorithm[64]; (void)instate; /* no use for this yet */ if(smtpcode != 334) { failf(data, "Access denied: %d", smtpcode); return CURLE_LOGIN_DENIED; } /* Get the challenge message */ smtp_get_message(data->state.buffer, &chlg64); /* Decode the challange message */ result = Curl_sasl_decode_digest_md5_message(chlg64, nonce, sizeof(nonce), realm, sizeof(realm), algorithm, sizeof(algorithm)); if(result || strcmp(algorithm, "md5-sess") != 0) { /* Send the cancellation */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "*"); if(!result) state(conn, SMTP_AUTH_CANCEL); } else { /* Create the response message */ result = Curl_sasl_create_digest_md5_message(data, nonce, realm, conn->user, conn->passwd, "smtp", &rplyb64, &len); if(!result && rplyb64) { /* Send the response */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", rplyb64); if(!result) state(conn, SMTP_AUTH_DIGESTMD5_RESP); } } Curl_safefree(rplyb64); return result; } /* For AUTH DIGEST-MD5 challenge-response responses */ static CURLcode smtp_state_auth_digest_resp_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(smtpcode != 334) { failf(data, "Authentication failed: %d", smtpcode); result = CURLE_LOGIN_DENIED; } else { /* Send an empty response */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", ""); if(!result) state(conn, SMTP_AUTH_FINAL); } return result; } #endif #ifdef USE_NTLM /* For AUTH NTLM (without initial response) responses */ static CURLcode smtp_state_auth_ntlm_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; char *type1msg = NULL; size_t len = 0; (void)instate; /* no use for this yet */ if(smtpcode != 334) { failf(data, "Access denied: %d", smtpcode); result = CURLE_LOGIN_DENIED; } else { /* Create the type-1 message */ result = Curl_sasl_create_ntlm_type1_message(conn->user, conn->passwd, &conn->ntlm, &type1msg, &len); if(!result && type1msg) { /* Send the message */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", type1msg); if(!result) state(conn, SMTP_AUTH_NTLM_TYPE2MSG); } } Curl_safefree(type1msg); return result; } /* For NTLM type-2 responses (sent in reponse to our type-1 message) */ static CURLcode smtp_state_auth_ntlm_type2msg_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; char *type2msg = NULL; char *type3msg = NULL; size_t len = 0; (void)instate; /* no use for this yet */ if(smtpcode != 334) { failf(data, "Access denied: %d", smtpcode); result = CURLE_LOGIN_DENIED; } else { /* Get the type-2 message */ smtp_get_message(data->state.buffer, &type2msg); /* Decode the type-2 message */ result = Curl_sasl_decode_ntlm_type2_message(data, type2msg, &conn->ntlm); if(result) { /* Send the cancellation */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "*"); if(!result) state(conn, SMTP_AUTH_CANCEL); } else { /* Create the type-3 message */ result = Curl_sasl_create_ntlm_type3_message(data, conn->user, conn->passwd, &conn->ntlm, &type3msg, &len); if(!result && type3msg) { /* Send the message */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", type3msg); if(!result) state(conn, SMTP_AUTH_FINAL); } } } Curl_safefree(type3msg); return result; } #endif /* For AUTH XOAUTH2 (without initial response) responses */ static CURLcode smtp_state_auth_xoauth2_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; size_t len = 0; char *xoauth = NULL; (void)instate; /* no use for this yet */ if(smtpcode != 334) { failf(data, "Access denied: %d", smtpcode); result = CURLE_LOGIN_DENIED; } else { /* Create the authorisation message */ result = Curl_sasl_create_xoauth2_message(conn->data, conn->user, conn->xoauth2_bearer, &xoauth, &len); if(!result && xoauth) { /* Send the message */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", xoauth); if(!result) state(conn, SMTP_AUTH_FINAL); } } Curl_safefree(xoauth); return result; } /* For AUTH cancellation responses */ static CURLcode smtp_state_auth_cancel_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct smtp_conn *smtpc = &conn->proto.smtpc; const char *mech = NULL; char *initresp = NULL; size_t len = 0; smtpstate state1 = SMTP_STOP; smtpstate state2 = SMTP_STOP; (void)smtpcode; (void)instate; /* no use for this yet */ /* Remove the offending mechanism from the supported list */ smtpc->authmechs ^= smtpc->authused; /* Calculate alternative SASL login details */ result = smtp_calc_sasl_details(conn, &mech, &initresp, &len, &state1, &state2); if(!result) { /* Do we have any mechanisms left? */ if(mech) { /* Retry SASL based authentication */ result = smtp_perform_auth(conn, mech, initresp, len, state1, state2); Curl_safefree(initresp); } else { failf(data, "Authentication cancelled"); result = CURLE_LOGIN_DENIED; } } return result; } /* For final responses in the AUTH sequence */ static CURLcode smtp_state_auth_final_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(smtpcode != 235) { failf(data, "Authentication failed: %d", smtpcode); result = CURLE_LOGIN_DENIED; } else /* End of connect phase */ state(conn, SMTP_STOP); return result; } /* For command responses */ static CURLcode smtp_state_command_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct SMTP *smtp = data->req.protop; char *line = data->state.buffer; size_t len = strlen(line); (void)instate; /* no use for this yet */ if((smtp->rcpt && smtpcode/100 != 2 && smtpcode != 553 && smtpcode != 1) || (!smtp->rcpt && smtpcode/100 != 2 && smtpcode != 1)) { failf(data, "Command failed: %d", smtpcode); result = CURLE_RECV_ERROR; } else { /* Temporarily add the LF character back and send as body to the client */ if(!data->set.opt_no_body) { line[len] = '\n'; result = Curl_client_write(conn, CLIENTWRITE_BODY, line, len + 1); line[len] = '\0'; } if(smtpcode != 1) { if(smtp->rcpt) { smtp->rcpt = smtp->rcpt->next; if(smtp->rcpt) { /* Send the next command */ result = smtp_perform_command(conn); } else /* End of DO phase */ state(conn, SMTP_STOP); } else /* End of DO phase */ state(conn, SMTP_STOP); } } return result; } /* For MAIL responses */ static CURLcode smtp_state_mail_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(smtpcode/100 != 2) { failf(data, "MAIL failed: %d", smtpcode); result = CURLE_SEND_ERROR; } else /* Start the RCPT TO command */ result = smtp_perform_rcpt_to(conn); return result; } /* For RCPT responses */ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct SMTP *smtp = data->req.protop; (void)instate; /* no use for this yet */ if(smtpcode/100 != 2) { failf(data, "RCPT failed: %d", smtpcode); result = CURLE_SEND_ERROR; } else { smtp->rcpt = smtp->rcpt->next; if(smtp->rcpt) /* Send the next RCPT TO command */ result = smtp_perform_rcpt_to(conn); else { /* Send the DATA command */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "DATA"); if(!result) state(conn, SMTP_DATA); } } return result; } /* For DATA response */ static CURLcode smtp_state_data_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(smtpcode != 354) { failf(data, "DATA failed: %d", smtpcode); result = CURLE_SEND_ERROR; } else { /* Set the progress upload size */ Curl_pgrsSetUploadSize(data, data->set.infilesize); /* SMTP upload */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, FIRSTSOCKET, NULL); /* End of DO phase */ state(conn, SMTP_STOP); } return result; } /* For POSTDATA responses, which are received after the entire DATA part has been sent to the server */ static CURLcode smtp_state_postdata_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; (void)instate; /* no use for this yet */ if(smtpcode != 250) result = CURLE_RECV_ERROR; /* End of DONE phase */ state(conn, SMTP_STOP); return result; } static CURLcode smtp_statemach_act(struct connectdata *conn) { CURLcode result = CURLE_OK; curl_socket_t sock = conn->sock[FIRSTSOCKET]; struct SessionHandle *data = conn->data; int smtpcode; struct smtp_conn *smtpc = &conn->proto.smtpc; struct pingpong *pp = &smtpc->pp; size_t nread = 0; /* Busy upgrading the connection; right now all I/O is SSL/TLS, not SMTP */ if(smtpc->state == SMTP_UPGRADETLS) return smtp_perform_upgrade_tls(conn); /* Flush any data that needs to be sent */ if(pp->sendleft) return Curl_pp_flushsend(pp); do { /* Read the response from the server */ result = Curl_pp_readresp(sock, pp, &smtpcode, &nread); if(result) return result; /* Store the latest response for later retrieval if necessary */ if(smtpc->state != SMTP_QUIT && smtpcode != 1) data->info.httpcode = smtpcode; if(!smtpcode) break; /* We have now received a full SMTP server response */ switch(smtpc->state) { case SMTP_SERVERGREET: result = smtp_state_servergreet_resp(conn, smtpcode, smtpc->state); break; case SMTP_EHLO: result = smtp_state_ehlo_resp(conn, smtpcode, smtpc->state); break; case SMTP_HELO: result = smtp_state_helo_resp(conn, smtpcode, smtpc->state); break; case SMTP_STARTTLS: result = smtp_state_starttls_resp(conn, smtpcode, smtpc->state); break; case SMTP_AUTH_PLAIN: result = smtp_state_auth_plain_resp(conn, smtpcode, smtpc->state); break; case SMTP_AUTH_LOGIN: result = smtp_state_auth_login_resp(conn, smtpcode, smtpc->state); break; case SMTP_AUTH_LOGIN_PASSWD: result = smtp_state_auth_login_password_resp(conn, smtpcode, smtpc->state); break; #ifndef CURL_DISABLE_CRYPTO_AUTH case SMTP_AUTH_CRAMMD5: result = smtp_state_auth_cram_resp(conn, smtpcode, smtpc->state); break; case SMTP_AUTH_DIGESTMD5: result = smtp_state_auth_digest_resp(conn, smtpcode, smtpc->state); break; case SMTP_AUTH_DIGESTMD5_RESP: result = smtp_state_auth_digest_resp_resp(conn, smtpcode, smtpc->state); break; #endif #ifdef USE_NTLM case SMTP_AUTH_NTLM: result = smtp_state_auth_ntlm_resp(conn, smtpcode, smtpc->state); break; case SMTP_AUTH_NTLM_TYPE2MSG: result = smtp_state_auth_ntlm_type2msg_resp(conn, smtpcode, smtpc->state); break; #endif case SMTP_AUTH_XOAUTH2: result = smtp_state_auth_xoauth2_resp(conn, smtpcode, smtpc->state); break; case SMTP_AUTH_CANCEL: result = smtp_state_auth_cancel_resp(conn, smtpcode, smtpc->state); break; case SMTP_AUTH_FINAL: result = smtp_state_auth_final_resp(conn, smtpcode, smtpc->state); break; case SMTP_COMMAND: result = smtp_state_command_resp(conn, smtpcode, smtpc->state); break; case SMTP_MAIL: result = smtp_state_mail_resp(conn, smtpcode, smtpc->state); break; case SMTP_RCPT: result = smtp_state_rcpt_resp(conn, smtpcode, smtpc->state); break; case SMTP_DATA: result = smtp_state_data_resp(conn, smtpcode, smtpc->state); break; case SMTP_POSTDATA: result = smtp_state_postdata_resp(conn, smtpcode, smtpc->state); break; case SMTP_QUIT: /* fallthrough, just stop! */ default: /* internal error */ state(conn, SMTP_STOP); break; } } while(!result && smtpc->state != SMTP_STOP && Curl_pp_moredata(pp)); return result; } /* Called repeatedly until done from multi.c */ static CURLcode smtp_multi_statemach(struct connectdata *conn, bool *done) { CURLcode result = CURLE_OK; struct smtp_conn *smtpc = &conn->proto.smtpc; if((conn->handler->flags & PROTOPT_SSL) && !smtpc->ssldone) { result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &smtpc->ssldone); if(result || !smtpc->ssldone) return result; } result = Curl_pp_statemach(&smtpc->pp, FALSE); *done = (smtpc->state == SMTP_STOP) ? TRUE : FALSE; return result; } static CURLcode smtp_block_statemach(struct connectdata *conn) { CURLcode result = CURLE_OK; struct smtp_conn *smtpc = &conn->proto.smtpc; while(smtpc->state != SMTP_STOP && !result) result = Curl_pp_statemach(&smtpc->pp, TRUE); return result; } /* Allocate and initialize the SMTP struct for the current SessionHandle if required */ static CURLcode smtp_init(struct connectdata *conn) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct SMTP *smtp; smtp = data->req.protop = calloc(sizeof(struct SMTP), 1); if(!smtp) result = CURLE_OUT_OF_MEMORY; return result; } /* For the SMTP "protocol connect" and "doing" phases only */ static int smtp_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { return Curl_pp_getsock(&conn->proto.smtpc.pp, socks, numsocks); } /*********************************************************************** * * smtp_connect() * * This function should do everything that is to be considered a part of * the connection phase. * * The variable pointed to by 'done' will be TRUE if the protocol-layer * connect phase is done when this function returns, or FALSE if not. */ static CURLcode smtp_connect(struct connectdata *conn, bool *done) { CURLcode result = CURLE_OK; struct smtp_conn *smtpc = &conn->proto.smtpc; struct pingpong *pp = &smtpc->pp; *done = FALSE; /* default to not done yet */ /* We always support persistent connections in SMTP */ conn->bits.close = FALSE; /* Set the default response time-out */ pp->response_time = RESP_TIMEOUT; pp->statemach_act = smtp_statemach_act; pp->endofresp = smtp_endofresp; pp->conn = conn; /* Set the default preferred authentication mechanism */ smtpc->prefmech = SASL_AUTH_ANY; /* Initialise the pingpong layer */ Curl_pp_init(pp); /* Parse the URL options */ result = smtp_parse_url_options(conn); if(result) return result; /* Parse the URL path */ result = smtp_parse_url_path(conn); if(result) return result; /* Start off waiting for the server greeting response */ state(conn, SMTP_SERVERGREET); result = smtp_multi_statemach(conn, done); return result; } /*********************************************************************** * * smtp_done() * * The DONE function. This does what needs to be done after a single DO has * performed. * * Input argument is already checked for validity. */ static CURLcode smtp_done(struct connectdata *conn, CURLcode status, bool premature) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct SMTP *smtp = data->req.protop; struct pingpong *pp = &conn->proto.smtpc.pp; const char *eob; ssize_t len; ssize_t bytes_written; (void)premature; if(!smtp) /* When the easy handle is removed from the multi interface while libcurl is still trying to resolve the host name, the SMTP struct is not yet initialized. However, the removal action calls Curl_done() which in turn calls this function, so we simply return success. */ return CURLE_OK; if(status) { conn->bits.close = TRUE; /* marked for closure */ result = status; /* use the already set error code */ } else if(!data->set.connect_only && data->set.upload && data->set.mail_rcpt) { /* Calculate the EOB taking into account any terminating CRLF from the previous line of the email or the CRLF of the DATA command when there is "no mail data". RFC-5321, sect. 4.1.1.4. */ eob = SMTP_EOB; len = SMTP_EOB_LEN; if(smtp->trailing_crlf || !conn->data->set.infilesize) { eob += 2; len -= 2; } /* Send the end of block data */ result = Curl_write(conn, conn->writesockfd, eob, len, &bytes_written); if(result) return result; if(bytes_written != len) { /* The whole chunk was not sent so keep it around and adjust the pingpong structure accordingly */ pp->sendthis = strdup(eob); pp->sendsize = len; pp->sendleft = len - bytes_written; } else /* Successfully sent so adjust the response timeout relative to now */ pp->response = Curl_tvnow(); state(conn, SMTP_POSTDATA); /* Run the state-machine TODO: when the multi interface is used, this _really_ should be using the smtp_multi_statemach function but we have no general support for non-blocking DONE operations, not in the multi state machine and with Curl_done() invokes on several places in the code! */ result = smtp_block_statemach(conn); } /* Cleanup our per-request based variables */ Curl_safefree(smtp->custom); /* Clear the transfer mode for the next request */ smtp->transfer = FTPTRANSFER_BODY; return result; } /*********************************************************************** * * smtp_perform() * * This is the actual DO function for SMTP. Transfer a mail, send a command * or get some data according to the options previously setup. */ static CURLcode smtp_perform(struct connectdata *conn, bool *connected, bool *dophase_done) { /* This is SMTP and no proxy */ CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct SMTP *smtp = data->req.protop; DEBUGF(infof(conn->data, "DO phase starts\n")); if(data->set.opt_no_body) { /* Requested no body means no transfer */ smtp->transfer = FTPTRANSFER_INFO; } *dophase_done = FALSE; /* not done yet */ /* Store the first recipient (or NULL if not specified) */ smtp->rcpt = data->set.mail_rcpt; /* Start the first command in the DO phase */ if(data->set.upload && data->set.mail_rcpt) /* MAIL transfer */ result = smtp_perform_mail(conn); else /* SMTP based command (VRFY, EXPN, NOOP, RSET or HELP) */ result = smtp_perform_command(conn); if(result) return result; /* Run the state-machine */ result = smtp_multi_statemach(conn, dophase_done); *connected = conn->bits.tcpconnect[FIRSTSOCKET]; if(*dophase_done) DEBUGF(infof(conn->data, "DO phase is complete\n")); return result; } /*********************************************************************** * * smtp_do() * * This function is registered as 'curl_do' function. It decodes the path * parts etc as a wrapper to the actual DO function (smtp_perform). * * The input argument is already checked for validity. */ static CURLcode smtp_do(struct connectdata *conn, bool *done) { CURLcode result = CURLE_OK; *done = FALSE; /* default to false */ /* Parse the custom request */ result = smtp_parse_custom_request(conn); if(result) return result; result = smtp_regular_transfer(conn, done); return result; } /*********************************************************************** * * smtp_disconnect() * * Disconnect from an SMTP server. Cleanup protocol-specific per-connection * resources. BLOCKING. */ static CURLcode smtp_disconnect(struct connectdata *conn, bool dead_connection) { struct smtp_conn *smtpc = &conn->proto.smtpc; /* 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. */ /* The SMTP session may or may not have been allocated/setup at this point! */ if(!dead_connection && smtpc->pp.conn && smtpc->pp.conn->bits.protoconnstart) if(!smtp_perform_quit(conn)) (void)smtp_block_statemach(conn); /* ignore errors on QUIT */ /* Disconnect from the server */ Curl_pp_disconnect(&smtpc->pp); /* Cleanup the SASL module */ Curl_sasl_cleanup(conn, smtpc->authused); /* Cleanup our connection based variables */ Curl_safefree(smtpc->domain); return CURLE_OK; } /* Call this when the DO phase has completed */ static CURLcode smtp_dophase_done(struct connectdata *conn, bool connected) { struct SMTP *smtp = conn->data->req.protop; (void)connected; if(smtp->transfer != FTPTRANSFER_BODY) /* no data to transfer */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); return CURLE_OK; } /* Called from multi.c while DOing */ static CURLcode smtp_doing(struct connectdata *conn, bool *dophase_done) { CURLcode result = smtp_multi_statemach(conn, dophase_done); if(result) DEBUGF(infof(conn->data, "DO phase failed\n")); else if(*dophase_done) { result = smtp_dophase_done(conn, FALSE /* not connected */); DEBUGF(infof(conn->data, "DO phase is complete\n")); } return result; } /*********************************************************************** * * smtp_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. */ static CURLcode smtp_regular_transfer(struct connectdata *conn, bool *dophase_done) { CURLcode result = CURLE_OK; bool connected = FALSE; struct SessionHandle *data = conn->data; /* Make sure size is unknown at this point */ data->req.size = -1; /* Set the progress data */ Curl_pgrsSetUploadCounter(data, 0); Curl_pgrsSetDownloadCounter(data, 0); Curl_pgrsSetUploadSize(data, 0); Curl_pgrsSetDownloadSize(data, 0); /* Carry out the perform */ result = smtp_perform(conn, &connected, dophase_done); /* Perform post DO phase operations if necessary */ if(!result && *dophase_done) result = smtp_dophase_done(conn, connected); return result; } static CURLcode smtp_setup_connection(struct connectdata *conn) { struct SessionHandle *data = conn->data; CURLcode result; if(conn->bits.httpproxy && !data->set.tunnel_thru_httpproxy) { /* Unless we have asked to tunnel SMTP operations through the proxy, we switch and use HTTP operations only */ #ifndef CURL_DISABLE_HTTP if(conn->handler == &Curl_handler_smtp) conn->handler = &Curl_handler_smtp_proxy; else { #ifdef USE_SSL conn->handler = &Curl_handler_smtps_proxy; #else failf(data, "SMTPS not supported!"); return CURLE_UNSUPPORTED_PROTOCOL; #endif } /* set it up as a HTTP connection instead */ return conn->handler->setup_connection(conn); #else failf(data, "SMTP over http proxy requires HTTP support built-in!"); return CURLE_UNSUPPORTED_PROTOCOL; #endif } /* Initialise the SMTP layer */ result = smtp_init(conn); if(result) return result; data->state.path++; /* don't include the initial slash */ return CURLE_OK; } /*********************************************************************** * * smtp_parse_url_options() * * Parse the URL login options. */ static CURLcode smtp_parse_url_options(struct connectdata *conn) { CURLcode result = CURLE_OK; struct smtp_conn *smtpc = &conn->proto.smtpc; const char *options = conn->options; const char *ptr = options; bool reset = TRUE; while(ptr && *ptr) { const char *key = ptr; while(*ptr && *ptr != '=') ptr++; if(strnequal(key, "AUTH", 4)) { size_t len = 0; const char *value = ++ptr; if(reset) { reset = FALSE; smtpc->prefmech = SASL_AUTH_NONE; } while(*ptr && *ptr != ';') { ptr++; len++; } if(strnequal(value, "*", len)) smtpc->prefmech = SASL_AUTH_ANY; else if(strnequal(value, SASL_MECH_STRING_LOGIN, len)) smtpc->prefmech |= SASL_MECH_LOGIN; else if(strnequal(value, SASL_MECH_STRING_PLAIN, len)) smtpc->prefmech |= SASL_MECH_PLAIN; else if(strnequal(value, SASL_MECH_STRING_CRAM_MD5, len)) smtpc->prefmech |= SASL_MECH_CRAM_MD5; else if(strnequal(value, SASL_MECH_STRING_DIGEST_MD5, len)) smtpc->prefmech |= SASL_MECH_DIGEST_MD5; else if(strnequal(value, SASL_MECH_STRING_GSSAPI, len)) smtpc->prefmech |= SASL_MECH_GSSAPI; else if(strnequal(value, SASL_MECH_STRING_NTLM, len)) smtpc->prefmech |= SASL_MECH_NTLM; else if(strnequal(value, SASL_MECH_STRING_XOAUTH2, len)) smtpc->prefmech |= SASL_MECH_XOAUTH2; if(*ptr == ';') ptr++; } else result = CURLE_URL_MALFORMAT; } return result; } /*********************************************************************** * * smtp_parse_url_path() * * Parse the URL path into separate path components. */ static CURLcode smtp_parse_url_path(struct connectdata *conn) { /* The SMTP struct is already initialised in smtp_connect() */ struct SessionHandle *data = conn->data; struct smtp_conn *smtpc = &conn->proto.smtpc; const char *path = data->state.path; char localhost[HOSTNAME_MAX + 1]; /* Calculate the path if necessary */ if(!*path) { if(!Curl_gethostname(localhost, sizeof(localhost))) path = localhost; else path = "localhost"; } /* URL decode the path and use it as the domain in our EHLO */ return Curl_urldecode(conn->data, path, 0, &smtpc->domain, NULL, TRUE); } /*********************************************************************** * * smtp_parse_custom_request() * * Parse the custom request. */ static CURLcode smtp_parse_custom_request(struct connectdata *conn) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct SMTP *smtp = data->req.protop; const char *custom = data->set.str[STRING_CUSTOMREQUEST]; /* URL decode the custom request */ if(custom) result = Curl_urldecode(data, custom, 0, &smtp->custom, NULL, TRUE); return result; } /*********************************************************************** * * smtp_calc_sasl_details() * * Calculate the required login details for SASL authentication. */ static CURLcode smtp_calc_sasl_details(struct connectdata *conn, const char **mech, char **initresp, size_t *len, smtpstate *state1, smtpstate *state2) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct smtp_conn *smtpc = &conn->proto.smtpc; /* Calculate the supported authentication mechanism, by decreasing order of security, as well as the initial response where appropriate */ #ifndef CURL_DISABLE_CRYPTO_AUTH if((smtpc->authmechs & SASL_MECH_DIGEST_MD5) && (smtpc->prefmech & SASL_MECH_DIGEST_MD5)) { *mech = SASL_MECH_STRING_DIGEST_MD5; *state1 = SMTP_AUTH_DIGESTMD5; smtpc->authused = SASL_MECH_DIGEST_MD5; } else if((smtpc->authmechs & SASL_MECH_CRAM_MD5) && (smtpc->prefmech & SASL_MECH_CRAM_MD5)) { *mech = SASL_MECH_STRING_CRAM_MD5; *state1 = SMTP_AUTH_CRAMMD5; smtpc->authused = SASL_MECH_CRAM_MD5; } else #endif #ifdef USE_NTLM if((smtpc->authmechs & SASL_MECH_NTLM) && (smtpc->prefmech & SASL_MECH_NTLM)) { *mech = SASL_MECH_STRING_NTLM; *state1 = SMTP_AUTH_NTLM; *state2 = SMTP_AUTH_NTLM_TYPE2MSG; smtpc->authused = SASL_MECH_NTLM; if(data->set.sasl_ir) result = Curl_sasl_create_ntlm_type1_message(conn->user, conn->passwd, &conn->ntlm, initresp, len); } else #endif if(((smtpc->authmechs & SASL_MECH_XOAUTH2) && (smtpc->prefmech & SASL_MECH_XOAUTH2) && (smtpc->prefmech != SASL_AUTH_ANY)) || conn->xoauth2_bearer) { *mech = SASL_MECH_STRING_XOAUTH2; *state1 = SMTP_AUTH_XOAUTH2; *state2 = SMTP_AUTH_FINAL; smtpc->authused = SASL_MECH_XOAUTH2; if(data->set.sasl_ir) result = Curl_sasl_create_xoauth2_message(data, conn->user, conn->xoauth2_bearer, initresp, len); } else if((smtpc->authmechs & SASL_MECH_LOGIN) && (smtpc->prefmech & SASL_MECH_LOGIN)) { *mech = SASL_MECH_STRING_LOGIN; *state1 = SMTP_AUTH_LOGIN; *state2 = SMTP_AUTH_LOGIN_PASSWD; smtpc->authused = SASL_MECH_LOGIN; if(data->set.sasl_ir) result = Curl_sasl_create_login_message(data, conn->user, initresp, len); } else if((smtpc->authmechs & SASL_MECH_PLAIN) && (smtpc->prefmech & SASL_MECH_PLAIN)) { *mech = SASL_MECH_STRING_PLAIN; *state1 = SMTP_AUTH_PLAIN; *state2 = SMTP_AUTH_FINAL; smtpc->authused = SASL_MECH_PLAIN; if(data->set.sasl_ir) result = Curl_sasl_create_plain_message(data, conn->user, conn->passwd, initresp, len); } return result; } CURLcode Curl_smtp_escape_eob(struct connectdata *conn, ssize_t nread) { /* When sending a SMTP payload we must detect CRLF. sequences making sure they are sent as CRLF.. instead, as a . on the beginning of a line will be deleted by the server when not part of an EOB terminator and a genuine CRLF.CRLF which isn't escaped will wrongly be detected as end of data by the server */ ssize_t i; ssize_t si; struct SessionHandle *data = conn->data; struct SMTP *smtp = data->req.protop; /* Do we need to allocate the scatch buffer? */ if(!data->state.scratch) { data->state.scratch = malloc(2 * BUFSIZE); if(!data->state.scratch) { failf (data, "Failed to alloc scratch buffer!"); return CURLE_OUT_OF_MEMORY; } } /* This loop can be improved by some kind of Boyer-Moore style of approach but that is saved for later... */ for(i = 0, si = 0; i < nread; i++) { if(SMTP_EOB[smtp->eob] == data->req.upload_fromhere[i]) { smtp->eob++; /* Is the EOB potentially the terminating CRLF? */ if(2 == smtp->eob || SMTP_EOB_LEN == smtp->eob) smtp->trailing_crlf = TRUE; else smtp->trailing_crlf = FALSE; } else if(smtp->eob) { /* A previous substring matched so output that first */ memcpy(&data->state.scratch[si], SMTP_EOB, smtp->eob); si += smtp->eob; /* Then compare the first byte */ if(SMTP_EOB[0] == data->req.upload_fromhere[i]) smtp->eob = 1; else smtp->eob = 0; /* Reset the trailing CRLF flag as there was more data */ smtp->trailing_crlf = FALSE; } /* Do we have a match for CRLF. as per RFC-5321, sect. 4.5.2 */ if(SMTP_EOB_FIND_LEN == smtp->eob) { /* Copy the replacement data to the target buffer */ memcpy(&data->state.scratch[si], SMTP_EOB_REPL, SMTP_EOB_REPL_LEN); si += SMTP_EOB_REPL_LEN; smtp->eob = 0; } else if(!smtp->eob) data->state.scratch[si++] = data->req.upload_fromhere[i]; } if(smtp->eob) { /* A substring matched before processing ended so output that now */ memcpy(&data->state.scratch[si], SMTP_EOB, smtp->eob); si += smtp->eob; smtp->eob = 0; } if(si != nread) { /* Only use the new buffer if we replaced something */ nread = si; /* Upload from the new (replaced) buffer instead */ data->req.upload_fromhere = data->state.scratch; /* Set the new amount too */ data->req.upload_present = nread; } return CURLE_OK; } #endif /* CURL_DISABLE_SMTP */ curl-7.35.0/lib/inet_ntop.h0000644000175000017500000000257512213173003012413 00000000000000#ifndef HEADER_CURL_INET_NTOP_H #define HEADER_CURL_INET_NTOP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2009, 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. * ***************************************************************************/ #include "curl_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,(curl_socklen_t)size) #endif #endif /* HEADER_CURL_INET_NTOP_H */ curl-7.35.0/lib/libcurl.plist0000644000175000017500000000141712272124477012766 00000000000000 CFBundleInfoDictionaryVersion 6.0 CFBundleDevelopmentRegion English CFBundleExecutable curl CFBundleIdentifier se.haxx.curl.libcurl CFBundleVersion 7.35.0 CFBundleName libcurl CFBundlePackageType FMWK CFBundleSignature ???? CFBundleShortVersionString libcurl 7.35.0 CFBundleGetInfoString libcurl.plist 7.35.0 curl-7.35.0/lib/curl_sasl.c0000644000175000017500000004716712270035364012416 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2012 - 2014, 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. * * RFC2195 CRAM-MD5 authentication * RFC2831 DIGEST-MD5 authentication * RFC4422 Simple Authentication and Security Layer (SASL) * RFC4616 PLAIN authentication * RFC6749 OAuth 2.0 Authorization Framework * Draft LOGIN SASL Mechanism * ***************************************************************************/ #include "curl_setup.h" #include #include "urldata.h" #include "curl_base64.h" #include "curl_md5.h" #include "vtls/vtls.h" #include "curl_hmac.h" #include "curl_ntlm_msgs.h" #include "curl_sasl.h" #include "warnless.h" #include "curl_memory.h" #ifdef USE_NSS #include "vtls/nssg.h" /* for Curl_nss_force_init() */ #endif #define _MPRINTF_REPLACE /* use our functions only */ #include /* The last #include file should be: */ #include "memdebug.h" #ifndef CURL_DISABLE_CRYPTO_AUTH /* Retrieves the value for a corresponding key from the challenge string * returns TRUE if the key could be found, FALSE if it does not exists */ static bool sasl_digest_get_key_value(const char *chlg, const char *key, char *value, size_t max_val_len, char end_char) { char *find_pos; size_t i; find_pos = strstr(chlg, key); if(!find_pos) return FALSE; find_pos += strlen(key); for(i = 0; *find_pos && *find_pos != end_char && i < max_val_len - 1; ++i) value[i] = *find_pos++; value[i] = '\0'; return TRUE; } #endif /* * Curl_sasl_create_plain_message() * * This is used to generate an already encoded PLAIN message ready * for sending to the recipient. * * Parameters: * * data [in] - The session handle. * userp [in] - The user name. * passdwp [in] - The user's password. * outptr [in/out] - The address where a pointer to newly allocated memory * holding the result will be stored upon completion. * outlen [out] - The length of the output message. * * Returns CURLE_OK on success. */ CURLcode Curl_sasl_create_plain_message(struct SessionHandle *data, const char *userp, const char *passwdp, char **outptr, size_t *outlen) { CURLcode result; char *plainauth; size_t ulen; size_t plen; ulen = strlen(userp); plen = strlen(passwdp); plainauth = malloc(2 * ulen + plen + 2); if(!plainauth) { *outlen = 0; *outptr = NULL; return CURLE_OUT_OF_MEMORY; } /* Calculate the reply */ memcpy(plainauth, userp, ulen); plainauth[ulen] = '\0'; memcpy(plainauth + ulen + 1, userp, ulen); plainauth[2 * ulen + 1] = '\0'; memcpy(plainauth + 2 * ulen + 2, passwdp, plen); /* Base64 encode the reply */ result = Curl_base64_encode(data, plainauth, 2 * ulen + plen + 2, outptr, outlen); Curl_safefree(plainauth); return result; } /* * Curl_sasl_create_login_message() * * This is used to generate an already encoded LOGIN message containing the * user name or password ready for sending to the recipient. * * Parameters: * * data [in] - The session handle. * valuep [in] - The user name or user's password. * outptr [in/out] - The address where a pointer to newly allocated memory * holding the result will be stored upon completion. * outlen [out] - The length of the output message. * * Returns CURLE_OK on success. */ CURLcode Curl_sasl_create_login_message(struct SessionHandle *data, const char *valuep, char **outptr, size_t *outlen) { size_t vlen = strlen(valuep); if(!vlen) { /* Calculate an empty reply */ *outptr = strdup("="); if(*outptr) { *outlen = (size_t) 1; return CURLE_OK; } *outlen = 0; return CURLE_OUT_OF_MEMORY; } /* Base64 encode the value */ return Curl_base64_encode(data, valuep, vlen, outptr, outlen); } #ifndef CURL_DISABLE_CRYPTO_AUTH /* * Curl_sasl_decode_cram_md5_message() * * This is used to decode an already encoded CRAM-MD5 challenge message. * * Parameters: * * chlg64 [in] - Pointer to the base64 encoded challenge message. * outptr [in/out] - The address where a pointer to newly allocated memory * holding the result will be stored upon completion. * outlen [out] - The length of the output message. * * Returns CURLE_OK on success. */ CURLcode Curl_sasl_decode_cram_md5_message(const char *chlg64, char **outptr, size_t *outlen) { CURLcode result = CURLE_OK; size_t chlg64len = strlen(chlg64); *outptr = NULL; *outlen = 0; /* Decode the challenge if necessary */ if(chlg64len && *chlg64 != '=') result = Curl_base64_decode(chlg64, (unsigned char **) outptr, outlen); return result; } /* * Curl_sasl_create_cram_md5_message() * * This is used to generate an already encoded CRAM-MD5 response message ready * for sending to the recipient. * * Parameters: * * data [in] - The session handle. * chlg [in] - The challenge. * userp [in] - The user name. * passdwp [in] - The user's password. * outptr [in/out] - The address where a pointer to newly allocated memory * holding the result will be stored upon completion. * outlen [out] - The length of the output message. * * Returns CURLE_OK on success. */ CURLcode Curl_sasl_create_cram_md5_message(struct SessionHandle *data, const char *chlg, const char *userp, const char *passwdp, char **outptr, size_t *outlen) { CURLcode result = CURLE_OK; size_t chlglen = 0; HMAC_context *ctxt; unsigned char digest[MD5_DIGEST_LEN]; char *response; if(chlg) chlglen = strlen(chlg); /* Compute the digest using the password as the key */ ctxt = Curl_HMAC_init(Curl_HMAC_MD5, (const unsigned char *) passwdp, curlx_uztoui(strlen(passwdp))); if(!ctxt) return CURLE_OUT_OF_MEMORY; /* Update the digest with the given challenge */ if(chlglen > 0) Curl_HMAC_update(ctxt, (const unsigned char *) chlg, curlx_uztoui(chlglen)); /* Finalise the digest */ Curl_HMAC_final(ctxt, digest); /* Generate the response */ response = aprintf( "%s %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", userp, digest[0], digest[1], digest[2], digest[3], digest[4], digest[5], digest[6], digest[7], digest[8], digest[9], digest[10], digest[11], digest[12], digest[13], digest[14], digest[15]); if(!response) return CURLE_OUT_OF_MEMORY; /* Base64 encode the response */ result = Curl_base64_encode(data, response, 0, outptr, outlen); Curl_safefree(response); return result; } /* * Curl_sasl_decode_digest_md5_message() * * This is used to decode an already encoded DIGEST-MD5 challenge message. * * Parameters: * * chlg64 [in] - Pointer to the base64 encoded challenge message. * nonce [in/out] - The buffer where the nonce will be stored. * nlen [in] - The length of the nonce buffer. * realm [in/out] - The buffer where the realm will be stored. * rlen [in] - The length of the realm buffer. * alg [in/out] - The buffer where the algorithm will be stored. * alen [in] - The length of the algorithm buffer. * * Returns CURLE_OK on success. */ CURLcode Curl_sasl_decode_digest_md5_message(const char *chlg64, char *nonce, size_t nlen, char *realm, size_t rlen, char *alg, size_t alen) { CURLcode result = CURLE_OK; unsigned char *chlg = NULL; size_t chlglen = 0; size_t chlg64len = strlen(chlg64); if(chlg64len && *chlg64 != '=') { result = Curl_base64_decode(chlg64, &chlg, &chlglen); if(result) return result; } /* Ensure we have a valid challenge message */ if(!chlg) return CURLE_BAD_CONTENT_ENCODING; /* Retrieve nonce string from the challenge */ if(!sasl_digest_get_key_value((char *)chlg, "nonce=\"", nonce, nlen, '\"')) { Curl_safefree(chlg); return CURLE_BAD_CONTENT_ENCODING; } /* Retrieve realm string from the challenge */ if(!sasl_digest_get_key_value((char *)chlg, "realm=\"", realm, rlen, '\"')) { /* Challenge does not have a realm, set empty string [RFC2831] page 6 */ strcpy(realm, ""); } /* Retrieve algorithm string from the challenge */ if(!sasl_digest_get_key_value((char *)chlg, "algorithm=", alg, alen, ',')) { Curl_safefree(chlg); return CURLE_BAD_CONTENT_ENCODING; } Curl_safefree(chlg); return CURLE_OK; } /* * Curl_sasl_create_digest_md5_message() * * This is used to generate an already encoded DIGEST-MD5 response message * ready for sending to the recipient. * * Parameters: * * data [in] - The session handle. * nonce [in] - The nonce. * realm [in] - The realm. * userp [in] - The user name. * passdwp [in] - The user's password. * service [in] - The service type such as www, smtp, pop or imap. * outptr [in/out] - The address where a pointer to newly allocated memory * holding the result will be stored upon completion. * outlen [out] - The length of the output message. * * Returns CURLE_OK on success. */ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data, const char *nonce, const char *realm, const char *userp, const char *passwdp, const char *service, char **outptr, size_t *outlen) { #ifndef DEBUGBUILD static const char table16[] = "0123456789abcdef"; #endif CURLcode result = CURLE_OK; size_t i; MD5_context *ctxt; char *response = NULL; unsigned char digest[MD5_DIGEST_LEN]; char HA1_hex[2 * MD5_DIGEST_LEN + 1]; char HA2_hex[2 * MD5_DIGEST_LEN + 1]; char resp_hash_hex[2 * MD5_DIGEST_LEN + 1]; char nonceCount[] = "00000001"; char cnonce[] = "12345678"; /* will be changed */ char method[] = "AUTHENTICATE"; char qop[] = "auth"; char uri[128]; #ifndef DEBUGBUILD /* Generate 64 bits of random data */ for(i = 0; i < 8; i++) cnonce[i] = table16[Curl_rand(data)%16]; #endif /* So far so good, now calculate A1 and H(A1) according to RFC 2831 */ ctxt = Curl_MD5_init(Curl_DIGEST_MD5); if(!ctxt) return CURLE_OUT_OF_MEMORY; Curl_MD5_update(ctxt, (const unsigned char *) userp, curlx_uztoui(strlen(userp))); Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); Curl_MD5_update(ctxt, (const unsigned char *) realm, curlx_uztoui(strlen(realm))); Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); Curl_MD5_update(ctxt, (const unsigned char *) passwdp, curlx_uztoui(strlen(passwdp))); Curl_MD5_final(ctxt, digest); ctxt = Curl_MD5_init(Curl_DIGEST_MD5); if(!ctxt) return CURLE_OUT_OF_MEMORY; Curl_MD5_update(ctxt, (const unsigned char *) digest, MD5_DIGEST_LEN); Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); Curl_MD5_update(ctxt, (const unsigned char *) nonce, curlx_uztoui(strlen(nonce))); Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); Curl_MD5_update(ctxt, (const unsigned char *) cnonce, curlx_uztoui(strlen(cnonce))); Curl_MD5_final(ctxt, digest); /* Convert calculated 16 octet hex into 32 bytes string */ for(i = 0; i < MD5_DIGEST_LEN; i++) snprintf(&HA1_hex[2 * i], 3, "%02x", digest[i]); /* Prepare the URL string */ snprintf(uri, sizeof(uri), "%s/%s", service, realm); /* Calculate H(A2) */ ctxt = Curl_MD5_init(Curl_DIGEST_MD5); if(!ctxt) return CURLE_OUT_OF_MEMORY; Curl_MD5_update(ctxt, (const unsigned char *) method, curlx_uztoui(strlen(method))); Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); Curl_MD5_update(ctxt, (const unsigned char *) uri, curlx_uztoui(strlen(uri))); Curl_MD5_final(ctxt, digest); for(i = 0; i < MD5_DIGEST_LEN; i++) snprintf(&HA2_hex[2 * i], 3, "%02x", digest[i]); /* Now calculate the response hash */ ctxt = Curl_MD5_init(Curl_DIGEST_MD5); if(!ctxt) return CURLE_OUT_OF_MEMORY; Curl_MD5_update(ctxt, (const unsigned char *) HA1_hex, 2 * MD5_DIGEST_LEN); Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); Curl_MD5_update(ctxt, (const unsigned char *) nonce, curlx_uztoui(strlen(nonce))); Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); Curl_MD5_update(ctxt, (const unsigned char *) nonceCount, curlx_uztoui(strlen(nonceCount))); Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); Curl_MD5_update(ctxt, (const unsigned char *) cnonce, curlx_uztoui(strlen(cnonce))); Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); Curl_MD5_update(ctxt, (const unsigned char *) qop, curlx_uztoui(strlen(qop))); Curl_MD5_update(ctxt, (const unsigned char *) ":", 1); Curl_MD5_update(ctxt, (const unsigned char *) HA2_hex, 2 * MD5_DIGEST_LEN); Curl_MD5_final(ctxt, digest); for(i = 0; i < MD5_DIGEST_LEN; i++) snprintf(&resp_hash_hex[2 * i], 3, "%02x", digest[i]); /* Generate the response */ response = aprintf("username=\"%s\",realm=\"%s\",nonce=\"%s\"," "cnonce=\"%s\",nc=\"%s\",digest-uri=\"%s\",response=%s", userp, realm, nonce, cnonce, nonceCount, uri, resp_hash_hex); if(!response) return CURLE_OUT_OF_MEMORY; /* Base64 encode the response */ result = Curl_base64_encode(data, response, 0, outptr, outlen); Curl_safefree(response); return result; } #endif #ifdef USE_NTLM /* * Curl_sasl_create_ntlm_type1_message() * * This is used to generate an already encoded NTLM type-1 message ready for * sending to the recipient. * * Note: This is a simple wrapper of the NTLM function which means that any * SASL based protocols don't have to include the NTLM functions directly. * * Parameters: * * userp [in] - The user name in the format User or Domain\User. * passdwp [in] - The user's password. * ntlm [in/out] - The ntlm data struct being used and modified. * outptr [in/out] - The address where a pointer to newly allocated memory * holding the result will be stored upon completion. * outlen [out] - The length of the output message. * * Returns CURLE_OK on success. */ CURLcode Curl_sasl_create_ntlm_type1_message(const char *userp, const char *passwdp, struct ntlmdata *ntlm, char **outptr, size_t *outlen) { return Curl_ntlm_create_type1_message(userp, passwdp, ntlm, outptr, outlen); } /* * Curl_sasl_decode_ntlm_type2_message() * * This is used to decode an already encoded NTLM type-2 message. * * Parameters: * * data [in] - Pointer to session handle. * type2msg [in] - Pointer to the base64 encoded type-2 message. * ntlm [in/out] - The ntlm data struct being used and modified. * * Returns CURLE_OK on success. */ CURLcode Curl_sasl_decode_ntlm_type2_message(struct SessionHandle *data, const char *type2msg, struct ntlmdata *ntlm) { #ifdef USE_NSS CURLcode result; /* make sure the crypto backend is initialized */ result = Curl_nss_force_init(data); if(result) return result; #endif return Curl_ntlm_decode_type2_message(data, type2msg, ntlm); } /* * Curl_sasl_create_ntlm_type3_message() * * This is used to generate an already encoded NTLM type-3 message ready for * sending to the recipient. * * Parameters: * * data [in] - Pointer to session handle. * userp [in] - The user name in the format User or Domain\User. * passdwp [in] - The user's password. * ntlm [in/out] - The ntlm data struct being used and modified. * outptr [in/out] - The address where a pointer to newly allocated memory * holding the result will be stored upon completion. * outlen [out] - The length of the output message. * * Returns CURLE_OK on success. */ CURLcode Curl_sasl_create_ntlm_type3_message(struct SessionHandle *data, const char *userp, const char *passwdp, struct ntlmdata *ntlm, char **outptr, size_t *outlen) { return Curl_ntlm_create_type3_message(data, userp, passwdp, ntlm, outptr, outlen); } #endif /* USE_NTLM */ /* * Curl_sasl_create_xoauth2_message() * * This is used to generate an already encoded OAuth 2.0 message ready for * sending to the recipient. * * Parameters: * * data [in] - The session handle. * user [in] - The user name. * bearer [in] - The bearer token. * outptr [in/out] - The address where a pointer to newly allocated memory * holding the result will be stored upon completion. * outlen [out] - The length of the output message. * * Returns CURLE_OK on success. */ CURLcode Curl_sasl_create_xoauth2_message(struct SessionHandle *data, const char *user, const char *bearer, char **outptr, size_t *outlen) { CURLcode result = CURLE_OK; char *xoauth = NULL; /* Generate the message */ xoauth = aprintf("user=%s\1auth=Bearer %s\1\1", user, bearer); if(!xoauth) return CURLE_OUT_OF_MEMORY; /* Base64 encode the reply */ result = Curl_base64_encode(data, xoauth, strlen(xoauth), outptr, outlen); Curl_safefree(xoauth); return result; } /* * Curl_sasl_cleanup() * * This is used to cleanup any libraries or curl modules used by the sasl * functions. * * Parameters: * * conn [in] - Pointer to the connection data. * authused [in] - The authentication mechanism used. */ void Curl_sasl_cleanup(struct connectdata *conn, unsigned int authused) { #ifdef USE_NTLM /* Cleanup the ntlm structure */ if(authused == SASL_MECH_NTLM) { Curl_ntlm_sspi_cleanup(&conn->ntlm); } (void)conn; #else /* Reserved for future use */ (void)conn; (void)authused; #endif } curl-7.35.0/lib/escape.h0000644000175000017500000000266112213173003011650 00000000000000#ifndef HEADER_CURL_ESCAPE_H #define HEADER_CURL_ESCAPE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ /* Escape and unescape URL encoding in strings. The functions return a new * allocated string or NULL if an error occurred. */ CURLcode Curl_urldecode(struct SessionHandle *data, const char *string, size_t length, char **ostring, size_t *olen, bool reject_crlf); #endif /* HEADER_CURL_ESCAPE_H */ curl-7.35.0/lib/content_encoding.h0000644000175000017500000000345212213173003013727 00000000000000#ifndef HEADER_CURL_CONTENT_ENCODING_H #define HEADER_CURL_CONTENT_ENCODING_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" /* * Comma-separated list all supported Content-Encodings ('identity' is implied) */ #ifdef HAVE_LIBZ #define ALL_CONTENT_ENCODINGS "deflate, gzip" /* force a cleanup */ void Curl_unencode_cleanup(struct connectdata *conn); #else #define ALL_CONTENT_ENCODINGS "identity" #define Curl_unencode_cleanup(x) Curl_nop_stmt #endif CURLcode Curl_unencode_deflate_write(struct connectdata *conn, struct SingleRequest *req, ssize_t nread); CURLcode Curl_unencode_gzip_write(struct connectdata *conn, struct SingleRequest *k, ssize_t nread); #endif /* HEADER_CURL_CONTENT_ENCODING_H */ curl-7.35.0/lib/non-ascii.c0000644000175000017500000002371412213173003012265 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef CURL_DOES_CONVERSIONS #include #include "non-ascii.h" #include "formdata.h" #include "sendf.h" #include "urldata.h" #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" #ifdef 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 /* HAVE_ICONV */ /* * Curl_convert_clone() returns a malloced copy of the source string (if * returning CURLE_OK), with the data converted to network format. */ CURLcode Curl_convert_clone(struct SessionHandle *data, const char *indata, size_t insize, char **outbuf) { char *convbuf; CURLcode result; convbuf = malloc(insize); if(!convbuf) return CURLE_OUT_OF_MEMORY; memcpy(convbuf, indata, insize); result = Curl_convert_to_network(data, convbuf, insize); if(result) { free(convbuf); return result; } *outbuf = convbuf; /* return the converted buffer */ return CURLE_OK; } /* * Curl_convert_to_network() is an internal function for performing ASCII * conversions on non-ASCII platforms. It convers the buffer _in place_. */ 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 %d: %s", (int)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; int error; /* 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) { error = ERRNO; failf(data, "The iconv_open(\"%s\", \"%s\") call failed with errno %i: %s", CURL_ICONV_CODESET_OF_NETWORK, CURL_ICONV_CODESET_OF_HOST, error, strerror(error)); 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)) { error = ERRNO; failf(data, "The Curl_convert_to_network iconv call failed with errno %i: %s", error, strerror(error)); 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. It convers the buffer _in place_. */ 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 %d: %s", (int)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; int error; /* 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) { error = ERRNO; failf(data, "The iconv_open(\"%s\", \"%s\") call failed with errno %i: %s", CURL_ICONV_CODESET_OF_HOST, CURL_ICONV_CODESET_OF_NETWORK, error, strerror(error)); 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)) { error = ERRNO; failf(data, "Curl_convert_from_network iconv call failed with errno %i: %s", error, strerror(error)); 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 %d: %s", (int)rc, curl_easy_strerror(rc)); } return rc; } else { #ifdef HAVE_ICONV /* do the translation ourselves */ const char *input_ptr; char *output_ptr; size_t in_bytes, out_bytes, rc; int error; /* 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) { error = ERRNO; failf(data, "The iconv_open(\"%s\", \"%s\") call failed with errno %i: %s", CURL_ICONV_CODESET_OF_HOST, CURL_ICONV_CODESET_FOR_UTF8, error, strerror(error)); return CURLE_CONV_FAILED; } } /* call iconv */ input_ptr = output_ptr = buffer; in_bytes = out_bytes = length; rc = iconv(data->utf8_cd, &input_ptr, &in_bytes, &output_ptr, &out_bytes); if((rc == ICONV_ERROR) || (in_bytes != 0)) { error = ERRNO; failf(data, "The Curl_convert_from_utf8 iconv call failed with errno %i: %s", error, strerror(error)); 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; } /* * Init conversion stuff for a SessionHandle */ void Curl_convert_init(struct SessionHandle *data) { #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; #else (void)data; #endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */ } /* * Setup conversion stuff for a SessionHandle */ void Curl_convert_setup(struct SessionHandle *data) { data->inbound_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST, CURL_ICONV_CODESET_OF_NETWORK); data->outbound_cd = iconv_open(CURL_ICONV_CODESET_OF_NETWORK, CURL_ICONV_CODESET_OF_HOST); data->utf8_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST, CURL_ICONV_CODESET_FOR_UTF8); } /* * Close conversion stuff for a SessionHandle */ void Curl_convert_close(struct SessionHandle *data) { #ifdef 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); } #else (void)data; #endif /* HAVE_ICONV */ } /* * Curl_convert_form() is used from http.c, this converts any form items that need to be sent in the network encoding. Returns CURLE_OK on success. */ CURLcode Curl_convert_form(struct SessionHandle *data, struct FormData *form) { struct FormData *next; CURLcode rc; if(!form) return CURLE_OK; if(!data) return CURLE_BAD_FUNCTION_ARGUMENT; do { next=form->next; /* the following form line */ if(form->type == FORM_DATA) { rc = Curl_convert_to_network(data, form->line, form->length); /* Curl_convert_to_network calls failf if unsuccessful */ if(rc != CURLE_OK) return rc; } } while((form = next) != NULL); /* continue */ return CURLE_OK; } #endif /* CURL_DOES_CONVERSIONS */ curl-7.35.0/lib/multihandle.h0000644000175000017500000001353612262353672012741 00000000000000#ifndef HEADER_CURL_MULTIHANDLE_H #define HEADER_CURL_MULTIHANDLE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ struct Curl_message { /* the 'CURLMsg' is the part that is visible to the external user */ struct CURLMsg extmsg; }; /* NOTE: if you add a state here, add the name to the statename[] array as well! */ typedef enum { CURLM_STATE_INIT, /* 0 - start in this state */ CURLM_STATE_CONNECT_PEND, /* 1 - no connections, waiting for one */ CURLM_STATE_CONNECT, /* 2 - resolve/connect has been sent off */ CURLM_STATE_WAITRESOLVE, /* 3 - awaiting the resolve to finalize */ CURLM_STATE_WAITCONNECT, /* 4 - awaiting the connect to finalize */ CURLM_STATE_WAITPROXYCONNECT, /* 5 - awaiting proxy CONNECT to finalize */ CURLM_STATE_PROTOCONNECT, /* 6 - completing the protocol-specific connect phase */ CURLM_STATE_WAITDO, /* 7 - wait for our turn to send the request */ CURLM_STATE_DO, /* 8 - start send off the request (part 1) */ CURLM_STATE_DOING, /* 9 - sending off the request (part 1) */ CURLM_STATE_DO_MORE, /* 10 - send off the request (part 2) */ CURLM_STATE_DO_DONE, /* 11 - done sending off request */ CURLM_STATE_WAITPERFORM, /* 12 - wait for our turn to read the response */ CURLM_STATE_PERFORM, /* 13 - transfer data */ CURLM_STATE_TOOFAST, /* 14 - wait because limit-rate exceeded */ CURLM_STATE_DONE, /* 15 - post data transfer operation */ CURLM_STATE_COMPLETED, /* 16 - operation complete */ CURLM_STATE_MSGSENT, /* 17 - the operation complete message is sent */ CURLM_STATE_LAST /* 18 - 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) /* 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 doubly-linked circular list with easy handles */ struct SessionHandle *easyp; struct SessionHandle *easylp; /* last node */ int num_easy; /* amount of entries in the linked list above. */ int num_alive; /* amount of easy handles that are added but have not yet reached COMPLETE state */ struct curl_llist *msglist; /* a list of messages from completed transfers */ /* 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 (bundles)*/ struct conncache *conn_cache; /* This handle will be used for closing the cached connections in curl_multi_cleanup() */ struct SessionHandle *closure_handle; long maxconnects; /* if >0, a fixed limit of the maximum number of entries we're allowed to grow the connection cache to */ long max_host_connections; /* if >0, a fixed limit of the maximum number of connections per host */ long max_total_connections; /* if >0, a fixed limit of the maximum number of connections in total */ long max_pipeline_length; /* if >0, maximum number of requests in a pipeline */ long content_length_penalty_size; /* a connection with a content-length bigger than this is not considered for pipelining */ long chunk_length_penalty_size; /* a connection with a chunk length bigger than this is not considered for pipelining */ struct curl_llist *pipelining_site_bl; /* List of sites that are blacklisted from pipelining */ struct curl_llist *pipelining_server_bl; /* List of server types that are blacklisted from pipelining */ /* timer callback and user data pointer for the *socket() API */ curl_multi_timer_callback timer_cb; void *timer_userp; struct timeval timer_lastcall; /* the fixed time for the timeout for the previous callback */ }; #endif /* HEADER_CURL_MULTIHANDLE_H */ curl-7.35.0/lib/openldap.c0000644000175000017500000004412012262353672012221 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2010, 2013, Howard Chu, * Copyright (C) 2011 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #if !defined(CURL_DISABLE_LDAP) && defined(USE_OPENLDAP) /* * Notice that USE_OPENLDAP is only a source code selection switch. When * libcurl is built with USE_OPENLDAP defined the libcurl source code that * gets compiled is the code from openldap.c, otherwise the code that gets * compiled is the code from ldap.c. * * When USE_OPENLDAP is defined a recent version of the OpenLDAP library * might be required for compilation and runtime. In order to use ancient * OpenLDAP library versions, USE_OPENLDAP shall not be defined. */ #include #include "urldata.h" #include #include "sendf.h" #include "vtls/vtls.h" #include "transfer.h" #include "curl_ldap.h" #include "curl_memory.h" #include "curl_base64.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "memdebug.h" #ifndef _LDAP_PVT_H extern int ldap_pvt_url_scheme2proto(const char *); extern int ldap_init_fd(ber_socket_t fd, int proto, const char *url, LDAP **ld); #endif static CURLcode ldap_setup(struct connectdata *conn); static CURLcode ldap_do(struct connectdata *conn, bool *done); static CURLcode ldap_done(struct connectdata *conn, CURLcode, bool); static CURLcode ldap_connect(struct connectdata *conn, bool *done); static CURLcode ldap_connecting(struct connectdata *conn, bool *done); static CURLcode ldap_disconnect(struct connectdata *conn, bool dead); static Curl_recv ldap_recv; /* * LDAP protocol handler. */ const struct Curl_handler Curl_handler_ldap = { "LDAP", /* scheme */ ldap_setup, /* setup_connection */ ldap_do, /* do_it */ ldap_done, /* done */ ZERO_NULL, /* do_more */ ldap_connect, /* connect_it */ ldap_connecting, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ldap_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_LDAP, /* defport */ CURLPROTO_LDAP, /* protocol */ PROTOPT_NONE /* flags */ }; #ifdef USE_SSL /* * LDAPS protocol handler. */ const struct Curl_handler Curl_handler_ldaps = { "LDAPS", /* scheme */ ldap_setup, /* setup_connection */ ldap_do, /* do_it */ ldap_done, /* done */ ZERO_NULL, /* do_more */ ldap_connect, /* connect_it */ ldap_connecting, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ldap_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_LDAPS, /* defport */ CURLPROTO_LDAP, /* protocol */ PROTOPT_SSL /* flags */ }; #endif static const char *url_errs[] = { "success", "out of memory", "bad parameter", "unrecognized scheme", "unbalanced delimiter", "bad URL", "bad host or port", "bad or missing attributes", "bad or missing scope", "bad or missing filter", "bad or missing extensions" }; typedef struct ldapconninfo { LDAP *ld; Curl_recv *recv; /* for stacking SSL handler */ Curl_send *send; int proto; int msgid; bool ssldone; bool sslinst; bool didbind; } ldapconninfo; typedef struct ldapreqinfo { int msgid; int nument; } ldapreqinfo; static CURLcode ldap_setup(struct connectdata *conn) { ldapconninfo *li; LDAPURLDesc *lud; struct SessionHandle *data=conn->data; int rc, proto; CURLcode status; rc = ldap_url_parse(data->change.url, &lud); if(rc != LDAP_URL_SUCCESS) { const char *msg = "url parsing problem"; status = CURLE_URL_MALFORMAT; if(rc > LDAP_URL_SUCCESS && rc <= LDAP_URL_ERR_BADEXTS) { if(rc == LDAP_URL_ERR_MEM) status = CURLE_OUT_OF_MEMORY; msg = url_errs[rc]; } failf(conn->data, "LDAP local: %s", msg); return status; } proto = ldap_pvt_url_scheme2proto(lud->lud_scheme); ldap_free_urldesc(lud); li = calloc(1, sizeof(ldapconninfo)); if(!li) return CURLE_OUT_OF_MEMORY; li->proto = proto; conn->proto.generic = li; conn->bits.close = FALSE; /* TODO: * - provide option to choose SASL Binds instead of Simple */ return CURLE_OK; } #ifdef USE_SSL static Sockbuf_IO ldapsb_tls; #endif static CURLcode ldap_connect(struct connectdata *conn, bool *done) { ldapconninfo *li = conn->proto.generic; struct SessionHandle *data=conn->data; int rc, proto = LDAP_VERSION3; char hosturl[1024], *ptr; (void)done; strcpy(hosturl, "ldap"); ptr = hosturl+4; if(conn->handler->flags & PROTOPT_SSL) *ptr++ = 's'; snprintf(ptr, sizeof(hosturl)-(ptr-hosturl), "://%s:%d", conn->host.name, conn->remote_port); rc = ldap_init_fd(conn->sock[FIRSTSOCKET], li->proto, hosturl, &li->ld); if(rc) { failf(data, "LDAP local: Cannot connect to %s, %s", hosturl, ldap_err2string(rc)); return CURLE_COULDNT_CONNECT; } ldap_set_option(li->ld, LDAP_OPT_PROTOCOL_VERSION, &proto); #ifdef USE_SSL if(conn->handler->flags & PROTOPT_SSL) { CURLcode res; res = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &li->ssldone); if(res) return res; } #endif return CURLE_OK; } static CURLcode ldap_connecting(struct connectdata *conn, bool *done) { ldapconninfo *li = conn->proto.generic; struct SessionHandle *data=conn->data; LDAPMessage *result = NULL; struct timeval tv = {0,1}, *tvp; int rc, err; char *info = NULL; #ifdef USE_SSL if(conn->handler->flags & PROTOPT_SSL) { /* Is the SSL handshake complete yet? */ if(!li->ssldone) { CURLcode res = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &li->ssldone); if(res || !li->ssldone) return res; } /* Have we installed the libcurl SSL handlers into the sockbuf yet? */ if(!li->sslinst) { Sockbuf *sb; ldap_get_option(li->ld, LDAP_OPT_SOCKBUF, &sb); ber_sockbuf_add_io(sb, &ldapsb_tls, LBER_SBIOD_LEVEL_TRANSPORT, conn); li->sslinst = TRUE; li->recv = conn->recv[FIRSTSOCKET]; li->send = conn->send[FIRSTSOCKET]; } } #endif tvp = &tv; retry: if(!li->didbind) { char *binddn; struct berval passwd; if(conn->bits.user_passwd) { binddn = conn->user; passwd.bv_val = conn->passwd; passwd.bv_len = strlen(passwd.bv_val); } else { binddn = NULL; passwd.bv_val = NULL; passwd.bv_len = 0; } rc = ldap_sasl_bind(li->ld, binddn, LDAP_SASL_SIMPLE, &passwd, NULL, NULL, &li->msgid); if(rc) return CURLE_LDAP_CANNOT_BIND; li->didbind = TRUE; if(tvp) return CURLE_OK; } rc = ldap_result(li->ld, li->msgid, LDAP_MSG_ONE, tvp, &result); if(rc < 0) { failf(data, "LDAP local: bind ldap_result %s", ldap_err2string(rc)); return CURLE_LDAP_CANNOT_BIND; } if(rc == 0) { /* timed out */ return CURLE_OK; } rc = ldap_parse_result(li->ld, result, &err, NULL, &info, NULL, NULL, 1); if(rc) { failf(data, "LDAP local: bind ldap_parse_result %s", ldap_err2string(rc)); return CURLE_LDAP_CANNOT_BIND; } /* Try to fallback to LDAPv2? */ if(err == LDAP_PROTOCOL_ERROR) { int proto; ldap_get_option(li->ld, LDAP_OPT_PROTOCOL_VERSION, &proto); if(proto == LDAP_VERSION3) { if(info) { ldap_memfree(info); info = NULL; } proto = LDAP_VERSION2; ldap_set_option(li->ld, LDAP_OPT_PROTOCOL_VERSION, &proto); li->didbind = FALSE; goto retry; } } if(err) { failf(data, "LDAP remote: bind failed %s %s", ldap_err2string(rc), info ? info : ""); if(info) ldap_memfree(info); return CURLE_LOGIN_DENIED; } if(info) ldap_memfree(info); conn->recv[FIRSTSOCKET] = ldap_recv; *done = TRUE; return CURLE_OK; } static CURLcode ldap_disconnect(struct connectdata *conn, bool dead_connection) { ldapconninfo *li = conn->proto.generic; (void) dead_connection; if(li) { if(li->ld) { ldap_unbind_ext(li->ld, NULL, NULL); li->ld = NULL; } conn->proto.generic = NULL; free(li); } return CURLE_OK; } static CURLcode ldap_do(struct connectdata *conn, bool *done) { ldapconninfo *li = conn->proto.generic; ldapreqinfo *lr; CURLcode status = CURLE_OK; int rc = 0; LDAPURLDesc *ludp = NULL; int msgid; struct SessionHandle *data=conn->data; conn->bits.close = FALSE; infof(data, "LDAP local: %s\n", data->change.url); rc = ldap_url_parse(data->change.url, &ludp); if(rc != LDAP_URL_SUCCESS) { const char *msg = "url parsing problem"; status = CURLE_URL_MALFORMAT; if(rc > LDAP_URL_SUCCESS && rc <= LDAP_URL_ERR_BADEXTS) { if(rc == LDAP_URL_ERR_MEM) status = CURLE_OUT_OF_MEMORY; msg = url_errs[rc]; } failf(conn->data, "LDAP local: %s", msg); return status; } rc = ldap_search_ext(li->ld, ludp->lud_dn, ludp->lud_scope, ludp->lud_filter, ludp->lud_attrs, 0, NULL, NULL, NULL, 0, &msgid); ldap_free_urldesc(ludp); if(rc != LDAP_SUCCESS) { failf(data, "LDAP local: ldap_search_ext %s", ldap_err2string(rc)); return CURLE_LDAP_SEARCH_FAILED; } lr = calloc(1,sizeof(ldapreqinfo)); if(!lr) return CURLE_OUT_OF_MEMORY; lr->msgid = msgid; data->req.protop = lr; Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, NULL, -1, NULL); *done = TRUE; return CURLE_OK; } static CURLcode ldap_done(struct connectdata *conn, CURLcode res, bool premature) { ldapreqinfo *lr = conn->data->req.protop; (void)res; (void)premature; if(lr) { /* if there was a search in progress, abandon it */ if(lr->msgid) { ldapconninfo *li = conn->proto.generic; ldap_abandon_ext(li->ld, lr->msgid, NULL, NULL); lr->msgid = 0; } conn->data->req.protop = NULL; free(lr); } return CURLE_OK; } static ssize_t ldap_recv(struct connectdata *conn, int sockindex, char *buf, size_t len, CURLcode *err) { ldapconninfo *li = conn->proto.generic; struct SessionHandle *data=conn->data; ldapreqinfo *lr = data->req.protop; int rc, ret; LDAPMessage *result = NULL; LDAPMessage *ent; BerElement *ber = NULL; struct timeval tv = {0,1}; (void)len; (void)buf; (void)sockindex; rc = ldap_result(li->ld, lr->msgid, LDAP_MSG_RECEIVED, &tv, &result); if(rc < 0) { failf(data, "LDAP local: search ldap_result %s", ldap_err2string(rc)); *err = CURLE_RECV_ERROR; return -1; } *err = CURLE_AGAIN; ret = -1; /* timed out */ if(result == NULL) return ret; for(ent = ldap_first_message(li->ld, result); ent; ent = ldap_next_message(li->ld, ent)) { struct berval bv, *bvals, **bvp = &bvals; int binary = 0, msgtype; msgtype = ldap_msgtype(ent); if(msgtype == LDAP_RES_SEARCH_RESULT) { int code; char *info = NULL; rc = ldap_parse_result(li->ld, ent, &code, NULL, &info, NULL, NULL, 0); if(rc) { failf(data, "LDAP local: search ldap_parse_result %s", ldap_err2string(rc)); *err = CURLE_LDAP_SEARCH_FAILED; } else if(code && code != LDAP_SIZELIMIT_EXCEEDED) { failf(data, "LDAP remote: search failed %s %s", ldap_err2string(rc), info ? info : ""); *err = CURLE_LDAP_SEARCH_FAILED; } else { /* successful */ if(code == LDAP_SIZELIMIT_EXCEEDED) infof(data, "There are more than %d entries\n", lr->nument); data->req.size = data->req.bytecount; *err = CURLE_OK; ret = 0; } lr->msgid = 0; ldap_memfree(info); break; } else if(msgtype != LDAP_RES_SEARCH_ENTRY) continue; lr->nument++; rc = ldap_get_dn_ber(li->ld, ent, &ber, &bv); if(rc < 0) { /* TODO: verify that this is really how this return code should be handled */ *err = CURLE_RECV_ERROR; return -1; } Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"DN: ", 4); Curl_client_write(conn, CLIENTWRITE_BODY, (char *)bv.bv_val, bv.bv_len); Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"\n", 1); data->req.bytecount += bv.bv_len + 5; for(rc = ldap_get_attribute_ber(li->ld, ent, ber, &bv, bvp); rc == LDAP_SUCCESS; rc = ldap_get_attribute_ber(li->ld, ent, ber, &bv, bvp)) { int i; if(bv.bv_val == NULL) break; if(bv.bv_len > 7 && !strncmp(bv.bv_val + bv.bv_len - 7, ";binary", 7)) binary = 1; else binary = 0; for(i=0; bvals[i].bv_val != NULL; i++) { int binval = 0; Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"\t", 1); Curl_client_write(conn, CLIENTWRITE_BODY, (char *)bv.bv_val, bv.bv_len); Curl_client_write(conn, CLIENTWRITE_BODY, (char *)":", 1); data->req.bytecount += bv.bv_len + 2; if(!binary) { /* check for leading or trailing whitespace */ if(ISSPACE(bvals[i].bv_val[0]) || ISSPACE(bvals[i].bv_val[bvals[i].bv_len-1])) binval = 1; else { /* check for unprintable characters */ unsigned int j; for(j=0; jreq.bytecount += 2; if(val_b64_sz > 0) { Curl_client_write(conn, CLIENTWRITE_BODY, val_b64, val_b64_sz); free(val_b64); data->req.bytecount += val_b64_sz; } } else { Curl_client_write(conn, CLIENTWRITE_BODY, (char *)" ", 1); Curl_client_write(conn, CLIENTWRITE_BODY, bvals[i].bv_val, bvals[i].bv_len); data->req.bytecount += bvals[i].bv_len + 1; } Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"\n", 0); data->req.bytecount++; } ber_memfree(bvals); Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"\n", 0); data->req.bytecount++; } Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"\n", 0); data->req.bytecount++; ber_free(ber, 0); } ldap_msgfree(result); return ret; } #ifdef USE_SSL static int ldapsb_tls_setup(Sockbuf_IO_Desc *sbiod, void *arg) { sbiod->sbiod_pvt = arg; return 0; } static int ldapsb_tls_remove(Sockbuf_IO_Desc *sbiod) { sbiod->sbiod_pvt = NULL; return 0; } /* We don't need to do anything because libcurl does it already */ static int ldapsb_tls_close(Sockbuf_IO_Desc *sbiod) { (void)sbiod; return 0; } static int ldapsb_tls_ctrl(Sockbuf_IO_Desc *sbiod, int opt, void *arg) { (void)arg; if(opt == LBER_SB_OPT_DATA_READY) { struct connectdata *conn = sbiod->sbiod_pvt; return Curl_ssl_data_pending(conn, FIRSTSOCKET); } return 0; } static ber_slen_t ldapsb_tls_read(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len) { struct connectdata *conn = sbiod->sbiod_pvt; ldapconninfo *li = conn->proto.generic; ber_slen_t ret; CURLcode err = CURLE_RECV_ERROR; ret = li->recv(conn, FIRSTSOCKET, buf, len, &err); if(ret < 0 && err == CURLE_AGAIN) { SET_SOCKERRNO(EWOULDBLOCK); } return ret; } static ber_slen_t ldapsb_tls_write(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len) { struct connectdata *conn = sbiod->sbiod_pvt; ldapconninfo *li = conn->proto.generic; ber_slen_t ret; CURLcode err = CURLE_SEND_ERROR; ret = li->send(conn, FIRSTSOCKET, buf, len, &err); if(ret < 0 && err == CURLE_AGAIN) { SET_SOCKERRNO(EWOULDBLOCK); } return ret; } static Sockbuf_IO ldapsb_tls = { ldapsb_tls_setup, ldapsb_tls_remove, ldapsb_tls_ctrl, ldapsb_tls_read, ldapsb_tls_write, ldapsb_tls_close }; #endif /* USE_SSL */ #endif /* !CURL_DISABLE_LDAP && USE_OPENLDAP */ curl-7.35.0/lib/conncache.h0000644000175000017500000000376312262102134012336 00000000000000#ifndef HEADER_CURL_CONNCACHE_H #define HEADER_CURL_CONNCACHE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2012, 2013, Linus Nielsen Feltzing, * * 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. * ***************************************************************************/ struct conncache { struct curl_hash *hash; size_t num_connections; }; struct conncache *Curl_conncache_init(int size); void Curl_conncache_destroy(struct conncache *connc); struct connectbundle *Curl_conncache_find_bundle(struct conncache *connc, char *hostname); CURLcode Curl_conncache_add_conn(struct conncache *connc, struct connectdata *conn); void Curl_conncache_remove_conn(struct conncache *connc, struct connectdata *conn); void Curl_conncache_foreach(struct conncache *connc, void *param, int (*func)(struct connectdata *conn, void *param)); struct connectdata * Curl_conncache_find_first_connection(struct conncache *connc); void Curl_conncache_print(struct conncache *connc); #endif /* HEADER_CURL_CONNCACHE_H */ curl-7.35.0/lib/file.c0000644000175000017500000004066012270035364011335 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_FILE #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_FCNTL_H #include #endif #include "strtoofft.h" #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 "curl_memory.h" #include "parsedate.h" /* for the week day and month names */ #include "warnless.h" #define _MPRINTF_REPLACE /* use our functions only */ #include /* The last #include file should be: */ #include "memdebug.h" #if defined(WIN32) || defined(MSDOS) || defined(__EMX__) || \ defined(__SYMBIAN32__) #define DOS_FILESYSTEM 1 #endif #ifdef OPEN_NEEDS_ARG3 # define open_readonly(p,f) open((p),(f),(0)) #else # define open_readonly(p,f) open((p),(f)) #endif /* * Forward declarations. */ static CURLcode file_do(struct connectdata *, bool *done); static CURLcode file_done(struct connectdata *conn, CURLcode status, bool premature); static CURLcode file_connect(struct connectdata *conn, bool *done); static CURLcode file_disconnect(struct connectdata *conn, bool dead_connection); static CURLcode file_setup_connection(struct connectdata *conn); /* * FILE scheme handler. */ const struct Curl_handler Curl_handler_file = { "FILE", /* scheme */ file_setup_connection, /* setup_connection */ file_do, /* do_it */ file_done, /* done */ ZERO_NULL, /* do_more */ file_connect, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ file_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ 0, /* defport */ CURLPROTO_FILE, /* protocol */ PROTOPT_NONETWORK | PROTOPT_NOURLQUERY /* flags */ }; static CURLcode file_setup_connection(struct connectdata *conn) { /* allocate the FILE specific struct */ conn->data->req.protop = calloc(1, sizeof(struct FILEPROTO)); if(!conn->data->req.protop) return CURLE_OUT_OF_MEMORY; return CURLE_OK; } /* Check if this is a range download, and if so, set the internal variables properly. This code is copied from the FTP implementation and might as well be factored out. */ static CURLcode file_range(struct connectdata *conn) { curl_off_t from, to; curl_off_t totalsize=-1; char *ptr; char *ptr2; struct SessionHandle *data = conn->data; if(data->state.use_range && data->state.range) { from=curlx_strtoofft(data->state.range, &ptr, 0); while(*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->state.resume_from = from; DEBUGF(infof(data, "RANGE %" CURL_FORMAT_CURL_OFF_T " to end of file\n", from)); } else if(from < 0) { /* -Y */ data->req.maxdownload = -from; data->state.resume_from = from; DEBUGF(infof(data, "RANGE the last %" CURL_FORMAT_CURL_OFF_T " bytes\n", -from)); } else { /* X-Y */ totalsize = to-from; data->req.maxdownload = totalsize+1; /* include last byte */ data->state.resume_from = from; DEBUGF(infof(data, "RANGE from %" CURL_FORMAT_CURL_OFF_T " getting %" CURL_FORMAT_CURL_OFF_T " bytes\n", from, data->req.maxdownload)); } DEBUGF(infof(data, "range-download from %" CURL_FORMAT_CURL_OFF_T " to %" CURL_FORMAT_CURL_OFF_T ", totally %" CURL_FORMAT_CURL_OFF_T " bytes\n", from, to, data->req.maxdownload)); } else data->req.maxdownload = -1; return CURLE_OK; } /* * 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 */ static CURLcode file_connect(struct connectdata *conn, bool *done) { struct SessionHandle *data = conn->data; char *real_path; struct FILEPROTO *file = data->req.protop; int fd; #ifdef DOS_FILESYSTEM int i; char *actual_path; #endif real_path = curl_easy_unescape(data, data->state.path, 0, NULL); if(!real_path) return CURLE_OUT_OF_MEMORY; #ifdef DOS_FILESYSTEM /* 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_readonly(actual_path, O_RDONLY|O_BINARY); file->path = actual_path; #else fd = open_readonly(real_path, O_RDONLY); file->path = real_path; #endif file->freepath = real_path; /* free this when done */ file->fd = fd; if(!data->set.upload && (fd == -1)) { failf(data, "Couldn't open file %s", data->state.path); file_done(conn, CURLE_FILE_COULDNT_READ_FILE, FALSE); return CURLE_FILE_COULDNT_READ_FILE; } *done = TRUE; return CURLE_OK; } static CURLcode file_done(struct connectdata *conn, CURLcode status, bool premature) { struct FILEPROTO *file = conn->data->req.protop; (void)status; /* not used */ (void)premature; /* not used */ if(file) { Curl_safefree(file->freepath); file->path = NULL; if(file->fd != -1) close(file->fd); file->fd = -1; } return CURLE_OK; } static CURLcode file_disconnect(struct connectdata *conn, bool dead_connection) { struct FILEPROTO *file = conn->data->req.protop; (void)dead_connection; /* not used */ if(file) { Curl_safefree(file->freepath); file->path = NULL; if(file->fd != -1) close(file->fd); file->fd = -1; } return CURLE_OK; } #ifdef DOS_FILESYSTEM #define DIRSEP '\\' #else #define DIRSEP '/' #endif static CURLcode file_upload(struct connectdata *conn) { struct FILEPROTO *file = conn->data->req.protop; const char *dir = strchr(file->path, DIRSEP); int fd; int mode; 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(); struct_stat file_stat; const char* buf2; /* * Since FILE: doesn't do the full init, we need to provide some extra * assignments here. */ conn->fread_func = data->set.fread_func; conn->fread_in = data->set.in; conn->data->req.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 */ #ifdef O_BINARY #define MODE_DEFAULT O_WRONLY|O_CREAT|O_BINARY #else #define MODE_DEFAULT O_WRONLY|O_CREAT #endif if(data->state.resume_from) mode = MODE_DEFAULT|O_APPEND; else mode = MODE_DEFAULT|O_TRUNC; fd = open(file->path, mode, conn->data->set.new_file_perms); if(fd < 0) { 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); /* treat the negative resume offset value as the case of "-" */ if(data->state.resume_from < 0) { if(fstat(fd, &file_stat)) { close(fd); failf(data, "Can't get the size of %s", file->path); return CURLE_WRITE_ERROR; } else data->state.resume_from = (curl_off_t)file_stat.st_size; } 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; /*skip bytes before resume point*/ if(data->state.resume_from) { if((curl_off_t)nread <= data->state.resume_from ) { data->state.resume_from -= nread; nread = 0; buf2 = buf; } else { buf2 = buf + data->state.resume_from; nread -= (size_t)data->state.resume_from; data->state.resume_from = 0; } } else buf2 = buf; /* write the data to the target */ nwrite = write(fd, buf2, nread); 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; close(fd); return res; } /* * file_do() 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. */ static CURLcode file_do(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(); struct FILEPROTO *file; *done = TRUE; /* unconditionally */ Curl_initinfo(data); Curl_pgrsStartNow(data); if(data->set.upload) return file_upload(conn); file = conn->data->req.protop; /* get the fd from the connection phase */ fd = 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; /* and store the modification time */ data->info.filetime = (long)statbuf.st_mtime; fstated = TRUE; } if(fstated && !data->state.range && data->set.timecondition) { if(!Curl_meets_timecondition(data, (time_t)data->info.filetime)) { *done = TRUE; return CURLE_OK; } } /* 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(data->set.opt_no_body && data->set.include_header && fstated) { CURLcode result; snprintf(buf, sizeof(data->state.buffer), "Content-Length: %" CURL_FORMAT_CURL_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) { time_t filetime = (time_t)statbuf.st_mtime; struct tm buffer; const struct tm *tm = &buffer; result = Curl_gmtime(filetime, &buffer); if(result) return result; /* 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); } /* if we fstat()ed the file, set the file size to make it available post- transfer */ if(fstated) Curl_pgrsSetDownloadSize(data, expected_size); return result; } /* Check whether file range has been specified */ file_range(conn); /* Adjust the start offset in case we want to get the N last bytes * of the stream iff the filesize could be determined */ if(data->state.resume_from < 0) { if(!fstated) { failf(data, "Can't get the size of file."); return CURLE_READ_ERROR; } else data->state.resume_from += (curl_off_t)statbuf.st_size; } if(data->state.resume_from <= expected_size) expected_size -= data->state.resume_from; else { failf(data, "failed to resume file:// transfer"); return CURLE_BAD_DOWNLOAD_RESUME; } /* A high water mark has been specified so we obey... */ if(data->req.maxdownload > 0) expected_size = data->req.maxdownload; 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->state.resume_from) { if(data->state.resume_from != lseek(fd, data->state.resume_from, SEEK_SET)) return CURLE_BAD_DOWNLOAD_RESUME; } Curl_pgrsTime(data, TIMER_STARTTRANSFER); while(res == CURLE_OK) { /* Don't fill a whole buffer if we want less than all data */ size_t bytestoread = (expected_size < CURL_OFF_T_C(BUFSIZE) - CURL_OFF_T_C(1)) ? curlx_sotouz(expected_size) : BUFSIZE - 1; nread = read(fd, buf, bytestoread); if(nread > 0) buf[nread] = 0; if(nread <= 0 || expected_size == 0) break; bytecount += nread; expected_size -= 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 curl-7.35.0/lib/curl_ntlm_wb.c0000644000175000017500000002557012262353672013116 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) /* * NTLM details: * * http://davenport.sourceforge.net/ntlm.html * http://www.innovation.ch/java/ntlm.html */ #define DEBUG_ME 0 #ifdef HAVE_SYS_WAIT_H #include #endif #ifdef HAVE_SIGNAL_H #include #endif #include "urldata.h" #include "sendf.h" #include "select.h" #include "curl_ntlm_wb.h" #include "url.h" #include "strerror.h" #include "curl_memory.h" #define _MPRINTF_REPLACE /* use our functions only */ #include /* The last #include file should be: */ #include "memdebug.h" #if DEBUG_ME # define DEBUG_OUT(x) x #else # define DEBUG_OUT(x) Curl_nop_stmt #endif /* Portable 'sclose_nolog' used only in child process instead of 'sclose' to avoid fooling the socket leak detector */ #if defined(HAVE_CLOSESOCKET) # define sclose_nolog(x) closesocket((x)) #elif defined(HAVE_CLOSESOCKET_CAMEL) # define sclose_nolog(x) CloseSocket((x)) #else # define sclose_nolog(x) close((x)) #endif void Curl_ntlm_wb_cleanup(struct connectdata *conn) { if(conn->ntlm_auth_hlpr_socket != CURL_SOCKET_BAD) { sclose(conn->ntlm_auth_hlpr_socket); conn->ntlm_auth_hlpr_socket = CURL_SOCKET_BAD; } if(conn->ntlm_auth_hlpr_pid) { int i; for(i = 0; i < 4; i++) { pid_t ret = waitpid(conn->ntlm_auth_hlpr_pid, NULL, WNOHANG); if(ret == conn->ntlm_auth_hlpr_pid || errno == ECHILD) break; switch(i) { case 0: kill(conn->ntlm_auth_hlpr_pid, SIGTERM); break; case 1: /* Give the process another moment to shut down cleanly before bringing down the axe */ Curl_wait_ms(1); break; case 2: kill(conn->ntlm_auth_hlpr_pid, SIGKILL); break; case 3: break; } } conn->ntlm_auth_hlpr_pid = 0; } Curl_safefree(conn->challenge_header); conn->challenge_header = NULL; Curl_safefree(conn->response_header); conn->response_header = NULL; } static CURLcode ntlm_wb_init(struct connectdata *conn, const char *userp) { curl_socket_t sockfds[2]; pid_t child_pid; const char *username; char *slash, *domain = NULL; const char *ntlm_auth = NULL; char *ntlm_auth_alloc = NULL; int error; /* Return if communication with ntlm_auth already set up */ if(conn->ntlm_auth_hlpr_socket != CURL_SOCKET_BAD || conn->ntlm_auth_hlpr_pid) return CURLE_OK; username = userp; slash = strpbrk(username, "\\/"); if(slash) { if((domain = strdup(username)) == NULL) return CURLE_OUT_OF_MEMORY; slash = domain + (slash - username); *slash = '\0'; username = username + (slash - domain) + 1; } /* For testing purposes, when DEBUGBUILD is defined and environment variable CURL_NTLM_WB_FILE is set a fake_ntlm is used to perform NTLM challenge/response which only accepts commands and output strings pre-written in test case definitions */ #ifdef DEBUGBUILD ntlm_auth_alloc = curl_getenv("CURL_NTLM_WB_FILE"); if(ntlm_auth_alloc) ntlm_auth = ntlm_auth_alloc; else #endif ntlm_auth = NTLM_WB_FILE; if(access(ntlm_auth, X_OK) != 0) { error = ERRNO; failf(conn->data, "Could not access ntlm_auth: %s errno %d: %s", ntlm_auth, error, Curl_strerror(conn, error)); goto done; } if(socketpair(AF_UNIX, SOCK_STREAM, 0, sockfds)) { error = ERRNO; failf(conn->data, "Could not open socket pair. errno %d: %s", error, Curl_strerror(conn, error)); goto done; } child_pid = fork(); if(child_pid == -1) { error = ERRNO; sclose(sockfds[0]); sclose(sockfds[1]); failf(conn->data, "Could not fork. errno %d: %s", error, Curl_strerror(conn, error)); goto done; } else if(!child_pid) { /* * child process */ /* Don't use sclose in the child since it fools the socket leak detector */ sclose_nolog(sockfds[0]); if(dup2(sockfds[1], STDIN_FILENO) == -1) { error = ERRNO; failf(conn->data, "Could not redirect child stdin. errno %d: %s", error, Curl_strerror(conn, error)); exit(1); } if(dup2(sockfds[1], STDOUT_FILENO) == -1) { error = ERRNO; failf(conn->data, "Could not redirect child stdout. errno %d: %s", error, Curl_strerror(conn, error)); exit(1); } if(domain) execl(ntlm_auth, ntlm_auth, "--helper-protocol", "ntlmssp-client-1", "--use-cached-creds", "--username", username, "--domain", domain, NULL); else execl(ntlm_auth, ntlm_auth, "--helper-protocol", "ntlmssp-client-1", "--use-cached-creds", "--username", username, NULL); error = ERRNO; sclose_nolog(sockfds[1]); failf(conn->data, "Could not execl(). errno %d: %s", error, Curl_strerror(conn, error)); exit(1); } sclose(sockfds[1]); conn->ntlm_auth_hlpr_socket = sockfds[0]; conn->ntlm_auth_hlpr_pid = child_pid; Curl_safefree(domain); Curl_safefree(ntlm_auth_alloc); return CURLE_OK; done: Curl_safefree(domain); Curl_safefree(ntlm_auth_alloc); return CURLE_REMOTE_ACCESS_DENIED; } static CURLcode ntlm_wb_response(struct connectdata *conn, const char *input, curlntlm state) { ssize_t size; char buf[200]; /* enough, type 1, 3 message length is less then 200 */ char *tmpbuf = buf; size_t len_in = strlen(input), len_out = sizeof(buf); while(len_in > 0) { ssize_t written = swrite(conn->ntlm_auth_hlpr_socket, input, len_in); if(written == -1) { /* Interrupted by a signal, retry it */ if(errno == EINTR) continue; /* write failed if other errors happen */ goto done; } input += written; len_in -= written; } /* Read one line */ while(len_out > 0) { size = sread(conn->ntlm_auth_hlpr_socket, tmpbuf, len_out); if(size == -1) { if(errno == EINTR) continue; goto done; } else if(size == 0) goto done; else if(tmpbuf[size - 1] == '\n') { tmpbuf[size - 1] = '\0'; goto wrfinish; } tmpbuf += size; len_out -= size; } goto done; wrfinish: /* Samba/winbind installed but not configured */ if(state == NTLMSTATE_TYPE1 && size == 3 && buf[0] == 'P' && buf[1] == 'W') return CURLE_REMOTE_ACCESS_DENIED; /* invalid response */ if(size < 4) goto done; if(state == NTLMSTATE_TYPE1 && (buf[0]!='Y' || buf[1]!='R' || buf[2]!=' ')) goto done; if(state == NTLMSTATE_TYPE2 && (buf[0]!='K' || buf[1]!='K' || buf[2]!=' ') && (buf[0]!='A' || buf[1]!='F' || buf[2]!=' ')) goto done; conn->response_header = aprintf("NTLM %.*s", size - 4, buf + 3); return CURLE_OK; done: return CURLE_REMOTE_ACCESS_DENIED; } /* * This is for creating ntlm header output by delegating challenge/response * to Samba's winbind daemon helper ntlm_auth. */ CURLcode Curl_output_ntlm_wb(struct connectdata *conn, bool proxy) { /* point to the address of the pointer that holds the string to send to the server, which is for a plain host or for a HTTP proxy */ char **allocuserpwd; /* point to the name and password for this */ const char *userp; /* point to the correct struct with this */ struct ntlmdata *ntlm; struct auth *authp; CURLcode res = CURLE_OK; char *input; DEBUGASSERT(conn); DEBUGASSERT(conn->data); if(proxy) { allocuserpwd = &conn->allocptr.proxyuserpwd; userp = conn->proxyuser; ntlm = &conn->proxyntlm; authp = &conn->data->state.authproxy; } else { allocuserpwd = &conn->allocptr.userpwd; userp = conn->user; ntlm = &conn->ntlm; authp = &conn->data->state.authhost; } authp->done = FALSE; /* not set means empty */ if(!userp) userp=""; switch(ntlm->state) { case NTLMSTATE_TYPE1: default: /* Use Samba's 'winbind' daemon to support NTLM authentication, * by delegating the NTLM challenge/response protocal to a helper * in ntlm_auth. * http://devel.squid-cache.org/ntlm/squid_helper_protocol.html * http://www.samba.org/samba/docs/man/manpages-3/winbindd.8.html * http://www.samba.org/samba/docs/man/manpages-3/ntlm_auth.1.html * Preprocessor symbol 'NTLM_WB_ENABLED' is defined when this * feature is enabled and 'NTLM_WB_FILE' symbol holds absolute * filename of ntlm_auth helper. * If NTLM authentication using winbind fails, go back to original * request handling process. */ /* Create communication with ntlm_auth */ res = ntlm_wb_init(conn, userp); if(res) return res; res = ntlm_wb_response(conn, "YR\n", ntlm->state); if(res) return res; Curl_safefree(*allocuserpwd); *allocuserpwd = aprintf("%sAuthorization: %s\r\n", proxy ? "Proxy-" : "", conn->response_header); DEBUG_OUT(fprintf(stderr, "**** Header %s\n ", *allocuserpwd)); Curl_safefree(conn->response_header); conn->response_header = NULL; break; case NTLMSTATE_TYPE2: input = aprintf("TT %s\n", conn->challenge_header); if(!input) return CURLE_OUT_OF_MEMORY; res = ntlm_wb_response(conn, input, ntlm->state); free(input); input = NULL; if(res) return res; Curl_safefree(*allocuserpwd); *allocuserpwd = aprintf("%sAuthorization: %s\r\n", proxy ? "Proxy-" : "", conn->response_header); DEBUG_OUT(fprintf(stderr, "**** %s\n ", *allocuserpwd)); ntlm->state = NTLMSTATE_TYPE3; /* we sent a type-3 */ authp->done = TRUE; Curl_ntlm_wb_cleanup(conn); 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; } #endif /* USE_NTLM && NTLM_WB_ENABLED */ curl-7.35.0/lib/telnet.h0000644000175000017500000000227012213173003011677 00000000000000#ifndef HEADER_CURL_TELNET_H #define HEADER_CURL_TELNET_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2007, 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. * ***************************************************************************/ #ifndef CURL_DISABLE_TELNET extern const struct Curl_handler Curl_handler_telnet; #endif #endif /* HEADER_CURL_TELNET_H */ curl-7.35.0/lib/netrc.h0000644000175000017500000000304012262353672011533 00000000000000#ifndef HEADER_CURL_NETRC_H #define HEADER_CURL_NETRC_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ /* returns -1 on failure, 0 if the host is found, 1 is the host isn't found */ int Curl_parsenetrc(const char *host, char **loginp, char **passwordp, char *filename); /* Assume: (*passwordp)[0]=0, host[0] != 0. * If (*loginp)[0] = 0, search for login and password within a machine * section in the netrc. * If (*loginp)[0] != 0, search for password within machine and login. */ #endif /* HEADER_CURL_NETRC_H */ curl-7.35.0/lib/mk-ca-bundle.pl0000755000175000017500000002357412270035364013056 00000000000000#!/usr/bin/perl -w # *************************************************************************** # * _ _ ____ _ # * Project ___| | | | _ \| | # * / __| | | | |_) | | # * | (__| |_| | _ <| |___ # * \___|\___/|_| \_\_____| # * # * Copyright (C) 1998 - 2014, 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. # * # *************************************************************************** # This Perl script creates a fresh ca-bundle.crt file for use with libcurl. # It downloads certdata.txt from Mozilla's source tree (see URL below), # then parses certdata.txt and extracts CA Root Certificates into PEM format. # These are then processed with the OpenSSL commandline tool to produce the # final ca-bundle.crt file. # The script is based on the parse-certs script written by Roland Krikava. # This Perl script works on almost any platform since its only external # dependency is the OpenSSL commandline tool for optional text listing. # Hacked by Guenter Knauf. # use Getopt::Std; use MIME::Base64; use LWP::UserAgent; use strict; use vars qw($opt_b $opt_d $opt_f $opt_h $opt_i $opt_l $opt_n $opt_q $opt_t $opt_u $opt_v $opt_w); my %urls = ( 'nss' => 'http://mxr.mozilla.org/nss/source/lib/ckfw/builtins/certdata.txt?raw=1', 'central' => 'http://mxr.mozilla.org/mozilla-central/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1', 'aurora' => 'http://mxr.mozilla.org/mozilla-aurora/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1', 'beta' => 'http://mxr.mozilla.org/mozilla-beta/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1', 'release' => 'http://mxr.mozilla.org/mozilla-release/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1', 'mozilla' => 'http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1' ); $opt_d = 'release'; # If the OpenSSL commandline is not in search path you can configure it here! my $openssl = 'openssl'; my $version = '1.20'; $opt_w = 76; # default base64 encoded lines length $0 =~ s@.*(/|\\)@@; $Getopt::Std::STANDARD_HELP_VERSION = 1; getopts('bd:fhilnqtuvw:'); if(!defined($opt_d)) { # to make plain "-d" use not cause warnings, and actually still work $opt_d = 'release'; } # Use predefined URL or else custom URL specified on command line. my $url = ( defined( $urls{$opt_d} ) ) ? $urls{$opt_d} : $opt_d; if ($opt_i) { print ("=" x 78 . "\n"); print "Script Version : $version\n"; print "Perl Version : $]\n"; print "Operating System Name : $^O\n"; print "Getopt::Std.pm Version : ${Getopt::Std::VERSION}\n"; print "MIME::Base64.pm Version : ${MIME::Base64::VERSION}\n"; print "LWP::UserAgent.pm Version : ${LWP::UserAgent::VERSION}\n"; print "LWP.pm Version : ${LWP::VERSION}\n"; print ("=" x 78 . "\n"); } sub WARNING_MESSAGE() { if ( $opt_d =~ m/^risk$/i ) { # Long Form Warning and Exit print "Warning: Use of this script may pose some risk:\n"; print "\n"; print " 1) Using http is subject to man in the middle attack of certdata content\n"; print " 2) Default to 'release', but more recent updates may be found in other trees\n"; print " 3) certdata.txt file format may change, lag time to update this script\n"; print " 4) Generally unwise to blindly trust CAs without manual review & verification\n"; print " 5) Mozilla apps use additional security checks aren't represented in certdata\n"; print " 6) Use of this script will make a security engineer grind his teeth and\n"; print " swear at you. ;)\n"; exit; } else { # Short Form Warning print "Warning: Use of this script may pose some risk, -d risk for more details.\n"; } } sub HELP_MESSAGE() { print "Usage:\t${0} [-b] [-d] [-f] [-i] [-l] [-n] [-q] [-t] [-u] [-v] [-w] []\n"; print "\t-b\tbackup an existing version of ca-bundle.crt\n"; print "\t-d\tspecify Mozilla tree to pull certdata.txt or custom URL\n"; print "\t\t Valid names are:\n"; print "\t\t ", join( ", ", map { ( $_ =~ m/$opt_d/ ) ? "$_ (default)" : "$_" } sort keys %urls ), "\n"; print "\t-f\tforce rebuild even if certdata.txt is current\n"; print "\t-i\tprint version info about used modules\n"; print "\t-l\tprint license info about certdata.txt\n"; print "\t-n\tno download of certdata.txt (to use existing)\n"; print "\t-q\tbe really quiet (no progress output at all)\n"; print "\t-t\tinclude plain text listing of certificates\n"; print "\t-u\tunlink (remove) certdata.txt after processing\n"; print "\t-v\tbe verbose and print out processed CAs\n"; print "\t-w \twrap base64 output lines after chars (default: ${opt_w})\n"; exit; } sub VERSION_MESSAGE() { print "${0} version ${version} running Perl ${]} on ${^O}\n"; } WARNING_MESSAGE() unless ($opt_q || $url =~ m/^(ht|f)tps:/i ); HELP_MESSAGE() if ($opt_h); my $crt = $ARGV[0] || 'ca-bundle.crt'; (my $txt = $url) =~ s@(.*/|\?.*)@@g; my $stdout = $crt eq '-'; my $resp; my $fetched; unless ($opt_n and -e $txt) { print STDERR "Downloading '$txt' ...\n" if (!$opt_q); my $ua = new LWP::UserAgent(agent => "$0/$version"); $ua->env_proxy(); $resp = $ua->mirror($url, $txt); if ($resp && $resp->code eq '304') { print STDERR "Not modified\n" unless $opt_q; exit 0 if -e $crt && !$opt_f; } else { $fetched = 1; } if( !$resp || $resp->code !~ /^(?:200|304)$/ ) { print STDERR "Unable to download latest data: " . ($resp? $resp->code . ' - ' . $resp->message : "LWP failed") . "\n" unless $opt_q; exit 1 if -e $crt || ! -r $txt; } } my $currentdate = scalar gmtime($fetched ? $resp->last_modified : (stat($txt))[9]); my $format = $opt_t ? "plain text and " : ""; if( $stdout ) { open(CRT, '> -') or die "Couldn't open STDOUT: $!\n"; } else { open(CRT,">$crt.~") or die "Couldn't open $crt.~: $!\n"; } print CRT <) { if (/\*\*\*\*\* BEGIN LICENSE BLOCK \*\*\*\*\*/) { print CRT; print if ($opt_l); while () { print CRT; print if ($opt_l); last if (/\*\*\*\*\* END LICENSE BLOCK \*\*\*\*\*/); } } next if /^#|^\s*$/; chomp; if (/^CVS_ID\s+\"(.*)\"/) { print CRT "# $1\n"; } # this is a match for the start of a certificate if (/^CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE/) { $start_of_cert = 1 } if ($start_of_cert && /^CKA_LABEL UTF8 \"(.*)\"/) { $caname = $1; } my $untrusted = 1; if ($start_of_cert && /^CKA_VALUE MULTILINE_OCTAL/) { my $data; while () { last if (/^END/); chomp; my @octets = split(/\\/); shift @octets; for (@octets) { $data .= chr(oct); } } # scan forwards until the trust part while () { last if (/^CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST/); chomp; } # now scan the trust part for untrusted certs while () { last if (/^#/); if (/^CKA_TRUST_SERVER_AUTH\s+CK_TRUST\s+CKT_NSS_TRUSTED_DELEGATOR$/) { $untrusted = 0; } } if ($untrusted) { $skipnum ++; } else { my $encoded = MIME::Base64::encode_base64($data, ''); $encoded =~ s/(.{1,${opt_w}})/$1\n/g; my $pem = "-----BEGIN CERTIFICATE-----\n" . $encoded . "-----END CERTIFICATE-----\n"; print CRT "\n$caname\n"; print CRT ("=" x length($caname) . "\n"); if (!$opt_t) { print CRT $pem; } else { my $pipe = "|$openssl x509 -md5 -fingerprint -text -inform PEM"; if (!$stdout) { $pipe .= " >> $crt.~"; close(CRT) or die "Couldn't close $crt.~: $!"; } open(TMP, $pipe) or die "Couldn't open openssl pipe: $!"; print TMP $pem; close(TMP) or die "Couldn't close openssl pipe: $!"; if (!$stdout) { open(CRT, ">>$crt.~") or die "Couldn't open $crt.~: $!"; } } print STDERR "Parsing: $caname\n" if ($opt_v); $certnum ++; $start_of_cert = 0; } } } close(TXT) or die "Couldn't close $txt: $!\n"; close(CRT) or die "Couldn't close $crt.~: $!\n"; unless( $stdout ) { if ($opt_b && -e $crt) { my $bk = 1; while (-e "$crt.~${bk}~") { $bk++; } rename $crt, "$crt.~${bk}~" or die "Failed to create backup $crt.~$bk}~: $!\n"; } elsif( -e $crt ) { unlink( $crt ) or die "Failed to remove $crt: $!\n"; } rename "$crt.~", $crt or die "Failed to rename $crt.~ to $crt: $!\n"; } unlink $txt if ($opt_u); print STDERR "Done ($certnum CA certs processed, $skipnum untrusted skipped).\n" if (!$opt_q); exit; curl-7.35.0/lib/pop3.h0000644000175000017500000000771412262353672011315 00000000000000#ifndef HEADER_CURL_POP3_H #define HEADER_CURL_POP3_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2009 - 2013, 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. * ***************************************************************************/ #include "pingpong.h" /**************************************************************************** * POP3 unique setup ***************************************************************************/ typedef enum { POP3_STOP, /* do nothing state, stops the state machine */ POP3_SERVERGREET, /* waiting for the initial greeting immediately after a connect */ POP3_CAPA, POP3_STARTTLS, POP3_UPGRADETLS, /* asynchronously upgrade the connection to SSL/TLS (multi mode only) */ POP3_AUTH_PLAIN, POP3_AUTH_LOGIN, POP3_AUTH_LOGIN_PASSWD, POP3_AUTH_CRAMMD5, POP3_AUTH_DIGESTMD5, POP3_AUTH_DIGESTMD5_RESP, POP3_AUTH_NTLM, POP3_AUTH_NTLM_TYPE2MSG, POP3_AUTH_XOAUTH2, POP3_AUTH_CANCEL, POP3_AUTH_FINAL, POP3_APOP, POP3_USER, POP3_PASS, POP3_COMMAND, POP3_QUIT, POP3_LAST /* never used */ } pop3state; /* This POP3 struct is used in the SessionHandle. All POP3 data that is connection-oriented must be in pop3_conn to properly deal with the fact that perhaps the SessionHandle is changed between the times the connection is used. */ struct POP3 { curl_pp_transfer transfer; char *id; /* Message ID */ char *custom; /* Custom Request */ }; /* pop3_conn is used for struct connection-oriented data in the connectdata struct */ struct pop3_conn { struct pingpong pp; pop3state state; /* Always use pop3.c:state() to change state! */ bool ssldone; /* Is connect() over SSL done? */ size_t eob; /* Number of bytes of the EOB (End Of Body) that have been received so far */ size_t strip; /* Number of bytes from the start to ignore as non-body */ unsigned int authtypes; /* Accepted authentication types */ unsigned int authmechs; /* Accepted SASL authentication mechanisms */ unsigned int preftype; /* Preferred authentication type */ unsigned int prefmech; /* Preferred SASL authentication mechanism */ unsigned int authused; /* SASL auth mechanism used for the connection */ char *apoptimestamp; /* APOP timestamp from the server greeting */ bool tls_supported; /* StartTLS capability supported by server */ }; extern const struct Curl_handler Curl_handler_pop3; extern const struct Curl_handler Curl_handler_pop3s; /* Authentication type flags */ #define POP3_TYPE_CLEARTEXT (1 << 0) #define POP3_TYPE_APOP (1 << 1) #define POP3_TYPE_SASL (1 << 2) /* Authentication type values */ #define POP3_TYPE_NONE 0 #define POP3_TYPE_ANY ~0U /* This is the 5-bytes End-Of-Body marker for POP3 */ #define POP3_EOB "\x0d\x0a\x2e\x0d\x0a" #define POP3_EOB_LEN 5 /* This function scans the body after the end-of-body and writes everything * until the end is found */ CURLcode Curl_pop3_write(struct connectdata *conn, char *str, size_t nread); #endif /* HEADER_CURL_POP3_H */ curl-7.35.0/lib/ftplistparser.h0000644000175000017500000000317612213173003013314 00000000000000#ifndef HEADER_CURL_FTPLISTPARSER_H #define HEADER_CURL_FTPLISTPARSER_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_FTP /* WRITEFUNCTION callback for parsing LIST responses */ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr); struct ftp_parselist_data; /* defined inside ftplibparser.c */ CURLcode Curl_ftp_parselist_geterror(struct ftp_parselist_data *pl_data); struct ftp_parselist_data *Curl_ftp_parselist_data_alloc(void); void Curl_ftp_parselist_data_free(struct ftp_parselist_data **pl_data); #endif /* CURL_DISABLE_FTP */ #endif /* HEADER_CURL_FTPLISTPARSER_H */ curl-7.35.0/lib/curl_memrchr.h0000644000175000017500000000262212213173003013067 00000000000000#ifndef HEADER_CURL_MEMRCHR_H #define HEADER_CURL_MEMRCHR_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2009, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_MEMRCHR #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #else /* HAVE_MEMRCHR */ void *Curl_memrchr(const void *s, int c, size_t n); #define memrchr(x,y,z) Curl_memrchr((x),(y),(z)) #endif /* HAVE_MEMRCHR */ #endif /* HEADER_CURL_MEMRCHR_H */ curl-7.35.0/lib/curl_addrinfo.c0000644000175000017500000003261512213173003013220 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #include #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef __VMS # include # include #endif #if defined(NETWARE) && defined(__NOVELL_LIBC__) # undef in_addr_t # define in_addr_t unsigned long #endif #include "curl_addrinfo.h" #include "inet_pton.h" #include "warnless.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* * Curl_freeaddrinfo() * * This is used to free a linked list of Curl_addrinfo structs along * with all its associated allocated storage. This function should be * called once for each successful call to Curl_getaddrinfo_ex() or to * any function call which actually allocates a Curl_addrinfo struct. */ #if defined(__INTEL_COMPILER) && (__INTEL_COMPILER == 910) && \ defined(__OPTIMIZE__) && defined(__unix__) && defined(__i386__) /* workaround icc 9.1 optimizer issue */ # define vqualifier volatile #else # define vqualifier #endif void Curl_freeaddrinfo(Curl_addrinfo *cahead) { Curl_addrinfo *vqualifier canext; Curl_addrinfo *ca; for(ca = cahead; ca != NULL; ca = canext) { if(ca->ai_addr) free(ca->ai_addr); if(ca->ai_canonname) free(ca->ai_canonname); canext = ca->ai_next; free(ca); } } #ifdef HAVE_GETADDRINFO /* * Curl_getaddrinfo_ex() * * This is a wrapper function around system's getaddrinfo(), with * the only difference that instead of returning a linked list of * addrinfo structs this one returns a linked list of Curl_addrinfo * ones. The memory allocated by this function *MUST* be free'd with * Curl_freeaddrinfo(). For each successful call to this function * there must be an associated call later to Curl_freeaddrinfo(). * * There should be no single call to system's getaddrinfo() in the * whole library, any such call should be 'routed' through this one. */ int Curl_getaddrinfo_ex(const char *nodename, const char *servname, const struct addrinfo *hints, Curl_addrinfo **result) { const struct addrinfo *ai; struct addrinfo *aihead; Curl_addrinfo *cafirst = NULL; Curl_addrinfo *calast = NULL; Curl_addrinfo *ca; size_t ss_size; int error; *result = NULL; /* assume failure */ error = getaddrinfo(nodename, servname, hints, &aihead); if(error) return error; /* traverse the addrinfo list */ for(ai = aihead; ai != NULL; ai = ai->ai_next) { /* ignore elements with unsupported address family, */ /* settle family-specific sockaddr structure size. */ if(ai->ai_family == AF_INET) ss_size = sizeof(struct sockaddr_in); #ifdef ENABLE_IPV6 else if(ai->ai_family == AF_INET6) ss_size = sizeof(struct sockaddr_in6); #endif else continue; /* ignore elements without required address info */ if((ai->ai_addr == NULL) || !(ai->ai_addrlen > 0)) continue; /* ignore elements with bogus address size */ if((size_t)ai->ai_addrlen < ss_size) continue; if((ca = malloc(sizeof(Curl_addrinfo))) == NULL) { error = EAI_MEMORY; break; } /* copy each structure member individually, member ordering, */ /* size, or padding might be different for each platform. */ ca->ai_flags = ai->ai_flags; ca->ai_family = ai->ai_family; ca->ai_socktype = ai->ai_socktype; ca->ai_protocol = ai->ai_protocol; ca->ai_addrlen = (curl_socklen_t)ss_size; ca->ai_addr = NULL; ca->ai_canonname = NULL; ca->ai_next = NULL; if((ca->ai_addr = malloc(ss_size)) == NULL) { error = EAI_MEMORY; free(ca); break; } memcpy(ca->ai_addr, ai->ai_addr, ss_size); if(ai->ai_canonname != NULL) { if((ca->ai_canonname = strdup(ai->ai_canonname)) == NULL) { error = EAI_MEMORY; free(ca->ai_addr); free(ca); break; } } /* if the return list is empty, this becomes the first element */ if(!cafirst) cafirst = ca; /* add this element last in the return list */ if(calast) calast->ai_next = ca; calast = ca; } /* destroy the addrinfo list */ if(aihead) freeaddrinfo(aihead); /* if we failed, also destroy the Curl_addrinfo list */ if(error) { Curl_freeaddrinfo(cafirst); cafirst = NULL; } else if(!cafirst) { #ifdef EAI_NONAME /* rfc3493 conformant */ error = EAI_NONAME; #else /* rfc3493 obsoleted */ error = EAI_NODATA; #endif #ifdef USE_WINSOCK SET_SOCKERRNO(error); #endif } *result = cafirst; /* This is not a CURLcode */ return error; } #endif /* HAVE_GETADDRINFO */ /* * Curl_he2ai() * * This function returns a pointer to the first element of a newly allocated * Curl_addrinfo struct linked list filled with the data of a given hostent. * Curl_addrinfo is meant to work like the addrinfo struct does for a IPv6 * stack, but usable also for IPv4, all hosts and environments. * * The memory allocated by this function *MUST* be free'd later on calling * Curl_freeaddrinfo(). For each successful call to this function there * must be an associated call later to Curl_freeaddrinfo(). * * Curl_addrinfo defined in "lib/curl_addrinfo.h" * * struct Curl_addrinfo { * int ai_flags; * int ai_family; * int ai_socktype; * int ai_protocol; * curl_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; * * 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; #ifdef ENABLE_IPV6 struct sockaddr_in6 *addr6; #endif CURLcode result = CURLE_OK; int i; char *curr; if(!he) /* no input == no output! */ return NULL; DEBUGASSERT((he->h_name != NULL) && (he->h_addr_list != NULL)); for(i=0; (curr = he->h_addr_list[i]) != NULL; i++) { size_t ss_size; #ifdef ENABLE_IPV6 if(he->h_addrtype == AF_INET6) ss_size = sizeof (struct sockaddr_in6); else #endif ss_size = sizeof (struct sockaddr_in); if((ai = calloc(1, sizeof(Curl_addrinfo))) == NULL) { result = CURLE_OUT_OF_MEMORY; break; } if((ai->ai_canonname = strdup(he->h_name)) == NULL) { result = CURLE_OUT_OF_MEMORY; free(ai); break; } if((ai->ai_addr = calloc(1, ss_size)) == NULL) { result = CURLE_OUT_OF_MEMORY; free(ai->ai_canonname); free(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 = he->h_addrtype; /* 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 = (curl_socklen_t)ss_size; /* leave the rest of the struct filled with zero */ switch (ai->ai_family) { case AF_INET: addr = (void *)ai->ai_addr; /* storage area for this info */ memcpy(&addr->sin_addr, curr, sizeof(struct in_addr)); addr->sin_family = (unsigned short)(he->h_addrtype); addr->sin_port = htons((unsigned short)port); break; #ifdef ENABLE_IPV6 case AF_INET6: addr6 = (void *)ai->ai_addr; /* storage area for this info */ memcpy(&addr6->sin6_addr, curr, sizeof(struct in6_addr)); addr6->sin6_family = (unsigned short)(he->h_addrtype); addr6->sin6_port = htons((unsigned short)port); break; #endif } prevai = ai; } if(result != CURLE_OK) { Curl_freeaddrinfo(firstai); firstai = NULL; } return firstai; } struct namebuff { struct hostent hostentry; union { struct in_addr ina4; #ifdef ENABLE_IPV6 struct in6_addr ina6; #endif } addrentry; char *h_addr_list[2]; }; /* * Curl_ip2addr() * * This function takes an internet address, in binary form, as input parameter * along with its address family and the string version of the address, and it * returns a Curl_addrinfo chain filled in correctly with information for the * given address/host */ Curl_addrinfo * Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port) { Curl_addrinfo *ai; #if defined(__VMS) && \ defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64) #pragma pointer_size save #pragma pointer_size short #pragma message disable PTRMISMATCH #endif struct hostent *h; struct namebuff *buf; char *addrentry; char *hoststr; size_t addrsize; DEBUGASSERT(inaddr && hostname); buf = malloc(sizeof(struct namebuff)); if(!buf) return NULL; hoststr = strdup(hostname); if(!hoststr) { free(buf); return NULL; } switch(af) { case AF_INET: addrsize = sizeof(struct in_addr); addrentry = (void *)&buf->addrentry.ina4; memcpy(addrentry, inaddr, sizeof(struct in_addr)); break; #ifdef ENABLE_IPV6 case AF_INET6: addrsize = sizeof(struct in6_addr); addrentry = (void *)&buf->addrentry.ina6; memcpy(addrentry, inaddr, sizeof(struct in6_addr)); break; #endif default: free(hoststr); free(buf); return NULL; } h = &buf->hostentry; h->h_name = hoststr; h->h_aliases = NULL; h->h_addrtype = (short)af; h->h_length = (short)addrsize; h->h_addr_list = &buf->h_addr_list[0]; h->h_addr_list[0] = addrentry; h->h_addr_list[1] = NULL; /* terminate list of entries */ #if defined(__VMS) && \ defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64) #pragma pointer_size restore #pragma message enable PTRMISMATCH #endif ai = Curl_he2ai(h, port); free(hoststr); free(buf); return ai; } /* * Given an IPv4 or IPv6 dotted string address, this converts it to a proper * allocated Curl_addrinfo struct and returns it. */ Curl_addrinfo *Curl_str2addr(char *address, int port) { struct in_addr in; if(Curl_inet_pton(AF_INET, address, &in) > 0) /* This is a dotted IP address 123.123.123.123-style */ return Curl_ip2addr(AF_INET, &in, address, port); #ifdef ENABLE_IPV6 else { struct in6_addr in6; if(Curl_inet_pton(AF_INET6, address, &in6) > 0) /* This is a dotted IPv6 address ::1-style */ return Curl_ip2addr(AF_INET6, &in6, address, port); } #endif return NULL; /* bad input format */ } #if defined(CURLDEBUG) && defined(HAVE_FREEADDRINFO) /* * curl_dofreeaddrinfo() * * This is 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 want to include in memdebug.c */ void curl_dofreeaddrinfo(struct addrinfo *freethis, int line, const char *source) { (freeaddrinfo)(freethis); curl_memlog("ADDR %s:%d freeaddrinfo(%p)\n", source, line, (void *)freethis); } #endif /* defined(CURLDEBUG) && defined(HAVE_FREEADDRINFO) */ #if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO) /* * curl_dogetaddrinfo() * * This is 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 want to include in memdebug.c */ int curl_dogetaddrinfo(const char *hostname, const char *service, const struct addrinfo *hints, struct addrinfo **result, int line, const char *source) { int res=(getaddrinfo)(hostname, service, hints, result); if(0 == res) /* success */ curl_memlog("ADDR %s:%d getaddrinfo() = %p\n", source, line, (void *)*result); else curl_memlog("ADDR %s:%d getaddrinfo() failed\n", source, line); return res; } #endif /* defined(CURLDEBUG) && defined(HAVE_GETADDRINFO) */ curl-7.35.0/lib/parsedate.c0000644000175000017500000003772612262353672012405 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* 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 "curl_setup.h" #ifdef HAVE_LIMITS_H #include #endif #include #include "rawstr.h" #include "warnless.h" #include "parsedate.h" 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 { char name[5]; int offset; /* +/- in minutes */ }; /* * parsedate() * * Returns: * * PARSEDATE_OK - a fine conversion * PARSEDATE_FAIL - failed to convert * PARSEDATE_LATER - time overflow at the far end of time_t * PARSEDATE_SOONER - time underflow at the low end of time_t */ static int parsedate(const char *date, time_t *output); #define PARSEDATE_OK 0 #define PARSEDATE_FAIL -1 #define PARSEDATE_LATER 1 #define PARSEDATE_SOONER 2 /* 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 */ /* Next up: Military timezone names. RFC822 allowed these, but (as noted in RFC 1123) had their signs wrong. Here we use the correct signs to match actual military usage. */ {"A", +1 * 60}, /* Alpha */ {"B", +2 * 60}, /* Bravo */ {"C", +3 * 60}, /* Charlie */ {"D", +4 * 60}, /* Delta */ {"E", +5 * 60}, /* Echo */ {"F", +6 * 60}, /* Foxtrot */ {"G", +7 * 60}, /* Golf */ {"H", +8 * 60}, /* Hotel */ {"I", +9 * 60}, /* India */ /* "J", Juliet is not used as a timezone, to indicate the observer's local time */ {"K", +10 * 60}, /* Kilo */ {"L", +11 * 60}, /* Lima */ {"M", +12 * 60}, /* Mike */ {"N", -1 * 60}, /* November */ {"O", -2 * 60}, /* Oscar */ {"P", -3 * 60}, /* Papa */ {"Q", -4 * 60}, /* Quebec */ {"R", -5 * 60}, /* Romeo */ {"S", -6 * 60}, /* Sierra */ {"T", -7 * 60}, /* Tango */ {"U", -8 * 60}, /* Uniform */ {"V", -9 * 60}, /* Victor */ {"W", -10 * 60}, /* Whiskey */ {"X", -11 * 60}, /* X-ray */ {"Y", -12 * 60}, /* Yankee */ {"Z", 0}, /* Zulu, zero meridian, a.k.a. UTC */ }; /* returns: -1 no day 0 monday - 6 sunday */ static int checkday(const 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_raw_equal(check, what[0])) { found=TRUE; break; } what++; } return found?i:-1; } static int checkmonth(const char *check) { int i; const char * const *what; bool found= FALSE; what = &Curl_month[0]; for(i=0; i<12; i++) { if(Curl_raw_equal(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(const 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_raw_equal(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 }; /* this is a clone of 'struct tm' but with all fields we don't need or use cut out */ struct my_tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; }; /* struct tm to time since epoch in GMT time zone. * This is similar to the standard mktime function but for GMT only, and * doesn't suffer from the various bugs and portability problems that * some systems' implementations have. */ static time_t my_timegm(struct my_tm *tm) { static const int month_days_cumulative [12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int month, year, leap_days; if(tm->tm_year < 70) /* we don't support years before 1970 as they will cause this function to return a negative value */ return -1; year = tm->tm_year + 1900; month = tm->tm_mon; if(month < 0) { year += (11 - month) / 12; month = 11 - (11 - month) % 12; } else if(month >= 12) { year -= month / 12; month = month % 12; } leap_days = year - (tm->tm_mon <= 1); leap_days = ((leap_days / 4) - (leap_days / 100) + (leap_days / 400) - (1969 / 4) + (1969 / 100) - (1969 / 400)); return ((((time_t) (year - 1970) * 365 + leap_days + month_days_cumulative [month] + tm->tm_mday - 1) * 24 + tm->tm_hour) * 60 + tm->tm_min) * 60 + tm->tm_sec; } /* * parsedate() * * Returns: * * PARSEDATE_OK - a fine conversion * PARSEDATE_FAIL - failed to convert * PARSEDATE_LATER - time overflow at the far end of time_t * PARSEDATE_SOONER - time underflow at the low end of time_t */ static int parsedate(const char *date, time_t *output) { 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 my_tm tm; enum assume dignext = DATE_MDAY; const char *indate = date; /* save the original pointer */ int part = 0; /* max 6 parts */ 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[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]", 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 PARSEDATE_FAIL; /* 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; } else if((secnum == -1) && (2 == sscanf(date, "%02d:%02d", &hournum, &minnum))) { /* time stamp without seconds */ date += 5; secnum = 0; } else { long lval; int error; int old_errno; old_errno = ERRNO; SET_ERRNO(0); lval = strtol(date, &end, 10); error = ERRNO; if(error != old_errno) SET_ERRNO(old_errno); if(error) return PARSEDATE_FAIL; if((lval > (long)INT_MAX) || (lval < (long)INT_MIN)) return PARSEDATE_FAIL; val = curlx_sltosi(lval); if((tzoff == -1) && ((end - date) == 4) && (val <= 1400) && (indate< date) && ((date[-1] == '+' || date[-1] == '-'))) { /* four digits and a value less than or equal to 1400 (to take into account all sorts of funny time zone diffs) and it is preceded with a plus or minus. This is a time zone indication. 1400 is picked since +1300 is frequently used and +1400 is mentioned as an edge number in the document "ISO C 200X Proposal: Timezone Functions" at http://david.tribble.com/text/c0xtimezone.html If anyone has a more authoritative source for the exact maximum time zone offsets, please speak up! */ 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 PARSEDATE_FAIL; 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 PARSEDATE_FAIL; #if SIZEOF_TIME_T < 5 /* 32 bit time_t can only hold dates to the beginning of 2038 */ if(yearnum > 2037) { *output = 0x7fffffff; return PARSEDATE_LATER; } #endif if(yearnum < 1970) { *output = 0; return PARSEDATE_SOONER; } if((mdaynum > 31) || (monnum > 11) || (hournum > 23) || (minnum > 59) || (secnum > 60)) return PARSEDATE_FAIL; /* clearly an illegal date */ 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; /* my_timegm() 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 on some of the systems with 64 bit time_t mktime() returns -1 for dates beyond 03:14:07 UTC, January 19, 2038. (Such as AIX 5100-06) */ t = my_timegm(&tm); /* time zone adjust (cast t to int to compare to negative one) */ if(-1 != (int)t) { /* Add the time zone diff between local time zone and GMT. */ long delta = (long)(tzoff!=-1?tzoff:0); if((delta>0) && (t > LONG_MAX - delta)) return -1; /* time_t overflow */ t += delta; } *output = t; return PARSEDATE_OK; } time_t curl_getdate(const char *p, const time_t *now) { time_t parsed; int rc = parsedate(p, &parsed); (void)now; /* legacy argument from the past that we ignore */ switch(rc) { case PARSEDATE_OK: case PARSEDATE_LATER: case PARSEDATE_SOONER: return parsed; } /* everything else is fail */ return -1; } /* * Curl_gmtime() is a gmtime() replacement for portability. Do not use the * gmtime_r() or gmtime() functions anywhere else but here. * * To make sure no such function calls slip in, we define them to cause build * errors, which is why we use the name within parentheses in this function. * */ CURLcode Curl_gmtime(time_t intime, struct tm *store) { const struct tm *tm; #ifdef HAVE_GMTIME_R /* thread-safe version */ tm = (struct tm *)gmtime_r(&intime, store); #else tm = gmtime(&intime); if(tm) *store = *tm; /* copy the pointed struct to the local copy */ #endif if(!tm) return CURLE_BAD_FUNCTION_ARGUMENT; return CURLE_OK; } curl-7.35.0/lib/dotdot.c0000644000175000017500000001145512262353672011721 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #include "dotdot.h" #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* * "Remove Dot Segments" * http://tools.ietf.org/html/rfc3986#section-5.2.4 */ /* * Curl_dedotdotify() * * This function gets a zero-terminated path with dot and dotdot sequences * passed in and strips them off according to the rules in RFC 3986 section * 5.2.4. * * The function handles a query part ('?' + stuff) appended but it expects * that fragments ('#' + stuff) have already been cut off. * * RETURNS * * an allocated dedotdotified output string */ char *Curl_dedotdotify(char *input) { size_t inlen = strlen(input); char *clone; size_t clen = inlen; /* the length of the cloned input */ char *out = malloc(inlen+1); char *outptr; char *orgclone; char *queryp; if(!out) return NULL; /* out of memory */ /* get a cloned copy of the input */ clone = strdup(input); if(!clone) { free(out); return NULL; } orgclone = clone; outptr = out; /* * To handle query-parts properly, we must find it and remove it during the * dotdot-operation and then append it again at the end to the output * string. */ queryp = strchr(clone, '?'); if(queryp) *queryp = 0; do { /* A. If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise, */ if(!strncmp("./", clone, 2)) { clone+=2; clen-=2; } else if(!strncmp("../", clone, 3)) { clone+=3; clen-=3; } /* B. if the input buffer begins with a prefix of "/./" or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer; otherwise, */ else if(!strncmp("/./", clone, 3)) { clone+=2; clen-=2; } else if(!strcmp("/.", clone)) { clone[1]='/'; clone++; clen-=1; } /* C. if the input buffer begins with a prefix of "/../" or "/..", where ".." is a complete path segment, then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise, */ else if(!strncmp("/../", clone, 4)) { clone+=3; clen-=3; /* remove the last segment from the output buffer */ while(outptr > out) { outptr--; if(*outptr == '/') break; } *outptr = 0; /* zero-terminate where it stops */ } else if(!strcmp("/..", clone)) { clone[2]='/'; clone+=2; clen-=2; /* remove the last segment from the output buffer */ while(outptr > out) { outptr--; if(*outptr == '/') break; } *outptr = 0; /* zero-terminate where it stops */ } /* D. if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise, */ else if(!strcmp(".", clone) || !strcmp("..", clone)) { *clone=0; } else { /* E. move the first path segment in the input buffer to the end of the output buffer, including the initial "/" character (if any) and any subsequent characters up to, but not including, the next "/" character or the end of the input buffer. */ do { *outptr++ = *clone++; clen--; } while(*clone && (*clone != '/')); *outptr = 0; } } while(*clone); if(queryp) { size_t qlen; /* There was a query part, append that to the output. The 'clone' string may now have been altered so we copy from the original input string from the correct index. */ size_t oindex = queryp - orgclone; qlen = strlen(&input[oindex]); memcpy(outptr, &input[oindex], qlen+1); /* include the ending zero byte */ } free(orgclone); return out; } curl-7.35.0/lib/checksrc.pl0000755000175000017500000001303012213173003012354 00000000000000#!/usr/bin/perl #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 2011 - 2013, 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. # ########################################################################### my $max_column = 79; my $indent = 2; my $warnings; my $errors; my $file; my $dir="."; my $wlist; sub checkwarn { my ($num, $col, $file, $line, $msg, $error) = @_; my $w=$error?"error":"warning"; if($w) { $warnings++; } else { $errors++; } $col++; print "$file:$num:$col: $w: $msg\n"; print " $line\n"; if($col < 80) { my $pref = (' ' x $col); print "${pref}^\n"; } } $file = shift @ARGV; while(1) { if($file =~ /-D(.*)/) { $dir = $1; $file = shift @ARGV; next; } elsif($file =~ /-W(.*)/) { $wlist .= " $1 "; $file = shift @ARGV; next; } last; } if(!$file) { print "checksrc.pl [option] [file2] ...\n"; print " Options:\n"; print " -D[DIR] Directory to prepend file names\n"; print " -W[file] Whitelist the given file - ignore all its flaws\n"; exit; } do { if("$wlist" !~ / $file /) { my $fullname = $file; $fullname = "$dir/$file" if ($fullname !~ '^\.?\.?/'); scanfile($fullname); } $file = shift @ARGV; } while($file); sub scanfile { my ($file) = @_; my $line = 1; my $prevl; my $l; open(R, "<$file") || die "failed to open $file"; my $copyright=0; while() { chomp; my $l = $_; my $column = 0; # check for a copyright statement if(!$copyright && ($l =~ /copyright .* \d\d\d\d/i)) { $copyright=1; } # detect long lines if(length($l) > $max_column) { checkwarn($line, length($l), $file, $l, "Longer than $max_column columns"); } # detect TAB characters if($l =~ /^(.*)\t/) { checkwarn($line, length($1), $file, $l, "Contains TAB character", 1); } # detect trailing white space if($l =~ /^(.*)[ \t]+\z/) { checkwarn($line, length($1), $file, $l, "Trailing whitespace"); } # check spaces after for/if/while if($l =~ /^(.*)(for|if|while) \(/) { if($1 =~ / *\#/) { # this is a #if, treat it differently } else { checkwarn($line, length($1)+length($2), $file, $l, "$2 with space"); } } # check spaces after open paren after for/if/while if($l =~ /^(.*)(for|if|while)\( /) { if($1 =~ / *\#/) { # this is a #if, treat it differently } else { checkwarn($line, length($1)+length($2)+1, $file, $l, "$2 with space first in condition"); } } # check for "} else" if($l =~ /^(.*)\} *else/) { checkwarn($line, length($1), $file, $l, "else after closing brace on same line"); } # check for "){" if($l =~ /^(.*)\)\{/) { checkwarn($line, length($1)+1, $file, $l, "missing space after close paren"); } # scan for use of banned functions if($l =~ /^(.*\W)(sprintf|vsprintf|strcat|strncat|gets)\s*\(/) { checkwarn($line, length($1), $file, $l, "use of $2 is banned"); } # check for open brace first on line but not first column # only alert if previous line ended with a close paren and wasn't a cpp # line if((($prevl =~ /\)\z/) && ($prevl !~ /^ *#/)) && ($l =~ /^( +)\{/)) { checkwarn($line, length($1), $file, $l, "badly placed open brace"); } # if the previous line starts with if/while/for AND ends with an open # brace, check that this line is indented $indent more steps, if not # a cpp line if($prevl =~ /^( *)(if|while|for)\(.*\{\z/) { my $first = length($1); # this line has some character besides spaces if(($l !~ /^ *#/) && ($l =~ /^( *)[^ ]/)) { my $second = length($1); my $expect = $first+$indent; if($expect != $second) { my $diff = $second - $first; checkwarn($line, length($1), $file, $l, "not indented $indent steps, uses $diff)"); } } } $line++; $prevl = $l; } if(!$copyright) { checkwarn(1, 0, $file, "", "Missing copyright statement", 1); } close(R); } if($errors || $warnings) { printf "checksrc: %d errors and %d warnings\n", $errors, $warnings; exit 5; # return failure } curl-7.35.0/lib/asyn.h0000644000175000017500000001360612213173003011363 00000000000000#ifndef HEADER_CURL_ASYN_H #define HEADER_CURL_ASYN_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #include "curl_addrinfo.h" struct addrinfo; struct hostent; struct SessionHandle; struct connectdata; struct Curl_dns_entry; /* * This header defines all functions in the internal asynch resolver interface. * All asynch resolvers need to provide these functions. * asyn-ares.c and asyn-thread.c are the current implementations of asynch * resolver backends. */ /* * Curl_resolver_global_init() * * Called from curl_global_init() to initialize global resolver environment. * Returning anything else than CURLE_OK fails curl_global_init(). */ int Curl_resolver_global_init(void); /* * Curl_resolver_global_cleanup() * Called from curl_global_cleanup() to destroy global resolver environment. */ void Curl_resolver_global_cleanup(void); /* * Curl_resolver_init() * Called from curl_easy_init() -> Curl_open() to initialize resolver * URL-state specific environment ('resolver' member of the UrlState * structure). Should fill the passed pointer by the initialized handler. * Returning anything else than CURLE_OK fails curl_easy_init() with the * correspondent code. */ CURLcode Curl_resolver_init(void **resolver); /* * Curl_resolver_cleanup() * Called from curl_easy_cleanup() -> Curl_close() to cleanup resolver * URL-state specific environment ('resolver' member of the UrlState * structure). Should destroy the handler and free all resources connected to * it. */ void Curl_resolver_cleanup(void *resolver); /* * Curl_resolver_duphandle() * Called from curl_easy_duphandle() to duplicate resolver URL-state specific * environment ('resolver' member of the UrlState structure). Should * duplicate the 'from' handle and pass the resulting handle to the 'to' * pointer. Returning anything else than CURLE_OK causes failed * curl_easy_duphandle() call. */ int Curl_resolver_duphandle(void **to, void *from); /* * Curl_resolver_cancel(). * * It is called from inside other functions to cancel currently performing * resolver request. Should also free any temporary resources allocated to * perform a request. */ void Curl_resolver_cancel(struct connectdata *conn); /* Curl_resolver_getsock() * * This 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_resolver_getsock(struct connectdata *conn, curl_socket_t *sock, int numsocks); /* * Curl_resolver_is_resolved() * * 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_resolver_is_resolved(struct connectdata *conn, struct Curl_dns_entry **dns); /* * Curl_resolver_wait_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_resolver_wait_resolv(struct connectdata *conn, struct Curl_dns_entry **dnsentry); /* * Curl_resolver_getaddrinfo() - when using this resolver * * 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. * * Each resolver backend must of course make sure to return data in the * correct format to comply with this. */ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn, const char *hostname, int port, int *waitp); #ifndef CURLRES_ASYNCH /* convert these functions if an asynch resolver isn't used */ #define Curl_resolver_cancel(x) Curl_nop_stmt #define Curl_resolver_is_resolved(x,y) CURLE_COULDNT_RESOLVE_HOST #define Curl_resolver_wait_resolv(x,y) CURLE_COULDNT_RESOLVE_HOST #define Curl_resolver_getsock(x,y,z) 0 #define Curl_resolver_duphandle(x,y) CURLE_OK #define Curl_resolver_init(x) CURLE_OK #define Curl_resolver_global_init() CURLE_OK #define Curl_resolver_global_cleanup() Curl_nop_stmt #define Curl_resolver_cleanup(x) Curl_nop_stmt #endif #ifdef CURLRES_ASYNCH #define Curl_resolver_asynch() 1 #else #define Curl_resolver_asynch() 0 #endif /********** end of generic resolver interface functions *****************/ #endif /* HEADER_CURL_ASYN_H */ curl-7.35.0/lib/base64.c0000644000175000017500000001574612262353672011517 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* Base64 encoding/decoding */ #include "curl_setup.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "urldata.h" /* for the SessionHandle definition */ #include "warnless.h" #include "curl_base64.h" #include "curl_memory.h" #include "non-ascii.h" /* include memdebug.h last */ #include "memdebug.h" /* ---- Base64 Encoding/Decoding Table --- */ static const char table64[]= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static size_t decodeQuantum(unsigned char *dest, const char *src) { size_t padding = 0; const char *s, *p; unsigned long i, v, x = 0; for(i = 0, s = src; i < 4; i++, s++) { v = 0; if(*s == '=') { x = (x << 6); padding++; } else { p = table64; while(*p && (*p != *s)) { v++; p++; } if(*p == *s) x = (x << 6) + v; else return 0; } } if(padding < 1) dest[2] = curlx_ultouc(x & 0xFFUL); x >>= 8; if(padding < 2) dest[1] = curlx_ultouc(x & 0xFFUL); x >>= 8; dest[0] = curlx_ultouc(x & 0xFFUL); return 3 - padding; } /* * Curl_base64_decode() * * Given a base64 NUL-terminated string at src, decode it and return a * pointer in *outptr to a newly allocated memory area holding decoded * data. Size of decoded data is returned in variable pointed by outlen. * * Returns CURLE_OK on success, otherwise specific error code. Function * output shall not be considered valid unless CURLE_OK is returned. * * When decoded data length is 0, returns NULL in *outptr. * * @unittest: 1302 */ CURLcode Curl_base64_decode(const char *src, unsigned char **outptr, size_t *outlen) { size_t srclen = 0; size_t length = 0; size_t padding = 0; size_t i; size_t result; size_t numQuantums; size_t rawlen = 0; unsigned char *pos; unsigned char *newstr; *outptr = NULL; *outlen = 0; srclen = strlen(src); /* Check the length of the input string is valid */ if(!srclen || srclen % 4) return CURLE_BAD_CONTENT_ENCODING; /* Find the position of any = padding characters */ while((src[length] != '=') && src[length]) length++; /* A maximum of two = padding characters is allowed */ if(src[length] == '=') { padding++; if(src[length + 1] == '=') padding++; } /* Check the = padding characters weren't part way through the input */ if(length + padding != srclen) return CURLE_BAD_CONTENT_ENCODING; /* Calculate the number of quantums */ numQuantums = srclen / 4; /* Calculate the size of the decoded string */ rawlen = (numQuantums * 3) - padding; /* Allocate our buffer including room for a zero terminator */ newstr = malloc(rawlen + 1); if(!newstr) return CURLE_OUT_OF_MEMORY; pos = newstr; /* Decode the quantums */ for(i = 0; i < numQuantums; i++) { result = decodeQuantum(pos, src); if(!result) { Curl_safefree(newstr); return CURLE_BAD_CONTENT_ENCODING; } pos += result; src += 4; } /* Zero terminate */ *pos = '\0'; /* Return the decoded data */ *outptr = newstr; *outlen = rawlen; return CURLE_OK; } /* * Curl_base64_encode() * * Given a pointer to an input buffer and an input size, encode it and * return a pointer in *outptr to a newly allocated memory area holding * encoded data. Size of encoded data is returned in variable pointed by * outlen. * * Input length of 0 indicates input buffer holds a NUL-terminated string. * * Returns CURLE_OK on success, otherwise specific error code. Function * output shall not be considered valid unless CURLE_OK is returned. * * When encoded data length is 0, returns NULL in *outptr. * * @unittest: 1302 */ CURLcode Curl_base64_encode(struct SessionHandle *data, const char *inputbuff, size_t insize, char **outptr, size_t *outlen) { CURLcode error; unsigned char ibuf[3]; unsigned char obuf[4]; int i; int inputparts; char *output; char *base64data; char *convbuf = NULL; const char *indata = inputbuff; *outptr = NULL; *outlen = 0; if(0 == insize) insize = strlen(indata); base64data = output = malloc(insize*4/3+4); if(NULL == output) return CURLE_OUT_OF_MEMORY; /* * The base64 data needs to be created using the network encoding * not the host encoding. And we can't change the actual input * so we copy it to a buffer, translate it, and use that instead. */ error = Curl_convert_clone(data, indata, insize, &convbuf); if(error) { free(output); return error; } if(convbuf) indata = (char *)convbuf; while(insize > 0) { for(i = inputparts = 0; i < 3; i++) { if(insize > 0) { inputparts++; ibuf[i] = (unsigned char) *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; /* return pointer to new data, allocated memory */ if(convbuf) free(convbuf); *outlen = strlen(base64data); /* return the length of the new data */ return CURLE_OK; } /* ---- End of Base64 Encoding ---- */ curl-7.35.0/lib/curl_md5.h0000644000175000017500000000470112213173003012117 00000000000000#ifndef HEADER_CURL_MD5_H #define HEADER_CURL_MD5_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ #ifndef CURL_DISABLE_CRYPTO_AUTH #include "curl_hmac.h" #define MD5_DIGEST_LEN 16 typedef void (* Curl_MD5_init_func)(void *context); typedef void (* Curl_MD5_update_func)(void *context, const unsigned char *data, unsigned int len); typedef void (* Curl_MD5_final_func)(unsigned char *result, void *context); typedef struct { Curl_MD5_init_func md5_init_func; /* Initialize context procedure */ Curl_MD5_update_func md5_update_func; /* Update context with data */ Curl_MD5_final_func md5_final_func; /* Get final result procedure */ unsigned int md5_ctxtsize; /* Context structure size */ unsigned int md5_resultlen; /* Result length (bytes) */ } MD5_params; typedef struct { const MD5_params *md5_hash; /* Hash function definition */ void *md5_hashctx; /* Hash function context */ } MD5_context; extern const MD5_params Curl_DIGEST_MD5[1]; extern const HMAC_params Curl_HMAC_MD5[1]; void Curl_md5it(unsigned char *output, const unsigned char *input); MD5_context * Curl_MD5_init(const MD5_params *md5params); int Curl_MD5_update(MD5_context *context, const unsigned char *data, unsigned int len); int Curl_MD5_final(MD5_context *context, unsigned char *result); #endif #endif /* HEADER_CURL_MD5_H */ curl-7.35.0/lib/formdata.c0000644000175000017500000013256412262353672012226 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #include #if !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY) #if defined(HAVE_LIBGEN_H) && defined(HAVE_BASENAME) #include #endif #include "urldata.h" /* for struct SessionHandle */ #include "formdata.h" #include "vtls/vtls.h" #include "strequal.h" #include "curl_memory.h" #include "sendf.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 #ifndef HAVE_BASENAME static char *Curl_basename(char *path); #define basename(x) Curl_basename((x)) #endif static size_t readfromfile(struct Form *form, char *buffer, size_t size); static char *formboundary(struct SessionHandle *data); /* 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, char *userp, struct curl_httppost *parent_post, struct curl_httppost **httppost, struct curl_httppost **last_post) { struct curl_httppost *post; post = calloc(1, sizeof(struct curl_httppost)); 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->userp = userp, 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 = calloc(1, sizeof(struct FormInfo)); if(form_info) { 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; } 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"}, {".xml", "application/xml"} }; if(prevtype) /* default to the previously set/used! */ contenttype = prevtype; else contenttype = HTTPPOST_CONTENTTYPE_DEFAULT; if(filename) { /* in case a NULL was passed in */ 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 if(src) { length = strlen(src); add = TRUE; } else /* no length and a NULL src pointer! */ return strdup(""); buffer = 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 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 = calloc(1, sizeof(struct FormInfo)); 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 && forms) { /* 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: #ifdef CURL_DOES_CONVERSIONS /* Treat CURLFORM_PTR like CURLFORM_COPYNAME so that libcurl will copy * the data in all cases so that we'll have safe memory for the eventual * conversion. */ #else current_form->flags |= HTTPPOST_PTRNAME; /* fall through */ #endif 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?(size_t)array_value:(size_t)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?(size_t)array_value:(size_t)va_arg(params, long); break; /* Get contents from a given file name */ case CURLFORM_FILECONTENT: if(current_form->flags & (HTTPPOST_PTRCONTENTS|HTTPPOST_READFILE)) return_value = CURL_FORMADD_OPTION_TWICE; else { const 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: { const char *filename = array_state?array_value: va_arg(params, char *); if(current_form->value) { if(current_form->flags & HTTPPOST_FILENAME) { if(filename) { char *fname = strdup(filename); if(!fname) return_value = CURL_FORMADD_MEMORY; else { form = AddFormInfo(fname, NULL, current_form); if(!form) { Curl_safefree(fname); return_value = CURL_FORMADD_MEMORY; } else { form->value_alloc = TRUE; current_form = form; form = NULL; } } } 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_BUFFERPTR: current_form->flags |= HTTPPOST_PTRBUFFER|HTTPPOST_BUFFER; 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 */ current_form->value = buffer; /* make it non-NULL to be accepted as fine */ } 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?(size_t)array_value:(size_t)va_arg(params, long); break; case CURLFORM_STREAM: current_form->flags |= HTTPPOST_CALLBACK; if(current_form->userp) return_value = CURL_FORMADD_OPTION_TWICE; else { char *userp = array_state?array_value:va_arg(params, char *); if(userp) { current_form->userp = userp; current_form->value = userp; /* this isn't strictly true but we derive a value from this later on and we need this non-NULL to be accepted as a fine form part */ } else return_value = CURL_FORMADD_NULL; } break; case CURLFORM_CONTENTTYPE: { const char *contenttype = array_state?array_value:va_arg(params, char *); if(current_form->contenttype) { if(current_form->flags & HTTPPOST_FILENAME) { if(contenttype) { char *type = strdup(contenttype); if(!type) return_value = CURL_FORMADD_MEMORY; else { form = AddFormInfo(NULL, type, current_form); if(!form) { Curl_safefree(type); return_value = CURL_FORMADD_MEMORY; } else { form->contenttype_alloc = TRUE; current_form = form; form = NULL; } } } 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: case CURLFORM_BUFFER: { const 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; break; } } if(CURL_FORMADD_OK != return_value) { /* On error, free allocated fields for all nodes of the FormInfo linked list without deallocating nodes. List nodes are deallocated later on */ FormInfo *ptr; for(ptr = first_form; ptr != NULL; ptr = ptr->more) { if(ptr->name_alloc) { Curl_safefree(ptr->name); ptr->name_alloc = FALSE; } if(ptr->value_alloc) { Curl_safefree(ptr->value); ptr->value_alloc = FALSE; } if(ptr->contenttype_alloc) { Curl_safefree(ptr->contenttype); ptr->contenttype_alloc = FALSE; } if(ptr->showfilename_alloc) { Curl_safefree(ptr->showfilename); ptr->showfilename_alloc = FALSE; } } } if(CURL_FORMADD_OK == return_value) { /* go through the list, check for completeness 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 ) { char *f = form->flags & HTTPPOST_BUFFER? form->showfilename : form->value; /* our contenttype is missing */ form->contenttype = strdup(ContentTypeForFilename(f, prevtype)); if(!form->contenttype) { return_value = CURL_FORMADD_MEMORY; break; } form->contenttype_alloc = TRUE; } if(!(form->flags & HTTPPOST_PTRNAME) && (form == first_form) ) { /* Note that there's small risk that form->name is NULL here if the app passed in a bad combo, so we better check for that first. */ if(form->name) /* 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 | HTTPPOST_READFILE | HTTPPOST_PTRCONTENTS | HTTPPOST_PTRBUFFER | HTTPPOST_CALLBACK)) ) { /* 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, form->userp, post, httppost, last_post); if(!post) { return_value = CURL_FORMADD_MEMORY; break; } if(form->contenttype) prevtype = form->contenttype; } } if(CURL_FORMADD_OK != return_value) { /* On error, free allocated fields for nodes of the FormInfo linked list which are not already owned by the httppost linked list without deallocating nodes. List nodes are deallocated later on */ FormInfo *ptr; for(ptr = form; ptr != NULL; ptr = ptr->more) { if(ptr->name_alloc) { Curl_safefree(ptr->name); ptr->name_alloc = FALSE; } if(ptr->value_alloc) { Curl_safefree(ptr->value); ptr->value_alloc = FALSE; } if(ptr->contenttype_alloc) { Curl_safefree(ptr->contenttype); ptr->contenttype_alloc = FALSE; } if(ptr->showfilename_alloc) { Curl_safefree(ptr->showfilename); ptr->showfilename_alloc = FALSE; } } } } /* Always deallocate FormInfo linked list nodes without touching node fields given that these have either been deallocated or are owned now by the httppost linked list */ while(first_form) { FormInfo *ptr = first_form->more; Curl_safefree(first_form); first_form = ptr; } return return_value; } /* * curl_formadd() is a public API to add a section to the multipart formpost. * * @unittest: 1308 */ 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; } #ifdef __VMS #include /* * get_vms_file_size does what it takes to get the real size of the file * * For fixed files, find out the size of the EOF block and adjust. * * For all others, have to read the entire file in, discarding the contents. * Most posted text files will be small, and binary files like zlib archives * and CD/DVD images should be either a STREAM_LF format or a fixed format. * */ curl_off_t VmsRealFileSize(const char * name, const struct_stat * stat_buf) { char buffer[8192]; curl_off_t count; int ret_stat; FILE * file; file = fopen(name, "r"); if(file == NULL) return 0; count = 0; ret_stat = 1; while(ret_stat > 0) { ret_stat = fread(buffer, 1, sizeof(buffer), file); if(ret_stat != 0) count += ret_stat; } fclose(file); return count; } /* * * VmsSpecialSize checks to see if the stat st_size can be trusted and * if not to call a routine to get the correct size. * */ static curl_off_t VmsSpecialSize(const char * name, const struct_stat * stat_buf) { switch(stat_buf->st_fab_rfm) { case FAB$C_VAR: case FAB$C_VFC: return VmsRealFileSize(name, stat_buf); break; default: return stat_buf->st_size; } } #endif #ifndef __VMS #define filesize(name, stat_data) (stat_data.st_size) #else /* Getting the expected file size needs help on VMS */ #define filesize(name, stat_data) VmsSpecialSize(name, &stat_data) #endif /* * 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 = malloc(sizeof(struct FormData)); if(!newform) return CURLE_OUT_OF_MEMORY; newform->next = NULL; if(type <= FORM_CONTENT) { /* we make it easier for plain strings: */ if(!length) length = strlen((char *)line); newform->line = 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 */ } else /* For callbacks and files we don't have any actual data so we just keep a pointer to whatever this points to */ newform->line = (char *)line; newform->type = type; if(*formp) { (*formp)->next = newform; *formp = newform; } else *formp = newform; if(size) { if(type != FORM_FILE) /* for static content as well as callback data we add the size given as input argument */ *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) && !S_ISDIR(file.st_mode)) *size += filesize(newform->line, file); else return CURLE_BAD_FUNCTION_ARGUMENT; } } } 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_ptr) { struct FormData *next, *form; form = *form_ptr; if(!form) return; do { next=form->next; /* the following form line */ if(form->type <= FORM_CONTENT) free(form->line); /* free the line */ free(form); /* free the struct */ } while((form = next) != NULL); /* continue */ *form_ptr = NULL; } /* * curl_formget() * Serialize a curl_httppost struct. * Returns 0 on success. * * @unittest: 1308 */ 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(NULL, &data, form, NULL, &size); if(rc != CURLE_OK) return (int)rc; for(ptr = data; ptr; ptr = ptr->next) { if((ptr->type == FORM_FILE) || (ptr->type == FORM_CALLBACK)) { char buffer[8192]; size_t nread; struct Form temp; Curl_FormInit(&temp, ptr); do { nread = readfromfile(&temp, buffer, sizeof(buffer)); if((nread == (size_t) -1) || (nread > sizeof(buffer)) || (nread != append(arg, buffer, nread))) { if(temp.fp) fclose(temp.fp); Curl_formclean(&data); return -1; } } while(nread); } 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|HTTPPOST_BUFFER|HTTPPOST_CALLBACK)) && 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 *Curl_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(const 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 or NULL ! */ } static CURLcode formdata_add_filename(const struct curl_httppost *file, struct FormData **form, curl_off_t *size) { CURLcode result = CURLE_OK; char *filename = file->showfilename; char *filebasename = NULL; char *filename_escaped = NULL; if(!filename) { filebasename = strippath(file->contents); if(!filebasename) return CURLE_OUT_OF_MEMORY; filename = filebasename; } if(strchr(filename, '\\') || strchr(filename, '"')) { char *p0, *p1; /* filename need be escaped */ filename_escaped = malloc(strlen(filename)*2+1); if(!filename_escaped) return CURLE_OUT_OF_MEMORY; p0 = filename_escaped; p1 = filename; while(*p1) { if(*p1 == '\\' || *p1 == '"') *p0++ = '\\'; *p0++ = *p1++; } *p0 = '\0'; filename = filename_escaped; } result = AddFormDataf(form, size, "; filename=\"%s\"", filename); Curl_safefree(filename_escaped); Curl_safefree(filebasename); return result; } /* * 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'. * * This function will not do a failf() for the potential memory failures but * should for all other errors it spots. Just note that this function MAY get * a NULL pointer in the 'data' argument. */ CURLcode Curl_getformdata(struct SessionHandle *data, 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 = formboundary(data); 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) { Curl_safefree(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 */ Curl_safefree(fileboundary); fileboundary = formboundary(data); if(!fileboundary) { result = CURLE_OUT_OF_MEMORY; break; } 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 */ result = AddFormDataf(&form, &size, "\r\n--%s\r\nContent-Disposition: " "attachment", fileboundary); if(result) break; result = formdata_add_filename(file, &form, &size); if(result) break; } else if(post->flags & (HTTPPOST_FILENAME|HTTPPOST_BUFFER| HTTPPOST_CALLBACK)) { /* it should be noted that for the HTTPPOST_FILENAME and HTTPPOST_CALLBACK cases the ->showfilename struct member is always assigned at this point */ if(post->showfilename || (post->flags & HTTPPOST_FILENAME)) { result = formdata_add_filename(post, &form, &size); } 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) break; 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 */ 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_CONTENT, buffer, nread, &size); if(result) break; } } } else { if(data) failf(data, "couldn't open file \"%s\"", file->contents); *finalform = NULL; result = CURLE_READ_ERROR; } } else if(post->flags & HTTPPOST_BUFFER) /* include contents of buffer */ result = AddFormData(&form, FORM_CONTENT, post->buffer, post->bufferlength, &size); else if(post->flags & HTTPPOST_CALLBACK) /* the contents should be read with the callback and the size is set with the contentslength */ result = AddFormData(&form, FORM_CALLBACK, post->userp, post->contentslength, &size); else /* include the contents we got */ result = AddFormData(&form, FORM_CONTENT, post->contents, post->contentslength, &size); file = file->more; } while(file && !result); /* for each specified file for this field */ if(result) break; if(post->more) { /* this was a multiple-file inclusion, make a termination file boundary: */ result = AddFormDataf(&form, &size, "\r\n--%s--", fileboundary); if(result) break; } } while((post = post->next) != NULL); /* for each field */ /* end-boundary for everything */ if(CURLE_OK == result) result = AddFormDataf(&form, &size, "\r\n--%s--\r\n", boundary); if(result) { Curl_formclean(&firstform); Curl_safefree(fileboundary); Curl_safefree(boundary); return result; } *sizep = size; Curl_safefree(fileboundary); Curl_safefree(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; form->fread_func = ZERO_NULL; return 0; } #ifndef __VMS # define fopen_read fopen #else /* * vmsfopenread * * For upload to work as expected on VMS, different optional * parameters must be added to the fopen command based on * record format of the file. * */ # define fopen_read vmsfopenread static FILE * vmsfopenread(const char *file, const char *mode) { struct_stat statbuf; int result; result = stat(file, &statbuf); switch (statbuf.st_fab_rfm) { case FAB$C_VAR: case FAB$C_VFC: case FAB$C_STMCR: return fopen(file, "r"); break; default: return fopen(file, "r", "rfm=stmlf", "ctx=stm"); } } #endif /* * readfromfile() * * The read callback that this function may use can return a value larger than * 'size' (which then this function returns) that indicates a problem and it * must be properly dealt with */ static size_t readfromfile(struct Form *form, char *buffer, size_t size) { size_t nread; bool callback = (form->data->type == FORM_CALLBACK)?TRUE:FALSE; if(callback) { if(form->fread_func == ZERO_NULL) return 0; else nread = form->fread_func(buffer, 1, size, form->data->line); } else { if(!form->fp) { /* this file hasn't yet been opened */ form->fp = fopen_read(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) { /* this is the last chunk from the file, move on */ if(form->fp) { 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) || (form->data->type == FORM_CALLBACK)) { 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_CALLBACK)); /* 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. */ 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; } /* * formboundary() creates a suitable boundary string and returns an allocated * one. */ static char *formboundary(struct SessionHandle *data) { /* 24 dashes and 16 hexadecimal digits makes 64 bit (18446744073709551615) combinations */ return aprintf("------------------------%08x%08x", Curl_rand(data), Curl_rand(data)); } #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 /* !defined(CURL_DISABLE_HTTP) */ curl-7.35.0/lib/curl_sspi.h0000644000175000017500000002422312213173003012411 00000000000000#ifndef HEADER_CURL_SSPI_H #define HEADER_CURL_SSPI_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_WINDOWS_SSPI #include /* * When including the following three headers, it is mandatory to define either * SECURITY_WIN32 or SECURITY_KERNEL, indicating who is compiling the code. */ #undef SECURITY_WIN32 #undef SECURITY_KERNEL #define SECURITY_WIN32 1 #include #include #include CURLcode Curl_sspi_global_init(void); void Curl_sspi_global_cleanup(void); /* Forward-declaration of global variables defined in curl_sspi.c */ extern HMODULE s_hSecDll; extern PSecurityFunctionTable s_pSecFn; /* Provide some definitions missing in old headers */ #ifndef SEC_E_INSUFFICIENT_MEMORY # define SEC_E_INSUFFICIENT_MEMORY ((HRESULT)0x80090300L) #endif #ifndef SEC_E_INVALID_HANDLE # define SEC_E_INVALID_HANDLE ((HRESULT)0x80090301L) #endif #ifndef SEC_E_UNSUPPORTED_FUNCTION # define SEC_E_UNSUPPORTED_FUNCTION ((HRESULT)0x80090302L) #endif #ifndef SEC_E_TARGET_UNKNOWN # define SEC_E_TARGET_UNKNOWN ((HRESULT)0x80090303L) #endif #ifndef SEC_E_INTERNAL_ERROR # define SEC_E_INTERNAL_ERROR ((HRESULT)0x80090304L) #endif #ifndef SEC_E_SECPKG_NOT_FOUND # define SEC_E_SECPKG_NOT_FOUND ((HRESULT)0x80090305L) #endif #ifndef SEC_E_NOT_OWNER # define SEC_E_NOT_OWNER ((HRESULT)0x80090306L) #endif #ifndef SEC_E_CANNOT_INSTALL # define SEC_E_CANNOT_INSTALL ((HRESULT)0x80090307L) #endif #ifndef SEC_E_INVALID_TOKEN # define SEC_E_INVALID_TOKEN ((HRESULT)0x80090308L) #endif #ifndef SEC_E_CANNOT_PACK # define SEC_E_CANNOT_PACK ((HRESULT)0x80090309L) #endif #ifndef SEC_E_QOP_NOT_SUPPORTED # define SEC_E_QOP_NOT_SUPPORTED ((HRESULT)0x8009030AL) #endif #ifndef SEC_E_NO_IMPERSONATION # define SEC_E_NO_IMPERSONATION ((HRESULT)0x8009030BL) #endif #ifndef SEC_E_LOGON_DENIED # define SEC_E_LOGON_DENIED ((HRESULT)0x8009030CL) #endif #ifndef SEC_E_UNKNOWN_CREDENTIALS # define SEC_E_UNKNOWN_CREDENTIALS ((HRESULT)0x8009030DL) #endif #ifndef SEC_E_NO_CREDENTIALS # define SEC_E_NO_CREDENTIALS ((HRESULT)0x8009030EL) #endif #ifndef SEC_E_MESSAGE_ALTERED # define SEC_E_MESSAGE_ALTERED ((HRESULT)0x8009030FL) #endif #ifndef SEC_E_OUT_OF_SEQUENCE # define SEC_E_OUT_OF_SEQUENCE ((HRESULT)0x80090310L) #endif #ifndef SEC_E_NO_AUTHENTICATING_AUTHORITY # define SEC_E_NO_AUTHENTICATING_AUTHORITY ((HRESULT)0x80090311L) #endif #ifndef SEC_E_BAD_PKGID # define SEC_E_BAD_PKGID ((HRESULT)0x80090316L) #endif #ifndef SEC_E_CONTEXT_EXPIRED # define SEC_E_CONTEXT_EXPIRED ((HRESULT)0x80090317L) #endif #ifndef SEC_E_INCOMPLETE_MESSAGE # define SEC_E_INCOMPLETE_MESSAGE ((HRESULT)0x80090318L) #endif #ifndef SEC_E_INCOMPLETE_CREDENTIALS # define SEC_E_INCOMPLETE_CREDENTIALS ((HRESULT)0x80090320L) #endif #ifndef SEC_E_BUFFER_TOO_SMALL # define SEC_E_BUFFER_TOO_SMALL ((HRESULT)0x80090321L) #endif #ifndef SEC_E_WRONG_PRINCIPAL # define SEC_E_WRONG_PRINCIPAL ((HRESULT)0x80090322L) #endif #ifndef SEC_E_TIME_SKEW # define SEC_E_TIME_SKEW ((HRESULT)0x80090324L) #endif #ifndef SEC_E_UNTRUSTED_ROOT # define SEC_E_UNTRUSTED_ROOT ((HRESULT)0x80090325L) #endif #ifndef SEC_E_ILLEGAL_MESSAGE # define SEC_E_ILLEGAL_MESSAGE ((HRESULT)0x80090326L) #endif #ifndef SEC_E_CERT_UNKNOWN # define SEC_E_CERT_UNKNOWN ((HRESULT)0x80090327L) #endif #ifndef SEC_E_CERT_EXPIRED # define SEC_E_CERT_EXPIRED ((HRESULT)0x80090328L) #endif #ifndef SEC_E_ENCRYPT_FAILURE # define SEC_E_ENCRYPT_FAILURE ((HRESULT)0x80090329L) #endif #ifndef SEC_E_DECRYPT_FAILURE # define SEC_E_DECRYPT_FAILURE ((HRESULT)0x80090330L) #endif #ifndef SEC_E_ALGORITHM_MISMATCH # define SEC_E_ALGORITHM_MISMATCH ((HRESULT)0x80090331L) #endif #ifndef SEC_E_SECURITY_QOS_FAILED # define SEC_E_SECURITY_QOS_FAILED ((HRESULT)0x80090332L) #endif #ifndef SEC_E_UNFINISHED_CONTEXT_DELETED # define SEC_E_UNFINISHED_CONTEXT_DELETED ((HRESULT)0x80090333L) #endif #ifndef SEC_E_NO_TGT_REPLY # define SEC_E_NO_TGT_REPLY ((HRESULT)0x80090334L) #endif #ifndef SEC_E_NO_IP_ADDRESSES # define SEC_E_NO_IP_ADDRESSES ((HRESULT)0x80090335L) #endif #ifndef SEC_E_WRONG_CREDENTIAL_HANDLE # define SEC_E_WRONG_CREDENTIAL_HANDLE ((HRESULT)0x80090336L) #endif #ifndef SEC_E_CRYPTO_SYSTEM_INVALID # define SEC_E_CRYPTO_SYSTEM_INVALID ((HRESULT)0x80090337L) #endif #ifndef SEC_E_MAX_REFERRALS_EXCEEDED # define SEC_E_MAX_REFERRALS_EXCEEDED ((HRESULT)0x80090338L) #endif #ifndef SEC_E_MUST_BE_KDC # define SEC_E_MUST_BE_KDC ((HRESULT)0x80090339L) #endif #ifndef SEC_E_STRONG_CRYPTO_NOT_SUPPORTED # define SEC_E_STRONG_CRYPTO_NOT_SUPPORTED ((HRESULT)0x8009033AL) #endif #ifndef SEC_E_TOO_MANY_PRINCIPALS # define SEC_E_TOO_MANY_PRINCIPALS ((HRESULT)0x8009033BL) #endif #ifndef SEC_E_NO_PA_DATA # define SEC_E_NO_PA_DATA ((HRESULT)0x8009033CL) #endif #ifndef SEC_E_PKINIT_NAME_MISMATCH # define SEC_E_PKINIT_NAME_MISMATCH ((HRESULT)0x8009033DL) #endif #ifndef SEC_E_SMARTCARD_LOGON_REQUIRED # define SEC_E_SMARTCARD_LOGON_REQUIRED ((HRESULT)0x8009033EL) #endif #ifndef SEC_E_SHUTDOWN_IN_PROGRESS # define SEC_E_SHUTDOWN_IN_PROGRESS ((HRESULT)0x8009033FL) #endif #ifndef SEC_E_KDC_INVALID_REQUEST # define SEC_E_KDC_INVALID_REQUEST ((HRESULT)0x80090340L) #endif #ifndef SEC_E_KDC_UNABLE_TO_REFER # define SEC_E_KDC_UNABLE_TO_REFER ((HRESULT)0x80090341L) #endif #ifndef SEC_E_KDC_UNKNOWN_ETYPE # define SEC_E_KDC_UNKNOWN_ETYPE ((HRESULT)0x80090342L) #endif #ifndef SEC_E_UNSUPPORTED_PREAUTH # define SEC_E_UNSUPPORTED_PREAUTH ((HRESULT)0x80090343L) #endif #ifndef SEC_E_DELEGATION_REQUIRED # define SEC_E_DELEGATION_REQUIRED ((HRESULT)0x80090345L) #endif #ifndef SEC_E_BAD_BINDINGS # define SEC_E_BAD_BINDINGS ((HRESULT)0x80090346L) #endif #ifndef SEC_E_MULTIPLE_ACCOUNTS # define SEC_E_MULTIPLE_ACCOUNTS ((HRESULT)0x80090347L) #endif #ifndef SEC_E_NO_KERB_KEY # define SEC_E_NO_KERB_KEY ((HRESULT)0x80090348L) #endif #ifndef SEC_E_CERT_WRONG_USAGE # define SEC_E_CERT_WRONG_USAGE ((HRESULT)0x80090349L) #endif #ifndef SEC_E_DOWNGRADE_DETECTED # define SEC_E_DOWNGRADE_DETECTED ((HRESULT)0x80090350L) #endif #ifndef SEC_E_SMARTCARD_CERT_REVOKED # define SEC_E_SMARTCARD_CERT_REVOKED ((HRESULT)0x80090351L) #endif #ifndef SEC_E_ISSUING_CA_UNTRUSTED # define SEC_E_ISSUING_CA_UNTRUSTED ((HRESULT)0x80090352L) #endif #ifndef SEC_E_REVOCATION_OFFLINE_C # define SEC_E_REVOCATION_OFFLINE_C ((HRESULT)0x80090353L) #endif #ifndef SEC_E_PKINIT_CLIENT_FAILURE # define SEC_E_PKINIT_CLIENT_FAILURE ((HRESULT)0x80090354L) #endif #ifndef SEC_E_SMARTCARD_CERT_EXPIRED # define SEC_E_SMARTCARD_CERT_EXPIRED ((HRESULT)0x80090355L) #endif #ifndef SEC_E_NO_S4U_PROT_SUPPORT # define SEC_E_NO_S4U_PROT_SUPPORT ((HRESULT)0x80090356L) #endif #ifndef SEC_E_CROSSREALM_DELEGATION_FAILURE # define SEC_E_CROSSREALM_DELEGATION_FAILURE ((HRESULT)0x80090357L) #endif #ifndef SEC_E_REVOCATION_OFFLINE_KDC # define SEC_E_REVOCATION_OFFLINE_KDC ((HRESULT)0x80090358L) #endif #ifndef SEC_E_ISSUING_CA_UNTRUSTED_KDC # define SEC_E_ISSUING_CA_UNTRUSTED_KDC ((HRESULT)0x80090359L) #endif #ifndef SEC_E_KDC_CERT_EXPIRED # define SEC_E_KDC_CERT_EXPIRED ((HRESULT)0x8009035AL) #endif #ifndef SEC_E_KDC_CERT_REVOKED # define SEC_E_KDC_CERT_REVOKED ((HRESULT)0x8009035BL) #endif #ifndef SEC_E_INVALID_PARAMETER # define SEC_E_INVALID_PARAMETER ((HRESULT)0x8009035DL) #endif #ifndef SEC_E_DELEGATION_POLICY # define SEC_E_DELEGATION_POLICY ((HRESULT)0x8009035EL) #endif #ifndef SEC_E_POLICY_NLTM_ONLY # define SEC_E_POLICY_NLTM_ONLY ((HRESULT)0x8009035FL) #endif #ifndef SEC_I_CONTINUE_NEEDED # define SEC_I_CONTINUE_NEEDED ((HRESULT)0x00090312L) #endif #ifndef SEC_I_COMPLETE_NEEDED # define SEC_I_COMPLETE_NEEDED ((HRESULT)0x00090313L) #endif #ifndef SEC_I_COMPLETE_AND_CONTINUE # define SEC_I_COMPLETE_AND_CONTINUE ((HRESULT)0x00090314L) #endif #ifndef SEC_I_LOCAL_LOGON # define SEC_I_LOCAL_LOGON ((HRESULT)0x00090315L) #endif #ifndef SEC_I_CONTEXT_EXPIRED # define SEC_I_CONTEXT_EXPIRED ((HRESULT)0x00090317L) #endif #ifndef SEC_I_INCOMPLETE_CREDENTIALS # define SEC_I_INCOMPLETE_CREDENTIALS ((HRESULT)0x00090320L) #endif #ifndef SEC_I_RENEGOTIATE # define SEC_I_RENEGOTIATE ((HRESULT)0x00090321L) #endif #ifndef SEC_I_NO_LSA_CONTEXT # define SEC_I_NO_LSA_CONTEXT ((HRESULT)0x00090323L) #endif #ifndef SEC_I_SIGNATURE_NEEDED # define SEC_I_SIGNATURE_NEEDED ((HRESULT)0x0009035CL) #endif #endif /* USE_WINDOWS_SSPI */ #endif /* HEADER_CURL_SSPI_H */ curl-7.35.0/lib/urldata.h0000644000175000017500000020177212271275502012063 00000000000000#ifndef HEADER_CURL_URLDATA_H #define HEADER_CURL_URLDATA_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* This file is for lib internal stuff */ #include "curl_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_LDAPS 636 #define PORT_TFTP 69 #define PORT_SSH 22 #define PORT_IMAP 143 #define PORT_IMAPS 993 #define PORT_POP3 110 #define PORT_POP3S 995 #define PORT_SMTP 25 #define PORT_SMTPS 465 /* sometimes called SSMTP */ #define PORT_RTSP 554 #define PORT_RTMP 1935 #define PORT_RTMPT PORT_HTTP #define PORT_RTMPS PORT_HTTPS #define PORT_GOPHER 70 #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 "ftp@example.com" #define DEFAULT_CONNCACHE_SIZE 5 /* length of longest IPv6 address string including the trailing null */ #define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") /* Default FTP/IMAP etc response timeout in milliseconds. Symbian OS panics when given a timeout much greater than 1/2 hour. */ #define RESP_TIMEOUT (1800*1000) #include "cookie.h" #include "formdata.h" #ifdef USE_SSLEAY #ifdef USE_OPENSSL #include #include #include #include #include #include #ifdef HAVE_OPENSSL_ENGINE_H #include #endif #ifdef HAVE_OPENSSL_PKCS12_H #include #endif #else /* SSLeay-style includes */ #include #include #include #include #include #include #ifdef HAVE_OPENSSL_ENGINE_H #include #endif #ifdef HAVE_OPENSSL_PKCS12_H #include #endif #endif /* USE_OPENSSL */ #ifdef USE_GNUTLS #error Configuration error; cannot use GnuTLS *and* OpenSSL. #endif #endif /* USE_SSLEAY */ #ifdef USE_GNUTLS #include #endif #ifdef USE_POLARSSL #include #include #if POLARSSL_VERSION_NUMBER<0x01010000 #include #else #include #include #endif /* POLARSSL_VERSION_NUMBER<0x01010000 */ #endif /* USE_POLARSSL */ #ifdef USE_CYASSL #undef OCSP_REQUEST /* avoid cyassl/openssl/ssl.h clash with wincrypt.h */ #undef OCSP_RESPONSE /* avoid cyassl/openssl/ssl.h clash with wincrypt.h */ #include #endif #ifdef USE_NSS #include #include #endif #ifdef USE_QSOSSL #include #endif #ifdef USE_GSKIT #include #endif #ifdef USE_AXTLS #include #undef malloc #undef calloc #undef realloc #endif /* USE_AXTLS */ #ifdef USE_SCHANNEL #include "curl_sspi.h" #include #include #endif #ifdef USE_DARWINSSL #include /* For some reason, when building for iOS, the omnibus header above does * not include SecureTransport.h as of iOS SDK 5.1. */ #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #include "timeval.h" #ifdef HAVE_ZLIB_H #include /* for content-encoding */ #ifdef __SYMBIAN32__ /* zlib pollutes the namespace with this definition */ #undef WIN32 #endif #endif #include #include "http_chunks.h" /* for the structs and enum stuff */ #include "hostip.h" #include "hash.h" #include "splay.h" #include "imap.h" #include "pop3.h" #include "smtp.h" #include "ftp.h" #include "file.h" #include "ssh.h" #include "http.h" #include "rtsp.h" #include "wildcard.h" #include "multihandle.h" #ifdef HAVE_GSSAPI # ifdef HAVE_GSSGNU # include # elif defined HAVE_GSSMIT # include # include # else # include # endif #endif #ifdef HAVE_LIBSSH2_H #include #include #endif /* HAVE_LIBSSH2_H */ /* 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 0xc0dedbadU /* Some convenience macros to get the larger/smaller value out of two given. We prefix with CURL to prevent name collisions. */ #define CURLMAX(x,y) ((x)>(y)?(x):(y)) #define CURLMIN(x,y) ((x)<(y)?(x):(y)) #ifdef HAVE_GSSAPI /* Types needed for krb5-ftp connections */ struct krb5buffer { void *data; size_t size; size_t index; int eof_flag; }; enum protection_level { PROT_NONE, /* first in list */ PROT_CLEAR, PROT_SAFE, PROT_CONFIDENTIAL, PROT_PRIVATE, PROT_CMD, PROT_LAST /* last in list */ }; #endif #ifdef USE_SCHANNEL /* Structs to store Schannel handles */ struct curl_schannel_cred { CredHandle cred_handle; TimeStamp time_stamp; int refcount; bool cached; }; struct curl_schannel_ctxt { CtxtHandle ctxt_handle; TimeStamp time_stamp; }; #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; typedef enum { ssl_connection_none, ssl_connection_negotiating, ssl_connection_complete } ssl_connection_state; /* struct for data related to each SSL connection */ struct ssl_connect_data { /* Use ssl encrypted communications TRUE/FALSE, not necessarily using it atm but at least asked to or meaning to use it. See 'state' for the exact current state of the connection. */ bool use; ssl_connection_state state; #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; #ifdef USE_TLS_SRP gnutls_srp_client_credentials srp_client_cred; #endif ssl_connect_state connecting_state; #endif /* USE_GNUTLS */ #ifdef USE_POLARSSL #if POLARSSL_VERSION_NUMBER<0x01010000 havege_state hs; #else /* from v1.1.0, use ctr_drbg and entropy */ ctr_drbg_context ctr_drbg; entropy_context entropy; #endif /* POLARSSL_VERSION_NUMBER<0x01010000 */ ssl_context ssl; ssl_session ssn; int server_fd; x509_cert cacert; x509_cert clicert; x509_crl crl; rsa_context rsa; ssl_connect_state connecting_state; #endif /* USE_POLARSSL */ #ifdef USE_CYASSL SSL_CTX* ctx; SSL* handle; ssl_connect_state connecting_state; #endif /* USE_CYASSL */ #ifdef USE_NSS PRFileDesc *handle; char *client_nickname; struct SessionHandle *data; struct curl_llist *obj_list; PK11GenericObject *obj_clicert; #endif /* USE_NSS */ #ifdef USE_QSOSSL SSLHandle *handle; #endif /* USE_QSOSSL */ #ifdef USE_GSKIT gsk_handle handle; int iocport; ssl_connect_state connecting_state; #endif #ifdef USE_AXTLS SSL_CTX* ssl_ctx; SSL* ssl; ssl_connect_state connecting_state; #endif /* USE_AXTLS */ #ifdef USE_SCHANNEL struct curl_schannel_cred *cred; struct curl_schannel_ctxt *ctxt; SecPkgContext_StreamSizes stream_sizes; ssl_connect_state connecting_state; size_t encdata_length, decdata_length; size_t encdata_offset, decdata_offset; unsigned char *encdata_buffer, *decdata_buffer; unsigned long req_flags, ret_flags; #endif /* USE_SCHANNEL */ #ifdef USE_DARWINSSL SSLContextRef ssl_ctx; curl_socket_t ssl_sockfd; ssl_connect_state connecting_state; bool ssl_direction; /* true if writing, false if reading */ size_t ssl_write_buffered_length; #endif /* USE_DARWINSSL */ }; struct ssl_config_data { long version; /* what version the client wants to use */ long certverifyresult; /* result from the certificate verification */ bool verifypeer; /* set TRUE if this is desired */ bool verifyhost; /* set TRUE if CN/SAN must match hostname */ char *CApath; /* certificate dir (doesn't work on windows) */ char *CAfile; /* certificate to verify peer against */ const char *CRLfile; /* CRL to check certificate revocation */ const char *issuercert;/* optional issuer certificate filename */ 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 */ size_t max_ssl_sessions; /* 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 */ bool certinfo; /* gather lots of certificate info */ #ifdef USE_TLS_SRP char *username; /* TLS username (for, e.g., SRP) */ char *password; /* TLS password (for, e.g., SRP) */ enum CURL_TLSAUTH authtype; /* TLS authentication type (default SRP) */ #endif }; /* 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 #include "curl_sspi.h" #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; unsigned long n_type_2; #else unsigned int flags; unsigned char nonce[8]; #endif }; #ifdef USE_HTTP_NEGOTIATE struct negotiatedata { /* when doing Negotiate we first need to receive an auth token and then we need to send our header */ enum { GSS_AUTHNONE, GSS_AUTHRECV, GSS_AUTHSENT } state; bool gss; /* Whether we're processing GSS-Negotiate or Negotiate */ const char* protocol; /* "GSS-Negotiate" or "Negotiate" */ #ifdef HAVE_GSSAPI OM_uint32 status; gss_ctx_id_t context; gss_name_t server_name; gss_buffer_desc output_token; #else #ifdef USE_WINDOWS_SSPI DWORD status; CtxtHandle *context; CredHandle *credentials; char server_name[1024]; size_t max_token_length; BYTE *output_token; size_t output_token_length; #endif #endif }; #endif /* * 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 proxy; /* if set, this transfer is done through a proxy - any type */ 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 tcpconnect[2]; /* the TCP layer (or similar) 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 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 userpwd_in_url; /* name+password found in url */ 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 */ bool proxy_connect_closed; /* set true if a proxy disconnected the connection in a CONNECT request with auth, so that libcurl should reconnect and continue. */ bool bound; /* set true if bind() has already been done on this socket/ connection */ bool type_set; /* type= was used in the URL */ }; 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 */ const char *dispname; /* name to display, as 'name' might be encoded */ }; /* * Flags on the keepon member of the Curl_transfer_keeper */ #define KEEP_NONE 0 #define KEEP_RECV (1<<0) /* there is or may be data to read */ #define KEEP_SEND (1<<1) /* there is or may be data to write */ #define KEEP_RECV_HOLD (1<<2) /* when set, no reading should be done but there might still be data to read */ #define KEEP_SEND_HOLD (1<<3) /* when set, no writing should be done but there might still be data to write */ #define KEEP_RECV_PAUSE (1<<4) /* reading is paused */ #define KEEP_SEND_PAUSE (1<<5) /* writing is paused */ #define KEEP_RECVBITS (KEEP_RECV | KEEP_RECV_HOLD | KEEP_RECV_PAUSE) #define KEEP_SENDBITS (KEEP_SEND | KEEP_SEND_HOLD | KEEP_SEND_PAUSE) #ifdef HAVE_LIBZ typedef enum { 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 */ } zlibInitState; #endif #ifdef CURLRES_ASYNCH 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 *, int *); typedef CURLcode (*Curl_done_func)(struct connectdata *, CURLcode, bool); enum expect100 { EXP100_SEND_DATA, /* enough waiting, just send the body now */ EXP100_AWAITING_CONTINUE, /* waiting for the 100 Continue header */ EXP100_SENDING_REQUEST, /* still sending the request but will wait for the 100 header once done with the request */ EXP100_FAILED /* used on 417 Expectation Failed */ }; /* * 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-specific * data here. This struct only keeps stuff that's interesting for *this* * request, as it will be cleared between multiple ones */ struct SingleRequest { 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, -1 means unlimited */ curl_off_t *writebytecountp; /* return number of bytes written or NULL */ 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 transferred 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' or 'RTSP/1.? XXX' line */ struct timeval start100; /* time stamp to wait for the 100 code from */ enum expect100 exp100; /* expect 100 continue state */ int auto_decoding; /* What content encoding. sec 3.5, RFC2616. */ #define IDENTITY 0 /* No encoding */ #define DEFLATE 1 /* zlib deflate [RFC 1950 & 1951] */ #define GZIP 2 /* gzip algorithm [RFC 1952] */ #define COMPRESS 3 /* Not handled, added for completeness */ #ifdef HAVE_LIBZ zlibInitState zlib_init; /* possible zlib init state; 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 */ char *location; /* This points to an allocated version of the Location: header data */ char *newurl; /* Set to the new URL to use when a redirect or a retry is wanted */ /* '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; bool chunk; /* if set, this is a chunked transfer-encoding */ 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. */ void *protop; /* Allocated protocol-specific data. Each protocol handler makes sure this points to data it needs. */ }; /* * Specific protocol handler. */ struct Curl_handler { const char * scheme; /* URL scheme name. */ /* Complement to setup_connection_internals(). */ CURLcode (*setup_connection)(struct connectdata *); /* These two functions MUST be set to be protocol dependent */ CURLcode (*do_it)(struct connectdata *, bool *done); Curl_done_func 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 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 (*connect_it)(struct connectdata *, bool *done); /* See above. Currently only used for FTP. */ CURLcode (*connecting)(struct connectdata *, bool *done); CURLcode (*doing)(struct connectdata *, bool *done); /* Called from the multi interface during the PROTOCONNECT phase, and it should then return a proper fd set */ int (*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 (*doing_getsock)(struct connectdata *conn, curl_socket_t *socks, int numsocks); /* Called from the multi interface during the DO_MORE phase, and it should then return a proper fd set */ int (*domore_getsock)(struct connectdata *conn, curl_socket_t *socks, int numsocks); /* Called from the multi interface during the DO_DONE, PERFORM and WAITPERFORM phases, and it should then return a proper fd set. Not setting this will make libcurl use the generic default one. */ int (*perform_getsock)(const 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. If the handler * is called because the connection has been considered dead, dead_connection * is set to TRUE. */ CURLcode (*disconnect)(struct connectdata *, bool dead_connection); /* If used, this function gets called from transfer.c:readwrite_data() to allow the protocol to do extra reads/writes */ CURLcode (*readwrite)(struct SessionHandle *data, struct connectdata *conn, ssize_t *nread, bool *readmore); long defport; /* Default port. */ unsigned int protocol; /* See CURLPROTO_* */ unsigned int flags; /* Extra particular characteristics, see PROTOPT_* */ }; #define PROTOPT_NONE 0 /* nothing extra */ #define PROTOPT_SSL (1<<0) /* uses SSL */ #define PROTOPT_DUAL (1<<1) /* this protocol uses two connections */ #define PROTOPT_CLOSEACTION (1<<2) /* need action before socket close */ /* some protocols will have to call the underlying functions without regard to what exact state the socket signals. IE even if the socket says "readable", the send function might need to be called while uploading, or vice versa. */ #define PROTOPT_DIRLOCK (1<<3) #define PROTOPT_NONETWORK (1<<4) /* protocol doesn't use the network! */ #define PROTOPT_NEEDSPWD (1<<5) /* needs a password, and if none is set it gets a default */ #define PROTOPT_NOURLQUERY (1<<6) /* protocol can't handle url query strings (?foo=bar) ! */ /* return the count of bytes sent, or -1 on error */ typedef ssize_t (Curl_send)(struct connectdata *conn, /* connection data */ int sockindex, /* socketindex */ const void *buf, /* data to write */ size_t len, /* max amount to write */ CURLcode *err); /* error to return */ /* return the count of bytes read, or -1 on error */ typedef ssize_t (Curl_recv)(struct connectdata *conn, /* connection data */ int sockindex, /* socketindex */ char *buf, /* store data here */ size_t len, /* max amount to read */ CURLcode *err); /* error to return */ /* * 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; /* chunk is for HTTP chunked encoding, but is in the general connectdata struct only because we can do just about any protocol through a HTTP proxy and a HTTP proxy may in fact respond using chunked encoding */ struct Curl_chunker chunk; curl_closesocket_callback fclosesocket; /* function closing the socket(s) */ void *closesocket_client; 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 connection_id; /* Contains a unique number to make it easier to track the connections in the log output */ /* '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; Curl_addrinfo *tempaddr[2]; /* for happy eyeballs */ /* 'ip_addr_str' is the ip_addr data as a human readable string. It remains available as long as the connection does, which is longer than the ip_addr itself. */ char ip_addr_str[MAX_IPADR_LEN]; unsigned int scope; /* address scope for IPv6 */ 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! */ /* 'primary_ip' and 'primary_port' get filled with peer's numerical ip address and port number whenever an outgoing connection is *attempted* from the primary socket to a remote address. When more than one address is tried for a connection these will hold data for the last attempt. When the connection is actually established these are updated with data which comes directly from the socket. */ char primary_ip[MAX_IPADR_LEN]; long primary_port; /* 'local_ip' and 'local_port' get filled with local's numerical ip address and port number whenever an outgoing connection is **established** from the primary socket to a remote address. */ char local_ip[MAX_IPADR_LEN]; long local_port; char *user; /* user name string, allocated */ char *passwd; /* password string, allocated */ char *options; /* options string, allocated */ char *xoauth2_bearer; /* bearer token for xoauth2, allocated */ char *proxyuser; /* proxy user name string, allocated */ char *proxypasswd; /* proxy password string, allocated */ curl_proxytype proxytype; /* what kind of proxy that is in use */ int httpversion; /* the HTTP version*10 reported by the server */ int rtspversion; /* the RTSP version*10 reported by the server */ 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 */ curl_socket_t tempsock[2]; /* temporary sockets for happy eyeballs */ bool sock_accepted[2]; /* TRUE if the socket on this index was created with accept() */ Curl_recv *recv[2]; Curl_send *send[2]; 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 */ /* connecttime: when connect() is called on the current IP address. Used to be able to track when to move on to try next IP - but only when the multi interface is used. */ struct timeval connecttime; /* The two fields below get set in Curl_connecthost */ int num_addr; /* number of addresses to try to connect to */ long timeoutms_per_addr; /* how long time in milliseconds to spend on trying to connect to each IP address */ const struct Curl_handler *handler; /* Connection's protocol handler */ const struct Curl_handler *given; /* The protocol first given */ long ip_version; /* copied from the SessionHandle at creation time */ /**** 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, MUST be freed before this **/ /** struct is killed. **/ struct dynamically_allocated_data { char *proxyuserpwd; char *uagent; char *accept_encoding; char *userpwd; char *rangeline; char *ref; char *host; char *cookiehost; char *rtsp_transport; char *te; /* TE: request header */ } allocptr; int sec_complete; /* if kerberos is enabled for this connection */ #ifdef HAVE_GSSAPI enum protection_level command_prot; enum protection_level data_prot; enum protection_level request_data_prot; size_t buffer_size; struct krb5buffer in_buffer; void *app_data; const struct Curl_sec_client_mech *mech; struct sockaddr_in local_addr; #endif /* the two following *_inuse fields are only flags, not counters in any way. If TRUE it means the channel is in use, and if FALSE it means the channel is up for grabs by one. */ 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 */ 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; /* The master buffer allocated on-demand; used for pipelining. */ size_t read_pos; /* Current read position in the master buffer */ size_t buf_len; /* Length of the buffer?? */ curl_seek_callback seek_func; /* function that seeks the input */ void *seek_client; /* pointer to pass to the seek() above */ /*************** Request - specific items ************/ /* previously this was in the urldata struct */ curl_read_callback fread_func; /* 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 */ #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) /* used for communication with Samba's winbind daemon helper ntlm_auth */ curl_socket_t ntlm_auth_hlpr_socket; pid_t ntlm_auth_hlpr_pid; char* challenge_header; char* response_header; #endif char syserr_buf [256]; /* buffer for Curl_strerror() */ #ifdef CURLRES_ASYNCH /* 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; struct http_conn httpc; struct ssh_conn sshc; struct tftp_state_data *tftpc; struct imap_conn imapc; struct pop3_conn pop3c; struct smtp_conn smtpc; struct rtsp_conn rtspc; void *generic; /* RTMP and LDAP use this */ } proto; int cselect_bits; /* bitmask of socket events */ int waitfor; /* current READ/WRITE bits to wait for */ #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) int socks5_gssapi_enctype; #endif bool verifypeer; bool verifyhost; /* When this connection is created, store the conditions for the local end bind. This is stored before the actual bind and before any connection is made and will serve the purpose of being used for comparison reasons so that subsequent bound-requested connections aren't accidentally re-using wrong connections. */ char *localdev; unsigned short localport; int localportrange; /* tunnel as in tunnel through a HTTP proxy with CONNECT */ enum { TUNNEL_INIT, /* init/default/no tunnel state */ TUNNEL_CONNECT, /* CONNECT has been sent off */ TUNNEL_COMPLETE /* CONNECT response received completely */ } tunnel_state[2]; /* two separate ones to allow FTP */ struct connectbundle *bundle; /* The bundle we are member of */ }; /* The end of connectdata. */ /* * Struct to keep statistical and informational data. */ struct PureInfo { int httpcode; /* Recent HTTP, FTP, or RTSP response code */ int httpproxycode; /* response code from proxy when received separate */ int httpversion; /* the http version number X.Y = X*10+Y */ 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. */ bool timecond; /* set to TRUE if the time condition didn't match, which thus made the document NOT get fetched */ long header_size; /* size of read header(s) in bytes */ long request_size; /* the amount of bytes sent in the request(s) */ unsigned long proxyauthavail; /* what proxy auth types were announced */ unsigned long httpauthavail; /* what host auth types were announced */ long numconnects; /* how many new connection did libcurl created */ char *contenttype; /* the content type of the object */ char *wouldredirect; /* URL this would've been redirected to if asked to */ /* PureInfo members 'conn_primary_ip', 'conn_primary_port', 'conn_local_ip' and, 'conn_local_port' are copied over from the connectdata struct in order to allow curl_easy_getinfo() to return this information even when the session handle is no longer associated with a connection, and also allow curl_easy_reset() to clear this information from the session handle without disturbing information which is still alive, and that might be reused, in the connection cache. */ char conn_primary_ip[MAX_IPADR_LEN]; long conn_primary_port; char conn_local_ip[MAX_IPADR_LEN]; long conn_local_port; struct curl_certinfo certs; /* info about the certs, only populated in OpenSSL builds. Asked for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */ }; 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; /* transferred so far */ curl_off_t uploaded; /* transferred 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_appconnect; double t_pretransfer; double t_starttransfer; double t_redirect; struct timeval start; struct timeval t_startsingle; struct timeval t_acceptdata; #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; typedef enum { RTSPREQ_NONE, /* first in list */ RTSPREQ_OPTIONS, RTSPREQ_DESCRIBE, RTSPREQ_ANNOUNCE, RTSPREQ_SETUP, RTSPREQ_PLAY, RTSPREQ_PAUSE, RTSPREQ_TEARDOWN, RTSPREQ_GET_PARAMETER, RTSPREQ_SET_PARAMETER, RTSPREQ_RECORD, RTSPREQ_RECEIVE, RTSPREQ_LAST /* last in list */ } Curl_RtspReq; /* * 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 struct auth { unsigned long want; /* Bitmask set to the authentication methods wanted by app (with CURLOPT_HTTPAUTH or CURLOPT_PROXYAUTH). */ unsigned long picked; unsigned 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 */ bool iestyle; /* TRUE if digest should be done IE-style or FALSE if it should be RFC compliant */ }; struct UrlState { /* Points to the connection cache */ struct conncache *conn_cache; /* when curl_easy_perform() is called, the multi handle is "owned" by the easy handle so curl_easy_cleanup() on such an easy handle will also close the multi handle! */ bool multi_owned_by_easy; /* buffers to store authentication data in, as parsed from input options */ struct timeval keeps_speed; /* for the progress meter really */ struct connectdata *lastconnect; /* The last connection, NULL 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 */ 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 'max_ssl_sessions' size */ long sessionage; /* number of the most recent session */ char *tempwrite; /* allocated buffer to keep data in when a write callback returns to make the connection paused */ size_t tempwritesize; /* size of the 'tempwrite' allocated buffer */ int tempwritetype; /* type of the 'tempwrite' buffer as a bitmask that is used with Curl_client_write() */ 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; /* state data for host Digest auth */ struct digestdata proxydigest; /* state data for proxy Digest auth */ #ifdef USE_HTTP_NEGOTIATE struct negotiatedata negotiate; /* state data for host Negotiate auth */ struct negotiatedata proxyneg; /* state data for proxy Negotiate auth */ #endif struct auth authhost; /* auth details for host */ struct auth authproxy; /* auth details for proxy */ bool authproblem; /* TRUE if there's some problem authenticating */ void *resolver; /* resolver state, if it is used in the URL state - ares_channel f.e. */ #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 */ struct curl_llist *timeoutlist; /* list of pending timeouts */ /* a place to store the most recently set FTP entrypath */ char *most_recent_ftp_entrypath; /* set after initial USER failure, to prevent an authentication loop */ bool ftp_trying_alternative; int httpversion; /* the lowest HTTP version*10 reported by any server involved in this request */ 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 */ #if !defined(WIN32) && !defined(MSDOS) && !defined(__EMX__) && \ !defined(__SYMBIAN32__) /* 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 char *pathbuffer;/* allocated buffer to store the URL's path part in */ char *path; /* path to use, points to somewhere within the pathbuffer area */ bool slash_removed; /* set TRUE if the 'path' points to a path where the initial URL slash separator has been taken off */ 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 */ /* This RTSP state information survives requests and connections */ long rtsp_next_client_CSeq; /* the session's next client CSeq */ long rtsp_next_server_CSeq; /* the session's next server CSeq */ long rtsp_CSeq_recv; /* most recent CSeq received */ /* if true, force SSL connection retry (workaround for certain servers) */ bool ssl_connect_retry; }; /* * 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 */ 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 */ struct curl_slist *resolve; /* set to point to the set.resolve list when this should be dealt with in pretransfer */ }; /* * 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. * Character pointer fields point to dynamic storage, unless otherwise stated. */ struct Curl_multi; /* declared and used only in multi.c */ enum dupstring { STRING_CERT, /* client certificate file name */ STRING_CERT_TYPE, /* format for certificate (default: PEM)*/ STRING_COOKIE, /* HTTP cookie string to send */ STRING_COOKIEJAR, /* dump all cookies to this file */ STRING_CUSTOMREQUEST, /* HTTP/FTP/RTSP request/method to use */ STRING_DEVICE, /* local network interface/address to use */ STRING_ENCODING, /* Accept-Encoding string */ STRING_FTP_ACCOUNT, /* ftp account data */ STRING_FTP_ALTERNATIVE_TO_USER, /* command to send if USER/PASS fails */ STRING_FTPPORT, /* port to send with the FTP PORT command */ STRING_KEY, /* private key file name */ STRING_KEY_PASSWD, /* plain text private key password */ STRING_KEY_TYPE, /* format for private key (default: PEM) */ STRING_KRB_LEVEL, /* krb security level */ STRING_NETRC_FILE, /* if not NULL, use this instead of trying to find $HOME/.netrc */ STRING_COPYPOSTFIELDS, /* if POST, set the fields' values here */ STRING_PROXY, /* proxy to use */ STRING_SET_RANGE, /* range, if used */ STRING_SET_REFERER, /* custom string for the HTTP referer field */ STRING_SET_URL, /* what original URL to work on */ STRING_SSL_CAPATH, /* CA directory name (doesn't work on windows) */ STRING_SSL_CAFILE, /* certificate file to verify peer against */ STRING_SSL_CIPHER_LIST, /* list of ciphers to use */ STRING_SSL_EGDSOCKET, /* path to file containing the EGD daemon socket */ STRING_SSL_RANDOM_FILE, /* path to file containing "random" data */ STRING_USERAGENT, /* User-Agent string */ STRING_SSL_CRLFILE, /* crl file to check certificate */ STRING_SSL_ISSUERCERT, /* issuer cert file to check certificate */ STRING_USERNAME, /* , if used */ STRING_PASSWORD, /* , if used */ STRING_OPTIONS, /* , if used */ STRING_PROXYUSERNAME, /* Proxy , if used */ STRING_PROXYPASSWORD, /* Proxy , if used */ STRING_NOPROXY, /* List of hosts which should not use the proxy, if used */ STRING_RTSP_SESSION_ID, /* Session ID to use */ STRING_RTSP_STREAM_URI, /* Stream URI for this request */ STRING_RTSP_TRANSPORT, /* Transport for this session */ #ifdef USE_LIBSSH2 STRING_SSH_PRIVATE_KEY, /* path to the private key file for auth */ STRING_SSH_PUBLIC_KEY, /* path to the public key file for auth */ STRING_SSH_HOST_PUBLIC_KEY_MD5, /* md5 of host public key in ascii hex */ STRING_SSH_KNOWNHOSTS, /* file name of knownhosts file */ #endif #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) STRING_SOCKS5_GSSAPI_SERVICE, /* GSSAPI service name */ #endif STRING_MAIL_FROM, STRING_MAIL_AUTH, #ifdef USE_TLS_SRP STRING_TLSAUTH_USERNAME, /* TLS auth */ STRING_TLSAUTH_PASSWORD, /* TLS auth */ #endif STRING_BEARER, /* , if used */ /* -- end of strings -- */ STRING_LAST /* not used, just an end-of-list marker */ }; struct UserDefined { FILE *err; /* the stderr user data goes here */ void *debugdata; /* the data that will be passed to fdebug */ char *errorbuffer; /* (Static) store failure messages in here */ 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 */ void *rtp_out; /* write RTP to this if non-NULL */ long use_port; /* which port to use (when not using default) */ unsigned long httpauth; /* kind of HTTP authentication to use (bitmask) */ unsigned long proxyauth; /* kind of proxy authentication to use (bitmask) */ long followlocation; /* as in HTTP Location: */ long maxredirs; /* maximum no. of http(s) redirects to follow, set to -1 for infinity */ int keep_post; /* keep POSTs as POSTs after a 30x request; each bit represents a request, from 301 to 303 */ bool free_referer; /* set TRUE if 'referer' points to a string we allocated */ void *postfields; /* if POST, set the fields' values here */ curl_seek_callback seek_func; /* function that seeks the input */ 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) */ 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_func; /* function that stores the output */ curl_write_callback fwrite_header; /* function that stores headers */ curl_write_callback fwrite_rtp; /* function that stores interleaved RTP */ curl_read_callback fread_func; /* function that reads the input */ int is_fread_set; /* boolean, has read callback been set to non-NULL? */ int is_fwrite_set; /* boolean, has write callback been set to non-NULL? */ curl_progress_callback fprogress; /* OLD and deprecated progress callback */ curl_xferinfo_callback fxferinfo; /* progress callback */ curl_debug_callback fdebug; /* function that write informational data */ curl_ioctl_callback ioctl_func; /* 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 */ curl_opensocket_callback fopensocket; /* function for checking/translating the address and opening the socket */ void* opensocket_client; curl_closesocket_callback fclosesocket; /* function for closing the socket */ void* closesocket_client; void *seek_client; /* pointer to pass to the seek 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 milliseconds, 0 means no timeout */ long connecttimeout; /* in milliseconds, 0 means no timeout */ long accepttimeout; /* in milliseconds, 0 means no timeout */ long server_response_timeout; /* in milliseconds, 0 means no timeout */ long tftp_blksize ; /* in bytes, 0 means use default */ 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 */ struct curl_slist *headers; /* linked list of extra headers */ struct curl_httppost *httppost; /* linked list of POST data */ bool cookiesession; /* new cookie session? */ bool crlf; /* convert crlf on ftp upload(?) */ 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 */ struct curl_slist *resolve; /* list of names to add/remove from DNS cache */ curl_TimeCond timecondition; /* kind of time/date comparison */ time_t timevalue; /* what time to compare with */ Curl_HttpReq httpreq; /* what kind of HTTP request (if any) is this */ long httpversion; /* when non-zero, a specific HTTP version requested to be used in the library's request(s) */ struct ssl_config_data ssl; /* user defined SSL stuff */ curl_proxytype proxytype; /* what kind of proxy that is in use */ long dns_cache_timeout; /* DNS cache timeout */ long buffer_size; /* size of receive buffer to use */ void *private_data; /* application-private data */ struct curl_slist *http200aliases; /* linked list of aliases for http200 */ long ipver; /* the CURL_IPRESOLVE_* defines in the public header file 0 - whatever, 1 - v2, 2 - v6 */ curl_off_t max_filesize; /* Maximum file size to download */ curl_ftpfile ftp_filemethod; /* how to get to a file when FTP is used */ int ftp_create_missing_dirs; /* 1 - create directories that don't exist 2 - the same but also allow MKD to fail once */ curl_sshkeycallback ssh_keyfunc; /* key matching callback */ void *ssh_keyfunc_userp; /* custom pointer to callback */ /* 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; /* get the time and get of the remote file */ bool tunnel_thru_httpproxy; /* use CONNECT through a HTTP proxy */ bool prefer_ascii; /* ASCII rather than binary */ bool ftp_append; /* append, not overwrite, on upload */ bool ftp_list_only; /* switch FTP command for listing directories */ bool ftp_use_port; /* use the FTP PORT command */ bool hide_progress; /* don't use the progress meter */ bool http_fail_on_error; /* fail on HTTP error codes >= 300 */ bool http_follow_location; /* follow HTTP redirects */ bool http_transfer_encoding; /* request compressed HTTP transfer-encoding */ bool http_disable_hostname_check_before_authentication; bool include_header; /* include received protocol headers in data output */ bool http_set_referer; /* is a custom referer used */ bool http_auto_referer; /* set "correct" referer when following location: */ bool opt_no_body; /* as set with CURLOPT_NOBODY */ bool set_port; /* custom port number used */ bool upload; /* upload request */ enum CURL_NETRC_OPTION use_netrc; /* defined in include/curl.h */ bool verbose; /* output verbosity */ bool krb; /* kerberos 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 */ bool ftp_use_pret; /* if PRET is to be used before PASV or not */ curl_usessl use_ssl; /* if AUTH TLS is to be attempted etc, for FTP or IMAP or POP3 or others! */ curl_ftpauth ftpsslauth; /* what AUTH XXX to be attempted */ curl_ftpccc ftp_ccc; /* FTP CCC options */ 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 */ bool ssl_enable_beast; /* especially allow this flaw for interoperability's sake*/ long ssh_auth_types; /* allowed SSH auth types */ bool http_te_skip; /* pass the raw body data to the user, even when transfer-encoded (chunked, compressed) */ bool http_ce_skip; /* pass the raw body data to the user, even when content-encoded (chunked, compressed) */ long new_file_perms; /* Permissions to use when creating remote files */ long new_directory_perms; /* Permissions to use when creating remote dirs */ bool proxy_transfer_mode; /* set transfer mode (;type=) when doing FTP via an HTTP proxy */ char *str[STRING_LAST]; /* array of strings, pointing to allocated memory */ unsigned int scope; /* address scope for IPv6 */ long allowed_protocols; long redir_protocols; #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) long socks5_gssapi_nec; /* flag to support nec socks5 server */ #endif struct curl_slist *mail_rcpt; /* linked list of mail recipients */ bool sasl_ir; /* Enable/disable SASL initial response */ /* Common RTSP header options */ Curl_RtspReq rtspreq; /* RTSP request type */ long rtspversion; /* like httpversion, for RTSP */ bool wildcardmatch; /* enable wildcard matching */ curl_chunk_bgn_callback chunk_bgn; /* called before part of transfer starts */ curl_chunk_end_callback chunk_end; /* called after part transferring stopped */ curl_fnmatch_callback fnmatch; /* callback to decide which file corresponds to pattern (e.g. if WILDCARDMATCH is on) */ void *fnmatch_data; long gssapi_delegation; /* GSSAPI credential delegation, see the documentation of CURLOPT_GSSAPI_DELEGATION */ bool tcp_keepalive; /* use TCP keepalives */ long tcp_keepidle; /* seconds in idle before sending keepalive probe */ long tcp_keepintvl; /* seconds between TCP keepalive probes */ size_t maxconnects; /* Max idle connections in the connection cache */ }; struct Names { struct curl_hash *hostcache; enum { HCACHE_NONE, /* not pointing to anything */ 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 { /* first, two fields for the linked list of these */ struct SessionHandle *next; struct SessionHandle *prev; struct connectdata *easy_conn; /* the "unit's" connection */ CURLMstate mstate; /* the handle's state */ CURLcode result; /* previous result */ struct Curl_message msg; /* A single posted message. */ /* 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; struct Names dns; struct Curl_multi *multi; /* if non-NULL, points to the multi handle struct to which this "belongs" when used by the multi interface */ struct Curl_multi *multi_easy; /* if non-NULL, points to the multi handle struct to which this "belongs" when used by the easy interface */ struct Curl_share *share; /* Share, handles global variable mutexing */ struct SingleRequest req; /* 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. NOTE that the 'cookie' field in the UserDefined struct defines if the "engine" is to be used or not. */ struct Progress progress; /* for all the progress meter data */ struct UrlState state; /* struct for fields used for state info and other dynamic purposes */ struct WildcardData wildcard; /* wildcard download state info */ struct PureInfo info; /* stats, reports and info data */ struct curl_tlssessioninfo tsi; /* Information about the TLS session, only valid after a client has asked for it */ #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 /* HEADER_CURL_URLDATA_H */ curl-7.35.0/lib/curl_ntlm_msgs.h0000644000175000017500000001546112213173003013442 00000000000000#ifndef HEADER_CURL_NTLM_MSGS_H #define HEADER_CURL_NTLM_MSGS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_NTLM /* This is to generate a base64 encoded NTLM type-1 message */ CURLcode Curl_ntlm_create_type1_message(const char *userp, const char *passwdp, struct ntlmdata *ntlm, char **outptr, size_t *outlen); /* This is to generate a base64 encoded NTLM type-3 message */ CURLcode Curl_ntlm_create_type3_message(struct SessionHandle *data, const char *userp, const char *passwdp, struct ntlmdata *ntlm, char **outptr, size_t *outlen); /* This is to decode a NTLM type-2 message */ CURLcode Curl_ntlm_decode_type2_message(struct SessionHandle *data, const char* header, struct ntlmdata* ntlm); /* This is to clean up the ntlm data structure */ #ifdef USE_WINDOWS_SSPI void Curl_ntlm_sspi_cleanup(struct ntlmdata *ntlm); #else #define Curl_ntlm_sspi_cleanup(x) #endif /* NTLM buffer fixed size, large enough for long user + host + domain */ #define NTLM_BUFSIZE 1024 /* Stuff only required for curl_ntlm_msgs.c */ #ifdef BUILDING_CURL_NTLM_MSGS_C /* 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) /* Indicates that datagram authentication is being used. */ #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) */ #define NTLMFLAG_NEGOTIATE_ANONYMOUS (1<<11) /* Sent by the client in the Type 3 message to indicate that an anonymous context has been established. This also affects the response fields. */ #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) /* Indicates that the client will provide an encrypted master key in the "Session Key" field of the Type 3 message. */ #define NTLMFLAG_NEGOTIATE_56 (1<<31) /* Indicates that 56-bit encryption is supported. */ #ifdef UNICODE # define SECFLAG_WINNT_AUTH_IDENTITY \ (unsigned long)SEC_WINNT_AUTH_IDENTITY_UNICODE #else # define SECFLAG_WINNT_AUTH_IDENTITY \ (unsigned long)SEC_WINNT_AUTH_IDENTITY_ANSI #endif #endif /* BUILDING_CURL_NTLM_MSGS_C */ #endif /* USE_NTLM */ #endif /* HEADER_CURL_NTLM_MSGS_H */ curl-7.35.0/lib/config-tpf.h0000644000175000017500000005272312213173003012450 00000000000000#ifndef HEADER_CURL_CONFIG_TPF_H #define HEADER_CURL_CONFIG_TPF_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* ================================================================ */ /* Hand crafted config file for TPF */ /* ================================================================ */ /* ---------------------------------------------------------------- */ /* FEATURES, FUNCTIONS, and DEFINITIONS */ /* ---------------------------------------------------------------- */ /* NOTE: Refer also to the .mak file for some of the flags below */ /* 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 */ /* 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 if struct sockaddr_in6 has the sin6_scope_id member */ /* #undef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID */ /* 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 alarm function. */ #define HAVE_ALARM 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 /* 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 /* Define to 1 if you have the fcntl function. */ #define HAVE_FCNTL 1 /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ #define HAVE_FCNTL_O_NONBLOCK 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 a IPv6 capable working inet_ntop function. */ /* #undef HAVE_INET_NTOP */ /* Define to 1 if you have a IPv6 capable working inet_pton function. */ /* #undef HAVE_INET_PTON */ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the ioctl function. */ #define HAVE_IOCTL 1 /* Define to 1 if you have a working ioctl FIONBIO function. */ #define HAVE_IOCTL_FIONBIO 1 /* Define to 1 if you have the ioctlsocket function. */ /* #undef HAVE_IOCTLSOCKET */ /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_FIONBIO */ /* Define to 1 if you have the IoctlSocket camel case function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL */ /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ /* 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 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 /* Define to 1 if the compiler supports the 'long long' data type. */ #define HAVE_LONGLONG 1 /* 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 */ /* 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 /* 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 setsockopt function. */ /* #undef HAVE_SETSOCKOPT */ /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ /* 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 /* Define to 1 if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define to 1 if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T 1 /* Define to 1 if sig_atomic_t is already defined as volatile. */ /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ /* If you have sigsetjmp */ /* #undef HAVE_SIGSETJMP */ /* Define to 1 if you have the `socket' function. */ #define HAVE_SOCKET 1 /* 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 `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 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 */ /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ /* #undef NEED_REENTRANT */ /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ /* #undef NEED_THREAD_SAFE */ /* 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 `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* The size of `off_t', as computed by sizeof. */ #define SIZEOF_OFF_T 8 /* The size of `short', as computed by sizeof. */ #define SIZEOF_SHORT 2 /* The size of `size_t', as computed by sizeof. */ #define SIZEOF_SIZE_T 8 /* The size of `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 */ /* Define to disable non-blocking sockets */ /* #undef USE_BLOCKING_SOCKETS */ /* 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 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 */ /* 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 recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 int /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 char /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 int /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 int /* Define to the function return type for recvfrom. */ #define RECVFROM_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 #endif /* HEADER_CURL_CONFIG_TPF_H */ curl-7.35.0/lib/firefox-db2pem.sh0000644000175000017500000000354112213173003013402 00000000000000#!/bin/sh # *************************************************************************** # * _ _ ____ _ # * Project ___| | | | _ \| | # * / __| | | | |_) | | # * | (__| |_| | _ <| |___ # * \___|\___/|_| \_\_____| # * # * Copyright (C) 1998 - 2010, 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. # * # *************************************************************************** # This shell script creates a fresh ca-bundle.crt file for use with libcurl. # It extracts all ca certs it finds in the local Firefox database and converts # them all into PEM format. # db=`ls -1d $HOME/.mozilla/firefox/*default` out=$1 if test -z "$out"; then out="ca-bundle.crt" # use a sensible default fi currentdate=`date` cat >$out <> $out curl-7.35.0/lib/multiif.h0000644000175000017500000000761512270035364012077 00000000000000#ifndef HEADER_CURL_MULTIIF_H #define HEADER_CURL_MULTIIF_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ /* * Prototypes for library-wide functions provided by multi.c */ void Curl_expire(struct SessionHandle *data, long milli); bool Curl_multi_pipeline_enabled(const struct Curl_multi* multi); void Curl_multi_handlePipeBreak(struct SessionHandle *data); /* Internal version of curl_multi_init() accepts size parameters for the socket and connection hashes */ struct Curl_multi *Curl_multi_handle(int hashsize, int chashsize); /* 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)) #ifdef DEBUGBUILD /* * Curl_multi_dump is not a stable public function, this is only meant to * allow easier tracking of the internal handle's state and what sockets * they use. Only for research and development DEBUGBUILD enabled builds. */ void Curl_multi_dump(const struct Curl_multi *multi_handle); #endif /* Update the current connection of a One_Easy handle */ void Curl_multi_set_easy_connection(struct SessionHandle *handle, struct connectdata *conn); void Curl_multi_process_pending_handles(struct Curl_multi *multi); /* Return the value of the CURLMOPT_MAX_HOST_CONNECTIONS option */ size_t Curl_multi_max_host_connections(struct Curl_multi *multi); /* Return the value of the CURLMOPT_MAX_PIPELINE_LENGTH option */ size_t Curl_multi_max_pipeline_length(struct Curl_multi *multi); /* Return the value of the CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE option */ curl_off_t Curl_multi_content_length_penalty_size(struct Curl_multi *multi); /* Return the value of the CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE option */ curl_off_t Curl_multi_chunk_length_penalty_size(struct Curl_multi *multi); /* Return the value of the CURLMOPT_PIPELINING_SITE_BL option */ struct curl_llist *Curl_multi_pipelining_site_bl(struct Curl_multi *multi); /* Return the value of the CURLMOPT_PIPELINING_SERVER_BL option */ struct curl_llist *Curl_multi_pipelining_server_bl(struct Curl_multi *multi); /* Return the value of the CURLMOPT_MAX_TOTAL_CONNECTIONS option */ size_t Curl_multi_max_total_connections(struct Curl_multi *multi); /* * Curl_multi_closed() * * Used by the connect code to tell the multi_socket code that one of the * sockets we were using have just been closed. This function will then * remove it from the sockethash for this handle to make the multi_socket API * behave properly, especially for the case when libcurl will create another * socket again and it gets the same file descriptor number. */ void Curl_multi_closed(struct connectdata *conn, curl_socket_t s); #endif /* HEADER_CURL_MULTIIF_H */ curl-7.35.0/lib/curl_ntlm.h0000644000175000017500000000277412213173003012414 00000000000000#ifndef HEADER_CURL_NTLM_H #define HEADER_CURL_NTLM_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_NTLM /* this is for ntlm header input */ CURLcode Curl_input_ntlm(struct connectdata *conn, bool proxy, const char *header); /* this is for creating ntlm header output */ CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy); void Curl_http_ntlm_cleanup(struct connectdata *conn); #else #define Curl_http_ntlm_cleanup(a) Curl_nop_stmt #endif #endif /* HEADER_CURL_NTLM_H */ curl-7.35.0/lib/speedcheck.c0000644000175000017500000000517612213173003012505 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #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); long nextcheck = (data->set.low_speed_time * 1000) - howlong; /* 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(nextcheck <= 0) { /* we have been this slow for long enough, now die */ failf(data, "Operation too slow. " "Less than %ld bytes/sec transferred the last %ld seconds", data->set.low_speed_limit, data->set.low_speed_time); return CURLE_OPERATION_TIMEDOUT; } else { /* wait complete low_speed_time */ Curl_expire(data, nextcheck); } } 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; } curl-7.35.0/lib/progress.c0000644000175000017500000004222312270035364012257 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #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, curl_off_t seconds) { curl_off_t d, h, m, s; if(seconds <= 0) { strcpy(r, "--:--:--"); return; } h = seconds / CURL_OFF_T_C(3600); if(h <= CURL_OFF_T_C(99)) { m = (seconds - (h*CURL_OFF_T_C(3600))) / CURL_OFF_T_C(60); s = (seconds - (h*CURL_OFF_T_C(3600))) - (m*CURL_OFF_T_C(60)); snprintf(r, 9, "%2" CURL_FORMAT_CURL_OFF_T ":%02" CURL_FORMAT_CURL_OFF_T ":%02" CURL_FORMAT_CURL_OFF_T, h, m, s); } else { /* this equals to more than 99 hours, switch to a more suitable output format to fit within the limits. */ d = seconds / CURL_OFF_T_C(86400); h = (seconds - (d*CURL_OFF_T_C(86400))) / CURL_OFF_T_C(3600); if(d <= CURL_OFF_T_C(999)) snprintf(r, 9, "%3" CURL_FORMAT_CURL_OFF_T "d %02" CURL_FORMAT_CURL_OFF_T "h", d, h); else snprintf(r, 9, "%7" CURL_FORMAT_CURL_OFF_T "d", d); } } /* 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 CURL_OFF_T_C(1024) #define ONE_MEGABYTE (CURL_OFF_T_C(1024) * ONE_KILOBYTE) #define ONE_GIGABYTE (CURL_OFF_T_C(1024) * ONE_MEGABYTE) #define ONE_TERABYTE (CURL_OFF_T_C(1024) * ONE_GIGABYTE) #define ONE_PETABYTE (CURL_OFF_T_C(1024) * ONE_TERABYTE) if(bytes < CURL_OFF_T_C(100000)) snprintf(max5, 6, "%5" CURL_FORMAT_CURL_OFF_T, bytes); else if(bytes < CURL_OFF_T_C(10000) * ONE_KILOBYTE) snprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "k", bytes/ONE_KILOBYTE); else if(bytes < CURL_OFF_T_C(100) * ONE_MEGABYTE) /* 'XX.XM' is good as long as we're less than 100 megs */ snprintf(max5, 6, "%2" CURL_FORMAT_CURL_OFF_T ".%0" CURL_FORMAT_CURL_OFF_T "M", bytes/ONE_MEGABYTE, (bytes%ONE_MEGABYTE) / (ONE_MEGABYTE/CURL_OFF_T_C(10)) ); #if (CURL_SIZEOF_CURL_OFF_T > 4) else if(bytes < CURL_OFF_T_C(10000) * ONE_MEGABYTE) /* 'XXXXM' is good until we're at 10000MB or above */ snprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "M", bytes/ONE_MEGABYTE); else if(bytes < CURL_OFF_T_C(100) * ONE_GIGABYTE) /* 10000 MB - 100 GB, we show it as XX.XG */ snprintf(max5, 6, "%2" CURL_FORMAT_CURL_OFF_T ".%0" CURL_FORMAT_CURL_OFF_T "G", bytes/ONE_GIGABYTE, (bytes%ONE_GIGABYTE) / (ONE_GIGABYTE/CURL_OFF_T_C(10)) ); else if(bytes < CURL_OFF_T_C(10000) * ONE_GIGABYTE) /* up to 10000GB, display without decimal: XXXXG */ snprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "G", bytes/ONE_GIGABYTE); else if(bytes < CURL_OFF_T_C(10000) * ONE_TERABYTE) /* up to 10000TB, display without decimal: XXXXT */ snprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "T", bytes/ONE_TERABYTE); else /* up to 10000PB, display without decimal: XXXXP */ snprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "P", bytes/ONE_PETABYTE); /* 16384 petabytes (16 exabytes) is the maximum a 64 bit unsigned number can hold, but our data type is signed so 8192PB will be the maximum. */ #else else snprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "M", 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 */ int Curl_pgrsDone(struct connectdata *conn) { int rc; struct SessionHandle *data = conn->data; data->progress.lastshow=0; rc = Curl_pgrsUpdate(conn); /* the final (forced) update */ if(rc) return rc; 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"); data->progress.speeder_c = 0; /* reset the progress meter display */ return 0; } /* reset all times except redirect, and reset the known transfer sizes */ void Curl_pgrsResetTimesSizes(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; Curl_pgrsSetDownloadSize(data, 0); Curl_pgrsSetUploadSize(data, 0); } void Curl_pgrsTime(struct SessionHandle *data, timerid timer) { struct timeval now = Curl_tvnow(); 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 = now; break; case TIMER_STARTACCEPT: data->progress.t_acceptdata = Curl_tvnow(); break; case TIMER_NAMELOOKUP: data->progress.t_nslookup = Curl_tvdiff_secs(now, data->progress.t_startsingle); break; case TIMER_CONNECT: data->progress.t_connect = Curl_tvdiff_secs(now, data->progress.t_startsingle); break; case TIMER_APPCONNECT: data->progress.t_appconnect = Curl_tvdiff_secs(now, data->progress.t_startsingle); break; case TIMER_PRETRANSFER: data->progress.t_pretransfer = Curl_tvdiff_secs(now, data->progress.t_startsingle); break; case TIMER_STARTTRANSFER: data->progress.t_starttransfer = Curl_tvdiff_secs(now, 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(now, 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(); /* clear all bits except HIDE and HEADERS_OUT */ data->progress.flags &= PGRS_HIDE|PGRS_HEADERS_OUT; } 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; } /* * Curl_pgrsUpdate() returns 0 for success or the value returned by the * progress callback! */ int Curl_pgrsUpdate(struct connectdata *conn) { struct timeval now; int result; char max5[6][10]; curl_off_t dlpercen=0; curl_off_t ulpercen=0; curl_off_t total_percen=0; curl_off_t total_transfer; curl_off_t total_expected_transfer; curl_off_t 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]; curl_off_t ulestimate=0; curl_off_t dlestimate=0; curl_off_t total_estimate; bool shownow=FALSE; now = Curl_tvnow(); /* what time is it */ /* The time spent so far (from the start) */ data->progress.timespent = (double)(now.tv_sec - data->progress.start.tv_sec) + (double)(now.tv_usec - data->progress.start.tv_usec)/1000000.0; timespent = (curl_off_t)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)); /* Calculations done at most once a second, unless end is reached */ if(data->progress.lastshow != (long)now.tv_sec) { shownow = TRUE; 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 faster 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 > CURL_OFF_T_C(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*CURL_OFF_T_C(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; } /* Calculations end */ if(!(data->progress.flags & PGRS_HIDE)) { /* progress meter has not been shut off */ if(data->set.fxferinfo) { /* There's a callback set, call that */ result= data->set.fxferinfo(data->set.progress_client, data->progress.size_dl, data->progress.downloaded, data->progress.size_ul, data->progress.uploaded); if(result) failf(data, "Callback aborted"); return result; } else if(data->set.fprogress) { /* The older deprecated callback is set, call that */ 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; } if(!shownow) /* only show the internal progress meter once per second */ return 0; /* If there's no external callback set, use internal code to show progress */ if(!(data->progress.flags & PGRS_HEADERS_OUT)) { if(data->state.resume_from) { fprintf(data->set.err, "** Resuming transfer from byte position %" CURL_FORMAT_CURL_OFF_T "\n", data->state.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 */ } /* Figure out the estimated time of arrival for the upload */ if((data->progress.flags & PGRS_UL_SIZE_KNOWN) && (data->progress.ulspeed > CURL_OFF_T_C(0))) { ulestimate = data->progress.size_ul / data->progress.ulspeed; if(data->progress.size_ul > CURL_OFF_T_C(10000)) ulpercen = data->progress.uploaded / (data->progress.size_ul/CURL_OFF_T_C(100)); else if(data->progress.size_ul > CURL_OFF_T_C(0)) ulpercen = (data->progress.uploaded*100) / data->progress.size_ul; } /* ... and the download */ if((data->progress.flags & PGRS_DL_SIZE_KNOWN) && (data->progress.dlspeed > CURL_OFF_T_C(0))) { dlestimate = data->progress.size_dl / data->progress.dlspeed; if(data->progress.size_dl > CURL_OFF_T_C(10000)) dlpercen = data->progress.downloaded / (data->progress.size_dl/CURL_OFF_T_C(100)); else if(data->progress.size_dl > CURL_OFF_T_C(0)) dlpercen = (data->progress.downloaded*100) / data->progress.size_dl; } /* Now figure out which of them is slower and use that one for the 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 transferred */ 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 transferred this much so far */ total_transfer = data->progress.downloaded + data->progress.uploaded; /* Get the percentage of data transferred so far */ if(total_expected_transfer > CURL_OFF_T_C(10000)) total_percen = total_transfer / (total_expected_transfer/CURL_OFF_T_C(100)); else if(total_expected_transfer > CURL_OFF_T_C(0)) total_percen = (total_transfer*100) / total_expected_transfer; fprintf(data->set.err, "\r" "%3" CURL_FORMAT_CURL_OFF_T " %s " "%3" CURL_FORMAT_CURL_OFF_T " %s " "%3" CURL_FORMAT_CURL_OFF_T " %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); } /* !(data->progress.flags & PGRS_HIDE) */ return 0; } curl-7.35.0/lib/http.c0000644000175000017500000033756212271275502011410 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_HTTP #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_SYS_PARAM_H #include #endif #include "urldata.h" #include #include "transfer.h" #include "sendf.h" #include "formdata.h" #include "progress.h" #include "curl_base64.h" #include "cookie.h" #include "strequal.h" #include "vtls/vtls.h" #include "http_digest.h" #include "curl_ntlm.h" #include "curl_ntlm_wb.h" #include "http_negotiate.h" #include "url.h" #include "share.h" #include "hostip.h" #include "http.h" #include "curl_memory.h" #include "select.h" #include "parsedate.h" /* for the week day and month names */ #include "strtoofft.h" #include "multiif.h" #include "rawstr.h" #include "content_encoding.h" #include "http_proxy.h" #include "warnless.h" #include "non-ascii.h" #include "bundles.h" #include "pipeline.h" #include "http2.h" #define _MPRINTF_REPLACE /* use our functions only */ #include /* The last #include file should be: */ #include "memdebug.h" /* * Forward declarations. */ static int http_getsock_do(struct connectdata *conn, curl_socket_t *socks, int numsocks); static int http_should_fail(struct connectdata *conn); #ifdef USE_SSL static CURLcode https_connecting(struct connectdata *conn, bool *done); static int https_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks); #else #define https_connecting(x,y) CURLE_COULDNT_CONNECT #endif /* * HTTP handler interface. */ const struct Curl_handler Curl_handler_http = { "HTTP", /* scheme */ Curl_http_setup_conn, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ ZERO_NULL, /* do_more */ Curl_http_connect, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ http_getsock_do, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_HTTP, /* defport */ CURLPROTO_HTTP, /* protocol */ PROTOPT_NONE /* flags */ }; #ifdef USE_SSL /* * HTTPS handler interface. */ const struct Curl_handler Curl_handler_https = { "HTTPS", /* scheme */ Curl_http_setup_conn, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ ZERO_NULL, /* do_more */ Curl_http_connect, /* connect_it */ https_connecting, /* connecting */ ZERO_NULL, /* doing */ https_getsock, /* proto_getsock */ http_getsock_do, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_HTTPS, /* defport */ CURLPROTO_HTTP | CURLPROTO_HTTPS, /* protocol */ PROTOPT_SSL /* flags */ }; #endif CURLcode Curl_http_setup_conn(struct connectdata *conn) { /* allocate the HTTP-specific struct for the SessionHandle, only to survive during this request */ DEBUGASSERT(conn->data->req.protop == NULL); conn->data->req.protop = calloc(1, sizeof(struct HTTP)); if(!conn->data->req.protop) return CURLE_OUT_OF_MEMORY; return CURLE_OK; } /* * 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. */ char *Curl_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(Curl_raw_nequal(head->data, thisheader, thislen)) return head->data; } return NULL; } /* * Strip off leading and trailing whitespace from the value in the * given HTTP header line and return a strdupped copy. Returns NULL in * case of allocation failure. Returns an empty string if the header value * consists entirely of whitespace. */ char *Curl_copy_header_value(const char *header) { const char *start; const char *end; char *value; size_t len; DEBUGASSERT(header); /* Find the end of the header name */ while(*header && (*header != ':')) ++header; if(*header) /* Skip over colon */ ++header; /* Find the first non-space letter */ start = header; while(*start && ISSPACE(*start)) start++; /* data is in the host encoding so use '\r' and '\n' instead of 0x0d and 0x0a */ end = strchr(start, '\r'); if(!end) end = strchr(start, '\n'); if(!end) end = strchr(start, '\0'); if(!end) return NULL; /* skip all trailing space letters */ while((end > start) && ISSPACE(*end)) end--; /* get length of the type */ len = end - start + 1; value = malloc(len + 1); if(!value) return NULL; memcpy(value, start, len); value[len] = 0; /* zero terminate */ return value; } /* * http_output_basic() sets up an Authorization: header (or the proxy version) * for HTTP Basic authentication. * * Returns CURLcode. */ static CURLcode http_output_basic(struct connectdata *conn, bool proxy) { size_t size = 0; char *authorization = NULL; struct SessionHandle *data = conn->data; char **userp; const char *user; const char *pwd; CURLcode error; 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); error = Curl_base64_encode(data, data->state.buffer, strlen(data->state.buffer), &authorization, &size); if(error) return error; if(!authorization) return CURLE_REMOTE_ACCESS_DENIED; Curl_safefree(*userp); *userp = aprintf("%sAuthorization: Basic %s\r\n", proxy?"Proxy-":"", authorization); free(authorization); if(!*userp) 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 */ unsigned 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 existence 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_NTLM_WB) pick->picked = CURLAUTH_NTLM_WB; 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; } /* * Curl_http_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 http_perhapsrewind(struct connectdata *conn) { struct SessionHandle *data = conn->data; struct HTTP *http = data->req.protop; 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; switch(data->set.httpreq) { case HTTPREQ_GET: case HTTPREQ_HEAD: return CURLE_OK; default: break; } 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; else if(data->set.postfields) expectsend = (curl_off_t)strlen(data->set.postfields); 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) || (data->state.authproxy.picked == CURLAUTH_NTLM_WB) || (data->state.authhost.picked == CURLAUTH_NTLM_WB)) { if(((expectsend - bytessent) < 2000) || (conn->ntlm.state != NTLMSTATE_NONE) || (conn->proxyntlm.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; infof(data, "Rewind stream after send\n"); } 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 %" CURL_FORMAT_CURL_OFF_T " bytes\n", (curl_off_t)(expectsend - bytessent)); } /* This is not NTLM or many bytes left to send: close */ conn->bits.close = TRUE; data->req.size = 0; /* don't download any more than 0 bytes */ /* There still is data left to send, but this connection is marked for closure so we can safely do the rewind right now */ } if(bytessent) /* we rewind now at once since if we already sent something */ return Curl_readrewind(conn); return CURLE_OK; } /* * Curl_http_auth_act() gets called when 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 method 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->req.httpcode && 199 >= data->req.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->req.httpcode == 401) || (conn->bits.authneg && data->req.httpcode < 300))) { pickhost = pickoneauth(&data->state.authhost); if(!pickhost) data->state.authproblem = TRUE; } if(conn->bits.proxy_user_passwd && ((data->req.httpcode == 407) || (conn->bits.authneg && data->req.httpcode < 300))) { pickproxy = pickoneauth(&data->state.authproxy); if(!pickproxy) data->state.authproblem = TRUE; } if(pickhost || pickproxy) { /* In case this is GSS auth, the newurl field is already allocated so we must make sure to free it before allocating a new one. As figured out in bug #2284386 */ Curl_safefree(data->req.newurl); data->req.newurl = strdup(data->change.url); /* clone URL */ if(!data->req.newurl) return CURLE_OUT_OF_MEMORY; if((data->set.httpreq != HTTPREQ_GET) && (data->set.httpreq != HTTPREQ_HEAD) && !conn->bits.rewindaftersend) { code = http_perhapsrewind(conn); if(code) return code; } } else if((data->req.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->req.newurl = strdup(data->change.url); /* clone URL */ if(!data->req.newurl) return CURLE_OUT_OF_MEMORY; data->state.authhost.done = TRUE; } } if(http_should_fail(conn)) { failf (data, "The requested URL returned error: %d", data->req.httpcode); code = CURLE_HTTP_RETURNED_ERROR; } return code; } /* * Output the correct authentication header depending on the auth type * and whether or not it is to a proxy. */ static CURLcode output_auth_headers(struct connectdata *conn, struct auth *authstatus, const char *request, const char *path, bool proxy) { struct SessionHandle *data = conn->data; const char *auth=NULL; CURLcode result = CURLE_OK; #ifdef USE_HTTP_NEGOTIATE struct negotiatedata *negdata = proxy? &data->state.proxyneg:&data->state.negotiate; #endif #ifdef CURL_DISABLE_CRYPTO_AUTH (void)request; (void)path; #endif #ifdef USE_HTTP_NEGOTIATE negdata->state = GSS_AUTHNONE; if((authstatus->picked == CURLAUTH_GSSNEGOTIATE) && negdata->context && !GSS_ERROR(negdata->status)) { auth="GSS-Negotiate"; result = Curl_output_negotiate(conn, proxy); if(result) return result; authstatus->done = TRUE; negdata->state = GSS_AUTHSENT; } else #endif #ifdef USE_NTLM if(authstatus->picked == CURLAUTH_NTLM) { auth="NTLM"; result = Curl_output_ntlm(conn, proxy); if(result) return result; } else #endif #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) if(authstatus->picked == CURLAUTH_NTLM_WB) { auth="NTLM_WB"; result = Curl_output_ntlm_wb(conn, proxy); if(result) return result; } else #endif #ifndef CURL_DISABLE_CRYPTO_AUTH if(authstatus->picked == CURLAUTH_DIGEST) { auth="Digest"; result = Curl_output_digest(conn, proxy, (const unsigned char *)request, (const unsigned char *)path); if(result) return result; } else #endif if(authstatus->picked == CURLAUTH_BASIC) { /* Basic */ if((proxy && conn->bits.proxy_user_passwd && !Curl_checkheaders(data, "Proxy-authorization:")) || (!proxy && conn->bits.user_passwd && !Curl_checkheaders(data, "Authorization:"))) { auth="Basic"; result = http_output_basic(conn, proxy); if(result) return result; } /* NOTE: this function should set 'done' TRUE, as the other auth functions work that way */ authstatus->done = TRUE; } if(auth) { infof(data, "%s auth using %s with user '%s'\n", proxy?"Proxy":"Server", auth, proxy?(conn->proxyuser?conn->proxyuser:""): (conn->user?conn->user:"")); authstatus->multi = (!authstatus->done) ? TRUE : FALSE; } else authstatus->multi = FALSE; return CURLE_OK; } /** * 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 */ CURLcode Curl_http_output_auth(struct connectdata *conn, const char *request, const char *path, bool proxytunnel) /* TRUE if this is the request setting up the proxy tunnel */ { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct auth *authhost; struct auth *authproxy; DEBUGASSERT(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; #ifndef CURL_DISABLE_PROXY /* Send proxy authentication header if needed */ if(conn->bits.httpproxy && (conn->bits.tunnel_proxy == proxytunnel)) { result = output_auth_headers(conn, authproxy, request, path, TRUE); if(result) return result; } else #else (void)proxytunnel; #endif /* CURL_DISABLE_PROXY */ /* 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 || data->set.http_disable_hostname_check_before_authentication || Curl_raw_equal(data->state.first_host, conn->host.name)) { result = output_auth_headers(conn, authhost, request, path, 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, bool proxy, const char *auth) /* the first non-space */ { /* * This resource requires authentication */ struct SessionHandle *data = conn->data; unsigned long *availp; struct auth *authp; if(proxy) { availp = &data->info.proxyauthavail; authp = &data->state.authproxy; } else { availp = &data->info.httpauthavail; authp = &data->state.authhost; } /* * 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. * * Note: * * ->picked is first set to the 'want' value (one or more bits) before the * request is sent, and then it is again set _after_ all response 401/407 * headers have been received but then only to a single preferred method * (bit). * */ while(*auth) { #ifdef USE_HTTP_NEGOTIATE if(checkprefix("GSS-Negotiate", auth) || checkprefix("Negotiate", auth)) { int neg; *availp |= CURLAUTH_GSSNEGOTIATE; authp->avail |= CURLAUTH_GSSNEGOTIATE; if(authp->picked == CURLAUTH_GSSNEGOTIATE) { if(data->state.negotiate.state == GSS_AUTHSENT) { /* if we sent GSS authentication in the outgoing request and we get this back, we're in trouble */ infof(data, "Authentication problem. Ignoring this.\n"); data->state.authproblem = TRUE; } else { neg = Curl_input_negotiate(conn, proxy, auth); if(neg == 0) { DEBUGASSERT(!data->req.newurl); data->req.newurl = strdup(data->change.url); if(!data->req.newurl) return CURLE_OUT_OF_MEMORY; data->state.authproblem = FALSE; /* we received GSS auth info and we dealt with it fine */ data->state.negotiate.state = GSS_AUTHRECV; } else data->state.authproblem = TRUE; } } } else #endif #ifdef USE_NTLM /* NTLM support requires the SSL crypto libs */ if(checkprefix("NTLM", auth)) { *availp |= CURLAUTH_NTLM; authp->avail |= CURLAUTH_NTLM; if(authp->picked == CURLAUTH_NTLM || authp->picked == CURLAUTH_NTLM_WB) { /* NTLM authentication is picked and activated */ CURLcode ntlm = Curl_input_ntlm(conn, proxy, auth); if(CURLE_OK == ntlm) { data->state.authproblem = FALSE; #ifdef NTLM_WB_ENABLED if(authp->picked == CURLAUTH_NTLM_WB) { *availp &= ~CURLAUTH_NTLM; authp->avail &= ~CURLAUTH_NTLM; *availp |= CURLAUTH_NTLM_WB; authp->avail |= CURLAUTH_NTLM_WB; /* Get the challenge-message which will be passed to * ntlm_auth for generating the type 3 message later */ while(*auth && ISSPACE(*auth)) auth++; if(checkprefix("NTLM", auth)) { auth += strlen("NTLM"); while(*auth && ISSPACE(*auth)) auth++; if(*auth) if((conn->challenge_header = strdup(auth)) == NULL) return CURLE_OUT_OF_MEMORY; } } #endif } else { infof(data, "Authentication problem. Ignoring this.\n"); data->state.authproblem = TRUE; } } } else #endif #ifndef CURL_DISABLE_CRYPTO_AUTH if(checkprefix("Digest", auth)) { 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, proxy, auth); if(CURLDIGEST_FINE != dig) { infof(data, "Authentication problem. Ignoring this.\n"); data->state.authproblem = TRUE; } } } else #endif if(checkprefix("Basic", auth)) { *availp |= CURLAUTH_BASIC; authp->avail |= CURLAUTH_BASIC; if(authp->picked == CURLAUTH_BASIC) { /* We asked for Basic authentication but got a 40X back anyway, which basically means our name+password isn't valid. */ authp->avail = CURLAUTH_NONE; infof(data, "Authentication problem. Ignoring this.\n"); data->state.authproblem = TRUE; } } /* there may be multiple methods on one line, so keep reading */ while(*auth && *auth != ',') /* read up to the next comma */ auth++; if(*auth == ',') /* if we're on a comma, skip it */ auth++; while(*auth && ISSPACE(*auth)) auth++; } return CURLE_OK; } /** * 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 */ static int http_should_fail(struct connectdata *conn) { struct SessionHandle *data; int httpcode; DEBUGASSERT(conn); data = conn->data; DEBUGASSERT(data); httpcode = data->req.httpcode; /* ** 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(httpcode < 400) return 0; if(data->state.resume_from && (data->set.httpreq==HTTPREQ_GET) && (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((httpcode != 401) && (httpcode != 407)) return 1; /* ** All we have left to deal with is 401 and 407 */ DEBUGASSERT((httpcode == 401) || (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. */ /* ** Either we're not authenticating, or we're supposed to ** be authenticating something else. This is an error. */ if((httpcode == 401) && !conn->bits.user_passwd) return TRUE; if((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->req.protop; 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->data->req.forbidchunk = (http->sending == HTTPSEND_REQUEST)?TRUE:FALSE; 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_func = http->backup.fread_func; 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; } /* ------------------------------------------------------------------------- */ /* add_buffer functions */ /* * Curl_add_buffer_init() sets up and returns a fine buffer struct */ Curl_send_buffer *Curl_add_buffer_init(void) { return calloc(1, sizeof(Curl_send_buffer)); } /* * Curl_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 */ CURLcode Curl_add_buffer_send(Curl_send_buffer *in, struct connectdata *conn, /* add the number of sent bytes to this counter */ long *bytes_written, /* how much of the buffer contains body data */ size_t included_body_bytes, int socketindex) { ssize_t amount; CURLcode res; char *ptr; size_t size; struct HTTP *http = conn->data->req.protop; size_t sendsize; curl_socket_t sockfd; size_t headersize; DEBUGASSERT(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; headersize = size - included_body_bytes; /* the initial part that isn't body is header */ DEBUGASSERT(size > included_body_bytes); res = Curl_convert_to_network(conn->data, ptr, headersize); /* Curl_convert_to_network calls failf if unsuccessful */ if(res) { /* conversion failed, free memory and return to the caller */ if(in->buffer) free(in->buffer); free(in); return res; } if(conn->handler->flags & PROTOPT_SSL) { /* 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) { /* * Note that we may not send the entire chunk at once, and we have a set * number of data bytes at the end of the big buffer (out of which we may * only send away a part). */ /* how much of the header that was sent */ size_t headlen = (size_t)amount>headersize?headersize:(size_t)amount; size_t bodylen = amount - headlen; if(conn->data->set.verbose) { /* this data _may_ contain binary stuff */ Curl_debug(conn->data, CURLINFO_HEADER_OUT, ptr, headlen, conn); if(bodylen) { /* there was body data sent beyond the initial header part, pass that on to the debug callback too */ Curl_debug(conn->data, CURLINFO_DATA_OUT, ptr+headlen, bodylen, conn); } } if(bodylen) /* since we sent a piece of the body here, up the byte counter for it accordingly */ http->writebytecount += bodylen; /* 'amount' can never be a very large value here so typecasting it so a signed 31 bit value should not cause problems even if ssize_t is 64bit */ *bytes_written += (long)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_func = conn->fread_func; 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_func = (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. */ CURLcode Curl_add_bufferf(Curl_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 = Curl_add_buffer(in, s, strlen(s)); free(s); return result; } /* 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 */ CURLcode Curl_add_buffer(Curl_send_buffer *in, const void *inptr, size_t size) { char *new_rb; size_t new_size; if(~size < in->size_used) { /* If resulting used size of send buffer would wrap size_t, cleanup the whole buffer and return error. Otherwise the required buffer size will fit into a single allocatable memory chunk */ Curl_safefree(in->buffer); free(in); return CURLE_OUT_OF_MEMORY; } if(!in->buffer || ((in->size_used + size) > (in->size_max - 1))) { /* If current buffer size isn't enough to hold the result, use a buffer size that doubles the required size. If this new size would wrap size_t, then just use the largest possible one */ if((size > (size_t)-1/2) || (in->size_used > (size_t)-1/2) || (~(size*2) < (in->size_used*2))) new_size = (size_t)-1; else new_size = (in->size_used+size)*2; if(in->buffer) /* we have a buffer, enlarge the existing one */ new_rb = realloc(in->buffer, new_size); else /* create a new buffer */ new_rb = malloc(new_size); if(!new_rb) { /* If we failed, we cleanup the whole buffer and return error */ Curl_safefree(in->buffer); free(in); 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(const 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; const char *start; const char *end; if(!Curl_raw_nequal(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(Curl_raw_nequal(start, content, clen)) return TRUE; /* match! */ } return FALSE; /* no match */ } /* * 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) { CURLcode result; /* We default to persistent connections. We set this already in this connect function to make the re-use checks properly be able to check this bit. */ conn->bits.close = FALSE; /* the CONNECT procedure might not have been completed */ result = Curl_proxy_connect(conn); if(result) return result; if(conn->tunnel_state[FIRSTSOCKET] == TUNNEL_CONNECT) /* nothing else to do except wait right now - we're not done here. */ return CURLE_OK; if(conn->given->flags & PROTOPT_SSL) { /* perform SSL initialization */ result = https_connecting(conn, done); if(result) return result; } else *done = TRUE; return CURLE_OK; } /* this returns the socket to wait for in the DO and DOING state for the multi interface and then we're always _sending_ a request and thus we wait for the single socket to become writable only */ static int http_getsock_do(struct connectdata *conn, curl_socket_t *socks, int numsocks) { /* write mode */ (void)numsocks; /* unused, we trust it to be at least 1 */ socks[0] = conn->sock[FIRSTSOCKET]; return GETSOCK_WRITESOCK(0); } #ifdef USE_SSL static CURLcode https_connecting(struct connectdata *conn, bool *done) { CURLcode result; DEBUGASSERT((conn) && (conn->handler->flags & PROTOPT_SSL)); /* perform SSL initialization for this socket */ result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, done); if(result) conn->bits.close = TRUE; /* a failed connection is marked for closure to prevent (bad) re-use or similar */ return result; } #endif #if defined(USE_SSLEAY) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \ defined(USE_DARWINSSL) /* This function is for OpenSSL, GnuTLS, darwinssl, and schannel only. It should be made to query the generic SSL layer instead. */ static int https_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { if(conn->handler->flags & PROTOPT_SSL) { 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_SSL static int https_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { (void)conn; (void)socks; (void)numsocks; return GETSOCK_BLANK; } #endif /* USE_SSL */ #endif /* USE_SSLEAY || USE_GNUTLS || USE_SCHANNEL */ /* * 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, bool premature) { struct SessionHandle *data = conn->data; struct HTTP *http =data->req.protop; Curl_unencode_cleanup(conn); /* set the proper values (possibly modified on POST) */ conn->fread_func = data->set.fread_func; /* restore */ conn->fread_in = data->set.in; /* restore */ conn->seek_func = data->set.seek_func; /* restore */ conn->seek_client = data->set.seek_client; /* restore */ if(http == NULL) return CURLE_OK; if(http->send_buffer) { Curl_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) { data->req.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) data->req.bytecount = http->readbytecount + http->writebytecount; if(status != CURLE_OK) return (status); if(!premature && /* this check is pointless when DONE is called before the entire operation is complete */ !conn->bits.retry && !data->set.connect_only && ((http->readbytecount + data->req.headerbytecount - data->req.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; } /* * Determine if we should use HTTP 1.1 (OR BETTER) for this request. Reasons * to avoid it include: * * - if the user specifically requested HTTP 1.0 * - if the server we are connected to only supports 1.0 * - if any server previously contacted to handle this request only supports * 1.0. */ static bool use_http_1_1plus(const struct SessionHandle *data, const struct connectdata *conn) { return ((data->set.httpversion >= CURL_HTTP_VERSION_1_1) || ((data->set.httpversion != CURL_HTTP_VERSION_1_0) && ((conn->httpversion == 11) || ((conn->httpversion != 10) && (data->state.httpversion != 10))))) ? TRUE : FALSE; } /* check and possibly add an Expect: header */ static CURLcode expect100(struct SessionHandle *data, struct connectdata *conn, Curl_send_buffer *req_buffer) { CURLcode result = CURLE_OK; const char *ptr; data->state.expect100header = FALSE; /* default to false unless it is set to TRUE below */ if(use_http_1_1plus(data, conn)) { /* 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) */ ptr = Curl_checkheaders(data, "Expect:"); if(ptr) { data->state.expect100header = Curl_compareheader(ptr, "Expect:", "100-continue"); } else { result = Curl_add_bufferf(req_buffer, "Expect: 100-continue\r\n"); if(result == CURLE_OK) data->state.expect100header = TRUE; } } return result; } CURLcode Curl_add_custom_headers(struct connectdata *conn, Curl_send_buffer *req_buffer) { 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! */ checkprefix("Host:", headers->data)) ; else if(conn->data->set.httpreq == HTTPREQ_POST_FORM && /* this header (extended by formdata.c) is sent later */ checkprefix("Content-Type:", headers->data)) ; else if(conn->bits.authneg && /* while doing auth neg, don't allow the custom length since we will force length zero then */ checkprefix("Content-Length", headers->data)) ; else if(conn->allocptr.te && /* when asking for Transfer-Encoding, don't pass on a custom Connection: */ checkprefix("Connection", headers->data)) ; else { CURLcode result = Curl_add_bufferf(req_buffer, "%s\r\n", headers->data); if(result) return result; } } } else { ptr = strchr(headers->data, ';'); if(ptr) { ptr++; /* pass the semicolon */ while(*ptr && ISSPACE(*ptr)) ptr++; if(*ptr) { /* this may be used for something else in the future */ } else { if(*(--ptr) == ';') { CURLcode result; /* send no-value custom header if terminated by semicolon */ *ptr = ':'; result = Curl_add_bufferf(req_buffer, "%s\r\n", headers->data); if(result) return result; } } } } headers = headers->next; } return CURLE_OK; } CURLcode Curl_add_timecondition(struct SessionHandle *data, Curl_send_buffer *req_buffer) { const struct tm *tm; char *buf = data->state.buffer; CURLcode result = CURLE_OK; struct tm keeptime; result = Curl_gmtime(data->set.timevalue, &keeptime); if(result) { failf(data, "Invalid TIMEVALUE"); return result; } tm = &keeptime; /* 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). */ /* 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 = Curl_add_bufferf(req_buffer, "If-Modified-Since: %s\r\n", buf); break; case CURL_TIMECOND_IFUNMODSINCE: result = Curl_add_bufferf(req_buffer, "If-Unmodified-Since: %s\r\n", buf); break; case CURL_TIMECOND_LASTMOD: result = Curl_add_bufferf(req_buffer, "Last-Modified: %s\r\n", buf); break; } 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; CURLcode result=CURLE_OK; struct HTTP *http; const char *ppath = data->state.path; bool paste_ftp_userpwd = FALSE; char ftp_typecode[sizeof("/;type=?")] = ""; const char *host = conn->host.name; const char *te = ""; /* transfer-encoding */ const char *ptr; const char *request; Curl_HttpReq httpreq = data->set.httpreq; char *addcookies = NULL; curl_off_t included_body = 0; const char *httpstring; Curl_send_buffer *req_buffer; curl_off_t postsize = 0; /* curl_off_t to handle large file sizes */ int seekerr = CURL_SEEKFUNC_OK; /* 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; http = data->req.protop; 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(!data->state.first_host) return CURLE_OUT_OF_MEMORY; } http->writebytecount = http->readbytecount = 0; if((conn->handler->protocol&(CURLPROTO_HTTP|CURLPROTO_FTP)) && data->set.upload) { httpreq = HTTPREQ_PUT; } /* Now set the 'request' pointer to the proper request string */ if(data->set.str[STRING_CUSTOMREQUEST]) request = data->set.str[STRING_CUSTOMREQUEST]; else { if(data->set.opt_no_body) request = "HEAD"; else { DEBUGASSERT((httpreq > HTTPREQ_NONE) && (httpreq < HTTPREQ_LAST)); switch(httpreq) { case HTTPREQ_POST: case HTTPREQ_POST_FORM: request = "POST"; break; case HTTPREQ_PUT: request = "PUT"; break; default: /* this should never happen */ case HTTPREQ_GET: request = "GET"; break; case HTTPREQ_HEAD: request = "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(Curl_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 && !Curl_checkheaders(data, "Referer:")) { conn->allocptr.ref = aprintf("Referer: %s\r\n", data->change.referer); if(!conn->allocptr.ref) return CURLE_OUT_OF_MEMORY; } else conn->allocptr.ref = NULL; if(data->set.str[STRING_COOKIE] && !Curl_checkheaders(data, "Cookie:")) addcookies = data->set.str[STRING_COOKIE]; if(!Curl_checkheaders(data, "Accept-Encoding:") && data->set.str[STRING_ENCODING]) { Curl_safefree(conn->allocptr.accept_encoding); conn->allocptr.accept_encoding = aprintf("Accept-Encoding: %s\r\n", data->set.str[STRING_ENCODING]); if(!conn->allocptr.accept_encoding) return CURLE_OUT_OF_MEMORY; } #ifdef HAVE_LIBZ /* we only consider transfer-encoding magic if libz support is built-in */ if(!Curl_checkheaders(data, "TE:") && data->set.http_transfer_encoding) { /* When we are to insert a TE: header in the request, we must also insert TE in a Connection: header, so we need to merge the custom provided Connection: header and prevent the original to get sent. Note that if the user has inserted his/hers own TE: header we don't do this magic but then assume that the user will handle it all! */ char *cptr = Curl_checkheaders(data, "Connection:"); #define TE_HEADER "TE: gzip\r\n" Curl_safefree(conn->allocptr.te); /* Create the (updated) Connection: header */ conn->allocptr.te = cptr? aprintf("%s, TE\r\n" TE_HEADER, cptr): strdup("Connection: TE\r\n" TE_HEADER); if(!conn->allocptr.te) return CURLE_OUT_OF_MEMORY; } #endif ptr = Curl_checkheaders(data, "Transfer-Encoding:"); if(ptr) { /* Some kind of TE is requested, check if 'chunked' is chosen */ data->req.upload_chunky = Curl_compareheader(ptr, "Transfer-Encoding:", "chunked"); } else { if((conn->handler->protocol&CURLPROTO_HTTP) && data->set.upload && (data->set.infilesize == -1)) { if(conn->bits.authneg) /* don't enable chunked during auth neg */ ; else if(use_http_1_1plus(data, conn)) { /* HTTP, upload, unknown file size and not HTTP 1.0 */ data->req.upload_chunky = TRUE; } else { failf(data, "Chunky upload is not supported by HTTP 1.0"); return CURLE_UPLOAD_FAILED; } } else { /* else, no chunky upload */ data->req.upload_chunky = FALSE; } if(data->req.upload_chunky) te = "Transfer-Encoding: chunked\r\n"; } Curl_safefree(conn->allocptr.host); ptr = Curl_checkheaders(data, "Host:"); if(ptr && (!data->state.this_is_a_follow || Curl_raw_equal(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 *cookiehost = Curl_copy_header_value(ptr); if(!cookiehost) return CURLE_OUT_OF_MEMORY; if(!*cookiehost) /* ignore empty data */ free(cookiehost); else { /* If the host begins with '[', we start searching for the port after the bracket has been closed */ int startsearch = 0; if(*cookiehost == '[') { char *closingbracket; /* since the 'cookiehost' is an allocated memory area that will be freed later we cannot simply increment the pointer */ memmove(cookiehost, cookiehost + 1, strlen(cookiehost) - 1); closingbracket = strchr(cookiehost, ']'); if(closingbracket) *closingbracket = 0; } else { char *colon = strchr(cookiehost + startsearch, ':'); if(colon) *colon = 0; /* The host must not include an embedded port number */ } Curl_safefree(conn->allocptr.cookiehost); conn->allocptr.cookiehost = cookiehost; } #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->given->protocol&CURLPROTO_HTTPS) && (conn->remote_port == PORT_HTTPS)) || ((conn->given->protocol&CURLPROTO_HTTP) && (conn->remote_port == PORT_HTTP)) ) /* if(HTTPS on port 443) OR (HTTP 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:%hu\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; } #ifndef CURL_DISABLE_PROXY 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) { Curl_safefree(data->change.url); data->change.url_alloc = FALSE; } data->change.url = newurl; data->change.url_alloc = TRUE; } else return CURLE_OUT_OF_MEMORY; } } ppath = data->change.url; if(checkprefix("ftp://", ppath)) { if(data->set.proxy_transfer_mode) { /* when doing ftp, append ;type= if not present */ char *type = strstr(ppath, ";type="); if(type && type[6] && type[7] == 0) { switch (Curl_raw_toupper(type[6])) { case 'A': case 'D': case 'I': break; default: type = NULL; } } if(!type) { char *p = ftp_typecode; /* avoid sending invalid URLs like ftp://example.com;type=i if the * user specified ftp://example.com without the slash */ if(!*data->state.path && ppath[strlen(ppath) - 1] != '/') { *p++ = '/'; } snprintf(p, sizeof(ftp_typecode) - 1, ";type=%c", data->set.prefer_ascii ? 'a' : 'i'); } } if(conn->bits.user_passwd && !conn->bits.userpwd_in_url) paste_ftp_userpwd = TRUE; } } #endif /* CURL_DISABLE_PROXY */ if(HTTPREQ_POST_FORM == httpreq) { /* we must build the whole post sequence first, so that we have a size of the whole transfer before we start to send it */ result = Curl_getformdata(data, &http->sendit, data->set.httppost, Curl_checkheaders(data, "Content-Type:"), &http->postsize); if(result) return result; } http->p_accept = Curl_checkheaders(data, "Accept:")?NULL:"Accept: */*\r\n"; if(( (HTTPREQ_POST == httpreq) || (HTTPREQ_POST_FORM == httpreq) || (HTTPREQ_PUT == httpreq) ) && data->state.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->state.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->state.resume_from = 0; } if(data->state.resume_from && !data->state.this_is_a_follow) { /* do we still game? */ /* Now, let's read off the proper amount of bytes from the input. */ if(conn->seek_func) { seekerr = conn->seek_func(conn->seek_client, data->state.resume_from, SEEK_SET); } if(seekerr != CURL_SEEKFUNC_OK) { if(seekerr != CURL_SEEKFUNC_CANTSEEK) { failf(data, "Could not seek stream"); return CURLE_READ_ERROR; } /* when seekerr == CURL_SEEKFUNC_CANTSEEK (can't seek to offset) */ else { curl_off_t passed=0; do { size_t readthisamountnow = (data->state.resume_from - passed > CURL_OFF_T_C(BUFSIZE)) ? BUFSIZE : curlx_sotouz(data->state.resume_from - passed); size_t actuallyread = data->set.fread_func(data->state.buffer, 1, readthisamountnow, data->set.in); passed += actuallyread; if((actuallyread == 0) || (actuallyread > readthisamountnow)) { /* this checks for greater-than only to make sure that the CURL_READFUNC_ABORT return code still aborts */ failf(data, "Could only read %" CURL_FORMAT_CURL_OFF_T " bytes from the input", passed); return CURLE_READ_ERROR; } } while(passed < data->state.resume_from); } } /* now, decrease the size of the read */ if(data->set.infilesize>0) { data->set.infilesize -= data->state.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->state.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) || (httpreq == HTTPREQ_HEAD)) && !Curl_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->state.range); } else if((httpreq != HTTPREQ_GET) && !Curl_checkheaders(data, "Content-Range:")) { /* if a line like this was already allocated, free the previous one */ if(conn->allocptr.rangeline) free(conn->allocptr.rangeline); if(data->set.set_resume_from < 0) { /* Upload resume was asked for, but we don't know the size of the remote part so we tell the server (and act accordingly) that we upload the whole file (again) */ conn->allocptr.rangeline = aprintf("Content-Range: bytes 0-%" CURL_FORMAT_CURL_OFF_T "/%" CURL_FORMAT_CURL_OFF_T "\r\n", data->set.infilesize - 1, data->set.infilesize); } else if(data->state.resume_from) { /* This is because "resume" was selected */ curl_off_t total_expected_size= data->state.resume_from + data->set.infilesize; conn->allocptr.rangeline = aprintf("Content-Range: bytes %s%" CURL_FORMAT_CURL_OFF_T "/%" CURL_FORMAT_CURL_OFF_T "\r\n", data->state.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/%" CURL_FORMAT_CURL_OFF_T "\r\n", data->state.range, data->set.infilesize); } if(!conn->allocptr.rangeline) return CURLE_OUT_OF_MEMORY; } } /* Use 1.1 unless the user specifically asked for 1.0 or the server only supports 1.0 */ httpstring= use_http_1_1plus(data, conn)?"1.1":"1.0"; /* initialize a dynamic send-buffer */ req_buffer = Curl_add_buffer_init(); if(!req_buffer) return CURLE_OUT_OF_MEMORY; /* add the main request stuff */ /* GET/HEAD/POST/PUT */ result = Curl_add_bufferf(req_buffer, "%s ", request); if(result) return result; /* url */ if(paste_ftp_userpwd) result = Curl_add_bufferf(req_buffer, "ftp://%s:%s@%s", conn->user, conn->passwd, ppath + sizeof("ftp://") - 1); else result = Curl_add_buffer(req_buffer, ppath, strlen(ppath)); if(result) return result; result = Curl_add_bufferf(req_buffer, "%s" /* ftp typecode (;type=x) */ " HTTP/%s\r\n" /* HTTP version */ "%s" /* proxyuserpwd */ "%s" /* userpwd */ "%s" /* range */ "%s" /* user agent */ "%s" /* host */ "%s" /* accept */ "%s" /* TE: */ "%s" /* accept-encoding */ "%s" /* referer */ "%s" /* Proxy-Connection */ "%s",/* transfer-encoding */ ftp_typecode, httpstring, conn->allocptr.proxyuserpwd? conn->allocptr.proxyuserpwd:"", conn->allocptr.userpwd?conn->allocptr.userpwd:"", (data->state.use_range && conn->allocptr.rangeline)? conn->allocptr.rangeline:"", (data->set.str[STRING_USERAGENT] && *data->set.str[STRING_USERAGENT] && conn->allocptr.uagent)? conn->allocptr.uagent:"", (conn->allocptr.host?conn->allocptr.host:""), http->p_accept?http->p_accept:"", conn->allocptr.te?conn->allocptr.te:"", (data->set.str[STRING_ENCODING] && *data->set.str[STRING_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 && !Curl_checkheaders(data, "Proxy-Connection:"))? "Proxy-Connection: Keep-Alive\r\n":"", te ); /* * Free userpwd now --- cannot reuse this for Negotiate and possibly NTLM * with basic and digest, it will be freed anyway by the next request */ Curl_safefree (conn->allocptr.userpwd); conn->allocptr.userpwd = NULL; if(result) return result; if(!(conn->handler->flags&PROTOPT_SSL) && (data->set.httpversion == CURL_HTTP_VERSION_2_0)) { /* append HTTP2 updrade magic stuff to the HTTP request if it isn't done over SSL */ result = Curl_http2_request(req_buffer, conn); 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->state.path, (conn->handler->protocol&CURLPROTO_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 = Curl_add_bufferf(req_buffer, "Cookie: "); if(result) break; } result = Curl_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, FALSE); /* free the cookie list */ } if(addcookies && (CURLE_OK == result)) { if(!count) result = Curl_add_bufferf(req_buffer, "Cookie: "); if(CURLE_OK == result) { result = Curl_add_bufferf(req_buffer, "%s%s", count?"; ":"", addcookies); count++; } } if(count && (CURLE_OK == result)) result = Curl_add_buffer(req_buffer, "\r\n", 2); if(result) return result; } #endif if(data->set.timecondition) { result = Curl_add_timecondition(data, req_buffer); if(result) return result; } result = Curl_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 = Curl_add_bufferf(req_buffer, "Content-Length: 0\r\n\r\n"); if(result) return result; result = Curl_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 */ 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; } /* Get the currently set callback function pointer and store that in the form struct since we might want the actual user-provided callback later on. The conn->fread_func pointer itself will be changed for the multipart case to the function that returns a multipart formatted stream. */ http->form.fread_func = conn->fread_func; /* Set the read function to read from the generated form data */ conn->fread_func = (curl_read_callback)Curl_FormReader; conn->fread_in = &http->form; http->sending = HTTPSEND_BODY; if(!data->req.upload_chunky && !Curl_checkheaders(data, "Content-Length:")) { /* only add Content-Length if not uploading chunked */ result = Curl_add_bufferf(req_buffer, "Content-Length: %" CURL_FORMAT_CURL_OFF_T "\r\n", http->postsize); if(result) return result; } result = expect100(data, conn, 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 = Curl_add_buffer(req_buffer, contentType, linelength); if(result) return result; } /* make the request end in a true CRLF */ result = Curl_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 = Curl_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 */ Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, &http->readbytecount, FIRSTSOCKET, &http->writebytecount); if(result) { Curl_formclean(&http->sendit); /* free that whole lot */ return result; } /* convert the form data */ result = Curl_convert_form(data, http->sendit); 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) && !data->req.upload_chunky && !Curl_checkheaders(data, "Content-Length:")) { /* only add Content-Length if not uploading chunked */ result = Curl_add_bufferf(req_buffer, "Content-Length: %" CURL_FORMAT_CURL_OFF_T "\r\n", postsize); if(result) return result; } result = expect100(data, conn, req_buffer); if(result) return result; result = Curl_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 = Curl_add_buffer_send(req_buffer, conn, &data->info.request_size, 0, FIRSTSOCKET); if(result) failf(data, "Failed sending PUT request"); else /* prepare for transfer */ 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):-1); } /* 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((postsize != -1) && !data->req.upload_chunky && !Curl_checkheaders(data, "Content-Length:")) { /* we allow replacing this header if not during auth negotiation, although it isn't very wise to actually set your own */ result = Curl_add_bufferf(req_buffer, "Content-Length: %" CURL_FORMAT_CURL_OFF_T "\r\n", postsize); if(result) return result; } if(!Curl_checkheaders(data, "Content-Type:")) { result = Curl_add_bufferf(req_buffer, "Content-Type: application/" "x-www-form-urlencoded\r\n"); if(result) return result; } /* 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. Just make sure that the expect100header is always set to the preferred value here. */ ptr = Curl_checkheaders(data, "Expect:"); if(ptr) { data->state.expect100header = Curl_compareheader(ptr, "Expect:", "100-continue"); } else if(postsize > TINY_INITIAL_POST_SIZE || postsize < 0) { result = expect100(data, conn, req_buffer); if(result) return result; } else data->state.expect100header = FALSE; if(data->set.postfields) { 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 = Curl_add_buffer(req_buffer, "\r\n", 2); /* end of headers! */ if(result) return result; if(!data->req.upload_chunky) { /* We're not sending it 'chunked', append it to the request already now to reduce the number if send() calls */ result = Curl_add_buffer(req_buffer, data->set.postfields, (size_t)postsize); included_body = postsize; } else { if(postsize) { /* Append the POST data chunky-style */ result = Curl_add_bufferf(req_buffer, "%x\r\n", (int)postsize); if(CURLE_OK == result) { result = Curl_add_buffer(req_buffer, data->set.postfields, (size_t)postsize); if(CURLE_OK == result) result = Curl_add_buffer(req_buffer, "\r\n", 2); included_body = postsize + 2; } } if(CURLE_OK == result) result = Curl_add_buffer(req_buffer, "\x30\x0d\x0a\x0d\x0a", 5); /* 0 CR LF CR LF */ included_body += 5; } if(result) return result; /* Make sure the progress information is accurate */ Curl_pgrsSetUploadSize(data, postsize); } 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_func = (curl_read_callback)readmoredata; conn->fread_in = (void *)conn; /* set the upload size to the progress meter */ Curl_pgrsSetUploadSize(data, http->postsize); result = Curl_add_buffer(req_buffer, "\r\n", 2); /* end of headers! */ if(result) return result; } } else { result = Curl_add_buffer(req_buffer, "\r\n", 2); /* end of headers! */ if(result) return result; if(data->req.upload_chunky && conn->bits.authneg) { /* Chunky upload is selected and we're negotiating auth still, send end-of-data only */ result = Curl_add_buffer(req_buffer, "\x30\x0d\x0a\x0d\x0a", 5); /* 0 CR LF CR LF */ if(result) return result; } else 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, but only if we're not in authenticate negotiation */ if(!conn->bits.authneg) { http->postdata = (char *)&http->postdata; http->postsize = postsize; } } } /* issue the request */ result = Curl_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 Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, &http->readbytecount, http->postdata?FIRSTSOCKET:-1, http->postdata?&http->writebytecount:NULL); break; default: result = Curl_add_buffer(req_buffer, "\r\n", 2); if(result) return result; /* issue the request */ result = Curl_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: */ Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, &http->readbytecount, http->postdata?FIRSTSOCKET:-1, http->postdata?&http->writebytecount:NULL); } if(result) return result; if(http->writebytecount) { /* if a request-body has been sent off, we make sure this progress is noted properly */ Curl_pgrsSetUploadCounter(data, http->writebytecount); if(Curl_pgrsUpdate(conn)) result = CURLE_ABORTED_BY_CALLBACK; if(http->writebytecount >= postsize) { /* already sent the entire request body, mark the "upload" as complete */ infof(data, "upload completely sent off: %" CURL_FORMAT_CURL_OFF_T " out of %" CURL_FORMAT_CURL_OFF_T " bytes\n", http->writebytecount, postsize); data->req.upload_done = TRUE; data->req.keepon &= ~KEEP_SEND; /* we're done writing */ data->req.exp100 = EXP100_SEND_DATA; /* already sent */ } } return result; } /* * 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; bool rc = FALSE; #ifdef CURL_DOES_CONVERSIONS /* convert from the network encoding using a scratch area */ char *scratch = strdup(s); if(NULL == scratch) { failf (data, "Failed to allocate memory for conversion!"); return FALSE; /* can't return CURLE_OUT_OF_MEMORY so return FALSE */ } if(CURLE_OK != Curl_convert_from_network(data, scratch, strlen(s)+1)) { /* Curl_convert_from_network calls failf if unsuccessful */ free(scratch); return FALSE; /* can't return CURLE_foobar so return FALSE */ } s = scratch; #endif /* CURL_DOES_CONVERSIONS */ while(head) { if(checkprefix(head->data, s)) { rc = TRUE; break; } head = head->next; } if(!rc && (checkprefix("HTTP/", s))) rc = TRUE; #ifdef CURL_DOES_CONVERSIONS free(scratch); #endif /* CURL_DOES_CONVERSIONS */ return rc; } #ifndef CURL_DISABLE_RTSP static bool checkrtspprefix(struct SessionHandle *data, const char *s) { #ifdef CURL_DOES_CONVERSIONS /* convert from the network encoding using a scratch area */ char *scratch = strdup(s); if(NULL == scratch) { failf (data, "Failed to allocate memory for conversion!"); return FALSE; /* can't return CURLE_OUT_OF_MEMORY so return FALSE */ } if(CURLE_OK != Curl_convert_from_network(data, scratch, strlen(s)+1)) { /* Curl_convert_from_network calls failf if unsuccessful */ free(scratch); return FALSE; /* can't return CURLE_foobar so return FALSE */ } s = scratch; #else (void)data; /* unused */ #endif /* CURL_DOES_CONVERSIONS */ if(checkprefix("RTSP/", s)) return TRUE; else return FALSE; } #endif /* CURL_DISABLE_RTSP */ static bool checkprotoprefix(struct SessionHandle *data, struct connectdata *conn, const char *s) { #ifndef CURL_DISABLE_RTSP if(conn->handler->protocol & CURLPROTO_RTSP) return checkrtspprefix(data, s); #else (void)conn; #endif /* CURL_DISABLE_RTSP */ return checkhttpprefix(data, s); } /* * header_append() copies 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. */ static CURLcode header_append(struct SessionHandle *data, struct SingleRequest *k, size_t length) { if(k->hbuflen + length >= data->state.headersize) { /* We enlarge the header buffer as it is too small */ char *newbuff; size_t hbufp_index; size_t newsize; if(k->hbuflen + length > CURL_MAX_HTTP_HEADER) { /* The reason to have a max limit for this is to avoid the risk of a bad server feeding libcurl with a never-ending header that will cause reallocs infinitely */ failf (data, "Avoided giant realloc for header (max is %d)!", CURL_MAX_HTTP_HEADER); return CURLE_OUT_OF_MEMORY; } newsize=CURLMAX((k->hbuflen+ length)*3/2, data->state.headersize*2); hbufp_index = k->hbufp - data->state.headerbuff; newbuff = 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_start, length); k->hbufp += length; k->hbuflen += length; *k->hbufp = 0; return CURLE_OK; } static void print_http_error(struct SessionHandle *data) { struct SingleRequest *k = &data->req; char *beg = k->p; /* make sure that data->req.p points to the HTTP status line */ if(!strncmp(beg, "HTTP", 4)) { /* skip to HTTP status code */ beg = strchr(beg, ' '); if(beg && *++beg) { /* find trailing CR */ char end_char = '\r'; char *end = strchr(beg, end_char); if(!end) { /* try to find LF (workaround for non-compliant HTTP servers) */ end_char = '\n'; end = strchr(beg, end_char); } if(end) { /* temporarily replace CR or LF by NUL and print the error message */ *end = '\0'; failf(data, "The requested URL returned error: %s", beg); /* restore the previously replaced CR or LF */ *end = end_char; return; } } } /* fall-back to printing the HTTP status code only */ failf(data, "The requested URL returned error: %d", k->httpcode); } /* * Read any HTTP header lines from the server and pass them to the client app. */ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data, struct connectdata *conn, ssize_t *nread, bool *stop_reading) { CURLcode result; struct SingleRequest *k = &data->req; /* header line within buffer loop */ do { size_t rest_length; size_t full_length; int writetype; /* str_start is start of line within buf */ k->str_start = k->str; /* data is in network encoding so use 0x0a instead of '\n' */ k->end_ptr = memchr(k->str_start, 0x0a, *nread); if(!k->end_ptr) { /* Not a complete header line within buffer, append the data to the end of the headerbuff. */ result = header_append(data, k, *nread); if(result) return result; if(!k->headerline && (k->hbuflen>5)) { /* make a first check that this looks like a protocol header */ if(!checkprotoprefix(data, conn, data->state.headerbuff)) { /* this is not the beginning of a protocol 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; result = header_append(data, k, full_length); if(result) return result; 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) && !checkprotoprefix(data, conn, data->state.headerbuff)) { /* this is not the beginning of a protocol 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 it's all a bad header */ k->badheader = HEADER_ALLBAD; *nread = (ssize_t)rest_length; } break; } } /* headers are in network encoding so use 0x0a and 0x0d instead of '\n' and '\r' */ if((0x0a == *k->p) || (0x0d == *k->p)) { size_t headerlen; /* Zero-length header line means end of headers! */ #ifdef CURL_DOES_CONVERSIONS if(0x0d == *k->p) { *k->p = '\r'; /* replace with CR in host encoding */ k->p++; /* pass the CR byte */ } if(0x0a == *k->p) { *k->p = '\n'; /* replace with LF in host encoding */ k->p++; /* pass the LF byte */ } #else if('\r' == *k->p) k->p++; /* pass the \r byte */ if('\n' == *k->p) k->p++; /* pass the \n byte */ #endif /* CURL_DOES_CONVERSIONS */ if(100 <= k->httpcode && 199 >= 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->exp100) { k->exp100 = EXP100_SEND_DATA; k->keepon |= KEEP_SEND; } } else { k->header = FALSE; /* no more header to parse! */ if((k->size == -1) && !k->chunk && !conn->bits.close && (conn->httpversion >= 11) && !(conn->handler->protocol & CURLPROTO_RTSP) && data->set.httpreq != HTTPREQ_HEAD) { /* On HTTP 1.1, when connection is not to get closed, but no Content-Length nor Content-Encoding chunked have been received, according to RFC2616 section 4.4 point 5, we assume that the server will close the connection to signal the end of the document. */ infof(data, "no chunk, no close, no size. Assume close to " "signal end\n"); conn->bits.close = TRUE; } } /* * When all the headers have been parsed, see if we should give * up and return an error. */ if(http_should_fail(conn)) { failf (data, "The requested URL returned error: %d", k->httpcode); return CURLE_HTTP_RETURNED_ERROR; } /* 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; data->req.headerbytecount += (long)headerlen; data->req.deductheadercount = (100 <= k->httpcode && 199 >= k->httpcode)?data->req.headerbytecount:0; 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 method was picked. */ result = Curl_http_auth_act(conn); if(result) return result; if(k->httpcode >= 300) { if((!conn->bits.authneg) && !conn->bits.close && !conn->bits.rewindaftersend) { /* * General treatment of errors when about to send data. Including : * "417 Expectation Failed", while waiting for 100-continue. * * The check for close above is done simply because of something * else has already deemed the connection to get closed then * something else should've considered the big picture and we * avoid this check. * * rewindaftersend indicates that something has told libcurl to * continue sending even if it gets discarded */ switch(data->set.httpreq) { case HTTPREQ_PUT: case HTTPREQ_POST: case HTTPREQ_POST_FORM: /* We got an error response. If this happened before the whole * request body has been sent we stop sending and mark the * connection for closure after we've read the entire response. */ if(!k->upload_done) { infof(data, "HTTP error before end of send, stop sending\n"); conn->bits.close = TRUE; /* close after this */ k->upload_done = TRUE; k->keepon &= ~KEEP_SEND; /* don't send */ if(data->state.expect100header) k->exp100 = EXP100_FAILED; } break; default: /* default label present to avoid compiler warnings */ break; } } } 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_SEND; } } 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(data->set.opt_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(k->chunk) k->maxdownload = 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_RECV; } if(data->set.verbose) Curl_debug(data, CURLINFO_HEADER_IN, k->str_start, headerlen, conn); 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 consider this to be the body right away! */ int httpversion_major; int rtspversion_major; int nc = 0; #ifdef CURL_DOES_CONVERSIONS #define HEADER1 scratch #define SCRATCHSIZE 21 CURLcode res; char scratch[SCRATCHSIZE+1]; /* "HTTP/major.minor 123" */ /* We can't really convert this yet because we don't know if it's the 1st header line or the body. So we do a partial conversion into a scratch area, leaving the data at k->p as-is. */ strncpy(&scratch[0], k->p, SCRATCHSIZE); scratch[SCRATCHSIZE] = 0; /* null terminate */ res = Curl_convert_from_network(data, &scratch[0], SCRATCHSIZE); if(res) /* Curl_convert_from_network calls failf if unsuccessful */ return res; #else #define HEADER1 k->p /* no conversion needed, just use k->p */ #endif /* CURL_DOES_CONVERSIONS */ if(conn->handler->protocol & CURLPROTO_HTTP) { nc = sscanf(HEADER1, " HTTP/%d.%d %3d", &httpversion_major, &conn->httpversion, &k->httpcode); if(nc==3) { conn->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(HEADER1, " HTTP %3d", &k->httpcode); conn->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; conn->httpversion = 10; } } } } else if(conn->handler->protocol & CURLPROTO_RTSP) { nc = sscanf(HEADER1, " RTSP/%d.%d %3d", &rtspversion_major, &conn->rtspversion, &k->httpcode); if(nc==3) { conn->rtspversion += 10 * rtspversion_major; conn->httpversion = 11; /* For us, RTSP acts like HTTP 1.1 */ } else { /* TODO: do we care about the other cases here? */ nc = 0; } } if(nc) { data->info.httpcode = k->httpcode; data->info.httpversion = conn->httpversion; if(!data->state.httpversion || data->state.httpversion > conn->httpversion) /* store the lowest server version we encounter */ data->state.httpversion = conn->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) || !conn->bits.user_passwd) && ((k->httpcode != 407) || !conn->bits.proxy_user_passwd) ) { if(data->state.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! */ print_http_error(data); return CURLE_HTTP_RETURNED_ERROR; } } if(conn->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! */ infof(data, "HTTP 1.0, assume close after body\n"); conn->bits.close = TRUE; } else if(conn->httpversion >= 11 && !conn->bits.close) { struct connectbundle *cb_ptr; /* If HTTP version is >= 1.1 and connection is persistent server supports pipelining. */ DEBUGF(infof(data, "HTTP 1.1 or later with persistent connection, " "pipelining supported\n")); /* Activate pipelining if needed */ cb_ptr = conn->bundle; if(cb_ptr) { if(!Curl_pipeline_site_blacklisted(data, conn)) cb_ptr->server_supports_pipelining = 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 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. */ if(data->set.timecondition) data->info.timecond = TRUE; 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; } } result = Curl_convert_from_network(data, k->p, strlen(k->p)); /* Curl_convert_from_network calls failf if unsuccessful */ if(result) return result; /* Check for Content-Length: header lines to get size */ if(!k->ignorecl && !data->set.ignorecl && checkprefix("Content-Length:", k->p)) { curl_off_t 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; /* we set the progress download size already at this point just to make it easier for apps/callbacks to extract this info as soon as possible */ Curl_pgrsSetDownloadSize(data, 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: %" CURL_FORMAT_CURL_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 *contenttype = Curl_copy_header_value(k->p); if(!contenttype) return CURLE_OUT_OF_MEMORY; if(!*contenttype) /* ignore empty data */ free(contenttype); else { Curl_safefree(data->info.contenttype); data->info.contenttype = contenttype; } } else if(checkprefix("Server:", k->p)) { char *server_name = Curl_copy_header_value(k->p); /* Turn off pipelining if the server version is blacklisted */ if(conn->bundle && conn->bundle->server_supports_pipelining) { if(Curl_pipeline_server_blacklisted(data, server_name)) conn->bundle->server_supports_pipelining = FALSE; } Curl_safefree(server_name); } else if((conn->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((conn->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((conn->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(checkprefix("Transfer-Encoding:", k->p)) { /* One or more encodings. We check for chunked and/or a compression algorithm. */ /* * [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. */ char *start; /* Find the first non-space letter */ start = k->p + 18; for(;;) { /* skip whitespaces and commas */ while(*start && (ISSPACE(*start) || (*start == ','))) start++; if(checkprefix("chunked", start)) { k->chunk = TRUE; /* chunks coming our way */ /* init our chunky engine */ Curl_httpchunk_init(conn); start += 7; } if(k->auto_decoding) /* TODO: we only support the first mentioned compression for now */ break; if(checkprefix("identity", start)) { k->auto_decoding = IDENTITY; start += 8; } else if(checkprefix("deflate", start)) { k->auto_decoding = DEFLATE; start += 7; } else if(checkprefix("gzip", start)) { k->auto_decoding = GZIP; start += 4; } else if(checkprefix("x-gzip", start)) { k->auto_decoding = GZIP; start += 6; } else if(checkprefix("compress", start)) { k->auto_decoding = COMPRESS; start += 8; } else if(checkprefix("x-compress", start)) { k->auto_decoding = COMPRESS; start += 10; } else /* unknown! */ break; } } else if(checkprefix("Content-Encoding:", k->p) && data->set.str[STRING_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 */ start = k->p + 17; while(*start && ISSPACE(*start)) start++; /* Record the content-encoding for later use */ if(checkprefix("identity", start)) k->auto_decoding = IDENTITY; else if(checkprefix("deflate", start)) k->auto_decoding = DEFLATE; else if(checkprefix("gzip", start) || checkprefix("x-gzip", start)) k->auto_decoding = GZIP; else if(checkprefix("compress", start) || checkprefix("x-compress", start)) k->auto_decoding = COMPRESS; } else if(checkprefix("Content-Range:", k->p)) { /* Content-Range: bytes [num]- Content-Range: bytes: [num]- Content-Range: [num]- The second format was added since Sun's webserver JavaWebServer/1.1.1 obviously sends the header this way! The third added since some servers use that! */ char *ptr = k->p + 14; /* Move forward until first digit */ while(*ptr && !ISDIGIT(*ptr)) ptr++; k->offset = curlx_strtoofft(ptr, NULL, 10); if(data->state.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->state.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))) { bool proxy = (k->httpcode == 407) ? TRUE : FALSE; char *auth = Curl_copy_header_value(k->p); if(!auth) return CURLE_OUT_OF_MEMORY; result = Curl_http_input_auth(conn, proxy, auth); Curl_safefree(auth); if(result) return result; } else if((k->httpcode >= 300 && k->httpcode < 400) && checkprefix("Location:", k->p) && !data->req.location) { /* this is the URL that the server advises us to use instead */ char *location = Curl_copy_header_value(k->p); if(!location) return CURLE_OUT_OF_MEMORY; if(!*location) /* ignore empty data */ free(location); else { data->req.location = location; if(data->set.http_follow_location) { DEBUGASSERT(!data->req.newurl); data->req.newurl = strdup(data->req.location); /* clone */ if(!data->req.newurl) return CURLE_OUT_OF_MEMORY; /* some cases of POST and PUT etc needs to rewind the data stream at this point */ result = http_perhapsrewind(conn); if(result) return result; } } } else if(conn->handler->protocol & CURLPROTO_RTSP) { result = Curl_rtsp_parseheader(conn, k->p); if(result) return result; } /* * 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; data->req.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 */ /* 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. */ return CURLE_OK; } #endif /* CURL_DISABLE_HTTP */ curl-7.35.0/lib/getinfo.c0000644000175000017500000002621212262353672012054 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #include #include "urldata.h" #include "getinfo.h" #include "curl_memory.h" #include "vtls/vtls.h" #include "connect.h" /* Curl_getconnectinfo() */ #include "progress.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_appconnect = 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 */ info->timecond = FALSE; if(info->contenttype) free(info->contenttype); info->contenttype = NULL; info->header_size = 0; info->request_size = 0; info->numconnects = 0; info->conn_primary_ip[0] = '\0'; info->conn_local_ip[0] = '\0'; info->conn_primary_port = 0; info->conn_local_port = 0; return CURLE_OK; } static CURLcode getinfo_char(struct SessionHandle *data, CURLINFO info, char **param_charp) { switch(info) { case CURLINFO_EFFECTIVE_URL: *param_charp = data->change.url?data->change.url:(char *)""; break; case CURLINFO_CONTENT_TYPE: *param_charp = data->info.contenttype; break; case CURLINFO_PRIVATE: *param_charp = (char *) data->set.private_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_REDIRECT_URL: /* Return the URL this request would have been redirected to if that option had been enabled! */ *param_charp = data->info.wouldredirect; break; case CURLINFO_PRIMARY_IP: /* Return the ip address of the most recent (primary) connection */ *param_charp = data->info.conn_primary_ip; break; case CURLINFO_LOCAL_IP: /* Return the source/local ip address of the most recent (primary) connection */ *param_charp = data->info.conn_local_ip; break; case CURLINFO_RTSP_SESSION_ID: *param_charp = data->set.str[STRING_RTSP_SESSION_ID]; break; default: return CURLE_BAD_FUNCTION_ARGUMENT; } return CURLE_OK; } static CURLcode getinfo_long(struct SessionHandle *data, CURLINFO info, long *param_longp) { curl_socket_t sockfd; union { unsigned long *to_ulong; long *to_long; } lptr; switch(info) { 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_SSL_VERIFYRESULT: *param_longp = data->set.ssl.certverifyresult; break; case CURLINFO_REDIRECT_COUNT: *param_longp = data->set.followlocation; break; case CURLINFO_HTTPAUTH_AVAIL: lptr.to_long = param_longp; *lptr.to_ulong = data->info.httpauthavail; break; case CURLINFO_PROXYAUTH_AVAIL: lptr.to_long = param_longp; *lptr.to_ulong = 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_LASTSOCKET: sockfd = Curl_getconnectinfo(data, NULL); /* note: this is not a good conversion for systems with 64 bit sockets and 32 bit longs */ if(sockfd != CURL_SOCKET_BAD) *param_longp = (long)sockfd; else /* this interface is documented to return -1 in case of badness, which may not be the same as the CURL_SOCKET_BAD value */ *param_longp = -1; break; case CURLINFO_PRIMARY_PORT: /* Return the (remote) port of the most recent (primary) connection */ *param_longp = data->info.conn_primary_port; break; case CURLINFO_LOCAL_PORT: /* Return the local port of the most recent (primary) connection */ *param_longp = data->info.conn_local_port; break; case CURLINFO_CONDITION_UNMET: /* return if the condition prevented the document to get transferred */ *param_longp = data->info.timecond ? 1L : 0L; break; case CURLINFO_RTSP_CLIENT_CSEQ: *param_longp = data->state.rtsp_next_client_CSeq; break; case CURLINFO_RTSP_SERVER_CSEQ: *param_longp = data->state.rtsp_next_server_CSeq; break; case CURLINFO_RTSP_CSEQ_RECV: *param_longp = data->state.rtsp_CSeq_recv; break; default: return CURLE_BAD_FUNCTION_ARGUMENT; } return CURLE_OK; } static CURLcode getinfo_double(struct SessionHandle *data, CURLINFO info, double *param_doublep) { switch(info) { 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_APPCONNECT_TIME: *param_doublep = data->progress.t_appconnect; 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_CONTENT_LENGTH_DOWNLOAD: *param_doublep = (data->progress.flags & PGRS_DL_SIZE_KNOWN)? (double)data->progress.size_dl:-1; break; case CURLINFO_CONTENT_LENGTH_UPLOAD: *param_doublep = (data->progress.flags & PGRS_UL_SIZE_KNOWN)? (double)data->progress.size_ul:-1; break; case CURLINFO_REDIRECT_TIME: *param_doublep = data->progress.t_redirect; break; default: return CURLE_BAD_FUNCTION_ARGUMENT; } return CURLE_OK; } static CURLcode getinfo_slist(struct SessionHandle *data, CURLINFO info, struct curl_slist **param_slistp) { union { struct curl_certinfo * to_certinfo; struct curl_slist * to_slist; } ptr; switch(info) { case CURLINFO_SSL_ENGINES: *param_slistp = Curl_ssl_engines_list(data); break; case CURLINFO_COOKIELIST: *param_slistp = Curl_cookie_list(data); break; case CURLINFO_CERTINFO: /* Return the a pointer to the certinfo struct. Not really an slist pointer but we can pretend it is here */ ptr.to_certinfo = &data->info.certs; *param_slistp = ptr.to_slist; break; case CURLINFO_TLS_SESSION: { struct curl_tlssessioninfo **tsip = (struct curl_tlssessioninfo **) param_slistp; struct curl_tlssessioninfo *tsi = &data->tsi; struct connectdata *conn = data->easy_conn; unsigned int sockindex = 0; *tsip = tsi; tsi->backend = CURLSSLBACKEND_NONE; tsi->internals = NULL; if(!conn) break; /* Find the active ("in use") SSL connection, if any */ while((sockindex < sizeof(conn->ssl) / sizeof(conn->ssl[0])) && (!conn->ssl[sockindex].use)) sockindex++; if(sockindex == sizeof(conn->ssl) / sizeof(conn->ssl[0])) break; /* no SSL session found */ /* Return the TLS session information from the relevant backend */ #ifdef USE_SSLEAY tsi->backend = CURLSSLBACKEND_OPENSSL; tsi->internals = conn->ssl[sockindex].ctx; #endif #ifdef USE_GNUTLS tsi->backend = CURLSSLBACKEND_GNUTLS; tsi->internals = conn->ssl[sockindex].session; #endif #ifdef USE_NSS tsi->backend = CURLSSLBACKEND_NSS; tsi->internals = conn->ssl[sockindex].handle; #endif #ifdef USE_QSOSSL tsi->backend = CURLSSLBACKEND_QSOSSL; tsi->internals = conn->ssl[sockindex].handle; #endif #ifdef USE_GSKIT tsi->backend = CURLSSLBACKEND_GSKIT; tsi->internals = conn->ssl[sockindex].handle; #endif /* NOTE: For other SSL backends, it is not immediately clear what data to return from 'struct ssl_connect_data'; thus, for now we keep the backend as CURLSSLBACKEND_NONE in those cases, which should be interpreted as "not supported" */ break; } break; default: return CURLE_BAD_FUNCTION_ARGUMENT; } 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; int type; /* default return code is to error out! */ CURLcode ret = CURLE_BAD_FUNCTION_ARGUMENT; if(!data) return ret; va_start(arg, info); type = CURLINFO_TYPEMASK & (int)info; switch(type) { case CURLINFO_STRING: param_charp = va_arg(arg, char **); if(NULL != param_charp) ret = getinfo_char(data, info, param_charp); break; case CURLINFO_LONG: param_longp = va_arg(arg, long *); if(NULL != param_longp) ret = getinfo_long(data, info, param_longp); break; case CURLINFO_DOUBLE: param_doublep = va_arg(arg, double *); if(NULL != param_doublep) ret = getinfo_double(data, info, param_doublep); break; case CURLINFO_SLIST: param_slistp = va_arg(arg, struct curl_slist **); if(NULL != param_slistp) ret = getinfo_slist(data, info, param_slistp); break; default: break; } va_end(arg); return ret; } curl-7.35.0/lib/curl_base64.h0000644000175000017500000000261012213173003012513 00000000000000#ifndef HEADER_CURL_BASE64_H #define HEADER_CURL_BASE64_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ CURLcode Curl_base64_encode(struct SessionHandle *data, const char *inputbuff, size_t insize, char **outptr, size_t *outlen); CURLcode Curl_base64_decode(const char *src, unsigned char **outptr, size_t *outlen); #endif /* HEADER_CURL_BASE64_H */ curl-7.35.0/lib/arpa_telnet.h0000644000175000017500000000763012213173003012707 00000000000000#ifndef HEADER_CURL_ARPA_TELNET_H #define HEADER_CURL_ARPA_TELNET_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #ifndef CURL_DISABLE_TELNET /* * Telnet option defines. Add more here if in need. */ #define CURL_TELOPT_BINARY 0 /* binary 8bit data */ #define CURL_TELOPT_ECHO 1 /* just echo! */ #define CURL_TELOPT_SGA 3 /* Suppress Go Ahead */ #define CURL_TELOPT_EXOPL 255 /* EXtended OPtions List */ #define CURL_TELOPT_TTYPE 24 /* Terminal TYPE */ #define CURL_TELOPT_NAWS 31 /* Negotiate About Window Size */ #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 /* CURL_DISABLE_TELNET */ #endif /* HEADER_CURL_ARPA_TELNET_H */ curl-7.35.0/lib/if2ip.h0000644000175000017500000000504712213173003011422 00000000000000#ifndef HEADER_CURL_IF2IP_H #define HEADER_CURL_IF2IP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" bool Curl_if_is_interface_name(const char *interf); typedef enum { IF2IP_NOT_FOUND = 0, /* Interface not found */ IF2IP_AF_NOT_SUPPORTED = 1, /* Int. exists but has no address for this af */ IF2IP_FOUND = 2 /* The address has been stored in "buf" */ } if2ip_result_t; if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope, const char *interf, char *buf, int buf_size); #ifdef __INTERIX /* 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_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 /* HEADER_CURL_IF2IP_H */ curl-7.35.0/lib/config-os400.h0000644000175000017500000003633612262353672012546 00000000000000#ifndef HEADER_CURL_CONFIG_OS400_H #define HEADER_CURL_CONFIG_OS400_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* ================================================================ */ /* Hand crafted config file for OS/400 */ /* ================================================================ */ #pragma enum(int) #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 "OS/400" /* Define if you have the gethostbyaddr_r() function with 5 arguments */ #define 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 /* OS400 supports a 3-argument ASCII version of gethostbyaddr_r(), but its * prototype is incompatible with the "standard" one (1st argument is not * const). However, getaddrinfo() is supported (ASCII version defined as * a local wrapper in setup-os400.h) in a threadsafe way: we can then * configure getaddrinfo() as such and get rid of gethostbyname_r() without * loss of threadsafeness. */ #undef HAVE_GETHOSTBYNAME_R #undef HAVE_GETHOSTBYNAME_R_3 #undef HAVE_GETHOSTBYNAME_R_5 #undef HAVE_GETHOSTBYNAME_R_6 #define HAVE_GETADDRINFO #define HAVE_GETADDRINFO_THREADSAFE /* 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 */ #define ENABLE_IPV6 /* Define if struct sockaddr_in6 has the sin6_scope_id member */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 /* Define this to 'int' if ssize_t is not an available typedefed type */ #undef ssize_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 /* Define to 1 if you have the alarm function. */ #define HAVE_ALARM 1 /* Define if you have the header file. */ #undef 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. */ #define HAVE_ERRNO_H /* 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 `geteuid' function. */ #define HAVE_GETEUID /* Define if you have the `gethostbyaddr' function. */ #define HAVE_GETHOSTBYADDR /* Define if you have the `gethostbyaddr_r' function. */ #define HAVE_GETHOSTBYADDR_R /* Define if you have the `gethostname' function. */ #define HAVE_GETHOSTNAME /* Define if you have the header file. */ #undef HAVE_GETOPT_H /* Define if you have the `getpass_r' function. */ #undef HAVE_GETPASS_R /* Define if you have the `getpwuid' function. */ #define HAVE_GETPWUID /* Define if you have the `getservbyname' function. */ #define 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. */ #define HAVE_INET_ADDR /* 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 `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 GSS API. */ #define HAVE_GSSAPI /* Define if you have the `ucb' library (-lucb). */ #undef HAVE_LIBUCB /* Define if you have the `localtime_r' function. */ #define 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. */ #define HAVE_PERROR /* Define if you have the header file. */ #define 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. */ #define HAVE_SETVBUF /* Define if you have the header file. */ #undef HAVE_SGTTY_H /* Define if you have the `sigaction' function. */ #define HAVE_SIGACTION /* Define if you have the `signal' function. */ #undef HAVE_SIGNAL /* Define if you have the header file. */ #define HAVE_SIGNAL_H /* Define if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T /* Define if sig_atomic_t is already defined as volatile. */ #undef HAVE_SIG_ATOMIC_T_VOLATILE /* 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 /* The following define is needed on OS400 to enable strcmpi(), stricmp() and strdup(). */ #define __cplusplus__strings__ /* Define if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define if you have the `strcmpi' function. */ #define HAVE_STRCMPI /* Define if you have the `stricmp' function. */ #define HAVE_STRICMP /* 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 header file. */ #define HAVE_STRINGS_H /* Define if you have the header file. */ #define HAVE_STRING_H /* Define if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define if you have the header file. */ #undef HAVE_STROPTS_H /* Define if you have the `strstr' function. */ #define HAVE_STRSTR /* Define if you have the `strtok_r' function. */ #define HAVE_STRTOK_R /* Define if you have the `strtoll' function. */ #undef HAVE_STRTOLL /* Allows ASCII compile on V5R1. */ /* Define if you have the header file. */ #define 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. */ #define 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 header file. */ #define HAVE_SYS_UN_H /* Define if you have the header file. */ #define HAVE_SYS_IOCTL_H /* Define if you have the `tcgetattr' function. */ #undef HAVE_TCGETATTR /* Define if you have the `tcsetattr' function. */ #undef HAVE_TCSETATTR /* Define if you have the header file. */ #undef HAVE_TERMIOS_H /* Define if you have the header file. */ #undef HAVE_TERMIO_H /* Define if you have the header file. */ #define HAVE_TIME_H /* Define if you have the `uname' function. */ #undef 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 `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* The size of a `long double', as computed by sizeof. */ #define SIZEOF_LONG_DOUBLE 8 /* Define if the compiler supports the 'long long' data type. */ #define HAVE_LONGLONG /* The size of a `long long', as computed by sizeof. */ #define SIZEOF_LONG_LONG 8 /* The size of `short', as computed by sizeof. */ #define SIZEOF_SHORT 2 /* The size of `size_t', as computed by sizeof. */ #define SIZEOF_SIZE_T 8 /* Whether long long constants must be suffixed by LL. */ #define HAVE_LL /* Define this if you have struct sockaddr_storage */ #define HAVE_STRUCT_SOCKADDR_STORAGE /* Define if you have the ANSI C header files. */ #define STDC_HEADERS /* Define if you can safely include both and . */ #define TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* 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. */ #define _LARGE_FILES /* 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 */ #define in_addr_t unsigned long /* Define to `unsigned' if does not define. */ #undef size_t /* Define if you have the ioctl function. */ #define HAVE_IOCTL /* Define if you have a working ioctl FIONBIO function. */ #define HAVE_IOCTL_FIONBIO /* Define if you have a working ioctl SIOCGIFADDR function. */ #define HAVE_IOCTL_SIOCGIFADDR /* To disable LDAP */ #undef CURL_DISABLE_LDAP /* Definition to make a library symbol externally visible. */ #define CURL_EXTERN_SYMBOL /* Define if you have the ldap_url_parse procedure. */ /* #define HAVE_LDAP_URL_PARSE */ /* Disabled because of an IBM bug. */ /* Define if you have the getnameinfo function. */ /* OS400 has no ASCII version of this procedure: wrapped in setup-os400.h. */ #define HAVE_GETNAMEINFO /* 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 socklen_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 /* 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 if you have the recvfrom function. */ #define HAVE_RECVFROM /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 int /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 char /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 int /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 int /* Define to the function return type for recvfrom. */ #define RECVFROM_TYPE_RETV int /* Define if you have the send function. */ #define HAVE_SEND /* 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 /* 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 to use the QsoSSL package. */ #undef USE_QSOSSL /* Define to use the GSKit package. */ #define USE_GSKIT /* Use the system keyring as the default CA bundle. */ #define CURL_CA_BUNDLE "/QIBM/UserData/ICSS/Cert/Server/DEFAULT.KDB" /* ---------------------------------------------------------------- */ /* ADDITIONAL DEFINITIONS */ /* ---------------------------------------------------------------- */ /* The following must be defined BEFORE system header files inclusion. */ #define __ptr128 /* No teraspace. */ #define qadrt_use_fputc_inline /* Generate fputc() wrapper inline. */ #define qadrt_use_fread_inline /* Generate fread() wrapper inline. */ #define qadrt_use_fwrite_inline /* Generate fwrite() wrapper inline. */ #endif /* HEADER_CURL_CONFIG_OS400_H */ curl-7.35.0/lib/curl_multibyte.c0000644000175000017500000000474212213173003013450 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(USE_WIN32_IDN) || (defined(USE_WINDOWS_SSPI) && defined(UNICODE)) /* * MultiByte conversions using Windows kernel32 library. */ #include "curl_multibyte.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" wchar_t *Curl_convert_UTF8_to_wchar(const char *str_utf8) { wchar_t *str_w = NULL; if(str_utf8) { int str_w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str_utf8, -1, NULL, 0); if(str_w_len > 0) { str_w = malloc(str_w_len * sizeof(wchar_t)); if(str_w) { if(MultiByteToWideChar(CP_UTF8, 0, str_utf8, -1, str_w, str_w_len) == 0) { Curl_safefree(str_w); } } } } return str_w; } char *Curl_convert_wchar_to_UTF8(const wchar_t *str_w) { char *str_utf8 = NULL; if(str_w) { int str_utf8_len = WideCharToMultiByte(CP_UTF8, 0, str_w, -1, NULL, 0, NULL, NULL); if(str_utf8_len > 0) { str_utf8 = malloc(str_utf8_len * sizeof(wchar_t)); if(str_utf8) { if(WideCharToMultiByte(CP_UTF8, 0, str_w, -1, str_utf8, str_utf8_len, NULL, FALSE) == 0) { Curl_safefree(str_utf8); } } } } return str_utf8; } #endif /* USE_WIN32_IDN || (USE_WINDOWS_SSPI && UNICODE) */ curl-7.35.0/lib/curl_setup_once.h0000644000175000017500000003551312262353672013623 00000000000000#ifndef HEADER_CURL_SETUP_ONCE_H #define HEADER_CURL_SETUP_ONCE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* * Inclusion of common header files. */ #include #include #include #include #include #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef NEED_MALLOC_H #include #endif #ifdef NEED_MEMORY_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_SYS_TIME_H #include #ifdef TIME_WITH_SYS_TIME #include #endif #else #ifdef HAVE_TIME_H #include #endif #endif #ifdef WIN32 #include #include #endif #if defined(HAVE_STDBOOL_H) && defined(HAVE_BOOL_T) #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef __hpux # if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL) # ifdef _APP32_64BIT_OFF_T # define OLD_APP32_64BIT_OFF_T _APP32_64BIT_OFF_T # undef _APP32_64BIT_OFF_T # else # undef OLD_APP32_64BIT_OFF_T # endif # endif #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef __hpux # if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL) # ifdef OLD_APP32_64BIT_OFF_T # define _APP32_64BIT_OFF_T OLD_APP32_64BIT_OFF_T # undef OLD_APP32_64BIT_OFF_T # endif # endif #endif /* * Definition of timeval struct for platforms that don't have it. */ #ifndef HAVE_STRUCT_TIMEVAL struct timeval { long tv_sec; long tv_usec; }; #endif /* * If we have the MSG_NOSIGNAL define, make sure we use * it as the fourth argument of function send() */ #ifdef HAVE_MSG_NOSIGNAL #define SEND_4TH_ARG MSG_NOSIGNAL #else #define SEND_4TH_ARG 0 #endif #if defined(__minix) /* Minix doesn't support recv on TCP sockets */ #define sread(x,y,z) (ssize_t)read((RECV_TYPE_ARG1)(x), \ (RECV_TYPE_ARG2)(y), \ (RECV_TYPE_ARG3)(z)) #elif defined(HAVE_RECV) /* * 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. */ #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)(0)) #endif #else /* HAVE_RECV */ #ifndef sread /* */ Error Missing_definition_of_macro_sread /* */ #endif #endif /* HAVE_RECV */ #if defined(__minix) /* Minix doesn't support send on TCP sockets */ #define swrite(x,y,z) (ssize_t)write((SEND_TYPE_ARG1)(x), \ (SEND_TYPE_ARG2)(y), \ (SEND_TYPE_ARG3)(z)) #elif defined(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 */ #if 0 #if defined(HAVE_RECVFROM) /* * Currently recvfrom is only used on udp sockets. */ #if !defined(RECVFROM_TYPE_ARG1) || \ !defined(RECVFROM_TYPE_ARG2) || \ !defined(RECVFROM_TYPE_ARG3) || \ !defined(RECVFROM_TYPE_ARG4) || \ !defined(RECVFROM_TYPE_ARG5) || \ !defined(RECVFROM_TYPE_ARG6) || \ !defined(RECVFROM_TYPE_RETV) /* */ Error Missing_definition_of_return_and_arguments_types_of_recvfrom /* */ #else #define sreadfrom(s,b,bl,f,fl) (ssize_t)recvfrom((RECVFROM_TYPE_ARG1) (s), \ (RECVFROM_TYPE_ARG2 *)(b), \ (RECVFROM_TYPE_ARG3) (bl), \ (RECVFROM_TYPE_ARG4) (0), \ (RECVFROM_TYPE_ARG5 *)(f), \ (RECVFROM_TYPE_ARG6 *)(fl)) #endif #else /* HAVE_RECVFROM */ #ifndef sreadfrom /* */ Error Missing_definition_of_macro_sreadfrom /* */ #endif #endif /* HAVE_RECVFROM */ #ifdef RECVFROM_TYPE_ARG6_IS_VOID # define RECVFROM_ARG6_T int #else # define RECVFROM_ARG6_T RECVFROM_TYPE_ARG6 #endif #endif /* if 0 */ /* * Function-like macro definition used to close a socket. */ #if defined(HAVE_CLOSESOCKET) # define sclose(x) closesocket((x)) #elif defined(HAVE_CLOSESOCKET_CAMEL) # define sclose(x) CloseSocket((x)) #elif defined(HAVE_CLOSE_S) # define sclose(x) close_s((x)) #elif defined(USE_LWIPSOCK) # define sclose(x) lwip_close((x)) #else # define sclose(x) close((x)) #endif /* * Stack-independent version of fcntl() on sockets: */ #if defined(USE_LWIPSOCK) # define sfcntl lwip_fcntl #else # define sfcntl fcntl #endif /* * 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))) #define ISUPPER(x) (isupper((int) ((unsigned char)x))) #define ISLOWER(x) (islower((int) ((unsigned char)x))) #define ISASCII(x) (isascii((int) ((unsigned char)x))) #define ISBLANK(x) (int)((((unsigned char)x) == ' ') || \ (((unsigned char)x) == '\t')) #define TOLOWER(x) (tolower((int) ((unsigned char)x))) /* * 'bool' stuff compatible with HP-UX headers. */ #if defined(__hpux) && !defined(HAVE_BOOL_T) typedef int bool; # define false 0 # define true 1 # define HAVE_BOOL_T #endif /* * 'bool' exists on platforms with , i.e. C99 platforms. * On non-C99 platforms there's no bool, so define an enum for that. * On C99 platforms 'false' and 'true' also exist. Enum uses a * global namespace though, so use bool_false and bool_true. */ #ifndef HAVE_BOOL_T typedef enum { bool_false = 0, bool_true = 1 } bool; /* * Use a define to let 'true' and 'false' use those enums. There * are currently no use of true and false in libcurl proper, but * there are some in the examples. This will cater for any later * code happening to use true and false. */ # define false bool_false # define true bool_true # define HAVE_BOOL_T #endif /* * Redefine TRUE and FALSE too, to catch current use. With this * change, 'bool found = 1' will give a warning on MIPSPro, but * 'bool found = TRUE' will not. Change tested on IRIX/MIPSPro, * AIX 5.1/Xlc, Tru64 5.1/cc, w/make test too. */ #ifndef TRUE #define TRUE true #endif #ifndef FALSE #define FALSE false #endif /* * Macro WHILE_FALSE may be used to build single-iteration do-while loops, * avoiding compiler warnings. Mostly intended for other macro definitions. */ #define WHILE_FALSE while(0) #if defined(_MSC_VER) && !defined(__POCC__) # undef WHILE_FALSE # if (_MSC_VER < 1500) # define WHILE_FALSE while(1, 0) # else # define WHILE_FALSE \ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ while(0) \ __pragma(warning(pop)) # endif #endif /* * Typedef to 'int' if sig_atomic_t is not an available 'typedefed' type. */ #ifndef HAVE_SIG_ATOMIC_T typedef int sig_atomic_t; #define HAVE_SIG_ATOMIC_T #endif /* * Convenience SIG_ATOMIC_T definition */ #ifdef HAVE_SIG_ATOMIC_T_VOLATILE #define SIG_ATOMIC_T static sig_atomic_t #else #define SIG_ATOMIC_T static volatile sig_atomic_t #endif /* * Default return type for signal handlers. */ #ifndef RETSIGTYPE #define RETSIGTYPE void #endif /* * Macro used to include code only in debug builds. */ #ifdef DEBUGBUILD #define DEBUGF(x) x #else #define DEBUGF(x) do { } WHILE_FALSE #endif /* * Macro used to include assertion code only in debug builds. */ #if defined(DEBUGBUILD) && defined(HAVE_ASSERT_H) #define DEBUGASSERT(x) assert(x) #else #define DEBUGASSERT(x) do { } WHILE_FALSE #endif /* * Macro SOCKERRNO / SET_SOCKERRNO() returns / sets the *socket-related* errno * (or equivalent) on this platform to hide platform details to code using it. */ #ifdef USE_WINSOCK #define SOCKERRNO ((int)WSAGetLastError()) #define SET_SOCKERRNO(x) (WSASetLastError((int)(x))) #else #define SOCKERRNO (errno) #define SET_SOCKERRNO(x) (errno = (x)) #endif /* * Macro ERRNO / SET_ERRNO() returns / sets the NOT *socket-related* errno * (or equivalent) on this platform to hide platform details to code using it. */ #if defined(WIN32) && !defined(USE_LWIPSOCK) #define ERRNO ((int)GetLastError()) #define SET_ERRNO(x) (SetLastError((DWORD)(x))) #else #define ERRNO (errno) #define SET_ERRNO(x) (errno = (x)) #endif /* * Portable error number symbolic names defined to Winsock error codes. */ #ifdef USE_WINSOCK #undef EBADF /* override definition in errno.h */ #define EBADF WSAEBADF #undef EINTR /* override definition in errno.h */ #define EINTR WSAEINTR #undef EINVAL /* override definition in errno.h */ #define EINVAL WSAEINVAL #undef EWOULDBLOCK /* override definition in errno.h */ #define EWOULDBLOCK WSAEWOULDBLOCK #undef EINPROGRESS /* override definition in errno.h */ #define EINPROGRESS WSAEINPROGRESS #undef EALREADY /* override definition in errno.h */ #define EALREADY WSAEALREADY #undef ENOTSOCK /* override definition in errno.h */ #define ENOTSOCK WSAENOTSOCK #undef EDESTADDRREQ /* override definition in errno.h */ #define EDESTADDRREQ WSAEDESTADDRREQ #undef EMSGSIZE /* override definition in errno.h */ #define EMSGSIZE WSAEMSGSIZE #undef EPROTOTYPE /* override definition in errno.h */ #define EPROTOTYPE WSAEPROTOTYPE #undef ENOPROTOOPT /* override definition in errno.h */ #define ENOPROTOOPT WSAENOPROTOOPT #undef EPROTONOSUPPORT /* override definition in errno.h */ #define EPROTONOSUPPORT WSAEPROTONOSUPPORT #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT #undef EOPNOTSUPP /* override definition in errno.h */ #define EOPNOTSUPP WSAEOPNOTSUPP #define EPFNOSUPPORT WSAEPFNOSUPPORT #undef EAFNOSUPPORT /* override definition in errno.h */ #define EAFNOSUPPORT WSAEAFNOSUPPORT #undef EADDRINUSE /* override definition in errno.h */ #define EADDRINUSE WSAEADDRINUSE #undef EADDRNOTAVAIL /* override definition in errno.h */ #define EADDRNOTAVAIL WSAEADDRNOTAVAIL #undef ENETDOWN /* override definition in errno.h */ #define ENETDOWN WSAENETDOWN #undef ENETUNREACH /* override definition in errno.h */ #define ENETUNREACH WSAENETUNREACH #undef ENETRESET /* override definition in errno.h */ #define ENETRESET WSAENETRESET #undef ECONNABORTED /* override definition in errno.h */ #define ECONNABORTED WSAECONNABORTED #undef ECONNRESET /* override definition in errno.h */ #define ECONNRESET WSAECONNRESET #undef ENOBUFS /* override definition in errno.h */ #define ENOBUFS WSAENOBUFS #undef EISCONN /* override definition in errno.h */ #define EISCONN WSAEISCONN #undef ENOTCONN /* override definition in errno.h */ #define ENOTCONN WSAENOTCONN #define ESHUTDOWN WSAESHUTDOWN #define ETOOMANYREFS WSAETOOMANYREFS #undef ETIMEDOUT /* override definition in errno.h */ #define ETIMEDOUT WSAETIMEDOUT #undef ECONNREFUSED /* override definition in errno.h */ #define ECONNREFUSED WSAECONNREFUSED #undef ELOOP /* override definition in errno.h */ #define ELOOP WSAELOOP #ifndef ENAMETOOLONG /* possible previous definition in errno.h */ #define ENAMETOOLONG WSAENAMETOOLONG #endif #define EHOSTDOWN WSAEHOSTDOWN #undef EHOSTUNREACH /* override definition in errno.h */ #define EHOSTUNREACH WSAEHOSTUNREACH #ifndef ENOTEMPTY /* possible previous definition in errno.h */ #define ENOTEMPTY WSAENOTEMPTY #endif #define EPROCLIM WSAEPROCLIM #define EUSERS WSAEUSERS #define EDQUOT WSAEDQUOT #define ESTALE WSAESTALE #define EREMOTE WSAEREMOTE #endif /* * Macro argv_item_t hides platform details to code using it. */ #ifdef __VMS #define argv_item_t __char_ptr32 #else #define argv_item_t char * #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 #endif /* HEADER_CURL_SETUP_ONCE_H */ curl-7.35.0/lib/curl_threads.h0000644000175000017500000000445512270035364013104 00000000000000#ifndef HEADER_CURL_THREADS_H #define HEADER_CURL_THREADS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(USE_THREADS_POSIX) # define CURL_STDCALL # define curl_mutex_t pthread_mutex_t # define curl_thread_t pthread_t * # define curl_thread_t_null (pthread_t *)0 # define Curl_mutex_init(m) pthread_mutex_init(m, NULL) # define Curl_mutex_acquire(m) pthread_mutex_lock(m) # define Curl_mutex_release(m) pthread_mutex_unlock(m) # define Curl_mutex_destroy(m) pthread_mutex_destroy(m) #elif defined(USE_THREADS_WIN32) # define CURL_STDCALL __stdcall # define curl_mutex_t CRITICAL_SECTION # define curl_thread_t HANDLE # define curl_thread_t_null (HANDLE)0 # define Curl_mutex_init(m) InitializeCriticalSection(m) # define Curl_mutex_acquire(m) EnterCriticalSection(m) # define Curl_mutex_release(m) LeaveCriticalSection(m) # define Curl_mutex_destroy(m) DeleteCriticalSection(m) #endif #if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void*), void *arg); void Curl_thread_destroy(curl_thread_t hnd); int Curl_thread_join(curl_thread_t *hnd); #endif /* USE_THREADS_POSIX || USE_THREADS_WIN32 */ #endif /* HEADER_CURL_THREADS_H */ curl-7.35.0/lib/http2.h0000644000175000017500000000274212271275502011464 00000000000000#ifndef HEADER_CURL_HTTP2_H #define HEADER_CURL_HTTP2_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_NGHTTP2 #include "http.h" /* * Store nghttp2 version info in this buffer, Prefix with a space. Return * total length written. */ int Curl_http2_ver(char *p, size_t len); CURLcode Curl_http2_request(Curl_send_buffer *req, struct connectdata *conn); #else /* USE_NGHTTP2 */ #define Curl_http2_request(x,y) CURLE_OK #endif #endif /* HEADER_CURL_HTTP2_H */ curl-7.35.0/lib/libcurl.rc0000644000175000017500000000414012213173003012213 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2009, 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. * ***************************************************************************/ #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 defined(DEBUGBUILD) || defined(_DEBUG) 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", "© " LIBCURL_COPYRIGHT "\0" VALUE "License", "http://curl.haxx.se/docs/copyright.html\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END curl-7.35.0/lib/curl_addrinfo.h0000644000175000017500000000564112213173003013224 00000000000000#ifndef HEADER_CURL_ADDRINFO_H #define HEADER_CURL_ADDRINFO_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef __VMS # include # include # include #endif /* * Curl_addrinfo is our internal struct definition that we use to allow * consistent internal handling of this data. We use this even when the * system provides an addrinfo structure definition. And we use this for * all sorts of IPv4 and IPV6 builds. */ struct Curl_addrinfo { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; curl_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; void Curl_freeaddrinfo(Curl_addrinfo *cahead); #ifdef HAVE_GETADDRINFO int Curl_getaddrinfo_ex(const char *nodename, const char *servname, const struct addrinfo *hints, Curl_addrinfo **result); #endif Curl_addrinfo * Curl_he2ai(const struct hostent *he, int port); Curl_addrinfo * Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port); Curl_addrinfo *Curl_str2addr(char *dotted, int port); #if defined(CURLDEBUG) && defined(HAVE_FREEADDRINFO) void curl_dofreeaddrinfo(struct addrinfo *freethis, int line, const char *source); #endif #if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO) int curl_dogetaddrinfo(const char *hostname, const char *service, const struct addrinfo *hints, struct addrinfo **result, int line, const char *source); #endif #endif /* HEADER_CURL_ADDRINFO_H */ curl-7.35.0/lib/slist.h0000644000175000017500000000311012262353672011554 00000000000000#ifndef HEADER_CURL_SLIST_H #define HEADER_CURL_SLIST_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* * Curl_slist_duplicate() duplicates a linked list. It always returns the * address of the first record of the cloned list or NULL in case of an * error (or if the input list was NULL). */ struct curl_slist *Curl_slist_duplicate(struct curl_slist *inlist); /* * Curl_slist_append_nodup() takes ownership of the given string and appends * it to the list. */ struct curl_slist *Curl_slist_append_nodup(struct curl_slist *list, char *data); #endif /* HEADER_CURL_SLIST_H */ curl-7.35.0/lib/Makefile.vc60000644000175000017500000005230512270035364012406 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1999 - 2014, 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. # #*************************************************************************** # All files in the Makefile.vc* series are generated automatically from the # one made for MSVC version 6. Alas, if you want to do changes to any of the # files and send back to the project, edit the version six, make your diff and # mail curl-library. ########################################################################### # # 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. # ############################################################## # ---------------------------------------------- # Verify that current subdir is libcurl's 'lib' # ---------------------------------------------- !IF ! EXIST(.\curl_addrinfo.c) ! MESSAGE Can not process this makefile from outside of libcurl's 'lib' subdirectory. ! MESSAGE Change to libcurl's 'lib' subdirectory, and try again. ! ERROR See previous message. !ENDIF # ------------------------------------------------ # Makefile.msvc.names provides libcurl file names # ------------------------------------------------ !INCLUDE ..\winbuild\Makefile.msvc.names !IFNDEF OPENSSL_PATH OPENSSL_PATH = ../../openssl-0.9.8y !ENDIF !IFNDEF LIBSSH2_PATH LIBSSH2_PATH = ../../libssh2-1.4.3 !ENDIF !IFNDEF ZLIB_PATH ZLIB_PATH = ../../zlib-1.2.8 !ENDIF !IFNDEF MACHINE MACHINE = X86 !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". Since at least with MSVC6 the sspi.h # header is broken it is either required to install the Windows SDK, # or to fix sspi.h with adding this define at the beginning of sspi.h: # #define FreeCredentialHandle FreeCredentialsHandle # # 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/ # WINDOWS_SSPI = 1 !IFDEF WINDOWS_SSPI !IFNDEF WINDOWS_SDK_PATH WINDOWS_SDK_PATH = "$(PROGRAMFILES)\Microsoft SDK" !ENDIF !ENDIF ############################################################# ## Nothing more to do below this line! CCNODBG = cl.exe /O2 /DNDEBUG CCDEBUG = cl.exe /Od /Gm /Zi /D_DEBUG /GZ CFLAGSSSL = /DUSE_SSLEAY /DUSE_OPENSSL /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl" CFLAGSWINSSL = /DUSE_SCHANNEL CFLAGSSSH2 = /DUSE_LIBSSH2 /DCURL_DISABLE_LDAP /DHAVE_LIBSSH2 /DHAVE_LIBSSH2_H /DLIBSSH2_WIN32 /DLIBSSH2_LIBRARY /I "$(LIBSSH2_PATH)/include" CFLAGSZLIB = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I "$(ZLIB_PATH)" CFLAGS = /I. /I../include /nologo /W3 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL /D_BIND_TO_CURRENT_VCLIBS_VERSION=1 CFLAGSLIB = /DCURL_STATICLIB LNKDLL = link.exe /DLL LNKLIB = link.exe /lib LFLAGS = /nologo /machine:$(MACHINE) SSLLIBS = libeay32.lib ssleay32.lib ZLIBLIBSDLL = zdll.lib ZLIBLIBS = zlib.lib WINLIBS = ws2_32.lib wldap32.lib advapi32.lib CFLAGS = $(CFLAGS) CFGSET = FALSE !IFDEF WINDOWS_SSPI CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include !ENDIF !IFDEF USE_IPV6 CFLAGS = $(CFLAGS) /DUSE_IPV6 !ENDIF ############################################################## # Runtime library configuration RTLIB = /MD RTLIBD = /MDd !IF "$(RTLIBCFG)" == "static" RTLIB = /MT RTLIBD = /MTd !ENDIF ###################### # release !IF "$(CFG)" == "release" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl !IF "$(CFG)" == "release-ssl" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-winssl !IF "$(CFG)" == "release-winssl" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSWINSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-zlib !IF "$(CFG)" == "release-zlib" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl-zlib !IF "$(CFG)" == "release-ssl-zlib" TARGET = $(LIBCURL_STA_LIB_REL) 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-winssl-zlib !IF "$(CFG)" == "release-winssl-zlib" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSWINSSL) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl-ssh2-zlib !IF "$(CFG)" == "release-ssl-ssh2-zlib" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" LFLAGSSSH2 = "/LIBPATH:$(LIBSSH2_PATH)" LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(LFLAGSSSL) $(LFLAGSSSH2) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSSSH2) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl-dll !IF "$(CFG)" == "release-ssl-dll" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-zlib-dll !IF "$(CFG)" == "release-zlib-dll" TARGET = $(LIBCURL_STA_LIB_REL) 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 = $(LIBCURL_STA_LIB_REL) 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 !IF "$(CFG)" == "release-dll" TARGET = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LNK = $(LNKDLL) $(WINLIBS) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) CC = $(CCNODBG) $(RTLIB) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # release-dll-ssl-dll !IF "$(CFG)" == "release-dll-ssl-dll" TARGET = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # release-dll-zlib-dll !IF "$(CFG)" == "release-dll-zlib-dll" TARGET = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKDLL) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) 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 = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSZLIB) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # debug !IF "$(CFG)" == "debug" TARGET = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-ssl !IF "$(CFG)" == "debug-ssl" TARGET = $(LIBCURL_STA_LIB_DBG) 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 = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-ssl-zlib !IF "$(CFG)" == "debug-ssl-zlib" TARGET = $(LIBCURL_STA_LIB_DBG) 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-ssl-ssh2-zlib !IF "$(CFG)" == "debug-ssl-ssh2-zlib" TARGET = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LFLAGSSSH2 = "/LIBPATH:$(LIBSSH2_PATH)" LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSSSL) $(LFLAGSSSH2) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSSSH2) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-ssl-dll !IF "$(CFG)" == "debug-ssl-dll" TARGET = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)\out32dll LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-zlib-dll !IF "$(CFG)" == "debug-zlib-dll" TARGET = $(LIBCURL_STA_LIB_DBG) 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 = $(LIBCURL_STA_LIB_DBG) 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 = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LNK = $(LNKDLL) $(WINLIBS) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_PDB) CC = $(CCDEBUG) $(RTLIBD) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # debug-dll-ssl-dll !IF "$(CFG)" == "debug-dll-ssl-dll" TARGET = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_PDB) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # debug-dll-zlib-dll !IF "$(CFG)" == "debug-dll-zlib-dll" TARGET = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKDLL) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_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 = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_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-ssh2-zlib - release static library with ssl, ssh2 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-ssh2-zlib - debug static library with ssl, ssh2 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)\amigaos.obj \ $(DIROBJ)\asyn-ares.obj \ $(DIROBJ)\asyn-thread.obj \ $(DIROBJ)\axtls.obj \ $(DIROBJ)\base64.obj \ $(DIROBJ)\bundles.obj \ $(DIROBJ)\conncache.obj \ $(DIROBJ)\connect.obj \ $(DIROBJ)\content_encoding.obj \ $(DIROBJ)\cookie.obj \ $(DIROBJ)\curl_addrinfo.obj \ $(DIROBJ)\curl_darwinssl.obj \ $(DIROBJ)\curl_fnmatch.obj \ $(DIROBJ)\curl_gethostname.obj \ $(DIROBJ)\curl_gssapi.obj \ $(DIROBJ)\curl_memrchr.obj \ $(DIROBJ)\curl_multibyte.obj \ $(DIROBJ)\curl_ntlm.obj \ $(DIROBJ)\curl_ntlm_core.obj \ $(DIROBJ)\curl_ntlm_msgs.obj \ $(DIROBJ)\curl_ntlm_wb.obj \ $(DIROBJ)\curl_rtmp.obj \ $(DIROBJ)\curl_sasl.obj \ $(DIROBJ)\curl_schannel.obj \ $(DIROBJ)\curl_sspi.obj \ $(DIROBJ)\curl_threads.obj \ $(DIROBJ)\cyassl.obj \ $(DIROBJ)\dict.obj \ $(DIROBJ)\dotdot.obj \ $(DIROBJ)\easy.obj \ $(DIROBJ)\escape.obj \ $(DIROBJ)\file.obj \ $(DIROBJ)\fileinfo.obj \ $(DIROBJ)\formdata.obj \ $(DIROBJ)\ftp.obj \ $(DIROBJ)\ftplistparser.obj \ $(DIROBJ)\getenv.obj \ $(DIROBJ)\getinfo.obj \ $(DIROBJ)\gopher.obj \ $(DIROBJ)\gtls.obj \ $(DIROBJ)\hash.obj \ $(DIROBJ)\hmac.obj \ $(DIROBJ)\hostasyn.obj \ $(DIROBJ)\hostcheck.obj \ $(DIROBJ)\hostip.obj \ $(DIROBJ)\hostip4.obj \ $(DIROBJ)\hostip6.obj \ $(DIROBJ)\hostsyn.obj \ $(DIROBJ)\http.obj \ $(DIROBJ)\http_chunks.obj \ $(DIROBJ)\http_digest.obj \ $(DIROBJ)\http_negotiate.obj \ $(DIROBJ)\http_negotiate_sspi.obj \ $(DIROBJ)\http_proxy.obj \ $(DIROBJ)\idn_win32.obj \ $(DIROBJ)\if2ip.obj \ $(DIROBJ)\imap.obj \ $(DIROBJ)\inet_ntop.obj \ $(DIROBJ)\inet_pton.obj \ $(DIROBJ)\krb5.obj \ $(DIROBJ)\ldap.obj \ $(DIROBJ)\llist.obj \ $(DIROBJ)\md4.obj \ $(DIROBJ)\md5.obj \ $(DIROBJ)\memdebug.obj \ $(DIROBJ)\mprintf.obj \ $(DIROBJ)\multi.obj \ $(DIROBJ)\netrc.obj \ $(DIROBJ)\non-ascii.obj \ $(DIROBJ)\nonblock.obj \ $(DIROBJ)\nss.obj \ $(DIROBJ)\openldap.obj \ $(DIROBJ)\parsedate.obj \ $(DIROBJ)\pingpong.obj \ $(DIROBJ)\pipeline.obj \ $(DIROBJ)\polarssl.obj \ $(DIROBJ)\polarssl_threadlock.obj \ $(DIROBJ)\pop3.obj \ $(DIROBJ)\progress.obj \ $(DIROBJ)\qssl.obj \ $(DIROBJ)\rawstr.obj \ $(DIROBJ)\rtsp.obj \ $(DIROBJ)\security.obj \ $(DIROBJ)\select.obj \ $(DIROBJ)\sendf.obj \ $(DIROBJ)\share.obj \ $(DIROBJ)\slist.obj \ $(DIROBJ)\smtp.obj \ $(DIROBJ)\socks.obj \ $(DIROBJ)\socks_gssapi.obj \ $(DIROBJ)\socks_sspi.obj \ $(DIROBJ)\speedcheck.obj \ $(DIROBJ)\splay.obj \ $(DIROBJ)\ssh.obj \ $(DIROBJ)\vtls.obj \ $(DIROBJ)\openssl.obj \ $(DIROBJ)\strdup.obj \ $(DIROBJ)\strequal.obj \ $(DIROBJ)\strerror.obj \ $(DIROBJ)\strtok.obj \ $(DIROBJ)\strtoofft.obj \ $(DIROBJ)\telnet.obj \ $(DIROBJ)\tftp.obj \ $(DIROBJ)\timeval.obj \ $(DIROBJ)\transfer.obj \ $(DIROBJ)\url.obj \ $(DIROBJ)\version.obj \ $(DIROBJ)\warnless.obj \ $(DIROBJ)\wildcard.obj \ $(RESOURCE) all : $(TARGET) $(TARGET): $(X_OBJS) $(LNK) $(LFLAGS) $(X_OBJS) -xcopy $(DIROBJ)\$(LIBCURL_STA_LIB_REL) . /y -xcopy $(DIROBJ)\$(LIBCURL_STA_LIB_DBG) . /y -xcopy $(DIROBJ)\$(LIBCURL_DYN_LIB_REL) . /y -xcopy $(DIROBJ)\$(LIBCURL_DYN_LIB_DBG) . /y -xcopy $(DIROBJ)\$(LIBCURL_IMP_LIB_REL) . /y -xcopy $(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) . /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"$@" $< {.\vtls\}.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 /dDEBUGBUILD=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 /dDEBUGBUILD=0 /Fo $@ libcurl.rc !ENDIF # End of case where a config was provided. curl-7.35.0/lib/mk-ca-bundle.vbs0000755000175000017500000002647212262353672013243 00000000000000'*************************************************************************** '* _ _ ____ _ '* Project ___| | | | _ \| | '* / __| | | | |_) | | '* | (__| |_| | _ <| |___ '* \___|\___/|_| \_\_____| '* '* Copyright (C) 1998 - 2013, 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. '* '*************************************************************************** '* Script to fetch certdata.txt from Mozilla.org site and create a '* ca-bundle.crt for use with OpenSSL / libcurl / libcurl bindings '* Requires WinHttp.WinHttpRequest.5.1 and ADODB.Stream which are part of '* W2000 SP3 or later, WXP SP1 or later, W2003 Server SP1 or later. '* Hacked by Guenter Knauf '*************************************************************************** Option Explicit Const myVersion = "0.3.8" Const myUrl = "http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1" Const myOpenssl = "openssl.exe" Const myCdSavF = FALSE ' Flag: save downloaded data to file certdata.txt Const myCaBakF = TRUE ' Flag: backup existing ca-bundle certificate Const myAskLiF = TRUE ' Flag: display certdata.txt license agreement Const myAskTiF = TRUE ' Flag: ask to include certificate text info Const myWrapLe = 76 ' Default length of base64 output lines '******************* Nothing to configure below! ******************* Dim objShell, objNetwork, objFSO, objHttp Dim myBase, mySelf, myFh, myTmpFh, myCdData, myCdFile, myCaFile, myTmpName, myBakNum, myOptTxt, i Set objNetwork = WScript.CreateObject("WScript.Network") Set objShell = WScript.CreateObject("WScript.Shell") Set objFSO = WScript.CreateObject("Scripting.FileSystemObject") Set objHttp = WScript.CreateObject("WinHttp.WinHttpRequest.5.1") If objHttp Is Nothing Then Set objHttp = WScript.CreateObject("WinHttp.WinHttpRequest") myBase = Left(WScript.ScriptFullName, InstrRev(WScript.ScriptFullName, "\")) mySelf = Left(WScript.ScriptName, InstrRev(WScript.ScriptName, ".") - 1) & " " & myVersion myCdFile = Mid(myUrl, InstrRev(myUrl, "/") + 1, InstrRev(myUrl, "?") - InstrRev(myUrl, "/") - 1) myCaFile = "ca-bundle.crt" myTmpName = InputBox("Enter output filename:", mySelf, myCaFile) If Not (myTmpName = "") Then myCaFile = myTmpName End If ' Lets ignore SSL invalid cert errors objHttp.Option(4) = 256 + 512 + 4096 + 8192 objHttp.SetTimeouts 0, 5000, 10000, 10000 objHttp.Open "GET", myUrl, FALSE objHttp.setRequestHeader "User-Agent", WScript.ScriptName & "/" & myVersion objHttp.Send "" If Not (objHttp.statusText = "OK") Then MsgBox("Failed to download '" & myCdFile & "': " & objHttp.statusText), vbCritical, mySelf WScript.Quit 1 End If ' Convert data from ResponseBody instead of using ResponseText because of UTF-8 myCdData = ConvertBinaryData(objHttp.ResponseBody) Set objHttp = Nothing ' Write received data to file if enabled If (myCdSavF = TRUE) Then Set myFh = objFSO.OpenTextFile(myCdFile, 2, TRUE) myFh.Write myCdData myFh.Close End If ' Backup exitsing ca-bundle certificate file If (myCaBakF = TRUE) Then If objFSO.FileExists(myCaFile) Then Dim myBakFile, b b = 1 myBakFile = myCaFile & ".~" & b & "~" While objFSO.FileExists(myBakFile) b = b + 1 myBakFile = myCaFile & ".~" & b & "~" Wend Set myTmpFh = objFSO.GetFile(myCaFile) myTmpFh.Move myBakFile End If End If If (myAskTiF = TRUE) Then If (6 = objShell.PopUp("Do you want to include text information about each certificate?" & vbLf & _ "(requires OpenSSL commandline in current directory or in search path)",, _ mySelf, vbQuestion + vbYesNo + vbDefaultButton2)) Then myOptTxt = TRUE Else myOptTxt = FALSE End If End If ' Process the received data Dim myLines, myPattern, myInsideCert, myInsideLicense, myLicenseText, myNumCerts, myNumSkipped Dim myLabel, myOctets, myData, myPem, myRev, myUntrusted, j myNumSkipped = 0 myNumCerts = 0 myData = "" myLines = Split(myCdData, vbLf, -1) Set myFh = objFSO.OpenTextFile(myCaFile, 2, TRUE) myFh.Write "##" & vbLf myFh.Write "## " & myCaFile & " -- Bundle of CA Root Certificates" & vbLf myFh.Write "##" & vbLf myFh.Write "## Converted at: " & Now & vbLf myFh.Write "##" & vbLf myFh.Write "## This is a bundle of X.509 certificates of public Certificate Authorities" & vbLf myFh.Write "## (CA). These were automatically extracted from Mozilla's root certificates" & vbLf myFh.Write "## file (certdata.txt). This file can be found in the mozilla source tree:" & vbLf myFh.Write "## '/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt'" & vbLf myFh.Write "##" & vbLf myFh.Write "## It contains the certificates in PEM format and therefore" & vbLf myFh.Write "## can be directly used with curl / libcurl / php_curl, or with" & vbLf myFh.Write "## an Apache+mod_ssl webserver for SSL client authentication." & vbLf myFh.Write "## Just configure this file as the SSLCACertificateFile." & vbLf myFh.Write "##" & vbLf myFh.Write vbLf For i = 0 To UBound(myLines) If InstrRev(myLines(i), "CKA_LABEL ") Then myPattern = "^CKA_LABEL\s+[A-Z0-9]+\s+""(.+?)""" myLabel = RegExprFirst(myPattern, myLines(i)) End If If (myInsideCert = TRUE) Then If InstrRev(myLines(i), "END") Then myInsideCert = FALSE While (i < UBound(myLines)) And Not (myLines(i) = "#") i = i + 1 If InstrRev(myLines(i), "CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR") Then myUntrusted = FALSE End If Wend If (myUntrusted = TRUE) Then myNumSkipped = myNumSkipped + 1 Else myFh.Write myLabel & vbLf myFh.Write String(Len(myLabel), "=") & vbLf myPem = "-----BEGIN CERTIFICATE-----" & vbLf & _ Base64Encode(myData) & vbLf & _ "-----END CERTIFICATE-----" & vbLf If (myOptTxt = FALSE) Then myFh.Write myPem & vbLf Else Dim myCmd, myRval, myTmpIn, myTmpOut myTmpIn = objFSO.GetSpecialFolder(2).Path & "\" & objFSO.GetTempName myTmpOut = objFSO.GetSpecialFolder(2).Path & "\" & objFSO.GetTempName Set myTmpFh = objFSO.OpenTextFile(myTmpIn, 2, TRUE) myTmpFh.Write myPem myTmpFh.Close myCmd = myOpenssl & " x509 -md5 -fingerprint -text -inform PEM" & _ " -in " & myTmpIn & " -out " & myTmpOut myRval = objShell.Run (myCmd, 0, TRUE) objFSO.DeleteFile myTmpIn, TRUE If Not (myRval = 0) Then MsgBox("Failed to process PEM cert with OpenSSL commandline!"), vbCritical, mySelf objFSO.DeleteFile myTmpOut, TRUE WScript.Quit 3 End If Set myTmpFh = objFSO.OpenTextFile(myTmpOut, 1) myFh.Write myTmpFh.ReadAll & vbLf myTmpFh.Close objFSO.DeleteFile myTmpOut, TRUE End If myNumCerts = myNumCerts + 1 End If Else myOctets = Split(myLines(i), "\") For j = 1 To UBound(myOctets) myData = myData & Chr(CByte("&o" & myOctets(j))) Next End If End If If InstrRev(myLines(i), "CVS_ID ") Then myPattern = "^CVS_ID\s+""(.+?)""" myRev = RegExprFirst(myPattern, myLines(i)) myFh.Write "# " & myRev & vbLf & vbLf End If If InstrRev(myLines(i), "CKA_VALUE MULTILINE_OCTAL") Then myInsideCert = TRUE myUntrusted = TRUE myData = "" End If If InstrRev(myLines(i), "***** BEGIN LICENSE BLOCK *****") Then myInsideLicense = TRUE End If If (myInsideLicense = TRUE) Then myFh.Write myLines(i) & vbLf myLicenseText = myLicenseText & Mid(myLines(i), 2) & vbLf End If If InstrRev(myLines(i), "***** END LICENSE BLOCK *****") Then myInsideLicense = FALSE If (myAskLiF = TRUE) Then If Not (6 = objShell.PopUp(myLicenseText & vbLf & _ "Do you agree to the license shown above (required to proceed) ?",, _ mySelf, vbQuestion + vbYesNo + vbDefaultButton1)) Then myFh.Close objFSO.DeleteFile myCaFile, TRUE WScript.Quit 2 End If End If End If Next myFh.Close objShell.PopUp "Done (" & myNumCerts & " CA certs processed, " & myNumSkipped & _ " untrusted skipped).", 20, mySelf, vbInformation WScript.Quit 0 Function ConvertBinaryData(arrBytes) Dim objStream Set objStream = CreateObject("ADODB.Stream") objStream.Open objStream.Type = 1 objStream.Write arrBytes objStream.Position = 0 objStream.Type = 2 objStream.Charset = "ascii" ConvertBinaryData = objStream.ReadText Set objStream = Nothing End Function Function RegExprFirst(SearchPattern, TheString) Dim objRegExp, Matches ' create variables. Set objRegExp = New RegExp ' create a regular expression. objRegExp.Pattern = SearchPattern ' sets the search pattern. objRegExp.IgnoreCase = TRUE ' set to ignores case. objRegExp.Global = TRUE ' set to gloabal search. Set Matches = objRegExp.Execute(TheString) ' do the search. If (Matches.Count) Then RegExprFirst = Matches(0).SubMatches(0) ' return first match. Else RegExprFirst = "" End If Set objRegExp = Nothing End Function Function Base64Encode(inData) Const Base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" Dim cOut, sOut, lWrap, I lWrap = Int(myWrapLe * 3 / 4) 'For each group of 3 bytes For I = 1 To Len(inData) Step 3 Dim nGroup, pOut, sGroup 'Create one long from this 3 bytes. nGroup = &H10000 * Asc(Mid(inData, I, 1)) + _ &H100 * MyASC(Mid(inData, I + 1, 1)) + _ MyASC(Mid(inData, I + 2, 1)) 'Oct splits the long To 8 groups with 3 bits nGroup = Oct(nGroup) 'Add leading zeros nGroup = String(8 - Len(nGroup), "0") & nGroup 'Convert To base64 pOut = Mid(Base64, CLng("&o" & Mid(nGroup, 1, 2)) + 1, 1) & _ Mid(Base64, CLng("&o" & Mid(nGroup, 3, 2)) + 1, 1) & _ Mid(Base64, CLng("&o" & Mid(nGroup, 5, 2)) + 1, 1) & _ Mid(Base64, CLng("&o" & Mid(nGroup, 7, 2)) + 1, 1) 'Add the part To OutPut string sOut = sOut + pOut 'Add a new line For Each myWrapLe chars In dest If (I < Len(inData) - 2) Then If (I + 2) Mod lWrap = 0 Then sOut = sOut & vbLf End If Next Select Case Len(inData) Mod 3 Case 1: '8 bit final sOut = Left(sOut, Len(sOut) - 2) & "==" Case 2: '16 bit final sOut = Left(sOut, Len(sOut) - 1) & "=" End Select Base64Encode = sOut End Function Function MyASC(OneChar) If OneChar = "" Then MyASC = 0 Else MyASC = Asc(OneChar) End Function curl-7.35.0/lib/content_encoding.c0000644000175000017500000003030112213173003013713 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_LIBZ #include "urldata.h" #include #include "sendf.h" #include "content_encoding.h" #include "curl_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 CURL_MAX_WRITE_SIZE /* 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 */ static voidpf zalloc_cb(voidpf opaque, unsigned int items, unsigned int size) { (void) opaque; /* not a typo, keep it calloc() */ return (voidpf) calloc(items, size); } static void zfree_cb(voidpf opaque, voidpf ptr) { (void) opaque; free(ptr); } 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, zlibInitState *zlib_init, CURLcode result) { inflateEnd(z); *zlib_init = ZLIB_UNINIT; return result; } static CURLcode inflate_stream(struct connectdata *conn, struct SingleRequest *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 = 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) && (!k->ignorebody)) { 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 */ /* status is always Z_OK at this point! */ if(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 */ (void) inflateEnd(z); /* don't care about the return code */ if(inflateInit2(z, -MAX_WBITS) != Z_OK) { free(decomp); return exit_zlib(z, &k->zlib_init, 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 SingleRequest *k, ssize_t nread) { z_stream *z = &k->z; /* zlib state structure */ /* Initialize zlib? */ if(k->zlib_init == ZLIB_UNINIT) { memset(z, 0, sizeof(z_stream)); z->zalloc = (alloc_func)zalloc_cb; z->zfree = (free_func)zfree_cb; 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; } if(flags & HEAD_CRC) { if(len < 2) return GZIP_UNDERFLOW; len -= 2; } *headerlen = totallen - len; return GZIP_OK; } #endif CURLcode Curl_unencode_gzip_write(struct connectdata *conn, struct SingleRequest *k, ssize_t nread) { z_stream *z = &k->z; /* zlib state structure */ /* Initialize zlib? */ if(k->zlib_init == ZLIB_UNINIT) { memset(z, 0, sizeof(z_stream)); z->zalloc = (alloc_func)zalloc_cb; z->zfree = (free_func)zfree_cb; 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 += (uInt)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 } void Curl_unencode_cleanup(struct connectdata *conn) { struct SessionHandle *data = conn->data; struct SingleRequest *k = &data->req; z_stream *z = &k->z; if(k->zlib_init != ZLIB_UNINIT) (void) exit_zlib(z, &k->zlib_init, CURLE_OK); } #endif /* HAVE_LIBZ */ curl-7.35.0/lib/if2ip.c0000644000175000017500000001350512262102134011414 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # 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 HAVE_IFADDRS_H # include #endif #ifdef HAVE_STROPTS_H # include #endif #ifdef __VMS # include #endif #include "inet_ntop.h" #include "strequal.h" #include "if2ip.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* ------------------------------------------------------------------ */ #if defined(HAVE_GETIFADDRS) bool Curl_if_is_interface_name(const char *interf) { bool result = FALSE; struct ifaddrs *iface, *head; if(getifaddrs(&head) >= 0) { for(iface=head; iface != NULL; iface=iface->ifa_next) { if(curl_strequal(iface->ifa_name, interf)) { result = TRUE; break; } } freeifaddrs(head); } return result; } if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope, const char *interf, char *buf, int buf_size) { struct ifaddrs *iface, *head; if2ip_result_t res = IF2IP_NOT_FOUND; #ifndef ENABLE_IPV6 (void) remote_scope; #endif if(getifaddrs(&head) >= 0) { for(iface=head; iface != NULL; iface=iface->ifa_next) { if(iface->ifa_addr != NULL) { if(iface->ifa_addr->sa_family == af) { if(curl_strequal(iface->ifa_name, interf)) { void *addr; char *ip; char scope[12]=""; char ipstr[64]; #ifdef ENABLE_IPV6 if(af == AF_INET6) { unsigned int scopeid = 0; addr = &((struct sockaddr_in6 *)iface->ifa_addr)->sin6_addr; #ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID /* Include the scope of this interface as part of the address */ scopeid = ((struct sockaddr_in6 *)iface->ifa_addr)->sin6_scope_id; #endif if(scopeid != remote_scope) { /* We are interested only in interface addresses whose scope ID matches the remote address we want to connect to: global (0) for global, link-local for link-local, etc... */ if(res == IF2IP_NOT_FOUND) res = IF2IP_AF_NOT_SUPPORTED; continue; } if(scopeid) snprintf(scope, sizeof(scope), "%%%u", scopeid); } else #endif addr = &((struct sockaddr_in *)iface->ifa_addr)->sin_addr; res = IF2IP_FOUND; ip = (char *) Curl_inet_ntop(af, addr, ipstr, sizeof(ipstr)); snprintf(buf, buf_size, "%s%s", ip, scope); break; } } else if((res == IF2IP_NOT_FOUND) && curl_strequal(iface->ifa_name, interf)) { res = IF2IP_AF_NOT_SUPPORTED; } } } freeifaddrs(head); } return res; } #elif defined(HAVE_IOCTL_SIOCGIFADDR) bool Curl_if_is_interface_name(const char *interf) { /* This is here just to support the old interfaces */ char buf[256]; return (Curl_if2ip(AF_INET, 0, interf, buf, sizeof(buf)) == IF2IP_NOT_FOUND) ? FALSE : TRUE; } if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope, const char *interf, char *buf, int buf_size) { struct ifreq req; struct in_addr in; struct sockaddr_in *s; curl_socket_t dummy; size_t len; (void)remote_scope; if(!interf || (af != AF_INET)) return IF2IP_NOT_FOUND; len = strlen(interf); if(len >= sizeof(req.ifr_name)) return IF2IP_NOT_FOUND; dummy = socket(AF_INET, SOCK_STREAM, 0); if(CURL_SOCKET_BAD == dummy) return IF2IP_NOT_FOUND; memset(&req, 0, sizeof(req)); memcpy(req.ifr_name, interf, len+1); req.ifr_addr.sa_family = AF_INET; if(ioctl(dummy, SIOCGIFADDR, &req) < 0) { sclose(dummy); /* With SIOCGIFADDR, we cannot tell the difference between an interface that does not exist and an interface that has no address of the correct family. Assume the interface does not exist */ return IF2IP_NOT_FOUND; } s = (struct sockaddr_in *)&req.ifr_addr; memcpy(&in, &s->sin_addr, sizeof(in)); Curl_inet_ntop(s->sin_family, &in, buf, buf_size); sclose(dummy); return IF2IP_FOUND; } #else bool Curl_if_is_interface_name(const char *interf) { (void) interf; return FALSE; } if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope, const char *interf, char *buf, int buf_size) { (void) af; (void) remote_scope; (void) interf; (void) buf; (void) buf_size; return IF2IP_NOT_FOUND; } #endif curl-7.35.0/lib/config-symbian.h0000644000175000017500000005561612213173003013325 00000000000000#ifndef HEADER_CURL_CONFIG_SYMBIAN_H #define HEADER_CURL_CONFIG_SYMBIAN_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* ================================================================ */ /* Hand crafted config file for Symbian */ /* ================================================================ */ /* Location of default ca bundle */ /* #define CURL_CA_BUNDLE "/etc/pki/tls/certs/ca-bundle.crt"*/ /* Location of default ca path */ /* #undef CURL_CA_PATH */ /* 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 */ #define CURL_DISABLE_LDAP 1 /* to disable LDAPS */ #define CURL_DISABLE_LDAPS 1 /* to disable TELNET */ /* #undef CURL_DISABLE_TELNET */ /* to disable TFTP */ /* #undef CURL_DISABLE_TFTP */ /* to disable verbose strings */ /* #define CURL_DISABLE_VERBOSE_STRINGS 1*/ /* Definition to make a library symbol externally visible. */ /* #undef CURL_EXTERN_SYMBOL */ /* Use Windows LDAP implementation */ /* #undef CURL_LDAP_WIN */ /* your Entropy Gathering Daemon socket pathname */ /* #undef EGD_SOCKET */ /* Define if you want to enable IPv6 support */ #define ENABLE_IPV6 1 /* Define if struct sockaddr_in6 has the sin6_scope_id member */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 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 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. */ /*#define HAVE_ARPA_TFTP_H 1*/ /* 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 bool is an available type. */ /*#define HAVE_BOOL_T 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. */ /*#define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1*/ /* 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 */ /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */ /*#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. */ #define HAVE_ERR_H 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have the fcntl function. */ #define HAVE_FCNTL 1 /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ #define HAVE_FCNTL_O_NONBLOCK 1 /* Define to 1 if you have the `fork' function. */ /*#define HAVE_FORK 1*/ /* Define to 1 if you have the `ftruncate' function. */ #define HAVE_FTRUNCATE 1 /* Define if getaddrinfo exists and works */ #define HAVE_GETADDRINFO 1 /* 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 */ /* Define to 1 if you have the getnameinfo function. */ #define HAVE_GETNAMEINFO 1 /* Define to 1 if you have the `getpass_r' function. */ /* #undef HAVE_GETPASS_R */ /* Define to 1 if you have the `getppid' function. */ #define HAVE_GETPPID 1 /* Define to 1 if you have the `getprotobyname' function. */ #define HAVE_GETPROTOBYNAME 1 /* Define to 1 if you have the `getpwuid' function. */ #define HAVE_GETPWUID 1 /* Define to 1 if you have the `getrlimit' function. */ /*#define HAVE_GETRLIMIT 1*/ /* 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 to 1 if you have the `gmtime_r' function. */ #define HAVE_GMTIME_R 1 /* if you have the gssapi libraries */ /* #undef HAVE_GSSAPI */ /* Define to 1 if you have the header file. */ /* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_GSSAPI_GSSAPI_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_GSSAPI_GSSAPI_KRB5_H */ /* 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. */ /*#define HAVE_IDNA_STRERROR 1*/ /* Define to 1 if you have the `idn_free' function. */ /*#define HAVE_IDN_FREE 1*/ /* Define to 1 if you have the header file. */ /*#define HAVE_IDN_FREE_H 1*/ /* Define to 1 if you have the `inet_addr' function. */ /*#define HAVE_INET_ADDR 1*/ /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ /*#define HAVE_INET_NTOP 1*/ /* Define to 1 if you have a IPv6 capable working inet_pton function. */ /*#define HAVE_INET_PTON 1*/ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the ioctl function. */ #define HAVE_IOCTL 1 /* Define to 1 if you have a working ioctl FIONBIO function. */ #define HAVE_IOCTL_FIONBIO 1 /* Define to 1 if you have the ioctlsocket function. */ /* #undef HAVE_IOCTLSOCKET */ /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_FIONBIO */ /* Define to 1 if you have the IoctlSocket camel case function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL */ /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ /* 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 lber.h header file. */ /*#define HAVE_LBER_H 1*/ /* Define to 1 if you have the ldapssl.h header file. */ /* #undef HAVE_LDAPSSL_H */ /* Define to 1 if you have the ldap.h header file. */ /*#define HAVE_LDAP_H 1*/ /* Use LDAPS implementation */ /*#define HAVE_LDAP_SSL 1*/ /* Define to 1 if you have the ldap_ssl.h header file. */ /* #undef HAVE_LDAP_SSL_H */ /* Define to 1 if you have the `ldap_url_parse' function. */ /*#define HAVE_LDAP_URL_PARSE 1*/ /* Define to 1 if you have the header file. */ /*#define HAVE_LIBGEN_H 1*/ /* Define to 1 if you have the `idn' library (-lidn). */ /*#define HAVE_LIBIDN 1*/ /* 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 `ssh2' library (-lssh2). */ /*#define HAVE_LIBSSH2 1*/ /* Define to 1 if you have the header file. */ /*#define HAVE_LIBSSH2_H 1*/ /* Define to 1 if you have the `ssl' library (-lssl). */ /*#define HAVE_LIBSSL 1*/ /* 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 /* Define to 1 if the compiler supports the 'long long' data type. */ #define HAVE_LONGLONG 1 /* Define to 1 if you have the malloc.h header file. */ /*#define HAVE_MALLOC_H 1*/ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the MSG_NOSIGNAL flag. */ /*#define HAVE_MSG_NOSIGNAL 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. */ /*#define HAVE_NETINET_TCP_H 1*/ /* Define to 1 if you have the header file. */ #define HAVE_NET_IF_H 1 /* Define to 1 if NI_WITHSCOPEID exists and works. */ /*#define HAVE_NI_WITHSCOPEID 1*/ /* we have no strerror_r() proto */ /* #undef HAVE_NO_STRERROR_R_DECL */ /* if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE */ /* #undef HAVE_OLD_GSSMIT */ /* Define to 1 if you have the header file. */ /*#define HAVE_OPENSSL_CRYPTO_H 1*/ /* Define to 1 if you have the header file. */ /*#define HAVE_OPENSSL_ENGINE_H 1*/ /* Define to 1 if you have the header file. */ /*#define HAVE_OPENSSL_ERR_H 1*/ /* Define to 1 if you have the header file. */ /*#define HAVE_OPENSSL_PEM_H 1*/ /* Define to 1 if you have the header file. */ /*#define HAVE_OPENSSL_PKCS12_H 1*/ /* Define to 1 if you have the header file. */ /*#define HAVE_OPENSSL_RSA_H 1*/ /* Define to 1 if you have the header file. */ /*#define HAVE_OPENSSL_SSL_H 1*/ /* Define to 1 if you have the header file. */ /*#define HAVE_OPENSSL_X509_H 1*/ /* Define to 1 if you have the header file. */ /* #undef HAVE_PEM_H */ /* 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. */ /*#define HAVE_POLL 1*/ /* If you have a fine poll */ /*#define HAVE_POLL_FINE 1*/ /* Define to 1 if you have the header file. */ /*#define HAVE_POLL_H 1*/ /* we have a POSIX-style strerror_r() */ #define HAVE_POSIX_STRERROR_R 1 /* Define to 1 if you have the header file. */ #define HAVE_PWD_H 1 /* Define to 1 if you have the `RAND_egd' function. */ #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. */ /*#define HAVE_RAND_STATUS 1*/ /* Define to 1 if you have the recv function. */ #define HAVE_RECV 1 /* Define to 1 if you have the recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_RSA_H */ /* Define to 1 if you have the select function. */ #define HAVE_SELECT 1 /* Define to 1 if you have the send function. */ #define HAVE_SEND 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 `setmode' function. */ /* #undef HAVE_SETMODE */ /* Define to 1 if you have the `setrlimit' function. */ /*#define HAVE_SETRLIMIT 1*/ /* Define to 1 if you have the setsockopt function. */ /* #undef HAVE_SETSOCKOPT */ /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ /* Define to 1 if you have the header file. */ /*#define 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. */ /*#define HAVE_SIGINTERRUPT 1*/ /* Define to 1 if you have the `signal' function. */ /*#define HAVE_SIGNAL 1*/ /* Define to 1 if you have the header file. */ #define HAVE_SIGNAL_H 1 /* If you have sigsetjmp */ /*#define HAVE_SIGSETJMP 1*/ /* Define to 1 if sig_atomic_t is an available typedef. */ /*#define HAVE_SIG_ATOMIC_T 1*/ /* Define to 1 if sig_atomic_t is already defined as volatile. */ /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ /* Define to 1 if you have the `socket' function. */ #define HAVE_SOCKET 1 /* Define this if you have the SPNEGO library fbopenssl */ /* #undef HAVE_SPNEGO */ /* Define to 1 if you have the `SSL_get_shutdown' function. */ /*#define HAVE_SSL_GET_SHUTDOWN 1*/ /* Define to 1 if you have the header file. */ /* #undef HAVE_SSL_H */ /* Define to 1 if you have the header file. */ #define HAVE_STDBOOL_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_STDIO_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 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 `strlcpy' function. */ #define HAVE_STRLCPY 1 /* 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 */ #define HAVE_STRUCT_SOCKADDR_STORAGE 1 /* Define to 1 if you have the timeval struct. */ #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. */ /*#define HAVE_SYS_POLL_H 1*/ /* 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. */ #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. */ /*#define HAVE_TERMIOS_H 1*/ /* Define to 1 if you have the header file. */ /*#define HAVE_TERMIO_H 1*/ /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 /* Define to 1 if you have the header file. */ /*#define HAVE_TLD_H 1*/ /* Define to 1 if you have the `tld_strerror' function. */ /*#define HAVE_TLD_STRERROR 1*/ /* Define to 1 if you have the `uname' function. */ #define HAVE_UNAME 1 /* 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 compiler supports C99 variadic macro style. */ #define HAVE_VARIADIC_MACROS_C99 1 /* Define to 1 if compiler supports old gcc variadic macro style. */ /*#define HAVE_VARIADIC_MACROS_GCC 1*/ /* Define to 1 if you have the winber.h header file. */ /* #undef HAVE_WINBER_H */ /* Define to 1 if you have the windows.h header file. */ /* #undef HAVE_WINDOWS_H */ /* Define to 1 if you have the winldap.h header file. */ /* #undef HAVE_WINLDAP_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 */ /*#define HAVE_WRITABLE_ARGV 1*/ /* 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 */ /* Define to 1 if you need the lber.h header file even with ldap.h */ /* #undef NEED_LBER_H */ /* Define to 1 if you need the malloc.h header file even with stdlib.h */ /* #undef NEED_MALLOC_H */ /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ /* #undef NEED_REENTRANT */ /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ /* #undef NEED_THREAD_SAFE */ /* cpu-machine-OS */ #ifdef __WINS__ #define OS "i386-pc-epoc32" #elif __MARM__ #define OS "arm-unknown-epoc32" #else /* This won't happen on any current Symbian version */ #define OS "unknown-unknown-epoc32" #endif /* 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 */ /*#define RANDOM_FILE "/dev/urandom"*/ #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 RECVFROM_TYPE_ARG1 int #define RECVFROM_TYPE_ARG2 void #define RECVFROM_TYPE_ARG3 size_t #define RECVFROM_TYPE_ARG4 int #define RECVFROM_TYPE_ARG5 struct sockaddr #define RECVFROM_TYPE_ARG6 size_t #define RECVFROM_TYPE_RETV ssize_t #define RECVFROM_TYPE_ARG2_IS_VOID 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 /* 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 `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* The size of `off_t', as computed by sizeof. */ #define SIZEOF_OFF_T 8 /* The size of `short', as computed by sizeof. */ #define SIZEOF_SHORT 2 /* The size of `size_t', as computed by sizeof. */ #define SIZEOF_SIZE_T 4 /* The size of `time_t', as computed by sizeof. */ #define SIZEOF_TIME_T 4 /* 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 c-ares support */ /* #undef USE_ARES */ /* Define to disable non-blocking sockets */ /* #undef USE_BLOCKING_SOCKETS */ /* if GnuTLS is enabled */ /* #undef USE_GNUTLS */ /* if libSSH2 is in use */ /*#define USE_LIBSSH2 1*/ /* If you want to build curl with the built-in manual */ /*#define USE_MANUAL 1*/ /* if NSS is enabled */ /* #undef USE_NSS */ /* to enable SSPI support */ /* #undef USE_WINDOWS_SSPI */ /* Define to 1 if using yaSSL in OpenSSL compatibility mode. */ /* #undef USE_YASSLEMUL */ /* Version number of package */ /*#define VERSION "7.18.2-CVS"*/ /* 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. */ #define _FILE_OFFSET_BITS 64 /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* 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 `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ #endif /* Define to `unsigned int' if does not define. */ /* #undef size_t */ /* the signed version of size_t */ /* #undef ssize_t */ /* Enabling curl debug mode when building in Symbian debug mode would work */ /* except that debug mode introduces new exports that must be frozen. */ #ifdef _DEBUG /* #define CURLDEBUG */ #endif /* sys/cdefs.h fails to define this for WINSCW prior to Symbian OS ver. 9.4 */ #ifndef __LONG_LONG_SUPPORTED #define __LONG_LONG_SUPPORTED #endif /* Enable appropriate header only when zlib support is enabled */ #ifdef HAVE_LIBZ #define HAVE_ZLIB_H 1 #endif /* Enable appropriate definitions only when OpenSSL support is enabled */ #ifdef USE_SSLEAY /* if OpenSSL is in use */ #define USE_OPENSSL #endif #endif /* HEADER_CURL_CONFIG_SYMBIAN_H */ curl-7.35.0/lib/hostip.h0000644000175000017500000001745012262353672011740 00000000000000#ifndef HEADER_CURL_HOSTIP_H #define HEADER_CURL_HOSTIP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #include "hash.h" #include "curl_addrinfo.h" #include "asyn.h" #ifdef HAVE_SETJMP_H #include #endif #ifdef NETWARE #undef in_addr_t #define in_addr_t unsigned long #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 */ #define CURL_ASYNC_SUCCESS CURLE_OK struct addrinfo; struct hostent; struct SessionHandle; struct connectdata; /* * 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! * * Returns a struct curl_hash pointer on success, NULL on failure. */ struct curl_hash *Curl_global_host_cache_init(void); void Curl_global_host_cache_dtor(void); struct Curl_dns_entry { Curl_addrinfo *addr; /* timestamp == 0 -- entry not in hostcache timestamp != 0 -- entry is in hostcache */ 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_TIMEDOUT -2 #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); int Curl_resolv_timeout(struct connectdata *conn, const char *hostname, int port, struct Curl_dns_entry **dnsentry, long timeoutms); #ifdef CURLRES_IPV6 /* * Curl_ipv6works() returns TRUE if ipv6 seems to work. */ bool Curl_ipv6works(void); #else #define Curl_ipv6works() FALSE #endif /* * Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've * been set and returns TRUE if they are OK. */ bool Curl_ipvalid(struct connectdata *conn); /* * 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); /* 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); /* 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); #if defined(CURLDEBUG) && defined(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 /* IPv4 threadsafe resolve function used for synch and asynch builds */ Curl_addrinfo *Curl_ipv4_resolve_r(const char * hostname, int port); CURLcode Curl_async_resolved(struct connectdata *conn, bool *protocol_connect); #ifndef CURLRES_ASYNCH #define Curl_async_resolved(x,y) CURLE_OK #endif /* * Curl_addrinfo_callback() is used when we build with any asynch specialty. * Handles end of async request processing. Inserts ai into hostcache when * status is CURL_ASYNC_SUCCESS. Twiddles fields in conn to indicate async * request completed whether successful or failed. */ CURLcode Curl_addrinfo_callback(struct connectdata *conn, int status, Curl_addrinfo *ai); /* * 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); #ifndef INADDR_NONE #define CURL_INADDR_NONE (in_addr_t) ~0 #else #define CURL_INADDR_NONE INADDR_NONE #endif #ifdef HAVE_SIGSETJMP /* Forward-declaration of variable defined in hostip.c. 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. */ extern sigjmp_buf curl_jmpenv; #endif /* * Function provided by the resolver backend to set DNS servers to use. */ CURLcode Curl_set_dns_servers(struct SessionHandle *data, char *servers); /* * Function provided by the resolver backend to set * outgoing interface to use for DNS requests */ CURLcode Curl_set_dns_interface(struct SessionHandle *data, const char *interf); /* * Function provided by the resolver backend to set * local IPv4 address to use as source address for DNS requests */ CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data, const char *local_ip4); /* * Function provided by the resolver backend to set * local IPv6 address to use as source address for DNS requests */ CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data, const char *local_ip6); /* * Clean off entries from the cache */ void Curl_hostcache_clean(struct SessionHandle *data, struct curl_hash *hash); /* * Destroy the hostcache of this handle. */ void Curl_hostcache_destroy(struct SessionHandle *data); /* * Populate the cache with specified entries from CURLOPT_RESOLVE. */ CURLcode Curl_loadhostpairs(struct SessionHandle *data); #endif /* HEADER_CURL_HOSTIP_H */ curl-7.35.0/lib/README.httpauth0000644000175000017500000000645412213173003012763 00000000000000 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. curl-7.35.0/lib/tftp.c0000644000175000017500000011757112272003552011375 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_TFTP #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_SYS_PARAM_H #include #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 */ #include "multiif.h" #include "url.h" #include "rawstr.h" #include "speedcheck.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" #include "select.h" /* The last #include file should be: */ #include "memdebug.h" /* RFC2348 allows the block size to be negotiated */ #define TFTP_BLKSIZE_DEFAULT 512 #define TFTP_BLKSIZE_MIN 8 #define TFTP_BLKSIZE_MAX 65464 #define TFTP_OPTION_BLKSIZE "blksize" /* from RFC2349: */ #define TFTP_OPTION_TSIZE "tsize" #define TFTP_OPTION_INTERVAL "timeout" 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_NONE = -1, 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_OACK = 6, 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, /* This will never be triggered by this code */ /* The remaining error codes are internal to curl */ TFTP_ERR_NONE = -100, TFTP_ERR_TIMEOUT, TFTP_ERR_NORESPONSE } tftp_error_t; typedef struct tftp_packet { unsigned char *data; } tftp_packet_t; typedef struct tftp_state_data { tftp_state_t state; tftp_mode_t mode; tftp_error_t error; tftp_event_t event; struct connectdata *conn; curl_socket_t sockfd; int retries; int retry_time; int retry_max; time_t start_time; time_t max_time; time_t rx_time; unsigned short block; struct Curl_sockaddr_storage local_addr; struct Curl_sockaddr_storage remote_addr; curl_socklen_t remote_addrlen; int rbytes; int sbytes; int blksize; int requested_blksize; 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) ; static CURLcode tftp_connect(struct connectdata *conn, bool *done); static CURLcode tftp_disconnect(struct connectdata *conn, bool dead_connection); static CURLcode tftp_do(struct connectdata *conn, bool *done); static CURLcode tftp_done(struct connectdata *conn, CURLcode, bool premature); static CURLcode tftp_setup_connection(struct connectdata * conn); static CURLcode tftp_multi_statemach(struct connectdata *conn, bool *done); static CURLcode tftp_doing(struct connectdata *conn, bool *dophase_done); static int tftp_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks); static CURLcode tftp_translate_code(tftp_error_t error); /* * TFTP protocol handler. */ const struct Curl_handler Curl_handler_tftp = { "TFTP", /* scheme */ tftp_setup_connection, /* setup_connection */ tftp_do, /* do_it */ tftp_done, /* done */ ZERO_NULL, /* do_more */ tftp_connect, /* connect_it */ tftp_multi_statemach, /* connecting */ tftp_doing, /* doing */ tftp_getsock, /* proto_getsock */ tftp_getsock, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ tftp_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_TFTP, /* defport */ CURLPROTO_TFTP, /* protocol */ PROTOPT_NONE | PROTOPT_NOURLQUERY /* flags */ }; /********************************************************** * * 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 * * **********************************************************/ static CURLcode tftp_set_timeouts(tftp_state_data_t *state) { time_t maxtime, timeout; long timeout_ms; bool start = (state->state == TFTP_STATE_START) ? TRUE : FALSE; time(&state->start_time); /* Compute drop-dead time */ timeout_ms = Curl_timeleft(state->conn->data, NULL, start); if(timeout_ms < 0) { /* time-out, bail out, go home */ failf(state->conn->data, "Connection time-out"); return CURLE_OPERATION_TIMEDOUT; } if(start) { maxtime = (time_t)(timeout_ms + 500) / 1000; state->max_time = state->start_time+maxtime; /* Set per-block timeout to total */ timeout = maxtime ; /* Average restart after 5 seconds */ state->retry_max = (int)timeout/5; if(state->retry_max < 1) /* avoid division by zero below */ state->retry_max = 1; /* Compute the re-start interval to suit the timeout */ state->retry_time = (int)timeout/state->retry_max; if(state->retry_time<1) state->retry_time=1; } else { if(timeout_ms > 0) maxtime = (time_t)(timeout_ms + 500) / 1000; else maxtime = 3600; state->max_time = state->start_time+maxtime; /* Set per-block timeout to total */ timeout = maxtime; /* Average reposting an ACK after 5 seconds */ state->retry_max = (int)timeout/5; } /* 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 = (int)(timeout/state->retry_max); if(state->retry_time<1) state->retry_time=1; infof(state->conn->data, "set timeouts for state %d; Total %ld, retry %d maxtry %d\n", (int)state->state, (long)(state->max_time-state->start_time), state->retry_time, state->retry_max); /* init RX time */ time(&state->rx_time); return CURLE_OK; } /********************************************************** * * 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(const tftp_packet_t *packet) { return (unsigned short)((packet->data[0] << 8) | packet->data[1]); } static unsigned short getrpacketblock(const tftp_packet_t *packet) { return (unsigned short)((packet->data[2] << 8) | packet->data[3]); } static size_t Curl_strnlen(const char *string, size_t maxlen) { const char *end = memchr (string, '\0', maxlen); return end ? (size_t) (end - string) : maxlen; } static const char *tftp_option_get(const char *buf, size_t len, const char **option, const char **value) { size_t loc; loc = Curl_strnlen( buf, len ); loc++; /* NULL term */ if(loc >= len) return NULL; *option = buf; loc += Curl_strnlen( buf+loc, len-loc ); loc++; /* NULL term */ if(loc > len) return NULL; *value = &buf[strlen(*option) + 1]; return &buf[loc]; } static CURLcode tftp_parse_option_ack(tftp_state_data_t *state, const char *ptr, int len) { const char *tmp = ptr; struct SessionHandle *data = state->conn->data; /* if OACK doesn't contain blksize option, the default (512) must be used */ state->blksize = TFTP_BLKSIZE_DEFAULT; while(tmp < ptr + len) { const char *option, *value; tmp = tftp_option_get(tmp, ptr + len - tmp, &option, &value); if(tmp == NULL) { failf(data, "Malformed ACK packet, rejecting"); return CURLE_TFTP_ILLEGAL; } infof(data, "got option=(%s) value=(%s)\n", option, value); if(checkprefix(option, TFTP_OPTION_BLKSIZE)) { long blksize; blksize = strtol( value, NULL, 10 ); if(!blksize) { failf(data, "invalid blocksize value in OACK packet"); return CURLE_TFTP_ILLEGAL; } else if(blksize > TFTP_BLKSIZE_MAX) { failf(data, "%s (%d)", "blksize is larger than max supported", TFTP_BLKSIZE_MAX); return CURLE_TFTP_ILLEGAL; } else if(blksize < TFTP_BLKSIZE_MIN) { failf(data, "%s (%d)", "blksize is smaller than min supported", TFTP_BLKSIZE_MIN); return CURLE_TFTP_ILLEGAL; } else if(blksize > state->requested_blksize) { /* could realloc pkt buffers here, but the spec doesn't call out * support for the server requesting a bigger blksize than the client * requests */ failf(data, "%s (%ld)", "server requested blksize larger than allocated", blksize); return CURLE_TFTP_ILLEGAL; } state->blksize = (int)blksize; infof(data, "%s (%d) %s (%d)\n", "blksize parsed from OACK", state->blksize, "requested", state->requested_blksize); } else if(checkprefix(option, TFTP_OPTION_TSIZE)) { long tsize = 0; tsize = strtol( value, NULL, 10 ); infof(data, "%s (%ld)\n", "tsize parsed from OACK", tsize); /* tsize should be ignored on upload: Who cares about the size of the remote file? */ if(!data->set.upload) { if(!tsize) { failf(data, "invalid tsize -:%s:- value in OACK packet", value); return CURLE_TFTP_ILLEGAL; } Curl_pgrsSetDownloadSize(data, tsize); } } } return CURLE_OK; } static size_t tftp_option_add(tftp_state_data_t *state, size_t csize, char *buf, const char *option) { if(( strlen(option) + csize + 1 ) > (size_t)state->blksize) return 0; strcpy(buf, option); return( strlen(option) + 1 ); } static CURLcode tftp_connect_for_tx(tftp_state_data_t *state, tftp_event_t event) { CURLcode res; #ifndef CURL_DISABLE_VERBOSE_STRINGS struct SessionHandle *data = state->conn->data; infof(data, "%s\n", "Connected for transmit"); #endif state->state = TFTP_STATE_TX; res = tftp_set_timeouts(state); if(res != CURLE_OK) return(res); return tftp_tx(state, event); } static CURLcode tftp_connect_for_rx(tftp_state_data_t *state, tftp_event_t event) { CURLcode res; #ifndef CURL_DISABLE_VERBOSE_STRINGS struct SessionHandle *data = state->conn->data; infof(data, "%s\n", "Connected for receive"); #endif state->state = TFTP_STATE_RX; res = tftp_set_timeouts(state); if(res != CURLE_OK) return(res); return tftp_rx(state, event); } static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event) { size_t sbytes; ssize_t senddata; const char *mode = "octet"; char *filename; char buf[64]; 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); state->conn->data->req.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); } /* 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. */ filename = curl_easy_unescape(data, &state->conn->data->state.path[1], 0, NULL); if(!filename) return CURLE_OUT_OF_MEMORY; snprintf((char *)state->spacket.data+2, state->blksize, "%s%c%s%c", filename, '\0', mode, '\0'); sbytes = 4 + strlen(filename) + strlen(mode); /* add tsize option */ if(data->set.upload && (data->set.infilesize != -1)) snprintf(buf, sizeof(buf), "%" CURL_FORMAT_CURL_OFF_T, data->set.infilesize); else strcpy(buf, "0"); /* the destination is large enough */ sbytes += tftp_option_add(state, sbytes, (char *)state->spacket.data+sbytes, TFTP_OPTION_TSIZE); sbytes += tftp_option_add(state, sbytes, (char *)state->spacket.data+sbytes, buf); /* add blksize option */ snprintf( buf, sizeof(buf), "%d", state->requested_blksize ); sbytes += tftp_option_add(state, sbytes, (char *)state->spacket.data+sbytes, TFTP_OPTION_BLKSIZE); sbytes += tftp_option_add(state, sbytes, (char *)state->spacket.data+sbytes, buf ); /* add timeout option */ snprintf( buf, sizeof(buf), "%d", state->retry_time); sbytes += tftp_option_add(state, sbytes, (char *)state->spacket.data+sbytes, TFTP_OPTION_INTERVAL); sbytes += tftp_option_add(state, sbytes, (char *)state->spacket.data+sbytes, buf ); /* the typecase for the 3rd argument is mostly for systems that do not have a size_t argument, like older unixes that want an 'int' */ senddata = sendto(state->sockfd, (void *)state->spacket.data, (SEND_TYPE_ARG3)sbytes, 0, state->conn->ip_addr->ai_addr, state->conn->ip_addr->ai_addrlen); if(senddata != (ssize_t)sbytes) { failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO)); } Curl_safefree(filename); break; case TFTP_EVENT_OACK: if(data->set.upload) { res = tftp_connect_for_tx(state, event); } else { res = tftp_connect_for_rx(state, event); } break; case TFTP_EVENT_ACK: /* Connected for transmit */ res = tftp_connect_for_tx(state, event); break; case TFTP_EVENT_DATA: /* Connected for receive */ res = tftp_connect_for_rx(state, event); break; case TFTP_EVENT_ERROR: state->state = TFTP_STATE_FIN; break; default: failf(state->conn->data, "tftp_send_first: internal error"); break; } return res; } /* the next blocknum is x + 1 but it needs to wrap at an unsigned 16bit boundary */ #define NEXT_BLOCKNUM(x) (((x)+1)&0xffff) /********************************************************** * * tftp_rx * * Event handler for the RX state * **********************************************************/ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event) { ssize_t 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(NEXT_BLOCKNUM(state->block) == rblock) { /* This is the expected block. Reset counters and ACK it. */ state->retries = 0; } else if(state->block == rblock) { /* This is the last recently received block again. Log it and ACK it again. */ infof(data, "Received last DATA packet block %d again.\n", rblock); } else { /* totally unexpected, just log it */ infof(data, "Received unexpected DATA packet block %d, expecting block %d\n", rblock, NEXT_BLOCKNUM(state->block)); break; } /* ACK this block. */ state->block = (unsigned short)rblock; 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", Curl_strerror(state->conn, SOCKERRNO)); return CURLE_SEND_ERROR; } /* Check if completed (That is, a less than full packet is received) */ if(state->rbytes < (ssize_t)state->blksize+4) { state->state = TFTP_STATE_FIN; } else { state->state = TFTP_STATE_RX; } time(&state->rx_time); break; case TFTP_EVENT_OACK: /* ACK option acknowledgement so we can move on to data */ state->block = 0; 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", Curl_strerror(state->conn, SOCKERRNO)); return CURLE_SEND_ERROR; } /* we're ready to RX data */ state->state = TFTP_STATE_RX; time(&state->rx_time); 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", NEXT_BLOCKNUM(state->block), 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.data, 4, SEND_4TH_ARG, (struct sockaddr *)&state->remote_addr, state->remote_addrlen); if(sbytes<0) { failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO)); return CURLE_SEND_ERROR; } } break; case TFTP_EVENT_ERROR: setpacketevent(&state->spacket, TFTP_EVENT_ERROR); setpacketblock(&state->spacket, state->block); (void)sendto(state->sockfd, (void *)state->spacket.data, 4, SEND_4TH_ARG, (struct sockaddr *)&state->remote_addr, state->remote_addrlen); /* don't bother with the return code, but if the socket is still up we * should be a good TFTP client and let the server know we're done */ state->state = TFTP_STATE_FIN; break; default: failf(data, "%s", "tftp_rx: internal error"); return CURLE_TFTP_ILLEGAL; /* not really the perfect return code for this */ } 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; ssize_t sbytes; int rblock; CURLcode res = CURLE_OK; struct SingleRequest *k = &data->req; switch(event) { case TFTP_EVENT_ACK: case TFTP_EVENT_OACK: if(event == TFTP_EVENT_ACK) { /* Ack the packet */ rblock = getrpacketblock(&state->rpacket); if(rblock != state->block && /* There's a bug in tftpd-hpa that causes it to send us an ack for * 65535 when the block number wraps to 0. So when we're expecting * 0, also accept 65535. See * http://syslinux.zytor.com/archives/2010-September/015253.html * */ !(state->block == 0 && rblock == 65535)) { /* 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.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", Curl_strerror(state->conn, SOCKERRNO)); res = CURLE_SEND_ERROR; } } return res; } /* This is the expected packet. Reset the counters and send the next block */ time(&state->rx_time); state->block++; } else state->block = 1; /* first data block is 1 when using OACK */ state->retries = 0; setpacketevent(&state->spacket, TFTP_EVENT_DATA); setpacketblock(&state->spacket, state->block); if(state->block > 1 && state->sbytes < (int)state->blksize) { state->state = TFTP_STATE_FIN; return CURLE_OK; } res = Curl_fillreadbuffer(state->conn, state->blksize, &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", Curl_strerror(state->conn, SOCKERRNO)); return CURLE_SEND_ERROR; } /* Update the progress meter */ k->writebytecount += state->sbytes; Curl_pgrsSetUploadCounter(data, k->writebytecount); 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", NEXT_BLOCKNUM(state->block), 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.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", Curl_strerror(state->conn, SOCKERRNO)); return CURLE_SEND_ERROR; } /* since this was a re-send, we remain at the still byte position */ Curl_pgrsSetUploadCounter(data, k->writebytecount); } break; case TFTP_EVENT_ERROR: state->state = TFTP_STATE_FIN; setpacketevent(&state->spacket, TFTP_EVENT_ERROR); setpacketblock(&state->spacket, state->block); (void)sendto(state->sockfd, (void *)state->spacket.data, 4, SEND_4TH_ARG, (struct sockaddr *)&state->remote_addr, state->remote_addrlen); /* don't bother with the return code, but if the socket is still up we * should be a good TFTP client and let the server know we're done */ state->state = TFTP_STATE_FIN; break; default: failf(data, "tftp_tx: internal error, event: %i", (int)(event)); break; } return res; } /********************************************************** * * tftp_translate_code * * Translate internal error codes to CURL error codes * **********************************************************/ static CURLcode tftp_translate_code(tftp_error_t error) { CURLcode code = CURLE_OK; if(error != TFTP_ERR_NONE) { switch(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_REMOTE_DISK_FULL; break; case TFTP_ERR_UNDEF: case TFTP_ERR_ILLEGAL: code = CURLE_TFTP_ILLEGAL; break; case TFTP_ERR_UNKNOWNID: code = CURLE_TFTP_UNKNOWNID; break; case TFTP_ERR_EXISTS: code = CURLE_REMOTE_FILE_EXISTS; break; case TFTP_ERR_NOSUCHUSER: code = CURLE_TFTP_NOSUCHUSER; break; case TFTP_ERR_TIMEOUT: code = CURLE_OPERATION_TIMEDOUT; break; case TFTP_ERR_NORESPONSE: code = CURLE_COULDNT_CONNECT; break; default: code= CURLE_ABORTED_BY_CALLBACK; break; } } else { code = CURLE_OK; } return(code); } /********************************************************** * * 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", "Internal state machine error"); res = CURLE_TFTP_ILLEGAL; break; } return res; } /********************************************************** * * tftp_disconnect * * The disconnect callback * **********************************************************/ static CURLcode tftp_disconnect(struct connectdata *conn, bool dead_connection) { tftp_state_data_t *state = conn->proto.tftpc; (void) dead_connection; /* done, free dynamically allocated pkt buffers */ if(state) { Curl_safefree(state->rpacket.data); Curl_safefree(state->spacket.data); free(state); } return CURLE_OK; } /********************************************************** * * tftp_connect * * The connect callback * **********************************************************/ static CURLcode tftp_connect(struct connectdata *conn, bool *done) { CURLcode code; tftp_state_data_t *state; int blksize, rc; blksize = TFTP_BLKSIZE_DEFAULT; state = conn->proto.tftpc = calloc(1, sizeof(tftp_state_data_t)); if(!state) return CURLE_OUT_OF_MEMORY; /* alloc pkt buffers based on specified blksize */ if(conn->data->set.tftp_blksize) { blksize = (int)conn->data->set.tftp_blksize; if(blksize > TFTP_BLKSIZE_MAX || blksize < TFTP_BLKSIZE_MIN ) return CURLE_TFTP_ILLEGAL; } if(!state->rpacket.data) { state->rpacket.data = calloc(1, blksize + 2 + 2); if(!state->rpacket.data) return CURLE_OUT_OF_MEMORY; } if(!state->spacket.data) { state->spacket.data = calloc(1, blksize + 2 + 2); if(!state->spacket.data) return CURLE_OUT_OF_MEMORY; } conn->bits.close = TRUE; /* we don't keep TFTP connections up bascially because there's none or very little gain for UDP */ state->conn = conn; state->sockfd = state->conn->sock[FIRSTSOCKET]; state->state = TFTP_STATE_START; state->error = TFTP_ERR_NONE; state->blksize = TFTP_BLKSIZE_DEFAULT; state->requested_blksize = blksize; ((struct sockaddr *)&state->local_addr)->sa_family = (unsigned short)(conn->ip_addr->ai_family); tftp_set_timeouts(state); if(!conn->bits.bound) { /* If not already bound, bind to any interface, random UDP port. If it is * reused or a custom local port was desired, this has already been done! * * 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", Curl_strerror(conn, SOCKERRNO)); return CURLE_COULDNT_CONNECT; } conn->bits.bound = TRUE; } Curl_pgrsStartNow(conn->data); *done = TRUE; code = CURLE_OK; return(code); } /********************************************************** * * tftp_done * * The done callback * **********************************************************/ static CURLcode tftp_done(struct connectdata *conn, CURLcode status, bool premature) { CURLcode code = CURLE_OK; tftp_state_data_t *state = (tftp_state_data_t *)conn->proto.tftpc; (void)status; /* unused */ (void)premature; /* not used */ if(Curl_pgrsDone(conn)) return CURLE_ABORTED_BY_CALLBACK; /* If we have encountered an error */ if(state) code = tftp_translate_code(state->error); return code; } /********************************************************** * * tftp_getsock * * The getsock callback * **********************************************************/ static int tftp_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { if(!numsocks) return GETSOCK_BLANK; socks[0] = conn->sock[FIRSTSOCKET]; return GETSOCK_READSOCK(0); } /********************************************************** * * tftp_receive_packet * * Called once select fires and data is ready on the socket * **********************************************************/ static CURLcode tftp_receive_packet(struct connectdata *conn) { struct Curl_sockaddr_storage fromaddr; curl_socklen_t fromlen; CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; tftp_state_data_t *state = (tftp_state_data_t *)conn->proto.tftpc; struct SingleRequest *k = &data->req; /* Receive the packet */ fromlen = sizeof(fromaddr); state->rbytes = (int)recvfrom(state->sockfd, (void *)state->rpacket.data, state->blksize+4, 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(data, "Received too short packet"); /* Not a timeout, but how best to handle it? */ state->event = TFTP_EVENT_TIMEOUT; } else { /* The event is given by the TFTP packet time */ state->event = (tftp_event_t)getrpacketevent(&state->rpacket); switch(state->event) { case TFTP_EVENT_DATA: /* Don't pass to the client empty or retransmitted packets */ if(state->rbytes > 4 && (NEXT_BLOCKNUM(state->block) == getrpacketblock(&state->rpacket))) { result = Curl_client_write(conn, CLIENTWRITE_BODY, (char *)state->rpacket.data+4, state->rbytes-4); if(result) { tftp_state_machine(state, TFTP_EVENT_ERROR); return result; } k->bytecount += state->rbytes-4; Curl_pgrsSetDownloadCounter(data, (curl_off_t) k->bytecount); } break; case TFTP_EVENT_ERROR: state->error = (tftp_error_t)getrpacketblock(&state->rpacket); infof(data, "%s\n", (const char *)state->rpacket.data+4); break; case TFTP_EVENT_ACK: break; case TFTP_EVENT_OACK: result = tftp_parse_option_ack(state, (const char *)state->rpacket.data+2, state->rbytes-2); if(result) return result; break; case TFTP_EVENT_RRQ: case TFTP_EVENT_WRQ: default: failf(data, "%s", "Internal error: Unexpected packet"); break; } /* Update the progress meter */ if(Curl_pgrsUpdate(conn)) { tftp_state_machine(state, TFTP_EVENT_ERROR); return CURLE_ABORTED_BY_CALLBACK; } } return result; } /********************************************************** * * tftp_state_timeout * * Check if timeouts have been reached * **********************************************************/ static long tftp_state_timeout(struct connectdata *conn, tftp_event_t *event) { time_t current; tftp_state_data_t *state = (tftp_state_data_t *)conn->proto.tftpc; if(event) *event = TFTP_EVENT_NONE; time(¤t); if(current > state->max_time) { DEBUGF(infof(conn->data, "timeout: %ld > %ld\n", (long)current, (long)state->max_time)); state->error = TFTP_ERR_TIMEOUT; state->state = TFTP_STATE_FIN; return 0; } else if(current > state->rx_time+state->retry_time) { if(event) *event = TFTP_EVENT_TIMEOUT; time(&state->rx_time); /* update even though we received nothing */ } /* there's a typecast below here since 'time_t' may in fact be larger than 'long', but we estimate that a 'long' will still be able to hold number of seconds even if "only" 32 bit */ return (long)(state->max_time - current); } /********************************************************** * * tftp_multi_statemach * * Handle single RX socket event and return * **********************************************************/ static CURLcode tftp_multi_statemach(struct connectdata *conn, bool *done) { int rc; tftp_event_t event; CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; tftp_state_data_t *state = (tftp_state_data_t *)conn->proto.tftpc; long timeout_ms = tftp_state_timeout(conn, &event); *done = FALSE; if(timeout_ms <= 0) { failf(data, "TFTP response timeout"); return CURLE_OPERATION_TIMEDOUT; } else if(event != TFTP_EVENT_NONE) { result = tftp_state_machine(state, event); if(result != CURLE_OK) return(result); *done = (state->state == TFTP_STATE_FIN) ? TRUE : FALSE; if(*done) /* Tell curl we're done */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); } else { /* no timeouts to handle, check our socket */ rc = Curl_socket_ready(state->sockfd, CURL_SOCKET_BAD, 0); if(rc == -1) { /* bail out */ int error = SOCKERRNO; failf(data, "%s", Curl_strerror(conn, error)); state->event = TFTP_EVENT_ERROR; } else if(rc != 0) { result = tftp_receive_packet(conn); if(result != CURLE_OK) return(result); result = tftp_state_machine(state, state->event); if(result != CURLE_OK) return(result); *done = (state->state == TFTP_STATE_FIN) ? TRUE : FALSE; if(*done) /* Tell curl we're done */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); } /* if rc == 0, then select() timed out */ } return result; } /********************************************************** * * tftp_doing * * Called from multi.c while DOing * **********************************************************/ static CURLcode tftp_doing(struct connectdata *conn, bool *dophase_done) { CURLcode result; result = tftp_multi_statemach(conn, dophase_done); if(*dophase_done) { DEBUGF(infof(conn->data, "DO phase is complete\n")); } else if(!result) { /* The multi code doesn't have this logic for the DOING state so we provide it for TFTP since it may do the entire transfer in this state. */ if(Curl_pgrsUpdate(conn)) result = CURLE_ABORTED_BY_CALLBACK; else result = Curl_speedcheck(conn->data, Curl_tvnow()); } return result; } /********************************************************** * * tftp_peform * * Entry point for transfer from tftp_do, sarts state mach * **********************************************************/ static CURLcode tftp_perform(struct connectdata *conn, bool *dophase_done) { CURLcode result = CURLE_OK; tftp_state_data_t *state = (tftp_state_data_t *)conn->proto.tftpc; *dophase_done = FALSE; result = tftp_state_machine(state, TFTP_EVENT_INIT); if(state->state == TFTP_STATE_FIN || result != CURLE_OK) return(result); tftp_multi_statemach(conn, dophase_done); if(*dophase_done) DEBUGF(infof(conn->data, "DO phase is complete\n")); return result; } /********************************************************** * * tftp_do * * The do callback * * This callback initiates the TFTP transfer * **********************************************************/ static CURLcode tftp_do(struct connectdata *conn, bool *done) { tftp_state_data_t *state; CURLcode code; *done = FALSE; if(!conn->proto.tftpc) { code = tftp_connect(conn, done); if(code) return code; } state = (tftp_state_data_t *)conn->proto.tftpc; code = tftp_perform(conn, done); /* If tftp_perform() returned an error, use that for return code. If it was OK, see if tftp_translate_code() has an error. */ if(code == CURLE_OK) /* If we have encountered an internal tftp error, translate it. */ code = tftp_translate_code(state->error); return code; } static CURLcode tftp_setup_connection(struct connectdata * conn) { struct SessionHandle *data = conn->data; char * type; char command; conn->socktype = SOCK_DGRAM; /* UDP datagram based */ /* TFTP URLs support an extension like ";mode=" that * we'll try to get now! */ type = strstr(data->state.path, ";mode="); if(!type) type = strstr(conn->host.rawalloc, ";mode="); if(type) { *type = 0; /* it was in the middle of the hostname */ command = Curl_raw_toupper(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; } } return CURLE_OK; } #endif curl-7.35.0/lib/Makefile.b320000644000175000017500000001061112262353672012276 00000000000000############################################################ # # 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 # # Initially written by Jaepil Kim, pit@paradise.net.nz ############################################################ !if "$(__MAKE__)" == "" !error __MAKE__ not defined. Use Borlands's MAKE to process this makefile. !endif # Borland's $(MAKEDIR) expands to the path where make.exe is located, # use this feature to define BCCDIR when user has not defined BCCDIR. !ifndef BCCDIR BCCDIR = $(MAKEDIR)\.. !endif # Edit the path below to point to the base of your Zlib sources. !ifndef ZLIB_PATH ZLIB_PATH = ..\..\zlib-1.2.8 !endif # Edit the path below to point to the base of your OpenSSL package. !ifndef OPENSSL_PATH OPENSSL_PATH = ..\..\openssl-0.9.8y !endif # Set libcurl static lib, dll and import lib LIBCURL_LIB = libcurl.lib LIBCURL_DLL = libcurl.dll LIBCURL_IMPLIB = libcurl_imp.lib # Setup environment PP_CMD = cpp32 -q -P- CC_CMD = bcc32 -q -c LD = bcc32 RM = del 2>NUL MKDIR = md RMDIR = rd /q LIB = tlib IMPLIB = implib CC_FLAGS = -5 -O2 -tWM -w -w-aus -w-ccc -w-dup -w-prc -w-pro -w-rch -w-sig -w-spa -w-inl -w-pia -w-pin -Dinline=__inline LIBFLAGS = /C /P32 LDFLAGS = -q -lq -laa -tWD SRCDIR = . OBJDIR = .\BCC_objs INCDIRS = -I.;..\include LINKLIB = $(BCCDIR)\lib\cw32mt.lib $(BCCDIR)\lib\ws2_32.lib DEFINES = -DNDEBUG -DWIN32 -DBUILDING_LIBCURL # By default SSPI support is enabled for BCC !ifndef DISABLE_SSPI DEFINES = $(DEFINES) -DUSE_WINDOWS_SSPI !endif # By default LDAP support is disabled for BCC !ifndef WITH_LDAP DEFINES = $(DEFINES) -DCURL_DISABLE_LDAP !endif # ZLIB support is enabled setting WITH_ZLIB=1 !ifdef WITH_ZLIB DEFINES = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H INCDIRS = $(INCDIRS);$(ZLIB_PATH) LINKLIB = $(LINKLIB) $(ZLIB_PATH)\zlib.lib !endif # SSL support is enabled setting WITH_SSL=1 !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 .path.c = $(SRCDIR) .path.obj = $(OBJDIR) .path.int = $(OBJDIR) # Makefile.inc provides the CSOURCES and HHEADERS defines !include Makefile.inc # Borland's command line librarian program TLIB version 4.5 is not capable # of building a library when any of its objects contains an hypen in its # name, due to a command line parsing bug. In order to workaround this, we # build source files with hyphens in their name as objects with underscores # using explicit compilation build rules instead of implicit ones. NOHYPHEN = $(CSOURCES:-=_) OBJECTS = $(NOHYPHEN:.c=.obj) PREPROCESSED = $(NOHYPHEN:.c=.int) # Borland's command line compiler (BCC32) version 5.5.1 integrated # preprocessor has a bug which results in silently generating wrong # definitions for libcurl macros such as CURL_OFF_T_C, on the other # hand Borland's command line preprocessor (CPP32) version 5.5.1 does # not have the bug and achieves proper results. In order to avoid the # silent bug we first preprocess source files and later compile the # preprocessed result. .c.obj: @-$(RM) $(@R).int $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<) $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int all: $(OBJDIR) $(LIBCURL_LIB) $(LIBCURL_DLL) asyn_ares.obj: asyn-ares.c @-$(RM) $(@R).int $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?) $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int asyn_thread.obj: asyn-thread.c @-$(RM) $(@R).int $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?) $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int non_ascii.obj: non-ascii.c @-$(RM) $(@R).int $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?) $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int clean: cd $(OBJDIR) @-$(RM) $(OBJECTS) @-$(RM) $(PREPROCESSED) cd .. @-$(RMDIR) $(OBJDIR) @-$(RM) $(LIBCURL_LIB) @-$(RM) $(LIBCURL_IMPLIB) @-$(RM) libcurl.tds $(OBJDIR): @-$(RMDIR) $(OBJDIR) @-$(MKDIR) $(OBJDIR) $(LIBCURL_LIB): $(OBJECTS) @-$(RM) $(LIBCURL_LIB) $(LIB) $(LIBFLAGS) $@ @&&! +$(**: = &^ +) ! $(LIBCURL_DLL) $(LIBCURL_IMPLIB): $(OBJECTS) $(LINKLIB) @-$(RM) $(LIBCURL_DLL) @-$(RM) $(LIBCURL_IMPLIB) $(LD) $(LDFLAGS) -e$(LIBCURL_DLL) @&&! $(**: = ^ ) ! $(IMPLIB) $(LIBCURL_IMPLIB) $(LIBCURL_DLL) # End of Makefile.b32 curl-7.35.0/lib/asyn-ares.c0000644000175000017500000004664112262353672012333 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef __VMS #include #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 /*********************************************************************** * Only for ares-enabled builds * And only for functions that fulfill the asynch resolver backend API * as defined in asyn.h, nothing else belongs in this file! **********************************************************************/ #ifdef CURLRES_ARES #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 "inet_pton.h" #include "connect.h" #include "select.h" #include "progress.h" #define _MPRINTF_REPLACE /* use our functions only */ #include # if defined(CURL_STATICLIB) && !defined(CARES_STATICLIB) && \ (defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)) # define CARES_STATICLIB # endif # include # include /* really old c-ares didn't include this by itself */ #if ARES_VERSION >= 0x010500 /* c-ares 1.5.0 or later, the callback proto is modified */ #define HAVE_CARES_CALLBACK_TIMEOUTS 1 #endif #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" struct ResolverResults { int num_pending; /* number of ares_gethostbyname() requests */ Curl_addrinfo *temp_ai; /* intermediary result while fetching c-ares parts */ int last_status; }; /* * Curl_resolver_global_init() - the generic low-level asynchronous name * resolve API. Called from curl_global_init() to initialize global resolver * environment. Initializes ares library. */ int Curl_resolver_global_init(void) { #ifdef CARES_HAVE_ARES_LIBRARY_INIT if(ares_library_init(ARES_LIB_INIT_ALL)) { return CURLE_FAILED_INIT; } #endif return CURLE_OK; } /* * Curl_resolver_global_cleanup() * * Called from curl_global_cleanup() to destroy global resolver environment. * Deinitializes ares library. */ void Curl_resolver_global_cleanup(void) { #ifdef CARES_HAVE_ARES_LIBRARY_CLEANUP ares_library_cleanup(); #endif } /* * Curl_resolver_init() * * Called from curl_easy_init() -> Curl_open() to initialize resolver * URL-state specific environment ('resolver' member of the UrlState * structure). Fills the passed pointer by the initialized ares_channel. */ CURLcode Curl_resolver_init(void **resolver) { int status = ares_init((ares_channel*)resolver); if(status != ARES_SUCCESS) { if(status == ARES_ENOMEM) return CURLE_OUT_OF_MEMORY; else return CURLE_FAILED_INIT; } return CURLE_OK; /* make sure that all other returns from this function should destroy the ares channel before returning error! */ } /* * Curl_resolver_cleanup() * * Called from curl_easy_cleanup() -> Curl_close() to cleanup resolver * URL-state specific environment ('resolver' member of the UrlState * structure). Destroys the ares channel. */ void Curl_resolver_cleanup(void *resolver) { ares_destroy((ares_channel)resolver); } /* * Curl_resolver_duphandle() * * Called from curl_easy_duphandle() to duplicate resolver URL-state specific * environment ('resolver' member of the UrlState structure). Duplicates the * 'from' ares channel and passes the resulting channel to the 'to' pointer. */ int Curl_resolver_duphandle(void **to, void *from) { /* Clone the ares channel for the new handle */ if(ARES_SUCCESS != ares_dup((ares_channel*)to,(ares_channel)from)) return CURLE_FAILED_INIT; return CURLE_OK; } static void destroy_async_data (struct Curl_async *async); /* * Cancel all possibly still on-going resolves for this connection. */ void Curl_resolver_cancel(struct connectdata *conn) { if(conn && conn->data && conn->data->state.resolver) ares_cancel((ares_channel)conn->data->state.resolver); destroy_async_data(&conn->async); } /* * destroy_async_data() cleans up async resolver data. */ static void destroy_async_data (struct Curl_async *async) { if(async->hostname) free(async->hostname); if(async->os_specific) { struct ResolverResults *res = (struct ResolverResults *)async->os_specific; if(res) { if(res->temp_ai) { Curl_freeaddrinfo(res->temp_ai); res->temp_ai = NULL; } free(res); } async->os_specific = NULL; } async->hostname = NULL; } /* * Curl_resolver_getsock() 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: sockets-in-use-bitmap */ int Curl_resolver_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { struct timeval maxtime; struct timeval timebuf; struct timeval *timeout; long milli; int max = ares_getsock((ares_channel)conn->data->state.resolver, (ares_socket_t *)socks, numsocks); maxtime.tv_sec = CURL_TIMEOUT_RESOLVE; maxtime.tv_usec = 0; timeout = ares_timeout((ares_channel)conn->data->state.resolver, &maxtime, &timebuf); milli = (timeout->tv_sec * 1000) + (timeout->tv_usec/1000); if(milli == 0) milli += 10; Curl_expire(conn->data, milli); return max; } /* * waitperform() * * 1) Ask ares what sockets it currently plays with, then * 2) wait for the timeout period to check for action on ares' sockets. * 3) tell ares to act on all the sockets marked as "with action" * * return number of sockets it worked on */ static int waitperform(struct connectdata *conn, int timeout_ms) { struct SessionHandle *data = conn->data; int nfds; int bitmask; ares_socket_t socks[ARES_GETSOCK_MAXNUM]; struct pollfd pfd[ARES_GETSOCK_MAXNUM]; int i; int num = 0; bitmask = ares_getsock((ares_channel)data->state.resolver, socks, ARES_GETSOCK_MAXNUM); for(i=0; i < ARES_GETSOCK_MAXNUM; i++) { pfd[i].events = 0; pfd[i].revents = 0; if(ARES_GETSOCK_READABLE(bitmask, i)) { pfd[i].fd = socks[i]; pfd[i].events |= POLLRDNORM|POLLIN; } if(ARES_GETSOCK_WRITABLE(bitmask, i)) { pfd[i].fd = socks[i]; pfd[i].events |= POLLWRNORM|POLLOUT; } if(pfd[i].events != 0) num++; else break; } if(num) nfds = Curl_poll(pfd, num, timeout_ms); else nfds = 0; if(!nfds) /* Call ares_process() unconditonally here, even if we simply timed out above, as otherwise the ares name resolve won't timeout! */ ares_process_fd((ares_channel)data->state.resolver, ARES_SOCKET_BAD, ARES_SOCKET_BAD); else { /* move through the descriptors and ask for processing on them */ for(i=0; i < num; i++) ares_process_fd((ares_channel)data->state.resolver, pfd[i].revents & (POLLRDNORM|POLLIN)? pfd[i].fd:ARES_SOCKET_BAD, pfd[i].revents & (POLLWRNORM|POLLOUT)? pfd[i].fd:ARES_SOCKET_BAD); } return nfds; } /* * Curl_resolver_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_resolver_is_resolved(struct connectdata *conn, struct Curl_dns_entry **dns) { struct SessionHandle *data = conn->data; struct ResolverResults *res = (struct ResolverResults *) conn->async.os_specific; CURLcode rc = CURLE_OK; *dns = NULL; waitperform(conn, 0); if(res && !res->num_pending) { (void)Curl_addrinfo_callback(conn, res->last_status, res->temp_ai); /* temp_ai ownership is moved to the connection, so we need not free-up them */ res->temp_ai = NULL; if(!conn->async.dns) { failf(data, "Could not resolve: %s (%s)", conn->async.hostname, ares_strerror(conn->async.status)); rc = conn->bits.proxy?CURLE_COULDNT_RESOLVE_PROXY: CURLE_COULDNT_RESOLVE_HOST; } else *dns = conn->async.dns; destroy_async_data(&conn->async); } return rc; } /* * Curl_resolver_wait_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_resolver_wait_resolv(struct connectdata *conn, struct Curl_dns_entry **entry) { CURLcode rc=CURLE_OK; struct SessionHandle *data = conn->data; long timeout; struct timeval now = Curl_tvnow(); struct Curl_dns_entry *temp_entry; timeout = Curl_timeleft(data, &now, TRUE); if(!timeout) timeout = CURL_TIMEOUT_RESOLVE * 1000; /* default name resolve timeout */ /* Wait for the name resolve query to complete. */ for(;;) { struct timeval *tvp, tv, store; long timediff; int itimeout; int timeout_ms; itimeout = (timeout > (long)INT_MAX) ? INT_MAX : (int)timeout; store.tv_sec = itimeout/1000; store.tv_usec = (itimeout%1000)*1000; tvp = ares_timeout((ares_channel)data->state.resolver, &store, &tv); /* use the timeout period ares returned to us above if less than one second is left, otherwise just use 1000ms to make sure the progress callback gets called frequent enough */ if(!tvp->tv_sec) timeout_ms = (int)(tvp->tv_usec/1000); else timeout_ms = 1000; waitperform(conn, timeout_ms); Curl_resolver_is_resolved(conn,&temp_entry); if(conn->async.done) break; if(Curl_pgrsUpdate(conn)) { rc = CURLE_ABORTED_BY_CALLBACK; timeout = -1; /* trigger the cancel below */ } else { struct timeval now2 = Curl_tvnow(); timediff = Curl_tvdiff(now2, now); /* spent time */ timeout -= timediff?timediff:1; /* always deduct at least 1 */ now = now2; /* for next loop */ } if(timeout < 0) { /* our timeout, so we cancel the ares operation */ ares_cancel((ares_channel)data->state.resolver); break; } } /* Operation complete, if the lookup was successful we now have the entry in the cache. */ if(entry) *entry = conn->async.dns; if(rc) /* close the connection, since we can't return failure here without cleaning up this connection properly. TODO: remove this action from here, it is not a name resolver decision. */ conn->bits.close = TRUE; return rc; } /* Connects results to the list */ static void compound_results(struct ResolverResults *res, Curl_addrinfo *ai) { Curl_addrinfo *ai_tail; if(!ai) return; ai_tail = ai; while(ai_tail->ai_next) ai_tail = ai_tail->ai_next; /* Add the new results to the list of old results. */ ai_tail->ai_next = res->temp_ai; res->temp_ai = ai; } /* * ares_query_completed_cb() is the callback that ares will call when * the host query initiated by ares_gethostbyname() from Curl_getaddrinfo(), * when using ares, is completed either successfully or with failure. */ static void query_completed_cb(void *arg, /* (struct connectdata *) */ int status, #ifdef HAVE_CARES_CALLBACK_TIMEOUTS int timeouts, #endif struct hostent *hostent) { struct connectdata *conn = (struct connectdata *)arg; struct ResolverResults *res; #ifdef HAVE_CARES_CALLBACK_TIMEOUTS (void)timeouts; /* ignored */ #endif if(ARES_EDESTRUCTION == status) /* when this ares handle is getting destroyed, the 'arg' pointer may not be valid so only defer it when we know the 'status' says its fine! */ return; res = (struct ResolverResults *)conn->async.os_specific; res->num_pending--; if(CURL_ASYNC_SUCCESS == status) { Curl_addrinfo *ai = Curl_he2ai(hostent, conn->async.port); if(ai) { compound_results(res, ai); } } /* A successful result overwrites any previous error */ if(res->last_status != ARES_SUCCESS) res->last_status = status; } /* * Curl_resolver_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_resolver_getaddrinfo(struct connectdata *conn, const char *hostname, int port, int *waitp) { char *bufp; struct SessionHandle *data = conn->data; struct in_addr in; int family = PF_INET; #ifdef ENABLE_IPV6 /* CURLRES_IPV6 */ struct in6_addr in6; #endif /* CURLRES_IPV6 */ *waitp = 0; /* default to synchronous response */ /* First check if this is an IPv4 address string */ if(Curl_inet_pton(AF_INET, hostname, &in) > 0) { /* This is a dotted IP address 123.123.123.123-style */ return Curl_ip2addr(AF_INET, &in, hostname, port); } #ifdef ENABLE_IPV6 /* CURLRES_IPV6 */ /* Otherwise, check if this is an IPv6 address string */ if(Curl_inet_pton (AF_INET6, hostname, &in6) > 0) /* This must be an IPv6 address literal. */ return Curl_ip2addr(AF_INET6, &in6, hostname, port); switch(conn->ip_version) { default: #if ARES_VERSION >= 0x010601 family = PF_UNSPEC; /* supported by c-ares since 1.6.1, so for older c-ares versions this just falls through and defaults to PF_INET */ break; #endif case CURL_IPRESOLVE_V4: family = PF_INET; break; case CURL_IPRESOLVE_V6: family = PF_INET6; break; } #endif /* CURLRES_IPV6 */ bufp = strdup(hostname); if(bufp) { struct ResolverResults *res = NULL; 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 */ res = calloc(sizeof(struct ResolverResults),1); if(!res) { Curl_safefree(conn->async.hostname); conn->async.hostname = NULL; return NULL; } conn->async.os_specific = res; /* initial status - failed */ res->last_status = ARES_ENOTFOUND; #ifdef ENABLE_IPV6 /* CURLRES_IPV6 */ if(family == PF_UNSPEC) { if(Curl_ipv6works()) { res->num_pending = 2; /* areschannel is already setup in the Curl_open() function */ ares_gethostbyname((ares_channel)data->state.resolver, hostname, PF_INET, query_completed_cb, conn); ares_gethostbyname((ares_channel)data->state.resolver, hostname, PF_INET6, query_completed_cb, conn); } else { res->num_pending = 1; /* areschannel is already setup in the Curl_open() function */ ares_gethostbyname((ares_channel)data->state.resolver, hostname, PF_INET, query_completed_cb, conn); } } else #endif /* CURLRES_IPV6 */ { res->num_pending = 1; /* areschannel is already setup in the Curl_open() function */ ares_gethostbyname((ares_channel)data->state.resolver, hostname, family, query_completed_cb, conn); } *waitp = 1; /* expect asynchronous response */ } return NULL; /* no struct yet */ } CURLcode Curl_set_dns_servers(struct SessionHandle *data, char *servers) { CURLcode result = CURLE_NOT_BUILT_IN; int ares_result; /* If server is NULL or empty, this would purge all DNS servers * from ares library, which will cause any and all queries to fail. * So, just return OK if none are configured and don't actually make * any changes to c-ares. This lets c-ares use it's defaults, which * it gets from the OS (for instance from /etc/resolv.conf on Linux). */ if(!(servers && servers[0])) return CURLE_OK; #if (ARES_VERSION >= 0x010704) ares_result = ares_set_servers_csv(data->state.resolver, servers); switch(ares_result) { case ARES_SUCCESS: result = CURLE_OK; break; case ARES_ENOMEM: result = CURLE_OUT_OF_MEMORY; break; case ARES_ENOTINITIALIZED: case ARES_ENODATA: case ARES_EBADSTR: default: result = CURLE_BAD_FUNCTION_ARGUMENT; break; } #else /* too old c-ares version! */ (void)data; (void)(ares_result); #endif return result; } CURLcode Curl_set_dns_interface(struct SessionHandle *data, const char *interf) { #if (ARES_VERSION >= 0x010704) if(!interf) interf = ""; ares_set_local_dev((ares_channel)data->state.resolver, interf); return CURLE_OK; #else /* c-ares version too old! */ (void)data; (void)interf; return CURLE_NOT_BUILT_IN; #endif } CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data, const char *local_ip4) { #if (ARES_VERSION >= 0x010704) struct in_addr a4; if((!local_ip4) || (local_ip4[0] == 0)) { a4.s_addr = 0; /* disabled: do not bind to a specific address */ } else { if(Curl_inet_pton(AF_INET, local_ip4, &a4) != 1) { return CURLE_BAD_FUNCTION_ARGUMENT; } } ares_set_local_ip4((ares_channel)data->state.resolver, ntohl(a4.s_addr)); return CURLE_OK; #else /* c-ares version too old! */ (void)data; (void)local_ip4; return CURLE_NOT_BUILT_IN; #endif } CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data, const char *local_ip6) { #if (ARES_VERSION >= 0x010704) unsigned char a6[INET6_ADDRSTRLEN]; if((!local_ip6) || (local_ip6[0] == 0)) { /* disabled: do not bind to a specific address */ memset(a6, 0, sizeof(a6)); } else { if(Curl_inet_pton(AF_INET6, local_ip6, a6) != 1) { return CURLE_BAD_FUNCTION_ARGUMENT; } } ares_set_local_ip6((ares_channel)data->state.resolver, a6); return CURLE_OK; #else /* c-ares version too old! */ (void)data; (void)local_ip6; return CURLE_NOT_BUILT_IN; #endif } #endif /* CURLRES_ARES */ curl-7.35.0/lib/curl_gssapi.h0000644000175000017500000000336212213173003012722 00000000000000#ifndef HEADER_CURL_GSSAPI_H #define HEADER_CURL_GSSAPI_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #include "urldata.h" #ifdef HAVE_GSSAPI #ifdef HAVE_GSSGNU # include #elif defined HAVE_GSSMIT /* MIT style */ # include # include # include #else /* Heimdal-style */ # include #endif /* Common method for using gss api */ OM_uint32 Curl_gss_init_sec_context( struct SessionHandle *data, OM_uint32 * minor_status, gss_ctx_id_t * context, gss_name_t target_name, gss_channel_bindings_t input_chan_bindings, gss_buffer_t input_token, gss_buffer_t output_token, OM_uint32 * ret_flags); #endif /* HAVE_GSSAPI */ #endif /* HEADER_CURL_GSSAPI_H */ curl-7.35.0/lib/share.c0000644000175000017500000001423212262353672011522 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #include #include "urldata.h" #include "share.h" #include "vtls/vtls.h" #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" CURLSH * curl_share_init(void) { struct Curl_share *share = calloc(1, sizeof(struct Curl_share)); if(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) res = CURLSHE_NOMEM; } break; case CURL_LOCK_DATA_COOKIE: #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) if(!share->cookies) { share->cookies = Curl_cookie_init(NULL, NULL, NULL, TRUE ); if(!share->cookies) res = CURLSHE_NOMEM; } #else /* CURL_DISABLE_HTTP */ res = CURLSHE_NOT_BUILT_IN; #endif break; case CURL_LOCK_DATA_SSL_SESSION: #ifdef USE_SSL if(!share->sslsession) { share->max_ssl_sessions = 8; share->sslsession = calloc(share->max_ssl_sessions, sizeof(struct curl_ssl_session)); share->sessionage = 0; if(!share->sslsession) res = CURLSHE_NOMEM; } #else res = CURLSHE_NOT_BUILT_IN; #endif break; case CURL_LOCK_DATA_CONNECT: /* not supported (yet) */ break; default: res = 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; case CURL_LOCK_DATA_COOKIE: #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) if(share->cookies) { Curl_cookie_cleanup(share->cookies); share->cookies = NULL; } #else /* CURL_DISABLE_HTTP */ res = CURLSHE_NOT_BUILT_IN; #endif break; case CURL_LOCK_DATA_SSL_SESSION: #ifdef USE_SSL Curl_safefree(share->sslsession); #else res = CURLSHE_NOT_BUILT_IN; #endif break; case CURL_LOCK_DATA_CONNECT: break; default: res = CURLSHE_BAD_OPTION; break; } 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: res = CURLSHE_BAD_OPTION; break; } va_end(param); return res; } 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); share->hostcache = NULL; } #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) if(share->cookies) Curl_cookie_cleanup(share->cookies); #endif #ifdef USE_SSL if(share->sslsession) { size_t i; for(i = 0; i < share->max_ssl_sessions; i++) Curl_ssl_kill_session(&(share->sslsession[i])); free(share->sslsession); } #endif 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; } curl-7.35.0/lib/hmac.c0000644000175000017500000001007712213173003011313 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * * RFC2104 Keyed-Hashing for Message Authentication * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_CRYPTO_AUTH #include "curl_hmac.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* * Generic HMAC algorithm. * * This module computes HMAC digests based on any hash function. Parameters * and computing procedures are set-up dynamically at HMAC computation * context initialisation. */ static const unsigned char hmac_ipad = 0x36; static const unsigned char hmac_opad = 0x5C; HMAC_context * Curl_HMAC_init(const HMAC_params * hashparams, const unsigned char * key, unsigned int keylen) { size_t i; HMAC_context * ctxt; unsigned char * hkey; unsigned char b; /* Create HMAC context. */ i = sizeof *ctxt + 2 * hashparams->hmac_ctxtsize + hashparams->hmac_resultlen; ctxt = malloc(i); if(!ctxt) return ctxt; ctxt->hmac_hash = hashparams; ctxt->hmac_hashctxt1 = (void *) (ctxt + 1); ctxt->hmac_hashctxt2 = (void *) ((char *) ctxt->hmac_hashctxt1 + hashparams->hmac_ctxtsize); /* If the key is too long, replace it by its hash digest. */ if(keylen > hashparams->hmac_maxkeylen) { (*hashparams->hmac_hinit)(ctxt->hmac_hashctxt1); (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, key, keylen); hkey = (unsigned char *) ctxt->hmac_hashctxt2 + hashparams->hmac_ctxtsize; (*hashparams->hmac_hfinal)(hkey, ctxt->hmac_hashctxt1); key = hkey; keylen = hashparams->hmac_resultlen; } /* Prime the two hash contexts with the modified key. */ (*hashparams->hmac_hinit)(ctxt->hmac_hashctxt1); (*hashparams->hmac_hinit)(ctxt->hmac_hashctxt2); for(i = 0; i < keylen; i++) { b = (unsigned char)(*key ^ hmac_ipad); (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &b, 1); b = (unsigned char)(*key++ ^ hmac_opad); (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &b, 1); } for(; i < hashparams->hmac_maxkeylen; i++) { (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &hmac_ipad, 1); (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &hmac_opad, 1); } /* Done, return pointer to HMAC context. */ return ctxt; } int Curl_HMAC_update(HMAC_context * ctxt, const unsigned char * data, unsigned int len) { /* Update first hash calculation. */ (*ctxt->hmac_hash->hmac_hupdate)(ctxt->hmac_hashctxt1, data, len); return 0; } int Curl_HMAC_final(HMAC_context * ctxt, unsigned char * result) { const HMAC_params * hashparams = ctxt->hmac_hash; /* Do not get result if called with a null parameter: only release storage. */ if(!result) result = (unsigned char *) ctxt->hmac_hashctxt2 + ctxt->hmac_hash->hmac_ctxtsize; (*hashparams->hmac_hfinal)(result, ctxt->hmac_hashctxt1); (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, result, hashparams->hmac_resultlen); (*hashparams->hmac_hfinal)(result, ctxt->hmac_hashctxt2); free((char *) ctxt); return 0; } #endif /* CURL_DISABLE_CRYPTO_AUTH */ curl-7.35.0/lib/config-vxworks.h0000644000175000017500000006363112213173003013402 00000000000000#ifndef HEADER_CURL_CONFIG_VXWORKS_H #define HEADER_CURL_CONFIG_VXWORKS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* =============================================================== */ /* Hand crafted config file for VxWorks */ /* =============================================================== */ /* Location of default ca bundle */ /* #undef CURL_CA_BUNDLE */ /* Location of default ca path */ /* #undef CURL_CA_PATH */ /* 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 */ #define CURL_DISABLE_FTP 1 /* to disable HTTP */ /* #undef CURL_DISABLE_HTTP */ /* to disable LDAP */ #define CURL_DISABLE_LDAP 1 /* to disable LDAPS */ #define CURL_DISABLE_LDAPS 1 /* to disable NTLM authentication */ #define CURL_DISABLE_NTLM 1 /* to disable proxies */ /* #undef CURL_DISABLE_PROXY */ /* to disable TELNET */ #define CURL_DISABLE_TELNET 1 /* to disable TFTP */ #define CURL_DISABLE_TFTP 1 /* to disable verbose strings */ /* #undef CURL_DISABLE_VERBOSE_STRINGS */ /* Definition to make a library symbol externally visible. */ /* #undef CURL_EXTERN_SYMBOL */ /* Use Windows LDAP implementation */ /* #undef CURL_LDAP_WIN */ /* your Entropy Gathering Daemon socket pathname */ /* #undef EGD_SOCKET */ /* Define if you want to enable IPv6 support */ #define ENABLE_IPV6 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 unsigned int /* Specifies the number of arguments to getservbyport_r */ #define GETSERVBYPORT_R_ARGS 6 /* Specifies the size of the buffer to pass to getservbyport_r */ #define GETSERVBYPORT_R_BUFSIZE 4096 /* Define to 1 if you have the alarm function. */ #define HAVE_ALARM 1 /* 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. */ /* #undef HAVE_BASENAME */ /* Define to 1 if bool is an available type. */ #define HAVE_BOOL_T 1 /* Define to 1 if you have the clock_gettime function and monotonic timer. */ /* #undef HAVE_CLOCK_GETTIME_MONOTONIC */ /* 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. */ #define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1 /* 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 */ /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */ #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 to 1 if you have the fcntl function. */ #define HAVE_FCNTL 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ #define HAVE_FCNTL_O_NONBLOCK 1 /* Define to 1 if you have the fdopen function. */ #define HAVE_FDOPEN 1 /* Define to 1 if you have the `fork' function. */ #define HAVE_FORK 1 /* Define to 1 if you have the freeaddrinfo function. */ #define HAVE_FREEADDRINFO 1 /* Define to 1 if you have the freeifaddrs function. */ #define HAVE_FREEIFADDRS 1 /* Define to 1 if you have the ftruncate function. */ #define HAVE_FTRUNCATE 1 /* Define to 1 if you have a working getaddrinfo function. */ #define HAVE_GETADDRINFO 1 /* Define to 1 if you have the `geteuid' function. */ /* #undef HAVE_GETEUID */ /* Define to 1 if you have the gethostbyaddr function. */ #define HAVE_GETHOSTBYADDR 1 /* Define to 1 if you have the gethostbyaddr_r function. */ #define HAVE_GETHOSTBYADDR_R 1 /* gethostbyaddr_r() takes 5 args */ /* #undef HAVE_GETHOSTBYADDR_R_5 */ /* gethostbyaddr_r() takes 7 args */ /* #undef HAVE_GETHOSTBYADDR_R_7 */ /* gethostbyaddr_r() takes 8 args */ #define HAVE_GETHOSTBYADDR_R_8 1 /* Define to 1 if you have the gethostbyname function. */ #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 */ /* Define to 1 if you have the gethostname function. */ #define HAVE_GETHOSTNAME 1 /* Define to 1 if you have a working getifaddrs function. */ /* #undef HAVE_GETIFADDRS */ /* Define to 1 if you have the getnameinfo function. */ #define HAVE_GETNAMEINFO 1 /* Define to 1 if you have the `getpass_r' function. */ /* #undef HAVE_GETPASS_R */ /* Define to 1 if you have the `getppid' function. */ #define HAVE_GETPPID 1 /* Define to 1 if you have the `getprotobyname' function. */ #define HAVE_GETPROTOBYNAME 1 /* Define to 1 if you have the `getpwuid' function. */ /* #undef HAVE_GETPWUID */ /* Define to 1 if you have the `getrlimit' function. */ #define HAVE_GETRLIMIT 1 /* Define to 1 if you have the getservbyport_r function. */ /* #undef HAVE_GETSERVBYPORT_R */ /* Define to 1 if you have the `gettimeofday' function. */ /* #undef HAVE_GETTIMEOFDAY */ /* Define to 1 if you have a working glibc-style strerror_r function. */ /* #undef HAVE_GLIBC_STRERROR_R */ /* Define to 1 if you have a working gmtime_r function. */ #define HAVE_GMTIME_R 1 /* if you have the gssapi libraries */ /* #undef HAVE_GSSAPI */ /* Define to 1 if you have the header file. */ /* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_GSSAPI_GSSAPI_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_GSSAPI_GSSAPI_KRB5_H */ /* 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 header file. */ /* #undef HAVE_IFADDRS_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_r function. */ /* #undef HAVE_INET_NTOA_R */ /* inet_ntoa_r() takes 2 args */ /* #undef HAVE_INET_NTOA_R_2 */ /* inet_ntoa_r() takes 3 args */ /* #undef HAVE_INET_NTOA_R_3 */ /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ /* #undef HAVE_INET_NTOP */ /* Define to 1 if you have a IPv6 capable working inet_pton function. */ /* #undef HAVE_INET_PTON */ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the ioctl function. */ #define HAVE_IOCTL 1 /* Define to 1 if you have the ioctlsocket function. */ /* #undef HAVE_IOCTLSOCKET */ /* Define to 1 if you have the IoctlSocket camel case function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL */ /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_FIONBIO */ /* Define to 1 if you have a working ioctl FIONBIO function. */ #define HAVE_IOCTL_FIONBIO 1 /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ #define HAVE_IOCTL_SIOCGIFADDR 1 /* Define to 1 if you have the header file. */ #define HAVE_IO_H 1 /* 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 lber.h header file. */ /* #undef HAVE_LBER_H */ /* Define to 1 if you have the ldapssl.h header file. */ /* #undef HAVE_LDAPSSL_H */ /* Define to 1 if you have the ldap.h header file. */ /* #undef HAVE_LDAP_H */ /* Use LDAPS implementation */ /* #undef HAVE_LDAP_SSL */ /* Define to 1 if you have the ldap_ssl.h header file. */ /* #undef HAVE_LDAP_SSL_H */ /* Define to 1 if you have the `ldap_url_parse' function. */ /* #undef HAVE_LDAP_URL_PARSE */ /* 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 `ssh2' library (-lssh2). */ /* #undef HAVE_LIBSSH2 */ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBSSH2_H */ /* Define to 1 if you have the `libssh2_version' function. */ /* #undef HAVE_LIBSSH2_VERSION */ /* Define to 1 if you have the `ssl' library (-lssl). */ #define HAVE_LIBSSL 1 /* if zlib is available */ #define HAVE_LIBZ 1 /* 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 a working localtime_r function. */ #define HAVE_LOCALTIME_R 1 /* Define to 1 if the compiler supports the 'long long' data type. */ #define HAVE_LONGLONG 1 /* Define to 1 if you have the malloc.h header file. */ #define HAVE_MALLOC_H 1 /* Define to 1 if you have the memory.h header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the MSG_NOSIGNAL flag. */ /* #undef HAVE_MSG_NOSIGNAL */ /* 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. */ #define HAVE_NETINET_TCP_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NET_IF_H 1 /* Define to 1 if NI_WITHSCOPEID exists and works. */ /* #undef HAVE_NI_WITHSCOPEID */ /* if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE */ /* #undef HAVE_OLD_GSSMIT */ /* Define to 1 if you have the header file. */ #define HAVE_OPENSSL_CRYPTO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_OPENSSL_ENGINE_H 1 /* Define to 1 if you have the header file. */ #define HAVE_OPENSSL_ERR_H 1 /* Define to 1 if you have the header file. */ #define HAVE_OPENSSL_PEM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_OPENSSL_PKCS12_H 1 /* Define to 1 if you have the header file. */ #define HAVE_OPENSSL_RSA_H 1 /* Define to 1 if you have the header file. */ #define HAVE_OPENSSL_SSL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_OPENSSL_X509_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_PEM_H */ /* 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 a working poll function. */ /* #undef HAVE_POLL */ /* If you have a fine poll */ /* #undef HAVE_POLL_FINE */ /* Define to 1 if you have the header file. */ /* #undef HAVE_POLL_H */ /* Define to 1 if you have a working POSIX-style strerror_r function. */ /* #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. */ #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. */ #define HAVE_RAND_STATUS 1 /* Define to 1 if you have the recv function. */ #define HAVE_RECV 1 /* Define to 1 if you have the recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_RSA_H */ /* Define to 1 if you have the select function. */ #define HAVE_SELECT 1 /* Define to 1 if you have the send function. */ #define HAVE_SEND 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 `setmode' function. */ #define HAVE_SETMODE 1 /* Define to 1 if you have the `setrlimit' function. */ #define HAVE_SETRLIMIT 1 /* Define to 1 if you have the setsockopt function. */ #define HAVE_SETSOCKOPT 1 /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ /* Define to 1 if you have the header file. */ /* #undef HAVE_SGTTY_H */ /* Define to 1 if you have the sigaction function. */ #define HAVE_SIGACTION 1 /* Define to 1 if you have the siginterrupt function. */ #define HAVE_SIGINTERRUPT 1 /* Define to 1 if you have the signal function. */ #define HAVE_SIGNAL 1 /* Define to 1 if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define to 1 if you have the sigsetjmp function or macro. */ /* #undef HAVE_SIGSETJMP */ /* Define to 1 if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T 1 /* Define to 1 if sig_atomic_t is already defined as volatile. */ /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ /* Define to 1 if struct sockaddr_in6 has the sin6_scope_id member */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 /* Define to 1 if you have the `socket' function. */ #define HAVE_SOCKET 1 /* Define this if you have the SPNEGO library fbopenssl */ /* #undef HAVE_SPNEGO */ /* Define to 1 if you have the `SSL_get_shutdown' function. */ #define HAVE_SSL_GET_SHUTDOWN 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SSL_H */ /* Define to 1 if you have the header file. */ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_STDINT_H */ /* Define to 1 if you have the header file. */ #define HAVE_STDIO_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 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 `strlcpy' function. */ /* #undef HAVE_STRLCPY */ /* Define to 1 if you have the strncasecmp function. */ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the strncmpi function. */ /* #undef HAVE_STRNCMPI */ /* Define to 1 if you have the strnicmp function. */ /* #undef HAVE_STRNICMP */ /* Define to 1 if you have the header file. */ /* #undef HAVE_STROPTS_H */ /* 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. */ /* #undef HAVE_STRTOLL */ /* if struct sockaddr_storage is defined */ #define HAVE_STRUCT_SOCKADDR_STORAGE 1 /* Define to 1 if you have the timeval struct. */ #define HAVE_STRUCT_TIMEVAL 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_FILIO_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* 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. */ #define HAVE_SYS_RESOURCE_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_SELECT_H */ /* 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 to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_TIME_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_UIO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_UN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_UTIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TERMIOS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TERMIO_H 1 /* 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. */ #define HAVE_UNAME 1 /* 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 compiler supports C99 variadic macro style. */ #define HAVE_VARIADIC_MACROS_C99 1 /* Define to 1 if compiler supports old gcc variadic macro style. */ #define HAVE_VARIADIC_MACROS_GCC 1 /* Define to 1 if you have a working vxworks-style strerror_r function. */ #define HAVE_VXWORKS_STRERROR_R 1 /* Define to 1 if you have the winber.h header file. */ /* #undef HAVE_WINBER_H */ /* Define to 1 if you have the windows.h header file. */ /* #undef HAVE_WINDOWS_H */ /* Define to 1 if you have the winldap.h header file. */ /* #undef HAVE_WINLDAP_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 */ #define HAVE_WRITABLE_ARGV 1 /* Define to 1 if you have the writev function. */ #define HAVE_WRITEV 1 /* 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 */ #define HAVE_ZLIB_H 1 /* Define to 1 if you need the lber.h header file even with ldap.h */ /* #undef NEED_LBER_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 need the memory.h header file even with stdlib.h */ /* #undef NEED_MEMORY_H */ /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ /* #undef NEED_REENTRANT */ /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ /* #undef NEED_THREAD_SAFE */ /* Define to 1 if the open function requires three arguments. */ #define OPEN_NEEDS_ARG3 1 /* cpu-machine-OS */ #define OS "unknown-unknown-vxworks" /* Name of package */ #define PACKAGE "curl" /* a suitable file to read random data from */ #define RANDOM_FILE "/dev/urandom" /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 int /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 void /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ #define RECVFROM_TYPE_ARG2_IS_VOID 1 /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 size_t /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 socklen_t /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG6_IS_VOID */ /* Define to the function return type for recvfrom. */ #define RECVFROM_TYPE_RETV int /* 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 int /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void /* Define to the type qualifier of arg 5 for select. */ #define SELECT_QUAL_ARG5 /* 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 * /* Define to the function return type for select. */ #define SELECT_TYPE_RETV int /* Define to the type qualifier of arg 2 for send. */ #define SEND_QUAL_ARG2 const /* Define to the type of arg 1 for send. */ #define SEND_TYPE_ARG1 int /* 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 int /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 /* The size of `off_t', as computed by sizeof. */ #define SIZEOF_OFF_T 8 /* The size of `short', as computed by sizeof. */ #define SIZEOF_SHORT 2 /* The size of `size_t', as computed by sizeof. */ #define SIZEOF_SIZE_T 4 /* The size of `time_t', as computed by sizeof. */ #define SIZEOF_TIME_T 4 /* The size of `void*', as computed by sizeof. */ #define SIZEOF_VOIDP 4 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to the type of arg 3 for strerror_r. */ /* #undef STRERROR_R_TYPE_ARG3 */ /* Define to 1 if you can safely include both and . */ /* #undef TIME_WITH_SYS_TIME */ /* Define if you want to enable c-ares support */ /* #undef USE_ARES */ /* Define to disable non-blocking sockets. */ /* #undef USE_BLOCKING_SOCKETS */ /* if GnuTLS is enabled */ /* #undef USE_GNUTLS */ /* if libSSH2 is in use */ /* #undef USE_LIBSSH2 */ /* If you want to build curl with the built-in manual */ #define USE_MANUAL 1 /* if NSS is enabled */ /* #undef USE_NSS */ /* if OpenSSL is in use */ #define USE_OPENSSL 1 /* if SSL is enabled */ #define USE_SSLEAY 1 /* Define to 1 if you are building a Windows target without large file support. */ /* #undef USE_WIN32_LARGE_FILES */ /* to enable SSPI support */ /* #undef USE_WINDOWS_SSPI */ /* Define to 1 if using yaSSL in OpenSSL compatibility mode. */ /* #undef USE_YASSLEMUL */ /* Define to avoid automatic inclusion of winsock.h */ /* #undef WIN32_LEAN_AND_MEAN */ /* Define to 1 if OS is AIX. */ #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 */ /* Type to use in place of in_addr_t when system does not provide it. */ /* #undef in_addr_t */ /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ #endif /* Define to `unsigned int' if does not define. */ /* #undef size_t */ /* the signed version of size_t */ /* #undef ssize_t */ #endif /* HEADER_CURL_CONFIG_VXWORKS_H */ curl-7.35.0/lib/formdata.h0000644000175000017500000000663012213173003012205 00000000000000#ifndef HEADER_CURL_FORMDATA_H #define HEADER_CURL_FORMDATA_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ enum formtype { FORM_DATA, /* form metadata (convert to network encoding if necessary) */ FORM_CONTENT, /* form content (never convert) */ FORM_CALLBACK, /* 'line' points to the custom pointer we pass to the callback */ FORM_FILE /* 'line' points to a file name we should read from to create the form data (never convert) */ }; /* 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 */ curl_read_callback fread_func; /* fread callback pointer */ }; /* 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; char *userp; /* pointer for the read callback */ struct curl_slist* contentheader; struct FormInfo *more; } FormInfo; int Curl_FormInit(struct Form *form, struct FormData *formdata ); CURLcode Curl_getformdata(struct SessionHandle *data, 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 **); CURLcode Curl_formconvert(struct SessionHandle *, struct FormData *); #endif /* HEADER_CURL_FORMDATA_H */ curl-7.35.0/lib/slist.c0000644000175000017500000000751312262353672011562 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #include "curl_memory.h" #include "slist.h" /* 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_nodup() appends a string to the linked list. Rather than * copying the string in dynamic storage, it takes its ownership. The string * should have been malloc()ated. Curl_slist_append_nodup always returns * the address of the first record, so that you can use this function as an * initialization function as well as an append function. * If an error occurs, NULL is returned and the string argument is NOT * released. */ struct curl_slist *Curl_slist_append_nodup(struct curl_slist *list, char *data) { struct curl_slist *last; struct curl_slist *new_item; DEBUGASSERT(data); new_item = malloc(sizeof(struct curl_slist)); if(!new_item) return NULL; new_item->next = NULL; new_item->data = data; /* if this is the first item, then new_item *is* the list */ if(!list) return new_item; last = slist_get_last(list); last->next = new_item; return list; } /* * curl_slist_append() appends a string to the linked list. It always returns * the address of the first record, so that you can use 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 program. */ struct curl_slist *curl_slist_append(struct curl_slist *list, const char *data) { char *dupdata = strdup(data); if(!dupdata) return NULL; list = Curl_slist_append_nodup(list, dupdata); if(!list) free(dupdata); return list; } /* * Curl_slist_duplicate() duplicates a linked list. It always returns the * address of the first record of the cloned list or NULL in case of an * error (or if the input list was NULL). */ struct curl_slist *Curl_slist_duplicate(struct curl_slist *inlist) { struct curl_slist *outlist = NULL; struct curl_slist *tmp; while(inlist) { tmp = curl_slist_append(outlist, inlist->data); if(!tmp) { curl_slist_free_all(outlist); return NULL; } outlist = tmp; inlist = inlist->next; } return outlist; } /* 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; Curl_safefree(item->data); free(item); item = next; } while(next); } curl-7.35.0/lib/README.hostip0000644000175000017500000000274212213173003012424 00000000000000 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 curl_setup.h defines. curl-7.35.0/lib/hostsyn.c0000644000175000017500000000567112262353672012136 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef __VMS #include #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 #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /*********************************************************************** * Only for builds using synchronous name resolves **********************************************************************/ #ifdef CURLRES_SYNCH /* * Function provided by the resolver backend to set DNS servers to use. */ CURLcode Curl_set_dns_servers(struct SessionHandle *data, char *servers) { (void)data; (void)servers; return CURLE_NOT_BUILT_IN; } /* * Function provided by the resolver backend to set * outgoing interface to use for DNS requests */ CURLcode Curl_set_dns_interface(struct SessionHandle *data, const char *interf) { (void)data; (void)interf; return CURLE_NOT_BUILT_IN; } /* * Function provided by the resolver backend to set * local IPv4 address to use as source address for DNS requests */ CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data, const char *local_ip4) { (void)data; (void)local_ip4; return CURLE_NOT_BUILT_IN; } /* * Function provided by the resolver backend to set * local IPv6 address to use as source address for DNS requests */ CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data, const char *local_ip6) { (void)data; (void)local_ip6; return CURLE_NOT_BUILT_IN; } #endif /* truly sync */ curl-7.35.0/lib/http_chunks.h0000644000175000017500000000601612270035364012752 00000000000000#ifndef HEADER_CURL_HTTP_CHUNKS_H #define HEADER_CURL_HTTP_CHUNKS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ /* * 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 { /* await and buffer all hexadecimal digits until we get one that isn't a hexadecimal digit. When done, we go CHUNK_LF */ CHUNK_HEX, /* wait for LF, ignore all else */ CHUNK_LF, /* We eat the amount of data specified. When done, we move on to the POST_CR state. */ CHUNK_DATA, /* POSTLF should get a CR and then a LF and nothing else, then move back to HEX as the CRLF combination marks the end of a chunk. A missing CR is no big deal. */ CHUNK_POSTLF, /* Used to 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 } 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; curl_off_t datasize; size_t dataleft; /* untouched data amount at the end of the last buffer */ }; #endif /* HEADER_CURL_HTTP_CHUNKS_H */ curl-7.35.0/lib/security.c0000644000175000017500000003774012262353672012300 00000000000000/* 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, 2013 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * * Copyright (C) 2001 - 2013, Daniel Stenberg, , et al. * * 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 "curl_setup.h" #ifndef CURL_DISABLE_FTP #ifdef HAVE_GSSAPI #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #include "urldata.h" #include "curl_base64.h" #include "curl_memory.h" #include "curl_sec.h" #include "ftp.h" #include "sendf.h" #include "rawstr.h" #include "warnless.h" /* The last #include file should be: */ #include "memdebug.h" 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(checkprefix(name, level_names[i].name)) return level_names[i].level; return PROT_NONE; } /* Convert a protocol |level| to its char representation. We take an int to catch programming mistakes. */ static char level_to_char(int level) { switch(level) { case PROT_CLEAR: return 'C'; case PROT_SAFE: return 'S'; case PROT_CONFIDENTIAL: return 'E'; case PROT_PRIVATE: return 'P'; case PROT_CMD: /* Fall through */ default: /* Those 2 cases should not be reached! */ break; } DEBUGASSERT(0); /* Default to the most secure alternative. */ return 'P'; } static const struct Curl_sec_client_mech * const mechs[] = { #ifdef HAVE_GSSAPI &Curl_krb5_client_mech, #endif NULL }; /* Send an FTP command defined by |message| and the optional arguments. The function returns the ftp_code. If an error occurs, -1 is returned. */ static int ftp_send_command(struct connectdata *conn, const char *message, ...) { int ftp_code; ssize_t nread; va_list args; char print_buffer[50]; va_start(args, message); vsnprintf(print_buffer, sizeof(print_buffer), message, args); va_end(args); if(Curl_ftpsendf(conn, print_buffer) != CURLE_OK) { ftp_code = -1; } else { if(Curl_GetFTPResponse(&nread, conn, &ftp_code) != CURLE_OK) ftp_code = -1; } (void)nread; /* Unused */ return ftp_code; } /* Read |len| from the socket |fd| and store it in |to|. Return a CURLcode saying whether an error occurred or CURLE_OK if |len| was read. */ static CURLcode socket_read(curl_socket_t fd, void *to, size_t len) { char *to_p = to; CURLcode code; ssize_t nread; while(len > 0) { code = Curl_read_plain(fd, to_p, len, &nread); if(code == CURLE_OK) { len -= nread; to_p += nread; } else { /* FIXME: We are doing a busy wait */ if(code == CURLE_AGAIN) continue; return code; } } return CURLE_OK; } /* Write |len| bytes from the buffer |to| to the socket |fd|. Return a CURLcode saying whether an error occurred or CURLE_OK if |len| was written. */ static CURLcode socket_write(struct connectdata *conn, curl_socket_t fd, const void *to, size_t len) { const char *to_p = to; CURLcode code; ssize_t written; while(len > 0) { code = Curl_write_plain(conn, fd, to_p, len, &written); if(code == CURLE_OK) { len -= written; to_p += written; } else { /* FIXME: We are doing a busy wait */ if(code == CURLE_AGAIN) continue; return code; } } return CURLE_OK; } static CURLcode read_data(struct connectdata *conn, curl_socket_t fd, struct krb5buffer *buf) { int len; void* tmp; CURLcode ret; ret = socket_read(fd, &len, sizeof(len)); if(ret != CURLE_OK) return ret; len = ntohl(len); tmp = realloc(buf->data, len); if(tmp == NULL) return CURLE_OUT_OF_MEMORY; buf->data = tmp; ret = socket_read(fd, buf->data, len); if(ret != CURLE_OK) return ret; buf->size = conn->mech->decode(conn->app_data, buf->data, len, conn->data_prot, conn); buf->index = 0; return CURLE_OK; } static size_t buffer_read(struct krb5buffer *buf, void *data, size_t len) { if(buf->size - buf->index < len) len = buf->size - buf->index; memcpy(data, (char*)buf->data + buf->index, len); buf->index += len; return len; } /* Matches Curl_recv signature */ static ssize_t sec_recv(struct connectdata *conn, int sockindex, char *buffer, size_t len, CURLcode *err) { size_t bytes_read; size_t total_read = 0; curl_socket_t fd = conn->sock[sockindex]; *err = CURLE_OK; /* Handle clear text response. */ if(conn->sec_complete == 0 || conn->data_prot == PROT_CLEAR) return read(fd, buffer, len); if(conn->in_buffer.eof_flag) { conn->in_buffer.eof_flag = 0; return 0; } bytes_read = buffer_read(&conn->in_buffer, buffer, len); len -= bytes_read; total_read += bytes_read; buffer += bytes_read; while(len > 0) { if(read_data(conn, fd, &conn->in_buffer) != CURLE_OK) return -1; if(conn->in_buffer.size == 0) { if(bytes_read > 0) conn->in_buffer.eof_flag = 1; return bytes_read; } bytes_read = buffer_read(&conn->in_buffer, buffer, len); len -= bytes_read; total_read += bytes_read; buffer += bytes_read; } /* FIXME: Check for overflow */ return total_read; } /* Send |length| bytes from |from| to the |fd| socket taking care of encoding and negociating with the server. |from| can be NULL. */ /* FIXME: We don't check for errors nor report any! */ static void do_sec_send(struct connectdata *conn, curl_socket_t fd, const char *from, int length) { int bytes, htonl_bytes; /* 32-bit integers for htonl */ char *buffer = NULL; char *cmd_buffer; size_t cmd_size = 0; CURLcode error; enum protection_level prot_level = conn->data_prot; bool iscmd = (prot_level == PROT_CMD)?TRUE:FALSE; DEBUGASSERT(prot_level > PROT_NONE && prot_level < PROT_LAST); if(iscmd) { if(!strncmp(from, "PASS ", 5) || !strncmp(from, "ACCT ", 5)) prot_level = PROT_PRIVATE; else prot_level = conn->command_prot; } bytes = conn->mech->encode(conn->app_data, from, length, prot_level, (void**)&buffer, conn); if(!buffer || bytes <= 0) return; /* error */ if(iscmd) { error = Curl_base64_encode(conn->data, buffer, curlx_sitouz(bytes), &cmd_buffer, &cmd_size); if(error) { free(buffer); return; /* error */ } if(cmd_size > 0) { static const char *enc = "ENC "; static const char *mic = "MIC "; if(prot_level == PROT_PRIVATE) socket_write(conn, fd, enc, 4); else socket_write(conn, fd, mic, 4); socket_write(conn, fd, cmd_buffer, cmd_size); socket_write(conn, fd, "\r\n", 2); infof(conn->data, "Send: %s%s\n", prot_level == PROT_PRIVATE?enc:mic, cmd_buffer); free(cmd_buffer); } } else { htonl_bytes = htonl(bytes); socket_write(conn, fd, &htonl_bytes, sizeof(htonl_bytes)); socket_write(conn, fd, buffer, curlx_sitouz(bytes)); } free(buffer); } static ssize_t sec_write(struct connectdata *conn, curl_socket_t fd, const char *buffer, size_t length) { /* FIXME: Check for overflow */ ssize_t tx = 0, len = conn->buffer_size; len -= conn->mech->overhead(conn->app_data, conn->data_prot, curlx_sztosi(len)); if(len <= 0) len = length; while(length) { if(len >= 0 || length < (size_t)len) { /* FIXME: Check for overflow. */ len = length; } do_sec_send(conn, fd, buffer, curlx_sztosi(len)); length -= len; buffer += len; tx += len; } return tx; } /* Matches Curl_send signature */ static ssize_t sec_send(struct connectdata *conn, int sockindex, const void *buffer, size_t len, CURLcode *err) { curl_socket_t fd = conn->sock[sockindex]; *err = CURLE_OK; return sec_write(conn, fd, buffer, len); } int Curl_sec_read_msg(struct connectdata *conn, char *buffer, enum protection_level level) { /* decoded_len should be size_t or ssize_t but conn->mech->decode returns an int */ int decoded_len; char *buf; int ret_code; size_t decoded_sz = 0; CURLcode error; DEBUGASSERT(level > PROT_NONE && level < PROT_LAST); error = Curl_base64_decode(buffer + 4, (unsigned char **)&buf, &decoded_sz); if(error || decoded_sz == 0) return -1; if(decoded_sz > (size_t)INT_MAX) { free(buf); return -1; } decoded_len = curlx_uztosi(decoded_sz); decoded_len = conn->mech->decode(conn->app_data, buf, decoded_len, level, conn); if(decoded_len <= 0) { free(buf); return -1; } if(conn->data->set.verbose) { buf[decoded_len] = '\n'; Curl_debug(conn->data, CURLINFO_HEADER_IN, buf, decoded_len + 1, conn); } buf[decoded_len] = '\0'; DEBUGASSERT(decoded_len > 3); if(buf[3] == '-') ret_code = 0; else { /* Check for error? */ sscanf(buf, "%d", &ret_code); } if(buf[decoded_len - 1] == '\n') buf[decoded_len - 1] = '\0'; /* FIXME: Is |buffer| length always greater than |decoded_len|? */ strcpy(buffer, buf); free(buf); return ret_code; } /* FIXME: The error code returned here is never checked. */ static int sec_set_protection_level(struct connectdata *conn) { int code; char* pbsz; static unsigned int buffer_size = 1 << 20; /* 1048576 */ enum protection_level level = conn->request_data_prot; DEBUGASSERT(level > PROT_NONE && level < PROT_LAST); if(!conn->sec_complete) { infof(conn->data, "Trying to change the protection level after the" "completion of the data exchange.\n"); return -1; } /* Bail out if we try to set up the same level */ if(conn->data_prot == level) return 0; if(level) { code = ftp_send_command(conn, "PBSZ %u", buffer_size); if(code < 0) return -1; if(code/100 != 2) { failf(conn->data, "Failed to set the protection's buffer size."); return -1; } conn->buffer_size = buffer_size; pbsz = strstr(conn->data->state.buffer, "PBSZ="); if(pbsz) { /* FIXME: Checks for errors in sscanf? */ sscanf(pbsz, "PBSZ=%u", &buffer_size); if(buffer_size < conn->buffer_size) conn->buffer_size = buffer_size; } } /* Now try to negiociate the protection level. */ code = ftp_send_command(conn, "PROT %c", level_to_char(level)); if(code < 0) return -1; if(code/100 != 2) { failf(conn->data, "Failed to set the protection level."); return -1; } conn->data_prot = level; if(level == PROT_PRIVATE) conn->command_prot = level; return 0; } int Curl_sec_request_prot(struct connectdata *conn, const char *level) { enum protection_level l = name_to_level(level); if(l == PROT_NONE) return -1; DEBUGASSERT(l > PROT_NONE && l < PROT_LAST); conn->request_data_prot = l; return 0; } static CURLcode choose_mech(struct connectdata *conn) { int ret; struct SessionHandle *data = conn->data; const struct Curl_sec_client_mech * const *mech; void *tmp_allocation; const char *mech_name; for(mech = mechs; (*mech); ++mech) { mech_name = (*mech)->name; /* We have no mechanism with a NULL name but keep this check */ DEBUGASSERT(mech_name != NULL); if(mech_name == NULL) { infof(data, "Skipping mechanism with empty name (%p)\n", (void *)mech); continue; } tmp_allocation = realloc(conn->app_data, (*mech)->size); if(tmp_allocation == NULL) { failf(data, "Failed realloc of size %u", (*mech)->size); mech = NULL; return CURLE_OUT_OF_MEMORY; } conn->app_data = tmp_allocation; if((*mech)->init) { ret = (*mech)->init(conn->app_data); if(ret != 0) { infof(data, "Failed initialization for %s. Skipping it.\n", mech_name); continue; } } infof(data, "Trying mechanism %s...\n", mech_name); ret = ftp_send_command(conn, "AUTH %s", mech_name); if(ret < 0) /* FIXME: This error is too generic but it is OK for now. */ return CURLE_COULDNT_CONNECT; if(ret/100 != 3) { switch(ret) { case 504: infof(data, "Mechanism %s is not supported by the server (server " "returned ftp code: 504).\n", mech_name); break; case 534: infof(data, "Mechanism %s was rejected by the server (server returned " "ftp code: 534).\n", mech_name); break; default: if(ret/100 == 5) { infof(data, "server does not support the security extensions\n"); return CURLE_USE_SSL_FAILED; } break; } continue; } /* Authenticate */ ret = (*mech)->auth(conn->app_data, conn); if(ret == AUTH_CONTINUE) continue; else if(ret != AUTH_OK) { /* Mechanism has dumped the error to stderr, don't error here. */ return -1; } DEBUGASSERT(ret == AUTH_OK); conn->mech = *mech; conn->sec_complete = 1; conn->recv[FIRSTSOCKET] = sec_recv; conn->send[FIRSTSOCKET] = sec_send; conn->recv[SECONDARYSOCKET] = sec_recv; conn->send[SECONDARYSOCKET] = sec_send; conn->command_prot = PROT_SAFE; /* Set the requested protection level */ /* BLOCKING */ (void)sec_set_protection_level(conn); break; } return mech != NULL ? CURLE_OK : CURLE_FAILED_INIT; } CURLcode Curl_sec_login(struct connectdata *conn) { return choose_mech(conn); } void Curl_sec_end(struct connectdata *conn) { if(conn->mech != NULL && conn->mech->end) conn->mech->end(conn->app_data); if(conn->app_data) { free(conn->app_data); conn->app_data = NULL; } if(conn->in_buffer.data) { free(conn->in_buffer.data); conn->in_buffer.data = NULL; conn->in_buffer.size = 0; conn->in_buffer.index = 0; /* FIXME: Is this really needed? */ conn->in_buffer.eof_flag = 0; } conn->sec_complete = 0; conn->data_prot = PROT_CLEAR; conn->mech = NULL; } #endif /* HAVE_GSSAPI */ #endif /* CURL_DISABLE_FTP */ curl-7.35.0/lib/curl_sec.h0000644000175000017500000000361112262353672012223 00000000000000#ifndef HEADER_CURL_SECURITY_H #define HEADER_CURL_SECURITY_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ 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 *, const 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 #ifdef HAVE_GSSAPI int Curl_sec_read_msg (struct connectdata *conn, char *, enum protection_level); void Curl_sec_end (struct connectdata *); CURLcode Curl_sec_login (struct connectdata *); int Curl_sec_request_prot (struct connectdata *conn, const char *level); extern struct Curl_sec_client_mech Curl_krb5_client_mech; #endif #endif /* HEADER_CURL_SECURITY_H */ curl-7.35.0/lib/http_digest.c0000644000175000017500000004174212262353672012744 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH) #include "urldata.h" #include "rawstr.h" #include "curl_base64.h" #include "curl_md5.h" #include "http_digest.h" #include "strtok.h" #include "curl_memory.h" #include "vtls/vtls.h" /* for Curl_rand() */ #include "non-ascii.h" /* included for Curl_convert_... prototypes */ #include "warnless.h" #define _MPRINTF_REPLACE /* use our functions only */ #include /* The last #include file should be: */ #include "memdebug.h" #define MAX_VALUE_LENGTH 256 #define MAX_CONTENT_LENGTH 1024 static void digest_cleanup_one(struct digestdata *dig); /* * Return 0 on success and then the buffers are filled in fine. * * Non-zero means failure to parse. */ static int get_pair(const char *str, char *value, char *content, const char **endptr) { int c; bool starts_with_quote = FALSE; bool escape = FALSE; for(c=MAX_VALUE_LENGTH-1; (*str && (*str != '=') && c--); ) *value++ = *str++; *value=0; if('=' != *str++) /* eek, no match */ return 1; if('\"' == *str) { /* this starts with a quote so it must end with one as well! */ str++; starts_with_quote = TRUE; } for(c=MAX_CONTENT_LENGTH-1; *str && c--; str++) { switch(*str) { case '\\': if(!escape) { /* possibly the start of an escaped quote */ escape = TRUE; *content++ = '\\'; /* even though this is an escape character, we still store it as-is in the target buffer */ continue; } break; case ',': if(!starts_with_quote) { /* this signals the end of the content if we didn't get a starting quote and then we do "sloppy" parsing */ c=0; /* the end */ continue; } break; case '\r': case '\n': /* end of string */ c=0; continue; case '\"': if(!escape && starts_with_quote) { /* end of string */ c=0; continue; } break; } escape = FALSE; *content++ = *str; } *content=0; *endptr = str; return 0; /* all is fine! */ } /* 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, const char *header) /* rest of the *-authenticate: header */ { 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; } 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 */ digest_cleanup_one(d); for(;;) { char value[MAX_VALUE_LENGTH]; char content[MAX_CONTENT_LENGTH]; while(*header && ISSPACE(*header)) header++; /* extract a value=content pair */ if(!get_pair(header, value, content, &header)) { if(Curl_raw_equal(value, "nonce")) { d->nonce = strdup(content); if(!d->nonce) return CURLDIGEST_NOMEM; } else if(Curl_raw_equal(value, "stale")) { if(Curl_raw_equal(content, "true")) { d->stale = TRUE; d->nc = 1; /* we make a new nonce now */ } } else if(Curl_raw_equal(value, "realm")) { d->realm = strdup(content); if(!d->realm) return CURLDIGEST_NOMEM; } else if(Curl_raw_equal(value, "opaque")) { d->opaque = strdup(content); if(!d->opaque) return CURLDIGEST_NOMEM; } else if(Curl_raw_equal(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(Curl_raw_equal(token, "auth")) { foundAuth = TRUE; } else if(Curl_raw_equal(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(Curl_raw_equal(value, "algorithm")) { d->algorithm = strdup(content); if(!d->algorithm) return CURLDIGEST_NOMEM; if(Curl_raw_equal(content, "MD5-sess")) d->algo = CURLDIGESTALGO_MD5SESS; else if(Curl_raw_equal(content, "MD5")) d->algo = CURLDIGESTALGO_MD5; else return CURLDIGEST_BADALGO; } else { /* unknown specifier, ignore it! */ } } else break; /* we're done here */ /* pass all additional spaces here */ while(*header && ISSPACE(*header)) header++; 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]); } /* Perform quoted-string escaping as described in RFC2616 and its errata */ static char *string_quoted(const char *source) { char *dest, *d; const char *s = source; size_t n = 1; /* null terminator */ /* Calculate size needed */ while(*s) { ++n; if(*s == '"' || *s == '\\') { ++n; } ++s; } dest = malloc(n); if(dest) { s = source; d = dest; while(*s) { if(*s == '"' || *s == '\\') { *d++ = '\\'; } *d++ = *s++; } *d = 0; } return dest; } CURLcode Curl_output_digest(struct connectdata *conn, bool proxy, const unsigned char *request, const 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, */ size_t urilen; unsigned char md5buf[16]; /* 16 bytes/128 bits */ unsigned char request_digest[33]; unsigned char *md5this; unsigned char ha1[33];/* 32 digits and 1 zero byte */ unsigned char ha2[33];/* 32 digits and 1 zero byte */ char cnoncebuf[33]; char *cnonce = NULL; size_t cnonce_sz = 0; char *tmp = NULL; char **allocuserpwd; size_t userlen; const char *userp; char *userp_quoted; const char *passwdp; struct auth *authp; struct SessionHandle *data = conn->data; struct digestdata *d; CURLcode rc; /* The CURL_OUTPUT_DIGEST_CONV macro below is for non-ASCII machines. It converts digest text to ASCII so the MD5 will be correct for what ultimately goes over the network. */ #define CURL_OUTPUT_DIGEST_CONV(a, b) \ rc = Curl_convert_to_network(a, (char *)b, strlen((const char*)b)); \ if(rc != CURLE_OK) { \ free(b); \ return rc; \ } 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; } Curl_safefree(*allocuserpwd); /* not set means empty */ if(!userp) userp=""; if(!passwdp) passwdp=""; if(!d->nonce) { authp->done = FALSE; return CURLE_OK; } authp->done = TRUE; if(!d->nc) d->nc = 1; if(!d->cnonce) { struct timeval now = Curl_tvnow(); snprintf(cnoncebuf, sizeof(cnoncebuf), "%08x%08x%08x%08x", Curl_rand(data), Curl_rand(data), (unsigned int)now.tv_sec, (unsigned int)now.tv_usec); rc = Curl_base64_encode(data, cnoncebuf, strlen(cnoncebuf), &cnonce, &cnonce_sz); if(rc) return rc; d->cnonce = cnonce; } /* 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_OUTPUT_DIGEST_CONV(data, md5this); /* convert on non-ASCII machines */ Curl_md5it(md5buf, md5this); Curl_safefree(md5this); 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_OUTPUT_DIGEST_CONV(data, tmp); /* convert on non-ASCII machines */ Curl_md5it(md5buf, (unsigned char *)tmp); Curl_safefree(tmp); 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) */ /* So IE browsers < v7 cut off the URI part at the query part when they evaluate the MD5 and some (IIS?) servers work with them so we may need to do the Digest IE-style. Note that the different ways cause different MD5 sums to get sent. Apache servers can be set to do the Digest IE-style automatically using the BrowserMatch feature: http://httpd.apache.org/docs/2.2/mod/mod_auth_digest.html#msie Further details on Digest implementation differences: http://www.fngtps.com/2006/09/http-authentication */ if(authp->iestyle && ((tmp = strchr((char *)uripath, '?')) != NULL)) urilen = tmp - (char *)uripath; else urilen = strlen((char *)uripath); md5this = (unsigned char *)aprintf("%s:%.*s", request, urilen, uripath); if(d->qop && Curl_raw_equal(d->qop, "auth-int")) { /* We don't support auth-int for PUT or POST at the moment. TODO: replace md5 of empty string with entity-body for PUT/POST */ unsigned char *md5this2 = (unsigned char *) aprintf("%s:%s", md5this, "d41d8cd98f00b204e9800998ecf8427e"); Curl_safefree(md5this); md5this = md5this2; } if(!md5this) return CURLE_OUT_OF_MEMORY; CURL_OUTPUT_DIGEST_CONV(data, md5this); /* convert on non-ASCII machines */ Curl_md5it(md5buf, md5this); Curl_safefree(md5this); 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); } if(!md5this) return CURLE_OUT_OF_MEMORY; CURL_OUTPUT_DIGEST_CONV(data, md5this); /* convert on non-ASCII machines */ Curl_md5it(md5buf, md5this); Curl_safefree(md5this); 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" Digest parameters are all quoted strings. Username which is provided by the user will need double quotes and backslashes within it escaped. For the other fields, this shouldn't be an issue. realm, nonce, and opaque are copied as is from the server, escapes and all. cnonce is generated with web-safe characters. uri is already percent encoded. nc is 8 hex characters. algorithm and qop with standard values only contain web-safe chracters. */ userp_quoted = string_quoted(userp); if(!userp_quoted) return CURLE_OUT_OF_MEMORY; 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_quoted, d->realm, d->nonce, urilen, uripath, /* this is the PATH part of the URL */ d->cnonce, d->nc, d->qop, request_digest); if(Curl_raw_equal(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_quoted, d->realm, d->nonce, urilen, uripath, /* this is the PATH part of the URL */ request_digest); } Curl_safefree(userp_quoted); 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 + zero (3 bytes) to the userpwd header */ userlen = strlen(*allocuserpwd); tmp = realloc(*allocuserpwd, userlen + 3); if(!tmp) return CURLE_OUT_OF_MEMORY; strcpy(&tmp[userlen], "\r\n"); /* append the data */ *allocuserpwd = tmp; return CURLE_OK; } static void digest_cleanup_one(struct digestdata *d) { Curl_safefree(d->nonce); Curl_safefree(d->cnonce); Curl_safefree(d->realm); Curl_safefree(d->opaque); Curl_safefree(d->qop); Curl_safefree(d->algorithm); d->nc = 0; d->algo = CURLDIGESTALGO_MD5; /* default algorithm */ d->stale = FALSE; /* default means normal, not stale */ } void Curl_digest_cleanup(struct SessionHandle *data) { digest_cleanup_one(&data->state.digest); digest_cleanup_one(&data->state.proxydigest); } #endif curl-7.35.0/lib/curl_threads.c0000644000175000017500000000613712270035364013076 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(USE_THREADS_POSIX) # ifdef HAVE_PTHREAD_H # include # endif #elif defined(USE_THREADS_WIN32) # ifdef HAVE_PROCESS_H # include # endif #endif #include "curl_threads.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" #if defined(USE_THREADS_POSIX) struct curl_actual_call { unsigned int (*func)(void *); void *arg; }; static void *curl_thread_create_thunk(void *arg) { struct curl_actual_call * ac = arg; unsigned int (*func)(void *) = ac->func; void *real_arg = ac->arg; free(ac); (*func)(real_arg); return 0; } curl_thread_t Curl_thread_create(unsigned int (*func) (void*), void *arg) { curl_thread_t t = malloc(sizeof(pthread_t)); struct curl_actual_call *ac = malloc(sizeof(struct curl_actual_call)); if(!(ac && t)) goto err; ac->func = func; ac->arg = arg; if(pthread_create(t, NULL, curl_thread_create_thunk, ac) != 0) goto err; return t; err: Curl_safefree(t); Curl_safefree(ac); return curl_thread_t_null; } void Curl_thread_destroy(curl_thread_t hnd) { if(hnd != curl_thread_t_null) { pthread_detach(*hnd); free(hnd); } } int Curl_thread_join(curl_thread_t *hnd) { int ret = (pthread_join(**hnd, NULL) == 0); free(*hnd); *hnd = curl_thread_t_null; return ret; } #elif defined(USE_THREADS_WIN32) curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void*), void *arg) { #ifdef _WIN32_WCE return CreateThread(NULL, 0, func, arg, 0, NULL); #else curl_thread_t t; t = (curl_thread_t)_beginthreadex(NULL, 0, func, arg, 0, NULL); if((t == 0) || (t == (curl_thread_t)-1L)) return curl_thread_t_null; return t; #endif } void Curl_thread_destroy(curl_thread_t hnd) { CloseHandle(hnd); } int Curl_thread_join(curl_thread_t *hnd) { int ret = (WaitForSingleObject(*hnd, INFINITE) == WAIT_OBJECT_0); Curl_thread_destroy(*hnd); *hnd = curl_thread_t_null; return ret; } #endif /* USE_THREADS_* */ curl-7.35.0/lib/wildcard.c0000644000175000017500000000406412213173003012173 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ #include "curl_setup.h" #include "wildcard.h" #include "llist.h" #include "fileinfo.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" CURLcode Curl_wildcard_init(struct WildcardData *wc) { DEBUGASSERT(wc->filelist == NULL); /* now allocate only wc->filelist, everything else will be allocated if it is needed. */ wc->filelist = Curl_llist_alloc(Curl_fileinfo_dtor); if(!wc->filelist) {; return CURLE_OUT_OF_MEMORY; } return CURLE_OK; } void Curl_wildcard_dtor(struct WildcardData *wc) { if(!wc) return; if(wc->tmp_dtor) { wc->tmp_dtor(wc->tmp); wc->tmp_dtor = ZERO_NULL; wc->tmp = NULL; } DEBUGASSERT(wc->tmp == NULL); if(wc->filelist) { Curl_llist_destroy(wc->filelist, NULL); wc->filelist = NULL; } if(wc->path) { free(wc->path); wc->path = NULL; } if(wc->pattern) { free(wc->pattern); wc->pattern = NULL; } wc->customptr = NULL; wc->state = CURLWC_INIT; } curl-7.35.0/lib/version.c0000644000175000017500000001752412262353672012114 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #include #include "urldata.h" #include "vtls/vtls.h" #include "http2.h" #define _MPRINTF_REPLACE /* use the internal *printf() functions */ #include #ifdef USE_ARES # if defined(CURL_STATICLIB) && !defined(CARES_STATICLIB) && \ (defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)) # define CARES_STATICLIB # endif # include #endif #ifdef USE_LIBIDN #include #endif #if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS) #include #endif #ifdef USE_LIBRTMP #include #endif #ifdef USE_LIBSSH2 #include #endif #ifdef HAVE_LIBSSH2_VERSION /* get it run-time if possible */ #define CURL_LIBSSH2_VERSION libssh2_version(0) #else /* use build-time if run-time not possible */ #define CURL_LIBSSH2_VERSION LIBSSH2_VERSION #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); len = strlen(ptr); left -= len; ptr += len; if(left > 1) { len = Curl_ssl_version(ptr + 1, left - 1); if(len > 0) { *ptr = ' '; 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 #ifdef USE_WIN32_IDN len = snprintf(ptr, left, " WinIDN"); 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 #ifdef USE_LIBSSH2 len = snprintf(ptr, left, " libssh2/%s", CURL_LIBSSH2_VERSION); left -= len; ptr += len; #endif #ifdef USE_NGHTTP2 len = Curl_http2_ver(ptr, left); left -= len; ptr += len; #endif #ifdef USE_LIBRTMP { char suff[2]; if(RTMP_LIB_VERSION & 0xff) { suff[0] = (RTMP_LIB_VERSION & 0xff) + 'a' - 1; suff[1] = '\0'; } else suff[0] = '\0'; snprintf(ptr, left, " librtmp/%d.%d%s", RTMP_LIB_VERSION >> 16, (RTMP_LIB_VERSION >> 8) & 0xff, suff); /* If another lib version is added below this one, this code would also have to do: len = what snprintf() returned left -= len; ptr += len; */ } #endif return version; } /* data for curl_version_info Keep the list sorted alphabetically. It is also written so that each protocol line has its own #if line to make things easier on the eye. */ static const char * const protocols[] = { #ifndef CURL_DISABLE_DICT "dict", #endif #ifndef CURL_DISABLE_FILE "file", #endif #ifndef CURL_DISABLE_FTP "ftp", #endif #if defined(USE_SSL) && !defined(CURL_DISABLE_FTP) "ftps", #endif #ifndef CURL_DISABLE_GOPHER "gopher", #endif #ifndef CURL_DISABLE_HTTP "http", #endif #if defined(USE_SSL) && !defined(CURL_DISABLE_HTTP) "https", #endif #ifndef CURL_DISABLE_IMAP "imap", #endif #if defined(USE_SSL) && !defined(CURL_DISABLE_IMAP) "imaps", #endif #ifndef CURL_DISABLE_LDAP "ldap", #if !defined(CURL_DISABLE_LDAPS) && \ ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \ (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))) "ldaps", #endif #endif #ifndef CURL_DISABLE_POP3 "pop3", #endif #if defined(USE_SSL) && !defined(CURL_DISABLE_POP3) "pop3s", #endif #ifdef USE_LIBRTMP "rtmp", #endif #ifndef CURL_DISABLE_RTSP "rtsp", #endif #ifdef USE_LIBSSH2 "scp", #endif #ifdef USE_LIBSSH2 "sftp", #endif #ifndef CURL_DISABLE_SMTP "smtp", #endif #if defined(USE_SSL) && !defined(CURL_DISABLE_SMTP) "smtps", #endif #ifndef CURL_DISABLE_TELNET "telnet", #endif #ifndef CURL_DISABLE_TFTP "tftp", #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 USE_SSL | CURL_VERSION_SSL #endif #ifdef USE_NTLM | CURL_VERSION_NTLM #endif #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) | CURL_VERSION_NTLM_WB #endif #ifdef USE_WINDOWS_SSPI | CURL_VERSION_SSPI #endif #ifdef HAVE_LIBZ | CURL_VERSION_LIBZ #endif #ifdef USE_HTTP_NEGOTIATE | CURL_VERSION_GSSNEGOTIATE #endif #ifdef DEBUGBUILD | CURL_VERSION_DEBUG #endif #ifdef CURLDEBUG | CURL_VERSION_CURLDEBUG #endif #ifdef CURLRES_ASYNCH | CURL_VERSION_ASYNCHDNS #endif #ifdef HAVE_SPNEGO | CURL_VERSION_SPNEGO #endif #if (CURL_SIZEOF_CURL_OFF_T > 4) && \ ( (SIZEOF_OFF_T > 4) || defined(USE_WIN32_LARGE_FILES) ) | CURL_VERSION_LARGEFILE #endif #if defined(CURL_DOES_CONVERSIONS) | CURL_VERSION_CONV #endif #if defined(USE_TLS_SRP) | CURL_VERSION_TLSAUTH_SRP #endif #if defined(USE_NGHTTP2) | CURL_VERSION_HTTP2 #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 */ NULL, /* ssh lib version */ }; curl_version_info_data *curl_version_info(CURLversion stamp) { #ifdef USE_LIBSSH2 static char ssh_buffer[80]; #endif #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; #elif defined(USE_WIN32_IDN) 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 #ifdef USE_LIBSSH2 snprintf(ssh_buffer, sizeof(ssh_buffer), "libssh2/%s", LIBSSH2_VERSION); version_info.libssh_version = ssh_buffer; #endif (void)stamp; /* avoid compiler warnings, we don't use this */ return &version_info; } curl-7.35.0/lib/curl_sasl.h0000644000175000017500000001402612262353672012415 00000000000000#ifndef HEADER_CURL_SASL_H #define HEADER_CURL_SASL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2012 - 2013, 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. * ***************************************************************************/ #include "pingpong.h" /* Authentication mechanism values */ #define SASL_AUTH_NONE 0 #define SASL_AUTH_ANY ~0U /* Authentication mechanism flags */ #define SASL_MECH_LOGIN (1 << 0) #define SASL_MECH_PLAIN (1 << 1) #define SASL_MECH_CRAM_MD5 (1 << 2) #define SASL_MECH_DIGEST_MD5 (1 << 3) #define SASL_MECH_GSSAPI (1 << 4) #define SASL_MECH_EXTERNAL (1 << 5) #define SASL_MECH_NTLM (1 << 6) #define SASL_MECH_XOAUTH2 (1 << 7) /* Authentication mechanism strings */ #define SASL_MECH_STRING_LOGIN "LOGIN" #define SASL_MECH_STRING_PLAIN "PLAIN" #define SASL_MECH_STRING_CRAM_MD5 "CRAM-MD5" #define SASL_MECH_STRING_DIGEST_MD5 "DIGEST-MD5" #define SASL_MECH_STRING_GSSAPI "GSSAPI" #define SASL_MECH_STRING_EXTERNAL "EXTERNAL" #define SASL_MECH_STRING_NTLM "NTLM" #define SASL_MECH_STRING_XOAUTH2 "XOAUTH2" /* This is used to test whether the line starts with the given mechanism */ #define sasl_mech_equal(line, wordlen, mech) \ (wordlen == (sizeof(mech) - 1) / sizeof(char) && \ !memcmp(line, mech, wordlen)) /* This is used to generate a base64 encoded PLAIN authentication message */ CURLcode Curl_sasl_create_plain_message(struct SessionHandle *data, const char *userp, const char *passwdp, char **outptr, size_t *outlen); /* This is used to generate a base64 encoded LOGIN authentication message containing either the user name or password details */ CURLcode Curl_sasl_create_login_message(struct SessionHandle *data, const char *valuep, char **outptr, size_t *outlen); #ifndef CURL_DISABLE_CRYPTO_AUTH /* This is used to decode a base64 encoded CRAM-MD5 challange message */ CURLcode Curl_sasl_decode_cram_md5_message(const char *chlg64, char **outptr, size_t *outlen); /* This is used to generate a base64 encoded CRAM-MD5 response message */ CURLcode Curl_sasl_create_cram_md5_message(struct SessionHandle *data, const char *chlg, const char *user, const char *passwdp, char **outptr, size_t *outlen); /* This is used to decode a base64 encoded DIGEST-MD5 challange message */ CURLcode Curl_sasl_decode_digest_md5_message(const char *chlg64, char *nonce, size_t nlen, char *realm, size_t rlen, char *alg, size_t alen); /* This is used to generate a base64 encoded DIGEST-MD5 response message */ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data, const char *nonce, const char *realm, const char *user, const char *passwdp, const char *service, char **outptr, size_t *outlen); #endif #ifdef USE_NTLM /* This is used to generate a base64 encoded NTLM type-1 message */ CURLcode Curl_sasl_create_ntlm_type1_message(const char *userp, const char *passwdp, struct ntlmdata *ntlm, char **outptr, size_t *outlen); /* This is used to decode a base64 encoded NTLM type-2 message */ CURLcode Curl_sasl_decode_ntlm_type2_message(struct SessionHandle *data, const char *type2msg, struct ntlmdata *ntlm); /* This is used to generate a base64 encoded NTLM type-3 message */ CURLcode Curl_sasl_create_ntlm_type3_message(struct SessionHandle *data, const char *userp, const char *passwdp, struct ntlmdata *ntlm, char **outptr, size_t *outlen); #endif /* USE_NTLM */ /* This is used to generate a base64 encoded XOAUTH2 authentication message containing the user name and bearer token */ CURLcode Curl_sasl_create_xoauth2_message(struct SessionHandle *data, const char *user, const char *bearer, char **outptr, size_t *outlen); /* This is used to cleanup any libraries or curl modules used by the sasl functions */ void Curl_sasl_cleanup(struct connectdata *conn, unsigned int authused); #endif /* HEADER_CURL_SASL_H */ curl-7.35.0/lib/curl_memrchr.c0000644000175000017500000000342112213173003013060 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #include "curl_memrchr.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" #ifndef HAVE_MEMRCHR /* * Curl_memrchr() * * Our memrchr() function clone for systems which lack this function. The * memrchr() function is like the memchr() function, except that it searches * backwards from the end of the n bytes pointed to by s instead of forward * from the beginning. */ void * Curl_memrchr(const void *s, int c, size_t n) { const unsigned char *p = s; const unsigned char *q = s; p += n - 1; while(p >= q) { if(*p == (unsigned char)c) return (void *)p; p--; } return NULL; } #endif /* HAVE_MEMRCHR */ curl-7.35.0/lib/http_negotiate.c0000644000175000017500000002771412262353672013447 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_GSSAPI #ifdef HAVE_OLD_GSSMIT #define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name #define NCOMPAT 1 #endif #ifndef CURL_DISABLE_HTTP #include "urldata.h" #include "sendf.h" #include "curl_gssapi.h" #include "rawstr.h" #include "curl_base64.h" #include "http_negotiate.h" #include "curl_memory.h" #include "url.h" #ifdef HAVE_SPNEGO # include # ifdef USE_SSLEAY # ifdef USE_OPENSSL # include # else # include # endif # else # error "Can't compile SPNEGO support without OpenSSL." # endif #endif #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, bool proxy, gss_name_t *server) { struct negotiatedata *neg_ctx = proxy?&conn->data->state.proxyneg: &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(proxy ? conn->proxy.name : conn->host.name) + 1; if(token.length + 1 > sizeof(name)) return EMSGSIZE; snprintf(name, sizeof(name), "%s@%s", service, proxy ? conn->proxy.name : 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, const 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\n", buf); } /* returning zero (0) means success, everything else is treated as "failure" with no care exactly what the failure was */ int Curl_input_negotiate(struct connectdata *conn, bool proxy, const char *header) { struct SessionHandle *data = conn->data; struct negotiatedata *neg_ctx = proxy?&data->state.proxyneg: &data->state.negotiate; OM_uint32 major_status, minor_status, discard_st; gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER; gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER; int ret; size_t len; size_t rawlen = 0; bool gss; const char* protocol; CURLcode error; 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 successfully 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(data); return -1; } if(neg_ctx->server_name == NULL && (ret = get_gss_name(conn, proxy, &neg_ctx->server_name))) return ret; header += strlen(neg_ctx->protocol); while(*header && ISSPACE(*header)) header++; len = strlen(header); if(len > 0) { error = Curl_base64_decode(header, (unsigned char **)&input_token.value, &rawlen); if(error || rawlen == 0) return -1; input_token.length = rawlen; DEBUGASSERT(input_token.value != NULL); #ifdef HAVE_SPNEGO /* Handle SPNEGO */ if(checkprefix("Negotiate", header)) { unsigned char *spnegoToken = NULL; size_t spnegoTokenLength = 0; gss_buffer_desc mechToken = GSS_C_EMPTY_BUFFER; spnegoToken = malloc(input_token.length); if(spnegoToken == NULL) { Curl_safefree(input_token.value); return CURLE_OUT_OF_MEMORY; } memcpy(spnegoToken, input_token.value, input_token.length); spnegoTokenLength = input_token.length; if(!parseSpnegoTargetToken(spnegoToken, spnegoTokenLength, NULL, NULL, (unsigned char**)&mechToken.value, &mechToken.length, NULL, NULL)) { Curl_safefree(spnegoToken); infof(data, "Parse SPNEGO Target Token failed\n"); } else if(!mechToken.value || !mechToken.length) { Curl_safefree(spnegoToken); if(mechToken.value) gss_release_buffer(&discard_st, &mechToken); infof(data, "Parse SPNEGO Target Token succeeded (NULL token)\n"); } else { Curl_safefree(spnegoToken); Curl_safefree(input_token.value); input_token.value = malloc(mechToken.length); if(input_token.value == NULL) { gss_release_buffer(&discard_st, &mechToken); return CURLE_OUT_OF_MEMORY; } memcpy(input_token.value, mechToken.value, mechToken.length); input_token.length = mechToken.length; gss_release_buffer(&discard_st, &mechToken); infof(data, "Parse SPNEGO Target Token succeeded\n"); } } #endif } major_status = Curl_gss_init_sec_context(data, &minor_status, &neg_ctx->context, neg_ctx->server_name, GSS_C_NO_CHANNEL_BINDINGS, &input_token, &output_token, NULL); Curl_safefree(input_token.value); neg_ctx->status = major_status; if(GSS_ERROR(major_status)) { if(output_token.value) gss_release_buffer(&discard_st, &output_token); log_gss_error(conn, minor_status, "gss_init_sec_context() failed: "); return -1; } if(!output_token.value || !output_token.length) { if(output_token.value) gss_release_buffer(&discard_st, &output_token); return -1; } neg_ctx->output_token = output_token; return 0; } CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy) { struct negotiatedata *neg_ctx = proxy?&conn->data->state.proxyneg: &conn->data->state.negotiate; char *encoded = NULL; size_t len = 0; char *userp; CURLcode error; OM_uint32 discard_st; #ifdef HAVE_SPNEGO /* Handle SPNEGO */ if(checkprefix("Negotiate", neg_ctx->protocol)) { ASN1_OBJECT *object = NULL; unsigned char *responseToken = NULL; size_t responseTokenLength = 0; gss_buffer_desc spnegoToken = GSS_C_EMPTY_BUFFER; 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(!object) { Curl_safefree(responseToken); return CURLE_OUT_OF_MEMORY; } if(!makeSpnegoInitialToken(object, responseToken, responseTokenLength, (unsigned char**)&spnegoToken.value, &spnegoToken.length)) { Curl_safefree(responseToken); ASN1_OBJECT_free(object); infof(conn->data, "Make SPNEGO Initial Token failed\n"); } else if(!spnegoToken.value || !spnegoToken.length) { Curl_safefree(responseToken); ASN1_OBJECT_free(object); if(spnegoToken.value) gss_release_buffer(&discard_st, &spnegoToken); infof(conn->data, "Make SPNEGO Initial Token succeeded (NULL token)\n"); } else { Curl_safefree(responseToken); ASN1_OBJECT_free(object); gss_release_buffer(&discard_st, &neg_ctx->output_token); neg_ctx->output_token.value = spnegoToken.value; neg_ctx->output_token.length = spnegoToken.length; infof(conn->data, "Make SPNEGO Initial Token succeeded\n"); } } #endif error = Curl_base64_encode(conn->data, neg_ctx->output_token.value, neg_ctx->output_token.length, &encoded, &len); if(error) { gss_release_buffer(&discard_st, &neg_ctx->output_token); neg_ctx->output_token.value = NULL; neg_ctx->output_token.length = 0; return error; } if(!encoded || !len) { gss_release_buffer(&discard_st, &neg_ctx->output_token); neg_ctx->output_token.value = NULL; neg_ctx->output_token.length = 0; return CURLE_REMOTE_ACCESS_DENIED; } userp = aprintf("%sAuthorization: %s %s\r\n", proxy ? "Proxy-" : "", neg_ctx->protocol, encoded); if(proxy) { Curl_safefree(conn->allocptr.proxyuserpwd); conn->allocptr.proxyuserpwd = userp; } else { Curl_safefree(conn->allocptr.userpwd); conn->allocptr.userpwd = userp; } Curl_safefree(encoded); Curl_cleanup_negotiate(conn->data); return (userp == NULL) ? CURLE_OUT_OF_MEMORY : CURLE_OK; } static void cleanup(struct negotiatedata *neg_ctx) { OM_uint32 minor_status; 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.value) 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)); } void Curl_cleanup_negotiate(struct SessionHandle *data) { cleanup(&data->state.negotiate); cleanup(&data->state.proxyneg); } #endif #endif curl-7.35.0/lib/curl_rtmp.c0000644000175000017500000002600512213173003012410 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2010, Howard Chu, * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_LIBRTMP #include "urldata.h" #include "nonblock.h" /* for curlx_nonblock */ #include "progress.h" /* for Curl_pgrsSetUploadSize */ #include "transfer.h" #include "warnless.h" #include #include #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" #ifdef _WIN32 #define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e) #define SET_RCVTIMEO(tv,s) int tv = s*1000 #else #define SET_RCVTIMEO(tv,s) struct timeval tv = {s,0} #endif #define DEF_BUFTIME (2*60*60*1000) /* 2 hours */ static CURLcode rtmp_setup(struct connectdata *conn); static CURLcode rtmp_do(struct connectdata *conn, bool *done); static CURLcode rtmp_done(struct connectdata *conn, CURLcode, bool premature); static CURLcode rtmp_connect(struct connectdata *conn, bool *done); static CURLcode rtmp_disconnect(struct connectdata *conn, bool dead); static Curl_recv rtmp_recv; static Curl_send rtmp_send; /* * RTMP protocol handler.h, based on http://rtmpdump.mplayerhq.hu */ const struct Curl_handler Curl_handler_rtmp = { "RTMP", /* scheme */ rtmp_setup, /* setup_connection */ rtmp_do, /* do_it */ rtmp_done, /* done */ ZERO_NULL, /* do_more */ rtmp_connect, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ rtmp_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_RTMP, /* defport */ CURLPROTO_RTMP, /* protocol */ PROTOPT_NONE /* flags*/ }; const struct Curl_handler Curl_handler_rtmpt = { "RTMPT", /* scheme */ rtmp_setup, /* setup_connection */ rtmp_do, /* do_it */ rtmp_done, /* done */ ZERO_NULL, /* do_more */ rtmp_connect, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ rtmp_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_RTMPT, /* defport */ CURLPROTO_RTMPT, /* protocol */ PROTOPT_NONE /* flags*/ }; const struct Curl_handler Curl_handler_rtmpe = { "RTMPE", /* scheme */ rtmp_setup, /* setup_connection */ rtmp_do, /* do_it */ rtmp_done, /* done */ ZERO_NULL, /* do_more */ rtmp_connect, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ rtmp_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_RTMP, /* defport */ CURLPROTO_RTMPE, /* protocol */ PROTOPT_NONE /* flags*/ }; const struct Curl_handler Curl_handler_rtmpte = { "RTMPTE", /* scheme */ rtmp_setup, /* setup_connection */ rtmp_do, /* do_it */ rtmp_done, /* done */ ZERO_NULL, /* do_more */ rtmp_connect, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ rtmp_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_RTMPT, /* defport */ CURLPROTO_RTMPTE, /* protocol */ PROTOPT_NONE /* flags*/ }; const struct Curl_handler Curl_handler_rtmps = { "RTMPS", /* scheme */ rtmp_setup, /* setup_connection */ rtmp_do, /* do_it */ rtmp_done, /* done */ ZERO_NULL, /* do_more */ rtmp_connect, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ rtmp_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_RTMPS, /* defport */ CURLPROTO_RTMPS, /* protocol */ PROTOPT_NONE /* flags*/ }; const struct Curl_handler Curl_handler_rtmpts = { "RTMPTS", /* scheme */ rtmp_setup, /* setup_connection */ rtmp_do, /* do_it */ rtmp_done, /* done */ ZERO_NULL, /* do_more */ rtmp_connect, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ rtmp_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_RTMPS, /* defport */ CURLPROTO_RTMPTS, /* protocol */ PROTOPT_NONE /* flags*/ }; static CURLcode rtmp_setup(struct connectdata *conn) { RTMP *r = RTMP_Alloc(); if(!r) return CURLE_OUT_OF_MEMORY; RTMP_Init(r); RTMP_SetBufferMS(r, DEF_BUFTIME); if(!RTMP_SetupURL(r, conn->data->change.url)) { RTMP_Free(r); return CURLE_URL_MALFORMAT; } conn->proto.generic = r; return CURLE_OK; } static CURLcode rtmp_connect(struct connectdata *conn, bool *done) { RTMP *r = conn->proto.generic; SET_RCVTIMEO(tv,10); r->m_sb.sb_socket = conn->sock[FIRSTSOCKET]; /* We have to know if it's a write before we send the * connect request packet */ if(conn->data->set.upload) r->Link.protocol |= RTMP_FEATURE_WRITE; /* For plain streams, use the buffer toggle trick to keep data flowing */ if(!(r->Link.lFlags & RTMP_LF_LIVE) && !(r->Link.protocol & RTMP_FEATURE_HTTP)) r->Link.lFlags |= RTMP_LF_BUFX; curlx_nonblock(r->m_sb.sb_socket, FALSE); setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(tv)); if(!RTMP_Connect1(r, NULL)) return CURLE_FAILED_INIT; /* Clients must send a periodic BytesReceived report to the server */ r->m_bSendCounter = true; *done = TRUE; conn->recv[FIRSTSOCKET] = rtmp_recv; conn->send[FIRSTSOCKET] = rtmp_send; return CURLE_OK; } static CURLcode rtmp_do(struct connectdata *conn, bool *done) { RTMP *r = conn->proto.generic; if(!RTMP_ConnectStream(r, 0)) return CURLE_FAILED_INIT; if(conn->data->set.upload) { Curl_pgrsSetUploadSize(conn->data, conn->data->set.infilesize); Curl_setup_transfer(conn, -1, -1, FALSE, NULL, FIRSTSOCKET, NULL); } else Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, NULL, -1, NULL); *done = TRUE; return CURLE_OK; } static CURLcode rtmp_done(struct connectdata *conn, CURLcode status, bool premature) { (void)conn; /* unused */ (void)status; /* unused */ (void)premature; /* unused */ return CURLE_OK; } static CURLcode rtmp_disconnect(struct connectdata *conn, bool dead_connection) { RTMP *r = conn->proto.generic; (void)dead_connection; if(r) { conn->proto.generic = NULL; RTMP_Close(r); RTMP_Free(r); } return CURLE_OK; } static ssize_t rtmp_recv(struct connectdata *conn, int sockindex, char *buf, size_t len, CURLcode *err) { RTMP *r = conn->proto.generic; ssize_t nread; (void)sockindex; /* unused */ nread = RTMP_Read(r, buf, curlx_uztosi(len)); if(nread < 0) { if(r->m_read.status == RTMP_READ_COMPLETE || r->m_read.status == RTMP_READ_EOF) { conn->data->req.size = conn->data->req.bytecount; nread = 0; } else *err = CURLE_RECV_ERROR; } return nread; } static ssize_t rtmp_send(struct connectdata *conn, int sockindex, const void *buf, size_t len, CURLcode *err) { RTMP *r = conn->proto.generic; ssize_t num; (void)sockindex; /* unused */ num = RTMP_Write(r, (char *)buf, curlx_uztosi(len)); if(num < 0) *err = CURLE_SEND_ERROR; return num; } #endif /* USE_LIBRTMP */ curl-7.35.0/lib/mprintf.c0000644000175000017500000007113512270035364012076 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1999 - 2013, 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. * * * 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 "curl_setup.h" #if defined(DJGPP) && (DJGPP_MINOR < 4) #undef _MPRINTF_REPLACE /* don't use x_was_used() here */ #endif #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" #ifndef SIZEOF_LONG_DOUBLE #define SIZEOF_LONG_DOUBLE 0 #endif /* * If SIZEOF_SIZE_T has not been defined, default to the size of long. */ #ifndef SIZEOF_SIZE_T # define SIZEOF_SIZE_T CURL_SIZEOF_LONG #endif #ifdef HAVE_LONGLONG # define LONG_LONG_TYPE long long # define HAVE_LONG_LONG_TYPE #else # if defined(_MSC_VER) && (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64) # define LONG_LONG_TYPE __int64 # define HAVE_LONG_LONG_TYPE # else # undef LONG_LONG_TYPE # undef HAVE_LONG_LONG_TYPE # endif #endif /* * Non-ANSI integer extensions */ #if (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)) || \ (defined(__WATCOMC__) && defined(__386__)) || \ (defined(__POCC__) && defined(_MSC_VER)) || \ (defined(_WIN32_WCE)) || \ (defined(__MINGW32__)) || \ (defined(_MSC_VER) && (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)) # define MP_HAVE_INT_EXTENSIONS #endif /* * Max integer data types that mprintf.c is capable */ #ifdef HAVE_LONG_LONG_TYPE # define mp_intmax_t LONG_LONG_TYPE # define mp_uintmax_t unsigned LONG_LONG_TYPE #else # define mp_intmax_t long # define mp_uintmax_t unsigned long #endif #define BUFFSIZE 256 /* buffer for long-to-str and float-to-str calcs */ #define MAX_PARAMETERS 128 /* lame static limit */ #ifdef __AMIGA__ # 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_FALSE /* 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; /* conversion 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; union { mp_intmax_t as_signed; mp_uintmax_t as_unsigned; } num; 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 */ int fail; /* (!= 0) if an alloc has failed and thus the output is not the complete data */ }; 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(const char *fmt) { #if defined(MP_HAVE_INT_EXTENSIONS) if(!strncmp(fmt, "I32", 3) || !strncmp(fmt, "I64", 3)) { return TRUE; } #endif switch(*fmt) { 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': #if defined(MP_HAVE_INT_EXTENSIONS) case 'I': #endif return TRUE; default: return FALSE; } } /****************************************************************** * * Pass 1: * Create an index with the type of each parameter entry and its * value (may vary in size) * ******************************************************************/ static long dprintf_Pass1(const char *format, va_stack_t *vto, char **endpos, va_list arglist) { char *fmt = (char *)format; int param_num = 0; long this_param; long width; long precision; int flags; long max_param=0; long i; while(*fmt) { if(*fmt++ == '%') { if(*fmt == '%') { fmt++; continue; /* while */ } flags = FLAGS_NEW; /* Handle the positional case (N$) */ param_num++; this_param = dprintf_DollarString(fmt, &fmt); if(0 == this_param) /* we got no positional, get the next counter */ this_param = param_num; if(this_param > 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)) { #if defined(MP_HAVE_INT_EXTENSIONS) if(!strncmp(fmt, "I32", 3)) { flags |= FLAGS_LONG; fmt += 3; } else if(!strncmp(fmt, "I64", 3)) { flags |= FLAGS_LONGLONG; fmt += 3; } else #endif 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; #if defined(MP_HAVE_INT_EXTENSIONS) case 'I': #if (CURL_SIZEOF_CURL_OFF_T > CURL_SIZEOF_LONG) flags |= FLAGS_LONGLONG; #else flags |= FLAGS_LONG; #endif break; #endif 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 > CURL_SIZEOF_LONG) flags |= FLAGS_LONGLONG; #else flags |= FLAGS_LONG; #endif break; case 'O': #if (CURL_SIZEOF_CURL_OFF_T > CURL_SIZEOF_LONG) 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|FLAGS_UNSIGNED; break; case 'X': vto[i].type = FORMAT_INT; flags |= FLAGS_HEX|FLAGS_UPPER|FLAGS_UNSIGNED; 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 */ } } /* 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 = (long)vto[p->width].data.num.as_signed; else width = p->width; /* pick up the specified precision */ if(p->flags & FLAGS_PRECPARAM) { prec = (long)vto[p->precision].data.num.as_signed; param_num++; /* since the precision is extraced from a parameter, we must skip that to get to the next one properly */ } else if(p->flags & FLAGS_PREC) prec = p->precision; else prec = -1; is_alt = (p->flags & FLAGS_ALT) ? 1 : 0; switch (p->type) { case FORMAT_INT: num = p->data.num.as_unsigned; 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_OCTAL) { /* Octal unsigned integer. */ base = 8; goto unsigned_number; } else if(p->flags & FLAGS_HEX) { /* Hexadecimal unsigned integer. */ digits = (p->flags & FLAGS_UPPER)? upper_digits : lower_digits; base = 16; goto unsigned_number; } else if(p->flags & FLAGS_UNSIGNED) { /* Decimal unsigned integer. */ base = 10; goto unsigned_number; } /* Decimal integer. */ base = 10; is_neg = (p->data.num.as_signed < (mp_intmax_t)0) ? 1 : 0; if(is_neg) { /* signed_num might fail to hold absolute negative minimum by 1 */ signed_num = p->data.num.as_signed + (mp_intmax_t)1; signed_num = -signed_num; num = (mp_uintmax_t)signed_num; num += (mp_uintmax_t)1; } 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(is_alt && base == 8 && prec <= 0) { *w-- = '0'; --width; } if(prec > 0) { width -= prec; while(prec-- > 0) *w-- = '0'; } if(is_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(is_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 = (size_t)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; is_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 -= (long)(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 = &formatbuf[1]; 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 = (long)vto[p->width].data.num.as_signed; prec = -1; if(p->flags & FLAGS_PREC) prec = p->precision; else if(p->flags & FLAGS_PRECPARAM) prec = (long)vto[p->precision].data.num.as_signed; if(p->flags & FLAGS_LEFT) *fptr++ = '-'; if(p->flags & FLAGS_SHOWSIGN) *fptr++ = '+'; if(p->flags & FLAGS_SPACE) *fptr++ = ' '; if(p->flags & FLAGS_ALT) *fptr++ = '#'; *fptr = 0; 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; } if(p->flags & FLAGS_LONG) *fptr++ = 'l'; if(p->flags & FLAGS_FLOATE) *fptr++ = (char)((p->flags & FLAGS_UPPER) ? 'E':'e'); else if(p->flags & FLAGS_FLOATG) *fptr++ = (char)((p->flags & FLAGS_UPPER) ? 'G' : 'g'); else *fptr++ = 'f'; *fptr = 0; /* and a final zero termination */ /* NOTE NOTE NOTE!! Not all sprintf implementations return 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 HAVE_LONG_LONG_TYPE if(p->flags & FLAGS_LONGLONG) *(LONG_LONG_TYPE *) p->data.ptr = (LONG_LONG_TYPE)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 = malloc(32); if(!infop->buffer) { infop->fail = 1; return -1; /* fail */ } infop->alloc = 32; infop->len =0; } else if(infop->len+1 >= infop->alloc) { char *newptr; newptr = realloc(infop->buffer, infop->alloc*2); if(!newptr) { infop->fail = 1; return -1; /* fail */ } 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 = 0; 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 = 0; 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); } curl-7.35.0/lib/config-amigaos.h0000644000175000017500000001070512213173003013271 00000000000000#ifndef HEADER_CURL_CONFIG_AMIGAOS_H #define HEADER_CURL_CONFIG_AMIGAOS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ /* ================================================================ */ /* Hand crafted config file for AmigaOS */ /* ================================================================ */ #ifdef __AMIGA__ /* Any AmigaOS flavour */ #define HAVE_ARPA_INET_H 1 #define HAVE_CLOSESOCKET_CAMEL 1 #define HAVE_ERRNO_H 1 #define HAVE_GETHOSTBYADDR 1 #define HAVE_INET_ADDR 1 #define HAVE_INTTYPES_H 1 #define HAVE_IOCTLSOCKET_CAMEL 1 #define HAVE_IOCTLSOCKET_CAMEL_FIONBIO 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_SIGNAL_H 1 #define HAVE_SIG_ATOMIC_T 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_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 SIZEOF_INT 4 #define SIZEOF_SHORT 2 #define SIZEOF_SIZE_T 4 #define USE_MANUAL 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 STDC_HEADERS 1 #define TIME_WITH_SYS_TIME 1 #define in_addr_t int #ifndef F_OK # define F_OK 0 #endif #ifndef O_RDONLY # define O_RDONLY 0x0000 #endif #ifndef LONG_MAX # define LONG_MAX 0x7fffffffL #endif #ifndef LONG_MIN # define LONG_MIN (-0x7fffffffL-1) #endif #define HAVE_GETNAMEINFO 1 #define GETNAMEINFO_QUAL_ARG1 const #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * #define GETNAMEINFO_TYPE_ARG2 int #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_RECVFROM 1 #define RECVFROM_TYPE_ARG1 long #define RECVFROM_TYPE_ARG2 char #define RECVFROM_TYPE_ARG3 long #define RECVFROM_TYPE_ARG4 long #define RECVFROM_TYPE_ARG5 struct sockaddr #define RECVFROM_TYPE_ARG6 long #define RECVFROM_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 /* __AMIGA__ */ #endif /* HEADER_CURL_CONFIG_AMIGAOS_H */ curl-7.35.0/lib/dotdot.h0000644000175000017500000000214712262353672011724 00000000000000#ifndef HEADER_CURL_DOTDOT_H #define HEADER_CURL_DOTDOT_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ char *Curl_dedotdotify(char *input); #endif curl-7.35.0/lib/krb5.c0000644000175000017500000002272612262353672011272 00000000000000/* GSSAPI/krb5 support for FTP - loosely based on old krb4.c * * Copyright (c) 1995, 1996, 1997, 1998, 1999, 2013 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * Copyright (c) 2004 - 2012 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. */ #include "curl_setup.h" #ifndef CURL_DISABLE_FTP #ifdef HAVE_GSSAPI #ifdef HAVE_OLD_GSSMIT #define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name #define NCOMPAT 1 #endif #ifdef HAVE_NETDB_H #include #endif #include "urldata.h" #include "curl_base64.h" #include "ftp.h" #include "curl_gssapi.h" #include "sendf.h" #include "curl_sec.h" #include "curl_memory.h" #include "warnless.h" #define _MPRINTF_REPLACE /* use our functions only */ #include /* The last #include file should be: */ #include "memdebug.h" #define LOCAL_ADDR (&conn->local_addr) #define REMOTE_ADDR conn->ip_addr->ai_addr static int krb5_init(void *app_data) { gss_ctx_id_t *context = app_data; /* Make sure our context is initialized for krb5_end. */ *context = GSS_C_NO_CONTEXT; return 0; } static int krb5_check_prot(void *app_data, int level) { (void)app_data; /* unused */ if(level == PROT_CONFIDENTIAL) return -1; return 0; } static int krb5_decode(void *app_data, void *buf, int len, int level UNUSED_PARAM, struct connectdata *conn UNUSED_PARAM) { gss_ctx_id_t *context = app_data; OM_uint32 maj, min; gss_buffer_desc enc, dec; (void)level; (void)conn; enc.value = buf; enc.length = len; maj = gss_unseal(&min, *context, &enc, &dec, NULL, NULL); if(maj != GSS_S_COMPLETE) { if(len >= 4) strcpy(buf, "599 "); return -1; } memcpy(buf, dec.value, dec.length); len = curlx_uztosi(dec.length); gss_release_buffer(&min, &dec); return len; } static int krb5_overhead(void *app_data, int level, int len) { /* no arguments are used */ (void)app_data; (void)level; (void)len; return 0; } static int krb5_encode(void *app_data, const void *from, int length, int level, void **to, struct connectdata *conn UNUSED_PARAM) { gss_ctx_id_t *context = app_data; gss_buffer_desc dec, enc; OM_uint32 maj, min; int state; int len; /* shut gcc up */ conn = NULL; /* NOTE that the cast is safe, neither of the krb5, gnu gss and heimdal * libraries modify the input buffer in gss_seal() */ dec.value = (void*)from; dec.length = length; maj = gss_seal(&min, *context, level == PROT_PRIVATE, GSS_C_QOP_DEFAULT, &dec, &state, &enc); if(maj != GSS_S_COMPLETE) return -1; /* malloc a new buffer, in case gss_release_buffer doesn't work as expected */ *to = malloc(enc.length); if(!*to) return -1; memcpy(*to, enc.value, enc.length); len = curlx_uztosi(enc.length); gss_release_buffer(&min, &enc); return len; } static int krb5_auth(void *app_data, struct connectdata *conn) { int ret = AUTH_OK; char *p; const char *host = conn->host.name; ssize_t nread; curl_socklen_t l = sizeof(conn->local_addr); struct SessionHandle *data = conn->data; CURLcode result; const char *service = "ftp", *srv_host = "host"; gss_buffer_desc input_buffer, output_buffer, _gssresp, *gssresp; OM_uint32 maj, min; gss_name_t gssname; gss_ctx_id_t *context = app_data; struct gss_channel_bindings_struct chan; size_t base64_sz = 0; if(getsockname(conn->sock[FIRSTSOCKET], (struct sockaddr *)LOCAL_ADDR, &l) < 0) perror("getsockname()"); chan.initiator_addrtype = GSS_C_AF_INET; chan.initiator_address.length = l - 4; chan.initiator_address.value = &((struct sockaddr_in *)LOCAL_ADDR)->sin_addr.s_addr; chan.acceptor_addrtype = GSS_C_AF_INET; chan.acceptor_address.length = l - 4; chan.acceptor_address.value = &((struct sockaddr_in *)REMOTE_ADDR)->sin_addr.s_addr; chan.application_data.length = 0; chan.application_data.value = NULL; /* this loop will execute twice (once for service, once for host) */ for(;;) { /* this really shouldn't be repeated here, but can't help it */ if(service == srv_host) { result = Curl_ftpsendf(conn, "AUTH GSSAPI"); if(result) return -2; if(Curl_GetFTPResponse(&nread, conn, NULL)) return -1; if(data->state.buffer[0] != '3') return -1; } input_buffer.value = data->state.buffer; input_buffer.length = snprintf(input_buffer.value, BUFSIZE, "%s@%s", service, host); maj = gss_import_name(&min, &input_buffer, GSS_C_NT_HOSTBASED_SERVICE, &gssname); if(maj != GSS_S_COMPLETE) { gss_release_name(&min, &gssname); if(service == srv_host) { Curl_failf(data, "Error importing service name %s", input_buffer.value); return AUTH_ERROR; } service = srv_host; continue; } /* We pass NULL as |output_name_type| to avoid a leak. */ gss_display_name(&min, gssname, &output_buffer, NULL); Curl_infof(data, "Trying against %s\n", output_buffer.value); gssresp = GSS_C_NO_BUFFER; *context = GSS_C_NO_CONTEXT; do { /* Release the buffer at each iteration to avoid leaking: the first time we are releasing the memory from gss_display_name. The last item is taken care by a final gss_release_buffer. */ gss_release_buffer(&min, &output_buffer); ret = AUTH_OK; maj = Curl_gss_init_sec_context(data, &min, context, gssname, &chan, gssresp, &output_buffer, NULL); if(gssresp) { free(_gssresp.value); gssresp = NULL; } if(GSS_ERROR(maj)) { Curl_infof(data, "Error creating security context\n"); ret = AUTH_ERROR; break; } if(output_buffer.length != 0) { result = Curl_base64_encode(data, (char *)output_buffer.value, output_buffer.length, &p, &base64_sz); if(result) { Curl_infof(data,"base64-encoding: %s\n", curl_easy_strerror(result)); ret = AUTH_CONTINUE; break; } result = Curl_ftpsendf(conn, "ADAT %s", p); free(p); if(result) { ret = -2; break; } if(Curl_GetFTPResponse(&nread, conn, NULL)) { ret = -1; break; } if(data->state.buffer[0] != '2' && data->state.buffer[0] != '3') { Curl_infof(data, "Server didn't accept auth data\n"); ret = AUTH_ERROR; break; } p = data->state.buffer + 4; p = strstr(p, "ADAT="); if(p) { result = Curl_base64_decode(p + 5, (unsigned char **)&_gssresp.value, &_gssresp.length); if(result) { Curl_failf(data,"base64-decoding: %s", curl_easy_strerror(result)); ret = AUTH_CONTINUE; break; } } gssresp = &_gssresp; } } while(maj == GSS_S_CONTINUE_NEEDED); gss_release_name(&min, &gssname); gss_release_buffer(&min, &output_buffer); if(gssresp) free(_gssresp.value); if(ret == AUTH_OK || service == srv_host) return ret; service = srv_host; } return ret; } static void krb5_end(void *app_data) { OM_uint32 min; gss_ctx_id_t *context = app_data; if(*context != GSS_C_NO_CONTEXT) { #ifdef DEBUGBUILD OM_uint32 maj = #endif gss_delete_sec_context(&min, context, GSS_C_NO_BUFFER); DEBUGASSERT(maj == GSS_S_COMPLETE); } } struct Curl_sec_client_mech Curl_krb5_client_mech = { "GSSAPI", sizeof(gss_ctx_id_t), krb5_init, krb5_auth, krb5_end, krb5_check_prot, krb5_overhead, krb5_encode, krb5_decode }; #endif /* HAVE_GSSAPI */ #endif /* CURL_DISABLE_FTP */ curl-7.35.0/lib/curl_multibyte.h0000644000175000017500000000620212213173003013446 00000000000000#ifndef HEADER_CURL_MULTIBYTE_H #define HEADER_CURL_MULTIBYTE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(USE_WIN32_IDN) || (defined(USE_WINDOWS_SSPI) && defined(UNICODE)) /* * MultiByte conversions using Windows kernel32 library. */ wchar_t *Curl_convert_UTF8_to_wchar(const char *str_utf8); char *Curl_convert_wchar_to_UTF8(const wchar_t *str_w); #endif /* USE_WIN32_IDN || (USE_WINDOWS_SSPI && UNICODE) */ #if defined(USE_WIN32_IDN) || defined(USE_WINDOWS_SSPI) /* * Macros Curl_convert_UTF8_to_tchar(), Curl_convert_tchar_to_UTF8() * and Curl_unicodefree() main purpose is to minimize the number of * preprocessor conditional directives needed by code using these * to differentiate UNICODE from non-UNICODE builds. * * When building with UNICODE defined, this two macros * Curl_convert_UTF8_to_tchar() and Curl_convert_tchar_to_UTF8() * return a pointer to a newly allocated memory area holding result. * When the result is no longer needed, allocated memory is intended * to be free'ed with Curl_unicodefree(). * * When building without UNICODE defined, this macros * Curl_convert_UTF8_to_tchar() and Curl_convert_tchar_to_UTF8() * return the pointer received as argument. Curl_unicodefree() does * no actual free'ing of this pointer it is simply set to NULL. */ #ifdef UNICODE #define Curl_convert_UTF8_to_tchar(ptr) Curl_convert_UTF8_to_wchar((ptr)) #define Curl_convert_tchar_to_UTF8(ptr) Curl_convert_wchar_to_UTF8((ptr)) #define Curl_unicodefree(ptr) \ do {if((ptr)) {free((ptr)); (ptr) = NULL;}} WHILE_FALSE typedef union { unsigned short *tchar_ptr; const unsigned short *const_tchar_ptr; unsigned short *tbyte_ptr; const unsigned short *const_tbyte_ptr; } xcharp_u; #else #define Curl_convert_UTF8_to_tchar(ptr) (ptr) #define Curl_convert_tchar_to_UTF8(ptr) (ptr) #define Curl_unicodefree(ptr) \ do {(ptr) = NULL;} WHILE_FALSE typedef union { char *tchar_ptr; const char *const_tchar_ptr; unsigned char *tbyte_ptr; const unsigned char *const_tbyte_ptr; } xcharp_u; #endif /* UNICODE */ #endif /* USE_WIN32_IDN || USE_WINDOWS_SSPI */ #endif /* HEADER_CURL_MULTIBYTE_H */ curl-7.35.0/lib/curl_gethostname.h0000644000175000017500000000244212213173003013750 00000000000000#ifndef HEADER_CURL_GETHOSTNAME_H #define HEADER_CURL_GETHOSTNAME_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ /* Hostname buffer size */ #define HOSTNAME_MAX 1024 /* This returns the local machine's un-qualified hostname */ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen); #endif /* HEADER_CURL_GETHOSTNAME_H */ curl-7.35.0/lib/CMakeLists.txt0000644000175000017500000000573012262353672013017 00000000000000set(LIB_NAME libcurl) configure_file(${CURL_SOURCE_DIR}/include/curl/curlbuild.h.cmake ${CURL_BINARY_DIR}/include/curl/curlbuild.h) configure_file(curl_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/curl_config.h) transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake) list(APPEND HHEADERS ${CMAKE_CURRENT_BINARY_DIR}/curl_config.h ${CURL_BINARY_DIR}/include/curl/curlbuild.h ) if(MSVC) list(APPEND CSOURCES libcurl.rc) endif() # SET(CSOURCES # # memdebug.c -not used # # nwlib.c - Not used # # strtok.c - specify later # # strtoofft.c - specify later # ) # # if we have Kerberos 4, right now this is never on # #OPTION(CURL_KRB4 "Use Kerberos 4" OFF) # IF(CURL_KRB4) # SET(CSOURCES ${CSOURCES} # krb4.c # security.c # ) # ENDIF(CURL_KRB4) # #OPTION(CURL_MALLOC_DEBUG "Debug mallocs in Curl" OFF) # MARK_AS_ADVANCED(CURL_MALLOC_DEBUG) # IF(CURL_MALLOC_DEBUG) # SET(CSOURCES ${CSOURCES} # memdebug.c # ) # ENDIF(CURL_MALLOC_DEBUG) # # only build compat strtoofft if we need to # IF(NOT HAVE_STRTOLL AND NOT HAVE__STRTOI64) # SET(CSOURCES ${CSOURCES} # strtoofft.c # ) # ENDIF(NOT HAVE_STRTOLL AND NOT HAVE__STRTOI64) if(HAVE_FEATURES_H) set_source_files_properties( cookie.c easy.c formdata.c getenv.c nonblock.c hash.c http.c if2ip.c mprintf.c multi.c sendf.c telnet.c transfer.c url.c COMPILE_FLAGS -D_BSD_SOURCE) endif(HAVE_FEATURES_H) # The rest of the build include_directories(${CMAKE_CURRENT_BINARY_DIR}/../include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include) include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) if(CURL_USE_ARES) include_directories(${CARES_INCLUDE_DIR}) endif() if(CURL_STATICLIB) # Static lib set(CURL_USER_DEFINED_DYNAMIC_OR_STATIC STATIC) else() # DLL / so dynamic lib set(CURL_USER_DEFINED_DYNAMIC_OR_STATIC SHARED) endif() add_library( ${LIB_NAME} ${CURL_USER_DEFINED_DYNAMIC_OR_STATIC} ${HHEADERS} ${CSOURCES} ) if(MSVC AND CURL_STATICLIB) set_target_properties(${LIB_NAME} PROPERTIES STATIC_LIBRARY_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) endif() target_link_libraries(${LIB_NAME} ${CURL_LIBS}) if(WIN32) add_definitions( -D_USRDLL ) endif() set_target_properties(${LIB_NAME} PROPERTIES COMPILE_DEFINITIONS BUILDING_LIBCURL) setup_curl_dependencies(${LIB_NAME}) # Remove the "lib" prefix since the library is already named "libcurl". set_target_properties(${LIB_NAME} PROPERTIES PREFIX "") set_target_properties(${LIB_NAME} PROPERTIES IMPORT_PREFIX "") if(WIN32) if(NOT CURL_STATICLIB) # Add "_imp" as a suffix before the extension to avoid conflicting with the statically linked "libcurl.lib" set_target_properties(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib") endif() endif() install(TARGETS ${LIB_NAME} DESTINATION lib) curl-7.35.0/lib/socks.c0000644000175000017500000005747612262353672011563 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #if !defined(CURL_DISABLE_PROXY) #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_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... */ int Curl_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 */ { ssize_t nread; ssize_t allread = 0; int result; long timeleft; *n = 0; for(;;) { timeleft = Curl_timeleft(conn->data, NULL, TRUE); if(timeleft < 0) { /* we already got the timeout */ result = CURLE_OPERATION_TIMEDOUT; break; } if(Curl_socket_ready(sockfd, CURL_SOCKET_BAD, timeleft) <= 0) { result = ~CURLE_OK; break; } result = Curl_read_plain(sockfd, buf, buffersize, &nread); if(CURLE_AGAIN == result) continue; else if(result) break; if(buffersize == nread) { allread += nread; *n = allread; result = CURLE_OK; break; } if(!nread) { result = ~CURLE_OK; break; } buffersize -= nread; buf += nread; allread += nread; } 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 : * Set protocol4a=true for "SOCKS 4A (Simple Extension to SOCKS 4 Protocol)" * Nonsupport "Identification Protocol (RFC1413)" */ CURLcode Curl_SOCKS4(const char *proxy_name, const char *hostname, int remote_port, int sockindex, struct connectdata *conn, bool protocol4a) { #define SOCKS4REQLEN 262 unsigned char socksreq[SOCKS4REQLEN]; /* room for SOCKS4 request incl. user id */ int result; CURLcode code; curl_socket_t sock = conn->sock[sockindex]; struct SessionHandle *data = conn->data; if(Curl_timeleft(data, NULL, TRUE) < 0) { /* time-out, bail out, go home */ failf(data, "Connection time-out"); return CURLE_OPERATION_TIMEDOUT; } curlx_nonblock(sock, FALSE); infof(data, "SOCKS4 communication to %s:%d\n", hostname, remote_port); /* * 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 */ socksreq[2] = (unsigned char)((remote_port >> 8) & 0xff); /* PORT MSB */ socksreq[3] = (unsigned char)(remote_port & 0xff); /* PORT LSB */ /* DNS resolve only for SOCKS4, not SOCKS4a */ if(!protocol4a) { struct Curl_dns_entry *dns; Curl_addrinfo *hp=NULL; int rc; rc = Curl_resolv(conn, hostname, remote_port, &dns); if(rc == CURLRESOLV_ERROR) return CURLE_COULDNT_RESOLVE_PROXY; if(rc == CURLRESOLV_PENDING) /* ignores the return code, but 'dns' remains NULL on failure */ (void)Curl_resolver_wait_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! */ infof(data, "SOCKS4 connect to %s (locally resolved)\n", buf); Curl_resolv_unlock(data, dns); /* not used anymore from now on */ } if(!hp) { failf(data, "Failed to resolve \"%s\" for SOCKS4 connect.", hostname); 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) { size_t plen = strlen(proxy_name); if(plen >= sizeof(socksreq) - 8) { failf(data, "Too long SOCKS proxy name, can't use!\n"); return CURLE_COULDNT_CONNECT; } /* copy the proxy name WITH trailing zero */ memcpy(socksreq + 8, proxy_name, plen+1); } /* * Make connection */ { ssize_t actualread; ssize_t written; ssize_t hostnamelen = 0; int packetsize = 9 + (int)strlen((char*)socksreq + 8); /* size including NUL */ /* If SOCKS4a, set special invalid IP address 0.0.0.x */ if(protocol4a) { socksreq[4] = 0; socksreq[5] = 0; socksreq[6] = 0; socksreq[7] = 1; /* If still enough room in buffer, also append hostname */ hostnamelen = (ssize_t)strlen(hostname) + 1; /* length including NUL */ if(packetsize + hostnamelen <= SOCKS4REQLEN) strcpy((char*)socksreq + packetsize, hostname); else hostnamelen = 0; /* Flag: hostname did not fit in buffer */ } /* Send request */ code = Curl_write_plain(conn, sock, (char *)socksreq, packetsize + hostnamelen, &written); if((code != CURLE_OK) || (written != packetsize + hostnamelen)) { failf(data, "Failed to send SOCKS4 connect request."); return CURLE_COULDNT_CONNECT; } if(protocol4a && hostnamelen == 0) { /* SOCKS4a with very long hostname - send that name separately */ hostnamelen = (ssize_t)strlen(hostname) + 1; code = Curl_write_plain(conn, sock, (char *)hostname, hostnamelen, &written); if((code != CURLE_OK) || (written != hostnamelen)) { failf(data, "Failed to send SOCKS4 connect request."); return CURLE_COULDNT_CONNECT; } } packetsize = 8; /* receive data size */ /* Receive response */ result = Curl_blockread_all(conn, sock, (char *)socksreq, packetsize, &actualread); 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%s request granted.\n", protocol4a?"a":""); 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], ((socksreq[8] << 8) | socksreq[9]), 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], ((socksreq[8] << 8) | socksreq[9]), 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], ((socksreq[8] << 8) | socksreq[9]), 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], ((socksreq[8] << 8) | socksreq[9]), socksreq[1]); return CURLE_COULDNT_CONNECT; } } curlx_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, const char *hostname, int remote_port, int sockindex, 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[sockindex]; struct SessionHandle *data = conn->data; long timeout; bool socks5_resolve_local = (conn->proxytype == CURLPROXY_SOCKS5)?TRUE:FALSE; const size_t hostname_len = strlen(hostname); ssize_t len = 0; /* RFC1928 chapter 5 specifies max 255 chars for domain name in packet */ if(!socks5_resolve_local && hostname_len > 255) { infof(conn->data,"SOCKS5: server resolving disabled for hostnames of " "length > 255 [actual len=%zu]\n", hostname_len); socks5_resolve_local = TRUE; } /* get timeout */ timeout = Curl_timeleft(data, NULL, TRUE); if(timeout < 0) { /* time-out, bail out, go home */ failf(data, "Connection time-out"); return CURLE_OPERATION_TIMEDOUT; } curlx_nonblock(sock, TRUE); /* wait until socket gets connected */ result = Curl_socket_ready(CURL_SOCKET_BAD, sock, 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 & CURL_CSELECT_ERR) { failf(conn->data, "SOCKS5: error occurred during connection"); return CURLE_COULDNT_CONNECT; } socksreq[0] = 5; /* version */ #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) socksreq[1] = (char)(proxy_name ? 3 : 2); /* number of methods (below) */ socksreq[2] = 0; /* no authentication */ socksreq[3] = 1; /* gssapi */ socksreq[4] = 2; /* username/password */ #else socksreq[1] = (char)(proxy_name ? 2 : 1); /* number of methods (below) */ socksreq[2] = 0; /* no authentication */ socksreq[3] = 2; /* username/password */ #endif curlx_nonblock(sock, FALSE); code = Curl_write_plain(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; } curlx_nonblock(sock, TRUE); result = Curl_socket_ready(sock, CURL_SOCKET_BAD, 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 & CURL_CSELECT_ERR) { failf(conn->data, "SOCKS5 read error occurred"); return CURLE_RECV_ERROR; } curlx_nonblock(sock, FALSE); result=Curl_blockread_all(conn, sock, (char *)socksreq, 2, &actualread); 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 */ ; } #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) else if(socksreq[1] == 1) { code = Curl_SOCKS5_gssapi_negotiate(sockindex, conn); if(code != CURLE_OK) { failf(data, "Unable to negotiate SOCKS5 gssapi context."); return CURLE_COULDNT_CONNECT; } } #endif else if(socksreq[1] == 2) { /* Needs user name and password */ size_t proxy_name_len, proxy_password_len; if(proxy_name && proxy_password) { proxy_name_len = strlen(proxy_name); proxy_password_len = strlen(proxy_password); } else { proxy_name_len = 0; proxy_password_len = 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++] = (unsigned char) proxy_name_len; if(proxy_name && proxy_name_len) memcpy(socksreq + len, proxy_name, proxy_name_len); len += proxy_name_len; socksreq[len++] = (unsigned char) proxy_password_len; if(proxy_password && proxy_password_len) memcpy(socksreq + len, proxy_password, proxy_password_len); len += proxy_password_len; code = Curl_write_plain(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=Curl_blockread_all(conn, sock, (char *)socksreq, 2, &actualread); 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 defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) if(socksreq[1] == 255) { #else if(socksreq[1] == 1) { failf(data, "SOCKS5 GSSAPI per-message authentication is not supported."); return CURLE_COULDNT_CONNECT; } else if(socksreq[1] == 255) { #endif 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 */ len = 0; socksreq[len++] = 5; /* version (SOCKS5) */ socksreq[len++] = 1; /* connect */ socksreq[len++] = 0; /* must be zero */ if(!socks5_resolve_local) { socksreq[len++] = 3; /* ATYP: domain name = 3 */ socksreq[len++] = (char) hostname_len; /* address length */ memcpy(&socksreq[len], hostname, hostname_len); /* address str w/o NULL */ len += hostname_len; } else { struct Curl_dns_entry *dns; Curl_addrinfo *hp = NULL; int rc = Curl_resolv(conn, hostname, 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 */ code = Curl_resolver_wait_resolv(conn, &dns); if(code != CURLE_OK) return code; } /* * 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) { struct sockaddr_in *saddr_in; #ifdef ENABLE_IPV6 struct sockaddr_in6 *saddr_in6; #endif int i; if(hp->ai_family == AF_INET) { socksreq[len++] = 1; /* ATYP: IPv4 = 1 */ saddr_in = (struct sockaddr_in*)hp->ai_addr; for(i = 0; i < 4; i++) { socksreq[len++] = ((unsigned char*)&saddr_in->sin_addr.s_addr)[i]; infof(data, "%d\n", socksreq[len-1]); } } #ifdef ENABLE_IPV6 else if(hp->ai_family == AF_INET6) { socksreq[len++] = 4; /* ATYP: IPv6 = 4 */ saddr_in6 = (struct sockaddr_in6*)hp->ai_addr; for(i = 0; i < 16; i++) { socksreq[len++] = ((unsigned char*)&saddr_in6->sin6_addr.s6_addr)[i]; } } #endif 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.", hostname); return CURLE_COULDNT_RESOLVE_HOST; } } socksreq[len++] = (unsigned char)((remote_port >> 8) & 0xff); /* PORT MSB */ socksreq[len++] = (unsigned char)(remote_port & 0xff); /* PORT LSB */ #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) if(conn->socks5_gssapi_enctype) { failf(data, "SOCKS5 gssapi protection not yet implemented."); } else #endif code = Curl_write_plain(conn, sock, (char *)socksreq, len, &written); if((code != CURLE_OK) || (len != written)) { failf(data, "Failed to send SOCKS5 connect request."); return CURLE_COULDNT_CONNECT; } len = 10; /* minimum packet size is 10 */ #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) if(conn->socks5_gssapi_enctype) { failf(data, "SOCKS5 gssapi protection not yet implemented."); } else #endif result = Curl_blockread_all(conn, sock, (char *)socksreq, len, &actualread); if((result != CURLE_OK) || (len != actualread)) { 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 */ if(socksreq[3] == 1) { 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], ((socksreq[8] << 8) | socksreq[9]), socksreq[1]); } else if(socksreq[3] == 3) { failf(data, "Can't complete SOCKS5 connection to %s:%d. (%d)", hostname, ((socksreq[8] << 8) | socksreq[9]), socksreq[1]); } else if(socksreq[3] == 4) { failf(data, "Can't complete SOCKS5 connection to %02x%02x:%02x%02x:" "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%d. (%d)", (unsigned char)socksreq[4], (unsigned char)socksreq[5], (unsigned char)socksreq[6], (unsigned char)socksreq[7], (unsigned char)socksreq[8], (unsigned char)socksreq[9], (unsigned char)socksreq[10], (unsigned char)socksreq[11], (unsigned char)socksreq[12], (unsigned char)socksreq[13], (unsigned char)socksreq[14], (unsigned char)socksreq[15], (unsigned char)socksreq[16], (unsigned char)socksreq[17], (unsigned char)socksreq[18], (unsigned char)socksreq[19], ((socksreq[8] << 8) | socksreq[9]), socksreq[1]); } return CURLE_COULDNT_CONNECT; } /* Fix: in general, returned BND.ADDR is variable length parameter by RFC 1928, so the reply packet should be read until the end to avoid errors at subsequent protocol level. +----+-----+-------+------+----------+----------+ |VER | REP | RSV | ATYP | BND.ADDR | BND.PORT | +----+-----+-------+------+----------+----------+ | 1 | 1 | X'00' | 1 | Variable | 2 | +----+-----+-------+------+----------+----------+ ATYP: o IP v4 address: X'01', BND.ADDR = 4 byte o domain name: X'03', BND.ADDR = [ 1 byte length, string ] o IP v6 address: X'04', BND.ADDR = 16 byte */ /* Calculate real packet size */ if(socksreq[3] == 3) { /* domain name */ int addrlen = (int) socksreq[4]; len = 5 + addrlen + 2; } else if(socksreq[3] == 4) { /* IPv6 */ len = 4 + 16 + 2; } /* At this point we already read first 10 bytes */ #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) if(!conn->socks5_gssapi_enctype) { /* decrypt_gssapi_blockread already read the whole packet */ #endif if(len > 10) { len -= 10; result = Curl_blockread_all(conn, sock, (char *)&socksreq[10], len, &actualread); if((result != CURLE_OK) || (len != actualread)) { failf(data, "Failed to receive SOCKS5 connect request ack."); return CURLE_COULDNT_CONNECT; } } #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) } #endif curlx_nonblock(sock, TRUE); return CURLE_OK; /* Proxy was successful! */ } #endif /* CURL_DISABLE_PROXY */ curl-7.35.0/lib/getinfo.h0000644000175000017500000000233412213173003012040 00000000000000#ifndef HEADER_CURL_GETINFO_H #define HEADER_CURL_GETINFO_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...); CURLcode Curl_initinfo(struct SessionHandle *data); #endif /* HEADER_CURL_GETINFO_H */ curl-7.35.0/lib/hostip.c0000644000175000017500000005743512272020134011723 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef __VMS #include #include #endif #ifdef HAVE_SETJMP_H #include #endif #ifdef HAVE_SIGNAL_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" #include "warnless.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" #if defined(CURLRES_SYNCH) && \ defined(HAVE_ALARM) && defined(SIGALRM) && defined(HAVE_SIGSETJMP) /* alarm-based timeouts can only be used with all the dependencies satisfied */ #define USE_ALARM_TIMEOUT #endif /* * 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 * hostip4.c - ipv4-specific functions * hostip6.c - ipv6-specific functions * * The two asynchronous name resolver backends are implemented in: * asyn-ares.c - functions for ares-using name resolves * asyn-thread.c - functions for threaded name resolves * The hostip.h is the united header file for all this. It defines the * CURLRES_* defines based on the config*.h and curl_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! * * Returns a struct curl_hash pointer on success, NULL on failure. */ struct curl_hash *Curl_global_host_cache_init(void) { int rc = 0; if(!host_cache_initialized) { rc = Curl_hash_init(&hostname_cache, 7, Curl_hash_str, Curl_str_key_compare, freednsentry); if(!rc) host_cache_initialized = 1; } return rc?NULL:&hostname_cache; } /* * Destroy and cleanup the global DNS cache */ void Curl_global_host_cache_dtor(void) { if(host_cache_initialized) { /* first make sure that any custom "CURLOPT_RESOLVE" names are cleared off */ Curl_hostcache_clean(NULL, &hostname_cache); /* then free the remaining hash completely */ 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 = 0; while(addr) { addr = addr->ai_next; i++; } return i; } /* * Curl_printable_address() returns a printable version of the 1st address * given in the 'ai' 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 *ai, char *buf, size_t bufsize) { const struct sockaddr_in *sa4; const struct in_addr *ipaddr4; #ifdef ENABLE_IPV6 const struct sockaddr_in6 *sa6; const struct in6_addr *ipaddr6; #endif switch (ai->ai_family) { case AF_INET: sa4 = (const void *)ai->ai_addr; ipaddr4 = &sa4->sin_addr; return Curl_inet_ntop(ai->ai_family, (const void *)ipaddr4, buf, bufsize); #ifdef ENABLE_IPV6 case AF_INET6: sa6 = (const void *)ai->ai_addr; ipaddr6 = &sa6->sin6_addr; return Curl_inet_ntop(ai->ai_family, (const void *)ipaddr6, buf, bufsize); #endif default: break; } return NULL; } /* * Return a hostcache id string for the provided host + port, to be used by * the DNS caching. */ static char * create_hostcache_id(const char *name, int port) { /* create and return the new allocated entry */ char *id = aprintf("%s:%d", name, port); char *ptr = id; if(ptr) { /* lower case the name part */ while(*ptr && (*ptr != ':')) { *ptr = (char)TOLOWER(*ptr); ptr++; } } return id; } struct hostcache_prune_data { long 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; return !c->inuse && (data->now - c->timestamp >= data->cache_timeout); } /* * Prune the DNS cache. This assumes that a lock has already been taken. */ static void hostcache_prune(struct curl_hash *hostcache, long 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); } /* * Check if the entry should be pruned. Assumes a locked cache. */ 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 || dns->inuse) /* cache forever means never prune, and NULL hostcache means we can't do it, if it still is in use then we leave it */ return 0; time(&user.now); user.cache_timeout = data->set.dns_cache_timeout; if(!hostcache_timestamp_remove(&user,dns) ) return 0; Curl_hash_clean_with_criterium(data->dns.hostcache, (void *) &user, hostcache_timestamp_remove); 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; /* 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 = calloc(1, sizeof(struct Curl_dns_entry)); if(!dns) { free(entry_id); return NULL; } dns->inuse = 0; /* init to not used */ dns->addr = addr; /* this is the address(es) */ time(&dns->timestamp); if(dns->timestamp == 0) dns->timestamp = 1; /* zero indicates that entry isn't in hash table */ /* Store the resolved data in our DNS cache. */ dns2 = Curl_hash_add(data->dns.hostcache, entry_id, entry_len+1, (void *)dns); if(!dns2) { free(dns); free(entry_id); return NULL; } dns = dns2; dns->inuse++; /* mark entry as in-use */ /* free the allocated entry_id */ 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. * * In debug mode, we specifically test for an interface name "LocalHost" * and resolve "localhost" instead as a means to permit test cases * to connect to a local test server with any host name. * * 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; struct SessionHandle *data = conn->data; CURLcode result; int rc = CURLRESOLV_ERROR; /* default to failure */ *entry = NULL; /* 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 rc; 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); /* free the allocated entry_id again */ free(entry_id); infof(data, "Hostname was %sfound in DNS cache\n", dns?"":"NOT "); /* See whether the returned entry is stale. Done before we release lock */ if(remove_entry_if_stale(data, dns)) { infof(data, "Hostname in DNS cache was stale, zapped\n"); dns = NULL; /* the memory deallocation is being handled by the hash */ } if(dns) { dns->inuse++; /* we use it! */ rc = CURLRESOLV_RESOLVED; } if(data->share) Curl_share_unlock(data, CURL_LOCK_DATA_DNS); if(!dns) { /* The entry was not in the cache. Resolve it to IP address */ Curl_addrinfo *addr; int respwait; /* Check what IP specifics the app has requested and if we can provide it. * If not, bail out. */ if(!Curl_ipvalid(conn)) return CURLRESOLV_ERROR; /* If Curl_getaddrinfo() returns NULL, 'respwait' 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, #ifdef DEBUGBUILD (data->set.str[STRING_DEVICE] && !strcmp(data->set.str[STRING_DEVICE], "LocalHost"))?"localhost": #endif hostname, port, &respwait); if(!addr) { if(respwait) { /* 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_resolver_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; } } *entry = dns; return rc; } #ifdef USE_ALARM_TIMEOUT /* * This signal handler jumps back into the main libcurl code and continues * execution. This effectively causes the remainder of the application to run * within a signal handler which is nonportable and could lead to problems. */ static RETSIGTYPE alarmfunc(int sig) { /* this is for "-ansi -Wall -pedantic" to stop complaining! (rabe) */ (void)sig; siglongjmp(curl_jmpenv, 1); return; } #endif /* USE_ALARM_TIMEOUT */ /* * Curl_resolv_timeout() is the same as Curl_resolv() but specifies a * timeout. 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. * * If built with a synchronous resolver and use of signals is not * disabled by the application, then a nonzero timeout will cause a * timeout after the specified number of milliseconds. Otherwise, timeout * is ignored. * * Return codes: * * CURLRESOLV_TIMEDOUT(-2) = warning, time too short or previous alarm expired * CURLRESOLV_ERROR (-1) = error, no pointer * CURLRESOLV_RESOLVED (0) = OK, pointer provided * CURLRESOLV_PENDING (1) = waiting for response, no pointer */ int Curl_resolv_timeout(struct connectdata *conn, const char *hostname, int port, struct Curl_dns_entry **entry, long timeoutms) { #ifdef USE_ALARM_TIMEOUT #ifdef HAVE_SIGACTION struct sigaction keep_sigact; /* store the old struct here */ volatile bool keep_copysig = FALSE; /* wether old sigact has been saved */ struct sigaction sigact; #else #ifdef HAVE_SIGNAL void (*keep_sigact)(int); /* store the old handler here */ #endif /* HAVE_SIGNAL */ #endif /* HAVE_SIGACTION */ volatile long timeout; volatile unsigned int prev_alarm = 0; struct SessionHandle *data = conn->data; #endif /* USE_ALARM_TIMEOUT */ int rc; *entry = NULL; if(timeoutms < 0) /* got an already expired timeout */ return CURLRESOLV_TIMEDOUT; #ifdef USE_ALARM_TIMEOUT if(data->set.no_signal) /* Ignore the timeout when signals are disabled */ timeout = 0; else timeout = timeoutms; if(!timeout) /* USE_ALARM_TIMEOUT defined, but no timeout actually requested */ return Curl_resolv(conn, hostname, port, entry); if(timeout < 1000) /* The alarm() function only provides integer second resolution, so if we want to wait less than one second we must bail out already now. */ return CURLRESOLV_TIMEDOUT; /************************************************************* * Set signal handler to catch SIGALRM * Store the old value to be able to set it back later! *************************************************************/ #ifdef HAVE_SIGACTION 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 */ /* alarm() makes a signal get sent when the timeout fires off, and that will abort system calls */ prev_alarm = alarm(curlx_sltoui(timeout/1000L)); /* This allows us to time-out from the name resolver, as the timeout will generate a signal and we will siglongjmp() from that here. This technique has problems (see alarmfunc). This should be the last thing we do before calling Curl_resolv(), as otherwise we'd have to worry about variables that get modified before we invoke Curl_resolv() (and thus use "volatile"). */ if(sigsetjmp(curl_jmpenv, 1)) { /* this is coming from a siglongjmp() after an alarm signal */ failf(data, "name lookup timed out"); rc = CURLRESOLV_ERROR; goto clean_up; } #else #ifndef CURLRES_ASYNCH if(timeoutms) infof(conn->data, "timeout on name lookup is not supported\n"); #else (void)timeoutms; /* timeoutms not used with an async resolver */ #endif #endif /* USE_ALARM_TIMEOUT */ /* Perform the actual name resolution. This might be interrupted by an * alarm if it takes too long. */ rc = Curl_resolv(conn, hostname, port, entry); #ifdef USE_ALARM_TIMEOUT clean_up: if(!prev_alarm) /* deactivate a possibly active alarm before uninstalling the handler */ alarm(0); #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); /* the alarm period is counted in even number of seconds */ unsigned long 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); rc = CURLRESOLV_TIMEDOUT; failf(data, "Previous alarm fired off!"); } else alarm((unsigned int)alarm_set); } #endif /* USE_ALARM_TIMEOUT */ 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. * * May be called with 'data' == NULL for global cache. */ void Curl_resolv_unlock(struct SessionHandle *data, struct Curl_dns_entry *dns) { DEBUGASSERT(dns && (dns->inuse>0)); if(data && data->share) Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); dns->inuse--; /* only free if nobody is using AND it is not in hostcache (timestamp == 0) */ if(dns->inuse == 0 && dns->timestamp == 0) { Curl_freeaddrinfo(dns->addr); free(dns); } if(data && 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; /* mark the entry as not in hostcache */ p->timestamp = 0; if(p->inuse == 0) { 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, Curl_hash_str, Curl_str_key_compare, freednsentry); } static int hostcache_inuse(void *data, void *hc) { struct Curl_dns_entry *c = (struct Curl_dns_entry *) hc; if(c->inuse == 1) Curl_resolv_unlock(data, c); return 1; /* free all entries */ } /* * Curl_hostcache_clean() * * This _can_ be called with 'data' == NULL but then of course no locking * can be done! */ void Curl_hostcache_clean(struct SessionHandle *data, struct curl_hash *hash) { /* Entries added to the hostcache with the CURLOPT_RESOLVE function are * still present in the cache with the inuse counter set to 1. Detect them * and cleanup! */ Curl_hash_clean_with_criterium(hash, data, hostcache_inuse); } CURLcode Curl_loadhostpairs(struct SessionHandle *data) { struct curl_slist *hostp; char hostname[256]; char address[256]; int port; for(hostp = data->change.resolve; hostp; hostp = hostp->next ) { if(!hostp->data) continue; if(hostp->data[0] == '-') { /* TODO: mark an entry for removal */ } else if(3 == sscanf(hostp->data, "%255[^:]:%d:%255s", hostname, &port, address)) { struct Curl_dns_entry *dns; Curl_addrinfo *addr; char *entry_id; size_t entry_len; addr = Curl_str2addr(address, port); if(!addr) { infof(data, "Resolve %s found illegal!\n", hostp->data); continue; } /* 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) { Curl_freeaddrinfo(addr); return CURLE_OUT_OF_MEMORY; } 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); /* free the allocated entry_id again */ free(entry_id); if(!dns) /* if not in the cache already, put this host in the cache */ dns = Curl_cache_addr(data, addr, hostname, port); else /* this is a duplicate, free it again */ Curl_freeaddrinfo(addr); if(data->share) Curl_share_unlock(data, CURL_LOCK_DATA_DNS); if(!dns) { Curl_freeaddrinfo(addr); return CURLE_OUT_OF_MEMORY; } infof(data, "Added %s:%d:%s to DNS cache\n", hostname, port, address); } } data->change.resolve = NULL; /* dealt with now */ return CURLE_OK; } curl-7.35.0/lib/splay.c0000644000175000017500000001746612213173003011544 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1997 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #include "splay.h" /* * This macro compares two node keys i and j and returns: * * negative value: when i is smaller than j * zero : when i is equal to j * positive when : when i is larger than j */ #define compare(i,j) Curl_splaycomparekeys((i),(j)) /* * Splay using the key i (which may or may not be in the tree.) The starting * root is t. */ struct Curl_tree *Curl_splay(struct timeval i, struct Curl_tree *t) { struct Curl_tree N, *l, *r, *y; long 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. * * @unittest: 1309 */ struct Curl_tree *Curl_splayinsert(struct timeval i, struct Curl_tree *t, struct Curl_tree *node) { static struct timeval KEY_NOTUSED = {-1,-1}; /* will *NEVER* appear */ 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; } /* 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 key */ struct Curl_tree *Curl_splaygetbest(struct timeval 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 keys */ 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. * * @unittest: 1309 */ int Curl_splayremovebyaddr(struct Curl_tree *t, struct Curl_tree *removenode, struct Curl_tree **newroot) { static struct timeval KEY_NOTUSED = {-1,-1}; /* will *NEVER* appear */ struct Curl_tree *x; if(!t || !removenode) return 1; if(compare(KEY_NOTUSED, removenode->key) == 0) { /* 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(removenode->smaller == NULL) return 3; removenode->smaller->same = removenode->same; if(removenode->same) removenode->same->smaller = removenode->smaller; /* Ensures that double-remove gets caught. */ removenode->smaller = NULL; /* voila, we're done! */ *newroot = t; /* return the same root */ return 0; } t = Curl_splay(removenode->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 != removenode) 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(removenode->key, t->smaller); x->larger = t->larger; } } *newroot = x; /* store new root pointer */ return 0; } curl-7.35.0/lib/README.curlx0000644000175000017500000000374312213173003012255 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| 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 curl-7.35.0/lib/README.curl_off_t0000644000175000017500000000471112213173003013236 00000000000000 curl_off_t explained ==================== curl_off_t is a data type provided by the external libcurl include headers. It is the type meant to be used for the curl_easy_setopt() options that end with LARGE. The type is 64bit large on most modern platforms. Transition from < 7.19.0 to >= 7.19.0 ------------------------------------- Applications that used libcurl before 7.19.0 that are rebuilt with a libcurl that is 7.19.0 or later may or may not have to worry about anything of this. We have made a significant effort to make the transition really seamless and transparent. You have have to take notice if you are in one of the following situations: o Your app is using or will after the transition use a libcurl that is built with LFS (large file support) disabled even though your system otherwise supports it. o Your app is using or will after the transition use a libcurl that doesn't support LFS at all, but your system and compiler support 64bit data types. In both these cases, the curl_off_t type will now (after the transition) be 64bit where it previously was 32bit. This will cause a binary incompatibility that you MAY need to deal with. Benefits -------- This new way has several benefits: o Platforms without LFS support can still use libcurl to do >32 bit file transfers and range operations etc as long as they have >32 bit data-types supported. o Applications will no longer easily build with the curl_off_t size mismatched, which has been a very frequent (and annoying) problem with libcurl <= 7.18.2 Historically ------------ Previously, before 7.19.0, the curl_off_t type would be rather strongly connected to the size of the system off_t type, where currently curl_off_t is independent of that. The strong connection to off_t made it troublesome for application authors since when they did mistakes, they could get curl_off_t type of different sizes in the app vs libcurl, and that caused strange effects that were hard to track and detect by users of libcurl. SONAME ------ We opted to not bump the soname for the library unconditionally, simply because soname bumping is causing a lot of grief and moaning all over the community so we try to keep that at minimum. Also, our selected design path should be 100% backwards compatible for the vast majority of all libcurl users. Enforce SONAME bump ------------------- If configure doesn't detect your case where a bump is necessary, re-run it with the --enable-soname-bump command line option! curl-7.35.0/lib/curl_ldap.h0000644000175000017500000000260012213173003012346 00000000000000#ifndef HEADER_CURL_LDAP_H #define HEADER_CURL_LDAP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ #ifndef CURL_DISABLE_LDAP extern const struct Curl_handler Curl_handler_ldap; #if !defined(CURL_DISABLE_LDAPS) && \ ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \ (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))) extern const struct Curl_handler Curl_handler_ldaps; #endif #endif #endif /* HEADER_CURL_LDAP_H */ curl-7.35.0/lib/curl_md4.h0000644000175000017500000000252512213173003012120 00000000000000#ifndef HEADER_CURL_MD4_H #define HEADER_CURL_MD4_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ #include "curl_setup.h" /* NSS crypto library does not provide the MD4 hash algorithm, so that we have * a local implementation of it */ #ifdef USE_NSS void Curl_md4it(unsigned char *output, const unsigned char *input, size_t len); #endif /* USE_NSS */ #endif /* HEADER_CURL_MD4_H */ curl-7.35.0/lib/vtls/0000755000175000017500000000000012272124476011321 500000000000000curl-7.35.0/lib/vtls/nss.c0000644000175000017500000013576612270035364012225 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* * Source file for all NSS-specific code for the TLS/SSL layer. No code * but vtls.c should ever call or use these functions. */ #include "curl_setup.h" #ifdef USE_NSS #include "urldata.h" #include "sendf.h" #include "formdata.h" /* for the boundary function */ #include "url.h" /* for the ssl config check function */ #include "connect.h" #include "strequal.h" #include "select.h" #include "vtls.h" #include "llist.h" #define _MPRINTF_REPLACE /* use the internal *printf() functions */ #include #include "nssg.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "curl_memory.h" #include "rawstr.h" #include "warnless.h" #include "x509asn1.h" /* The last #include file should be: */ #include "memdebug.h" #define SSL_DIR "/etc/pki/nssdb" /* enough to fit the string "PEM Token #[0|1]" */ #define SLOTSIZE 13 PRFileDesc *PR_ImportTCPSocket(PRInt32 osfd); PRLock * nss_initlock = NULL; PRLock * nss_crllock = NULL; NSSInitContext * nss_context = NULL; volatile int initialized = 0; typedef struct { const char *name; int num; } cipher_s; #define PK11_SETATTRS(_attr, _idx, _type, _val, _len) do { \ CK_ATTRIBUTE *ptr = (_attr) + ((_idx)++); \ ptr->type = (_type); \ ptr->pValue = (_val); \ ptr->ulValueLen = (_len); \ } WHILE_FALSE #define CERT_NewTempCertificate __CERT_NewTempCertificate #define NUM_OF_CIPHERS sizeof(cipherlist)/sizeof(cipherlist[0]) static const cipher_s cipherlist[] = { /* SSL2 cipher suites */ {"rc4", SSL_EN_RC4_128_WITH_MD5}, {"rc4-md5", SSL_EN_RC4_128_WITH_MD5}, {"rc4export", SSL_EN_RC4_128_EXPORT40_WITH_MD5}, {"rc2", SSL_EN_RC2_128_CBC_WITH_MD5}, {"rc2export", SSL_EN_RC2_128_CBC_EXPORT40_WITH_MD5}, {"des", SSL_EN_DES_64_CBC_WITH_MD5}, {"desede3", SSL_EN_DES_192_EDE3_CBC_WITH_MD5}, /* SSL3/TLS cipher suites */ {"rsa_rc4_128_md5", SSL_RSA_WITH_RC4_128_MD5}, {"rsa_rc4_128_sha", SSL_RSA_WITH_RC4_128_SHA}, {"rsa_3des_sha", SSL_RSA_WITH_3DES_EDE_CBC_SHA}, {"rsa_des_sha", SSL_RSA_WITH_DES_CBC_SHA}, {"rsa_rc4_40_md5", SSL_RSA_EXPORT_WITH_RC4_40_MD5}, {"rsa_rc2_40_md5", SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5}, {"rsa_null_md5", SSL_RSA_WITH_NULL_MD5}, {"rsa_null_sha", SSL_RSA_WITH_NULL_SHA}, {"fips_3des_sha", SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA}, {"fips_des_sha", SSL_RSA_FIPS_WITH_DES_CBC_SHA}, {"fortezza", SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA}, {"fortezza_rc4_128_sha", SSL_FORTEZZA_DMS_WITH_RC4_128_SHA}, {"fortezza_null", SSL_FORTEZZA_DMS_WITH_NULL_SHA}, /* TLS 1.0: Exportable 56-bit Cipher Suites. */ {"rsa_des_56_sha", TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA}, {"rsa_rc4_56_sha", TLS_RSA_EXPORT1024_WITH_RC4_56_SHA}, /* AES ciphers. */ {"rsa_aes_128_sha", TLS_RSA_WITH_AES_128_CBC_SHA}, {"rsa_aes_256_sha", TLS_RSA_WITH_AES_256_CBC_SHA}, #ifdef NSS_ENABLE_ECC /* ECC ciphers. */ {"ecdh_ecdsa_null_sha", TLS_ECDH_ECDSA_WITH_NULL_SHA}, {"ecdh_ecdsa_rc4_128_sha", TLS_ECDH_ECDSA_WITH_RC4_128_SHA}, {"ecdh_ecdsa_3des_sha", TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA}, {"ecdh_ecdsa_aes_128_sha", TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA}, {"ecdh_ecdsa_aes_256_sha", TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA}, {"ecdhe_ecdsa_null_sha", TLS_ECDHE_ECDSA_WITH_NULL_SHA}, {"ecdhe_ecdsa_rc4_128_sha", TLS_ECDHE_ECDSA_WITH_RC4_128_SHA}, {"ecdhe_ecdsa_3des_sha", TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA}, {"ecdhe_ecdsa_aes_128_sha", TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA}, {"ecdhe_ecdsa_aes_256_sha", TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA}, {"ecdh_rsa_null_sha", TLS_ECDH_RSA_WITH_NULL_SHA}, {"ecdh_rsa_128_sha", TLS_ECDH_RSA_WITH_RC4_128_SHA}, {"ecdh_rsa_3des_sha", TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA}, {"ecdh_rsa_aes_128_sha", TLS_ECDH_RSA_WITH_AES_128_CBC_SHA}, {"ecdh_rsa_aes_256_sha", TLS_ECDH_RSA_WITH_AES_256_CBC_SHA}, {"echde_rsa_null", TLS_ECDHE_RSA_WITH_NULL_SHA}, {"ecdhe_rsa_rc4_128_sha", TLS_ECDHE_RSA_WITH_RC4_128_SHA}, {"ecdhe_rsa_3des_sha", TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA}, {"ecdhe_rsa_aes_128_sha", TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA}, {"ecdhe_rsa_aes_256_sha", TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA}, {"ecdh_anon_null_sha", TLS_ECDH_anon_WITH_NULL_SHA}, {"ecdh_anon_rc4_128sha", TLS_ECDH_anon_WITH_RC4_128_SHA}, {"ecdh_anon_3des_sha", TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA}, {"ecdh_anon_aes_128_sha", TLS_ECDH_anon_WITH_AES_128_CBC_SHA}, {"ecdh_anon_aes_256_sha", TLS_ECDH_anon_WITH_AES_256_CBC_SHA}, #endif }; /* following ciphers are new in NSS 3.4 and not enabled by default, therefore they are enabled explicitly */ static const int enable_ciphers_by_default[] = { TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, SSL_NULL_WITH_NULL_NULL }; static const char* pem_library = "libnsspem.so"; SECMODModule* mod = NULL; static const char* nss_error_to_name(PRErrorCode code) { const char *name = PR_ErrorToName(code); if(name) return name; return "unknown error"; } static void nss_print_error_message(struct SessionHandle *data, PRUint32 err) { failf(data, "%s", PR_ErrorToString(err, PR_LANGUAGE_I_DEFAULT)); } static SECStatus set_ciphers(struct SessionHandle *data, PRFileDesc * model, char *cipher_list) { unsigned int i; PRBool cipher_state[NUM_OF_CIPHERS]; PRBool found; char *cipher; SECStatus rv; /* First disable all ciphers. This uses a different max value in case * NSS adds more ciphers later we don't want them available by * accident */ for(i=0; iset.str[cert_kind]; const char *n; if(!is_file(str)) /* no such file exists, use the string as nickname */ return strdup(str); /* search the last slash; we require at least one slash in a file name */ n = strrchr(str, '/'); if(!n) { infof(data, "warning: certificate file name \"%s\" handled as nickname; " "please use \"./%s\" to force file name\n", str, str); return strdup(str); } /* we'll use the PEM reader to read the certificate from file */ return NULL; } /* Call PK11_CreateGenericObject() with the given obj_class and filename. If * the call succeeds, append the object handle to the list of objects so that * the object can be destroyed in Curl_nss_close(). */ static CURLcode nss_create_object(struct ssl_connect_data *ssl, CK_OBJECT_CLASS obj_class, const char *filename, bool cacert) { PK11SlotInfo *slot; PK11GenericObject *obj; CK_BBOOL cktrue = CK_TRUE; CK_BBOOL ckfalse = CK_FALSE; CK_ATTRIBUTE attrs[/* max count of attributes */ 4]; int attr_cnt = 0; CURLcode err = (cacert) ? CURLE_SSL_CACERT_BADFILE : CURLE_SSL_CERTPROBLEM; const int slot_id = (cacert) ? 0 : 1; char *slot_name = aprintf("PEM Token #%d", slot_id); if(!slot_name) return CURLE_OUT_OF_MEMORY; slot = PK11_FindSlotByName(slot_name); free(slot_name); if(!slot) return err; PK11_SETATTRS(attrs, attr_cnt, CKA_CLASS, &obj_class, sizeof(obj_class)); PK11_SETATTRS(attrs, attr_cnt, CKA_TOKEN, &cktrue, sizeof(CK_BBOOL)); PK11_SETATTRS(attrs, attr_cnt, CKA_LABEL, (unsigned char *)filename, strlen(filename) + 1); if(CKO_CERTIFICATE == obj_class) { CK_BBOOL *pval = (cacert) ? (&cktrue) : (&ckfalse); PK11_SETATTRS(attrs, attr_cnt, CKA_TRUST, pval, sizeof(*pval)); } obj = PK11_CreateGenericObject(slot, attrs, attr_cnt, PR_FALSE); PK11_FreeSlot(slot); if(!obj) return err; if(!Curl_llist_insert_next(ssl->obj_list, ssl->obj_list->tail, obj)) { PK11_DestroyGenericObject(obj); return CURLE_OUT_OF_MEMORY; } if(!cacert && CKO_CERTIFICATE == obj_class) /* store reference to a client certificate */ ssl->obj_clicert = obj; return CURLE_OK; } /* Destroy the NSS object whose handle is given by ptr. This function is * a callback of Curl_llist_alloc() used by Curl_llist_destroy() to destroy * NSS objects in Curl_nss_close() */ static void nss_destroy_object(void *user, void *ptr) { PK11GenericObject *obj = (PK11GenericObject *)ptr; (void) user; PK11_DestroyGenericObject(obj); } static CURLcode nss_load_cert(struct ssl_connect_data *ssl, const char *filename, PRBool cacert) { CURLcode err = (cacert) ? CURLE_SSL_CACERT_BADFILE : CURLE_SSL_CERTPROBLEM; /* libnsspem.so leaks memory if the requested file does not exist. For more * details, go to . */ if(is_file(filename)) err = nss_create_object(ssl, CKO_CERTIFICATE, filename, cacert); if(CURLE_OK == err && !cacert) { /* we have successfully loaded a client certificate */ CERTCertificate *cert; char *nickname = NULL; char *n = strrchr(filename, '/'); if(n) n++; /* The following undocumented magic helps to avoid a SIGSEGV on call * of PK11_ReadRawAttribute() from SelectClientCert() when using an * immature version of libnsspem.so. For more details, go to * . */ nickname = aprintf("PEM Token #1:%s", n); if(nickname) { cert = PK11_FindCertFromNickname(nickname, NULL); if(cert) CERT_DestroyCertificate(cert); free(nickname); } } return err; } /* add given CRL to cache if it is not already there */ static SECStatus nss_cache_crl(SECItem *crlDER) { CERTCertDBHandle *db = CERT_GetDefaultCertDB(); CERTSignedCrl *crl = SEC_FindCrlByDERCert(db, crlDER, 0); if(crl) { /* CRL already cached */ SEC_DestroyCrl(crl); SECITEM_FreeItem(crlDER, PR_FALSE); return SECSuccess; } /* acquire lock before call of CERT_CacheCRL() */ PR_Lock(nss_crllock); if(SECSuccess != CERT_CacheCRL(db, crlDER)) { /* unable to cache CRL */ PR_Unlock(nss_crllock); SECITEM_FreeItem(crlDER, PR_FALSE); return SECFailure; } /* we need to clear session cache, so that the CRL could take effect */ SSL_ClearSessionCache(); PR_Unlock(nss_crllock); return SECSuccess; } static SECStatus nss_load_crl(const char* crlfilename) { PRFileDesc *infile; PRFileInfo info; SECItem filedata = { 0, NULL, 0 }; SECItem crlDER = { 0, NULL, 0 }; char *body; infile = PR_Open(crlfilename, PR_RDONLY, 0); if(!infile) return SECFailure; if(PR_SUCCESS != PR_GetOpenFileInfo(infile, &info)) goto fail; if(!SECITEM_AllocItem(NULL, &filedata, info.size + /* zero ended */ 1)) goto fail; if(info.size != PR_Read(infile, filedata.data, info.size)) goto fail; /* place a trailing zero right after the visible data */ body = (char*)filedata.data; body[--filedata.len] = '\0'; body = strstr(body, "-----BEGIN"); if(body) { /* assume ASCII */ char *trailer; char *begin = PORT_Strchr(body, '\n'); if(!begin) begin = PORT_Strchr(body, '\r'); if(!begin) goto fail; trailer = strstr(++begin, "-----END"); if(!trailer) goto fail; /* retrieve DER from ASCII */ *trailer = '\0'; if(ATOB_ConvertAsciiToItem(&crlDER, begin)) goto fail; SECITEM_FreeItem(&filedata, PR_FALSE); } else /* assume DER */ crlDER = filedata; PR_Close(infile); return nss_cache_crl(&crlDER); fail: PR_Close(infile); SECITEM_FreeItem(&filedata, PR_FALSE); return SECFailure; } static CURLcode nss_load_key(struct connectdata *conn, int sockindex, char *key_file) { PK11SlotInfo *slot; SECStatus status; CURLcode rv; struct ssl_connect_data *ssl = conn->ssl; (void)sockindex; /* unused */ rv = nss_create_object(ssl, CKO_PRIVATE_KEY, key_file, FALSE); if(CURLE_OK != rv) { PR_SetError(SEC_ERROR_BAD_KEY, 0); return rv; } slot = PK11_FindSlotByName("PEM Token #1"); if(!slot) return CURLE_SSL_CERTPROBLEM; /* This will force the token to be seen as re-inserted */ SECMOD_WaitForAnyTokenEvent(mod, 0, 0); PK11_IsPresent(slot); status = PK11_Authenticate(slot, PR_TRUE, conn->data->set.str[STRING_KEY_PASSWD]); PK11_FreeSlot(slot); return (SECSuccess == status) ? CURLE_OK : CURLE_SSL_CERTPROBLEM; } static int display_error(struct connectdata *conn, PRInt32 err, const char *filename) { switch(err) { case SEC_ERROR_BAD_PASSWORD: failf(conn->data, "Unable to load client key: Incorrect password"); return 1; case SEC_ERROR_UNKNOWN_CERT: failf(conn->data, "Unable to load certificate %s", filename); return 1; default: break; } return 0; /* The caller will print a generic error */ } static CURLcode cert_stuff(struct connectdata *conn, int sockindex, char *cert_file, char *key_file) { struct SessionHandle *data = conn->data; CURLcode rv; if(cert_file) { rv = nss_load_cert(&conn->ssl[sockindex], cert_file, PR_FALSE); if(CURLE_OK != rv) { const PRErrorCode err = PR_GetError(); if(!display_error(conn, err, cert_file)) { const char *err_name = nss_error_to_name(err); failf(data, "unable to load client cert: %d (%s)", err, err_name); } return rv; } } if(key_file || (is_file(cert_file))) { if(key_file) rv = nss_load_key(conn, sockindex, key_file); else /* In case the cert file also has the key */ rv = nss_load_key(conn, sockindex, cert_file); if(CURLE_OK != rv) { const PRErrorCode err = PR_GetError(); if(!display_error(conn, err, key_file)) { const char *err_name = nss_error_to_name(err); failf(data, "unable to load client key: %d (%s)", err, err_name); } return rv; } } return CURLE_OK; } static char * nss_get_password(PK11SlotInfo * slot, PRBool retry, void *arg) { (void)slot; /* unused */ if(retry || NULL == arg) return NULL; else return (char *)PORT_Strdup((char *)arg); } /* bypass the default SSL_AuthCertificate() hook in case we do not want to * verify peer */ static SECStatus nss_auth_cert_hook(void *arg, PRFileDesc *fd, PRBool checksig, PRBool isServer) { struct connectdata *conn = (struct connectdata *)arg; if(!conn->data->set.ssl.verifypeer) { infof(conn->data, "skipping SSL peer certificate verification\n"); return SECSuccess; } return SSL_AuthCertificate(CERT_GetDefaultCertDB(), fd, checksig, isServer); } /** * Inform the application that the handshake is complete. */ static void HandshakeCallback(PRFileDesc *sock, void *arg) { (void)sock; (void)arg; } static void display_cert_info(struct SessionHandle *data, CERTCertificate *cert) { char *subject, *issuer, *common_name; PRExplodedTime printableTime; char timeString[256]; PRTime notBefore, notAfter; subject = CERT_NameToAscii(&cert->subject); issuer = CERT_NameToAscii(&cert->issuer); common_name = CERT_GetCommonName(&cert->subject); infof(data, "\tsubject: %s\n", subject); CERT_GetCertTimes(cert, ¬Before, ¬After); PR_ExplodeTime(notBefore, PR_GMTParameters, &printableTime); PR_FormatTime(timeString, 256, "%b %d %H:%M:%S %Y GMT", &printableTime); infof(data, "\tstart date: %s\n", timeString); PR_ExplodeTime(notAfter, PR_GMTParameters, &printableTime); PR_FormatTime(timeString, 256, "%b %d %H:%M:%S %Y GMT", &printableTime); infof(data, "\texpire date: %s\n", timeString); infof(data, "\tcommon name: %s\n", common_name); infof(data, "\tissuer: %s\n", issuer); PR_Free(subject); PR_Free(issuer); PR_Free(common_name); } static void display_conn_info(struct connectdata *conn, PRFileDesc *sock) { SSLChannelInfo channel; SSLCipherSuiteInfo suite; CERTCertificate *cert; CERTCertificate *cert2; CERTCertificate *cert3; PRTime now; int i; if(SSL_GetChannelInfo(sock, &channel, sizeof channel) == SECSuccess && channel.length == sizeof channel && channel.cipherSuite) { if(SSL_GetCipherSuiteInfo(channel.cipherSuite, &suite, sizeof suite) == SECSuccess) { infof(conn->data, "SSL connection using %s\n", suite.cipherSuiteName); } } cert = SSL_PeerCertificate(sock); if(cert) { infof(conn->data, "Server certificate:\n"); if(!conn->data->set.ssl.certinfo) { display_cert_info(conn->data, cert); CERT_DestroyCertificate(cert); } else { /* Count certificates in chain. */ now = PR_Now(); i = 1; if(!cert->isRoot) { cert2 = CERT_FindCertIssuer(cert, now, certUsageSSLCA); while(cert2) { i++; if(cert2->isRoot) { CERT_DestroyCertificate(cert2); break; } cert3 = CERT_FindCertIssuer(cert2, now, certUsageSSLCA); CERT_DestroyCertificate(cert2); cert2 = cert3; } } Curl_ssl_init_certinfo(conn->data, i); for(i = 0; cert; cert = cert2) { Curl_extract_certinfo(conn, i++, (char *)cert->derCert.data, (char *)cert->derCert.data + cert->derCert.len); if(cert->isRoot) { CERT_DestroyCertificate(cert); break; } cert2 = CERT_FindCertIssuer(cert, now, certUsageSSLCA); CERT_DestroyCertificate(cert); } } } return; } static SECStatus BadCertHandler(void *arg, PRFileDesc *sock) { struct connectdata *conn = (struct connectdata *)arg; struct SessionHandle *data = conn->data; PRErrorCode err = PR_GetError(); CERTCertificate *cert; /* remember the cert verification result */ data->set.ssl.certverifyresult = err; if(err == SSL_ERROR_BAD_CERT_DOMAIN && !data->set.ssl.verifyhost) /* we are asked not to verify the host name */ return SECSuccess; /* print only info about the cert, the error is printed off the callback */ cert = SSL_PeerCertificate(sock); if(cert) { infof(data, "Server certificate:\n"); display_cert_info(data, cert); CERT_DestroyCertificate(cert); } return SECFailure; } /** * * Check that the Peer certificate's issuer certificate matches the one found * by issuer_nickname. This is not exactly the way OpenSSL and GNU TLS do the * issuer check, so we provide comments that mimic the OpenSSL * X509_check_issued function (in x509v3/v3_purp.c) */ static SECStatus check_issuer_cert(PRFileDesc *sock, char *issuer_nickname) { CERTCertificate *cert,*cert_issuer,*issuer; SECStatus res=SECSuccess; void *proto_win = NULL; /* PRArenaPool *tmpArena = NULL; CERTAuthKeyID *authorityKeyID = NULL; SECITEM *caname = NULL; */ cert = SSL_PeerCertificate(sock); cert_issuer = CERT_FindCertIssuer(cert,PR_Now(),certUsageObjectSigner); proto_win = SSL_RevealPinArg(sock); issuer = PK11_FindCertFromNickname(issuer_nickname, proto_win); if((!cert_issuer) || (!issuer)) res = SECFailure; else if(SECITEM_CompareItem(&cert_issuer->derCert, &issuer->derCert)!=SECEqual) res = SECFailure; CERT_DestroyCertificate(cert); CERT_DestroyCertificate(issuer); CERT_DestroyCertificate(cert_issuer); return res; } /** * * Callback to pick the SSL client certificate. */ static SECStatus SelectClientCert(void *arg, PRFileDesc *sock, struct CERTDistNamesStr *caNames, struct CERTCertificateStr **pRetCert, struct SECKEYPrivateKeyStr **pRetKey) { struct ssl_connect_data *connssl = (struct ssl_connect_data *)arg; struct SessionHandle *data = connssl->data; const char *nickname = connssl->client_nickname; if(connssl->obj_clicert) { /* use the cert/key provided by PEM reader */ static const char pem_slotname[] = "PEM Token #1"; SECItem cert_der = { 0, NULL, 0 }; void *proto_win = SSL_RevealPinArg(sock); struct CERTCertificateStr *cert; struct SECKEYPrivateKeyStr *key; PK11SlotInfo *slot = PK11_FindSlotByName(pem_slotname); if(NULL == slot) { failf(data, "NSS: PK11 slot not found: %s", pem_slotname); return SECFailure; } if(PK11_ReadRawAttribute(PK11_TypeGeneric, connssl->obj_clicert, CKA_VALUE, &cert_der) != SECSuccess) { failf(data, "NSS: CKA_VALUE not found in PK11 generic object"); PK11_FreeSlot(slot); return SECFailure; } cert = PK11_FindCertFromDERCertItem(slot, &cert_der, proto_win); SECITEM_FreeItem(&cert_der, PR_FALSE); if(NULL == cert) { failf(data, "NSS: client certificate from file not found"); PK11_FreeSlot(slot); return SECFailure; } key = PK11_FindPrivateKeyFromCert(slot, cert, NULL); PK11_FreeSlot(slot); if(NULL == key) { failf(data, "NSS: private key from file not found"); CERT_DestroyCertificate(cert); return SECFailure; } infof(data, "NSS: client certificate from file\n"); display_cert_info(data, cert); *pRetCert = cert; *pRetKey = key; return SECSuccess; } /* use the default NSS hook */ if(SECSuccess != NSS_GetClientAuthData((void *)nickname, sock, caNames, pRetCert, pRetKey) || NULL == *pRetCert) { if(NULL == nickname) failf(data, "NSS: client certificate not found (nickname not " "specified)"); else failf(data, "NSS: client certificate not found: %s", nickname); return SECFailure; } /* get certificate nickname if any */ nickname = (*pRetCert)->nickname; if(NULL == nickname) nickname = "[unknown]"; if(NULL == *pRetKey) { failf(data, "NSS: private key not found for certificate: %s", nickname); return SECFailure; } infof(data, "NSS: using client certificate: %s\n", nickname); display_cert_info(data, *pRetCert); return SECSuccess; } /* This function is supposed to decide, which error codes should be used * to conclude server is TLS intolerant. * * taken from xulrunner - nsNSSIOLayer.cpp */ static PRBool isTLSIntoleranceError(PRInt32 err) { switch (err) { case SSL_ERROR_BAD_MAC_ALERT: case SSL_ERROR_BAD_MAC_READ: case SSL_ERROR_HANDSHAKE_FAILURE_ALERT: case SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT: case SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE: case SSL_ERROR_ILLEGAL_PARAMETER_ALERT: case SSL_ERROR_NO_CYPHER_OVERLAP: case SSL_ERROR_BAD_SERVER: case SSL_ERROR_BAD_BLOCK_PADDING: case SSL_ERROR_UNSUPPORTED_VERSION: case SSL_ERROR_PROTOCOL_VERSION_ALERT: case SSL_ERROR_RX_MALFORMED_FINISHED: case SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE: case SSL_ERROR_DECODE_ERROR_ALERT: case SSL_ERROR_RX_UNKNOWN_ALERT: return PR_TRUE; default: return PR_FALSE; } } static CURLcode nss_init_core(struct SessionHandle *data, const char *cert_dir) { NSSInitParameters initparams; if(nss_context != NULL) return CURLE_OK; memset((void *) &initparams, '\0', sizeof(initparams)); initparams.length = sizeof(initparams); if(cert_dir) { const bool use_sql = NSS_VersionCheck("3.12.0"); char *certpath = aprintf("%s%s", use_sql ? "sql:" : "", cert_dir); if(!certpath) return CURLE_OUT_OF_MEMORY; infof(data, "Initializing NSS with certpath: %s\n", certpath); nss_context = NSS_InitContext(certpath, "", "", "", &initparams, NSS_INIT_READONLY | NSS_INIT_PK11RELOAD); free(certpath); if(nss_context != NULL) return CURLE_OK; infof(data, "Unable to initialize NSS database\n"); } infof(data, "Initializing NSS with certpath: none\n"); nss_context = NSS_InitContext("", "", "", "", &initparams, NSS_INIT_READONLY | NSS_INIT_NOCERTDB | NSS_INIT_NOMODDB | NSS_INIT_FORCEOPEN | NSS_INIT_NOROOTINIT | NSS_INIT_OPTIMIZESPACE | NSS_INIT_PK11RELOAD); if(nss_context != NULL) return CURLE_OK; infof(data, "Unable to initialize NSS\n"); return CURLE_SSL_CACERT_BADFILE; } static CURLcode nss_init(struct SessionHandle *data) { char *cert_dir; struct_stat st; CURLcode rv; if(initialized) return CURLE_OK; /* First we check if $SSL_DIR points to a valid dir */ cert_dir = getenv("SSL_DIR"); if(cert_dir) { if((stat(cert_dir, &st) != 0) || (!S_ISDIR(st.st_mode))) { cert_dir = NULL; } } /* Now we check if the default location is a valid dir */ if(!cert_dir) { if((stat(SSL_DIR, &st) == 0) && (S_ISDIR(st.st_mode))) { cert_dir = (char *)SSL_DIR; } } rv = nss_init_core(data, cert_dir); if(rv) return rv; if(num_enabled_ciphers() == 0) NSS_SetDomesticPolicy(); initialized = 1; return CURLE_OK; } /** * Global SSL init * * @retval 0 error initializing SSL * @retval 1 SSL initialized successfully */ int Curl_nss_init(void) { /* curl_global_init() is not thread-safe so this test is ok */ if(nss_initlock == NULL) { PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 256); nss_initlock = PR_NewLock(); nss_crllock = PR_NewLock(); } /* We will actually initialize NSS later */ return 1; } CURLcode Curl_nss_force_init(struct SessionHandle *data) { CURLcode rv; if(!nss_initlock) { failf(data, "unable to initialize NSS, curl_global_init() should have been " "called with CURL_GLOBAL_SSL or CURL_GLOBAL_ALL"); return CURLE_FAILED_INIT; } PR_Lock(nss_initlock); rv = nss_init(data); PR_Unlock(nss_initlock); return rv; } /* Global cleanup */ void Curl_nss_cleanup(void) { /* This function isn't required to be threadsafe and this is only done * as a safety feature. */ PR_Lock(nss_initlock); if(initialized) { /* Free references to client certificates held in the SSL session cache. * Omitting this hampers destruction of the security module owning * the certificates. */ SSL_ClearSessionCache(); if(mod && SECSuccess == SECMOD_UnloadUserModule(mod)) { SECMOD_DestroyModule(mod); mod = NULL; } NSS_ShutdownContext(nss_context); nss_context = NULL; } PR_Unlock(nss_initlock); PR_DestroyLock(nss_initlock); PR_DestroyLock(nss_crllock); nss_initlock = NULL; initialized = 0; } /* * 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_nss_check_cxn(struct connectdata *conn) { int rc; char buf; rc = PR_Recv(conn->ssl[FIRSTSOCKET].handle, (void *)&buf, 1, PR_MSG_PEEK, PR_SecondsToInterval(1)); if(rc > 0) return 1; /* connection still in place */ if(rc == 0) return 0; /* connection has been closed */ return -1; /* connection status unknown */ } /* * This function is called when an SSL connection is closed. */ void Curl_nss_close(struct connectdata *conn, int sockindex) { struct ssl_connect_data *connssl = &conn->ssl[sockindex]; if(connssl->handle) { /* NSS closes the socket we previously handed to it, so we must mark it as closed to avoid double close */ fake_sclose(conn->sock[sockindex]); conn->sock[sockindex] = CURL_SOCKET_BAD; if((connssl->client_nickname != NULL) || (connssl->obj_clicert != NULL)) /* A server might require different authentication based on the * particular path being requested by the client. To support this * scenario, we must ensure that a connection will never reuse the * authentication data from a previous connection. */ SSL_InvalidateSession(connssl->handle); if(connssl->client_nickname != NULL) { free(connssl->client_nickname); connssl->client_nickname = NULL; } /* destroy all NSS objects in order to avoid failure of NSS shutdown */ Curl_llist_destroy(connssl->obj_list, NULL); connssl->obj_list = NULL; connssl->obj_clicert = NULL; PR_Close(connssl->handle); connssl->handle = NULL; } } /* * This function is called when the 'data' struct is going away. Close * down everything and free all resources! */ int Curl_nss_close_all(struct SessionHandle *data) { (void)data; return 0; } /* return true if NSS can provide error code (and possibly msg) for the error */ static bool is_nss_error(CURLcode err) { switch(err) { case CURLE_PEER_FAILED_VERIFICATION: case CURLE_SSL_CACERT: case CURLE_SSL_CERTPROBLEM: case CURLE_SSL_CONNECT_ERROR: case CURLE_SSL_ISSUER_ERROR: return true; default: return false; } } /* return true if the given error code is related to a client certificate */ static bool is_cc_error(PRInt32 err) { switch(err) { case SSL_ERROR_BAD_CERT_ALERT: case SSL_ERROR_EXPIRED_CERT_ALERT: case SSL_ERROR_REVOKED_CERT_ALERT: return true; default: return false; } } static Curl_recv nss_recv; static Curl_send nss_send; static CURLcode nss_load_ca_certificates(struct connectdata *conn, int sockindex) { struct SessionHandle *data = conn->data; const char *cafile = data->set.ssl.CAfile; const char *capath = data->set.ssl.CApath; if(cafile) { CURLcode rv = nss_load_cert(&conn->ssl[sockindex], cafile, PR_TRUE); if(CURLE_OK != rv) return rv; } if(capath) { struct_stat st; if(stat(capath, &st) == -1) return CURLE_SSL_CACERT_BADFILE; if(S_ISDIR(st.st_mode)) { PRDirEntry *entry; PRDir *dir = PR_OpenDir(capath); if(!dir) return CURLE_SSL_CACERT_BADFILE; while((entry = PR_ReadDir(dir, PR_SKIP_BOTH | PR_SKIP_HIDDEN))) { char *fullpath = aprintf("%s/%s", capath, entry->name); if(!fullpath) { PR_CloseDir(dir); return CURLE_OUT_OF_MEMORY; } if(CURLE_OK != nss_load_cert(&conn->ssl[sockindex], fullpath, PR_TRUE)) /* This is purposefully tolerant of errors so non-PEM files can * be in the same directory */ infof(data, "failed to load '%s' from CURLOPT_CAPATH\n", fullpath); free(fullpath); } PR_CloseDir(dir); } else infof(data, "warning: CURLOPT_CAPATH not a directory (%s)\n", capath); } infof(data, " CAfile: %s\n CApath: %s\n", cafile ? cafile : "none", capath ? capath : "none"); return CURLE_OK; } static CURLcode nss_init_sslver(SSLVersionRange *sslver, struct SessionHandle *data) { switch (data->set.ssl.version) { default: case CURL_SSLVERSION_DEFAULT: if(data->state.ssl_connect_retry) { infof(data, "TLS disabled due to previous handshake failure\n"); sslver->max = SSL_LIBRARY_VERSION_3_0; } return CURLE_OK; case CURL_SSLVERSION_TLSv1: sslver->min = SSL_LIBRARY_VERSION_TLS_1_0; #ifdef SSL_LIBRARY_VERSION_TLS_1_2 sslver->max = SSL_LIBRARY_VERSION_TLS_1_2; #elif defined SSL_LIBRARY_VERSION_TLS_1_1 sslver->max = SSL_LIBRARY_VERSION_TLS_1_1; #else sslver->max = SSL_LIBRARY_VERSION_TLS_1_0; #endif return CURLE_OK; case CURL_SSLVERSION_SSLv2: sslver->min = SSL_LIBRARY_VERSION_2; sslver->max = SSL_LIBRARY_VERSION_2; return CURLE_OK; case CURL_SSLVERSION_SSLv3: sslver->min = SSL_LIBRARY_VERSION_3_0; sslver->max = SSL_LIBRARY_VERSION_3_0; return CURLE_OK; case CURL_SSLVERSION_TLSv1_0: sslver->min = SSL_LIBRARY_VERSION_TLS_1_0; sslver->max = SSL_LIBRARY_VERSION_TLS_1_0; return CURLE_OK; case CURL_SSLVERSION_TLSv1_1: #ifdef SSL_LIBRARY_VERSION_TLS_1_1 sslver->min = SSL_LIBRARY_VERSION_TLS_1_1; sslver->max = SSL_LIBRARY_VERSION_TLS_1_1; return CURLE_OK; #endif break; case CURL_SSLVERSION_TLSv1_2: #ifdef SSL_LIBRARY_VERSION_TLS_1_2 sslver->min = SSL_LIBRARY_VERSION_TLS_1_2; sslver->max = SSL_LIBRARY_VERSION_TLS_1_2; return CURLE_OK; #endif break; } failf(data, "TLS minor version cannot be set"); return CURLE_SSL_CONNECT_ERROR; } CURLcode Curl_nss_connect(struct connectdata *conn, int sockindex) { PRErrorCode err = 0; PRFileDesc *model = NULL; PRBool ssl_no_cache; PRBool ssl_cbc_random_iv; struct SessionHandle *data = conn->data; curl_socket_t sockfd = conn->sock[sockindex]; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; CURLcode curlerr; const int *cipher_to_enable; PRSocketOptionData sock_opt; long time_left; PRUint32 timeout; SSLVersionRange sslver = { SSL_LIBRARY_VERSION_3_0, /* min */ SSL_LIBRARY_VERSION_TLS_1_0 /* max */ }; if(connssl->state == ssl_connection_complete) return CURLE_OK; connssl->data = data; /* list of all NSS objects we need to destroy in Curl_nss_close() */ connssl->obj_list = Curl_llist_alloc(nss_destroy_object); if(!connssl->obj_list) return CURLE_OUT_OF_MEMORY; /* FIXME. NSS doesn't support multiple databases open at the same time. */ PR_Lock(nss_initlock); curlerr = nss_init(conn->data); if(CURLE_OK != curlerr) { PR_Unlock(nss_initlock); goto error; } curlerr = CURLE_SSL_CONNECT_ERROR; if(!mod) { char *configstring = aprintf("library=%s name=PEM", pem_library); if(!configstring) { PR_Unlock(nss_initlock); goto error; } mod = SECMOD_LoadUserModule(configstring, NULL, PR_FALSE); free(configstring); if(!mod || !mod->loaded) { if(mod) { SECMOD_DestroyModule(mod); mod = NULL; } infof(data, "WARNING: failed to load NSS PEM library %s. Using " "OpenSSL PEM certificates will not work.\n", pem_library); } } PK11_SetPasswordFunc(nss_get_password); PR_Unlock(nss_initlock); model = PR_NewTCPSocket(); if(!model) goto error; model = SSL_ImportFD(NULL, model); if(SSL_OptionSet(model, SSL_SECURITY, PR_TRUE) != SECSuccess) goto error; if(SSL_OptionSet(model, SSL_HANDSHAKE_AS_SERVER, PR_FALSE) != SECSuccess) goto error; if(SSL_OptionSet(model, SSL_HANDSHAKE_AS_CLIENT, PR_TRUE) != SECSuccess) goto error; /* do not use SSL cache if disabled or we are not going to verify peer */ ssl_no_cache = (conn->ssl_config.sessionid && data->set.ssl.verifypeer) ? PR_FALSE : PR_TRUE; if(SSL_OptionSet(model, SSL_NO_CACHE, ssl_no_cache) != SECSuccess) goto error; /* enable/disable the requested SSL version(s) */ if(nss_init_sslver(&sslver, data) != CURLE_OK) goto error; if(SSL_VersionRangeSet(model, &sslver) != SECSuccess) goto error; ssl_cbc_random_iv = !data->set.ssl_enable_beast; #ifdef SSL_CBC_RANDOM_IV /* unless the user explicitly asks to allow the protocol vulnerability, we use the work-around */ if(SSL_OptionSet(model, SSL_CBC_RANDOM_IV, ssl_cbc_random_iv) != SECSuccess) infof(data, "warning: failed to set SSL_CBC_RANDOM_IV = %d\n", ssl_cbc_random_iv); #else if(ssl_cbc_random_iv) infof(data, "warning: support for SSL_CBC_RANDOM_IV not compiled in\n"); #endif /* reset the flag to avoid an infinite loop */ data->state.ssl_connect_retry = FALSE; /* enable all ciphers from enable_ciphers_by_default */ cipher_to_enable = enable_ciphers_by_default; while(SSL_NULL_WITH_NULL_NULL != *cipher_to_enable) { if(SSL_CipherPrefSet(model, *cipher_to_enable, PR_TRUE) != SECSuccess) { curlerr = CURLE_SSL_CIPHER; goto error; } cipher_to_enable++; } if(data->set.ssl.cipher_list) { if(set_ciphers(data, model, data->set.ssl.cipher_list) != SECSuccess) { curlerr = CURLE_SSL_CIPHER; goto error; } } if(!data->set.ssl.verifypeer && data->set.ssl.verifyhost) infof(data, "warning: ignoring value of ssl.verifyhost\n"); /* bypass the default SSL_AuthCertificate() hook in case we do not want to * verify peer */ if(SSL_AuthCertificateHook(model, nss_auth_cert_hook, conn) != SECSuccess) goto error; data->set.ssl.certverifyresult=0; /* not checked yet */ if(SSL_BadCertHook(model, BadCertHandler, conn) != SECSuccess) goto error; if(SSL_HandshakeCallback(model, HandshakeCallback, NULL) != SECSuccess) goto error; if(data->set.ssl.verifypeer) { const CURLcode rv = nss_load_ca_certificates(conn, sockindex); if(CURLE_OK != rv) { curlerr = rv; goto error; } } if(data->set.ssl.CRLfile) { if(SECSuccess != nss_load_crl(data->set.ssl.CRLfile)) { curlerr = CURLE_SSL_CRL_BADFILE; goto error; } infof(data, " CRLfile: %s\n", data->set.ssl.CRLfile ? data->set.ssl.CRLfile : "none"); } if(data->set.str[STRING_CERT]) { char *nickname = dup_nickname(data, STRING_CERT); if(nickname) { /* we are not going to use libnsspem.so to read the client cert */ connssl->obj_clicert = NULL; } else { CURLcode rv = cert_stuff(conn, sockindex, data->set.str[STRING_CERT], data->set.str[STRING_KEY]); if(CURLE_OK != rv) { /* failf() is already done in cert_stuff() */ curlerr = rv; goto error; } } /* store the nickname for SelectClientCert() called during handshake */ connssl->client_nickname = nickname; } else connssl->client_nickname = NULL; if(SSL_GetClientAuthDataHook(model, SelectClientCert, (void *)connssl) != SECSuccess) { curlerr = CURLE_SSL_CERTPROBLEM; goto error; } /* Import our model socket onto the existing file descriptor */ connssl->handle = PR_ImportTCPSocket(sockfd); connssl->handle = SSL_ImportFD(model, connssl->handle); if(!connssl->handle) goto error; PR_Close(model); /* We don't need this any more */ model = NULL; /* This is the password associated with the cert that we're using */ if(data->set.str[STRING_KEY_PASSWD]) { SSL_SetPKCS11PinArg(connssl->handle, data->set.str[STRING_KEY_PASSWD]); } /* Force handshake on next I/O */ SSL_ResetHandshake(connssl->handle, /* asServer */ PR_FALSE); SSL_SetURL(connssl->handle, conn->host.name); /* check timeout situation */ time_left = Curl_timeleft(data, NULL, TRUE); if(time_left < 0L) { failf(data, "timed out before SSL handshake"); curlerr = CURLE_OPERATION_TIMEDOUT; goto error; } timeout = PR_MillisecondsToInterval((PRUint32) time_left); /* Force the handshake now */ if(SSL_ForceHandshakeWithTimeout(connssl->handle, timeout) != SECSuccess) { if(conn->data->set.ssl.certverifyresult == SSL_ERROR_BAD_CERT_DOMAIN) curlerr = CURLE_PEER_FAILED_VERIFICATION; else if(conn->data->set.ssl.certverifyresult!=0) curlerr = CURLE_SSL_CACERT; goto error; } /* switch the SSL socket into non-blocking mode */ sock_opt.option = PR_SockOpt_Nonblocking; sock_opt.value.non_blocking = PR_TRUE; if(PR_SetSocketOption(connssl->handle, &sock_opt) != PR_SUCCESS) goto error; connssl->state = ssl_connection_complete; conn->recv[sockindex] = nss_recv; conn->send[sockindex] = nss_send; display_conn_info(conn, connssl->handle); if(data->set.str[STRING_SSL_ISSUERCERT]) { SECStatus ret = SECFailure; char *nickname = dup_nickname(data, STRING_SSL_ISSUERCERT); if(nickname) { /* we support only nicknames in case of STRING_SSL_ISSUERCERT for now */ ret = check_issuer_cert(connssl->handle, nickname); free(nickname); } if(SECFailure == ret) { infof(data,"SSL certificate issuer check failed\n"); curlerr = CURLE_SSL_ISSUER_ERROR; goto error; } else { infof(data, "SSL certificate issuer check ok\n"); } } return CURLE_OK; error: /* reset the flag to avoid an infinite loop */ data->state.ssl_connect_retry = FALSE; if(is_nss_error(curlerr)) { /* read NSPR error code */ err = PR_GetError(); if(is_cc_error(err)) curlerr = CURLE_SSL_CERTPROBLEM; /* print the error number and error string */ infof(data, "NSS error %d (%s)\n", err, nss_error_to_name(err)); /* print a human-readable message describing the error if available */ nss_print_error_message(data, err); } if(model) PR_Close(model); /* cleanup on connection failure */ Curl_llist_destroy(connssl->obj_list, NULL); connssl->obj_list = NULL; if((sslver.min == SSL_LIBRARY_VERSION_3_0) && (sslver.max == SSL_LIBRARY_VERSION_TLS_1_0) && isTLSIntoleranceError(err)) { /* schedule reconnect through Curl_retry_request() */ data->state.ssl_connect_retry = TRUE; infof(data, "Error in TLS handshake, trying SSLv3...\n"); return CURLE_OK; } return curlerr; } static ssize_t nss_send(struct connectdata *conn, /* connection data */ int sockindex, /* socketindex */ const void *mem, /* send this data */ size_t len, /* amount to write */ CURLcode *curlcode) { ssize_t rc = PR_Send(conn->ssl[sockindex].handle, mem, (int)len, 0, PR_INTERVAL_NO_WAIT); if(rc < 0) { PRInt32 err = PR_GetError(); if(err == PR_WOULD_BLOCK_ERROR) *curlcode = CURLE_AGAIN; else { /* print the error number and error string */ const char *err_name = nss_error_to_name(err); infof(conn->data, "SSL write: error %d (%s)\n", err, err_name); /* print a human-readable message describing the error if available */ nss_print_error_message(conn->data, err); *curlcode = (is_cc_error(err)) ? CURLE_SSL_CERTPROBLEM : CURLE_SEND_ERROR; } return -1; } return rc; /* number of bytes */ } static ssize_t nss_recv(struct connectdata * conn, /* connection data */ int num, /* socketindex */ char *buf, /* store read data here */ size_t buffersize, /* max amount to read */ CURLcode *curlcode) { ssize_t nread = PR_Recv(conn->ssl[num].handle, buf, (int)buffersize, 0, PR_INTERVAL_NO_WAIT); if(nread < 0) { /* failed SSL read */ PRInt32 err = PR_GetError(); if(err == PR_WOULD_BLOCK_ERROR) *curlcode = CURLE_AGAIN; else { /* print the error number and error string */ const char *err_name = nss_error_to_name(err); infof(conn->data, "SSL read: errno %d (%s)\n", err, err_name); /* print a human-readable message describing the error if available */ nss_print_error_message(conn->data, err); *curlcode = (is_cc_error(err)) ? CURLE_SSL_CERTPROBLEM : CURLE_RECV_ERROR; } return -1; } return nread; } size_t Curl_nss_version(char *buffer, size_t size) { return snprintf(buffer, size, "NSS/%s", NSS_VERSION); } int Curl_nss_seed(struct SessionHandle *data) { /* make sure that NSS is initialized */ return !!Curl_nss_force_init(data); } void Curl_nss_random(struct SessionHandle *data, unsigned char *entropy, size_t length) { Curl_nss_seed(data); /* Initiate the seed if not already done */ if(SECSuccess != PK11_GenerateRandom(entropy, curlx_uztosi(length))) { /* no way to signal a failure from here, we have to abort */ failf(data, "PK11_GenerateRandom() failed, calling abort()..."); abort(); } } void Curl_nss_md5sum(unsigned char *tmp, /* input */ size_t tmplen, unsigned char *md5sum, /* output */ size_t md5len) { PK11Context *MD5pw = PK11_CreateDigestContext(SEC_OID_MD5); unsigned int MD5out; PK11_DigestOp(MD5pw, tmp, curlx_uztoui(tmplen)); PK11_DigestFinal(MD5pw, md5sum, &MD5out, curlx_uztoui(md5len)); PK11_DestroyContext(MD5pw, PR_TRUE); } #endif /* USE_NSS */ curl-7.35.0/lib/vtls/gtls.c0000644000175000017500000010725612270035364012364 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ /* * Source file for all GnuTLS-specific code for the TLS/SSL layer. No code * but vtls.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 "curl_setup.h" #ifdef USE_GNUTLS #include #include #ifdef USE_GNUTLS_NETTLE #include #include #else #include #endif #include "urldata.h" #include "sendf.h" #include "inet_pton.h" #include "gtls.h" #include "vtls.h" #include "parsedate.h" #include "connect.h" /* for the connect timeout */ #include "select.h" #include "rawstr.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* Some hackish cast macros based on: http://library.gnome.org/devel/glib/unstable/glib-Type-Conversion-Macros.html */ #ifndef GNUTLS_POINTER_TO_INT_CAST #define GNUTLS_POINTER_TO_INT_CAST(p) ((int) (long) (p)) #endif #ifndef GNUTLS_INT_TO_POINTER_CAST #define GNUTLS_INT_TO_POINTER_CAST(i) ((void*) (long) (i)) #endif /* 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 static bool gtls_inited = FALSE; #if defined(GNUTLS_VERSION_NUMBER) # if (GNUTLS_VERSION_NUMBER >= 0x020c00) # undef gnutls_transport_set_lowat # define gnutls_transport_set_lowat(A,B) Curl_nop_stmt # define USE_GNUTLS_PRIORITY_SET_DIRECT 1 # endif # if (GNUTLS_VERSION_NUMBER >= 0x020c03) # define GNUTLS_MAPS_WINSOCK_ERRORS 1 # endif #endif /* * Custom push and pull callback functions used by GNU TLS to read and write * to the socket. These functions are simple wrappers to send() and recv() * (although here using the sread/swrite macros as defined by * curl_setup_once.h). * We use custom functions rather than the GNU TLS defaults because it allows * us to get specific about the fourth "flags" argument, and to use arbitrary * private data with gnutls_transport_set_ptr if we wish. * * When these custom push and pull callbacks fail, GNU TLS checks its own * session-specific error variable, and when not set also its own global * errno variable, in order to take appropriate action. GNU TLS does not * require that the transport is actually a socket. This implies that for * Windows builds these callbacks should ideally set the session-specific * error variable using function gnutls_transport_set_errno or as a last * resort global errno variable using gnutls_transport_set_global_errno, * with a transport agnostic error value. This implies that some winsock * error translation must take place in these callbacks. * * Paragraph above applies to GNU TLS versions older than 2.12.3, since * this version GNU TLS does its own internal winsock error translation * using system_errno() function. */ #if defined(USE_WINSOCK) && !defined(GNUTLS_MAPS_WINSOCK_ERRORS) # define gtls_EINTR 4 # define gtls_EIO 5 # define gtls_EAGAIN 11 static int gtls_mapped_sockerrno(void) { switch(SOCKERRNO) { case WSAEWOULDBLOCK: return gtls_EAGAIN; case WSAEINTR: return gtls_EINTR; default: break; } return gtls_EIO; } #endif static ssize_t Curl_gtls_push(void *s, const void *buf, size_t len) { ssize_t ret = swrite(GNUTLS_POINTER_TO_INT_CAST(s), buf, len); #if defined(USE_WINSOCK) && !defined(GNUTLS_MAPS_WINSOCK_ERRORS) if(ret < 0) gnutls_transport_set_global_errno(gtls_mapped_sockerrno()); #endif return ret; } static ssize_t Curl_gtls_pull(void *s, void *buf, size_t len) { ssize_t ret = sread(GNUTLS_POINTER_TO_INT_CAST(s), buf, len); #if defined(USE_WINSOCK) && !defined(GNUTLS_MAPS_WINSOCK_ERRORS) if(ret < 0) gnutls_transport_set_global_errno(gtls_mapped_sockerrno()); #endif return ret; } /* Curl_gtls_init() * * Global GnuTLS init, called from Curl_ssl_init(). This calls functions that * are not thread-safe and thus this function itself is not thread-safe and * must only be called from within curl_global_init() to keep the thread * situation under control! */ int Curl_gtls_init(void) { int ret = 1; if(!gtls_inited) { ret = gnutls_global_init()?0:1; #ifdef GTLSDEBUG gnutls_global_set_log_function(tls_log_func); gnutls_global_set_log_level(2); #endif gtls_inited = TRUE; } return ret; } int Curl_gtls_cleanup(void) { if(gtls_inited) { gnutls_global_deinit(); gtls_inited = FALSE; } return 1; } static void showtime(struct SessionHandle *data, const char *text, time_t stamp) { struct tm buffer; const struct tm *tm = &buffer; CURLcode result = Curl_gmtime(stamp, &buffer); if(result) return; 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\n", data->state.buffer); } static gnutls_datum load_file (const char *file) { FILE *f; gnutls_datum loaded_file = { NULL, 0 }; long filelen; void *ptr; if(!(f = fopen(file, "r"))) return loaded_file; if(fseek(f, 0, SEEK_END) != 0 || (filelen = ftell(f)) < 0 || fseek(f, 0, SEEK_SET) != 0 || !(ptr = malloc((size_t)filelen))) goto out; if(fread(ptr, 1, (size_t)filelen, f) < (size_t)filelen) { free(ptr); goto out; } loaded_file.data = ptr; loaded_file.size = (unsigned int)filelen; out: fclose(f); return loaded_file; } static void unload_file(gnutls_datum data) { free(data.data); } /* this function does a SSL/TLS (re-)handshake */ static CURLcode handshake(struct connectdata *conn, int sockindex, bool duringconnect, bool nonblocking) { struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; gnutls_session session = conn->ssl[sockindex].session; curl_socket_t sockfd = conn->sock[sockindex]; long timeout_ms; int rc; int what; for(;;) { /* check allowed time left */ timeout_ms = Curl_timeleft(data, NULL, duringconnect); if(timeout_ms < 0) { /* no need to continue if time already is up */ failf(data, "SSL connection timeout"); return CURLE_OPERATION_TIMEDOUT; } /* 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) { curl_socket_t writefd = ssl_connect_2_writing== connssl->connecting_state?sockfd:CURL_SOCKET_BAD; curl_socket_t readfd = ssl_connect_2_reading== connssl->connecting_state?sockfd:CURL_SOCKET_BAD; what = Curl_socket_ready(readfd, writefd, nonblocking?0: timeout_ms?timeout_ms:1000); if(what < 0) { /* fatal error */ failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); return CURLE_SSL_CONNECT_ERROR; } else if(0 == what) { if(nonblocking) return CURLE_OK; else if(timeout_ms) { /* timeout */ failf(data, "SSL connection timeout at %ld", timeout_ms); return CURLE_OPERATION_TIMEDOUT; } } /* socket is readable or writable */ } rc = gnutls_handshake(session); if((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)) { connssl->connecting_state = gnutls_record_get_direction(session)? ssl_connect_2_writing:ssl_connect_2_reading; continue; if(nonblocking) return CURLE_OK; } else if((rc < 0) && !gnutls_error_is_fatal(rc)) { const char *strerr = NULL; if(rc == GNUTLS_E_WARNING_ALERT_RECEIVED) { int alert = gnutls_alert_get(session); strerr = gnutls_alert_get_name(alert); } if(strerr == NULL) strerr = gnutls_strerror(rc); failf(data, "gnutls_handshake() warning: %s", strerr); } else if(rc < 0) { const char *strerr = NULL; if(rc == GNUTLS_E_FATAL_ALERT_RECEIVED) { int alert = gnutls_alert_get(session); strerr = gnutls_alert_get_name(alert); } if(strerr == NULL) strerr = gnutls_strerror(rc); failf(data, "gnutls_handshake() failed: %s", strerr); return CURLE_SSL_CONNECT_ERROR; } /* Reset our connect state machine */ connssl->connecting_state = ssl_connect_1; 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_raw_equal(type, "PEM")) return GNUTLS_X509_FMT_PEM; if(Curl_raw_equal(type, "DER")) return GNUTLS_X509_FMT_DER; return -1; } static CURLcode gtls_connect_step1(struct connectdata *conn, int sockindex) { struct SessionHandle *data = conn->data; gnutls_session session; int rc; void *ssl_sessionid; size_t ssl_idsize; bool sni = TRUE; /* default is SNI enabled */ #ifdef ENABLE_IPV6 struct in6_addr addr; #else struct in_addr addr; #endif #ifndef USE_GNUTLS_PRIORITY_SET_DIRECT static int cipher_priority[] = { GNUTLS_CIPHER_AES_128_GCM, GNUTLS_CIPHER_AES_256_GCM, GNUTLS_CIPHER_AES_128_CBC, GNUTLS_CIPHER_AES_256_CBC, GNUTLS_CIPHER_CAMELLIA_128_CBC, GNUTLS_CIPHER_CAMELLIA_256_CBC, GNUTLS_CIPHER_3DES_CBC, }; static const int cert_type_priority[] = { GNUTLS_CRT_X509, 0 }; static int protocol_priority[] = { 0, 0, 0, 0 }; #else #define GNUTLS_CIPHERS "NORMAL:-ARCFOUR-128:-CTYPE-ALL:+CTYPE-X509" const char* prioritylist; const char *err; #endif if(conn->ssl[sockindex].state == ssl_connection_complete) /* to make us tolerant against being called more than once for the same connection */ return CURLE_OK; if(!gtls_inited) Curl_gtls_init(); /* GnuTLS only supports SSLv3 and TLSv1 */ if(data->set.ssl.version == CURL_SSLVERSION_SSLv2) { failf(data, "GnuTLS does not support SSLv2"); return CURLE_SSL_CONNECT_ERROR; } else if(data->set.ssl.version == CURL_SSLVERSION_SSLv3) sni = FALSE; /* SSLv3 has no SNI */ /* allocate a cred struct */ rc = gnutls_certificate_allocate_credentials(&conn->ssl[sockindex].cred); if(rc != GNUTLS_E_SUCCESS) { failf(data, "gnutls_cert_all_cred() failed: %s", gnutls_strerror(rc)); return CURLE_SSL_CONNECT_ERROR; } #ifdef USE_TLS_SRP if(data->set.ssl.authtype == CURL_TLSAUTH_SRP) { infof(data, "Using TLS-SRP username: %s\n", data->set.ssl.username); rc = gnutls_srp_allocate_client_credentials( &conn->ssl[sockindex].srp_client_cred); if(rc != GNUTLS_E_SUCCESS) { failf(data, "gnutls_srp_allocate_client_cred() failed: %s", gnutls_strerror(rc)); return CURLE_OUT_OF_MEMORY; } rc = gnutls_srp_set_client_credentials(conn->ssl[sockindex]. srp_client_cred, data->set.ssl.username, data->set.ssl.password); if(rc != GNUTLS_E_SUCCESS) { failf(data, "gnutls_srp_set_client_cred() failed: %s", gnutls_strerror(rc)); return CURLE_BAD_FUNCTION_ARGUMENT; } } #endif 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); } if(data->set.ssl.CRLfile) { /* set the CRL list file */ rc = gnutls_certificate_set_x509_crl_file(conn->ssl[sockindex].cred, data->set.ssl.CRLfile, GNUTLS_X509_FMT_PEM); if(rc < 0) { failf(data, "error reading crl file %s (%s)", data->set.ssl.CRLfile, gnutls_strerror(rc)); return CURLE_SSL_CRL_BADFILE; } else infof(data, "found %d CRL in %s\n", rc, data->set.ssl.CRLfile); } /* Initialize TLS session as a client */ rc = gnutls_init(&conn->ssl[sockindex].session, GNUTLS_CLIENT); if(rc != GNUTLS_E_SUCCESS) { failf(data, "gnutls_init() failed: %d", rc); return CURLE_SSL_CONNECT_ERROR; } /* convenient assign */ session = conn->ssl[sockindex].session; if((0 == Curl_inet_pton(AF_INET, conn->host.name, &addr)) && #ifdef ENABLE_IPV6 (0 == Curl_inet_pton(AF_INET6, conn->host.name, &addr)) && #endif sni && (gnutls_server_name_set(session, GNUTLS_NAME_DNS, conn->host.name, strlen(conn->host.name)) < 0)) infof(data, "WARNING: failed to configure server name indication (SNI) " "TLS extension\n"); /* Use default priorities */ rc = gnutls_set_default_priority(session); if(rc != GNUTLS_E_SUCCESS) return CURLE_SSL_CONNECT_ERROR; #ifndef USE_GNUTLS_PRIORITY_SET_DIRECT rc = gnutls_cipher_set_priority(session, cipher_priority); if(rc != GNUTLS_E_SUCCESS) 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 != GNUTLS_E_SUCCESS) return CURLE_SSL_CONNECT_ERROR; if(data->set.ssl.cipher_list != NULL) { failf(data, "can't pass a custom cipher list to older GnuTLS" " versions"); return CURLE_SSL_CONNECT_ERROR; } switch (data->set.ssl.version) { case CURL_SSLVERSION_SSLv3: protocol_priority[0] = GNUTLS_SSL3; break; case CURL_SSLVERSION_DEFAULT: case CURL_SSLVERSION_TLSv1: protocol_priority[0] = GNUTLS_TLS1_0; protocol_priority[1] = GNUTLS_TLS1_1; protocol_priority[2] = GNUTLS_TLS1_2; break; case CURL_SSLVERSION_TLSv1_0: protocol_priority[0] = GNUTLS_TLS1_0; break; case CURL_SSLVERSION_TLSv1_1: protocol_priority[0] = GNUTLS_TLS1_1; break; case CURL_SSLVERSION_TLSv1_2: protocol_priority[0] = GNUTLS_TLS1_2; break; case CURL_SSLVERSION_SSLv2: default: failf(data, "GnuTLS does not support SSLv2"); return CURLE_SSL_CONNECT_ERROR; break; } rc = gnutls_protocol_set_priority(session, protocol_priority); #else switch (data->set.ssl.version) { case CURL_SSLVERSION_SSLv3: prioritylist = GNUTLS_CIPHERS ":-VERS-TLS-ALL:+VERS-SSL3.0"; sni = false; break; case CURL_SSLVERSION_DEFAULT: case CURL_SSLVERSION_TLSv1: prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0"; break; case CURL_SSLVERSION_TLSv1_0: prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:" "+VERS-TLS1.0"; break; case CURL_SSLVERSION_TLSv1_1: prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:" "+VERS-TLS1.1"; break; case CURL_SSLVERSION_TLSv1_2: prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:" "+VERS-TLS1.2"; break; case CURL_SSLVERSION_SSLv2: default: failf(data, "GnuTLS does not support SSLv2"); return CURLE_SSL_CONNECT_ERROR; break; } rc = gnutls_priority_set_direct(session, prioritylist, &err); #endif if(rc != GNUTLS_E_SUCCESS) { failf(data, "Did you pass a valid GnuTLS cipher list?"); return CURLE_SSL_CONNECT_ERROR; } if(data->set.str[STRING_CERT]) { if(gnutls_certificate_set_x509_key_file( conn->ssl[sockindex].cred, data->set.str[STRING_CERT], data->set.str[STRING_KEY] ? data->set.str[STRING_KEY] : data->set.str[STRING_CERT], do_file_type(data->set.str[STRING_CERT_TYPE]) ) != GNUTLS_E_SUCCESS) { failf(data, "error reading X.509 key or certificate file"); return CURLE_SSL_CONNECT_ERROR; } } #ifdef USE_TLS_SRP /* put the credentials to the current session */ if(data->set.ssl.authtype == CURL_TLSAUTH_SRP) { rc = gnutls_credentials_set(session, GNUTLS_CRD_SRP, conn->ssl[sockindex].srp_client_cred); if(rc != GNUTLS_E_SUCCESS) failf(data, "gnutls_credentials_set() failed: %s", gnutls_strerror(rc)); } else #endif 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_INT_TO_POINTER_CAST(conn->sock[sockindex])); /* register callback functions to send and receive data. */ gnutls_transport_set_push_function(session, Curl_gtls_push); gnutls_transport_set_pull_function(session, Curl_gtls_pull); /* lowat must be set to zero when using custom push and pull functions. */ gnutls_transport_set_lowat(session, 0); /* 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"); } return CURLE_OK; } static Curl_recv gtls_recv; static Curl_send gtls_send; static CURLcode gtls_connect_step3(struct connectdata *conn, int sockindex) { unsigned int cert_list_size; const gnutls_datum *chainp; unsigned int verify_status; gnutls_x509_crt x509_cert,x509_issuer; gnutls_datum issuerp; char certbuf[256]; /* big enough? */ size_t size; unsigned int algo; unsigned int bits; time_t certclock; const char *ptr; struct SessionHandle *data = conn->data; gnutls_session session = conn->ssl[sockindex].session; int rc; int incache; void *ssl_sessionid; CURLcode result = CURLE_OK; /* 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.verifypeer || data->set.ssl.verifyhost || data->set.ssl.issuercert) { #ifdef USE_TLS_SRP if(data->set.ssl.authtype == CURL_TLSAUTH_SRP && data->set.ssl.username != NULL && !data->set.ssl.verifypeer && gnutls_cipher_get(session)) { /* no peer cert, but auth is ok if we have SRP user and cipher and no peer verify */ } else { #endif failf(data, "failed to get server cert"); return CURLE_PEER_FAILED_VERIFICATION; #ifdef USE_TLS_SRP } #endif } infof(data, "\t common name: WARNING couldn't obtain\n"); } if(data->set.ssl.verifypeer) { /* 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 " "CRLfile: %s", data->set.ssl.CAfile?data->set.ssl.CAfile:"none", data->set.ssl.CRLfile?data->set.ssl.CRLfile:"none"); return CURLE_SSL_CACERT; } else infof(data, "\t server certificate verification FAILED\n"); } else infof(data, "\t server certificate verification OK\n"); } else infof(data, "\t server certificate verification SKIPPED\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); if(data->set.ssl.issuercert) { gnutls_x509_crt_init(&x509_issuer); issuerp = load_file(data->set.ssl.issuercert); gnutls_x509_crt_import(x509_issuer, &issuerp, GNUTLS_X509_FMT_PEM); rc = gnutls_x509_crt_check_issuer(x509_cert,x509_issuer); unload_file(issuerp); if(rc <= 0) { failf(data, "server certificate issuer check failed (IssuerCert: %s)", data->set.ssl.issuercert?data->set.ssl.issuercert:"none"); return CURLE_SSL_ISSUER_ERROR; } infof(data,"\t server certificate issuer check OK (Issuer Cert: %s)\n", data->set.ssl.issuercert?data->set.ssl.issuercert:"none"); } 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) { 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_PEER_FAILED_VERIFICATION; } 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); /* Check for time-based validity */ certclock = gnutls_x509_crt_get_expiration_time(x509_cert); if(certclock == (time_t)-1) { failf(data, "server cert expiration date verify failed"); return CURLE_SSL_CONNECT_ERROR; } if(certclock < time(NULL)) { if(data->set.ssl.verifypeer) { failf(data, "server certificate expiration date has passed."); return CURLE_PEER_FAILED_VERIFICATION; } else infof(data, "\t server certificate expiration date FAILED\n"); } else infof(data, "\t server certificate expiration date OK\n"); certclock = gnutls_x509_crt_get_activation_time(x509_cert); if(certclock == (time_t)-1) { failf(data, "server cert activation date verify failed"); return CURLE_SSL_CONNECT_ERROR; } if(certclock > time(NULL)) { if(data->set.ssl.verifypeer) { failf(data, "server certificate not activated yet."); return CURLE_PEER_FAILED_VERIFICATION; } else infof(data, "\t server certificate activation date FAILED\n"); } else infof(data, "\t server certificate activation date OK\n"); /* 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); certclock = gnutls_x509_crt_get_activation_time(x509_cert); showtime(data, "start date", certclock); certclock = gnutls_x509_crt_get_expiration_time(x509_cert); showtime(data, "expire date", certclock); 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); conn->ssl[sockindex].state = ssl_connection_complete; conn->recv[sockindex] = gtls_recv; conn->send[sockindex] = gtls_send; { /* we always unconditionally get the session id here, as even if we already got it from the cache and asked to use it in the connection, it might've been rejected and then a new one is in use now and we need to detect that. */ void *connect_sessionid; size_t connect_idsize; /* get the session ID data size */ gnutls_session_get_data(session, NULL, &connect_idsize); connect_sessionid = malloc(connect_idsize); /* get a buffer for it */ if(connect_sessionid) { /* extract session ID to the allocated buffer */ gnutls_session_get_data(session, connect_sessionid, &connect_idsize); incache = !(Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL)); if(incache) { /* there was one before in the cache, so instead of risking that the previous one was rejected, we just kill that and store the new */ Curl_ssl_delsessionid(conn, ssl_sessionid); } /* store this session id */ result = Curl_ssl_addsessionid(conn, connect_sessionid, connect_idsize); if(result) { free(connect_sessionid); result = CURLE_OUT_OF_MEMORY; } } else result = CURLE_OUT_OF_MEMORY; } return result; } /* * This function is called after the TCP connect has completed. Setup the TLS * layer and do all necessary magic. */ /* We use connssl->connecting_state to keep track of the connection status; there are three states: 'ssl_connect_1' (not started yet or complete), 'ssl_connect_2_reading' (waiting for data from server), and 'ssl_connect_2_writing' (waiting to be able to write). */ static CURLcode gtls_connect_common(struct connectdata *conn, int sockindex, bool nonblocking, bool *done) { int rc; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; /* Initiate the connection, if not already done */ if(ssl_connect_1==connssl->connecting_state) { rc = gtls_connect_step1 (conn, sockindex); if(rc) return rc; } rc = handshake(conn, sockindex, TRUE, nonblocking); if(rc) /* handshake() sets its own error message with failf() */ return rc; /* Finish connecting once the handshake is done */ if(ssl_connect_1==connssl->connecting_state) { rc = gtls_connect_step3(conn, sockindex); if(rc) return rc; } *done = ssl_connect_1==connssl->connecting_state; return CURLE_OK; } CURLcode Curl_gtls_connect_nonblocking(struct connectdata *conn, int sockindex, bool *done) { return gtls_connect_common(conn, sockindex, TRUE, done); } CURLcode Curl_gtls_connect(struct connectdata *conn, int sockindex) { CURLcode retcode; bool done = FALSE; retcode = gtls_connect_common(conn, sockindex, FALSE, &done); if(retcode) return retcode; DEBUGASSERT(done); return CURLE_OK; } static ssize_t gtls_send(struct connectdata *conn, int sockindex, const void *mem, size_t len, CURLcode *curlcode) { ssize_t rc = gnutls_record_send(conn->ssl[sockindex].session, mem, len); if(rc < 0 ) { *curlcode = (rc == GNUTLS_E_AGAIN) ? CURLE_AGAIN : CURLE_SEND_ERROR; rc = -1; } 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 idx) { if(conn->ssl[idx].session) { gnutls_bye(conn->ssl[idx].session, GNUTLS_SHUT_RDWR); gnutls_deinit(conn->ssl[idx].session); conn->ssl[idx].session = NULL; } if(conn->ssl[idx].cred) { gnutls_certificate_free_credentials(conn->ssl[idx].cred); conn->ssl[idx].cred = NULL; } #ifdef USE_TLS_SRP if(conn->ssl[idx].srp_client_cred) { gnutls_srp_free_client_credentials(conn->ssl[idx].srp_client_cred); conn->ssl[idx].srp_client_cred = NULL; } #endif } void Curl_gtls_close(struct connectdata *conn, int sockindex) { close_one(conn, sockindex); } /* * This function is called to shut down the SSL layer but keep the * socket open (CCC - Clear Command Channel) */ int Curl_gtls_shutdown(struct connectdata *conn, int sockindex) { ssize_t result; int retval = 0; struct SessionHandle *data = conn->data; int done = 0; char buf[120]; /* This has only been tested on the proftpd server, and the mod_tls code sends a close notify alert without waiting for a close notify alert in response. Thus we wait for a close notify alert from the server, but we do not send one. Let's hope other servers do the same... */ if(data->set.ftp_ccc == CURLFTPSSL_CCC_ACTIVE) gnutls_bye(conn->ssl[sockindex].session, GNUTLS_SHUT_WR); if(conn->ssl[sockindex].session) { while(!done) { int what = Curl_socket_ready(conn->sock[sockindex], CURL_SOCKET_BAD, SSL_SHUTDOWN_TIMEOUT); if(what > 0) { /* Something to read, let's do it and hope that it is the close notify alert from the server */ result = gnutls_record_recv(conn->ssl[sockindex].session, buf, sizeof(buf)); switch(result) { case 0: /* This is the expected response. There was no data but only the close notify alert */ done = 1; break; case GNUTLS_E_AGAIN: case GNUTLS_E_INTERRUPTED: infof(data, "GNUTLS_E_AGAIN || GNUTLS_E_INTERRUPTED\n"); break; default: retval = -1; done = 1; break; } } else if(0 == what) { /* timeout */ failf(data, "SSL shutdown timeout"); done = 1; break; } else { /* anything that gets here is fatally bad */ failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); retval = -1; done = 1; } } gnutls_deinit(conn->ssl[sockindex].session); } gnutls_certificate_free_credentials(conn->ssl[sockindex].cred); #ifdef USE_TLS_SRP if(data->set.ssl.authtype == CURL_TLSAUTH_SRP && data->set.ssl.username != NULL) gnutls_srp_free_client_credentials(conn->ssl[sockindex].srp_client_cred); #endif conn->ssl[sockindex].cred = NULL; conn->ssl[sockindex].session = NULL; return retval; } static ssize_t gtls_recv(struct connectdata *conn, /* connection data */ int num, /* socketindex */ char *buf, /* store read data here */ size_t buffersize, /* max amount to read */ CURLcode *curlcode) { ssize_t ret; ret = gnutls_record_recv(conn->ssl[num].session, buf, buffersize); if((ret == GNUTLS_E_AGAIN) || (ret == GNUTLS_E_INTERRUPTED)) { *curlcode = CURLE_AGAIN; 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, num, FALSE, FALSE); if(rc) /* handshake() writes error message on its own */ *curlcode = rc; else *curlcode = CURLE_AGAIN; /* then return as if this was a wouldblock */ return -1; } if(ret < 0) { failf(conn->data, "GnuTLS recv error (%d): %s", (int)ret, gnutls_strerror((int)ret)); *curlcode = CURLE_RECV_ERROR; 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)); } int Curl_gtls_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; /* Quickly add a bit of entropy */ #ifndef USE_GNUTLS_NETTLE gcry_fast_random_poll(); #endif if(!ssl_seeded || data->set.str[STRING_SSL_RANDOM_FILE] || data->set.str[STRING_SSL_EGDSOCKET]) { /* TODO: to a good job seeding the RNG This may involve the gcry_control function and these options: GCRYCTL_SET_RANDOM_SEED_FILE GCRYCTL_SET_RNDEGD_SOCKET */ ssl_seeded = TRUE; } return 0; } void Curl_gtls_random(struct SessionHandle *data, unsigned char *entropy, size_t length) { #if defined(USE_GNUTLS_NETTLE) (void)data; gnutls_rnd(GNUTLS_RND_RANDOM, entropy, length); #elif defined(USE_GNUTLS) Curl_gtls_seed(data); /* Initiate the seed if not already done */ gcry_randomize(entropy, length, GCRY_STRONG_RANDOM); #endif } void Curl_gtls_md5sum(unsigned char *tmp, /* input */ size_t tmplen, unsigned char *md5sum, /* output */ size_t md5len) { #if defined(USE_GNUTLS_NETTLE) struct md5_ctx MD5pw; md5_init(&MD5pw); md5_update(&MD5pw, (unsigned int)tmplen, tmp); md5_digest(&MD5pw, (unsigned int)md5len, md5sum); #elif defined(USE_GNUTLS) gcry_md_hd_t MD5pw; gcry_md_open(&MD5pw, GCRY_MD_MD5, 0); gcry_md_write(MD5pw, tmp, tmplen); memcpy(md5sum, gcry_md_read (MD5pw, 0), md5len); gcry_md_close(MD5pw); #endif } #endif /* USE_GNUTLS */ curl-7.35.0/lib/vtls/cyassl.c0000644000175000017500000004355712270035364012714 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* * Source file for all CyaSSL-specific code for the TLS/SSL layer. No code * but vtls.c should ever call or use these functions. * */ #include "curl_setup.h" #ifdef USE_CYASSL #ifdef HAVE_LIMITS_H #include #endif #include "urldata.h" #include "sendf.h" #include "inet_pton.h" #include "cyassl.h" #include "vtls.h" #include "parsedate.h" #include "connect.h" /* for the connect timeout */ #include "select.h" #include "rawstr.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" #include #include static Curl_recv cyassl_recv; static Curl_send cyassl_send; static int do_file_type(const char *type) { if(!type || !type[0]) return SSL_FILETYPE_PEM; if(Curl_raw_equal(type, "PEM")) return SSL_FILETYPE_PEM; if(Curl_raw_equal(type, "DER")) return SSL_FILETYPE_ASN1; return -1; } /* * This function loads all the client/CA certificates and CRLs. Setup the TLS * layer and do all necessary magic. */ static CURLcode cyassl_connect_step1(struct connectdata *conn, int sockindex) { struct SessionHandle *data = conn->data; struct ssl_connect_data* conssl = &conn->ssl[sockindex]; SSL_METHOD* req_method = NULL; void* ssl_sessionid = NULL; curl_socket_t sockfd = conn->sock[sockindex]; if(conssl->state == ssl_connection_complete) return CURLE_OK; /* CyaSSL doesn't support SSLv2 */ if(data->set.ssl.version == CURL_SSLVERSION_SSLv2) { failf(data, "CyaSSL does not support SSLv2"); return CURLE_SSL_CONNECT_ERROR; } /* check to see if we've been told to use an explicit SSL/TLS version */ switch(data->set.ssl.version) { case CURL_SSLVERSION_DEFAULT: /* we try to figure out version */ req_method = SSLv23_client_method(); break; case CURL_SSLVERSION_TLSv1: infof(data, "CyaSSL cannot be configured to use TLS 1.0-1.2, " "TLS 1.0 is used exclusively\n"); req_method = TLSv1_client_method(); break; case CURL_SSLVERSION_TLSv1_0: req_method = TLSv1_client_method(); break; case CURL_SSLVERSION_TLSv1_1: req_method = TLSv1_1_client_method(); break; case CURL_SSLVERSION_TLSv1_2: req_method = TLSv1_2_client_method(); break; case CURL_SSLVERSION_SSLv3: req_method = SSLv3_client_method(); break; default: req_method = TLSv1_client_method(); } if(!req_method) { failf(data, "SSL: couldn't create a method!"); return CURLE_OUT_OF_MEMORY; } if(conssl->ctx) SSL_CTX_free(conssl->ctx); conssl->ctx = SSL_CTX_new(req_method); if(!conssl->ctx) { failf(data, "SSL: couldn't create a context!"); return CURLE_OUT_OF_MEMORY; } #ifndef NO_FILESYSTEM /* load trusted cacert */ if(data->set.str[STRING_SSL_CAFILE]) { if(!SSL_CTX_load_verify_locations(conssl->ctx, data->set.str[STRING_SSL_CAFILE], data->set.str[STRING_SSL_CAPATH])) { if(data->set.ssl.verifypeer) { /* Fail if we insiste on successfully verifying the server. */ failf(data,"error setting certificate verify locations:\n" " CAfile: %s\n CApath: %s", data->set.str[STRING_SSL_CAFILE]? data->set.str[STRING_SSL_CAFILE]: "none", data->set.str[STRING_SSL_CAPATH]? data->set.str[STRING_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.str[STRING_SSL_CAFILE] ? data->set.str[STRING_SSL_CAFILE]: "none", data->set.str[STRING_SSL_CAPATH] ? data->set.str[STRING_SSL_CAPATH]: "none"); } /* Load the client certificate, and private key */ if(data->set.str[STRING_CERT] && data->set.str[STRING_KEY]) { int file_type = do_file_type(data->set.str[STRING_CERT_TYPE]); if(SSL_CTX_use_certificate_file(conssl->ctx, data->set.str[STRING_CERT], file_type) != 1) { failf(data, "unable to use client certificate (no key or wrong pass" " phrase?)"); return CURLE_SSL_CONNECT_ERROR; } file_type = do_file_type(data->set.str[STRING_KEY_TYPE]); if(SSL_CTX_use_PrivateKey_file(conssl->ctx, data->set.str[STRING_KEY], file_type) != 1) { failf(data, "unable to set private key"); return CURLE_SSL_CONNECT_ERROR; } } #else if(CyaSSL_no_filesystem_verify(conssl->ctx)!= SSL_SUCCESS) { return CURLE_SSL_CONNECT_ERROR; } #endif /* NO_FILESYSTEM */ /* 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(conssl->ctx, data->set.ssl.verifypeer?SSL_VERIFY_PEER:SSL_VERIFY_NONE, NULL); /* Let's make an SSL structure */ if(conssl->handle) SSL_free(conssl->handle); conssl->handle = SSL_new(conssl->ctx); if(!conssl->handle) { failf(data, "SSL: couldn't create a context (handle)!"); return CURLE_OUT_OF_MEMORY; } /* 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(conssl->handle, ssl_sessionid)) { failf(data, "SSL: SSL_set_session failed: %s", ERR_error_string(SSL_get_error(conssl->handle, 0),NULL)); return CURLE_SSL_CONNECT_ERROR; } /* Informational message */ infof (data, "SSL re-using session ID\n"); } /* pass the raw socket into the SSL layer */ if(!SSL_set_fd(conssl->handle, (int)sockfd)) { failf(data, "SSL: SSL_set_fd failed"); return CURLE_SSL_CONNECT_ERROR; } conssl->connecting_state = ssl_connect_2; return CURLE_OK; } static CURLcode cyassl_connect_step2(struct connectdata *conn, int sockindex) { int ret = -1; struct SessionHandle *data = conn->data; struct ssl_connect_data* conssl = &conn->ssl[sockindex]; infof(data, "CyaSSL: Connecting to %s:%d\n", conn->host.name, conn->remote_port); conn->recv[sockindex] = cyassl_recv; conn->send[sockindex] = cyassl_send; /* Enable RFC2818 checks */ if(data->set.ssl.verifyhost) { ret = CyaSSL_check_domain_name(conssl->handle, conn->host.name); if(ret == SSL_FAILURE) return CURLE_OUT_OF_MEMORY; } ret = SSL_connect(conssl->handle); if(ret != 1) { char error_buffer[80]; int detail = SSL_get_error(conssl->handle, ret); if(SSL_ERROR_WANT_READ == detail) { conssl->connecting_state = ssl_connect_2_reading; return CURLE_OK; } else if(SSL_ERROR_WANT_WRITE == detail) { conssl->connecting_state = ssl_connect_2_writing; return CURLE_OK; } /* There is no easy way to override only the CN matching. * This will enable the override of both mismatching SubjectAltNames * as also mismatching CN fields */ else if(DOMAIN_NAME_MISMATCH == detail) { #if 1 failf(data, "\tsubject alt name(s) or common name do not match \"%s\"\n", conn->host.dispname); return CURLE_PEER_FAILED_VERIFICATION; #else /* When the CyaSSL_check_domain_name() is used and you desire to continue * on a DOMAIN_NAME_MISMATCH, i.e. 'data->set.ssl.verifyhost == 0', * CyaSSL version 2.4.0 will fail with an INCOMPLETE_DATA error. The only * way to do this is currently to switch the CyaSSL_check_domain_name() * in and out based on the 'data->set.ssl.verifyhost' value. */ if(data->set.ssl.verifyhost) { failf(data, "\tsubject alt name(s) or common name do not match \"%s\"\n", conn->host.dispname); return CURLE_PEER_FAILED_VERIFICATION; } else { infof(data, "\tsubject alt name(s) and/or common name do not match \"%s\"\n", conn->host.dispname); return CURLE_OK; } #endif } else { failf(data, "SSL_connect failed with error %d: %s", detail, ERR_error_string(detail, error_buffer)); return CURLE_SSL_CONNECT_ERROR; } } conssl->connecting_state = ssl_connect_3; infof(data, "SSL connected\n"); return CURLE_OK; } static CURLcode cyassl_connect_step3(struct connectdata *conn, int sockindex) { CURLcode retcode = CURLE_OK; void *old_ssl_sessionid=NULL; struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; int incache; SSL_SESSION *our_ssl_sessionid; DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); our_ssl_sessionid = SSL_get_session(connssl->handle); incache = !(Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL)); if(incache) { if(old_ssl_sessionid != our_ssl_sessionid) { infof(data, "old SSL session ID is stale, removing\n"); Curl_ssl_delsessionid(conn, old_ssl_sessionid); incache = FALSE; } } if(!incache) { retcode = Curl_ssl_addsessionid(conn, our_ssl_sessionid, 0 /* unknown size */); if(retcode) { failf(data, "failed to store ssl session"); return retcode; } } connssl->connecting_state = ssl_connect_done; return retcode; } static ssize_t cyassl_send(struct connectdata *conn, int sockindex, const void *mem, size_t len, CURLcode *curlcode) { char error_buffer[80]; int memlen = (len > (size_t)INT_MAX) ? INT_MAX : (int)len; int rc = SSL_write(conn->ssl[sockindex].handle, mem, memlen); if(rc < 0) { int err = SSL_get_error(conn->ssl[sockindex].handle, rc); switch(err) { case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: /* there's data pending, re-invoke SSL_write() */ *curlcode = CURLE_AGAIN; return -1; default: failf(conn->data, "SSL write: %s, errno %d", ERR_error_string(err, error_buffer), SOCKERRNO); *curlcode = CURLE_SEND_ERROR; return -1; } } return rc; } void Curl_cyassl_close_all(struct SessionHandle *data) { (void)data; } void Curl_cyassl_close(struct connectdata *conn, int sockindex) { struct ssl_connect_data *conssl = &conn->ssl[sockindex]; if(conssl->handle) { (void)SSL_shutdown(conssl->handle); SSL_free (conssl->handle); conssl->handle = NULL; } if(conssl->ctx) { SSL_CTX_free (conssl->ctx); conssl->ctx = NULL; } } static ssize_t cyassl_recv(struct connectdata *conn, int num, char *buf, size_t buffersize, CURLcode *curlcode) { char error_buffer[80]; int buffsize = (buffersize > (size_t)INT_MAX) ? INT_MAX : (int)buffersize; int nread = SSL_read(conn->ssl[num].handle, buf, buffsize); if(nread < 0) { int err = SSL_get_error(conn->ssl[num].handle, nread); switch(err) { 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() */ *curlcode = CURLE_AGAIN; return -1; default: failf(conn->data, "SSL read: %s, errno %d", ERR_error_string(err, error_buffer), SOCKERRNO); *curlcode = CURLE_RECV_ERROR; return -1; } } return nread; } void Curl_cyassl_session_free(void *ptr) { (void)ptr; /* CyaSSL reuses sessions on own, no free */ } size_t Curl_cyassl_version(char *buffer, size_t size) { #ifdef CYASSL_VERSION return snprintf(buffer, size, "CyaSSL/%s", CYASSL_VERSION); #else return snprintf(buffer, size, "CyaSSL/%s", "<1.8.8"); #endif } int Curl_cyassl_init(void) { if(CyaSSL_Init() == 0) return 1; return -1; } bool Curl_cyassl_data_pending(const struct connectdata* conn, int connindex) { if(conn->ssl[connindex].handle) /* SSL is in use */ return (0 != SSL_pending(conn->ssl[connindex].handle)) ? TRUE : FALSE; else return FALSE; } /* * This function is called to shut down the SSL layer but keep the * socket open (CCC - Clear Command Channel) */ int Curl_cyassl_shutdown(struct connectdata *conn, int sockindex) { int retval = 0; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; if(connssl->handle) { SSL_free (connssl->handle); connssl->handle = NULL; } return retval; } static CURLcode cyassl_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; int what; /* check if the connection has already been established */ if(ssl_connection_complete == connssl->state) { *done = TRUE; return CURLE_OK; } if(ssl_connect_1==connssl->connecting_state) { /* Find out how much more time we're allowed */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { /* no need to continue if time already is up */ failf(data, "SSL connection timeout"); return CURLE_OPERATION_TIMEDOUT; } retcode = cyassl_connect_step1(conn, sockindex); if(retcode) return retcode; } while(ssl_connect_2 == connssl->connecting_state || ssl_connect_2_reading == connssl->connecting_state || ssl_connect_2_writing == connssl->connecting_state) { /* check allowed time left */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { /* no need to continue if time already is up */ failf(data, "SSL connection timeout"); return CURLE_OPERATION_TIMEDOUT; } /* 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) { curl_socket_t writefd = ssl_connect_2_writing== connssl->connecting_state?sockfd:CURL_SOCKET_BAD; curl_socket_t readfd = ssl_connect_2_reading== connssl->connecting_state?sockfd:CURL_SOCKET_BAD; what = Curl_socket_ready(readfd, writefd, nonblocking?0:timeout_ms); if(what < 0) { /* fatal error */ failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); return CURLE_SSL_CONNECT_ERROR; } else if(0 == what) { if(nonblocking) { *done = FALSE; return CURLE_OK; } else { /* timeout */ failf(data, "SSL connection timeout"); return CURLE_OPERATION_TIMEDOUT; } } /* socket is readable or writable */ } /* Run transaction, and return to the caller if it failed or if * this connection is part of a multi handle and this loop would * execute again. This permits the owner of a multi handle to * abort a connection attempt before step2 has completed while * ensuring that a client using select() or epoll() will always * have a valid fdset to wait on. */ retcode = cyassl_connect_step2(conn, sockindex); if(retcode || (nonblocking && (ssl_connect_2 == connssl->connecting_state || ssl_connect_2_reading == connssl->connecting_state || ssl_connect_2_writing == connssl->connecting_state))) return retcode; } /* repeat step2 until all transactions are done. */ if(ssl_connect_3==connssl->connecting_state) { retcode = cyassl_connect_step3(conn, sockindex); if(retcode) return retcode; } if(ssl_connect_done==connssl->connecting_state) { connssl->state = ssl_connection_complete; conn->recv[sockindex] = cyassl_recv; conn->send[sockindex] = cyassl_send; *done = TRUE; } else *done = FALSE; /* Reset our connect state machine */ connssl->connecting_state = ssl_connect_1; return CURLE_OK; } CURLcode Curl_cyassl_connect_nonblocking(struct connectdata *conn, int sockindex, bool *done) { return cyassl_connect_common(conn, sockindex, TRUE, done); } CURLcode Curl_cyassl_connect(struct connectdata *conn, int sockindex) { CURLcode retcode; bool done = FALSE; retcode = cyassl_connect_common(conn, sockindex, FALSE, &done); if(retcode) return retcode; DEBUGASSERT(done); return CURLE_OK; } #endif curl-7.35.0/lib/vtls/nssg.h0000644000175000017500000000643312270035364012365 00000000000000#ifndef HEADER_CURL_NSSG_H #define HEADER_CURL_NSSG_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_NSS /* * This header should only be needed to get included by vtls.c and nss.c */ #include "urldata.h" CURLcode Curl_nss_connect(struct connectdata *conn, int sockindex); CURLcode Curl_nss_connect_nonblocking(struct connectdata *conn, int sockindex, bool *done); /* close a SSL connection */ void Curl_nss_close(struct connectdata *conn, int sockindex); /* tell NSS to close down all open information regarding connections (and thus session ID caching etc) */ int Curl_nss_close_all(struct SessionHandle *data); int Curl_nss_init(void); void Curl_nss_cleanup(void); size_t Curl_nss_version(char *buffer, size_t size); int Curl_nss_check_cxn(struct connectdata *cxn); int Curl_nss_seed(struct SessionHandle *data); /* initialize NSS library if not already */ CURLcode Curl_nss_force_init(struct SessionHandle *data); void Curl_nss_random(struct SessionHandle *data, unsigned char *entropy, size_t length); void Curl_nss_md5sum(unsigned char *tmp, /* input */ size_t tmplen, unsigned char *md5sum, /* output */ size_t md5len); /* this backend provides these functions: */ #define have_curlssl_random 1 #define have_curlssl_md5sum 1 /* API setup for NSS */ #define curlssl_init Curl_nss_init #define curlssl_cleanup Curl_nss_cleanup #define curlssl_connect Curl_nss_connect /* NSS has its own session ID cache */ #define curlssl_session_free(x) Curl_nop_stmt #define curlssl_close_all Curl_nss_close_all #define curlssl_close Curl_nss_close /* NSS has no shutdown function provided and thus always fail */ #define curlssl_shutdown(x,y) (x=x, y=y, 1) #define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN) #define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN) #define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL) #define curlssl_version Curl_nss_version #define curlssl_check_cxn(x) Curl_nss_check_cxn(x) #define curlssl_data_pending(x,y) (x=x, y=y, 0) #define curlssl_random(x,y,z) Curl_nss_random(x,y,z) #define curlssl_md5sum(a,b,c,d) Curl_nss_md5sum(a,b,c,d) #endif /* USE_NSS */ #endif /* HEADER_CURL_NSSG_H */ curl-7.35.0/lib/vtls/openssl.h0000644000175000017500000000762412270035364013101 00000000000000#ifndef HEADER_CURL_SSLUSE_H #define HEADER_CURL_SSLUSE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_SSLEAY /* * This header should only be needed to get included by vtls.c and openssl.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); /* close a SSL connection */ void Curl_ossl_close(struct connectdata *conn, int sockindex); /* 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); 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); int Curl_ossl_shutdown(struct connectdata *conn, int sockindex); bool Curl_ossl_data_pending(const struct connectdata *conn, int connindex); void Curl_ossl_random(struct SessionHandle *data, unsigned char *entropy, size_t length); void Curl_ossl_md5sum(unsigned char *tmp, /* input */ size_t tmplen, unsigned char *md5sum /* output */, size_t unused); /* this backend provides these functions: */ #define have_curlssl_random 1 #define have_curlssl_md5sum 1 /* API setup for OpenSSL */ #define curlssl_init Curl_ossl_init #define curlssl_cleanup Curl_ossl_cleanup #define curlssl_connect Curl_ossl_connect #define curlssl_connect_nonblocking Curl_ossl_connect_nonblocking #define curlssl_session_free(x) Curl_ossl_session_free(x) #define curlssl_close_all Curl_ossl_close_all #define curlssl_close Curl_ossl_close #define curlssl_shutdown(x,y) Curl_ossl_shutdown(x,y) #define curlssl_set_engine(x,y) Curl_ossl_set_engine(x,y) #define curlssl_set_engine_default(x) Curl_ossl_set_engine_default(x) #define curlssl_engines_list(x) Curl_ossl_engines_list(x) #define curlssl_version Curl_ossl_version #define curlssl_check_cxn Curl_ossl_check_cxn #define curlssl_data_pending(x,y) Curl_ossl_data_pending(x,y) #define curlssl_random(x,y,z) Curl_ossl_random(x,y,z) #define curlssl_md5sum(a,b,c,d) Curl_ossl_md5sum(a,b,c,d) #define DEFAULT_CIPHER_SELECTION "ALL!EXPORT!EXPORT40!EXPORT56!aNULL!LOW!RC4" #endif /* USE_SSLEAY */ #endif /* HEADER_CURL_SSLUSE_H */ curl-7.35.0/lib/vtls/qssl.c0000644000175000017500000003062512270035364012370 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_QSOSSL #include #ifdef HAVE_LIMITS_H # include #endif #include #include "urldata.h" #include "sendf.h" #include "qssl.h" #include "vtls.h" #include "connect.h" /* for the connect timeout */ #include "select.h" #include "x509asn1.h" #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" int Curl_qsossl_init(void) { /* Nothing to do here. We must have connection data to initialize ssl, so * defer. */ return 1; } void Curl_qsossl_cleanup(void) { /* Nothing to do. */ } static CURLcode Curl_qsossl_init_session(struct SessionHandle * data) { int rc; char * certname; SSLInit initstr; SSLInitApp initappstr; /* Initialize the job for SSL according to the current parameters. * QsoSSL offers two ways to do it: SSL_Init_Application() that uses an * application identifier to select certificates in the main certificate * store, and SSL_Init() that uses named keyring files and a password. * It is not possible to have different keyrings for the CAs and the * local certificate. We thus use the certificate name to identify the * keyring if given, else the CA file name. * If the key file name is given, it is taken as the password for the * keyring in certificate file. * We first try to SSL_Init_Application(), then SSL_Init() if it failed. */ certname = data->set.str[STRING_CERT]; if(!certname) { certname = data->set.str[STRING_SSL_CAFILE]; if(!certname) return CURLE_OK; /* Use previous setup. */ } memset((char *) &initappstr, 0, sizeof initappstr); initappstr.applicationID = certname; initappstr.applicationIDLen = strlen(certname); initappstr.protocol = SSL_VERSION_CURRENT; /* TLSV1 compat. SSLV[23]. */ initappstr.sessionType = SSL_REGISTERED_AS_CLIENT; rc = SSL_Init_Application(&initappstr); if(rc == SSL_ERROR_NOT_REGISTERED) { initstr.keyringFileName = certname; initstr.keyringPassword = data->set.str[STRING_KEY]; initstr.cipherSuiteList = NULL; /* Use default. */ initstr.cipherSuiteListLen = 0; rc = SSL_Init(&initstr); } switch (rc) { case 0: /* No error. */ break; case SSL_ERROR_IO: failf(data, "SSL_Init() I/O error: %s", strerror(errno)); return CURLE_SSL_CONNECT_ERROR; case SSL_ERROR_BAD_CIPHER_SUITE: return CURLE_SSL_CIPHER; case SSL_ERROR_KEYPASSWORD_EXPIRED: case SSL_ERROR_NOT_REGISTERED: return CURLE_SSL_CONNECT_ERROR; case SSL_ERROR_NO_KEYRING: return CURLE_SSL_CACERT; case SSL_ERROR_CERT_EXPIRED: return CURLE_SSL_CERTPROBLEM; default: failf(data, "SSL_Init(): %s", SSL_Strerror(rc, NULL)); return CURLE_SSL_CONNECT_ERROR; } return CURLE_OK; } static CURLcode Curl_qsossl_create(struct connectdata * conn, int sockindex) { SSLHandle * h; struct ssl_connect_data * connssl = &conn->ssl[sockindex]; h = SSL_Create(conn->sock[sockindex], SSL_ENCRYPT); if(!h) { failf(conn->data, "SSL_Create() I/O error: %s", strerror(errno)); return CURLE_SSL_CONNECT_ERROR; } connssl->handle = h; return CURLE_OK; } static int Curl_qsossl_trap_cert(SSLHandle * h) { return 1; /* Accept certificate. */ } static CURLcode Curl_qsossl_handshake(struct connectdata * conn, int sockindex) { int rc; struct SessionHandle * data = conn->data; struct ssl_connect_data * connssl = &conn->ssl[sockindex]; SSLHandle * h = connssl->handle; long timeout_ms; h->exitPgm = data->set.ssl.verifypeer? NULL: Curl_qsossl_trap_cert; /* figure out how long time we should wait at maximum */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { /* time-out, bail out, go home */ failf(data, "Connection time-out"); return CURLE_OPERATION_TIMEDOUT; } /* SSL_Handshake() timeout resolution is second, so round up. */ h->timeout = (timeout_ms + 1000 - 1) / 1000; /* Set-up protocol. */ switch (data->set.ssl.version) { default: case CURL_SSLVERSION_DEFAULT: h->protocol = SSL_VERSION_CURRENT; /* TLSV1 compat. SSLV[23]. */ break; case CURL_SSLVERSION_TLSv1: h->protocol = TLS_VERSION_1; break; case CURL_SSLVERSION_SSLv2: h->protocol = SSL_VERSION_2; break; case CURL_SSLVERSION_SSLv3: h->protocol = SSL_VERSION_3; break; case CURL_SSLVERSION_TLSv1_0: case CURL_SSLVERSION_TLSv1_1: case CURL_SSLVERSION_TLSv1_2: failf(data, "TLS minor version cannot be set"); return CURLE_SSL_CONNECT_ERROR; } h->peerCert = NULL; h->peerCertLen = 0; rc = SSL_Handshake(h, SSL_HANDSHAKE_AS_CLIENT); switch (rc) { case 0: /* No error. */ break; case SSL_ERROR_BAD_CERTIFICATE: case SSL_ERROR_BAD_CERT_SIG: case SSL_ERROR_NOT_TRUSTED_ROOT: return CURLE_PEER_FAILED_VERIFICATION; case SSL_ERROR_BAD_CIPHER_SUITE: case SSL_ERROR_NO_CIPHERS: return CURLE_SSL_CIPHER; case SSL_ERROR_CERTIFICATE_REJECTED: case SSL_ERROR_CERT_EXPIRED: case SSL_ERROR_NO_CERTIFICATE: return CURLE_SSL_CERTPROBLEM; case SSL_ERROR_IO: failf(data, "SSL_Handshake() I/O error: %s", strerror(errno)); return CURLE_SSL_CONNECT_ERROR; default: failf(data, "SSL_Handshake(): %s", SSL_Strerror(rc, NULL)); return CURLE_SSL_CONNECT_ERROR; } /* Verify host. */ rc = Curl_verifyhost(conn, h->peerCert, h->peerCert + h->peerCertLen); if(rc != CURLE_OK) return rc; /* Gather certificate info. */ if(data->set.ssl.certinfo) { if(Curl_ssl_init_certinfo(data, 1)) return CURLE_OUT_OF_MEMORY; if(h->peerCert) { rc = Curl_extract_certinfo(conn, 0, h->peerCert, h->peerCert + h->peerCertLen); if(rc != CURLE_OK) return rc; } } return CURLE_OK; } static Curl_recv qsossl_recv; static Curl_send qsossl_send; CURLcode Curl_qsossl_connect(struct connectdata * conn, int sockindex) { struct SessionHandle * data = conn->data; struct ssl_connect_data * connssl = &conn->ssl[sockindex]; int rc; rc = Curl_qsossl_init_session(data); if(rc == CURLE_OK) { rc = Curl_qsossl_create(conn, sockindex); if(rc == CURLE_OK) { rc = Curl_qsossl_handshake(conn, sockindex); if(rc != CURLE_OK) SSL_Destroy(connssl->handle); } } if(rc == CURLE_OK) { conn->recv[sockindex] = qsossl_recv; conn->send[sockindex] = qsossl_send; connssl->state = ssl_connection_complete; } else { connssl->handle = NULL; connssl->use = FALSE; connssl->state = ssl_connection_none; } return rc; } static int Curl_qsossl_close_one(struct ssl_connect_data * conn, struct SessionHandle * data) { int rc; if(!conn->handle) return 0; rc = SSL_Destroy(conn->handle); if(rc) { if(rc == SSL_ERROR_IO) { failf(data, "SSL_Destroy() I/O error: %s", strerror(errno)); return -1; } /* An SSL error. */ failf(data, "SSL_Destroy() returned error %s", SSL_Strerror(rc, NULL)); return -1; } conn->handle = NULL; return 0; } void Curl_qsossl_close(struct connectdata *conn, int sockindex) { struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; if(connssl->use) (void) Curl_qsossl_close_one(connssl, data); } int Curl_qsossl_close_all(struct SessionHandle * data) { /* Unimplemented. */ (void) data; return 0; } int Curl_qsossl_shutdown(struct connectdata * conn, int sockindex) { struct ssl_connect_data * connssl = &conn->ssl[sockindex]; struct SessionHandle *data = conn->data; ssize_t nread; int what; int rc; char buf[120]; if(!connssl->handle) return 0; if(data->set.ftp_ccc != CURLFTPSSL_CCC_ACTIVE) return 0; if(Curl_qsossl_close_one(connssl, data)) return -1; rc = 0; what = Curl_socket_ready(conn->sock[sockindex], CURL_SOCKET_BAD, SSL_SHUTDOWN_TIMEOUT); for(;;) { if(what < 0) { /* anything that gets here is fatally bad */ failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); rc = -1; break; } if(!what) { /* timeout */ failf(data, "SSL shutdown timeout"); break; } /* Something to read, let's do it and hope that it is the close notify alert from the server. No way to SSL_Read now, so use read(). */ nread = read(conn->sock[sockindex], buf, sizeof(buf)); if(nread < 0) { failf(data, "read: %s", strerror(errno)); rc = -1; } if(nread <= 0) break; what = Curl_socket_ready(conn->sock[sockindex], CURL_SOCKET_BAD, 0); } return rc; } static ssize_t qsossl_send(struct connectdata * conn, int sockindex, const void * mem, size_t len, CURLcode * curlcode) { /* SSL_Write() is said to return 'int' while write() and send() returns 'size_t' */ int rc; rc = SSL_Write(conn->ssl[sockindex].handle, (void *) mem, (int) len); if(rc < 0) { switch(rc) { case SSL_ERROR_BAD_STATE: /* The operation did not complete; the same SSL I/O function should be called again later. This is basically an EWOULDBLOCK equivalent. */ *curlcode = CURLE_AGAIN; return -1; case SSL_ERROR_IO: switch (errno) { case EWOULDBLOCK: case EINTR: *curlcode = CURLE_AGAIN; return -1; } failf(conn->data, "SSL_Write() I/O error: %s", strerror(errno)); *curlcode = CURLE_SEND_ERROR; return -1; } /* An SSL error. */ failf(conn->data, "SSL_Write() returned error %s", SSL_Strerror(rc, NULL)); *curlcode = CURLE_SEND_ERROR; return -1; } return (ssize_t) rc; /* number of bytes */ } static ssize_t qsossl_recv(struct connectdata * conn, int num, char * buf, size_t buffersize, CURLcode * curlcode) { char error_buffer[120]; /* OpenSSL documents that this must be at least 120 bytes long. */ unsigned long sslerror; int buffsize; int nread; buffsize = (buffersize > (size_t)INT_MAX) ? INT_MAX : (int)buffersize; nread = SSL_Read(conn->ssl[num].handle, buf, buffsize); if(nread < 0) { /* failed SSL_read */ switch (nread) { case SSL_ERROR_BAD_STATE: /* there's data pending, re-invoke SSL_Read(). */ *curlcode = CURLE_AGAIN; return -1; case SSL_ERROR_IO: switch (errno) { case EWOULDBLOCK: *curlcode = CURLE_AGAIN; return -1; } failf(conn->data, "SSL_Read() I/O error: %s", strerror(errno)); *curlcode = CURLE_RECV_ERROR; return -1; default: failf(conn->data, "SSL read error: %s", SSL_Strerror(nread, NULL)); *curlcode = CURLE_RECV_ERROR; return -1; } } return (ssize_t) nread; } size_t Curl_qsossl_version(char * buffer, size_t size) { strncpy(buffer, "IBM OS/400 SSL", size); return strlen(buffer); } int Curl_qsossl_check_cxn(struct connectdata * cxn) { int err; int errlen; /* The only thing that can be tested here is at the socket level. */ if(!cxn->ssl[FIRSTSOCKET].handle) return 0; /* connection has been closed */ err = 0; errlen = sizeof err; if(getsockopt(cxn->sock[FIRSTSOCKET], SOL_SOCKET, SO_ERROR, (unsigned char *) &err, &errlen) || errlen != sizeof err || err) return 0; /* connection has been closed */ return -1; /* connection status unknown */ } #endif /* USE_QSOSSL */ curl-7.35.0/lib/vtls/gskit.c0000644000175000017500000007575212270035364012541 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_GSKIT #include #include /* Some symbols are undefined/unsupported on OS400 versions < V7R1. */ #ifndef GSK_SSL_EXTN_SERVERNAME_REQUEST #define GSK_SSL_EXTN_SERVERNAME_REQUEST 230 #endif #ifndef GSK_TLSV10_CIPHER_SPECS #define GSK_TLSV10_CIPHER_SPECS 236 #endif #ifndef GSK_TLSV11_CIPHER_SPECS #define GSK_TLSV11_CIPHER_SPECS 237 #endif #ifndef GSK_TLSV12_CIPHER_SPECS #define GSK_TLSV12_CIPHER_SPECS 238 #endif #ifndef GSK_PROTOCOL_TLSV11 #define GSK_PROTOCOL_TLSV11 437 #endif #ifndef GSK_PROTOCOL_TLSV12 #define GSK_PROTOCOL_TLSV12 438 #endif #ifndef GSK_FALSE #define GSK_FALSE 0 #endif #ifndef GSK_TRUE #define GSK_TRUE 1 #endif #ifdef HAVE_LIMITS_H # include #endif #include #include "urldata.h" #include "sendf.h" #include "gskit.h" #include "vtls.h" #include "connect.h" /* for the connect timeout */ #include "select.h" #include "strequal.h" #include "x509asn1.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* SSL version flags. */ #define CURL_GSKPROTO_SSLV2 0 #define CURL_GSKPROTO_SSLV2_MASK (1 << CURL_GSKPROTO_SSLV2) #define CURL_GSKPROTO_SSLV3 1 #define CURL_GSKPROTO_SSLV3_MASK (1 << CURL_GSKPROTO_SSLV3) #define CURL_GSKPROTO_TLSV10 2 #define CURL_GSKPROTO_TLSV10_MASK (1 << CURL_GSKPROTO_TLSV10) #define CURL_GSKPROTO_TLSV11 3 #define CURL_GSKPROTO_TLSV11_MASK (1 << CURL_GSKPROTO_TLSV11) #define CURL_GSKPROTO_TLSV12 4 #define CURL_GSKPROTO_TLSV12_MASK (1 << CURL_GSKPROTO_TLSV12) #define CURL_GSKPROTO_LAST 5 /* Supported ciphers. */ typedef struct { const char *name; /* Cipher name. */ const char *gsktoken; /* Corresponding token for GSKit String. */ unsigned int versions; /* SSL version flags. */ } gskit_cipher; static const gskit_cipher ciphertable[] = { { "null-md5", "01", CURL_GSKPROTO_SSLV3_MASK | CURL_GSKPROTO_TLSV10_MASK | CURL_GSKPROTO_TLSV11_MASK | CURL_GSKPROTO_TLSV12_MASK }, { "null-sha", "02", CURL_GSKPROTO_SSLV3_MASK | CURL_GSKPROTO_TLSV10_MASK | CURL_GSKPROTO_TLSV11_MASK | CURL_GSKPROTO_TLSV12_MASK }, { "exp-rc4-md5", "03", CURL_GSKPROTO_SSLV3_MASK | CURL_GSKPROTO_TLSV10_MASK }, { "rc4-md5", "04", CURL_GSKPROTO_SSLV3_MASK | CURL_GSKPROTO_TLSV10_MASK | CURL_GSKPROTO_TLSV11_MASK | CURL_GSKPROTO_TLSV12_MASK }, { "rc4-sha", "05", CURL_GSKPROTO_SSLV3_MASK | CURL_GSKPROTO_TLSV10_MASK | CURL_GSKPROTO_TLSV11_MASK | CURL_GSKPROTO_TLSV12_MASK }, { "exp-rc2-cbc-md5", "06", CURL_GSKPROTO_SSLV3_MASK | CURL_GSKPROTO_TLSV10_MASK }, { "exp-des-cbc-sha", "09", CURL_GSKPROTO_SSLV3_MASK | CURL_GSKPROTO_TLSV10_MASK | CURL_GSKPROTO_TLSV11_MASK }, { "des-cbc3-sha", "0A", CURL_GSKPROTO_SSLV3_MASK | CURL_GSKPROTO_TLSV10_MASK | CURL_GSKPROTO_TLSV11_MASK | CURL_GSKPROTO_TLSV12_MASK }, { "aes128-sha", "2F", CURL_GSKPROTO_TLSV10_MASK | CURL_GSKPROTO_TLSV11_MASK | CURL_GSKPROTO_TLSV12_MASK }, { "aes256-sha", "35", CURL_GSKPROTO_TLSV10_MASK | CURL_GSKPROTO_TLSV11_MASK | CURL_GSKPROTO_TLSV12_MASK }, { "null-sha256", "3B", CURL_GSKPROTO_TLSV12_MASK }, { "aes128-sha256", "3D", CURL_GSKPROTO_TLSV12_MASK }, { "aes256-sha256", "3D", CURL_GSKPROTO_TLSV12_MASK }, { "rc4-md5", "1", CURL_GSKPROTO_SSLV2_MASK }, { "exp-rc4-md5", "2", CURL_GSKPROTO_SSLV2_MASK }, { "rc2-md5", "3", CURL_GSKPROTO_SSLV2_MASK }, { "exp-rc2-md5", "4", CURL_GSKPROTO_SSLV2_MASK }, { "des-cbc-md5", "6", CURL_GSKPROTO_SSLV2_MASK }, { "des-cbc3-md5", "7", CURL_GSKPROTO_SSLV2_MASK }, { (const char *) NULL, (const char *) NULL, 0 } }; static bool is_separator(char c) { /* Return whether character is a cipher list separator. */ switch (c) { case ' ': case '\t': case ':': case ',': case ';': return true; } return false; } static CURLcode gskit_status(struct SessionHandle *data, int rc, const char *procname, CURLcode defcode) { CURLcode cc; /* Process GSKit status and map it to a CURLcode. */ switch (rc) { case GSK_OK: case GSK_OS400_ASYNCHRONOUS_SOC_INIT: return CURLE_OK; case GSK_KEYRING_OPEN_ERROR: case GSK_OS400_ERROR_NO_ACCESS: return CURLE_SSL_CACERT_BADFILE; case GSK_INSUFFICIENT_STORAGE: return CURLE_OUT_OF_MEMORY; case GSK_ERROR_BAD_V2_CIPHER: case GSK_ERROR_BAD_V3_CIPHER: case GSK_ERROR_NO_CIPHERS: return CURLE_SSL_CIPHER; case GSK_OS400_ERROR_NOT_TRUSTED_ROOT: case GSK_ERROR_CERT_VALIDATION: return CURLE_PEER_FAILED_VERIFICATION; case GSK_OS400_ERROR_TIMED_OUT: return CURLE_OPERATION_TIMEDOUT; case GSK_WOULD_BLOCK: return CURLE_AGAIN; case GSK_OS400_ERROR_NOT_REGISTERED: break; case GSK_ERROR_IO: switch (errno) { case ENOMEM: return CURLE_OUT_OF_MEMORY; default: failf(data, "%s I/O error: %s", procname, strerror(errno)); break; } break; default: failf(data, "%s: %s", procname, gsk_strerror(rc)); break; } return defcode; } static CURLcode set_enum(struct SessionHandle *data, gsk_handle h, GSK_ENUM_ID id, GSK_ENUM_VALUE value, bool unsupported_ok) { int rc = gsk_attribute_set_enum(h, id, value); switch (rc) { case GSK_OK: return CURLE_OK; case GSK_ERROR_IO: failf(data, "gsk_attribute_set_enum() I/O error: %s", strerror(errno)); break; case GSK_ATTRIBUTE_INVALID_ID: if(unsupported_ok) return CURLE_UNSUPPORTED_PROTOCOL; default: failf(data, "gsk_attribute_set_enum(): %s", gsk_strerror(rc)); break; } return CURLE_SSL_CONNECT_ERROR; } static CURLcode set_buffer(struct SessionHandle *data, gsk_handle h, GSK_BUF_ID id, const char *buffer, bool unsupported_ok) { int rc = gsk_attribute_set_buffer(h, id, buffer, 0); switch (rc) { case GSK_OK: return CURLE_OK; case GSK_ERROR_IO: failf(data, "gsk_attribute_set_buffer() I/O error: %s", strerror(errno)); break; case GSK_ATTRIBUTE_INVALID_ID: if(unsupported_ok) return CURLE_UNSUPPORTED_PROTOCOL; default: failf(data, "gsk_attribute_set_buffer(): %s", gsk_strerror(rc)); break; } return CURLE_SSL_CONNECT_ERROR; } static CURLcode set_numeric(struct SessionHandle *data, gsk_handle h, GSK_NUM_ID id, int value) { int rc = gsk_attribute_set_numeric_value(h, id, value); switch (rc) { case GSK_OK: return CURLE_OK; case GSK_ERROR_IO: failf(data, "gsk_attribute_set_numeric_value() I/O error: %s", strerror(errno)); break; default: failf(data, "gsk_attribute_set_numeric_value(): %s", gsk_strerror(rc)); break; } return CURLE_SSL_CONNECT_ERROR; } static CURLcode set_callback(struct SessionHandle *data, gsk_handle h, GSK_CALLBACK_ID id, void *info) { int rc = gsk_attribute_set_callback(h, id, info); switch (rc) { case GSK_OK: return CURLE_OK; case GSK_ERROR_IO: failf(data, "gsk_attribute_set_callback() I/O error: %s", strerror(errno)); break; default: failf(data, "gsk_attribute_set_callback(): %s", gsk_strerror(rc)); break; } return CURLE_SSL_CONNECT_ERROR; } static CURLcode set_ciphers(struct SessionHandle *data, gsk_handle h, unsigned int *protoflags) { const char *cipherlist = data->set.str[STRING_SSL_CIPHER_LIST]; const char *clp; const gskit_cipher *ctp; int i; int l; bool unsupported; CURLcode cc; struct { char *buf; char *ptr; } ciphers[CURL_GSKPROTO_LAST]; /* Compile cipher list into GSKit-compatible cipher lists. */ if(!cipherlist) return CURLE_OK; while(is_separator(*cipherlist)) /* Skip initial separators. */ cipherlist++; if(!*cipherlist) return CURLE_OK; /* We allocate GSKit buffers of the same size as the input string: since GSKit tokens are always shorter than their cipher names, allocated buffers will always be large enough to accomodate the result. */ l = strlen(cipherlist) + 1; memset((char *) ciphers, 0, sizeof ciphers); for(i = 0; i < CURL_GSKPROTO_LAST; i++) { ciphers[i].buf = malloc(l); if(!ciphers[i].buf) { while(i--) free(ciphers[i].buf); return CURLE_OUT_OF_MEMORY; } ciphers[i].ptr = ciphers[i].buf; *ciphers[i].ptr = '\0'; } /* Process each cipher in input string. */ unsupported = FALSE; cc = CURLE_OK; for(;;) { for(clp = cipherlist; *cipherlist && !is_separator(*cipherlist);) cipherlist++; l = cipherlist - clp; if(!l) break; /* Search the cipher in our table. */ for(ctp = ciphertable; ctp->name; ctp++) if(strnequal(ctp->name, clp, l) && !ctp->name[l]) break; if(!ctp->name) { failf(data, "Unknown cipher %.*s", l, clp); cc = CURLE_SSL_CIPHER; } else { unsupported |= !(ctp->versions & (CURL_GSKPROTO_SSLV2_MASK | CURL_GSKPROTO_SSLV3_MASK | CURL_GSKPROTO_TLSV10_MASK)); for(i = 0; i < CURL_GSKPROTO_LAST; i++) { if(ctp->versions & (1 << i)) { strcpy(ciphers[i].ptr, ctp->gsktoken); ciphers[i].ptr += strlen(ctp->gsktoken); } } } /* Advance to next cipher name or end of string. */ while(is_separator(*cipherlist)) cipherlist++; } /* Disable protocols with empty cipher lists. */ for(i = 0; i < CURL_GSKPROTO_LAST; i++) { if(!(*protoflags & (1 << i)) || !ciphers[i].buf[0]) { *protoflags &= ~(1 << i); ciphers[i].buf[0] = '\0'; } } /* Try to set-up TLSv1.1 and TLSv2.1 ciphers. */ if(*protoflags & CURL_GSKPROTO_TLSV11_MASK) { cc = set_buffer(data, h, GSK_TLSV11_CIPHER_SPECS, ciphers[CURL_GSKPROTO_TLSV11].buf, TRUE); if(cc == CURLE_UNSUPPORTED_PROTOCOL) { cc = CURLE_OK; if(unsupported) { failf(data, "TLSv1.1-only ciphers are not yet supported"); cc = CURLE_SSL_CIPHER; } } } if(cc == CURLE_OK && (*protoflags & CURL_GSKPROTO_TLSV12_MASK)) { cc = set_buffer(data, h, GSK_TLSV12_CIPHER_SPECS, ciphers[CURL_GSKPROTO_TLSV12].buf, TRUE); if(cc == CURLE_UNSUPPORTED_PROTOCOL) { cc = CURLE_OK; if(unsupported) { failf(data, "TLSv1.2-only ciphers are not yet supported"); cc = CURLE_SSL_CIPHER; } } } /* Try to set-up TLSv1.0 ciphers. If not successful, concatenate them to the SSLv3 ciphers. OS/400 prior to version 7.1 will understand it. */ if(cc == CURLE_OK && (*protoflags & CURL_GSKPROTO_TLSV10_MASK)) { cc = set_buffer(data, h, GSK_TLSV10_CIPHER_SPECS, ciphers[CURL_GSKPROTO_TLSV10].buf, TRUE); if(cc == CURLE_UNSUPPORTED_PROTOCOL) { cc = CURLE_OK; strcpy(ciphers[CURL_GSKPROTO_SSLV3].ptr, ciphers[CURL_GSKPROTO_TLSV10].ptr); } } /* Set-up other ciphers. */ if(cc == CURLE_OK && (*protoflags & CURL_GSKPROTO_SSLV3_MASK)) cc = set_buffer(data, h, GSK_V3_CIPHER_SPECS, ciphers[CURL_GSKPROTO_SSLV3].buf, FALSE); if(cc == CURLE_OK && (*protoflags & CURL_GSKPROTO_SSLV2_MASK)) cc = set_buffer(data, h, GSK_V2_CIPHER_SPECS, ciphers[CURL_GSKPROTO_SSLV2].buf, FALSE); /* Clean-up. */ for(i = 0; i < CURL_GSKPROTO_LAST; i++) free(ciphers[i].buf); return cc; } int Curl_gskit_init(void) { /* No initialisation needed. */ return 1; } void Curl_gskit_cleanup(void) { /* Nothing to do. */ } static CURLcode init_environment(struct SessionHandle *data, gsk_handle *envir, const char *appid, const char *file, const char *label, const char *password) { int rc; CURLcode c; gsk_handle h; /* Creates the GSKit environment. */ rc = gsk_environment_open(&h); switch (rc) { case GSK_OK: break; case GSK_INSUFFICIENT_STORAGE: return CURLE_OUT_OF_MEMORY; default: failf(data, "gsk_environment_open(): %s", gsk_strerror(rc)); return CURLE_SSL_CONNECT_ERROR; } c = set_enum(data, h, GSK_SESSION_TYPE, GSK_CLIENT_SESSION, FALSE); if(c == CURLE_OK && appid) c = set_buffer(data, h, GSK_OS400_APPLICATION_ID, appid, FALSE); if(c == CURLE_OK && file) c = set_buffer(data, h, GSK_KEYRING_FILE, file, FALSE); if(c == CURLE_OK && label) c = set_buffer(data, h, GSK_KEYRING_LABEL, label, FALSE); if(c == CURLE_OK && password) c = set_buffer(data, h, GSK_KEYRING_PW, password, FALSE); if(c == CURLE_OK) { /* Locate CAs, Client certificate and key according to our settings. Note: this call may be blocking for some tenths of seconds. */ c = gskit_status(data, gsk_environment_init(h), "gsk_environment_init()", CURLE_SSL_CERTPROBLEM); if(c == CURLE_OK) { *envir = h; return c; } } /* Error: rollback. */ gsk_environment_close(&h); return c; } static void cancel_async_handshake(struct connectdata *conn, int sockindex) { struct ssl_connect_data *connssl = &conn->ssl[sockindex]; Qso_OverlappedIO_t cstat; if(QsoCancelOperation(conn->sock[sockindex], 0) > 0) QsoWaitForIOCompletion(connssl->iocport, &cstat, (struct timeval *) NULL); } static void close_async_handshake(struct ssl_connect_data *connssl) { QsoDestroyIOCompletionPort(connssl->iocport); connssl->iocport = -1; } static void close_one(struct ssl_connect_data *conn, struct SessionHandle *data) { if(conn->handle) { gskit_status(data, gsk_secure_soc_close(&conn->handle), "gsk_secure_soc_close()", 0); conn->handle = (gsk_handle) NULL; } if(conn->iocport >= 0) close_async_handshake(conn); } static ssize_t gskit_send(struct connectdata *conn, int sockindex, const void *mem, size_t len, CURLcode *curlcode) { struct SessionHandle *data = conn->data; CURLcode cc; int written; cc = gskit_status(data, gsk_secure_soc_write(conn->ssl[sockindex].handle, (char *) mem, (int) len, &written), "gsk_secure_soc_write()", CURLE_SEND_ERROR); if(cc != CURLE_OK) { *curlcode = cc; written = -1; } return (ssize_t) written; /* number of bytes */ } static ssize_t gskit_recv(struct connectdata *conn, int num, char *buf, size_t buffersize, CURLcode *curlcode) { struct SessionHandle *data = conn->data; int buffsize; int nread; CURLcode cc; buffsize = buffersize > (size_t) INT_MAX? INT_MAX: (int) buffersize; cc = gskit_status(data, gsk_secure_soc_read(conn->ssl[num].handle, buf, buffsize, &nread), "gsk_secure_soc_read()", CURLE_RECV_ERROR); if(cc != CURLE_OK) { *curlcode = cc; nread = -1; } return (ssize_t) nread; } static CURLcode gskit_connect_step1(struct connectdata *conn, int sockindex) { struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; gsk_handle envir; CURLcode cc; int rc; char *keyringfile; char *keyringpwd; char *keyringlabel; char *sni; unsigned int protoflags; long timeout; Qso_OverlappedIO_t commarea; /* Create SSL environment, start (preferably asynchronous) handshake. */ connssl->handle = (gsk_handle) NULL; connssl->iocport = -1; /* GSKit supports two ways of specifying an SSL context: either by * application identifier (that should have been defined at the system * level) or by keyring file, password and certificate label. * Local certificate name (CURLOPT_SSLCERT) is used to hold either the * application identifier of the certificate label. * Key password (CURLOPT_KEYPASSWD) holds the keyring password. * It is not possible to have different keyrings for the CAs and the * local certificate. We thus use the CA file (CURLOPT_CAINFO) to identify * the keyring file. * If no key password is given and the keyring is the system keyring, * application identifier mode is tried first, as recommended in IBM doc. */ keyringfile = data->set.str[STRING_SSL_CAFILE]; keyringpwd = data->set.str[STRING_KEY_PASSWD]; keyringlabel = data->set.str[STRING_CERT]; envir = (gsk_handle) NULL; if(keyringlabel && *keyringlabel && !keyringpwd && !strcmp(keyringfile, CURL_CA_BUNDLE)) { /* Try application identifier mode. */ init_environment(data, &envir, keyringlabel, (const char *) NULL, (const char *) NULL, (const char *) NULL); } if(!envir) { /* Use keyring mode. */ cc = init_environment(data, &envir, (const char *) NULL, keyringfile, keyringlabel, keyringpwd); if(cc != CURLE_OK) return cc; } /* Create secure session. */ cc = gskit_status(data, gsk_secure_soc_open(envir, &connssl->handle), "gsk_secure_soc_open()", CURLE_SSL_CONNECT_ERROR); gsk_environment_close(&envir); if(cc != CURLE_OK) return cc; /* Determine which SSL/TLS version should be enabled. */ protoflags = CURL_GSKPROTO_SSLV3_MASK | CURL_GSKPROTO_TLSV10_MASK | CURL_GSKPROTO_TLSV11_MASK | CURL_GSKPROTO_TLSV12_MASK; sni = conn->host.name; switch (data->set.ssl.version) { case CURL_SSLVERSION_SSLv2: protoflags = CURL_GSKPROTO_SSLV2_MASK; sni = (char *) NULL; break; case CURL_SSLVERSION_SSLv3: protoflags = CURL_GSKPROTO_SSLV2_MASK; sni = (char *) NULL; break; case CURL_SSLVERSION_TLSv1: protoflags = CURL_GSKPROTO_TLSV10_MASK | CURL_GSKPROTO_TLSV11_MASK | CURL_GSKPROTO_TLSV12_MASK; break; case CURL_SSLVERSION_TLSv1_0: protoflags = CURL_GSKPROTO_TLSV10_MASK; break; case CURL_SSLVERSION_TLSv1_1: protoflags = CURL_GSKPROTO_TLSV11_MASK; break; case CURL_SSLVERSION_TLSv1_2: protoflags = CURL_GSKPROTO_TLSV12_MASK; break; } /* Process SNI. Ignore if not supported (on OS400 < V7R1). */ if(sni) { cc = set_buffer(data, connssl->handle, GSK_SSL_EXTN_SERVERNAME_REQUEST, sni, TRUE); if(cc == CURLE_UNSUPPORTED_PROTOCOL) cc = CURLE_OK; } /* Set session parameters. */ if(cc == CURLE_OK) { /* Compute the handshake timeout. Since GSKit granularity is 1 second, we round up the required value. */ timeout = Curl_timeleft(data, NULL, TRUE); if(timeout < 0) cc = CURLE_OPERATION_TIMEDOUT; else cc = set_numeric(data, connssl->handle, GSK_HANDSHAKE_TIMEOUT, (timeout + 999) / 1000); } if(cc == CURLE_OK) cc = set_numeric(data, connssl->handle, GSK_FD, conn->sock[sockindex]); if(cc == CURLE_OK) cc = set_ciphers(data, connssl->handle, &protoflags); if(!protoflags) { failf(data, "No SSL protocol/cipher combination enabled"); cc = CURLE_SSL_CIPHER; } if(cc == CURLE_OK) cc = set_enum(data, connssl->handle, GSK_PROTOCOL_SSLV2, (protoflags & CURL_GSKPROTO_SSLV2_MASK)? GSK_PROTOCOL_SSLV2_ON: GSK_PROTOCOL_SSLV2_OFF, FALSE); if(cc == CURLE_OK) cc = set_enum(data, connssl->handle, GSK_PROTOCOL_SSLV3, (protoflags & CURL_GSKPROTO_SSLV3_MASK)? GSK_PROTOCOL_SSLV3_ON: GSK_PROTOCOL_SSLV3_OFF, FALSE); if(cc == CURLE_OK) cc = set_enum(data, connssl->handle, GSK_PROTOCOL_TLSV1, (protoflags & CURL_GSKPROTO_TLSV10_MASK)? GSK_PROTOCOL_TLSV1_ON: GSK_PROTOCOL_TLSV1_OFF, FALSE); if(cc == CURLE_OK) { cc = set_enum(data, connssl->handle, GSK_PROTOCOL_TLSV11, (protoflags & CURL_GSKPROTO_TLSV11_MASK)? GSK_TRUE: GSK_FALSE, TRUE); if(cc == CURLE_UNSUPPORTED_PROTOCOL) { cc = CURLE_OK; if(protoflags == CURL_GSKPROTO_TLSV11_MASK) { failf(data, "TLS 1.1 not yet supported"); cc = CURLE_SSL_CIPHER; } } } if(cc == CURLE_OK) { cc = set_enum(data, connssl->handle, GSK_PROTOCOL_TLSV12, (protoflags & CURL_GSKPROTO_TLSV12_MASK)? GSK_TRUE: GSK_FALSE, TRUE); if(cc == CURLE_UNSUPPORTED_PROTOCOL) { cc = CURLE_OK; if(protoflags == CURL_GSKPROTO_TLSV12_MASK) { failf(data, "TLS 1.2 not yet supported"); cc = CURLE_SSL_CIPHER; } } } if(cc == CURLE_OK) cc = set_enum(data, connssl->handle, GSK_SERVER_AUTH_TYPE, data->set.ssl.verifypeer? GSK_SERVER_AUTH_FULL: GSK_SERVER_AUTH_PASSTHRU, FALSE); if(cc == CURLE_OK) { /* Start handshake. Try asynchronous first. */ memset(&commarea, 0, sizeof commarea); connssl->iocport = QsoCreateIOCompletionPort(); if(connssl->iocport != -1) { cc = gskit_status(data, gsk_secure_soc_startInit(connssl->handle, connssl->iocport, &commarea), "gsk_secure_soc_startInit()", CURLE_SSL_CONNECT_ERROR); if(cc == CURLE_OK) { connssl->connecting_state = ssl_connect_2; return CURLE_OK; } else close_async_handshake(connssl); } else if(errno != ENOBUFS) cc = gskit_status(data, GSK_ERROR_IO, "QsoCreateIOCompletionPort()", 0); else { /* No more completion port available. Use synchronous IO. */ cc = gskit_status(data, gsk_secure_soc_init(connssl->handle), "gsk_secure_soc_init()", CURLE_SSL_CONNECT_ERROR); if(cc == CURLE_OK) { connssl->connecting_state = ssl_connect_3; return CURLE_OK; } } } /* Error: rollback. */ close_one(connssl, data); return cc; } static CURLcode gskit_connect_step2(struct connectdata *conn, int sockindex, bool nonblocking) { struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; Qso_OverlappedIO_t cstat; long timeout_ms; struct timeval stmv; CURLcode cc; /* Poll or wait for end of SSL asynchronous handshake. */ for(;;) { timeout_ms = nonblocking? 0: Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) timeout_ms = 0; stmv.tv_sec = timeout_ms / 1000; stmv.tv_usec = (timeout_ms - stmv.tv_sec * 1000) * 1000; switch (QsoWaitForIOCompletion(connssl->iocport, &cstat, &stmv)) { case 1: /* Operation complete. */ break; case -1: /* An error occurred: handshake still in progress. */ if(errno == EINTR) { if(nonblocking) return CURLE_OK; continue; /* Retry. */ } if(errno != ETIME) { failf(data, "QsoWaitForIOCompletion() I/O error: %s", strerror(errno)); cancel_async_handshake(conn, sockindex); close_async_handshake(connssl); return CURLE_SSL_CONNECT_ERROR; } /* FALL INTO... */ case 0: /* Handshake in progress, timeout occurred. */ if(nonblocking) return CURLE_OK; cancel_async_handshake(conn, sockindex); close_async_handshake(connssl); return CURLE_OPERATION_TIMEDOUT; } break; } cc = gskit_status(data, cstat.returnValue, "SSL handshake", CURLE_SSL_CONNECT_ERROR); if(cc == CURLE_OK) connssl->connecting_state = ssl_connect_3; close_async_handshake(connssl); return cc; } static CURLcode gskit_connect_step3(struct connectdata *conn, int sockindex) { struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; const gsk_cert_data_elem *cdev; int cdec; const gsk_cert_data_elem *p; const char *cert = (const char *) NULL; const char *certend; int i; CURLcode cc; /* SSL handshake done: gather certificate info and verify host. */ if(gskit_status(data, gsk_attribute_get_cert_info(connssl->handle, GSK_PARTNER_CERT_INFO, &cdev, &cdec), "gsk_attribute_get_cert_info()", CURLE_SSL_CONNECT_ERROR) == CURLE_OK) { infof(data, "Server certificate:\n"); p = cdev; for(i = 0; i++ < cdec; p++) switch (p->cert_data_id) { case CERT_BODY_DER: cert = p->cert_data_p; certend = cert + cdev->cert_data_l; break; case CERT_DN_PRINTABLE: infof(data, "\t subject: %.*s\n", p->cert_data_l, p->cert_data_p); break; case CERT_ISSUER_DN_PRINTABLE: infof(data, "\t issuer: %.*s\n", p->cert_data_l, p->cert_data_p); break; case CERT_VALID_FROM: infof(data, "\t start date: %.*s\n", p->cert_data_l, p->cert_data_p); break; case CERT_VALID_TO: infof(data, "\t expire date: %.*s\n", p->cert_data_l, p->cert_data_p); break; } } /* Verify host. */ cc = Curl_verifyhost(conn, cert, certend); if(cc != CURLE_OK) return cc; /* The only place GSKit can get the whole CA chain is a validation callback where no user data pointer is available. Therefore it's not possible to copy this chain into our structures for CAINFO. However the server certificate may be available, thus we can return info about it. */ if(data->set.ssl.certinfo) { if(Curl_ssl_init_certinfo(data, 1)) return CURLE_OUT_OF_MEMORY; if(cert) { cc = Curl_extract_certinfo(conn, 0, cert, certend); if(cc != CURLE_OK) return cc; } } connssl->connecting_state = ssl_connect_done; return CURLE_OK; } static CURLcode gskit_connect_common(struct connectdata *conn, int sockindex, bool nonblocking, bool *done) { struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; long timeout_ms; Qso_OverlappedIO_t cstat; CURLcode cc = CURLE_OK; *done = connssl->state == ssl_connection_complete; if(*done) return CURLE_OK; /* Step 1: create session, start handshake. */ if(connssl->connecting_state == ssl_connect_1) { /* check allowed time left */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { /* no need to continue if time already is up */ failf(data, "SSL connection timeout"); cc = CURLE_OPERATION_TIMEDOUT; } else cc = gskit_connect_step1(conn, sockindex); } /* Step 2: check if handshake is over. */ if(cc == CURLE_OK && connssl->connecting_state == ssl_connect_2) { /* check allowed time left */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { /* no need to continue if time already is up */ failf(data, "SSL connection timeout"); cc = CURLE_OPERATION_TIMEDOUT; } else cc = gskit_connect_step2(conn, sockindex, nonblocking); } /* Step 3: gather certificate info, verify host. */ if(cc == CURLE_OK && connssl->connecting_state == ssl_connect_3) cc = gskit_connect_step3(conn, sockindex); if(cc != CURLE_OK) close_one(connssl, data); else if(connssl->connecting_state == ssl_connect_done) { connssl->state = ssl_connection_complete; connssl->connecting_state = ssl_connect_1; conn->recv[sockindex] = gskit_recv; conn->send[sockindex] = gskit_send; *done = TRUE; } return cc; } CURLcode Curl_gskit_connect_nonblocking(struct connectdata *conn, int sockindex, bool *done) { CURLcode cc; cc = gskit_connect_common(conn, sockindex, TRUE, done); if(*done || cc != CURLE_OK) conn->ssl[sockindex].connecting_state = ssl_connect_1; return cc; } CURLcode Curl_gskit_connect(struct connectdata *conn, int sockindex) { CURLcode retcode; bool done; conn->ssl[sockindex].connecting_state = ssl_connect_1; retcode = gskit_connect_common(conn, sockindex, FALSE, &done); if(retcode) return retcode; DEBUGASSERT(done); return CURLE_OK; } void Curl_gskit_close(struct connectdata *conn, int sockindex) { struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; if(connssl->use) close_one(connssl, data); } int Curl_gskit_close_all(struct SessionHandle *data) { /* Unimplemented. */ (void) data; return 0; } int Curl_gskit_shutdown(struct connectdata *conn, int sockindex) { struct ssl_connect_data *connssl = &conn->ssl[sockindex]; struct SessionHandle *data = conn->data; ssize_t nread; int what; int rc; char buf[120]; if(!connssl->handle) return 0; if(data->set.ftp_ccc != CURLFTPSSL_CCC_ACTIVE) return 0; close_one(connssl, data); rc = 0; what = Curl_socket_ready(conn->sock[sockindex], CURL_SOCKET_BAD, SSL_SHUTDOWN_TIMEOUT); for(;;) { if(what < 0) { /* anything that gets here is fatally bad */ failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); rc = -1; break; } if(!what) { /* timeout */ failf(data, "SSL shutdown timeout"); break; } /* Something to read, let's do it and hope that it is the close notify alert from the server. No way to gsk_secure_soc_read() now, so use read(). */ nread = read(conn->sock[sockindex], buf, sizeof(buf)); if(nread < 0) { failf(data, "read: %s", strerror(errno)); rc = -1; } if(nread <= 0) break; what = Curl_socket_ready(conn->sock[sockindex], CURL_SOCKET_BAD, 0); } return rc; } size_t Curl_gskit_version(char *buffer, size_t size) { strncpy(buffer, "GSKit", size); return strlen(buffer); } int Curl_gskit_check_cxn(struct connectdata *cxn) { int err; int errlen; /* The only thing that can be tested here is at the socket level. */ if(!cxn->ssl[FIRSTSOCKET].handle) return 0; /* connection has been closed */ err = 0; errlen = sizeof err; if(getsockopt(cxn->sock[FIRSTSOCKET], SOL_SOCKET, SO_ERROR, (unsigned char *) &err, &errlen) || errlen != sizeof err || err) return 0; /* connection has been closed */ return -1; /* connection status unknown */ } #endif /* USE_GSKIT */ curl-7.35.0/lib/vtls/axtls.c0000644000175000017500000005177412270035364012551 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2010, DirecTV, Contact: Eric Hu, . * Copyright (C) 2010 - 2013, 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. * ***************************************************************************/ /* * Source file for all axTLS-specific code for the TLS/SSL layer. No code * but vtls.c should ever call or use these functions. */ #include "curl_setup.h" #ifdef USE_AXTLS #include #include "axtls.h" #include "sendf.h" #include "inet_pton.h" #include "vtls.h" #include "parsedate.h" #include "connect.h" /* for the connect timeout */ #include "select.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" #include /* The last #include file should be: */ #include "memdebug.h" #include "hostcheck.h" /* Global axTLS init, called from Curl_ssl_init() */ int Curl_axtls_init(void) { /* axTLS has no global init. Everything is done through SSL and SSL_CTX * structs stored in connectdata structure. Perhaps can move to axtls.h. */ return 1; } int Curl_axtls_cleanup(void) { /* axTLS has no global cleanup. Perhaps can move this to axtls.h. */ return 1; } static CURLcode map_error_to_curl(int axtls_err) { switch (axtls_err) { case SSL_ERROR_NOT_SUPPORTED: case SSL_ERROR_INVALID_VERSION: case -70: /* protocol version alert from server */ return CURLE_UNSUPPORTED_PROTOCOL; break; case SSL_ERROR_NO_CIPHER: return CURLE_SSL_CIPHER; break; case SSL_ERROR_BAD_CERTIFICATE: /* this may be bad server cert too */ case SSL_ERROR_NO_CERT_DEFINED: case -42: /* bad certificate alert from server */ case -43: /* unsupported cert alert from server */ case -44: /* cert revoked alert from server */ case -45: /* cert expired alert from server */ case -46: /* cert unknown alert from server */ return CURLE_SSL_CERTPROBLEM; break; case SSL_X509_ERROR(X509_NOT_OK): case SSL_X509_ERROR(X509_VFY_ERROR_NO_TRUSTED_CERT): case SSL_X509_ERROR(X509_VFY_ERROR_BAD_SIGNATURE): case SSL_X509_ERROR(X509_VFY_ERROR_NOT_YET_VALID): case SSL_X509_ERROR(X509_VFY_ERROR_EXPIRED): case SSL_X509_ERROR(X509_VFY_ERROR_SELF_SIGNED): case SSL_X509_ERROR(X509_VFY_ERROR_INVALID_CHAIN): case SSL_X509_ERROR(X509_VFY_ERROR_UNSUPPORTED_DIGEST): case SSL_X509_ERROR(X509_INVALID_PRIV_KEY): return CURLE_PEER_FAILED_VERIFICATION; break; case -48: /* unknown ca alert from server */ return CURLE_SSL_CACERT; break; case -49: /* access denied alert from server */ return CURLE_REMOTE_ACCESS_DENIED; break; case SSL_ERROR_CONN_LOST: case SSL_ERROR_SOCK_SETUP_FAILURE: case SSL_ERROR_INVALID_HANDSHAKE: case SSL_ERROR_INVALID_PROT_MSG: case SSL_ERROR_INVALID_HMAC: case SSL_ERROR_INVALID_SESSION: case SSL_ERROR_INVALID_KEY: /* it's too bad this doesn't map better */ case SSL_ERROR_FINISHED_INVALID: case SSL_ERROR_NO_CLIENT_RENOG: default: return CURLE_SSL_CONNECT_ERROR; break; } } static Curl_recv axtls_recv; static Curl_send axtls_send; static void free_ssl_structs(struct ssl_connect_data *connssl) { if(connssl->ssl) { ssl_free (connssl->ssl); connssl->ssl = NULL; } if(connssl->ssl_ctx) { ssl_ctx_free(connssl->ssl_ctx); connssl->ssl_ctx = NULL; } } /* * For both blocking and non-blocking connects, this function sets up the * ssl context and state. This function is called after the TCP connect * has completed. */ static CURLcode connect_prep(struct connectdata *conn, int sockindex) { struct SessionHandle *data = conn->data; SSL_CTX *ssl_ctx; SSL *ssl = NULL; int cert_types[] = {SSL_OBJ_X509_CERT, SSL_OBJ_PKCS12, 0}; int key_types[] = {SSL_OBJ_RSA_KEY, SSL_OBJ_PKCS8, SSL_OBJ_PKCS12, 0}; int i, ssl_fcn_return; const uint8_t *ssl_sessionid; size_t ssl_idsize; /* Assuming users will not compile in custom key/cert to axTLS. * Also, even for blocking connects, use axTLS non-blocking feature. */ uint32_t client_option = SSL_NO_DEFAULT_KEY | SSL_SERVER_VERIFY_LATER | SSL_CONNECT_IN_PARTS; if(conn->ssl[sockindex].state == ssl_connection_complete) /* to make us tolerant against being called more than once for the same connection */ return CURLE_OK; /* axTLS only supports TLSv1 */ /* check to see if we've been told to use an explicit SSL/TLS version */ switch(data->set.ssl.version) { case CURL_SSLVERSION_DEFAULT: case CURL_SSLVERSION_TLSv1: break; default: failf(data, "axTLS only supports TLS 1.0 and 1.1, " "and it cannot be specified which one to use"); return CURLE_SSL_CONNECT_ERROR; } #ifdef AXTLSDEBUG client_option |= SSL_DISPLAY_STATES | SSL_DISPLAY_RSA | SSL_DISPLAY_CERTS; #endif /* AXTLSDEBUG */ /* Allocate an SSL_CTX struct */ ssl_ctx = ssl_ctx_new(client_option, SSL_DEFAULT_CLNT_SESS); if(ssl_ctx == NULL) { failf(data, "unable to create client SSL context"); return CURLE_SSL_CONNECT_ERROR; } conn->ssl[sockindex].ssl_ctx = ssl_ctx; conn->ssl[sockindex].ssl = NULL; /* Load the trusted CA cert bundle file */ if(data->set.ssl.CAfile) { if(ssl_obj_load(ssl_ctx, SSL_OBJ_X509_CACERT, data->set.ssl.CAfile, NULL) != SSL_OK) { infof(data, "error reading ca cert file %s \n", data->set.ssl.CAfile); if(data->set.ssl.verifypeer) { return CURLE_SSL_CACERT_BADFILE; } } else infof(data, "found certificates in %s\n", data->set.ssl.CAfile); } /* gtls.c tasks we're skipping for now: * 1) certificate revocation list checking * 2) dns name assignment to host * 3) set protocol priority. axTLS is TLSv1 only, so can probably ignore * 4) set certificate priority. axTLS ignores type and sends certs in * order added. can probably ignore this. */ /* Load client certificate */ if(data->set.str[STRING_CERT]) { i=0; /* Instead of trying to analyze cert type here, let axTLS try them all. */ while(cert_types[i] != 0) { ssl_fcn_return = ssl_obj_load(ssl_ctx, cert_types[i], data->set.str[STRING_CERT], NULL); if(ssl_fcn_return == SSL_OK) { infof(data, "successfully read cert file %s \n", data->set.str[STRING_CERT]); break; } i++; } /* Tried all cert types, none worked. */ if(cert_types[i] == 0) { failf(data, "%s is not x509 or pkcs12 format", data->set.str[STRING_CERT]); return CURLE_SSL_CERTPROBLEM; } } /* Load client key. If a pkcs12 file successfully loaded a cert, then there's nothing to do because the key has already been loaded. */ if(data->set.str[STRING_KEY] && cert_types[i] != SSL_OBJ_PKCS12) { i=0; /* Instead of trying to analyze key type here, let axTLS try them all. */ while(key_types[i] != 0) { ssl_fcn_return = ssl_obj_load(ssl_ctx, key_types[i], data->set.str[STRING_KEY], NULL); if(ssl_fcn_return == SSL_OK) { infof(data, "successfully read key file %s \n", data->set.str[STRING_KEY]); break; } i++; } /* Tried all key types, none worked. */ if(key_types[i] == 0) { failf(data, "Failure: %s is not a supported key file", data->set.str[STRING_KEY]); return CURLE_SSL_CONNECT_ERROR; } } /* gtls.c does more here that is being left out for now * 1) set session credentials. can probably ignore since axtls puts this * info in the ssl_ctx struct * 2) setting up callbacks. these seem gnutls specific */ /* In axTLS, handshaking happens inside ssl_client_new. */ if(!Curl_ssl_getsessionid(conn, (void **) &ssl_sessionid, &ssl_idsize)) { /* we got a session id, use it! */ infof (data, "SSL re-using session ID\n"); ssl = ssl_client_new(ssl_ctx, conn->sock[sockindex], ssl_sessionid, (uint8_t)ssl_idsize); } else ssl = ssl_client_new(ssl_ctx, conn->sock[sockindex], NULL, 0); conn->ssl[sockindex].ssl = ssl; return CURLE_OK; } /* * For both blocking and non-blocking connects, this function finalizes the * SSL connection. */ static CURLcode connect_finish(struct connectdata *conn, int sockindex) { struct SessionHandle *data = conn->data; SSL *ssl = conn->ssl[sockindex].ssl; const uint8_t *ssl_sessionid; size_t ssl_idsize; const char *peer_CN; uint32_t dns_altname_index; const char *dns_altname; int8_t found_subject_alt_names = 0; int8_t found_subject_alt_name_matching_conn = 0; /* Here, gtls.c gets the peer certificates and fails out depending on * settings in "data." axTLS api doesn't have get cert chain fcn, so omit? */ /* Verify server's certificate */ if(data->set.ssl.verifypeer) { if(ssl_verify_cert(ssl) != SSL_OK) { Curl_axtls_close(conn, sockindex); failf(data, "server cert verify failed"); return CURLE_PEER_FAILED_VERIFICATION; } } else infof(data, "\t server certificate verification SKIPPED\n"); /* Here, gtls.c does issuer verification. axTLS has no straightforward * equivalent, so omitting for now.*/ /* Here, gtls.c does the following * 1) x509 hostname checking per RFC2818. axTLS doesn't support this, but * it seems useful. This is now implemented, by Oscar Koeroo * 2) checks cert validity based on time. axTLS does this in ssl_verify_cert * 3) displays a bunch of cert information. axTLS doesn't support most of * this, but a couple fields are available. */ /* There is no (DNS) Altnames count in the version 1.4.8 API. There is a risk of an inifite loop */ for(dns_altname_index = 0; ; dns_altname_index++) { dns_altname = ssl_get_cert_subject_alt_dnsname(ssl, dns_altname_index); if(dns_altname == NULL) { break; } found_subject_alt_names = 1; infof(data, "\tComparing subject alt name DNS with hostname: %s <-> %s\n", dns_altname, conn->host.name); if(Curl_cert_hostcheck(dns_altname, conn->host.name)) { found_subject_alt_name_matching_conn = 1; break; } } /* RFC2818 checks */ if(found_subject_alt_names && !found_subject_alt_name_matching_conn) { if(data->set.ssl.verifyhost) { /* Break connection ! */ Curl_axtls_close(conn, sockindex); failf(data, "\tsubjectAltName(s) do not match %s\n", conn->host.dispname); return CURLE_PEER_FAILED_VERIFICATION; } else infof(data, "\tsubjectAltName(s) do not match %s\n", conn->host.dispname); } else if(found_subject_alt_names == 0) { /* Per RFC2818, when no Subject Alt Names were available, examine the peer CN as a legacy fallback */ peer_CN = ssl_get_cert_dn(ssl, SSL_X509_CERT_COMMON_NAME); if(peer_CN == NULL) { if(data->set.ssl.verifyhost) { Curl_axtls_close(conn, sockindex); failf(data, "unable to obtain common name from peer certificate"); return CURLE_PEER_FAILED_VERIFICATION; } else infof(data, "unable to obtain common name from peer certificate"); } else { if(!Curl_cert_hostcheck((const char *)peer_CN, conn->host.name)) { if(data->set.ssl.verifyhost) { /* Break connection ! */ Curl_axtls_close(conn, sockindex); failf(data, "\tcommon name \"%s\" does not match \"%s\"\n", peer_CN, conn->host.dispname); return CURLE_PEER_FAILED_VERIFICATION; } else infof(data, "\tcommon name \"%s\" does not match \"%s\"\n", peer_CN, conn->host.dispname); } } } /* General housekeeping */ conn->ssl[sockindex].state = ssl_connection_complete; conn->recv[sockindex] = axtls_recv; conn->send[sockindex] = axtls_send; /* Put our freshly minted SSL session in cache */ ssl_idsize = ssl_get_session_id_size(ssl); ssl_sessionid = ssl_get_session_id(ssl); if(Curl_ssl_addsessionid(conn, (void *) ssl_sessionid, ssl_idsize) != CURLE_OK) infof (data, "failed to add session to cache\n"); return CURLE_OK; } /* * Use axTLS's non-blocking connection feature to open an SSL connection. * This is called after a TCP connection is already established. */ CURLcode Curl_axtls_connect_nonblocking( struct connectdata *conn, int sockindex, bool *done) { CURLcode conn_step; int ssl_fcn_return; *done = FALSE; /* connectdata is calloc'd and connecting_state is only changed in this function, so this is safe, as the state is effectively initialized. */ if(conn->ssl[sockindex].connecting_state == ssl_connect_1) { conn_step = connect_prep(conn, sockindex); if(conn_step != CURLE_OK) { Curl_axtls_close(conn, sockindex); return conn_step; } conn->ssl[sockindex].connecting_state = ssl_connect_2; } if(conn->ssl[sockindex].connecting_state == ssl_connect_2) { /* Check to make sure handshake was ok. */ if(ssl_handshake_status(conn->ssl[sockindex].ssl) != SSL_OK) { ssl_fcn_return = ssl_read(conn->ssl[sockindex].ssl, NULL); if(ssl_fcn_return < 0) { Curl_axtls_close(conn, sockindex); ssl_display_error(ssl_fcn_return); /* goes to stdout. */ return map_error_to_curl(ssl_fcn_return); } else { return CURLE_OK; /* Return control to caller for retries */ } } infof (conn->data, "handshake completed successfully\n"); conn->ssl[sockindex].connecting_state = ssl_connect_3; } if(conn->ssl[sockindex].connecting_state == ssl_connect_3) { conn_step = connect_finish(conn, sockindex); if(conn_step != CURLE_OK) { Curl_axtls_close(conn, sockindex); return conn_step; } /* Reset connect state */ conn->ssl[sockindex].connecting_state = ssl_connect_1; *done = TRUE; return CURLE_OK; } /* Unrecognized state. Things are very bad. */ conn->ssl[sockindex].state = ssl_connection_none; conn->ssl[sockindex].connecting_state = ssl_connect_1; /* Return value perhaps not strictly correct, but distinguishes the issue.*/ return CURLE_BAD_FUNCTION_ARGUMENT; } /* * This function is called after the TCP connect has completed. Setup the TLS * layer and do all necessary magic for a blocking connect. */ CURLcode Curl_axtls_connect(struct connectdata *conn, int sockindex) { CURLcode conn_step = connect_prep(conn, sockindex); int ssl_fcn_return; SSL *ssl = conn->ssl[sockindex].ssl; if(conn_step != CURLE_OK) { Curl_axtls_close(conn, sockindex); return conn_step; } /* Check to make sure handshake was ok. */ while(ssl_handshake_status(ssl) != SSL_OK) { ssl_fcn_return = ssl_read(ssl, NULL); if(ssl_fcn_return < 0) { Curl_axtls_close(conn, sockindex); ssl_display_error(ssl_fcn_return); /* goes to stdout. */ return map_error_to_curl(ssl_fcn_return); } usleep(10000); } infof (conn->data, "handshake completed successfully\n"); conn_step = connect_finish(conn, sockindex); if(conn_step != CURLE_OK) { Curl_axtls_close(conn, sockindex); return conn_step; } return CURLE_OK; } /* return number of sent (non-SSL) bytes */ static ssize_t axtls_send(struct connectdata *conn, int sockindex, const void *mem, size_t len, CURLcode *err) { /* ssl_write() returns 'int' while write() and send() returns 'size_t' */ int rc = ssl_write(conn->ssl[sockindex].ssl, mem, (int)len); infof(conn->data, " axtls_send\n"); if(rc < 0 ) { *err = map_error_to_curl(rc); rc = -1; /* generic error code for send failure */ } *err = CURLE_OK; return rc; } void Curl_axtls_close_all(struct SessionHandle *data) { (void)data; infof(data, " Curl_axtls_close_all\n"); } void Curl_axtls_close(struct connectdata *conn, int sockindex) { struct ssl_connect_data *connssl = &conn->ssl[sockindex]; infof(conn->data, " Curl_axtls_close\n"); /* line from openssl.c: (void)SSL_shutdown(connssl->ssl); axTLS compat layer does nothing for SSL_shutdown */ /* The following line is from openssl.c. There seems to be no axTLS equivalent. ssl_free and ssl_ctx_free close things. SSL_set_connect_state(connssl->handle); */ free_ssl_structs(connssl); } /* * This function is called to shut down the SSL layer but keep the * socket open (CCC - Clear Command Channel) */ int Curl_axtls_shutdown(struct connectdata *conn, int sockindex) { /* Outline taken from openssl.c since functions are in axTLS compat layer. axTLS's error set is much smaller, so a lot of error-handling was removed. */ int retval = 0; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; struct SessionHandle *data = conn->data; uint8_t *buf; ssize_t nread; infof(conn->data, " Curl_axtls_shutdown\n"); /* This has only been tested on the proftpd server, and the mod_tls code sends a close notify alert without waiting for a close notify alert in response. Thus we wait for a close notify alert from the server, but we do not send one. Let's hope other servers do the same... */ /* axTLS compat layer does nothing for SSL_shutdown, so we do nothing too if(data->set.ftp_ccc == CURLFTPSSL_CCC_ACTIVE) (void)SSL_shutdown(connssl->ssl); */ if(connssl->ssl) { int what = Curl_socket_ready(conn->sock[sockindex], CURL_SOCKET_BAD, SSL_SHUTDOWN_TIMEOUT); if(what > 0) { /* Something to read, let's do it and hope that it is the close notify alert from the server. buf is managed internally by axTLS and will be released upon calling ssl_free via free_ssl_structs. */ nread = (ssize_t)ssl_read(connssl->ssl, &buf); if(nread < SSL_OK) { failf(data, "close notify alert not received during shutdown"); retval = -1; } } else if(0 == what) { /* timeout */ failf(data, "SSL shutdown timeout"); } else { /* anything that gets here is fatally bad */ failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); retval = -1; } free_ssl_structs(connssl); } return retval; } static ssize_t axtls_recv(struct connectdata *conn, /* connection data */ int num, /* socketindex */ char *buf, /* store read data here */ size_t buffersize, /* max amount to read */ CURLcode *err) { struct ssl_connect_data *connssl = &conn->ssl[num]; ssize_t ret = 0; uint8_t *read_buf; infof(conn->data, " axtls_recv\n"); *err = CURLE_OK; if(connssl) { ret = ssl_read(connssl->ssl, &read_buf); if(ret > SSL_OK) { /* ssl_read returns SSL_OK if there is more data to read, so if it is larger, then all data has been read already. */ memcpy(buf, read_buf, (size_t)ret > buffersize ? buffersize : (size_t)ret); } else if(ret == SSL_OK) { /* more data to be read, signal caller to call again */ *err = CURLE_AGAIN; ret = -1; } else if(ret == -3) { /* With patched axTLS, SSL_CLOSE_NOTIFY=-3. Hard-coding until axTLS team approves proposed fix. */ Curl_axtls_close(conn, num); } else { failf(conn->data, "axTLS recv error (%d)", ret); *err = map_error_to_curl((int) ret); ret = -1; } } return ret; } /* * 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_axtls_check_cxn(struct connectdata *conn) { /* openssl.c line: rc = SSL_peek(conn->ssl[FIRSTSOCKET].ssl, (void*)&buf, 1); axTLS compat layer always returns the last argument, so connection is always alive? */ infof(conn->data, " Curl_axtls_check_cxn\n"); return 1; /* connection still in place */ } void Curl_axtls_session_free(void *ptr) { (void)ptr; /* free the ID */ /* both openssl.c and gtls.c do something here, but axTLS's OpenSSL compatibility layer does nothing, so we do nothing too. */ } size_t Curl_axtls_version(char *buffer, size_t size) { return snprintf(buffer, size, "axTLS/%s", ssl_version()); } #endif /* USE_AXTLS */ curl-7.35.0/lib/vtls/curl_darwinssl.h0000644000175000017500000000644212262353672014454 00000000000000#ifndef HEADER_CURL_DARWINSSL_H #define HEADER_CURL_DARWINSSL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2012 - 2013, Nick Zitzmann, . * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_DARWINSSL CURLcode Curl_darwinssl_connect(struct connectdata *conn, int sockindex); CURLcode Curl_darwinssl_connect_nonblocking(struct connectdata *conn, int sockindex, bool *done); /* this function doesn't actually do anything */ void Curl_darwinssl_close_all(struct SessionHandle *data); /* close a SSL connection */ void Curl_darwinssl_close(struct connectdata *conn, int sockindex); void Curl_darwinssl_session_free(void *ptr); size_t Curl_darwinssl_version(char *buffer, size_t size); int Curl_darwinssl_shutdown(struct connectdata *conn, int sockindex); int Curl_darwinssl_check_cxn(struct connectdata *conn); bool Curl_darwinssl_data_pending(const struct connectdata *conn, int connindex); void Curl_darwinssl_random(struct SessionHandle *data, unsigned char *entropy, size_t length); void Curl_darwinssl_md5sum(unsigned char *tmp, /* input */ size_t tmplen, unsigned char *md5sum, /* output */ size_t md5len); /* this backend provides these functions: */ #define have_curlssl_random 1 #define have_curlssl_md5sum 1 /* API setup for SecureTransport */ #define curlssl_init() (1) #define curlssl_cleanup() Curl_nop_stmt #define curlssl_connect Curl_darwinssl_connect #define curlssl_connect_nonblocking Curl_darwinssl_connect_nonblocking #define curlssl_session_free(x) Curl_darwinssl_session_free(x) #define curlssl_close_all Curl_darwinssl_close_all #define curlssl_close Curl_darwinssl_close #define curlssl_shutdown(x,y) 0 #define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN) #define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN) #define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL) #define curlssl_version Curl_darwinssl_version #define curlssl_check_cxn Curl_darwinssl_check_cxn #define curlssl_data_pending(x,y) Curl_darwinssl_data_pending(x, y) #define curlssl_random(x,y,z) Curl_darwinssl_random(x,y,z) #define curlssl_md5sum(a,b,c,d) Curl_darwinssl_md5sum(a,b,c,d) #endif /* USE_DARWINSSL */ #endif /* HEADER_CURL_DARWINSSL_H */ curl-7.35.0/lib/vtls/polarssl_threadlock.h0000644000175000017500000000361212262353672015454 00000000000000#ifndef HEADER_CURL_POLARSSL_THREADLOCK_H #define HEADER_CURL_POLARSSL_THREADLOCK_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2010, Hoi-Ho Chan, * Copyright (C) 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_POLARSSL #if defined(USE_THREADS_POSIX) # define POLARSSL_MUTEX_T pthread_mutex_t #elif defined(USE_THREADS_WIN32) # define POLARSSL_MUTEX_T HANDLE #endif #if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) int polarsslthreadlock_thread_setup(void); int polarsslthreadlock_thread_cleanup(void); int polarsslthreadlock_lock_function(int n); int polarsslthreadlock_unlock_function(int n); #else #define polarsslthreadlock_thread_setup() 1 #define polarsslthreadlock_thread_cleanup() 1 #define polarsslthreadlock_lock_function(x) 1 #define polarsslthreadlock_unlock_function(x) 1 #endif /* USE_THREADS_POSIX || USE_THREADS_WIN32 */ #endif /* USE_POLARSSL */ #endif /* HEADER_CURL_POLARSSL_THREADLOCK_H */ curl-7.35.0/lib/vtls/vtls.c0000644000175000017500000004536612262353672012414 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* This file is for implementing all "generic" SSL functions that all libcurl internals should use. It is then responsible for calling the proper "backend" function. 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 Curl_nss_ - prefix for NSS ones Curl_qssl_ - prefix for QsoSSL ones Curl_gskit_ - prefix for GSKit ones Curl_polarssl_ - prefix for PolarSSL ones Curl_cyassl_ - prefix for CyaSSL ones Curl_schannel_ - prefix for Schannel SSPI ones Curl_darwinssl_ - prefix for SecureTransport (Darwin) ones Note that this source code uses curlssl_* functions, and they are all defines/macros #defined by the lib-specific header files. "SSL/TLS Strong Encryption: An Introduction" http://httpd.apache.org/docs-2.0/ssl/ssl_intro.html */ #include "curl_setup.h" #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_FCNTL_H #include #endif #include "urldata.h" #include "vtls.h" /* generic SSL protos etc */ #include "openssl.h" /* OpenSSL versions */ #include "gtls.h" /* GnuTLS versions */ #include "nssg.h" /* NSS versions */ #include "qssl.h" /* QSOSSL versions */ #include "gskit.h" /* Global Secure ToolKit versions */ #include "polarssl.h" /* PolarSSL versions */ #include "axtls.h" /* axTLS versions */ #include "cyassl.h" /* CyaSSL versions */ #include "curl_schannel.h" /* Schannel SSPI version */ #include "curl_darwinssl.h" /* SecureTransport (Darwin) version */ #include "slist.h" #include "sendf.h" #include "rawstr.h" #include "url.h" #include "curl_memory.h" #include "progress.h" #include "share.h" #include "timeval.h" #define _MPRINTF_REPLACE /* use our functions only */ #include /* The last #include file should be: */ #include "memdebug.h" /* convenience macro to check if this handle is using a shared SSL session */ #define SSLSESSION_SHARED(data) (data->share && \ (data->share->specifier & \ (1<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->sessionid = source->sessionid; 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; } else dest->CAfile = NULL; if(source->CApath) { dest->CApath = strdup(source->CApath); if(!dest->CApath) return FALSE; } else dest->CApath = NULL; if(source->cipher_list) { dest->cipher_list = strdup(source->cipher_list); if(!dest->cipher_list) return FALSE; } else dest->cipher_list = NULL; if(source->egdsocket) { dest->egdsocket = strdup(source->egdsocket); if(!dest->egdsocket) return FALSE; } else dest->egdsocket = NULL; if(source->random_file) { dest->random_file = strdup(source->random_file); if(!dest->random_file) return FALSE; } else dest->random_file = NULL; return TRUE; } void Curl_free_ssl_config(struct ssl_config_data* sslc) { Curl_safefree(sslc->CAfile); Curl_safefree(sslc->CApath); Curl_safefree(sslc->cipher_list); Curl_safefree(sslc->egdsocket); Curl_safefree(sslc->random_file); } /* * Curl_rand() returns a random unsigned integer, 32bit. * * This non-SSL function is put here only because this file is the only one * with knowledge of what the underlying SSL libraries provide in terms of * randomizers. * * NOTE: 'data' may be passed in as NULL when coming from external API without * easy handle! * */ unsigned int Curl_rand(struct SessionHandle *data) { unsigned int r; static unsigned int randseed; static bool seeded = FALSE; #ifndef have_curlssl_random (void)data; #else if(data) { Curl_ssl_random(data, (unsigned char *)&r, sizeof(r)); return r; } #endif #ifdef RANDOM_FILE if(!seeded) { /* if there's a random file to read a seed from, use it */ int fd = open(RANDOM_FILE, O_RDONLY); if(fd > -1) { /* read random data into the randseed variable */ ssize_t nread = read(fd, &randseed, sizeof(randseed)); if(nread == sizeof(randseed)) seeded = TRUE; close(fd); } } #endif if(!seeded) { struct timeval now = curlx_tvnow(); randseed += (unsigned int)now.tv_usec + (unsigned int)now.tv_sec; randseed = randseed * 1103515245 + 12345; randseed = randseed * 1103515245 + 12345; randseed = randseed * 1103515245 + 12345; seeded = TRUE; } /* Return an unsigned 32-bit pseudo-random number. */ r = randseed = randseed * 1103515245 + 12345; return (r << 16) | ((r >> 16) & 0xFFFF); } #ifdef USE_SSL /* "global" init done? */ static bool init_ssl=FALSE; /** * 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 */ return curlssl_init(); } /* Global cleanup */ void Curl_ssl_cleanup(void) { if(init_ssl) { /* only cleanup if we did a previous init */ curlssl_cleanup(); init_ssl = FALSE; } } CURLcode Curl_ssl_connect(struct connectdata *conn, int sockindex) { CURLcode res; /* mark this is being ssl-enabled from here on. */ conn->ssl[sockindex].use = TRUE; conn->ssl[sockindex].state = ssl_connection_negotiating; res = curlssl_connect(conn, sockindex); if(!res) Curl_pgrsTime(conn->data, TIMER_APPCONNECT); /* SSL is connected */ return res; } CURLcode Curl_ssl_connect_nonblocking(struct connectdata *conn, int sockindex, bool *done) { CURLcode res; /* mark this is being ssl requested from here on. */ conn->ssl[sockindex].use = TRUE; #ifdef curlssl_connect_nonblocking res = curlssl_connect_nonblocking(conn, sockindex, done); #else *done = TRUE; /* fallback to BLOCKING */ res = curlssl_connect(conn, sockindex); #endif /* non-blocking connect support */ if(!res && *done) Curl_pgrsTime(conn->data, TIMER_APPCONNECT); /* SSL is connected */ return res; } /* * 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; size_t i; long *general_age; bool no_match = TRUE; *ssl_sessionid = NULL; if(!conn->ssl_config.sessionid) /* session ID re-use is disabled */ return TRUE; /* Lock if shared */ if(SSLSESSION_SHARED(data)) { Curl_share_lock(data, CURL_LOCK_DATA_SSL_SESSION, CURL_LOCK_ACCESS_SINGLE); general_age = &data->share->sessionage; } else general_age = &data->state.sessionage; for(i = 0; i < data->set.ssl.max_ssl_sessions; i++) { check = &data->state.session[i]; if(!check->sessionid) /* not session ID means blank entry */ continue; if(Curl_raw_equal(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! */ (*general_age)++; /* increase general age */ check->age = *general_age; /* set this as used in this age */ *ssl_sessionid = check->sessionid; if(idsize) *idsize = check->idsize; no_match = FALSE; break; } } /* Unlock */ if(SSLSESSION_SHARED(data)) Curl_share_unlock(data, CURL_LOCK_DATA_SSL_SESSION); return no_match; } /* * Kill a single session ID entry in the cache. */ void Curl_ssl_kill_session(struct curl_ssl_session *session) { if(session->sessionid) { /* defensive check */ /* free the ID the SSL-layer specific way */ curlssl_session_free(session->sessionid); session->sessionid = NULL; session->age = 0; /* fresh */ Curl_free_ssl_config(&session->ssl_config); Curl_safefree(session->name); } } /* * Delete the given session ID from the cache. */ void Curl_ssl_delsessionid(struct connectdata *conn, void *ssl_sessionid) { size_t i; struct SessionHandle *data=conn->data; if(SSLSESSION_SHARED(data)) Curl_share_lock(data, CURL_LOCK_DATA_SSL_SESSION, CURL_LOCK_ACCESS_SINGLE); for(i = 0; i < data->set.ssl.max_ssl_sessions; i++) { struct curl_ssl_session *check = &data->state.session[i]; if(check->sessionid == ssl_sessionid) { Curl_ssl_kill_session(check); break; } } if(SSLSESSION_SHARED(data)) Curl_share_unlock(data, CURL_LOCK_DATA_SSL_SESSION); } /* * 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) { size_t 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; long *general_age; /* 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) */ /* If using shared SSL session, lock! */ if(SSLSESSION_SHARED(data)) { Curl_share_lock(data, CURL_LOCK_DATA_SSL_SESSION, CURL_LOCK_ACCESS_SINGLE); general_age = &data->share->sessionage; } else { general_age = &data->state.sessionage; } /* find an empty slot for us, or find the oldest */ for(i = 1; (i < data->set.ssl.max_ssl_sessions) && 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.max_ssl_sessions) /* cache is full, we must "kill" the oldest entry! */ Curl_ssl_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 = *general_age; /* set current age */ if(store->name) /* free it if there's one already present */ free(store->name); store->name = clone_host; /* clone host name */ store->remote_port = conn->remote_port; /* port number */ /* Unlock */ if(SSLSESSION_SHARED(data)) Curl_share_unlock(data, CURL_LOCK_DATA_SSL_SESSION); if(!Curl_clone_ssl_config(&conn->ssl_config, &store->ssl_config)) { store->sessionid = NULL; /* let caller free sessionid */ free(clone_host); return CURLE_OUT_OF_MEMORY; } return CURLE_OK; } void Curl_ssl_close_all(struct SessionHandle *data) { size_t i; /* kill the session ID cache if not shared */ if(data->state.session && !SSLSESSION_SHARED(data)) { for(i = 0; i < data->set.ssl.max_ssl_sessions; i++) /* the single-killer function handles empty table slots */ Curl_ssl_kill_session(&data->state.session[i]); /* free the cache data */ Curl_safefree(data->state.session); } curlssl_close_all(data); } void Curl_ssl_close(struct connectdata *conn, int sockindex) { DEBUGASSERT((sockindex <= 1) && (sockindex >= -1)); curlssl_close(conn, sockindex); } CURLcode Curl_ssl_shutdown(struct connectdata *conn, int sockindex) { if(curlssl_shutdown(conn, sockindex)) return CURLE_SSL_SHUTDOWN_FAILED; conn->ssl[sockindex].use = FALSE; /* get back to ordinary socket usage */ conn->ssl[sockindex].state = ssl_connection_none; conn->recv[sockindex] = Curl_recv_plain; conn->send[sockindex] = Curl_send_plain; return CURLE_OK; } /* Selects an SSL crypto engine */ CURLcode Curl_ssl_set_engine(struct SessionHandle *data, const char *engine) { return curlssl_set_engine(data, engine); } /* Selects the default SSL crypto engine */ CURLcode Curl_ssl_set_engine_default(struct SessionHandle *data) { return curlssl_set_engine_default(data); } /* Return list of OpenSSL crypto engine names. */ struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data) { return curlssl_engines_list(data); } /* * 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, size_t amount) { struct curl_ssl_session *session; if(data->state.session) /* this is just a precaution to prevent multiple inits */ return CURLE_OK; session = calloc(amount, sizeof(struct curl_ssl_session)); if(!session) return CURLE_OUT_OF_MEMORY; /* store the info in the SSL section */ data->set.ssl.max_ssl_sessions = amount; data->state.session = session; data->state.sessionage = 1; /* this is brand new */ return CURLE_OK; } size_t Curl_ssl_version(char *buffer, size_t size) { return curlssl_version(buffer, size); } /* * 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) { return curlssl_check_cxn(conn); } bool Curl_ssl_data_pending(const struct connectdata *conn, int connindex) { return curlssl_data_pending(conn, connindex); } void Curl_ssl_free_certinfo(struct SessionHandle *data) { int i; struct curl_certinfo *ci = &data->info.certs; if(ci->num_of_certs) { /* free all individual lists used */ for(i=0; inum_of_certs; i++) { curl_slist_free_all(ci->certinfo[i]); ci->certinfo[i] = NULL; } free(ci->certinfo); /* free the actual array too */ ci->certinfo = NULL; ci->num_of_certs = 0; } } int Curl_ssl_init_certinfo(struct SessionHandle * data, int num) { struct curl_certinfo * ci = &data->info.certs; struct curl_slist * * table; /* Initialize the certificate information structures. Return 0 if OK, else 1. */ Curl_ssl_free_certinfo(data); ci->num_of_certs = num; table = calloc((size_t) num, sizeof(struct curl_slist *)); if(!table) return 1; ci->certinfo = table; return 0; } /* * 'value' is NOT a zero terminated string */ CURLcode Curl_ssl_push_certinfo_len(struct SessionHandle *data, int certnum, const char *label, const char *value, size_t valuelen) { struct curl_certinfo * ci = &data->info.certs; char * output; struct curl_slist * nl; CURLcode res = CURLE_OK; size_t labellen = strlen(label); size_t outlen = labellen + 1 + valuelen + 1; /* label:value\0 */ output = malloc(outlen); if(!output) return CURLE_OUT_OF_MEMORY; /* sprintf the label and colon */ snprintf(output, outlen, "%s:", label); /* memcpy the value (it might not be zero terminated) */ memcpy(&output[labellen+1], value, valuelen); /* zero terminate the output */ output[labellen + 1 + valuelen] = 0; nl = Curl_slist_append_nodup(ci->certinfo[certnum], output); if(!nl) { free(output); curl_slist_free_all(ci->certinfo[certnum]); res = CURLE_OUT_OF_MEMORY; } ci->certinfo[certnum] = nl; return res; } /* * This is a convenience function for push_certinfo_len that takes a zero * terminated value. */ CURLcode Curl_ssl_push_certinfo(struct SessionHandle *data, int certnum, const char *label, const char *value) { size_t valuelen = strlen(value); return Curl_ssl_push_certinfo_len(data, certnum, label, value, valuelen); } /* these functions are only provided by some SSL backends */ #ifdef have_curlssl_random void Curl_ssl_random(struct SessionHandle *data, unsigned char *entropy, size_t length) { curlssl_random(data, entropy, length); } #endif #ifdef have_curlssl_md5sum void Curl_ssl_md5sum(unsigned char *tmp, /* input */ size_t tmplen, unsigned char *md5sum, /* output */ size_t md5len) { curlssl_md5sum(tmp, tmplen, md5sum, md5len); } #endif #endif /* USE_SSL */ curl-7.35.0/lib/vtls/axtls.h0000644000175000017500000000514712262353672012555 00000000000000#ifndef HEADER_CURL_AXTLS_H #define HEADER_CURL_AXTLS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2010, DirecTV * contact: Eric Hu * * 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. * ***************************************************************************/ #ifdef USE_AXTLS #include "curl/curl.h" #include "urldata.h" int Curl_axtls_init(void); int Curl_axtls_cleanup(void); CURLcode Curl_axtls_connect(struct connectdata *conn, int sockindex); CURLcode Curl_axtls_connect_nonblocking( struct connectdata *conn, int sockindex, bool *done); /* tell axTLS to close down all open information regarding connections (and thus session ID caching etc) */ void Curl_axtls_close_all(struct SessionHandle *data); /* close a SSL connection */ void Curl_axtls_close(struct connectdata *conn, int sockindex); void Curl_axtls_session_free(void *ptr); size_t Curl_axtls_version(char *buffer, size_t size); int Curl_axtls_shutdown(struct connectdata *conn, int sockindex); int Curl_axtls_check_cxn(struct connectdata *conn); /* API setup for axTLS */ #define curlssl_init Curl_axtls_init #define curlssl_cleanup Curl_axtls_cleanup #define curlssl_connect Curl_axtls_connect #define curlssl_connect_nonblocking Curl_axtls_connect_nonblocking #define curlssl_session_free(x) Curl_axtls_session_free(x) #define curlssl_close_all Curl_axtls_close_all #define curlssl_close Curl_axtls_close #define curlssl_shutdown(x,y) Curl_axtls_shutdown(x,y) #define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN) #define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN) #define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL) #define curlssl_version Curl_axtls_version #define curlssl_check_cxn(x) Curl_axtls_check_cxn(x) #define curlssl_data_pending(x,y) (x=x, y=y, 0) #endif /* USE_AXTLS */ #endif /* HEADER_CURL_AXTLS_H */ curl-7.35.0/lib/vtls/curl_schannel.h0000644000175000017500000001014512262353672014234 00000000000000#ifndef HEADER_CURL_SCHANNEL_H #define HEADER_CURL_SCHANNEL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2012, Marc Hoersken, , et al. * Copyright (C) 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_SCHANNEL #include "urldata.h" #ifndef UNISP_NAME_A #define UNISP_NAME_A "Microsoft Unified Security Protocol Provider" #endif #ifndef UNISP_NAME_W #define UNISP_NAME_W L"Microsoft Unified Security Protocol Provider" #endif #ifndef UNISP_NAME #ifdef UNICODE #define UNISP_NAME UNISP_NAME_W #else #define UNISP_NAME UNISP_NAME_A #endif #endif #ifndef SP_PROT_SSL2_CLIENT #define SP_PROT_SSL2_CLIENT 0x00000008 #endif #ifndef SP_PROT_SSL3_CLIENT #define SP_PROT_SSL3_CLIENT 0x00000008 #endif #ifndef SP_PROT_TLS1_CLIENT #define SP_PROT_TLS1_CLIENT 0x00000080 #endif #ifndef SP_PROT_TLS1_0_CLIENT #define SP_PROT_TLS1_0_CLIENT SP_PROT_TLS1_CLIENT #endif #ifndef SP_PROT_TLS1_1_CLIENT #define SP_PROT_TLS1_1_CLIENT 0x00000200 #endif #ifndef SP_PROT_TLS1_2_CLIENT #define SP_PROT_TLS1_2_CLIENT 0x00000800 #endif #ifndef SECBUFFER_ALERT #define SECBUFFER_ALERT 17 #endif #ifndef ISC_RET_REPLAY_DETECT #define ISC_RET_REPLAY_DETECT 0x00000004 #endif #ifndef ISC_RET_SEQUENCE_DETECT #define ISC_RET_SEQUENCE_DETECT 0x00000008 #endif #ifndef ISC_RET_CONFIDENTIALITY #define ISC_RET_CONFIDENTIALITY 0x00000010 #endif #ifndef ISC_RET_ALLOCATED_MEMORY #define ISC_RET_ALLOCATED_MEMORY 0x00000100 #endif #ifndef ISC_RET_STREAM #define ISC_RET_STREAM 0x00008000 #endif #define CURL_SCHANNEL_BUFFER_INIT_SIZE 4096 #define CURL_SCHANNEL_BUFFER_FREE_SIZE 1024 #define CURL_SCHANNEL_BUFFER_STEP_FACTOR 2 CURLcode Curl_schannel_connect(struct connectdata *conn, int sockindex); CURLcode Curl_schannel_connect_nonblocking(struct connectdata *conn, int sockindex, bool *done); bool Curl_schannel_data_pending(const struct connectdata *conn, int sockindex); void Curl_schannel_close(struct connectdata *conn, int sockindex); int Curl_schannel_shutdown(struct connectdata *conn, int sockindex); void Curl_schannel_session_free(void *ptr); int Curl_schannel_init(void); void Curl_schannel_cleanup(void); size_t Curl_schannel_version(char *buffer, size_t size); /* API setup for Schannel */ #define curlssl_init Curl_schannel_init #define curlssl_cleanup Curl_schannel_cleanup #define curlssl_connect Curl_schannel_connect #define curlssl_connect_nonblocking Curl_schannel_connect_nonblocking #define curlssl_session_free Curl_schannel_session_free #define curlssl_close_all(x) (x=x, CURLE_NOT_BUILT_IN) #define curlssl_close Curl_schannel_close #define curlssl_shutdown Curl_schannel_shutdown #define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN) #define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN) #define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL) #define curlssl_version Curl_schannel_version #define curlssl_check_cxn(x) (x=x, -1) #define curlssl_data_pending Curl_schannel_data_pending #endif /* USE_SCHANNEL */ #endif /* HEADER_CURL_SCHANNEL_H */ curl-7.35.0/lib/vtls/polarssl.c0000644000175000017500000004767412270035364013261 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2010 - 2011, Hoi-Ho Chan, * Copyright (C) 2012 - 2013, 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. * ***************************************************************************/ /* * Source file for all PolarSSL-specific code for the TLS/SSL layer. No code * but vtls.c should ever call or use these functions. * */ #include "curl_setup.h" #ifdef USE_POLARSSL #include #include #include #include #include #if POLARSSL_VERSION_NUMBER >= 0x01000000 #include #endif /* POLARSSL_VERSION_NUMBER >= 0x01000000 */ #if POLARSSL_VERSION_NUMBER>0x01010000 #include #include #else #include #endif /* POLARSSL_VERSION_NUMBER>0x01010000 */ #if POLARSSL_VERSION_NUMBER<0x01000000 /* Earlier versions of polarssl had no WANT_READ or WANT_WRITE, only TRY_AGAIN */ #define POLARSSL_ERR_NET_WANT_READ POLARSSL_ERR_NET_TRY_AGAIN #define POLARSSL_ERR_NET_WANT_WRITE POLARSSL_ERR_NET_TRY_AGAIN #endif #include "urldata.h" #include "sendf.h" #include "inet_pton.h" #include "polarssl.h" #include "vtls.h" #include "parsedate.h" #include "connect.h" /* for the connect timeout */ #include "select.h" #include "rawstr.h" #include "polarssl_threadlock.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* apply threading? */ #if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) #define THREADING_SUPPORT #endif #if defined(THREADING_SUPPORT) && POLARSSL_VERSION_NUMBER>0x01010000 static entropy_context entropy; static int entropy_init_initialized = 0; /* start of entropy_init_mutex() */ static void entropy_init_mutex(entropy_context *ctx) { /* lock 0 = entropy_init_mutex() */ polarsslthreadlock_lock_function(0); if(entropy_init_initialized == 0) { entropy_init(ctx); entropy_init_initialized = 1; } polarsslthreadlock_unlock_function(0); } /* end of entropy_init_mutex() */ /* start of entropy_func_mutex() */ static int entropy_func_mutex(void *data, unsigned char *output, size_t len) { int ret; /* lock 1 = entropy_func_mutex() */ polarsslthreadlock_lock_function(1); ret = entropy_func(data, output, len); polarsslthreadlock_unlock_function(1); return ret; } /* end of entropy_func_mutex() */ #endif /* THREADING_SUPPORT && POLARSSL_VERSION_NUMBER>0x01010000 */ /* Define this to enable lots of debugging for PolarSSL */ #undef POLARSSL_DEBUG #ifdef POLARSSL_DEBUG static void polarssl_debug(void *context, int level, char *line) { struct SessionHandle *data = NULL; if(!context) return; data = (struct SessionHandle *)context; infof(data, "%s\n", line); } #else #endif static Curl_recv polarssl_recv; static Curl_send polarssl_send; static CURLcode polarssl_connect_step1(struct connectdata *conn, int sockindex) { struct SessionHandle *data = conn->data; struct ssl_connect_data* connssl = &conn->ssl[sockindex]; bool sni = TRUE; /* default is SNI enabled */ int ret = -1; #ifdef ENABLE_IPV6 struct in6_addr addr; #else struct in_addr addr; #endif void *old_session = NULL; size_t old_session_size = 0; char errorbuf[128]; memset(errorbuf, 0, sizeof(errorbuf)); /* PolarSSL only supports SSLv3 and TLSv1 */ if(data->set.ssl.version == CURL_SSLVERSION_SSLv2) { failf(data, "PolarSSL does not support SSLv2"); return CURLE_SSL_CONNECT_ERROR; } else if(data->set.ssl.version == CURL_SSLVERSION_SSLv3) sni = FALSE; /* SSLv3 has no SNI */ #if POLARSSL_VERSION_NUMBER<0x01010000 havege_init(&connssl->hs); #else #ifdef THREADING_SUPPORT entropy_init_mutex(&entropy); if((ret = ctr_drbg_init(&connssl->ctr_drbg, entropy_func_mutex, &entropy, connssl->ssn.id, connssl->ssn.length)) != 0) { #ifdef POLARSSL_ERROR_C error_strerror(ret, errorbuf, sizeof(errorbuf)); #endif /* POLARSSL_ERROR_C */ failf(data, "Failed - PolarSSL: ctr_drbg_init returned (-0x%04X) %s\n", -ret, errorbuf); } #else entropy_init(&connssl->entropy); if((ret = ctr_drbg_init(&connssl->ctr_drbg, entropy_func, &connssl->entropy, connssl->ssn.id, connssl->ssn.length)) != 0) { #ifdef POLARSSL_ERROR_C error_strerror(ret, errorbuf, sizeof(errorbuf)); #endif /* POLARSSL_ERROR_C */ failf(data, "Failed - PolarSSL: ctr_drbg_init returned (-0x%04X) %s\n", -ret, errorbuf); } #endif /* THREADING_SUPPORT */ #endif /* POLARSSL_VERSION_NUMBER<0x01010000 */ /* Load the trusted CA */ memset(&connssl->cacert, 0, sizeof(x509_cert)); if(data->set.str[STRING_SSL_CAFILE]) { ret = x509parse_crtfile(&connssl->cacert, data->set.str[STRING_SSL_CAFILE]); if(ret<0) { #ifdef POLARSSL_ERROR_C error_strerror(ret, errorbuf, sizeof(errorbuf)); #endif /* POLARSSL_ERROR_C */ failf(data, "Error reading ca cert file %s - PolarSSL: (-0x%04X) %s", data->set.str[STRING_SSL_CAFILE], -ret, errorbuf); if(data->set.ssl.verifypeer) return CURLE_SSL_CACERT_BADFILE; } } /* Load the client certificate */ memset(&connssl->clicert, 0, sizeof(x509_cert)); if(data->set.str[STRING_CERT]) { ret = x509parse_crtfile(&connssl->clicert, data->set.str[STRING_CERT]); if(ret) { #ifdef POLARSSL_ERROR_C error_strerror(ret, errorbuf, sizeof(errorbuf)); #endif /* POLARSSL_ERROR_C */ failf(data, "Error reading client cert file %s - PolarSSL: (-0x%04X) %s", data->set.str[STRING_CERT], -ret, errorbuf); return CURLE_SSL_CERTPROBLEM; } } /* Load the client private key */ if(data->set.str[STRING_KEY]) { ret = x509parse_keyfile(&connssl->rsa, data->set.str[STRING_KEY], data->set.str[STRING_KEY_PASSWD]); if(ret) { #ifdef POLARSSL_ERROR_C error_strerror(ret, errorbuf, sizeof(errorbuf)); #endif /* POLARSSL_ERROR_C */ failf(data, "Error reading private key %s - PolarSSL: (-0x%04X) %s", data->set.str[STRING_KEY], -ret, errorbuf); return CURLE_SSL_CERTPROBLEM; } } /* Load the CRL */ memset(&connssl->crl, 0, sizeof(x509_crl)); if(data->set.str[STRING_SSL_CRLFILE]) { ret = x509parse_crlfile(&connssl->crl, data->set.str[STRING_SSL_CRLFILE]); if(ret) { #ifdef POLARSSL_ERROR_C error_strerror(ret, errorbuf, sizeof(errorbuf)); #endif /* POLARSSL_ERROR_C */ failf(data, "Error reading CRL file %s - PolarSSL: (-0x%04X) %s", data->set.str[STRING_SSL_CRLFILE], -ret, errorbuf); return CURLE_SSL_CRL_BADFILE; } } infof(data, "PolarSSL: Connecting to %s:%d\n", conn->host.name, conn->remote_port); if(ssl_init(&connssl->ssl)) { failf(data, "PolarSSL: ssl_init failed"); return CURLE_SSL_CONNECT_ERROR; } ssl_set_endpoint(&connssl->ssl, SSL_IS_CLIENT); ssl_set_authmode(&connssl->ssl, SSL_VERIFY_OPTIONAL); #if POLARSSL_VERSION_NUMBER<0x01010000 ssl_set_rng(&connssl->ssl, havege_rand, &connssl->hs); #else ssl_set_rng(&connssl->ssl, ctr_drbg_random, &connssl->ctr_drbg); #endif /* POLARSSL_VERSION_NUMBER<0x01010000 */ ssl_set_bio(&connssl->ssl, net_recv, &conn->sock[sockindex], net_send, &conn->sock[sockindex]); #if POLARSSL_VERSION_NUMBER<0x01000000 ssl_set_ciphers(&connssl->ssl, ssl_default_ciphers); #else ssl_set_ciphersuites(&connssl->ssl, ssl_default_ciphersuites); #endif if(!Curl_ssl_getsessionid(conn, &old_session, &old_session_size)) { memcpy(&connssl->ssn, old_session, old_session_size); infof(data, "PolarSSL re-using session\n"); } /* PolarSSL SVN revision r1316 to r1317, matching <1.2.0 is to cover Ubuntu's 1.1.4 version and the like */ #if POLARSSL_VERSION_NUMBER<0x01020000 ssl_set_session(&connssl->ssl, 1, 600, &connssl->ssn); #else ssl_set_session(&connssl->ssl, &connssl->ssn); #endif ssl_set_ca_chain(&connssl->ssl, &connssl->cacert, &connssl->crl, conn->host.name); ssl_set_own_cert(&connssl->ssl, &connssl->clicert, &connssl->rsa); if(!Curl_inet_pton(AF_INET, conn->host.name, &addr) && #ifdef ENABLE_IPV6 !Curl_inet_pton(AF_INET6, conn->host.name, &addr) && #endif sni && ssl_set_hostname(&connssl->ssl, conn->host.name)) { infof(data, "WARNING: failed to configure " "server name indication (SNI) TLS extension\n"); } #ifdef POLARSSL_DEBUG ssl_set_dbg(&connssl->ssl, polarssl_debug, data); #endif connssl->connecting_state = ssl_connect_2; return CURLE_OK; } static CURLcode polarssl_connect_step2(struct connectdata *conn, int sockindex) { int ret; struct SessionHandle *data = conn->data; struct ssl_connect_data* connssl = &conn->ssl[sockindex]; char buffer[1024]; char errorbuf[128]; memset(errorbuf, 0, sizeof(errorbuf)); conn->recv[sockindex] = polarssl_recv; conn->send[sockindex] = polarssl_send; for(;;) { if(!(ret = ssl_handshake(&connssl->ssl))) break; else if(ret != POLARSSL_ERR_NET_WANT_READ && ret != POLARSSL_ERR_NET_WANT_WRITE) { #ifdef POLARSSL_ERROR_C error_strerror(ret, errorbuf, sizeof(errorbuf)); #endif /* POLARSSL_ERROR_C */ failf(data, "ssl_handshake returned - PolarSSL: (-0x%04X) %s", -ret, errorbuf); return CURLE_SSL_CONNECT_ERROR; } else { if(ret == POLARSSL_ERR_NET_WANT_READ) { connssl->connecting_state = ssl_connect_2_reading; return CURLE_OK; } if(ret == POLARSSL_ERR_NET_WANT_WRITE) { connssl->connecting_state = ssl_connect_2_writing; return CURLE_OK; } failf(data, "SSL_connect failed with error %d.", ret); return CURLE_SSL_CONNECT_ERROR; } } infof(data, "PolarSSL: Handshake complete, cipher is %s\n", #if POLARSSL_VERSION_NUMBER<0x01000000 ssl_get_cipher(&conn->ssl[sockindex].ssl) #elif POLARSSL_VERSION_NUMBER >= 0x01010000 ssl_get_ciphersuite(&conn->ssl[sockindex].ssl) #else ssl_get_ciphersuite_name(&conn->ssl[sockindex].ssl) #endif ); ret = ssl_get_verify_result(&conn->ssl[sockindex].ssl); if(ret && data->set.ssl.verifypeer) { if(ret & BADCERT_EXPIRED) failf(data, "Cert verify failed: BADCERT_EXPIRED"); if(ret & BADCERT_REVOKED) { failf(data, "Cert verify failed: BADCERT_REVOKED"); return CURLE_SSL_CACERT; } if(ret & BADCERT_CN_MISMATCH) failf(data, "Cert verify failed: BADCERT_CN_MISMATCH"); if(ret & BADCERT_NOT_TRUSTED) failf(data, "Cert verify failed: BADCERT_NOT_TRUSTED"); return CURLE_PEER_FAILED_VERIFICATION; } /* PolarSSL SVN revision r1316 to r1317, matching <1.2.0 is to cover Ubuntu's 1.1.4 version and the like */ #if POLARSSL_VERSION_NUMBER<0x01020000 if(conn->ssl[sockindex].ssl.peer_cert) { #else if(ssl_get_peer_cert(&(connssl->ssl))) { #endif /* If the session was resumed, there will be no peer certs */ memset(buffer, 0, sizeof(buffer)); /* PolarSSL SVN revision r1316 to r1317, matching <1.2.0 is to cover Ubuntu's 1.1.4 version and the like */ #if POLARSSL_VERSION_NUMBER<0x01020000 if(x509parse_cert_info(buffer, sizeof(buffer), (char *)"* ", conn->ssl[sockindex].ssl.peer_cert) != -1) #else if(x509parse_cert_info(buffer, sizeof(buffer), (char *)"* ", ssl_get_peer_cert(&(connssl->ssl))) != -1) #endif infof(data, "Dumping cert info:\n%s\n", buffer); } connssl->connecting_state = ssl_connect_3; infof(data, "SSL connected\n"); return CURLE_OK; } static CURLcode polarssl_connect_step3(struct connectdata *conn, int sockindex) { CURLcode retcode = CURLE_OK; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; struct SessionHandle *data = conn->data; void *old_ssl_sessionid = NULL; ssl_session *our_ssl_sessionid = &conn->ssl[sockindex].ssn ; int incache; DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); /* Save the current session data for possible re-use */ incache = !(Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL)); if(incache) { if(old_ssl_sessionid != our_ssl_sessionid) { infof(data, "old SSL session ID is stale, removing\n"); Curl_ssl_delsessionid(conn, old_ssl_sessionid); incache = FALSE; } } if(!incache) { void *new_session = malloc(sizeof(ssl_session)); if(new_session) { memcpy(new_session, our_ssl_sessionid, sizeof(ssl_session)); retcode = Curl_ssl_addsessionid(conn, new_session, sizeof(ssl_session)); } else { retcode = CURLE_OUT_OF_MEMORY; } if(retcode) { failf(data, "failed to store ssl session"); return retcode; } } connssl->connecting_state = ssl_connect_done; return CURLE_OK; } static ssize_t polarssl_send(struct connectdata *conn, int sockindex, const void *mem, size_t len, CURLcode *curlcode) { int ret = -1; ret = ssl_write(&conn->ssl[sockindex].ssl, (unsigned char *)mem, len); if(ret < 0) { *curlcode = (ret == POLARSSL_ERR_NET_WANT_WRITE) ? CURLE_AGAIN : CURLE_SEND_ERROR; ret = -1; } return ret; } void Curl_polarssl_close_all(struct SessionHandle *data) { (void)data; } void Curl_polarssl_close(struct connectdata *conn, int sockindex) { rsa_free(&conn->ssl[sockindex].rsa); x509_free(&conn->ssl[sockindex].clicert); x509_free(&conn->ssl[sockindex].cacert); x509_crl_free(&conn->ssl[sockindex].crl); ssl_free(&conn->ssl[sockindex].ssl); } static ssize_t polarssl_recv(struct connectdata *conn, int num, char *buf, size_t buffersize, CURLcode *curlcode) { int ret = -1; ssize_t len = -1; memset(buf, 0, buffersize); ret = ssl_read(&conn->ssl[num].ssl, (unsigned char *)buf, buffersize); if(ret <= 0) { if(ret == POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY) return 0; *curlcode = (ret == POLARSSL_ERR_NET_WANT_READ) ? CURLE_AGAIN : CURLE_RECV_ERROR; return -1; } len = ret; return len; } void Curl_polarssl_session_free(void *ptr) { free(ptr); } size_t Curl_polarssl_version(char *buffer, size_t size) { unsigned int version = version_get_number(); return snprintf(buffer, size, "PolarSSL/%d.%d.%d", version>>24, (version>>16)&0xff, (version>>8)&0xff); } static CURLcode polarssl_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; int what; /* check if the connection has already been established */ if(ssl_connection_complete == connssl->state) { *done = TRUE; return CURLE_OK; } if(ssl_connect_1==connssl->connecting_state) { /* Find out how much more time we're allowed */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { /* no need to continue if time already is up */ failf(data, "SSL connection timeout"); return CURLE_OPERATION_TIMEDOUT; } retcode = polarssl_connect_step1(conn, sockindex); if(retcode) return retcode; } while(ssl_connect_2 == connssl->connecting_state || ssl_connect_2_reading == connssl->connecting_state || ssl_connect_2_writing == connssl->connecting_state) { /* check allowed time left */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { /* no need to continue if time already is up */ failf(data, "SSL connection timeout"); return CURLE_OPERATION_TIMEDOUT; } /* 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) { curl_socket_t writefd = ssl_connect_2_writing== connssl->connecting_state?sockfd:CURL_SOCKET_BAD; curl_socket_t readfd = ssl_connect_2_reading== connssl->connecting_state?sockfd:CURL_SOCKET_BAD; what = Curl_socket_ready(readfd, writefd, nonblocking?0:timeout_ms); if(what < 0) { /* fatal error */ failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); return CURLE_SSL_CONNECT_ERROR; } else if(0 == what) { if(nonblocking) { *done = FALSE; return CURLE_OK; } else { /* timeout */ failf(data, "SSL connection timeout"); return CURLE_OPERATION_TIMEDOUT; } } /* socket is readable or writable */ } /* Run transaction, and return to the caller if it failed or if * this connection is part of a multi handle and this loop would * execute again. This permits the owner of a multi handle to * abort a connection attempt before step2 has completed while * ensuring that a client using select() or epoll() will always * have a valid fdset to wait on. */ retcode = polarssl_connect_step2(conn, sockindex); if(retcode || (nonblocking && (ssl_connect_2 == connssl->connecting_state || ssl_connect_2_reading == connssl->connecting_state || ssl_connect_2_writing == connssl->connecting_state))) return retcode; } /* repeat step2 until all transactions are done. */ if(ssl_connect_3==connssl->connecting_state) { retcode = polarssl_connect_step3(conn, sockindex); if(retcode) return retcode; } if(ssl_connect_done==connssl->connecting_state) { connssl->state = ssl_connection_complete; conn->recv[sockindex] = polarssl_recv; conn->send[sockindex] = polarssl_send; *done = TRUE; } else *done = FALSE; /* Reset our connect state machine */ connssl->connecting_state = ssl_connect_1; return CURLE_OK; } CURLcode Curl_polarssl_connect_nonblocking(struct connectdata *conn, int sockindex, bool *done) { return polarssl_connect_common(conn, sockindex, TRUE, done); } CURLcode Curl_polarssl_connect(struct connectdata *conn, int sockindex) { CURLcode retcode; bool done = FALSE; retcode = polarssl_connect_common(conn, sockindex, FALSE, &done); if(retcode) return retcode; DEBUGASSERT(done); return CURLE_OK; } /* * return 0 error initializing SSL * return 1 SSL initialized successfully */ int polarssl_init(void) { return polarsslthreadlock_thread_setup(); } void polarssl_cleanup(void) { (void)polarsslthreadlock_thread_cleanup(); } #endif /* USE_POLARSSL */ curl-7.35.0/lib/vtls/polarssl_threadlock.c0000644000175000017500000001023712262353672015450 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2010, 2011, Hoi-Ho Chan, * Copyright (C) 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(USE_POLARSSL) && \ (defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32)) #if defined(USE_THREADS_POSIX) # ifdef HAVE_PTHREAD_H # include # endif #elif defined(USE_THREADS_WIN32) # ifdef HAVE_PROCESS_H # include # endif #endif #include "polarssl_threadlock.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* number of thread locks */ #define NUMT 2 /* This array will store all of the mutexes available to PolarSSL. */ static POLARSSL_MUTEX_T *mutex_buf = NULL; int polarsslthreadlock_thread_setup(void) { int i; int ret; mutex_buf = malloc(NUMT * sizeof(POLARSSL_MUTEX_T)); if(!mutex_buf) return 0; /* error, no number of threads defined */ #ifdef HAVE_PTHREAD_H for(i = 0; i < NUMT; i++) { ret = pthread_mutex_init(&mutex_buf[i], NULL); if(ret) return 0; /* pthread_mutex_init failed */ } #elif defined(HAVE_PROCESS_H) for(i = 0; i < NUMT; i++) { mutex_buf[i] = CreateMutex(0, FALSE, 0); if(mutex_buf[i] == 0) return 0; /* CreateMutex failed */ } #endif /* HAVE_PTHREAD_H */ return 1; /* OK */ } int polarsslthreadlock_thread_cleanup(void) { int i; int ret; if(!mutex_buf) return 0; /* error, no threads locks defined */ #ifdef HAVE_PTHREAD_H for(i = 0; i < NUMT; i++) { ret = pthread_mutex_destroy(&mutex_buf[i]); if(ret) return 0; /* pthread_mutex_destroy failed */ } #elif defined(HAVE_PROCESS_H) for(i = 0; i < NUMT; i++) { ret = CloseHandle(mutex_buf[i]); if(!ret) return 0; /* CloseHandle failed */ } #endif /* HAVE_PTHREAD_H */ free(mutex_buf); mutex_buf = NULL; return 1; /* OK */ } int polarsslthreadlock_lock_function(int n) { int ret; #ifdef HAVE_PTHREAD_H if(n < NUMT) { ret = pthread_mutex_lock(&mutex_buf[n]); if(ret) { DEBUGF(fprintf(stderr, "Error: polarsslthreadlock_lock_function failed\n")); return 0; /* pthread_mutex_lock failed */ } } #elif defined(HAVE_PROCESS_H) if(n < NUMT) { ret = (WaitForSingleObject(mutex_buf[n], INFINITE)==WAIT_FAILED?1:0); if(ret) { DEBUGF(fprintf(stderr, "Error: polarsslthreadlock_lock_function failed\n")); return 0; /* pthread_mutex_lock failed */ } } #endif /* HAVE_PTHREAD_H */ return 1; /* OK */ } int polarsslthreadlock_unlock_function(int n) { int ret; #ifdef HAVE_PTHREAD_H if(n < NUMT) { ret = pthread_mutex_unlock(&mutex_buf[n]); if(ret) { DEBUGF(fprintf(stderr, "Error: polarsslthreadlock_unlock_function failed\n")); return 0; /* pthread_mutex_unlock failed */ } } #elif defined(HAVE_PROCESS_H) if(n < NUMT) { ret = ReleaseMutex(mutex_buf[n]); if(!ret) { DEBUGF(fprintf(stderr, "Error: polarsslthreadlock_unlock_function failed\n")); return 0; /* pthread_mutex_lock failed */ } } #endif /* HAVE_PTHREAD_H */ return 1; /* OK */ } #endif /* USE_POLARSSL */ curl-7.35.0/lib/vtls/vtls.h0000644000175000017500000001227012262353672012405 00000000000000#ifndef HEADER_CURL_VTLS_H #define HEADER_CURL_VTLS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef MD5_DIGEST_LENGTH #define MD5_DIGEST_LENGTH 16 /* fixed size */ #endif 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); unsigned int Curl_rand(struct SessionHandle *); #ifdef USE_SSL 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); /* 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); void Curl_ssl_close(struct connectdata *conn, int sockindex); CURLcode Curl_ssl_shutdown(struct connectdata *conn, int sockindex); 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); struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data); /* init the SSL session ID cache */ CURLcode Curl_ssl_initsessions(struct SessionHandle *, size_t); size_t Curl_ssl_version(char *buffer, size_t size); bool Curl_ssl_data_pending(const struct connectdata *conn, int connindex); int Curl_ssl_check_cxn(struct connectdata *conn); /* Certificate information list handling. */ void Curl_ssl_free_certinfo(struct SessionHandle *data); int Curl_ssl_init_certinfo(struct SessionHandle * data, int num); CURLcode Curl_ssl_push_certinfo_len(struct SessionHandle * data, int certnum, const char * label, const char * value, size_t valuelen); CURLcode Curl_ssl_push_certinfo(struct SessionHandle * data, int certnum, const char * label, const char * value); /* Functions to be used by SSL library adaptation functions */ /* 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); /* Kill a single session ID entry in the cache */ void Curl_ssl_kill_session(struct curl_ssl_session *session); /* delete a session from the cache */ void Curl_ssl_delsessionid(struct connectdata *conn, void *ssl_sessionid); /* get N random bytes into the buffer */ void Curl_ssl_random(struct SessionHandle *data, unsigned char *buffer, size_t length); void Curl_ssl_md5sum(unsigned char *tmp, /* input */ size_t tmplen, unsigned char *md5sum, /* output */ size_t md5len); #define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */ #ifdef have_curlssl_random #define HAVE_CURL_SSL_RANDOM #endif #ifdef have_curlssl_md5sum #define HAVE_CURL_SSL_MD5SUM #endif #else /* When SSL support is not present, just define away these function calls */ #define Curl_ssl_init() 1 #define Curl_ssl_cleanup() Curl_nop_stmt #define Curl_ssl_connect(x,y) CURLE_NOT_BUILT_IN #define Curl_ssl_close_all(x) Curl_nop_stmt #define Curl_ssl_close(x,y) Curl_nop_stmt #define Curl_ssl_shutdown(x,y) CURLE_NOT_BUILT_IN #define Curl_ssl_set_engine(x,y) CURLE_NOT_BUILT_IN #define Curl_ssl_set_engine_default(x) CURLE_NOT_BUILT_IN #define Curl_ssl_engines_list(x) NULL #define Curl_ssl_send(a,b,c,d,e) -1 #define Curl_ssl_recv(a,b,c,d,e) -1 #define Curl_ssl_initsessions(x,y) CURLE_OK #define Curl_ssl_version(x,y) 0 #define Curl_ssl_data_pending(x,y) 0 #define Curl_ssl_check_cxn(x) 0 #define Curl_ssl_free_certinfo(x) Curl_nop_stmt #define Curl_ssl_connect_nonblocking(x,y,z) CURLE_NOT_BUILT_IN #define Curl_ssl_kill_session(x) Curl_nop_stmt #endif #endif /* HEADER_CURL_VTLS_H */ curl-7.35.0/lib/vtls/curl_darwinssl.c0000644000175000017500000022627012270035364014444 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2012 - 2013, Nick Zitzmann, . * Copyright (C) 2012 - 2013, 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. * ***************************************************************************/ /* * Source file for all iOS and Mac OS X SecureTransport-specific code for the * TLS/SSL layer. No code but vtls.c should ever call or use these functions. */ #include "curl_setup.h" #ifdef USE_DARWINSSL #ifdef HAVE_LIMITS_H #include #endif #include #include #include #include /* The Security framework has changed greatly between iOS and different OS X versions, and we will try to support as many of them as we can (back to Leopard and iOS 5) by using macros and weak-linking. IMPORTANT: If TLS 1.1 and 1.2 support are important for you on OS X, then you must build this project against the 10.8 SDK or later. */ #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) #if MAC_OS_X_VERSION_MAX_ALLOWED < 1050 #error "The darwinssl back-end requires Leopard or later." #endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1050 */ #define CURL_BUILD_IOS 0 #define CURL_BUILD_IOS_7 0 #define CURL_BUILD_MAC 1 /* This is the maximum API level we are allowed to use when building: */ #define CURL_BUILD_MAC_10_5 MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 #define CURL_BUILD_MAC_10_6 MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 #define CURL_BUILD_MAC_10_7 MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 #define CURL_BUILD_MAC_10_8 MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 #define CURL_BUILD_MAC_10_9 MAC_OS_X_VERSION_MAX_ALLOWED >= 1090 /* These macros mean "the following code is present to allow runtime backward compatibility with at least this cat or earlier": (You set this at build-time by setting the MACOSX_DEPLOYMENT_TARGET environmental variable.) */ #define CURL_SUPPORT_MAC_10_5 MAC_OS_X_VERSION_MIN_REQUIRED <= 1050 #define CURL_SUPPORT_MAC_10_6 MAC_OS_X_VERSION_MIN_REQUIRED <= 1060 #define CURL_SUPPORT_MAC_10_7 MAC_OS_X_VERSION_MIN_REQUIRED <= 1070 #define CURL_SUPPORT_MAC_10_8 MAC_OS_X_VERSION_MIN_REQUIRED <= 1080 #define CURL_SUPPORT_MAC_10_9 MAC_OS_X_VERSION_MIN_REQUIRED <= 1090 #elif TARGET_OS_EMBEDDED || TARGET_OS_IPHONE #define CURL_BUILD_IOS 1 #define CURL_BUILD_IOS_7 __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 #define CURL_BUILD_MAC 0 #define CURL_BUILD_MAC_10_5 0 #define CURL_BUILD_MAC_10_6 0 #define CURL_BUILD_MAC_10_7 0 #define CURL_BUILD_MAC_10_8 0 #define CURL_SUPPORT_MAC_10_5 0 #define CURL_SUPPORT_MAC_10_6 0 #define CURL_SUPPORT_MAC_10_7 0 #define CURL_SUPPORT_MAC_10_8 0 #else #error "The darwinssl back-end requires iOS or OS X." #endif /* (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) */ #if CURL_BUILD_MAC #include #endif /* CURL_BUILD_MAC */ #include "urldata.h" #include "sendf.h" #include "inet_pton.h" #include "connect.h" #include "select.h" #include "vtls.h" #include "curl_darwinssl.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* From MacTypes.h (which we can't include because it isn't present in iOS: */ #define ioErr -36 #define paramErr -50 /* The following two functions were ripped from Apple sample code, * with some modifications: */ static OSStatus SocketRead(SSLConnectionRef connection, void *data, /* owned by * caller, data * RETURNED */ size_t *dataLength) /* IN/OUT */ { size_t bytesToGo = *dataLength; size_t initLen = bytesToGo; UInt8 *currData = (UInt8 *)data; /*int sock = *(int *)connection;*/ struct ssl_connect_data *connssl = (struct ssl_connect_data *)connection; int sock = connssl->ssl_sockfd; OSStatus rtn = noErr; size_t bytesRead; ssize_t rrtn; int theErr; *dataLength = 0; for(;;) { bytesRead = 0; rrtn = read(sock, currData, bytesToGo); if(rrtn <= 0) { /* this is guesswork... */ theErr = errno; if(rrtn == 0) { /* EOF = server hung up */ /* the framework will turn this into errSSLClosedNoNotify */ rtn = errSSLClosedGraceful; } else /* do the switch */ switch(theErr) { case ENOENT: /* connection closed */ rtn = errSSLClosedGraceful; break; case ECONNRESET: rtn = errSSLClosedAbort; break; case EAGAIN: rtn = errSSLWouldBlock; connssl->ssl_direction = false; break; default: rtn = ioErr; break; } break; } else { bytesRead = rrtn; } bytesToGo -= bytesRead; currData += bytesRead; if(bytesToGo == 0) { /* filled buffer with incoming data, done */ break; } } *dataLength = initLen - bytesToGo; return rtn; } static OSStatus SocketWrite(SSLConnectionRef connection, const void *data, size_t *dataLength) /* IN/OUT */ { size_t bytesSent = 0; /*int sock = *(int *)connection;*/ struct ssl_connect_data *connssl = (struct ssl_connect_data *)connection; int sock = connssl->ssl_sockfd; ssize_t length; size_t dataLen = *dataLength; const UInt8 *dataPtr = (UInt8 *)data; OSStatus ortn; int theErr; *dataLength = 0; do { length = write(sock, (char*)dataPtr + bytesSent, dataLen - bytesSent); } while((length > 0) && ( (bytesSent += length) < dataLen) ); if(length <= 0) { theErr = errno; if(theErr == EAGAIN) { ortn = errSSLWouldBlock; connssl->ssl_direction = true; } else { ortn = ioErr; } } else { ortn = noErr; } *dataLength = bytesSent; return ortn; } CF_INLINE const char *SSLCipherNameForNumber(SSLCipherSuite cipher) { switch (cipher) { /* SSL version 3.0 */ case SSL_RSA_WITH_NULL_MD5: return "SSL_RSA_WITH_NULL_MD5"; break; case SSL_RSA_WITH_NULL_SHA: return "SSL_RSA_WITH_NULL_SHA"; break; case SSL_RSA_EXPORT_WITH_RC4_40_MD5: return "SSL_RSA_EXPORT_WITH_RC4_40_MD5"; break; case SSL_RSA_WITH_RC4_128_MD5: return "SSL_RSA_WITH_RC4_128_MD5"; break; case SSL_RSA_WITH_RC4_128_SHA: return "SSL_RSA_WITH_RC4_128_SHA"; break; case SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5: return "SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5"; break; case SSL_RSA_WITH_IDEA_CBC_SHA: return "SSL_RSA_WITH_IDEA_CBC_SHA"; break; case SSL_RSA_EXPORT_WITH_DES40_CBC_SHA: return "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA"; break; case SSL_RSA_WITH_DES_CBC_SHA: return "SSL_RSA_WITH_DES_CBC_SHA"; break; case SSL_RSA_WITH_3DES_EDE_CBC_SHA: return "SSL_RSA_WITH_3DES_EDE_CBC_SHA"; break; case SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA: return "SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA"; break; case SSL_DH_DSS_WITH_DES_CBC_SHA: return "SSL_DH_DSS_WITH_DES_CBC_SHA"; break; case SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA: return "SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA"; break; case SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA: return "SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA"; break; case SSL_DH_RSA_WITH_DES_CBC_SHA: return "SSL_DH_RSA_WITH_DES_CBC_SHA"; break; case SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA: return "SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA"; break; case SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA: return "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA"; break; case SSL_DHE_DSS_WITH_DES_CBC_SHA: return "SSL_DHE_DSS_WITH_DES_CBC_SHA"; break; case SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA: return "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA"; break; case SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA: return "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA"; break; case SSL_DHE_RSA_WITH_DES_CBC_SHA: return "SSL_DHE_RSA_WITH_DES_CBC_SHA"; break; case SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA: return "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA"; break; case SSL_DH_anon_EXPORT_WITH_RC4_40_MD5: return "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5"; break; case SSL_DH_anon_WITH_RC4_128_MD5: return "SSL_DH_anon_WITH_RC4_128_MD5"; break; case SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA: return "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA"; break; case SSL_DH_anon_WITH_DES_CBC_SHA: return "SSL_DH_anon_WITH_DES_CBC_SHA"; break; case SSL_DH_anon_WITH_3DES_EDE_CBC_SHA: return "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA"; break; case SSL_FORTEZZA_DMS_WITH_NULL_SHA: return "SSL_FORTEZZA_DMS_WITH_NULL_SHA"; break; case SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA: return "SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA"; break; /* TLS 1.0 with AES (RFC 3268) (Apparently these are used in SSLv3 implementations as well.) */ case TLS_RSA_WITH_AES_128_CBC_SHA: return "TLS_RSA_WITH_AES_128_CBC_SHA"; break; case TLS_DH_DSS_WITH_AES_128_CBC_SHA: return "TLS_DH_DSS_WITH_AES_128_CBC_SHA"; break; case TLS_DH_RSA_WITH_AES_128_CBC_SHA: return "TLS_DH_RSA_WITH_AES_128_CBC_SHA"; break; case TLS_DHE_DSS_WITH_AES_128_CBC_SHA: return "TLS_DHE_DSS_WITH_AES_128_CBC_SHA"; break; case TLS_DHE_RSA_WITH_AES_128_CBC_SHA: return "TLS_DHE_RSA_WITH_AES_128_CBC_SHA"; break; case TLS_DH_anon_WITH_AES_128_CBC_SHA: return "TLS_DH_anon_WITH_AES_128_CBC_SHA"; break; case TLS_RSA_WITH_AES_256_CBC_SHA: return "TLS_RSA_WITH_AES_256_CBC_SHA"; break; case TLS_DH_DSS_WITH_AES_256_CBC_SHA: return "TLS_DH_DSS_WITH_AES_256_CBC_SHA"; break; case TLS_DH_RSA_WITH_AES_256_CBC_SHA: return "TLS_DH_RSA_WITH_AES_256_CBC_SHA"; break; case TLS_DHE_DSS_WITH_AES_256_CBC_SHA: return "TLS_DHE_DSS_WITH_AES_256_CBC_SHA"; break; case TLS_DHE_RSA_WITH_AES_256_CBC_SHA: return "TLS_DHE_RSA_WITH_AES_256_CBC_SHA"; break; case TLS_DH_anon_WITH_AES_256_CBC_SHA: return "TLS_DH_anon_WITH_AES_256_CBC_SHA"; break; /* SSL version 2.0 */ case SSL_RSA_WITH_RC2_CBC_MD5: return "SSL_RSA_WITH_RC2_CBC_MD5"; break; case SSL_RSA_WITH_IDEA_CBC_MD5: return "SSL_RSA_WITH_IDEA_CBC_MD5"; break; case SSL_RSA_WITH_DES_CBC_MD5: return "SSL_RSA_WITH_DES_CBC_MD5"; break; case SSL_RSA_WITH_3DES_EDE_CBC_MD5: return "SSL_RSA_WITH_3DES_EDE_CBC_MD5"; break; } return "SSL_NULL_WITH_NULL_NULL"; } CF_INLINE const char *TLSCipherNameForNumber(SSLCipherSuite cipher) { switch(cipher) { /* TLS 1.0 with AES (RFC 3268) */ case TLS_RSA_WITH_AES_128_CBC_SHA: return "TLS_RSA_WITH_AES_128_CBC_SHA"; break; case TLS_DH_DSS_WITH_AES_128_CBC_SHA: return "TLS_DH_DSS_WITH_AES_128_CBC_SHA"; break; case TLS_DH_RSA_WITH_AES_128_CBC_SHA: return "TLS_DH_RSA_WITH_AES_128_CBC_SHA"; break; case TLS_DHE_DSS_WITH_AES_128_CBC_SHA: return "TLS_DHE_DSS_WITH_AES_128_CBC_SHA"; break; case TLS_DHE_RSA_WITH_AES_128_CBC_SHA: return "TLS_DHE_RSA_WITH_AES_128_CBC_SHA"; break; case TLS_DH_anon_WITH_AES_128_CBC_SHA: return "TLS_DH_anon_WITH_AES_128_CBC_SHA"; break; case TLS_RSA_WITH_AES_256_CBC_SHA: return "TLS_RSA_WITH_AES_256_CBC_SHA"; break; case TLS_DH_DSS_WITH_AES_256_CBC_SHA: return "TLS_DH_DSS_WITH_AES_256_CBC_SHA"; break; case TLS_DH_RSA_WITH_AES_256_CBC_SHA: return "TLS_DH_RSA_WITH_AES_256_CBC_SHA"; break; case TLS_DHE_DSS_WITH_AES_256_CBC_SHA: return "TLS_DHE_DSS_WITH_AES_256_CBC_SHA"; break; case TLS_DHE_RSA_WITH_AES_256_CBC_SHA: return "TLS_DHE_RSA_WITH_AES_256_CBC_SHA"; break; case TLS_DH_anon_WITH_AES_256_CBC_SHA: return "TLS_DH_anon_WITH_AES_256_CBC_SHA"; break; #if CURL_BUILD_MAC_10_6 || CURL_BUILD_IOS /* TLS 1.0 with ECDSA (RFC 4492) */ case TLS_ECDH_ECDSA_WITH_NULL_SHA: return "TLS_ECDH_ECDSA_WITH_NULL_SHA"; break; case TLS_ECDH_ECDSA_WITH_RC4_128_SHA: return "TLS_ECDH_ECDSA_WITH_RC4_128_SHA"; break; case TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA: return "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA"; break; case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA: return "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA"; break; case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA: return "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA"; break; case TLS_ECDHE_ECDSA_WITH_NULL_SHA: return "TLS_ECDHE_ECDSA_WITH_NULL_SHA"; break; case TLS_ECDHE_ECDSA_WITH_RC4_128_SHA: return "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA"; break; case TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA: return "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA"; break; case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: return "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA"; break; case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: return "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA"; break; case TLS_ECDH_RSA_WITH_NULL_SHA: return "TLS_ECDH_RSA_WITH_NULL_SHA"; break; case TLS_ECDH_RSA_WITH_RC4_128_SHA: return "TLS_ECDH_RSA_WITH_RC4_128_SHA"; break; case TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA: return "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA"; break; case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA: return "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA"; break; case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA: return "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA"; break; case TLS_ECDHE_RSA_WITH_NULL_SHA: return "TLS_ECDHE_RSA_WITH_NULL_SHA"; break; case TLS_ECDHE_RSA_WITH_RC4_128_SHA: return "TLS_ECDHE_RSA_WITH_RC4_128_SHA"; break; case TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA: return "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA"; break; case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: return "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"; break; case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: return "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"; break; case TLS_ECDH_anon_WITH_NULL_SHA: return "TLS_ECDH_anon_WITH_NULL_SHA"; break; case TLS_ECDH_anon_WITH_RC4_128_SHA: return "TLS_ECDH_anon_WITH_RC4_128_SHA"; break; case TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA: return "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA"; break; case TLS_ECDH_anon_WITH_AES_128_CBC_SHA: return "TLS_ECDH_anon_WITH_AES_128_CBC_SHA"; break; case TLS_ECDH_anon_WITH_AES_256_CBC_SHA: return "TLS_ECDH_anon_WITH_AES_256_CBC_SHA"; break; #endif /* CURL_BUILD_MAC_10_6 || CURL_BUILD_IOS */ #if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS /* TLS 1.2 (RFC 5246) */ case TLS_RSA_WITH_NULL_MD5: return "TLS_RSA_WITH_NULL_MD5"; break; case TLS_RSA_WITH_NULL_SHA: return "TLS_RSA_WITH_NULL_SHA"; break; case TLS_RSA_WITH_RC4_128_MD5: return "TLS_RSA_WITH_RC4_128_MD5"; break; case TLS_RSA_WITH_RC4_128_SHA: return "TLS_RSA_WITH_RC4_128_SHA"; break; case TLS_RSA_WITH_3DES_EDE_CBC_SHA: return "TLS_RSA_WITH_3DES_EDE_CBC_SHA"; break; case TLS_RSA_WITH_NULL_SHA256: return "TLS_RSA_WITH_NULL_SHA256"; break; case TLS_RSA_WITH_AES_128_CBC_SHA256: return "TLS_RSA_WITH_AES_128_CBC_SHA256"; break; case TLS_RSA_WITH_AES_256_CBC_SHA256: return "TLS_RSA_WITH_AES_256_CBC_SHA256"; break; case TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA: return "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA"; break; case TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA: return "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA"; break; case TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA: return "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA"; break; case TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA: return "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA"; break; case TLS_DH_DSS_WITH_AES_128_CBC_SHA256: return "TLS_DH_DSS_WITH_AES_128_CBC_SHA256"; break; case TLS_DH_RSA_WITH_AES_128_CBC_SHA256: return "TLS_DH_RSA_WITH_AES_128_CBC_SHA256"; break; case TLS_DHE_DSS_WITH_AES_128_CBC_SHA256: return "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256"; break; case TLS_DHE_RSA_WITH_AES_128_CBC_SHA256: return "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256"; break; case TLS_DH_DSS_WITH_AES_256_CBC_SHA256: return "TLS_DH_DSS_WITH_AES_256_CBC_SHA256"; break; case TLS_DH_RSA_WITH_AES_256_CBC_SHA256: return "TLS_DH_RSA_WITH_AES_256_CBC_SHA256"; break; case TLS_DHE_DSS_WITH_AES_256_CBC_SHA256: return "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"; break; case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256: return "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256"; break; case TLS_DH_anon_WITH_RC4_128_MD5: return "TLS_DH_anon_WITH_RC4_128_MD5"; break; case TLS_DH_anon_WITH_3DES_EDE_CBC_SHA: return "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA"; break; case TLS_DH_anon_WITH_AES_128_CBC_SHA256: return "TLS_DH_anon_WITH_AES_128_CBC_SHA256"; break; case TLS_DH_anon_WITH_AES_256_CBC_SHA256: return "TLS_DH_anon_WITH_AES_256_CBC_SHA256"; break; /* TLS 1.2 with AES GCM (RFC 5288) */ case TLS_RSA_WITH_AES_128_GCM_SHA256: return "TLS_RSA_WITH_AES_128_GCM_SHA256"; break; case TLS_RSA_WITH_AES_256_GCM_SHA384: return "TLS_RSA_WITH_AES_256_GCM_SHA384"; break; case TLS_DHE_RSA_WITH_AES_128_GCM_SHA256: return "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256"; break; case TLS_DHE_RSA_WITH_AES_256_GCM_SHA384: return "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384"; break; case TLS_DH_RSA_WITH_AES_128_GCM_SHA256: return "TLS_DH_RSA_WITH_AES_128_GCM_SHA256"; break; case TLS_DH_RSA_WITH_AES_256_GCM_SHA384: return "TLS_DH_RSA_WITH_AES_256_GCM_SHA384"; break; case TLS_DHE_DSS_WITH_AES_128_GCM_SHA256: return "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256"; break; case TLS_DHE_DSS_WITH_AES_256_GCM_SHA384: return "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384"; break; case TLS_DH_DSS_WITH_AES_128_GCM_SHA256: return "TLS_DH_DSS_WITH_AES_128_GCM_SHA256"; break; case TLS_DH_DSS_WITH_AES_256_GCM_SHA384: return "TLS_DH_DSS_WITH_AES_256_GCM_SHA384"; break; case TLS_DH_anon_WITH_AES_128_GCM_SHA256: return "TLS_DH_anon_WITH_AES_128_GCM_SHA256"; break; case TLS_DH_anon_WITH_AES_256_GCM_SHA384: return "TLS_DH_anon_WITH_AES_256_GCM_SHA384"; break; /* TLS 1.2 with elliptic curve ciphers (RFC 5289) */ case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: return "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"; break; case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384: return "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384"; break; case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256: return "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256"; break; case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384: return "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384"; break; case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: return "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"; break; case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384: return "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384"; break; case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256: return "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256"; break; case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384: return "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384"; break; case TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: return "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"; break; case TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: return "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"; break; case TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256: return "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256"; break; case TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384: return "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384"; break; case TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: return "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"; break; case TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: return "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"; break; case TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256: return "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256"; break; case TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384: return "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384"; break; case TLS_EMPTY_RENEGOTIATION_INFO_SCSV: return "TLS_EMPTY_RENEGOTIATION_INFO_SCSV"; break; #else case SSL_RSA_WITH_NULL_MD5: return "TLS_RSA_WITH_NULL_MD5"; break; case SSL_RSA_WITH_NULL_SHA: return "TLS_RSA_WITH_NULL_SHA"; break; case SSL_RSA_WITH_RC4_128_MD5: return "TLS_RSA_WITH_RC4_128_MD5"; break; case SSL_RSA_WITH_RC4_128_SHA: return "TLS_RSA_WITH_RC4_128_SHA"; break; case SSL_RSA_WITH_3DES_EDE_CBC_SHA: return "TLS_RSA_WITH_3DES_EDE_CBC_SHA"; break; case SSL_DH_anon_WITH_RC4_128_MD5: return "TLS_DH_anon_WITH_RC4_128_MD5"; break; case SSL_DH_anon_WITH_3DES_EDE_CBC_SHA: return "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA"; break; #endif /* CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS */ #if CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 /* TLS PSK (RFC 4279): */ case TLS_PSK_WITH_RC4_128_SHA: return "TLS_PSK_WITH_RC4_128_SHA"; break; case TLS_PSK_WITH_3DES_EDE_CBC_SHA: return "TLS_PSK_WITH_3DES_EDE_CBC_SHA"; break; case TLS_PSK_WITH_AES_128_CBC_SHA: return "TLS_PSK_WITH_AES_128_CBC_SHA"; break; case TLS_PSK_WITH_AES_256_CBC_SHA: return "TLS_PSK_WITH_AES_256_CBC_SHA"; break; case TLS_DHE_PSK_WITH_RC4_128_SHA: return "TLS_DHE_PSK_WITH_RC4_128_SHA"; break; case TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA: return "TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA"; break; case TLS_DHE_PSK_WITH_AES_128_CBC_SHA: return "TLS_DHE_PSK_WITH_AES_128_CBC_SHA"; break; case TLS_DHE_PSK_WITH_AES_256_CBC_SHA: return "TLS_DHE_PSK_WITH_AES_256_CBC_SHA"; break; case TLS_RSA_PSK_WITH_RC4_128_SHA: return "TLS_RSA_PSK_WITH_RC4_128_SHA"; break; case TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA: return "TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA"; break; case TLS_RSA_PSK_WITH_AES_128_CBC_SHA: return "TLS_RSA_PSK_WITH_AES_128_CBC_SHA"; break; case TLS_RSA_PSK_WITH_AES_256_CBC_SHA: return "TLS_RSA_PSK_WITH_AES_256_CBC_SHA"; break; /* More TLS PSK (RFC 4785): */ case TLS_PSK_WITH_NULL_SHA: return "TLS_PSK_WITH_NULL_SHA"; break; case TLS_DHE_PSK_WITH_NULL_SHA: return "TLS_DHE_PSK_WITH_NULL_SHA"; break; case TLS_RSA_PSK_WITH_NULL_SHA: return "TLS_RSA_PSK_WITH_NULL_SHA"; break; /* Even more TLS PSK (RFC 5487): */ case TLS_PSK_WITH_AES_128_GCM_SHA256: return "TLS_PSK_WITH_AES_128_GCM_SHA256"; break; case TLS_PSK_WITH_AES_256_GCM_SHA384: return "TLS_PSK_WITH_AES_256_GCM_SHA384"; break; case TLS_DHE_PSK_WITH_AES_128_GCM_SHA256: return "TLS_DHE_PSK_WITH_AES_128_GCM_SHA256"; break; case TLS_DHE_PSK_WITH_AES_256_GCM_SHA384: return "TLS_DHE_PSK_WITH_AES_256_GCM_SHA384"; break; case TLS_RSA_PSK_WITH_AES_128_GCM_SHA256: return "TLS_RSA_PSK_WITH_AES_128_GCM_SHA256"; break; case TLS_RSA_PSK_WITH_AES_256_GCM_SHA384: return "TLS_PSK_WITH_AES_256_GCM_SHA384"; break; case TLS_PSK_WITH_AES_128_CBC_SHA256: return "TLS_PSK_WITH_AES_128_CBC_SHA256"; break; case TLS_PSK_WITH_AES_256_CBC_SHA384: return "TLS_PSK_WITH_AES_256_CBC_SHA384"; break; case TLS_PSK_WITH_NULL_SHA256: return "TLS_PSK_WITH_NULL_SHA256"; break; case TLS_PSK_WITH_NULL_SHA384: return "TLS_PSK_WITH_NULL_SHA384"; break; case TLS_DHE_PSK_WITH_AES_128_CBC_SHA256: return "TLS_DHE_PSK_WITH_AES_128_CBC_SHA256"; break; case TLS_DHE_PSK_WITH_AES_256_CBC_SHA384: return "TLS_DHE_PSK_WITH_AES_256_CBC_SHA384"; break; case TLS_DHE_PSK_WITH_NULL_SHA256: return "TLS_DHE_PSK_WITH_NULL_SHA256"; break; case TLS_DHE_PSK_WITH_NULL_SHA384: return "TLS_RSA_PSK_WITH_NULL_SHA384"; break; case TLS_RSA_PSK_WITH_AES_128_CBC_SHA256: return "TLS_RSA_PSK_WITH_AES_128_CBC_SHA256"; break; case TLS_RSA_PSK_WITH_AES_256_CBC_SHA384: return "TLS_RSA_PSK_WITH_AES_256_CBC_SHA384"; break; case TLS_RSA_PSK_WITH_NULL_SHA256: return "TLS_RSA_PSK_WITH_NULL_SHA256"; break; case TLS_RSA_PSK_WITH_NULL_SHA384: return "TLS_RSA_PSK_WITH_NULL_SHA384"; break; #endif /* CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 */ } return "TLS_NULL_WITH_NULL_NULL"; } #if CURL_BUILD_MAC CF_INLINE void GetDarwinVersionNumber(int *major, int *minor) { int mib[2]; char *os_version; size_t os_version_len; char *os_version_major, *os_version_minor/*, *os_version_point*/; /* Get the Darwin kernel version from the kernel using sysctl(): */ mib[0] = CTL_KERN; mib[1] = KERN_OSRELEASE; if(sysctl(mib, 2, NULL, &os_version_len, NULL, 0) == -1) return; os_version = malloc(os_version_len*sizeof(char)); if(!os_version) return; if(sysctl(mib, 2, os_version, &os_version_len, NULL, 0) == -1) { free(os_version); return; } /* Parse the version: */ os_version_major = strtok(os_version, "."); os_version_minor = strtok(NULL, "."); /*os_version_point = strtok(NULL, ".");*/ *major = atoi(os_version_major); *minor = atoi(os_version_minor); free(os_version); } #endif /* CURL_BUILD_MAC */ /* Apple provides a myriad of ways of getting information about a certificate into a string. Some aren't available under iOS or newer cats. So here's a unified function for getting a string describing the certificate that ought to work in all cats starting with Leopard. */ CF_INLINE CFStringRef CopyCertSubject(SecCertificateRef cert) { CFStringRef server_cert_summary = CFSTR("(null)"); #if CURL_BUILD_IOS /* iOS: There's only one way to do this. */ server_cert_summary = SecCertificateCopySubjectSummary(cert); #else #if CURL_BUILD_MAC_10_7 /* Lion & later: Get the long description if we can. */ if(SecCertificateCopyLongDescription != NULL) server_cert_summary = SecCertificateCopyLongDescription(NULL, cert, NULL); else #endif /* CURL_BUILD_MAC_10_7 */ #if CURL_BUILD_MAC_10_6 /* Snow Leopard: Get the certificate summary. */ if(SecCertificateCopySubjectSummary != NULL) server_cert_summary = SecCertificateCopySubjectSummary(cert); else #endif /* CURL_BUILD_MAC_10_6 */ /* Leopard is as far back as we go... */ (void)SecCertificateCopyCommonName(cert, &server_cert_summary); #endif /* CURL_BUILD_IOS */ return server_cert_summary; } #if CURL_SUPPORT_MAC_10_6 /* The SecKeychainSearch API was deprecated in Lion, and using it will raise deprecation warnings, so let's not compile this unless it's necessary: */ static OSStatus CopyIdentityWithLabelOldSchool(char *label, SecIdentityRef *out_c_a_k) { OSStatus status = errSecItemNotFound; SecKeychainAttributeList attr_list; SecKeychainAttribute attr; SecKeychainSearchRef search = NULL; SecCertificateRef cert = NULL; /* Set up the attribute list: */ attr_list.count = 1L; attr_list.attr = &attr; /* Set up our lone search criterion: */ attr.tag = kSecLabelItemAttr; attr.data = label; attr.length = (UInt32)strlen(label); /* Start searching: */ status = SecKeychainSearchCreateFromAttributes(NULL, kSecCertificateItemClass, &attr_list, &search); if(status == noErr) { status = SecKeychainSearchCopyNext(search, (SecKeychainItemRef *)&cert); if(status == noErr && cert) { /* If we found a certificate, does it have a private key? */ status = SecIdentityCreateWithCertificate(NULL, cert, out_c_a_k); CFRelease(cert); } } if(search) CFRelease(search); return status; } #endif /* CURL_SUPPORT_MAC_10_6 */ static OSStatus CopyIdentityWithLabel(char *label, SecIdentityRef *out_cert_and_key) { OSStatus status = errSecItemNotFound; #if CURL_BUILD_MAC_10_7 || CURL_BUILD_IOS /* SecItemCopyMatching() was introduced in iOS and Snow Leopard. kSecClassIdentity was introduced in Lion. If both exist, let's use them to find the certificate. */ if(SecItemCopyMatching != NULL && kSecClassIdentity != NULL) { CFTypeRef keys[4]; CFTypeRef values[4]; CFDictionaryRef query_dict; CFStringRef label_cf = CFStringCreateWithCString(NULL, label, kCFStringEncodingUTF8); /* Set up our search criteria and expected results: */ values[0] = kSecClassIdentity; /* we want a certificate and a key */ keys[0] = kSecClass; values[1] = kCFBooleanTrue; /* we want a reference */ keys[1] = kSecReturnRef; values[2] = kSecMatchLimitOne; /* one is enough, thanks */ keys[2] = kSecMatchLimit; /* identity searches need a SecPolicyRef in order to work */ values[3] = SecPolicyCreateSSL(false, label_cf); keys[3] = kSecMatchPolicy; query_dict = CFDictionaryCreate(NULL, (const void **)keys, (const void **)values, 4L, &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFRelease(values[3]); CFRelease(label_cf); /* Do we have a match? */ status = SecItemCopyMatching(query_dict, (CFTypeRef *)out_cert_and_key); CFRelease(query_dict); } else { #if CURL_SUPPORT_MAC_10_6 /* On Leopard and Snow Leopard, fall back to SecKeychainSearch. */ status = CopyIdentityWithLabelOldSchool(label, out_cert_and_key); #endif /* CURL_SUPPORT_MAC_10_7 */ } #elif CURL_SUPPORT_MAC_10_6 /* For developers building on older cats, we have no choice but to fall back to SecKeychainSearch. */ status = CopyIdentityWithLabelOldSchool(label, out_cert_and_key); #endif /* CURL_BUILD_MAC_10_7 || CURL_BUILD_IOS */ return status; } static OSStatus CopyIdentityFromPKCS12File(const char *cPath, const char *cPassword, SecIdentityRef *out_cert_and_key) { OSStatus status = errSecItemNotFound; CFURLRef pkcs_url = CFURLCreateFromFileSystemRepresentation(NULL, (const UInt8 *)cPath, strlen(cPath), false); CFStringRef password = cPassword ? CFStringCreateWithCString(NULL, cPassword, kCFStringEncodingUTF8) : NULL; CFDataRef pkcs_data = NULL; /* We can import P12 files on iOS or OS X 10.7 or later: */ /* These constants are documented as having first appeared in 10.6 but they raise linker errors when used on that cat for some reason. */ #if CURL_BUILD_MAC_10_7 || CURL_BUILD_IOS if(CFURLCreateDataAndPropertiesFromResource(NULL, pkcs_url, &pkcs_data, NULL, NULL, &status)) { const void *cKeys[] = {kSecImportExportPassphrase}; const void *cValues[] = {password}; CFDictionaryRef options = CFDictionaryCreate(NULL, cKeys, cValues, password ? 1L : 0L, NULL, NULL); CFArrayRef items = NULL; /* Here we go: */ status = SecPKCS12Import(pkcs_data, options, &items); if(status == noErr) { CFDictionaryRef identity_and_trust = CFArrayGetValueAtIndex(items, 0L); const void *temp_identity = CFDictionaryGetValue(identity_and_trust, kSecImportItemIdentity); /* Retain the identity; we don't care about any other data... */ CFRetain(temp_identity); *out_cert_and_key = (SecIdentityRef)temp_identity; CFRelease(items); } CFRelease(options); CFRelease(pkcs_data); } #endif /* CURL_BUILD_MAC_10_7 || CURL_BUILD_IOS */ if(password) CFRelease(password); CFRelease(pkcs_url); return status; } /* This code was borrowed from nss.c, with some modifications: * Determine whether the nickname passed in is a filename that needs to * be loaded as a PEM or a regular NSS nickname. * * returns 1 for a file * returns 0 for not a file */ CF_INLINE bool is_file(const char *filename) { struct_stat st; if(filename == NULL) return false; if(stat(filename, &st) == 0) return S_ISREG(st.st_mode); return false; } static CURLcode darwinssl_connect_step1(struct connectdata *conn, int sockindex) { struct SessionHandle *data = conn->data; curl_socket_t sockfd = conn->sock[sockindex]; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; #ifdef ENABLE_IPV6 struct in6_addr addr; #else struct in_addr addr; #endif /* ENABLE_IPV6 */ size_t all_ciphers_count = 0UL, allowed_ciphers_count = 0UL, i; SSLCipherSuite *all_ciphers = NULL, *allowed_ciphers = NULL; char *ssl_sessionid; size_t ssl_sessionid_len; OSStatus err = noErr; #if CURL_BUILD_MAC int darwinver_maj = 0, darwinver_min = 0; GetDarwinVersionNumber(&darwinver_maj, &darwinver_min); #endif /* CURL_BUILD_MAC */ #if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS if(SSLCreateContext != NULL) { /* use the newer API if avaialble */ if(connssl->ssl_ctx) CFRelease(connssl->ssl_ctx); connssl->ssl_ctx = SSLCreateContext(NULL, kSSLClientSide, kSSLStreamType); if(!connssl->ssl_ctx) { failf(data, "SSL: couldn't create a context!"); return CURLE_OUT_OF_MEMORY; } } else { /* The old ST API does not exist under iOS, so don't compile it: */ #if CURL_SUPPORT_MAC_10_8 if(connssl->ssl_ctx) (void)SSLDisposeContext(connssl->ssl_ctx); err = SSLNewContext(false, &(connssl->ssl_ctx)); if(err != noErr) { failf(data, "SSL: couldn't create a context: OSStatus %d", err); return CURLE_OUT_OF_MEMORY; } #endif /* CURL_SUPPORT_MAC_10_8 */ } #else if(connssl->ssl_ctx) (void)SSLDisposeContext(connssl->ssl_ctx); err = SSLNewContext(false, &(connssl->ssl_ctx)); if(err != noErr) { failf(data, "SSL: couldn't create a context: OSStatus %d", err); return CURLE_OUT_OF_MEMORY; } #endif /* CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS */ connssl->ssl_write_buffered_length = 0UL; /* reset buffered write length */ /* check to see if we've been told to use an explicit SSL/TLS version */ #if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS if(SSLSetProtocolVersionMax != NULL) { switch(data->set.ssl.version) { case CURL_SSLVERSION_DEFAULT: default: (void)SSLSetProtocolVersionMin(connssl->ssl_ctx, kSSLProtocol3); (void)SSLSetProtocolVersionMax(connssl->ssl_ctx, kTLSProtocol12); break; case CURL_SSLVERSION_TLSv1: (void)SSLSetProtocolVersionMin(connssl->ssl_ctx, kTLSProtocol1); (void)SSLSetProtocolVersionMax(connssl->ssl_ctx, kTLSProtocol12); break; case CURL_SSLVERSION_TLSv1_0: (void)SSLSetProtocolVersionMin(connssl->ssl_ctx, kTLSProtocol1); (void)SSLSetProtocolVersionMax(connssl->ssl_ctx, kTLSProtocol1); break; case CURL_SSLVERSION_TLSv1_1: (void)SSLSetProtocolVersionMin(connssl->ssl_ctx, kTLSProtocol11); (void)SSLSetProtocolVersionMax(connssl->ssl_ctx, kTLSProtocol11); break; case CURL_SSLVERSION_TLSv1_2: (void)SSLSetProtocolVersionMin(connssl->ssl_ctx, kTLSProtocol12); (void)SSLSetProtocolVersionMax(connssl->ssl_ctx, kTLSProtocol12); break; case CURL_SSLVERSION_SSLv3: (void)SSLSetProtocolVersionMin(connssl->ssl_ctx, kSSLProtocol3); (void)SSLSetProtocolVersionMax(connssl->ssl_ctx, kSSLProtocol3); break; case CURL_SSLVERSION_SSLv2: err = SSLSetProtocolVersionMin(connssl->ssl_ctx, kSSLProtocol2); if(err != noErr) { failf(data, "Your version of the OS does not support SSLv2"); return CURLE_SSL_CONNECT_ERROR; } (void)SSLSetProtocolVersionMax(connssl->ssl_ctx, kSSLProtocol2); } } else { #if CURL_SUPPORT_MAC_10_8 (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kSSLProtocolAll, false); switch (data->set.ssl.version) { case CURL_SSLVERSION_DEFAULT: default: (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kSSLProtocol3, true); (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kTLSProtocol1, true); (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kTLSProtocol11, true); (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kTLSProtocol12, true); break; case CURL_SSLVERSION_TLSv1: (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kTLSProtocol1, true); (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kTLSProtocol11, true); (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kTLSProtocol12, true); break; case CURL_SSLVERSION_TLSv1_0: (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kTLSProtocol1, true); break; case CURL_SSLVERSION_TLSv1_1: (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kTLSProtocol11, true); break; case CURL_SSLVERSION_TLSv1_2: (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kTLSProtocol12, true); break; case CURL_SSLVERSION_SSLv3: (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kSSLProtocol3, true); break; case CURL_SSLVERSION_SSLv2: err = SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kSSLProtocol2, true); if(err != noErr) { failf(data, "Your version of the OS does not support SSLv2"); return CURLE_SSL_CONNECT_ERROR; } break; } #endif /* CURL_SUPPORT_MAC_10_8 */ } #else (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kSSLProtocolAll, false); switch(data->set.ssl.version) { default: case CURL_SSLVERSION_DEFAULT: (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kSSLProtocol3, true); (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kTLSProtocol1, true); break; case CURL_SSLVERSION_TLSv1: case CURL_SSLVERSION_TLSv1_0: (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kTLSProtocol1, true); break; case CURL_SSLVERSION_TLSv1_1: failf(data, "Your version of the OS does not support TLSv1.1"); return CURLE_SSL_CONNECT_ERROR; case CURL_SSLVERSION_TLSv1_2: failf(data, "Your version of the OS does not support TLSv1.2"); return CURLE_SSL_CONNECT_ERROR; case CURL_SSLVERSION_SSLv2: err = SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kSSLProtocol2, true); if(err != noErr) { failf(data, "Your version of the OS does not support SSLv2"); return CURLE_SSL_CONNECT_ERROR; } break; case CURL_SSLVERSION_SSLv3: (void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kSSLProtocol3, true); break; } #endif /* CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS */ if(data->set.str[STRING_KEY]) { infof(data, "WARNING: SSL: CURLOPT_SSLKEY is ignored by Secure " "Transport. The private key must be in the Keychain.\n"); } if(data->set.str[STRING_CERT]) { SecIdentityRef cert_and_key = NULL; bool is_cert_file = is_file(data->set.str[STRING_CERT]); /* User wants to authenticate with a client cert. Look for it: If we detect that this is a file on disk, then let's load it. Otherwise, assume that the user wants to use an identity loaded from the Keychain. */ if(is_cert_file) { if(!data->set.str[STRING_CERT_TYPE]) infof(data, "WARNING: SSL: Certificate type not set, assuming " "PKCS#12 format.\n"); else if(strncmp(data->set.str[STRING_CERT_TYPE], "P12", strlen(data->set.str[STRING_CERT_TYPE])) != 0) infof(data, "WARNING: SSL: The Security framework only supports " "loading identities that are in PKCS#12 format.\n"); err = CopyIdentityFromPKCS12File(data->set.str[STRING_CERT], data->set.str[STRING_KEY_PASSWD], &cert_and_key); } else err = CopyIdentityWithLabel(data->set.str[STRING_CERT], &cert_and_key); if(err == noErr) { SecCertificateRef cert = NULL; CFTypeRef certs_c[1]; CFArrayRef certs; /* If we found one, print it out: */ err = SecIdentityCopyCertificate(cert_and_key, &cert); if(err == noErr) { CFStringRef cert_summary = CopyCertSubject(cert); char cert_summary_c[128]; if(cert_summary) { memset(cert_summary_c, 0, 128); if(CFStringGetCString(cert_summary, cert_summary_c, 128, kCFStringEncodingUTF8)) { infof(data, "Client certificate: %s\n", cert_summary_c); } CFRelease(cert_summary); CFRelease(cert); } } certs_c[0] = cert_and_key; certs = CFArrayCreate(NULL, (const void **)certs_c, 1L, &kCFTypeArrayCallBacks); err = SSLSetCertificate(connssl->ssl_ctx, certs); if(certs) CFRelease(certs); if(err != noErr) { failf(data, "SSL: SSLSetCertificate() failed: OSStatus %d", err); return CURLE_SSL_CERTPROBLEM; } CFRelease(cert_and_key); } else { switch(err) { case errSecAuthFailed: case -25264: /* errSecPkcs12VerifyFailure */ failf(data, "SSL: Incorrect password for the certificate \"%s\" " "and its private key.", data->set.str[STRING_CERT]); break; case -26275: /* errSecDecode */ case -25257: /* errSecUnknownFormat */ failf(data, "SSL: Couldn't make sense of the data in the " "certificate \"%s\" and its private key.", data->set.str[STRING_CERT]); break; case -25260: /* errSecPassphraseRequired */ failf(data, "SSL The certificate \"%s\" requires a password.", data->set.str[STRING_CERT]); break; case errSecItemNotFound: failf(data, "SSL: Can't find the certificate \"%s\" and its private " "key in the Keychain.", data->set.str[STRING_CERT]); break; default: failf(data, "SSL: Can't load the certificate \"%s\" and its private " "key: OSStatus %d", data->set.str[STRING_CERT], err); break; } return CURLE_SSL_CERTPROBLEM; } } /* 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. */ #if CURL_BUILD_MAC_10_6 || CURL_BUILD_IOS /* Snow Leopard introduced the SSLSetSessionOption() function, but due to a library bug with the way the kSSLSessionOptionBreakOnServerAuth flag works, it doesn't work as expected under Snow Leopard or Lion. So we need to call SSLSetEnableCertVerify() on those older cats in order to disable certificate validation if the user turned that off. (SecureTransport will always validate the certificate chain by default.) */ /* (Note: Darwin 12.x.x is Mountain Lion.) */ #if CURL_BUILD_MAC if(SSLSetSessionOption != NULL && darwinver_maj >= 12) { #else if(SSLSetSessionOption != NULL) { #endif /* CURL_BUILD_MAC */ err = SSLSetSessionOption(connssl->ssl_ctx, kSSLSessionOptionBreakOnServerAuth, data->set.ssl.verifypeer?false:true); if(err != noErr) { failf(data, "SSL: SSLSetSessionOption() failed: OSStatus %d", err); return CURLE_SSL_CONNECT_ERROR; } } else { #if CURL_SUPPORT_MAC_10_8 err = SSLSetEnableCertVerify(connssl->ssl_ctx, data->set.ssl.verifypeer?true:false); if(err != noErr) { failf(data, "SSL: SSLSetEnableCertVerify() failed: OSStatus %d", err); return CURLE_SSL_CONNECT_ERROR; } #endif /* CURL_SUPPORT_MAC_10_8 */ } #else err = SSLSetEnableCertVerify(connssl->ssl_ctx, data->set.ssl.verifypeer?true:false); if(err != noErr) { failf(data, "SSL: SSLSetEnableCertVerify() failed: OSStatus %d", err); return CURLE_SSL_CONNECT_ERROR; } #endif /* CURL_BUILD_MAC_10_6 || CURL_BUILD_IOS */ /* If this is a domain name and not an IP address, then configure SNI. * Also: the verifyhost setting influences SNI usage */ /* If this is a domain name and not an IP address, then configure SNI: */ if((0 == Curl_inet_pton(AF_INET, conn->host.name, &addr)) && #ifdef ENABLE_IPV6 (0 == Curl_inet_pton(AF_INET6, conn->host.name, &addr)) && #endif data->set.ssl.verifyhost) { err = SSLSetPeerDomainName(connssl->ssl_ctx, conn->host.name, strlen(conn->host.name)); if(err != noErr) { infof(data, "WARNING: SSL: SSLSetPeerDomainName() failed: OSStatus %d\n", err); } } /* Disable cipher suites that ST supports but are not safe. These ciphers are unlikely to be used in any case since ST gives other ciphers a much higher priority, but it's probably better that we not connect at all than to give the user a false sense of security if the server only supports insecure ciphers. (Note: We don't care about SSLv2-only ciphers.) */ (void)SSLGetNumberSupportedCiphers(connssl->ssl_ctx, &all_ciphers_count); all_ciphers = malloc(all_ciphers_count*sizeof(SSLCipherSuite)); allowed_ciphers = malloc(all_ciphers_count*sizeof(SSLCipherSuite)); if(all_ciphers && allowed_ciphers && SSLGetSupportedCiphers(connssl->ssl_ctx, all_ciphers, &all_ciphers_count) == noErr) { for(i = 0UL ; i < all_ciphers_count ; i++) { #if CURL_BUILD_MAC /* There's a known bug in early versions of Mountain Lion where ST's ECC ciphers (cipher suite 0xC001 through 0xC032) simply do not work. Work around the problem here by disabling those ciphers if we are running in an affected version of OS X. */ if(darwinver_maj == 12 && darwinver_min <= 3 && all_ciphers[i] >= 0xC001 && all_ciphers[i] <= 0xC032) { continue; } #endif /* CURL_BUILD_MAC */ switch(all_ciphers[i]) { /* Disable NULL ciphersuites: */ case SSL_NULL_WITH_NULL_NULL: case SSL_RSA_WITH_NULL_MD5: case SSL_RSA_WITH_NULL_SHA: case 0x003B: /* TLS_RSA_WITH_NULL_SHA256 */ case SSL_FORTEZZA_DMS_WITH_NULL_SHA: case 0xC001: /* TLS_ECDH_ECDSA_WITH_NULL_SHA */ case 0xC006: /* TLS_ECDHE_ECDSA_WITH_NULL_SHA */ case 0xC00B: /* TLS_ECDH_RSA_WITH_NULL_SHA */ case 0xC010: /* TLS_ECDHE_RSA_WITH_NULL_SHA */ case 0x002C: /* TLS_PSK_WITH_NULL_SHA */ case 0x002D: /* TLS_DHE_PSK_WITH_NULL_SHA */ case 0x002E: /* TLS_RSA_PSK_WITH_NULL_SHA */ case 0x00B0: /* TLS_PSK_WITH_NULL_SHA256 */ case 0x00B1: /* TLS_PSK_WITH_NULL_SHA384 */ case 0x00B4: /* TLS_DHE_PSK_WITH_NULL_SHA256 */ case 0x00B5: /* TLS_DHE_PSK_WITH_NULL_SHA384 */ case 0x00B8: /* TLS_RSA_PSK_WITH_NULL_SHA256 */ case 0x00B9: /* TLS_RSA_PSK_WITH_NULL_SHA384 */ /* Disable anonymous ciphersuites: */ case SSL_DH_anon_EXPORT_WITH_RC4_40_MD5: case SSL_DH_anon_WITH_RC4_128_MD5: case SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA: case SSL_DH_anon_WITH_DES_CBC_SHA: case SSL_DH_anon_WITH_3DES_EDE_CBC_SHA: case TLS_DH_anon_WITH_AES_128_CBC_SHA: case TLS_DH_anon_WITH_AES_256_CBC_SHA: case 0xC015: /* TLS_ECDH_anon_WITH_NULL_SHA */ case 0xC016: /* TLS_ECDH_anon_WITH_RC4_128_SHA */ case 0xC017: /* TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA */ case 0xC018: /* TLS_ECDH_anon_WITH_AES_128_CBC_SHA */ case 0xC019: /* TLS_ECDH_anon_WITH_AES_256_CBC_SHA */ case 0x006C: /* TLS_DH_anon_WITH_AES_128_CBC_SHA256 */ case 0x006D: /* TLS_DH_anon_WITH_AES_256_CBC_SHA256 */ case 0x00A6: /* TLS_DH_anon_WITH_AES_128_GCM_SHA256 */ case 0x00A7: /* TLS_DH_anon_WITH_AES_256_GCM_SHA384 */ /* Disable weak key ciphersuites: */ case SSL_RSA_EXPORT_WITH_RC4_40_MD5: case SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5: case SSL_RSA_EXPORT_WITH_DES40_CBC_SHA: case SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA: case SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA: case SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA: case SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA: case SSL_RSA_WITH_DES_CBC_SHA: case SSL_DH_DSS_WITH_DES_CBC_SHA: case SSL_DH_RSA_WITH_DES_CBC_SHA: case SSL_DHE_DSS_WITH_DES_CBC_SHA: case SSL_DHE_RSA_WITH_DES_CBC_SHA: /* Disable IDEA: */ case SSL_RSA_WITH_IDEA_CBC_SHA: case SSL_RSA_WITH_IDEA_CBC_MD5: break; default: /* enable everything else */ allowed_ciphers[allowed_ciphers_count++] = all_ciphers[i]; break; } } err = SSLSetEnabledCiphers(connssl->ssl_ctx, allowed_ciphers, allowed_ciphers_count); if(err != noErr) { failf(data, "SSL: SSLSetEnabledCiphers() failed: OSStatus %d", err); return CURLE_SSL_CONNECT_ERROR; } } else { Curl_safefree(all_ciphers); Curl_safefree(allowed_ciphers); failf(data, "SSL: Failed to allocate memory for allowed ciphers"); return CURLE_OUT_OF_MEMORY; } Curl_safefree(all_ciphers); Curl_safefree(allowed_ciphers); #if CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 /* We want to enable 1/n-1 when using a CBC cipher unless the user specifically doesn't want us doing that: */ if(SSLSetSessionOption != NULL) SSLSetSessionOption(connssl->ssl_ctx, kSSLSessionOptionSendOneByteRecord, !data->set.ssl_enable_beast); #endif /* CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 */ /* Check if there's a cached ID we can/should use here! */ if(!Curl_ssl_getsessionid(conn, (void **)&ssl_sessionid, &ssl_sessionid_len)) { /* we got a session id, use it! */ err = SSLSetPeerID(connssl->ssl_ctx, ssl_sessionid, ssl_sessionid_len); if(err != noErr) { failf(data, "SSL: SSLSetPeerID() failed: OSStatus %d", err); return CURLE_SSL_CONNECT_ERROR; } /* Informational message */ infof(data, "SSL re-using session ID\n"); } /* If there isn't one, then let's make one up! This has to be done prior to starting the handshake. */ else { CURLcode retcode; ssl_sessionid = malloc(256*sizeof(char)); ssl_sessionid_len = snprintf(ssl_sessionid, 256, "curl:%s:%hu", conn->host.name, conn->remote_port); err = SSLSetPeerID(connssl->ssl_ctx, ssl_sessionid, ssl_sessionid_len); if(err != noErr) { failf(data, "SSL: SSLSetPeerID() failed: OSStatus %d", err); return CURLE_SSL_CONNECT_ERROR; } retcode = Curl_ssl_addsessionid(conn, ssl_sessionid, ssl_sessionid_len); if(retcode!= CURLE_OK) { failf(data, "failed to store ssl session"); return retcode; } } err = SSLSetIOFuncs(connssl->ssl_ctx, SocketRead, SocketWrite); if(err != noErr) { failf(data, "SSL: SSLSetIOFuncs() failed: OSStatus %d", err); return CURLE_SSL_CONNECT_ERROR; } /* pass the raw socket into the SSL layers */ /* We need to store the FD in a constant memory address, because * SSLSetConnection() will not copy that address. I've found that * conn->sock[sockindex] may change on its own. */ connssl->ssl_sockfd = sockfd; err = SSLSetConnection(connssl->ssl_ctx, connssl); if(err != noErr) { failf(data, "SSL: SSLSetConnection() failed: %d", err); return CURLE_SSL_CONNECT_ERROR; } connssl->connecting_state = ssl_connect_2; return CURLE_OK; } static CURLcode darwinssl_connect_step2(struct connectdata *conn, int sockindex) { struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; OSStatus err; SSLCipherSuite cipher; SSLProtocol protocol = 0; DEBUGASSERT(ssl_connect_2 == connssl->connecting_state || ssl_connect_2_reading == connssl->connecting_state || ssl_connect_2_writing == connssl->connecting_state); /* Here goes nothing: */ err = SSLHandshake(connssl->ssl_ctx); if(err != noErr) { switch (err) { case errSSLWouldBlock: /* they're not done with us yet */ connssl->connecting_state = connssl->ssl_direction ? ssl_connect_2_writing : ssl_connect_2_reading; return CURLE_OK; /* The below is errSSLServerAuthCompleted; it's not defined in Leopard's headers */ case -9841: /* the documentation says we need to call SSLHandshake() again */ return darwinssl_connect_step2(conn, sockindex); /* These are all certificate problems with the server: */ case errSSLXCertChainInvalid: failf(data, "SSL certificate problem: Invalid certificate chain"); return CURLE_SSL_CACERT; case errSSLUnknownRootCert: failf(data, "SSL certificate problem: Untrusted root certificate"); return CURLE_SSL_CACERT; case errSSLNoRootCert: failf(data, "SSL certificate problem: No root certificate"); return CURLE_SSL_CACERT; case errSSLCertExpired: failf(data, "SSL certificate problem: Certificate chain had an " "expired certificate"); return CURLE_SSL_CACERT; case errSSLBadCert: failf(data, "SSL certificate problem: Couldn't understand the server " "certificate format"); return CURLE_SSL_CONNECT_ERROR; /* These are all certificate problems with the client: */ case errSecAuthFailed: failf(data, "SSL authentication failed"); return CURLE_SSL_CONNECT_ERROR; case errSSLPeerHandshakeFail: failf(data, "SSL peer handshake failed, the server most likely " "requires a client certificate to connect"); return CURLE_SSL_CONNECT_ERROR; case errSSLPeerUnknownCA: failf(data, "SSL server rejected the client certificate due to " "the certificate being signed by an unknown certificate " "authority"); return CURLE_SSL_CONNECT_ERROR; /* This error is raised if the server's cert didn't match the server's host name: */ case errSSLHostNameMismatch: failf(data, "SSL certificate peer verification failed, the " "certificate did not match \"%s\"\n", conn->host.dispname); return CURLE_PEER_FAILED_VERIFICATION; /* Generic handshake errors: */ case errSSLConnectionRefused: failf(data, "Server dropped the connection during the SSL handshake"); return CURLE_SSL_CONNECT_ERROR; case errSSLClosedAbort: failf(data, "Server aborted the SSL handshake"); return CURLE_SSL_CONNECT_ERROR; case errSSLNegotiation: failf(data, "Could not negotiate an SSL cipher suite with the server"); return CURLE_SSL_CONNECT_ERROR; /* Sometimes paramErr happens with buggy ciphers: */ case paramErr: case errSSLInternal: failf(data, "Internal SSL engine error encountered during the " "SSL handshake"); return CURLE_SSL_CONNECT_ERROR; case errSSLFatalAlert: failf(data, "Fatal SSL engine error encountered during the SSL " "handshake"); return CURLE_SSL_CONNECT_ERROR; default: failf(data, "Unknown SSL protocol error in connection to %s:%d", conn->host.name, err); return CURLE_SSL_CONNECT_ERROR; } } else { /* we have been connected fine, we're not waiting for anything else. */ connssl->connecting_state = ssl_connect_3; /* Informational message */ (void)SSLGetNegotiatedCipher(connssl->ssl_ctx, &cipher); (void)SSLGetNegotiatedProtocolVersion(connssl->ssl_ctx, &protocol); switch (protocol) { case kSSLProtocol2: infof(data, "SSL 2.0 connection using %s\n", SSLCipherNameForNumber(cipher)); break; case kSSLProtocol3: infof(data, "SSL 3.0 connection using %s\n", SSLCipherNameForNumber(cipher)); break; case kTLSProtocol1: infof(data, "TLS 1.0 connection using %s\n", TLSCipherNameForNumber(cipher)); break; #if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS case kTLSProtocol11: infof(data, "TLS 1.1 connection using %s\n", TLSCipherNameForNumber(cipher)); break; case kTLSProtocol12: infof(data, "TLS 1.2 connection using %s\n", TLSCipherNameForNumber(cipher)); break; #endif default: infof(data, "Unknown protocol connection\n"); break; } return CURLE_OK; } } static CURLcode darwinssl_connect_step3(struct connectdata *conn, int sockindex) { struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; CFStringRef server_cert_summary; char server_cert_summary_c[128]; CFArrayRef server_certs = NULL; SecCertificateRef server_cert; OSStatus err; CFIndex i, count; SecTrustRef trust = NULL; /* There is no step 3! * Well, okay, if verbose mode is on, let's print the details of the * server certificates. */ #if CURL_BUILD_MAC_10_7 || CURL_BUILD_IOS #if CURL_BUILD_IOS #pragma unused(server_certs) err = SSLCopyPeerTrust(connssl->ssl_ctx, &trust); /* For some reason, SSLCopyPeerTrust() can return noErr and yet return a null trust, so be on guard for that: */ if(err == noErr && trust) { count = SecTrustGetCertificateCount(trust); for(i = 0L ; i < count ; i++) { server_cert = SecTrustGetCertificateAtIndex(trust, i); server_cert_summary = CopyCertSubject(server_cert); memset(server_cert_summary_c, 0, 128); if(CFStringGetCString(server_cert_summary, server_cert_summary_c, 128, kCFStringEncodingUTF8)) { infof(data, "Server certificate: %s\n", server_cert_summary_c); } CFRelease(server_cert_summary); } CFRelease(trust); } #else /* SSLCopyPeerCertificates() is deprecated as of Mountain Lion. The function SecTrustGetCertificateAtIndex() is officially present in Lion, but it is unfortunately also present in Snow Leopard as private API and doesn't work as expected. So we have to look for a different symbol to make sure this code is only executed under Lion or later. */ if(SecTrustEvaluateAsync != NULL) { #pragma unused(server_certs) err = SSLCopyPeerTrust(connssl->ssl_ctx, &trust); /* For some reason, SSLCopyPeerTrust() can return noErr and yet return a null trust, so be on guard for that: */ if(err == noErr && trust) { count = SecTrustGetCertificateCount(trust); for(i = 0L ; i < count ; i++) { server_cert = SecTrustGetCertificateAtIndex(trust, i); server_cert_summary = CopyCertSubject(server_cert); memset(server_cert_summary_c, 0, 128); if(CFStringGetCString(server_cert_summary, server_cert_summary_c, 128, kCFStringEncodingUTF8)) { infof(data, "Server certificate: %s\n", server_cert_summary_c); } CFRelease(server_cert_summary); } CFRelease(trust); } } else { #if CURL_SUPPORT_MAC_10_8 err = SSLCopyPeerCertificates(connssl->ssl_ctx, &server_certs); /* Just in case SSLCopyPeerCertificates() returns null too... */ if(err == noErr && server_certs) { count = CFArrayGetCount(server_certs); for(i = 0L ; i < count ; i++) { server_cert = (SecCertificateRef)CFArrayGetValueAtIndex(server_certs, i); server_cert_summary = CopyCertSubject(server_cert); memset(server_cert_summary_c, 0, 128); if(CFStringGetCString(server_cert_summary, server_cert_summary_c, 128, kCFStringEncodingUTF8)) { infof(data, "Server certificate: %s\n", server_cert_summary_c); } CFRelease(server_cert_summary); } CFRelease(server_certs); } #endif /* CURL_SUPPORT_MAC_10_8 */ } #endif /* CURL_BUILD_IOS */ #else #pragma unused(trust) err = SSLCopyPeerCertificates(connssl->ssl_ctx, &server_certs); if(err == noErr) { count = CFArrayGetCount(server_certs); for(i = 0L ; i < count ; i++) { server_cert = (SecCertificateRef)CFArrayGetValueAtIndex(server_certs, i); server_cert_summary = CopyCertSubject(server_cert); memset(server_cert_summary_c, 0, 128); if(CFStringGetCString(server_cert_summary, server_cert_summary_c, 128, kCFStringEncodingUTF8)) { infof(data, "Server certificate: %s\n", server_cert_summary_c); } CFRelease(server_cert_summary); } CFRelease(server_certs); } #endif /* CURL_BUILD_MAC_10_7 || CURL_BUILD_IOS */ connssl->connecting_state = ssl_connect_done; return CURLE_OK; } static Curl_recv darwinssl_recv; static Curl_send darwinssl_send; static CURLcode darwinssl_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; int what; /* check if the connection has already been established */ if(ssl_connection_complete == connssl->state) { *done = TRUE; return CURLE_OK; } if(ssl_connect_1==connssl->connecting_state) { /* Find out how much more time we're allowed */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { /* no need to continue if time already is up */ failf(data, "SSL connection timeout"); return CURLE_OPERATION_TIMEDOUT; } retcode = darwinssl_connect_step1(conn, sockindex); if(retcode) return retcode; } while(ssl_connect_2 == connssl->connecting_state || ssl_connect_2_reading == connssl->connecting_state || ssl_connect_2_writing == connssl->connecting_state) { /* check allowed time left */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { /* no need to continue if time already is up */ failf(data, "SSL connection timeout"); return CURLE_OPERATION_TIMEDOUT; } /* 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) { curl_socket_t writefd = ssl_connect_2_writing == connssl->connecting_state?sockfd:CURL_SOCKET_BAD; curl_socket_t readfd = ssl_connect_2_reading == connssl->connecting_state?sockfd:CURL_SOCKET_BAD; what = Curl_socket_ready(readfd, writefd, nonblocking?0:timeout_ms); if(what < 0) { /* fatal error */ failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); return CURLE_SSL_CONNECT_ERROR; } else if(0 == what) { if(nonblocking) { *done = FALSE; return CURLE_OK; } else { /* timeout */ failf(data, "SSL connection timeout"); return CURLE_OPERATION_TIMEDOUT; } } /* socket is readable or writable */ } /* Run transaction, and return to the caller if it failed or if this * connection is done nonblocking and this loop would execute again. This * permits the owner of a multi handle to abort a connection attempt * before step2 has completed while ensuring that a client using select() * or epoll() will always have a valid fdset to wait on. */ retcode = darwinssl_connect_step2(conn, sockindex); if(retcode || (nonblocking && (ssl_connect_2 == connssl->connecting_state || ssl_connect_2_reading == connssl->connecting_state || ssl_connect_2_writing == connssl->connecting_state))) return retcode; } /* repeat step2 until all transactions are done. */ if(ssl_connect_3==connssl->connecting_state) { retcode = darwinssl_connect_step3(conn, sockindex); if(retcode) return retcode; } if(ssl_connect_done==connssl->connecting_state) { connssl->state = ssl_connection_complete; conn->recv[sockindex] = darwinssl_recv; conn->send[sockindex] = darwinssl_send; *done = TRUE; } else *done = FALSE; /* Reset our connect state machine */ connssl->connecting_state = ssl_connect_1; return CURLE_OK; } CURLcode Curl_darwinssl_connect_nonblocking(struct connectdata *conn, int sockindex, bool *done) { return darwinssl_connect_common(conn, sockindex, TRUE, done); } CURLcode Curl_darwinssl_connect(struct connectdata *conn, int sockindex) { CURLcode retcode; bool done = FALSE; retcode = darwinssl_connect_common(conn, sockindex, FALSE, &done); if(retcode) return retcode; DEBUGASSERT(done); return CURLE_OK; } void Curl_darwinssl_close(struct connectdata *conn, int sockindex) { struct ssl_connect_data *connssl = &conn->ssl[sockindex]; if(connssl->ssl_ctx) { (void)SSLClose(connssl->ssl_ctx); #if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS if(SSLCreateContext != NULL) CFRelease(connssl->ssl_ctx); #if CURL_SUPPORT_MAC_10_8 else (void)SSLDisposeContext(connssl->ssl_ctx); #endif /* CURL_SUPPORT_MAC_10_8 */ #else (void)SSLDisposeContext(connssl->ssl_ctx); #endif /* CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS */ connssl->ssl_ctx = NULL; } connssl->ssl_sockfd = 0; } void Curl_darwinssl_close_all(struct SessionHandle *data) { /* SecureTransport doesn't separate sessions from contexts, so... */ (void)data; } int Curl_darwinssl_shutdown(struct connectdata *conn, int sockindex) { struct ssl_connect_data *connssl = &conn->ssl[sockindex]; struct SessionHandle *data = conn->data; ssize_t nread; int what; int rc; char buf[120]; if(!connssl->ssl_ctx) return 0; if(data->set.ftp_ccc != CURLFTPSSL_CCC_ACTIVE) return 0; Curl_darwinssl_close(conn, sockindex); rc = 0; what = Curl_socket_ready(conn->sock[sockindex], CURL_SOCKET_BAD, SSL_SHUTDOWN_TIMEOUT); for(;;) { if(what < 0) { /* anything that gets here is fatally bad */ failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); rc = -1; break; } if(!what) { /* timeout */ failf(data, "SSL shutdown timeout"); break; } /* Something to read, let's do it and hope that it is the close notify alert from the server. No way to SSL_Read now, so use read(). */ nread = read(conn->sock[sockindex], buf, sizeof(buf)); if(nread < 0) { failf(data, "read: %s", strerror(errno)); rc = -1; } if(nread <= 0) break; what = Curl_socket_ready(conn->sock[sockindex], CURL_SOCKET_BAD, 0); } return rc; } void Curl_darwinssl_session_free(void *ptr) { /* ST, as of iOS 5 and Mountain Lion, has no public method of deleting a cached session ID inside the Security framework. There is a private function that does this, but I don't want to have to explain to you why I got your application rejected from the App Store due to the use of a private API, so the best we can do is free up our own char array that we created way back in darwinssl_connect_step1... */ Curl_safefree(ptr); } size_t Curl_darwinssl_version(char *buffer, size_t size) { return snprintf(buffer, size, "SecureTransport"); } /* * This function uses SSLGetSessionState 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_darwinssl_check_cxn(struct connectdata *conn) { struct ssl_connect_data *connssl = &conn->ssl[FIRSTSOCKET]; OSStatus err; SSLSessionState state; if(connssl->ssl_ctx) { err = SSLGetSessionState(connssl->ssl_ctx, &state); if(err == noErr) return state == kSSLConnected || state == kSSLHandshake; return -1; } return 0; } bool Curl_darwinssl_data_pending(const struct connectdata *conn, int connindex) { const struct ssl_connect_data *connssl = &conn->ssl[connindex]; OSStatus err; size_t buffer; if(connssl->ssl_ctx) { /* SSL is in use */ err = SSLGetBufferedReadSize(connssl->ssl_ctx, &buffer); if(err == noErr) return buffer > 0UL; return false; } else return false; } void Curl_darwinssl_random(struct SessionHandle *data, unsigned char *entropy, size_t length) { /* arc4random_buf() isn't available on cats older than Lion, so let's do this manually for the benefit of the older cats. */ size_t i; u_int32_t random_number = 0; for(i = 0 ; i < length ; i++) { if(i % sizeof(u_int32_t) == 0) random_number = arc4random(); entropy[i] = random_number & 0xFF; random_number >>= 8; } i = random_number = 0; (void)data; } void Curl_darwinssl_md5sum(unsigned char *tmp, /* input */ size_t tmplen, unsigned char *md5sum, /* output */ size_t md5len) { (void)md5len; (void)CC_MD5(tmp, (CC_LONG)tmplen, md5sum); } static ssize_t darwinssl_send(struct connectdata *conn, int sockindex, const void *mem, size_t len, CURLcode *curlcode) { /*struct SessionHandle *data = conn->data;*/ struct ssl_connect_data *connssl = &conn->ssl[sockindex]; size_t processed = 0UL; OSStatus err; /* The SSLWrite() function works a little differently than expected. The fourth argument (processed) is currently documented in Apple's documentation as: "On return, the length, in bytes, of the data actually written." Now, one could interpret that as "written to the socket," but actually, it returns the amount of data that was written to a buffer internal to the SSLContextRef instead. So it's possible for SSLWrite() to return errSSLWouldBlock and a number of bytes "written" because those bytes were encrypted and written to a buffer, not to the socket. So if this happens, then we need to keep calling SSLWrite() over and over again with no new data until it quits returning errSSLWouldBlock. */ /* Do we have buffered data to write from the last time we were called? */ if(connssl->ssl_write_buffered_length) { /* Write the buffered data: */ err = SSLWrite(connssl->ssl_ctx, NULL, 0UL, &processed); switch (err) { case noErr: /* processed is always going to be 0 because we didn't write to the buffer, so return how much was written to the socket */ processed = connssl->ssl_write_buffered_length; connssl->ssl_write_buffered_length = 0UL; break; case errSSLWouldBlock: /* argh, try again */ *curlcode = CURLE_AGAIN; return -1L; default: failf(conn->data, "SSLWrite() returned error %d", err); *curlcode = CURLE_SEND_ERROR; return -1L; } } else { /* We've got new data to write: */ err = SSLWrite(connssl->ssl_ctx, mem, len, &processed); if(err != noErr) { switch (err) { case errSSLWouldBlock: /* Data was buffered but not sent, we have to tell the caller to try sending again, and remember how much was buffered */ connssl->ssl_write_buffered_length = len; *curlcode = CURLE_AGAIN; return -1L; default: failf(conn->data, "SSLWrite() returned error %d", err); *curlcode = CURLE_SEND_ERROR; return -1L; } } } return (ssize_t)processed; } static ssize_t darwinssl_recv(struct connectdata *conn, int num, char *buf, size_t buffersize, CURLcode *curlcode) { /*struct SessionHandle *data = conn->data;*/ struct ssl_connect_data *connssl = &conn->ssl[num]; size_t processed = 0UL; OSStatus err = SSLRead(connssl->ssl_ctx, buf, buffersize, &processed); if(err != noErr) { switch (err) { case errSSLWouldBlock: /* return how much we read (if anything) */ if(processed) return (ssize_t)processed; *curlcode = CURLE_AGAIN; return -1L; break; /* errSSLClosedGraceful - server gracefully shut down the SSL session errSSLClosedNoNotify - server hung up on us instead of sending a closure alert notice, read() is returning 0 Either way, inform the caller that the server disconnected. */ case errSSLClosedGraceful: case errSSLClosedNoNotify: *curlcode = CURLE_OK; return -1L; break; default: failf(conn->data, "SSLRead() return error %d", err); *curlcode = CURLE_RECV_ERROR; return -1L; break; } } return (ssize_t)processed; } #endif /* USE_DARWINSSL */ curl-7.35.0/lib/vtls/cyassl.h0000644000175000017500000000535612262353672012722 00000000000000#ifndef HEADER_CURL_CYASSL_H #define HEADER_CURL_CYASSL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_CYASSL CURLcode Curl_cyassl_connect(struct connectdata *conn, int sockindex); bool Curl_cyassl_data_pending(const struct connectdata* conn,int connindex); int Curl_cyassl_shutdown(struct connectdata* conn, int sockindex); /* tell CyaSSL to close down all open information regarding connections (and thus session ID caching etc) */ void Curl_cyassl_close_all(struct SessionHandle *data); /* close a SSL connection */ void Curl_cyassl_close(struct connectdata *conn, int sockindex); void Curl_cyassl_session_free(void *ptr); size_t Curl_cyassl_version(char *buffer, size_t size); int Curl_cyassl_shutdown(struct connectdata *conn, int sockindex); int Curl_cyassl_init(void); CURLcode Curl_cyassl_connect_nonblocking(struct connectdata *conn, int sockindex, bool *done); /* API setup for CyaSSL */ #define curlssl_init Curl_cyassl_init #define curlssl_cleanup() Curl_nop_stmt #define curlssl_connect Curl_cyassl_connect #define curlssl_connect_nonblocking Curl_cyassl_connect_nonblocking #define curlssl_session_free(x) Curl_cyassl_session_free(x) #define curlssl_close_all Curl_cyassl_close_all #define curlssl_close Curl_cyassl_close #define curlssl_shutdown(x,y) Curl_cyassl_shutdown(x,y) #define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN) #define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN) #define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL) #define curlssl_version Curl_cyassl_version #define curlssl_check_cxn(x) (x=x, -1) #define curlssl_data_pending(x,y) Curl_cyassl_data_pending(x,y) #endif /* USE_CYASSL */ #endif /* HEADER_CURL_CYASSL_H */ curl-7.35.0/lib/vtls/polarssl.h0000644000175000017500000000527212262353672013260 00000000000000#ifndef HEADER_CURL_POLARSSL_H #define HEADER_CURL_POLARSSL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2010, Hoi-Ho Chan, * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_POLARSSL /* Called on first use PolarSSL, setup threading if supported */ int polarssl_init(void); void polarssl_cleanup(void); CURLcode Curl_polarssl_connect(struct connectdata *conn, int sockindex); CURLcode Curl_polarssl_connect_nonblocking(struct connectdata *conn, int sockindex, bool *done); /* tell PolarSSL to close down all open information regarding connections (and thus session ID caching etc) */ void Curl_polarssl_close_all(struct SessionHandle *data); /* close a SSL connection */ void Curl_polarssl_close(struct connectdata *conn, int sockindex); void Curl_polarssl_session_free(void *ptr); size_t Curl_polarssl_version(char *buffer, size_t size); int Curl_polarssl_shutdown(struct connectdata *conn, int sockindex); /* API setup for PolarSSL */ #define curlssl_init() polarssl_init() #define curlssl_cleanup() polarssl_cleanup() #define curlssl_connect Curl_polarssl_connect #define curlssl_connect_nonblocking Curl_polarssl_connect_nonblocking #define curlssl_session_free(x) Curl_polarssl_session_free(x) #define curlssl_close_all Curl_polarssl_close_all #define curlssl_close Curl_polarssl_close #define curlssl_shutdown(x,y) 0 #define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN) #define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN) #define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL) #define curlssl_version Curl_polarssl_version #define curlssl_check_cxn(x) (x=x, -1) #define curlssl_data_pending(x,y) (x=x, y=y, 0) #endif /* USE_POLARSSL */ #endif /* HEADER_CURL_POLARSSL_H */ curl-7.35.0/lib/vtls/gskit.h0000644000175000017500000000500312270035364012524 00000000000000#ifndef HEADER_CURL_GSKIT_H #define HEADER_CURL_GSKIT_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" /* * This header should only be needed to get included by vtls.c and gskit.c */ #include "urldata.h" #ifdef USE_GSKIT int Curl_gskit_init(void); void Curl_gskit_cleanup(void); CURLcode Curl_gskit_connect(struct connectdata * conn, int sockindex); CURLcode Curl_gskit_connect_nonblocking(struct connectdata * conn, int sockindex, bool * done); void Curl_gskit_close(struct connectdata *conn, int sockindex); int Curl_gskit_close_all(struct SessionHandle * data); int Curl_gskit_shutdown(struct connectdata * conn, int sockindex); size_t Curl_gskit_version(char * buffer, size_t size); int Curl_gskit_check_cxn(struct connectdata * cxn); /* API setup for GSKit */ #define curlssl_init Curl_gskit_init #define curlssl_cleanup Curl_gskit_cleanup #define curlssl_connect Curl_gskit_connect #define curlssl_connect_nonblocking Curl_gskit_connect_nonblocking /* No session handling for GSKit */ #define curlssl_session_free(x) Curl_nop_stmt #define curlssl_close_all Curl_gskit_close_all #define curlssl_close Curl_gskit_close #define curlssl_shutdown(x,y) Curl_gskit_shutdown(x,y) #define curlssl_set_engine(x,y) CURLE_NOT_BUILT_IN #define curlssl_set_engine_default(x) CURLE_NOT_BUILT_IN #define curlssl_engines_list(x) NULL #define curlssl_version Curl_gskit_version #define curlssl_check_cxn(x) Curl_gskit_check_cxn(x) #define curlssl_data_pending(x,y) 0 #endif /* USE_GSKIT */ #endif /* HEADER_CURL_GSKIT_H */ curl-7.35.0/lib/vtls/gtls.h0000644000175000017500000000624612262353672012374 00000000000000#ifndef HEADER_CURL_GTLS_H #define HEADER_CURL_GTLS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_GNUTLS #include "urldata.h" int Curl_gtls_init(void); int Curl_gtls_cleanup(void); CURLcode Curl_gtls_connect(struct connectdata *conn, int sockindex); CURLcode Curl_gtls_connect_nonblocking(struct connectdata *conn, int sockindex, bool *done); /* tell GnuTLS to close down all open information regarding connections (and thus session ID caching etc) */ void Curl_gtls_close_all(struct SessionHandle *data); /* close a SSL connection */ void Curl_gtls_close(struct connectdata *conn, int sockindex); void Curl_gtls_session_free(void *ptr); size_t Curl_gtls_version(char *buffer, size_t size); int Curl_gtls_shutdown(struct connectdata *conn, int sockindex); int Curl_gtls_seed(struct SessionHandle *data); void Curl_gtls_random(struct SessionHandle *data, unsigned char *entropy, size_t length); void Curl_gtls_md5sum(unsigned char *tmp, /* input */ size_t tmplen, unsigned char *md5sum, /* output */ size_t md5len); /* this backend provides these functions: */ #define have_curlssl_random 1 #define have_curlssl_md5sum 1 /* API setup for GnuTLS */ #define curlssl_init Curl_gtls_init #define curlssl_cleanup Curl_gtls_cleanup #define curlssl_connect Curl_gtls_connect #define curlssl_connect_nonblocking Curl_gtls_connect_nonblocking #define curlssl_session_free(x) Curl_gtls_session_free(x) #define curlssl_close_all Curl_gtls_close_all #define curlssl_close Curl_gtls_close #define curlssl_shutdown(x,y) Curl_gtls_shutdown(x,y) #define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN) #define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN) #define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL) #define curlssl_version Curl_gtls_version #define curlssl_check_cxn(x) (x=x, -1) #define curlssl_data_pending(x,y) (x=x, y=y, 0) #define curlssl_random(x,y,z) Curl_gtls_random(x,y,z) #define curlssl_md5sum(a,b,c,d) Curl_gtls_md5sum(a,b,c,d) #endif /* USE_GNUTLS */ #endif /* HEADER_CURL_GTLS_H */ curl-7.35.0/lib/vtls/openssl.c0000644000175000017500000024142712270035364013075 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ /* * Source file for all OpenSSL-specific code for the TLS/SSL layer. No code * but vtls.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 "curl_setup.h" #ifdef HAVE_LIMITS_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 "openssl.h" #include "connect.h" #include "slist.h" #include "strequal.h" #include "select.h" #include "vtls.h" #include "rawstr.h" #include "hostcheck.h" #define _MPRINTF_REPLACE /* use the internal *printf() functions */ #include #ifdef USE_SSLEAY #ifdef USE_OPENSSL #include #include #include #include #include #include #else #include #include #include #endif #include "warnless.h" #include "curl_memory.h" #include "non-ascii.h" /* for Curl_convert_from_utf8 prototype */ /* The last #include file should be: */ #include "memdebug.h" #ifndef OPENSSL_VERSION_NUMBER #error "OPENSSL_VERSION_NUMBER not defined" #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 #include #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 #if OPENSSL_VERSION_NUMBER >= 0x00907000L /* 0.9.6 didn't have X509_STORE_set_flags() */ #define HAVE_X509_STORE_SET_FLAGS 1 #else #define X509_STORE_set_flags(x,y) Curl_nop_stmt #endif #if OPENSSL_VERSION_NUMBER >= 0x10000000L #define HAVE_ERR_REMOVE_THREAD_STATE 1 #endif #ifndef HAVE_SSLV2_CLIENT_METHOD #undef OPENSSL_NO_SSL2 /* undef first to avoid compiler warnings */ #define OPENSSL_NO_SSL2 #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 encrypting #ifdef 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 ) { DEBUGASSERT(0 == encrypting); if(!encrypting) { int klen = curlx_uztosi(strlen((char *)global_passwd)); if(num > klen) { memcpy(buf, global_passwd, klen+1); return klen; } } 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 (0 != RAND_status()) ? TRUE : FALSE; } #else #define seed_enough(x) rand_enough(x) static bool rand_enough(int nread) { /* this is a very silly decision to make */ return (nread > 500) ? TRUE : FALSE; } #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.str[STRING_SSL_RANDOM_FILE]? data->set.str[STRING_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.str[STRING_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.str[STRING_SSL_EGDSOCKET]? data->set.str[STRING_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! */ do { unsigned char randb[64]; int len = sizeof(randb); RAND_bytes(randb, len); RAND_add(randb, len, (len >> 1)); } while(!RAND_status()); /* 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.str[STRING_SSL_RANDOM_FILE] || data->set.str[STRING_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_raw_equal(type, "PEM")) return SSL_FILETYPE_PEM; if(Curl_raw_equal(type, "DER")) return SSL_FILETYPE_ASN1; if(Curl_raw_equal(type, "ENG")) return SSL_FILETYPE_ENGINE; if(Curl_raw_equal(type, "P12")) return SSL_FILETYPE_PKCS12; return -1; } #if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_LOAD_FOUR_ARGS) /* * Supply default password to the engine user interface conversation. * The password is passed by OpenSSL engine from ENGINE_load_private_key() * last argument to the ui and can be obtained by UI_get0_user_data(ui) here. */ static int ssl_ui_reader(UI *ui, UI_STRING *uis) { const char *password; switch(UI_get_string_type(uis)) { case UIT_PROMPT: case UIT_VERIFY: password = (const char*)UI_get0_user_data(ui); if(NULL != password && UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD) { UI_set_result(ui, uis, password); return 1; } default: break; } return (UI_method_get_reader(UI_OpenSSL()))(ui, uis); } /* * Suppress interactive request for a default password if available. */ static int ssl_ui_writer(UI *ui, UI_STRING *uis) { switch(UI_get_string_type(uis)) { case UIT_PROMPT: case UIT_VERIFY: if(NULL != UI_get0_user_data(ui) && UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD) { return 1; } default: break; } return (UI_method_get_writer(UI_OpenSSL()))(ui, uis); } #endif 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 = do_file_type(cert_type); if(cert_file != NULL || file_type == SSL_FILETYPE_ENGINE) { SSL *ssl; X509 *x509; int cert_done = 0; if(data->set.str[STRING_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.str[STRING_KEY_PASSWD]); if(len < sizeof(global_passwd)) memcpy(global_passwd, data->set.str[STRING_KEY_PASSWD], len+1); else global_passwd[0] = '\0'; #else /* * We set the password in the callback userdata */ SSL_CTX_set_default_passwd_cb_userdata(ctx, data->set.str[STRING_KEY_PASSWD]); #endif /* Set passwd callback: */ SSL_CTX_set_default_passwd_cb(ctx, passwd_callback); } #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: #if defined(HAVE_OPENSSL_ENGINE_H) && defined(ENGINE_CTRL_GET_CMD_FROM_NAME) { if(data->state.engine) { const char *cmd_name = "LOAD_CERT_CTRL"; struct { const char *cert_id; X509 *cert; } params; params.cert_id = cert_file; params.cert = NULL; /* Does the engine supports LOAD_CERT_CTRL ? */ if(!ENGINE_ctrl(data->state.engine, ENGINE_CTRL_GET_CMD_FROM_NAME, 0, (void *)cmd_name, NULL)) { failf(data, "ssl engine does not support loading certificates"); return 0; } /* Load the certificate from the engine */ if(!ENGINE_ctrl_cmd(data->state.engine, cmd_name, 0, ¶ms, NULL, 1)) { failf(data, "ssl engine cannot load client cert with id" " '%s' [%s]", cert_file, ERR_error_string(ERR_get_error(), NULL)); return 0; } if(!params.cert) { failf(data, "ssl engine didn't initialized the certificate " "properly."); return 0; } if(SSL_CTX_use_certificate(ctx, params.cert) != 1) { failf(data, "unable to set client certificate"); X509_free(params.cert); return 0; } X509_free(params.cert); /* we don't need the handle any more... */ } else { failf(data, "crypto engine not set, can't load certificate"); return 0; } } break; #else failf(data, "file type ENG for certificate not implemented"); return 0; #endif case SSL_FILETYPE_PKCS12: { #ifdef HAVE_PKCS12_SUPPORT FILE *f; PKCS12 *p12; EVP_PKEY *pri; STACK_OF(X509) *ca = NULL; int i; 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); if(!p12) { failf(data, "error reading PKCS12 file '%s'", cert_file ); return 0; } PKCS12_PBE_add(); if(!PKCS12_parse(p12, data->set.str[STRING_KEY_PASSWD], &pri, &x509, &ca)) { failf(data, "could not parse PKCS12 file, check password, OpenSSL error %s", ERR_error_string(ERR_get_error(), NULL) ); PKCS12_free(p12); return 0; } PKCS12_free(p12); if(SSL_CTX_use_certificate(ctx, x509) != 1) { failf(data, SSL_CLIENT_CERT_ERR); goto fail; } if(SSL_CTX_use_PrivateKey(ctx, pri) != 1) { failf(data, "unable to use private key from PKCS12 file '%s'", cert_file); goto fail; } if(!SSL_CTX_check_private_key (ctx)) { failf(data, "private key from PKCS12 file '%s' " "does not match certificate in same file", cert_file); goto fail; } /* Set Certificate Verification chain */ if(ca && sk_X509_num(ca)) { for(i = 0; i < sk_X509_num(ca); i++) { /* * Note that sk_X509_pop() is used below to make sure the cert is * removed from the stack properly before getting passed to * SSL_CTX_add_extra_chain_cert(). Previously we used * sk_X509_value() instead, but then we'd clean it in the subsequent * sk_X509_pop_free() call. */ X509 *x = sk_X509_pop(ca); if(!SSL_CTX_add_extra_chain_cert(ctx, x)) { failf(data, "cannot add certificate to certificate chain"); goto fail; } /* SSL_CTX_add_client_CA() seems to work with either sk_* function, * presumably because it duplicates what we pass to it. */ if(!SSL_CTX_add_client_CA(ctx, x)) { failf(data, "cannot add certificate to client CA list"); goto fail; } } } cert_done = 1; fail: EVP_PKEY_free(pri); X509_free(x509); sk_X509_pop_free(ca, X509_free); if(!cert_done) return 0; /* failure! */ #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", 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(data->state.engine) { #ifdef HAVE_ENGINE_LOAD_FOUR_ARGS UI_METHOD *ui_method = UI_create_method((char *)"cURL user interface"); if(NULL == ui_method) { failf(data, "unable do create OpenSSL user-interface method"); return 0; } UI_method_set_opener(ui_method, UI_method_get_opener(UI_OpenSSL())); UI_method_set_closer(ui_method, UI_method_get_closer(UI_OpenSSL())); UI_method_set_reader(ui_method, ssl_ui_reader); UI_method_set_writer(ui_method, ssl_ui_writer); #endif /* the typecast below was added to please mingw32 */ priv_key = (EVP_PKEY *) ENGINE_load_private_key(data->state.engine,key_file, #ifdef HAVE_ENGINE_LOAD_FOUR_ARGS ui_method, #endif data->set.str[STRING_KEY_PASSWD]); #ifdef HAVE_ENGINE_LOAD_FOUR_ARGS UI_destroy_method(ui_method); #endif if(!priv_key) { failf(data, "failed to load private key from crypto engine"); return 0; } if(SSL_CTX_use_PrivateKey(ctx, priv_key) != 1) { failf(data, "unable to set private key"); 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"); return 0; } } break; #else failf(data, "file type ENG for private key not supported"); return 0; #endif case SSL_FILETYPE_PKCS12: if(!cert_done) { failf(data, "file type P12 for private key not supported"); return 0; } break; default: failf(data, "not supported file type for private key"); return 0; } ssl=SSL_new(ctx); if(NULL == ssl) { failf(data,"unable to create an SSL structure"); 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; } /* returns non-zero on failure */ static int x509_name_oneline(X509_NAME *a, char *buf, size_t size) { #if 0 return X509_NAME_oneline(a, buf, size); #else BIO *bio_out = BIO_new(BIO_s_mem()); BUF_MEM *biomem; int rc; if(!bio_out) return 1; /* alloc failed! */ rc = X509_NAME_print_ex(bio_out, a, 0, XN_FLAG_SEP_SPLUS_SPC); BIO_get_mem_ptr(bio_out, &biomem); if((size_t)biomem->length < size) size = biomem->length; else size--; /* don't overwrite the buffer end */ memcpy(buf, biomem->data, size); buf[size]=0; BIO_free(bio_out); return !rc; #endif } 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); (void)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(); /* Init the global ciphers and digests */ if(!SSLeay_add_ssl_algorithms()) return 0; OpenSSL_add_all_algorithms(); return 1; } #endif /* USE_SSLEAY */ #ifdef USE_SSLEAY /* Global cleanup */ void Curl_ossl_cleanup(void) { /* Free ciphers and digests lists */ EVP_cleanup(); #ifdef HAVE_ENGINE_CLEANUP /* Free engine list */ ENGINE_cleanup(); #endif #ifdef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA /* Free OpenSSL ex_data table */ CRYPTO_cleanup_all_ex_data(); #endif /* Free OpenSSL error strings */ ERR_free_strings(); /* Free thread local error state, destroying hash upon zero refcount */ #ifdef HAVE_ERR_REMOVE_THREAD_STATE ERR_remove_thread_state(NULL); #else ERR_remove_state(0); #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 */ } /* 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; #if OPENSSL_VERSION_NUMBER >= 0x00909000L e = ENGINE_by_id(engine); #else /* avoid memory leak */ for(e = ENGINE_get_first(); e; e = ENGINE_get_next(e)) { const char *e_id = ENGINE_get_id(e); if(!strcmp(engine, e_id)) break; } #endif 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 } /* 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", ENGINE_get_id(data->state.engine)); } else { failf(data, "set default crypto engine '%s' failed", ENGINE_get_id(data->state.engine)); return CURLE_SSL_ENGINE_SETFAILED; } } #else (void) data; #endif return CURLE_OK; } /* 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) struct curl_slist *beg; ENGINE *e; for(e = ENGINE_get_first(); e; e = ENGINE_get_next(e)) { beg = curl_slist_append(list, ENGINE_get_id(e)); if(!beg) { curl_slist_free_all(list); return NULL; } list = beg; } #endif (void) data; return list; } /* * This function is called when an SSL connection is closed. */ void Curl_ossl_close(struct connectdata *conn, int sockindex) { struct ssl_connect_data *connssl = &conn->ssl[sockindex]; 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; } } /* * This function is called to shut down the SSL layer but keep the * socket open (CCC - Clear Command Channel) */ int Curl_ossl_shutdown(struct connectdata *conn, int sockindex) { int retval = 0; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; struct SessionHandle *data = conn->data; char buf[120]; /* We will use this for the OpenSSL error buffer, so it has to be at least 120 bytes long. */ unsigned long sslerror; ssize_t nread; int buffsize; int err; int done = 0; /* This has only been tested on the proftpd server, and the mod_tls code sends a close notify alert without waiting for a close notify alert in response. Thus we wait for a close notify alert from the server, but we do not send one. Let's hope other servers do the same... */ if(data->set.ftp_ccc == CURLFTPSSL_CCC_ACTIVE) (void)SSL_shutdown(connssl->handle); if(connssl->handle) { buffsize = (int)sizeof(buf); while(!done) { int what = Curl_socket_ready(conn->sock[sockindex], CURL_SOCKET_BAD, SSL_SHUTDOWN_TIMEOUT); if(what > 0) { ERR_clear_error(); /* Something to read, let's do it and hope that it is the close notify alert from the server */ nread = (ssize_t)SSL_read(conn->ssl[sockindex].handle, buf, buffsize); err = SSL_get_error(conn->ssl[sockindex].handle, (int)nread); switch(err) { case SSL_ERROR_NONE: /* this is not an error */ case SSL_ERROR_ZERO_RETURN: /* no more data */ /* This is the expected response. There was no data but only the close notify alert */ done = 1; break; case SSL_ERROR_WANT_READ: /* there's data pending, re-invoke SSL_read() */ infof(data, "SSL_ERROR_WANT_READ\n"); break; case SSL_ERROR_WANT_WRITE: /* SSL wants a write. Really odd. Let's bail out. */ infof(data, "SSL_ERROR_WANT_WRITE\n"); done = 1; break; 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, buf), SOCKERRNO); done = 1; break; } } else if(0 == what) { /* timeout */ failf(data, "SSL shutdown timeout"); done = 1; } else { /* anything that gets here is fatally bad */ failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); retval = -1; done = 1; } } /* while()-loop for the select() */ if(data->set.verbose) { #ifdef HAVE_SSL_GET_SHUTDOWN switch(SSL_get_shutdown(connssl->handle)) { case SSL_SENT_SHUTDOWN: infof(data, "SSL_get_shutdown() returned SSL_SENT_SHUTDOWN\n"); break; case SSL_RECEIVED_SHUTDOWN: infof(data, "SSL_get_shutdown() returned SSL_RECEIVED_SHUTDOWN\n"); break; case SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN: infof(data, "SSL_get_shutdown() returned SSL_SENT_SHUTDOWN|" "SSL_RECEIVED__SHUTDOWN\n"); break; } #endif } SSL_free (connssl->handle); connssl->handle = NULL; } return retval; } 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 asn1_output(const ASN1_UTCTIME *tm, char *buf, size_t sizeofbuf) { const char *asn1_string; int gmt=FALSE; int i; int year=0,month=0,day=0,hour=0,minute=0,second=0; i=tm->length; asn1_string=(const 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'); snprintf(buf, sizeofbuf, "%04d-%02d-%02d %02d:%02d:%02d %s", year+1900, month, day, hour, minute, second, (gmt?"GMT":"")); 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) { int matched = -1; /* -1 is no alternative match yet, 1 means match and 0 means mismatch */ int target = GEN_DNS; /* target type, GEN_DNS or GEN_IPADD */ size_t 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); size_t altlen = (size_t) ASN1_STRING_length(check->d.ia5); 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((altlen == strlen(altptr)) && /* if this isn't true, there was an embedded zero in the name string and we cannot match it. */ Curl_cert_hostcheck(altptr, conn->host.name)) matched = 1; else matched = 0; break; case GEN_IPADD: /* IP address comparison */ /* compare alternative IP address if the data chunk is the same size our server IP address is */ if((altlen == addrlen) && !memcmp(altptr, &addr, altlen)) matched = 1; else matched = 0; break; } } } GENERAL_NAMES_free(altnames); } if(matched == 1) /* an alternative name matched the server hostname */ infof(data, "\t subjectAltName: %s matched\n", conn->host.dispname); else if(matched == 0) { /* an alternative name field existed, but didn't match and then we MUST fail */ infof(data, "\t subjectAltName does not match %s\n", conn->host.dispname); failf(data, "SSL: no alternative certificate subject name matches " "target host name '%s'", conn->host.dispname); res = CURLE_PEER_FAILED_VERIFICATION; } else { /* we have to look to the last occurrence 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) { if(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 && (curlx_uztosi(strlen((char *)peer_CN)) != j)) { /* there was a terminating zero before the end of string, this cannot match and we return failure! */ failf(data, "SSL: illegal cert name field"); res = CURLE_PEER_FAILED_VERIFICATION; } } } if(peer_CN == nulstr) peer_CN = NULL; else { /* convert peer_CN from UTF8 */ CURLcode rc = Curl_convert_from_utf8(data, peer_CN, strlen(peer_CN)); /* Curl_convert_from_utf8 calls failf if unsuccessful */ if(rc) { OPENSSL_free(peer_CN); return rc; } } if(res) /* error already detected, pass through */ ; else if(!peer_CN) { failf(data, "SSL: unable to obtain common name from peer certificate"); res = CURLE_PEER_FAILED_VERIFICATION; } else if(!Curl_cert_hostcheck((const char *)peer_CN, conn->host.name)) { failf(data, "SSL: certificate subject name '%s' does not match " "target host name '%s'", peer_CN, conn->host.dispname); res = CURLE_PEER_FAILED_VERIFICATION; } else { infof(data, "\t common name: %s (matched)\n", peer_CN); } if(peer_CN) OPENSSL_free(peer_CN); } return res; } #endif /* USE_SSLEAY */ /* 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 /* ====================================================== */ #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME # define use_sni(x) sni = (x) #else # define use_sni(x) Curl_nop_stmt #endif static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex) { CURLcode retcode = CURLE_OK; char *ciphers; struct SessionHandle *data = conn->data; SSL_METHOD_QUAL SSL_METHOD *req_method=NULL; void *ssl_sessionid=NULL; X509_LOOKUP *lookup=NULL; curl_socket_t sockfd = conn->sock[sockindex]; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; long ctx_options; #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME bool sni; #ifdef ENABLE_IPV6 struct in6_addr addr; #else struct in_addr addr; #endif #endif DEBUGASSERT(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: case CURL_SSLVERSION_TLSv1: case CURL_SSLVERSION_TLSv1_0: case CURL_SSLVERSION_TLSv1_1: case CURL_SSLVERSION_TLSv1_2: /* it will be handled later with the context options */ req_method = SSLv23_client_method(); use_sni(TRUE); break; case CURL_SSLVERSION_SSLv2: #ifdef OPENSSL_NO_SSL2 failf(data, "OpenSSL was built without SSLv2 support"); return CURLE_NOT_BUILT_IN; #else #ifdef USE_TLS_SRP if(data->set.ssl.authtype == CURL_TLSAUTH_SRP) return CURLE_SSL_CONNECT_ERROR; #endif req_method = SSLv2_client_method(); use_sni(FALSE); break; #endif case CURL_SSLVERSION_SSLv3: #ifdef USE_TLS_SRP if(data->set.ssl.authtype == CURL_TLSAUTH_SRP) return CURLE_SSL_CONNECT_ERROR; #endif req_method = SSLv3_client_method(); use_sni(FALSE); 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: %s", ERR_error_string(ERR_peek_error(), NULL)); return CURLE_OUT_OF_MEMORY; } #ifdef SSL_MODE_RELEASE_BUFFERS SSL_CTX_set_mode(connssl->ctx, SSL_MODE_RELEASE_BUFFERS); #endif #ifdef SSL_CTRL_SET_MSG_CALLBACK if(data->set.fdebug && data->set.verbose) { /* 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." The "-no_ticket" option was introduced in Openssl0.9.8j. It's a flag to disable "rfc4507bis session ticket support". rfc4507bis was later turned into the proper RFC5077 it seems: http://tools.ietf.org/html/rfc5077 The enabled extension concerns the session management. I wonder how often libcurl stops a connection and then resumes a TLS session. also, sending the session data is some overhead. .I suggest that you just use your proposed patch (which explicitly disables TICKET). If someone writes an application with libcurl and openssl who wants to enable the feature, one can do this in the SSL callback. SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG option enabling allowed proper interoperability with web server Netscape Enterprise Server 2.0.1 which was released back in 1996. Due to CVE-2010-4180, option SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG has become ineffective as of OpenSSL 0.9.8q and 1.0.0c. In order to mitigate CVE-2010-4180 when using previous OpenSSL versions we no longer enable this option regardless of OpenSSL version and SSL_OP_ALL definition. OpenSSL added a work-around for a SSL 3.0/TLS 1.0 CBC vulnerability (http://www.openssl.org/~bodo/tls-cbc.txt). In 0.9.6e they added a bit to SSL_OP_ALL that _disables_ that work-around despite the fact that SSL_OP_ALL is documented to do "rather harmless" workarounds. In order to keep the secure work-around, the SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS bit must not be set. */ ctx_options = SSL_OP_ALL; #ifdef SSL_OP_NO_TICKET ctx_options |= SSL_OP_NO_TICKET; #endif #ifdef SSL_OP_NO_COMPRESSION ctx_options |= SSL_OP_NO_COMPRESSION; #endif #ifdef SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG /* mitigate CVE-2010-4180 */ ctx_options &= ~SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG; #endif #ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS /* unless the user explicitly ask to allow the protocol vulnerability we use the work-around */ if(!conn->data->set.ssl_enable_beast) ctx_options &= ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; #endif switch(data->set.ssl.version) { case CURL_SSLVERSION_DEFAULT: ctx_options |= SSL_OP_NO_SSLv2; #ifdef USE_TLS_SRP if(data->set.ssl.authtype == CURL_TLSAUTH_SRP) { infof(data, "Set version TLSv1.x for SRP authorisation\n"); ctx_options |= SSL_OP_NO_SSLv3; } #endif break; case CURL_SSLVERSION_SSLv3: ctx_options |= SSL_OP_NO_SSLv2; ctx_options |= SSL_OP_NO_TLSv1; #if OPENSSL_VERSION_NUMBER >= 0x1000100FL ctx_options |= SSL_OP_NO_TLSv1_1; ctx_options |= SSL_OP_NO_TLSv1_2; #endif break; case CURL_SSLVERSION_TLSv1: ctx_options |= SSL_OP_NO_SSLv2; ctx_options |= SSL_OP_NO_SSLv3; break; case CURL_SSLVERSION_TLSv1_0: ctx_options |= SSL_OP_NO_SSLv2; ctx_options |= SSL_OP_NO_SSLv3; #if OPENSSL_VERSION_NUMBER >= 0x1000100FL ctx_options |= SSL_OP_NO_TLSv1_1; ctx_options |= SSL_OP_NO_TLSv1_2; #endif break; #if OPENSSL_VERSION_NUMBER >= 0x1000100FL case CURL_SSLVERSION_TLSv1_1: ctx_options |= SSL_OP_NO_SSLv2; ctx_options |= SSL_OP_NO_SSLv3; ctx_options |= SSL_OP_NO_TLSv1; ctx_options |= SSL_OP_NO_TLSv1_2; break; case CURL_SSLVERSION_TLSv1_2: ctx_options |= SSL_OP_NO_SSLv2; ctx_options |= SSL_OP_NO_SSLv3; ctx_options |= SSL_OP_NO_TLSv1; ctx_options |= SSL_OP_NO_TLSv1_1; break; #endif #ifndef OPENSSL_NO_SSL2 case CURL_SSLVERSION_SSLv2: ctx_options |= SSL_OP_NO_SSLv3; ctx_options |= SSL_OP_NO_TLSv1; #if OPENSSL_VERSION_NUMBER >= 0x1000100FL ctx_options |= SSL_OP_NO_TLSv1_1; ctx_options |= SSL_OP_NO_TLSv1_2; #endif break; #endif default: failf(data, "Unsupported SSL protocol version"); return CURLE_SSL_CONNECT_ERROR; } SSL_CTX_set_options(connssl->ctx, ctx_options); if(data->set.str[STRING_CERT] || data->set.str[STRING_CERT_TYPE]) { if(!cert_stuff(conn, connssl->ctx, data->set.str[STRING_CERT], data->set.str[STRING_CERT_TYPE], data->set.str[STRING_KEY], data->set.str[STRING_KEY_TYPE])) { /* failf() is already done in cert_stuff() */ return CURLE_SSL_CERTPROBLEM; } } ciphers = data->set.str[STRING_SSL_CIPHER_LIST]; if(!ciphers) ciphers = (char *)DEFAULT_CIPHER_SELECTION; if(!SSL_CTX_set_cipher_list(connssl->ctx, ciphers)) { failf(data, "failed setting cipher list: %s", ciphers); return CURLE_SSL_CIPHER; } #ifdef USE_TLS_SRP if(data->set.ssl.authtype == CURL_TLSAUTH_SRP) { infof(data, "Using TLS-SRP username: %s\n", data->set.ssl.username); if(!SSL_CTX_set_srp_username(connssl->ctx, data->set.ssl.username)) { failf(data, "Unable to set SRP user name"); return CURLE_BAD_FUNCTION_ARGUMENT; } if(!SSL_CTX_set_srp_password(connssl->ctx,data->set.ssl.password)) { failf(data, "failed setting SRP password"); return CURLE_BAD_FUNCTION_ARGUMENT; } if(!data->set.str[STRING_SSL_CIPHER_LIST]) { infof(data, "Setting cipher list SRP\n"); if(!SSL_CTX_set_cipher_list(connssl->ctx, "SRP")) { failf(data, "failed setting SRP cipher list"); return CURLE_SSL_CIPHER; } } } #endif if(data->set.str[STRING_SSL_CAFILE] || data->set.str[STRING_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.str[STRING_SSL_CAFILE], data->set.str[STRING_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", data->set.str[STRING_SSL_CAFILE]? data->set.str[STRING_SSL_CAFILE]: "none", data->set.str[STRING_SSL_CAPATH]? data->set.str[STRING_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.str[STRING_SSL_CAFILE] ? data->set.str[STRING_SSL_CAFILE]: "none", data->set.str[STRING_SSL_CAPATH] ? data->set.str[STRING_SSL_CAPATH]: "none"); } if(data->set.str[STRING_SSL_CRLFILE]) { /* tell SSL where to find CRL file that is used to check certificate * revocation */ lookup=X509_STORE_add_lookup(SSL_CTX_get_cert_store(connssl->ctx), X509_LOOKUP_file()); if(!lookup || (!X509_load_crl_file(lookup,data->set.str[STRING_SSL_CRLFILE], X509_FILETYPE_PEM)) ) { failf(data,"error loading CRL file: %s", data->set.str[STRING_SSL_CRLFILE]); return CURLE_SSL_CRL_BADFILE; } else { /* Everything is fine. */ infof(data, "successfully load CRL file:\n"); X509_STORE_set_flags(SSL_CTX_get_cert_store(connssl->ctx), X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL); } infof(data, " CRLfile: %s\n", data->set.str[STRING_SSL_CRLFILE] ? data->set.str[STRING_SSL_CRLFILE]: "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; #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME if((0 == Curl_inet_pton(AF_INET, conn->host.name, &addr)) && #ifdef ENABLE_IPV6 (0 == Curl_inet_pton(AF_INET6, conn->host.name, &addr)) && #endif sni && !SSL_set_tlsext_host_name(connssl->handle, conn->host.name)) infof(data, "WARNING: failed to configure server name indication (SNI) " "TLS extension\n"); #endif /* 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, (int)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 ossl_connect_step2(struct connectdata *conn, int sockindex) { struct SessionHandle *data = conn->data; int err; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; DEBUGASSERT(ssl_connect_2 == connssl->connecting_state || ssl_connect_2_reading == connssl->connecting_state || ssl_connect_2_writing == connssl->connecting_state); ERR_clear_error(); 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; long lerr; 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 */ rc = CURLE_SSL_CACERT; lerr = SSL_get_verify_result(connssl->handle); if(lerr != X509_V_OK) { snprintf(error_buffer, sizeof(error_buffer), "SSL certificate problem: %s", X509_verify_cert_error_string(lerr)); } else cert_problem = "SSL certificate problem, verify that the CA cert is" " OK."; break; default: rc = CURLE_SSL_CONNECT_ERROR; SSL_strerror(errdetail, error_buffer, sizeof(error_buffer)); 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:%ld ", conn->host.name, conn->remote_port); return rc; } /* Could be a CERT problem */ 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 int asn1_object_dump(ASN1_OBJECT *a, char *buf, size_t len) { int i, ilen; if((ilen = (int)len) < 0) return 1; /* buffer too big */ i = i2t_ASN1_OBJECT(buf, ilen, a); if(i >= ilen) return 1; /* buffer too small */ return 0; } static void pubkey_show(struct SessionHandle *data, int num, const char *type, const char *name, unsigned char *raw, int len) { size_t left; int i; char namebuf[32]; char *buffer; left = len*3 + 1; buffer = malloc(left); if(buffer) { char *ptr=buffer; snprintf(namebuf, sizeof(namebuf), "%s(%s)", type, name); for(i=0; i< len; i++) { snprintf(ptr, left, "%02x:", raw[i]); ptr += 3; left -= 3; } infof(data, " %s: %s\n", namebuf, buffer); Curl_ssl_push_certinfo(data, num, namebuf, buffer); free(buffer); } } #define print_pubkey_BN(_type, _name, _num) \ do { \ if(pubkey->pkey._type->_name != NULL) { \ int len = BN_num_bytes(pubkey->pkey._type->_name); \ if(len < CERTBUFFERSIZE) { \ BN_bn2bin(pubkey->pkey._type->_name, (unsigned char*)bufp); \ bufp[len] = 0; \ pubkey_show(data, _num, #_type, #_name, (unsigned char*)bufp, len); \ } \ } \ } WHILE_FALSE static int X509V3_ext(struct SessionHandle *data, int certnum, STACK_OF(X509_EXTENSION) *exts) { int i; size_t j; if(sk_X509_EXTENSION_num(exts) <= 0) /* no extensions, bail out */ return 1; for(i=0; ivalue); BIO_get_mem_ptr(bio_out, &biomem); /* biomem->length bytes at biomem->data, this little loop here is only done for the infof() call, we send the "raw" data to the certinfo function */ for(j=0; j<(size_t)biomem->length; j++) { const char *sep=""; if(biomem->data[j] == '\n') { sep=", "; j++; /* skip the newline */ }; while((biomem->data[j] == ' ') && (j<(size_t)biomem->length)) j++; if(j<(size_t)biomem->length) ptr+=snprintf(ptr, sizeof(buf)-(ptr-buf), "%s%c", sep, biomem->data[j]); } infof(data, " %s\n", buf); Curl_ssl_push_certinfo(data, certnum, namebuf, buf); BIO_free(bio_out); } return 0; /* all is fine */ } static void X509_signature(struct SessionHandle *data, int numcert, ASN1_STRING *sig) { char buf[1024]; char *ptr = buf; int i; for(i=0; ilength; i++) ptr+=snprintf(ptr, sizeof(buf)-(ptr-buf), "%02x:", sig->data[i]); infof(data, " Signature: %s\n", buf); Curl_ssl_push_certinfo(data, numcert, "Signature", buf); } static void dumpcert(struct SessionHandle *data, X509 *x, int numcert) { BIO *bio_out = BIO_new(BIO_s_mem()); BUF_MEM *biomem; /* this outputs the cert in this 64 column wide style with newlines and -----BEGIN CERTIFICATE----- texts and more */ PEM_write_bio_X509(bio_out, x); BIO_get_mem_ptr(bio_out, &biomem); infof(data, "%s\n", biomem->data); Curl_ssl_push_certinfo_len(data, numcert, "Cert", biomem->data, biomem->length); BIO_free(bio_out); } /* * This size was previously 512 which has been reported "too small" without * any specifics, so it was enlarged to allow more data to get shown uncut. * The "perfect" size is yet to figure out. */ #define CERTBUFFERSIZE 8192 static CURLcode get_cert_chain(struct connectdata *conn, struct ssl_connect_data *connssl) { STACK_OF(X509) *sk; int i; char *bufp; struct SessionHandle *data = conn->data; int numcerts; bufp = malloc(CERTBUFFERSIZE); if(!bufp) return CURLE_OUT_OF_MEMORY; sk = SSL_get_peer_cert_chain(connssl->handle); if(!sk) { free(bufp); return CURLE_OUT_OF_MEMORY; } numcerts = sk_X509_num(sk); if(Curl_ssl_init_certinfo(data, numcerts)) { free(bufp); return CURLE_OUT_OF_MEMORY; } infof(data, "--- Certificate chain\n"); for(i=0; ilength <= 4) { value = ASN1_INTEGER_get(num); infof(data," Serial Number: %ld (0x%lx)\n", value, value); snprintf(bufp, CERTBUFFERSIZE, "%lx", value); } else { int left = CERTBUFFERSIZE; ptr = bufp; *ptr++ = 0; if(num->type == V_ASN1_NEG_INTEGER) *ptr++='-'; for(j=0; (jlength) && (left>=4); j++) { /* TODO: length restrictions */ snprintf(ptr, 3, "%02x%c",num->data[j], ((j+1 == num->length)?'\n':':')); ptr += 3; left-=4; } if(num->length) infof(data," Serial Number: %s\n", bufp); else bufp[0]=0; } if(bufp[0]) Curl_ssl_push_certinfo(data, i, "Serial Number", bufp); /* hex */ cinf = x->cert_info; j = asn1_object_dump(cinf->signature->algorithm, bufp, CERTBUFFERSIZE); if(!j) { infof(data, " Signature Algorithm: %s\n", bufp); Curl_ssl_push_certinfo(data, i, "Signature Algorithm", bufp); } certdate = X509_get_notBefore(x); asn1_output(certdate, bufp, CERTBUFFERSIZE); infof(data, " Start date: %s\n", bufp); Curl_ssl_push_certinfo(data, i, "Start date", bufp); certdate = X509_get_notAfter(x); asn1_output(certdate, bufp, CERTBUFFERSIZE); infof(data, " Expire date: %s\n", bufp); Curl_ssl_push_certinfo(data, i, "Expire date", bufp); j = asn1_object_dump(cinf->key->algor->algorithm, bufp, CERTBUFFERSIZE); if(!j) { infof(data, " Public Key Algorithm: %s\n", bufp); Curl_ssl_push_certinfo(data, i, "Public Key Algorithm", bufp); } pubkey = X509_get_pubkey(x); if(!pubkey) infof(data, " Unable to load public key\n"); else { switch(pubkey->type) { case EVP_PKEY_RSA: infof(data, " RSA Public Key (%d bits)\n", BN_num_bits(pubkey->pkey.rsa->n)); snprintf(bufp, CERTBUFFERSIZE, "%d", BN_num_bits(pubkey->pkey.rsa->n)); Curl_ssl_push_certinfo(data, i, "RSA Public Key", bufp); print_pubkey_BN(rsa, n, i); print_pubkey_BN(rsa, e, i); print_pubkey_BN(rsa, d, i); print_pubkey_BN(rsa, p, i); print_pubkey_BN(rsa, q, i); print_pubkey_BN(rsa, dmp1, i); print_pubkey_BN(rsa, dmq1, i); print_pubkey_BN(rsa, iqmp, i); break; case EVP_PKEY_DSA: print_pubkey_BN(dsa, p, i); print_pubkey_BN(dsa, q, i); print_pubkey_BN(dsa, g, i); print_pubkey_BN(dsa, priv_key, i); print_pubkey_BN(dsa, pub_key, i); break; case EVP_PKEY_DH: print_pubkey_BN(dh, p, i); print_pubkey_BN(dh, g, i); print_pubkey_BN(dh, priv_key, i); print_pubkey_BN(dh, pub_key, i); break; #if 0 case EVP_PKEY_EC: /* symbol not present in OpenSSL 0.9.6 */ /* left TODO */ break; #endif } EVP_PKEY_free(pubkey); } X509V3_ext(data, i, cinf->extensions); X509_signature(data, i, x->signature); dumpcert(data, x, i); } free(bufp); return CURLE_OK; } /* * Get the server cert, verify it and show it etc, only call failf() if the * 'strict' argument is TRUE as otherwise all this is for informational * purposes only! * * We check certificates to authenticate the server; otherwise we risk * man-in-the-middle attack. */ static CURLcode servercert(struct connectdata *conn, struct ssl_connect_data *connssl, bool strict) { CURLcode retcode = CURLE_OK; int rc; long lerr; ASN1_TIME *certdate; struct SessionHandle *data = conn->data; X509 *issuer; FILE *fp; char *buffer = data->state.buffer; if(data->set.ssl.certinfo) /* we've been asked to gather certificate info! */ (void)get_cert_chain(conn, connssl); data->set.ssl.certverifyresult = !X509_V_OK; connssl->server_cert = SSL_get_peer_certificate(connssl->handle); if(!connssl->server_cert) { if(strict) failf(data, "SSL: couldn't get peer certificate!"); return CURLE_PEER_FAILED_VERIFICATION; } infof (data, "Server certificate:\n"); rc = x509_name_oneline(X509_get_subject_name(connssl->server_cert), buffer, BUFSIZE); infof(data, "\t subject: %s\n", rc?"[NONE]":buffer); certdate = X509_get_notBefore(connssl->server_cert); asn1_output(certdate, buffer, BUFSIZE); infof(data, "\t start date: %s\n", buffer); certdate = X509_get_notAfter(connssl->server_cert); asn1_output(certdate, buffer, BUFSIZE); infof(data, "\t expire date: %s\n", buffer); if(data->set.ssl.verifyhost) { retcode = verifyhost(conn, connssl->server_cert); if(retcode) { X509_free(connssl->server_cert); connssl->server_cert = NULL; return retcode; } } rc = x509_name_oneline(X509_get_issuer_name(connssl->server_cert), buffer, BUFSIZE); if(rc) { if(strict) failf(data, "SSL: couldn't get X509-issuer name!"); retcode = CURLE_SSL_CONNECT_ERROR; } else { infof(data, "\t issuer: %s\n", buffer); /* We could do all sorts of certificate verification stuff here before deallocating the certificate. */ /* e.g. match issuer name with provided issuer certificate */ if(data->set.str[STRING_SSL_ISSUERCERT]) { fp=fopen(data->set.str[STRING_SSL_ISSUERCERT],"r"); if(!fp) { if(strict) failf(data, "SSL: Unable to open issuer cert (%s)", data->set.str[STRING_SSL_ISSUERCERT]); X509_free(connssl->server_cert); connssl->server_cert = NULL; return CURLE_SSL_ISSUER_ERROR; } issuer = PEM_read_X509(fp,NULL,ZERO_NULL,NULL); if(!issuer) { if(strict) failf(data, "SSL: Unable to read issuer cert (%s)", data->set.str[STRING_SSL_ISSUERCERT]); X509_free(connssl->server_cert); X509_free(issuer); fclose(fp); return CURLE_SSL_ISSUER_ERROR; } fclose(fp); if(X509_check_issued(issuer,connssl->server_cert) != X509_V_OK) { if(strict) failf(data, "SSL: Certificate issuer check failed (%s)", data->set.str[STRING_SSL_ISSUERCERT]); X509_free(connssl->server_cert); X509_free(issuer); connssl->server_cert = NULL; return CURLE_SSL_ISSUER_ERROR; } infof(data, "\t SSL certificate issuer check ok (%s)\n", data->set.str[STRING_SSL_ISSUERCERT]); X509_free(issuer); } 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 earlier if verifypeer is set? */ if(strict) failf(data, "SSL certificate verify result: %s (%ld)", X509_verify_cert_error_string(lerr), lerr); retcode = CURLE_PEER_FAILED_VERIFICATION; } else infof(data, "\t SSL certificate verify result: %s (%ld)," " continuing anyway.\n", X509_verify_cert_error_string(lerr), lerr); } else infof(data, "\t SSL certificate verify ok.\n"); } X509_free(connssl->server_cert); connssl->server_cert = NULL; connssl->connecting_state = ssl_connect_done; return retcode; } static CURLcode ossl_connect_step3(struct connectdata *conn, int sockindex) { CURLcode retcode = CURLE_OK; void *old_ssl_sessionid=NULL; struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; int incache; SSL_SESSION *our_ssl_sessionid; DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); #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 incache = !(Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL)); if(incache) { if(old_ssl_sessionid != our_ssl_sessionid) { infof(data, "old SSL session ID is stale, removing\n"); Curl_ssl_delsessionid(conn, old_ssl_sessionid); incache = FALSE; } } if(!incache) { retcode = Curl_ssl_addsessionid(conn, our_ssl_sessionid, 0 /* unknown size */); if(retcode) { failf(data, "failed to store ssl session"); return retcode; } } #ifdef HAVE_SSL_GET1_SESSION else { /* Session was incache, so refcount already incremented earlier. * Avoid further increments with each SSL_get1_session() call. * This does not free the session as refcount remains > 0 */ SSL_SESSION_free(our_ssl_sessionid); } #endif /* * We check certificates to authenticate the server; otherwise we risk * man-in-the-middle attack; NEVERTHELESS, if we're told explicitly not to * verify the peer ignore faults and failures from the server cert * operations. */ if(!data->set.ssl.verifypeer && !data->set.ssl.verifyhost) (void)servercert(conn, connssl, FALSE); else retcode = servercert(conn, connssl, TRUE); if(CURLE_OK == retcode) connssl->connecting_state = ssl_connect_done; return retcode; } static Curl_recv ossl_recv; static Curl_send ossl_send; static CURLcode 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; int what; /* check if the connection has already been established */ if(ssl_connection_complete == connssl->state) { *done = TRUE; return CURLE_OK; } if(ssl_connect_1==connssl->connecting_state) { /* Find out how much more time we're allowed */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { /* no need to continue if time already is up */ failf(data, "SSL connection timeout"); return CURLE_OPERATION_TIMEDOUT; } retcode = ossl_connect_step1(conn, sockindex); if(retcode) return retcode; } while(ssl_connect_2 == connssl->connecting_state || ssl_connect_2_reading == connssl->connecting_state || ssl_connect_2_writing == connssl->connecting_state) { /* check allowed time left */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { /* no need to continue if time already is up */ failf(data, "SSL connection timeout"); return CURLE_OPERATION_TIMEDOUT; } /* 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) { curl_socket_t writefd = ssl_connect_2_writing== connssl->connecting_state?sockfd:CURL_SOCKET_BAD; curl_socket_t readfd = ssl_connect_2_reading== connssl->connecting_state?sockfd:CURL_SOCKET_BAD; what = Curl_socket_ready(readfd, writefd, nonblocking?0:timeout_ms); if(what < 0) { /* fatal error */ failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); return CURLE_SSL_CONNECT_ERROR; } else if(0 == what) { if(nonblocking) { *done = FALSE; return CURLE_OK; } else { /* timeout */ failf(data, "SSL connection timeout"); return CURLE_OPERATION_TIMEDOUT; } } /* socket is readable or writable */ } /* Run transaction, and return to the caller if it failed or if this * connection is done nonblocking and this loop would execute again. This * permits the owner of a multi handle to abort a connection attempt * before step2 has completed while ensuring that a client using select() * or epoll() will always have a valid fdset to wait on. */ retcode = ossl_connect_step2(conn, sockindex); if(retcode || (nonblocking && (ssl_connect_2 == connssl->connecting_state || ssl_connect_2_reading == connssl->connecting_state || ssl_connect_2_writing == connssl->connecting_state))) return retcode; } /* repeat step2 until all transactions are done. */ if(ssl_connect_3==connssl->connecting_state) { retcode = ossl_connect_step3(conn, sockindex); if(retcode) return retcode; } if(ssl_connect_done==connssl->connecting_state) { connssl->state = ssl_connection_complete; conn->recv[sockindex] = ossl_recv; conn->send[sockindex] = ossl_send; *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 ossl_connect_common(conn, sockindex, TRUE, done); } CURLcode Curl_ossl_connect(struct connectdata *conn, int sockindex) { CURLcode retcode; bool done = FALSE; retcode = ossl_connect_common(conn, sockindex, FALSE, &done); if(retcode) return retcode; DEBUGASSERT(done); return CURLE_OK; } bool Curl_ossl_data_pending(const struct connectdata *conn, int connindex) { if(conn->ssl[connindex].handle) /* SSL is in use */ return (0 != SSL_pending(conn->ssl[connindex].handle)) ? TRUE : FALSE; else return FALSE; } static ssize_t ossl_send(struct connectdata *conn, int sockindex, const void *mem, size_t len, CURLcode *curlcode) { /* 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 memlen; int rc; ERR_clear_error(); memlen = (len > (size_t)INT_MAX) ? INT_MAX : (int)len; rc = SSL_write(conn->ssl[sockindex].handle, mem, memlen); 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 basically an EWOULDBLOCK equivalent. */ *curlcode = CURLE_AGAIN; return -1; case SSL_ERROR_SYSCALL: failf(conn->data, "SSL_write() returned SYSCALL, errno = %d", SOCKERRNO); *curlcode = CURLE_SEND_ERROR; 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", ERR_error_string(sslerror, error_buffer)); *curlcode = CURLE_SEND_ERROR; return -1; } /* a true error */ failf(conn->data, "SSL_write() return error %d", err); *curlcode = CURLE_SEND_ERROR; return -1; } return (ssize_t)rc; /* number of bytes */ } static ssize_t ossl_recv(struct connectdata *conn, /* connection data */ int num, /* socketindex */ char *buf, /* store read data here */ size_t buffersize, /* max amount to read */ CURLcode *curlcode) { char error_buffer[120]; /* OpenSSL documents that this must be at least 120 bytes long. */ unsigned long sslerror; ssize_t nread; int buffsize; ERR_clear_error(); buffsize = (buffersize > (size_t)INT_MAX) ? INT_MAX : (int)buffersize; nread = (ssize_t)SSL_read(conn->ssl[num].handle, buf, buffsize); 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() */ *curlcode = CURLE_AGAIN; return -1; default: /* openssl/ssl.h for SSL_ERROR_SYSCALL says "look at error stack/return value/errno" */ /* http://www.openssl.org/docs/crypto/ERR_get_error.html */ sslerror = ERR_get_error(); if((nread < 0) || sslerror) { /* If the return code was negative or there actually is an error in the queue */ failf(conn->data, "SSL read: %s, errno %d", ERR_error_string(sslerror, error_buffer), SOCKERRNO); *curlcode = CURLE_RECV_ERROR; return -1; } } } return nread; } size_t Curl_ossl_version(char *buffer, size_t size) { #ifdef YASSL_VERSION /* yassl provides an OpenSSL API compatibility 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 */ } void Curl_ossl_random(struct SessionHandle *data, unsigned char *entropy, size_t length) { Curl_ossl_seed(data); /* Initiate the seed if not already done */ RAND_bytes(entropy, curlx_uztosi(length)); } void Curl_ossl_md5sum(unsigned char *tmp, /* input */ size_t tmplen, unsigned char *md5sum /* output */, size_t unused) { MD5_CTX MD5pw; (void)unused; MD5_Init(&MD5pw); MD5_Update(&MD5pw, tmp, tmplen); MD5_Final(md5sum, &MD5pw); } #endif /* USE_SSLEAY */ curl-7.35.0/lib/vtls/qssl.h0000644000175000017500000000451012270035364012367 00000000000000#ifndef HEADER_CURL_QSSL_H #define HEADER_CURL_QSSL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" /* * This header should only be needed to get included by vtls.c and qssl.c */ #include "urldata.h" #ifdef USE_QSOSSL int Curl_qsossl_init(void); void Curl_qsossl_cleanup(void); CURLcode Curl_qsossl_connect(struct connectdata * conn, int sockindex); void Curl_qsossl_close(struct connectdata *conn, int sockindex); int Curl_qsossl_close_all(struct SessionHandle * data); int Curl_qsossl_shutdown(struct connectdata * conn, int sockindex); size_t Curl_qsossl_version(char * buffer, size_t size); int Curl_qsossl_check_cxn(struct connectdata * cxn); /* API setup for QsoSSL */ #define curlssl_init Curl_qsossl_init #define curlssl_cleanup Curl_qsossl_cleanup #define curlssl_connect Curl_qsossl_connect /* No session handling for QsoSSL */ #define curlssl_session_free(x) Curl_nop_stmt #define curlssl_close_all Curl_qsossl_close_all #define curlssl_close Curl_qsossl_close #define curlssl_shutdown(x,y) Curl_qsossl_shutdown(x,y) #define curlssl_set_engine(x,y) CURLE_NOT_BUILT_IN #define curlssl_set_engine_default(x) CURLE_NOT_BUILT_IN #define curlssl_engines_list(x) NULL #define curlssl_version Curl_qsossl_version #define curlssl_check_cxn(x) Curl_qsossl_check_cxn(x) #define curlssl_data_pending(x,y) 0 #endif /* USE_QSOSSL */ #endif /* HEADER_CURL_QSSL_H */ curl-7.35.0/lib/vtls/curl_schannel.c0000644000175000017500000013330112270035364014221 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2012 - 2013, Marc Hoersken, * Copyright (C) 2012, Mark Salisbury, * Copyright (C) 2012 - 2013, 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. * ***************************************************************************/ /* * Source file for all SChannel-specific code for the TLS/SSL layer. No code * but vtls.c should ever call or use these functions. * */ /* * Based upon the PolarSSL implementation in polarssl.c and polarssl.h: * Copyright (C) 2010, 2011, Hoi-Ho Chan, * * Based upon the CyaSSL implementation in cyassl.c and cyassl.h: * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * Thanks for code and inspiration! */ /* * TODO list for TLS/SSL implementation: * - implement client certificate authentication * - implement custom server certificate validation * - implement cipher/algorithm option * * Related articles on MSDN: * - Getting a Certificate for Schannel * http://msdn.microsoft.com/en-us/library/windows/desktop/aa375447.aspx * - Specifying Schannel Ciphers and Cipher Strengths * http://msdn.microsoft.com/en-us/library/windows/desktop/aa380161.aspx */ #include "curl_setup.h" #ifdef USE_SCHANNEL #ifndef USE_WINDOWS_SSPI # error "Can't compile SCHANNEL support without SSPI." #endif #include "curl_sspi.h" #include "curl_schannel.h" #include "vtls.h" #include "sendf.h" #include "connect.h" /* for the connect timeout */ #include "strerror.h" #include "select.h" /* for the socket readyness */ #include "inet_pton.h" /* for IP addr SNI check */ #include "curl_multibyte.h" #include "warnless.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* Uncomment to force verbose output * #define infof(x, y, ...) printf(y, __VA_ARGS__) * #define failf(x, y, ...) printf(y, __VA_ARGS__) */ static Curl_recv schannel_recv; static Curl_send schannel_send; #ifdef _WIN32_WCE static CURLcode verify_certificate(struct connectdata *conn, int sockindex); #endif static void InitSecBuffer(SecBuffer *buffer, unsigned long BufType, void *BufDataPtr, unsigned long BufByteSize) { buffer->cbBuffer = BufByteSize; buffer->BufferType = BufType; buffer->pvBuffer = BufDataPtr; } static void InitSecBufferDesc(SecBufferDesc *desc, SecBuffer *BufArr, unsigned long NumArrElem) { desc->ulVersion = SECBUFFER_VERSION; desc->pBuffers = BufArr; desc->cBuffers = NumArrElem; } static CURLcode schannel_connect_step1(struct connectdata *conn, int sockindex) { ssize_t written = -1; struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; SecBuffer outbuf; SecBufferDesc outbuf_desc; SCHANNEL_CRED schannel_cred; SECURITY_STATUS sspi_status = SEC_E_OK; struct curl_schannel_cred *old_cred = NULL; struct in_addr addr; #ifdef ENABLE_IPV6 struct in6_addr addr6; #endif TCHAR *host_name; CURLcode code; infof(data, "schannel: SSL/TLS connection with %s port %hu (step 1/3)\n", conn->host.name, conn->remote_port); /* check for an existing re-usable credential handle */ if(!Curl_ssl_getsessionid(conn, (void**)&old_cred, NULL)) { connssl->cred = old_cred; infof(data, "schannel: re-using existing credential handle\n"); } else { /* setup Schannel API options */ memset(&schannel_cred, 0, sizeof(schannel_cred)); schannel_cred.dwVersion = SCHANNEL_CRED_VERSION; if(data->set.ssl.verifypeer) { #ifdef _WIN32_WCE /* certificate validation on CE doesn't seem to work right; we'll do it following a more manual process. */ schannel_cred.dwFlags = SCH_CRED_MANUAL_CRED_VALIDATION | SCH_CRED_IGNORE_NO_REVOCATION_CHECK | SCH_CRED_IGNORE_REVOCATION_OFFLINE; #else schannel_cred.dwFlags = SCH_CRED_AUTO_CRED_VALIDATION | SCH_CRED_REVOCATION_CHECK_CHAIN; #endif infof(data, "schannel: checking server certificate revocation\n"); } else { schannel_cred.dwFlags = SCH_CRED_MANUAL_CRED_VALIDATION | SCH_CRED_IGNORE_NO_REVOCATION_CHECK | SCH_CRED_IGNORE_REVOCATION_OFFLINE; infof(data, "schannel: disable server certificate revocation checks\n"); } if(Curl_inet_pton(AF_INET, conn->host.name, &addr) #ifdef ENABLE_IPV6 || Curl_inet_pton(AF_INET6, conn->host.name, &addr6) #endif ) { schannel_cred.dwFlags |= SCH_CRED_NO_SERVERNAME_CHECK; infof(data, "schannel: using IP address, SNI is being disabled by " "disabling the servername check against the " "subject names in server certificates.\n"); } if(!data->set.ssl.verifyhost) { schannel_cred.dwFlags |= SCH_CRED_NO_SERVERNAME_CHECK; infof(data, "schannel: verifyhost setting prevents Schannel from " "comparing the supplied target name with the subject " "names in server certificates. Also disables SNI.\n"); } switch(data->set.ssl.version) { case CURL_SSLVERSION_TLSv1: schannel_cred.grbitEnabledProtocols = SP_PROT_TLS1_0_CLIENT | SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_2_CLIENT; break; case CURL_SSLVERSION_TLSv1_0: schannel_cred.grbitEnabledProtocols = SP_PROT_TLS1_0_CLIENT; break; case CURL_SSLVERSION_TLSv1_1: schannel_cred.grbitEnabledProtocols = SP_PROT_TLS1_1_CLIENT; break; case CURL_SSLVERSION_TLSv1_2: schannel_cred.grbitEnabledProtocols = SP_PROT_TLS1_2_CLIENT; break; case CURL_SSLVERSION_SSLv3: schannel_cred.grbitEnabledProtocols = SP_PROT_SSL3_CLIENT; break; case CURL_SSLVERSION_SSLv2: schannel_cred.grbitEnabledProtocols = SP_PROT_SSL2_CLIENT; break; } /* allocate memory for the re-usable credential handle */ connssl->cred = malloc(sizeof(struct curl_schannel_cred)); if(!connssl->cred) { failf(data, "schannel: unable to allocate memory"); return CURLE_OUT_OF_MEMORY; } memset(connssl->cred, 0, sizeof(struct curl_schannel_cred)); /* http://msdn.microsoft.com/en-us/library/windows/desktop/aa374716.aspx */ sspi_status = s_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR *)UNISP_NAME, SECPKG_CRED_OUTBOUND, NULL, &schannel_cred, NULL, NULL, &connssl->cred->cred_handle, &connssl->cred->time_stamp); if(sspi_status != SEC_E_OK) { if(sspi_status == SEC_E_WRONG_PRINCIPAL) failf(data, "schannel: SNI or certificate check failed: %s", Curl_sspi_strerror(conn, sspi_status)); else failf(data, "schannel: AcquireCredentialsHandle failed: %s", Curl_sspi_strerror(conn, sspi_status)); Curl_safefree(connssl->cred); return CURLE_SSL_CONNECT_ERROR; } } /* setup output buffer */ InitSecBuffer(&outbuf, SECBUFFER_EMPTY, NULL, 0); InitSecBufferDesc(&outbuf_desc, &outbuf, 1); /* setup request flags */ connssl->req_flags = ISC_REQ_SEQUENCE_DETECT | ISC_REQ_REPLAY_DETECT | ISC_REQ_CONFIDENTIALITY | ISC_REQ_ALLOCATE_MEMORY | ISC_REQ_STREAM; /* allocate memory for the security context handle */ connssl->ctxt = malloc(sizeof(struct curl_schannel_ctxt)); if(!connssl->ctxt) { failf(data, "schannel: unable to allocate memory"); return CURLE_OUT_OF_MEMORY; } memset(connssl->ctxt, 0, sizeof(struct curl_schannel_ctxt)); host_name = Curl_convert_UTF8_to_tchar(conn->host.name); if(!host_name) return CURLE_OUT_OF_MEMORY; /* http://msdn.microsoft.com/en-us/library/windows/desktop/aa375924.aspx */ sspi_status = s_pSecFn->InitializeSecurityContext( &connssl->cred->cred_handle, NULL, host_name, connssl->req_flags, 0, 0, NULL, 0, &connssl->ctxt->ctxt_handle, &outbuf_desc, &connssl->ret_flags, &connssl->ctxt->time_stamp); Curl_unicodefree(host_name); if(sspi_status != SEC_I_CONTINUE_NEEDED) { if(sspi_status == SEC_E_WRONG_PRINCIPAL) failf(data, "schannel: SNI or certificate check failed: %s", Curl_sspi_strerror(conn, sspi_status)); else failf(data, "schannel: initial InitializeSecurityContext failed: %s", Curl_sspi_strerror(conn, sspi_status)); Curl_safefree(connssl->ctxt); return CURLE_SSL_CONNECT_ERROR; } infof(data, "schannel: sending initial handshake data: " "sending %lu bytes...\n", outbuf.cbBuffer); /* send initial handshake data which is now stored in output buffer */ code = Curl_write_plain(conn, conn->sock[sockindex], outbuf.pvBuffer, outbuf.cbBuffer, &written); s_pSecFn->FreeContextBuffer(outbuf.pvBuffer); if((code != CURLE_OK) || (outbuf.cbBuffer != (size_t)written)) { failf(data, "schannel: failed to send initial handshake data: " "sent %zd of %lu bytes", written, outbuf.cbBuffer); return CURLE_SSL_CONNECT_ERROR; } infof(data, "schannel: sent initial handshake data: " "sent %zd bytes\n", written); /* continue to second handshake step */ connssl->connecting_state = ssl_connect_2; return CURLE_OK; } static CURLcode schannel_connect_step2(struct connectdata *conn, int sockindex) { int i; ssize_t nread = -1, written = -1; struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; SecBuffer outbuf[2]; SecBufferDesc outbuf_desc; SecBuffer inbuf[2]; SecBufferDesc inbuf_desc; SECURITY_STATUS sspi_status = SEC_E_OK; TCHAR *host_name; CURLcode code; bool doread; doread = (connssl->connecting_state != ssl_connect_2_writing) ? TRUE : FALSE; infof(data, "schannel: SSL/TLS connection with %s port %hu (step 2/3)\n", conn->host.name, conn->remote_port); /* buffer to store previously received and encrypted data */ if(connssl->encdata_buffer == NULL) { connssl->encdata_offset = 0; connssl->encdata_length = CURL_SCHANNEL_BUFFER_INIT_SIZE; connssl->encdata_buffer = malloc(connssl->encdata_length); if(connssl->encdata_buffer == NULL) { failf(data, "schannel: unable to allocate memory"); return CURLE_OUT_OF_MEMORY; } } /* if we need a bigger buffer to read a full message, increase buffer now */ if(connssl->encdata_length - connssl->encdata_offset < CURL_SCHANNEL_BUFFER_FREE_SIZE) { /* increase internal encrypted data buffer */ connssl->encdata_length *= CURL_SCHANNEL_BUFFER_STEP_FACTOR; connssl->encdata_buffer = realloc(connssl->encdata_buffer, connssl->encdata_length); if(connssl->encdata_buffer == NULL) { failf(data, "schannel: unable to re-allocate memory"); return CURLE_OUT_OF_MEMORY; } } for(;;) { if(doread) { /* read encrypted handshake data from socket */ code = Curl_read_plain(conn->sock[sockindex], (char *) (connssl->encdata_buffer + connssl->encdata_offset), connssl->encdata_length - connssl->encdata_offset, &nread); if(code == CURLE_AGAIN) { if(connssl->connecting_state != ssl_connect_2_writing) connssl->connecting_state = ssl_connect_2_reading; infof(data, "schannel: failed to receive handshake, " "need more data\n"); return CURLE_OK; } else if((code != CURLE_OK) || (nread == 0)) { failf(data, "schannel: failed to receive handshake, " "SSL/TLS connection failed"); return CURLE_SSL_CONNECT_ERROR; } /* increase encrypted data buffer offset */ connssl->encdata_offset += nread; } infof(data, "schannel: encrypted data buffer: offset %zu length %zu\n", connssl->encdata_offset, connssl->encdata_length); /* setup input buffers */ InitSecBuffer(&inbuf[0], SECBUFFER_TOKEN, malloc(connssl->encdata_offset), curlx_uztoul(connssl->encdata_offset)); InitSecBuffer(&inbuf[1], SECBUFFER_EMPTY, NULL, 0); InitSecBufferDesc(&inbuf_desc, inbuf, 2); /* setup output buffers */ InitSecBuffer(&outbuf[0], SECBUFFER_TOKEN, NULL, 0); InitSecBuffer(&outbuf[1], SECBUFFER_ALERT, NULL, 0); InitSecBufferDesc(&outbuf_desc, outbuf, 2); if(inbuf[0].pvBuffer == NULL) { failf(data, "schannel: unable to allocate memory"); return CURLE_OUT_OF_MEMORY; } /* copy received handshake data into input buffer */ memcpy(inbuf[0].pvBuffer, connssl->encdata_buffer, connssl->encdata_offset); host_name = Curl_convert_UTF8_to_tchar(conn->host.name); if(!host_name) return CURLE_OUT_OF_MEMORY; /* http://msdn.microsoft.com/en-us/library/windows/desktop/aa375924.aspx */ sspi_status = s_pSecFn->InitializeSecurityContext( &connssl->cred->cred_handle, &connssl->ctxt->ctxt_handle, host_name, connssl->req_flags, 0, 0, &inbuf_desc, 0, NULL, &outbuf_desc, &connssl->ret_flags, &connssl->ctxt->time_stamp); Curl_unicodefree(host_name); /* free buffer for received handshake data */ Curl_safefree(inbuf[0].pvBuffer); /* check if the handshake was incomplete */ if(sspi_status == SEC_E_INCOMPLETE_MESSAGE) { connssl->connecting_state = ssl_connect_2_reading; infof(data, "schannel: received incomplete message, need more data\n"); return CURLE_OK; } /* check if the handshake needs to be continued */ if(sspi_status == SEC_I_CONTINUE_NEEDED || sspi_status == SEC_E_OK) { for(i = 0; i < 2; i++) { /* search for handshake tokens that need to be send */ if(outbuf[i].BufferType == SECBUFFER_TOKEN && outbuf[i].cbBuffer > 0) { infof(data, "schannel: sending next handshake data: " "sending %lu bytes...\n", outbuf[i].cbBuffer); /* send handshake token to server */ code = Curl_write_plain(conn, conn->sock[sockindex], outbuf[i].pvBuffer, outbuf[i].cbBuffer, &written); if((code != CURLE_OK) || (outbuf[i].cbBuffer != (size_t)written)) { failf(data, "schannel: failed to send next handshake data: " "sent %zd of %lu bytes", written, outbuf[i].cbBuffer); return CURLE_SSL_CONNECT_ERROR; } } /* free obsolete buffer */ if(outbuf[i].pvBuffer != NULL) { s_pSecFn->FreeContextBuffer(outbuf[i].pvBuffer); } } } else { if(sspi_status == SEC_E_WRONG_PRINCIPAL) failf(data, "schannel: SNI or certificate check failed: %s", Curl_sspi_strerror(conn, sspi_status)); else failf(data, "schannel: next InitializeSecurityContext failed: %s", Curl_sspi_strerror(conn, sspi_status)); return CURLE_SSL_CONNECT_ERROR; } /* check if there was additional remaining encrypted data */ if(inbuf[1].BufferType == SECBUFFER_EXTRA && inbuf[1].cbBuffer > 0) { infof(data, "schannel: encrypted data length: %lu\n", inbuf[1].cbBuffer); /* There are two cases where we could be getting extra data here: 1) If we're renegotiating a connection and the handshake is already complete (from the server perspective), it can encrypted app data (not handshake data) in an extra buffer at this point. 2) (sspi_status == SEC_I_CONTINUE_NEEDED) We are negotiating a connection and this extra data is part of the handshake. We should process the data immediately; waiting for the socket to be ready may fail since the server is done sending handshake data. */ /* check if the remaining data is less than the total amount and therefore begins after the already processed data */ if(connssl->encdata_offset > inbuf[1].cbBuffer) { memmove(connssl->encdata_buffer, (connssl->encdata_buffer + connssl->encdata_offset) - inbuf[1].cbBuffer, inbuf[1].cbBuffer); connssl->encdata_offset = inbuf[1].cbBuffer; if(sspi_status == SEC_I_CONTINUE_NEEDED) { doread = FALSE; continue; } } } else { connssl->encdata_offset = 0; } break; } /* check if the handshake needs to be continued */ if(sspi_status == SEC_I_CONTINUE_NEEDED) { connssl->connecting_state = ssl_connect_2_reading; return CURLE_OK; } /* check if the handshake is complete */ if(sspi_status == SEC_E_OK) { connssl->connecting_state = ssl_connect_3; infof(data, "schannel: SSL/TLS handshake complete\n"); } #ifdef _WIN32_WCE /* Windows CE doesn't do any server certificate validation. We have to do it manually. */ if(data->set.ssl.verifypeer) return verify_certificate(conn, sockindex); #endif return CURLE_OK; } static CURLcode schannel_connect_step3(struct connectdata *conn, int sockindex) { CURLcode retcode = CURLE_OK; struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; struct curl_schannel_cred *old_cred = NULL; int incache; DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); infof(data, "schannel: SSL/TLS connection with %s port %hu (step 3/3)\n", conn->host.name, conn->remote_port); /* check if the required context attributes are met */ if(connssl->ret_flags != connssl->req_flags) { if(!(connssl->ret_flags & ISC_RET_SEQUENCE_DETECT)) failf(data, "schannel: failed to setup sequence detection"); if(!(connssl->ret_flags & ISC_RET_REPLAY_DETECT)) failf(data, "schannel: failed to setup replay detection"); if(!(connssl->ret_flags & ISC_RET_CONFIDENTIALITY)) failf(data, "schannel: failed to setup confidentiality"); if(!(connssl->ret_flags & ISC_RET_ALLOCATED_MEMORY)) failf(data, "schannel: failed to setup memory allocation"); if(!(connssl->ret_flags & ISC_RET_STREAM)) failf(data, "schannel: failed to setup stream orientation"); return CURLE_SSL_CONNECT_ERROR; } /* increment the reference counter of the credential/session handle */ if(connssl->cred && connssl->ctxt) { connssl->cred->refcount++; infof(data, "schannel: incremented credential handle refcount = %d\n", connssl->cred->refcount); } /* save the current session data for possible re-use */ incache = !(Curl_ssl_getsessionid(conn, (void**)&old_cred, NULL)); if(incache) { if(old_cred != connssl->cred) { infof(data, "schannel: old credential handle is stale, removing\n"); Curl_ssl_delsessionid(conn, (void*)old_cred); incache = FALSE; } } if(!incache) { retcode = Curl_ssl_addsessionid(conn, (void*)connssl->cred, sizeof(struct curl_schannel_cred)); if(retcode) { failf(data, "schannel: failed to store credential handle"); return retcode; } else { connssl->cred->cached = TRUE; infof(data, "schannel: stored credential handle in session cache\n"); } } connssl->connecting_state = ssl_connect_done; return CURLE_OK; } static CURLcode schannel_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; int what; /* check if the connection has already been established */ if(ssl_connection_complete == connssl->state) { *done = TRUE; return CURLE_OK; } if(ssl_connect_1 == connssl->connecting_state) { /* check out how much more time we're allowed */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { /* no need to continue if time already is up */ failf(data, "SSL/TLS connection timeout"); return CURLE_OPERATION_TIMEDOUT; } retcode = schannel_connect_step1(conn, sockindex); if(retcode) return retcode; } while(ssl_connect_2 == connssl->connecting_state || ssl_connect_2_reading == connssl->connecting_state || ssl_connect_2_writing == connssl->connecting_state) { /* check out how much more time we're allowed */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { /* no need to continue if time already is up */ failf(data, "SSL/TLS connection timeout"); return CURLE_OPERATION_TIMEDOUT; } /* 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) { curl_socket_t writefd = ssl_connect_2_writing == connssl->connecting_state ? sockfd : CURL_SOCKET_BAD; curl_socket_t readfd = ssl_connect_2_reading == connssl->connecting_state ? sockfd : CURL_SOCKET_BAD; what = Curl_socket_ready(readfd, writefd, nonblocking ? 0 : timeout_ms); if(what < 0) { /* fatal error */ failf(data, "select/poll on SSL/TLS socket, errno: %d", SOCKERRNO); return CURLE_SSL_CONNECT_ERROR; } else if(0 == what) { if(nonblocking) { *done = FALSE; return CURLE_OK; } else { /* timeout */ failf(data, "SSL/TLS connection timeout"); return CURLE_OPERATION_TIMEDOUT; } } /* socket is readable or writable */ } /* Run transaction, and return to the caller if it failed or if * this connection is part of a multi handle and this loop would * execute again. This permits the owner of a multi handle to * abort a connection attempt before step2 has completed while * ensuring that a client using select() or epoll() will always * have a valid fdset to wait on. */ retcode = schannel_connect_step2(conn, sockindex); if(retcode || (nonblocking && (ssl_connect_2 == connssl->connecting_state || ssl_connect_2_reading == connssl->connecting_state || ssl_connect_2_writing == connssl->connecting_state))) return retcode; } /* repeat step2 until all transactions are done. */ if(ssl_connect_3 == connssl->connecting_state) { retcode = schannel_connect_step3(conn, sockindex); if(retcode) return retcode; } if(ssl_connect_done == connssl->connecting_state) { connssl->state = ssl_connection_complete; conn->recv[sockindex] = schannel_recv; conn->send[sockindex] = schannel_send; *done = TRUE; } else *done = FALSE; /* reset our connection state machine */ connssl->connecting_state = ssl_connect_1; return CURLE_OK; } static ssize_t schannel_send(struct connectdata *conn, int sockindex, const void *buf, size_t len, CURLcode *err) { ssize_t written = -1; size_t data_len = 0; unsigned char *data = NULL; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; SecBuffer outbuf[4]; SecBufferDesc outbuf_desc; SECURITY_STATUS sspi_status = SEC_E_OK; CURLcode code; /* check if the maximum stream sizes were queried */ if(connssl->stream_sizes.cbMaximumMessage == 0) { sspi_status = s_pSecFn->QueryContextAttributes( &connssl->ctxt->ctxt_handle, SECPKG_ATTR_STREAM_SIZES, &connssl->stream_sizes); if(sspi_status != SEC_E_OK) { *err = CURLE_SEND_ERROR; return -1; } } /* check if the buffer is longer than the maximum message length */ if(len > connssl->stream_sizes.cbMaximumMessage) { *err = CURLE_SEND_ERROR; return -1; } /* calculate the complete message length and allocate a buffer for it */ data_len = connssl->stream_sizes.cbHeader + len + connssl->stream_sizes.cbTrailer; data = (unsigned char*) malloc(data_len); if(data == NULL) { *err = CURLE_OUT_OF_MEMORY; return -1; } /* setup output buffers (header, data, trailer, empty) */ InitSecBuffer(&outbuf[0], SECBUFFER_STREAM_HEADER, data, connssl->stream_sizes.cbHeader); InitSecBuffer(&outbuf[1], SECBUFFER_DATA, data + connssl->stream_sizes.cbHeader, curlx_uztoul(len)); InitSecBuffer(&outbuf[2], SECBUFFER_STREAM_TRAILER, data + connssl->stream_sizes.cbHeader + len, connssl->stream_sizes.cbTrailer); InitSecBuffer(&outbuf[3], SECBUFFER_EMPTY, NULL, 0); InitSecBufferDesc(&outbuf_desc, outbuf, 4); /* copy data into output buffer */ memcpy(outbuf[1].pvBuffer, buf, len); /* http://msdn.microsoft.com/en-us/library/windows/desktop/aa375390.aspx */ sspi_status = s_pSecFn->EncryptMessage(&connssl->ctxt->ctxt_handle, 0, &outbuf_desc, 0); /* check if the message was encrypted */ if(sspi_status == SEC_E_OK) { written = 0; /* send the encrypted message including header, data and trailer */ len = outbuf[0].cbBuffer + outbuf[1].cbBuffer + outbuf[2].cbBuffer; /* It's important to send the full message which includes the header, encrypted payload, and trailer. Until the client receives all the data a coherent message has not been delivered and the client can't read any of it. If we wanted to buffer the unwritten encrypted bytes, we would tell the client that all data it has requested to be sent has been sent. The unwritten encrypted bytes would be the first bytes to send on the next invocation. Here's the catch with this - if we tell the client that all the bytes have been sent, will the client call this method again to send the buffered data? Looking at who calls this function, it seems the answer is NO. */ /* send entire message or fail */ while(len > (size_t)written) { ssize_t this_write; long timeleft; int what; this_write = 0; timeleft = Curl_timeleft(conn->data, NULL, TRUE); if(timeleft < 0) { /* we already got the timeout */ failf(conn->data, "schannel: timed out sending data " "(bytes sent: %zd)", written); *err = CURLE_OPERATION_TIMEDOUT; written = -1; break; } what = Curl_socket_ready(CURL_SOCKET_BAD, conn->sock[sockindex], timeleft); if(what < 0) { /* fatal error */ failf(conn->data, "select/poll on SSL socket, errno: %d", SOCKERRNO); *err = CURLE_SEND_ERROR; written = -1; break; } else if(0 == what) { failf(conn->data, "schannel: timed out sending data " "(bytes sent: %zd)", written); *err = CURLE_OPERATION_TIMEDOUT; written = -1; break; } /* socket is writable */ code = Curl_write_plain(conn, conn->sock[sockindex], data + written, len - written, &this_write); if(code == CURLE_AGAIN) continue; else if(code != CURLE_OK) { *err = code; written = -1; break; } written += this_write; } } else if(sspi_status == SEC_E_INSUFFICIENT_MEMORY) { *err = CURLE_OUT_OF_MEMORY; } else{ *err = CURLE_SEND_ERROR; } Curl_safefree(data); if(len == (size_t)written) /* Encrypted message including header, data and trailer entirely sent. The return value is the number of unencrypted bytes that were sent. */ written = outbuf[1].cbBuffer; return written; } static ssize_t schannel_recv(struct connectdata *conn, int sockindex, char *buf, size_t len, CURLcode *err) { size_t size = 0; ssize_t nread = 0, ret = -1; CURLcode retcode; struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; bool done = FALSE; SecBuffer inbuf[4]; SecBufferDesc inbuf_desc; SECURITY_STATUS sspi_status = SEC_E_OK; infof(data, "schannel: client wants to read %zu bytes\n", len); *err = CURLE_OK; /* buffer to store previously received and decrypted data */ if(connssl->decdata_buffer == NULL) { connssl->decdata_offset = 0; connssl->decdata_length = CURL_SCHANNEL_BUFFER_INIT_SIZE; connssl->decdata_buffer = malloc(connssl->decdata_length); if(connssl->decdata_buffer == NULL) { failf(data, "schannel: unable to allocate memory"); *err = CURLE_OUT_OF_MEMORY; return -1; } } /* increase buffer in order to fit the requested amount of data */ while(connssl->encdata_length - connssl->encdata_offset < CURL_SCHANNEL_BUFFER_FREE_SIZE || connssl->encdata_length < len) { /* increase internal encrypted data buffer */ connssl->encdata_length *= CURL_SCHANNEL_BUFFER_STEP_FACTOR; connssl->encdata_buffer = realloc(connssl->encdata_buffer, connssl->encdata_length); if(connssl->encdata_buffer == NULL) { failf(data, "schannel: unable to re-allocate memory"); *err = CURLE_OUT_OF_MEMORY; return -1; } } /* read encrypted data from socket */ infof(data, "schannel: encrypted data buffer: offset %zu length %zu\n", connssl->encdata_offset, connssl->encdata_length); size = connssl->encdata_length - connssl->encdata_offset; if(size > 0) { *err = Curl_read_plain(conn->sock[sockindex], (char *) (connssl->encdata_buffer + connssl->encdata_offset), size, &nread); /* check for received data */ if(*err != CURLE_OK) ret = -1; else { if(nread > 0) /* increase encrypted data buffer offset */ connssl->encdata_offset += nread; ret = nread; } infof(data, "schannel: encrypted data got %zd\n", ret); } infof(data, "schannel: encrypted data buffer: offset %zu length %zu\n", connssl->encdata_offset, connssl->encdata_length); /* check if we still have some data in our buffers */ while(connssl->encdata_offset > 0 && sspi_status == SEC_E_OK && connssl->decdata_offset < len) { /* prepare data buffer for DecryptMessage call */ InitSecBuffer(&inbuf[0], SECBUFFER_DATA, connssl->encdata_buffer, curlx_uztoul(connssl->encdata_offset)); /* we need 3 more empty input buffers for possible output */ InitSecBuffer(&inbuf[1], SECBUFFER_EMPTY, NULL, 0); InitSecBuffer(&inbuf[2], SECBUFFER_EMPTY, NULL, 0); InitSecBuffer(&inbuf[3], SECBUFFER_EMPTY, NULL, 0); InitSecBufferDesc(&inbuf_desc, inbuf, 4); /* http://msdn.microsoft.com/en-us/library/windows/desktop/aa375348.aspx */ sspi_status = s_pSecFn->DecryptMessage(&connssl->ctxt->ctxt_handle, &inbuf_desc, 0, NULL); /* check if we need more data */ if(sspi_status == SEC_E_INCOMPLETE_MESSAGE) { infof(data, "schannel: failed to decrypt data, need more data\n"); *err = CURLE_AGAIN; return -1; } /* check if everything went fine (server may want to renegotiate context) */ if(sspi_status == SEC_E_OK || sspi_status == SEC_I_RENEGOTIATE || sspi_status == SEC_I_CONTEXT_EXPIRED) { /* check for successfully decrypted data */ if(inbuf[1].BufferType == SECBUFFER_DATA) { infof(data, "schannel: decrypted data length: %lu\n", inbuf[1].cbBuffer); /* increase buffer in order to fit the received amount of data */ size = inbuf[1].cbBuffer > CURL_SCHANNEL_BUFFER_FREE_SIZE ? inbuf[1].cbBuffer : CURL_SCHANNEL_BUFFER_FREE_SIZE; while(connssl->decdata_length - connssl->decdata_offset < size || connssl->decdata_length < len) { /* increase internal decrypted data buffer */ connssl->decdata_length *= CURL_SCHANNEL_BUFFER_STEP_FACTOR; connssl->decdata_buffer = realloc(connssl->decdata_buffer, connssl->decdata_length); if(connssl->decdata_buffer == NULL) { failf(data, "schannel: unable to re-allocate memory"); *err = CURLE_OUT_OF_MEMORY; return -1; } } /* copy decrypted data to internal buffer */ size = inbuf[1].cbBuffer; if(size > 0) { memcpy(connssl->decdata_buffer + connssl->decdata_offset, inbuf[1].pvBuffer, size); connssl->decdata_offset += size; } infof(data, "schannel: decrypted data added: %zu\n", size); infof(data, "schannel: decrypted data cached: offset %zu length %zu\n", connssl->decdata_offset, connssl->decdata_length); } /* check for remaining encrypted data */ if(inbuf[3].BufferType == SECBUFFER_EXTRA && inbuf[3].cbBuffer > 0) { infof(data, "schannel: encrypted data length: %lu\n", inbuf[3].cbBuffer); /* check if the remaining data is less than the total amount * and therefore begins after the already processed data */ if(connssl->encdata_offset > inbuf[3].cbBuffer) { /* move remaining encrypted data forward to the beginning of buffer */ memmove(connssl->encdata_buffer, (connssl->encdata_buffer + connssl->encdata_offset) - inbuf[3].cbBuffer, inbuf[3].cbBuffer); connssl->encdata_offset = inbuf[3].cbBuffer; } infof(data, "schannel: encrypted data cached: offset %zu length %zu\n", connssl->encdata_offset, connssl->encdata_length); } else{ /* reset encrypted buffer offset, because there is no data remaining */ connssl->encdata_offset = 0; } } /* check if server wants to renegotiate the connection context */ if(sspi_status == SEC_I_RENEGOTIATE) { infof(data, "schannel: remote party requests SSL/TLS renegotiation\n"); /* begin renegotiation */ infof(data, "schannel: renegotiating SSL/TLS connection\n"); connssl->state = ssl_connection_negotiating; connssl->connecting_state = ssl_connect_2_writing; retcode = schannel_connect_common(conn, sockindex, FALSE, &done); if(retcode) *err = retcode; else { infof(data, "schannel: SSL/TLS connection renegotiated\n"); /* now retry receiving data */ return schannel_recv(conn, sockindex, buf, len, err); } } } infof(data, "schannel: decrypted data buffer: offset %zu length %zu\n", connssl->decdata_offset, connssl->decdata_length); /* copy requested decrypted data to supplied buffer */ size = len < connssl->decdata_offset ? len : connssl->decdata_offset; if(size > 0) { memcpy(buf, connssl->decdata_buffer, size); ret = size; /* move remaining decrypted data forward to the beginning of buffer */ memmove(connssl->decdata_buffer, connssl->decdata_buffer + size, connssl->decdata_offset - size); connssl->decdata_offset -= size; infof(data, "schannel: decrypted data returned %zd\n", size); infof(data, "schannel: decrypted data buffer: offset %zu length %zu\n", connssl->decdata_offset, connssl->decdata_length); } /* check if the server closed the connection */ if(ret <= 0 && ( /* special check for Windows 2000 Professional */ sspi_status == SEC_I_CONTEXT_EXPIRED || (sspi_status == SEC_E_OK && connssl->encdata_offset > 0 && connssl->encdata_buffer[0] == 0x15))) { infof(data, "schannel: server closed the connection\n"); *err = CURLE_OK; return 0; } /* check if something went wrong and we need to return an error */ if(ret < 0 && sspi_status != SEC_E_OK) { infof(data, "schannel: failed to read data from server: %s\n", Curl_sspi_strerror(conn, sspi_status)); *err = CURLE_RECV_ERROR; return -1; } return ret; } CURLcode Curl_schannel_connect_nonblocking(struct connectdata *conn, int sockindex, bool *done) { return schannel_connect_common(conn, sockindex, TRUE, done); } CURLcode Curl_schannel_connect(struct connectdata *conn, int sockindex) { CURLcode retcode; bool done = FALSE; retcode = schannel_connect_common(conn, sockindex, FALSE, &done); if(retcode) return retcode; DEBUGASSERT(done); return CURLE_OK; } bool Curl_schannel_data_pending(const struct connectdata *conn, int sockindex) { const struct ssl_connect_data *connssl = &conn->ssl[sockindex]; if(connssl->use) /* SSL/TLS is in use */ return (connssl->encdata_offset > 0 || connssl->decdata_offset > 0 ) ? TRUE : FALSE; else return FALSE; } void Curl_schannel_close(struct connectdata *conn, int sockindex) { if(conn->ssl[sockindex].use) /* if the SSL/TLS channel hasn't been shut down yet, do that now. */ Curl_ssl_shutdown(conn, sockindex); } int Curl_schannel_shutdown(struct connectdata *conn, int sockindex) { /* See http://msdn.microsoft.com/en-us/library/windows/desktop/aa380138.aspx * Shutting Down an Schannel Connection */ struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; infof(data, "schannel: shutting down SSL/TLS connection with %s port %hu\n", conn->host.name, conn->remote_port); if(connssl->cred && connssl->ctxt) { SecBufferDesc BuffDesc; SecBuffer Buffer; SECURITY_STATUS sspi_status; SecBuffer outbuf; SecBufferDesc outbuf_desc; CURLcode code; TCHAR *host_name; DWORD dwshut = SCHANNEL_SHUTDOWN; InitSecBuffer(&Buffer, SECBUFFER_TOKEN, &dwshut, sizeof(dwshut)); InitSecBufferDesc(&BuffDesc, &Buffer, 1); sspi_status = s_pSecFn->ApplyControlToken(&connssl->ctxt->ctxt_handle, &BuffDesc); if(sspi_status != SEC_E_OK) failf(data, "schannel: ApplyControlToken failure: %s", Curl_sspi_strerror(conn, sspi_status)); host_name = Curl_convert_UTF8_to_tchar(conn->host.name); if(!host_name) return CURLE_OUT_OF_MEMORY; /* setup output buffer */ InitSecBuffer(&outbuf, SECBUFFER_EMPTY, NULL, 0); InitSecBufferDesc(&outbuf_desc, &outbuf, 1); sspi_status = s_pSecFn->InitializeSecurityContext( &connssl->cred->cred_handle, &connssl->ctxt->ctxt_handle, host_name, connssl->req_flags, 0, 0, NULL, 0, &connssl->ctxt->ctxt_handle, &outbuf_desc, &connssl->ret_flags, &connssl->ctxt->time_stamp); Curl_unicodefree(host_name); if((sspi_status == SEC_E_OK) || (sspi_status == SEC_I_CONTEXT_EXPIRED)) { /* send close message which is in output buffer */ ssize_t written; code = Curl_write_plain(conn, conn->sock[sockindex], outbuf.pvBuffer, outbuf.cbBuffer, &written); s_pSecFn->FreeContextBuffer(outbuf.pvBuffer); if((code != CURLE_OK) || (outbuf.cbBuffer != (size_t)written)) { infof(data, "schannel: failed to send close msg: %s" " (bytes written: %zd)\n", curl_easy_strerror(code), written); } } /* free SSPI Schannel API security context handle */ if(connssl->ctxt) { infof(data, "schannel: clear security context handle\n"); s_pSecFn->DeleteSecurityContext(&connssl->ctxt->ctxt_handle); Curl_safefree(connssl->ctxt); } /* free SSPI Schannel API credential handle */ if(connssl->cred) { /* decrement the reference counter of the credential/session handle */ if(connssl->cred->refcount > 0) { connssl->cred->refcount--; infof(data, "schannel: decremented credential handle refcount = %d\n", connssl->cred->refcount); } /* if the handle was not cached and the refcount is zero */ if(!connssl->cred->cached && connssl->cred->refcount == 0) { infof(data, "schannel: clear credential handle\n"); s_pSecFn->FreeCredentialsHandle(&connssl->cred->cred_handle); Curl_safefree(connssl->cred); } } } /* free internal buffer for received encrypted data */ if(connssl->encdata_buffer != NULL) { Curl_safefree(connssl->encdata_buffer); connssl->encdata_length = 0; connssl->encdata_offset = 0; } /* free internal buffer for received decrypted data */ if(connssl->decdata_buffer != NULL) { Curl_safefree(connssl->decdata_buffer); connssl->decdata_length = 0; connssl->decdata_offset = 0; } return CURLE_OK; } void Curl_schannel_session_free(void *ptr) { struct curl_schannel_cred *cred = ptr; if(cred && cred->cached && cred->refcount == 0) { s_pSecFn->FreeCredentialsHandle(&cred->cred_handle); Curl_safefree(cred); } } int Curl_schannel_init(void) { return (Curl_sspi_global_init() == CURLE_OK ? 1 : 0); } void Curl_schannel_cleanup(void) { Curl_sspi_global_cleanup(); } size_t Curl_schannel_version(char *buffer, size_t size) { size = snprintf(buffer, size, "WinSSL"); return size; } #ifdef _WIN32_WCE static CURLcode verify_certificate(struct connectdata *conn, int sockindex) { SECURITY_STATUS status; struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; CURLcode result = CURLE_OK; CERT_CONTEXT *pCertContextServer = NULL; const CERT_CHAIN_CONTEXT *pChainContext = NULL; status = s_pSecFn->QueryContextAttributes(&connssl->ctxt->ctxt_handle, SECPKG_ATTR_REMOTE_CERT_CONTEXT, &pCertContextServer); if((status != SEC_E_OK) || (pCertContextServer == NULL)) { failf(data, "schannel: Failed to read remote certificate context: %s", Curl_sspi_strerror(conn, status)); result = CURLE_PEER_FAILED_VERIFICATION; } if(result == CURLE_OK) { CERT_CHAIN_PARA ChainPara; memset(&ChainPara, 0, sizeof(ChainPara)); ChainPara.cbSize = sizeof(ChainPara); if(!CertGetCertificateChain(NULL, pCertContextServer, NULL, pCertContextServer->hCertStore, &ChainPara, 0, NULL, &pChainContext)) { failf(data, "schannel: CertGetCertificateChain failed: %s", Curl_sspi_strerror(conn, GetLastError())); pChainContext = NULL; result = CURLE_PEER_FAILED_VERIFICATION; } if(result == CURLE_OK) { CERT_SIMPLE_CHAIN *pSimpleChain = pChainContext->rgpChain[0]; DWORD dwTrustErrorMask = ~(DWORD)(CERT_TRUST_IS_NOT_TIME_NESTED| CERT_TRUST_REVOCATION_STATUS_UNKNOWN); dwTrustErrorMask &= pSimpleChain->TrustStatus.dwErrorStatus; if(dwTrustErrorMask) { if(dwTrustErrorMask & CERT_TRUST_IS_PARTIAL_CHAIN) failf(data, "schannel: CertGetCertificateChain trust error" " CERT_TRUST_IS_PARTIAL_CHAIN"); if(dwTrustErrorMask & CERT_TRUST_IS_UNTRUSTED_ROOT) failf(data, "schannel: CertGetCertificateChain trust error" " CERT_TRUST_IS_UNTRUSTED_ROOT"); if(dwTrustErrorMask & CERT_TRUST_IS_NOT_TIME_VALID) failf(data, "schannel: CertGetCertificateChain trust error" " CERT_TRUST_IS_NOT_TIME_VALID"); failf(data, "schannel: CertGetCertificateChain error mask: 0x%08x", dwTrustErrorMask); result = CURLE_PEER_FAILED_VERIFICATION; } } } if(result == CURLE_OK) { if(data->set.ssl.verifyhost) { TCHAR cert_hostname_buff[128]; xcharp_u hostname; xcharp_u cert_hostname; DWORD len; cert_hostname.const_tchar_ptr = cert_hostname_buff; hostname.tchar_ptr = Curl_convert_UTF8_to_tchar(conn->host.name); len = CertGetNameString(pCertContextServer, CERT_NAME_DNS_TYPE, 0, NULL, cert_hostname.tchar_ptr, 128); if(len > 0 && *cert_hostname.tchar_ptr == '*') { /* this is a wildcard cert. try matching the last len - 1 chars */ int hostname_len = strlen(conn->host.name); cert_hostname.tchar_ptr++; if(_tcsicmp(cert_hostname.const_tchar_ptr, hostname.const_tchar_ptr + hostname_len - len + 2) != 0) result = CURLE_PEER_FAILED_VERIFICATION; } else if(len == 0 || _tcsicmp(hostname.const_tchar_ptr, cert_hostname.const_tchar_ptr) != 0) { result = CURLE_PEER_FAILED_VERIFICATION; } if(result == CURLE_PEER_FAILED_VERIFICATION) { char *_cert_hostname; _cert_hostname = Curl_convert_tchar_to_UTF8(cert_hostname.tchar_ptr); failf(data, "schannel: CertGetNameString() certificate hostname " "(%s) did not match connection (%s)", _cert_hostname, conn->host.name); Curl_unicodefree(_cert_hostname); } Curl_unicodefree(hostname.tchar_ptr); } } if(pChainContext) CertFreeCertificateChain(pChainContext); if(pCertContextServer) CertFreeCertificateContext(pCertContextServer); return result; } #endif /* _WIN32_WCE */ #endif /* USE_SCHANNEL */ curl-7.35.0/lib/progress.h0000644000175000017500000000465612213173003012262 00000000000000#ifndef HEADER_CURL_PROGRESS_H #define HEADER_CURL_PROGRESS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "timeval.h" typedef enum { TIMER_NONE, TIMER_NAMELOOKUP, TIMER_CONNECT, TIMER_APPCONNECT, TIMER_PRETRANSFER, TIMER_STARTTRANSFER, TIMER_POSTRANSFER, TIMER_STARTSINGLE, TIMER_STARTACCEPT, TIMER_REDIRECT, TIMER_LAST /* must be last */ } timerid; int 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_pgrsResetTimesSizes(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 /* HEADER_CURL_PROGRESS_H */ curl-7.35.0/lib/objnames-test08.sh0000755000175000017500000001256312213173003013523 00000000000000#!/bin/sh # *************************************************************************** # * _ _ ____ _ # * Project ___| | | | _ \| | # * / __| | | | |_) | | # * | (__| |_| | _ <| |___ # * \___|\___/|_| \_\_____| # * # * Copyright (C) 2013, 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. # * # *************************************************************************** # # This Bourne shell script file is used by test case 1222 to do # unit testing of curl_8char_object_name() shell function which # is defined in file objnames.inc and sourced by this file and # any other shell script that may use it. # # # argument validation # if test $# -eq 1; then : else echo "Usage: ${0} srcdir" exit 1 fi if test -f "${1}/runtests.pl"; then : else echo "${0}: Wrong srcdir" exit 1 fi srcdir=${1} if test -f "$srcdir/../lib/objnames.inc"; then : else echo "$0: Missing objnames.inc" exit 1 fi # # Some variables # logdir=log tstnum=1222 list_c=$logdir/${tstnum}_list_c list_obj=$logdir/${tstnum}_list_obj list_obj_c=$logdir/${tstnum}_list_obj_c list_obj_uniq=$logdir/${tstnum}_list_obj_uniq # # Source curl_8char_object_name() function definition # . $srcdir/../lib/objnames.inc # # Some curl_8char_object_name() unit tests # echo 'Testing curl_8char_object_name...' echo "" argstr=123__678__ABC__FGH__KLM__PQRSTUV expect=16AFKPQR outstr=`curl_8char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123__678__ABC__FGH__KLM__PQ.S.UV expect=16AFKPQ outstr=`curl_8char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123__678__ABC..FGH..KLM..PQRSTUV expect=16ABC outstr=`curl_8char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123__678_.ABC._FGH__KLM__PQRSTUV expect=16 outstr=`curl_8char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123.567.90ABCDEFGHIJKLMNOPQRSTUV expect=123 outstr=`curl_8char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=1234567.90A.CDEFGHIJKLMNOPQRSTUV expect=1234567 outstr=`curl_8char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=1234567890.BCD.FGHIJKLMNOPQRSTUV expect=12345678 outstr=`curl_8char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=12=45-78+0AB.DE.GHIJKLMNOPQRSTUV expect=1470AB outstr=`curl_8char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=1234567890ABCDEFGHIJKLMNOPQRSTUV expect=12345678 outstr=`curl_8char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123_567_90A_CDE_GHIJKLMNOPQRSTUV expect=159CGHIJ outstr=`curl_8char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123_567_90A_CDEFGHIJKLMNOPQRSTUV expect=159CDEFG outstr=`curl_8char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123_567_90ABCDEFGHIJKLMNOPQRSTUV expect=1590ABCD outstr=`curl_8char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=123_567890ABCDEFGHIJKLMNOPQRSTUV expect=1567890A outstr=`curl_8char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" argstr=1234567890ABCDEFGHIJKLMNOPQRSTUV expect=12345678 outstr=`curl_8char_object_name $argstr` echo "result: $outstr expected: $expect input: $argstr" # # Verify that generated object name is distinct for # all *.c source files in lib and src subdirectories. # ls $srcdir/../lib/*.c > $list_c ls $srcdir/../src/*.c >> $list_c rm -f $list_obj for c_fname in `cat $list_c`; do obj_name=`curl_8char_object_name $c_fname` echo "$obj_name" >> $list_obj done sort -u $list_obj > $list_obj_uniq cnt_c=`cat $list_c | wc -l` cnt_u=`cat $list_obj_uniq | wc -l` echo "" echo "" echo "" if test $cnt_c -eq $cnt_u; then echo "8-characters-or-less generated object names are unique." obj_name_clash="no" else echo "8-characters-or-less generated object names are clashing..." obj_name_clash="yes" fi if test $obj_name_clash = "yes"; then # # Show clashing object names and respective source file names # echo "" paste $list_obj $list_c | sort > $list_obj_c prev_match="no" prev_line="unknown" prev_obj_name="unknown" while read this_line; do obj_name=`echo "$this_line" | cut -f1` if test "x$obj_name" = "x$prev_obj_name"; then if test "x$prev_match" != "xyes"; then echo "$prev_line" echo "$this_line" prev_match="yes" else echo "$this_line" fi else prev_match="no" fi prev_line=$this_line prev_obj_name=$obj_name done < $list_obj_c fi rm -f $list_c rm -f $list_obj rm -f $list_obj_c rm -f $list_obj_uniq # end of objnames-test.sh curl-7.35.0/lib/Makefile.m320000644000175000017500000002021212262353672012307 00000000000000########################################################################### # ## Makefile for building libcurl.a with MingW (GCC-3.2 or later) ## and optionally OpenSSL (0.9.8), libssh2 (1.3), zlib (1.2.5), librtmp (2.3) ## ## Usage: mingw32-make -f Makefile.m32 CFG=-feature1[-feature2][-feature3][...] ## Example: mingw32-make -f Makefile.m32 CFG=-zlib-ssl-sspi-winidn ## ## Hint: you can also set environment vars to control the build, f.e.: ## set ZLIB_PATH=c:/zlib-1.2.8 ## set ZLIB=1 # ########################################################################### # Edit the path below to point to the base of your Zlib sources. ifndef ZLIB_PATH ZLIB_PATH = ../../zlib-1.2.8 endif # Edit the path below to point to the base of your OpenSSL package. ifndef OPENSSL_PATH OPENSSL_PATH = ../../openssl-0.9.8y endif # Edit the path below to point to the base of your LibSSH2 package. ifndef LIBSSH2_PATH LIBSSH2_PATH = ../../libssh2-1.4.3 endif # Edit the path below to point to the base of your librtmp package. ifndef LIBRTMP_PATH LIBRTMP_PATH = ../../librtmp-2.3 endif # Edit the path below to point to the base of your libidn package. ifndef LIBIDN_PATH LIBIDN_PATH = ../../libidn-1.18 endif # Edit the path below to point to the base of your MS IDN package. # Microsoft Internationalized Domain Names (IDN) Mitigation APIs 1.1 # http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ad6158d7-ddba-416a-9109-07607425a815 ifndef WINIDN_PATH WINIDN_PATH = ../../Microsoft IDN Mitigation APIs endif # Edit the path below to point to the base of your Novell LDAP NDK. ifndef LDAP_SDK LDAP_SDK = c:/novell/ndk/cldapsdk/win32 endif PROOT = .. # Edit the path below to point to the base of your c-ares package. ifndef LIBCARES_PATH LIBCARES_PATH = $(PROOT)/ares endif # Edit the var below to set to your architecture or set environment var. ifndef ARCH ARCH = w32 endif CC = $(CROSSPREFIX)gcc CFLAGS = -g -O2 -Wall CFLAGS += -fno-strict-aliasing ifeq ($(ARCH),w64) CFLAGS += -D_AMD64_ endif # comment LDFLAGS below to keep debug info LDFLAGS = -s AR = $(CROSSPREFIX)ar RANLIB = $(CROSSPREFIX)ranlib RC = $(CROSSPREFIX)windres RCFLAGS = --include-dir=$(PROOT)/include -DDEBUGBUILD=0 -O COFF -i STRIP = $(CROSSPREFIX)strip -g # Platform-dependent helper tool macros ifeq ($(findstring /sh,$(SHELL)),/sh) DEL = rm -f $1 RMDIR = rm -fr $1 MKDIR = mkdir -p $1 COPY = -cp -afv $1 $2 #COPYR = -cp -afr $1/* $2 COPYR = -rsync -aC $1/* $2 TOUCH = touch $1 CAT = cat ECHONL = echo "" DL = ' else ifeq "$(OS)" "Windows_NT" DEL = -del 2>NUL /q /f $(subst /,\,$1) RMDIR = -rd 2>NUL /q /s $(subst /,\,$1) else DEL = -del 2>NUL $(subst /,\,$1) RMDIR = -deltree 2>NUL /y $(subst /,\,$1) endif MKDIR = -md 2>NUL $(subst /,\,$1) COPY = -copy 2>NUL /y $(subst /,\,$1) $(subst /,\,$2) COPYR = -xcopy 2>NUL /q /y /e $(subst /,\,$1) $(subst /,\,$2) TOUCH = copy 2>&1>NUL /b $(subst /,\,$1) +,, CAT = type ECHONL = $(ComSpec) /c echo. endif ######################################################## ## Nothing more to do below this line! ifeq ($(findstring -dyn,$(CFG)),-dyn) DYN = 1 endif ifeq ($(findstring -ares,$(CFG)),-ares) ARES = 1 endif ifeq ($(findstring -sync,$(CFG)),-sync) SYNC = 1 endif ifeq ($(findstring -rtmp,$(CFG)),-rtmp) RTMP = 1 SSL = 1 ZLIB = 1 endif ifeq ($(findstring -ssh2,$(CFG)),-ssh2) SSH2 = 1 SSL = 1 ZLIB = 1 endif ifeq ($(findstring -ssl,$(CFG)),-ssl) SSL = 1 endif ifeq ($(findstring -srp,$(CFG)),-srp) SRP = 1 endif ifeq ($(findstring -zlib,$(CFG)),-zlib) ZLIB = 1 endif ifeq ($(findstring -idn,$(CFG)),-idn) IDN = 1 endif ifeq ($(findstring -winidn,$(CFG)),-winidn) WINIDN = 1 endif ifeq ($(findstring -sspi,$(CFG)),-sspi) SSPI = 1 endif ifeq ($(findstring -spnego,$(CFG)),-spnego) SPNEGO = 1 endif ifeq ($(findstring -ldaps,$(CFG)),-ldaps) LDAPS = 1 endif ifeq ($(findstring -ipv6,$(CFG)),-ipv6) IPV6 = 1 endif ifeq ($(findstring -winssl,$(CFG)),-winssl) WINSSL = 1 SSPI = 1 endif INCLUDES = -I. -I../include CFLAGS += -DBUILDING_LIBCURL ifdef SYNC CFLAGS += -DUSE_SYNC_DNS else ifdef ARES INCLUDES += -I"$(LIBCARES_PATH)" CFLAGS += -DUSE_ARES -DCARES_STATICLIB DLL_LIBS += -L"$(LIBCARES_PATH)" -lcares libcurl_dll_DEPENDENCIES = $(LIBCARES_PATH)/libcares.a endif endif ifdef RTMP INCLUDES += -I"$(LIBRTMP_PATH)" CFLAGS += -DUSE_LIBRTMP DLL_LIBS += -L"$(LIBRTMP_PATH)/librtmp" -lrtmp -lwinmm endif ifdef SSH2 INCLUDES += -I"$(LIBSSH2_PATH)/include" -I"$(LIBSSH2_PATH)/win32" CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H DLL_LIBS += -L"$(LIBSSH2_PATH)/win32" -lssh2 endif ifdef SSL ifndef OPENSSL_INCLUDE ifeq "$(wildcard $(OPENSSL_PATH)/outinc)" "$(OPENSSL_PATH)/outinc" OPENSSL_INCLUDE = $(OPENSSL_PATH)/outinc endif ifeq "$(wildcard $(OPENSSL_PATH)/include)" "$(OPENSSL_PATH)/include" OPENSSL_INCLUDE = $(OPENSSL_PATH)/include endif endif ifneq "$(wildcard $(OPENSSL_INCLUDE)/openssl/opensslv.h)" "$(OPENSSL_INCLUDE)/openssl/opensslv.h" $(error Invalid path to OpenSSL package: $(OPENSSL_PATH)) endif ifndef OPENSSL_LIBPATH ifeq "$(wildcard $(OPENSSL_PATH)/out)" "$(OPENSSL_PATH)/out" OPENSSL_LIBPATH = $(OPENSSL_PATH)/out OPENSSL_LIBS = -leay32 -lssl32 endif ifeq "$(wildcard $(OPENSSL_PATH)/lib)" "$(OPENSSL_PATH)/lib" OPENSSL_LIBPATH = $(OPENSSL_PATH)/lib OPENSSL_LIBS = -lcrypto -lssl endif endif INCLUDES += -I"$(OPENSSL_INCLUDE)" CFLAGS += -DUSE_SSLEAY -DUSE_OPENSSL -DHAVE_OPENSSL_ENGINE_H -DHAVE_OPENSSL_PKCS12_H \ -DHAVE_ENGINE_LOAD_BUILTIN_ENGINES -DOPENSSL_NO_KRB5 \ -DCURL_WANTS_CA_BUNDLE_ENV DLL_LIBS += -L"$(OPENSSL_LIBPATH)" $(OPENSSL_LIBS) ifdef SRP ifeq "$(wildcard $(OPENSSL_INCLUDE)/openssl/srp.h)" "$(OPENSSL_INCLUDE)/openssl/srp.h" CFLAGS += -DHAVE_SSLEAY_SRP -DUSE_TLS_SRP endif endif endif ifdef ZLIB INCLUDES += -I"$(ZLIB_PATH)" CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H DLL_LIBS += -L"$(ZLIB_PATH)" -lz endif ifdef IDN INCLUDES += -I"$(LIBIDN_PATH)/include" CFLAGS += -DUSE_LIBIDN DLL_LIBS += -L"$(LIBIDN_PATH)/lib" -lidn else ifdef WINIDN CFLAGS += -DUSE_WIN32_IDN CFLAGS += -DWANT_IDN_PROTOTYPES DLL_LIBS += -L"$(WINIDN_PATH)" -lnormaliz endif endif ifdef SSPI CFLAGS += -DUSE_WINDOWS_SSPI ifdef WINSSL CFLAGS += -DUSE_SCHANNEL endif endif ifdef SPNEGO CFLAGS += -DHAVE_SPNEGO endif ifdef IPV6 CFLAGS += -DENABLE_IPV6 -D_WIN32_WINNT=0x0501 endif ifdef LDAPS CFLAGS += -DHAVE_LDAP_SSL endif ifdef USE_LDAP_NOVELL INCLUDES += -I"$(LDAP_SDK)/inc" CFLAGS += -DCURL_HAS_NOVELL_LDAPSDK DLL_LIBS += -L"$(LDAP_SDK)/lib/mscvc" -lldapsdk -lldapssl -lldapx endif ifdef USE_LDAP_OPENLDAP INCLUDES += -I"$(LDAP_SDK)/include" CFLAGS += -DCURL_HAS_OPENLDAP_LDAPSDK DLL_LIBS += -L"$(LDAP_SDK)/lib" -lldap -llber endif ifndef USE_LDAP_NOVELL ifndef USE_LDAP_OPENLDAP DLL_LIBS += -lwldap32 endif endif DLL_LIBS += -lws2_32 # Makefile.inc provides the CSOURCES and HHEADERS defines include Makefile.inc libcurl_dll_LIBRARY = libcurl.dll libcurl_dll_a_LIBRARY = libcurldll.a libcurl_a_LIBRARY = libcurl.a libcurl_a_OBJECTS := $(patsubst %.c,%.o,$(strip $(CSOURCES))) libcurl_a_DEPENDENCIES := $(strip $(CSOURCES) $(HHEADERS)) RESOURCE = libcurl.res all: $(libcurl_a_LIBRARY) $(libcurl_dll_LIBRARY) $(libcurl_a_LIBRARY): $(libcurl_a_OBJECTS) $(libcurl_a_DEPENDENCIES) @$(call DEL, $@) $(AR) cru $@ $(libcurl_a_OBJECTS) $(RANLIB) $@ $(STRIP) $@ # remove the last line above to keep debug info $(libcurl_dll_LIBRARY): $(libcurl_a_OBJECTS) $(RESOURCE) $(libcurl_dll_DEPENDENCIES) @$(call DEL, $@) $(CC) $(LDFLAGS) -shared -o $@ \ -Wl,--output-def,$(@:.dll=.def),--out-implib,$(libcurl_dll_a_LIBRARY) \ $(libcurl_a_OBJECTS) $(RESOURCE) $(DLL_LIBS) %.o: %.c $(PROOT)/include/curl/curlbuild.h $(CC) $(INCLUDES) $(CFLAGS) -c $< %.res: %.rc $(RC) $(RCFLAGS) $< -o $@ clean: ifeq "$(wildcard $(PROOT)/include/curl/curlbuild.h.dist)" "$(PROOT)/include/curl/curlbuild.h.dist" @$(call DEL, $(PROOT)/include/curl/curlbuild.h) endif @$(call DEL, $(libcurl_a_OBJECTS) $(RESOURCE)) distclean vclean: clean @$(call DEL, $(libcurl_a_LIBRARY) $(libcurl_dll_LIBRARY) $(libcurl_dll_LIBRARY:.dll=.def) $(libcurl_dll_a_LIBRARY)) $(PROOT)/include/curl/curlbuild.h: @echo Creating $@ @$(call COPY, $@.dist, $@) $(LIBCARES_PATH)/libcares.a: $(MAKE) -C $(LIBCARES_PATH) -f Makefile.m32 curl-7.35.0/lib/bundles.h0000644000175000017500000000345512213173003012046 00000000000000#ifndef HEADER_CURL_BUNDLES_H #define HEADER_CURL_BUNDLES_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2012, Linus Nielsen Feltzing, * * 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. * ***************************************************************************/ struct connectbundle { bool server_supports_pipelining; /* TRUE if server supports pipelining, set after first response */ size_t num_connections; /* Number of connections in the bundle */ struct curl_llist *conn_list; /* The connectdata members of the bundle */ }; CURLcode Curl_bundle_create(struct SessionHandle *data, struct connectbundle **cb_ptr); void Curl_bundle_destroy(struct connectbundle *cb_ptr); CURLcode Curl_bundle_add_conn(struct connectbundle *cb_ptr, struct connectdata *conn); int Curl_bundle_remove_conn(struct connectbundle *cb_ptr, struct connectdata *conn); #endif /* HEADER_CURL_BUNDLES_H */ curl-7.35.0/lib/hostasyn.c0000644000175000017500000001107612213173003012253 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef __VMS #include #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 #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /*********************************************************************** * Only for builds using asynchronous name resolves **********************************************************************/ #ifdef CURLRES_ASYNCH /* * Curl_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, this function takes * ownership of the Curl_addrinfo passed, storing the resolved data * in the DNS cache. * * The storage operation locks and unlocks the DNS cache. */ CURLcode Curl_addrinfo_callback(struct connectdata *conn, int status, struct Curl_addrinfo *ai) { struct Curl_dns_entry *dns = NULL; CURLcode rc = CURLE_OK; conn->async.status = status; if(CURL_ASYNC_SUCCESS == status) { 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; } /* 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) { CURLcode code; if(conn->async.dns) { conn->dns_entry = conn->async.dns; conn->async.dns = NULL; } code = Curl_setup_conn(conn, 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, FALSE); /* close the connection */ return code; } /* * 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) { return Curl_resolver_getaddrinfo(conn, hostname, port, waitp); } #endif /* CURLRES_ASYNCH */ curl-7.35.0/lib/curl_hmac.h0000644000175000017500000000513312213173003012342 00000000000000#ifndef HEADER_CURL_HMAC_H #define HEADER_CURL_HMAC_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ #ifndef CURL_DISABLE_CRYPTO_AUTH typedef void (* HMAC_hinit_func)(void * context); typedef void (* HMAC_hupdate_func)(void * context, const unsigned char * data, unsigned int len); typedef void (* HMAC_hfinal_func)(unsigned char * result, void * context); /* Per-hash function HMAC parameters. */ typedef struct { HMAC_hinit_func hmac_hinit; /* Initialize context procedure. */ HMAC_hupdate_func hmac_hupdate; /* Update context with data. */ HMAC_hfinal_func hmac_hfinal; /* Get final result procedure. */ unsigned int hmac_ctxtsize; /* Context structure size. */ unsigned int hmac_maxkeylen; /* Maximum key length (bytes). */ unsigned int hmac_resultlen; /* Result length (bytes). */ } HMAC_params; /* HMAC computation context. */ typedef struct { const HMAC_params * hmac_hash; /* Hash function definition. */ void * hmac_hashctxt1; /* Hash function context 1. */ void * hmac_hashctxt2; /* Hash function context 2. */ } HMAC_context; /* Prototypes. */ HMAC_context * Curl_HMAC_init(const HMAC_params * hashparams, const unsigned char * key, unsigned int keylen); int Curl_HMAC_update(HMAC_context * context, const unsigned char * data, unsigned int len); int Curl_HMAC_final(HMAC_context * context, unsigned char * result); #endif #endif /* HEADER_CURL_HMAC_H */ curl-7.35.0/lib/telnet.c0000644000175000017500000013211712262353672011716 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_TELNET #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_SYS_PARAM_H #include #endif #include "urldata.h" #include #include "transfer.h" #include "sendf.h" #include "telnet.h" #include "connect.h" #include "progress.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #define TELOPTS #define TELCMDS #include "arpa_telnet.h" #include "curl_memory.h" #include "select.h" #include "strequal.h" #include "rawstr.h" #include "warnless.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) \ do { \ x->subend = x->subpointer; \ CURL_SB_CLEAR(x); \ } WHILE_FALSE #define CURL_SB_ACCUM(x,c) \ do { \ if(x->subpointer < (x->subbuffer+sizeof x->subbuffer)) \ *x->subpointer++ = (c); \ } WHILE_FALSE #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 CURL_DISABLE_VERBOSE_STRINGS #define printoption(a,b,c,d) Curl_nop_stmt #endif #ifdef USE_WINSOCK typedef FARPROC WSOCK2_FUNC; static CURLcode check_wsock2 ( struct SessionHandle *data ); #endif static CURLcode telrcv(struct connectdata *, const unsigned char *inbuf, /* Data received from socket */ ssize_t count); /* Number of bytes received */ #ifndef CURL_DISABLE_VERBOSE_STRINGS static void printoption(struct SessionHandle *data, const char *direction, int cmd, int option); #endif 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 *); static void sendsuboption(struct connectdata *conn, int option); static CURLcode telnet_do(struct connectdata *conn, bool *done); static CURLcode telnet_done(struct connectdata *conn, CURLcode, bool premature); static CURLcode send_telnet_data(struct connectdata *conn, char *buffer, ssize_t nread); /* 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]; int subnegotiation[256]; char subopt_ttype[32]; /* Set with suboption TTYPE */ char subopt_xdisploc[128]; /* Set with suboption XDISPLOC */ unsigned short subopt_wsx; /* Set with suboption NAWS */ unsigned short subopt_wsy; /* Set with suboption NAWS */ struct curl_slist *telnet_vars; /* Environment variables */ /* suboptions */ unsigned char subbuffer[SUBBUFSIZE]; unsigned char *subpointer, *subend; /* buffer for sub-options */ TelnetReceive telrcv_state; }; /* * TELNET protocol handler. */ const struct Curl_handler Curl_handler_telnet = { "TELNET", /* scheme */ ZERO_NULL, /* setup_connection */ telnet_do, /* do_it */ telnet_done, /* done */ ZERO_NULL, /* do_more */ ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_TELNET, /* defport */ CURLPROTO_TELNET, /* protocol */ PROTOPT_NONE | PROTOPT_NOURLQUERY /* flags */ }; #ifdef USE_WINSOCK static CURLcode check_wsock2 ( struct SessionHandle *data ) { int err; WORD wVersionRequested; WSADATA wsaData; DEBUGASSERT(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 = calloc(1, sizeof(struct TELNET)); if(!tn) return CURLE_OUT_OF_MEMORY; conn->data->req.protop = 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_SGA] = CURL_YES; tn->him_preferred[CURL_TELOPT_SGA] = CURL_YES; /* To be compliant with previous releases of libcurl we enable this option by default. This behaviour can be changed thanks to the "BINARY" option in CURLOPT_TELNETOPTIONS */ tn->us_preferred[CURL_TELOPT_BINARY] = CURL_YES; tn->him_preferred[CURL_TELOPT_BINARY] = CURL_YES; /* We must allow the server to echo what we sent but it is not necessary to request the server to do so (it might forces the server to close the connection). Hence, we ignore ECHO in the negotiate function */ tn->him_preferred[CURL_TELOPT_ECHO] = CURL_YES; /* Set the subnegotiation fields to send information just after negotiation passed (do/will) Default values are (0,0) initialized by calloc. According to the RFC1013 it is valid: A value equal to zero is acceptable for the width (or height), and means that no character width (or height) is being sent. In this case, the width (or height) that will be assumed by the Telnet server is operating system specific (it will probably be based upon the terminal type information that may have been sent using the TERMINAL TYPE Telnet option). */ tn->subnegotiation[CURL_TELOPT_NAWS] = CURL_YES; return CURLE_OK; } static void negotiate(struct connectdata *conn) { int i; struct TELNET *tn = (struct TELNET *) conn->data->req.protop; for(i = 0;i < CURL_NTELOPTS;i++) { if(i==CURL_TELOPT_ECHO) continue; 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); } } #ifndef CURL_DISABLE_VERBOSE_STRINGS 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); } } } #endif 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 = 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->req.protop; 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->req.protop; 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->req.protop; 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->req.protop; 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->req.protop; 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); if(tn->subnegotiation[option] == CURL_YES) /* transmission of data option */ sendsuboption(conn, option); } else if(tn->subnegotiation[option] == CURL_YES) { /* send information to achieve this option*/ tn->us[option] = CURL_YES; send_negotiation(conn, CURL_WILL, option); sendsuboption(conn, 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; if(tn->subnegotiation[option] == CURL_YES) { /* transmission of data option */ sendsuboption(conn, option); } 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->req.protop; 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; unsigned short *pval; 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, "%u ", 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: case CURL_TELOPT_NAWS: 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[0]) { case CURL_TELOPT_NAWS: pval = (unsigned short*)(pointer+1); infof(data, "Width: %hu ; Height: %hu", ntohs(pval[0]), ntohs(pval[1])); break; default: 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; struct curl_slist *beg; char option_keyword[128]; char option_arg[256]; struct SessionHandle *data = conn->data; struct TELNET *tn = (struct TELNET *)conn->data->req.protop; CURLcode result = CURLE_OK; int binary_option; /* 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); beg = curl_slist_append(tn->telnet_vars, option_arg); if(!beg) { curl_slist_free_all(tn->telnet_vars); tn->telnet_vars = NULL; return CURLE_OUT_OF_MEMORY; } tn->telnet_vars = beg; 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_raw_equal(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_raw_equal(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_raw_equal(option_keyword, "NEW_ENV")) { beg = curl_slist_append(tn->telnet_vars, option_arg); if(!beg) { result = CURLE_OUT_OF_MEMORY; break; } tn->telnet_vars = beg; tn->us_preferred[CURL_TELOPT_NEW_ENVIRON] = CURL_YES; continue; } /* Window Size */ if(Curl_raw_equal(option_keyword, "WS")) { if(sscanf(option_arg, "%hu%*[xX]%hu", &tn->subopt_wsx, &tn->subopt_wsy) == 2) tn->us_preferred[CURL_TELOPT_NAWS] = CURL_YES; else { failf(data, "Syntax error in telnet option: %s", head->data); result = CURLE_TELNET_OPTION_SYNTAX; break; } continue; } /* To take care or not of the 8th bit in data exchange */ if(Curl_raw_equal(option_keyword, "BINARY")) { binary_option=atoi(option_arg); if(binary_option!=1) { tn->us_preferred[CURL_TELOPT_BINARY] = CURL_NO; tn->him_preferred[CURL_TELOPT_BINARY] = CURL_NO; } continue; } failf(data, "Unknown telnet option %s", head->data); result = CURLE_UNKNOWN_TELNET_OPTION; break; } else { failf(data, "Syntax error in telnet option: %s", head->data); result = CURLE_TELNET_OPTION_SYNTAX; break; } } if(result) { curl_slist_free_all(tn->telnet_vars); tn->telnet_vars = NULL; } return result; } /* * 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->req.protop; 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 = 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 = 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 = SOCKERRNO; failf(data,"Sending data failed (%d)",err); } printsub(data, '>', &temp[2], len-2); break; } return; } /* * sendsuboption() * * Send suboption information to the server side. */ static void sendsuboption(struct connectdata *conn, int option) { ssize_t bytes_written; int err; unsigned short x, y; unsigned char*uc1, *uc2; struct SessionHandle *data = conn->data; struct TELNET *tn = (struct TELNET *)data->req.protop; switch (option) { case CURL_TELOPT_NAWS: /* We prepare data to be sent */ CURL_SB_CLEAR(tn); CURL_SB_ACCUM(tn, CURL_IAC); CURL_SB_ACCUM(tn, CURL_SB); CURL_SB_ACCUM(tn, CURL_TELOPT_NAWS); /* We must deal either with litte or big endien processors */ /* Window size must be sent according to the 'network order' */ x=htons(tn->subopt_wsx); y=htons(tn->subopt_wsy); uc1 = (unsigned char*)&x; uc2 = (unsigned char*)&y; CURL_SB_ACCUM(tn, uc1[0]); CURL_SB_ACCUM(tn, uc1[1]); CURL_SB_ACCUM(tn, uc2[0]); CURL_SB_ACCUM(tn, uc2[1]); CURL_SB_ACCUM(tn, CURL_IAC); CURL_SB_ACCUM(tn, CURL_SE); CURL_SB_TERM(tn); /* data suboption is now ready */ printsub(data, '>', (unsigned char *)tn->subbuffer+2, CURL_SB_LEN(tn)-2); /* we send the header of the suboption... */ bytes_written = swrite(conn->sock[FIRSTSOCKET], tn->subbuffer, 3); if(bytes_written < 0) { err = SOCKERRNO; failf(data, "Sending data failed (%d)", err); } /* ... then the window size with the send_telnet_data() function to deal with 0xFF cases ... */ send_telnet_data(conn, (char *)tn->subbuffer+3, 4); /* ... and the footer */ bytes_written = swrite(conn->sock[FIRSTSOCKET], tn->subbuffer+7, 2); if(bytes_written < 0) { err = SOCKERRNO; failf(data, "Sending data failed (%d)", err); } break; } } static CURLcode telrcv(struct connectdata *conn, const unsigned char *inbuf, /* Data received from socket */ ssize_t count) /* Number of bytes received */ { unsigned char c; CURLcode result; int in = 0; int startwrite=-1; struct SessionHandle *data = conn->data; struct TELNET *tn = (struct TELNET *)data->req.protop; #define startskipping() \ if(startwrite >= 0) { \ result = Curl_client_write(conn, \ CLIENTWRITE_BODY, \ (char *)&inbuf[startwrite], \ in-startwrite); \ if(result != CURLE_OK) \ return result; \ } \ startwrite = -1 #define writebyte() \ if(startwrite < 0) \ startwrite = in #define bufferflush() startskipping() while(count--) { c = inbuf[in]; switch (tn->telrcv_state) { case CURL_TS_CR: tn->telrcv_state = CURL_TS_DATA; if(c == '\0') { startskipping(); break; /* Ignore \0 after CR */ } writebyte(); break; case CURL_TS_DATA: if(c == CURL_IAC) { tn->telrcv_state = CURL_TS_IAC; startskipping(); break; } else if(c == '\r') tn->telrcv_state = CURL_TS_CR; writebyte(); break; case CURL_TS_IAC: process_iac: DEBUGASSERT(startwrite < 0); switch (c) { case CURL_WILL: tn->telrcv_state = CURL_TS_WILL; break; case CURL_WONT: tn->telrcv_state = CURL_TS_WONT; break; case CURL_DO: tn->telrcv_state = CURL_TS_DO; break; case CURL_DONT: tn->telrcv_state = CURL_TS_DONT; break; case CURL_SB: CURL_SB_CLEAR(tn); tn->telrcv_state = CURL_TS_SB; break; case CURL_IAC: tn->telrcv_state = CURL_TS_DATA; writebyte(); break; case CURL_DM: case CURL_NOP: case CURL_GA: default: tn->telrcv_state = CURL_TS_DATA; printoption(data, "RCVD", CURL_IAC, c); break; } break; case CURL_TS_WILL: printoption(data, "RCVD", CURL_WILL, c); tn->please_negotiate = 1; rec_will(conn, c); tn->telrcv_state = CURL_TS_DATA; break; case CURL_TS_WONT: printoption(data, "RCVD", CURL_WONT, c); tn->please_negotiate = 1; rec_wont(conn, c); tn->telrcv_state = CURL_TS_DATA; break; case CURL_TS_DO: printoption(data, "RCVD", CURL_DO, c); tn->please_negotiate = 1; rec_do(conn, c); tn->telrcv_state = CURL_TS_DATA; break; case CURL_TS_DONT: printoption(data, "RCVD", CURL_DONT, c); tn->please_negotiate = 1; rec_dont(conn, c); tn->telrcv_state = CURL_TS_DATA; break; case CURL_TS_SB: if(c == CURL_IAC) tn->telrcv_state = CURL_TS_SE; else CURL_SB_ACCUM(tn,c); break; 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 happened. 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; } ++in; } bufferflush(); return CURLE_OK; } /* Escape and send a telnet data block */ /* TODO: write large chunks of data instead of one byte at a time */ static CURLcode send_telnet_data(struct connectdata *conn, char *buffer, ssize_t nread) { unsigned char outbuf[2]; ssize_t bytes_written, total_written; int out_count; CURLcode rc = CURLE_OK; while(rc == CURLE_OK && nread--) { outbuf[0] = *buffer++; out_count = 1; if(outbuf[0] == CURL_IAC) outbuf[out_count++] = CURL_IAC; total_written = 0; do { /* Make sure socket is writable to avoid EWOULDBLOCK condition */ struct pollfd pfd[1]; pfd[0].fd = conn->sock[FIRSTSOCKET]; pfd[0].events = POLLOUT; switch (Curl_poll(pfd, 1, -1)) { case -1: /* error, abort writing */ case 0: /* timeout (will never happen) */ rc = CURLE_SEND_ERROR; break; default: /* write! */ bytes_written = 0; rc = Curl_write(conn, conn->sock[FIRSTSOCKET], outbuf+total_written, out_count-total_written, &bytes_written); total_written += bytes_written; break; } /* handle partial write */ } while(rc == CURLE_OK && total_written < out_count); } return rc; } static CURLcode telnet_done(struct connectdata *conn, CURLcode status, bool premature) { struct TELNET *tn = (struct TELNET *)conn->data->req.protop; (void)status; /* unused */ (void)premature; /* not used */ if(!tn) return CURLE_OK; curl_slist_free_all(tn->telnet_vars); tn->telnet_vars = NULL; Curl_safefree(conn->data->req.protop); return CURLE_OK; } static CURLcode telnet_do(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; int err; #else int interval_ms; struct pollfd pfd[2]; int poll_cnt; curl_off_t total_dl = 0; curl_off_t total_ul = 0; #endif ssize_t nread; struct timeval now; bool keepon = TRUE; char *buf = data->state.buffer; struct TELNET *tn; *done = TRUE; /* unconditionally */ code = init_telnet(conn); if(code) return code; tn = (struct TELNET *)data->req.protop; 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(TEXT("WS2_32.DLL")); if(wsock2 == NULL) { failf(data,"failed to load WS2_32.DLL (%d)", ERRNO); 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)", ERRNO); 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)", ERRNO); 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)", ERRNO); 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)", ERRNO); 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)", SOCKERRNO); FreeLibrary(wsock2); return CURLE_FAILED_INIT; } /* 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 CURLE_OK; } /* 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; /* 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 || data->set.is_fread_set) { /* 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 = 1000; } /* Keep on listening and act on events */ while(keepon) { waitret = WaitForMultipleObjects(obj_count, objs, FALSE, wait_timeout); switch(waitret) { case WAIT_TIMEOUT: { for(;;) { if(obj_count == 1) { /* read from user-supplied method */ code = (int)conn->fread_func(buf, 1, BUFSIZE - 1, conn->fread_in); if(code == CURL_READFUNC_ABORT) { keepon = FALSE; code = CURLE_READ_ERROR; break; } if(code == CURL_READFUNC_PAUSE) break; if(code == 0) /* no bytes */ break; readfile_read = code; /* fall thru with number of bytes read */ } else { /* read from stdin */ if(!PeekNamedPipe(stdin_handle, NULL, 0, NULL, &readfile_read, NULL)) { keepon = FALSE; code = CURLE_READ_ERROR; break; } if(!readfile_read) break; if(!ReadFile(stdin_handle, buf, sizeof(data->state.buffer), &readfile_read, NULL)) { keepon = FALSE; code = CURLE_READ_ERROR; break; } } code = send_telnet_data(conn, buf, readfile_read); if(code) { keepon = FALSE; break; } } } break; case WAIT_OBJECT_0 + 1: { if(!ReadFile(stdin_handle, buf, sizeof(data->state.buffer), &readfile_read, NULL)) { keepon = FALSE; code = CURLE_READ_ERROR; break; } code = send_telnet_data(conn, buf, readfile_read); if(code) { keepon = FALSE; break; } } break; case WAIT_OBJECT_0: if(SOCKET_ERROR == enum_netevents_func(sockfd, event_handle, &events)) { if((err = SOCKERRNO) != EINPROGRESS) { infof(data,"WSAEnumNetworkEvents failed (%d)", err); keepon = FALSE; code = CURLE_READ_ERROR; } break; } if(events.lNetworkEvents & FD_READ) { /* read data from network */ code = Curl_read(conn, sockfd, buf, BUFSIZE - 1, &nread); /* read would've blocked. Loop again */ if(code == CURLE_AGAIN) break; /* returned not-zero, this an error */ else if(code) { keepon = FALSE; break; } /* returned zero but actually received 0 or less here, the server closed the connection and we bail out */ else if(nread <= 0) { keepon = FALSE; break; } code = telrcv(conn, (unsigned char *)buf, nread); if(code) { keepon = FALSE; break; } /* 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; } if(data->set.timeout) { now = Curl_tvnow(); if(Curl_tvdiff(now, conn->created) >= data->set.timeout) { failf(data, "Time-out"); code = CURLE_OPERATION_TIMEDOUT; keepon = FALSE; } } } /* We called WSACreateEvent, so call WSACloseEvent */ if(!close_event_func(event_handle)) { infof(data,"WSACloseEvent failed (%d)", SOCKERRNO); } /* "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)", ERRNO); #else pfd[0].fd = sockfd; pfd[0].events = POLLIN; if(conn->fread_func != (curl_read_callback)fread) { poll_cnt = 1; interval_ms = 100; /* poll user-supplied read function */ } else { /* really using fread, so infile is a FILE* */ pfd[1].fd = fileno((FILE *)conn->fread_in); pfd[1].events = POLLIN; poll_cnt = 2; interval_ms = 1 * 1000; } while(keepon) { switch (Curl_poll(pfd, poll_cnt, interval_ms)) { case -1: /* error, stop reading */ keepon = FALSE; continue; case 0: /* timeout */ pfd[0].revents = 0; pfd[1].revents = 0; /* fall through */ default: /* read! */ if(pfd[0].revents & POLLIN) { /* read data from network */ code = Curl_read(conn, sockfd, buf, BUFSIZE - 1, &nread); /* read would've blocked. Loop again */ if(code == CURLE_AGAIN) break; /* returned not-zero, this an error */ else if(code) { keepon = FALSE; break; } /* returned zero but actually received 0 or less here, the server closed the connection and we bail out */ else if(nread <= 0) { keepon = FALSE; break; } total_dl += nread; Curl_pgrsSetDownloadCounter(data, total_dl); code = telrcv(conn, (unsigned char *)buf, nread); if(code) { keepon = FALSE; break; } /* 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; } } nread = 0; if(poll_cnt == 2) { if(pfd[1].revents & POLLIN) { /* read from in file */ nread = read(pfd[1].fd, buf, BUFSIZE - 1); } } else { /* read from user-supplied method */ nread = (int)conn->fread_func(buf, 1, BUFSIZE - 1, conn->fread_in); if(nread == CURL_READFUNC_ABORT) { keepon = FALSE; break; } if(nread == CURL_READFUNC_PAUSE) break; } if(nread > 0) { code = send_telnet_data(conn, buf, nread); if(code) { keepon = FALSE; break; } total_ul += nread; Curl_pgrsSetUploadCounter(data, total_ul); } else if(nread < 0) keepon = FALSE; break; } /* poll switch statement */ if(data->set.timeout) { now = Curl_tvnow(); if(Curl_tvdiff(now, conn->created) >= data->set.timeout) { failf(data, "Time-out"); code = CURLE_OPERATION_TIMEDOUT; keepon = FALSE; } } if(Curl_pgrsUpdate(conn)) { code = CURLE_ABORTED_BY_CALLBACK; break; } } #endif /* mark this as "no further transfer wanted" */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); return code; } #endif curl-7.35.0/lib/strdup.h0000644000175000017500000000227612213173003011733 00000000000000#ifndef HEADER_CURL_STRDUP_H #define HEADER_CURL_STRDUP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef HAVE_STRDUP extern char *curlx_strdup(const char *str); #endif #endif /* HEADER_CURL_STRDUP_H */ curl-7.35.0/lib/config-riscos.h0000644000175000017500000003320612213173003013154 00000000000000#ifndef HEADER_CURL_CONFIG_RISCOS_H #define HEADER_CURL_CONFIG_RISCOS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* ================================================================ */ /* Hand crafted config file for RISC OS */ /* ================================================================ */ /* 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 want the built-in manual */ #define USE_MANUAL /* 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 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 if struct sockaddr_in6 has the sin6_scope_id member */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 /* Define this to 'int' if ssize_t is not an available typedefed type */ #undef ssize_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 /* Define if you want to enable IPv6 support */ #undef ENABLE_IPV6 /* Define if you have the alarm function. */ #define HAVE_ALARM /* 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. */ #define HAVE_ERRNO_H /* 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 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 `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 header file. */ #define HAVE_SIGNAL_H /* Define if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T /* Define if sig_atomic_t is already defined as volatile. */ #undef HAVE_SIG_ATOMIC_T_VOLATILE /* 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 `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 `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* The size of `long double', as computed by sizeof. */ #undef SIZEOF_LONG_DOUBLE /* The size of `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG /* The size of `short', as computed by sizeof. */ #define SIZEOF_SHORT 2 /* The size of `size_t', as computed by sizeof. */ #define SIZEOF_SIZE_T 4 /* 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 /* Define to `int' if does not define. */ #undef ssize_t /* Define if you have the ioctl function. */ #define HAVE_IOCTL /* Define if you have a working ioctl FIONBIO function. */ #define HAVE_IOCTL_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 1 if you have the recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 int /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 void /* Define if the type pointed by arg 2 for recvfrom is void. */ #define RECVFROM_TYPE_ARG2_IS_VOID /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 size_t /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 int /* Define to the function return type for recvfrom. */ #define RECVFROM_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 #endif /* HEADER_CURL_CONFIG_RISCOS_H */ curl-7.35.0/lib/pingpong.c0000644000175000017500000003564712270035364012250 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * * 'pingpong' is for generic back-and-forth support functions used by FTP, * IMAP, POP3, SMTP and whatever more that likes them. * ***************************************************************************/ #include "curl_setup.h" #include "urldata.h" #include "sendf.h" #include "select.h" #include "progress.h" #include "speedcheck.h" #include "pingpong.h" #include "multiif.h" #include "non-ascii.h" #include "vtls/vtls.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" #ifdef USE_PINGPONG /* Returns timeout in ms. 0 or negative number means the timeout has already triggered */ long Curl_pp_state_timeout(struct pingpong *pp) { struct connectdata *conn = pp->conn; struct SessionHandle *data=conn->data; long timeout_ms; /* in milliseconds */ long timeout2_ms; /* in milliseconds */ long response_time= (data->set.server_response_timeout)? data->set.server_response_timeout: pp->response_time; /* if CURLOPT_SERVER_RESPONSE_TIMEOUT is set, use that to determine remaining time, or use pp->response because SERVER_RESPONSE_TIMEOUT is supposed to govern the response for any given server response, not for the time from connect to the given server response. */ /* Without a requested timeout, we only wait 'response_time' seconds for the full response to arrive before we bail out */ timeout_ms = response_time - Curl_tvdiff(Curl_tvnow(), pp->response); /* spent time */ if(data->set.timeout) { /* if timeout is requested, find out how much remaining time we have */ timeout2_ms = data->set.timeout - /* timeout time */ Curl_tvdiff(Curl_tvnow(), conn->now); /* spent time */ /* pick the lowest number */ timeout_ms = CURLMIN(timeout_ms, timeout2_ms); } return timeout_ms; } /* * Curl_pp_statemach() */ CURLcode Curl_pp_statemach(struct pingpong *pp, bool block) { struct connectdata *conn = pp->conn; curl_socket_t sock = conn->sock[FIRSTSOCKET]; int rc; long interval_ms; long timeout_ms = Curl_pp_state_timeout(pp); struct SessionHandle *data=conn->data; CURLcode result = CURLE_OK; if(timeout_ms <=0 ) { failf(data, "server response timeout"); return CURLE_OPERATION_TIMEDOUT; /* already too little time */ } if(block) { interval_ms = 1000; /* use 1 second timeout intervals */ if(timeout_ms < interval_ms) interval_ms = timeout_ms; } else interval_ms = 0; /* immediate */ if(Curl_pp_moredata(pp)) /* We are receiving and there is data in the cache so just read it */ rc = 1; else if(!pp->sendleft && Curl_ssl_data_pending(conn, FIRSTSOCKET)) /* We are receiving and there is data ready in the SSL library */ rc = 1; else rc = Curl_socket_ready(pp->sendleft?CURL_SOCKET_BAD:sock, /* reading */ pp->sendleft?sock:CURL_SOCKET_BAD, /* writing */ interval_ms); if(block) { /* if we didn't wait, we don't have to spend time on this now */ if(Curl_pgrsUpdate(conn)) result = CURLE_ABORTED_BY_CALLBACK; else result = Curl_speedcheck(data, Curl_tvnow()); if(result) return result; } if(rc == -1) { failf(data, "select/poll error"); result = CURLE_OUT_OF_MEMORY; } else if(rc) result = pp->statemach_act(conn); return result; } /* initialize stuff to prepare for reading a fresh new response */ void Curl_pp_init(struct pingpong *pp) { struct connectdata *conn = pp->conn; pp->nread_resp = 0; pp->linestart_resp = conn->data->state.buffer; pp->pending_resp = TRUE; pp->response = Curl_tvnow(); /* start response time-out now! */ } /*********************************************************************** * * Curl_pp_vsendf() * * Send the formated string as a command to a pingpong server. Note that * the string should not have any CRLF appended, as this function will * append the necessary things itself. * * made to never block */ CURLcode Curl_pp_vsendf(struct pingpong *pp, const char *fmt, va_list args) { ssize_t bytes_written; size_t write_len; char *fmt_crlf; char *s; CURLcode error; struct connectdata *conn = pp->conn; struct SessionHandle *data = conn->data; #ifdef HAVE_GSSAPI enum protection_level data_sec = conn->data_prot; #endif DEBUGASSERT(pp->sendleft == 0); DEBUGASSERT(pp->sendsize == 0); DEBUGASSERT(pp->sendthis == NULL); fmt_crlf = aprintf("%s\r\n", fmt); /* append a trailing CRLF */ if(!fmt_crlf) return CURLE_OUT_OF_MEMORY; s = vaprintf(fmt_crlf, args); /* trailing CRLF appended */ free(fmt_crlf); if(!s) return CURLE_OUT_OF_MEMORY; bytes_written = 0; write_len = strlen(s); Curl_pp_init(pp); error = Curl_convert_to_network(data, s, write_len); /* Curl_convert_to_network calls failf if unsuccessful */ if(error) { free(s); return error; } #ifdef HAVE_GSSAPI conn->data_prot = PROT_CMD; #endif error = Curl_write(conn, conn->sock[FIRSTSOCKET], s, write_len, &bytes_written); #ifdef HAVE_GSSAPI DEBUGASSERT(data_sec > PROT_NONE && data_sec < PROT_LAST); conn->data_prot = data_sec; #endif if(error) { free(s); return error; } if(conn->data->set.verbose) Curl_debug(conn->data, CURLINFO_HEADER_OUT, s, (size_t)bytes_written, conn); if(bytes_written != (ssize_t)write_len) { /* the whole chunk was not sent, keep it around and adjust sizes */ pp->sendthis = s; pp->sendsize = write_len; pp->sendleft = write_len - bytes_written; } else { free(s); pp->sendthis = NULL; pp->sendleft = pp->sendsize = 0; pp->response = Curl_tvnow(); } return CURLE_OK; } /*********************************************************************** * * Curl_pp_sendf() * * Send the formated string as a command to a pingpong server. Note that * the string should not have any CRLF appended, as this function will * append the necessary things itself. * * made to never block */ CURLcode Curl_pp_sendf(struct pingpong *pp, const char *fmt, ...) { CURLcode res; va_list ap; va_start(ap, fmt); res = Curl_pp_vsendf(pp, fmt, ap); va_end(ap); return res; } /* * Curl_pp_readresp() * * Reads a piece of a server response. */ CURLcode Curl_pp_readresp(curl_socket_t sockfd, struct pingpong *pp, int *code, /* return the server code if done */ size_t *size) /* size of the response */ { ssize_t perline; /* count bytes per line */ bool keepon=TRUE; ssize_t gotbytes; char *ptr; struct connectdata *conn = pp->conn; struct SessionHandle *data = conn->data; char * const buf = data->state.buffer; CURLcode result = CURLE_OK; *code = 0; /* 0 for errors or not done */ *size = 0; ptr=buf + pp->nread_resp; /* number of bytes in the current line, so far */ perline = (ssize_t)(ptr-pp->linestart_resp); keepon=TRUE; while((pp->nread_respcache) { /* we had data in the "cache", copy that instead of doing an actual * read * * pp->cache_size is cast to ssize_t 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. */ DEBUGASSERT((ptr+pp->cache_size) <= (buf+BUFSIZE+1)); memcpy(ptr, pp->cache, pp->cache_size); gotbytes = (ssize_t)pp->cache_size; free(pp->cache); /* free the cache */ pp->cache = NULL; /* clear the pointer */ pp->cache_size = 0; /* zero the size just in case */ } else { int res; #ifdef HAVE_GSSAPI enum protection_level prot = conn->data_prot; conn->data_prot = PROT_CLEAR; #endif DEBUGASSERT((ptr+BUFSIZE-pp->nread_resp) <= (buf+BUFSIZE+1)); res = Curl_read(conn, sockfd, ptr, BUFSIZE-pp->nread_resp, &gotbytes); #ifdef HAVE_GSSAPI DEBUGASSERT(prot > PROT_NONE && prot < PROT_LAST); conn->data_prot = prot; #endif if(res == CURLE_AGAIN) return CURLE_OK; /* return */ if((res == CURLE_OK) && (gotbytes > 0)) /* convert from the network encoding */ res = Curl_convert_from_network(data, ptr, gotbytes); /* Curl_convert_from_network calls failf if unsuccessful */ if(CURLE_OK != res) { result = (CURLcode)res; /* Set outer result variable to this error. */ keepon = FALSE; } } if(!keepon) ; else if(gotbytes <= 0) { keepon = FALSE; result = CURLE_RECV_ERROR; failf(data, "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 */ ssize_t i; ssize_t clipamount = 0; bool restart = FALSE; data->req.headerbytecount += (long)gotbytes; pp->nread_resp += gotbytes; for(i = 0; i < gotbytes; ptr++, i++) { perline++; if(*ptr=='\n') { /* a newline is CRLF in pp-talk, so the CR is ignored as the line isn't really terminated until the LF comes */ /* output debug output if that is requested */ #ifdef HAVE_GSSAPI if(!conn->sec_complete) #endif if(data->set.verbose) Curl_debug(data, CURLINFO_HEADER_IN, pp->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, pp->linestart_resp, perline); if(result) return result; if(pp->endofresp(conn, pp->linestart_resp, perline, code)) { /* 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 */ size_t n = ptr - pp->linestart_resp; memmove(buf, pp->linestart_resp, n); buf[n]=0; /* zero terminate */ keepon=FALSE; pp->linestart_resp = ptr+1; /* advance pointer */ i++; /* skip this before getting out */ *size = pp->nread_resp; /* size of the response */ pp->nread_resp = 0; /* restart */ break; } perline=0; /* line starts over here */ pp->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! */ clipamount = gotbytes - i; restart = TRUE; DEBUGF(infof(data, "Curl_pp_readresp_ %d bytes of trailing " "server response left\n", (int)clipamount)); } else if(keepon) { if((perline == gotbytes) && (gotbytes > BUFSIZE/2)) { /* We got an excessive line without newlines and we need to deal with it. We keep the first bytes of the line then we throw away the rest. */ infof(data, "Excessive server response line length received, " "%zd bytes. Stripping\n", gotbytes); restart = TRUE; /* we keep 40 bytes since all our pingpong protocols are only interested in the first piece */ clipamount = 40; } else if(pp->nread_resp > BUFSIZE/2) { /* We got a large chunk of data and there's potentially still trailing data to take care of, so we put any such part in the "cache", clear the buffer to make space and restart. */ clipamount = perline; restart = TRUE; } } else if(i == gotbytes) restart = TRUE; if(clipamount) { pp->cache_size = clipamount; pp->cache = malloc(pp->cache_size); if(pp->cache) memcpy(pp->cache, pp->linestart_resp, pp->cache_size); else return CURLE_OUT_OF_MEMORY; } if(restart) { /* now reset a few variables to start over nicely from the start of the big buffer */ pp->nread_resp = 0; /* start over from scratch in the buffer */ ptr = pp->linestart_resp = buf; perline = 0; } } /* there was data */ } /* while there's buffer left and loop is requested */ pp->pending_resp = FALSE; return result; } int Curl_pp_getsock(struct pingpong *pp, curl_socket_t *socks, int numsocks) { struct connectdata *conn = pp->conn; if(!numsocks) return GETSOCK_BLANK; socks[0] = conn->sock[FIRSTSOCKET]; if(pp->sendleft) { /* write mode */ return GETSOCK_WRITESOCK(0); } /* read mode */ return GETSOCK_READSOCK(0); } CURLcode Curl_pp_flushsend(struct pingpong *pp) { /* we have a piece of a command still left to send */ struct connectdata *conn = pp->conn; ssize_t written; CURLcode result = CURLE_OK; curl_socket_t sock = conn->sock[FIRSTSOCKET]; result = Curl_write(conn, sock, pp->sendthis + pp->sendsize - pp->sendleft, pp->sendleft, &written); if(result) return result; if(written != (ssize_t)pp->sendleft) { /* only a fraction was sent */ pp->sendleft -= written; } else { free(pp->sendthis); pp->sendthis=NULL; pp->sendleft = pp->sendsize = 0; pp->response = Curl_tvnow(); } return CURLE_OK; } CURLcode Curl_pp_disconnect(struct pingpong *pp) { if(pp->cache) { free(pp->cache); pp->cache = NULL; } return CURLE_OK; } bool Curl_pp_moredata(struct pingpong *pp) { return (!pp->sendleft && pp->cache && pp->nread_resp < pp->cache_size) ? TRUE : FALSE; } #endif curl-7.35.0/lib/Makefile.vc90000644000175000017500000005230512272124477012417 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1999 - 2014, 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. # #*************************************************************************** # All files in the Makefile.vc* series are generated automatically from the # one made for MSVC version 6. Alas, if you want to do changes to any of the # files and send back to the project, edit the version six, make your diff and # mail curl-library. ########################################################################### # # Makefile for building libcurl with MSVC9 # # 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. # ############################################################## # ---------------------------------------------- # Verify that current subdir is libcurl's 'lib' # ---------------------------------------------- !IF ! EXIST(.\curl_addrinfo.c) ! MESSAGE Can not process this makefile from outside of libcurl's 'lib' subdirectory. ! MESSAGE Change to libcurl's 'lib' subdirectory, and try again. ! ERROR See previous message. !ENDIF # ------------------------------------------------ # Makefile.msvc.names provides libcurl file names # ------------------------------------------------ !INCLUDE ..\winbuild\Makefile.msvc.names !IFNDEF OPENSSL_PATH OPENSSL_PATH = ../../openssl-0.9.8y !ENDIF !IFNDEF LIBSSH2_PATH LIBSSH2_PATH = ../../libssh2-1.4.3 !ENDIF !IFNDEF ZLIB_PATH ZLIB_PATH = ../../zlib-1.2.8 !ENDIF !IFNDEF MACHINE MACHINE = X86 !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". Since at least with MSVC9 the sspi.h # header is broken it is either required to install the Windows SDK, # or to fix sspi.h with adding this define at the beginning of sspi.h: # #define FreeCredentialHandle FreeCredentialsHandle # # 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/ # WINDOWS_SSPI = 1 !IFDEF WINDOWS_SSPI !IFNDEF WINDOWS_SDK_PATH WINDOWS_SDK_PATH = "$(PROGRAMFILES)\Microsoft SDK" !ENDIF !ENDIF ############################################################# ## Nothing more to do below this line! CCNODBG = cl.exe /O2 /DNDEBUG CCDEBUG = cl.exe /Od /Gm /Zi /D_DEBUG /RTC1 CFLAGSSSL = /DUSE_SSLEAY /DUSE_OPENSSL /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl" CFLAGSWINSSL = /DUSE_SCHANNEL CFLAGSSSH2 = /DUSE_LIBSSH2 /DCURL_DISABLE_LDAP /DHAVE_LIBSSH2 /DHAVE_LIBSSH2_H /DLIBSSH2_WIN32 /DLIBSSH2_LIBRARY /I "$(LIBSSH2_PATH)/include" CFLAGSZLIB = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I "$(ZLIB_PATH)" CFLAGS = /I. /I../include /nologo /W3 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL /D_BIND_TO_CURRENT_VCLIBS_VERSION=1 CFLAGSLIB = /DCURL_STATICLIB LNKDLL = link.exe /DLL LNKLIB = link.exe /lib LFLAGS = /nologo /machine:$(MACHINE) SSLLIBS = libeay32.lib ssleay32.lib ZLIBLIBSDLL = zdll.lib ZLIBLIBS = zlib.lib WINLIBS = ws2_32.lib wldap32.lib advapi32.lib CFLAGS = $(CFLAGS) CFGSET = FALSE !IFDEF WINDOWS_SSPI CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include !ENDIF !IFDEF USE_IPV6 CFLAGS = $(CFLAGS) /DUSE_IPV6 !ENDIF ############################################################## # Runtime library configuration RTLIB = /MD RTLIBD = /MDd !IF "$(RTLIBCFG)" == "static" RTLIB = /MT RTLIBD = /MTd !ENDIF ###################### # release !IF "$(CFG)" == "release" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl !IF "$(CFG)" == "release-ssl" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-winssl !IF "$(CFG)" == "release-winssl" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSWINSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-zlib !IF "$(CFG)" == "release-zlib" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl-zlib !IF "$(CFG)" == "release-ssl-zlib" TARGET = $(LIBCURL_STA_LIB_REL) 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-winssl-zlib !IF "$(CFG)" == "release-winssl-zlib" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSWINSSL) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl-ssh2-zlib !IF "$(CFG)" == "release-ssl-ssh2-zlib" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" LFLAGSSSH2 = "/LIBPATH:$(LIBSSH2_PATH)" LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(LFLAGSSSL) $(LFLAGSSSH2) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSSSH2) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-ssl-dll !IF "$(CFG)" == "release-ssl-dll" TARGET = $(LIBCURL_STA_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # release-zlib-dll !IF "$(CFG)" == "release-zlib-dll" TARGET = $(LIBCURL_STA_LIB_REL) 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 = $(LIBCURL_STA_LIB_REL) 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 !IF "$(CFG)" == "release-dll" TARGET = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LNK = $(LNKDLL) $(WINLIBS) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) CC = $(CCNODBG) $(RTLIB) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # release-dll-ssl-dll !IF "$(CFG)" == "release-dll-ssl-dll" TARGET = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # release-dll-zlib-dll !IF "$(CFG)" == "release-dll-zlib-dll" TARGET = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKDLL) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) 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 = $(LIBCURL_DYN_LIB_REL) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSZLIB) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # debug !IF "$(CFG)" == "debug" TARGET = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-ssl !IF "$(CFG)" == "debug-ssl" TARGET = $(LIBCURL_STA_LIB_DBG) 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 = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-ssl-zlib !IF "$(CFG)" == "debug-ssl-zlib" TARGET = $(LIBCURL_STA_LIB_DBG) 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-ssl-ssh2-zlib !IF "$(CFG)" == "debug-ssl-ssh2-zlib" TARGET = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LFLAGSSSH2 = "/LIBPATH:$(LIBSSH2_PATH)" LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32" LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSSSL) $(LFLAGSSSH2) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSSSH2) $(CFLAGSZLIB) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-ssl-dll !IF "$(CFG)" == "debug-ssl-dll" TARGET = $(LIBCURL_STA_LIB_DBG) DIROBJ = $(CFG) LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)\out32dll LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSLIB) CFGSET = TRUE !ENDIF ###################### # debug-zlib-dll !IF "$(CFG)" == "debug-zlib-dll" TARGET = $(LIBCURL_STA_LIB_DBG) 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 = $(LIBCURL_STA_LIB_DBG) 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 = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LNK = $(LNKDLL) $(WINLIBS) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_PDB) CC = $(CCDEBUG) $(RTLIBD) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # debug-dll-ssl-dll !IF "$(CFG)" == "debug-dll-ssl-dll" TARGET = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_PDB) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ###################### # debug-dll-zlib-dll !IF "$(CFG)" == "debug-dll-zlib-dll" TARGET = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LNK = $(LNKDLL) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_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 = $(LIBCURL_DYN_LIB_DBG) DIROBJ = $(CFG) LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_PDB) CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSZLIB) CFGSET = TRUE RESOURCE = $(DIROBJ)\libcurl.res !ENDIF ####################### # Usage # !IF "$(CFGSET)" == "FALSE" && "$(CFG)" != "" !MESSAGE Usage: nmake /f makefile.vc9 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-ssh2-zlib - release static library with ssl, ssh2 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-ssh2-zlib - debug static library with ssl, ssh2 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)\amigaos.obj \ $(DIROBJ)\asyn-ares.obj \ $(DIROBJ)\asyn-thread.obj \ $(DIROBJ)\axtls.obj \ $(DIROBJ)\base64.obj \ $(DIROBJ)\bundles.obj \ $(DIROBJ)\conncache.obj \ $(DIROBJ)\connect.obj \ $(DIROBJ)\content_encoding.obj \ $(DIROBJ)\cookie.obj \ $(DIROBJ)\curl_addrinfo.obj \ $(DIROBJ)\curl_darwinssl.obj \ $(DIROBJ)\curl_fnmatch.obj \ $(DIROBJ)\curl_gethostname.obj \ $(DIROBJ)\curl_gssapi.obj \ $(DIROBJ)\curl_memrchr.obj \ $(DIROBJ)\curl_multibyte.obj \ $(DIROBJ)\curl_ntlm.obj \ $(DIROBJ)\curl_ntlm_core.obj \ $(DIROBJ)\curl_ntlm_msgs.obj \ $(DIROBJ)\curl_ntlm_wb.obj \ $(DIROBJ)\curl_rtmp.obj \ $(DIROBJ)\curl_sasl.obj \ $(DIROBJ)\curl_schannel.obj \ $(DIROBJ)\curl_sspi.obj \ $(DIROBJ)\curl_threads.obj \ $(DIROBJ)\cyassl.obj \ $(DIROBJ)\dict.obj \ $(DIROBJ)\dotdot.obj \ $(DIROBJ)\easy.obj \ $(DIROBJ)\escape.obj \ $(DIROBJ)\file.obj \ $(DIROBJ)\fileinfo.obj \ $(DIROBJ)\formdata.obj \ $(DIROBJ)\ftp.obj \ $(DIROBJ)\ftplistparser.obj \ $(DIROBJ)\getenv.obj \ $(DIROBJ)\getinfo.obj \ $(DIROBJ)\gopher.obj \ $(DIROBJ)\gtls.obj \ $(DIROBJ)\hash.obj \ $(DIROBJ)\hmac.obj \ $(DIROBJ)\hostasyn.obj \ $(DIROBJ)\hostcheck.obj \ $(DIROBJ)\hostip.obj \ $(DIROBJ)\hostip4.obj \ $(DIROBJ)\hostip6.obj \ $(DIROBJ)\hostsyn.obj \ $(DIROBJ)\http.obj \ $(DIROBJ)\http_chunks.obj \ $(DIROBJ)\http_digest.obj \ $(DIROBJ)\http_negotiate.obj \ $(DIROBJ)\http_negotiate_sspi.obj \ $(DIROBJ)\http_proxy.obj \ $(DIROBJ)\idn_win32.obj \ $(DIROBJ)\if2ip.obj \ $(DIROBJ)\imap.obj \ $(DIROBJ)\inet_ntop.obj \ $(DIROBJ)\inet_pton.obj \ $(DIROBJ)\krb5.obj \ $(DIROBJ)\ldap.obj \ $(DIROBJ)\llist.obj \ $(DIROBJ)\md4.obj \ $(DIROBJ)\md5.obj \ $(DIROBJ)\memdebug.obj \ $(DIROBJ)\mprintf.obj \ $(DIROBJ)\multi.obj \ $(DIROBJ)\netrc.obj \ $(DIROBJ)\non-ascii.obj \ $(DIROBJ)\nonblock.obj \ $(DIROBJ)\nss.obj \ $(DIROBJ)\openldap.obj \ $(DIROBJ)\parsedate.obj \ $(DIROBJ)\pingpong.obj \ $(DIROBJ)\pipeline.obj \ $(DIROBJ)\polarssl.obj \ $(DIROBJ)\polarssl_threadlock.obj \ $(DIROBJ)\pop3.obj \ $(DIROBJ)\progress.obj \ $(DIROBJ)\qssl.obj \ $(DIROBJ)\rawstr.obj \ $(DIROBJ)\rtsp.obj \ $(DIROBJ)\security.obj \ $(DIROBJ)\select.obj \ $(DIROBJ)\sendf.obj \ $(DIROBJ)\share.obj \ $(DIROBJ)\slist.obj \ $(DIROBJ)\smtp.obj \ $(DIROBJ)\socks.obj \ $(DIROBJ)\socks_gssapi.obj \ $(DIROBJ)\socks_sspi.obj \ $(DIROBJ)\speedcheck.obj \ $(DIROBJ)\splay.obj \ $(DIROBJ)\ssh.obj \ $(DIROBJ)\vtls.obj \ $(DIROBJ)\openssl.obj \ $(DIROBJ)\strdup.obj \ $(DIROBJ)\strequal.obj \ $(DIROBJ)\strerror.obj \ $(DIROBJ)\strtok.obj \ $(DIROBJ)\strtoofft.obj \ $(DIROBJ)\telnet.obj \ $(DIROBJ)\tftp.obj \ $(DIROBJ)\timeval.obj \ $(DIROBJ)\transfer.obj \ $(DIROBJ)\url.obj \ $(DIROBJ)\version.obj \ $(DIROBJ)\warnless.obj \ $(DIROBJ)\wildcard.obj \ $(RESOURCE) all : $(TARGET) $(TARGET): $(X_OBJS) $(LNK) $(LFLAGS) $(X_OBJS) -xcopy $(DIROBJ)\$(LIBCURL_STA_LIB_REL) . /y -xcopy $(DIROBJ)\$(LIBCURL_STA_LIB_DBG) . /y -xcopy $(DIROBJ)\$(LIBCURL_DYN_LIB_REL) . /y -xcopy $(DIROBJ)\$(LIBCURL_DYN_LIB_DBG) . /y -xcopy $(DIROBJ)\$(LIBCURL_IMP_LIB_REL) . /y -xcopy $(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) . /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"$@" $< {.\vtls\}.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 /dDEBUGBUILD=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 /dDEBUGBUILD=0 /Fo $@ libcurl.rc !ENDIF # End of case where a config was provided. curl-7.35.0/lib/http_negotiate_sspi.c0000644000175000017500000002120312262353672014470 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_WINDOWS_SSPI #ifndef CURL_DISABLE_HTTP #include "urldata.h" #include "sendf.h" #include "rawstr.h" #include "warnless.h" #include "curl_base64.h" #include "http_negotiate.h" #include "curl_memory.h" #include "curl_multibyte.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, bool proxy, struct negotiatedata *neg_ctx) { const char* service; size_t length; if(proxy && !conn->proxy.name) /* proxy auth requested but no given proxy name, error out! */ return -1; /* 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, and SSPI then generates an NTLM token. When using / a Kerberos token is generated. */ if(neg_ctx->gss) service = "KHTTP"; else service = "HTTP"; length = strlen(service) + 1 + strlen(proxy ? conn->proxy.name : conn->host.name) + 1; if(length + 1 > sizeof(neg_ctx->server_name)) return EMSGSIZE; snprintf(neg_ctx->server_name, sizeof(neg_ctx->server_name), "%s/%s", service, proxy ? conn->proxy.name : conn->host.name); return 0; } /* returning zero (0) means success, everything else is treated as "failure" with no care exactly what the failure was */ int Curl_input_negotiate(struct connectdata *conn, bool proxy, const char *header) { struct negotiatedata *neg_ctx = proxy?&conn->data->state.proxyneg: &conn->data->state.negotiate; BYTE *input_token = 0; SecBufferDesc out_buff_desc; SecBuffer out_sec_buff; SecBufferDesc in_buff_desc; SecBuffer in_sec_buff; unsigned long context_attributes; TimeStamp lifetime; TCHAR *sname; int ret; size_t len = 0, input_token_len = 0; bool gss = FALSE; const char* protocol; CURLcode error; 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 == SEC_E_OK) { /* We finished successfully 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(0 == strlen(neg_ctx->server_name)) { ret = get_gss_name(conn, proxy, neg_ctx); if(ret) return ret; } if(!neg_ctx->output_token) { PSecPkgInfo SecurityPackage; ret = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT("Negotiate"), &SecurityPackage); if(ret != SEC_E_OK) return -1; /* Allocate input and output buffers according to the max token size as indicated by the security package */ neg_ctx->max_token_length = SecurityPackage->cbMaxToken; neg_ctx->output_token = malloc(neg_ctx->max_token_length); s_pSecFn->FreeContextBuffer(SecurityPackage); } /* Obtain the input token, if any */ header += strlen(neg_ctx->protocol); while(*header && ISSPACE(*header)) header++; len = strlen(header); if(!len) { /* first call in a new negotation, we have to acquire credentials, and allocate memory for the context */ neg_ctx->credentials = malloc(sizeof(CredHandle)); neg_ctx->context = malloc(sizeof(CtxtHandle)); if(!neg_ctx->credentials || !neg_ctx->context) return -1; neg_ctx->status = s_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR *) TEXT("Negotiate"), SECPKG_CRED_OUTBOUND, NULL, NULL, NULL, NULL, neg_ctx->credentials, &lifetime); if(neg_ctx->status != SEC_E_OK) return -1; } else { input_token = malloc(neg_ctx->max_token_length); if(!input_token) return -1; error = Curl_base64_decode(header, (unsigned char **)&input_token, &input_token_len); if(error || input_token_len == 0) return -1; } /* prepare the output buffers, and input buffers if present */ out_buff_desc.ulVersion = 0; out_buff_desc.cBuffers = 1; out_buff_desc.pBuffers = &out_sec_buff; out_sec_buff.cbBuffer = curlx_uztoul(neg_ctx->max_token_length); out_sec_buff.BufferType = SECBUFFER_TOKEN; out_sec_buff.pvBuffer = neg_ctx->output_token; if(input_token) { in_buff_desc.ulVersion = 0; in_buff_desc.cBuffers = 1; in_buff_desc.pBuffers = &in_sec_buff; in_sec_buff.cbBuffer = curlx_uztoul(input_token_len); in_sec_buff.BufferType = SECBUFFER_TOKEN; in_sec_buff.pvBuffer = input_token; } sname = Curl_convert_UTF8_to_tchar(neg_ctx->server_name); if(!sname) return CURLE_OUT_OF_MEMORY; neg_ctx->status = s_pSecFn->InitializeSecurityContext( neg_ctx->credentials, input_token ? neg_ctx->context : 0, sname, ISC_REQ_CONFIDENTIALITY, 0, SECURITY_NATIVE_DREP, input_token ? &in_buff_desc : 0, 0, neg_ctx->context, &out_buff_desc, &context_attributes, &lifetime); Curl_unicodefree(sname); if(GSS_ERROR(neg_ctx->status)) return -1; if(neg_ctx->status == SEC_I_COMPLETE_NEEDED || neg_ctx->status == SEC_I_COMPLETE_AND_CONTINUE) { neg_ctx->status = s_pSecFn->CompleteAuthToken(neg_ctx->context, &out_buff_desc); if(GSS_ERROR(neg_ctx->status)) return -1; } neg_ctx->output_token_length = out_sec_buff.cbBuffer; return 0; } CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy) { struct negotiatedata *neg_ctx = proxy?&conn->data->state.proxyneg: &conn->data->state.negotiate; char *encoded = NULL; size_t len = 0; char *userp; CURLcode error; error = Curl_base64_encode(conn->data, (const char*)neg_ctx->output_token, neg_ctx->output_token_length, &encoded, &len); if(error) return error; if(len == 0) return CURLE_REMOTE_ACCESS_DENIED; userp = aprintf("%sAuthorization: %s %s\r\n", proxy ? "Proxy-" : "", neg_ctx->protocol, encoded); if(proxy) conn->allocptr.proxyuserpwd = userp; else conn->allocptr.userpwd = userp; free(encoded); Curl_cleanup_negotiate (conn->data); return (userp == NULL) ? CURLE_OUT_OF_MEMORY : CURLE_OK; } static void cleanup(struct negotiatedata *neg_ctx) { if(neg_ctx->context) { s_pSecFn->DeleteSecurityContext(neg_ctx->context); free(neg_ctx->context); neg_ctx->context = 0; } if(neg_ctx->credentials) { s_pSecFn->FreeCredentialsHandle(neg_ctx->credentials); free(neg_ctx->credentials); neg_ctx->credentials = 0; } if(neg_ctx->output_token) { free(neg_ctx->output_token); neg_ctx->output_token = 0; } neg_ctx->max_token_length = 0; } void Curl_cleanup_negotiate(struct SessionHandle *data) { cleanup(&data->state.negotiate); cleanup(&data->state.proxyneg); } #endif #endif curl-7.35.0/lib/Makefile.netware0000644000175000017500000005567312270035364013370 00000000000000################################################################# # ## Makefile for building libcurl.nlm (NetWare version - gnu make) ## Use: make -f Makefile.netware ## ## Comments to: Guenter Knauf http://www.gknw.net/phpbb # ################################################################# # Edit the path below to point to the base of your Novell NDK. ifndef NDKBASE NDKBASE = c:/novell endif # Edit the path below to point to the base of your Zlib sources. ifndef ZLIB_PATH ZLIB_PATH = ../../zlib-1.2.8 endif # Edit the path below to point to the base of your OpenSSL package. ifndef OPENSSL_PATH OPENSSL_PATH = ../../openssl-0.9.8y endif # Edit the path below to point to the base of your LibSSH2 package. ifndef LIBSSH2_PATH LIBSSH2_PATH = ../../libssh2-1.4.3 endif # Edit the path below to point to the base of your axTLS package. ifndef AXTLS_PATH AXTLS_PATH = ../../axTLS-1.2.7 endif # Edit the path below to point to the base of your libidn package. ifndef LIBIDN_PATH LIBIDN_PATH = ../../libidn-1.18 endif # Edit the path below to point to the base of your librtmp package. ifndef LIBRTMP_PATH LIBRTMP_PATH = ../../librtmp-2.3 endif # Edit the path below to point to the base of your fbopenssl package. ifndef FBOPENSSL_PATH FBOPENSSL_PATH = ../../fbopenssl-0.4 endif # Edit the path below to point to the base of your c-ares package. ifndef LIBCARES_PATH LIBCARES_PATH = ../ares endif ifndef INSTDIR INSTDIR = ..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw endif # Edit the vars below to change NLM target settings. TARGET = libcurl VERSION = $(LIBCURL_VERSION) COPYR = Copyright (C) $(LIBCURL_COPYRIGHT_STR) DESCR = cURL libcurl $(LIBCURL_VERSION_STR) ($(LIBARCH)) - http://curl.haxx.se MTSAFE = YES STACK = 64000 SCREEN = none EXPORTF = $(TARGET).imp EXPORTS = @$(EXPORTF) # Uncomment the next line to enable linking with POSIX semantics. # POSIXFL = 1 # Edit the var below to point to your lib architecture. ifndef LIBARCH LIBARCH = LIBC endif # must be equal to NDEBUG or DEBUG, CURLDEBUG ifndef DB DB = NDEBUG endif # Optimization: -O or debugging: -g ifeq ($(DB),NDEBUG) OPT = -O2 OBJDIR = release else OPT = -g OBJDIR = debug endif # The following lines defines your compiler. ifdef CWFolder METROWERKS = $(CWFolder) endif ifdef METROWERKS # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support CC = mwccnlm else CC = gcc endif PERL = perl # Here you can find a native Win32 binary of the original awk: # http://www.gknw.net/development/prgtools/awk-20100523.zip AWK = awk CP = cp -afv MKDIR = mkdir # RM = rm -f # If you want to mark the target as MTSAFE you will need a tool for # generating the xdc data for the linker; here's a minimal tool: # http://www.gknw.net/development/prgtools/mkxdc.zip MPKXDC = mkxdc # LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH)) LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH)) # Include the version info retrieved from curlver.h -include $(OBJDIR)/version.inc # Global flags for all compilers CFLAGS += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc ifeq ($(CC),mwccnlm) LD = mwldnlm LDFLAGS = -nostdlib $(PRELUDE) $(OBJL) -o $@ -commandfile AR = mwldnlm ARFLAGS = -nostdlib -type library -o LIBEXT = lib #RANLIB = CFLAGS += -msgstyle gcc -gccinc -inline off -opt nointrinsics -proc 586 CFLAGS += -relax_pointers #CFLAGS += -w on ifeq ($(LIBARCH),LIBC) ifeq ($(POSIXFL),1) PRELUDE = $(NDK_LIBC)/imports/posixpre.o else PRELUDE = $(NDK_LIBC)/imports/libcpre.o endif CFLAGS += -align 4 else # PRELUDE = $(NDK_CLIB)/imports/clibpre.o # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj" # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h" CFLAGS += -align 1 endif else LD = nlmconv LDFLAGS = -T AR = ar ARFLAGS = -cq LIBEXT = a RANLIB = ranlib CFLAGS += -m32 CFLAGS += -fno-builtin -fno-strict-aliasing ifeq ($(findstring gcc,$(CC)),gcc) CFLAGS += -fpcc-struct-return endif CFLAGS += -Wall # -pedantic ifeq ($(LIBARCH),LIBC) ifeq ($(POSIXFL),1) PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o else PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o endif else PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK # http://www.gknw.net/development/mk_nlm/gcc_pre.zip # PRELUDE = $(NDK_ROOT)/pre/prelude.o CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h endif endif NDK_ROOT = $(NDKBASE)/ndk ifndef NDK_CLIB NDK_CLIB = $(NDK_ROOT)/nwsdk endif ifndef NDK_LIBC NDK_LIBC = $(NDK_ROOT)/libc endif ifndef NDK_LDAP NDK_LDAP = $(NDK_ROOT)/cldapsdk/netware endif CURL_INC = ../include CURL_LIB = ../lib INCLUDES = -I$(CURL_INC) -I$(CURL_LIB) ifeq ($(findstring -static,$(CFG)),-static) LINK_STATIC = 1 endif ifeq ($(findstring -ares,$(CFG)),-ares) WITH_ARES = 1 endif ifeq ($(findstring -rtmp,$(CFG)),-rtmp) WITH_RTMP = 1 WITH_SSL = 1 WITH_ZLIB = 1 endif ifeq ($(findstring -ssh2,$(CFG)),-ssh2) WITH_SSH2 = 1 WITH_SSL = 1 WITH_ZLIB = 1 endif ifeq ($(findstring -axtls,$(CFG)),-axtls) WITH_AXTLS = 1 WITH_SSL = else ifeq ($(findstring -ssl,$(CFG)),-ssl) WITH_SSL = 1 endif endif ifeq ($(findstring -zlib,$(CFG)),-zlib) WITH_ZLIB = 1 endif ifeq ($(findstring -idn,$(CFG)),-idn) WITH_IDN = 1 endif ifeq ($(findstring -spnego,$(CFG)),-spnego) WITH_SPNEGO = 1 endif ifeq ($(findstring -ipv6,$(CFG)),-ipv6) ENABLE_IPV6 = 1 endif ifdef WITH_ARES INCLUDES += -I$(LIBCARES_PATH) LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT) endif ifdef WITH_SSH2 INCLUDES += -I$(LIBSSH2_PATH)/include ifdef LINK_STATIC LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT) else MODULES += libssh2.nlm IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp endif endif ifdef WITH_RTMP INCLUDES += -I$(LIBRTMP_PATH) LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT) endif ifdef WITH_SSL INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L) LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT) LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT) IMPORTS += GetProcessSwitchCount RunningProcess INSTDEP += ca-bundle.crt ifdef WITH_SPNEGO INCLUDES += -I$(FBOPENSSL_PATH)/include LDLIBS += $(FBOPENSSL_PATH)/nw/fbopenssl.$(LIBEXT) endif else ifdef WITH_AXTLS INCLUDES += -I$(AXTLS_PATH)/inc ifdef LINK_STATIC LDLIBS += $(AXTLS_PATH)/lib/libaxtls.$(LIBEXT) else MODULES += libaxtls.nlm IMPORTS += $(AXTLS_PATH)/lib/libaxtls.imp endif INSTDEP += ca-bundle.crt endif endif ifdef WITH_ZLIB INCLUDES += -I$(ZLIB_PATH) ifdef LINK_STATIC LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT) else MODULES += libz.nlm IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp endif endif ifdef WITH_IDN INCLUDES += -I$(LIBIDN_PATH)/include LDLIBS += $(LIBIDN_PATH)/lib/libidn.$(LIBEXT) endif ifeq ($(LIBARCH),LIBC) INCLUDES += -I$(NDK_LIBC)/include # INCLUDES += -I$(NDK_LIBC)/include/nks # INCLUDES += -I$(NDK_LIBC)/include/winsock CFLAGS += -D_POSIX_SOURCE else INCLUDES += -I$(NDK_CLIB)/include/nlm # INCLUDES += -I$(NDK_CLIB)/include/nlm/obsolete # INCLUDES += -I$(NDK_CLIB)/include endif ifndef DISABLE_LDAP INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc endif CFLAGS += $(INCLUDES) ifeq ($(MTSAFE),YES) XDCOPT = -n endif ifeq ($(MTSAFE),NO) XDCOPT = -u endif ifdef XDCOPT XDCDATA = $(OBJDIR)/$(TARGET).xdc endif ifeq ($(findstring /sh,$(SHELL)),/sh) DL = ' DS = / PCT = % #-include $(NDKBASE)/nlmconv/ncpfs.inc else DS = \\ PCT = %% endif # Makefile.inc provides the CSOURCES and HHEADERS defines include Makefile.inc OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(notdir $(CSOURCES)))) $(OBJDIR)/nwos.o OBJL = $(OBJS) $(OBJDIR)/nwlib.o $(LDLIBS) vpath %.c . vtls all: lib nlm nlm: prebuild $(TARGET).nlm lib: prebuild $(TARGET).$(LIBEXT) prebuild: $(OBJDIR) $(CURL_INC)/curl/curlbuild.h $(OBJDIR)/version.inc curl_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 $< > $@ install: $(INSTDIR) all $(INSTDEP) @$(CP) $(TARGET).nlm $(INSTDIR) @$(CP) $(TARGET).$(LIBEXT) $(INSTDIR) @$(CP) ../CHANGES $(INSTDIR) @$(CP) ../COPYING $(INSTDIR) @$(CP) ../README $(INSTDIR) @$(CP) ../RELEASE-NOTES $(INSTDIR) ifdef WITH_SSL @-$(CP) ca-bundle.crt $(INSTDIR)/ca-bundle.crt endif clean: -$(RM) curl_config.h -$(RM) -r $(OBJDIR) distclean vclean: clean -$(RM) $(TARGET).$(LIBEXT) $(TARGET).nlm $(TARGET).imp -$(RM) certdata.txt ca-bundle.crt $(OBJDIR) $(INSTDIR): @$(MKDIR) $@ $(TARGET).$(LIBEXT): $(OBJS) @echo Creating $@ @-$(RM) $@ @$(AR) $(ARFLAGS) $@ $^ ifdef RANLIB @$(RANLIB) $@ endif $(TARGET).nlm: $(OBJDIR)/$(TARGET).def $(OBJL) $(EXPORTF) $(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 ifneq ($(DB),NDEBUG) @echo $(DL)debug$(DL) >> $@ endif @echo $(DL)threadname "$(TARGET)"$(DL) >> $@ ifdef XDCDATA @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@ endif @echo $(DL)flag_on 64$(DL) >> $@ ifeq ($(LIBARCH),CLIB) @echo $(DL)start _Prelude$(DL) >> $@ @echo $(DL)exit _Stop$(DL) >> $@ @echo $(DL)import @$(NDK_CLIB)/imports/clib.imp$(DL) >> $@ @echo $(DL)import @$(NDK_CLIB)/imports/threads.imp$(DL) >> $@ @echo $(DL)import @$(NDK_CLIB)/imports/nlmlib.imp$(DL) >> $@ @echo $(DL)import @$(NDK_CLIB)/imports/socklib.imp$(DL) >> $@ @echo $(DL)module clib$(DL) >> $@ ifndef DISABLE_LDAP @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@ @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@ # @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@ @echo $(DL)module ldapsdk ldapssl$(DL) >> $@ endif else ifeq ($(POSIXFL),1) @echo $(DL)flag_on 4194304$(DL) >> $@ endif @echo $(DL)pseudopreemption$(DL) >> $@ ifeq ($(findstring posixpre,$(PRELUDE)),posixpre) @echo $(DL)start POSIX_Start$(DL) >> $@ @echo $(DL)exit POSIX_Stop$(DL) >> $@ @echo $(DL)check POSIX_CheckUnload$(DL) >> $@ else @echo $(DL)start _LibCPrelude$(DL) >> $@ @echo $(DL)exit _LibCPostlude$(DL) >> $@ @echo $(DL)check _LibCCheckUnload$(DL) >> $@ endif @echo $(DL)import @$(NDK_LIBC)/imports/libc.imp$(DL) >> $@ @echo $(DL)import @$(NDK_LIBC)/imports/netware.imp$(DL) >> $@ @echo $(DL)module libc$(DL) >> $@ ifndef DISABLE_LDAP @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@ @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@ # @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@ @echo $(DL)module lldapsdk lldapssl$(DL) >> $@ endif endif ifdef MODULES @echo $(DL)module $(MODULES)$(DL) >> $@ endif ifdef EXPORTS @echo $(DL)export $(EXPORTS)$(DL) >> $@ endif ifdef IMPORTS @echo $(DL)import $(IMPORTS)$(DL) >> $@ endif ifeq ($(findstring nlmconv,$(LD)),nlmconv) @echo $(DL)input $(PRELUDE)$(DL) >> $@ @echo $(DL)input $(OBJL)$(DL) >> $@ #ifdef LDLIBS # @echo $(DL)input $(LDLIBS)$(DL) >> $@ #endif @echo $(DL)output $(TARGET).nlm$(DL) >> $@ endif curl_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)#ifndef NETWARE$(DL) >> $@ @echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@ @echo $(DL)#endif$(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) >> $@ ifeq ($(LIBARCH),CLIB) @echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@ @echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@ @echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@ @echo $(DL)#define HAVE_STRNICMP 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 RECVFROM_TYPE_ARG1 int$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG2 char$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG3 int$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG6 int$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_RETV int$(DL) >> $@ @echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@ @echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@ @echo $(DL)#define SIZEOF_SIZE_T 4$(DL) >> $@ @echo $(DL)#define pressanykey PressAnyKeyToContinue$(DL) >> $@ else @echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@ @echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@ @echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@ @echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@ @echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@ @echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@ @echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@ @echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@ @echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@ @echo $(DL)#define HAVE_STRTOLL 1$(DL) >> $@ @echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@ @echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@ @echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG2 void *$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@ @echo $(DL)#define RECV_TYPE_RETV ssize_t$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG2 void$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG3 size_t$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG6 size_t$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_RETV ssize_t$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG2_IS_VOID 1$(DL) >> $@ @echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG2 void *$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG3 size_t$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@ @echo $(DL)#define SEND_TYPE_RETV ssize_t$(DL) >> $@ @echo $(DL)#define SIZEOF_OFF_T 8$(DL) >> $@ @echo $(DL)#define SIZEOF_SIZE_T 8$(DL) >> $@ @echo $(DL)#define _LARGEFILE 1$(DL) >> $@ ifdef ENABLE_IPV6 @echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@ @echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@ @echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@ @echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@ @echo $(DL)#define HAVE_GETADDRINFO 1$(DL) >> $@ @echo $(DL)#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 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 SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@ endif endif @echo $(DL)#define USE_MANUAL 1$(DL) >> $@ @echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@ @echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@ @echo $(DL)#define HAVE_ERRNO_H 1$(DL) >> $@ @echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@ @echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@ @echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@ @echo $(DL)#define HAVE_GETHOSTBYNAME 1$(DL) >> $@ @echo $(DL)#define HAVE_GETPROTOBYNAME 1$(DL) >> $@ @echo $(DL)#define HAVE_GMTIME_R 1$(DL) >> $@ @echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@ @echo $(DL)#define HAVE_IOCTL 1$(DL) >> $@ @echo $(DL)#define HAVE_IOCTL_FIONBIO 1$(DL) >> $@ @echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@ @echo $(DL)#define HAVE_LL 1$(DL) >> $@ @echo $(DL)#define HAVE_LOCALE_H 1$(DL) >> $@ @echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@ @echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@ @echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@ @echo $(DL)#define HAVE_RECV 1$(DL) >> $@ @echo $(DL)#define HAVE_RECVFROM 1$(DL) >> $@ @echo $(DL)#define HAVE_SELECT 1$(DL) >> $@ @echo $(DL)#define HAVE_SEND 1$(DL) >> $@ @echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@ @echo $(DL)#define HAVE_SETLOCALE 1$(DL) >> $@ @echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@ @echo $(DL)#define HAVE_SIGNAL_H 1$(DL) >> $@ @echo $(DL)#define HAVE_SIG_ATOMIC_T 1$(DL) >> $@ @echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@ @echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@ @echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@ @echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@ @echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@ @echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@ @echo $(DL)#define HAVE_STRUCT_TIMEVAL 1$(DL) >> $@ @echo $(DL)#define HAVE_SYS_IOCTL_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_TIME_H 1$(DL) >> $@ @echo $(DL)#define HAVE_UNAME 1$(DL) >> $@ @echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@ @echo $(DL)#define HAVE_UTIME 1$(DL) >> $@ @echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@ @echo $(DL)#define HAVE_WRITEV 1$(DL) >> $@ @echo $(DL)#define RETSIGTYPE void$(DL) >> $@ @echo $(DL)#define SIZEOF_INT 4$(DL) >> $@ @echo $(DL)#define SIZEOF_SHORT 2$(DL) >> $@ @echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@ @echo $(DL)#define STDC_HEADERS 1$(DL) >> $@ @echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@ ifdef DISABLE_LDAP @echo $(DL)#define CURL_DISABLE_LDAP 1$(DL) >> $@ else @echo $(DL)#define CURL_HAS_NOVELL_LDAPSDK 1$(DL) >> $@ ifndef DISABLE_LDAPS @echo $(DL)#define HAVE_LDAP_SSL 1$(DL) >> $@ endif @echo $(DL)#define HAVE_LDAP_SSL_H 1$(DL) >> $@ @echo $(DL)#define HAVE_LDAP_URL_PARSE 1$(DL) >> $@ endif ifdef NW_WINSOCK @echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@ else @echo $(DL)#define USE_BSD_SOCKETS 1$(DL) >> $@ @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) >> $@ ifdef WITH_SPNEGO @echo $(DL)#define HAVE_SPNEGO 1$(DL) >> $@ endif else ifdef WITH_AXTLS @echo $(DL)#define USE_AXTLS 1$(DL) >> $@ endif endif ifdef WITH_SSH2 @echo $(DL)#define USE_LIBSSH2 1$(DL) >> $@ @echo $(DL)#define HAVE_LIBSSH2_H 1$(DL) >> $@ endif ifdef WITH_IDN @echo $(DL)#define HAVE_LIBIDN 1$(DL) >> $@ @echo $(DL)#define HAVE_TLD_H 1$(DL) >> $@ endif ifdef WITH_RTMP @echo $(DL)#define USE_LIBRTMP 1$(DL) >> $@ endif @echo $(DL)#ifdef __GNUC__$(DL) >> $@ @echo $(DL)#define HAVE_VARIADIC_MACROS_GCC 1$(DL) >> $@ @echo $(DL)#else$(DL) >> $@ @echo $(DL)#define HAVE_VARIADIC_MACROS_C99 1$(DL) >> $@ @echo $(DL)#endif$(DL) >> $@ ifdef CABUNDLE @echo $(DL)#define CURL_CA_BUNDLE "$(CABUNDLE)"$(DL) >> $@ else @echo $(DL)#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")$(DL) >> $@ endif $(EXPORTF): $(CURL_INC)/curl/curl.h $(CURL_INC)/curl/easy.h $(CURL_INC)/curl/multi.h $(CURL_INC)/curl/mprintf.h @echo Creating $@ @$(AWK) -f ../packages/NetWare/get_exp.awk $^ > $@ FORCE: ; info: $(OBJDIR)/version.inc @echo Configured to build $(TARGET) with these options: @echo libarchitecture: $(LIBARCH) @echo curl version: $(LIBCURL_VERSION_STR) @echo compiler/linker: $(CC) / $(LD) ifdef CABUNDLE @echo ca-bundle path: $(CABUNDLE) endif ifdef WITH_SSL @echo SSL support: enabled (OpenSSL) else @echo SSL support: no endif ifdef WITH_SSH2 @echo SSH2 support: enabled (libssh2) else @echo SSH2 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 $(CURL_INC)/curl/curlbuild.h: Makefile.netware FORCE @echo Creating $@ @echo $(DL)/* $@ intended 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)#ifndef NETWARE$(DL) >> $@ @echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@ @echo $(DL)#endif$(DL) >> $@ @echo $(DL)#ifndef __CURL_CURLBUILD_H$(DL) >> $@ @echo $(DL)#define __CURL_CURLBUILD_H$(DL) >> $@ ifeq ($(LIBARCH),LIBC) @echo $(DL)#define CURL_SIZEOF_LONG 4$(DL) >> $@ @echo $(DL)#define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int$(DL) >> $@ @echo $(DL)#define CURL_SIZEOF_CURL_SOCKLEN_T 4$(DL) >> $@ @echo $(DL)#define CURL_TYPEOF_CURL_OFF_T long long$(DL) >> $@ @echo $(DL)#define CURL_FORMAT_CURL_OFF_T "lld"$(DL) >> $@ @echo $(DL)#define CURL_FORMAT_CURL_OFF_TU "llu"$(DL) >> $@ @echo $(DL)#define CURL_FORMAT_OFF_T "$(PCT)lld"$(DL) >> $@ @echo $(DL)#define CURL_SIZEOF_CURL_OFF_T 8$(DL) >> $@ @echo $(DL)#define CURL_SUFFIX_CURL_OFF_T LL$(DL) >> $@ @echo $(DL)#define CURL_SUFFIX_CURL_OFF_TU ULL$(DL) >> $@ else @echo $(DL)#define CURL_SIZEOF_LONG 4$(DL) >> $@ @echo $(DL)#define CURL_TYPEOF_CURL_SOCKLEN_T int$(DL) >> $@ @echo $(DL)#define CURL_SIZEOF_CURL_SOCKLEN_T 4$(DL) >> $@ @echo $(DL)#define CURL_TYPEOF_CURL_OFF_T long$(DL) >> $@ @echo $(DL)#define CURL_FORMAT_CURL_OFF_T "ld"$(DL) >> $@ @echo $(DL)#define CURL_FORMAT_CURL_OFF_TU "lu"$(DL) >> $@ @echo $(DL)#define CURL_FORMAT_OFF_T "$(PCT)ld"$(DL) >> $@ @echo $(DL)#define CURL_SIZEOF_CURL_OFF_T 4$(DL) >> $@ @echo $(DL)#define CURL_SUFFIX_CURL_OFF_T L$(DL) >> $@ @echo $(DL)#define CURL_SUFFIX_CURL_OFF_TU UL$(DL) >> $@ endif @echo $(DL)typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;$(DL) >> $@ @echo $(DL)typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;$(DL) >> $@ @echo $(DL)#endif /* __CURL_CURLBUILD_H */$(DL) >> $@ $(LIBCARES_PATH)/libcares.$(LIBEXT): $(MAKE) -C $(LIBCARES_PATH) -f Makefile.netware lib ca-bundle.crt: mk-ca-bundle.pl @echo Creating $@ @-$(PERL) $< -b -n $@ curl-7.35.0/lib/llist.h0000644000175000017500000000367412213173003011544 00000000000000#ifndef HEADER_CURL_LLIST_H #define HEADER_CURL_LLIST_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ #include "curl_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; }; 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_remove(struct curl_llist *, struct curl_llist_element *, void *); size_t Curl_llist_count(struct curl_llist *); void Curl_llist_destroy(struct curl_llist *, void *); int Curl_llist_move(struct curl_llist *, struct curl_llist_element *, struct curl_llist *, struct curl_llist_element *); #endif /* HEADER_CURL_LLIST_H */ curl-7.35.0/lib/ftp.h0000644000175000017500000001503512262353672011220 00000000000000#ifndef HEADER_CURL_FTP_H #define HEADER_CURL_FTP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "pingpong.h" #ifndef CURL_DISABLE_FTP extern const struct Curl_handler Curl_handler_ftp; #ifdef USE_SSL extern const struct Curl_handler Curl_handler_ftps; #endif CURLcode Curl_ftpsendf(struct connectdata *, const char *fmt, ...); CURLcode Curl_GetFTPResponse(ssize_t *nread, struct connectdata *conn, int *ftpcode); #endif /* CURL_DISABLE_FTP */ /**************************************************************************** * FTP unique setup ***************************************************************************/ typedef enum { FTP_STOP, /* do nothing state, stops the state machine */ FTP_WAIT220, /* waiting for the initial 220 response immediately after a connect */ FTP_AUTH, FTP_USER, FTP_PASS, FTP_ACCT, FTP_PBSZ, FTP_PROT, FTP_CCC, FTP_PWD, FTP_SYST, FTP_NAMEFMT, 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 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_PRET, /* generic state for PRET RETR, PRET STOR and PRET LIST/NLST */ 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; struct ftp_parselist_data; /* defined later in ftplistparser.c */ struct ftp_wc_tmpdata { struct ftp_parselist_data *parser; struct { curl_write_callback write_function; FILE *file_descriptor; } backup; }; 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 */ /* transfer a file/body or not, done as a typedefed enum just to make debuggers display the full symbol and not just the numerical value */ curl_pp_transfer transfer; curl_off_t downloadsize; }; /* ftp_conn is used for struct connection-oriented data in the connectdata struct */ struct ftp_conn { struct pingpong pp; 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 *file; /* decoded file */ 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. */ 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 */ bool wait_data_conn; /* this is set TRUE if data connection is waited */ 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) */ 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 */ ftpstate state; /* always use ftp.c:state() to change state! */ ftpstate state_saved; /* transfer type saved to be reloaded after data connection is established */ curl_off_t retr_size_saved; /* Size of retrieved file saved */ char * server_os; /* The target server operating system. */ curl_off_t known_filesize; /* file size is different from -1, if wildcard LIST parsing was done and wc_statemach set it */ /* 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]; /* this is the pair to connect the DATA... */ unsigned short newport; /* connection to */ }; #define DEFAULT_ACCEPT_TIMEOUT 60000 /* milliseconds == one minute */ #endif /* HEADER_CURL_FTP_H */ curl-7.35.0/lib/select.h0000644000175000017500000000633312213173003011667 00000000000000#ifndef HEADER_CURL_SELECT_H #define HEADER_CURL_SELECT_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_SYS_POLL_H #include #elif defined(HAVE_POLL_H) #include #endif /* * Definition of pollfd struct and constants for platforms lacking them. */ #if !defined(HAVE_STRUCT_POLLFD) && \ !defined(HAVE_SYS_POLL_H) && \ !defined(HAVE_POLL_H) #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 #ifndef POLLRDNORM #define POLLRDNORM POLLIN #endif #ifndef POLLWRNORM #define POLLWRNORM POLLOUT #endif #ifndef POLLRDBAND #define POLLRDBAND POLLPRI #endif /* there are three CSELECT defines that are defined in the public header that are exposed to users, but this *IN2 bit is only ever used internally and therefore defined here */ #define CURL_CSELECT_IN2 (CURL_CSELECT_ERR << 1) int Curl_socket_check(curl_socket_t readfd, curl_socket_t readfd2, curl_socket_t writefd, long timeout_ms); /* provide the former API internally */ #define Curl_socket_ready(x,y,z) \ Curl_socket_check(x, CURL_SOCKET_BAD, y, z) int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms); /* On non-DOS and non-Winsock platforms, when Curl_ack_eintr is set, * EINTR condition is honored and function might exit early without * awaiting full timeout. Otherwise EINTR will be ignored and full * timeout will elapse. */ extern int Curl_ack_eintr; int Curl_wait_ms(int timeout_ms); #ifdef TPF int tpf_select_libcurl(int maxfds, fd_set* reads, fd_set* writes, fd_set* excepts, struct timeval* tv); #endif /* Winsock and TPF sockets are not in range [0..FD_SETSIZE-1], which unfortunately makes it impossible for us to easily check if they're valid */ #if defined(USE_WINSOCK) || defined(TPF) #define VALID_SOCK(x) 1 #define VERIFY_SOCK(x) Curl_nop_stmt #else #define VALID_SOCK(s) (((s) >= 0) && ((s) < FD_SETSIZE)) #define VERIFY_SOCK(x) do { \ if(!VALID_SOCK(x)) { \ SET_SOCKERRNO(EINVAL); \ return -1; \ } \ } WHILE_FALSE #endif #endif /* HEADER_CURL_SELECT_H */ curl-7.35.0/lib/parsedate.h0000644000175000017500000000236412213173003012360 00000000000000#ifndef HEADER_CURL_PARSEDATE_H #define HEADER_CURL_PARSEDATE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ extern const char * const Curl_wkday[7]; extern const char * const Curl_month[12]; CURLcode Curl_gmtime(time_t intime, struct tm *store); #endif /* HEADER_CURL_PARSEDATE_H */ curl-7.35.0/lib/http_negotiate.h0000644000175000017500000000311512213173003013421 00000000000000#ifndef HEADER_CURL_HTTP_NEGOTIATE_H #define HEADER_CURL_HTTP_NEGOTIATE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #ifdef USE_HTTP_NEGOTIATE /* this is for Negotiate header input */ int Curl_input_negotiate(struct connectdata *conn, bool proxy, const char *header); /* this is for creating Negotiate header output */ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy); void Curl_cleanup_negotiate(struct SessionHandle *data); #ifdef USE_WINDOWS_SSPI #define GSS_ERROR(status) (status & 0x80000000) #endif #endif /* USE_HTTP_NEGOTIATE */ #endif /* HEADER_CURL_HTTP_NEGOTIATE_H */ curl-7.35.0/lib/Makefile.vxworks0000644000175000017500000001311412262353672013434 00000000000000#***************************************************************************** # # #Filename : Makefile.vxworks #Description: makefile to be used in order to compile libcurl for VxWoorks 6.3. # #How to use: # 1. Adjust environment variables at the file beginning # 2. Open the Command Prompt window and change directory ('cd') # into the 'lib' folder # 3. Add /bin folder to the PATH environment variable # For example type 'set PATH=C:/embedded/cygwin/bin;%PATH%' # 4. Build the library by typing 'make -f ./Makefile.vxworks' # As a result the libcurl.a should be created in the 'lib' folder. # To clean package use 'make -f ./Makefile.vxworks clean' #Requirements: # 1. WinXP machine # 2. Full CYGWIN installation (open source) with GNU make version # v3.78 or higher # 3. WindRiver Workbench with vxWorks 6.3 (commercial) #***************************************************************************** # ---------------------------------------------------------------------- # Environment # ---------------------------------------------------------------------- export WIND_HOME := C:/embedded/Workbench2.5.0.1 export WIND_BASE := $(WIND_HOME)/vxworks-6.3 export WIND_HOST_TYPE := x86-win32 # BUILD_TYE:= | (build with debugging info or optimized) BUILD_TYPE := debug USER_CFLAGS:= # directories where to seek for includes and libraries OPENSSL_INC := D:/libraries/openssl/openssl-0.9.8y-vxWorks6.3/include OPENSSL_LIB := D:/libraries/openssl/openssl-0.9.8y-vxWorks6.3 ZLIB_INC := D:/libraries/zlib/zlib-1.2.8-VxWorks6.3/zlib-1.2.8 ZLIB_LIB := D:/libraries/zlib/zlib-1.2.8-VxWorks6.3/binaries/vxworks_3.1_gnu/Debug/lib ARES_INC := ARES_LIB := # ---------------------------------------------------------------------- # Compiler # ---------------------------------------------------------------------- CC := ccppc AR := arppc LINK := ccppc CFLAGS := -D__GNUC__ -D__ppc__ -msoft-float -fno-builtin -mcpu=604 -mlongcall -DCPU=PPC604 -D_GNU_TOOL -Wall -W -Winline $(USER_CFLAGS) LDFLAGS := -nostdlib -Wl,-i -Wl,-X INCLUDE_FLAG := -I C_DEBUGFLAG := -g C_OPTFLAG := -O2 COMPILE_ONLY_FLAG := -c OBJ_EXTENSION := .o CC_OBJ_OUTPUT = -o $@ ARFLAGS := -rc LIBS_FLAG := -l LIBS_DIRFLAG:= -L LD_DEBUGFLAG := $(C_DEBUGFLAG) EXECUTE_EXTENSION := .out TOOL_CHAIN_BIN := $(WIND_HOME)/gnu/3.4.4-vxworks-6.3/$(WIND_HOST_TYPE)/bin/ # ---------------------------------------------------------------------- # Add -DINET6 if the OS kernel image was built with IPv6 support # CFLAGS += -DINET6 # Set up compiler and linker flags for debug or optimization ifeq ($(BUILD_TYPE), debug) CFLAGS += $(C_DEBUGFLAG) LDFLAGS += $(LD_DEBUGFLAG) else CFLAGS += $(C_OPTFLAG) endif # ---------------------------------------------------------------------- # Main Makefile and possible sub-make files MAKEFILES := Makefile.vxworks # List of external include directories #----- # IMPORTANT: include OPENSSL directories before system # in order to prevent WindRiver OpenSSL to be used. #----- INCLUDE_DIRS := ../include $(OPENSSL_INC) $(ZLIB_INC) $(ARES_INC) $(WIND_BASE)/target/h $(WIND_BASE)/target/h/wrn/coreip # List of external libraries and their directories LIBS_LIST := . LIB_DIRS := . ifneq ($(OPENSSL_LIB), ) LIBS_LIST += crypto ssl LIB_DIRS += $(OPENSSL_LIB) endif ifneq ($(ZLIB_LIB), ) LIBS_LIST += z LIB_DIRS += $(ZLIB_LIB) endif ifneq ($(ARES_LIB), ) LIBS_LIST += ares LIB_DIRS += $(ARES_LIB) endif # Add include and library directories and libraries CFLAGS += $(INCLUDE_DIRS:%=$(INCLUDE_FLAG)%) LDFLAGS += $(LIB_DIRS:%=$(LIBS_DIRFLAG)%) # List of targets to make for libs target LIBS_TARGET_LIST := libcurl.a # List of execuatble applications to make in addition to libs for all target EXE_TARGET_LIST := # Support for echoing rules # If ECHORULES variable was set (for example, using 'make' command line) # some shell commands in the rules will be echoed ifneq ($(strip $(findstring $(ECHORULES), yes YES 1 true TRUE)),) _@_ := else _@_ := @ endif # Directory to hold compilation intermediate files TMP_DIR := tmp # Get sources and headers to be compiled include Makefile.inc # List of headers INCLUDE_FILES := $(HHEADERS) INCLUDE_FILES += $(shell find ../include -name \*.h) # List of sources OBJLIST := $(CSOURCES:%.c=$(TMP_DIR)/%$(OBJ_EXTENSION)) # ---------------------------------------------------------------------- #### default rule # It should be first rule in this file .PHONY: default default: libcurl.a #### Compiling C files $(TMP_DIR)/%$(OBJ_EXTENSION): %.c $(MAKEFILES) @echo Compiling C file $< $(ECHO_STDOUT) @[ -d $(@D) ] || mkdir -p $(@D) $(_@_) $(TOOL_CHAIN_BIN)$(CC) $(COMPILE_ONLY_FLAG) $(CFLAGS) $< $(CC_OBJ_OUTPUT) #### Creating library $(LIBS_TARGET_LIST): $(INCLUDE_FILES) $(MAKEFILES) $(OBJLIST) @echo Creating library $@ $(ECHO_STDOUT) $(_@_) [ -d $(@D) ] || mkdir -p $(@D) $(_@_) rm -f $@ $(_@_) $(TOOL_CHAIN_BIN)$(AR) $(ARFLAGS) $@ $(filter %$(OBJ_EXTENSION), $^) #### Creating application $(EXE_TARGET_LIST): $(INCLUDE_FILES) $(MAKEFILES) $(LIBS_TARGET_LIST) @echo Creating application $@ @[ -d $(@D) ] || mkdir -p $(@D) $(_@_) $(TOOL_CHAIN_BIN)$(LINK) $(CC_OBJ_OUTPUT) $($(@)_EXE_OBJ_LIST) $(LDFLAGS) $($(@)_EXE_LIBS_NEEDED:%=$(LIBS_FLAG)%) $(LIBS_LIST:%=$(LIBS_FLAG)%) $(USER_LIBS_LIST) $(USER_LIBS_LIST) #### Master Targets libs: $(LIBS_TARGET_LIST) @echo All libs made. all: $(LIBS_TARGET_LIST) $(EXE_TARGET_LIST) $(INCLUDE_TARGET_LIST) @echo All targets made. # Clean up .PHONY: clean clean: $(_@_) rm -rf $(TMP_DIR) @echo libcurl was cleaned. curl-7.35.0/lib/getenv.c0000644000175000017500000000307412213173003011672 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #include #include "curl_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) ExpandEnvironmentStringsA(temp, env, sizeof(env)); return (env[0] != '\0')?strdup(env):NULL; #else char *env = getenv(variable); return (env && env[0])?strdup(env):NULL; #endif #endif } char *curl_getenv(const char *v) { return GetEnv(v); } curl-7.35.0/lib/README.ares0000644000175000017500000000431412213173003012045 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| How To Build libcurl to Use c-ares For Asynch Name Resolves =========================================================== c-ares: http://c-ares.haxx.se/ NOTE The latest libcurl version requires c-ares 1.6.0 or later. Once upon the time libcurl built fine with the "original" ares. That is no longer true. You need to use c-ares. Build c-ares ============ 1. unpack the c-ares archive 2. cd c-ares-dir 3. ./configure 4. make 5. make install Build libcurl to use c-ares in the curl source tree =================================================== 1. name or symlink the c-ares source directory 'ares' in the curl source directory 2. ./configure --enable-ares Optionally, you can point out the c-ares install tree root with the the --enable-ares option. 3. make Build libcurl to use an installed c-ares ======================================== 1. ./configure --enable-ares=/path/to/ares/install 2. make 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. curl-7.35.0/lib/transfer.h0000644000175000017500000000610412213173003012230 00000000000000#ifndef HEADER_CURL_TRANSFER_H #define HEADER_CURL_TRANSFER_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ CURLcode Curl_pretransfer(struct SessionHandle *data); CURLcode Curl_second_connect(struct connectdata *conn); CURLcode Curl_posttransfer(struct SessionHandle *data); typedef enum { FOLLOW_NONE, /* not used within the function, just a placeholder to allow initing to this */ FOLLOW_FAKE, /* only records stuff, not actually following */ FOLLOW_RETRY, /* set if this is a request retry as opposed to a real redirect following */ FOLLOW_REDIR, /* a full true redirect */ FOLLOW_LAST /* never used */ } followtype; CURLcode Curl_follow(struct SessionHandle *data, char *newurl, followtype type); CURLcode Curl_readwrite(struct connectdata *conn, bool *done); int Curl_single_getsock(const struct connectdata *conn, curl_socket_t *socks, int numsocks); CURLcode Curl_readrewind(struct connectdata *conn); CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp); CURLcode Curl_reconnect_request(struct connectdata **connp); CURLcode Curl_retry_request(struct connectdata *conn, char **url); bool Curl_meets_timecondition(struct SessionHandle *data, time_t timeofdoc); /* This sets up a forthcoming transfer */ void 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 */ ); long Curl_sleep_time(curl_off_t rate_bps, curl_off_t cur_rate_bps, int pkt_size); #endif /* HEADER_CURL_TRANSFER_H */ curl-7.35.0/lib/multi.c0000644000175000017500000025323012271241025011541 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include "curl_setup.h" #include #include "urldata.h" #include "transfer.h" #include "url.h" #include "connect.h" #include "progress.h" #include "easyif.h" #include "multiif.h" #include "sendf.h" #include "timeval.h" #include "http.h" #include "select.h" #include "warnless.h" #include "speedcheck.h" #include "conncache.h" #include "bundles.h" #include "multihandle.h" #include "pipeline.h" #include "sigpipe.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* CURL_SOCKET_HASH_TABLE_SIZE should be a prime number. Increasing it from 97 to 911 takes on a 32-bit machine 4 x 804 = 3211 more bytes. Still, every CURL handle takes 45-50 K memory, therefore this 3K are not significant. */ #ifndef CURL_SOCKET_HASH_TABLE_SIZE #define CURL_SOCKET_HASH_TABLE_SIZE 911 #endif #define CURL_CONNECTION_HASH_SIZE 97 #define CURL_MULTI_HANDLE 0x000bab1e #define GOOD_MULTI_HANDLE(x) \ ((x) && (((struct Curl_multi *)(x))->type == CURL_MULTI_HANDLE)) #define GOOD_EASY_HANDLE(x) \ ((x) && (((struct SessionHandle *)(x))->magic == CURLEASY_MAGIC_NUMBER)) static void singlesocket(struct Curl_multi *multi, struct SessionHandle *data); static int update_timer(struct Curl_multi *multi); static bool isHandleAtHead(struct SessionHandle *handle, struct curl_llist *pipeline); static CURLMcode add_next_timeout(struct timeval now, struct Curl_multi *multi, struct SessionHandle *d); static CURLMcode multi_timeout(struct Curl_multi *multi, long *timeout_ms); #ifdef DEBUGBUILD static const char * const statename[]={ "INIT", "CONNECT_PEND", "CONNECT", "WAITRESOLVE", "WAITCONNECT", "WAITPROXYCONNECT", "PROTOCONNECT", "WAITDO", "DO", "DOING", "DO_MORE", "DO_DONE", "WAITPERFORM", "PERFORM", "TOOFAST", "DONE", "COMPLETED", "MSGSENT", }; #endif static void multi_freetimeout(void *a, void *b); /* always use this function to change state, to make debugging easier */ static void mstate(struct SessionHandle *data, CURLMstate state #ifdef DEBUGBUILD , int lineno #endif ) { #ifdef DEBUGBUILD long connection_id = -5000; #endif CURLMstate oldstate = data->mstate; if(oldstate == state) /* don't bother when the new state is the same as the old state */ return; data->mstate = state; #ifdef DEBUGBUILD if(data->mstate >= CURLM_STATE_CONNECT_PEND && data->mstate < CURLM_STATE_COMPLETED) { if(data->easy_conn) connection_id = data->easy_conn->connection_id; infof(data, "STATE: %s => %s handle %p; line %d (connection #%ld) \n", statename[oldstate], statename[data->mstate], (void *)data, lineno, connection_id); } #endif if(state == CURLM_STATE_COMPLETED) /* changing to COMPLETED means there's one less easy handle 'alive' */ data->multi->num_alive--; } #ifndef DEBUGBUILD #define multistate(x,y) mstate(x,y) #else #define multistate(x,y) mstate(x,y, __LINE__) #endif /* * We add one of these structs to the sockhash for a particular socket */ struct Curl_sh_entry { struct SessionHandle *easy; time_t timestamp; 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(1, sizeof(struct Curl_sh_entry)); 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; if(p) free(p); } static size_t fd_key_compare(void *k1, size_t k1_len, void *k2, size_t k2_len) { (void) k1_len; (void) k2_len; return (*((int *) k1)) == (*((int *) k2)); } static size_t hash_fd(void *key, size_t key_length, size_t slots_num) { int fd = *((int *) key); (void) key_length; return (fd % (int)slots_num); } /* * sh_init() creates a new socket hash and returns the handle for it. * * 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(int hashsize) { return Curl_hash_alloc(hashsize, hash_fd, fd_key_compare, sh_freeentry); } /* * multi_addmsg() * * Called when a transfer is completed. Adds the given msg pointer to * the list kept in the multi handle. */ static CURLMcode multi_addmsg(struct Curl_multi *multi, struct Curl_message *msg) { if(!Curl_llist_insert_next(multi->msglist, multi->msglist->tail, msg)) return CURLM_OUT_OF_MEMORY; return CURLM_OK; } /* * multi_freeamsg() * * Callback used by the llist system when a single list entry is destroyed. */ static void multi_freeamsg(void *a, void *b) { (void)a; (void)b; } struct Curl_multi *Curl_multi_handle(int hashsize, /* socket hash */ int chashsize) /* connection hash */ { struct Curl_multi *multi = calloc(1, sizeof(struct Curl_multi)); if(!multi) return NULL; multi->type = CURL_MULTI_HANDLE; multi->hostcache = Curl_mk_dnscache(); if(!multi->hostcache) goto error; multi->sockhash = sh_init(hashsize); if(!multi->sockhash) goto error; multi->conn_cache = Curl_conncache_init(chashsize); if(!multi->conn_cache) goto error; multi->msglist = Curl_llist_alloc(multi_freeamsg); if(!multi->msglist) goto error; /* allocate a new easy handle to use when closing cached connections */ multi->closure_handle = curl_easy_init(); if(!multi->closure_handle) goto error; multi->closure_handle->multi = multi; multi->closure_handle->state.conn_cache = multi->conn_cache; multi->max_pipeline_length = 5; return (CURLM *) multi; error: Curl_hash_destroy(multi->sockhash); multi->sockhash = NULL; Curl_hash_destroy(multi->hostcache); multi->hostcache = NULL; Curl_conncache_destroy(multi->conn_cache); multi->conn_cache = NULL; Curl_close(multi->closure_handle); multi->closure_handle = NULL; Curl_llist_destroy(multi->msglist, NULL); free(multi); return NULL; } CURLM *curl_multi_init(void) { return Curl_multi_handle(CURL_SOCKET_HASH_TABLE_SIZE, CURL_CONNECTION_HASH_SIZE); } CURLMcode curl_multi_add_handle(CURLM *multi_handle, CURL *easy_handle) { struct curl_llist *timeoutlist; struct Curl_multi *multi = (struct Curl_multi *)multi_handle; struct SessionHandle *data = (struct SessionHandle *)easy_handle; /* 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 from adding same easy handle more than once and prevent adding to more than one multi stack */ if(data->multi) return CURLM_ADDED_ALREADY; /* Allocate and initialize timeout list for easy handle */ timeoutlist = Curl_llist_alloc(multi_freetimeout); if(!timeoutlist) return CURLM_OUT_OF_MEMORY; /* * No failure allowed in this function beyond this point. And no * modification of easy nor multi handle allowed before this except for * potential multi's connection cache growing which won't be undone in this * function no matter what. */ /* Make easy handle use timeout list initialized above */ data->state.timeoutlist = timeoutlist; timeoutlist = NULL; /* set the easy handle */ multistate(data, CURLM_STATE_INIT); if((data->set.global_dns_cache) && (data->dns.hostcachetype != HCACHE_GLOBAL)) { /* global dns cache was requested but still isn't */ struct curl_hash *global = Curl_global_host_cache_init(); if(global) { /* only do this if the global cache init works */ data->dns.hostcache = global; data->dns.hostcachetype = HCACHE_GLOBAL; } } /* for multi interface connections, we share DNS cache automatically if the easy handle's one is currently not set. */ else if(!data->dns.hostcache || (data->dns.hostcachetype == HCACHE_NONE)) { data->dns.hostcache = multi->hostcache; data->dns.hostcachetype = HCACHE_MULTI; } /* Point to the multi's connection cache */ data->state.conn_cache = multi->conn_cache; /* This adds the new entry at the 'end' of the doubly-linked circular list of SessionHandle structs to try and maintain a FIFO queue so the pipelined requests are in order. */ /* We add this new entry last in the list. */ data->next = NULL; /* end of the line */ if(multi->easyp) { struct SessionHandle *last = multi->easylp; last->next = data; data->prev = last; multi->easylp = data; /* the new last node */ } else { /* first node, make both prev and next be NULL! */ data->next = NULL; data->prev = NULL; multi->easylp = multi->easyp = data; /* both first and last */ } /* make the SessionHandle refer back to this multi handle */ data->multi = multi_handle; /* Set the timeout for this handle to expire really soon so that it will be taken care of even when this handle is added in the midst of operation when only the curl_multi_socket() API is used. During that flow, only sockets that time-out or have actions will be dealt with. Since this handle has no action yet, we make sure it times out to get things to happen. */ Curl_expire(data, 1); /* increase the node-counter */ multi->num_easy++; /* increase the alive-counter */ multi->num_alive++; /* A somewhat crude work-around for a little glitch in update_timer() that happens if the lastcall time is set to the same time when the handle is removed as when the next handle is added, as then the check in update_timer() that prevents calling the application multiple times with the same timer infor will not trigger and then the new handle's timeout will not be notified to the app. The work-around is thus simply to clear the 'lastcall' variable to force update_timer() to always trigger a callback to the app when a new easy handle is added */ memset(&multi->timer_lastcall, 0, sizeof(multi->timer_lastcall)); 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->data, sh->data->magic, (int)sh->socket); } #endif CURLMcode curl_multi_remove_handle(CURLM *multi_handle, CURL *curl_handle) { struct Curl_multi *multi=(struct Curl_multi *)multi_handle; struct SessionHandle *easy = curl_handle; struct SessionHandle *data = 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; /* Prevent users from trying to remove same easy handle more than once */ if(!data->multi) return CURLM_OK; /* it is already removed so let's say it is fine! */ if(easy) { bool premature = (data->mstate < CURLM_STATE_COMPLETED) ? TRUE : FALSE; bool easy_owns_conn = (data->easy_conn && (data->easy_conn->data == easy)) ? TRUE : FALSE; /* 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(premature) /* this handle is "alive" so we need to count down the total number of alive connections when this is removed */ multi->num_alive--; if(data->easy_conn && (data->easy_conn->send_pipe->size + data->easy_conn->recv_pipe->size > 1) && data->mstate > CURLM_STATE_WAITDO && data->mstate < CURLM_STATE_COMPLETED) { /* If the handle is in a pipeline and has started sending off its request but not received its response yet, we need to close connection. */ data->easy_conn->bits.close = TRUE; /* Set connection owner so that Curl_done() closes it. We can sefely do this here since connection is killed. */ data->easy_conn->data = easy; } /* The timer must be shut down before data->multi is set to NULL, else the timenode will remain in the splay tree after curl_easy_cleanup is called. */ Curl_expire(data, 0); /* destroy the timeout list that is held in the easy handle */ if(data->state.timeoutlist) { Curl_llist_destroy(data->state.timeoutlist, NULL); data->state.timeoutlist = NULL; } if(data->dns.hostcachetype == HCACHE_MULTI) { /* stop using the multi handle's DNS cache */ data->dns.hostcache = NULL; data->dns.hostcachetype = HCACHE_NONE; } if(data->easy_conn) { /* we must call Curl_done() here (if we still "own it") so that we don't leave a half-baked one around */ if(easy_owns_conn) { /* Curl_done() clears the conn->data field to lose the association between the easy handle and the connection Note that this ignores the return code simply because there's nothing really useful to do with it anyway! */ (void)Curl_done(&data->easy_conn, data->result, premature); } else /* Clear connection pipelines, if Curl_done above was not called */ Curl_getoff_all_pipelines(data, data->easy_conn); } /* as this was using a shared connection cache we clear the pointer to that since we're not part of that multi handle anymore */ data->state.conn_cache = NULL; /* change state without using multistate(), only to make singlesocket() do what we want */ data->mstate = CURLM_STATE_COMPLETED; singlesocket(multi, easy); /* to let the application know what sockets that vanish with this handle */ /* Remove the association between the connection and the handle */ if(data->easy_conn) { data->easy_conn->data = NULL; data->easy_conn = NULL; } data->multi = NULL; /* clear the association to this multi handle */ { /* make sure there's no pending message in the queue sent from this easy handle */ struct curl_llist_element *e; for(e = multi->msglist->head; e; e = e->next) { struct Curl_message *msg = e->ptr; if(msg->extmsg.easy_handle == easy) { Curl_llist_remove(multi->msglist, e, NULL); /* there can only be one from this specific handle */ break; } } } /* make the previous node point to our next */ if(data->prev) data->prev->next = data->next; else multi->easyp = data->next; /* point to first node */ /* make our next point to our previous node */ if(data->next) data->next->prev = data->prev; else multi->easylp = data->prev; /* point to last node */ /* NOTE NOTE NOTE We do not touch the easy handle here! */ 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_pipeline_enabled(const struct Curl_multi *multi) { return (multi && multi->pipelining_enabled) ? TRUE : FALSE; } void Curl_multi_handlePipeBreak(struct SessionHandle *data) { data->easy_conn = NULL; } static int waitconnect_getsock(struct connectdata *conn, curl_socket_t *sock, int numsocks) { int i; int s=0; int rc=0; if(!numsocks) return GETSOCK_BLANK; for(i=0; i<2; i++) { if(conn->tempsock[i] != CURL_SOCKET_BAD) { sock[s] = conn->tempsock[i]; rc |= GETSOCK_WRITESOCK(s++); } } /* when we've sent a CONNECT to a proxy, we should rather wait for the socket to become readable to be able to get the response headers */ if(conn->tunnel_state[FIRSTSOCKET] == TUNNEL_CONNECT) { sock[0] = conn->sock[FIRSTSOCKET]; rc = GETSOCK_READSOCK(0); } return rc; } static int domore_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { if(conn && conn->handler->domore_getsock) return conn->handler->domore_getsock(conn, socks, numsocks); return GETSOCK_BLANK; } /* returns bitmapped flags for this handle and its sockets */ static int multi_getsock(struct SessionHandle *data, curl_socket_t *socks, /* points to numsocks number of sockets */ int numsocks) { /* If the pipe broke, or if there's no connection left for this easy handle, then we MUST bail out now with no bitmask set. The no connection case can happen when this is called from curl_multi_remove_handle() => singlesocket() => multi_getsock(). */ if(data->state.pipe_broke || !data->easy_conn) return 0; if(data->mstate > CURLM_STATE_CONNECT && data->mstate < CURLM_STATE_COMPLETED) { /* Set up ownership correctly */ data->easy_conn->data = data; } switch(data->mstate) { default: #if 0 /* switch back on these cases to get the compiler to check for all enums to be present */ case CURLM_STATE_TOOFAST: /* returns 0, so will not select. */ case CURLM_STATE_COMPLETED: case CURLM_STATE_MSGSENT: case CURLM_STATE_INIT: case CURLM_STATE_CONNECT: case CURLM_STATE_WAITDO: case CURLM_STATE_DONE: case CURLM_STATE_LAST: /* this will get called with CURLM_STATE_COMPLETED when a handle is removed */ #endif return 0; case CURLM_STATE_WAITRESOLVE: return Curl_resolver_getsock(data->easy_conn, socks, numsocks); case CURLM_STATE_PROTOCONNECT: return Curl_protocol_getsock(data->easy_conn, socks, numsocks); case CURLM_STATE_DO: case CURLM_STATE_DOING: return Curl_doing_getsock(data->easy_conn, socks, numsocks); case CURLM_STATE_WAITPROXYCONNECT: case CURLM_STATE_WAITCONNECT: return waitconnect_getsock(data->easy_conn, socks, numsocks); case CURLM_STATE_DO_MORE: return domore_getsock(data->easy_conn, socks, numsocks); case CURLM_STATE_DO_DONE: /* since is set after DO is completed, we switch to waiting for the same as the *PERFORM states */ case CURLM_STATE_PERFORM: case CURLM_STATE_WAITPERFORM: return Curl_single_getsock(data->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 SessionHandle *data; 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; data=multi->easyp; while(data) { bitmap = multi_getsock(data, sockbunch, MAX_SOCKSPEREASYHANDLE); for(i=0; i< MAX_SOCKSPEREASYHANDLE; i++) { curl_socket_t s = CURL_SOCKET_BAD; if((bitmap & GETSOCK_READSOCK(i)) && VALID_SOCK((sockbunch[i]))) { FD_SET(sockbunch[i], read_fd_set); s = sockbunch[i]; } if((bitmap & GETSOCK_WRITESOCK(i)) && VALID_SOCK((sockbunch[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; } } data = data->next; /* check next handle */ } *max_fd = this_max_fd; return CURLM_OK; } CURLMcode curl_multi_wait(CURLM *multi_handle, struct curl_waitfd extra_fds[], unsigned int extra_nfds, int timeout_ms, int *ret) { struct Curl_multi *multi=(struct Curl_multi *)multi_handle; struct SessionHandle *data; curl_socket_t sockbunch[MAX_SOCKSPEREASYHANDLE]; int bitmap; unsigned int i; unsigned int nfds = 0; unsigned int curlfds; struct pollfd *ufds = NULL; long timeout_internal; if(!GOOD_MULTI_HANDLE(multi)) return CURLM_BAD_HANDLE; /* If the internally desired timeout is actually shorter than requested from the outside, then use the shorter time! But only if the internal timer is actually larger than -1! */ (void)multi_timeout(multi, &timeout_internal); if((timeout_internal >= 0) && (timeout_internal < (long)timeout_ms)) timeout_ms = (int)timeout_internal; /* Count up how many fds we have from the multi handle */ data=multi->easyp; while(data) { bitmap = multi_getsock(data, sockbunch, MAX_SOCKSPEREASYHANDLE); for(i=0; i< MAX_SOCKSPEREASYHANDLE; i++) { curl_socket_t s = CURL_SOCKET_BAD; if(bitmap & GETSOCK_READSOCK(i)) { ++nfds; s = sockbunch[i]; } if(bitmap & GETSOCK_WRITESOCK(i)) { ++nfds; s = sockbunch[i]; } if(s == CURL_SOCKET_BAD) { break; } } data = data->next; /* check next handle */ } curlfds = nfds; /* number of internal file descriptors */ nfds += extra_nfds; /* add the externally provided ones */ if(nfds) { ufds = malloc(nfds * sizeof(struct pollfd)); if(!ufds) return CURLM_OUT_OF_MEMORY; } nfds = 0; /* only do the second loop if we found descriptors in the first stage run above */ if(curlfds) { /* Add the curl handles to our pollfds first */ data=multi->easyp; while(data) { bitmap = multi_getsock(data, sockbunch, MAX_SOCKSPEREASYHANDLE); for(i=0; i< MAX_SOCKSPEREASYHANDLE; i++) { curl_socket_t s = CURL_SOCKET_BAD; if(bitmap & GETSOCK_READSOCK(i)) { ufds[nfds].fd = sockbunch[i]; ufds[nfds].events = POLLIN; ++nfds; s = sockbunch[i]; } if(bitmap & GETSOCK_WRITESOCK(i)) { ufds[nfds].fd = sockbunch[i]; ufds[nfds].events = POLLOUT; ++nfds; s = sockbunch[i]; } if(s == CURL_SOCKET_BAD) { break; } } data = data->next; /* check next handle */ } } /* Add external file descriptions from poll-like struct curl_waitfd */ for(i = 0; i < extra_nfds; i++) { ufds[nfds].fd = extra_fds[i].fd; ufds[nfds].events = 0; if(extra_fds[i].events & CURL_WAIT_POLLIN) ufds[nfds].events |= POLLIN; if(extra_fds[i].events & CURL_WAIT_POLLPRI) ufds[nfds].events |= POLLPRI; if(extra_fds[i].events & CURL_WAIT_POLLOUT) ufds[nfds].events |= POLLOUT; ++nfds; } if(nfds) { /* wait... */ infof(data, "Curl_poll(%d ds, %d ms)\n", nfds, timeout_ms); i = Curl_poll(ufds, nfds, timeout_ms); if(i) { unsigned int j; /* copy revents results from the poll to the curl_multi_wait poll struct, the bit values of the actual underlying poll() implementation may not be the same as the ones in the public libcurl API! */ for(j = 0; j < extra_nfds; j++) { unsigned short mask = 0; unsigned r = ufds[curlfds + j].revents; if(r & POLLIN) mask |= CURL_WAIT_POLLIN; if(r & POLLOUT) mask |= CURL_WAIT_POLLOUT; if(r & POLLPRI) mask |= CURL_WAIT_POLLPRI; extra_fds[j].revents = mask; } } } else i = 0; Curl_safefree(ufds); if(ret) *ret = i; return CURLM_OK; } static CURLMcode multi_runsingle(struct Curl_multi *multi, struct timeval now, struct SessionHandle *data) { struct Curl_message *msg = NULL; bool connected; bool async; bool protocol_connect = FALSE; bool dophase_done = FALSE; bool done = FALSE; CURLMcode result = CURLM_OK; struct SingleRequest *k; long timeout_ms; int control; if(!GOOD_EASY_HANDLE(data)) return CURLM_BAD_EASY_HANDLE; do { /* this is a single-iteration do-while loop just to allow a break to skip to the end of it */ bool disconnect_conn = FALSE; /* Handle the case when the pipe breaks, i.e., the connection we're using gets cleaned up and we're left with nothing. */ if(data->state.pipe_broke) { infof(data, "Pipe broke: handle 0x%p, url = %s\n", (void *)data, data->state.path); if(data->mstate < CURLM_STATE_COMPLETED) { /* Head back to the CONNECT state */ multistate(data, CURLM_STATE_CONNECT); result = CURLM_CALL_MULTI_PERFORM; data->result = CURLE_OK; } data->state.pipe_broke = FALSE; data->easy_conn = NULL; break; } if(!data->easy_conn && data->mstate > CURLM_STATE_CONNECT && data->mstate < CURLM_STATE_DONE) { /* In all these states, the code will blindly access 'data->easy_conn' so this is precaution that it isn't NULL. And it silences static analyzers. */ failf(data, "In state %d with no easy_conn, bail out!\n", data->mstate); return CURLM_INTERNAL_ERROR; } if(data->easy_conn && data->mstate > CURLM_STATE_CONNECT && data->mstate < CURLM_STATE_COMPLETED) /* Make sure we set the connection's current owner */ data->easy_conn->data = data; if(data->easy_conn && (data->mstate >= CURLM_STATE_CONNECT) && (data->mstate < CURLM_STATE_COMPLETED)) { /* we need to wait for the connect state as only then is the start time stored, but we must not check already completed handles */ timeout_ms = Curl_timeleft(data, &now, (data->mstate <= CURLM_STATE_WAITDO)? TRUE:FALSE); if(timeout_ms < 0) { /* Handle timed out */ if(data->mstate == CURLM_STATE_WAITRESOLVE) failf(data, "Resolving timed out after %ld milliseconds", Curl_tvdiff(now, data->progress.t_startsingle)); else if(data->mstate == CURLM_STATE_WAITCONNECT) failf(data, "Connection timed out after %ld milliseconds", Curl_tvdiff(now, data->progress.t_startsingle)); else { k = &data->req; if(k->size != -1) { failf(data, "Operation timed out after %ld milliseconds with %" CURL_FORMAT_CURL_OFF_T " out of %" CURL_FORMAT_CURL_OFF_T " bytes received", Curl_tvdiff(k->now, data->progress.t_startsingle), k->bytecount, k->size); } else { failf(data, "Operation timed out after %ld milliseconds with %" CURL_FORMAT_CURL_OFF_T " bytes received", Curl_tvdiff(now, data->progress.t_startsingle), k->bytecount); } } /* Force the connection closed because the server could continue to send us stuff at any time. (The disconnect_conn logic used below doesn't work at this point). */ data->easy_conn->bits.close = TRUE; data->result = CURLE_OPERATION_TIMEDOUT; multistate(data, CURLM_STATE_COMPLETED); break; } } switch(data->mstate) { case CURLM_STATE_INIT: /* init this transfer. */ data->result=Curl_pretransfer(data); if(CURLE_OK == data->result) { /* after init, go CONNECT */ multistate(data, CURLM_STATE_CONNECT); result = CURLM_CALL_MULTI_PERFORM; } break; case CURLM_STATE_CONNECT_PEND: /* We will stay here until there is a connection available. Then we try again in the CURLM_STATE_CONNECT state. */ break; case CURLM_STATE_CONNECT: /* Connect. We want to get a connection identifier filled in. */ Curl_pgrsTime(data, TIMER_STARTSINGLE); data->result = Curl_connect(data, &data->easy_conn, &async, &protocol_connect); if(CURLE_NO_CONNECTION_AVAILABLE == data->result) { /* There was no connection available. We will go to the pending state and wait for an available connection. */ multistate(data, CURLM_STATE_CONNECT_PEND); data->result = CURLE_OK; break; } if(CURLE_OK == data->result) { /* Add this handle to the send or pend pipeline */ data->result = Curl_add_handle_to_pipeline(data, data->easy_conn); if(CURLE_OK != data->result) disconnect_conn = TRUE; else { if(async) /* We're now waiting for an asynchronous name lookup */ multistate(data, 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 or DO! */ result = CURLM_CALL_MULTI_PERFORM; if(protocol_connect) multistate(data, multi->pipelining_enabled? CURLM_STATE_WAITDO:CURLM_STATE_DO); else { #ifndef CURL_DISABLE_HTTP if(data->easy_conn->tunnel_state[FIRSTSOCKET] == TUNNEL_CONNECT) multistate(data, CURLM_STATE_WAITPROXYCONNECT); else #endif multistate(data, 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 */ data->result = Curl_resolver_is_resolved(data->easy_conn, &dns); /* Update sockets here, because the socket(s) may have been closed and the application thus needs to be told, even if it is likely that the same socket(s) will again be used further down. If the name has not yet been resolved, it is likely that new sockets have been opened in an attempt to contact another resolver. */ singlesocket(multi, data); if(dns) { /* Perform the next step in the connection phase, and then move on to the WAITCONNECT state */ data->result = Curl_async_resolved(data->easy_conn, &protocol_connect); if(CURLE_OK != data->result) /* if Curl_async_resolved() returns failure, the connection struct is already freed and gone */ data->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(data, multi->pipelining_enabled? CURLM_STATE_WAITDO:CURLM_STATE_DO); else { #ifndef CURL_DISABLE_HTTP if(data->easy_conn->tunnel_state[FIRSTSOCKET] == TUNNEL_CONNECT) multistate(data, CURLM_STATE_WAITPROXYCONNECT); else #endif multistate(data, CURLM_STATE_WAITCONNECT); } } } if(CURLE_OK != data->result) { /* failure detected */ disconnect_conn = TRUE; break; } } break; #ifndef CURL_DISABLE_HTTP case CURLM_STATE_WAITPROXYCONNECT: /* this is HTTP-specific, but sending CONNECT to a proxy is HTTP... */ data->result = Curl_http_connect(data->easy_conn, &protocol_connect); if(data->easy_conn->bits.proxy_connect_closed) { /* reset the error buffer */ if(data->set.errorbuffer) data->set.errorbuffer[0] = '\0'; data->state.errorbuf = FALSE; data->result = CURLE_OK; result = CURLM_CALL_MULTI_PERFORM; multistate(data, CURLM_STATE_CONNECT); } else if(CURLE_OK == data->result) { if(data->easy_conn->tunnel_state[FIRSTSOCKET] == TUNNEL_COMPLETE) multistate(data, CURLM_STATE_WAITCONNECT); } break; #endif case CURLM_STATE_WAITCONNECT: /* awaiting a completion of an asynch connect */ data->result = Curl_is_connected(data->easy_conn, FIRSTSOCKET, &connected); if(connected) { if(!data->result) /* if everything is still fine we do the protocol-specific connect setup */ data->result = Curl_protocol_connect(data->easy_conn, &protocol_connect); } if(CURLE_OK != data->result) { /* failure detected */ /* Just break, the cleaning up is handled all in one place */ disconnect_conn = TRUE; 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. BUT if we are using a proxy we must change to WAITPROXYCONNECT */ #ifndef CURL_DISABLE_HTTP if(data->easy_conn->tunnel_state[FIRSTSOCKET] == TUNNEL_CONNECT) multistate(data, CURLM_STATE_WAITPROXYCONNECT); else #endif multistate(data, CURLM_STATE_PROTOCONNECT); } else /* after the connect has completed, go WAITDO or DO */ multistate(data, multi->pipelining_enabled? CURLM_STATE_WAITDO:CURLM_STATE_DO); result = CURLM_CALL_MULTI_PERFORM; } break; case CURLM_STATE_PROTOCONNECT: /* protocol-specific connect phase */ data->result = Curl_protocol_connecting(data->easy_conn, &protocol_connect); if((data->result == CURLE_OK) && protocol_connect) { /* after the connect has completed, go WAITDO or DO */ multistate(data, multi->pipelining_enabled? CURLM_STATE_WAITDO:CURLM_STATE_DO); result = CURLM_CALL_MULTI_PERFORM; } else if(data->result) { /* failure detected */ Curl_posttransfer(data); Curl_done(&data->easy_conn, data->result, TRUE); disconnect_conn = TRUE; } break; case CURLM_STATE_WAITDO: /* Wait for our turn to DO when we're pipelining requests */ #ifdef DEBUGBUILD infof(data, "WAITDO: Conn %ld send pipe %zu inuse %s athead %s\n", data->easy_conn->connection_id, data->easy_conn->send_pipe->size, data->easy_conn->writechannel_inuse?"TRUE":"FALSE", isHandleAtHead(data, data->easy_conn->send_pipe)?"TRUE":"FALSE"); #endif if(!data->easy_conn->writechannel_inuse && isHandleAtHead(data, data->easy_conn->send_pipe)) { /* Grab the channel */ data->easy_conn->writechannel_inuse = TRUE; multistate(data, CURLM_STATE_DO); result = CURLM_CALL_MULTI_PERFORM; } break; case CURLM_STATE_DO: if(data->set.connect_only) { /* keep connection open for application to use the socket */ data->easy_conn->bits.close = FALSE; multistate(data, CURLM_STATE_DONE); data->result = CURLE_OK; result = CURLM_CALL_MULTI_PERFORM; } else { /* Perform the protocol's DO action */ data->result = Curl_do(&data->easy_conn, &dophase_done); /* When Curl_do() returns failure, data->easy_conn might be NULL! */ if(CURLE_OK == data->result) { if(!dophase_done) { /* some steps needed for wildcard matching */ if(data->set.wildcardmatch) { struct WildcardData *wc = &data->wildcard; if(wc->state == CURLWC_DONE || wc->state == CURLWC_SKIP) { /* skip some states if it is important */ Curl_done(&data->easy_conn, CURLE_OK, FALSE); multistate(data, CURLM_STATE_DONE); result = CURLM_CALL_MULTI_PERFORM; break; } } /* DO was not completed in one function call, we must continue DOING... */ multistate(data, CURLM_STATE_DOING); result = CURLM_OK; } /* after DO, go DO_DONE... or DO_MORE */ else if(data->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(data, CURLM_STATE_DO_MORE); result = CURLM_OK; } else { /* we're done with the DO, now DO_DONE */ multistate(data, CURLM_STATE_DO_DONE); result = CURLM_CALL_MULTI_PERFORM; } } else if((CURLE_SEND_ERROR == data->result) && data->easy_conn->bits.reuse) { /* * In this situation, a connection that we were trying to use * may have unexpectedly died. If possible, send the connection * back to the CONNECT phase so we can try again. */ char *newurl = NULL; followtype follow=FOLLOW_NONE; CURLcode drc; bool retry = FALSE; drc = Curl_retry_request(data->easy_conn, &newurl); if(drc) { /* a failure here pretty much implies an out of memory */ data->result = drc; disconnect_conn = TRUE; } else retry = (newurl)?TRUE:FALSE; Curl_posttransfer(data); drc = Curl_done(&data->easy_conn, data->result, FALSE); /* When set to retry the connection, we must to go back to * the CONNECT state */ if(retry) { if((drc == CURLE_OK) || (drc == CURLE_SEND_ERROR)) { follow = FOLLOW_RETRY; drc = Curl_follow(data, newurl, follow); if(drc == CURLE_OK) { multistate(data, CURLM_STATE_CONNECT); result = CURLM_CALL_MULTI_PERFORM; data->result = CURLE_OK; } else { /* Follow failed */ data->result = drc; free(newurl); } } else { /* done didn't return OK or SEND_ERROR */ data->result = drc; free(newurl); } } else { /* Have error handler disconnect conn if we can't retry */ disconnect_conn = TRUE; } } else { /* failure detected */ Curl_posttransfer(data); if(data->easy_conn) Curl_done(&data->easy_conn, data->result, FALSE); disconnect_conn = TRUE; } } break; case CURLM_STATE_DOING: /* we continue DOING until the DO phase is complete */ data->result = Curl_protocol_doing(data->easy_conn, &dophase_done); if(CURLE_OK == data->result) { if(dophase_done) { /* after DO, go DO_DONE or DO_MORE */ multistate(data, data->easy_conn->bits.do_more? CURLM_STATE_DO_MORE: CURLM_STATE_DO_DONE); result = CURLM_CALL_MULTI_PERFORM; } /* dophase_done */ } else { /* failure detected */ Curl_posttransfer(data); Curl_done(&data->easy_conn, data->result, FALSE); disconnect_conn = TRUE; } break; case CURLM_STATE_DO_MORE: /* * When we are connected, DO MORE and then go DO_DONE */ data->result = Curl_do_more(data->easy_conn, &control); /* No need to remove this handle from the send pipeline here since that is done in Curl_done() */ if(CURLE_OK == data->result) { if(control) { /* if positive, advance to DO_DONE if negative, go back to DOING */ multistate(data, control==1? CURLM_STATE_DO_DONE: CURLM_STATE_DOING); result = CURLM_CALL_MULTI_PERFORM; } else /* stay in DO_MORE */ result = CURLM_OK; } else { /* failure detected */ Curl_posttransfer(data); Curl_done(&data->easy_conn, data->result, FALSE); disconnect_conn = TRUE; } break; case CURLM_STATE_DO_DONE: /* Move ourselves from the send to recv pipeline */ Curl_move_handle_from_send_to_recv_pipe(data, data->easy_conn); /* Check if we can move pending requests to send pipe */ Curl_multi_process_pending_handles(multi); /* Only perform the transfer if there's a good socket to work with. Having both BAD is a signal to skip immediately to DONE */ if((data->easy_conn->sockfd != CURL_SOCKET_BAD) || (data->easy_conn->writesockfd != CURL_SOCKET_BAD)) multistate(data, CURLM_STATE_WAITPERFORM); else multistate(data, CURLM_STATE_DONE); result = CURLM_CALL_MULTI_PERFORM; break; case CURLM_STATE_WAITPERFORM: /* Wait for our turn to PERFORM */ if(!data->easy_conn->readchannel_inuse && isHandleAtHead(data, data->easy_conn->recv_pipe)) { /* Grab the channel */ data->easy_conn->readchannel_inuse = TRUE; multistate(data, CURLM_STATE_PERFORM); result = CURLM_CALL_MULTI_PERFORM; } #ifdef DEBUGBUILD else { infof(data, "WAITPERFORM: Conn %ld recv pipe %zu inuse %s athead %s\n", data->easy_conn->connection_id, data->easy_conn->recv_pipe->size, data->easy_conn->readchannel_inuse?"TRUE":"FALSE", isHandleAtHead(data, data->easy_conn->recv_pipe)?"TRUE":"FALSE"); } #endif break; case CURLM_STATE_TOOFAST: /* limit-rate exceeded in either direction */ /* if both rates are within spec, resume transfer */ if(Curl_pgrsUpdate(data->easy_conn)) data->result = CURLE_ABORTED_BY_CALLBACK; else data->result = Curl_speedcheck(data, now); if(( (data->set.max_send_speed == 0) || (data->progress.ulspeed < data->set.max_send_speed )) && ( (data->set.max_recv_speed == 0) || (data->progress.dlspeed < data->set.max_recv_speed))) multistate(data, CURLM_STATE_PERFORM); break; case CURLM_STATE_PERFORM: { char *newurl = NULL; bool retry = FALSE; /* check if over send speed */ if((data->set.max_send_speed > 0) && (data->progress.ulspeed > data->set.max_send_speed)) { int buffersize; multistate(data, CURLM_STATE_TOOFAST); /* calculate upload rate-limitation timeout. */ buffersize = (int)(data->set.buffer_size ? data->set.buffer_size : BUFSIZE); timeout_ms = Curl_sleep_time(data->set.max_send_speed, data->progress.ulspeed, buffersize); Curl_expire(data, timeout_ms); break; } /* check if over recv speed */ if((data->set.max_recv_speed > 0) && (data->progress.dlspeed > data->set.max_recv_speed)) { int buffersize; multistate(data, CURLM_STATE_TOOFAST); /* Calculate download rate-limitation timeout. */ buffersize = (int)(data->set.buffer_size ? data->set.buffer_size : BUFSIZE); timeout_ms = Curl_sleep_time(data->set.max_recv_speed, data->progress.dlspeed, buffersize); Curl_expire(data, timeout_ms); break; } /* read/write data if it is ready to do so */ data->result = Curl_readwrite(data->easy_conn, &done); k = &data->req; if(!(k->keepon & KEEP_RECV)) { /* We're done receiving */ data->easy_conn->readchannel_inuse = FALSE; } if(!(k->keepon & KEEP_SEND)) { /* We're done sending */ data->easy_conn->writechannel_inuse = FALSE; } if(done || (data->result == CURLE_RECV_ERROR)) { /* If CURLE_RECV_ERROR happens early enough, we assume it was a race * condition and the server closed the re-used connection exactly when * we wanted to use it, so figure out if that is indeed the case. */ CURLcode ret = Curl_retry_request(data->easy_conn, &newurl); if(!ret) retry = (newurl)?TRUE:FALSE; if(retry) { /* if we are to retry, set the result to OK and consider the request as done */ data->result = CURLE_OK; done = TRUE; } } if(data->result) { /* * The transfer phase returned error, we mark the connection to get * closed to prevent being re-used. This is because we can't possibly * know if the connection is in a good shape or not now. Unless it is * a protocol which uses two "channels" like FTP, as then the error * happened in the data connection. */ if(!(data->easy_conn->handler->flags & PROTOPT_DUAL)) data->easy_conn->bits.close = TRUE; Curl_posttransfer(data); Curl_done(&data->easy_conn, data->result, FALSE); } else if(done) { followtype follow=FOLLOW_NONE; /* call this even if the readwrite function returned error */ Curl_posttransfer(data); /* we're no longer receiving */ Curl_removeHandleFromPipeline(data, data->easy_conn->recv_pipe); /* expire the new receiving pipeline head */ if(data->easy_conn->recv_pipe->head) Curl_expire(data->easy_conn->recv_pipe->head->ptr, 1); /* Check if we can move pending requests to send pipe */ Curl_multi_process_pending_handles(multi); /* When we follow redirects or is set to retry the connection, we must to go back to the CONNECT state */ if(data->req.newurl || retry) { if(!retry) { /* if the URL is a follow-location and not just a retried request then figure out the URL here */ newurl = data->req.newurl; data->req.newurl = NULL; follow = FOLLOW_REDIR; } else follow = FOLLOW_RETRY; data->result = Curl_done(&data->easy_conn, CURLE_OK, FALSE); if(CURLE_OK == data->result) { data->result = Curl_follow(data, newurl, follow); if(CURLE_OK == data->result) { multistate(data, CURLM_STATE_CONNECT); result = CURLM_CALL_MULTI_PERFORM; newurl = NULL; /* handed over the memory ownership to Curl_follow(), make sure we don't free() it here */ } } } else { /* after the transfer is done, go DONE */ /* but first check to see if we got a location info even though we're not following redirects */ if(data->req.location) { if(newurl) free(newurl); newurl = data->req.location; data->req.location = NULL; data->result = Curl_follow(data, newurl, FOLLOW_FAKE); if(CURLE_OK == data->result) newurl = NULL; /* allocation was handed over Curl_follow() */ else disconnect_conn = TRUE; } multistate(data, CURLM_STATE_DONE); result = CURLM_CALL_MULTI_PERFORM; } } if(newurl) free(newurl); break; } case CURLM_STATE_DONE: /* this state is highly transient, so run another loop after this */ result = CURLM_CALL_MULTI_PERFORM; if(data->easy_conn) { CURLcode res; /* Remove ourselves from the receive pipeline, if we are there. */ Curl_removeHandleFromPipeline(data, data->easy_conn->recv_pipe); /* Check if we can move pending requests to send pipe */ Curl_multi_process_pending_handles(multi); /* post-transfer command */ res = Curl_done(&data->easy_conn, CURLE_OK, FALSE); /* allow a previously set error code take precedence */ if(!data->result) data->result = res; /* * If there are other handles on the pipeline, Curl_done won't set * easy_conn to NULL. In such a case, curl_multi_remove_handle() can * access free'd data, if the connection is free'd and the handle * removed before we perform the processing in CURLM_STATE_COMPLETED */ if(data->easy_conn) data->easy_conn = NULL; } if(data->set.wildcardmatch) { if(data->wildcard.state != CURLWC_DONE) { /* if a wildcard is set and we are not ending -> lets start again with CURLM_STATE_INIT */ multistate(data, CURLM_STATE_INIT); break; } } /* after we have DONE what we're supposed to do, go COMPLETED, and it doesn't matter what the Curl_done() returned! */ multistate(data, CURLM_STATE_COMPLETED); break; case CURLM_STATE_COMPLETED: /* 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. */ /* Important: reset the conn pointer so that we don't point to memory that could be freed anytime */ data->easy_conn = NULL; Curl_expire(data, 0); /* stop all timers */ break; case CURLM_STATE_MSGSENT: return CURLM_OK; /* do nothing */ default: return CURLM_INTERNAL_ERROR; } if(data->mstate < CURLM_STATE_COMPLETED) { if(CURLE_OK != data->result) { /* * If an error was returned, and we aren't in completed state now, * then we go to completed and consider this transfer aborted. */ /* NOTE: no attempt to disconnect connections must be made in the case blocks above - cleanup happens only here */ data->state.pipe_broke = FALSE; if(data->easy_conn) { /* if this has a connection, unsubscribe from the pipelines */ data->easy_conn->writechannel_inuse = FALSE; data->easy_conn->readchannel_inuse = FALSE; Curl_removeHandleFromPipeline(data, data->easy_conn->send_pipe); Curl_removeHandleFromPipeline(data, data->easy_conn->recv_pipe); /* Check if we can move pending requests to send pipe */ Curl_multi_process_pending_handles(multi); if(disconnect_conn) { /* disconnect properly */ Curl_disconnect(data->easy_conn, /* dead_connection */ FALSE); /* This is where we make sure that the easy_conn pointer is reset. We don't have to do this in every case block above where a failure is detected */ data->easy_conn = NULL; } } else if(data->mstate == CURLM_STATE_CONNECT) { /* Curl_connect() failed */ (void)Curl_posttransfer(data); } multistate(data, CURLM_STATE_COMPLETED); } /* if there's still a connection to use, call the progress function */ else if(data->easy_conn && Curl_pgrsUpdate(data->easy_conn)) { /* aborted due to progress callback return code must close the connection */ data->result = CURLE_ABORTED_BY_CALLBACK; data->easy_conn->bits.close = TRUE; /* if not yet in DONE state, go there, otherwise COMPLETED */ multistate(data, (data->mstate < CURLM_STATE_DONE)? CURLM_STATE_DONE: CURLM_STATE_COMPLETED); result = CURLM_CALL_MULTI_PERFORM; } } } WHILE_FALSE; /* just to break out from! */ if(CURLM_STATE_COMPLETED == data->mstate) { /* now fill in the Curl_message with this info */ msg = &data->msg; msg->extmsg.msg = CURLMSG_DONE; msg->extmsg.easy_handle = data; msg->extmsg.data.result = data->result; result = multi_addmsg(multi, msg); multistate(data, CURLM_STATE_MSGSENT); } return result; } CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles) { struct Curl_multi *multi=(struct Curl_multi *)multi_handle; struct SessionHandle *data; CURLMcode returncode=CURLM_OK; struct Curl_tree *t; struct timeval now = Curl_tvnow(); if(!GOOD_MULTI_HANDLE(multi)) return CURLM_BAD_HANDLE; data=multi->easyp; while(data) { CURLMcode result; struct WildcardData *wc = &data->wildcard; if(data->set.wildcardmatch) { if(!wc->filelist) { CURLcode ret = Curl_wildcard_init(wc); /* init wildcard structures */ if(ret) return CURLM_OUT_OF_MEMORY; } } do result = multi_runsingle(multi, now, data); while(CURLM_CALL_MULTI_PERFORM == result); if(data->set.wildcardmatch) { /* destruct wildcard structures if it is needed */ if(wc->state == CURLWC_DONE || result) Curl_wildcard_dtor(wc); } if(result) returncode = result; data = data->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. * * It is important that the 'now' value is set at the entry of this function * and not for the current time as it may have ticked a little while since * then and then we risk this loop to remove timers that actually have not * been handled! */ do { multi->timetree = Curl_splaygetbest(now, multi->timetree, &t); if(t) /* the removed may have another timeout in queue */ (void)add_next_timeout(now, multi, t->payload); } while(t); *running_handles = multi->num_alive; if(CURLM_OK >= returncode) update_timer(multi); return returncode; } static void close_all_connections(struct Curl_multi *multi) { struct connectdata *conn; conn = Curl_conncache_find_first_connection(multi->conn_cache); while(conn) { conn->data = multi->closure_handle; /* This will remove the connection from the cache */ (void)Curl_disconnect(conn, FALSE); conn = Curl_conncache_find_first_connection(multi->conn_cache); } } CURLMcode curl_multi_cleanup(CURLM *multi_handle) { struct Curl_multi *multi=(struct Curl_multi *)multi_handle; struct SessionHandle *data; struct SessionHandle *nextdata; if(GOOD_MULTI_HANDLE(multi)) { bool restore_pipe = FALSE; SIGPIPE_VARIABLE(pipe_st); multi->type = 0; /* not good anymore */ /* Close all the connections in the connection cache */ close_all_connections(multi); if(multi->closure_handle) { sigpipe_ignore(multi->closure_handle, &pipe_st); restore_pipe = TRUE; multi->closure_handle->dns.hostcache = multi->hostcache; Curl_hostcache_clean(multi->closure_handle, multi->closure_handle->dns.hostcache); Curl_close(multi->closure_handle); multi->closure_handle = NULL; } Curl_hash_destroy(multi->sockhash); multi->sockhash = NULL; Curl_conncache_destroy(multi->conn_cache); multi->conn_cache = NULL; /* remove the pending list of messages */ Curl_llist_destroy(multi->msglist, NULL); multi->msglist = NULL; /* remove all easy handles */ data = multi->easyp; while(data) { nextdata=data->next; if(data->dns.hostcachetype == HCACHE_MULTI) { /* clear out the usage of the shared DNS cache */ Curl_hostcache_clean(data, data->dns.hostcache); data->dns.hostcache = NULL; data->dns.hostcachetype = HCACHE_NONE; } /* Clear the pointer to the connection cache */ data->state.conn_cache = NULL; data->multi = NULL; /* clear the association */ data = nextdata; } Curl_hash_destroy(multi->hostcache); multi->hostcache = NULL; /* Free the blacklists by setting them to NULL */ Curl_pipeline_set_site_blacklist(NULL, &multi->pipelining_site_bl); Curl_pipeline_set_server_blacklist(NULL, &multi->pipelining_server_bl); free(multi); if(restore_pipe) sigpipe_restore(&pipe_st); return CURLM_OK; } else return CURLM_BAD_HANDLE; } /* * curl_multi_info_read() * * This function is the primary way for a multi/multi_socket application to * figure out if a transfer has ended. We MUST make this function as fast as * possible as it will be polled frequently and we MUST NOT scan any lists in * here to figure out things. We must scale fine to thousands of handles and * beyond. The current design is fully O(1). */ CURLMsg *curl_multi_info_read(CURLM *multi_handle, int *msgs_in_queue) { struct Curl_multi *multi=(struct Curl_multi *)multi_handle; struct Curl_message *msg; *msgs_in_queue = 0; /* default to none */ if(GOOD_MULTI_HANDLE(multi) && Curl_llist_count(multi->msglist)) { /* there is one or more messages in the list */ struct curl_llist_element *e; /* extract the head of the list to return */ e = multi->msglist->head; msg = e->ptr; /* remove the extracted entry */ Curl_llist_remove(multi->msglist, e, NULL); *msgs_in_queue = curlx_uztosi(Curl_llist_count(multi->msglist)); return &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 SessionHandle *data) { curl_socket_t socks[MAX_SOCKSPEREASYHANDLE]; int i; struct Curl_sh_entry *entry; curl_socket_t s; int num; unsigned int curraction; bool remove_sock_from_hash; 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(data, 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, data); if(!entry) /* fatal */ return; } /* we know (entry != NULL) at this point, see the logic above */ if(multi->socket_cb) multi->socket_cb(data, s, action, multi->socket_userp, entry->socketp); 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< data->numsocks; i++) { int j; s = data->sockets[i]; for(j=0; jsockhash, (char *)&s, sizeof(s)); if(entry) { /* check if the socket to be removed serves a connection which has other easy-s in a pipeline. In this case the socket should not be removed. */ struct connectdata *easy_conn = data->easy_conn; if(easy_conn) { if(easy_conn->recv_pipe && easy_conn->recv_pipe->size > 1) { /* the handle should not be removed from the pipe yet */ remove_sock_from_hash = FALSE; /* Update the sockhash entry to instead point to the next in line for the recv_pipe, or the first (in case this particular easy isn't already) */ if(entry->easy == data) { if(isHandleAtHead(data, easy_conn->recv_pipe)) entry->easy = easy_conn->recv_pipe->head->next->ptr; else entry->easy = easy_conn->recv_pipe->head->ptr; } } if(easy_conn->send_pipe && easy_conn->send_pipe->size > 1) { /* the handle should not be removed from the pipe yet */ remove_sock_from_hash = FALSE; /* Update the sockhash entry to instead point to the next in line for the send_pipe, or the first (in case this particular easy isn't already) */ if(entry->easy == data) { if(isHandleAtHead(data, easy_conn->send_pipe)) entry->easy = easy_conn->send_pipe->head->next->ptr; else entry->easy = easy_conn->send_pipe->head->ptr; } } /* Don't worry about overwriting recv_pipe head with send_pipe_head, when action will be asked on the socket (see multi_socket()), the head of the correct pipe will be taken according to the action. */ } } else /* 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 */ remove_sock_from_hash = FALSE; if(remove_sock_from_hash) { /* in this case 'entry' is always non-NULL */ if(multi->socket_cb) multi->socket_cb(data, s, CURL_POLL_REMOVE, multi->socket_userp, entry->socketp); sh_delentry(multi->sockhash, s); } } } memcpy(data->sockets, socks, num*sizeof(curl_socket_t)); data->numsocks = num; } /* * Curl_multi_closed() * * Used by the connect code to tell the multi_socket code that one of the * sockets we were using have just been closed. This function will then * remove it from the sockethash for this handle to make the multi_socket API * behave properly, especially for the case when libcurl will create another * socket again and it gets the same file descriptor number. */ void Curl_multi_closed(struct connectdata *conn, curl_socket_t s) { struct Curl_multi *multi = conn->data->multi; if(multi) { /* this is set if this connection is part of a handle that is added to a multi handle, and only then this is necessary */ struct Curl_sh_entry *entry = Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s)); if(entry) { if(multi->socket_cb) multi->socket_cb(conn->data, s, CURL_POLL_REMOVE, multi->socket_userp, entry->socketp); /* now remove it from the socket hash */ sh_delentry(multi->sockhash, s); } } } /* * add_next_timeout() * * Each SessionHandle has a list of timeouts. The add_next_timeout() is called * when it has just been removed from the splay tree because the timeout has * expired. This function is then to advance in the list to pick the next * timeout to use (skip the already expired ones) and add this node back to * the splay tree again. * * The splay tree only has each sessionhandle as a single node and the nearest * timeout is used to sort it on. */ static CURLMcode add_next_timeout(struct timeval now, struct Curl_multi *multi, struct SessionHandle *d) { struct timeval *tv = &d->state.expiretime; struct curl_llist *list = d->state.timeoutlist; struct curl_llist_element *e; /* move over the timeout list for this specific handle and remove all timeouts that are now passed tense and store the next pending timeout in *tv */ for(e = list->head; e; ) { struct curl_llist_element *n = e->next; long diff = curlx_tvdiff(*(struct timeval *)e->ptr, now); if(diff <= 0) /* remove outdated entry */ Curl_llist_remove(list, e, NULL); else /* the list is sorted so get out on the first mismatch */ break; e = n; } e = list->head; if(!e) { /* clear the expire times within the handles that we remove from the splay tree */ tv->tv_sec = 0; tv->tv_usec = 0; } else { /* copy the first entry to 'tv' */ memcpy(tv, e->ptr, sizeof(*tv)); /* remove first entry from list */ Curl_llist_remove(list, e, NULL); /* insert this node again into the splay */ multi->timetree = Curl_splayinsert(*tv, multi->timetree, &d->state.timenode); } return CURLM_OK; } static CURLMcode multi_socket(struct Curl_multi *multi, bool checkall, curl_socket_t s, int ev_bitmask, int *running_handles) { CURLMcode result = CURLM_OK; struct SessionHandle *data = NULL; struct Curl_tree *t; struct timeval now = Curl_tvnow(); if(checkall) { /* *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 */ if(result != CURLM_BAD_HANDLE) { data=multi->easyp; while(data) { singlesocket(multi, data); data = data->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, we can't act on it but we ignore this fact. In real-world tests it has been proved that libevent can in fact give the application actions even though the socket was just previously asked to get removed, so thus we better survive stray socket actions and just move on. */ ; else { data = entry->easy; if(data->magic != CURLEASY_MAGIC_NUMBER) /* bad bad bad bad bad bad bad */ return CURLM_INTERNAL_ERROR; /* If the pipeline is enabled, take the handle which is in the head of the pipeline. If we should write into the socket, take the send_pipe head. If we should read from the socket, take the recv_pipe head. */ if(data->easy_conn) { if((ev_bitmask & CURL_POLL_OUT) && data->easy_conn->send_pipe && data->easy_conn->send_pipe->head) data = data->easy_conn->send_pipe->head->ptr; else if((ev_bitmask & CURL_POLL_IN) && data->easy_conn->recv_pipe && data->easy_conn->recv_pipe->head) data = data->easy_conn->recv_pipe->head->ptr; } if(data->easy_conn && !(data->easy_conn->handler->flags & PROTOPT_DIRLOCK)) /* set socket event bitmask if they're not locked */ data->easy_conn->cselect_bits = ev_bitmask; do result = multi_runsingle(multi, now, data); while(CURLM_CALL_MULTI_PERFORM == result); if(data->easy_conn && !(data->easy_conn->handler->flags & PROTOPT_DIRLOCK)) /* clear the bitmask only if not locked */ data->easy_conn->cselect_bits = 0; if(CURLM_OK >= result) /* get the socket(s) and check if the state has been changed since last */ singlesocket(multi, data); /* 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 */ now = Curl_tvnow(); /* get a newer time since the multi_runsingle() loop may have taken some time */ } } else { /* Asked to run due to time-out. Clear the 'lastcall' variable to force update_timer() to trigger a callback to the app again even if the same timeout is still the one to run after this call. That handles the case when the application asks libcurl to run the timeout prematurely. */ memset(&multi->timer_lastcall, 0, sizeof(multi->timer_lastcall)); } /* * 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 { /* the first loop lap 'data' can be NULL */ if(data) { do result = multi_runsingle(multi, now, data); while(CURLM_CALL_MULTI_PERFORM == result); if(CURLM_OK >= result) /* get the socket(s) and check if the state has been changed since last */ singlesocket(multi, data); } /* Check if there's one (more) expired timer to deal with! This function extracts a matching node if there is one */ multi->timetree = Curl_splaygetbest(now, multi->timetree, &t); if(t) { data = t->payload; /* assign this for next loop */ (void)add_next_timeout(now, multi, t->payload); } } while(t); *running_handles = multi->num_alive; return result; } #undef curl_multi_setopt 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 = (0 != va_arg(param, long)) ? TRUE : FALSE; 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; case CURLMOPT_MAXCONNECTS: multi->maxconnects = va_arg(param, long); break; case CURLMOPT_MAX_HOST_CONNECTIONS: multi->max_host_connections = va_arg(param, long); break; case CURLMOPT_MAX_PIPELINE_LENGTH: multi->max_pipeline_length = va_arg(param, long); break; case CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE: multi->content_length_penalty_size = va_arg(param, long); break; case CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE: multi->chunk_length_penalty_size = va_arg(param, long); break; case CURLMOPT_PIPELINING_SITE_BL: res = Curl_pipeline_set_site_blacklist(va_arg(param, char **), &multi->pipelining_site_bl); break; case CURLMOPT_PIPELINING_SERVER_BL: res = Curl_pipeline_set_server_blacklist(va_arg(param, char **), &multi->pipelining_server_bl); break; case CURLMOPT_MAX_TOTAL_CONNECTIONS: multi->max_total_connections = va_arg(param, long); break; default: res = CURLM_UNKNOWN_OPTION; break; } va_end(param); return res; } /* we define curl_multi_socket() in the public multi.h header */ #undef curl_multi_socket 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, 0, running_handles); if(CURLM_OK >= result) update_timer((struct Curl_multi *)multi_handle); return result; } CURLMcode curl_multi_socket_action(CURLM *multi_handle, curl_socket_t s, int ev_bitmask, int *running_handles) { CURLMcode result = multi_socket((struct Curl_multi *)multi_handle, FALSE, s, ev_bitmask, 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, 0, 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) { static struct timeval tv_zero = {0,0}; 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(tv_zero, multi->timetree); if(Curl_splaycomparekeys(multi->timetree->key, now) > 0) { /* some time left before expiration */ *timeout_ms = curlx_tvdiff(multi->timetree->key, now); if(!*timeout_ms) /* * Since we only provide millisecond resolution on the returned value * and the diff might be less than one millisecond here, we don't * return zero as that may cause short bursts of busyloops on fast * processors while the diff is still present but less than one * millisecond! instead we return 1 until the time is ripe. */ *timeout_ms=1; } else /* 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)) { return -1; } if(timeout_ms < 0) { static const struct timeval none={0,0}; if(Curl_splaycomparekeys(none, multi->timer_lastcall)) { multi->timer_lastcall = none; /* there's no timeout now but there was one previously, tell the app to disable it */ return multi->timer_cb((CURLM*)multi, -1, multi->timer_userp); } 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(Curl_splaycomparekeys(multi->timetree->key, multi->timer_lastcall) == 0) return 0; multi->timer_lastcall = multi->timetree->key; return multi->timer_cb((CURLM*)multi, timeout_ms, multi->timer_userp); } void Curl_multi_set_easy_connection(struct SessionHandle *handle, struct connectdata *conn) { handle->easy_conn = conn; } static bool isHandleAtHead(struct SessionHandle *handle, struct curl_llist *pipeline) { struct curl_llist_element *curr = pipeline->head; if(curr) return (curr->ptr == handle) ? TRUE : FALSE; return FALSE; } /* * multi_freetimeout() * * Callback used by the llist system when a single timeout list entry is * destroyed. */ static void multi_freetimeout(void *user, void *entryptr) { (void)user; /* the entry was plain malloc()'ed */ free(entryptr); } /* * multi_addtimeout() * * Add a timestamp to the list of timeouts. Keep the list sorted so that head * of list is always the timeout nearest in time. * */ static CURLMcode multi_addtimeout(struct curl_llist *timeoutlist, struct timeval *stamp) { struct curl_llist_element *e; struct timeval *timedup; struct curl_llist_element *prev = NULL; timedup = malloc(sizeof(*timedup)); if(!timedup) return CURLM_OUT_OF_MEMORY; /* copy the timestamp */ memcpy(timedup, stamp, sizeof(*timedup)); if(Curl_llist_count(timeoutlist)) { /* find the correct spot in the list */ for(e = timeoutlist->head; e; e = e->next) { struct timeval *checktime = e->ptr; long diff = curlx_tvdiff(*checktime, *timedup); if(diff > 0) break; prev = e; } } /* else this is the first timeout on the list */ if(!Curl_llist_insert_next(timeoutlist, prev, timedup)) { free(timedup); return CURLM_OUT_OF_MEMORY; } return CURLM_OK; } /* * Curl_expire() * * 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() * * Note that the timeout will be added to a queue of timeouts if it defines a * moment in time that is later than the current head of queue. * * Pass zero to clear all timeout values for this handle. */ 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 while there is still an associated multi struct remaining! */ if(!multi) return; if(!milli) { /* No timeout, clear the time data. */ if(nowp->tv_sec || nowp->tv_usec) { /* Since this is an cleared time, we must remove the previous entry from the splay tree */ struct curl_llist *list = data->state.timeoutlist; rc = Curl_splayremovebyaddr(multi->timetree, &data->state.timenode, &multi->timetree); if(rc) infof(data, "Internal error clearing splay node = %d\n", rc); /* flush the timeout list too */ while(list->size > 0) Curl_llist_remove(list, list->tail, NULL); #ifdef DEBUGBUILD infof(data, "Expire cleared\n"); #endif nowp->tv_sec = 0; nowp->tv_usec = 0; } } else { struct timeval set; set = Curl_tvnow(); set.tv_sec += milli/1000; set.tv_usec += (milli%1000)*1000; if(set.tv_usec >= 1000000) { set.tv_sec++; set.tv_usec -= 1000000; } if(nowp->tv_sec || nowp->tv_usec) { /* 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 just add it to the queue and get out */ multi_addtimeout(data->state.timeoutlist, &set); return; } /* the new time is newer than the presently set one, so add the current to the queue and update the head */ multi_addtimeout(data->state.timeoutlist, nowp); /* 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; data->state.timenode.payload = data; multi->timetree = Curl_splayinsert(*nowp, 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; } size_t Curl_multi_max_host_connections(struct Curl_multi *multi) { return multi ? multi->max_host_connections : 0; } size_t Curl_multi_max_total_connections(struct Curl_multi *multi) { return multi ? multi->max_total_connections : 0; } size_t Curl_multi_max_pipeline_length(struct Curl_multi *multi) { return multi ? multi->max_pipeline_length : 0; } curl_off_t Curl_multi_content_length_penalty_size(struct Curl_multi *multi) { return multi ? multi->content_length_penalty_size : 0; } curl_off_t Curl_multi_chunk_length_penalty_size(struct Curl_multi *multi) { return multi ? multi->chunk_length_penalty_size : 0; } struct curl_llist *Curl_multi_pipelining_site_bl(struct Curl_multi *multi) { return multi->pipelining_site_bl; } struct curl_llist *Curl_multi_pipelining_server_bl(struct Curl_multi *multi) { return multi->pipelining_server_bl; } void Curl_multi_process_pending_handles(struct Curl_multi *multi) { struct SessionHandle *data; data=multi->easyp; while(data) { if(data->mstate == CURLM_STATE_CONNECT_PEND) { multistate(data, CURLM_STATE_CONNECT); /* Make sure that the handle will be processed soonish. */ Curl_expire(data, 1); } data = data->next; /* operate on next handle */ } } #ifdef DEBUGBUILD void Curl_multi_dump(const struct Curl_multi *multi_handle) { struct Curl_multi *multi=(struct Curl_multi *)multi_handle; struct SessionHandle *data; int i; fprintf(stderr, "* Multi status: %d handles, %d alive\n", multi->num_easy, multi->num_alive); for(data=multi->easyp; data; data = data->next) { if(data->mstate < CURLM_STATE_COMPLETED) { /* only display handles that are not completed */ fprintf(stderr, "handle %p, state %s, %d sockets\n", (void *)data, statename[data->mstate], data->numsocks); for(i=0; i < data->numsocks; i++) { curl_socket_t s = data->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(data->numsocks) fprintf(stderr, "\n"); } } } #endif curl-7.35.0/lib/curl_memory.h0000644000175000017500000001234712262353672012767 00000000000000#ifndef HEADER_CURL_MEMORY_H #define HEADER_CURL_MEMORY_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* * Nasty internal details ahead... * * File curl_memory.h must be included by _all_ *.c source files * that use memory related functions strdup, malloc, calloc, realloc * or free, and given source file is used to build libcurl library. * * There is nearly no exception to above rule. All libcurl source * files in 'lib' subdirectory as well as those living deep inside * 'packages' subdirectories and linked together in order to build * libcurl library shall follow it. * * File lib/strdup.c is an exception, given that it provides a strdup * clone implementation while using malloc. Extra care needed inside * this one. TODO: revisit this paragraph and related code. * * The need for curl_memory.h inclusion is due to libcurl's feature * of allowing library user to provide memory replacement functions, * memory callbacks, at runtime with curl_global_init_mem() * * Any *.c source file used to build libcurl library that does not * include curl_memory.h and uses any memory function of the five * mentioned above will compile without any indication, but it will * trigger weird memory related issues at runtime. * * OTOH some source files from 'lib' subdirectory may additionally be * used directly as source code when using some curlx_ functions by * third party programs that don't even use libcurl at all. When using * these source files in this way it is necessary these are compiled * with CURLX_NO_MEMORY_CALLBACKS defined, in order to ensure that no * attempt of calling libcurl's memory callbacks is done from code * which can not use this machinery. * * Notice that libcurl's 'memory tracking' system works chaining into * the memory callback machinery. This implies that when compiling * 'lib' source files with CURLX_NO_MEMORY_CALLBACKS defined this file * disengages usage of libcurl's 'memory tracking' system, defining * MEMDEBUG_NODEFINES and overriding CURLDEBUG purpose. * * CURLX_NO_MEMORY_CALLBACKS takes precedence over CURLDEBUG. This is * done in order to allow building a 'memory tracking' enabled libcurl * and at the same time allow building programs which do not use it. * * Programs and libraries in 'tests' subdirectories have specific * purposes and needs, and as such each one will use whatever fits * best, depending additionally wether it links with libcurl or not. * * Caveat emptor. Proper curlx_* separation is a work in progress * the same as CURLX_NO_MEMORY_CALLBACKS usage, some adjustments may * still be required. IOW don't use them yet, there are sharp edges. */ #ifdef HEADER_CURL_MEMDEBUG_H #error "Header memdebug.h shall not be included before curl_memory.h" #endif #ifndef CURLX_NO_MEMORY_CALLBACKS #include /* for the callback 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; #if defined(WIN32) && defined(UNICODE) extern curl_wcsdup_callback Curl_cwcsdup; #endif #ifndef CURLDEBUG /* * libcurl's 'memory tracking' system defines strdup, malloc, calloc, * realloc and free, along with others, in memdebug.h in a different * way although still using memory callbacks forward declared above. * When using the 'memory tracking' system (CURLDEBUG defined) we do * not define here the five memory functions given that definitions * from memdebug.h are the ones that shall be used. */ #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) #ifdef WIN32 # ifdef UNICODE # undef wcsdup # define wcsdup(ptr) Curl_cwcsdup(ptr) # undef _wcsdup # define _wcsdup(ptr) Curl_cwcsdup(ptr) # undef _tcsdup # define _tcsdup(ptr) Curl_cwcsdup(ptr) # else # undef _tcsdup # define _tcsdup(ptr) Curl_cstrdup(ptr) # endif #endif #endif /* CURLDEBUG */ #else /* CURLX_NO_MEMORY_CALLBACKS */ #ifndef MEMDEBUG_NODEFINES #define MEMDEBUG_NODEFINES #endif #endif /* CURLX_NO_MEMORY_CALLBACKS */ #endif /* HEADER_CURL_MEMORY_H */ curl-7.35.0/lib/objnames.inc0000644000175000017500000001046512213173003012531 00000000000000# *************************************************************************** # * _ _ ____ _ # * Project ___| | | | _ \| | # * / __| | | | |_) | | # * | (__| |_| | _ <| |___ # * \___|\___/|_| \_\_____| # * # * Copyright (C) 2012, 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. # * # *************************************************************************** # # This file is sourced from curl/packages/OS400/initscript.sh and # other Bourne shell scripts. Keep it as portable as possible. # # # curl_10char_object_name # # This shell function accepts a single string argument with unspecified # length representing a (*.c) source file name and returns a string which # is a transformation of given argument. # # The intended purpose of this function is to transliterate a (*.c) source # file name that may be longer than 10 characters, or not, into a string # with at most 10 characters which may be used as an OS/400 object name. # # This function might not be universally usefull, nor we care about it. # # It is intended to be used with libcurl's (*.c) source file names, so # dependency on libcurl's source file naming scheme is acceptable and # good enough for its intended use. Specifically it makes use of the fact # that libcurl's (*.c) source file names which may be longer than 10 chars # are conformed with underscore '_' separated substrings, or separated by # other character which does not belong to the [0-9], [a-z] or [A-Z] sets. # # This allows repeatable and automatic short object name generation with # no need for a hardcoded mapping table. # # Transformation is done in the following way: # # 1) Leading directory components are removed. # 2) Leftmost dot character and any other char following it are removed. # 3) Lowercase characters are transliterated to uppercase. # 4) Characters not in [A-Z] or [0-9] are transliterated to underscore '_'. # 5) Every sequence of one or more underscores is replaced with a single one. # 6) Five leftmost substrings which end in an underscore character are # replaced by the first character of each substring, while retaining # the rest of the string. # 7) Finally the result is truncated to 10 characters. # # Resulting object name may be shorter than 10 characters. # # Test case 1221 does unit testng of this function and also verifies # that it is possible to generate distinct short object names for all # curl and libcurl *.c source file names. # curl_10char_object_name() { echo "${1}" | \ sed -e 's:.*/::' \ -e 's:[.].*::' \ -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:' \ -e 's:[^ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_]:_:g' \ -e 's:__*:_:g' \ -e 's:\([^_]\)[^_]*_\(.*\):\1\2:' \ -e 's:\([^_]\)\([^_]\)[^_]*_\(.*\):\1\2\3:' \ -e 's:\([^_]\)\([^_]\)\([^_]\)[^_]*_\(.*\):\1\2\3\4:' \ -e 's:\([^_]\)\([^_]\)\([^_]\)\([^_]\)[^_]*_\(.*\):\1\2\3\4\5:' \ -e 's:\([^_]\)\([^_]\)\([^_]\)\([^_]\)\([^_]\)[^_]*_\(.*\):\1\2\3\4\5\6:' \ -e 's:^\(..........\).*:\1:' } # # curl_8char_object_name # # Same as curl_10char_object_name() description and details above, except # that object name is limited to 8 charcters maximum. # curl_8char_object_name() { echo "${1}" | \ sed -e 's:.*/::' \ -e 's:[.].*::' \ -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:' \ -e 's:[^ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_]:_:g' \ -e 's:__*:_:g' \ -e 's:\([^_]\)[^_]*_\(.*\):\1\2:' \ -e 's:\([^_]\)\([^_]\)[^_]*_\(.*\):\1\2\3:' \ -e 's:\([^_]\)\([^_]\)\([^_]\)[^_]*_\(.*\):\1\2\3\4:' \ -e 's:\([^_]\)\([^_]\)\([^_]\)\([^_]\)[^_]*_\(.*\):\1\2\3\4\5:' \ -e 's:\([^_]\)\([^_]\)\([^_]\)\([^_]\)\([^_]\)[^_]*_\(.*\):\1\2\3\4\5\6:' \ -e 's:^\(........\).*:\1:' } # end of objectname.inc curl-7.35.0/lib/warnless.c0000644000175000017500000002511012213173003012233 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(__INTEL_COMPILER) && defined(__unix__) #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #endif /* __INTEL_COMPILER && __unix__ */ #define BUILDING_WARNLESS_C 1 #include "warnless.h" #define CURL_MASK_SCHAR 0x7F #define CURL_MASK_UCHAR 0xFF #if (SIZEOF_SHORT == 2) # define CURL_MASK_SSHORT 0x7FFF # define CURL_MASK_USHORT 0xFFFF #elif (SIZEOF_SHORT == 4) # define CURL_MASK_SSHORT 0x7FFFFFFF # define CURL_MASK_USHORT 0xFFFFFFFF #elif (SIZEOF_SHORT == 8) # define CURL_MASK_SSHORT 0x7FFFFFFFFFFFFFFF # define CURL_MASK_USHORT 0xFFFFFFFFFFFFFFFF #else # error "SIZEOF_SHORT not defined" #endif #if (SIZEOF_INT == 2) # define CURL_MASK_SINT 0x7FFF # define CURL_MASK_UINT 0xFFFF #elif (SIZEOF_INT == 4) # define CURL_MASK_SINT 0x7FFFFFFF # define CURL_MASK_UINT 0xFFFFFFFF #elif (SIZEOF_INT == 8) # define CURL_MASK_SINT 0x7FFFFFFFFFFFFFFF # define CURL_MASK_UINT 0xFFFFFFFFFFFFFFFF #elif (SIZEOF_INT == 16) # define CURL_MASK_SINT 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF # define CURL_MASK_UINT 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF #else # error "SIZEOF_INT not defined" #endif #if (CURL_SIZEOF_LONG == 2) # define CURL_MASK_SLONG 0x7FFFL # define CURL_MASK_ULONG 0xFFFFUL #elif (CURL_SIZEOF_LONG == 4) # define CURL_MASK_SLONG 0x7FFFFFFFL # define CURL_MASK_ULONG 0xFFFFFFFFUL #elif (CURL_SIZEOF_LONG == 8) # define CURL_MASK_SLONG 0x7FFFFFFFFFFFFFFFL # define CURL_MASK_ULONG 0xFFFFFFFFFFFFFFFFUL #elif (CURL_SIZEOF_LONG == 16) # define CURL_MASK_SLONG 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFL # define CURL_MASK_ULONG 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFUL #else # error "CURL_SIZEOF_LONG not defined" #endif #if (CURL_SIZEOF_CURL_OFF_T == 2) # define CURL_MASK_SCOFFT CURL_OFF_T_C(0x7FFF) # define CURL_MASK_UCOFFT CURL_OFF_TU_C(0xFFFF) #elif (CURL_SIZEOF_CURL_OFF_T == 4) # define CURL_MASK_SCOFFT CURL_OFF_T_C(0x7FFFFFFF) # define CURL_MASK_UCOFFT CURL_OFF_TU_C(0xFFFFFFFF) #elif (CURL_SIZEOF_CURL_OFF_T == 8) # define CURL_MASK_SCOFFT CURL_OFF_T_C(0x7FFFFFFFFFFFFFFF) # define CURL_MASK_UCOFFT CURL_OFF_TU_C(0xFFFFFFFFFFFFFFFF) #elif (CURL_SIZEOF_CURL_OFF_T == 16) # define CURL_MASK_SCOFFT CURL_OFF_T_C(0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) # define CURL_MASK_UCOFFT CURL_OFF_TU_C(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) #else # error "CURL_SIZEOF_CURL_OFF_T not defined" #endif #if (SIZEOF_SIZE_T == SIZEOF_SHORT) # define CURL_MASK_SSIZE_T CURL_MASK_SSHORT # define CURL_MASK_USIZE_T CURL_MASK_USHORT #elif (SIZEOF_SIZE_T == SIZEOF_INT) # define CURL_MASK_SSIZE_T CURL_MASK_SINT # define CURL_MASK_USIZE_T CURL_MASK_UINT #elif (SIZEOF_SIZE_T == CURL_SIZEOF_LONG) # define CURL_MASK_SSIZE_T CURL_MASK_SLONG # define CURL_MASK_USIZE_T CURL_MASK_ULONG #elif (SIZEOF_SIZE_T == CURL_SIZEOF_CURL_OFF_T) # define CURL_MASK_SSIZE_T CURL_MASK_SCOFFT # define CURL_MASK_USIZE_T CURL_MASK_UCOFFT #else # error "SIZEOF_SIZE_T not defined" #endif /* ** unsigned long to unsigned short */ unsigned short curlx_ultous(unsigned long ulnum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(ulnum <= (unsigned long) CURL_MASK_USHORT); return (unsigned short)(ulnum & (unsigned long) CURL_MASK_USHORT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** unsigned long to unsigned char */ unsigned char curlx_ultouc(unsigned long ulnum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(ulnum <= (unsigned long) CURL_MASK_UCHAR); return (unsigned char)(ulnum & (unsigned long) CURL_MASK_UCHAR); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** unsigned long to signed int */ int curlx_ultosi(unsigned long ulnum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(ulnum <= (unsigned long) CURL_MASK_SINT); return (int)(ulnum & (unsigned long) CURL_MASK_SINT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** unsigned size_t to signed int */ int curlx_uztosi(size_t uznum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(uznum <= (size_t) CURL_MASK_SINT); return (int)(uznum & (size_t) CURL_MASK_SINT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** unsigned size_t to unsigned long */ unsigned long curlx_uztoul(size_t uznum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif #if (CURL_SIZEOF_LONG < SIZEOF_SIZE_T) DEBUGASSERT(uznum <= (size_t) CURL_MASK_ULONG); #endif return (unsigned long)(uznum & (size_t) CURL_MASK_ULONG); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** unsigned size_t to unsigned int */ unsigned int curlx_uztoui(size_t uznum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif #if (SIZEOF_INT < SIZEOF_SIZE_T) DEBUGASSERT(uznum <= (size_t) CURL_MASK_UINT); #endif return (unsigned int)(uznum & (size_t) CURL_MASK_UINT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** signed long to signed int */ int curlx_sltosi(long slnum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(slnum >= 0); #if (SIZEOF_INT < CURL_SIZEOF_LONG) DEBUGASSERT((unsigned long) slnum <= (unsigned long) CURL_MASK_SINT); #endif return (int)(slnum & (long) CURL_MASK_SINT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** signed long to unsigned int */ unsigned int curlx_sltoui(long slnum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(slnum >= 0); #if (SIZEOF_INT < CURL_SIZEOF_LONG) DEBUGASSERT((unsigned long) slnum <= (unsigned long) CURL_MASK_UINT); #endif return (unsigned int)(slnum & (long) CURL_MASK_UINT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** signed long to unsigned short */ unsigned short curlx_sltous(long slnum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(slnum >= 0); DEBUGASSERT((unsigned long) slnum <= (unsigned long) CURL_MASK_USHORT); return (unsigned short)(slnum & (long) CURL_MASK_USHORT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** unsigned size_t to signed ssize_t */ ssize_t curlx_uztosz(size_t uznum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(uznum <= (size_t) CURL_MASK_SSIZE_T); return (ssize_t)(uznum & (size_t) CURL_MASK_SSIZE_T); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** signed curl_off_t to unsigned size_t */ size_t curlx_sotouz(curl_off_t sonum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(sonum >= 0); return (size_t)(sonum & (curl_off_t) CURL_MASK_USIZE_T); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** signed ssize_t to signed int */ int curlx_sztosi(ssize_t sznum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(sznum >= 0); #if (SIZEOF_INT < SIZEOF_SIZE_T) DEBUGASSERT((size_t) sznum <= (size_t) CURL_MASK_SINT); #endif return (int)(sznum & (ssize_t) CURL_MASK_SINT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** signed int to unsigned size_t */ size_t curlx_sitouz(int sinum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(sinum >= 0); return (size_t) sinum; #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } #ifdef USE_WINSOCK /* ** curl_socket_t to signed int */ int curlx_sktosi(curl_socket_t s) { return (int)((ssize_t) s); } /* ** signed int to curl_socket_t */ curl_socket_t curlx_sitosk(int i) { return (curl_socket_t)((ssize_t) i); } #endif /* USE_WINSOCK */ #if defined(__INTEL_COMPILER) && defined(__unix__) int curlx_FD_ISSET(int fd, fd_set *fdset) { #pragma warning(push) #pragma warning(disable:1469) /* clobber ignored */ return FD_ISSET(fd, fdset); #pragma warning(pop) } void curlx_FD_SET(int fd, fd_set *fdset) { #pragma warning(push) #pragma warning(disable:1469) /* clobber ignored */ FD_SET(fd, fdset); #pragma warning(pop) } void curlx_FD_ZERO(fd_set *fdset) { #pragma warning(push) #pragma warning(disable:593) /* variable was set but never used */ FD_ZERO(fdset); #pragma warning(pop) } unsigned short curlx_htons(unsigned short usnum) { #if (__INTEL_COMPILER == 910) && defined(__i386__) return (unsigned short)(((usnum << 8) & 0xFF00) | ((usnum >> 8) & 0x00FF)); #else #pragma warning(push) #pragma warning(disable:810) /* conversion may lose significant bits */ return htons(usnum); #pragma warning(pop) #endif } unsigned short curlx_ntohs(unsigned short usnum) { #if (__INTEL_COMPILER == 910) && defined(__i386__) return (unsigned short)(((usnum << 8) & 0xFF00) | ((usnum >> 8) & 0x00FF)); #else #pragma warning(push) #pragma warning(disable:810) /* conversion may lose significant bits */ return ntohs(usnum); #pragma warning(pop) #endif } #endif /* __INTEL_COMPILER && __unix__ */ curl-7.35.0/lib/http.h0000644000175000017500000001554312271275502011405 00000000000000#ifndef HEADER_CURL_HTTP_H #define HEADER_CURL_HTTP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_HTTP #ifdef USE_NGHTTP2 #include #endif extern const struct Curl_handler Curl_handler_http; #ifdef USE_SSL extern const struct Curl_handler Curl_handler_https; #endif /* Header specific functions */ bool Curl_compareheader(const char *headerline, /* line to check */ const char *header, /* header keyword _with_ colon */ const char *content); /* content string to find */ char *Curl_checkheaders(struct SessionHandle *data, const char *thisheader); char *Curl_copy_header_value(const char *header); /* ------------------------------------------------------------------------- */ /* * 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 Curl_send_buffer { char *buffer; size_t size_max; size_t size_used; }; typedef struct Curl_send_buffer Curl_send_buffer; Curl_send_buffer *Curl_add_buffer_init(void); CURLcode Curl_add_bufferf(Curl_send_buffer *in, const char *fmt, ...); CURLcode Curl_add_buffer(Curl_send_buffer *in, const void *inptr, size_t size); CURLcode Curl_add_buffer_send(Curl_send_buffer *in, struct connectdata *conn, long *bytes_written, size_t included_body_bytes, int socketindex); CURLcode Curl_add_timecondition(struct SessionHandle *data, Curl_send_buffer *buf); CURLcode Curl_add_custom_headers(struct connectdata *conn, Curl_send_buffer *req_buffer); /* 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, bool premature); CURLcode Curl_http_connect(struct connectdata *conn, bool *done); CURLcode Curl_http_setup_conn(struct connectdata *conn); /* 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, bool proxy, const char *auth); CURLcode Curl_http_auth_act(struct connectdata *conn); CURLcode Curl_http_perhapsrewind(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 /* CURL_DISABLE_HTTP */ /**************************************************************************** * HTTP unique setup ***************************************************************************/ struct HTTP { struct FormData *sendit; curl_off_t postsize; /* off_t to handle large file sizes */ const 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 back { curl_read_callback fread_func; /* backup storage for fread pointer */ void *fread_in; /* backup storage for fread_in pointer */ const 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 */ }; struct http_conn { #ifdef USE_NGHTTP2 nghttp2_session *h2; #else int unused; /* prevent a compiler warning */ #endif }; CURLcode Curl_http_readwrite_headers(struct SessionHandle *data, struct connectdata *conn, ssize_t *nread, bool *stop_reading); /** * 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 */ CURLcode Curl_http_output_auth(struct connectdata *conn, const char *request, const char *path, bool proxytunnel); /* TRUE if this is the request setting up the proxy tunnel */ #endif /* HEADER_CURL_HTTP_H */ curl-7.35.0/lib/x509asn1.h0000644000175000017500000001065112262353672011716 00000000000000#ifndef HEADER_CURL_X509ASN1_H #define HEADER_CURL_X509ASN1_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(USE_QSOSSL) || defined(USE_GSKIT) || defined(USE_NSS) #include "urldata.h" /* * Constants. */ /* ASN.1 classes. */ #define CURL_ASN1_UNIVERSAL 0 #define CURL_ASN1_APPLICATION 1 #define CURL_ASN1_CONTEXT_SPECIFIC 2 #define CURL_ASN1_PRIVATE 3 /* ASN.1 types. */ #define CURL_ASN1_BOOLEAN 1 #define CURL_ASN1_INTEGER 2 #define CURL_ASN1_BIT_STRING 3 #define CURL_ASN1_OCTET_STRING 4 #define CURL_ASN1_NULL 5 #define CURL_ASN1_OBJECT_IDENTIFIER 6 #define CURL_ASN1_OBJECT_DESCRIPTOR 7 #define CURL_ASN1_INSTANCE_OF 8 #define CURL_ASN1_REAL 9 #define CURL_ASN1_ENUMERATED 10 #define CURL_ASN1_EMBEDDED 11 #define CURL_ASN1_UTF8_STRING 12 #define CURL_ASN1_RELATIVE_OID 13 #define CURL_ASN1_SEQUENCE 16 #define CURL_ASN1_SET 17 #define CURL_ASN1_NUMERIC_STRING 18 #define CURL_ASN1_PRINTABLE_STRING 19 #define CURL_ASN1_TELETEX_STRING 20 #define CURL_ASN1_VIDEOTEX_STRING 21 #define CURL_ASN1_IA5_STRING 22 #define CURL_ASN1_UTC_TIME 23 #define CURL_ASN1_GENERALIZED_TIME 24 #define CURL_ASN1_GRAPHIC_STRING 25 #define CURL_ASN1_VISIBLE_STRING 26 #define CURL_ASN1_GENERAL_STRING 27 #define CURL_ASN1_UNIVERSAL_STRING 28 #define CURL_ASN1_CHARACTER_STRING 29 #define CURL_ASN1_BMP_STRING 30 /* * Types. */ /* ASN.1 parsed element. */ typedef struct { const char * beg; /* Pointer to element data. */ const char * end; /* Pointer to 1st byte after element data. */ unsigned char class; /* ASN.1 element class. */ unsigned char tag; /* ASN.1 element tag. */ bool constructed; /* Element is constructed. */ } curl_asn1Element; /* ASN.1 OID table entry. */ typedef struct { const char * numoid; /* Dotted-numeric OID. */ const char * textoid; /* OID name. */ } curl_OID; /* X509 certificate: RFC 5280. */ typedef struct { curl_asn1Element certificate; curl_asn1Element version; curl_asn1Element serialNumber; curl_asn1Element signatureAlgorithm; curl_asn1Element signature; curl_asn1Element issuer; curl_asn1Element notBefore; curl_asn1Element notAfter; curl_asn1Element subject; curl_asn1Element subjectPublicKeyAlgorithm; curl_asn1Element subjectPublicKey; curl_asn1Element issuerUniqueID; curl_asn1Element subjectUniqueID; curl_asn1Element extensions; } curl_X509certificate; /* * Prototypes. */ const char * Curl_getASN1Element(curl_asn1Element * elem, const char * beg, const char * end); const char * Curl_ASN1tostr(curl_asn1Element * elem, int type); const char * Curl_DNtostr(curl_asn1Element * dn); void Curl_parseX509(curl_X509certificate * cert, const char * beg, const char * end); CURLcode Curl_extract_certinfo(struct connectdata * conn, int certnum, const char * beg, const char * end); CURLcode Curl_verifyhost(struct connectdata * conn, const char * beg, const char * end); #endif /* USE_QSOSSL or USE_GSKIT or USE_NSS */ #endif /* HEADER_CURL_X509ASN1_H */ curl-7.35.0/lib/llist.c0000644000175000017500000001042512213173003011527 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #include "llist.h" #include "curl_memory.h" /* this must be the last include file */ #include "memdebug.h" /* * @unittest: 1300 */ static void 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 = malloc(sizeof(struct curl_llist)); if(!list) return NULL; llist_init(list, dtor); return list; } /* * Curl_llist_insert_next() * * Inserts a new list element after the given one 'e'. If the given existing * entry is NULL and the list already has elements, the new one will be * inserted first in the list. * * Returns: 1 on success and 0 on failure. * * @unittest: 1300 */ int Curl_llist_insert_next(struct curl_llist *list, struct curl_llist_element *e, const void *p) { struct curl_llist_element *ne = 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 { /* if 'e' is NULL here, we insert the new element first in the list */ ne->next = e?e->next:list->head; ne->prev = e; if(!e) { list->head->prev = ne; list->head = ne; } else if(e->next) { e->next->prev = ne; } else { list->tail = ne; } if(e) e->next = ne; } ++list->size; return 1; } /* * @unittest: 1300 */ 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); e->ptr = NULL; e->prev = NULL; e->next = NULL; 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; } /* * @unittest: 1300 */ int Curl_llist_move(struct curl_llist *list, struct curl_llist_element *e, struct curl_llist *to_list, struct curl_llist_element *to_e) { /* Remove element from list */ if(e == NULL || list->size == 0) return 0; 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->size; /* Add element to to_list after to_e */ if(to_list->size == 0) { to_list->head = e; to_list->head->prev = NULL; to_list->head->next = NULL; to_list->tail = e; } else { e->next = to_e->next; e->prev = to_e; if(to_e->next) { to_e->next->prev = e; } else { to_list->tail = e; } to_e->next = e; } ++to_list->size; return 1; } curl-7.35.0/lib/ftp.c0000644000175000017500000041561712270035364011217 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_FTP #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 #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 "if2ip.h" #include "hostip.h" #include "progress.h" #include "transfer.h" #include "escape.h" #include "http.h" /* for HTTP proxy tunnel stuff */ #include "socks.h" #include "ftp.h" #include "fileinfo.h" #include "ftplistparser.h" #include "curl_sec.h" #include "strtoofft.h" #include "strequal.h" #include "vtls/vtls.h" #include "connect.h" #include "strerror.h" #include "inet_ntop.h" #include "inet_pton.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" #include "url.h" #include "rawstr.h" #include "speedcheck.h" #include "warnless.h" #include "http_proxy.h" #include "non-ascii.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" #ifndef NI_MAXHOST #define NI_MAXHOST 1025 #endif #ifndef INET_ADDRSTRLEN #define INET_ADDRSTRLEN 16 #endif #ifdef CURL_DISABLE_VERBOSE_STRINGS #define ftp_pasv_verbose(a,b,c,d) Curl_nop_stmt #endif /* Local API functions */ #ifndef DEBUGBUILD static void _state(struct connectdata *conn, ftpstate newstate); #define state(x,y) _state(x,y) #else static void _state(struct connectdata *conn, ftpstate newstate, int lineno); #define state(x,y) _state(x,y,__LINE__) #endif 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); #ifndef CURL_DISABLE_VERBOSE_STRINGS static void ftp_pasv_verbose(struct connectdata *conn, Curl_addrinfo *ai, char *newhost, /* ascii version */ int port); #endif static CURLcode ftp_state_prepare_transfer(struct connectdata *conn); static CURLcode ftp_state_mdtm(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 newstate); static int ftp_need_type(struct connectdata *conn, bool ascii); static CURLcode ftp_do(struct connectdata *conn, bool *done); static CURLcode ftp_done(struct connectdata *conn, CURLcode, bool premature); static CURLcode ftp_connect(struct connectdata *conn, bool *done); static CURLcode ftp_disconnect(struct connectdata *conn, bool dead_connection); static CURLcode ftp_do_more(struct connectdata *conn, int *completed); static CURLcode ftp_multi_statemach(struct connectdata *conn, bool *done); static int ftp_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks); static int ftp_domore_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks); static CURLcode ftp_doing(struct connectdata *conn, bool *dophase_done); static CURLcode ftp_setup_connection(struct connectdata * conn); static CURLcode init_wc_data(struct connectdata *conn); static CURLcode wc_statemach(struct connectdata *conn); static void wc_data_dtor(void *ptr); static CURLcode ftp_state_retr(struct connectdata *conn, curl_off_t filesize); static CURLcode ftp_readresp(curl_socket_t sockfd, struct pingpong *pp, int *ftpcode, size_t *size); static CURLcode ftp_dophase_done(struct connectdata *conn, bool connected); /* easy-to-use macro: */ #define PPSENDF(x,y,z) if((result = Curl_pp_sendf(x,y,z)) != CURLE_OK) \ return result /* * FTP protocol handler. */ const struct Curl_handler Curl_handler_ftp = { "FTP", /* scheme */ ftp_setup_connection, /* setup_connection */ ftp_do, /* do_it */ ftp_done, /* done */ ftp_do_more, /* do_more */ ftp_connect, /* connect_it */ ftp_multi_statemach, /* connecting */ ftp_doing, /* doing */ ftp_getsock, /* proto_getsock */ ftp_getsock, /* doing_getsock */ ftp_domore_getsock, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ftp_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_FTP, /* defport */ CURLPROTO_FTP, /* protocol */ PROTOPT_DUAL | PROTOPT_CLOSEACTION | PROTOPT_NEEDSPWD | PROTOPT_NOURLQUERY /* flags */ }; #ifdef USE_SSL /* * FTPS protocol handler. */ const struct Curl_handler Curl_handler_ftps = { "FTPS", /* scheme */ ftp_setup_connection, /* setup_connection */ ftp_do, /* do_it */ ftp_done, /* done */ ftp_do_more, /* do_more */ ftp_connect, /* connect_it */ ftp_multi_statemach, /* connecting */ ftp_doing, /* doing */ ftp_getsock, /* proto_getsock */ ftp_getsock, /* doing_getsock */ ftp_domore_getsock, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ftp_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_FTPS, /* defport */ CURLPROTO_FTP | CURLPROTO_FTPS, /* protocol */ PROTOPT_SSL | PROTOPT_DUAL | PROTOPT_CLOSEACTION | PROTOPT_NEEDSPWD | PROTOPT_NOURLQUERY /* flags */ }; #endif #ifndef CURL_DISABLE_HTTP /* * HTTP-proxyed FTP protocol handler. */ static const struct Curl_handler Curl_handler_ftp_proxy = { "FTP", /* scheme */ Curl_http_setup_conn, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ ZERO_NULL, /* do_more */ ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_FTP, /* defport */ CURLPROTO_HTTP, /* protocol */ PROTOPT_NONE /* flags */ }; #ifdef USE_SSL /* * HTTP-proxyed FTPS protocol handler. */ static const struct Curl_handler Curl_handler_ftps_proxy = { "FTPS", /* scheme */ Curl_http_setup_conn, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ ZERO_NULL, /* do_more */ ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_FTPS, /* defport */ CURLPROTO_HTTP, /* protocol */ PROTOPT_NONE /* flags */ }; #endif #endif /* * NOTE: back in the old days, we added code in the FTP code that made NOBODY * requests on files respond with headers passed to the client/stdout that * looked like HTTP ones. * * This approach is not very elegant, it causes confusion and is error-prone. * It is subject for removal at the next (or at least a future) soname bump. * Until then you can test the effects of the removal by undefining the * following define named CURL_FTP_HTTPSTYLE_HEAD. */ #define CURL_FTP_HTTPSTYLE_HEAD 1 static void freedirs(struct ftp_conn *ftpc) { 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; ftpc->dirdepth = 0; } if(ftpc->file) { free(ftpc->file); ftpc->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 ((NULL != strchr(string, '\r')) || (NULL != strchr(string, '\n'))) ? TRUE : FALSE; } /*********************************************************************** * * AcceptServerConnect() * * After connection request is received from the server this function is * called to accept the connection and close the listening socket * */ static CURLcode AcceptServerConnect(struct connectdata *conn) { struct SessionHandle *data = conn->data; curl_socket_t sock = conn->sock[SECONDARYSOCKET]; curl_socket_t s = CURL_SOCKET_BAD; #ifdef ENABLE_IPV6 struct Curl_sockaddr_storage add; #else struct sockaddr_in add; #endif curl_socklen_t size = (curl_socklen_t) sizeof(add); if(0 == getsockname(sock, (struct sockaddr *) &add, &size)) { size = sizeof(add); s=accept(sock, (struct sockaddr *) &add, &size); } Curl_closesocket(conn, sock); /* close the first socket */ if(CURL_SOCKET_BAD == s) { failf(data, "Error accept()ing server connect"); return CURLE_FTP_PORT_FAILED; } infof(data, "Connection accepted from server\n"); conn->sock[SECONDARYSOCKET] = s; curlx_nonblock(s, TRUE); /* enable non-blocking */ conn->sock_accepted[SECONDARYSOCKET] = TRUE; if(data->set.fsockopt) { int error = 0; /* activate callback for setting socket options */ error = data->set.fsockopt(data->set.sockopt_client, s, CURLSOCKTYPE_ACCEPT); if(error) { Curl_closesocket(conn, s); /* close the socket and bail out */ conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; return CURLE_ABORTED_BY_CALLBACK; } } return CURLE_OK; } /* * ftp_timeleft_accept() returns the amount of milliseconds left allowed for * waiting server to connect. If the value is negative, the timeout time has * already elapsed. * * The start time is stored in progress.t_acceptdata - as set with * Curl_pgrsTime(..., TIMER_STARTACCEPT); * */ static long ftp_timeleft_accept(struct SessionHandle *data) { long timeout_ms = DEFAULT_ACCEPT_TIMEOUT; long other; struct timeval now; if(data->set.accepttimeout > 0) timeout_ms = data->set.accepttimeout; now = Curl_tvnow(); /* check if the generic timeout possibly is set shorter */ other = Curl_timeleft(data, &now, FALSE); if(other && (other < timeout_ms)) /* note that this also works fine for when other happens to be negative due to it already having elapsed */ timeout_ms = other; else { /* subtract elapsed time */ timeout_ms -= Curl_tvdiff(now, data->progress.t_acceptdata); if(!timeout_ms) /* avoid returning 0 as that means no timeout! */ return -1; } return timeout_ms; } /*********************************************************************** * * ReceivedServerConnect() * * After allowing server to connect to us from data port, this function * checks both data connection for connection establishment and ctrl * connection for a negative response regarding a failure in connecting * */ static CURLcode ReceivedServerConnect(struct connectdata *conn, bool *received) { struct SessionHandle *data = conn->data; curl_socket_t ctrl_sock = conn->sock[FIRSTSOCKET]; curl_socket_t data_sock = conn->sock[SECONDARYSOCKET]; struct ftp_conn *ftpc = &conn->proto.ftpc; struct pingpong *pp = &ftpc->pp; int result; long timeout_ms; ssize_t nread; int ftpcode; *received = FALSE; timeout_ms = ftp_timeleft_accept(data); infof(data, "Checking for server connect\n"); if(timeout_ms < 0) { /* if a timeout was already reached, bail out */ failf(data, "Accept timeout occurred while waiting server connect"); return CURLE_FTP_ACCEPT_TIMEOUT; } /* First check whether there is a cached response from server */ if(pp->cache_size && pp->cache && pp->cache[0] > '3') { /* Data connection could not be established, let's return */ infof(data, "There is negative response in cache while serv connect\n"); Curl_GetFTPResponse(&nread, conn, &ftpcode); return CURLE_FTP_ACCEPT_FAILED; } result = Curl_socket_check(ctrl_sock, data_sock, CURL_SOCKET_BAD, 0); /* see if the connection request is already here */ switch (result) { case -1: /* error */ /* let's die here */ failf(data, "Error while waiting for server connect"); return CURLE_FTP_ACCEPT_FAILED; case 0: /* Server connect is not received yet */ break; /* loop */ default: if(result & CURL_CSELECT_IN2) { infof(data, "Ready to accept data connection from server\n"); *received = TRUE; } else if(result & CURL_CSELECT_IN) { infof(data, "Ctrl conn has data while waiting for data conn\n"); Curl_GetFTPResponse(&nread, conn, &ftpcode); if(ftpcode/100 > 3) return CURLE_FTP_ACCEPT_FAILED; return CURLE_FTP_WEIRD_SERVER_REPLY; } break; } /* switch() */ return CURLE_OK; } /*********************************************************************** * * InitiateTransfer() * * After connection from server is accepted this function is called to * setup transfer parameters and initiate the data transfer. * */ static CURLcode InitiateTransfer(struct connectdata *conn) { struct SessionHandle *data = conn->data; struct FTP *ftp = data->req.protop; CURLcode result = CURLE_OK; 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(conn->proto.ftpc.state_saved == FTP_STOR) { *(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); /* set the SO_SNDBUF for the secondary socket for those who need it */ Curl_sndbufset(conn->sock[SECONDARYSOCKET]); Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */ SECONDARYSOCKET, ftp->bytecountp); } else { /* FTP download: */ Curl_setup_transfer(conn, SECONDARYSOCKET, conn->proto.ftpc.retr_size_saved, FALSE, ftp->bytecountp, -1, NULL); /* no upload here */ } conn->proto.ftpc.pp.pending_resp = TRUE; /* expect server response */ state(conn, FTP_STOP); return CURLE_OK; } /*********************************************************************** * * AllowServerConnect() * * When we've issue the PORT command, we have told the server to connect to * us. This function checks whether data connection is established if so it is * accepted. * */ static CURLcode AllowServerConnect(struct connectdata *conn, bool *connected) { struct SessionHandle *data = conn->data; long timeout_ms; CURLcode ret = CURLE_OK; *connected = FALSE; infof(data, "Preparing for accepting server on data port\n"); /* Save the time we start accepting server connect */ Curl_pgrsTime(data, TIMER_STARTACCEPT); timeout_ms = ftp_timeleft_accept(data); if(timeout_ms < 0) { /* if a timeout was already reached, bail out */ failf(data, "Accept timeout occurred while waiting server connect"); return CURLE_FTP_ACCEPT_TIMEOUT; } /* see if the connection request is already here */ ret = ReceivedServerConnect(conn, connected); if(ret) return ret; if(*connected) { ret = AcceptServerConnect(conn); if(ret) return ret; ret = InitiateTransfer(conn); if(ret) return ret; } else { /* Add timeout to multi handle and break out of the loop */ if(ret == CURLE_OK && *connected == FALSE) { if(data->set.accepttimeout > 0) Curl_expire(data, data->set.accepttimeout); else Curl_expire(data, DEFAULT_ACCEPT_TIMEOUT); } } return ret; } /* macro to check for a three-digit ftp status code at the start of the given string */ #define STATUSCODE(line) (ISDIGIT(line[0]) && ISDIGIT(line[1]) && \ ISDIGIT(line[2])) /* macro to check for the last line in an FTP server response */ #define LASTLINE(line) (STATUSCODE(line) && (' ' == line[3])) static bool ftp_endofresp(struct connectdata *conn, char *line, size_t len, int *code) { (void)conn; if((len > 3) && LASTLINE(line)) { *code = curlx_sltosi(strtol(line, NULL, 10)); return TRUE; } return FALSE; } static CURLcode ftp_readresp(curl_socket_t sockfd, struct pingpong *pp, int *ftpcode, /* return the ftp-code if done */ size_t *size) /* size of the response */ { struct connectdata *conn = pp->conn; struct SessionHandle *data = conn->data; #ifdef HAVE_GSSAPI char * const buf = data->state.buffer; #endif CURLcode result = CURLE_OK; int code; result = Curl_pp_readresp(sockfd, pp, &code, size); #if defined(HAVE_GSSAPI) /* handle the security-oriented responses 6xx ***/ /* FIXME: some errorchecking perhaps... ***/ switch(code) { case 631: code = Curl_sec_read_msg(conn, buf, PROT_SAFE); break; case 632: code = Curl_sec_read_msg(conn, buf, PROT_PRIVATE); break; case 633: code = Curl_sec_read_msg(conn, buf, PROT_CONFIDENTIAL); break; default: /* normal ftp stuff we pass through! */ break; } #endif /* store the latest code for later retrieval */ data->info.httpcode=code; if(ftpcode) *ftpcode = code; if(421 == code) { /* 421 means "Service not available, closing control connection." and FTP * servers use it to signal that idle session timeout has been exceeded. * If we ignored the response, it could end up hanging in some cases. * * This response code can come at any point so having it treated * generically is a good idea. */ infof(data, "We got a 421 - timeout!\n"); state(conn, FTP_STOP); return CURLE_OPERATION_TIMEDOUT; } return result; } /* --- parse FTP server responses --- */ /* * Curl_GetFTPResponse() is a BLOCKING function to read the full response * from a server after a command. * */ 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]; long timeout; /* timeout in milliseconds */ long interval_ms; struct SessionHandle *data = conn->data; CURLcode result = CURLE_OK; struct ftp_conn *ftpc = &conn->proto.ftpc; struct pingpong *pp = &ftpc->pp; size_t nread; int cache_skip=0; int value_to_be_ignored=0; if(ftpcode) *ftpcode = 0; /* 0 for errors */ else /* make the pointer point to something for the rest of this function */ ftpcode = &value_to_be_ignored; *nreadp=0; while(!*ftpcode && !result) { /* check and reset timeout value every lap */ timeout = Curl_pp_state_timeout(pp); if(timeout <=0 ) { failf(data, "FTP response timeout"); return CURLE_OPERATION_TIMEDOUT; /* already too little time */ } interval_ms = 1000; /* use 1 second timeout intervals */ if(timeout < interval_ms) interval_ms = timeout; /* * Since this function is blocking, we need to wait here for input on the * connection and only then we call the response reading function. We do * timeout at least every second to make the timeout check run. * * A caution here is that the ftp_readresp() function has a cache that may * contain pieces of a response from the previous invoke and we need to * make sure we don't just wait for input while there is unhandled data in * that cache. But also, if the cache is there, we call ftp_readresp() and * the cache wasn't good enough to continue we must not just busy-loop * around this function. * */ if(pp->cache && (cache_skip < 2)) { /* * There's a cache left since before. We then skipping the wait for * socket action, unless this is the same cache like the previous round * as then the cache was deemed not enough to act on and we then need to * wait for more data anyway. */ } else { switch (Curl_socket_ready(sockfd, CURL_SOCKET_BAD, interval_ms)) { case -1: /* select() error, stop reading */ failf(data, "FTP response aborted due to select/poll error: %d", SOCKERRNO); return CURLE_RECV_ERROR; case 0: /* timeout */ if(Curl_pgrsUpdate(conn)) return CURLE_ABORTED_BY_CALLBACK; continue; /* just continue in our loop for the timeout duration */ default: /* for clarity */ break; } } result = ftp_readresp(sockfd, pp, ftpcode, &nread); if(result) break; if(!nread && pp->cache) /* bump cache skip counter as on repeated skips we must wait for more data */ cache_skip++; else /* when we got data or there is no cache left, we reset the cache skip counter */ cache_skip=0; *nreadp += nread; } /* while there's buffer left and loop is requested */ pp->pending_resp = FALSE; return result; } #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) /* for debug purposes */ static const char * const ftp_state_names[]={ "STOP", "WAIT220", "AUTH", "USER", "PASS", "ACCT", "PBSZ", "PROT", "CCC", "PWD", "SYST", "NAMEFMT", "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", "PRET", "PASV", "LIST", "RETR", "STOR", "QUIT" }; #endif /* This is the ONLY way to change FTP state! */ static void _state(struct connectdata *conn, ftpstate newstate #ifdef DEBUGBUILD , int lineno #endif ) { struct ftp_conn *ftpc = &conn->proto.ftpc; #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) if(ftpc->state != newstate) infof(conn->data, "FTP %p (line %d) state change from %s to %s\n", (void *)ftpc, lineno, ftp_state_names[ftpc->state], ftp_state_names[newstate]); #endif ftpc->state = newstate; } static CURLcode ftp_state_user(struct connectdata *conn) { CURLcode result; struct FTP *ftp = conn->data->req.protop; /* send USER */ PPSENDF(&conn->proto.ftpc.pp, "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 */ PPSENDF(&conn->proto.ftpc.pp, "%s", "PWD"); state(conn, FTP_PWD); return CURLE_OK; } /* For the FTP "protocol connect" and "doing" phases only */ static int ftp_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { return Curl_pp_getsock(&conn->proto.ftpc.pp, socks, numsocks); } /* For the FTP "DO_MORE" phase only */ static int ftp_domore_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { struct ftp_conn *ftpc = &conn->proto.ftpc; 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. Or just * handle ordinary commands. */ if(FTP_STOP == ftpc->state) { /* if stopped and still in this state, then we're also waiting for a connect on the secondary connection */ socks[0] = conn->sock[FIRSTSOCKET]; socks[1] = conn->sock[SECONDARYSOCKET]; return GETSOCK_READSOCK(FIRSTSOCKET) | GETSOCK_WRITESOCK(SECONDARYSOCKET); } else return Curl_pp_getsock(&conn->proto.ftpc.pp, socks, numsocks); } /* This is called after the FTP_QUOTE state is passed. ftp_state_cwd() sends the range of CWD 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_mdtm(conn); else { ftpc->count2 = 0; /* count2 counts failed CWDs */ /* count3 is set to allow a MKD to fail once. In the case when first CWD fails and then MKD fails (due to another session raced it to create the dir) this then allows for a second try to CWD to it */ ftpc->count3 = (conn->data->set.ftp_create_missing_dirs==2)?1: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 */ PPSENDF(&conn->proto.ftpc.pp, "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... */ PPSENDF(&conn->proto.ftpc.pp, "CWD %s", ftpc->dirs[ftpc->count1 -1]); state(conn, FTP_CWD); } else { /* No CWD necessary */ result = ftp_state_mdtm(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] = ""; struct Curl_sockaddr_storage ss; Curl_addrinfo *res, *ai; curl_socklen_t sslen; char hbuf[NI_MAXHOST]; struct sockaddr *sa=(struct sockaddr *)&ss; struct sockaddr_in * const sa4 = (void *)sa; #ifdef ENABLE_IPV6 struct sockaddr_in6 * const sa6 = (void *)sa; #endif char tmp[1024]; static const char mode[][5] = { "EPRT", "PORT" }; int rc; int error; char *host = NULL; char *string_ftpport = data->set.str[STRING_FTPPORT]; struct Curl_dns_entry *h=NULL; unsigned short port_min = 0; unsigned short port_max = 0; unsigned short port; bool possibly_non_local = TRUE; char *addr = NULL; /* Step 1, figure out what is requested, * accepted format : * (ipv4|ipv6|domain|interface)?(:port(-range)?)? */ if(data->set.str[STRING_FTPPORT] && (strlen(data->set.str[STRING_FTPPORT]) > 1)) { #ifdef ENABLE_IPV6 size_t addrlen = INET6_ADDRSTRLEN > strlen(string_ftpport) ? INET6_ADDRSTRLEN : strlen(string_ftpport); #else size_t addrlen = INET_ADDRSTRLEN > strlen(string_ftpport) ? INET_ADDRSTRLEN : strlen(string_ftpport); #endif char *ip_start = string_ftpport; char *ip_end = NULL; char *port_start = NULL; char *port_sep = NULL; addr = calloc(addrlen+1, 1); if(!addr) return CURLE_OUT_OF_MEMORY; #ifdef ENABLE_IPV6 if(*string_ftpport == '[') { /* [ipv6]:port(-range) */ ip_start = string_ftpport + 1; if((ip_end = strchr(string_ftpport, ']')) != NULL ) strncpy(addr, ip_start, ip_end - ip_start); } else #endif if(*string_ftpport == ':') { /* :port */ ip_end = string_ftpport; } else if((ip_end = strchr(string_ftpport, ':')) != NULL) { /* either ipv6 or (ipv4|domain|interface):port(-range) */ #ifdef ENABLE_IPV6 if(Curl_inet_pton(AF_INET6, string_ftpport, sa6) == 1) { /* ipv6 */ port_min = port_max = 0; strcpy(addr, string_ftpport); ip_end = NULL; /* this got no port ! */ } else #endif /* (ipv4|domain|interface):port(-range) */ strncpy(addr, string_ftpport, ip_end - ip_start ); } else /* ipv4|interface */ strcpy(addr, string_ftpport); /* parse the port */ if(ip_end != NULL) { if((port_start = strchr(ip_end, ':')) != NULL) { port_min = curlx_ultous(strtoul(port_start+1, NULL, 10)); if((port_sep = strchr(port_start, '-')) != NULL) { port_max = curlx_ultous(strtoul(port_sep + 1, NULL, 10)); } else port_max = port_min; } } /* correct errors like: * :1234-1230 * :-4711 , in this case port_min is (unsigned)-1, * therefore port_min > port_max for all cases * but port_max = (unsigned)-1 */ if(port_min > port_max ) port_min = port_max = 0; if(*addr != '\0') { /* attempt to get the address of the given interface name */ switch(Curl_if2ip(conn->ip_addr->ai_family, conn->scope, addr, hbuf, sizeof(hbuf))) { case IF2IP_NOT_FOUND: /* not an interface, use the given string as host name instead */ host = addr; break; case IF2IP_AF_NOT_SUPPORTED: return CURLE_FTP_PORT_FAILED; case IF2IP_FOUND: host = hbuf; /* use the hbuf for host name */ } } else /* there was only a port(-range) given, default the host */ host = NULL; } /* 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], sa, &sslen)) { failf(data, "getsockname() failed: %s", Curl_strerror(conn, SOCKERRNO) ); Curl_safefree(addr); return CURLE_FTP_PORT_FAILED; } switch(sa->sa_family) { #ifdef ENABLE_IPV6 case AF_INET6: Curl_inet_ntop(sa->sa_family, &sa6->sin6_addr, hbuf, sizeof(hbuf)); break; #endif default: Curl_inet_ntop(sa->sa_family, &sa4->sin_addr, hbuf, sizeof(hbuf)); break; } host = hbuf; /* use this host name */ possibly_non_local = FALSE; /* we know it is local now */ } /* resolv ip/host to ip */ rc = Curl_resolv(conn, host, 0, &h); if(rc == CURLRESOLV_PENDING) (void)Curl_resolver_wait_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! */ if(res == NULL) { failf(data, "failed to resolve the address provided to PORT: %s", host); Curl_safefree(addr); return CURLE_FTP_PORT_FAILED; } Curl_safefree(addr); host = NULL; /* step 2, create a socket for the requested address */ portsock = CURL_SOCKET_BAD; error = 0; for(ai = res; ai; ai = ai->ai_next) { result = Curl_socket(conn, ai, NULL, &portsock); if(result) { error = 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 */ memcpy(sa, ai->ai_addr, ai->ai_addrlen); sslen = ai->ai_addrlen; for(port = port_min; port <= port_max;) { if(sa->sa_family == AF_INET) sa4->sin_port = htons(port); #ifdef ENABLE_IPV6 else sa6->sin6_port = htons(port); #endif /* Try binding the given address. */ if(bind(portsock, sa, sslen) ) { /* It failed. */ error = SOCKERRNO; if(possibly_non_local && (error == EADDRNOTAVAIL)) { /* The requested bind address is not local. Use the address used for * the control connection instead and restart the port loop */ infof(data, "bind(port=%hu) on non-local address failed: %s\n", port, Curl_strerror(conn, error) ); sslen = sizeof(ss); if(getsockname(conn->sock[FIRSTSOCKET], sa, &sslen)) { failf(data, "getsockname() failed: %s", Curl_strerror(conn, SOCKERRNO) ); Curl_closesocket(conn, portsock); return CURLE_FTP_PORT_FAILED; } port = port_min; possibly_non_local = FALSE; /* don't try this again */ continue; } else if(error != EADDRINUSE && error != EACCES) { failf(data, "bind(port=%hu) failed: %s", port, Curl_strerror(conn, error) ); Curl_closesocket(conn, portsock); return CURLE_FTP_PORT_FAILED; } } else break; port++; } /* maybe all ports were in use already*/ if(port > port_max) { failf(data, "bind() failed, we ran out of ports!"); Curl_closesocket(conn, 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, SOCKERRNO) ); Curl_closesocket(conn, portsock); return CURLE_FTP_PORT_FAILED; } /* step 4, listen on the socket */ if(listen(portsock, 1)) { failf(data, "socket failure: %s", Curl_strerror(conn, SOCKERRNO)); Curl_closesocket(conn, 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 ENABLE_IPV6 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; if((PORT == fcmd) && sa->sa_family != AF_INET) /* PORT is ipv4 only */ continue; switch (sa->sa_family) { case AF_INET: port = ntohs(sa4->sin_port); break; #ifdef ENABLE_IPV6 case AF_INET6: port = ntohs(sa6->sin6_port); break; #endif default: continue; /* might as well skip this */ } 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_pp_sendf(&ftpc->pp, "%s |%d|%s|%hu|", mode[fcmd], sa->sa_family == AF_INET?1:2, myhost, port); if(result) { failf(data, "Failure sending EPRT command: %s", curl_easy_strerror(result)); Curl_closesocket(conn, portsock); /* don't retry using PORT */ ftpc->count1 = PORT; /* bail out */ state(conn, FTP_STOP); return result; } break; } else if(PORT == fcmd) { char *source = myhost; char *dest = tmp; /* 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", (int)(port>>8), (int)(port&0xff)); result = Curl_pp_sendf(&ftpc->pp, "%s %s", mode[fcmd], tmp); if(result) { failf(data, "Failure sending PORT command: %s", curl_easy_strerror(result)); Curl_closesocket(conn, portsock); /* bail out */ state(conn, FTP_STOP); 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]) Curl_closesocket(conn, conn->sock[SECONDARYSOCKET]); conn->sock[SECONDARYSOCKET] = portsock; /* this tcpconnect assignment below is a hackish work-around to make the multi interface with active FTP work - as it will not wait for a (passive) connect in Curl_is_connected(). The *proper* fix is to make sure that the active connection from the server is done in a non-blocking way. Currently, it is still BLOCKING. */ conn->bits.tcpconnect[SECONDARYSOCKET] = TRUE; 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|) */ static const char mode[][5] = { "EPSV", "PASV" }; 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; PPSENDF(&ftpc->pp, "%s", mode[modeoff]); ftpc->count1 = modeoff; state(conn, FTP_PASV); infof(conn->data, "Connect data stream passively\n"); return result; } /* * ftp_state_prepare_transfer() starts PORT, PASV or PRET etc. * * 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_prepare_transfer(struct connectdata *conn) { CURLcode result = CURLE_OK; struct FTP *ftp = conn->data->req.protop; struct SessionHandle *data = conn->data; if(ftp->transfer != FTPTRANSFER_BODY) { /* doesn't transfer any data */ /* 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 */ if(data->set.ftp_use_pret) { /* The user has requested that we send a PRET command to prepare the server for the upcoming PASV */ if(!conn->proto.ftpc.file) { PPSENDF(&conn->proto.ftpc.pp, "PRET %s", data->set.str[STRING_CUSTOMREQUEST]? data->set.str[STRING_CUSTOMREQUEST]: (data->set.ftp_list_only?"NLST":"LIST")); } else if(data->set.upload) { PPSENDF(&conn->proto.ftpc.pp, "PRET STOR %s", conn->proto.ftpc.file); } else { PPSENDF(&conn->proto.ftpc.pp, "PRET RETR %s", conn->proto.ftpc.file); } state(conn, FTP_PRET); } else { result = ftp_state_use_pasv(conn); } } return result; } static CURLcode ftp_state_rest(struct connectdata *conn) { CURLcode result = CURLE_OK; struct FTP *ftp = conn->data->req.protop; struct ftp_conn *ftpc = &conn->proto.ftpc; if((ftp->transfer != FTPTRANSFER_BODY) && ftpc->file) { /* if a "head"-like request is being made (on a file) */ /* Determine if server can respond to REST command and therefore whether it supports range */ PPSENDF(&conn->proto.ftpc.pp, "REST %d", 0); state(conn, FTP_REST); } else result = ftp_state_prepare_transfer(conn); return result; } static CURLcode ftp_state_size(struct connectdata *conn) { CURLcode result = CURLE_OK; struct FTP *ftp = conn->data->req.protop; struct ftp_conn *ftpc = &conn->proto.ftpc; if((ftp->transfer == FTPTRANSFER_INFO) && ftpc->file) { /* if a "head"-like request is being made (on a file) */ /* we know ftpc->file is a valid pointer to a file name */ PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file); state(conn, FTP_SIZE); } else result = ftp_state_rest(conn); return result; } static CURLcode ftp_state_list(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... */ /* if FTPFILE_NOCWD was specified, we are currently in the user's home directory, so we should add the path as argument for the LIST / NLST / or custom command. Whether the server will support this, is uncertain. The other ftp_filemethods will CWD into dir/dir/ first and then just do LIST (in that case: nothing to do here) */ char *cmd,*lstArg,*slashPos; lstArg = NULL; if((data->set.ftp_filemethod == FTPFILE_NOCWD) && data->state.path && data->state.path[0] && strchr(data->state.path,'/')) { lstArg = strdup(data->state.path); if(!lstArg) return CURLE_OUT_OF_MEMORY; /* Check if path does not end with /, as then we cut off the file part */ if(lstArg[strlen(lstArg) - 1] != '/') { /* chop off the file part if format is dir/dir/file */ slashPos = strrchr(lstArg,'/'); if(slashPos) *(slashPos+1) = '\0'; } } cmd = aprintf( "%s%s%s", data->set.str[STRING_CUSTOMREQUEST]? data->set.str[STRING_CUSTOMREQUEST]: (data->set.ftp_list_only?"NLST":"LIST"), lstArg? " ": "", lstArg? lstArg: "" ); if(!cmd) { if(lstArg) free(lstArg); return CURLE_OUT_OF_MEMORY; } result = Curl_pp_sendf(&conn->proto.ftpc.pp, "%s", cmd); if(lstArg) free(lstArg); free(cmd); if(result != CURLE_OK) return result; state(conn, FTP_LIST); return result; } static CURLcode ftp_state_retr_prequote(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_stor_prequote(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_type(struct connectdata *conn) { CURLcode result = CURLE_OK; struct FTP *ftp = conn->data->req.protop; struct SessionHandle *data = conn->data; struct ftp_conn *ftpc = &conn->proto.ftpc; /* 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(data->set.opt_no_body && ftpc->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->transfer = FTPTRANSFER_INFO; /* 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_size(conn); return result; } /* This is called after the CWD commands have been done in the beginning of the DO phase */ static CURLcode ftp_state_mdtm(struct connectdata *conn) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct ftp_conn *ftpc = &conn->proto.ftpc; /* Requested time of file or time-depended transfer? */ if((data->set.get_filetime || data->set.timecondition) && ftpc->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 */ PPSENDF(&ftpc->pp, "MDTM %s", ftpc->file); state(conn, FTP_MDTM); } else result = ftp_state_type(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->req.protop; struct SessionHandle *data = conn->data; struct ftp_conn *ftpc = &conn->proto.ftpc; int seekerr = CURL_SEEKFUNC_OK; if((data->state.resume_from && !sizechecked) || ((data->state.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->state.resume_from < 0 ) { /* Got no given size to start from, figure it out */ PPSENDF(&ftpc->pp, "SIZE %s", ftpc->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(conn->seek_func) { seekerr = conn->seek_func(conn->seek_client, data->state.resume_from, SEEK_SET); } if(seekerr != CURL_SEEKFUNC_OK) { if(seekerr != CURL_SEEKFUNC_CANTSEEK) { failf(data, "Could not seek stream"); return CURLE_FTP_COULDNT_USE_REST; } /* seekerr == CURL_SEEKFUNC_CANTSEEK (can't seek to offset) */ else { curl_off_t passed=0; do { size_t readthisamountnow = (data->state.resume_from - passed > CURL_OFF_T_C(BUFSIZE)) ? BUFSIZE : curlx_sotouz(data->state.resume_from - passed); size_t actuallyread = conn->fread_func(data->state.buffer, 1, readthisamountnow, conn->fread_in); passed += actuallyread; if((actuallyread == 0) || (actuallyread > readthisamountnow)) { /* this checks for greater-than only to make sure that the CURL_READFUNC_ABORT return code still aborts */ failf(data, "Failed to read data"); return CURLE_FTP_COULDNT_USE_REST; } } while(passed < data->state.resume_from); } } /* now, decrease the size of the read */ if(data->set.infilesize>0) { data->set.infilesize -= data->state.resume_from; if(data->set.infilesize <= 0) { infof(data, "File already completely uploaded\n"); /* no data to transfer */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); /* Set ->transfer so that we won't get any error in * ftp_done() because we didn't transfer anything! */ ftp->transfer = FTPTRANSFER_NONE; state(conn, FTP_STOP); return CURLE_OK; } } /* we've passed, proceed as normal */ } /* resume_from */ PPSENDF(&ftpc->pp, data->set.ftp_append?"APPE %s":"STOR %s", ftpc->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->req.protop; 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; } /* * This state uses: * 'count1' to iterate over the commands to send * 'count2' to store wether to allow commands to fail */ 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) { char *cmd = item->data; if(cmd[0] == '*') { cmd++; ftpc->count2 = 1; /* the sent command is allowed to fail */ } else ftpc->count2 = 0; /* failure means cancel operation */ PPSENDF(&ftpc->pp, "%s", cmd); 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->transfer != FTPTRANSFER_BODY) state(conn, FTP_STOP); else { if(ftpc->known_filesize != -1) { Curl_pgrsSetDownloadSize(data, ftpc->known_filesize); result = ftp_state_retr(conn, ftpc->known_filesize); } else { PPSENDF(&ftpc->pp, "SIZE %s", ftpc->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; } /* called from ftp_state_pasv_resp to switch to PASV in case of EPSV problems */ static CURLcode ftp_epsv_disable(struct connectdata *conn) { CURLcode result = CURLE_OK; infof(conn->data, "Failed EPSV attempt. Disabling EPSV\n"); /* disable it for next transfer */ conn->bits.ftp_use_epsv = FALSE; conn->data->state.errorbuf = FALSE; /* allow error message to get rewritten */ PPSENDF(&conn->proto.ftpc.pp, "%s", "PASV"); conn->proto.ftpc.count1++; /* remain in/go to the FTP_PASV state */ state(conn, FTP_PASV); return result; } /* * Perform the necessary magic that needs to be done once the TCP connection * to the proxy has completed. */ static CURLcode proxy_magic(struct connectdata *conn, char *newhost, unsigned short newport, bool *magicdone) { CURLcode result = CURLE_OK; struct SessionHandle *data=conn->data; *magicdone = FALSE; switch(conn->proxytype) { case CURLPROXY_SOCKS5: case CURLPROXY_SOCKS5_HOSTNAME: result = Curl_SOCKS5(conn->proxyuser, conn->proxypasswd, newhost, newport, SECONDARYSOCKET, conn); *magicdone = TRUE; break; case CURLPROXY_SOCKS4: result = Curl_SOCKS4(conn->proxyuser, newhost, newport, SECONDARYSOCKET, conn, FALSE); *magicdone = TRUE; break; case CURLPROXY_SOCKS4A: result = Curl_SOCKS4(conn->proxyuser, newhost, newport, SECONDARYSOCKET, conn, TRUE); *magicdone = TRUE; break; case CURLPROXY_HTTP: case CURLPROXY_HTTP_1_0: /* do nothing here. handled later. */ break; default: failf(data, "unknown proxytype option given"); result = CURLE_COULDNT_CONNECT; break; } 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 */ struct HTTP http_proxy; struct FTP *ftp_save = data->req.protop; memset(&http_proxy, 0, sizeof(http_proxy)); data->req.protop = &http_proxy; result = Curl_proxyCONNECT(conn, SECONDARYSOCKET, newhost, newport); data->req.protop = ftp_save; if(result) return result; if(conn->tunnel_state[SECONDARYSOCKET] != TUNNEL_COMPLETE) { /* the CONNECT procedure is not complete, the tunnel is not yet up */ state(conn, FTP_STOP); /* this phase is completed */ return result; } else *magicdone = TRUE; } 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; struct Curl_dns_entry *addr=NULL; int rc; unsigned short connectport; /* the local port connect() should use! */ 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(num > 0xffff) { failf(data, "Illegal port number in EPSV reply"); return CURLE_FTP_WEIRD_PASV_REPLY; } if(ptr) { ftpc->newport = (unsigned short)(num & 0xffff); if(conn->bits.tunnel_proxy || conn->proxytype == CURLPROXY_SOCKS5 || conn->proxytype == CURLPROXY_SOCKS5_HOSTNAME || conn->proxytype == CURLPROXY_SOCKS4 || conn->proxytype == CURLPROXY_SOCKS4A) /* proxy tunnel -> use other host info because ip_addr_str is the proxy address not the ftp host */ snprintf(ftpc->newhost, sizeof(ftpc->newhost), "%s", conn->host.name); else /* use the same IP we are already connected to */ snprintf(ftpc->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 || conn->proxytype == CURLPROXY_SOCKS5 || conn->proxytype == CURLPROXY_SOCKS5_HOSTNAME || conn->proxytype == CURLPROXY_SOCKS4 || conn->proxytype == CURLPROXY_SOCKS4A) /* proxy tunnel -> use other host info because ip_addr_str is the proxy address not the ftp host */ snprintf(ftpc->newhost, sizeof(ftpc->newhost), "%s", conn->host.name); else snprintf(ftpc->newhost, sizeof(ftpc->newhost), "%s", conn->ip_addr_str); } else snprintf(ftpc->newhost, sizeof(ftpc->newhost), "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); ftpc->newport = (unsigned short)(((port[0]<<8) + port[1]) & 0xffff); } else if(ftpc->count1 == 0) { /* EPSV failed, move on to PASV */ return ftp_epsv_disable(conn); } else { failf(data, "Bad PASV/EPSV response: %03d", ftpcode); return CURLE_FTP_WEIRD_PASV_REPLY; } if(conn->bits.proxy) { /* * This connection uses a 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, ignores the return code but 'addr' will be NULL in case of failure */ (void)Curl_resolver_wait_resolv(conn, &addr); connectport = (unsigned short)conn->port; /* we connect to the proxy's port */ if(!addr) { failf(data, "Can't resolve proxy host %s:%hu", conn->proxy.name, connectport); return CURLE_FTP_CANT_GET_HOST; } } else { /* normal, direct, ftp connection */ rc = Curl_resolv(conn, ftpc->newhost, ftpc->newport, &addr); if(rc == CURLRESOLV_PENDING) /* BLOCKING */ (void)Curl_resolver_wait_resolv(conn, &addr); connectport = ftpc->newport; /* we connect to the remote port */ if(!addr) { failf(data, "Can't resolve new host %s:%hu", ftpc->newhost, connectport); return CURLE_FTP_CANT_GET_HOST; } } conn->bits.tcpconnect[SECONDARYSOCKET] = FALSE; result = Curl_connecthost(conn, addr); Curl_resolv_unlock(data, addr); /* we're done using this address */ if(result) { if(ftpc->count1 == 0 && ftpcode == 229) return ftp_epsv_disable(conn); return result; } /* * 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. */ if(data->set.verbose) /* this just dumps information about this second connection */ ftp_pasv_verbose(conn, conn->ip_addr, ftpc->newhost, connectport); conn->bits.do_more = TRUE; 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 */ result = ftp_dophase_done(conn, FALSE); } 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->req.protop; struct ftp_conn *ftpc = &conn->proto.ftpc; 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); } #ifdef CURL_FTP_HTTPSTYLE_HEAD /* 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(data->set.opt_no_body && ftpc->file && data->set.get_filetime && (data->info.filetime>=0) ) { time_t filetime = (time_t)data->info.filetime; struct tm buffer; const struct tm *tm = &buffer; result = Curl_gmtime(filetime, &buffer); if(result) return result; /* 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 */ #endif } 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->transfer = FTPTRANSFER_NONE; /* mark to not transfer data */ data->info.timecond = TRUE; 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->transfer = FTPTRANSFER_NONE; /* mark to not transfer data */ data->info.timecond = TRUE; state(conn, FTP_STOP); return CURLE_OK; } break; } /* switch */ } else { infof(data, "Skipping time comparison\n"); } } if(!result) result = ftp_state_type(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_TYPE; } if(ftpcode != 200) infof(data, "Got a %03d response code instead of the assumed 200\n", ftpcode); if(instate == FTP_TYPE) result = ftp_state_size(conn); else if(instate == FTP_LIST_TYPE) result = ftp_state_list(conn); else if(instate == FTP_RETR_TYPE) result = ftp_state_retr_prequote(conn); else if(instate == FTP_STOR_TYPE) result = ftp_state_stor_prequote(conn); return result; } static CURLcode ftp_state_retr(struct connectdata *conn, curl_off_t filesize) { CURLcode result = CURLE_OK; struct SessionHandle *data=conn->data; struct FTP *ftp = data->req.protop; struct ftp_conn *ftpc = &conn->proto.ftpc; 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->state.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->state.resume_from< 0) { /* We're supposed to download the last abs(from) bytes */ if(filesize < -data->state.resume_from) { failf(data, "Offset (%" CURL_FORMAT_CURL_OFF_T ") was beyond file size (%" CURL_FORMAT_CURL_OFF_T ")", data->state.resume_from, filesize); return CURLE_BAD_DOWNLOAD_RESUME; } /* convert to size to download */ ftp->downloadsize = -data->state.resume_from; /* download from where? */ data->state.resume_from = filesize - ftp->downloadsize; } else { if(filesize < data->state.resume_from) { failf(data, "Offset (%" CURL_FORMAT_CURL_OFF_T ") was beyond file size (%" CURL_FORMAT_CURL_OFF_T ")", data->state.resume_from, filesize); return CURLE_BAD_DOWNLOAD_RESUME; } /* Now store the number of bytes we are expected to download */ ftp->downloadsize = filesize-data->state.resume_from; } } if(ftp->downloadsize == 0) { /* no data to transfer */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); infof(data, "File already completely downloaded\n"); /* Set ->transfer so that we won't get any error in ftp_done() * because we didn't transfer the any file */ ftp->transfer = FTPTRANSFER_NONE; state(conn, FTP_STOP); return CURLE_OK; } /* Set resume file transfer offset */ infof(data, "Instructs server to resume from offset %" CURL_FORMAT_CURL_OFF_T "\n", data->state.resume_from); PPSENDF(&ftpc->pp, "REST %" CURL_FORMAT_CURL_OFF_T, data->state.resume_from); state(conn, FTP_RETR_REST); } else { /* no resume */ PPSENDF(&ftpc->pp, "RETR %s", ftpc->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) { #ifdef CURL_FTP_HTTPSTYLE_HEAD if(-1 != filesize) { snprintf(buf, sizeof(data->state.buffer), "Content-Length: %" CURL_FORMAT_CURL_OFF_T "\r\n", filesize); result = Curl_client_write(conn, CLIENTWRITE_BOTH, buf, 0); if(result) return result; } #endif Curl_pgrsSetDownloadSize(data, filesize); result = ftp_state_rest(conn); } else if(instate == FTP_RETR_SIZE) { Curl_pgrsSetDownloadSize(data, filesize); result = ftp_state_retr(conn, filesize); } else if(instate == FTP_STOR_SIZE) { data->state.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_conn *ftpc = &conn->proto.ftpc; switch(instate) { case FTP_REST: default: #ifdef CURL_FTP_HTTPSTYLE_HEAD if(ftpcode == 350) { char buffer[24]= { "Accept-ranges: bytes\r\n" }; result = Curl_client_write(conn, CLIENTWRITE_BOTH, buffer, 0); if(result) return result; } #endif result = ftp_state_prepare_transfer(conn); break; case FTP_RETR_REST: if(ftpcode != 350) { failf(conn->data, "Couldn't use REST"); result = CURLE_FTP_COULDNT_USE_REST; } else { PPSENDF(&ftpc->pp, "RETR %s", ftpc->file); state(conn, FTP_RETR); } break; } return result; } static CURLcode ftp_state_stor_resp(struct connectdata *conn, int ftpcode, ftpstate instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; if(ftpcode>=400) { failf(data, "Failed FTP upload: %0d", ftpcode); state(conn, FTP_STOP); /* oops, we never close the sockets! */ return CURLE_UPLOAD_FAILED; } conn->proto.ftpc.state_saved = instate; /* PORT means we are now awaiting the server to connect to us. */ if(data->set.ftp_use_port) { bool connected; state(conn, FTP_STOP); /* no longer in STOR state */ result = AllowServerConnect(conn, &connected); if(result) return result; if(!connected) { struct ftp_conn *ftpc = &conn->proto.ftpc; infof(data, "Data conn was not available immediately\n"); ftpc->wait_data_conn = TRUE; } return CURLE_OK; } else return InitiateTransfer(conn); } /* 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->req.protop; 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 transferred) 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 [file] (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 transferred 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(size > data->req.maxdownload && data->req.maxdownload > 0) size = data->req.size = data->req.maxdownload; else if((instate != FTP_LIST) && (data->set.prefer_ascii)) size = -1; /* kludge for servers that understate ASCII mode file size */ infof(data, "Maxdownload = %" CURL_FORMAT_CURL_OFF_T "\n", data->req.maxdownload); if(instate != FTP_LIST) infof(data, "Getting file with size: %" CURL_FORMAT_CURL_OFF_T "\n", size); /* FTP download: */ conn->proto.ftpc.state_saved = instate; conn->proto.ftpc.retr_size_saved = size; if(data->set.ftp_use_port) { bool connected; result = AllowServerConnect(conn, &connected); if(result) return result; if(!connected) { struct ftp_conn *ftpc = &conn->proto.ftpc; infof(data, "Data conn was not available immediately\n"); state(conn, FTP_STOP); ftpc->wait_data_conn = TRUE; } } else return InitiateTransfer(conn); } else { if((instate == FTP_LIST) && (ftpcode == 450)) { /* simply no matching files in the dir listing */ ftp->transfer = FTPTRANSFER_NONE; /* don't download anything */ state(conn, FTP_STOP); /* this phase is over */ } else { failf(data, "RETR response: %03d", ftpcode); return instate == FTP_RETR && ftpcode == 550? CURLE_REMOTE_FILE_NOT_FOUND: CURLE_FTP_COULDNT_RETR_FILE; } } return result; } /* after USER, PASS and ACCT */ static CURLcode ftp_state_loggedin(struct connectdata *conn) { CURLcode result = CURLE_OK; 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. */ PPSENDF(&conn->proto.ftpc.pp, "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->req.protop; struct ftp_conn *ftpc = &conn->proto.ftpc; (void)instate; /* no use for this yet */ /* some need password anyway, and others just return 2xx ignored */ if((ftpcode == 331) && (ftpc->state == FTP_USER)) { /* 331 Password required for ... (the server requires to send the user's password too) */ PPSENDF(&ftpc->pp, "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.str[STRING_FTP_ACCOUNT]) { PPSENDF(&ftpc->pp, "ACCT %s", data->set.str[STRING_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.str[STRING_FTP_ALTERNATIVE_TO_USER] && !conn->data->state.ftp_trying_alternative) { /* Ok, USER failed. Let's try the supplied command. */ PPSENDF(&conn->proto.ftpc.pp, "%s", conn->data->set.str[STRING_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; struct pingpong *pp = &ftpc->pp; static const char ftpauth[][4] = { "SSL", "TLS" }; size_t nread = 0; if(pp->sendleft) return Curl_pp_flushsend(pp); result = ftp_readresp(sock, pp, &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 == 230) /* 230 User logged in - already! */ return ftp_state_user_resp(conn, ftpcode, ftpc->state); else if(ftpcode != 220) { failf(data, "Got a %03d ftp-server response when 220 was expected", ftpcode); return CURLE_FTP_WEIRD_SERVER_REPLY; } /* We have received a 220 response fine, now we proceed. */ #ifdef HAVE_GSSAPI if(data->set.krb) { /* 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.str[STRING_KRB_LEVEL]); if(Curl_sec_login(conn) != CURLE_OK) infof(data, "Logging in with password in cleartext!\n"); else infof(data, "Authentication successful\n"); } #endif if(data->set.use_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", (int)data->set.ftpsslauth); return CURLE_UNKNOWN_OPTION; /* we don't know what to do */ } PPSENDF(&ftpc->pp, "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->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_pp_sendf(&ftpc->pp, "AUTH %s", ftpauth[ftpc->count1]); /* remain in this same state */ } else { if(data->set.use_ssl > CURLUSESSL_TRY) /* we failed and CURLUSESSL_CONTROL or CURLUSESSL_ALL is set */ result = CURLE_USE_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: PPSENDF(&ftpc->pp, "PROT %c", data->set.use_ssl == CURLUSESSL_CONTROL ? 'C' : 'P'); state(conn, FTP_PROT); break; case FTP_PROT: if(ftpcode/100 == 2) /* We have enabled SSL for the data connection! */ conn->ssl[SECONDARYSOCKET].use = (data->set.use_ssl != CURLUSESSL_CONTROL) ? TRUE : FALSE; /* FTP servers typically responds with 500 if they decide to reject our 'P' request */ else if(data->set.use_ssl > CURLUSESSL_CONTROL) /* we failed and bails out */ return CURLE_USE_SSL_FAILED; if(data->set.ftp_ccc) { /* CCC - Clear Command Channel */ PPSENDF(&ftpc->pp, "%s", "CCC"); state(conn, FTP_CCC); } else { result = ftp_state_pwd(conn); if(result) return result; } break; case FTP_CCC: if(ftpcode < 500) { /* First shut down the SSL layer (note: this call will block) */ result = Curl_ssl_shutdown(conn, FIRSTSOCKET); if(result) { failf(conn->data, "Failed to clear the command channel (CCC)"); return result; } } /* Then continue as normal */ result = ftp_state_pwd(conn); if(result) return result; break; case FTP_PWD: if(ftpcode == 257) { char *ptr=&data->state.buffer[4]; /* start on the first letter */ char *dir; char *store; dir = malloc(nread + 1); if(!dir) return CURLE_OUT_OF_MEMORY; /* Reply format is like 257[rubbish]"" and the RFC959 says The directory name can contain any character; embedded double-quotes should be escaped by double-quotes (the "quote-doubling" convention). */ /* scan for the first double-quote for non-standard responses */ while(ptr < &data->state.buffer[sizeof(data->state.buffer)] && *ptr != '\n' && *ptr != '\0' && *ptr != '"') ptr++; if('\"' == *ptr) { /* it started good */ ptr++; for(store = dir; *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++; } /* If the path name does not look like an absolute path (i.e.: it does not start with a '/'), we probably need some server-dependent adjustments. For example, this is the case when connecting to an OS400 FTP server: this server supports two name syntaxes, the default one being incompatible with standard pathes. In addition, this server switches automatically to the regular path syntax when one is encountered in a command: this results in having an entrypath in the wrong syntax when later used in CWD. The method used here is to check the server OS: we do it only if the path name looks strange to minimize overhead on other systems. */ if(!ftpc->server_os && dir[0] != '/') { result = Curl_pp_sendf(&ftpc->pp, "%s", "SYST"); if(result != CURLE_OK) { free(dir); return result; } Curl_safefree(ftpc->entrypath); 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; state(conn, FTP_SYST); break; } Curl_safefree(ftpc->entrypath); 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_SYST: if(ftpcode == 215) { char *ptr=&data->state.buffer[4]; /* start on the first letter */ char *os; char *store; os = malloc(nread + 1); if(!os) return CURLE_OUT_OF_MEMORY; /* Reply format is like 215 */ while(*ptr == ' ') ptr++; for(store = os; *ptr && *ptr != ' ';) *store++ = *ptr++; *store = '\0'; /* zero terminate */ /* Check for special servers here. */ if(strequal(os, "OS/400")) { /* Force OS400 name format 1. */ result = Curl_pp_sendf(&ftpc->pp, "%s", "SITE NAMEFMT 1"); if(result != CURLE_OK) { free(os); return result; } /* remember target server OS */ Curl_safefree(ftpc->server_os); ftpc->server_os = os; state(conn, FTP_NAMEFMT); break; } else { /* Nothing special for the target server. */ /* remember target server OS */ Curl_safefree(ftpc->server_os); ftpc->server_os = os; } } else { /* Cannot identify server OS. Continue anyway and cross fingers. */ } state(conn, FTP_STOP); /* we are done with the CONNECT phase! */ DEBUGF(infof(data, "protocol connect phase DONE\n")); break; case FTP_NAMEFMT: if(ftpcode == 250) { /* Name format change successful: reload initial path. */ ftp_state_pwd(conn); break; } 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) && !ftpc->count2) { /* failure response code, and not allowed to fail */ failf(conn->data, "QUOT command failed with %03d", ftpcode); return CURLE_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 */ PPSENDF(&ftpc->pp, "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_REMOTE_ACCESS_DENIED; } } else { /* success */ ftpc->count2=0; if(++ftpc->count1 <= ftpc->dirdepth) { /* send next CWD */ PPSENDF(&ftpc->pp, "CWD %s", ftpc->dirs[ftpc->count1 - 1]); } else { result = ftp_state_mdtm(conn); if(result) return result; } } break; case FTP_MKD: if((ftpcode/100 != 2) && !ftpc->count3--) { /* failure to MKD the dir */ failf(data, "Failed to MKD dir: %03d", ftpcode); return CURLE_REMOTE_ACCESS_DENIED; } state(conn, FTP_CWD); /* send CWD */ PPSENDF(&ftpc->pp, "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_PRET: if(ftpcode != 200) { /* there only is this one standard OK return code. */ failf(data, "PRET command not accepted: %03d", ftpcode); return CURLE_FTP_PRET_FAILED; } result = ftp_state_use_pasv(conn); 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, ftpc->state); break; case FTP_QUIT: /* fallthrough, just stop! */ default: /* internal error */ state(conn, FTP_STOP); break; } } /* if(ftpcode) */ return result; } /* called repeatedly until done from multi.c */ static CURLcode ftp_multi_statemach(struct connectdata *conn, bool *done) { struct ftp_conn *ftpc = &conn->proto.ftpc; CURLcode result = Curl_pp_statemach(&ftpc->pp, FALSE); /* Check for the state outside of the Curl_socket_ready() return code checks since at times we are in fact already in this state when this function gets called. */ *done = (ftpc->state == FTP_STOP) ? TRUE : FALSE; return result; } static CURLcode ftp_block_statemach(struct connectdata *conn) { struct ftp_conn *ftpc = &conn->proto.ftpc; struct pingpong *pp = &ftpc->pp; CURLcode result = CURLE_OK; while(ftpc->state != FTP_STOP) { result = Curl_pp_statemach(pp, TRUE); if(result) break; } return result; } /* * 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 if not. * */ static CURLcode ftp_connect(struct connectdata *conn, bool *done) /* see description above */ { CURLcode result; struct ftp_conn *ftpc = &conn->proto.ftpc; struct pingpong *pp = &ftpc->pp; *done = FALSE; /* default to not done yet */ /* We always support persistent connections on ftp */ conn->bits.close = FALSE; pp->response_time = RESP_TIMEOUT; /* set default response time-out */ pp->statemach_act = ftp_statemach_act; pp->endofresp = ftp_endofresp; pp->conn = conn; if(conn->handler->flags & PROTOPT_SSL) { /* BLOCKING */ result = Curl_ssl_connect(conn, FIRSTSOCKET); if(result) return result; } Curl_pp_init(pp); /* init the generic pingpong data */ /* When we connect, we start in the state where we await the 220 response */ state(conn, FTP_WAIT220); result = ftp_multi_statemach(conn, done); return result; } /*********************************************************************** * * 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. */ static CURLcode ftp_done(struct connectdata *conn, CURLcode status, bool premature) { struct SessionHandle *data = conn->data; struct FTP *ftp = data->req.protop; struct ftp_conn *ftpc = &conn->proto.ftpc; struct pingpong *pp = &ftpc->pp; ssize_t nread; int ftpcode; CURLcode result = CURLE_OK; bool was_ctl_valid = ftpc->ctl_valid; char *path; const char *path_to_use = data->state.path; 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; switch(status) { case CURLE_BAD_DOWNLOAD_RESUME: case CURLE_FTP_WEIRD_PASV_REPLY: case CURLE_FTP_PORT_FAILED: case CURLE_FTP_ACCEPT_FAILED: case CURLE_FTP_ACCEPT_TIMEOUT: case CURLE_FTP_COULDNT_SET_TYPE: case CURLE_FTP_COULDNT_RETR_FILE: case CURLE_PARTIAL_FILE: case CURLE_UPLOAD_FAILED: case CURLE_REMOTE_ACCESS_DENIED: case CURLE_FILESIZE_EXCEEDED: case CURLE_REMOTE_FILE_NOT_FOUND: case CURLE_WRITE_ERROR: /* the connection stays alive fine even though this happened */ /* fall-through */ case CURLE_OK: /* doesn't affect the control connection's status */ if(!premature) { ftpc->ctl_valid = was_ctl_valid; break; } /* until we cope better with prematurely ended requests, let them * fallback as if in complete failure */ default: /* by default, an error means the control connection is wedged and should not be used anymore */ ftpc->ctl_valid = FALSE; ftpc->cwdfail = TRUE; /* set this TRUE to prevent us to remember the current path, as this connection is going */ conn->bits.close = TRUE; /* marked for closure */ result = status; /* use the already set error code */ break; } /* now store a copy of the directory we are in */ if(ftpc->prevpath) free(ftpc->prevpath); if(data->set.wildcardmatch) { if(data->set.chunk_end && ftpc->file) { data->set.chunk_end(data->wildcard.customptr); } ftpc->known_filesize = -1; } /* get the "raw" path */ path = curl_easy_unescape(data, path_to_use, 0, NULL); if(!path) { /* out of memory, but we can limp along anyway (and should try to * since we may already be in the out of memory cleanup path) */ if(!result) result = CURLE_OUT_OF_MEMORY; ftpc->ctl_valid = FALSE; /* mark control connection as bad */ conn->bits.close = TRUE; /* mark for connection closure */ ftpc->prevpath = NULL; /* no path remembering */ } else { size_t flen = ftpc->file?strlen(ftpc->file):0; /* file is "raw" already */ size_t dlen = strlen(path)-flen; if(!ftpc->cwdfail) { if(dlen && (data->set.ftp_filemethod != FTPFILE_NOCWD)) { ftpc->prevpath = path; if(flen) /* if 'path' is not the whole string */ ftpc->prevpath[dlen]=0; /* terminate */ } else { /* we never changed dir */ ftpc->prevpath=strdup(""); free(path); } if(ftpc->prevpath) 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(ftpc); /* shut down the socket to inform the server we're done */ #ifdef _WIN32_WCE shutdown(conn->sock[SECONDARYSOCKET],2); /* SD_BOTH */ #endif if(conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD) { if(!result && ftpc->dont_check && data->req.maxdownload > 0) { /* partial download completed */ result = Curl_pp_sendf(pp, "%s", "ABOR"); if(result) { failf(data, "Failure sending ABOR command: %s", curl_easy_strerror(result)); ftpc->ctl_valid = FALSE; /* mark control connection as bad */ conn->bits.close = TRUE; /* mark for connection closure */ } } if(conn->ssl[SECONDARYSOCKET].use) { /* The secondary socket is using SSL so we must close down that part first before we close the socket for real */ Curl_ssl_close(conn, SECONDARYSOCKET); /* Note that we keep "use" set to TRUE since that (next) connection is still requested to use SSL */ } if(CURL_SOCKET_BAD != conn->sock[SECONDARYSOCKET]) { Curl_closesocket(conn, conn->sock[SECONDARYSOCKET]); conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; conn->bits.tcpconnect[SECONDARYSOCKET] = FALSE; } } if(!result && (ftp->transfer == FTPTRANSFER_BODY) && ftpc->ctl_valid && pp->pending_resp && !premature) { /* * 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 transferred. This happens when doing through NATs etc that * abandon old silent connections. */ long old_time = pp->response_time; pp->response_time = 60*1000; /* give it only a minute for now */ pp->response = Curl_tvnow(); /* timeout relative now */ result = Curl_GetFTPResponse(&nread, conn, &ftpcode); pp->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 */ conn->bits.close = TRUE; /* mark for closure */ } if(result) return result; if(ftpc->dont_check && data->req.maxdownload > 0) { /* we have just sent ABOR and there is no reliable way to check if it was * successful or not; we have to close the connection now */ infof(data, "partial download completed, closing connection\n"); conn->bits.close = TRUE; /* mark for closure */ 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 || premature) /* 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->transfer == FTPTRANSFER_BODY)) { failf(data, "Uploaded unaligned file size (%" CURL_FORMAT_CURL_OFF_T " out of %" CURL_FORMAT_CURL_OFF_T " bytes)", *ftp->bytecountp, data->set.infilesize); result = CURLE_PARTIAL_FILE; } } else { if((-1 != data->req.size) && (data->req.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. */ ((data->req.size + data->state.crlf_conversions) != *ftp->bytecountp) && #endif /* CURL_DO_LINEEND_CONV */ (data->req.maxdownload != *ftp->bytecountp)) { failf(data, "Received only partial file: %" CURL_FORMAT_CURL_OFF_T " bytes", *ftp->bytecountp); result = CURLE_PARTIAL_FILE; } else if(!ftpc->dont_check && !*ftp->bytecountp && (data->req.size>0)) { failf(data, "No data was received!"); result = CURLE_FTP_COULDNT_RETR_FILE; } } /* clear these for next connection */ ftp->transfer = FTPTRANSFER_BODY; ftpc->dont_check = FALSE; /* Send any post-transfer QUOTE strings? */ if(!status && !result && !premature && 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. * * BLOCKING */ static CURLcode ftp_sendquote(struct connectdata *conn, struct curl_slist *quote) { struct curl_slist *item; ssize_t nread; int ftpcode; CURLcode result; struct ftp_conn *ftpc = &conn->proto.ftpc; struct pingpong *pp = &ftpc->pp; item = quote; while(item) { if(item->data) { char *cmd = item->data; bool acceptfail = FALSE; /* if a command starts with an asterisk, which a legal FTP command never can, the command will be allowed to fail without it causing any aborts or cancels etc. It will cause libcurl to act as if the command is successful, whatever the server reponds. */ if(cmd[0] == '*') { cmd++; acceptfail = TRUE; } PPSENDF(&conn->proto.ftpc.pp, "%s", cmd); pp->response = Curl_tvnow(); /* timeout relative now */ result = Curl_GetFTPResponse(&nread, conn, &ftpcode); if(result) return result; if(!acceptfail && (ftpcode >= 400)) { failf(conn->data, "QUOT string not accepted: %s", cmd); return CURLE_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; char want = (char)(ascii?'A':'I'); if(ftpc->transfertype == want) { state(conn, newstate); return ftp_state_type_resp(conn, 200, newstate); } PPSENDF(&ftpc->pp, "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. * */ #ifndef CURL_DISABLE_VERBOSE_STRINGS 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); } #endif /* 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; char *ptr; char *ptr2; struct SessionHandle *data = conn->data; struct ftp_conn *ftpc = &conn->proto.ftpc; if(data->state.use_range && data->state.range) { from=curlx_strtoofft(data->state.range, &ptr, 0); while(*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->state.resume_from = from; DEBUGF(infof(conn->data, "FTP RANGE %" CURL_FORMAT_CURL_OFF_T " to end of file\n", from)); } else if(from < 0) { /* -Y */ data->req.maxdownload = -from; data->state.resume_from = from; DEBUGF(infof(conn->data, "FTP RANGE the last %" CURL_FORMAT_CURL_OFF_T " bytes\n", -from)); } else { /* X-Y */ data->req.maxdownload = (to-from)+1; /* include last byte */ data->state.resume_from = from; DEBUGF(infof(conn->data, "FTP RANGE from %" CURL_FORMAT_CURL_OFF_T " getting %" CURL_FORMAT_CURL_OFF_T " bytes\n", from, data->req.maxdownload)); } DEBUGF(infof(conn->data, "range-download from %" CURL_FORMAT_CURL_OFF_T " to %" CURL_FORMAT_CURL_OFF_T ", totally %" CURL_FORMAT_CURL_OFF_T " bytes\n", from, to, data->req.maxdownload)); ftpc->dont_check = TRUE; /* dont check for successful transfer */ } else data->req.maxdownload = -1; return CURLE_OK; } /* * ftp_do_more() * * This function shall be called when the second FTP (data) connection is * connected. * * 'complete' can return 0 for incomplete, 1 for done and -1 for go back * (which basically is only for when PASV is being sent to retry a failed * EPSV). */ static CURLcode ftp_do_more(struct connectdata *conn, int *completep) { struct SessionHandle *data=conn->data; struct ftp_conn *ftpc = &conn->proto.ftpc; CURLcode result = CURLE_OK; bool connected = FALSE; bool complete = FALSE; /* the ftp struct is inited in ftp_connect() */ struct FTP *ftp = data->req.protop; /* if the second connection isn't done yet, wait for it */ if(!conn->bits.tcpconnect[SECONDARYSOCKET]) { if(conn->tunnel_state[SECONDARYSOCKET] == TUNNEL_CONNECT) { /* As we're in TUNNEL_CONNECT state now, we know the proxy name and port aren't used so we blank their arguments. TODO: make this nicer */ result = Curl_proxyCONNECT(conn, SECONDARYSOCKET, NULL, 0); return result; } result = Curl_is_connected(conn, SECONDARYSOCKET, &connected); /* Ready to do more? */ if(connected) { DEBUGF(infof(data, "DO-MORE connected phase starts\n")); if(conn->bits.proxy) { infof(data, "Connection to proxy confirmed\n"); result = proxy_magic(conn, ftpc->newhost, ftpc->newport, &connected); } } else { if(result && (ftpc->count1 == 0)) { *completep = -1; /* go back to DOING please */ /* this is a EPSV connect failing, try PASV instead */ return ftp_epsv_disable(conn); } return result; } } if(ftpc->state) { /* already in a state so skip the intial commands. They are only done to kickstart the do_more state */ result = ftp_multi_statemach(conn, &complete); *completep = (int)complete; /* if we got an error or if we don't wait for a data connection return immediately */ if(result || (ftpc->wait_data_conn != TRUE)) return result; if(ftpc->wait_data_conn) /* if we reach the end of the FTP state machine here, *complete will be TRUE but so is ftpc->wait_data_conn, which says we need to wait for the data connection and therefore we're not actually complete */ *completep = 0; } if(ftp->transfer <= FTPTRANSFER_INFO) { /* a transfer is about to take place, or if not a file name was given so we'll do a SIZE on it later and then we need the right TYPE first */ if(ftpc->wait_data_conn == TRUE) { bool serv_conned; result = ReceivedServerConnect(conn, &serv_conned); if(result) return result; /* Failed to accept data connection */ if(serv_conned) { /* It looks data connection is established */ result = AcceptServerConnect(conn); ftpc->wait_data_conn = FALSE; if(!result) result = InitiateTransfer(conn); if(result) return result; *completep = 1; /* this state is now complete when the server has connected back to us */ } } else if(data->set.upload) { result = ftp_nb_type(conn, data->set.prefer_ascii, FTP_STOR_TYPE); if(result) return result; result = ftp_multi_statemach(conn, &complete); *completep = (int)complete; } else { /* download */ ftp->downloadsize = -1; /* unknown as of yet */ result = ftp_range(conn); if(result) ; else if(data->set.ftp_list_only || !ftpc->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. */ /* But only if a body transfer was requested. */ if(ftp->transfer == FTPTRANSFER_BODY) { result = ftp_nb_type(conn, TRUE, FTP_LIST_TYPE); if(result) return result; } /* otherwise just fall through */ } else { result = ftp_nb_type(conn, data->set.prefer_ascii, FTP_RETR_TYPE); if(result) return result; } result = ftp_multi_statemach(conn, &complete); *completep = (int)complete; } return result; } if((result == CURLE_OK) && (ftp->transfer != FTPTRANSFER_BODY)) /* no data to transfer. FIX: it feels like a kludge to have this here too! */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); if(!ftpc->wait_data_conn) { /* no waiting for the data connection so this is now complete */ *completep = 1; DEBUGF(infof(data, "DO-MORE phase ends with %d\n", (int)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")); if(conn->data->set.opt_no_body) { /* requested no body means no transfer... */ struct FTP *ftp = conn->data->req.protop; ftp->transfer = FTPTRANSFER_INFO; } *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 */ result = ftp_multi_statemach(conn, dophase_done); *connected = conn->bits.tcpconnect[SECONDARYSOCKET]; infof(conn->data, "ftp_perform ends with SECONDARY: %d\n", *connected); if(*dophase_done) DEBUGF(infof(conn->data, "DO phase is complete1\n")); return result; } static void wc_data_dtor(void *ptr) { struct ftp_wc_tmpdata *tmp = ptr; if(tmp) Curl_ftp_parselist_data_free(&tmp->parser); Curl_safefree(tmp); } static CURLcode init_wc_data(struct connectdata *conn) { char *last_slash; char *path = conn->data->state.path; struct WildcardData *wildcard = &(conn->data->wildcard); CURLcode ret = CURLE_OK; struct ftp_wc_tmpdata *ftp_tmp; last_slash = strrchr(conn->data->state.path, '/'); if(last_slash) { last_slash++; if(last_slash[0] == '\0') { wildcard->state = CURLWC_CLEAN; ret = ftp_parse_url_path(conn); return ret; } else { wildcard->pattern = strdup(last_slash); if(!wildcard->pattern) return CURLE_OUT_OF_MEMORY; last_slash[0] = '\0'; /* cut file from path */ } } else { /* there is only 'wildcard pattern' or nothing */ if(path[0]) { wildcard->pattern = strdup(path); if(!wildcard->pattern) return CURLE_OUT_OF_MEMORY; path[0] = '\0'; } else { /* only list */ wildcard->state = CURLWC_CLEAN; ret = ftp_parse_url_path(conn); return ret; } } /* program continues only if URL is not ending with slash, allocate needed resources for wildcard transfer */ /* allocate ftp protocol specific temporary wildcard data */ ftp_tmp = calloc(1, sizeof(struct ftp_wc_tmpdata)); if(!ftp_tmp) { Curl_safefree(wildcard->pattern); return CURLE_OUT_OF_MEMORY; } /* INITIALIZE parselist structure */ ftp_tmp->parser = Curl_ftp_parselist_data_alloc(); if(!ftp_tmp->parser) { Curl_safefree(wildcard->pattern); Curl_safefree(ftp_tmp); return CURLE_OUT_OF_MEMORY; } wildcard->tmp = ftp_tmp; /* put it to the WildcardData tmp pointer */ wildcard->tmp_dtor = wc_data_dtor; /* wildcard does not support NOCWD option (assert it?) */ if(conn->data->set.ftp_filemethod == FTPFILE_NOCWD) conn->data->set.ftp_filemethod = FTPFILE_MULTICWD; /* try to parse ftp url */ ret = ftp_parse_url_path(conn); if(ret) { Curl_safefree(wildcard->pattern); wildcard->tmp_dtor(wildcard->tmp); wildcard->tmp_dtor = ZERO_NULL; wildcard->tmp = NULL; return ret; } wildcard->path = strdup(conn->data->state.path); if(!wildcard->path) { Curl_safefree(wildcard->pattern); wildcard->tmp_dtor(wildcard->tmp); wildcard->tmp_dtor = ZERO_NULL; wildcard->tmp = NULL; return CURLE_OUT_OF_MEMORY; } /* backup old write_function */ ftp_tmp->backup.write_function = conn->data->set.fwrite_func; /* parsing write function */ conn->data->set.fwrite_func = Curl_ftp_parselist; /* backup old file descriptor */ ftp_tmp->backup.file_descriptor = conn->data->set.out; /* let the writefunc callback know what curl pointer is working with */ conn->data->set.out = conn; infof(conn->data, "Wildcard - Parsing started\n"); return CURLE_OK; } /* This is called recursively */ static CURLcode wc_statemach(struct connectdata *conn) { struct WildcardData * const wildcard = &(conn->data->wildcard); CURLcode ret = CURLE_OK; switch (wildcard->state) { case CURLWC_INIT: ret = init_wc_data(conn); if(wildcard->state == CURLWC_CLEAN) /* only listing! */ break; else wildcard->state = ret ? CURLWC_ERROR : CURLWC_MATCHING; break; case CURLWC_MATCHING: { /* In this state is LIST response successfully parsed, so lets restore previous WRITEFUNCTION callback and WRITEDATA pointer */ struct ftp_wc_tmpdata *ftp_tmp = wildcard->tmp; conn->data->set.fwrite_func = ftp_tmp->backup.write_function; conn->data->set.out = ftp_tmp->backup.file_descriptor; ftp_tmp->backup.write_function = ZERO_NULL; ftp_tmp->backup.file_descriptor = NULL; wildcard->state = CURLWC_DOWNLOADING; if(Curl_ftp_parselist_geterror(ftp_tmp->parser)) { /* error found in LIST parsing */ wildcard->state = CURLWC_CLEAN; return wc_statemach(conn); } else if(wildcard->filelist->size == 0) { /* no corresponding file */ wildcard->state = CURLWC_CLEAN; return CURLE_REMOTE_FILE_NOT_FOUND; } return wc_statemach(conn); } case CURLWC_DOWNLOADING: { /* filelist has at least one file, lets get first one */ struct ftp_conn *ftpc = &conn->proto.ftpc; struct curl_fileinfo *finfo = wildcard->filelist->head->ptr; char *tmp_path = aprintf("%s%s", wildcard->path, finfo->filename); if(!tmp_path) return CURLE_OUT_OF_MEMORY; /* switch default "state.pathbuffer" and tmp_path, good to see ftp_parse_url_path function to understand this trick */ Curl_safefree(conn->data->state.pathbuffer); conn->data->state.pathbuffer = tmp_path; conn->data->state.path = tmp_path; infof(conn->data, "Wildcard - START of \"%s\"\n", finfo->filename); if(conn->data->set.chunk_bgn) { long userresponse = conn->data->set.chunk_bgn( finfo, wildcard->customptr, (int)wildcard->filelist->size); switch(userresponse) { case CURL_CHUNK_BGN_FUNC_SKIP: infof(conn->data, "Wildcard - \"%s\" skipped by user\n", finfo->filename); wildcard->state = CURLWC_SKIP; return wc_statemach(conn); case CURL_CHUNK_BGN_FUNC_FAIL: return CURLE_CHUNK_FAILED; } } if(finfo->filetype != CURLFILETYPE_FILE) { wildcard->state = CURLWC_SKIP; return wc_statemach(conn); } if(finfo->flags & CURLFINFOFLAG_KNOWN_SIZE) ftpc->known_filesize = finfo->size; ret = ftp_parse_url_path(conn); if(ret) { return ret; } /* we don't need the Curl_fileinfo of first file anymore */ Curl_llist_remove(wildcard->filelist, wildcard->filelist->head, NULL); if(wildcard->filelist->size == 0) { /* remains only one file to down. */ wildcard->state = CURLWC_CLEAN; /* after that will be ftp_do called once again and no transfer will be done because of CURLWC_CLEAN state */ return CURLE_OK; } } break; case CURLWC_SKIP: { if(conn->data->set.chunk_end) conn->data->set.chunk_end(conn->data->wildcard.customptr); Curl_llist_remove(wildcard->filelist, wildcard->filelist->head, NULL); wildcard->state = (wildcard->filelist->size == 0) ? CURLWC_CLEAN : CURLWC_DOWNLOADING; return wc_statemach(conn); } case CURLWC_CLEAN: { struct ftp_wc_tmpdata *ftp_tmp = wildcard->tmp; ret = CURLE_OK; if(ftp_tmp) { ret = Curl_ftp_parselist_geterror(ftp_tmp->parser); } wildcard->state = ret ? CURLWC_ERROR : CURLWC_DONE; } break; case CURLWC_DONE: case CURLWC_ERROR: break; } return ret; } /*********************************************************************** * * ftp_do() * * 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. */ static CURLcode ftp_do(struct connectdata *conn, bool *done) { CURLcode retcode = CURLE_OK; struct ftp_conn *ftpc = &conn->proto.ftpc; *done = FALSE; /* default to false */ ftpc->wait_data_conn = FALSE; /* default to no such wait */ if(conn->data->set.wildcardmatch) { retcode = wc_statemach(conn); if(conn->data->wildcard.state == CURLWC_SKIP || conn->data->wildcard.state == CURLWC_DONE) { /* do not call ftp_regular_transfer */ return CURLE_OK; } if(retcode) /* error, loop or skipping the file */ return retcode; } else { /* no wildcard FSM needed */ retcode = ftp_parse_url_path(conn); if(retcode) return retcode; } retcode = ftp_regular_transfer(conn, done); return retcode; } CURLcode Curl_ftpsendf(struct connectdata *conn, const char *fmt, ...) { ssize_t bytes_written; #define SBUF_SIZE 1024 char s[SBUF_SIZE]; size_t write_len; char *sptr=s; CURLcode res = CURLE_OK; #ifdef HAVE_GSSAPI enum protection_level data_sec = conn->data_prot; #endif va_list ap; va_start(ap, fmt); write_len = vsnprintf(s, SBUF_SIZE-3, fmt, ap); va_end(ap); strcpy(&s[write_len], "\r\n"); /* append a trailing CRLF */ write_len +=2; bytes_written=0; res = Curl_convert_to_network(conn->data, s, write_len); /* Curl_convert_to_network calls failf if unsuccessful */ if(res) return(res); for(;;) { #ifdef HAVE_GSSAPI conn->data_prot = PROT_CMD; #endif res = Curl_write(conn, conn->sock[FIRSTSOCKET], sptr, write_len, &bytes_written); #ifdef HAVE_GSSAPI DEBUGASSERT(data_sec > PROT_NONE && data_sec < PROT_LAST); conn->data_prot = data_sec; #endif 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) { result = Curl_pp_sendf(&conn->proto.ftpc.pp, "%s", "QUIT"); if(result) { failf(conn->data, "Failure sending QUIT command: %s", curl_easy_strerror(result)); conn->proto.ftpc.ctl_valid = FALSE; /* mark control connection as bad */ conn->bits.close = TRUE; /* mark for connection closure */ state(conn, FTP_STOP); return result; } state(conn, FTP_QUIT); result = ftp_block_statemach(conn); } return result; } /*********************************************************************** * * ftp_disconnect() * * Disconnect from an FTP server. Cleanup protocol-specific per-connection * resources. BLOCKING. */ static CURLcode ftp_disconnect(struct connectdata *conn, bool dead_connection) { struct ftp_conn *ftpc= &conn->proto.ftpc; struct pingpong *pp = &ftpc->pp; /* 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. */ if(dead_connection) ftpc->ctl_valid = FALSE; /* The FTP session may or may not have been allocated/setup at this point! */ (void)ftp_quit(conn); /* ignore errors on the QUIT */ if(ftpc->entrypath) { struct SessionHandle *data = conn->data; if(data->state.most_recent_ftp_entrypath == ftpc->entrypath) { data->state.most_recent_ftp_entrypath = NULL; } free(ftpc->entrypath); ftpc->entrypath = NULL; } freedirs(ftpc); if(ftpc->prevpath) { free(ftpc->prevpath); ftpc->prevpath = NULL; } if(ftpc->server_os) { free(ftpc->server_os); ftpc->server_os = NULL; } Curl_pp_disconnect(pp); #ifdef HAVE_GSSAPI Curl_sec_end(conn); #endif return CURLE_OK; } /*********************************************************************** * * ftp_parse_url_path() * * Parse the URL path into separate path components. * */ static CURLcode ftp_parse_url_path(struct connectdata *conn) { struct SessionHandle *data = conn->data; /* the ftp struct is already inited in ftp_connect() */ struct FTP *ftp = data->req.protop; struct ftp_conn *ftpc = &conn->proto.ftpc; const char *slash_pos; /* position of the first '/' char in curpos */ const char *path_to_use = data->state.path; const char *cur_pos; const char *filename = NULL; 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 */ /* The best time to check whether the path is a file or directory is right here. so: the first condition in the if() right here, is there just in case someone decides to set path to NULL one day */ if(data->state.path && data->state.path[0] && (data->state.path[strlen(data->state.path) - 1] != '/') ) filename = data->state.path; /* this is a full file path */ /* ftpc->file is not used anywhere other than for operations on a file. In other words, never for directory operations. So we can safely leave filename as NULL here and use it as a argument in dir/file decisions. */ break; case FTPFILE_SINGLECWD: /* get the last slash */ if(!path_to_use[0]) { /* no dir, no file */ ftpc->dirdepth = 0; break; } slash_pos=strrchr(cur_pos, '/'); if(slash_pos || !*cur_pos) { size_t dirlen = slash_pos-cur_pos; ftpc->dirs = calloc(1, sizeof(ftpc->dirs[0])); if(!ftpc->dirs) return CURLE_OUT_OF_MEMORY; if(!dirlen) dirlen++; ftpc->dirs[0] = curl_easy_unescape(conn->data, slash_pos ? cur_pos : "/", slash_pos ? curlx_uztosi(dirlen) : 1, NULL); if(!ftpc->dirs[0]) { freedirs(ftpc); return CURLE_OUT_OF_MEMORY; } ftpc->dirdepth = 1; /* we consider it to be a single dir */ filename = slash_pos ? slash_pos+1 : cur_pos; /* rest is file name */ } else filename = 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 = calloc(ftpc->diralloc, sizeof(ftpc->dirs[0])); if(!ftpc->dirs) return CURLE_OUT_OF_MEMORY; /* we have a special case for listing the root dir only */ if(strequal(path_to_use, "/")) { cur_pos++; /* make it point to the zero byte */ ftpc->dirs[0] = strdup("/"); ftpc->dirdepth++; } else { /* parse the URL path into separate path components */ while((slash_pos = strchr(cur_pos, '/')) != NULL) { /* 1 or 0 pointer offset to indicate absolute directory */ ssize_t absolute_dir = ((cur_pos - data->state.path > 0) && (ftpc->dirdepth == 0))?1: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-existent parameter a) doesn't work on many servers and b) has no effect on the others. */ int len = curlx_sztosi(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(ftpc); return CURLE_OUT_OF_MEMORY; } if(isBadFtpString(ftpc->dirs[ftpc->dirdepth])) { free(ftpc->dirs[ftpc->dirdepth]); freedirs(ftpc); return CURLE_URL_MALFORMAT; } } else { cur_pos = slash_pos + 1; /* jump to the rest of the string */ if(!ftpc->dirdepth) { /* path starts with a slash, add that as a directory */ ftpc->dirs[ftpc->dirdepth] = strdup("/"); if(!ftpc->dirs[ftpc->dirdepth++]) { /* run out of memory ... */ failf(data, "no memory"); freedirs(ftpc); return CURLE_OUT_OF_MEMORY; } } continue; } 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) { freedirs(ftpc); return CURLE_OUT_OF_MEMORY; } ftpc->dirs = bigger; } } } filename = cur_pos; /* the rest is the file name */ break; } /* switch */ if(filename && *filename) { ftpc->file = curl_easy_unescape(conn->data, filename, 0, NULL); if(NULL == ftpc->file) { freedirs(ftpc); failf(data, "no memory"); return CURLE_OUT_OF_MEMORY; } if(isBadFtpString(ftpc->file)) { freedirs(ftpc); return CURLE_URL_MALFORMAT; } } else ftpc->file=NULL; /* instead of point to a zero byte, we make it a NULL pointer */ if(data->set.upload && !ftpc->file && (ftp->transfer == FTPTRANSFER_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 */ int dlen; char *path = curl_easy_unescape(conn->data, data->state.path, 0, &dlen); if(!path) { freedirs(ftpc); return CURLE_OUT_OF_MEMORY; } dlen -= ftpc->file?curlx_uztosi(strlen(ftpc->file)):0; if((dlen == curlx_uztosi(strlen(ftpc->prevpath))) && strnequal(path, ftpc->prevpath, dlen)) { infof(data, "Request has same path as previous transfer\n"); ftpc->cwddone = TRUE; } free(path); } return CURLE_OK; } /* call this when the DO phase has completed */ static CURLcode ftp_dophase_done(struct connectdata *conn, bool connected) { struct FTP *ftp = conn->data->req.protop; struct ftp_conn *ftpc = &conn->proto.ftpc; if(connected) { int completed; CURLcode result = ftp_do_more(conn, &completed); if(result) { if(conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD) { /* close the second socket if it was created already */ Curl_closesocket(conn, conn->sock[SECONDARYSOCKET]); conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; } return result; } } if(ftp->transfer != FTPTRANSFER_BODY) /* no data to transfer */ 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 CURLE_OK; } /* called from multi.c while DOing */ static CURLcode ftp_doing(struct connectdata *conn, bool *dophase_done) { CURLcode result = ftp_multi_statemach(conn, dophase_done); if(result) DEBUGF(infof(conn->data, "DO phase failed\n")); else if(*dophase_done) { result = ftp_dophase_done(conn, FALSE /* not connected */); DEBUGF(infof(conn->data, "DO phase is complete2\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 * 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=FALSE; struct SessionHandle *data = conn->data; struct ftp_conn *ftpc = &conn->proto.ftpc; data->req.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(ftpc); return result; } static CURLcode ftp_setup_connection(struct connectdata *conn) { struct SessionHandle *data = conn->data; char *type; char command; struct FTP *ftp; if(conn->bits.httpproxy && !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 if(conn->handler == &Curl_handler_ftp) conn->handler = &Curl_handler_ftp_proxy; else { #ifdef USE_SSL conn->handler = &Curl_handler_ftps_proxy; #else failf(data, "FTPS not supported!"); return CURLE_UNSUPPORTED_PROTOCOL; #endif } /* set it up as a HTTP connection instead */ return conn->handler->setup_connection(conn); #else failf(data, "FTP over http proxy requires HTTP support built-in!"); return CURLE_UNSUPPORTED_PROTOCOL; #endif } conn->data->req.protop = ftp = malloc(sizeof(struct FTP)); if(NULL == ftp) return CURLE_OUT_OF_MEMORY; data->state.path++; /* don't include the initial slash */ data->state.slash_removed = TRUE; /* we've skipped the slash */ /* FTP URLs support an extension like ";type=" that * we'll try to get now! */ type = strstr(data->state.path, ";type="); if(!type) type = strstr(conn->host.rawalloc, ";type="); if(type) { *type = 0; /* it was in the middle of the hostname */ command = Curl_raw_toupper(type[6]); conn->bits.type_set = TRUE; 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; } } /* get some initial data into the ftp struct */ ftp->bytecountp = &conn->data->req.bytecount; ftp->transfer = FTPTRANSFER_BODY; ftp->downloadsize = 0; /* No need to duplicate user+password, the connectdata struct won't change during a session, but we re-init them here since on subsequent inits since the conn struct may have changed or been replaced. */ ftp->user = conn->user; ftp->passwd = conn->passwd; if(isBadFtpString(ftp->user)) return CURLE_URL_MALFORMAT; if(isBadFtpString(ftp->passwd)) return CURLE_URL_MALFORMAT; conn->proto.ftpc.known_filesize = -1; /* unknown size for now */ return CURLE_OK; } #endif /* CURL_DISABLE_FTP */ curl-7.35.0/lib/pipeline.c0000644000175000017500000002156712270035364012230 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2013, Linus Nielsen Feltzing, * Copyright (C) 2013-2014, 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. * ***************************************************************************/ #include "curl_setup.h" #include #include "urldata.h" #include "url.h" #include "progress.h" #include "multiif.h" #include "pipeline.h" #include "sendf.h" #include "rawstr.h" #include "bundles.h" #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" struct site_blacklist_entry { char *hostname; unsigned short port; }; static void site_blacklist_llist_dtor(void *user, void *element) { struct site_blacklist_entry *entry = element; (void)user; Curl_safefree(entry->hostname); Curl_safefree(entry); } static void server_blacklist_llist_dtor(void *user, void *element) { char *server_name = element; (void)user; Curl_safefree(server_name); } bool Curl_pipeline_penalized(struct SessionHandle *data, struct connectdata *conn) { if(data) { bool penalized = FALSE; curl_off_t penalty_size = Curl_multi_content_length_penalty_size(data->multi); curl_off_t chunk_penalty_size = Curl_multi_chunk_length_penalty_size(data->multi); curl_off_t recv_size = -2; /* Make it easy to spot in the log */ /* Find the head of the recv pipe, if any */ if(conn->recv_pipe && conn->recv_pipe->head) { struct SessionHandle *recv_handle = conn->recv_pipe->head->ptr; recv_size = recv_handle->req.size; if(penalty_size > 0 && recv_size > penalty_size) penalized = TRUE; } if(chunk_penalty_size > 0 && (curl_off_t)conn->chunk.datasize > chunk_penalty_size) penalized = TRUE; infof(data, "Conn: %ld (%p) Receive pipe weight: (%" CURL_FORMAT_CURL_OFF_T "/%zu), penalized: %s\n", conn->connection_id, (void *)conn, recv_size, conn->chunk.datasize, penalized?"TRUE":"FALSE"); return penalized; } return FALSE; } CURLcode Curl_add_handle_to_pipeline(struct SessionHandle *handle, struct connectdata *conn) { struct curl_llist_element *sendhead = conn->send_pipe->head; struct curl_llist *pipeline; CURLcode rc; pipeline = conn->send_pipe; rc = Curl_addHandleToPipeline(handle, pipeline); if(pipeline == conn->send_pipe && sendhead != conn->send_pipe->head) { /* this is a new one as head, expire it */ conn->writechannel_inuse = FALSE; /* not in use yet */ Curl_expire(conn->send_pipe->head->ptr, 1); } #if 0 /* enable for pipeline debugging */ print_pipeline(conn); #endif return rc; } /* Move this transfer from the sending list to the receiving list. Pay special attention to the new sending list "leader" as it needs to get checked to update what sockets it acts on. */ void Curl_move_handle_from_send_to_recv_pipe(struct SessionHandle *handle, struct connectdata *conn) { struct curl_llist_element *curr; curr = conn->send_pipe->head; while(curr) { if(curr->ptr == handle) { Curl_llist_move(conn->send_pipe, curr, conn->recv_pipe, conn->recv_pipe->tail); if(conn->send_pipe->head) { /* Since there's a new easy handle at the start of the send pipeline, set its timeout value to 1ms to make it trigger instantly */ conn->writechannel_inuse = FALSE; /* not used now */ #ifdef DEBUGBUILD infof(conn->data, "%p is at send pipe head B!\n", (void *)conn->send_pipe->head->ptr); #endif Curl_expire(conn->send_pipe->head->ptr, 1); } /* The receiver's list is not really interesting here since either this handle is now first in the list and we'll deal with it soon, or another handle is already first and thus is already taken care of */ break; /* we're done! */ } curr = curr->next; } } bool Curl_pipeline_site_blacklisted(struct SessionHandle *handle, struct connectdata *conn) { if(handle->multi) { struct curl_llist *blacklist = Curl_multi_pipelining_site_bl(handle->multi); if(blacklist) { struct curl_llist_element *curr; curr = blacklist->head; while(curr) { struct site_blacklist_entry *site; site = curr->ptr; if(Curl_raw_equal(site->hostname, conn->host.name) && site->port == conn->remote_port) { infof(handle, "Site %s:%d is pipeline blacklisted\n", conn->host.name, conn->remote_port); return TRUE; } curr = curr->next; } } } return FALSE; } CURLMcode Curl_pipeline_set_site_blacklist(char **sites, struct curl_llist **list_ptr) { struct curl_llist *old_list = *list_ptr; struct curl_llist *new_list = NULL; if(sites) { new_list = Curl_llist_alloc((curl_llist_dtor) site_blacklist_llist_dtor); if(!new_list) return CURLM_OUT_OF_MEMORY; /* Parse the URLs and populate the list */ while(*sites) { char *hostname; char *port; struct site_blacklist_entry *entry; entry = malloc(sizeof(struct site_blacklist_entry)); hostname = strdup(*sites); if(!hostname) return CURLM_OUT_OF_MEMORY; port = strchr(hostname, ':'); if(port) { *port = '\0'; port++; entry->port = (unsigned short)strtol(port, NULL, 10); } else { /* Default port number for HTTP */ entry->port = 80; } entry->hostname = hostname; if(!Curl_llist_insert_next(new_list, new_list->tail, entry)) return CURLM_OUT_OF_MEMORY; sites++; } } /* Free the old list */ if(old_list) { Curl_llist_destroy(old_list, NULL); } /* This might be NULL if sites == NULL, i.e the blacklist is cleared */ *list_ptr = new_list; return CURLM_OK; } bool Curl_pipeline_server_blacklisted(struct SessionHandle *handle, char *server_name) { if(handle->multi) { struct curl_llist *blacklist = Curl_multi_pipelining_server_bl(handle->multi); if(blacklist) { struct curl_llist_element *curr; curr = blacklist->head; while(curr) { char *bl_server_name; bl_server_name = curr->ptr; if(Curl_raw_nequal(bl_server_name, server_name, strlen(bl_server_name))) { infof(handle, "Server %s is blacklisted\n", server_name); return TRUE; } curr = curr->next; } } infof(handle, "Server %s is not blacklisted\n", server_name); } return FALSE; } CURLMcode Curl_pipeline_set_server_blacklist(char **servers, struct curl_llist **list_ptr) { struct curl_llist *old_list = *list_ptr; struct curl_llist *new_list = NULL; if(servers) { new_list = Curl_llist_alloc((curl_llist_dtor) server_blacklist_llist_dtor); if(!new_list) return CURLM_OUT_OF_MEMORY; /* Parse the URLs and populate the list */ while(*servers) { char *server_name; server_name = strdup(*servers); if(!server_name) return CURLM_OUT_OF_MEMORY; if(!Curl_llist_insert_next(new_list, new_list->tail, server_name)) return CURLM_OUT_OF_MEMORY; servers++; } } /* Free the old list */ if(old_list) { Curl_llist_destroy(old_list, NULL); } /* This might be NULL if sites == NULL, i.e the blacklist is cleared */ *list_ptr = new_list; return CURLM_OK; } #if 0 void print_pipeline(struct connectdata *conn) { struct curl_llist_element *curr; struct connectbundle *cb_ptr; struct SessionHandle *data = conn->data; cb_ptr = conn->bundle; if(cb_ptr) { curr = cb_ptr->conn_list->head; while(curr) { conn = curr->ptr; infof(data, "- Conn %ld (%p) send_pipe: %zu, recv_pipe: %zu\n", conn->connection_id, (void *)conn, conn->send_pipe->size, conn->recv_pipe->size); curr = curr->next; } } } #endif curl-7.35.0/lib/timeval.c0000644000175000017500000000747712213173003012056 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2008, 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. * ***************************************************************************/ #include "timeval.h" #if defined(WIN32) && !defined(MSDOS) struct timeval curlx_tvnow(void) { /* ** GetTickCount() is available on _all_ Windows versions from W95 up ** to nowadays. Returns milliseconds elapsed since last system boot, ** increases monotonically and wraps once 49.7 days have elapsed. */ struct timeval now; DWORD milliseconds = GetTickCount(); now.tv_sec = milliseconds / 1000; now.tv_usec = (milliseconds % 1000) * 1000; return now; } #elif defined(HAVE_CLOCK_GETTIME_MONOTONIC) struct timeval curlx_tvnow(void) { /* ** clock_gettime() is granted to be increased monotonically when the ** monotonic clock is queried. Time starting point is unspecified, it ** could be the system start-up time, the Epoch, or something else, ** in any case the time starting point does not change once that the ** system has started up. */ struct timeval now; struct timespec tsnow; if(0 == clock_gettime(CLOCK_MONOTONIC, &tsnow)) { now.tv_sec = tsnow.tv_sec; now.tv_usec = tsnow.tv_nsec / 1000; } /* ** Even when the configure process has truly detected monotonic clock ** availability, it might happen that it is not actually available at ** run-time. When this occurs simply fallback to other time source. */ #ifdef HAVE_GETTIMEOFDAY else (void)gettimeofday(&now, NULL); #else else { now.tv_sec = (long)time(NULL); now.tv_usec = 0; } #endif return now; } #elif defined(HAVE_GETTIMEOFDAY) struct timeval curlx_tvnow(void) { /* ** gettimeofday() is not granted to be increased monotonically, due to ** clock drifting and external source time synchronization it can jump ** forward or backward in time. */ struct timeval now; (void)gettimeofday(&now, NULL); return now; } #else struct timeval curlx_tvnow(void) { /* ** time() returns the value of time in seconds since the Epoch. */ struct timeval now; now.tv_sec = (long)time(NULL); now.tv_usec = 0; return now; } #endif /* * 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) { if(newer.tv_sec != older.tv_sec) return (double)(newer.tv_sec-older.tv_sec)+ (double)(newer.tv_usec-older.tv_usec)/1000000.0; else return (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; } curl-7.35.0/lib/inet_pton.c0000644000175000017500000001377012213173003012405 00000000000000/* 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 "curl_setup.h" #ifndef HAVE_INET_PTON #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #include "inet_pton.h" #define IN6ADDRSZ 16 #define INADDRSZ 4 #define INT16SZ 2 /* * 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) * notice: * On Windows we store the error in the thread errno, not * in the winsock error code. This is to avoid losing the * actual last winsock error. So use macro ERRNO to fetch the * errno this function sets when returning (-1), not SOCKERRNO. * 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 case AF_INET6: return (inet_pton6(src, (unsigned char *)dst)); #endif default: SET_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(saw_digit && *tp == 0) return (0); if(val > 255) return (0); *tp = (unsigned char)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); 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; size_t 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(++saw_xdigit > 4) return (0); 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 ssize_t n = tp - colonp; ssize_t i; if(tp == endp) return (0); for(i = 1; i <= n; i++) { *(endp - i) = *(colonp + n - i); *(colonp + n - i) = 0; } tp = endp; } if(tp != endp) return (0); memcpy(dst, tmp, IN6ADDRSZ); return (1); } #endif /* ENABLE_IPV6 */ #endif /* HAVE_INET_PTON */ curl-7.35.0/lib/socks_gssapi.c0000644000175000017500000004706112213173003013076 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2009, 2011, Markus Moeller, * Copyright (C) 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_PROXY #ifdef HAVE_GSSAPI #ifdef HAVE_OLD_GSSMIT #define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name #define NCOMPAT 1 #endif #ifndef gss_nt_service_name #define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE #endif #include "curl_gssapi.h" #include "urldata.h" #include "sendf.h" #include "connect.h" #include "timeval.h" #include "socks.h" #include "warnless.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" static gss_ctx_id_t gss_context = GSS_C_NO_CONTEXT; /* * Helper gssapi error functions. */ static int check_gss_err(struct SessionHandle *data, OM_uint32 major_status, OM_uint32 minor_status, const char* function) { if(GSS_ERROR(major_status)) { OM_uint32 maj_stat,min_stat; OM_uint32 msg_ctx = 0; gss_buffer_desc status_string; char buf[1024]; size_t len; len = 0; msg_ctx = 0; while(!msg_ctx) { /* convert major status code (GSS-API error) to text */ maj_stat = gss_display_status(&min_stat, major_status, GSS_C_GSS_CODE, GSS_C_NULL_OID, &msg_ctx, &status_string); if(maj_stat == GSS_S_COMPLETE) { if(sizeof(buf) > len + status_string.length + 1) { strcpy(buf+len, (char*) status_string.value); len += status_string.length; } gss_release_buffer(&min_stat, &status_string); break; } gss_release_buffer(&min_stat, &status_string); } if(sizeof(buf) > len + 3) { strcpy(buf+len, ".\n"); len += 2; } msg_ctx = 0; while(!msg_ctx) { /* convert minor status code (underlying routine error) to text */ maj_stat = gss_display_status(&min_stat, minor_status, GSS_C_MECH_CODE, GSS_C_NULL_OID, &msg_ctx, &status_string); if(maj_stat == GSS_S_COMPLETE) { if(sizeof(buf) > len + status_string.length) strcpy(buf+len, (char*) status_string.value); gss_release_buffer(&min_stat, &status_string); break; } gss_release_buffer(&min_stat, &status_string); } failf(data, "GSSAPI error: %s failed:\n%s", function, buf); return(1); } return(0); } CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex, struct connectdata *conn) { struct SessionHandle *data = conn->data; curl_socket_t sock = conn->sock[sockindex]; CURLcode code; ssize_t actualread; ssize_t written; int result; OM_uint32 gss_major_status, gss_minor_status, gss_status; OM_uint32 gss_ret_flags; int gss_conf_state, gss_enc; gss_buffer_desc service = GSS_C_EMPTY_BUFFER; gss_buffer_desc gss_send_token = GSS_C_EMPTY_BUFFER; gss_buffer_desc gss_recv_token = GSS_C_EMPTY_BUFFER; gss_buffer_desc gss_w_token = GSS_C_EMPTY_BUFFER; gss_buffer_desc* gss_token = GSS_C_NO_BUFFER; gss_name_t server = GSS_C_NO_NAME; gss_name_t gss_client_name = GSS_C_NO_NAME; unsigned short us_length; char *user=NULL; unsigned char socksreq[4]; /* room for gssapi exchange header only */ char *serviceptr = data->set.str[STRING_SOCKS5_GSSAPI_SERVICE]; /* GSSAPI request looks like * +----+------+-----+----------------+ * |VER | MTYP | LEN | TOKEN | * +----+------+----------------------+ * | 1 | 1 | 2 | up to 2^16 - 1 | * +----+------+-----+----------------+ */ /* prepare service name */ if(strchr(serviceptr,'/')) { service.value = malloc(strlen(serviceptr)); if(!service.value) return CURLE_OUT_OF_MEMORY; service.length = strlen(serviceptr); memcpy(service.value, serviceptr, service.length); gss_major_status = gss_import_name(&gss_minor_status, &service, (gss_OID) GSS_C_NULL_OID, &server); } else { service.value = malloc(strlen(serviceptr) +strlen(conn->proxy.name)+2); if(!service.value) return CURLE_OUT_OF_MEMORY; service.length = strlen(serviceptr) +strlen(conn->proxy.name)+1; snprintf(service.value, service.length+1, "%s@%s", serviceptr, conn->proxy.name); gss_major_status = gss_import_name(&gss_minor_status, &service, gss_nt_service_name, &server); } gss_release_buffer(&gss_status, &service); /* clear allocated memory */ if(check_gss_err(data,gss_major_status, gss_minor_status,"gss_import_name()")) { failf(data, "Failed to create service name."); gss_release_name(&gss_status, &server); return CURLE_COULDNT_CONNECT; } /* As long as we need to keep sending some context info, and there's no */ /* errors, keep sending it... */ for(;;) { gss_major_status = Curl_gss_init_sec_context(data, &gss_minor_status, &gss_context, server, NULL, gss_token, &gss_send_token, &gss_ret_flags); if(gss_token != GSS_C_NO_BUFFER) gss_release_buffer(&gss_status, &gss_recv_token); if(check_gss_err(data,gss_major_status, gss_minor_status,"gss_init_sec_context")) { gss_release_name(&gss_status, &server); gss_release_buffer(&gss_status, &gss_recv_token); gss_release_buffer(&gss_status, &gss_send_token); gss_delete_sec_context(&gss_status, &gss_context, NULL); failf(data, "Failed to initial GSSAPI token."); return CURLE_COULDNT_CONNECT; } if(gss_send_token.length != 0) { socksreq[0] = 1; /* gssapi subnegotiation version */ socksreq[1] = 1; /* authentication message type */ us_length = htons((short)gss_send_token.length); memcpy(socksreq+2,&us_length,sizeof(short)); code = Curl_write_plain(conn, sock, (char *)socksreq, 4, &written); if((code != CURLE_OK) || (4 != written)) { failf(data, "Failed to send GSSAPI authentication request."); gss_release_name(&gss_status, &server); gss_release_buffer(&gss_status, &gss_recv_token); gss_release_buffer(&gss_status, &gss_send_token); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } code = Curl_write_plain(conn, sock, (char *)gss_send_token.value, gss_send_token.length, &written); if((code != CURLE_OK) || ((ssize_t)gss_send_token.length != written)) { failf(data, "Failed to send GSSAPI authentication token."); gss_release_name(&gss_status, &server); gss_release_buffer(&gss_status, &gss_recv_token); gss_release_buffer(&gss_status, &gss_send_token); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } } gss_release_buffer(&gss_status, &gss_send_token); gss_release_buffer(&gss_status, &gss_recv_token); if(gss_major_status != GSS_S_CONTINUE_NEEDED) break; /* analyse response */ /* GSSAPI response looks like * +----+------+-----+----------------+ * |VER | MTYP | LEN | TOKEN | * +----+------+----------------------+ * | 1 | 1 | 2 | up to 2^16 - 1 | * +----+------+-----+----------------+ */ result=Curl_blockread_all(conn, sock, (char *)socksreq, 4, &actualread); if(result != CURLE_OK || actualread != 4) { failf(data, "Failed to receive GSSAPI authentication response."); gss_release_name(&gss_status, &server); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } /* ignore the first (VER) byte */ if(socksreq[1] == 255) { /* status / message type */ failf(data, "User was rejected by the SOCKS5 server (%d %d).", socksreq[0], socksreq[1]); gss_release_name(&gss_status, &server); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } if(socksreq[1] != 1) { /* status / messgae type */ failf(data, "Invalid GSSAPI authentication response type (%d %d).", socksreq[0], socksreq[1]); gss_release_name(&gss_status, &server); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } memcpy(&us_length, socksreq+2, sizeof(short)); us_length = ntohs(us_length); gss_recv_token.length=us_length; gss_recv_token.value=malloc(us_length); if(!gss_recv_token.value) { failf(data, "Could not allocate memory for GSSAPI authentication " "response token."); gss_release_name(&gss_status, &server); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_OUT_OF_MEMORY; } result=Curl_blockread_all(conn, sock, (char *)gss_recv_token.value, gss_recv_token.length, &actualread); if(result != CURLE_OK || actualread != us_length) { failf(data, "Failed to receive GSSAPI authentication token."); gss_release_name(&gss_status, &server); gss_release_buffer(&gss_status, &gss_recv_token); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } gss_token = &gss_recv_token; } gss_release_name(&gss_status, &server); /* Everything is good so far, user was authenticated! */ gss_major_status = gss_inquire_context (&gss_minor_status, gss_context, &gss_client_name, NULL, NULL, NULL, NULL, NULL, NULL); if(check_gss_err(data,gss_major_status, gss_minor_status,"gss_inquire_context")) { gss_delete_sec_context(&gss_status, &gss_context, NULL); gss_release_name(&gss_status, &gss_client_name); failf(data, "Failed to determine user name."); return CURLE_COULDNT_CONNECT; } gss_major_status = gss_display_name(&gss_minor_status, gss_client_name, &gss_send_token, NULL); if(check_gss_err(data,gss_major_status, gss_minor_status,"gss_display_name")) { gss_delete_sec_context(&gss_status, &gss_context, NULL); gss_release_name(&gss_status, &gss_client_name); gss_release_buffer(&gss_status, &gss_send_token); failf(data, "Failed to determine user name."); return CURLE_COULDNT_CONNECT; } user=malloc(gss_send_token.length+1); if(!user) { gss_delete_sec_context(&gss_status, &gss_context, NULL); gss_release_name(&gss_status, &gss_client_name); gss_release_buffer(&gss_status, &gss_send_token); return CURLE_OUT_OF_MEMORY; } memcpy(user, gss_send_token.value, gss_send_token.length); user[gss_send_token.length] = '\0'; gss_release_name(&gss_status, &gss_client_name); gss_release_buffer(&gss_status, &gss_send_token); infof(data, "SOCKS5 server authencticated user %s with gssapi.\n",user); free(user); user=NULL; /* Do encryption */ socksreq[0] = 1; /* gssapi subnegotiation version */ socksreq[1] = 2; /* encryption message type */ gss_enc = 0; /* no data protection */ /* do confidentiality protection if supported */ if(gss_ret_flags & GSS_C_CONF_FLAG) gss_enc = 2; /* else do integrity protection */ else if(gss_ret_flags & GSS_C_INTEG_FLAG) gss_enc = 1; infof(data, "SOCKS5 server supports gssapi %s data protection.\n", (gss_enc==0)?"no":((gss_enc==1)?"integrity":"confidentiality")); /* force for the moment to no data protection */ gss_enc = 0; /* * Sending the encryption type in clear seems wrong. It should be * protected with gss_seal()/gss_wrap(). See RFC1961 extract below * The NEC reference implementations on which this is based is * therefore at fault * * +------+------+------+.......................+ * + ver | mtyp | len | token | * +------+------+------+.......................+ * + 0x01 | 0x02 | 0x02 | up to 2^16 - 1 octets | * +------+------+------+.......................+ * * Where: * * - "ver" is the protocol version number, here 1 to represent the * first version of the SOCKS/GSS-API protocol * * - "mtyp" is the message type, here 2 to represent a protection * -level negotiation message * * - "len" is the length of the "token" field in octets * * - "token" is the GSS-API encapsulated protection level * * The token is produced by encapsulating an octet containing the * required protection level using gss_seal()/gss_wrap() with conf_req * set to FALSE. The token is verified using gss_unseal()/ * gss_unwrap(). * */ if(data->set.socks5_gssapi_nec) { us_length = htons((short)1); memcpy(socksreq+2,&us_length,sizeof(short)); } else { gss_send_token.length = 1; gss_send_token.value = malloc(1); if(!gss_send_token.value) { gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_OUT_OF_MEMORY; } memcpy(gss_send_token.value, &gss_enc, 1); gss_major_status = gss_wrap(&gss_minor_status, gss_context, 0, GSS_C_QOP_DEFAULT, &gss_send_token, &gss_conf_state, &gss_w_token); if(check_gss_err(data,gss_major_status,gss_minor_status,"gss_wrap")) { gss_release_buffer(&gss_status, &gss_send_token); gss_release_buffer(&gss_status, &gss_w_token); gss_delete_sec_context(&gss_status, &gss_context, NULL); failf(data, "Failed to wrap GSSAPI encryption value into token."); return CURLE_COULDNT_CONNECT; } gss_release_buffer(&gss_status, &gss_send_token); us_length = htons((short)gss_w_token.length); memcpy(socksreq+2,&us_length,sizeof(short)); } code = Curl_write_plain(conn, sock, (char *)socksreq, 4, &written); if((code != CURLE_OK) || (4 != written)) { failf(data, "Failed to send GSSAPI encryption request."); gss_release_buffer(&gss_status, &gss_w_token); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } if(data->set.socks5_gssapi_nec) { memcpy(socksreq, &gss_enc, 1); code = Curl_write_plain(conn, sock, socksreq, 1, &written); if((code != CURLE_OK) || ( 1 != written)) { failf(data, "Failed to send GSSAPI encryption type."); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } } else { code = Curl_write_plain(conn, sock, (char *)gss_w_token.value, gss_w_token.length, &written); if((code != CURLE_OK) || ((ssize_t)gss_w_token.length != written)) { failf(data, "Failed to send GSSAPI encryption type."); gss_release_buffer(&gss_status, &gss_w_token); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } gss_release_buffer(&gss_status, &gss_w_token); } result=Curl_blockread_all(conn, sock, (char *)socksreq, 4, &actualread); if(result != CURLE_OK || actualread != 4) { failf(data, "Failed to receive GSSAPI encryption response."); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } /* ignore the first (VER) byte */ if(socksreq[1] == 255) { /* status / message type */ failf(data, "User was rejected by the SOCKS5 server (%d %d).", socksreq[0], socksreq[1]); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } if(socksreq[1] != 2) { /* status / messgae type */ failf(data, "Invalid GSSAPI encryption response type (%d %d).", socksreq[0], socksreq[1]); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } memcpy(&us_length, socksreq+2, sizeof(short)); us_length = ntohs(us_length); gss_recv_token.length= us_length; gss_recv_token.value=malloc(gss_recv_token.length); if(!gss_recv_token.value) { gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_OUT_OF_MEMORY; } result=Curl_blockread_all(conn, sock, (char *)gss_recv_token.value, gss_recv_token.length, &actualread); if(result != CURLE_OK || actualread != us_length) { failf(data, "Failed to receive GSSAPI encryptrion type."); gss_release_buffer(&gss_status, &gss_recv_token); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } if(!data->set.socks5_gssapi_nec) { gss_major_status = gss_unwrap(&gss_minor_status, gss_context, &gss_recv_token, &gss_w_token, 0, GSS_C_QOP_DEFAULT); if(check_gss_err(data,gss_major_status,gss_minor_status,"gss_unwrap")) { gss_release_buffer(&gss_status, &gss_recv_token); gss_release_buffer(&gss_status, &gss_w_token); gss_delete_sec_context(&gss_status, &gss_context, NULL); failf(data, "Failed to unwrap GSSAPI encryption value into token."); return CURLE_COULDNT_CONNECT; } gss_release_buffer(&gss_status, &gss_recv_token); if(gss_w_token.length != 1) { failf(data, "Invalid GSSAPI encryption response length (%d).", gss_w_token.length); gss_release_buffer(&gss_status, &gss_w_token); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } memcpy(socksreq,gss_w_token.value,gss_w_token.length); gss_release_buffer(&gss_status, &gss_w_token); } else { if(gss_recv_token.length != 1) { failf(data, "Invalid GSSAPI encryption response length (%d).", gss_recv_token.length); gss_release_buffer(&gss_status, &gss_recv_token); gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_COULDNT_CONNECT; } memcpy(socksreq,gss_recv_token.value,gss_recv_token.length); gss_release_buffer(&gss_status, &gss_recv_token); } infof(data, "SOCKS5 access with%s protection granted.\n", (socksreq[0]==0)?"out gssapi data": ((socksreq[0]==1)?" gssapi integrity":" gssapi confidentiality")); conn->socks5_gssapi_enctype = socksreq[0]; if(socksreq[0] == 0) gss_delete_sec_context(&gss_status, &gss_context, NULL); return CURLE_OK; } #endif #endif /* CURL_DISABLE_PROXY */ curl-7.35.0/lib/README.multi_socket0000644000175000017500000000551212213173003013616 00000000000000Implementation 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_action() 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. 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() and the CURLMOPT_TIMERFUNCTION option. To get this to work, Internally, there's an 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 both how long time there is until the next nearest timer expires and which timer (handle) we should 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 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 are available in c-ares 1.3.1 and later. We have done a test runs with up to 9000 connections (with a single active one). The curl_multi_socket_action() 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). Documentation http://curl.haxx.se/libcurl/c/curl_multi_socket_action.html http://curl.haxx.se/libcurl/c/curl_multi_timeout.html http://curl.haxx.se/libcurl/c/curl_multi_setopt.html curl-7.35.0/lib/Makefile.am0000644000175000017500000001304612262353672012312 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # ########################################################################### AUTOMAKE_OPTIONS = foreign nostdinc DOCS = README.encoding README.memoryleak README.ares README.curlx \ README.hostip README.multi_socket README.httpauth README.pipelining \ README.curl_off_t README.pingpong CMAKE_DIST = CMakeLists.txt curl_config.h.cmake EXTRA_DIST = Makefile.b32 Makefile.m32 Makefile.vc6 config-win32.h \ config-win32ce.h config-riscos.h config-mac.h curl_config.h.in \ makefile.dj config-dos.h libcurl.plist libcurl.rc config-amigaos.h \ makefile.amiga Makefile.netware nwlib.c nwos.c config-win32ce.h \ config-os400.h setup-os400.h config-symbian.h Makefile.Watcom \ config-tpf.h $(DOCS) mk-ca-bundle.pl mk-ca-bundle.vbs $(CMAKE_DIST) \ firefox-db2pem.sh config-vxworks.h Makefile.vxworks checksrc.pl \ objnames-test08.sh objnames-test10.sh objnames.inc lib_LTLIBRARIES = libcurl.la if BUILD_UNITTESTS noinst_LTLIBRARIES = libcurlu.la else noinst_LTLIBRARIES = endif # This might hold -Werror CFLAGS += @CURL_CFLAG_EXTRAS@ # Specify our include paths here, and do it relative to $(top_srcdir) and # $(top_builddir), to ensure that these paths which belong to the library # being currently built and tested are searched before the library which # might possibly already be installed in the system. # # $(top_builddir)/include/curl for generated curlbuild.h included from curl.h # $(top_builddir)/include for generated curlbuild.h inc. from lib/curl_setup.h # $(top_srcdir)/include is for libcurl's external include files # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "private" files # $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file # $(top_srcdir)/ares is for in-tree c-ares's external include files AM_CPPFLAGS = -I$(top_builddir)/include/curl \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib if USE_EMBEDDED_ARES AM_CPPFLAGS += -I$(top_builddir)/ares \ -I$(top_srcdir)/ares endif # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) if SONAME_BUMP # # Bumping of SONAME conditionally may seem like a weird thing to do, and yeah # it is. The problem is that we try to avoid the bump as hard as possible, but # yet it is still necessary for a few rare situations. The configure script will # attempt to figure out these situations, and it can be forced to consider this # to be such a case! See README.curl_off_t for further details. # # This conditional soname bump SHOULD be removed at next "proper" bump. # VERSIONINFO=-version-info 8:0:3 else VERSIONINFO=-version-info 7:0:3 endif # 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. # # Here's the simplified rule guide on how to change -version-info: # (current version is C:R:A) # # 1. if there are only source changes, use C:R+1:A # 2. if interfaces were added use C+1:0:A+1 # 3. if interfaces were removed, then use C+1:0:0 # # For the full guide on libcurl ABI rules, see docs/libcurl/ABI AM_CPPFLAGS += -DBUILDING_LIBCURL AM_LDFLAGS = AM_CFLAGS = libcurl_la_CPPFLAGS_EXTRA = libcurl_la_LDFLAGS_EXTRA = libcurl_la_CFLAGS_EXTRA = if CURL_LT_SHLIB_USE_VERSION_INFO libcurl_la_LDFLAGS_EXTRA += $(VERSIONINFO) endif if CURL_LT_SHLIB_USE_NO_UNDEFINED libcurl_la_LDFLAGS_EXTRA += -no-undefined endif if CURL_LT_SHLIB_USE_MIMPURE_TEXT libcurl_la_LDFLAGS_EXTRA += -mimpure-text endif if CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS libcurl_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers endif if USE_CPPFLAG_CURL_STATICLIB libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB endif if DOING_CURL_SYMBOL_HIDING libcurl_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS libcurl_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING) endif libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_la_CPPFLAGS_EXTRA) libcurl_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS) libcurl_la_CFLAGS = $(AM_CFLAGS) $(libcurl_la_CFLAGS_EXTRA) libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_LIBS) libcurlu_la_CFLAGS = $(AM_CFLAGS) # Makefile.inc provides the CSOURCES and HHEADERS defines include Makefile.inc libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS) libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS) checksrc: @@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(top_srcdir)/lib $(CSOURCES) $(HHEADERS) if CURLDEBUG # for debug builds, we scan the sources on all regular make invokes all-local: checksrc endif curl-7.35.0/lib/ftplistparser.c0000644000175000017500000007723112270035364013324 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ /** * Now implemented: * * 1) UNIX version 1 * drwxr-xr-x 1 user01 ftp 512 Jan 29 23:32 prog * 2) UNIX version 2 * drwxr-xr-x 1 user01 ftp 512 Jan 29 1997 prog * 3) UNIX version 3 * drwxr-xr-x 1 1 1 512 Jan 29 23:32 prog * 4) UNIX symlink * lrwxr-xr-x 1 user01 ftp 512 Jan 29 23:32 prog -> prog2000 * 5) DOS style * 01-29-97 11:32PM

prog */ #include "curl_setup.h" #ifndef CURL_DISABLE_FTP #include #include "urldata.h" #include "fileinfo.h" #include "llist.h" #include "strtoofft.h" #include "rawstr.h" #include "ftp.h" #include "ftplistparser.h" #include "curl_fnmatch.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* allocs buffer which will contain one line of LIST command response */ #define FTP_BUFFER_ALLOCSIZE 160 typedef enum { PL_UNIX_TOTALSIZE = 0, PL_UNIX_FILETYPE, PL_UNIX_PERMISSION, PL_UNIX_HLINKS, PL_UNIX_USER, PL_UNIX_GROUP, PL_UNIX_SIZE, PL_UNIX_TIME, PL_UNIX_FILENAME, PL_UNIX_SYMLINK } pl_unix_mainstate; typedef union { enum { PL_UNIX_TOTALSIZE_INIT = 0, PL_UNIX_TOTALSIZE_READING } total_dirsize; enum { PL_UNIX_HLINKS_PRESPACE = 0, PL_UNIX_HLINKS_NUMBER } hlinks; enum { PL_UNIX_USER_PRESPACE = 0, PL_UNIX_USER_PARSING } user; enum { PL_UNIX_GROUP_PRESPACE = 0, PL_UNIX_GROUP_NAME } group; enum { PL_UNIX_SIZE_PRESPACE = 0, PL_UNIX_SIZE_NUMBER } size; enum { PL_UNIX_TIME_PREPART1 = 0, PL_UNIX_TIME_PART1, PL_UNIX_TIME_PREPART2, PL_UNIX_TIME_PART2, PL_UNIX_TIME_PREPART3, PL_UNIX_TIME_PART3 } time; enum { PL_UNIX_FILENAME_PRESPACE = 0, PL_UNIX_FILENAME_NAME, PL_UNIX_FILENAME_WINDOWSEOL } filename; enum { PL_UNIX_SYMLINK_PRESPACE = 0, PL_UNIX_SYMLINK_NAME, PL_UNIX_SYMLINK_PRETARGET1, PL_UNIX_SYMLINK_PRETARGET2, PL_UNIX_SYMLINK_PRETARGET3, PL_UNIX_SYMLINK_PRETARGET4, PL_UNIX_SYMLINK_TARGET, PL_UNIX_SYMLINK_WINDOWSEOL } symlink; } pl_unix_substate; typedef enum { PL_WINNT_DATE = 0, PL_WINNT_TIME, PL_WINNT_DIRORSIZE, PL_WINNT_FILENAME } pl_winNT_mainstate; typedef union { enum { PL_WINNT_TIME_PRESPACE = 0, PL_WINNT_TIME_TIME } time; enum { PL_WINNT_DIRORSIZE_PRESPACE = 0, PL_WINNT_DIRORSIZE_CONTENT } dirorsize; enum { PL_WINNT_FILENAME_PRESPACE = 0, PL_WINNT_FILENAME_CONTENT, PL_WINNT_FILENAME_WINEOL } filename; } pl_winNT_substate; /* This struct is used in wildcard downloading - for parsing LIST response */ struct ftp_parselist_data { enum { OS_TYPE_UNKNOWN = 0, OS_TYPE_UNIX, OS_TYPE_WIN_NT } os_type; union { struct { pl_unix_mainstate main; pl_unix_substate sub; } UNIX; struct { pl_winNT_mainstate main; pl_winNT_substate sub; } NT; } state; CURLcode error; struct curl_fileinfo *file_data; unsigned int item_length; size_t item_offset; struct { size_t filename; size_t user; size_t group; size_t time; size_t perm; size_t symlink_target; } offsets; }; struct ftp_parselist_data *Curl_ftp_parselist_data_alloc(void) { return calloc(1, sizeof(struct ftp_parselist_data)); } void Curl_ftp_parselist_data_free(struct ftp_parselist_data **pl_data) { if(*pl_data) free(*pl_data); *pl_data = NULL; } CURLcode Curl_ftp_parselist_geterror(struct ftp_parselist_data *pl_data) { return pl_data->error; } #define FTP_LP_MALFORMATED_PERM 0x01000000 static int ftp_pl_get_permission(const char *str) { int permissions = 0; /* USER */ if(str[0] == 'r') permissions |= 1 << 8; else if(str[0] != '-') permissions |= FTP_LP_MALFORMATED_PERM; if(str[1] == 'w') permissions |= 1 << 7; else if(str[1] != '-') permissions |= FTP_LP_MALFORMATED_PERM; if(str[2] == 'x') permissions |= 1 << 6; else if(str[2] == 's') { permissions |= 1 << 6; permissions |= 1 << 11; } else if(str[2] == 'S') permissions |= 1 << 11; else if(str[2] != '-') permissions |= FTP_LP_MALFORMATED_PERM; /* GROUP */ if(str[3] == 'r') permissions |= 1 << 5; else if(str[3] != '-') permissions |= FTP_LP_MALFORMATED_PERM; if(str[4] == 'w') permissions |= 1 << 4; else if(str[4] != '-') permissions |= FTP_LP_MALFORMATED_PERM; if(str[5] == 'x') permissions |= 1 << 3; else if(str[5] == 's') { permissions |= 1 << 3; permissions |= 1 << 10; } else if(str[5] == 'S') permissions |= 1 << 10; else if(str[5] != '-') permissions |= FTP_LP_MALFORMATED_PERM; /* others */ if(str[6] == 'r') permissions |= 1 << 2; else if(str[6] != '-') permissions |= FTP_LP_MALFORMATED_PERM; if(str[7] == 'w') permissions |= 1 << 1; else if(str[7] != '-') permissions |= FTP_LP_MALFORMATED_PERM; if(str[8] == 'x') permissions |= 1; else if(str[8] == 't') { permissions |= 1; permissions |= 1 << 9; } else if(str[8] == 'T') permissions |= 1 << 9; else if(str[8] != '-') permissions |= FTP_LP_MALFORMATED_PERM; return permissions; } static void PL_ERROR(struct connectdata *conn, CURLcode err) { struct ftp_wc_tmpdata *tmpdata = conn->data->wildcard.tmp; struct ftp_parselist_data *parser = tmpdata->parser; if(parser->file_data) Curl_fileinfo_dtor(NULL, parser->file_data); parser->file_data = NULL; parser->error = err; } static bool ftp_pl_gettime(struct ftp_parselist_data *parser, char *string) { (void)parser; (void)string; /* TODO * There could be possible parse timestamp from server. Leaving unimplemented * for now. * If you want implement this, please add CURLFINFOFLAG_KNOWN_TIME flag to * parser->file_data->flags * * Ftp servers are giving usually these formats: * Apr 11 1998 (unknown time.. set it to 00:00:00?) * Apr 11 12:21 (unknown year -> set it to NOW() time?) * 08-05-09 02:49PM (ms-dos format) * 20100421092538 -> for MLST/MLSD response */ return FALSE; } static CURLcode ftp_pl_insert_finfo(struct connectdata *conn, struct curl_fileinfo *finfo) { curl_fnmatch_callback compare; struct WildcardData *wc = &conn->data->wildcard; struct ftp_wc_tmpdata *tmpdata = wc->tmp; struct curl_llist *llist = wc->filelist; struct ftp_parselist_data *parser = tmpdata->parser; bool add = TRUE; /* move finfo pointers to b_data */ char *str = finfo->b_data; finfo->filename = str + parser->offsets.filename; finfo->strings.group = parser->offsets.group ? str + parser->offsets.group : NULL; finfo->strings.perm = parser->offsets.perm ? str + parser->offsets.perm : NULL; finfo->strings.target = parser->offsets.symlink_target ? str + parser->offsets.symlink_target : NULL; finfo->strings.time = str + parser->offsets.time; finfo->strings.user = parser->offsets.user ? str + parser->offsets.user : NULL; /* get correct fnmatch callback */ compare = conn->data->set.fnmatch; if(!compare) compare = Curl_fnmatch; /* filter pattern-corresponding filenames */ if(compare(conn->data->set.fnmatch_data, wc->pattern, finfo->filename) == 0) { /* discard symlink which is containing multiple " -> " */ if((finfo->filetype == CURLFILETYPE_SYMLINK) && finfo->strings.target && (strstr(finfo->strings.target, " -> "))) { add = FALSE; } } else { add = FALSE; } if(add) { if(!Curl_llist_insert_next(llist, llist->tail, finfo)) { Curl_fileinfo_dtor(NULL, finfo); tmpdata->parser->file_data = NULL; return CURLE_OUT_OF_MEMORY; } } else { Curl_fileinfo_dtor(NULL, finfo); } tmpdata->parser->file_data = NULL; return CURLE_OK; } size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr) { size_t bufflen = size*nmemb; struct connectdata *conn = (struct connectdata *)connptr; struct ftp_wc_tmpdata *tmpdata = conn->data->wildcard.tmp; struct ftp_parselist_data *parser = tmpdata->parser; struct curl_fileinfo *finfo; unsigned long i = 0; CURLcode rc; if(parser->error) { /* error in previous call */ /* scenario: * 1. call => OK.. * 2. call => OUT_OF_MEMORY (or other error) * 3. (last) call => is skipped RIGHT HERE and the error is hadled later * in wc_statemach() */ return bufflen; } if(parser->os_type == OS_TYPE_UNKNOWN && bufflen > 0) { /* considering info about FILE response format */ parser->os_type = (buffer[0] >= '0' && buffer[0] <= '9') ? OS_TYPE_WIN_NT : OS_TYPE_UNIX; } while(i < bufflen) { /* FSM */ char c = buffer[i]; if(!parser->file_data) { /* tmp file data is not allocated yet */ parser->file_data = Curl_fileinfo_alloc(); if(!parser->file_data) { parser->error = CURLE_OUT_OF_MEMORY; return bufflen; } parser->file_data->b_data = malloc(FTP_BUFFER_ALLOCSIZE); if(!parser->file_data->b_data) { PL_ERROR(conn, CURLE_OUT_OF_MEMORY); return bufflen; } parser->file_data->b_size = FTP_BUFFER_ALLOCSIZE; parser->item_offset = 0; parser->item_length = 0; } finfo = parser->file_data; finfo->b_data[finfo->b_used++] = c; if(finfo->b_used >= finfo->b_size - 1) { /* if it is important, extend buffer space for file data */ char *tmp = realloc(finfo->b_data, finfo->b_size + FTP_BUFFER_ALLOCSIZE); if(tmp) { finfo->b_size += FTP_BUFFER_ALLOCSIZE; finfo->b_data = tmp; } else { Curl_fileinfo_dtor(NULL, parser->file_data); parser->file_data = NULL; parser->error = CURLE_OUT_OF_MEMORY; PL_ERROR(conn, CURLE_OUT_OF_MEMORY); return bufflen; } } switch (parser->os_type) { case OS_TYPE_UNIX: switch (parser->state.UNIX.main) { case PL_UNIX_TOTALSIZE: switch(parser->state.UNIX.sub.total_dirsize) { case PL_UNIX_TOTALSIZE_INIT: if(c == 't') { parser->state.UNIX.sub.total_dirsize = PL_UNIX_TOTALSIZE_READING; parser->item_length++; } else { parser->state.UNIX.main = PL_UNIX_FILETYPE; /* start FSM again not considering size of directory */ finfo->b_used = 0; i--; } break; case PL_UNIX_TOTALSIZE_READING: parser->item_length++; if(c == '\r') { parser->item_length--; finfo->b_used--; } else if(c == '\n') { finfo->b_data[parser->item_length - 1] = 0; if(strncmp("total ", finfo->b_data, 6) == 0) { char *endptr = finfo->b_data+6; /* here we can deal with directory size, pass the leading white spaces and then the digits */ while(ISSPACE(*endptr)) endptr++; while(ISDIGIT(*endptr)) endptr++; if(*endptr != 0) { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } else { parser->state.UNIX.main = PL_UNIX_FILETYPE; finfo->b_used = 0; } } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } } break; } break; case PL_UNIX_FILETYPE: switch (c) { case '-': finfo->filetype = CURLFILETYPE_FILE; break; case 'd': finfo->filetype = CURLFILETYPE_DIRECTORY; break; case 'l': finfo->filetype = CURLFILETYPE_SYMLINK; break; case 'p': finfo->filetype = CURLFILETYPE_NAMEDPIPE; break; case 's': finfo->filetype = CURLFILETYPE_SOCKET; break; case 'c': finfo->filetype = CURLFILETYPE_DEVICE_CHAR; break; case 'b': finfo->filetype = CURLFILETYPE_DEVICE_BLOCK; break; case 'D': finfo->filetype = CURLFILETYPE_DOOR; break; default: PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } parser->state.UNIX.main = PL_UNIX_PERMISSION; parser->item_length = 0; parser->item_offset = 1; break; case PL_UNIX_PERMISSION: parser->item_length++; if(parser->item_length <= 9) { if(!strchr("rwx-tTsS", c)) { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } } else if(parser->item_length == 10) { unsigned int perm; if(c != ' ') { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } finfo->b_data[10] = 0; /* terminate permissions */ perm = ftp_pl_get_permission(finfo->b_data + parser->item_offset); if(perm & FTP_LP_MALFORMATED_PERM) { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } parser->file_data->flags |= CURLFINFOFLAG_KNOWN_PERM; parser->file_data->perm = perm; parser->offsets.perm = parser->item_offset; parser->item_length = 0; parser->state.UNIX.main = PL_UNIX_HLINKS; parser->state.UNIX.sub.hlinks = PL_UNIX_HLINKS_PRESPACE; } break; case PL_UNIX_HLINKS: switch(parser->state.UNIX.sub.hlinks) { case PL_UNIX_HLINKS_PRESPACE: if(c != ' ') { if(c >= '0' && c <= '9') { parser->item_offset = finfo->b_used - 1; parser->item_length = 1; parser->state.UNIX.sub.hlinks = PL_UNIX_HLINKS_NUMBER; } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } } break; case PL_UNIX_HLINKS_NUMBER: parser->item_length ++; if(c == ' ') { char *p; long int hlinks; finfo->b_data[parser->item_offset + parser->item_length - 1] = 0; hlinks = strtol(finfo->b_data + parser->item_offset, &p, 10); if(p[0] == '\0' && hlinks != LONG_MAX && hlinks != LONG_MIN) { parser->file_data->flags |= CURLFINFOFLAG_KNOWN_HLINKCOUNT; parser->file_data->hardlinks = hlinks; } parser->item_length = 0; parser->item_offset = 0; parser->state.UNIX.main = PL_UNIX_USER; parser->state.UNIX.sub.user = PL_UNIX_USER_PRESPACE; } else if(c < '0' || c > '9') { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } break; } break; case PL_UNIX_USER: switch(parser->state.UNIX.sub.user) { case PL_UNIX_USER_PRESPACE: if(c != ' ') { parser->item_offset = finfo->b_used - 1; parser->item_length = 1; parser->state.UNIX.sub.user = PL_UNIX_USER_PARSING; } break; case PL_UNIX_USER_PARSING: parser->item_length++; if(c == ' ') { finfo->b_data[parser->item_offset + parser->item_length - 1] = 0; parser->offsets.user = parser->item_offset; parser->state.UNIX.main = PL_UNIX_GROUP; parser->state.UNIX.sub.group = PL_UNIX_GROUP_PRESPACE; parser->item_offset = 0; parser->item_length = 0; } break; } break; case PL_UNIX_GROUP: switch(parser->state.UNIX.sub.group) { case PL_UNIX_GROUP_PRESPACE: if(c != ' ') { parser->item_offset = finfo->b_used - 1; parser->item_length = 1; parser->state.UNIX.sub.group = PL_UNIX_GROUP_NAME; } break; case PL_UNIX_GROUP_NAME: parser->item_length++; if(c == ' ') { finfo->b_data[parser->item_offset + parser->item_length - 1] = 0; parser->offsets.group = parser->item_offset; parser->state.UNIX.main = PL_UNIX_SIZE; parser->state.UNIX.sub.size = PL_UNIX_SIZE_PRESPACE; parser->item_offset = 0; parser->item_length = 0; } break; } break; case PL_UNIX_SIZE: switch(parser->state.UNIX.sub.size) { case PL_UNIX_SIZE_PRESPACE: if(c != ' ') { if(c >= '0' && c <= '9') { parser->item_offset = finfo->b_used - 1; parser->item_length = 1; parser->state.UNIX.sub.size = PL_UNIX_SIZE_NUMBER; } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } } break; case PL_UNIX_SIZE_NUMBER: parser->item_length++; if(c == ' ') { char *p; curl_off_t fsize; finfo->b_data[parser->item_offset + parser->item_length - 1] = 0; fsize = curlx_strtoofft(finfo->b_data+parser->item_offset, &p, 10); if(p[0] == '\0' && fsize != CURL_OFF_T_MAX && fsize != CURL_OFF_T_MIN) { parser->file_data->flags |= CURLFINFOFLAG_KNOWN_SIZE; parser->file_data->size = fsize; } parser->item_length = 0; parser->item_offset = 0; parser->state.UNIX.main = PL_UNIX_TIME; parser->state.UNIX.sub.time = PL_UNIX_TIME_PREPART1; } else if(!ISDIGIT(c)) { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } break; } break; case PL_UNIX_TIME: switch(parser->state.UNIX.sub.time) { case PL_UNIX_TIME_PREPART1: if(c != ' ') { if(ISALNUM(c)) { parser->item_offset = finfo->b_used -1; parser->item_length = 1; parser->state.UNIX.sub.time = PL_UNIX_TIME_PART1; } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } } break; case PL_UNIX_TIME_PART1: parser->item_length++; if(c == ' ') { parser->state.UNIX.sub.time = PL_UNIX_TIME_PREPART2; } else if(!ISALNUM(c) && c != '.') { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } break; case PL_UNIX_TIME_PREPART2: parser->item_length++; if(c != ' ') { if(ISALNUM(c)) { parser->state.UNIX.sub.time = PL_UNIX_TIME_PART2; } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } } break; case PL_UNIX_TIME_PART2: parser->item_length++; if(c == ' ') { parser->state.UNIX.sub.time = PL_UNIX_TIME_PREPART3; } else if(!ISALNUM(c) && c != '.') { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } break; case PL_UNIX_TIME_PREPART3: parser->item_length++; if(c != ' ') { if(ISALNUM(c)) { parser->state.UNIX.sub.time = PL_UNIX_TIME_PART3; } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } } break; case PL_UNIX_TIME_PART3: parser->item_length++; if(c == ' ') { finfo->b_data[parser->item_offset + parser->item_length -1] = 0; parser->offsets.time = parser->item_offset; if(ftp_pl_gettime(parser, finfo->b_data + parser->item_offset)) { parser->file_data->flags |= CURLFINFOFLAG_KNOWN_TIME; } if(finfo->filetype == CURLFILETYPE_SYMLINK) { parser->state.UNIX.main = PL_UNIX_SYMLINK; parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_PRESPACE; } else { parser->state.UNIX.main = PL_UNIX_FILENAME; parser->state.UNIX.sub.filename = PL_UNIX_FILENAME_PRESPACE; } } else if(!ISALNUM(c) && c != '.' && c != ':') { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } break; } break; case PL_UNIX_FILENAME: switch(parser->state.UNIX.sub.filename) { case PL_UNIX_FILENAME_PRESPACE: if(c != ' ') { parser->item_offset = finfo->b_used - 1; parser->item_length = 1; parser->state.UNIX.sub.filename = PL_UNIX_FILENAME_NAME; } break; case PL_UNIX_FILENAME_NAME: parser->item_length++; if(c == '\r') { parser->item_length--; parser->state.UNIX.sub.filename = PL_UNIX_FILENAME_WINDOWSEOL; } else if(c == '\n') { finfo->b_data[parser->item_offset + parser->item_length - 1] = 0; parser->offsets.filename = parser->item_offset; parser->state.UNIX.main = PL_UNIX_FILETYPE; rc = ftp_pl_insert_finfo(conn, finfo); if(rc) { PL_ERROR(conn, rc); return bufflen; } } break; case PL_UNIX_FILENAME_WINDOWSEOL: if(c == '\n') { finfo->b_data[parser->item_offset + parser->item_length] = 0; parser->offsets.filename = parser->item_offset; parser->state.UNIX.main = PL_UNIX_FILETYPE; rc = ftp_pl_insert_finfo(conn, finfo); if(rc) { PL_ERROR(conn, rc); return bufflen; } } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } break; } break; case PL_UNIX_SYMLINK: switch(parser->state.UNIX.sub.symlink) { case PL_UNIX_SYMLINK_PRESPACE: if(c != ' ') { parser->item_offset = finfo->b_used - 1; parser->item_length = 1; parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_NAME; } break; case PL_UNIX_SYMLINK_NAME: parser->item_length++; if(c == ' ') { parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_PRETARGET1; } else if(c == '\r' || c == '\n') { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } break; case PL_UNIX_SYMLINK_PRETARGET1: parser->item_length++; if(c == '-') { parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_PRETARGET2; } else if(c == '\r' || c == '\n') { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } else { parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_NAME; } break; case PL_UNIX_SYMLINK_PRETARGET2: parser->item_length++; if(c == '>') { parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_PRETARGET3; } else if(c == '\r' || c == '\n') { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } else { parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_NAME; } break; case PL_UNIX_SYMLINK_PRETARGET3: parser->item_length++; if(c == ' ') { parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_PRETARGET4; /* now place where is symlink following */ finfo->b_data[parser->item_offset + parser->item_length - 4] = 0; parser->offsets.filename = parser->item_offset; parser->item_length = 0; parser->item_offset = 0; } else if(c == '\r' || c == '\n') { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } else { parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_NAME; } break; case PL_UNIX_SYMLINK_PRETARGET4: if(c != '\r' && c != '\n') { parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_TARGET; parser->item_offset = finfo->b_used - 1; parser->item_length = 1; } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } break; case PL_UNIX_SYMLINK_TARGET: parser->item_length ++; if(c == '\r') { parser->item_length --; parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_WINDOWSEOL; } else if(c == '\n') { finfo->b_data[parser->item_offset + parser->item_length - 1] = 0; parser->offsets.symlink_target = parser->item_offset; rc = ftp_pl_insert_finfo(conn, finfo); if(rc) { PL_ERROR(conn, rc); return bufflen; } parser->state.UNIX.main = PL_UNIX_FILETYPE; } break; case PL_UNIX_SYMLINK_WINDOWSEOL: if(c == '\n') { finfo->b_data[parser->item_offset + parser->item_length - 1] = 0; parser->offsets.symlink_target = parser->item_offset; rc = ftp_pl_insert_finfo(conn, finfo); if(rc) { PL_ERROR(conn, rc); return bufflen; } parser->state.UNIX.main = PL_UNIX_FILETYPE; } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } break; } break; } break; case OS_TYPE_WIN_NT: switch(parser->state.NT.main) { case PL_WINNT_DATE: parser->item_length++; if(parser->item_length < 9) { if(!strchr("0123456789-", c)) { /* only simple control */ PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } } else if(parser->item_length == 9) { if(c == ' ') { parser->state.NT.main = PL_WINNT_TIME; parser->state.NT.sub.time = PL_WINNT_TIME_PRESPACE; } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } break; case PL_WINNT_TIME: parser->item_length++; switch(parser->state.NT.sub.time) { case PL_WINNT_TIME_PRESPACE: if(!ISSPACE(c)) { parser->state.NT.sub.time = PL_WINNT_TIME_TIME; } break; case PL_WINNT_TIME_TIME: if(c == ' ') { parser->offsets.time = parser->item_offset; finfo->b_data[parser->item_offset + parser->item_length -1] = 0; parser->state.NT.main = PL_WINNT_DIRORSIZE; parser->state.NT.sub.dirorsize = PL_WINNT_DIRORSIZE_PRESPACE; parser->item_length = 0; } else if(!strchr("APM0123456789:", c)) { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } break; } break; case PL_WINNT_DIRORSIZE: switch(parser->state.NT.sub.dirorsize) { case PL_WINNT_DIRORSIZE_PRESPACE: if(c == ' ') { } else { parser->item_offset = finfo->b_used - 1; parser->item_length = 1; parser->state.NT.sub.dirorsize = PL_WINNT_DIRORSIZE_CONTENT; } break; case PL_WINNT_DIRORSIZE_CONTENT: parser->item_length ++; if(c == ' ') { finfo->b_data[parser->item_offset + parser->item_length - 1] = 0; if(strcmp("", finfo->b_data + parser->item_offset) == 0) { finfo->filetype = CURLFILETYPE_DIRECTORY; finfo->size = 0; } else { char *endptr; finfo->size = curlx_strtoofft(finfo->b_data + parser->item_offset, &endptr, 10); if(!*endptr) { if(finfo->size == CURL_OFF_T_MAX || finfo->size == CURL_OFF_T_MIN) { if(errno == ERANGE) { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } } } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } /* correct file type */ parser->file_data->filetype = CURLFILETYPE_FILE; } parser->file_data->flags |= CURLFINFOFLAG_KNOWN_SIZE; parser->item_length = 0; parser->state.NT.main = PL_WINNT_FILENAME; parser->state.NT.sub.filename = PL_WINNT_FILENAME_PRESPACE; } break; } break; case PL_WINNT_FILENAME: switch (parser->state.NT.sub.filename) { case PL_WINNT_FILENAME_PRESPACE: if(c != ' ') { parser->item_offset = finfo->b_used -1; parser->item_length = 1; parser->state.NT.sub.filename = PL_WINNT_FILENAME_CONTENT; } break; case PL_WINNT_FILENAME_CONTENT: parser->item_length++; if(c == '\r') { parser->state.NT.sub.filename = PL_WINNT_FILENAME_WINEOL; finfo->b_data[finfo->b_used - 1] = 0; } else if(c == '\n') { parser->offsets.filename = parser->item_offset; finfo->b_data[finfo->b_used - 1] = 0; parser->offsets.filename = parser->item_offset; rc = ftp_pl_insert_finfo(conn, finfo); if(rc) { PL_ERROR(conn, rc); return bufflen; } parser->state.NT.main = PL_WINNT_DATE; parser->state.NT.sub.filename = PL_WINNT_FILENAME_PRESPACE; } break; case PL_WINNT_FILENAME_WINEOL: if(c == '\n') { parser->offsets.filename = parser->item_offset; rc = ftp_pl_insert_finfo(conn, finfo); if(rc) { PL_ERROR(conn, rc); return bufflen; } parser->state.NT.main = PL_WINNT_DATE; parser->state.NT.sub.filename = PL_WINNT_FILENAME_PRESPACE; } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } break; } break; } break; default: return bufflen+1; } i++; } return bufflen; } #endif /* CURL_DISABLE_FTP */ curl-7.35.0/lib/Makefile.in0000644000175000017500000111352212272122666012322 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # ########################################################################### VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @USE_EMBEDDED_ARES_TRUE@am__append_1 = -I$(top_builddir)/ares \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/ares @CURL_LT_SHLIB_USE_VERSION_INFO_TRUE@am__append_2 = $(VERSIONINFO) @CURL_LT_SHLIB_USE_NO_UNDEFINED_TRUE@am__append_3 = -no-undefined @CURL_LT_SHLIB_USE_MIMPURE_TEXT_TRUE@am__append_4 = -mimpure-text @CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_TRUE@am__append_5 = -Wl,--version-script=libcurl.vers @USE_CPPFLAG_CURL_STATICLIB_TRUE@am__append_6 = -DCURL_STATICLIB @DOING_CURL_SYMBOL_HIDING_TRUE@am__append_7 = -DCURL_HIDDEN_SYMBOLS @DOING_CURL_SYMBOL_HIDING_TRUE@am__append_8 = $(CFLAG_CURL_SYMBOL_HIDING) DIST_COMMON = $(srcdir)/Makefile.inc $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/curl_config.h.in \ $(top_srcdir)/mkinstalldirs $(srcdir)/libcurl.vers.in \ $(top_srcdir)/depcomp subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \ $(top_srcdir)/m4/curl-confopts.m4 \ $(top_srcdir)/m4/curl-functions.m4 \ $(top_srcdir)/m4/curl-openssl.m4 \ $(top_srcdir)/m4/curl-override.m4 \ $(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/xc-am-iface.m4 \ $(top_srcdir)/m4/xc-cc-check.m4 \ $(top_srcdir)/m4/xc-lt-iface.m4 \ $(top_srcdir)/m4/xc-translit.m4 \ $(top_srcdir)/m4/xc-val-flgs.m4 \ $(top_srcdir)/m4/zz40-xc-ovr.m4 \ $(top_srcdir)/m4/zz50-xc-ovr.m4 \ $(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = curl_config.h $(top_builddir)/include/curl/curlbuild.h CONFIG_CLEAN_FILES = libcurl.vers CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) libcurl_la_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am__objects_1 = vtls/libcurl_la-openssl.lo vtls/libcurl_la-gtls.lo \ vtls/libcurl_la-vtls.lo vtls/libcurl_la-nss.lo \ vtls/libcurl_la-qssl.lo vtls/libcurl_la-polarssl.lo \ vtls/libcurl_la-polarssl_threadlock.lo \ vtls/libcurl_la-axtls.lo vtls/libcurl_la-cyassl.lo \ vtls/libcurl_la-curl_schannel.lo \ vtls/libcurl_la-curl_darwinssl.lo vtls/libcurl_la-gskit.lo am__objects_2 = libcurl_la-file.lo libcurl_la-timeval.lo \ libcurl_la-base64.lo libcurl_la-hostip.lo \ libcurl_la-progress.lo libcurl_la-formdata.lo \ libcurl_la-cookie.lo libcurl_la-http.lo libcurl_la-sendf.lo \ libcurl_la-ftp.lo libcurl_la-url.lo libcurl_la-dict.lo \ libcurl_la-if2ip.lo libcurl_la-speedcheck.lo \ libcurl_la-ldap.lo libcurl_la-version.lo libcurl_la-getenv.lo \ libcurl_la-escape.lo libcurl_la-mprintf.lo \ libcurl_la-telnet.lo libcurl_la-netrc.lo libcurl_la-getinfo.lo \ libcurl_la-transfer.lo libcurl_la-strequal.lo \ libcurl_la-easy.lo libcurl_la-security.lo \ libcurl_la-curl_fnmatch.lo libcurl_la-fileinfo.lo \ libcurl_la-ftplistparser.lo libcurl_la-wildcard.lo \ libcurl_la-krb5.lo libcurl_la-memdebug.lo \ libcurl_la-http_chunks.lo libcurl_la-strtok.lo \ libcurl_la-connect.lo libcurl_la-llist.lo libcurl_la-hash.lo \ libcurl_la-multi.lo libcurl_la-content_encoding.lo \ libcurl_la-share.lo libcurl_la-http_digest.lo \ libcurl_la-md4.lo libcurl_la-md5.lo \ libcurl_la-http_negotiate.lo libcurl_la-inet_pton.lo \ libcurl_la-strtoofft.lo libcurl_la-strerror.lo \ libcurl_la-amigaos.lo libcurl_la-hostasyn.lo \ libcurl_la-hostip4.lo libcurl_la-hostip6.lo \ libcurl_la-hostsyn.lo libcurl_la-inet_ntop.lo \ libcurl_la-parsedate.lo libcurl_la-select.lo \ libcurl_la-tftp.lo libcurl_la-splay.lo libcurl_la-strdup.lo \ libcurl_la-socks.lo libcurl_la-ssh.lo libcurl_la-rawstr.lo \ libcurl_la-curl_addrinfo.lo libcurl_la-socks_gssapi.lo \ libcurl_la-socks_sspi.lo libcurl_la-curl_sspi.lo \ libcurl_la-slist.lo libcurl_la-nonblock.lo \ libcurl_la-curl_memrchr.lo libcurl_la-imap.lo \ libcurl_la-pop3.lo libcurl_la-smtp.lo libcurl_la-pingpong.lo \ libcurl_la-rtsp.lo libcurl_la-curl_threads.lo \ libcurl_la-warnless.lo libcurl_la-hmac.lo \ libcurl_la-curl_rtmp.lo libcurl_la-openldap.lo \ libcurl_la-curl_gethostname.lo libcurl_la-gopher.lo \ libcurl_la-idn_win32.lo libcurl_la-http_negotiate_sspi.lo \ libcurl_la-http_proxy.lo libcurl_la-non-ascii.lo \ libcurl_la-asyn-ares.lo libcurl_la-asyn-thread.lo \ libcurl_la-curl_gssapi.lo libcurl_la-curl_ntlm.lo \ libcurl_la-curl_ntlm_wb.lo libcurl_la-curl_ntlm_core.lo \ libcurl_la-curl_ntlm_msgs.lo libcurl_la-curl_sasl.lo \ libcurl_la-curl_multibyte.lo libcurl_la-hostcheck.lo \ libcurl_la-bundles.lo libcurl_la-conncache.lo \ libcurl_la-pipeline.lo libcurl_la-dotdot.lo \ libcurl_la-x509asn1.lo libcurl_la-http2.lo $(am__objects_1) am__objects_3 = am__objects_4 = $(am__objects_3) am_libcurl_la_OBJECTS = $(am__objects_2) $(am__objects_4) libcurl_la_OBJECTS = $(am_libcurl_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libcurl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libcurl_la_CFLAGS) \ $(CFLAGS) $(libcurl_la_LDFLAGS) $(LDFLAGS) -o $@ libcurlu_la_LIBADD = am__objects_5 = vtls/libcurlu_la-openssl.lo vtls/libcurlu_la-gtls.lo \ vtls/libcurlu_la-vtls.lo vtls/libcurlu_la-nss.lo \ vtls/libcurlu_la-qssl.lo vtls/libcurlu_la-polarssl.lo \ vtls/libcurlu_la-polarssl_threadlock.lo \ vtls/libcurlu_la-axtls.lo vtls/libcurlu_la-cyassl.lo \ vtls/libcurlu_la-curl_schannel.lo \ vtls/libcurlu_la-curl_darwinssl.lo vtls/libcurlu_la-gskit.lo am__objects_6 = libcurlu_la-file.lo libcurlu_la-timeval.lo \ libcurlu_la-base64.lo libcurlu_la-hostip.lo \ libcurlu_la-progress.lo libcurlu_la-formdata.lo \ libcurlu_la-cookie.lo libcurlu_la-http.lo libcurlu_la-sendf.lo \ libcurlu_la-ftp.lo libcurlu_la-url.lo libcurlu_la-dict.lo \ libcurlu_la-if2ip.lo libcurlu_la-speedcheck.lo \ libcurlu_la-ldap.lo libcurlu_la-version.lo \ libcurlu_la-getenv.lo libcurlu_la-escape.lo \ libcurlu_la-mprintf.lo libcurlu_la-telnet.lo \ libcurlu_la-netrc.lo libcurlu_la-getinfo.lo \ libcurlu_la-transfer.lo libcurlu_la-strequal.lo \ libcurlu_la-easy.lo libcurlu_la-security.lo \ libcurlu_la-curl_fnmatch.lo libcurlu_la-fileinfo.lo \ libcurlu_la-ftplistparser.lo libcurlu_la-wildcard.lo \ libcurlu_la-krb5.lo libcurlu_la-memdebug.lo \ libcurlu_la-http_chunks.lo libcurlu_la-strtok.lo \ libcurlu_la-connect.lo libcurlu_la-llist.lo \ libcurlu_la-hash.lo libcurlu_la-multi.lo \ libcurlu_la-content_encoding.lo libcurlu_la-share.lo \ libcurlu_la-http_digest.lo libcurlu_la-md4.lo \ libcurlu_la-md5.lo libcurlu_la-http_negotiate.lo \ libcurlu_la-inet_pton.lo libcurlu_la-strtoofft.lo \ libcurlu_la-strerror.lo libcurlu_la-amigaos.lo \ libcurlu_la-hostasyn.lo libcurlu_la-hostip4.lo \ libcurlu_la-hostip6.lo libcurlu_la-hostsyn.lo \ libcurlu_la-inet_ntop.lo libcurlu_la-parsedate.lo \ libcurlu_la-select.lo libcurlu_la-tftp.lo libcurlu_la-splay.lo \ libcurlu_la-strdup.lo libcurlu_la-socks.lo libcurlu_la-ssh.lo \ libcurlu_la-rawstr.lo libcurlu_la-curl_addrinfo.lo \ libcurlu_la-socks_gssapi.lo libcurlu_la-socks_sspi.lo \ libcurlu_la-curl_sspi.lo libcurlu_la-slist.lo \ libcurlu_la-nonblock.lo libcurlu_la-curl_memrchr.lo \ libcurlu_la-imap.lo libcurlu_la-pop3.lo libcurlu_la-smtp.lo \ libcurlu_la-pingpong.lo libcurlu_la-rtsp.lo \ libcurlu_la-curl_threads.lo libcurlu_la-warnless.lo \ libcurlu_la-hmac.lo libcurlu_la-curl_rtmp.lo \ libcurlu_la-openldap.lo libcurlu_la-curl_gethostname.lo \ libcurlu_la-gopher.lo libcurlu_la-idn_win32.lo \ libcurlu_la-http_negotiate_sspi.lo libcurlu_la-http_proxy.lo \ libcurlu_la-non-ascii.lo libcurlu_la-asyn-ares.lo \ libcurlu_la-asyn-thread.lo libcurlu_la-curl_gssapi.lo \ libcurlu_la-curl_ntlm.lo libcurlu_la-curl_ntlm_wb.lo \ libcurlu_la-curl_ntlm_core.lo libcurlu_la-curl_ntlm_msgs.lo \ libcurlu_la-curl_sasl.lo libcurlu_la-curl_multibyte.lo \ libcurlu_la-hostcheck.lo libcurlu_la-bundles.lo \ libcurlu_la-conncache.lo libcurlu_la-pipeline.lo \ libcurlu_la-dotdot.lo libcurlu_la-x509asn1.lo \ libcurlu_la-http2.lo $(am__objects_5) am_libcurlu_la_OBJECTS = $(am__objects_6) $(am__objects_4) libcurlu_la_OBJECTS = $(am_libcurlu_la_OBJECTS) libcurlu_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libcurlu_la_CFLAGS) \ $(CFLAGS) $(libcurlu_la_LDFLAGS) $(LDFLAGS) -o $@ @BUILD_UNITTESTS_TRUE@am_libcurlu_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcurl_la_SOURCES) $(libcurlu_la_SOURCES) DIST_SOURCES = $(libcurl_la_SOURCES) $(libcurlu_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)curl_config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ # This might hold -Werror CFLAGS = @CFLAGS@ @CURL_CFLAG_EXTRAS@ CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@ CURLVERSION = @CURLVERSION@ CURL_CA_BUNDLE = @CURL_CA_BUNDLE@ CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@ CURL_DISABLE_DICT = @CURL_DISABLE_DICT@ CURL_DISABLE_FILE = @CURL_DISABLE_FILE@ CURL_DISABLE_FTP = @CURL_DISABLE_FTP@ CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@ CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@ CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@ CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@ CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@ CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@ CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@ CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@ CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@ CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@ CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@ CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@ CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@ CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_SHARED = @ENABLE_SHARED@ ENABLE_STATIC = @ENABLE_STATIC@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@ HAVE_LDAP_SSL = @HAVE_LDAP_SSL@ HAVE_LIBZ = @HAVE_LIBZ@ HAVE_SSLEAY_SRP = @HAVE_SSLEAY_SRP@ IDN_ENABLED = @IDN_ENABLED@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IPV6_ENABLED = @IPV6_ENABLED@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@ LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@ LIBMETALINK_LIBS = @LIBMETALINK_LIBS@ LIBOBJS = @LIBOBJS@ # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANOPT = @MANOPT@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NROFF = @NROFF@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGADD_NAME = @PKGADD_NAME@ PKGADD_PKG = @PKGADD_PKG@ PKGADD_VENDOR = @PKGADD_VENDOR@ PKGCONFIG = @PKGCONFIG@ RANDOM_FILE = @RANDOM_FILE@ RANLIB = @RANLIB@ REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_ENABLED = @SSL_ENABLED@ STRIP = @STRIP@ SUPPORT_FEATURES = @SUPPORT_FEATURES@ SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@ USE_ARES = @USE_ARES@ USE_AXTLS = @USE_AXTLS@ USE_CYASSL = @USE_CYASSL@ USE_DARWINSSL = @USE_DARWINSSL@ USE_GNUTLS = @USE_GNUTLS@ USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@ USE_LIBRTMP = @USE_LIBRTMP@ USE_LIBSSH2 = @USE_LIBSSH2@ USE_NGHTTP2 = @USE_NGHTTP2@ USE_NSS = @USE_NSS@ USE_OPENLDAP = @USE_OPENLDAP@ USE_POLARSSL = @USE_POLARSSL@ USE_SCHANNEL = @USE_SCHANNEL@ USE_SSLEAY = @USE_SSLEAY@ USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@ VERSION = @VERSION@ VERSIONNUM = @VERSIONNUM@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libext = @libext@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # ########################################################################### AUTOMAKE_OPTIONS = foreign nostdinc DOCS = README.encoding README.memoryleak README.ares README.curlx \ README.hostip README.multi_socket README.httpauth README.pipelining \ README.curl_off_t README.pingpong CMAKE_DIST = CMakeLists.txt curl_config.h.cmake EXTRA_DIST = Makefile.b32 Makefile.m32 Makefile.vc6 config-win32.h \ config-win32ce.h config-riscos.h config-mac.h curl_config.h.in \ makefile.dj config-dos.h libcurl.plist libcurl.rc config-amigaos.h \ makefile.amiga Makefile.netware nwlib.c nwos.c config-win32ce.h \ config-os400.h setup-os400.h config-symbian.h Makefile.Watcom \ config-tpf.h $(DOCS) mk-ca-bundle.pl mk-ca-bundle.vbs $(CMAKE_DIST) \ firefox-db2pem.sh config-vxworks.h Makefile.vxworks checksrc.pl \ objnames-test08.sh objnames-test10.sh objnames.inc lib_LTLIBRARIES = libcurl.la @BUILD_UNITTESTS_FALSE@noinst_LTLIBRARIES = @BUILD_UNITTESTS_TRUE@noinst_LTLIBRARIES = libcurlu.la # Specify our include paths here, and do it relative to $(top_srcdir) and # $(top_builddir), to ensure that these paths which belong to the library # being currently built and tested are searched before the library which # might possibly already be installed in the system. # # $(top_builddir)/include/curl for generated curlbuild.h included from curl.h # $(top_builddir)/include for generated curlbuild.h inc. from lib/curl_setup.h # $(top_srcdir)/include is for libcurl's external include files # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "private" files # $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file # $(top_srcdir)/ares is for in-tree c-ares's external include files # 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. # # Here's the simplified rule guide on how to change -version-info: # (current version is C:R:A) # # 1. if there are only source changes, use C:R+1:A # 2. if interfaces were added use C+1:0:A+1 # 3. if interfaces were removed, then use C+1:0:0 # # For the full guide on libcurl ABI rules, see docs/libcurl/ABI AM_CPPFLAGS = -I$(top_builddir)/include/curl -I$(top_builddir)/include \ -I$(top_srcdir)/include -I$(top_builddir)/lib \ -I$(top_srcdir)/lib $(am__append_1) -DBUILDING_LIBCURL @SONAME_BUMP_FALSE@VERSIONINFO = -version-info 7:0:3 # # Bumping of SONAME conditionally may seem like a weird thing to do, and yeah # it is. The problem is that we try to avoid the bump as hard as possible, but # yet it is still necessary for a few rare situations. The configure script will # attempt to figure out these situations, and it can be forced to consider this # to be such a case! See README.curl_off_t for further details. # # This conditional soname bump SHOULD be removed at next "proper" bump. # @SONAME_BUMP_TRUE@VERSIONINFO = -version-info 8:0:3 AM_LDFLAGS = AM_CFLAGS = libcurl_la_CPPFLAGS_EXTRA = $(am__append_6) $(am__append_7) libcurl_la_LDFLAGS_EXTRA = $(am__append_2) $(am__append_3) \ $(am__append_4) $(am__append_5) libcurl_la_CFLAGS_EXTRA = $(am__append_8) libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_la_CPPFLAGS_EXTRA) libcurl_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS) libcurl_la_CFLAGS = $(AM_CFLAGS) $(libcurl_la_CFLAGS_EXTRA) libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_LIBS) libcurlu_la_CFLAGS = $(AM_CFLAGS) VSOURCES = vtls/openssl.c vtls/gtls.c vtls/vtls.c vtls/nss.c vtls/qssl.c \ vtls/polarssl.c vtls/polarssl_threadlock.c vtls/axtls.c vtls/cyassl.c \ vtls/curl_schannel.c vtls/curl_darwinssl.c vtls/gskit.c VHEADERS = vtls/qssl.h vtls/openssl.h vtls/vtls.h vtls/gtls.h \ vtls/nssg.h vtls/polarssl.h vtls/polarssl_threadlock.h vtls/axtls.h \ vtls/cyassl.h vtls/curl_schannel.h vtls/curl_darwinssl.h vtls/gskit.h 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 version.c getenv.c escape.c mprintf.c telnet.c netrc.c \ getinfo.c transfer.c strequal.c easy.c security.c curl_fnmatch.c \ fileinfo.c ftplistparser.c wildcard.c krb5.c memdebug.c http_chunks.c \ strtok.c connect.c llist.c hash.c multi.c content_encoding.c share.c \ http_digest.c md4.c md5.c http_negotiate.c inet_pton.c strtoofft.c \ strerror.c amigaos.c hostasyn.c hostip4.c hostip6.c hostsyn.c \ inet_ntop.c parsedate.c select.c tftp.c splay.c strdup.c socks.c \ ssh.c rawstr.c curl_addrinfo.c socks_gssapi.c socks_sspi.c \ curl_sspi.c slist.c nonblock.c curl_memrchr.c imap.c pop3.c smtp.c \ pingpong.c rtsp.c curl_threads.c warnless.c hmac.c curl_rtmp.c \ openldap.c curl_gethostname.c gopher.c idn_win32.c \ http_negotiate_sspi.c http_proxy.c non-ascii.c asyn-ares.c \ asyn-thread.c curl_gssapi.c curl_ntlm.c curl_ntlm_wb.c \ curl_ntlm_core.c curl_ntlm_msgs.c curl_sasl.c curl_multibyte.c \ hostcheck.c bundles.c conncache.c pipeline.c dotdot.c x509asn1.c \ http2.c $(VSOURCES) HHEADERS = arpa_telnet.h netrc.h file.h timeval.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 curl_ldap.h escape.h telnet.h getinfo.h \ strequal.h curl_sec.h memdebug.h http_chunks.h curl_fnmatch.h \ wildcard.h fileinfo.h ftplistparser.h strtok.h connect.h llist.h \ hash.h content_encoding.h share.h curl_md4.h curl_md5.h http_digest.h \ http_negotiate.h inet_pton.h amigaos.h strtoofft.h strerror.h \ inet_ntop.h curlx.h curl_memory.h curl_setup.h transfer.h select.h \ easyif.h multiif.h parsedate.h tftp.h sockaddr.h splay.h strdup.h \ socks.h ssh.h curl_base64.h rawstr.h curl_addrinfo.h curl_sspi.h \ slist.h nonblock.h curl_memrchr.h imap.h pop3.h smtp.h pingpong.h \ rtsp.h curl_threads.h warnless.h curl_hmac.h curl_rtmp.h \ curl_gethostname.h gopher.h http_proxy.h non-ascii.h asyn.h \ curl_ntlm.h curl_gssapi.h curl_ntlm_wb.h curl_ntlm_core.h \ curl_ntlm_msgs.h curl_sasl.h curl_multibyte.h hostcheck.h bundles.h \ conncache.h curl_setup_once.h multihandle.h setup-vms.h pipeline.h \ dotdot.h x509asn1.h http2.h sigpipe.h $(VHEADERS) # Makefile.inc provides the CSOURCES and HHEADERS defines libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS) libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS) all: curl_config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Makefile.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(srcdir)/Makefile.inc: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): curl_config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/curl_config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status lib/curl_config.h $(srcdir)/curl_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f curl_config.h stamp-h1 libcurl.vers: $(top_builddir)/config.status $(srcdir)/libcurl.vers.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } vtls/$(am__dirstamp): @$(MKDIR_P) vtls @: > vtls/$(am__dirstamp) vtls/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) vtls/$(DEPDIR) @: > vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurl_la-openssl.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurl_la-gtls.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurl_la-vtls.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurl_la-nss.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurl_la-qssl.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurl_la-polarssl.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurl_la-polarssl_threadlock.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurl_la-axtls.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurl_la-cyassl.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurl_la-curl_schannel.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurl_la-curl_darwinssl.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurl_la-gskit.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) libcurl.la: $(libcurl_la_OBJECTS) $(libcurl_la_DEPENDENCIES) $(EXTRA_libcurl_la_DEPENDENCIES) $(AM_V_CCLD)$(libcurl_la_LINK) -rpath $(libdir) $(libcurl_la_OBJECTS) $(libcurl_la_LIBADD) $(LIBS) vtls/libcurlu_la-openssl.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurlu_la-gtls.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurlu_la-vtls.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurlu_la-nss.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurlu_la-qssl.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurlu_la-polarssl.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurlu_la-polarssl_threadlock.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurlu_la-axtls.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurlu_la-cyassl.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurlu_la-curl_schannel.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurlu_la-curl_darwinssl.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) vtls/libcurlu_la-gskit.lo: vtls/$(am__dirstamp) \ vtls/$(DEPDIR)/$(am__dirstamp) libcurlu.la: $(libcurlu_la_OBJECTS) $(libcurlu_la_DEPENDENCIES) $(EXTRA_libcurlu_la_DEPENDENCIES) $(AM_V_CCLD)$(libcurlu_la_LINK) $(am_libcurlu_la_rpath) $(libcurlu_la_OBJECTS) $(libcurlu_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f vtls/*.$(OBJEXT) -rm -f vtls/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-amigaos.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-asyn-ares.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-asyn-thread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-base64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-bundles.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-conncache.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-connect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-content_encoding.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-cookie.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-curl_addrinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-curl_fnmatch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-curl_gethostname.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-curl_gssapi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-curl_memrchr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-curl_multibyte.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-curl_ntlm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-curl_ntlm_core.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-curl_ntlm_msgs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-curl_ntlm_wb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-curl_rtmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-curl_sasl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-curl_sspi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-curl_threads.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-dict.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-dotdot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-easy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-escape.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-fileinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-formdata.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-ftp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-ftplistparser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-getenv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-getinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-gopher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-hmac.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-hostasyn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-hostcheck.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-hostip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-hostip4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-hostip6.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-hostsyn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-http.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-http2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-http_chunks.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-http_digest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-http_negotiate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-http_negotiate_sspi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-http_proxy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-idn_win32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-if2ip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-imap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-inet_ntop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-inet_pton.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-krb5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-ldap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-llist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-md4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-md5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-memdebug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-mprintf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-multi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-netrc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-non-ascii.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-nonblock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-openldap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-parsedate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-pingpong.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-pipeline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-pop3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-progress.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-rawstr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-rtsp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-security.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-select.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-sendf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-share.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-slist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-smtp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-socks.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-socks_gssapi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-socks_sspi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-speedcheck.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-splay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-ssh.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-strdup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-strequal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-strerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-strtok.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-strtoofft.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-telnet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-tftp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-timeval.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-transfer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-url.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-version.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-warnless.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-wildcard.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-x509asn1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-amigaos.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-asyn-ares.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-asyn-thread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-base64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-bundles.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-conncache.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-connect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-content_encoding.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-cookie.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-curl_addrinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-curl_fnmatch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-curl_gethostname.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-curl_gssapi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-curl_memrchr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-curl_multibyte.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-curl_ntlm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-curl_ntlm_core.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-curl_ntlm_msgs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-curl_ntlm_wb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-curl_rtmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-curl_sasl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-curl_sspi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-curl_threads.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-dict.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-dotdot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-easy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-escape.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-fileinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-formdata.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-ftp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-ftplistparser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-getenv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-getinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-gopher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-hmac.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-hostasyn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-hostcheck.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-hostip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-hostip4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-hostip6.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-hostsyn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-http.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-http2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-http_chunks.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-http_digest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-http_negotiate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-http_negotiate_sspi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-http_proxy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-idn_win32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-if2ip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-imap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-inet_ntop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-inet_pton.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-krb5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-ldap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-llist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-md4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-md5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-memdebug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-mprintf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-multi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-netrc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-non-ascii.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-nonblock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-openldap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-parsedate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-pingpong.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-pipeline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-pop3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-progress.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-rawstr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-rtsp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-security.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-select.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-sendf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-share.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-slist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-smtp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-socks.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-socks_gssapi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-socks_sspi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-speedcheck.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-splay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-ssh.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-strdup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-strequal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-strerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-strtok.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-strtoofft.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-telnet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-tftp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-timeval.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-transfer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-url.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-version.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-warnless.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-wildcard.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-x509asn1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurl_la-axtls.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurl_la-curl_darwinssl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurl_la-curl_schannel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurl_la-cyassl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurl_la-gskit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurl_la-gtls.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurl_la-nss.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurl_la-openssl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurl_la-polarssl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurl_la-polarssl_threadlock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurl_la-qssl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurl_la-vtls.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurlu_la-axtls.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurlu_la-curl_darwinssl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurlu_la-curl_schannel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurlu_la-cyassl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurlu_la-gskit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurlu_la-gtls.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurlu_la-nss.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurlu_la-openssl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurlu_la-polarssl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurlu_la-polarssl_threadlock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurlu_la-qssl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@vtls/$(DEPDIR)/libcurlu_la-vtls.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libcurl_la-file.lo: file.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-file.lo -MD -MP -MF $(DEPDIR)/libcurl_la-file.Tpo -c -o libcurl_la-file.lo `test -f 'file.c' || echo '$(srcdir)/'`file.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-file.Tpo $(DEPDIR)/libcurl_la-file.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file.c' object='libcurl_la-file.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-file.lo `test -f 'file.c' || echo '$(srcdir)/'`file.c libcurl_la-timeval.lo: timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-timeval.lo -MD -MP -MF $(DEPDIR)/libcurl_la-timeval.Tpo -c -o libcurl_la-timeval.lo `test -f 'timeval.c' || echo '$(srcdir)/'`timeval.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-timeval.Tpo $(DEPDIR)/libcurl_la-timeval.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='timeval.c' object='libcurl_la-timeval.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-timeval.lo `test -f 'timeval.c' || echo '$(srcdir)/'`timeval.c libcurl_la-base64.lo: base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-base64.lo -MD -MP -MF $(DEPDIR)/libcurl_la-base64.Tpo -c -o libcurl_la-base64.lo `test -f 'base64.c' || echo '$(srcdir)/'`base64.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-base64.Tpo $(DEPDIR)/libcurl_la-base64.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='base64.c' object='libcurl_la-base64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-base64.lo `test -f 'base64.c' || echo '$(srcdir)/'`base64.c libcurl_la-hostip.lo: hostip.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-hostip.lo -MD -MP -MF $(DEPDIR)/libcurl_la-hostip.Tpo -c -o libcurl_la-hostip.lo `test -f 'hostip.c' || echo '$(srcdir)/'`hostip.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-hostip.Tpo $(DEPDIR)/libcurl_la-hostip.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hostip.c' object='libcurl_la-hostip.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-hostip.lo `test -f 'hostip.c' || echo '$(srcdir)/'`hostip.c libcurl_la-progress.lo: progress.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-progress.lo -MD -MP -MF $(DEPDIR)/libcurl_la-progress.Tpo -c -o libcurl_la-progress.lo `test -f 'progress.c' || echo '$(srcdir)/'`progress.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-progress.Tpo $(DEPDIR)/libcurl_la-progress.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='progress.c' object='libcurl_la-progress.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-progress.lo `test -f 'progress.c' || echo '$(srcdir)/'`progress.c libcurl_la-formdata.lo: formdata.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-formdata.lo -MD -MP -MF $(DEPDIR)/libcurl_la-formdata.Tpo -c -o libcurl_la-formdata.lo `test -f 'formdata.c' || echo '$(srcdir)/'`formdata.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-formdata.Tpo $(DEPDIR)/libcurl_la-formdata.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='formdata.c' object='libcurl_la-formdata.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-formdata.lo `test -f 'formdata.c' || echo '$(srcdir)/'`formdata.c libcurl_la-cookie.lo: cookie.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-cookie.lo -MD -MP -MF $(DEPDIR)/libcurl_la-cookie.Tpo -c -o libcurl_la-cookie.lo `test -f 'cookie.c' || echo '$(srcdir)/'`cookie.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-cookie.Tpo $(DEPDIR)/libcurl_la-cookie.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cookie.c' object='libcurl_la-cookie.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-cookie.lo `test -f 'cookie.c' || echo '$(srcdir)/'`cookie.c libcurl_la-http.lo: http.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-http.lo -MD -MP -MF $(DEPDIR)/libcurl_la-http.Tpo -c -o libcurl_la-http.lo `test -f 'http.c' || echo '$(srcdir)/'`http.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-http.Tpo $(DEPDIR)/libcurl_la-http.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http.c' object='libcurl_la-http.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-http.lo `test -f 'http.c' || echo '$(srcdir)/'`http.c libcurl_la-sendf.lo: sendf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-sendf.lo -MD -MP -MF $(DEPDIR)/libcurl_la-sendf.Tpo -c -o libcurl_la-sendf.lo `test -f 'sendf.c' || echo '$(srcdir)/'`sendf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-sendf.Tpo $(DEPDIR)/libcurl_la-sendf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sendf.c' object='libcurl_la-sendf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-sendf.lo `test -f 'sendf.c' || echo '$(srcdir)/'`sendf.c libcurl_la-ftp.lo: ftp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-ftp.lo -MD -MP -MF $(DEPDIR)/libcurl_la-ftp.Tpo -c -o libcurl_la-ftp.lo `test -f 'ftp.c' || echo '$(srcdir)/'`ftp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-ftp.Tpo $(DEPDIR)/libcurl_la-ftp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftp.c' object='libcurl_la-ftp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-ftp.lo `test -f 'ftp.c' || echo '$(srcdir)/'`ftp.c libcurl_la-url.lo: url.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-url.lo -MD -MP -MF $(DEPDIR)/libcurl_la-url.Tpo -c -o libcurl_la-url.lo `test -f 'url.c' || echo '$(srcdir)/'`url.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-url.Tpo $(DEPDIR)/libcurl_la-url.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='url.c' object='libcurl_la-url.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-url.lo `test -f 'url.c' || echo '$(srcdir)/'`url.c libcurl_la-dict.lo: dict.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-dict.lo -MD -MP -MF $(DEPDIR)/libcurl_la-dict.Tpo -c -o libcurl_la-dict.lo `test -f 'dict.c' || echo '$(srcdir)/'`dict.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-dict.Tpo $(DEPDIR)/libcurl_la-dict.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dict.c' object='libcurl_la-dict.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-dict.lo `test -f 'dict.c' || echo '$(srcdir)/'`dict.c libcurl_la-if2ip.lo: if2ip.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-if2ip.lo -MD -MP -MF $(DEPDIR)/libcurl_la-if2ip.Tpo -c -o libcurl_la-if2ip.lo `test -f 'if2ip.c' || echo '$(srcdir)/'`if2ip.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-if2ip.Tpo $(DEPDIR)/libcurl_la-if2ip.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='if2ip.c' object='libcurl_la-if2ip.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-if2ip.lo `test -f 'if2ip.c' || echo '$(srcdir)/'`if2ip.c libcurl_la-speedcheck.lo: speedcheck.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-speedcheck.lo -MD -MP -MF $(DEPDIR)/libcurl_la-speedcheck.Tpo -c -o libcurl_la-speedcheck.lo `test -f 'speedcheck.c' || echo '$(srcdir)/'`speedcheck.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-speedcheck.Tpo $(DEPDIR)/libcurl_la-speedcheck.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='speedcheck.c' object='libcurl_la-speedcheck.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-speedcheck.lo `test -f 'speedcheck.c' || echo '$(srcdir)/'`speedcheck.c libcurl_la-ldap.lo: ldap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-ldap.lo -MD -MP -MF $(DEPDIR)/libcurl_la-ldap.Tpo -c -o libcurl_la-ldap.lo `test -f 'ldap.c' || echo '$(srcdir)/'`ldap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-ldap.Tpo $(DEPDIR)/libcurl_la-ldap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ldap.c' object='libcurl_la-ldap.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-ldap.lo `test -f 'ldap.c' || echo '$(srcdir)/'`ldap.c libcurl_la-version.lo: version.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-version.lo -MD -MP -MF $(DEPDIR)/libcurl_la-version.Tpo -c -o libcurl_la-version.lo `test -f 'version.c' || echo '$(srcdir)/'`version.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-version.Tpo $(DEPDIR)/libcurl_la-version.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='version.c' object='libcurl_la-version.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-version.lo `test -f 'version.c' || echo '$(srcdir)/'`version.c libcurl_la-getenv.lo: getenv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-getenv.lo -MD -MP -MF $(DEPDIR)/libcurl_la-getenv.Tpo -c -o libcurl_la-getenv.lo `test -f 'getenv.c' || echo '$(srcdir)/'`getenv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-getenv.Tpo $(DEPDIR)/libcurl_la-getenv.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getenv.c' object='libcurl_la-getenv.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-getenv.lo `test -f 'getenv.c' || echo '$(srcdir)/'`getenv.c libcurl_la-escape.lo: escape.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-escape.lo -MD -MP -MF $(DEPDIR)/libcurl_la-escape.Tpo -c -o libcurl_la-escape.lo `test -f 'escape.c' || echo '$(srcdir)/'`escape.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-escape.Tpo $(DEPDIR)/libcurl_la-escape.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='escape.c' object='libcurl_la-escape.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-escape.lo `test -f 'escape.c' || echo '$(srcdir)/'`escape.c libcurl_la-mprintf.lo: mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-mprintf.lo -MD -MP -MF $(DEPDIR)/libcurl_la-mprintf.Tpo -c -o libcurl_la-mprintf.lo `test -f 'mprintf.c' || echo '$(srcdir)/'`mprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-mprintf.Tpo $(DEPDIR)/libcurl_la-mprintf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mprintf.c' object='libcurl_la-mprintf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-mprintf.lo `test -f 'mprintf.c' || echo '$(srcdir)/'`mprintf.c libcurl_la-telnet.lo: telnet.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-telnet.lo -MD -MP -MF $(DEPDIR)/libcurl_la-telnet.Tpo -c -o libcurl_la-telnet.lo `test -f 'telnet.c' || echo '$(srcdir)/'`telnet.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-telnet.Tpo $(DEPDIR)/libcurl_la-telnet.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='telnet.c' object='libcurl_la-telnet.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-telnet.lo `test -f 'telnet.c' || echo '$(srcdir)/'`telnet.c libcurl_la-netrc.lo: netrc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-netrc.lo -MD -MP -MF $(DEPDIR)/libcurl_la-netrc.Tpo -c -o libcurl_la-netrc.lo `test -f 'netrc.c' || echo '$(srcdir)/'`netrc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-netrc.Tpo $(DEPDIR)/libcurl_la-netrc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netrc.c' object='libcurl_la-netrc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-netrc.lo `test -f 'netrc.c' || echo '$(srcdir)/'`netrc.c libcurl_la-getinfo.lo: getinfo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-getinfo.lo -MD -MP -MF $(DEPDIR)/libcurl_la-getinfo.Tpo -c -o libcurl_la-getinfo.lo `test -f 'getinfo.c' || echo '$(srcdir)/'`getinfo.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-getinfo.Tpo $(DEPDIR)/libcurl_la-getinfo.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getinfo.c' object='libcurl_la-getinfo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-getinfo.lo `test -f 'getinfo.c' || echo '$(srcdir)/'`getinfo.c libcurl_la-transfer.lo: transfer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-transfer.lo -MD -MP -MF $(DEPDIR)/libcurl_la-transfer.Tpo -c -o libcurl_la-transfer.lo `test -f 'transfer.c' || echo '$(srcdir)/'`transfer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-transfer.Tpo $(DEPDIR)/libcurl_la-transfer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='transfer.c' object='libcurl_la-transfer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-transfer.lo `test -f 'transfer.c' || echo '$(srcdir)/'`transfer.c libcurl_la-strequal.lo: strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-strequal.lo -MD -MP -MF $(DEPDIR)/libcurl_la-strequal.Tpo -c -o libcurl_la-strequal.lo `test -f 'strequal.c' || echo '$(srcdir)/'`strequal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-strequal.Tpo $(DEPDIR)/libcurl_la-strequal.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strequal.c' object='libcurl_la-strequal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-strequal.lo `test -f 'strequal.c' || echo '$(srcdir)/'`strequal.c libcurl_la-easy.lo: easy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-easy.lo -MD -MP -MF $(DEPDIR)/libcurl_la-easy.Tpo -c -o libcurl_la-easy.lo `test -f 'easy.c' || echo '$(srcdir)/'`easy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-easy.Tpo $(DEPDIR)/libcurl_la-easy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='easy.c' object='libcurl_la-easy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-easy.lo `test -f 'easy.c' || echo '$(srcdir)/'`easy.c libcurl_la-security.lo: security.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-security.lo -MD -MP -MF $(DEPDIR)/libcurl_la-security.Tpo -c -o libcurl_la-security.lo `test -f 'security.c' || echo '$(srcdir)/'`security.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-security.Tpo $(DEPDIR)/libcurl_la-security.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='security.c' object='libcurl_la-security.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-security.lo `test -f 'security.c' || echo '$(srcdir)/'`security.c libcurl_la-curl_fnmatch.lo: curl_fnmatch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-curl_fnmatch.lo -MD -MP -MF $(DEPDIR)/libcurl_la-curl_fnmatch.Tpo -c -o libcurl_la-curl_fnmatch.lo `test -f 'curl_fnmatch.c' || echo '$(srcdir)/'`curl_fnmatch.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-curl_fnmatch.Tpo $(DEPDIR)/libcurl_la-curl_fnmatch.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_fnmatch.c' object='libcurl_la-curl_fnmatch.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-curl_fnmatch.lo `test -f 'curl_fnmatch.c' || echo '$(srcdir)/'`curl_fnmatch.c libcurl_la-fileinfo.lo: fileinfo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-fileinfo.lo -MD -MP -MF $(DEPDIR)/libcurl_la-fileinfo.Tpo -c -o libcurl_la-fileinfo.lo `test -f 'fileinfo.c' || echo '$(srcdir)/'`fileinfo.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-fileinfo.Tpo $(DEPDIR)/libcurl_la-fileinfo.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fileinfo.c' object='libcurl_la-fileinfo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-fileinfo.lo `test -f 'fileinfo.c' || echo '$(srcdir)/'`fileinfo.c libcurl_la-ftplistparser.lo: ftplistparser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-ftplistparser.lo -MD -MP -MF $(DEPDIR)/libcurl_la-ftplistparser.Tpo -c -o libcurl_la-ftplistparser.lo `test -f 'ftplistparser.c' || echo '$(srcdir)/'`ftplistparser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-ftplistparser.Tpo $(DEPDIR)/libcurl_la-ftplistparser.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftplistparser.c' object='libcurl_la-ftplistparser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-ftplistparser.lo `test -f 'ftplistparser.c' || echo '$(srcdir)/'`ftplistparser.c libcurl_la-wildcard.lo: wildcard.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-wildcard.lo -MD -MP -MF $(DEPDIR)/libcurl_la-wildcard.Tpo -c -o libcurl_la-wildcard.lo `test -f 'wildcard.c' || echo '$(srcdir)/'`wildcard.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-wildcard.Tpo $(DEPDIR)/libcurl_la-wildcard.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wildcard.c' object='libcurl_la-wildcard.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-wildcard.lo `test -f 'wildcard.c' || echo '$(srcdir)/'`wildcard.c libcurl_la-krb5.lo: krb5.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-krb5.lo -MD -MP -MF $(DEPDIR)/libcurl_la-krb5.Tpo -c -o libcurl_la-krb5.lo `test -f 'krb5.c' || echo '$(srcdir)/'`krb5.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-krb5.Tpo $(DEPDIR)/libcurl_la-krb5.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='krb5.c' object='libcurl_la-krb5.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-krb5.lo `test -f 'krb5.c' || echo '$(srcdir)/'`krb5.c libcurl_la-memdebug.lo: memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-memdebug.lo -MD -MP -MF $(DEPDIR)/libcurl_la-memdebug.Tpo -c -o libcurl_la-memdebug.lo `test -f 'memdebug.c' || echo '$(srcdir)/'`memdebug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-memdebug.Tpo $(DEPDIR)/libcurl_la-memdebug.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='memdebug.c' object='libcurl_la-memdebug.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-memdebug.lo `test -f 'memdebug.c' || echo '$(srcdir)/'`memdebug.c libcurl_la-http_chunks.lo: http_chunks.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-http_chunks.lo -MD -MP -MF $(DEPDIR)/libcurl_la-http_chunks.Tpo -c -o libcurl_la-http_chunks.lo `test -f 'http_chunks.c' || echo '$(srcdir)/'`http_chunks.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-http_chunks.Tpo $(DEPDIR)/libcurl_la-http_chunks.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http_chunks.c' object='libcurl_la-http_chunks.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-http_chunks.lo `test -f 'http_chunks.c' || echo '$(srcdir)/'`http_chunks.c libcurl_la-strtok.lo: strtok.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-strtok.lo -MD -MP -MF $(DEPDIR)/libcurl_la-strtok.Tpo -c -o libcurl_la-strtok.lo `test -f 'strtok.c' || echo '$(srcdir)/'`strtok.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-strtok.Tpo $(DEPDIR)/libcurl_la-strtok.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strtok.c' object='libcurl_la-strtok.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-strtok.lo `test -f 'strtok.c' || echo '$(srcdir)/'`strtok.c libcurl_la-connect.lo: connect.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-connect.lo -MD -MP -MF $(DEPDIR)/libcurl_la-connect.Tpo -c -o libcurl_la-connect.lo `test -f 'connect.c' || echo '$(srcdir)/'`connect.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-connect.Tpo $(DEPDIR)/libcurl_la-connect.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='connect.c' object='libcurl_la-connect.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-connect.lo `test -f 'connect.c' || echo '$(srcdir)/'`connect.c libcurl_la-llist.lo: llist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-llist.lo -MD -MP -MF $(DEPDIR)/libcurl_la-llist.Tpo -c -o libcurl_la-llist.lo `test -f 'llist.c' || echo '$(srcdir)/'`llist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-llist.Tpo $(DEPDIR)/libcurl_la-llist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='llist.c' object='libcurl_la-llist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-llist.lo `test -f 'llist.c' || echo '$(srcdir)/'`llist.c libcurl_la-hash.lo: hash.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-hash.lo -MD -MP -MF $(DEPDIR)/libcurl_la-hash.Tpo -c -o libcurl_la-hash.lo `test -f 'hash.c' || echo '$(srcdir)/'`hash.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-hash.Tpo $(DEPDIR)/libcurl_la-hash.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash.c' object='libcurl_la-hash.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-hash.lo `test -f 'hash.c' || echo '$(srcdir)/'`hash.c libcurl_la-multi.lo: multi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-multi.lo -MD -MP -MF $(DEPDIR)/libcurl_la-multi.Tpo -c -o libcurl_la-multi.lo `test -f 'multi.c' || echo '$(srcdir)/'`multi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-multi.Tpo $(DEPDIR)/libcurl_la-multi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='multi.c' object='libcurl_la-multi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-multi.lo `test -f 'multi.c' || echo '$(srcdir)/'`multi.c libcurl_la-content_encoding.lo: content_encoding.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-content_encoding.lo -MD -MP -MF $(DEPDIR)/libcurl_la-content_encoding.Tpo -c -o libcurl_la-content_encoding.lo `test -f 'content_encoding.c' || echo '$(srcdir)/'`content_encoding.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-content_encoding.Tpo $(DEPDIR)/libcurl_la-content_encoding.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='content_encoding.c' object='libcurl_la-content_encoding.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-content_encoding.lo `test -f 'content_encoding.c' || echo '$(srcdir)/'`content_encoding.c libcurl_la-share.lo: share.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-share.lo -MD -MP -MF $(DEPDIR)/libcurl_la-share.Tpo -c -o libcurl_la-share.lo `test -f 'share.c' || echo '$(srcdir)/'`share.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-share.Tpo $(DEPDIR)/libcurl_la-share.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='share.c' object='libcurl_la-share.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-share.lo `test -f 'share.c' || echo '$(srcdir)/'`share.c libcurl_la-http_digest.lo: http_digest.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-http_digest.lo -MD -MP -MF $(DEPDIR)/libcurl_la-http_digest.Tpo -c -o libcurl_la-http_digest.lo `test -f 'http_digest.c' || echo '$(srcdir)/'`http_digest.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-http_digest.Tpo $(DEPDIR)/libcurl_la-http_digest.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http_digest.c' object='libcurl_la-http_digest.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-http_digest.lo `test -f 'http_digest.c' || echo '$(srcdir)/'`http_digest.c libcurl_la-md4.lo: md4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-md4.lo -MD -MP -MF $(DEPDIR)/libcurl_la-md4.Tpo -c -o libcurl_la-md4.lo `test -f 'md4.c' || echo '$(srcdir)/'`md4.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-md4.Tpo $(DEPDIR)/libcurl_la-md4.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='md4.c' object='libcurl_la-md4.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-md4.lo `test -f 'md4.c' || echo '$(srcdir)/'`md4.c libcurl_la-md5.lo: md5.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-md5.lo -MD -MP -MF $(DEPDIR)/libcurl_la-md5.Tpo -c -o libcurl_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-md5.Tpo $(DEPDIR)/libcurl_la-md5.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='md5.c' object='libcurl_la-md5.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c libcurl_la-http_negotiate.lo: http_negotiate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-http_negotiate.lo -MD -MP -MF $(DEPDIR)/libcurl_la-http_negotiate.Tpo -c -o libcurl_la-http_negotiate.lo `test -f 'http_negotiate.c' || echo '$(srcdir)/'`http_negotiate.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-http_negotiate.Tpo $(DEPDIR)/libcurl_la-http_negotiate.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http_negotiate.c' object='libcurl_la-http_negotiate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-http_negotiate.lo `test -f 'http_negotiate.c' || echo '$(srcdir)/'`http_negotiate.c libcurl_la-inet_pton.lo: inet_pton.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-inet_pton.lo -MD -MP -MF $(DEPDIR)/libcurl_la-inet_pton.Tpo -c -o libcurl_la-inet_pton.lo `test -f 'inet_pton.c' || echo '$(srcdir)/'`inet_pton.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-inet_pton.Tpo $(DEPDIR)/libcurl_la-inet_pton.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inet_pton.c' object='libcurl_la-inet_pton.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-inet_pton.lo `test -f 'inet_pton.c' || echo '$(srcdir)/'`inet_pton.c libcurl_la-strtoofft.lo: strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-strtoofft.lo -MD -MP -MF $(DEPDIR)/libcurl_la-strtoofft.Tpo -c -o libcurl_la-strtoofft.lo `test -f 'strtoofft.c' || echo '$(srcdir)/'`strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-strtoofft.Tpo $(DEPDIR)/libcurl_la-strtoofft.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strtoofft.c' object='libcurl_la-strtoofft.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-strtoofft.lo `test -f 'strtoofft.c' || echo '$(srcdir)/'`strtoofft.c libcurl_la-strerror.lo: strerror.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-strerror.lo -MD -MP -MF $(DEPDIR)/libcurl_la-strerror.Tpo -c -o libcurl_la-strerror.lo `test -f 'strerror.c' || echo '$(srcdir)/'`strerror.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-strerror.Tpo $(DEPDIR)/libcurl_la-strerror.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strerror.c' object='libcurl_la-strerror.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-strerror.lo `test -f 'strerror.c' || echo '$(srcdir)/'`strerror.c libcurl_la-amigaos.lo: amigaos.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-amigaos.lo -MD -MP -MF $(DEPDIR)/libcurl_la-amigaos.Tpo -c -o libcurl_la-amigaos.lo `test -f 'amigaos.c' || echo '$(srcdir)/'`amigaos.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-amigaos.Tpo $(DEPDIR)/libcurl_la-amigaos.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='amigaos.c' object='libcurl_la-amigaos.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-amigaos.lo `test -f 'amigaos.c' || echo '$(srcdir)/'`amigaos.c libcurl_la-hostasyn.lo: hostasyn.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-hostasyn.lo -MD -MP -MF $(DEPDIR)/libcurl_la-hostasyn.Tpo -c -o libcurl_la-hostasyn.lo `test -f 'hostasyn.c' || echo '$(srcdir)/'`hostasyn.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-hostasyn.Tpo $(DEPDIR)/libcurl_la-hostasyn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hostasyn.c' object='libcurl_la-hostasyn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-hostasyn.lo `test -f 'hostasyn.c' || echo '$(srcdir)/'`hostasyn.c libcurl_la-hostip4.lo: hostip4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-hostip4.lo -MD -MP -MF $(DEPDIR)/libcurl_la-hostip4.Tpo -c -o libcurl_la-hostip4.lo `test -f 'hostip4.c' || echo '$(srcdir)/'`hostip4.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-hostip4.Tpo $(DEPDIR)/libcurl_la-hostip4.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hostip4.c' object='libcurl_la-hostip4.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-hostip4.lo `test -f 'hostip4.c' || echo '$(srcdir)/'`hostip4.c libcurl_la-hostip6.lo: hostip6.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-hostip6.lo -MD -MP -MF $(DEPDIR)/libcurl_la-hostip6.Tpo -c -o libcurl_la-hostip6.lo `test -f 'hostip6.c' || echo '$(srcdir)/'`hostip6.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-hostip6.Tpo $(DEPDIR)/libcurl_la-hostip6.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hostip6.c' object='libcurl_la-hostip6.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-hostip6.lo `test -f 'hostip6.c' || echo '$(srcdir)/'`hostip6.c libcurl_la-hostsyn.lo: hostsyn.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-hostsyn.lo -MD -MP -MF $(DEPDIR)/libcurl_la-hostsyn.Tpo -c -o libcurl_la-hostsyn.lo `test -f 'hostsyn.c' || echo '$(srcdir)/'`hostsyn.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-hostsyn.Tpo $(DEPDIR)/libcurl_la-hostsyn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hostsyn.c' object='libcurl_la-hostsyn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-hostsyn.lo `test -f 'hostsyn.c' || echo '$(srcdir)/'`hostsyn.c libcurl_la-inet_ntop.lo: inet_ntop.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-inet_ntop.lo -MD -MP -MF $(DEPDIR)/libcurl_la-inet_ntop.Tpo -c -o libcurl_la-inet_ntop.lo `test -f 'inet_ntop.c' || echo '$(srcdir)/'`inet_ntop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-inet_ntop.Tpo $(DEPDIR)/libcurl_la-inet_ntop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inet_ntop.c' object='libcurl_la-inet_ntop.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-inet_ntop.lo `test -f 'inet_ntop.c' || echo '$(srcdir)/'`inet_ntop.c libcurl_la-parsedate.lo: parsedate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-parsedate.lo -MD -MP -MF $(DEPDIR)/libcurl_la-parsedate.Tpo -c -o libcurl_la-parsedate.lo `test -f 'parsedate.c' || echo '$(srcdir)/'`parsedate.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-parsedate.Tpo $(DEPDIR)/libcurl_la-parsedate.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parsedate.c' object='libcurl_la-parsedate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-parsedate.lo `test -f 'parsedate.c' || echo '$(srcdir)/'`parsedate.c libcurl_la-select.lo: select.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-select.lo -MD -MP -MF $(DEPDIR)/libcurl_la-select.Tpo -c -o libcurl_la-select.lo `test -f 'select.c' || echo '$(srcdir)/'`select.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-select.Tpo $(DEPDIR)/libcurl_la-select.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='select.c' object='libcurl_la-select.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-select.lo `test -f 'select.c' || echo '$(srcdir)/'`select.c libcurl_la-tftp.lo: tftp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-tftp.lo -MD -MP -MF $(DEPDIR)/libcurl_la-tftp.Tpo -c -o libcurl_la-tftp.lo `test -f 'tftp.c' || echo '$(srcdir)/'`tftp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-tftp.Tpo $(DEPDIR)/libcurl_la-tftp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tftp.c' object='libcurl_la-tftp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-tftp.lo `test -f 'tftp.c' || echo '$(srcdir)/'`tftp.c libcurl_la-splay.lo: splay.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-splay.lo -MD -MP -MF $(DEPDIR)/libcurl_la-splay.Tpo -c -o libcurl_la-splay.lo `test -f 'splay.c' || echo '$(srcdir)/'`splay.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-splay.Tpo $(DEPDIR)/libcurl_la-splay.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='splay.c' object='libcurl_la-splay.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-splay.lo `test -f 'splay.c' || echo '$(srcdir)/'`splay.c libcurl_la-strdup.lo: strdup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-strdup.lo -MD -MP -MF $(DEPDIR)/libcurl_la-strdup.Tpo -c -o libcurl_la-strdup.lo `test -f 'strdup.c' || echo '$(srcdir)/'`strdup.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-strdup.Tpo $(DEPDIR)/libcurl_la-strdup.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strdup.c' object='libcurl_la-strdup.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-strdup.lo `test -f 'strdup.c' || echo '$(srcdir)/'`strdup.c libcurl_la-socks.lo: socks.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-socks.lo -MD -MP -MF $(DEPDIR)/libcurl_la-socks.Tpo -c -o libcurl_la-socks.lo `test -f 'socks.c' || echo '$(srcdir)/'`socks.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-socks.Tpo $(DEPDIR)/libcurl_la-socks.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='socks.c' object='libcurl_la-socks.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-socks.lo `test -f 'socks.c' || echo '$(srcdir)/'`socks.c libcurl_la-ssh.lo: ssh.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-ssh.lo -MD -MP -MF $(DEPDIR)/libcurl_la-ssh.Tpo -c -o libcurl_la-ssh.lo `test -f 'ssh.c' || echo '$(srcdir)/'`ssh.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-ssh.Tpo $(DEPDIR)/libcurl_la-ssh.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ssh.c' object='libcurl_la-ssh.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-ssh.lo `test -f 'ssh.c' || echo '$(srcdir)/'`ssh.c libcurl_la-rawstr.lo: rawstr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-rawstr.lo -MD -MP -MF $(DEPDIR)/libcurl_la-rawstr.Tpo -c -o libcurl_la-rawstr.lo `test -f 'rawstr.c' || echo '$(srcdir)/'`rawstr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-rawstr.Tpo $(DEPDIR)/libcurl_la-rawstr.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rawstr.c' object='libcurl_la-rawstr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-rawstr.lo `test -f 'rawstr.c' || echo '$(srcdir)/'`rawstr.c libcurl_la-curl_addrinfo.lo: curl_addrinfo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-curl_addrinfo.lo -MD -MP -MF $(DEPDIR)/libcurl_la-curl_addrinfo.Tpo -c -o libcurl_la-curl_addrinfo.lo `test -f 'curl_addrinfo.c' || echo '$(srcdir)/'`curl_addrinfo.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-curl_addrinfo.Tpo $(DEPDIR)/libcurl_la-curl_addrinfo.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_addrinfo.c' object='libcurl_la-curl_addrinfo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-curl_addrinfo.lo `test -f 'curl_addrinfo.c' || echo '$(srcdir)/'`curl_addrinfo.c libcurl_la-socks_gssapi.lo: socks_gssapi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-socks_gssapi.lo -MD -MP -MF $(DEPDIR)/libcurl_la-socks_gssapi.Tpo -c -o libcurl_la-socks_gssapi.lo `test -f 'socks_gssapi.c' || echo '$(srcdir)/'`socks_gssapi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-socks_gssapi.Tpo $(DEPDIR)/libcurl_la-socks_gssapi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='socks_gssapi.c' object='libcurl_la-socks_gssapi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-socks_gssapi.lo `test -f 'socks_gssapi.c' || echo '$(srcdir)/'`socks_gssapi.c libcurl_la-socks_sspi.lo: socks_sspi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-socks_sspi.lo -MD -MP -MF $(DEPDIR)/libcurl_la-socks_sspi.Tpo -c -o libcurl_la-socks_sspi.lo `test -f 'socks_sspi.c' || echo '$(srcdir)/'`socks_sspi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-socks_sspi.Tpo $(DEPDIR)/libcurl_la-socks_sspi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='socks_sspi.c' object='libcurl_la-socks_sspi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-socks_sspi.lo `test -f 'socks_sspi.c' || echo '$(srcdir)/'`socks_sspi.c libcurl_la-curl_sspi.lo: curl_sspi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-curl_sspi.lo -MD -MP -MF $(DEPDIR)/libcurl_la-curl_sspi.Tpo -c -o libcurl_la-curl_sspi.lo `test -f 'curl_sspi.c' || echo '$(srcdir)/'`curl_sspi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-curl_sspi.Tpo $(DEPDIR)/libcurl_la-curl_sspi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_sspi.c' object='libcurl_la-curl_sspi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-curl_sspi.lo `test -f 'curl_sspi.c' || echo '$(srcdir)/'`curl_sspi.c libcurl_la-slist.lo: slist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-slist.lo -MD -MP -MF $(DEPDIR)/libcurl_la-slist.Tpo -c -o libcurl_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-slist.Tpo $(DEPDIR)/libcurl_la-slist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='slist.c' object='libcurl_la-slist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c libcurl_la-nonblock.lo: nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-nonblock.lo -MD -MP -MF $(DEPDIR)/libcurl_la-nonblock.Tpo -c -o libcurl_la-nonblock.lo `test -f 'nonblock.c' || echo '$(srcdir)/'`nonblock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-nonblock.Tpo $(DEPDIR)/libcurl_la-nonblock.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nonblock.c' object='libcurl_la-nonblock.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-nonblock.lo `test -f 'nonblock.c' || echo '$(srcdir)/'`nonblock.c libcurl_la-curl_memrchr.lo: curl_memrchr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-curl_memrchr.lo -MD -MP -MF $(DEPDIR)/libcurl_la-curl_memrchr.Tpo -c -o libcurl_la-curl_memrchr.lo `test -f 'curl_memrchr.c' || echo '$(srcdir)/'`curl_memrchr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-curl_memrchr.Tpo $(DEPDIR)/libcurl_la-curl_memrchr.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_memrchr.c' object='libcurl_la-curl_memrchr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-curl_memrchr.lo `test -f 'curl_memrchr.c' || echo '$(srcdir)/'`curl_memrchr.c libcurl_la-imap.lo: imap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-imap.lo -MD -MP -MF $(DEPDIR)/libcurl_la-imap.Tpo -c -o libcurl_la-imap.lo `test -f 'imap.c' || echo '$(srcdir)/'`imap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-imap.Tpo $(DEPDIR)/libcurl_la-imap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imap.c' object='libcurl_la-imap.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-imap.lo `test -f 'imap.c' || echo '$(srcdir)/'`imap.c libcurl_la-pop3.lo: pop3.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-pop3.lo -MD -MP -MF $(DEPDIR)/libcurl_la-pop3.Tpo -c -o libcurl_la-pop3.lo `test -f 'pop3.c' || echo '$(srcdir)/'`pop3.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-pop3.Tpo $(DEPDIR)/libcurl_la-pop3.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pop3.c' object='libcurl_la-pop3.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-pop3.lo `test -f 'pop3.c' || echo '$(srcdir)/'`pop3.c libcurl_la-smtp.lo: smtp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-smtp.lo -MD -MP -MF $(DEPDIR)/libcurl_la-smtp.Tpo -c -o libcurl_la-smtp.lo `test -f 'smtp.c' || echo '$(srcdir)/'`smtp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-smtp.Tpo $(DEPDIR)/libcurl_la-smtp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='smtp.c' object='libcurl_la-smtp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-smtp.lo `test -f 'smtp.c' || echo '$(srcdir)/'`smtp.c libcurl_la-pingpong.lo: pingpong.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-pingpong.lo -MD -MP -MF $(DEPDIR)/libcurl_la-pingpong.Tpo -c -o libcurl_la-pingpong.lo `test -f 'pingpong.c' || echo '$(srcdir)/'`pingpong.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-pingpong.Tpo $(DEPDIR)/libcurl_la-pingpong.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pingpong.c' object='libcurl_la-pingpong.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-pingpong.lo `test -f 'pingpong.c' || echo '$(srcdir)/'`pingpong.c libcurl_la-rtsp.lo: rtsp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-rtsp.lo -MD -MP -MF $(DEPDIR)/libcurl_la-rtsp.Tpo -c -o libcurl_la-rtsp.lo `test -f 'rtsp.c' || echo '$(srcdir)/'`rtsp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-rtsp.Tpo $(DEPDIR)/libcurl_la-rtsp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp.c' object='libcurl_la-rtsp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-rtsp.lo `test -f 'rtsp.c' || echo '$(srcdir)/'`rtsp.c libcurl_la-curl_threads.lo: curl_threads.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-curl_threads.lo -MD -MP -MF $(DEPDIR)/libcurl_la-curl_threads.Tpo -c -o libcurl_la-curl_threads.lo `test -f 'curl_threads.c' || echo '$(srcdir)/'`curl_threads.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-curl_threads.Tpo $(DEPDIR)/libcurl_la-curl_threads.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_threads.c' object='libcurl_la-curl_threads.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-curl_threads.lo `test -f 'curl_threads.c' || echo '$(srcdir)/'`curl_threads.c libcurl_la-warnless.lo: warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-warnless.lo -MD -MP -MF $(DEPDIR)/libcurl_la-warnless.Tpo -c -o libcurl_la-warnless.lo `test -f 'warnless.c' || echo '$(srcdir)/'`warnless.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-warnless.Tpo $(DEPDIR)/libcurl_la-warnless.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='warnless.c' object='libcurl_la-warnless.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-warnless.lo `test -f 'warnless.c' || echo '$(srcdir)/'`warnless.c libcurl_la-hmac.lo: hmac.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-hmac.lo -MD -MP -MF $(DEPDIR)/libcurl_la-hmac.Tpo -c -o libcurl_la-hmac.lo `test -f 'hmac.c' || echo '$(srcdir)/'`hmac.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-hmac.Tpo $(DEPDIR)/libcurl_la-hmac.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hmac.c' object='libcurl_la-hmac.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-hmac.lo `test -f 'hmac.c' || echo '$(srcdir)/'`hmac.c libcurl_la-curl_rtmp.lo: curl_rtmp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-curl_rtmp.lo -MD -MP -MF $(DEPDIR)/libcurl_la-curl_rtmp.Tpo -c -o libcurl_la-curl_rtmp.lo `test -f 'curl_rtmp.c' || echo '$(srcdir)/'`curl_rtmp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-curl_rtmp.Tpo $(DEPDIR)/libcurl_la-curl_rtmp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_rtmp.c' object='libcurl_la-curl_rtmp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-curl_rtmp.lo `test -f 'curl_rtmp.c' || echo '$(srcdir)/'`curl_rtmp.c libcurl_la-openldap.lo: openldap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-openldap.lo -MD -MP -MF $(DEPDIR)/libcurl_la-openldap.Tpo -c -o libcurl_la-openldap.lo `test -f 'openldap.c' || echo '$(srcdir)/'`openldap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-openldap.Tpo $(DEPDIR)/libcurl_la-openldap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openldap.c' object='libcurl_la-openldap.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-openldap.lo `test -f 'openldap.c' || echo '$(srcdir)/'`openldap.c libcurl_la-curl_gethostname.lo: curl_gethostname.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-curl_gethostname.lo -MD -MP -MF $(DEPDIR)/libcurl_la-curl_gethostname.Tpo -c -o libcurl_la-curl_gethostname.lo `test -f 'curl_gethostname.c' || echo '$(srcdir)/'`curl_gethostname.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-curl_gethostname.Tpo $(DEPDIR)/libcurl_la-curl_gethostname.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_gethostname.c' object='libcurl_la-curl_gethostname.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-curl_gethostname.lo `test -f 'curl_gethostname.c' || echo '$(srcdir)/'`curl_gethostname.c libcurl_la-gopher.lo: gopher.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-gopher.lo -MD -MP -MF $(DEPDIR)/libcurl_la-gopher.Tpo -c -o libcurl_la-gopher.lo `test -f 'gopher.c' || echo '$(srcdir)/'`gopher.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-gopher.Tpo $(DEPDIR)/libcurl_la-gopher.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gopher.c' object='libcurl_la-gopher.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-gopher.lo `test -f 'gopher.c' || echo '$(srcdir)/'`gopher.c libcurl_la-idn_win32.lo: idn_win32.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-idn_win32.lo -MD -MP -MF $(DEPDIR)/libcurl_la-idn_win32.Tpo -c -o libcurl_la-idn_win32.lo `test -f 'idn_win32.c' || echo '$(srcdir)/'`idn_win32.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-idn_win32.Tpo $(DEPDIR)/libcurl_la-idn_win32.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='idn_win32.c' object='libcurl_la-idn_win32.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-idn_win32.lo `test -f 'idn_win32.c' || echo '$(srcdir)/'`idn_win32.c libcurl_la-http_negotiate_sspi.lo: http_negotiate_sspi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-http_negotiate_sspi.lo -MD -MP -MF $(DEPDIR)/libcurl_la-http_negotiate_sspi.Tpo -c -o libcurl_la-http_negotiate_sspi.lo `test -f 'http_negotiate_sspi.c' || echo '$(srcdir)/'`http_negotiate_sspi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-http_negotiate_sspi.Tpo $(DEPDIR)/libcurl_la-http_negotiate_sspi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http_negotiate_sspi.c' object='libcurl_la-http_negotiate_sspi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-http_negotiate_sspi.lo `test -f 'http_negotiate_sspi.c' || echo '$(srcdir)/'`http_negotiate_sspi.c libcurl_la-http_proxy.lo: http_proxy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-http_proxy.lo -MD -MP -MF $(DEPDIR)/libcurl_la-http_proxy.Tpo -c -o libcurl_la-http_proxy.lo `test -f 'http_proxy.c' || echo '$(srcdir)/'`http_proxy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-http_proxy.Tpo $(DEPDIR)/libcurl_la-http_proxy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http_proxy.c' object='libcurl_la-http_proxy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-http_proxy.lo `test -f 'http_proxy.c' || echo '$(srcdir)/'`http_proxy.c libcurl_la-non-ascii.lo: non-ascii.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-non-ascii.lo -MD -MP -MF $(DEPDIR)/libcurl_la-non-ascii.Tpo -c -o libcurl_la-non-ascii.lo `test -f 'non-ascii.c' || echo '$(srcdir)/'`non-ascii.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-non-ascii.Tpo $(DEPDIR)/libcurl_la-non-ascii.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='non-ascii.c' object='libcurl_la-non-ascii.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-non-ascii.lo `test -f 'non-ascii.c' || echo '$(srcdir)/'`non-ascii.c libcurl_la-asyn-ares.lo: asyn-ares.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-asyn-ares.lo -MD -MP -MF $(DEPDIR)/libcurl_la-asyn-ares.Tpo -c -o libcurl_la-asyn-ares.lo `test -f 'asyn-ares.c' || echo '$(srcdir)/'`asyn-ares.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-asyn-ares.Tpo $(DEPDIR)/libcurl_la-asyn-ares.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='asyn-ares.c' object='libcurl_la-asyn-ares.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-asyn-ares.lo `test -f 'asyn-ares.c' || echo '$(srcdir)/'`asyn-ares.c libcurl_la-asyn-thread.lo: asyn-thread.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-asyn-thread.lo -MD -MP -MF $(DEPDIR)/libcurl_la-asyn-thread.Tpo -c -o libcurl_la-asyn-thread.lo `test -f 'asyn-thread.c' || echo '$(srcdir)/'`asyn-thread.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-asyn-thread.Tpo $(DEPDIR)/libcurl_la-asyn-thread.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='asyn-thread.c' object='libcurl_la-asyn-thread.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-asyn-thread.lo `test -f 'asyn-thread.c' || echo '$(srcdir)/'`asyn-thread.c libcurl_la-curl_gssapi.lo: curl_gssapi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-curl_gssapi.lo -MD -MP -MF $(DEPDIR)/libcurl_la-curl_gssapi.Tpo -c -o libcurl_la-curl_gssapi.lo `test -f 'curl_gssapi.c' || echo '$(srcdir)/'`curl_gssapi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-curl_gssapi.Tpo $(DEPDIR)/libcurl_la-curl_gssapi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_gssapi.c' object='libcurl_la-curl_gssapi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-curl_gssapi.lo `test -f 'curl_gssapi.c' || echo '$(srcdir)/'`curl_gssapi.c libcurl_la-curl_ntlm.lo: curl_ntlm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-curl_ntlm.lo -MD -MP -MF $(DEPDIR)/libcurl_la-curl_ntlm.Tpo -c -o libcurl_la-curl_ntlm.lo `test -f 'curl_ntlm.c' || echo '$(srcdir)/'`curl_ntlm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-curl_ntlm.Tpo $(DEPDIR)/libcurl_la-curl_ntlm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_ntlm.c' object='libcurl_la-curl_ntlm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-curl_ntlm.lo `test -f 'curl_ntlm.c' || echo '$(srcdir)/'`curl_ntlm.c libcurl_la-curl_ntlm_wb.lo: curl_ntlm_wb.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-curl_ntlm_wb.lo -MD -MP -MF $(DEPDIR)/libcurl_la-curl_ntlm_wb.Tpo -c -o libcurl_la-curl_ntlm_wb.lo `test -f 'curl_ntlm_wb.c' || echo '$(srcdir)/'`curl_ntlm_wb.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-curl_ntlm_wb.Tpo $(DEPDIR)/libcurl_la-curl_ntlm_wb.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_ntlm_wb.c' object='libcurl_la-curl_ntlm_wb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-curl_ntlm_wb.lo `test -f 'curl_ntlm_wb.c' || echo '$(srcdir)/'`curl_ntlm_wb.c libcurl_la-curl_ntlm_core.lo: curl_ntlm_core.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-curl_ntlm_core.lo -MD -MP -MF $(DEPDIR)/libcurl_la-curl_ntlm_core.Tpo -c -o libcurl_la-curl_ntlm_core.lo `test -f 'curl_ntlm_core.c' || echo '$(srcdir)/'`curl_ntlm_core.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-curl_ntlm_core.Tpo $(DEPDIR)/libcurl_la-curl_ntlm_core.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_ntlm_core.c' object='libcurl_la-curl_ntlm_core.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-curl_ntlm_core.lo `test -f 'curl_ntlm_core.c' || echo '$(srcdir)/'`curl_ntlm_core.c libcurl_la-curl_ntlm_msgs.lo: curl_ntlm_msgs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-curl_ntlm_msgs.lo -MD -MP -MF $(DEPDIR)/libcurl_la-curl_ntlm_msgs.Tpo -c -o libcurl_la-curl_ntlm_msgs.lo `test -f 'curl_ntlm_msgs.c' || echo '$(srcdir)/'`curl_ntlm_msgs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-curl_ntlm_msgs.Tpo $(DEPDIR)/libcurl_la-curl_ntlm_msgs.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_ntlm_msgs.c' object='libcurl_la-curl_ntlm_msgs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-curl_ntlm_msgs.lo `test -f 'curl_ntlm_msgs.c' || echo '$(srcdir)/'`curl_ntlm_msgs.c libcurl_la-curl_sasl.lo: curl_sasl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-curl_sasl.lo -MD -MP -MF $(DEPDIR)/libcurl_la-curl_sasl.Tpo -c -o libcurl_la-curl_sasl.lo `test -f 'curl_sasl.c' || echo '$(srcdir)/'`curl_sasl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-curl_sasl.Tpo $(DEPDIR)/libcurl_la-curl_sasl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_sasl.c' object='libcurl_la-curl_sasl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-curl_sasl.lo `test -f 'curl_sasl.c' || echo '$(srcdir)/'`curl_sasl.c libcurl_la-curl_multibyte.lo: curl_multibyte.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-curl_multibyte.lo -MD -MP -MF $(DEPDIR)/libcurl_la-curl_multibyte.Tpo -c -o libcurl_la-curl_multibyte.lo `test -f 'curl_multibyte.c' || echo '$(srcdir)/'`curl_multibyte.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-curl_multibyte.Tpo $(DEPDIR)/libcurl_la-curl_multibyte.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_multibyte.c' object='libcurl_la-curl_multibyte.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-curl_multibyte.lo `test -f 'curl_multibyte.c' || echo '$(srcdir)/'`curl_multibyte.c libcurl_la-hostcheck.lo: hostcheck.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-hostcheck.lo -MD -MP -MF $(DEPDIR)/libcurl_la-hostcheck.Tpo -c -o libcurl_la-hostcheck.lo `test -f 'hostcheck.c' || echo '$(srcdir)/'`hostcheck.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-hostcheck.Tpo $(DEPDIR)/libcurl_la-hostcheck.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hostcheck.c' object='libcurl_la-hostcheck.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-hostcheck.lo `test -f 'hostcheck.c' || echo '$(srcdir)/'`hostcheck.c libcurl_la-bundles.lo: bundles.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-bundles.lo -MD -MP -MF $(DEPDIR)/libcurl_la-bundles.Tpo -c -o libcurl_la-bundles.lo `test -f 'bundles.c' || echo '$(srcdir)/'`bundles.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-bundles.Tpo $(DEPDIR)/libcurl_la-bundles.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bundles.c' object='libcurl_la-bundles.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-bundles.lo `test -f 'bundles.c' || echo '$(srcdir)/'`bundles.c libcurl_la-conncache.lo: conncache.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-conncache.lo -MD -MP -MF $(DEPDIR)/libcurl_la-conncache.Tpo -c -o libcurl_la-conncache.lo `test -f 'conncache.c' || echo '$(srcdir)/'`conncache.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-conncache.Tpo $(DEPDIR)/libcurl_la-conncache.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='conncache.c' object='libcurl_la-conncache.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-conncache.lo `test -f 'conncache.c' || echo '$(srcdir)/'`conncache.c libcurl_la-pipeline.lo: pipeline.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-pipeline.lo -MD -MP -MF $(DEPDIR)/libcurl_la-pipeline.Tpo -c -o libcurl_la-pipeline.lo `test -f 'pipeline.c' || echo '$(srcdir)/'`pipeline.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-pipeline.Tpo $(DEPDIR)/libcurl_la-pipeline.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pipeline.c' object='libcurl_la-pipeline.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-pipeline.lo `test -f 'pipeline.c' || echo '$(srcdir)/'`pipeline.c libcurl_la-dotdot.lo: dotdot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-dotdot.lo -MD -MP -MF $(DEPDIR)/libcurl_la-dotdot.Tpo -c -o libcurl_la-dotdot.lo `test -f 'dotdot.c' || echo '$(srcdir)/'`dotdot.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-dotdot.Tpo $(DEPDIR)/libcurl_la-dotdot.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dotdot.c' object='libcurl_la-dotdot.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-dotdot.lo `test -f 'dotdot.c' || echo '$(srcdir)/'`dotdot.c libcurl_la-x509asn1.lo: x509asn1.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-x509asn1.lo -MD -MP -MF $(DEPDIR)/libcurl_la-x509asn1.Tpo -c -o libcurl_la-x509asn1.lo `test -f 'x509asn1.c' || echo '$(srcdir)/'`x509asn1.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-x509asn1.Tpo $(DEPDIR)/libcurl_la-x509asn1.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='x509asn1.c' object='libcurl_la-x509asn1.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-x509asn1.lo `test -f 'x509asn1.c' || echo '$(srcdir)/'`x509asn1.c libcurl_la-http2.lo: http2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-http2.lo -MD -MP -MF $(DEPDIR)/libcurl_la-http2.Tpo -c -o libcurl_la-http2.lo `test -f 'http2.c' || echo '$(srcdir)/'`http2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-http2.Tpo $(DEPDIR)/libcurl_la-http2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http2.c' object='libcurl_la-http2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-http2.lo `test -f 'http2.c' || echo '$(srcdir)/'`http2.c vtls/libcurl_la-openssl.lo: vtls/openssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT vtls/libcurl_la-openssl.lo -MD -MP -MF vtls/$(DEPDIR)/libcurl_la-openssl.Tpo -c -o vtls/libcurl_la-openssl.lo `test -f 'vtls/openssl.c' || echo '$(srcdir)/'`vtls/openssl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurl_la-openssl.Tpo vtls/$(DEPDIR)/libcurl_la-openssl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/openssl.c' object='vtls/libcurl_la-openssl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurl_la-openssl.lo `test -f 'vtls/openssl.c' || echo '$(srcdir)/'`vtls/openssl.c vtls/libcurl_la-gtls.lo: vtls/gtls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT vtls/libcurl_la-gtls.lo -MD -MP -MF vtls/$(DEPDIR)/libcurl_la-gtls.Tpo -c -o vtls/libcurl_la-gtls.lo `test -f 'vtls/gtls.c' || echo '$(srcdir)/'`vtls/gtls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurl_la-gtls.Tpo vtls/$(DEPDIR)/libcurl_la-gtls.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/gtls.c' object='vtls/libcurl_la-gtls.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurl_la-gtls.lo `test -f 'vtls/gtls.c' || echo '$(srcdir)/'`vtls/gtls.c vtls/libcurl_la-vtls.lo: vtls/vtls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT vtls/libcurl_la-vtls.lo -MD -MP -MF vtls/$(DEPDIR)/libcurl_la-vtls.Tpo -c -o vtls/libcurl_la-vtls.lo `test -f 'vtls/vtls.c' || echo '$(srcdir)/'`vtls/vtls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurl_la-vtls.Tpo vtls/$(DEPDIR)/libcurl_la-vtls.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/vtls.c' object='vtls/libcurl_la-vtls.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurl_la-vtls.lo `test -f 'vtls/vtls.c' || echo '$(srcdir)/'`vtls/vtls.c vtls/libcurl_la-nss.lo: vtls/nss.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT vtls/libcurl_la-nss.lo -MD -MP -MF vtls/$(DEPDIR)/libcurl_la-nss.Tpo -c -o vtls/libcurl_la-nss.lo `test -f 'vtls/nss.c' || echo '$(srcdir)/'`vtls/nss.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurl_la-nss.Tpo vtls/$(DEPDIR)/libcurl_la-nss.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/nss.c' object='vtls/libcurl_la-nss.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurl_la-nss.lo `test -f 'vtls/nss.c' || echo '$(srcdir)/'`vtls/nss.c vtls/libcurl_la-qssl.lo: vtls/qssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT vtls/libcurl_la-qssl.lo -MD -MP -MF vtls/$(DEPDIR)/libcurl_la-qssl.Tpo -c -o vtls/libcurl_la-qssl.lo `test -f 'vtls/qssl.c' || echo '$(srcdir)/'`vtls/qssl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurl_la-qssl.Tpo vtls/$(DEPDIR)/libcurl_la-qssl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/qssl.c' object='vtls/libcurl_la-qssl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurl_la-qssl.lo `test -f 'vtls/qssl.c' || echo '$(srcdir)/'`vtls/qssl.c vtls/libcurl_la-polarssl.lo: vtls/polarssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT vtls/libcurl_la-polarssl.lo -MD -MP -MF vtls/$(DEPDIR)/libcurl_la-polarssl.Tpo -c -o vtls/libcurl_la-polarssl.lo `test -f 'vtls/polarssl.c' || echo '$(srcdir)/'`vtls/polarssl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurl_la-polarssl.Tpo vtls/$(DEPDIR)/libcurl_la-polarssl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/polarssl.c' object='vtls/libcurl_la-polarssl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurl_la-polarssl.lo `test -f 'vtls/polarssl.c' || echo '$(srcdir)/'`vtls/polarssl.c vtls/libcurl_la-polarssl_threadlock.lo: vtls/polarssl_threadlock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT vtls/libcurl_la-polarssl_threadlock.lo -MD -MP -MF vtls/$(DEPDIR)/libcurl_la-polarssl_threadlock.Tpo -c -o vtls/libcurl_la-polarssl_threadlock.lo `test -f 'vtls/polarssl_threadlock.c' || echo '$(srcdir)/'`vtls/polarssl_threadlock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurl_la-polarssl_threadlock.Tpo vtls/$(DEPDIR)/libcurl_la-polarssl_threadlock.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/polarssl_threadlock.c' object='vtls/libcurl_la-polarssl_threadlock.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurl_la-polarssl_threadlock.lo `test -f 'vtls/polarssl_threadlock.c' || echo '$(srcdir)/'`vtls/polarssl_threadlock.c vtls/libcurl_la-axtls.lo: vtls/axtls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT vtls/libcurl_la-axtls.lo -MD -MP -MF vtls/$(DEPDIR)/libcurl_la-axtls.Tpo -c -o vtls/libcurl_la-axtls.lo `test -f 'vtls/axtls.c' || echo '$(srcdir)/'`vtls/axtls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurl_la-axtls.Tpo vtls/$(DEPDIR)/libcurl_la-axtls.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/axtls.c' object='vtls/libcurl_la-axtls.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurl_la-axtls.lo `test -f 'vtls/axtls.c' || echo '$(srcdir)/'`vtls/axtls.c vtls/libcurl_la-cyassl.lo: vtls/cyassl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT vtls/libcurl_la-cyassl.lo -MD -MP -MF vtls/$(DEPDIR)/libcurl_la-cyassl.Tpo -c -o vtls/libcurl_la-cyassl.lo `test -f 'vtls/cyassl.c' || echo '$(srcdir)/'`vtls/cyassl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurl_la-cyassl.Tpo vtls/$(DEPDIR)/libcurl_la-cyassl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/cyassl.c' object='vtls/libcurl_la-cyassl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurl_la-cyassl.lo `test -f 'vtls/cyassl.c' || echo '$(srcdir)/'`vtls/cyassl.c vtls/libcurl_la-curl_schannel.lo: vtls/curl_schannel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT vtls/libcurl_la-curl_schannel.lo -MD -MP -MF vtls/$(DEPDIR)/libcurl_la-curl_schannel.Tpo -c -o vtls/libcurl_la-curl_schannel.lo `test -f 'vtls/curl_schannel.c' || echo '$(srcdir)/'`vtls/curl_schannel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurl_la-curl_schannel.Tpo vtls/$(DEPDIR)/libcurl_la-curl_schannel.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/curl_schannel.c' object='vtls/libcurl_la-curl_schannel.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurl_la-curl_schannel.lo `test -f 'vtls/curl_schannel.c' || echo '$(srcdir)/'`vtls/curl_schannel.c vtls/libcurl_la-curl_darwinssl.lo: vtls/curl_darwinssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT vtls/libcurl_la-curl_darwinssl.lo -MD -MP -MF vtls/$(DEPDIR)/libcurl_la-curl_darwinssl.Tpo -c -o vtls/libcurl_la-curl_darwinssl.lo `test -f 'vtls/curl_darwinssl.c' || echo '$(srcdir)/'`vtls/curl_darwinssl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurl_la-curl_darwinssl.Tpo vtls/$(DEPDIR)/libcurl_la-curl_darwinssl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/curl_darwinssl.c' object='vtls/libcurl_la-curl_darwinssl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurl_la-curl_darwinssl.lo `test -f 'vtls/curl_darwinssl.c' || echo '$(srcdir)/'`vtls/curl_darwinssl.c vtls/libcurl_la-gskit.lo: vtls/gskit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT vtls/libcurl_la-gskit.lo -MD -MP -MF vtls/$(DEPDIR)/libcurl_la-gskit.Tpo -c -o vtls/libcurl_la-gskit.lo `test -f 'vtls/gskit.c' || echo '$(srcdir)/'`vtls/gskit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurl_la-gskit.Tpo vtls/$(DEPDIR)/libcurl_la-gskit.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/gskit.c' object='vtls/libcurl_la-gskit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurl_la-gskit.lo `test -f 'vtls/gskit.c' || echo '$(srcdir)/'`vtls/gskit.c libcurlu_la-file.lo: file.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-file.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-file.Tpo -c -o libcurlu_la-file.lo `test -f 'file.c' || echo '$(srcdir)/'`file.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-file.Tpo $(DEPDIR)/libcurlu_la-file.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file.c' object='libcurlu_la-file.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-file.lo `test -f 'file.c' || echo '$(srcdir)/'`file.c libcurlu_la-timeval.lo: timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-timeval.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-timeval.Tpo -c -o libcurlu_la-timeval.lo `test -f 'timeval.c' || echo '$(srcdir)/'`timeval.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-timeval.Tpo $(DEPDIR)/libcurlu_la-timeval.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='timeval.c' object='libcurlu_la-timeval.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-timeval.lo `test -f 'timeval.c' || echo '$(srcdir)/'`timeval.c libcurlu_la-base64.lo: base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-base64.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-base64.Tpo -c -o libcurlu_la-base64.lo `test -f 'base64.c' || echo '$(srcdir)/'`base64.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-base64.Tpo $(DEPDIR)/libcurlu_la-base64.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='base64.c' object='libcurlu_la-base64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-base64.lo `test -f 'base64.c' || echo '$(srcdir)/'`base64.c libcurlu_la-hostip.lo: hostip.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-hostip.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-hostip.Tpo -c -o libcurlu_la-hostip.lo `test -f 'hostip.c' || echo '$(srcdir)/'`hostip.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-hostip.Tpo $(DEPDIR)/libcurlu_la-hostip.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hostip.c' object='libcurlu_la-hostip.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-hostip.lo `test -f 'hostip.c' || echo '$(srcdir)/'`hostip.c libcurlu_la-progress.lo: progress.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-progress.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-progress.Tpo -c -o libcurlu_la-progress.lo `test -f 'progress.c' || echo '$(srcdir)/'`progress.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-progress.Tpo $(DEPDIR)/libcurlu_la-progress.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='progress.c' object='libcurlu_la-progress.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-progress.lo `test -f 'progress.c' || echo '$(srcdir)/'`progress.c libcurlu_la-formdata.lo: formdata.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-formdata.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-formdata.Tpo -c -o libcurlu_la-formdata.lo `test -f 'formdata.c' || echo '$(srcdir)/'`formdata.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-formdata.Tpo $(DEPDIR)/libcurlu_la-formdata.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='formdata.c' object='libcurlu_la-formdata.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-formdata.lo `test -f 'formdata.c' || echo '$(srcdir)/'`formdata.c libcurlu_la-cookie.lo: cookie.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-cookie.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-cookie.Tpo -c -o libcurlu_la-cookie.lo `test -f 'cookie.c' || echo '$(srcdir)/'`cookie.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-cookie.Tpo $(DEPDIR)/libcurlu_la-cookie.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cookie.c' object='libcurlu_la-cookie.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-cookie.lo `test -f 'cookie.c' || echo '$(srcdir)/'`cookie.c libcurlu_la-http.lo: http.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-http.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-http.Tpo -c -o libcurlu_la-http.lo `test -f 'http.c' || echo '$(srcdir)/'`http.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-http.Tpo $(DEPDIR)/libcurlu_la-http.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http.c' object='libcurlu_la-http.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-http.lo `test -f 'http.c' || echo '$(srcdir)/'`http.c libcurlu_la-sendf.lo: sendf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-sendf.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-sendf.Tpo -c -o libcurlu_la-sendf.lo `test -f 'sendf.c' || echo '$(srcdir)/'`sendf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-sendf.Tpo $(DEPDIR)/libcurlu_la-sendf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sendf.c' object='libcurlu_la-sendf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-sendf.lo `test -f 'sendf.c' || echo '$(srcdir)/'`sendf.c libcurlu_la-ftp.lo: ftp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-ftp.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-ftp.Tpo -c -o libcurlu_la-ftp.lo `test -f 'ftp.c' || echo '$(srcdir)/'`ftp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-ftp.Tpo $(DEPDIR)/libcurlu_la-ftp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftp.c' object='libcurlu_la-ftp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-ftp.lo `test -f 'ftp.c' || echo '$(srcdir)/'`ftp.c libcurlu_la-url.lo: url.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-url.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-url.Tpo -c -o libcurlu_la-url.lo `test -f 'url.c' || echo '$(srcdir)/'`url.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-url.Tpo $(DEPDIR)/libcurlu_la-url.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='url.c' object='libcurlu_la-url.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-url.lo `test -f 'url.c' || echo '$(srcdir)/'`url.c libcurlu_la-dict.lo: dict.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-dict.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-dict.Tpo -c -o libcurlu_la-dict.lo `test -f 'dict.c' || echo '$(srcdir)/'`dict.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-dict.Tpo $(DEPDIR)/libcurlu_la-dict.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dict.c' object='libcurlu_la-dict.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-dict.lo `test -f 'dict.c' || echo '$(srcdir)/'`dict.c libcurlu_la-if2ip.lo: if2ip.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-if2ip.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-if2ip.Tpo -c -o libcurlu_la-if2ip.lo `test -f 'if2ip.c' || echo '$(srcdir)/'`if2ip.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-if2ip.Tpo $(DEPDIR)/libcurlu_la-if2ip.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='if2ip.c' object='libcurlu_la-if2ip.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-if2ip.lo `test -f 'if2ip.c' || echo '$(srcdir)/'`if2ip.c libcurlu_la-speedcheck.lo: speedcheck.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-speedcheck.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-speedcheck.Tpo -c -o libcurlu_la-speedcheck.lo `test -f 'speedcheck.c' || echo '$(srcdir)/'`speedcheck.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-speedcheck.Tpo $(DEPDIR)/libcurlu_la-speedcheck.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='speedcheck.c' object='libcurlu_la-speedcheck.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-speedcheck.lo `test -f 'speedcheck.c' || echo '$(srcdir)/'`speedcheck.c libcurlu_la-ldap.lo: ldap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-ldap.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-ldap.Tpo -c -o libcurlu_la-ldap.lo `test -f 'ldap.c' || echo '$(srcdir)/'`ldap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-ldap.Tpo $(DEPDIR)/libcurlu_la-ldap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ldap.c' object='libcurlu_la-ldap.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-ldap.lo `test -f 'ldap.c' || echo '$(srcdir)/'`ldap.c libcurlu_la-version.lo: version.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-version.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-version.Tpo -c -o libcurlu_la-version.lo `test -f 'version.c' || echo '$(srcdir)/'`version.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-version.Tpo $(DEPDIR)/libcurlu_la-version.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='version.c' object='libcurlu_la-version.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-version.lo `test -f 'version.c' || echo '$(srcdir)/'`version.c libcurlu_la-getenv.lo: getenv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-getenv.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-getenv.Tpo -c -o libcurlu_la-getenv.lo `test -f 'getenv.c' || echo '$(srcdir)/'`getenv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-getenv.Tpo $(DEPDIR)/libcurlu_la-getenv.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getenv.c' object='libcurlu_la-getenv.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-getenv.lo `test -f 'getenv.c' || echo '$(srcdir)/'`getenv.c libcurlu_la-escape.lo: escape.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-escape.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-escape.Tpo -c -o libcurlu_la-escape.lo `test -f 'escape.c' || echo '$(srcdir)/'`escape.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-escape.Tpo $(DEPDIR)/libcurlu_la-escape.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='escape.c' object='libcurlu_la-escape.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-escape.lo `test -f 'escape.c' || echo '$(srcdir)/'`escape.c libcurlu_la-mprintf.lo: mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-mprintf.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-mprintf.Tpo -c -o libcurlu_la-mprintf.lo `test -f 'mprintf.c' || echo '$(srcdir)/'`mprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-mprintf.Tpo $(DEPDIR)/libcurlu_la-mprintf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mprintf.c' object='libcurlu_la-mprintf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-mprintf.lo `test -f 'mprintf.c' || echo '$(srcdir)/'`mprintf.c libcurlu_la-telnet.lo: telnet.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-telnet.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-telnet.Tpo -c -o libcurlu_la-telnet.lo `test -f 'telnet.c' || echo '$(srcdir)/'`telnet.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-telnet.Tpo $(DEPDIR)/libcurlu_la-telnet.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='telnet.c' object='libcurlu_la-telnet.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-telnet.lo `test -f 'telnet.c' || echo '$(srcdir)/'`telnet.c libcurlu_la-netrc.lo: netrc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-netrc.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-netrc.Tpo -c -o libcurlu_la-netrc.lo `test -f 'netrc.c' || echo '$(srcdir)/'`netrc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-netrc.Tpo $(DEPDIR)/libcurlu_la-netrc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netrc.c' object='libcurlu_la-netrc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-netrc.lo `test -f 'netrc.c' || echo '$(srcdir)/'`netrc.c libcurlu_la-getinfo.lo: getinfo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-getinfo.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-getinfo.Tpo -c -o libcurlu_la-getinfo.lo `test -f 'getinfo.c' || echo '$(srcdir)/'`getinfo.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-getinfo.Tpo $(DEPDIR)/libcurlu_la-getinfo.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getinfo.c' object='libcurlu_la-getinfo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-getinfo.lo `test -f 'getinfo.c' || echo '$(srcdir)/'`getinfo.c libcurlu_la-transfer.lo: transfer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-transfer.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-transfer.Tpo -c -o libcurlu_la-transfer.lo `test -f 'transfer.c' || echo '$(srcdir)/'`transfer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-transfer.Tpo $(DEPDIR)/libcurlu_la-transfer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='transfer.c' object='libcurlu_la-transfer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-transfer.lo `test -f 'transfer.c' || echo '$(srcdir)/'`transfer.c libcurlu_la-strequal.lo: strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-strequal.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-strequal.Tpo -c -o libcurlu_la-strequal.lo `test -f 'strequal.c' || echo '$(srcdir)/'`strequal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-strequal.Tpo $(DEPDIR)/libcurlu_la-strequal.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strequal.c' object='libcurlu_la-strequal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-strequal.lo `test -f 'strequal.c' || echo '$(srcdir)/'`strequal.c libcurlu_la-easy.lo: easy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-easy.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-easy.Tpo -c -o libcurlu_la-easy.lo `test -f 'easy.c' || echo '$(srcdir)/'`easy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-easy.Tpo $(DEPDIR)/libcurlu_la-easy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='easy.c' object='libcurlu_la-easy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-easy.lo `test -f 'easy.c' || echo '$(srcdir)/'`easy.c libcurlu_la-security.lo: security.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-security.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-security.Tpo -c -o libcurlu_la-security.lo `test -f 'security.c' || echo '$(srcdir)/'`security.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-security.Tpo $(DEPDIR)/libcurlu_la-security.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='security.c' object='libcurlu_la-security.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-security.lo `test -f 'security.c' || echo '$(srcdir)/'`security.c libcurlu_la-curl_fnmatch.lo: curl_fnmatch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-curl_fnmatch.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-curl_fnmatch.Tpo -c -o libcurlu_la-curl_fnmatch.lo `test -f 'curl_fnmatch.c' || echo '$(srcdir)/'`curl_fnmatch.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-curl_fnmatch.Tpo $(DEPDIR)/libcurlu_la-curl_fnmatch.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_fnmatch.c' object='libcurlu_la-curl_fnmatch.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-curl_fnmatch.lo `test -f 'curl_fnmatch.c' || echo '$(srcdir)/'`curl_fnmatch.c libcurlu_la-fileinfo.lo: fileinfo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-fileinfo.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-fileinfo.Tpo -c -o libcurlu_la-fileinfo.lo `test -f 'fileinfo.c' || echo '$(srcdir)/'`fileinfo.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-fileinfo.Tpo $(DEPDIR)/libcurlu_la-fileinfo.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fileinfo.c' object='libcurlu_la-fileinfo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-fileinfo.lo `test -f 'fileinfo.c' || echo '$(srcdir)/'`fileinfo.c libcurlu_la-ftplistparser.lo: ftplistparser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-ftplistparser.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-ftplistparser.Tpo -c -o libcurlu_la-ftplistparser.lo `test -f 'ftplistparser.c' || echo '$(srcdir)/'`ftplistparser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-ftplistparser.Tpo $(DEPDIR)/libcurlu_la-ftplistparser.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftplistparser.c' object='libcurlu_la-ftplistparser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-ftplistparser.lo `test -f 'ftplistparser.c' || echo '$(srcdir)/'`ftplistparser.c libcurlu_la-wildcard.lo: wildcard.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-wildcard.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-wildcard.Tpo -c -o libcurlu_la-wildcard.lo `test -f 'wildcard.c' || echo '$(srcdir)/'`wildcard.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-wildcard.Tpo $(DEPDIR)/libcurlu_la-wildcard.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wildcard.c' object='libcurlu_la-wildcard.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-wildcard.lo `test -f 'wildcard.c' || echo '$(srcdir)/'`wildcard.c libcurlu_la-krb5.lo: krb5.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-krb5.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-krb5.Tpo -c -o libcurlu_la-krb5.lo `test -f 'krb5.c' || echo '$(srcdir)/'`krb5.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-krb5.Tpo $(DEPDIR)/libcurlu_la-krb5.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='krb5.c' object='libcurlu_la-krb5.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-krb5.lo `test -f 'krb5.c' || echo '$(srcdir)/'`krb5.c libcurlu_la-memdebug.lo: memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-memdebug.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-memdebug.Tpo -c -o libcurlu_la-memdebug.lo `test -f 'memdebug.c' || echo '$(srcdir)/'`memdebug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-memdebug.Tpo $(DEPDIR)/libcurlu_la-memdebug.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='memdebug.c' object='libcurlu_la-memdebug.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-memdebug.lo `test -f 'memdebug.c' || echo '$(srcdir)/'`memdebug.c libcurlu_la-http_chunks.lo: http_chunks.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-http_chunks.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-http_chunks.Tpo -c -o libcurlu_la-http_chunks.lo `test -f 'http_chunks.c' || echo '$(srcdir)/'`http_chunks.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-http_chunks.Tpo $(DEPDIR)/libcurlu_la-http_chunks.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http_chunks.c' object='libcurlu_la-http_chunks.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-http_chunks.lo `test -f 'http_chunks.c' || echo '$(srcdir)/'`http_chunks.c libcurlu_la-strtok.lo: strtok.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-strtok.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-strtok.Tpo -c -o libcurlu_la-strtok.lo `test -f 'strtok.c' || echo '$(srcdir)/'`strtok.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-strtok.Tpo $(DEPDIR)/libcurlu_la-strtok.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strtok.c' object='libcurlu_la-strtok.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-strtok.lo `test -f 'strtok.c' || echo '$(srcdir)/'`strtok.c libcurlu_la-connect.lo: connect.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-connect.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-connect.Tpo -c -o libcurlu_la-connect.lo `test -f 'connect.c' || echo '$(srcdir)/'`connect.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-connect.Tpo $(DEPDIR)/libcurlu_la-connect.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='connect.c' object='libcurlu_la-connect.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-connect.lo `test -f 'connect.c' || echo '$(srcdir)/'`connect.c libcurlu_la-llist.lo: llist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-llist.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-llist.Tpo -c -o libcurlu_la-llist.lo `test -f 'llist.c' || echo '$(srcdir)/'`llist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-llist.Tpo $(DEPDIR)/libcurlu_la-llist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='llist.c' object='libcurlu_la-llist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-llist.lo `test -f 'llist.c' || echo '$(srcdir)/'`llist.c libcurlu_la-hash.lo: hash.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-hash.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-hash.Tpo -c -o libcurlu_la-hash.lo `test -f 'hash.c' || echo '$(srcdir)/'`hash.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-hash.Tpo $(DEPDIR)/libcurlu_la-hash.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash.c' object='libcurlu_la-hash.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-hash.lo `test -f 'hash.c' || echo '$(srcdir)/'`hash.c libcurlu_la-multi.lo: multi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-multi.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-multi.Tpo -c -o libcurlu_la-multi.lo `test -f 'multi.c' || echo '$(srcdir)/'`multi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-multi.Tpo $(DEPDIR)/libcurlu_la-multi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='multi.c' object='libcurlu_la-multi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-multi.lo `test -f 'multi.c' || echo '$(srcdir)/'`multi.c libcurlu_la-content_encoding.lo: content_encoding.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-content_encoding.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-content_encoding.Tpo -c -o libcurlu_la-content_encoding.lo `test -f 'content_encoding.c' || echo '$(srcdir)/'`content_encoding.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-content_encoding.Tpo $(DEPDIR)/libcurlu_la-content_encoding.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='content_encoding.c' object='libcurlu_la-content_encoding.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-content_encoding.lo `test -f 'content_encoding.c' || echo '$(srcdir)/'`content_encoding.c libcurlu_la-share.lo: share.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-share.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-share.Tpo -c -o libcurlu_la-share.lo `test -f 'share.c' || echo '$(srcdir)/'`share.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-share.Tpo $(DEPDIR)/libcurlu_la-share.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='share.c' object='libcurlu_la-share.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-share.lo `test -f 'share.c' || echo '$(srcdir)/'`share.c libcurlu_la-http_digest.lo: http_digest.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-http_digest.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-http_digest.Tpo -c -o libcurlu_la-http_digest.lo `test -f 'http_digest.c' || echo '$(srcdir)/'`http_digest.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-http_digest.Tpo $(DEPDIR)/libcurlu_la-http_digest.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http_digest.c' object='libcurlu_la-http_digest.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-http_digest.lo `test -f 'http_digest.c' || echo '$(srcdir)/'`http_digest.c libcurlu_la-md4.lo: md4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-md4.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-md4.Tpo -c -o libcurlu_la-md4.lo `test -f 'md4.c' || echo '$(srcdir)/'`md4.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-md4.Tpo $(DEPDIR)/libcurlu_la-md4.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='md4.c' object='libcurlu_la-md4.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-md4.lo `test -f 'md4.c' || echo '$(srcdir)/'`md4.c libcurlu_la-md5.lo: md5.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-md5.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-md5.Tpo -c -o libcurlu_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-md5.Tpo $(DEPDIR)/libcurlu_la-md5.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='md5.c' object='libcurlu_la-md5.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c libcurlu_la-http_negotiate.lo: http_negotiate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-http_negotiate.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-http_negotiate.Tpo -c -o libcurlu_la-http_negotiate.lo `test -f 'http_negotiate.c' || echo '$(srcdir)/'`http_negotiate.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-http_negotiate.Tpo $(DEPDIR)/libcurlu_la-http_negotiate.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http_negotiate.c' object='libcurlu_la-http_negotiate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-http_negotiate.lo `test -f 'http_negotiate.c' || echo '$(srcdir)/'`http_negotiate.c libcurlu_la-inet_pton.lo: inet_pton.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-inet_pton.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-inet_pton.Tpo -c -o libcurlu_la-inet_pton.lo `test -f 'inet_pton.c' || echo '$(srcdir)/'`inet_pton.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-inet_pton.Tpo $(DEPDIR)/libcurlu_la-inet_pton.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inet_pton.c' object='libcurlu_la-inet_pton.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-inet_pton.lo `test -f 'inet_pton.c' || echo '$(srcdir)/'`inet_pton.c libcurlu_la-strtoofft.lo: strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-strtoofft.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-strtoofft.Tpo -c -o libcurlu_la-strtoofft.lo `test -f 'strtoofft.c' || echo '$(srcdir)/'`strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-strtoofft.Tpo $(DEPDIR)/libcurlu_la-strtoofft.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strtoofft.c' object='libcurlu_la-strtoofft.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-strtoofft.lo `test -f 'strtoofft.c' || echo '$(srcdir)/'`strtoofft.c libcurlu_la-strerror.lo: strerror.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-strerror.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-strerror.Tpo -c -o libcurlu_la-strerror.lo `test -f 'strerror.c' || echo '$(srcdir)/'`strerror.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-strerror.Tpo $(DEPDIR)/libcurlu_la-strerror.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strerror.c' object='libcurlu_la-strerror.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-strerror.lo `test -f 'strerror.c' || echo '$(srcdir)/'`strerror.c libcurlu_la-amigaos.lo: amigaos.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-amigaos.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-amigaos.Tpo -c -o libcurlu_la-amigaos.lo `test -f 'amigaos.c' || echo '$(srcdir)/'`amigaos.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-amigaos.Tpo $(DEPDIR)/libcurlu_la-amigaos.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='amigaos.c' object='libcurlu_la-amigaos.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-amigaos.lo `test -f 'amigaos.c' || echo '$(srcdir)/'`amigaos.c libcurlu_la-hostasyn.lo: hostasyn.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-hostasyn.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-hostasyn.Tpo -c -o libcurlu_la-hostasyn.lo `test -f 'hostasyn.c' || echo '$(srcdir)/'`hostasyn.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-hostasyn.Tpo $(DEPDIR)/libcurlu_la-hostasyn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hostasyn.c' object='libcurlu_la-hostasyn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-hostasyn.lo `test -f 'hostasyn.c' || echo '$(srcdir)/'`hostasyn.c libcurlu_la-hostip4.lo: hostip4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-hostip4.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-hostip4.Tpo -c -o libcurlu_la-hostip4.lo `test -f 'hostip4.c' || echo '$(srcdir)/'`hostip4.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-hostip4.Tpo $(DEPDIR)/libcurlu_la-hostip4.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hostip4.c' object='libcurlu_la-hostip4.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-hostip4.lo `test -f 'hostip4.c' || echo '$(srcdir)/'`hostip4.c libcurlu_la-hostip6.lo: hostip6.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-hostip6.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-hostip6.Tpo -c -o libcurlu_la-hostip6.lo `test -f 'hostip6.c' || echo '$(srcdir)/'`hostip6.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-hostip6.Tpo $(DEPDIR)/libcurlu_la-hostip6.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hostip6.c' object='libcurlu_la-hostip6.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-hostip6.lo `test -f 'hostip6.c' || echo '$(srcdir)/'`hostip6.c libcurlu_la-hostsyn.lo: hostsyn.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-hostsyn.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-hostsyn.Tpo -c -o libcurlu_la-hostsyn.lo `test -f 'hostsyn.c' || echo '$(srcdir)/'`hostsyn.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-hostsyn.Tpo $(DEPDIR)/libcurlu_la-hostsyn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hostsyn.c' object='libcurlu_la-hostsyn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-hostsyn.lo `test -f 'hostsyn.c' || echo '$(srcdir)/'`hostsyn.c libcurlu_la-inet_ntop.lo: inet_ntop.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-inet_ntop.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-inet_ntop.Tpo -c -o libcurlu_la-inet_ntop.lo `test -f 'inet_ntop.c' || echo '$(srcdir)/'`inet_ntop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-inet_ntop.Tpo $(DEPDIR)/libcurlu_la-inet_ntop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inet_ntop.c' object='libcurlu_la-inet_ntop.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-inet_ntop.lo `test -f 'inet_ntop.c' || echo '$(srcdir)/'`inet_ntop.c libcurlu_la-parsedate.lo: parsedate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-parsedate.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-parsedate.Tpo -c -o libcurlu_la-parsedate.lo `test -f 'parsedate.c' || echo '$(srcdir)/'`parsedate.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-parsedate.Tpo $(DEPDIR)/libcurlu_la-parsedate.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parsedate.c' object='libcurlu_la-parsedate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-parsedate.lo `test -f 'parsedate.c' || echo '$(srcdir)/'`parsedate.c libcurlu_la-select.lo: select.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-select.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-select.Tpo -c -o libcurlu_la-select.lo `test -f 'select.c' || echo '$(srcdir)/'`select.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-select.Tpo $(DEPDIR)/libcurlu_la-select.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='select.c' object='libcurlu_la-select.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-select.lo `test -f 'select.c' || echo '$(srcdir)/'`select.c libcurlu_la-tftp.lo: tftp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-tftp.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-tftp.Tpo -c -o libcurlu_la-tftp.lo `test -f 'tftp.c' || echo '$(srcdir)/'`tftp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-tftp.Tpo $(DEPDIR)/libcurlu_la-tftp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tftp.c' object='libcurlu_la-tftp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-tftp.lo `test -f 'tftp.c' || echo '$(srcdir)/'`tftp.c libcurlu_la-splay.lo: splay.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-splay.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-splay.Tpo -c -o libcurlu_la-splay.lo `test -f 'splay.c' || echo '$(srcdir)/'`splay.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-splay.Tpo $(DEPDIR)/libcurlu_la-splay.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='splay.c' object='libcurlu_la-splay.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-splay.lo `test -f 'splay.c' || echo '$(srcdir)/'`splay.c libcurlu_la-strdup.lo: strdup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-strdup.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-strdup.Tpo -c -o libcurlu_la-strdup.lo `test -f 'strdup.c' || echo '$(srcdir)/'`strdup.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-strdup.Tpo $(DEPDIR)/libcurlu_la-strdup.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strdup.c' object='libcurlu_la-strdup.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-strdup.lo `test -f 'strdup.c' || echo '$(srcdir)/'`strdup.c libcurlu_la-socks.lo: socks.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-socks.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-socks.Tpo -c -o libcurlu_la-socks.lo `test -f 'socks.c' || echo '$(srcdir)/'`socks.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-socks.Tpo $(DEPDIR)/libcurlu_la-socks.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='socks.c' object='libcurlu_la-socks.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-socks.lo `test -f 'socks.c' || echo '$(srcdir)/'`socks.c libcurlu_la-ssh.lo: ssh.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-ssh.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-ssh.Tpo -c -o libcurlu_la-ssh.lo `test -f 'ssh.c' || echo '$(srcdir)/'`ssh.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-ssh.Tpo $(DEPDIR)/libcurlu_la-ssh.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ssh.c' object='libcurlu_la-ssh.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-ssh.lo `test -f 'ssh.c' || echo '$(srcdir)/'`ssh.c libcurlu_la-rawstr.lo: rawstr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-rawstr.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-rawstr.Tpo -c -o libcurlu_la-rawstr.lo `test -f 'rawstr.c' || echo '$(srcdir)/'`rawstr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-rawstr.Tpo $(DEPDIR)/libcurlu_la-rawstr.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rawstr.c' object='libcurlu_la-rawstr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-rawstr.lo `test -f 'rawstr.c' || echo '$(srcdir)/'`rawstr.c libcurlu_la-curl_addrinfo.lo: curl_addrinfo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-curl_addrinfo.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-curl_addrinfo.Tpo -c -o libcurlu_la-curl_addrinfo.lo `test -f 'curl_addrinfo.c' || echo '$(srcdir)/'`curl_addrinfo.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-curl_addrinfo.Tpo $(DEPDIR)/libcurlu_la-curl_addrinfo.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_addrinfo.c' object='libcurlu_la-curl_addrinfo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-curl_addrinfo.lo `test -f 'curl_addrinfo.c' || echo '$(srcdir)/'`curl_addrinfo.c libcurlu_la-socks_gssapi.lo: socks_gssapi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-socks_gssapi.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-socks_gssapi.Tpo -c -o libcurlu_la-socks_gssapi.lo `test -f 'socks_gssapi.c' || echo '$(srcdir)/'`socks_gssapi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-socks_gssapi.Tpo $(DEPDIR)/libcurlu_la-socks_gssapi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='socks_gssapi.c' object='libcurlu_la-socks_gssapi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-socks_gssapi.lo `test -f 'socks_gssapi.c' || echo '$(srcdir)/'`socks_gssapi.c libcurlu_la-socks_sspi.lo: socks_sspi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-socks_sspi.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-socks_sspi.Tpo -c -o libcurlu_la-socks_sspi.lo `test -f 'socks_sspi.c' || echo '$(srcdir)/'`socks_sspi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-socks_sspi.Tpo $(DEPDIR)/libcurlu_la-socks_sspi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='socks_sspi.c' object='libcurlu_la-socks_sspi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-socks_sspi.lo `test -f 'socks_sspi.c' || echo '$(srcdir)/'`socks_sspi.c libcurlu_la-curl_sspi.lo: curl_sspi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-curl_sspi.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-curl_sspi.Tpo -c -o libcurlu_la-curl_sspi.lo `test -f 'curl_sspi.c' || echo '$(srcdir)/'`curl_sspi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-curl_sspi.Tpo $(DEPDIR)/libcurlu_la-curl_sspi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_sspi.c' object='libcurlu_la-curl_sspi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-curl_sspi.lo `test -f 'curl_sspi.c' || echo '$(srcdir)/'`curl_sspi.c libcurlu_la-slist.lo: slist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-slist.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-slist.Tpo -c -o libcurlu_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-slist.Tpo $(DEPDIR)/libcurlu_la-slist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='slist.c' object='libcurlu_la-slist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c libcurlu_la-nonblock.lo: nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-nonblock.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-nonblock.Tpo -c -o libcurlu_la-nonblock.lo `test -f 'nonblock.c' || echo '$(srcdir)/'`nonblock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-nonblock.Tpo $(DEPDIR)/libcurlu_la-nonblock.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nonblock.c' object='libcurlu_la-nonblock.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-nonblock.lo `test -f 'nonblock.c' || echo '$(srcdir)/'`nonblock.c libcurlu_la-curl_memrchr.lo: curl_memrchr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-curl_memrchr.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-curl_memrchr.Tpo -c -o libcurlu_la-curl_memrchr.lo `test -f 'curl_memrchr.c' || echo '$(srcdir)/'`curl_memrchr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-curl_memrchr.Tpo $(DEPDIR)/libcurlu_la-curl_memrchr.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_memrchr.c' object='libcurlu_la-curl_memrchr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-curl_memrchr.lo `test -f 'curl_memrchr.c' || echo '$(srcdir)/'`curl_memrchr.c libcurlu_la-imap.lo: imap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-imap.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-imap.Tpo -c -o libcurlu_la-imap.lo `test -f 'imap.c' || echo '$(srcdir)/'`imap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-imap.Tpo $(DEPDIR)/libcurlu_la-imap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imap.c' object='libcurlu_la-imap.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-imap.lo `test -f 'imap.c' || echo '$(srcdir)/'`imap.c libcurlu_la-pop3.lo: pop3.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-pop3.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-pop3.Tpo -c -o libcurlu_la-pop3.lo `test -f 'pop3.c' || echo '$(srcdir)/'`pop3.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-pop3.Tpo $(DEPDIR)/libcurlu_la-pop3.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pop3.c' object='libcurlu_la-pop3.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-pop3.lo `test -f 'pop3.c' || echo '$(srcdir)/'`pop3.c libcurlu_la-smtp.lo: smtp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-smtp.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-smtp.Tpo -c -o libcurlu_la-smtp.lo `test -f 'smtp.c' || echo '$(srcdir)/'`smtp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-smtp.Tpo $(DEPDIR)/libcurlu_la-smtp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='smtp.c' object='libcurlu_la-smtp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-smtp.lo `test -f 'smtp.c' || echo '$(srcdir)/'`smtp.c libcurlu_la-pingpong.lo: pingpong.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-pingpong.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-pingpong.Tpo -c -o libcurlu_la-pingpong.lo `test -f 'pingpong.c' || echo '$(srcdir)/'`pingpong.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-pingpong.Tpo $(DEPDIR)/libcurlu_la-pingpong.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pingpong.c' object='libcurlu_la-pingpong.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-pingpong.lo `test -f 'pingpong.c' || echo '$(srcdir)/'`pingpong.c libcurlu_la-rtsp.lo: rtsp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-rtsp.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-rtsp.Tpo -c -o libcurlu_la-rtsp.lo `test -f 'rtsp.c' || echo '$(srcdir)/'`rtsp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-rtsp.Tpo $(DEPDIR)/libcurlu_la-rtsp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtsp.c' object='libcurlu_la-rtsp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-rtsp.lo `test -f 'rtsp.c' || echo '$(srcdir)/'`rtsp.c libcurlu_la-curl_threads.lo: curl_threads.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-curl_threads.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-curl_threads.Tpo -c -o libcurlu_la-curl_threads.lo `test -f 'curl_threads.c' || echo '$(srcdir)/'`curl_threads.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-curl_threads.Tpo $(DEPDIR)/libcurlu_la-curl_threads.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_threads.c' object='libcurlu_la-curl_threads.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-curl_threads.lo `test -f 'curl_threads.c' || echo '$(srcdir)/'`curl_threads.c libcurlu_la-warnless.lo: warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-warnless.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-warnless.Tpo -c -o libcurlu_la-warnless.lo `test -f 'warnless.c' || echo '$(srcdir)/'`warnless.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-warnless.Tpo $(DEPDIR)/libcurlu_la-warnless.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='warnless.c' object='libcurlu_la-warnless.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-warnless.lo `test -f 'warnless.c' || echo '$(srcdir)/'`warnless.c libcurlu_la-hmac.lo: hmac.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-hmac.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-hmac.Tpo -c -o libcurlu_la-hmac.lo `test -f 'hmac.c' || echo '$(srcdir)/'`hmac.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-hmac.Tpo $(DEPDIR)/libcurlu_la-hmac.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hmac.c' object='libcurlu_la-hmac.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-hmac.lo `test -f 'hmac.c' || echo '$(srcdir)/'`hmac.c libcurlu_la-curl_rtmp.lo: curl_rtmp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-curl_rtmp.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-curl_rtmp.Tpo -c -o libcurlu_la-curl_rtmp.lo `test -f 'curl_rtmp.c' || echo '$(srcdir)/'`curl_rtmp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-curl_rtmp.Tpo $(DEPDIR)/libcurlu_la-curl_rtmp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_rtmp.c' object='libcurlu_la-curl_rtmp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-curl_rtmp.lo `test -f 'curl_rtmp.c' || echo '$(srcdir)/'`curl_rtmp.c libcurlu_la-openldap.lo: openldap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-openldap.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-openldap.Tpo -c -o libcurlu_la-openldap.lo `test -f 'openldap.c' || echo '$(srcdir)/'`openldap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-openldap.Tpo $(DEPDIR)/libcurlu_la-openldap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openldap.c' object='libcurlu_la-openldap.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-openldap.lo `test -f 'openldap.c' || echo '$(srcdir)/'`openldap.c libcurlu_la-curl_gethostname.lo: curl_gethostname.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-curl_gethostname.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-curl_gethostname.Tpo -c -o libcurlu_la-curl_gethostname.lo `test -f 'curl_gethostname.c' || echo '$(srcdir)/'`curl_gethostname.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-curl_gethostname.Tpo $(DEPDIR)/libcurlu_la-curl_gethostname.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_gethostname.c' object='libcurlu_la-curl_gethostname.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-curl_gethostname.lo `test -f 'curl_gethostname.c' || echo '$(srcdir)/'`curl_gethostname.c libcurlu_la-gopher.lo: gopher.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-gopher.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-gopher.Tpo -c -o libcurlu_la-gopher.lo `test -f 'gopher.c' || echo '$(srcdir)/'`gopher.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-gopher.Tpo $(DEPDIR)/libcurlu_la-gopher.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gopher.c' object='libcurlu_la-gopher.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-gopher.lo `test -f 'gopher.c' || echo '$(srcdir)/'`gopher.c libcurlu_la-idn_win32.lo: idn_win32.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-idn_win32.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-idn_win32.Tpo -c -o libcurlu_la-idn_win32.lo `test -f 'idn_win32.c' || echo '$(srcdir)/'`idn_win32.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-idn_win32.Tpo $(DEPDIR)/libcurlu_la-idn_win32.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='idn_win32.c' object='libcurlu_la-idn_win32.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-idn_win32.lo `test -f 'idn_win32.c' || echo '$(srcdir)/'`idn_win32.c libcurlu_la-http_negotiate_sspi.lo: http_negotiate_sspi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-http_negotiate_sspi.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-http_negotiate_sspi.Tpo -c -o libcurlu_la-http_negotiate_sspi.lo `test -f 'http_negotiate_sspi.c' || echo '$(srcdir)/'`http_negotiate_sspi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-http_negotiate_sspi.Tpo $(DEPDIR)/libcurlu_la-http_negotiate_sspi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http_negotiate_sspi.c' object='libcurlu_la-http_negotiate_sspi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-http_negotiate_sspi.lo `test -f 'http_negotiate_sspi.c' || echo '$(srcdir)/'`http_negotiate_sspi.c libcurlu_la-http_proxy.lo: http_proxy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-http_proxy.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-http_proxy.Tpo -c -o libcurlu_la-http_proxy.lo `test -f 'http_proxy.c' || echo '$(srcdir)/'`http_proxy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-http_proxy.Tpo $(DEPDIR)/libcurlu_la-http_proxy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http_proxy.c' object='libcurlu_la-http_proxy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-http_proxy.lo `test -f 'http_proxy.c' || echo '$(srcdir)/'`http_proxy.c libcurlu_la-non-ascii.lo: non-ascii.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-non-ascii.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-non-ascii.Tpo -c -o libcurlu_la-non-ascii.lo `test -f 'non-ascii.c' || echo '$(srcdir)/'`non-ascii.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-non-ascii.Tpo $(DEPDIR)/libcurlu_la-non-ascii.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='non-ascii.c' object='libcurlu_la-non-ascii.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-non-ascii.lo `test -f 'non-ascii.c' || echo '$(srcdir)/'`non-ascii.c libcurlu_la-asyn-ares.lo: asyn-ares.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-asyn-ares.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-asyn-ares.Tpo -c -o libcurlu_la-asyn-ares.lo `test -f 'asyn-ares.c' || echo '$(srcdir)/'`asyn-ares.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-asyn-ares.Tpo $(DEPDIR)/libcurlu_la-asyn-ares.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='asyn-ares.c' object='libcurlu_la-asyn-ares.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-asyn-ares.lo `test -f 'asyn-ares.c' || echo '$(srcdir)/'`asyn-ares.c libcurlu_la-asyn-thread.lo: asyn-thread.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-asyn-thread.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-asyn-thread.Tpo -c -o libcurlu_la-asyn-thread.lo `test -f 'asyn-thread.c' || echo '$(srcdir)/'`asyn-thread.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-asyn-thread.Tpo $(DEPDIR)/libcurlu_la-asyn-thread.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='asyn-thread.c' object='libcurlu_la-asyn-thread.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-asyn-thread.lo `test -f 'asyn-thread.c' || echo '$(srcdir)/'`asyn-thread.c libcurlu_la-curl_gssapi.lo: curl_gssapi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-curl_gssapi.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-curl_gssapi.Tpo -c -o libcurlu_la-curl_gssapi.lo `test -f 'curl_gssapi.c' || echo '$(srcdir)/'`curl_gssapi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-curl_gssapi.Tpo $(DEPDIR)/libcurlu_la-curl_gssapi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_gssapi.c' object='libcurlu_la-curl_gssapi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-curl_gssapi.lo `test -f 'curl_gssapi.c' || echo '$(srcdir)/'`curl_gssapi.c libcurlu_la-curl_ntlm.lo: curl_ntlm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-curl_ntlm.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-curl_ntlm.Tpo -c -o libcurlu_la-curl_ntlm.lo `test -f 'curl_ntlm.c' || echo '$(srcdir)/'`curl_ntlm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-curl_ntlm.Tpo $(DEPDIR)/libcurlu_la-curl_ntlm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_ntlm.c' object='libcurlu_la-curl_ntlm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-curl_ntlm.lo `test -f 'curl_ntlm.c' || echo '$(srcdir)/'`curl_ntlm.c libcurlu_la-curl_ntlm_wb.lo: curl_ntlm_wb.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-curl_ntlm_wb.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-curl_ntlm_wb.Tpo -c -o libcurlu_la-curl_ntlm_wb.lo `test -f 'curl_ntlm_wb.c' || echo '$(srcdir)/'`curl_ntlm_wb.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-curl_ntlm_wb.Tpo $(DEPDIR)/libcurlu_la-curl_ntlm_wb.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_ntlm_wb.c' object='libcurlu_la-curl_ntlm_wb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-curl_ntlm_wb.lo `test -f 'curl_ntlm_wb.c' || echo '$(srcdir)/'`curl_ntlm_wb.c libcurlu_la-curl_ntlm_core.lo: curl_ntlm_core.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-curl_ntlm_core.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-curl_ntlm_core.Tpo -c -o libcurlu_la-curl_ntlm_core.lo `test -f 'curl_ntlm_core.c' || echo '$(srcdir)/'`curl_ntlm_core.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-curl_ntlm_core.Tpo $(DEPDIR)/libcurlu_la-curl_ntlm_core.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_ntlm_core.c' object='libcurlu_la-curl_ntlm_core.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-curl_ntlm_core.lo `test -f 'curl_ntlm_core.c' || echo '$(srcdir)/'`curl_ntlm_core.c libcurlu_la-curl_ntlm_msgs.lo: curl_ntlm_msgs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-curl_ntlm_msgs.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-curl_ntlm_msgs.Tpo -c -o libcurlu_la-curl_ntlm_msgs.lo `test -f 'curl_ntlm_msgs.c' || echo '$(srcdir)/'`curl_ntlm_msgs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-curl_ntlm_msgs.Tpo $(DEPDIR)/libcurlu_la-curl_ntlm_msgs.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_ntlm_msgs.c' object='libcurlu_la-curl_ntlm_msgs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-curl_ntlm_msgs.lo `test -f 'curl_ntlm_msgs.c' || echo '$(srcdir)/'`curl_ntlm_msgs.c libcurlu_la-curl_sasl.lo: curl_sasl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-curl_sasl.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-curl_sasl.Tpo -c -o libcurlu_la-curl_sasl.lo `test -f 'curl_sasl.c' || echo '$(srcdir)/'`curl_sasl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-curl_sasl.Tpo $(DEPDIR)/libcurlu_la-curl_sasl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_sasl.c' object='libcurlu_la-curl_sasl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-curl_sasl.lo `test -f 'curl_sasl.c' || echo '$(srcdir)/'`curl_sasl.c libcurlu_la-curl_multibyte.lo: curl_multibyte.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-curl_multibyte.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-curl_multibyte.Tpo -c -o libcurlu_la-curl_multibyte.lo `test -f 'curl_multibyte.c' || echo '$(srcdir)/'`curl_multibyte.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-curl_multibyte.Tpo $(DEPDIR)/libcurlu_la-curl_multibyte.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='curl_multibyte.c' object='libcurlu_la-curl_multibyte.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-curl_multibyte.lo `test -f 'curl_multibyte.c' || echo '$(srcdir)/'`curl_multibyte.c libcurlu_la-hostcheck.lo: hostcheck.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-hostcheck.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-hostcheck.Tpo -c -o libcurlu_la-hostcheck.lo `test -f 'hostcheck.c' || echo '$(srcdir)/'`hostcheck.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-hostcheck.Tpo $(DEPDIR)/libcurlu_la-hostcheck.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hostcheck.c' object='libcurlu_la-hostcheck.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-hostcheck.lo `test -f 'hostcheck.c' || echo '$(srcdir)/'`hostcheck.c libcurlu_la-bundles.lo: bundles.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-bundles.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-bundles.Tpo -c -o libcurlu_la-bundles.lo `test -f 'bundles.c' || echo '$(srcdir)/'`bundles.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-bundles.Tpo $(DEPDIR)/libcurlu_la-bundles.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bundles.c' object='libcurlu_la-bundles.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-bundles.lo `test -f 'bundles.c' || echo '$(srcdir)/'`bundles.c libcurlu_la-conncache.lo: conncache.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-conncache.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-conncache.Tpo -c -o libcurlu_la-conncache.lo `test -f 'conncache.c' || echo '$(srcdir)/'`conncache.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-conncache.Tpo $(DEPDIR)/libcurlu_la-conncache.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='conncache.c' object='libcurlu_la-conncache.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-conncache.lo `test -f 'conncache.c' || echo '$(srcdir)/'`conncache.c libcurlu_la-pipeline.lo: pipeline.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-pipeline.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-pipeline.Tpo -c -o libcurlu_la-pipeline.lo `test -f 'pipeline.c' || echo '$(srcdir)/'`pipeline.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-pipeline.Tpo $(DEPDIR)/libcurlu_la-pipeline.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pipeline.c' object='libcurlu_la-pipeline.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-pipeline.lo `test -f 'pipeline.c' || echo '$(srcdir)/'`pipeline.c libcurlu_la-dotdot.lo: dotdot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-dotdot.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-dotdot.Tpo -c -o libcurlu_la-dotdot.lo `test -f 'dotdot.c' || echo '$(srcdir)/'`dotdot.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-dotdot.Tpo $(DEPDIR)/libcurlu_la-dotdot.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dotdot.c' object='libcurlu_la-dotdot.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-dotdot.lo `test -f 'dotdot.c' || echo '$(srcdir)/'`dotdot.c libcurlu_la-x509asn1.lo: x509asn1.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-x509asn1.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-x509asn1.Tpo -c -o libcurlu_la-x509asn1.lo `test -f 'x509asn1.c' || echo '$(srcdir)/'`x509asn1.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-x509asn1.Tpo $(DEPDIR)/libcurlu_la-x509asn1.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='x509asn1.c' object='libcurlu_la-x509asn1.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-x509asn1.lo `test -f 'x509asn1.c' || echo '$(srcdir)/'`x509asn1.c libcurlu_la-http2.lo: http2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-http2.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-http2.Tpo -c -o libcurlu_la-http2.lo `test -f 'http2.c' || echo '$(srcdir)/'`http2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-http2.Tpo $(DEPDIR)/libcurlu_la-http2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='http2.c' object='libcurlu_la-http2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-http2.lo `test -f 'http2.c' || echo '$(srcdir)/'`http2.c vtls/libcurlu_la-openssl.lo: vtls/openssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT vtls/libcurlu_la-openssl.lo -MD -MP -MF vtls/$(DEPDIR)/libcurlu_la-openssl.Tpo -c -o vtls/libcurlu_la-openssl.lo `test -f 'vtls/openssl.c' || echo '$(srcdir)/'`vtls/openssl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurlu_la-openssl.Tpo vtls/$(DEPDIR)/libcurlu_la-openssl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/openssl.c' object='vtls/libcurlu_la-openssl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurlu_la-openssl.lo `test -f 'vtls/openssl.c' || echo '$(srcdir)/'`vtls/openssl.c vtls/libcurlu_la-gtls.lo: vtls/gtls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT vtls/libcurlu_la-gtls.lo -MD -MP -MF vtls/$(DEPDIR)/libcurlu_la-gtls.Tpo -c -o vtls/libcurlu_la-gtls.lo `test -f 'vtls/gtls.c' || echo '$(srcdir)/'`vtls/gtls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurlu_la-gtls.Tpo vtls/$(DEPDIR)/libcurlu_la-gtls.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/gtls.c' object='vtls/libcurlu_la-gtls.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurlu_la-gtls.lo `test -f 'vtls/gtls.c' || echo '$(srcdir)/'`vtls/gtls.c vtls/libcurlu_la-vtls.lo: vtls/vtls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT vtls/libcurlu_la-vtls.lo -MD -MP -MF vtls/$(DEPDIR)/libcurlu_la-vtls.Tpo -c -o vtls/libcurlu_la-vtls.lo `test -f 'vtls/vtls.c' || echo '$(srcdir)/'`vtls/vtls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurlu_la-vtls.Tpo vtls/$(DEPDIR)/libcurlu_la-vtls.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/vtls.c' object='vtls/libcurlu_la-vtls.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurlu_la-vtls.lo `test -f 'vtls/vtls.c' || echo '$(srcdir)/'`vtls/vtls.c vtls/libcurlu_la-nss.lo: vtls/nss.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT vtls/libcurlu_la-nss.lo -MD -MP -MF vtls/$(DEPDIR)/libcurlu_la-nss.Tpo -c -o vtls/libcurlu_la-nss.lo `test -f 'vtls/nss.c' || echo '$(srcdir)/'`vtls/nss.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurlu_la-nss.Tpo vtls/$(DEPDIR)/libcurlu_la-nss.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/nss.c' object='vtls/libcurlu_la-nss.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurlu_la-nss.lo `test -f 'vtls/nss.c' || echo '$(srcdir)/'`vtls/nss.c vtls/libcurlu_la-qssl.lo: vtls/qssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT vtls/libcurlu_la-qssl.lo -MD -MP -MF vtls/$(DEPDIR)/libcurlu_la-qssl.Tpo -c -o vtls/libcurlu_la-qssl.lo `test -f 'vtls/qssl.c' || echo '$(srcdir)/'`vtls/qssl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurlu_la-qssl.Tpo vtls/$(DEPDIR)/libcurlu_la-qssl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/qssl.c' object='vtls/libcurlu_la-qssl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurlu_la-qssl.lo `test -f 'vtls/qssl.c' || echo '$(srcdir)/'`vtls/qssl.c vtls/libcurlu_la-polarssl.lo: vtls/polarssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT vtls/libcurlu_la-polarssl.lo -MD -MP -MF vtls/$(DEPDIR)/libcurlu_la-polarssl.Tpo -c -o vtls/libcurlu_la-polarssl.lo `test -f 'vtls/polarssl.c' || echo '$(srcdir)/'`vtls/polarssl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurlu_la-polarssl.Tpo vtls/$(DEPDIR)/libcurlu_la-polarssl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/polarssl.c' object='vtls/libcurlu_la-polarssl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurlu_la-polarssl.lo `test -f 'vtls/polarssl.c' || echo '$(srcdir)/'`vtls/polarssl.c vtls/libcurlu_la-polarssl_threadlock.lo: vtls/polarssl_threadlock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT vtls/libcurlu_la-polarssl_threadlock.lo -MD -MP -MF vtls/$(DEPDIR)/libcurlu_la-polarssl_threadlock.Tpo -c -o vtls/libcurlu_la-polarssl_threadlock.lo `test -f 'vtls/polarssl_threadlock.c' || echo '$(srcdir)/'`vtls/polarssl_threadlock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurlu_la-polarssl_threadlock.Tpo vtls/$(DEPDIR)/libcurlu_la-polarssl_threadlock.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/polarssl_threadlock.c' object='vtls/libcurlu_la-polarssl_threadlock.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurlu_la-polarssl_threadlock.lo `test -f 'vtls/polarssl_threadlock.c' || echo '$(srcdir)/'`vtls/polarssl_threadlock.c vtls/libcurlu_la-axtls.lo: vtls/axtls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT vtls/libcurlu_la-axtls.lo -MD -MP -MF vtls/$(DEPDIR)/libcurlu_la-axtls.Tpo -c -o vtls/libcurlu_la-axtls.lo `test -f 'vtls/axtls.c' || echo '$(srcdir)/'`vtls/axtls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurlu_la-axtls.Tpo vtls/$(DEPDIR)/libcurlu_la-axtls.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/axtls.c' object='vtls/libcurlu_la-axtls.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurlu_la-axtls.lo `test -f 'vtls/axtls.c' || echo '$(srcdir)/'`vtls/axtls.c vtls/libcurlu_la-cyassl.lo: vtls/cyassl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT vtls/libcurlu_la-cyassl.lo -MD -MP -MF vtls/$(DEPDIR)/libcurlu_la-cyassl.Tpo -c -o vtls/libcurlu_la-cyassl.lo `test -f 'vtls/cyassl.c' || echo '$(srcdir)/'`vtls/cyassl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurlu_la-cyassl.Tpo vtls/$(DEPDIR)/libcurlu_la-cyassl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/cyassl.c' object='vtls/libcurlu_la-cyassl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurlu_la-cyassl.lo `test -f 'vtls/cyassl.c' || echo '$(srcdir)/'`vtls/cyassl.c vtls/libcurlu_la-curl_schannel.lo: vtls/curl_schannel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT vtls/libcurlu_la-curl_schannel.lo -MD -MP -MF vtls/$(DEPDIR)/libcurlu_la-curl_schannel.Tpo -c -o vtls/libcurlu_la-curl_schannel.lo `test -f 'vtls/curl_schannel.c' || echo '$(srcdir)/'`vtls/curl_schannel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurlu_la-curl_schannel.Tpo vtls/$(DEPDIR)/libcurlu_la-curl_schannel.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/curl_schannel.c' object='vtls/libcurlu_la-curl_schannel.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurlu_la-curl_schannel.lo `test -f 'vtls/curl_schannel.c' || echo '$(srcdir)/'`vtls/curl_schannel.c vtls/libcurlu_la-curl_darwinssl.lo: vtls/curl_darwinssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT vtls/libcurlu_la-curl_darwinssl.lo -MD -MP -MF vtls/$(DEPDIR)/libcurlu_la-curl_darwinssl.Tpo -c -o vtls/libcurlu_la-curl_darwinssl.lo `test -f 'vtls/curl_darwinssl.c' || echo '$(srcdir)/'`vtls/curl_darwinssl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurlu_la-curl_darwinssl.Tpo vtls/$(DEPDIR)/libcurlu_la-curl_darwinssl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/curl_darwinssl.c' object='vtls/libcurlu_la-curl_darwinssl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurlu_la-curl_darwinssl.lo `test -f 'vtls/curl_darwinssl.c' || echo '$(srcdir)/'`vtls/curl_darwinssl.c vtls/libcurlu_la-gskit.lo: vtls/gskit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT vtls/libcurlu_la-gskit.lo -MD -MP -MF vtls/$(DEPDIR)/libcurlu_la-gskit.Tpo -c -o vtls/libcurlu_la-gskit.lo `test -f 'vtls/gskit.c' || echo '$(srcdir)/'`vtls/gskit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vtls/$(DEPDIR)/libcurlu_la-gskit.Tpo vtls/$(DEPDIR)/libcurlu_la-gskit.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vtls/gskit.c' object='vtls/libcurlu_la-gskit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o vtls/libcurlu_la-gskit.lo `test -f 'vtls/gskit.c' || echo '$(srcdir)/'`vtls/gskit.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf vtls/.libs vtls/_libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am @CURLDEBUG_FALSE@all-local: all-am: Makefile $(LTLIBRARIES) curl_config.h all-local installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f vtls/$(DEPDIR)/$(am__dirstamp) -rm -f vtls/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) vtls/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) vtls/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES checksrc: @@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(top_srcdir)/lib $(CSOURCES) $(HHEADERS) # for debug builds, we scan the sources on all regular make invokes @CURLDEBUG_TRUE@all-local: checksrc # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: curl-7.35.0/lib/dict.h0000644000175000017500000000225612213173003011333 00000000000000#ifndef HEADER_CURL_DICT_H #define HEADER_CURL_DICT_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2009, 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. * ***************************************************************************/ #ifndef CURL_DISABLE_DICT extern const struct Curl_handler Curl_handler_dict; #endif #endif /* HEADER_CURL_DICT_H */ curl-7.35.0/lib/curl_ntlm.c0000644000175000017500000001436112270035364012414 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_NTLM /* * NTLM details: * * http://davenport.sourceforge.net/ntlm.html * http://www.innovation.ch/java/ntlm.html */ #define DEBUG_ME 0 #include "urldata.h" #include "sendf.h" #include "rawstr.h" #include "curl_ntlm.h" #include "curl_ntlm_msgs.h" #include "curl_ntlm_wb.h" #include "url.h" #include "curl_memory.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #if defined(USE_NSS) #include "vtls/nssg.h" #elif defined(USE_WINDOWS_SSPI) #include "curl_sspi.h" #endif /* The last #include file should be: */ #include "memdebug.h" #if DEBUG_ME # define DEBUG_OUT(x) x #else # define DEBUG_OUT(x) Curl_nop_stmt #endif CURLcode Curl_input_ntlm(struct connectdata *conn, bool proxy, /* if proxy or not */ const char *header) /* rest of the www-authenticate: header */ { /* point to the correct struct with this */ struct ntlmdata *ntlm; CURLcode result = CURLE_OK; #ifdef USE_NSS result = Curl_nss_force_init(conn->data); if(result) return result; #endif ntlm = proxy ? &conn->proxyntlm : &conn->ntlm; if(checkprefix("NTLM", header)) { header += strlen("NTLM"); while(*header && ISSPACE(*header)) header++; if(*header) { result = Curl_ntlm_decode_type2_message(conn->data, header, ntlm); if(CURLE_OK != result) return result; ntlm->state = NTLMSTATE_TYPE2; /* We got a type-2 message */ } else { if(ntlm->state == NTLMSTATE_TYPE3) { infof(conn->data, "NTLM handshake rejected\n"); Curl_http_ntlm_cleanup(conn); ntlm->state = NTLMSTATE_NONE; return CURLE_REMOTE_ACCESS_DENIED; } else if(ntlm->state >= NTLMSTATE_TYPE1) { infof(conn->data, "NTLM handshake failure (internal error)\n"); return CURLE_REMOTE_ACCESS_DENIED; } ntlm->state = NTLMSTATE_TYPE1; /* We should send away a type-1 */ } } return result; } /* * This is for creating ntlm header output */ CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy) { char *base64 = NULL; size_t len = 0; CURLcode error; /* point to the address of the pointer that holds the string to send to the server, which is for a plain host or for a HTTP proxy */ char **allocuserpwd; /* point to the name and password for this */ const char *userp; const char *passwdp; /* point to the correct struct with this */ struct ntlmdata *ntlm; struct auth *authp; DEBUGASSERT(conn); DEBUGASSERT(conn->data); #ifdef USE_NSS if(CURLE_OK != Curl_nss_force_init(conn->data)) return CURLE_OUT_OF_MEMORY; #endif 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 = ""; if(!passwdp) passwdp = ""; #ifdef USE_WINDOWS_SSPI if(s_hSecDll == NULL) { /* not thread safe and leaks - use curl_global_init() to avoid */ CURLcode err = Curl_sspi_global_init(); if(s_hSecDll == NULL) return err; } #endif switch(ntlm->state) { case NTLMSTATE_TYPE1: default: /* for the weird cases we (re)start here */ /* Create a type-1 message */ error = Curl_ntlm_create_type1_message(userp, passwdp, ntlm, &base64, &len); if(error) return error; if(base64) { Curl_safefree(*allocuserpwd); *allocuserpwd = aprintf("%sAuthorization: NTLM %s\r\n", proxy ? "Proxy-" : "", base64); free(base64); if(!*allocuserpwd) return CURLE_OUT_OF_MEMORY; DEBUG_OUT(fprintf(stderr, "**** Header %s\n ", *allocuserpwd)); } break; case NTLMSTATE_TYPE2: /* We already received the type-2 message, create a type-3 message */ error = Curl_ntlm_create_type3_message(conn->data, userp, passwdp, ntlm, &base64, &len); if(error) return error; if(base64) { Curl_safefree(*allocuserpwd); *allocuserpwd = aprintf("%sAuthorization: NTLM %s\r\n", proxy ? "Proxy-" : "", base64); free(base64); if(!*allocuserpwd) return CURLE_OUT_OF_MEMORY; DEBUG_OUT(fprintf(stderr, "**** %s\n ", *allocuserpwd)); ntlm->state = NTLMSTATE_TYPE3; /* we send a type-3 */ authp->done = TRUE; } break; case NTLMSTATE_TYPE3: /* connection is already authenticated, * don't send a header in future requests */ Curl_safefree(*allocuserpwd); authp->done = TRUE; break; } return CURLE_OK; } void Curl_http_ntlm_cleanup(struct connectdata *conn) { #ifdef USE_WINDOWS_SSPI Curl_ntlm_sspi_cleanup(&conn->ntlm); Curl_ntlm_sspi_cleanup(&conn->proxyntlm); #elif defined(NTLM_WB_ENABLED) Curl_ntlm_wb_cleanup(conn); #else (void)conn; #endif } #endif /* USE_NTLM */ curl-7.35.0/lib/rawstr.c0000644000175000017500000000715612213173003011731 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #include "rawstr.h" /* Portable, consistent toupper (remember EBCDIC). Do not use toupper() because its behavior is altered by the current locale. */ char Curl_raw_toupper(char in) { switch (in) { case 'a': return 'A'; case 'b': return 'B'; case 'c': return 'C'; case 'd': return 'D'; case 'e': return 'E'; case 'f': return 'F'; case 'g': return 'G'; case 'h': return 'H'; case 'i': return 'I'; case 'j': return 'J'; case 'k': return 'K'; case 'l': return 'L'; case 'm': return 'M'; case 'n': return 'N'; case 'o': return 'O'; case 'p': return 'P'; case 'q': return 'Q'; case 'r': return 'R'; case 's': return 'S'; case 't': return 'T'; case 'u': return 'U'; case 'v': return 'V'; case 'w': return 'W'; case 'x': return 'X'; case 'y': return 'Y'; case 'z': return 'Z'; } return in; } /* * Curl_raw_equal() is for doing "raw" case insensitive strings. This is meant * to be locale independent and only compare strings we know are safe for * this. See http://daniel.haxx.se/blog/2008/10/15/strcasecmp-in-turkish/ for * some further explanation to why this function is necessary. * * The function is capable of comparing a-z case insensitively even for * non-ascii. */ int Curl_raw_equal(const char *first, const char *second) { while(*first && *second) { if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second)) /* get out of the loop as soon as they don't match */ break; first++; second++; } /* we do the comparison here (possibly again), just to make sure that if the loop above is skipped because one of the strings reached zero, we must not return this as a successful match */ return (Curl_raw_toupper(*first) == Curl_raw_toupper(*second)); } int Curl_raw_nequal(const char *first, const char *second, size_t max) { while(*first && *second && max) { if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second)) { break; } max--; first++; second++; } if(0 == max) return 1; /* they are equal this far */ return Curl_raw_toupper(*first) == Curl_raw_toupper(*second); } /* Copy an upper case version of the string from src to dest. The * strings may overlap. No more than n characters of the string are copied * (including any NUL) and the destination string will NOT be * NUL-terminated if that limit is reached. */ void Curl_strntoupper(char *dest, const char *src, size_t n) { if(n < 1) return; do { *dest++ = Curl_raw_toupper(*src); } while(*src++ && --n); } curl-7.35.0/lib/README.encoding0000644000175000017500000000555312213173003012707 00000000000000 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_ACCEPT_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_ACCEPT_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_ACCEPT_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 curl-7.35.0/lib/idn_win32.c0000644000175000017500000000475612213173003012206 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ /* * IDN conversions using Windows kernel32 and normaliz libraries. */ #include "curl_setup.h" #ifdef USE_WIN32_IDN #include "curl_multibyte.h" #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" #ifdef WANT_IDN_PROTOTYPES WINBASEAPI int WINAPI IdnToAscii(DWORD, const WCHAR *, int, WCHAR *, int); WINBASEAPI int WINAPI IdnToUnicode(DWORD, const WCHAR *, int, WCHAR *, int); #endif #define IDN_MAX_LENGTH 255 int curl_win32_idn_to_ascii(const char *in, char **out); int curl_win32_ascii_to_idn(const char *in, size_t in_len, char **out_utf8); int curl_win32_idn_to_ascii(const char *in, char **out) { wchar_t *in_w = Curl_convert_UTF8_to_wchar(in); if(in_w) { wchar_t punycode[IDN_MAX_LENGTH]; if(IdnToAscii(0, in_w, -1, punycode, IDN_MAX_LENGTH) == 0) { wprintf(L"ERROR %d converting to Punycode\n", GetLastError()); free(in_w); return 0; } free(in_w); *out = Curl_convert_wchar_to_UTF8(punycode); if(!*out) return 0; } return 1; } int curl_win32_ascii_to_idn(const char *in, size_t in_len, char **out_utf8) { (void)in_len; /* unused */ if(in) { WCHAR unicode[IDN_MAX_LENGTH]; if(IdnToUnicode(0, (wchar_t *)in, -1, unicode, IDN_MAX_LENGTH) == 0) { wprintf(L"ERROR %d converting to Punycode\n", GetLastError()); return 0; } else { *out_utf8 = Curl_convert_wchar_to_UTF8(unicode); if(!*out_utf8) return 0; } } return 1; } #endif /* USE_WIN32_IDN */ curl-7.35.0/lib/nonblock.h0000644000175000017500000000242012213173003012206 00000000000000#ifndef HEADER_CURL_NONBLOCK_H #define HEADER_CURL_NONBLOCK_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2009, 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. * ***************************************************************************/ #include /* for curl_socket_t */ int curlx_nonblock(curl_socket_t sockfd, /* operate on this */ int nonblock /* TRUE or FALSE */); #endif /* HEADER_CURL_NONBLOCK_H */ curl-7.35.0/lib/socks_sspi.c0000644000175000017500000005372612262353672012613 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2009, 2011, Markus Moeller, * Copyright (C) 2012 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(USE_WINDOWS_SSPI) && !defined(CURL_DISABLE_PROXY) #include "urldata.h" #include "sendf.h" #include "connect.h" #include "strerror.h" #include "timeval.h" #include "socks.h" #include "curl_sspi.h" #include "curl_multibyte.h" #include "warnless.h" #define _MPRINTF_REPLACE /* use the internal *printf() functions */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* * Definitions required from ntsecapi.h are directly provided below this point * to avoid including ntsecapi.h due to a conflict with OpenSSL's safestack.h */ #define KERB_WRAP_NO_ENCRYPT 0x80000001 /* * Helper sspi error functions. */ static int check_sspi_err(struct connectdata *conn, SECURITY_STATUS status, const char* function) { if(status != SEC_E_OK && status != SEC_I_COMPLETE_AND_CONTINUE && status != SEC_I_COMPLETE_NEEDED && status != SEC_I_CONTINUE_NEEDED) { failf(conn->data, "SSPI error: %s failed: %s", function, Curl_sspi_strerror(conn, status)); return 1; } return 0; } /* This is the SSPI-using version of this function */ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex, struct connectdata *conn) { struct SessionHandle *data = conn->data; curl_socket_t sock = conn->sock[sockindex]; CURLcode code; ssize_t actualread; ssize_t written; int result; /* Needs GSSAPI authentication */ SECURITY_STATUS status; unsigned long sspi_ret_flags = 0; int gss_enc; SecBuffer sspi_send_token, sspi_recv_token, sspi_w_token[3]; SecBufferDesc input_desc, output_desc, wrap_desc; SecPkgContext_Sizes sspi_sizes; CredHandle cred_handle; CtxtHandle sspi_context; PCtxtHandle context_handle = NULL; SecPkgCredentials_Names names; TimeStamp expiry; char *service_name = NULL; unsigned short us_length; unsigned long qop; unsigned char socksreq[4]; /* room for gssapi exchange header only */ char *service = data->set.str[STRING_SOCKS5_GSSAPI_SERVICE]; /* GSSAPI request looks like * +----+------+-----+----------------+ * |VER | MTYP | LEN | TOKEN | * +----+------+----------------------+ * | 1 | 1 | 2 | up to 2^16 - 1 | * +----+------+-----+----------------+ */ /* prepare service name */ if(strchr(service, '/')) { service_name = malloc(strlen(service)); if(!service_name) return CURLE_OUT_OF_MEMORY; memcpy(service_name, service, strlen(service)); } else { service_name = malloc(strlen(service) + strlen(conn->proxy.name) + 2); if(!service_name) return CURLE_OUT_OF_MEMORY; snprintf(service_name,strlen(service) +strlen(conn->proxy.name)+2,"%s/%s", service,conn->proxy.name); } input_desc.cBuffers = 1; input_desc.pBuffers = &sspi_recv_token; input_desc.ulVersion = SECBUFFER_VERSION; sspi_recv_token.BufferType = SECBUFFER_TOKEN; sspi_recv_token.cbBuffer = 0; sspi_recv_token.pvBuffer = NULL; output_desc.cBuffers = 1; output_desc.pBuffers = &sspi_send_token; output_desc.ulVersion = SECBUFFER_VERSION; sspi_send_token.BufferType = SECBUFFER_TOKEN; sspi_send_token.cbBuffer = 0; sspi_send_token.pvBuffer = NULL; wrap_desc.cBuffers = 3; wrap_desc.pBuffers = sspi_w_token; wrap_desc.ulVersion = SECBUFFER_VERSION; cred_handle.dwLower = 0; cred_handle.dwUpper = 0; status = s_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR *) TEXT("Kerberos"), SECPKG_CRED_OUTBOUND, NULL, NULL, NULL, NULL, &cred_handle, &expiry); if(check_sspi_err(conn, status, "AcquireCredentialsHandle")) { failf(data, "Failed to acquire credentials."); Curl_safefree(service_name); s_pSecFn->FreeCredentialsHandle(&cred_handle); return CURLE_COULDNT_CONNECT; } /* As long as we need to keep sending some context info, and there's no */ /* errors, keep sending it... */ for(;;) { TCHAR *sname; sname = Curl_convert_UTF8_to_tchar(service_name); if(!sname) return CURLE_OUT_OF_MEMORY; status = s_pSecFn->InitializeSecurityContext(&cred_handle, context_handle, sname, ISC_REQ_MUTUAL_AUTH | ISC_REQ_ALLOCATE_MEMORY | ISC_REQ_CONFIDENTIALITY | ISC_REQ_REPLAY_DETECT, 0, SECURITY_NATIVE_DREP, &input_desc, 0, &sspi_context, &output_desc, &sspi_ret_flags, &expiry); Curl_unicodefree(sname); if(sspi_recv_token.pvBuffer) { s_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); sspi_recv_token.pvBuffer = NULL; sspi_recv_token.cbBuffer = 0; } if(check_sspi_err(conn, status, "InitializeSecurityContext")) { Curl_safefree(service_name); s_pSecFn->FreeCredentialsHandle(&cred_handle); s_pSecFn->DeleteSecurityContext(&sspi_context); s_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); failf(data, "Failed to initialise security context."); return CURLE_COULDNT_CONNECT; } if(sspi_send_token.cbBuffer != 0) { socksreq[0] = 1; /* gssapi subnegotiation version */ socksreq[1] = 1; /* authentication message type */ us_length = htons((short)sspi_send_token.cbBuffer); memcpy(socksreq+2, &us_length, sizeof(short)); code = Curl_write_plain(conn, sock, (char *)socksreq, 4, &written); if((code != CURLE_OK) || (4 != written)) { failf(data, "Failed to send SSPI authentication request."); Curl_safefree(service_name); s_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); s_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); s_pSecFn->FreeCredentialsHandle(&cred_handle); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } code = Curl_write_plain(conn, sock, (char *)sspi_send_token.pvBuffer, sspi_send_token.cbBuffer, &written); if((code != CURLE_OK) || (sspi_send_token.cbBuffer != (size_t)written)) { failf(data, "Failed to send SSPI authentication token."); Curl_safefree(service_name); s_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); s_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); s_pSecFn->FreeCredentialsHandle(&cred_handle); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } } s_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); sspi_send_token.pvBuffer = NULL; sspi_send_token.cbBuffer = 0; s_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); sspi_recv_token.pvBuffer = NULL; sspi_recv_token.cbBuffer = 0; if(status != SEC_I_CONTINUE_NEEDED) break; /* analyse response */ /* GSSAPI response looks like * +----+------+-----+----------------+ * |VER | MTYP | LEN | TOKEN | * +----+------+----------------------+ * | 1 | 1 | 2 | up to 2^16 - 1 | * +----+------+-----+----------------+ */ result = Curl_blockread_all(conn, sock, (char *)socksreq, 4, &actualread); if(result != CURLE_OK || actualread != 4) { failf(data, "Failed to receive SSPI authentication response."); Curl_safefree(service_name); s_pSecFn->FreeCredentialsHandle(&cred_handle); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } /* ignore the first (VER) byte */ if(socksreq[1] == 255) { /* status / message type */ failf(data, "User was rejected by the SOCKS5 server (%u %u).", (unsigned int)socksreq[0], (unsigned int)socksreq[1]); Curl_safefree(service_name); s_pSecFn->FreeCredentialsHandle(&cred_handle); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } if(socksreq[1] != 1) { /* status / messgae type */ failf(data, "Invalid SSPI authentication response type (%u %u).", (unsigned int)socksreq[0], (unsigned int)socksreq[1]); Curl_safefree(service_name); s_pSecFn->FreeCredentialsHandle(&cred_handle); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } memcpy(&us_length, socksreq+2, sizeof(short)); us_length = ntohs(us_length); sspi_recv_token.cbBuffer = us_length; sspi_recv_token.pvBuffer = malloc(us_length); if(!sspi_recv_token.pvBuffer) { Curl_safefree(service_name); s_pSecFn->FreeCredentialsHandle(&cred_handle); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_OUT_OF_MEMORY; } result = Curl_blockread_all(conn, sock, (char *)sspi_recv_token.pvBuffer, sspi_recv_token.cbBuffer, &actualread); if(result != CURLE_OK || actualread != us_length) { failf(data, "Failed to receive SSPI authentication token."); Curl_safefree(service_name); s_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); s_pSecFn->FreeCredentialsHandle(&cred_handle); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } context_handle = &sspi_context; } Curl_safefree(service_name); /* Everything is good so far, user was authenticated! */ status = s_pSecFn->QueryCredentialsAttributes(&cred_handle, SECPKG_CRED_ATTR_NAMES, &names); s_pSecFn->FreeCredentialsHandle(&cred_handle); if(check_sspi_err(conn, status, "QueryCredentialAttributes")) { s_pSecFn->DeleteSecurityContext(&sspi_context); s_pSecFn->FreeContextBuffer(names.sUserName); failf(data, "Failed to determine user name."); return CURLE_COULDNT_CONNECT; } infof(data, "SOCKS5 server authencticated user %s with gssapi.\n", names.sUserName); s_pSecFn->FreeContextBuffer(names.sUserName); /* Do encryption */ socksreq[0] = 1; /* gssapi subnegotiation version */ socksreq[1] = 2; /* encryption message type */ gss_enc = 0; /* no data protection */ /* do confidentiality protection if supported */ if(sspi_ret_flags & ISC_REQ_CONFIDENTIALITY) gss_enc = 2; /* else do integrity protection */ else if(sspi_ret_flags & ISC_REQ_INTEGRITY) gss_enc = 1; infof(data, "SOCKS5 server supports gssapi %s data protection.\n", (gss_enc==0)?"no":((gss_enc==1)?"integrity":"confidentiality") ); /* force to no data protection, avoid encryption/decryption for now */ gss_enc = 0; /* * Sending the encryption type in clear seems wrong. It should be * protected with gss_seal()/gss_wrap(). See RFC1961 extract below * The NEC reference implementations on which this is based is * therefore at fault * * +------+------+------+.......................+ * + ver | mtyp | len | token | * +------+------+------+.......................+ * + 0x01 | 0x02 | 0x02 | up to 2^16 - 1 octets | * +------+------+------+.......................+ * * Where: * * - "ver" is the protocol version number, here 1 to represent the * first version of the SOCKS/GSS-API protocol * * - "mtyp" is the message type, here 2 to represent a protection * -level negotiation message * * - "len" is the length of the "token" field in octets * * - "token" is the GSS-API encapsulated protection level * * The token is produced by encapsulating an octet containing the * required protection level using gss_seal()/gss_wrap() with conf_req * set to FALSE. The token is verified using gss_unseal()/ * gss_unwrap(). * */ if(data->set.socks5_gssapi_nec) { us_length = htons((short)1); memcpy(socksreq+2, &us_length, sizeof(short)); } else { status = s_pSecFn->QueryContextAttributes(&sspi_context, SECPKG_ATTR_SIZES, &sspi_sizes); if(check_sspi_err(conn, status, "QueryContextAttributes")) { s_pSecFn->DeleteSecurityContext(&sspi_context); failf(data, "Failed to query security context attributes."); return CURLE_COULDNT_CONNECT; } sspi_w_token[0].cbBuffer = sspi_sizes.cbSecurityTrailer; sspi_w_token[0].BufferType = SECBUFFER_TOKEN; sspi_w_token[0].pvBuffer = malloc(sspi_sizes.cbSecurityTrailer); if(!sspi_w_token[0].pvBuffer) { s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_OUT_OF_MEMORY; } sspi_w_token[1].cbBuffer = 1; sspi_w_token[1].pvBuffer = malloc(1); if(!sspi_w_token[1].pvBuffer) { s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_OUT_OF_MEMORY; } memcpy(sspi_w_token[1].pvBuffer,&gss_enc,1); sspi_w_token[2].BufferType = SECBUFFER_PADDING; sspi_w_token[2].cbBuffer = sspi_sizes.cbBlockSize; sspi_w_token[2].pvBuffer = malloc(sspi_sizes.cbBlockSize); if(!sspi_w_token[2].pvBuffer) { s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); s_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_OUT_OF_MEMORY; } status = s_pSecFn->EncryptMessage(&sspi_context, KERB_WRAP_NO_ENCRYPT, &wrap_desc, 0); if(check_sspi_err(conn, status, "EncryptMessage")) { s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); s_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); s_pSecFn->FreeContextBuffer(sspi_w_token[2].pvBuffer); s_pSecFn->DeleteSecurityContext(&sspi_context); failf(data, "Failed to query security context attributes."); return CURLE_COULDNT_CONNECT; } sspi_send_token.cbBuffer = sspi_w_token[0].cbBuffer + sspi_w_token[1].cbBuffer + sspi_w_token[2].cbBuffer; sspi_send_token.pvBuffer = malloc(sspi_send_token.cbBuffer); if(!sspi_send_token.pvBuffer) { s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); s_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); s_pSecFn->FreeContextBuffer(sspi_w_token[2].pvBuffer); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_OUT_OF_MEMORY; } memcpy(sspi_send_token.pvBuffer, sspi_w_token[0].pvBuffer, sspi_w_token[0].cbBuffer); memcpy((PUCHAR) sspi_send_token.pvBuffer +(int)sspi_w_token[0].cbBuffer, sspi_w_token[1].pvBuffer, sspi_w_token[1].cbBuffer); memcpy((PUCHAR) sspi_send_token.pvBuffer +sspi_w_token[0].cbBuffer +sspi_w_token[1].cbBuffer, sspi_w_token[2].pvBuffer, sspi_w_token[2].cbBuffer); s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); sspi_w_token[0].pvBuffer = NULL; sspi_w_token[0].cbBuffer = 0; s_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); sspi_w_token[1].pvBuffer = NULL; sspi_w_token[1].cbBuffer = 0; s_pSecFn->FreeContextBuffer(sspi_w_token[2].pvBuffer); sspi_w_token[2].pvBuffer = NULL; sspi_w_token[2].cbBuffer = 0; us_length = htons((short)sspi_send_token.cbBuffer); memcpy(socksreq+2,&us_length,sizeof(short)); } code = Curl_write_plain(conn, sock, (char *)socksreq, 4, &written); if((code != CURLE_OK) || (4 != written)) { failf(data, "Failed to send SSPI encryption request."); s_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } if(data->set.socks5_gssapi_nec) { memcpy(socksreq,&gss_enc,1); code = Curl_write_plain(conn, sock, (char *)socksreq, 1, &written); if((code != CURLE_OK) || (1 != written)) { failf(data, "Failed to send SSPI encryption type."); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } } else { code = Curl_write_plain(conn, sock, (char *)sspi_send_token.pvBuffer, sspi_send_token.cbBuffer, &written); if((code != CURLE_OK) || (sspi_send_token.cbBuffer != (size_t)written)) { failf(data, "Failed to send SSPI encryption type."); s_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } s_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); } result = Curl_blockread_all(conn, sock, (char *)socksreq, 4, &actualread); if(result != CURLE_OK || actualread != 4) { failf(data, "Failed to receive SSPI encryption response."); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } /* ignore the first (VER) byte */ if(socksreq[1] == 255) { /* status / message type */ failf(data, "User was rejected by the SOCKS5 server (%u %u).", (unsigned int)socksreq[0], (unsigned int)socksreq[1]); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } if(socksreq[1] != 2) { /* status / message type */ failf(data, "Invalid SSPI encryption response type (%u %u).", (unsigned int)socksreq[0], (unsigned int)socksreq[1]); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } memcpy(&us_length, socksreq+2, sizeof(short)); us_length = ntohs(us_length); sspi_w_token[0].cbBuffer = us_length; sspi_w_token[0].pvBuffer = malloc(us_length); if(!sspi_w_token[0].pvBuffer) { s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_OUT_OF_MEMORY; } result = Curl_blockread_all(conn, sock, (char *)sspi_w_token[0].pvBuffer, sspi_w_token[0].cbBuffer, &actualread); if(result != CURLE_OK || actualread != us_length) { failf(data, "Failed to receive SSPI encryption type."); s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } if(!data->set.socks5_gssapi_nec) { wrap_desc.cBuffers = 2; sspi_w_token[0].BufferType = SECBUFFER_STREAM; sspi_w_token[1].BufferType = SECBUFFER_DATA; sspi_w_token[1].cbBuffer = 0; sspi_w_token[1].pvBuffer = NULL; status = s_pSecFn->DecryptMessage(&sspi_context, &wrap_desc, 0, &qop); if(check_sspi_err(conn, status, "DecryptMessage")) { s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); s_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); s_pSecFn->DeleteSecurityContext(&sspi_context); failf(data, "Failed to query security context attributes."); return CURLE_COULDNT_CONNECT; } if(sspi_w_token[1].cbBuffer != 1) { failf(data, "Invalid SSPI encryption response length (%lu).", (unsigned long)sspi_w_token[1].cbBuffer); s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); s_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } memcpy(socksreq,sspi_w_token[1].pvBuffer,sspi_w_token[1].cbBuffer); s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); s_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); } else { if(sspi_w_token[0].cbBuffer != 1) { failf(data, "Invalid SSPI encryption response length (%lu).", (unsigned long)sspi_w_token[0].cbBuffer); s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); s_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } memcpy(socksreq,sspi_w_token[0].pvBuffer,sspi_w_token[0].cbBuffer); s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); } infof(data, "SOCKS5 access with%s protection granted.\n", (socksreq[0]==0)?"out gssapi data": ((socksreq[0]==1)?" gssapi integrity":" gssapi confidentiality")); /* For later use if encryption is required conn->socks5_gssapi_enctype = socksreq[0]; if(socksreq[0] != 0) conn->socks5_sspi_context = sspi_context; else { s_pSecFn->DeleteSecurityContext(&sspi_context); conn->socks5_sspi_context = sspi_context; } */ return CURLE_OK; } #endif curl-7.35.0/lib/curl_config.h.in0000644000175000017500000006333412272122664013327 00000000000000/* lib/curl_config.h.in. Generated from configure.ac by autoheader. */ /* Location of default ca bundle */ #undef CURL_CA_BUNDLE /* Location of default ca path */ #undef CURL_CA_PATH /* 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 Gopher */ #undef CURL_DISABLE_GOPHER /* to disable HTTP */ #undef CURL_DISABLE_HTTP /* to disable IMAP */ #undef CURL_DISABLE_IMAP /* to disable LDAP */ #undef CURL_DISABLE_LDAP /* to disable LDAPS */ #undef CURL_DISABLE_LDAPS /* to disable --libcurl C code generation option */ #undef CURL_DISABLE_LIBCURL_OPTION /* to disable POP3 */ #undef CURL_DISABLE_POP3 /* to disable proxies */ #undef CURL_DISABLE_PROXY /* to disable RTSP */ #undef CURL_DISABLE_RTSP /* to disable SMTP */ #undef CURL_DISABLE_SMTP /* to disable TELNET */ #undef CURL_DISABLE_TELNET /* to disable TFTP */ #undef CURL_DISABLE_TFTP /* to disable TLS-SRP authentication */ #undef CURL_DISABLE_TLS_SRP /* to disable verbose strings */ #undef CURL_DISABLE_VERBOSE_STRINGS /* Definition to make a library symbol externally visible. */ #undef CURL_EXTERN_SYMBOL /* Use Windows LDAP implementation */ #undef CURL_LDAP_WIN /* 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 2 for gethostname. */ #undef GETHOSTNAME_TYPE_ARG2 /* 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 /* Specifies the number of arguments to getservbyport_r */ #undef GETSERVBYPORT_R_ARGS /* Specifies the size of the buffer to pass to getservbyport_r */ #undef GETSERVBYPORT_R_BUFSIZE /* Define to 1 if you have the alarm function. */ #undef HAVE_ALARM /* 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 bool is an available type. */ #undef HAVE_BOOL_T /* Define to 1 if you have the clock_gettime function and monotonic timer. */ #undef HAVE_CLOCK_GETTIME_MONOTONIC /* Define to 1 if you have the closesocket function. */ #undef HAVE_CLOSESOCKET /* Define to 1 if you have the CloseSocket camel case function. */ #undef HAVE_CLOSESOCKET_CAMEL /* Define to 1 if you have the connect function. */ #undef HAVE_CONNECT /* 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_DLFCN_H /* Define to 1 if you have the `ENGINE_cleanup' function. */ #undef HAVE_ENGINE_CLEANUP /* 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 fcntl function. */ #undef HAVE_FCNTL /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ #undef HAVE_FCNTL_O_NONBLOCK /* Define to 1 if you have the fdopen function. */ #undef HAVE_FDOPEN /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the freeaddrinfo function. */ #undef HAVE_FREEADDRINFO /* Define to 1 if you have the freeifaddrs function. */ #undef HAVE_FREEIFADDRS /* Define to 1 if you have the fsetxattr function. */ #undef HAVE_FSETXATTR /* fsetxattr() takes 5 args */ #undef HAVE_FSETXATTR_5 /* fsetxattr() takes 6 args */ #undef HAVE_FSETXATTR_6 /* Define to 1 if you have the ftruncate function. */ #undef HAVE_FTRUNCATE /* Define to 1 if you have the gai_strerror function. */ #undef HAVE_GAI_STRERROR /* Define to 1 if you have a working getaddrinfo function. */ #undef HAVE_GETADDRINFO /* Define to 1 if the getaddrinfo function is threadsafe. */ #undef HAVE_GETADDRINFO_THREADSAFE /* Define to 1 if you have the `geteuid' function. */ #undef HAVE_GETEUID /* Define to 1 if you have the gethostbyaddr function. */ #undef HAVE_GETHOSTBYADDR /* Define to 1 if you have the gethostbyaddr_r function. */ #undef HAVE_GETHOSTBYADDR_R /* gethostbyaddr_r() takes 5 args */ #undef HAVE_GETHOSTBYADDR_R_5 /* gethostbyaddr_r() takes 7 args */ #undef HAVE_GETHOSTBYADDR_R_7 /* gethostbyaddr_r() takes 8 args */ #undef HAVE_GETHOSTBYADDR_R_8 /* Define to 1 if you have the gethostbyname function. */ #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 gethostname function. */ #undef HAVE_GETHOSTNAME /* Define to 1 if you have a working getifaddrs function. */ #undef HAVE_GETIFADDRS /* 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 `getppid' function. */ #undef HAVE_GETPPID /* 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 getservbyport_r function. */ #undef HAVE_GETSERVBYPORT_R /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have a working glibc-style strerror_r function. */ #undef HAVE_GLIBC_STRERROR_R /* Define to 1 if you have a working gmtime_r function. */ #undef HAVE_GMTIME_R /* if you have the function gnutls_srp_verifier */ #undef HAVE_GNUTLS_SRP /* if you have the gssapi libraries */ #undef HAVE_GSSAPI /* Define to 1 if you have the header file. */ #undef HAVE_GSSAPI_GSSAPI_GENERIC_H /* Define to 1 if you have the header file. */ #undef HAVE_GSSAPI_GSSAPI_H /* Define to 1 if you have the header file. */ #undef HAVE_GSSAPI_GSSAPI_KRB5_H /* 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 header file. */ #undef HAVE_IFADDRS_H /* Define to 1 if you have the `inet_addr' function. */ #undef HAVE_INET_ADDR /* Define to 1 if you have the inet_ntoa_r function. */ #undef HAVE_INET_NTOA_R /* inet_ntoa_r() takes 2 args */ #undef HAVE_INET_NTOA_R_2 /* inet_ntoa_r() takes 3 args */ #undef HAVE_INET_NTOA_R_3 /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ #undef HAVE_INET_NTOP /* Define to 1 if you have a IPv6 capable working inet_pton function. */ #undef HAVE_INET_PTON /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the ioctl function. */ #undef HAVE_IOCTL /* Define to 1 if you have the ioctlsocket function. */ #undef HAVE_IOCTLSOCKET /* Define to 1 if you have the IoctlSocket camel case function. */ #undef HAVE_IOCTLSOCKET_CAMEL /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. */ #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ #undef HAVE_IOCTLSOCKET_FIONBIO /* Define to 1 if you have a working ioctl FIONBIO function. */ #undef HAVE_IOCTL_FIONBIO /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ #undef HAVE_IOCTL_SIOCGIFADDR /* Define to 1 if you have the header file. */ #undef HAVE_IO_H /* Define to 1 if you have the lber.h header file. */ #undef HAVE_LBER_H /* Define to 1 if you have the ldapssl.h header file. */ #undef HAVE_LDAPSSL_H /* Define to 1 if you have the ldap.h header file. */ #undef HAVE_LDAP_H /* Define to 1 if you have the `ldap_init_fd' function. */ #undef HAVE_LDAP_INIT_FD /* Use LDAPS implementation */ #undef HAVE_LDAP_SSL /* Define to 1 if you have the ldap_ssl.h header file. */ #undef HAVE_LDAP_SSL_H /* Define to 1 if you have the `ldap_url_parse' function. */ #undef HAVE_LDAP_URL_PARSE /* 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 `resolve' library (-lresolve). */ #undef HAVE_LIBRESOLVE /* Define to 1 if you have the header file. */ #undef HAVE_LIBRTMP_RTMP_H /* Define to 1 if you have the `ssh2' library (-lssh2). */ #undef HAVE_LIBSSH2 /* Define to 1 if you have the `libssh2_exit' function. */ #undef HAVE_LIBSSH2_EXIT /* Define to 1 if you have the header file. */ #undef HAVE_LIBSSH2_H /* Define to 1 if you have the `libssh2_init' function. */ #undef HAVE_LIBSSH2_INIT /* Define to 1 if you have the `libssh2_scp_send64' function. */ #undef HAVE_LIBSSH2_SCP_SEND64 /* Define to 1 if you have the `libssh2_session_handshake' function. */ #undef HAVE_LIBSSH2_SESSION_HANDSHAKE /* Define to 1 if you have the `libssh2_version' function. */ #undef HAVE_LIBSSH2_VERSION /* 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 a working localtime_r function. */ #undef HAVE_LOCALTIME_R /* Define to 1 if the compiler supports the 'long long' data type. */ #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 memory.h header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the memrchr function or macro. */ #undef HAVE_MEMRCHR /* 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 you have the header file. */ #undef HAVE_NGHTTP2_NGHTTP2_H /* Define to 1 if NI_WITHSCOPEID exists and works. */ #undef HAVE_NI_WITHSCOPEID /* if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE */ #undef HAVE_OLD_GSSMIT /* 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 /* 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 a working poll function. */ #undef HAVE_POLL /* If you have a fine poll */ #undef HAVE_POLL_FINE /* Define to 1 if you have the header file. */ #undef HAVE_POLL_H /* Define to 1 if you have a working POSIX-style strerror_r function. */ #undef HAVE_POSIX_STRERROR_R /* if you have */ #undef HAVE_PTHREAD_H /* 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 `setmode' function. */ #undef HAVE_SETMODE /* Define to 1 if you have the `setrlimit' function. */ #undef HAVE_SETRLIMIT /* Define to 1 if you have the setsockopt function. */ #undef HAVE_SETSOCKOPT /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ #undef HAVE_SETSOCKOPT_SO_NONBLOCK /* 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 /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the sigsetjmp function or macro. */ #undef HAVE_SIGSETJMP /* Define to 1 if sig_atomic_t is an available typedef. */ #undef HAVE_SIG_ATOMIC_T /* Define to 1 if sig_atomic_t is already defined as volatile. */ #undef HAVE_SIG_ATOMIC_T_VOLATILE /* Define to 1 if struct sockaddr_in6 has the sin6_scope_id member */ #undef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID /* Define to 1 if you have the socket function. */ #undef HAVE_SOCKET /* Define to 1 if you have the socketpair function. */ #undef HAVE_SOCKETPAIR /* Define to 1 if you have the header file. */ #undef HAVE_SOCKET_H /* Define this if you have the SPNEGO library fbopenssl */ #undef HAVE_SPNEGO /* if you have the function SRP_Calc_client_key */ #undef HAVE_SSLEAY_SRP /* Define to 1 if you have the `SSLv2_client_method' function. */ #undef HAVE_SSLV2_CLIENT_METHOD /* Define to 1 if you have the `SSL_get_shutdown' function. */ #undef HAVE_SSL_GET_SHUTDOWN /* Define to 1 if you have the header file. */ #undef HAVE_SSL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDBOOL_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 strncasecmp function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the strncmpi function. */ #undef HAVE_STRNCMPI /* Define to 1 if you have the strnicmp function. */ #undef HAVE_STRNICMP /* Define to 1 if you have the header file. */ #undef HAVE_STROPTS_H /* 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_UIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UN_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_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_XATTR_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 compiler supports C99 variadic macro style. */ #undef HAVE_VARIADIC_MACROS_C99 /* Define to 1 if compiler supports old gcc variadic macro style. */ #undef HAVE_VARIADIC_MACROS_GCC /* Define to 1 if you have the winber.h header file. */ #undef HAVE_WINBER_H /* Define to 1 if you have the windows.h header file. */ #undef HAVE_WINDOWS_H /* Define to 1 if you have the winldap.h header file. */ #undef HAVE_WINLDAP_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 writev function. */ #undef HAVE_WRITEV /* 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 /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to 1 if you need the lber.h header file even with ldap.h */ #undef NEED_LBER_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 need the memory.h header file even with stdlib.h */ #undef NEED_MEMORY_H /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ #undef NEED_REENTRANT /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ #undef NEED_THREAD_SAFE /* Define to enable NTLM delegation to winbind's ntlm_auth helper. */ #undef NTLM_WB_ENABLED /* Define absolute filename for winbind's ntlm_auth helper. */ #undef NTLM_WB_FILE /* 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 home page for this package. */ #undef PACKAGE_URL /* 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 qualifier of arg 5 for select. */ #undef SELECT_QUAL_ARG5 /* 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 function return type for select. */ #undef SELECT_TYPE_RETV /* 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 `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG /* The size of `off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T /* The size of `short', as computed by sizeof. */ #undef SIZEOF_SHORT /* 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 /* The size of `void*', as computed by sizeof. */ #undef SIZEOF_VOIDP /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to the type of arg 3 for strerror_r. */ #undef STRERROR_R_TYPE_ARG3 /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to enable c-ares support */ #undef USE_ARES /* if axTLS is enabled */ #undef USE_AXTLS /* if CyaSSL is enabled */ #undef USE_CYASSL /* to enable iOS/Mac OS X native SSL/TLS support */ #undef USE_DARWINSSL /* if GnuTLS is enabled */ #undef USE_GNUTLS /* if GnuTLS uses nettle as crypto backend */ #undef USE_GNUTLS_NETTLE /* if librtmp is in use */ #undef USE_LIBRTMP /* if libSSH2 is in use */ #undef USE_LIBSSH2 /* If you want to build curl with the built-in manual */ #undef USE_MANUAL /* Define to enable metalink support */ #undef USE_METALINK /* if nghttp2 is in use */ #undef USE_NGHTTP2 /* if NSS is enabled */ #undef USE_NSS /* Use OpenLDAP-specific code */ #undef USE_OPENLDAP /* if OpenSSL is in use */ #undef USE_OPENSSL /* if PolarSSL is enabled */ #undef USE_POLARSSL /* to enable Windows native SSL/TLS support */ #undef USE_SCHANNEL /* if SSL is enabled */ #undef USE_SSLEAY /* if you want POSIX threaded DNS lookup */ #undef USE_THREADS_POSIX /* Use TLS-SRP authentication */ #undef USE_TLS_SRP /* Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz). */ #undef USE_WIN32_IDN /* Define to 1 if you are building a Windows target with large file support. */ #undef USE_WIN32_LARGE_FILES /* Define to 1 if you are building a Windows target without large file support. */ #undef USE_WIN32_SMALL_FILES /* to enable SSPI support */ #undef USE_WINDOWS_SSPI /* Define to 1 if using yaSSL in OpenSSL compatibility mode. */ #undef USE_YASSLEMUL /* Version number of package */ #undef VERSION /* Define to 1 to provide own prototypes. */ #undef WANT_IDN_PROTOTYPES /* Define to avoid automatic inclusion of winsock.h */ #undef WIN32_LEAN_AND_MEAN /* Define to 1 if OS is AIX. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #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 /* Type to use in place of in_addr_t when system does not provide it. */ #undef in_addr_t /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `unsigned int' if does not define. */ #undef size_t /* the signed version of size_t */ #undef ssize_t curl-7.35.0/lib/pop3.c0000644000175000017500000017251012270035364011277 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * * RFC1734 POP3 Authentication * RFC1939 POP3 protocol * RFC2195 CRAM-MD5 authentication * RFC2384 POP URL Scheme * RFC2449 POP3 Extension Mechanism * RFC2595 Using TLS with IMAP, POP3 and ACAP * RFC2831 DIGEST-MD5 authentication * RFC4422 Simple Authentication and Security Layer (SASL) * RFC4616 PLAIN authentication * RFC5034 POP3 SASL Authentication Mechanism * RFC6749 OAuth 2.0 Authorization Framework * Draft LOGIN SASL Mechanism * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_POP3 #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 #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 "if2ip.h" #include "hostip.h" #include "progress.h" #include "transfer.h" #include "escape.h" #include "http.h" /* for HTTP proxy tunnel stuff */ #include "socks.h" #include "pop3.h" #include "strtoofft.h" #include "strequal.h" #include "vtls/vtls.h" #include "connect.h" #include "strerror.h" #include "select.h" #include "multiif.h" #include "url.h" #include "rawstr.h" #include "curl_sasl.h" #include "curl_md5.h" #include "warnless.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /* Local API functions */ static CURLcode pop3_regular_transfer(struct connectdata *conn, bool *done); static CURLcode pop3_do(struct connectdata *conn, bool *done); static CURLcode pop3_done(struct connectdata *conn, CURLcode status, bool premature); static CURLcode pop3_connect(struct connectdata *conn, bool *done); static CURLcode pop3_disconnect(struct connectdata *conn, bool dead); static CURLcode pop3_multi_statemach(struct connectdata *conn, bool *done); static int pop3_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks); static CURLcode pop3_doing(struct connectdata *conn, bool *dophase_done); static CURLcode pop3_setup_connection(struct connectdata *conn); static CURLcode pop3_parse_url_options(struct connectdata *conn); static CURLcode pop3_parse_url_path(struct connectdata *conn); static CURLcode pop3_parse_custom_request(struct connectdata *conn); static CURLcode pop3_calc_sasl_details(struct connectdata *conn, const char **mech, char **initresp, size_t *len, pop3state *state1, pop3state *state2); /* * POP3 protocol handler. */ const struct Curl_handler Curl_handler_pop3 = { "POP3", /* scheme */ pop3_setup_connection, /* setup_connection */ pop3_do, /* do_it */ pop3_done, /* done */ ZERO_NULL, /* do_more */ pop3_connect, /* connect_it */ pop3_multi_statemach, /* connecting */ pop3_doing, /* doing */ pop3_getsock, /* proto_getsock */ pop3_getsock, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ pop3_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_POP3, /* defport */ CURLPROTO_POP3, /* protocol */ PROTOPT_CLOSEACTION | PROTOPT_NOURLQUERY /* flags */ }; #ifdef USE_SSL /* * POP3S protocol handler. */ const struct Curl_handler Curl_handler_pop3s = { "POP3S", /* scheme */ pop3_setup_connection, /* setup_connection */ pop3_do, /* do_it */ pop3_done, /* done */ ZERO_NULL, /* do_more */ pop3_connect, /* connect_it */ pop3_multi_statemach, /* connecting */ pop3_doing, /* doing */ pop3_getsock, /* proto_getsock */ pop3_getsock, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ pop3_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_POP3S, /* defport */ CURLPROTO_POP3 | CURLPROTO_POP3S, /* protocol */ PROTOPT_CLOSEACTION | PROTOPT_SSL | PROTOPT_NOURLQUERY /* flags */ }; #endif #ifndef CURL_DISABLE_HTTP /* * HTTP-proxyed POP3 protocol handler. */ static const struct Curl_handler Curl_handler_pop3_proxy = { "POP3", /* scheme */ Curl_http_setup_conn, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ ZERO_NULL, /* do_more */ ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_POP3, /* defport */ CURLPROTO_HTTP, /* protocol */ PROTOPT_NONE /* flags */ }; #ifdef USE_SSL /* * HTTP-proxyed POP3S protocol handler. */ static const struct Curl_handler Curl_handler_pop3s_proxy = { "POP3S", /* scheme */ Curl_http_setup_conn, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ ZERO_NULL, /* do_more */ ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_POP3S, /* defport */ CURLPROTO_HTTP, /* protocol */ PROTOPT_NONE /* flags */ }; #endif #endif #ifdef USE_SSL static void pop3_to_pop3s(struct connectdata *conn) { conn->handler = &Curl_handler_pop3s; } #else #define pop3_to_pop3s(x) Curl_nop_stmt #endif /*********************************************************************** * * pop3_endofresp() * * Checks for an ending POP3 status code at the start of the given string, but * also detects the APOP timestamp from the server greeting and various * capabilities from the CAPA response including the supported authentication * types and allowed SASL mechanisms. */ static bool pop3_endofresp(struct connectdata *conn, char *line, size_t len, int *resp) { struct pop3_conn *pop3c = &conn->proto.pop3c; /* Do we have an error response? */ if(len >= 4 && !memcmp("-ERR", line, 4)) { *resp = '-'; return TRUE; } /* Are we processing CAPA command responses? */ if(pop3c->state == POP3_CAPA) { /* Do we have the terminating line? */ if(len >= 1 && !memcmp(line, ".", 1)) *resp = '+'; else *resp = '*'; return TRUE; } /* Do we have a command or continuation response? */ if((len >= 3 && !memcmp("+OK", line, 3)) || (len >= 1 && !memcmp("+", line, 1))) { *resp = '+'; return TRUE; } return FALSE; /* Nothing for us */ } /*********************************************************************** * * pop3_get_message() * * Gets the authentication message from the response buffer. */ static void pop3_get_message(char *buffer, char** outptr) { size_t len = 0; char* message = NULL; /* Find the start of the message */ for(message = buffer + 2; *message == ' ' || *message == '\t'; message++) ; /* Find the end of the message */ for(len = strlen(message); len--;) if(message[len] != '\r' && message[len] != '\n' && message[len] != ' ' && message[len] != '\t') break; /* Terminate the message */ if(++len) { message[len] = '\0'; } *outptr = message; } /*********************************************************************** * * state() * * This is the ONLY way to change POP3 state! */ static void state(struct connectdata *conn, pop3state newstate) { struct pop3_conn *pop3c = &conn->proto.pop3c; #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) /* for debug purposes */ static const char * const names[] = { "STOP", "SERVERGREET", "CAPA", "STARTTLS", "UPGRADETLS", "AUTH_PLAIN", "AUTH_LOGIN", "AUTH_LOGIN_PASSWD", "AUTH_CRAMMD5", "AUTH_DIGESTMD5", "AUTH_DIGESTMD5_RESP", "AUTH_NTLM", "AUTH_NTLM_TYPE2MSG", "AUTH_XOAUTH2", "AUTH_CANCEL", "AUTH_FINAL", "APOP", "USER", "PASS", "COMMAND", "QUIT", /* LAST */ }; if(pop3c->state != newstate) infof(conn->data, "POP3 %p state change from %s to %s\n", (void *)pop3c, names[pop3c->state], names[newstate]); #endif pop3c->state = newstate; } /*********************************************************************** * * pop3_perform_capa() * * Sends the CAPA command in order to obtain a list of server side supported * capabilities. */ static CURLcode pop3_perform_capa(struct connectdata *conn) { CURLcode result = CURLE_OK; struct pop3_conn *pop3c = &conn->proto.pop3c; pop3c->authmechs = 0; /* No known authentication mechanisms yet */ pop3c->authused = 0; /* Clear the authentication mechanism used */ pop3c->tls_supported = FALSE; /* Clear the TLS capability */ /* Send the CAPA command */ result = Curl_pp_sendf(&pop3c->pp, "%s", "CAPA"); if(!result) state(conn, POP3_CAPA); return result; } /*********************************************************************** * * pop3_perform_starttls() * * Sends the STLS command to start the upgrade to TLS. */ static CURLcode pop3_perform_starttls(struct connectdata *conn) { CURLcode result = CURLE_OK; /* Send the STLS command */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", "STLS"); if(!result) state(conn, POP3_STARTTLS); return result; } /*********************************************************************** * * pop3_perform_upgrade_tls() * * Performs the upgrade to TLS. */ static CURLcode pop3_perform_upgrade_tls(struct connectdata *conn) { CURLcode result = CURLE_OK; struct pop3_conn *pop3c = &conn->proto.pop3c; /* Start the SSL connection */ result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &pop3c->ssldone); if(!result) { if(pop3c->state != POP3_UPGRADETLS) state(conn, POP3_UPGRADETLS); if(pop3c->ssldone) { pop3_to_pop3s(conn); result = pop3_perform_capa(conn); } } return result; } /*********************************************************************** * * pop3_perform_user() * * Sends a clear text USER command to authenticate with. */ static CURLcode pop3_perform_user(struct connectdata *conn) { CURLcode result = CURLE_OK; /* Check we have a username and password to authenticate with and end the connect phase if we don't */ if(!conn->bits.user_passwd) { state(conn, POP3_STOP); return result; } /* Send the USER command */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "USER %s", conn->user ? conn->user : ""); if(!result) state(conn, POP3_USER); return result; } #ifndef CURL_DISABLE_CRYPTO_AUTH /*********************************************************************** * * pop3_perform_apop() * * Sends an APOP command to authenticate with. */ static CURLcode pop3_perform_apop(struct connectdata *conn) { CURLcode result = CURLE_OK; struct pop3_conn *pop3c = &conn->proto.pop3c; size_t i; MD5_context *ctxt; unsigned char digest[MD5_DIGEST_LEN]; char secret[2 * MD5_DIGEST_LEN + 1]; /* Check we have a username and password to authenticate with and end the connect phase if we don't */ if(!conn->bits.user_passwd) { state(conn, POP3_STOP); return result; } /* Create the digest */ ctxt = Curl_MD5_init(Curl_DIGEST_MD5); if(!ctxt) return CURLE_OUT_OF_MEMORY; Curl_MD5_update(ctxt, (const unsigned char *) pop3c->apoptimestamp, curlx_uztoui(strlen(pop3c->apoptimestamp))); Curl_MD5_update(ctxt, (const unsigned char *) conn->passwd, curlx_uztoui(strlen(conn->passwd))); /* Finalise the digest */ Curl_MD5_final(ctxt, digest); /* Convert the calculated 16 octet digest into a 32 byte hex string */ for(i = 0; i < MD5_DIGEST_LEN; i++) snprintf(&secret[2 * i], 3, "%02x", digest[i]); result = Curl_pp_sendf(&pop3c->pp, "APOP %s %s", conn->user, secret); if(!result) state(conn, POP3_APOP); return result; } #endif /*********************************************************************** * * pop3_perform_auth() * * Sends an AUTH command allowing the client to login with the given SASL * authentication mechanism. */ static CURLcode pop3_perform_auth(struct connectdata *conn, const char *mech, const char *initresp, size_t len, pop3state state1, pop3state state2) { CURLcode result = CURLE_OK; struct pop3_conn *pop3c = &conn->proto.pop3c; if(initresp && 8 + strlen(mech) + len <= 255) { /* AUTH ... */ /* Send the AUTH command with the initial response */ result = Curl_pp_sendf(&pop3c->pp, "AUTH %s %s", mech, initresp); if(!result) state(conn, state2); } else { /* Send the AUTH command */ result = Curl_pp_sendf(&pop3c->pp, "AUTH %s", mech); if(!result) state(conn, state1); } return result; } /*********************************************************************** * * pop3_perform_authentication() * * Initiates the authentication sequence, with the appropriate SASL * authentication mechanism, falling back to APOP and clear text should a * common mechanism not be available between the client and server. */ static CURLcode pop3_perform_authentication(struct connectdata *conn) { CURLcode result = CURLE_OK; struct pop3_conn *pop3c = &conn->proto.pop3c; const char *mech = NULL; char *initresp = NULL; size_t len = 0; pop3state state1 = POP3_STOP; pop3state state2 = POP3_STOP; /* Check we have a username and password to authenticate with and end the connect phase if we don't */ if(!conn->bits.user_passwd) { state(conn, POP3_STOP); return result; } /* Calculate the SASL login details */ if(pop3c->authtypes & POP3_TYPE_SASL) result = pop3_calc_sasl_details(conn, &mech, &initresp, &len, &state1, &state2); if(!result) { if(mech && (pop3c->preftype & POP3_TYPE_SASL)) { /* Perform SASL based authentication */ result = pop3_perform_auth(conn, mech, initresp, len, state1, state2); Curl_safefree(initresp); } #ifndef CURL_DISABLE_CRYPTO_AUTH else if((pop3c->authtypes & POP3_TYPE_APOP) && (pop3c->preftype & POP3_TYPE_APOP)) /* Perform APOP authentication */ result = pop3_perform_apop(conn); #endif else if((pop3c->authtypes & POP3_TYPE_CLEARTEXT) && (pop3c->preftype & POP3_TYPE_CLEARTEXT)) /* Perform clear text authentication */ result = pop3_perform_user(conn); else { /* Other mechanisms not supported */ infof(conn->data, "No known authentication mechanisms supported!\n"); result = CURLE_LOGIN_DENIED; } } return result; } /*********************************************************************** * * pop3_perform_command() * * Sends a POP3 based command. */ static CURLcode pop3_perform_command(struct connectdata *conn) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct POP3 *pop3 = data->req.protop; const char *command = NULL; /* Calculate the default command */ if(pop3->id[0] == '\0' || conn->data->set.ftp_list_only) { command = "LIST"; if(pop3->id[0] != '\0') /* Message specific LIST so skip the BODY transfer */ pop3->transfer = FTPTRANSFER_INFO; } else command = "RETR"; /* Send the command */ if(pop3->id[0] != '\0') result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s %s", (pop3->custom && pop3->custom[0] != '\0' ? pop3->custom : command), pop3->id); else result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", (pop3->custom && pop3->custom[0] != '\0' ? pop3->custom : command)); if(!result) state(conn, POP3_COMMAND); return result; } /*********************************************************************** * * pop3_perform_quit() * * Performs the quit action prior to sclose() be called. */ static CURLcode pop3_perform_quit(struct connectdata *conn) { CURLcode result = CURLE_OK; /* Send the QUIT command */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", "QUIT"); if(!result) state(conn, POP3_QUIT); return result; } /* For the initial server greeting */ static CURLcode pop3_state_servergreet_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct pop3_conn *pop3c = &conn->proto.pop3c; const char *line = data->state.buffer; size_t len = strlen(line); size_t i; (void)instate; /* no use for this yet */ if(pop3code != '+') { failf(data, "Got unexpected pop3-server response"); result = CURLE_FTP_WEIRD_SERVER_REPLY; } else { /* Does the server support APOP authentication? */ if(len >= 4 && line[len - 2] == '>') { /* Look for the APOP timestamp */ for(i = 3; i < len - 2; ++i) { if(line[i] == '<') { /* Calculate the length of the timestamp */ size_t timestamplen = len - 1 - i; if(!timestamplen) break; /* Allocate some memory for the timestamp */ pop3c->apoptimestamp = (char *)calloc(1, timestamplen + 1); if(!pop3c->apoptimestamp) break; /* Copy the timestamp */ memcpy(pop3c->apoptimestamp, line + i, timestamplen); pop3c->apoptimestamp[timestamplen] = '\0'; /* Store the APOP capability */ pop3c->authtypes |= POP3_TYPE_APOP; break; } } } result = pop3_perform_capa(conn); } return result; } /* For CAPA responses */ static CURLcode pop3_state_capa_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct pop3_conn *pop3c = &conn->proto.pop3c; const char *line = data->state.buffer; size_t len = strlen(line); size_t wordlen; (void)instate; /* no use for this yet */ /* Do we have a untagged response? */ if(pop3code == '*') { /* Does the server support the STLS capability? */ if(len >= 4 && !memcmp(line, "STLS", 4)) pop3c->tls_supported = TRUE; /* Does the server support clear text authentication? */ else if(len >= 4 && !memcmp(line, "USER", 4)) pop3c->authtypes |= POP3_TYPE_CLEARTEXT; /* Does the server support SASL based authentication? */ else if(len >= 5 && !memcmp(line, "SASL ", 5)) { pop3c->authtypes |= POP3_TYPE_SASL; /* Advance past the SASL keyword */ line += 5; len -= 5; /* Loop through the data line */ for(;;) { while(len && (*line == ' ' || *line == '\t' || *line == '\r' || *line == '\n')) { line++; len--; } if(!len) break; /* Extract the word */ for(wordlen = 0; wordlen < len && line[wordlen] != ' ' && line[wordlen] != '\t' && line[wordlen] != '\r' && line[wordlen] != '\n';) wordlen++; /* Test the word for a matching authentication mechanism */ if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_LOGIN)) pop3c->authmechs |= SASL_MECH_LOGIN; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_PLAIN)) pop3c->authmechs |= SASL_MECH_PLAIN; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_CRAM_MD5)) pop3c->authmechs |= SASL_MECH_CRAM_MD5; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_DIGEST_MD5)) pop3c->authmechs |= SASL_MECH_DIGEST_MD5; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_GSSAPI)) pop3c->authmechs |= SASL_MECH_GSSAPI; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_EXTERNAL)) pop3c->authmechs |= SASL_MECH_EXTERNAL; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_NTLM)) pop3c->authmechs |= SASL_MECH_NTLM; else if(sasl_mech_equal(line, wordlen, SASL_MECH_STRING_XOAUTH2)) pop3c->authmechs |= SASL_MECH_XOAUTH2; line += wordlen; len -= wordlen; } } } else if(pop3code == '+') { if(data->set.use_ssl && !conn->ssl[FIRSTSOCKET].use) { /* We don't have a SSL/TLS connection yet, but SSL is requested */ if(pop3c->tls_supported) /* Switch to TLS connection now */ result = pop3_perform_starttls(conn); else if(data->set.use_ssl == CURLUSESSL_TRY) /* Fallback and carry on with authentication */ result = pop3_perform_authentication(conn); else { failf(data, "STLS not supported."); result = CURLE_USE_SSL_FAILED; } } else result = pop3_perform_authentication(conn); } else { /* Clear text is supported when CAPA isn't recognised */ pop3c->authtypes |= POP3_TYPE_CLEARTEXT; result = pop3_perform_authentication(conn); } return result; } /* For STARTTLS responses */ static CURLcode pop3_state_starttls_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(pop3code != '+') { if(data->set.use_ssl != CURLUSESSL_TRY) { failf(data, "STARTTLS denied. %c", pop3code); result = CURLE_USE_SSL_FAILED; } else result = pop3_perform_authentication(conn); } else result = pop3_perform_upgrade_tls(conn); return result; } /* For AUTH PLAIN (without initial response) responses */ static CURLcode pop3_state_auth_plain_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; size_t len = 0; char *plainauth = NULL; (void)instate; /* no use for this yet */ if(pop3code != '+') { failf(data, "Access denied. %c", pop3code); result = CURLE_LOGIN_DENIED; } else { /* Create the authorisation message */ result = Curl_sasl_create_plain_message(data, conn->user, conn->passwd, &plainauth, &len); if(!result && plainauth) { /* Send the message */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", plainauth); if(!result) state(conn, POP3_AUTH_FINAL); } } Curl_safefree(plainauth); return result; } /* For AUTH LOGIN (without initial response) responses */ static CURLcode pop3_state_auth_login_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; size_t len = 0; char *authuser = NULL; (void)instate; /* no use for this yet */ if(pop3code != '+') { failf(data, "Access denied: %d", pop3code); result = CURLE_LOGIN_DENIED; } else { /* Create the user message */ result = Curl_sasl_create_login_message(data, conn->user, &authuser, &len); if(!result && authuser) { /* Send the user */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", authuser); if(!result) state(conn, POP3_AUTH_LOGIN_PASSWD); } } Curl_safefree(authuser); return result; } /* For AUTH LOGIN user entry responses */ static CURLcode pop3_state_auth_login_password_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; size_t len = 0; char *authpasswd = NULL; (void)instate; /* no use for this yet */ if(pop3code != '+') { failf(data, "Access denied: %d", pop3code); result = CURLE_LOGIN_DENIED; } else { /* Create the password message */ result = Curl_sasl_create_login_message(data, conn->passwd, &authpasswd, &len); if(!result && authpasswd) { /* Send the password */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", authpasswd); if(!result) state(conn, POP3_AUTH_FINAL); } } Curl_safefree(authpasswd); return result; } #ifndef CURL_DISABLE_CRYPTO_AUTH /* For AUTH CRAM-MD5 responses */ static CURLcode pop3_state_auth_cram_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; char *chlg = NULL; char *chlg64 = NULL; char *rplyb64 = NULL; size_t len = 0; (void)instate; /* no use for this yet */ if(pop3code != '+') { failf(data, "Access denied: %d", pop3code); return CURLE_LOGIN_DENIED; } /* Get the challenge message */ pop3_get_message(data->state.buffer, &chlg64); /* Decode the challenge message */ result = Curl_sasl_decode_cram_md5_message(chlg64, &chlg, &len); if(result) { /* Send the cancellation */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", "*"); if(!result) state(conn, POP3_AUTH_CANCEL); } else { /* Create the response message */ result = Curl_sasl_create_cram_md5_message(data, chlg, conn->user, conn->passwd, &rplyb64, &len); if(!result && rplyb64) { /* Send the response */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", rplyb64); if(!result) state(conn, POP3_AUTH_FINAL); } } Curl_safefree(chlg); Curl_safefree(rplyb64); return result; } /* For AUTH DIGEST-MD5 challenge responses */ static CURLcode pop3_state_auth_digest_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; char *chlg64 = NULL; char *rplyb64 = NULL; size_t len = 0; char nonce[64]; char realm[128]; char algorithm[64]; (void)instate; /* no use for this yet */ if(pop3code != '+') { failf(data, "Access denied: %d", pop3code); return CURLE_LOGIN_DENIED; } /* Get the challenge message */ pop3_get_message(data->state.buffer, &chlg64); /* Decode the challange message */ result = Curl_sasl_decode_digest_md5_message(chlg64, nonce, sizeof(nonce), realm, sizeof(realm), algorithm, sizeof(algorithm)); if(result || strcmp(algorithm, "md5-sess") != 0) { /* Send the cancellation */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", "*"); if(!result) state(conn, POP3_AUTH_CANCEL); } else { /* Create the response message */ result = Curl_sasl_create_digest_md5_message(data, nonce, realm, conn->user, conn->passwd, "pop", &rplyb64, &len); if(!result && rplyb64) { /* Send the response */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", rplyb64); if(!result) state(conn, POP3_AUTH_DIGESTMD5_RESP); } } Curl_safefree(rplyb64); return result; } /* For AUTH DIGEST-MD5 challenge-response responses */ static CURLcode pop3_state_auth_digest_resp_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(pop3code != '+') { failf(data, "Authentication failed: %d", pop3code); result = CURLE_LOGIN_DENIED; } else { /* Send an empty response */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", ""); if(!result) state(conn, POP3_AUTH_FINAL); } return result; } #endif #ifdef USE_NTLM /* For AUTH NTLM (without initial response) responses */ static CURLcode pop3_state_auth_ntlm_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; size_t len = 0; char *type1msg = NULL; (void)instate; /* no use for this yet */ if(pop3code != '+') { failf(data, "Access denied: %d", pop3code); result = CURLE_LOGIN_DENIED; } else { /* Create the type-1 message */ result = Curl_sasl_create_ntlm_type1_message(conn->user, conn->passwd, &conn->ntlm, &type1msg, &len); if(!result && type1msg) { /* Send the message */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", type1msg); if(!result) state(conn, POP3_AUTH_NTLM_TYPE2MSG); } } Curl_safefree(type1msg); return result; } /* For NTLM type-2 responses (sent in reponse to our type-1 message) */ static CURLcode pop3_state_auth_ntlm_type2msg_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; char *type2msg = NULL; char *type3msg = NULL; size_t len = 0; (void)instate; /* no use for this yet */ if(pop3code != '+') { failf(data, "Access denied: %d", pop3code); result = CURLE_LOGIN_DENIED; } else { /* Get the type-2 message */ pop3_get_message(data->state.buffer, &type2msg); /* Decode the type-2 message */ result = Curl_sasl_decode_ntlm_type2_message(data, type2msg, &conn->ntlm); if(result) { /* Send the cancellation */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", "*"); if(!result) state(conn, POP3_AUTH_CANCEL); } else { /* Create the type-3 message */ result = Curl_sasl_create_ntlm_type3_message(data, conn->user, conn->passwd, &conn->ntlm, &type3msg, &len); if(!result && type3msg) { /* Send the message */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", type3msg); if(!result) state(conn, POP3_AUTH_FINAL); } } } Curl_safefree(type3msg); return result; } #endif /* For AUTH XOAUTH2 (without initial response) responses */ static CURLcode pop3_state_auth_xoauth2_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; size_t len = 0; char *xoauth = NULL; (void)instate; /* no use for this yet */ if(pop3code != '+') { failf(data, "Access denied: %d", pop3code); result = CURLE_LOGIN_DENIED; } else { /* Create the authorisation message */ result = Curl_sasl_create_xoauth2_message(conn->data, conn->user, conn->xoauth2_bearer, &xoauth, &len); if(!result && xoauth) { /* Send the message */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s", xoauth); if(!result) state(conn, POP3_AUTH_FINAL); } } Curl_safefree(xoauth); return result; } /* For AUTH cancellation responses */ static CURLcode pop3_state_auth_cancel_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct pop3_conn *pop3c = &conn->proto.pop3c; const char *mech = NULL; char *initresp = NULL; size_t len = 0; pop3state state1 = POP3_STOP; pop3state state2 = POP3_STOP; (void)pop3code; (void)instate; /* no use for this yet */ /* Remove the offending mechanism from the supported list */ pop3c->authmechs ^= pop3c->authused; /* Calculate alternative SASL login details */ result = pop3_calc_sasl_details(conn, &mech, &initresp, &len, &state1, &state2); if(!result) { /* Do we have any mechanisms left or can we fallback to another authentication type? */ if(mech) { /* Retry SASL based authentication */ result = pop3_perform_auth(conn, mech, initresp, len, state1, state2); Curl_safefree(initresp); } #ifndef CURL_DISABLE_CRYPTO_AUTH else if((pop3c->authtypes & POP3_TYPE_APOP) && (pop3c->preftype & POP3_TYPE_APOP)) /* Perform APOP authentication */ result = pop3_perform_apop(conn); #endif else if((pop3c->authtypes & POP3_TYPE_CLEARTEXT) && (pop3c->preftype & POP3_TYPE_CLEARTEXT)) /* Perform clear text authentication */ result = pop3_perform_user(conn); else { failf(data, "Authentication cancelled"); result = CURLE_LOGIN_DENIED; } } return result; } /* For final responses in the AUTH sequence */ static CURLcode pop3_state_auth_final_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(pop3code != '+') { failf(data, "Authentication failed: %d", pop3code); result = CURLE_LOGIN_DENIED; } else /* End of connect phase */ state(conn, POP3_STOP); return result; } #ifndef CURL_DISABLE_CRYPTO_AUTH /* For APOP responses */ static CURLcode pop3_state_apop_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(pop3code != '+') { failf(data, "Authentication failed: %d", pop3code); result = CURLE_LOGIN_DENIED; } else /* End of connect phase */ state(conn, POP3_STOP); return result; } #endif /* For USER responses */ static CURLcode pop3_state_user_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(pop3code != '+') { failf(data, "Access denied. %c", pop3code); result = CURLE_LOGIN_DENIED; } else /* Send the PASS command */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "PASS %s", conn->passwd ? conn->passwd : ""); if(!result) state(conn, POP3_PASS); return result; } /* For PASS responses */ static CURLcode pop3_state_pass_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(pop3code != '+') { failf(data, "Access denied. %c", pop3code); result = CURLE_LOGIN_DENIED; } else /* End of connect phase */ state(conn, POP3_STOP); return result; } /* For command responses */ static CURLcode pop3_state_command_resp(struct connectdata *conn, int pop3code, pop3state instate) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct POP3 *pop3 = data->req.protop; struct pop3_conn *pop3c = &conn->proto.pop3c; struct pingpong *pp = &pop3c->pp; (void)instate; /* no use for this yet */ if(pop3code != '+') { state(conn, POP3_STOP); return CURLE_RECV_ERROR; } /* This 'OK' line ends with a CR LF pair which is the two first bytes of the EOB string so count this is two matching bytes. This is necessary to make the code detect the EOB if the only data than comes now is %2e CR LF like when there is no body to return. */ pop3c->eob = 2; /* But since this initial CR LF pair is not part of the actual body, we set the strip counter here so that these bytes won't be delivered. */ pop3c->strip = 2; if(pop3->transfer == FTPTRANSFER_BODY) { /* POP3 download */ Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, NULL, -1, NULL); if(pp->cache) { /* The header "cache" contains a bunch of data that is actually body content so send it as such. Note that there may even be additional "headers" after the body */ if(!data->set.opt_no_body) { result = Curl_pop3_write(conn, pp->cache, pp->cache_size); if(result) return result; } /* Free the cache */ Curl_safefree(pp->cache); /* Reset the cache size */ pp->cache_size = 0; } } /* End of DO phase */ state(conn, POP3_STOP); return result; } static CURLcode pop3_statemach_act(struct connectdata *conn) { CURLcode result = CURLE_OK; curl_socket_t sock = conn->sock[FIRSTSOCKET]; int pop3code; struct pop3_conn *pop3c = &conn->proto.pop3c; struct pingpong *pp = &pop3c->pp; size_t nread = 0; /* Busy upgrading the connection; right now all I/O is SSL/TLS, not POP3 */ if(pop3c->state == POP3_UPGRADETLS) return pop3_perform_upgrade_tls(conn); /* Flush any data that needs to be sent */ if(pp->sendleft) return Curl_pp_flushsend(pp); do { /* Read the response from the server */ result = Curl_pp_readresp(sock, pp, &pop3code, &nread); if(result) return result; if(!pop3code) break; /* We have now received a full POP3 server response */ switch(pop3c->state) { case POP3_SERVERGREET: result = pop3_state_servergreet_resp(conn, pop3code, pop3c->state); break; case POP3_CAPA: result = pop3_state_capa_resp(conn, pop3code, pop3c->state); break; case POP3_STARTTLS: result = pop3_state_starttls_resp(conn, pop3code, pop3c->state); break; case POP3_AUTH_PLAIN: result = pop3_state_auth_plain_resp(conn, pop3code, pop3c->state); break; case POP3_AUTH_LOGIN: result = pop3_state_auth_login_resp(conn, pop3code, pop3c->state); break; case POP3_AUTH_LOGIN_PASSWD: result = pop3_state_auth_login_password_resp(conn, pop3code, pop3c->state); break; #ifndef CURL_DISABLE_CRYPTO_AUTH case POP3_AUTH_CRAMMD5: result = pop3_state_auth_cram_resp(conn, pop3code, pop3c->state); break; case POP3_AUTH_DIGESTMD5: result = pop3_state_auth_digest_resp(conn, pop3code, pop3c->state); break; case POP3_AUTH_DIGESTMD5_RESP: result = pop3_state_auth_digest_resp_resp(conn, pop3code, pop3c->state); break; #endif #ifdef USE_NTLM case POP3_AUTH_NTLM: result = pop3_state_auth_ntlm_resp(conn, pop3code, pop3c->state); break; case POP3_AUTH_NTLM_TYPE2MSG: result = pop3_state_auth_ntlm_type2msg_resp(conn, pop3code, pop3c->state); break; #endif case POP3_AUTH_XOAUTH2: result = pop3_state_auth_xoauth2_resp(conn, pop3code, pop3c->state); break; case POP3_AUTH_CANCEL: result = pop3_state_auth_cancel_resp(conn, pop3code, pop3c->state); break; case POP3_AUTH_FINAL: result = pop3_state_auth_final_resp(conn, pop3code, pop3c->state); break; #ifndef CURL_DISABLE_CRYPTO_AUTH case POP3_APOP: result = pop3_state_apop_resp(conn, pop3code, pop3c->state); break; #endif case POP3_USER: result = pop3_state_user_resp(conn, pop3code, pop3c->state); break; case POP3_PASS: result = pop3_state_pass_resp(conn, pop3code, pop3c->state); break; case POP3_COMMAND: result = pop3_state_command_resp(conn, pop3code, pop3c->state); break; case POP3_QUIT: /* fallthrough, just stop! */ default: /* internal error */ state(conn, POP3_STOP); break; } } while(!result && pop3c->state != POP3_STOP && Curl_pp_moredata(pp)); return result; } /* Called repeatedly until done from multi.c */ static CURLcode pop3_multi_statemach(struct connectdata *conn, bool *done) { CURLcode result = CURLE_OK; struct pop3_conn *pop3c = &conn->proto.pop3c; if((conn->handler->flags & PROTOPT_SSL) && !pop3c->ssldone) { result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &pop3c->ssldone); if(result || !pop3c->ssldone) return result; } result = Curl_pp_statemach(&pop3c->pp, FALSE); *done = (pop3c->state == POP3_STOP) ? TRUE : FALSE; return result; } static CURLcode pop3_block_statemach(struct connectdata *conn) { CURLcode result = CURLE_OK; struct pop3_conn *pop3c = &conn->proto.pop3c; while(pop3c->state != POP3_STOP && !result) result = Curl_pp_statemach(&pop3c->pp, TRUE); return result; } /* Allocate and initialize the POP3 struct for the current SessionHandle if required */ static CURLcode pop3_init(struct connectdata *conn) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct POP3 *pop3; pop3 = data->req.protop = calloc(sizeof(struct POP3), 1); if(!pop3) result = CURLE_OUT_OF_MEMORY; return result; } /* For the POP3 "protocol connect" and "doing" phases only */ static int pop3_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { return Curl_pp_getsock(&conn->proto.pop3c.pp, socks, numsocks); } /*********************************************************************** * * pop3_connect() * * This function 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 if not. */ static CURLcode pop3_connect(struct connectdata *conn, bool *done) { CURLcode result = CURLE_OK; struct pop3_conn *pop3c = &conn->proto.pop3c; struct pingpong *pp = &pop3c->pp; *done = FALSE; /* default to not done yet */ /* We always support persistent connections in POP3 */ conn->bits.close = FALSE; /* Set the default response time-out */ pp->response_time = RESP_TIMEOUT; pp->statemach_act = pop3_statemach_act; pp->endofresp = pop3_endofresp; pp->conn = conn; /* Set the default preferred authentication type and mechanism */ pop3c->preftype = POP3_TYPE_ANY; pop3c->prefmech = SASL_AUTH_ANY; /* Initialise the pingpong layer */ Curl_pp_init(pp); /* Parse the URL options */ result = pop3_parse_url_options(conn); if(result) return result; /* Start off waiting for the server greeting response */ state(conn, POP3_SERVERGREET); result = pop3_multi_statemach(conn, done); return result; } /*********************************************************************** * * pop3_done() * * The DONE function. This does what needs to be done after a single DO has * performed. * * Input argument is already checked for validity. */ static CURLcode pop3_done(struct connectdata *conn, CURLcode status, bool premature) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct POP3 *pop3 = data->req.protop; (void)premature; if(!pop3) /* When the easy handle is removed from the multi interface while libcurl is still trying to resolve the host name, the POP3 struct is not yet initialized. However, the removal action calls Curl_done() which in turn calls this function, so we simply return success. */ return CURLE_OK; if(status) { conn->bits.close = TRUE; /* marked for closure */ result = status; /* use the already set error code */ } /* Cleanup our per-request based variables */ Curl_safefree(pop3->id); Curl_safefree(pop3->custom); /* Clear the transfer mode for the next request */ pop3->transfer = FTPTRANSFER_BODY; return result; } /*********************************************************************** * * pop3_perform() * * This is the actual DO function for POP3. Get a message/listing according to * the options previously setup. */ static CURLcode pop3_perform(struct connectdata *conn, bool *connected, bool *dophase_done) { /* This is POP3 and no proxy */ CURLcode result = CURLE_OK; struct POP3 *pop3 = conn->data->req.protop; DEBUGF(infof(conn->data, "DO phase starts\n")); if(conn->data->set.opt_no_body) { /* Requested no body means no transfer */ pop3->transfer = FTPTRANSFER_INFO; } *dophase_done = FALSE; /* not done yet */ /* Start the first command in the DO phase */ result = pop3_perform_command(conn); if(result) return result; /* Run the state-machine */ result = pop3_multi_statemach(conn, dophase_done); *connected = conn->bits.tcpconnect[FIRSTSOCKET]; if(*dophase_done) DEBUGF(infof(conn->data, "DO phase is complete\n")); return result; } /*********************************************************************** * * pop3_do() * * This function is registered as 'curl_do' function. It decodes the path * parts etc as a wrapper to the actual DO function (pop3_perform). * * The input argument is already checked for validity. */ static CURLcode pop3_do(struct connectdata *conn, bool *done) { CURLcode result = CURLE_OK; *done = FALSE; /* default to false */ /* Parse the URL path */ result = pop3_parse_url_path(conn); if(result) return result; /* Parse the custom request */ result = pop3_parse_custom_request(conn); if(result) return result; result = pop3_regular_transfer(conn, done); return result; } /*********************************************************************** * * pop3_disconnect() * * Disconnect from an POP3 server. Cleanup protocol-specific per-connection * resources. BLOCKING. */ static CURLcode pop3_disconnect(struct connectdata *conn, bool dead_connection) { struct pop3_conn *pop3c = &conn->proto.pop3c; /* 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. */ /* The POP3 session may or may not have been allocated/setup at this point! */ if(!dead_connection && pop3c->pp.conn && pop3c->pp.conn->bits.protoconnstart) if(!pop3_perform_quit(conn)) (void)pop3_block_statemach(conn); /* ignore errors on QUIT */ /* Disconnect from the server */ Curl_pp_disconnect(&pop3c->pp); /* Cleanup the SASL module */ Curl_sasl_cleanup(conn, pop3c->authused); /* Cleanup our connection based variables */ Curl_safefree(pop3c->apoptimestamp); return CURLE_OK; } /* Call this when the DO phase has completed */ static CURLcode pop3_dophase_done(struct connectdata *conn, bool connected) { (void)conn; (void)connected; return CURLE_OK; } /* Called from multi.c while DOing */ static CURLcode pop3_doing(struct connectdata *conn, bool *dophase_done) { CURLcode result = pop3_multi_statemach(conn, dophase_done); if(result) DEBUGF(infof(conn->data, "DO phase failed\n")); else if(*dophase_done) { result = pop3_dophase_done(conn, FALSE /* not connected */); DEBUGF(infof(conn->data, "DO phase is complete\n")); } return result; } /*********************************************************************** * * pop3_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. */ static CURLcode pop3_regular_transfer(struct connectdata *conn, bool *dophase_done) { CURLcode result = CURLE_OK; bool connected = FALSE; struct SessionHandle *data = conn->data; /* Make sure size is unknown at this point */ data->req.size = -1; /* Set the progress data */ Curl_pgrsSetUploadCounter(data, 0); Curl_pgrsSetDownloadCounter(data, 0); Curl_pgrsSetUploadSize(data, 0); Curl_pgrsSetDownloadSize(data, 0); /* Carry out the perform */ result = pop3_perform(conn, &connected, dophase_done); /* Perform post DO phase operations if necessary */ if(!result && *dophase_done) result = pop3_dophase_done(conn, connected); return result; } static CURLcode pop3_setup_connection(struct connectdata *conn) { struct SessionHandle *data = conn->data; /* Initialise the POP3 layer */ CURLcode result = pop3_init(conn); if(result) return result; if(conn->bits.httpproxy && !data->set.tunnel_thru_httpproxy) { /* Unless we have asked to tunnel POP3 operations through the proxy, we switch and use HTTP operations only */ #ifndef CURL_DISABLE_HTTP if(conn->handler == &Curl_handler_pop3) conn->handler = &Curl_handler_pop3_proxy; else { #ifdef USE_SSL conn->handler = &Curl_handler_pop3s_proxy; #else failf(data, "POP3S not supported!"); return CURLE_UNSUPPORTED_PROTOCOL; #endif } /* set it up as an HTTP connection instead */ return conn->handler->setup_connection(conn); #else failf(data, "POP3 over http proxy requires HTTP support built-in!"); return CURLE_UNSUPPORTED_PROTOCOL; #endif } data->state.path++; /* don't include the initial slash */ return CURLE_OK; } /*********************************************************************** * * pop3_parse_url_options() * * Parse the URL login options. */ static CURLcode pop3_parse_url_options(struct connectdata *conn) { CURLcode result = CURLE_OK; struct pop3_conn *pop3c = &conn->proto.pop3c; const char *options = conn->options; const char *ptr = options; bool reset = TRUE; while(ptr && *ptr) { const char *key = ptr; while(*ptr && *ptr != '=') ptr++; if(strnequal(key, "AUTH", 4)) { size_t len = 0; const char *value = ++ptr; if(reset) { reset = FALSE; pop3c->preftype = POP3_TYPE_NONE; pop3c->prefmech = SASL_AUTH_NONE; } while(*ptr && *ptr != ';') { ptr++; len++; } if(strnequal(value, "*", len)) { pop3c->preftype = POP3_TYPE_ANY; pop3c->prefmech = SASL_AUTH_ANY; } else if(strnequal(value, "+APOP", len)) { pop3c->preftype = POP3_TYPE_APOP; pop3c->prefmech = SASL_AUTH_NONE; } else if(strnequal(value, SASL_MECH_STRING_LOGIN, len)) { pop3c->preftype = POP3_TYPE_SASL; pop3c->prefmech |= SASL_MECH_LOGIN; } else if(strnequal(value, SASL_MECH_STRING_PLAIN, len)) { pop3c->preftype = POP3_TYPE_SASL; pop3c->prefmech |= SASL_MECH_PLAIN; } else if(strnequal(value, SASL_MECH_STRING_CRAM_MD5, len)) { pop3c->preftype = POP3_TYPE_SASL; pop3c->prefmech |= SASL_MECH_CRAM_MD5; } else if(strnequal(value, SASL_MECH_STRING_DIGEST_MD5, len)) { pop3c->preftype = POP3_TYPE_SASL; pop3c->prefmech |= SASL_MECH_DIGEST_MD5; } else if(strnequal(value, SASL_MECH_STRING_GSSAPI, len)) { pop3c->preftype = POP3_TYPE_SASL; pop3c->prefmech |= SASL_MECH_GSSAPI; } else if(strnequal(value, SASL_MECH_STRING_NTLM, len)) { pop3c->preftype = POP3_TYPE_SASL; pop3c->prefmech |= SASL_MECH_NTLM; } else if(strnequal(value, SASL_MECH_STRING_XOAUTH2, len)) { pop3c->preftype = POP3_TYPE_SASL; pop3c->prefmech |= SASL_MECH_XOAUTH2; } if(*ptr == ';') ptr++; } else result = CURLE_URL_MALFORMAT; } return result; } /*********************************************************************** * * pop3_parse_url_path() * * Parse the URL path into separate path components. */ static CURLcode pop3_parse_url_path(struct connectdata *conn) { /* The POP3 struct is already initialised in pop3_connect() */ struct SessionHandle *data = conn->data; struct POP3 *pop3 = data->req.protop; const char *path = data->state.path; /* URL decode the path for the message ID */ return Curl_urldecode(data, path, 0, &pop3->id, NULL, TRUE); } /*********************************************************************** * * pop3_parse_custom_request() * * Parse the custom request. */ static CURLcode pop3_parse_custom_request(struct connectdata *conn) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct POP3 *pop3 = data->req.protop; const char *custom = data->set.str[STRING_CUSTOMREQUEST]; /* URL decode the custom request */ if(custom) result = Curl_urldecode(data, custom, 0, &pop3->custom, NULL, TRUE); return result; } /*********************************************************************** * * pop3_calc_sasl_details() * * Calculate the required login details for SASL authentication. */ static CURLcode pop3_calc_sasl_details(struct connectdata *conn, const char **mech, char **initresp, size_t *len, pop3state *state1, pop3state *state2) { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct pop3_conn *pop3c = &conn->proto.pop3c; /* Calculate the supported authentication mechanism, by decreasing order of security, as well as the initial response where appropriate */ #ifndef CURL_DISABLE_CRYPTO_AUTH if((pop3c->authmechs & SASL_MECH_DIGEST_MD5) && (pop3c->prefmech & SASL_MECH_DIGEST_MD5)) { *mech = SASL_MECH_STRING_DIGEST_MD5; *state1 = POP3_AUTH_DIGESTMD5; pop3c->authused = SASL_MECH_DIGEST_MD5; } else if((pop3c->authmechs & SASL_MECH_CRAM_MD5) && (pop3c->prefmech & SASL_MECH_CRAM_MD5)) { *mech = SASL_MECH_STRING_CRAM_MD5; *state1 = POP3_AUTH_CRAMMD5; pop3c->authused = SASL_MECH_CRAM_MD5; } else #endif #ifdef USE_NTLM if((pop3c->authmechs & SASL_MECH_NTLM) && (pop3c->prefmech & SASL_MECH_NTLM)) { *mech = SASL_MECH_STRING_NTLM; *state1 = POP3_AUTH_NTLM; *state2 = POP3_AUTH_NTLM_TYPE2MSG; pop3c->authused = SASL_MECH_NTLM; if(data->set.sasl_ir) result = Curl_sasl_create_ntlm_type1_message(conn->user, conn->passwd, &conn->ntlm, initresp, len); } else #endif if(((pop3c->authmechs & SASL_MECH_XOAUTH2) && (pop3c->prefmech & SASL_MECH_XOAUTH2) && (pop3c->prefmech != SASL_AUTH_ANY)) || conn->xoauth2_bearer) { *mech = SASL_MECH_STRING_XOAUTH2; *state1 = POP3_AUTH_XOAUTH2; *state2 = POP3_AUTH_FINAL; pop3c->authused = SASL_MECH_XOAUTH2; if(data->set.sasl_ir) result = Curl_sasl_create_xoauth2_message(data, conn->user, conn->xoauth2_bearer, initresp, len); } else if((pop3c->authmechs & SASL_MECH_LOGIN) && (pop3c->prefmech & SASL_MECH_LOGIN)) { *mech = SASL_MECH_STRING_LOGIN; *state1 = POP3_AUTH_LOGIN; *state2 = POP3_AUTH_LOGIN_PASSWD; pop3c->authused = SASL_MECH_LOGIN; if(data->set.sasl_ir) result = Curl_sasl_create_login_message(data, conn->user, initresp, len); } else if((pop3c->authmechs & SASL_MECH_PLAIN) && (pop3c->prefmech & SASL_MECH_PLAIN)) { *mech = SASL_MECH_STRING_PLAIN; *state1 = POP3_AUTH_PLAIN; *state2 = POP3_AUTH_FINAL; pop3c->authused = SASL_MECH_PLAIN; if(data->set.sasl_ir) result = Curl_sasl_create_plain_message(data, conn->user, conn->passwd, initresp, len); } return result; } /*********************************************************************** * * Curl_pop3_write() * * This function scans the body after the end-of-body and writes everything * until the end is found. */ CURLcode Curl_pop3_write(struct connectdata *conn, char *str, size_t nread) { /* This code could be made into a special function in the handler struct */ CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct SingleRequest *k = &data->req; struct pop3_conn *pop3c = &conn->proto.pop3c; bool strip_dot = FALSE; size_t last = 0; size_t i; /* Search through the buffer looking for the end-of-body marker which is 5 bytes (0d 0a 2e 0d 0a). Note that a line starting with a dot matches the eob so the server will have prefixed it with an extra dot which we need to strip out. Additionally the marker could of course be spread out over 5 different data chunks. */ for(i = 0; i < nread; i++) { size_t prev = pop3c->eob; switch(str[i]) { case 0x0d: if(pop3c->eob == 0) { pop3c->eob++; if(i) { /* Write out the body part that didn't match */ result = Curl_client_write(conn, CLIENTWRITE_BODY, &str[last], i - last); if(result) return result; last = i; } } else if(pop3c->eob == 3) pop3c->eob++; else /* If the character match wasn't at position 0 or 3 then restart the pattern matching */ pop3c->eob = 1; break; case 0x0a: if(pop3c->eob == 1 || pop3c->eob == 4) pop3c->eob++; else /* If the character match wasn't at position 1 or 4 then start the search again */ pop3c->eob = 0; break; case 0x2e: if(pop3c->eob == 2) pop3c->eob++; else if(pop3c->eob == 3) { /* We have an extra dot after the CRLF which we need to strip off */ strip_dot = TRUE; pop3c->eob = 0; } else /* If the character match wasn't at position 2 then start the search again */ pop3c->eob = 0; break; default: pop3c->eob = 0; break; } /* Did we have a partial match which has subsequently failed? */ if(prev && prev >= pop3c->eob) { /* Strip can only be non-zero for the very first mismatch after CRLF and then both prev and strip are equal and nothing will be output below */ while(prev && pop3c->strip) { prev--; pop3c->strip--; } if(prev) { /* If the partial match was the CRLF and dot then only write the CRLF as the server would have inserted the dot */ result = Curl_client_write(conn, CLIENTWRITE_BODY, (char*)POP3_EOB, strip_dot ? prev - 1 : prev); if(result) return result; last = i; strip_dot = FALSE; } } } if(pop3c->eob == POP3_EOB_LEN) { /* We have a full match so the transfer is done, however we must transfer the CRLF at the start of the EOB as this is considered to be part of the message as per RFC-1939, sect. 3 */ result = Curl_client_write(conn, CLIENTWRITE_BODY, (char *)POP3_EOB, 2); k->keepon &= ~KEEP_RECV; pop3c->eob = 0; return result; } if(pop3c->eob) /* While EOB is matching nothing should be output */ return CURLE_OK; if(nread - last) { result = Curl_client_write(conn, CLIENTWRITE_BODY, &str[last], nread - last); } return result; } #endif /* CURL_DISABLE_POP3 */ curl-7.35.0/lib/md5.c0000644000175000017500000004025112262353672011105 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_CRYPTO_AUTH #include "curl_md5.h" #include "curl_hmac.h" #include "warnless.h" #include "curl_memory.h" #if defined(USE_GNUTLS_NETTLE) #include /* The last #include file should be: */ #include "memdebug.h" typedef struct md5_ctx MD5_CTX; static void MD5_Init(MD5_CTX * ctx) { md5_init(ctx); } static void MD5_Update(MD5_CTX * ctx, const unsigned char * input, unsigned int inputLen) { md5_update(ctx, inputLen, input); } static void MD5_Final(unsigned char digest[16], MD5_CTX * ctx) { md5_digest(ctx, 16, digest); } #elif defined(USE_GNUTLS) #include /* The last #include file should be: */ #include "memdebug.h" typedef gcry_md_hd_t MD5_CTX; static void MD5_Init(MD5_CTX * ctx) { gcry_md_open(ctx, GCRY_MD_MD5, 0); } static void MD5_Update(MD5_CTX * ctx, const unsigned char * input, unsigned int inputLen) { gcry_md_write(*ctx, input, inputLen); } static void MD5_Final(unsigned char digest[16], MD5_CTX * ctx) { memcpy(digest, gcry_md_read(*ctx, 0), 16); gcry_md_close(*ctx); } #elif defined(USE_SSLEAY) /* When OpenSSL is available we use the MD5-function from OpenSSL */ # ifdef USE_OPENSSL # include # else # include # endif #elif (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && \ (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)) || \ (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && \ (__IPHONE_OS_VERSION_MAX_ALLOWED >= 20000)) /* For Apple operating systems: CommonCrypto has the functions we need. These functions are available on Tiger and later, as well as iOS 2.0 and later. If you're building for an older cat, well, sorry. Declaring the functions as static like this seems to be a bit more reliable than defining COMMON_DIGEST_FOR_OPENSSL on older cats. */ # include # define MD5_CTX CC_MD5_CTX static void MD5_Init(MD5_CTX *ctx) { CC_MD5_Init(ctx); } static void MD5_Update(MD5_CTX *ctx, const unsigned char *input, unsigned int inputLen) { CC_MD5_Update(ctx, input, inputLen); } static void MD5_Final(unsigned char digest[16], MD5_CTX *ctx) { CC_MD5_Final(digest, ctx); } #elif defined(_WIN32) #include typedef struct { HCRYPTPROV hCryptProv; HCRYPTHASH hHash; } MD5_CTX; static void MD5_Init(MD5_CTX *ctx) { if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { CryptCreateHash(ctx->hCryptProv, CALG_MD5, 0, 0, &ctx->hHash); } } static void MD5_Update(MD5_CTX *ctx, const unsigned char *input, unsigned int inputLen) { CryptHashData(ctx->hHash, (unsigned char *)input, inputLen, 0); } static void MD5_Final(unsigned char digest[16], MD5_CTX *ctx) { unsigned long length; CryptGetHashParam(ctx->hHash, HP_HASHVAL, NULL, &length, 0); if(length == 16) CryptGetHashParam(ctx->hHash, HP_HASHVAL, digest, &length, 0); if(ctx->hHash) CryptDestroyHash(ctx->hHash); if(ctx->hCryptProv) CryptReleaseContext(ctx->hCryptProv, 0); } #else /* When no other crypto library is available we use this code segment */ /* 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. */ /* 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(&context->buffer[bufindex], 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(&context->buffer[bufindex], &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); } #endif /* CRYPTO LIBS */ /* The last #include file should be: */ #include "memdebug.h" const HMAC_params Curl_HMAC_MD5[] = { { (HMAC_hinit_func) MD5_Init, /* Hash initialization function. */ (HMAC_hupdate_func) MD5_Update, /* Hash update function. */ (HMAC_hfinal_func) MD5_Final, /* Hash computation end function. */ sizeof(MD5_CTX), /* Size of hash context structure. */ 64, /* Maximum key length. */ 16 /* Result size. */ } }; const MD5_params Curl_DIGEST_MD5[] = { { (Curl_MD5_init_func) MD5_Init, /* Digest initialization function */ (Curl_MD5_update_func) MD5_Update, /* Digest update function */ (Curl_MD5_final_func) MD5_Final, /* Digest computation end function */ sizeof(MD5_CTX), /* Size of digest context struct */ 16 /* Result size */ } }; void Curl_md5it(unsigned char *outbuffer, /* 16 bytes */ const unsigned char *input) { MD5_CTX ctx; MD5_Init(&ctx); MD5_Update(&ctx, input, curlx_uztoui(strlen((char *)input))); MD5_Final(outbuffer, &ctx); } MD5_context *Curl_MD5_init(const MD5_params *md5params) { MD5_context *ctxt; /* Create MD5 context */ ctxt = malloc(sizeof *ctxt); if(!ctxt) return ctxt; ctxt->md5_hashctx = malloc(md5params->md5_ctxtsize); if(!ctxt->md5_hashctx) { free(ctxt); return NULL; } ctxt->md5_hash = md5params; (*md5params->md5_init_func)(ctxt->md5_hashctx); return ctxt; } int Curl_MD5_update(MD5_context *context, const unsigned char *data, unsigned int len) { (*context->md5_hash->md5_update_func)(context->md5_hashctx, data, len); return 0; } int Curl_MD5_final(MD5_context *context, unsigned char *result) { (*context->md5_hash->md5_final_func)(result, context->md5_hashctx); free(context->md5_hashctx); free(context); return 0; } #endif /* CURL_DISABLE_CRYPTO_AUTH */ curl-7.35.0/lib/strerror.c0000644000175000017500000007016512262353672012311 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2004 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_STRERROR_R # if (!defined(HAVE_POSIX_STRERROR_R) && \ !defined(HAVE_GLIBC_STRERROR_R) && \ !defined(HAVE_VXWORKS_STRERROR_R)) || \ (defined(HAVE_POSIX_STRERROR_R) && defined(HAVE_VXWORKS_STRERROR_R)) || \ (defined(HAVE_GLIBC_STRERROR_R) && defined(HAVE_VXWORKS_STRERROR_R)) || \ (defined(HAVE_POSIX_STRERROR_R) && defined(HAVE_GLIBC_STRERROR_R)) # error "strerror_r MUST be either POSIX, glibc or vxworks-style" # endif #endif #include #ifdef USE_LIBIDN #include #endif #include "strerror.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" 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 initialization"; 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_REMOTE_ACCESS_DENIED: return "Access denied to remote resource"; case CURLE_FTP_ACCEPT_FAILED: return "FTP: The server failed to connect to data port"; case CURLE_FTP_ACCEPT_TIMEOUT: return "FTP: Accepting server connect has timed out"; case CURLE_FTP_PRET_FAILED: return "FTP: The server did not accept the PRET command."; case CURLE_FTP_WEIRD_PASS_REPLY: return "FTP: unknown PASS 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_COULDNT_SET_TYPE: return "FTP: couldn't set file type"; 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_QUOTE_ERROR: return "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_UPLOAD_FAILED: return "Upload failed (at start/before it took off)"; case CURLE_READ_ERROR: return "Failed to open/read local data from file/application"; case CURLE_OUT_OF_MEMORY: return "Out of memory"; case CURLE_OPERATION_TIMEDOUT: return "Timeout was reached"; case CURLE_FTP_PORT_FAILED: return "FTP: command PORT failed"; case CURLE_FTP_COULDNT_USE_REST: return "FTP: command REST failed"; case CURLE_RANGE_ERROR: return "Requested range was not delivered by the server"; 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_FUNCTION_NOT_FOUND: return "A required function in the library was not found"; case CURLE_ABORTED_BY_CALLBACK: return "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_OPTION: return "An unknown option was passed in to libcurl"; case CURLE_TELNET_OPTION_SYNTAX : return "Malformed telnet option"; case CURLE_PEER_FAILED_VERIFICATION: return "SSL peer certificate or SSH remote key 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_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 given CA " "certificates"; case CURLE_SSL_CACERT_BADFILE: return "Problem with the SSL CA cert (path? access rights?)"; case CURLE_BAD_CONTENT_ENCODING: return "Unrecognized or bad HTTP Content or Transfer-Encoding"; case CURLE_LDAP_INVALID_URL: return "Invalid LDAP URL"; case CURLE_FILESIZE_EXCEEDED: return "Maximum file size exceeded"; case CURLE_USE_SSL_FAILED: return "Requested SSL level failed"; case CURLE_SSL_SHUTDOWN_FAILED: return "Failed to shut down the SSL connection"; case CURLE_SSL_CRL_BADFILE: return "Failed to load CRL file (path? access rights?, format?)"; case CURLE_SSL_ISSUER_ERROR: return "Issuer check against peer certificate failed"; case CURLE_SEND_FAIL_REWIND: return "Send failed since rewinding of the data stream failed"; case CURLE_LOGIN_DENIED: return "Login denied"; case CURLE_TFTP_NOTFOUND: return "TFTP: File Not Found"; case CURLE_TFTP_PERM: return "TFTP: Access Violation"; case CURLE_REMOTE_DISK_FULL: return "Disk full or allocation exceeded"; case CURLE_TFTP_ILLEGAL: return "TFTP: Illegal operation"; case CURLE_TFTP_UNKNOWNID: return "TFTP: Unknown transfer ID"; case CURLE_REMOTE_FILE_EXISTS: return "Remote 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"; case CURLE_REMOTE_FILE_NOT_FOUND: return "Remote file not found"; case CURLE_SSH: return "Error in the SSH layer"; case CURLE_AGAIN: return "Socket not ready for send/recv"; case CURLE_RTSP_CSEQ_ERROR: return "RTSP CSeq mismatch or invalid CSeq"; case CURLE_RTSP_SESSION_ERROR: return "RTSP session error"; case CURLE_FTP_BAD_FILE_LIST: return "Unable to parse FTP file list"; case CURLE_CHUNK_FAILED: return "Chunk callback failed"; case CURLE_NO_CONNECTION_AVAILABLE: return "The max connection limit is reached"; /* error codes not used by current libcurl */ case CURLE_OBSOLETE16: case CURLE_OBSOLETE20: case CURLE_OBSOLETE24: case CURLE_OBSOLETE29: case CURLE_OBSOLETE32: case CURLE_OBSOLETE40: case CURLE_OBSOLETE44: case CURLE_OBSOLETE46: case CURLE_OBSOLETE50: case CURLE_OBSOLETE57: 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_ADDED_ALREADY: return "The easy handle is already added to a multi handle"; 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_NOT_BUILT_IN: return "Feature not enabled in this library"; case CURLSHE_LAST: break; } return "CURLSHcode 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(err == 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" conversion 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; int old_errno = ERRNO; DEBUGASSERT(conn); DEBUGASSERT(err >= 0); buf = conn->syserr_buf; max = sizeof(conn->syserr_buf)-1; *buf = '\0'; #ifdef USE_WINSOCK #ifdef _WIN32_WCE { wchar_t wbuf[256]; wbuf[0] = L'\0'; 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) && !FormatMessageA(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 */ #if defined(HAVE_STRERROR_R) && defined(HAVE_POSIX_STRERROR_R) /* * The POSIX-style strerror_r() may set errno to ERANGE if insufficient * storage is supplied via 'strerrbuf' and 'buflen' to hold the generated * message string, or EINVAL if 'errnum' is not a valid error number. */ if(0 != strerror_r(err, buf, max)) { if('\0' == buf[0]) snprintf(buf, max, "Unknown error %d", err); } #elif defined(HAVE_STRERROR_R) && defined(HAVE_GLIBC_STRERROR_R) /* * The glibc-style 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). */ { char buffer[256]; char *msg = strerror_r(err, buffer, sizeof(buffer)); if(msg) strncpy(buf, msg, max); else snprintf(buf, max, "Unknown error %d", err); } #elif defined(HAVE_STRERROR_R) && defined(HAVE_VXWORKS_STRERROR_R) /* * The vxworks-style strerror_r() does use the buffer we pass to the function. * The buffer size should be at least MAXERRSTR_SIZE (150) defined in rtsold.h */ { char buffer[256]; if(OK == strerror_r(err, buffer)) strncpy(buf, buffer, max); else snprintf(buf, max, "Unknown error %d", err); } #else { char *msg = strerror(err); if(msg) strncpy(buf, msg, max); else snprintf(buf, max, "Unknown error %d", err); } #endif #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'; if(old_errno != ERRNO) SET_ERRNO(old_errno); 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; DEBUGASSERT(conn); buf = conn->syserr_buf; max = sizeof(conn->syserr_buf)-1; *buf = '\0'; #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 = "Round trip 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", 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 */ #ifdef USE_WINDOWS_SSPI const char *Curl_sspi_strerror (struct connectdata *conn, int err) { #ifndef CURL_DISABLE_VERBOSE_STRINGS char txtbuf[80]; char msgbuf[sizeof(conn->syserr_buf)]; char *p, *str, *msg = NULL; bool msg_formatted = FALSE; int old_errno; #endif const char *txt; char *outbuf; size_t outmax; DEBUGASSERT(conn); outbuf = conn->syserr_buf; outmax = sizeof(conn->syserr_buf)-1; *outbuf = '\0'; #ifndef CURL_DISABLE_VERBOSE_STRINGS old_errno = ERRNO; switch (err) { case SEC_E_OK: txt = "No error"; break; case SEC_E_ALGORITHM_MISMATCH: txt = "SEC_E_ALGORITHM_MISMATCH"; break; case SEC_E_BAD_BINDINGS: txt = "SEC_E_BAD_BINDINGS"; break; case SEC_E_BAD_PKGID: txt = "SEC_E_BAD_PKGID"; break; case SEC_E_BUFFER_TOO_SMALL: txt = "SEC_E_BUFFER_TOO_SMALL"; break; case SEC_E_CANNOT_INSTALL: txt = "SEC_E_CANNOT_INSTALL"; break; case SEC_E_CANNOT_PACK: txt = "SEC_E_CANNOT_PACK"; break; case SEC_E_CERT_EXPIRED: txt = "SEC_E_CERT_EXPIRED"; break; case SEC_E_CERT_UNKNOWN: txt = "SEC_E_CERT_UNKNOWN"; break; case SEC_E_CERT_WRONG_USAGE: txt = "SEC_E_CERT_WRONG_USAGE"; break; case SEC_E_CONTEXT_EXPIRED: txt = "SEC_E_CONTEXT_EXPIRED"; break; case SEC_E_CROSSREALM_DELEGATION_FAILURE: txt = "SEC_E_CROSSREALM_DELEGATION_FAILURE"; break; case SEC_E_CRYPTO_SYSTEM_INVALID: txt = "SEC_E_CRYPTO_SYSTEM_INVALID"; break; case SEC_E_DECRYPT_FAILURE: txt = "SEC_E_DECRYPT_FAILURE"; break; case SEC_E_DELEGATION_POLICY: txt = "SEC_E_DELEGATION_POLICY"; break; case SEC_E_DELEGATION_REQUIRED: txt = "SEC_E_DELEGATION_REQUIRED"; break; case SEC_E_DOWNGRADE_DETECTED: txt = "SEC_E_DOWNGRADE_DETECTED"; break; case SEC_E_ENCRYPT_FAILURE: txt = "SEC_E_ENCRYPT_FAILURE"; break; case SEC_E_ILLEGAL_MESSAGE: txt = "SEC_E_ILLEGAL_MESSAGE"; break; case SEC_E_INCOMPLETE_CREDENTIALS: txt = "SEC_E_INCOMPLETE_CREDENTIALS"; break; case SEC_E_INCOMPLETE_MESSAGE: txt = "SEC_E_INCOMPLETE_MESSAGE"; break; case SEC_E_INSUFFICIENT_MEMORY: txt = "SEC_E_INSUFFICIENT_MEMORY"; break; case SEC_E_INTERNAL_ERROR: txt = "SEC_E_INTERNAL_ERROR"; break; case SEC_E_INVALID_HANDLE: txt = "SEC_E_INVALID_HANDLE"; break; case SEC_E_INVALID_PARAMETER: txt = "SEC_E_INVALID_PARAMETER"; break; case SEC_E_INVALID_TOKEN: txt = "SEC_E_INVALID_TOKEN"; break; case SEC_E_ISSUING_CA_UNTRUSTED: txt = "SEC_E_ISSUING_CA_UNTRUSTED"; break; case SEC_E_ISSUING_CA_UNTRUSTED_KDC: txt = "SEC_E_ISSUING_CA_UNTRUSTED_KDC"; break; case SEC_E_KDC_CERT_EXPIRED: txt = "SEC_E_KDC_CERT_EXPIRED"; break; case SEC_E_KDC_CERT_REVOKED: txt = "SEC_E_KDC_CERT_REVOKED"; break; case SEC_E_KDC_INVALID_REQUEST: txt = "SEC_E_KDC_INVALID_REQUEST"; break; case SEC_E_KDC_UNABLE_TO_REFER: txt = "SEC_E_KDC_UNABLE_TO_REFER"; break; case SEC_E_KDC_UNKNOWN_ETYPE: txt = "SEC_E_KDC_UNKNOWN_ETYPE"; break; case SEC_E_LOGON_DENIED: txt = "SEC_E_LOGON_DENIED"; break; case SEC_E_MAX_REFERRALS_EXCEEDED: txt = "SEC_E_MAX_REFERRALS_EXCEEDED"; break; case SEC_E_MESSAGE_ALTERED: txt = "SEC_E_MESSAGE_ALTERED"; break; case SEC_E_MULTIPLE_ACCOUNTS: txt = "SEC_E_MULTIPLE_ACCOUNTS"; break; case SEC_E_MUST_BE_KDC: txt = "SEC_E_MUST_BE_KDC"; break; case SEC_E_NOT_OWNER: txt = "SEC_E_NOT_OWNER"; break; case SEC_E_NO_AUTHENTICATING_AUTHORITY: txt = "SEC_E_NO_AUTHENTICATING_AUTHORITY"; break; case SEC_E_NO_CREDENTIALS: txt = "SEC_E_NO_CREDENTIALS"; break; case SEC_E_NO_IMPERSONATION: txt = "SEC_E_NO_IMPERSONATION"; break; case SEC_E_NO_IP_ADDRESSES: txt = "SEC_E_NO_IP_ADDRESSES"; break; case SEC_E_NO_KERB_KEY: txt = "SEC_E_NO_KERB_KEY"; break; case SEC_E_NO_PA_DATA: txt = "SEC_E_NO_PA_DATA"; break; case SEC_E_NO_S4U_PROT_SUPPORT: txt = "SEC_E_NO_S4U_PROT_SUPPORT"; break; case SEC_E_NO_TGT_REPLY: txt = "SEC_E_NO_TGT_REPLY"; break; case SEC_E_OUT_OF_SEQUENCE: txt = "SEC_E_OUT_OF_SEQUENCE"; break; case SEC_E_PKINIT_CLIENT_FAILURE: txt = "SEC_E_PKINIT_CLIENT_FAILURE"; break; case SEC_E_PKINIT_NAME_MISMATCH: txt = "SEC_E_PKINIT_NAME_MISMATCH"; break; case SEC_E_POLICY_NLTM_ONLY: txt = "SEC_E_POLICY_NLTM_ONLY"; break; case SEC_E_QOP_NOT_SUPPORTED: txt = "SEC_E_QOP_NOT_SUPPORTED"; break; case SEC_E_REVOCATION_OFFLINE_C: txt = "SEC_E_REVOCATION_OFFLINE_C"; break; case SEC_E_REVOCATION_OFFLINE_KDC: txt = "SEC_E_REVOCATION_OFFLINE_KDC"; break; case SEC_E_SECPKG_NOT_FOUND: txt = "SEC_E_SECPKG_NOT_FOUND"; break; case SEC_E_SECURITY_QOS_FAILED: txt = "SEC_E_SECURITY_QOS_FAILED"; break; case SEC_E_SHUTDOWN_IN_PROGRESS: txt = "SEC_E_SHUTDOWN_IN_PROGRESS"; break; case SEC_E_SMARTCARD_CERT_EXPIRED: txt = "SEC_E_SMARTCARD_CERT_EXPIRED"; break; case SEC_E_SMARTCARD_CERT_REVOKED: txt = "SEC_E_SMARTCARD_CERT_REVOKED"; break; case SEC_E_SMARTCARD_LOGON_REQUIRED: txt = "SEC_E_SMARTCARD_LOGON_REQUIRED"; break; case SEC_E_STRONG_CRYPTO_NOT_SUPPORTED: txt = "SEC_E_STRONG_CRYPTO_NOT_SUPPORTED"; break; case SEC_E_TARGET_UNKNOWN: txt = "SEC_E_TARGET_UNKNOWN"; break; case SEC_E_TIME_SKEW: txt = "SEC_E_TIME_SKEW"; break; case SEC_E_TOO_MANY_PRINCIPALS: txt = "SEC_E_TOO_MANY_PRINCIPALS"; break; case SEC_E_UNFINISHED_CONTEXT_DELETED: txt = "SEC_E_UNFINISHED_CONTEXT_DELETED"; break; case SEC_E_UNKNOWN_CREDENTIALS: txt = "SEC_E_UNKNOWN_CREDENTIALS"; break; case SEC_E_UNSUPPORTED_FUNCTION: txt = "SEC_E_UNSUPPORTED_FUNCTION"; break; case SEC_E_UNSUPPORTED_PREAUTH: txt = "SEC_E_UNSUPPORTED_PREAUTH"; break; case SEC_E_UNTRUSTED_ROOT: txt = "SEC_E_UNTRUSTED_ROOT"; break; case SEC_E_WRONG_CREDENTIAL_HANDLE: txt = "SEC_E_WRONG_CREDENTIAL_HANDLE"; break; case SEC_E_WRONG_PRINCIPAL: txt = "SEC_E_WRONG_PRINCIPAL"; break; case SEC_I_COMPLETE_AND_CONTINUE: txt = "SEC_I_COMPLETE_AND_CONTINUE"; break; case SEC_I_COMPLETE_NEEDED: txt = "SEC_I_COMPLETE_NEEDED"; break; case SEC_I_CONTEXT_EXPIRED: txt = "SEC_I_CONTEXT_EXPIRED"; break; case SEC_I_CONTINUE_NEEDED: txt = "SEC_I_CONTINUE_NEEDED"; break; case SEC_I_INCOMPLETE_CREDENTIALS: txt = "SEC_I_INCOMPLETE_CREDENTIALS"; break; case SEC_I_LOCAL_LOGON: txt = "SEC_I_LOCAL_LOGON"; break; case SEC_I_NO_LSA_CONTEXT: txt = "SEC_I_NO_LSA_CONTEXT"; break; case SEC_I_RENEGOTIATE: txt = "SEC_I_RENEGOTIATE"; break; case SEC_I_SIGNATURE_NEEDED: txt = "SEC_I_SIGNATURE_NEEDED"; break; default: txt = "Unknown error"; } if(err == SEC_E_OK) strncpy(outbuf, txt, outmax); else { str = txtbuf; snprintf(txtbuf, sizeof(txtbuf), "%s (0x%04X%04X)", txt, (err >> 16) & 0xffff, err & 0xffff); txtbuf[sizeof(txtbuf)-1] = '\0'; #ifdef _WIN32_WCE { wchar_t wbuf[256]; wbuf[0] = L'\0'; if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, LANG_NEUTRAL, wbuf, sizeof(wbuf)/sizeof(wchar_t), NULL)) { wcstombs(msgbuf,wbuf,sizeof(msgbuf)-1); msg_formatted = TRUE; } } #else if(FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, LANG_NEUTRAL, msgbuf, sizeof(msgbuf)-1, NULL)) { msg_formatted = TRUE; } #endif if(msg_formatted) { msgbuf[sizeof(msgbuf)-1] = '\0'; /* strip trailing '\r\n' or '\n' */ if((p = strrchr(msgbuf,'\n')) != NULL && (p - msgbuf) >= 2) *p = '\0'; if((p = strrchr(msgbuf,'\r')) != NULL && (p - msgbuf) >= 1) *p = '\0'; msg = msgbuf; } if(msg) snprintf(outbuf, outmax, "%s - %s", str, msg); else strncpy(outbuf, str, outmax); } if(old_errno != ERRNO) SET_ERRNO(old_errno); #else if(err == SEC_E_OK) txt = "No error"; else txt = "Error"; strncpy(outbuf, txt, outmax); #endif outbuf[outmax] = '\0'; return outbuf; } #endif /* USE_WINDOWS_SSPI */ curl-7.35.0/lib/curl_ntlm_msgs.c0000644000175000017500000007270312267476320013460 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_NTLM /* * NTLM details: * * http://davenport.sourceforge.net/ntlm.html * http://www.innovation.ch/java/ntlm.html */ #define DEBUG_ME 0 #include "urldata.h" #include "non-ascii.h" #include "sendf.h" #include "curl_base64.h" #include "curl_ntlm_core.h" #include "curl_gethostname.h" #include "curl_multibyte.h" #include "warnless.h" #include "curl_memory.h" #ifdef USE_WINDOWS_SSPI # include "curl_sspi.h" #endif #include "vtls/vtls.h" #define BUILDING_CURL_NTLM_MSGS_C #include "curl_ntlm_msgs.h" #define _MPRINTF_REPLACE /* use our functions only */ #include /* The last #include file should be: */ #include "memdebug.h" /* "NTLMSSP" signature is always in ASCII regardless of the platform */ #define NTLMSSP_SIGNATURE "\x4e\x54\x4c\x4d\x53\x53\x50" #define SHORTPAIR(x) ((x) & 0xff), (((x) >> 8) & 0xff) #define LONGQUARTET(x) ((x) & 0xff), (((x) >> 8) & 0xff), \ (((x) >> 16) & 0xff), (((x) >> 24) & 0xff) #if DEBUG_ME # define DEBUG_OUT(x) x static void ntlm_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 & NTLMFLAG_NEGOTIATE_ANONYMOUS) fprintf(handle, "NTLMFLAG_NEGOTIATE_ANONYMOUS "); 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 ntlm_print_hex(FILE *handle, const char *buf, size_t len) { const char *p = buf; (void)handle; fprintf(stderr, "0x"); while(len-- > 0) fprintf(stderr, "%02.2x", (unsigned int)*p++); } #else # define DEBUG_OUT(x) Curl_nop_stmt #endif #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. * Argument is a pointer to a 4 byte buffer. */ static unsigned int readint_le(unsigned char *buf) { return ((unsigned int)buf[0]) | ((unsigned int)buf[1] << 8) | ((unsigned int)buf[2] << 16) | ((unsigned int)buf[3] << 24); } #endif /* NTLM message structure notes: A 'short' is a 'network short', a little-endian 16-bit unsigned value. A 'long' is a 'network long', a little-endian, 32-bit unsigned value. A 'security buffer' represents a triplet used to point to a buffer, consisting of two shorts and one long: 1. A 'short' containing the length of the buffer content 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 in bytes, from the beginning of the NTLM message. */ /* * Curl_ntlm_decode_type2_message() * * This is used to decode a ntlm type-2 message received from a HTTP or SASL * based (such as SMTP, POP3 or IMAP) server. The message is first decoded * from a base64 string into a raw ntlm message and checked for validity * before the appropriate data for creating a type-3 message is written to * the given ntlm data structure. * * Parameters: * * data [in] - Pointer to session handle. * header [in] - Pointer to the input buffer. * ntlm [in] - Pointer to ntlm data struct being used and modified. * * Returns CURLE_OK on success. */ CURLcode Curl_ntlm_decode_type2_message(struct SessionHandle *data, const char* header, struct ntlmdata* ntlm) { #ifndef USE_WINDOWS_SSPI static const char type2_marker[] = { 0x02, 0x00, 0x00, 0x00 }; #endif /* NTLM type-2 message structure: 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 8 bytes (two consecutive longs) (*) (40) Target Information security buffer (*) (48) OS Version Structure 8 bytes (*) 32 (48) (56) Start of data block (*) (*) -> Optional */ size_t size = 0; unsigned char *buffer = NULL; CURLcode error; #if defined(CURL_DISABLE_VERBOSE_STRINGS) || defined(USE_WINDOWS_SSPI) (void)data; #endif error = Curl_base64_decode(header, &buffer, &size); if(error) return error; if(!buffer) { infof(data, "NTLM handshake failure (unhandled condition)\n"); return CURLE_REMOTE_ACCESS_DENIED; } #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 = curlx_uztoul(size); memcpy(ntlm->type_2, buffer, size); #else ntlm->flags = 0; if((size < 32) || (memcmp(buffer, NTLMSSP_SIGNATURE, 8) != 0) || (memcmp(buffer + 8, type2_marker, sizeof(type2_marker)) != 0)) { /* This was not a good enough type-2 message */ free(buffer); infof(data, "NTLM handshake failure (bad type-2 message)\n"); return CURLE_REMOTE_ACCESS_DENIED; } ntlm->flags = readint_le(&buffer[20]); memcpy(ntlm->nonce, &buffer[24], 8); DEBUG_OUT({ fprintf(stderr, "**** TYPE2 header flags=0x%08.8lx ", ntlm->flags); ntlm_print_flags(stderr, ntlm->flags); fprintf(stderr, "\n nonce="); ntlm_print_hex(stderr, (char *)ntlm->nonce, 8); fprintf(stderr, "\n****\n"); fprintf(stderr, "**** Header %s\n ", header); }); #endif free(buffer); return CURLE_OK; } #ifdef USE_WINDOWS_SSPI void Curl_ntlm_sspi_cleanup(struct ntlmdata *ntlm) { Curl_safefree(ntlm->type_2); if(ntlm->has_handles) { s_pSecFn->DeleteSecurityContext(&ntlm->c_handle); s_pSecFn->FreeCredentialsHandle(&ntlm->handle); ntlm->has_handles = 0; } if(ntlm->p_identity) { Curl_safefree(ntlm->identity.User); Curl_safefree(ntlm->identity.Password); Curl_safefree(ntlm->identity.Domain); ntlm->p_identity = NULL; } } #endif #ifndef USE_WINDOWS_SSPI /* copy the source to the destination and fill in zeroes in every other destination byte! */ static void unicodecpy(unsigned char *dest, const char *src, size_t length) { size_t i; for(i = 0; i < length; i++) { dest[2 * i] = (unsigned char)src[i]; dest[2 * i + 1] = '\0'; } } #endif /* * Curl_ntlm_create_type1_message() * * This is used to generate an already encoded NTLM type-1 message ready for * sending to the recipient, be it a HTTP or SASL based (such as SMTP, POP3 * or IMAP) server, using the appropriate compile time crypo API. * * Parameters: * * userp [in] - The user name in the format User or Domain\User. * passdwp [in] - The user's password. * ntlm [in/out] - The ntlm data struct being used and modified. * outptr [in/out] - The address where a pointer to newly allocated memory * holding the result will be stored upon completion. * outlen [out] - The length of the output message. * * Returns CURLE_OK on success. */ CURLcode Curl_ntlm_create_type1_message(const char *userp, const char *passwdp, struct ntlmdata *ntlm, char **outptr, size_t *outlen) { /* NTLM type-1 message structure: 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) OS Version Structure 8 bytes (*) (32) (40) Start of data block (*) (*) -> Optional */ unsigned char ntlmbuf[NTLM_BUFSIZE]; size_t size; #ifdef USE_WINDOWS_SSPI SecBuffer buf; SecBufferDesc desc; SECURITY_STATUS status; unsigned long attrs; xcharp_u useranddomain; xcharp_u user, dup_user; xcharp_u domain, dup_domain; xcharp_u passwd, dup_passwd; size_t domlen = 0; TimeStamp tsDummy; /* For Windows 9x compatibility of SSPI calls */ domain.const_tchar_ptr = TEXT(""); Curl_ntlm_sspi_cleanup(ntlm); if(userp && *userp) { /* null initialize ntlm identity's data to allow proper cleanup */ ntlm->p_identity = &ntlm->identity; memset(ntlm->p_identity, 0, sizeof(*ntlm->p_identity)); useranddomain.tchar_ptr = Curl_convert_UTF8_to_tchar((char *)userp); if(!useranddomain.tchar_ptr) return CURLE_OUT_OF_MEMORY; user.const_tchar_ptr = _tcschr(useranddomain.const_tchar_ptr, TEXT('\\')); if(!user.const_tchar_ptr) user.const_tchar_ptr = _tcschr(useranddomain.const_tchar_ptr, TEXT('/')); if(user.tchar_ptr) { domain.tchar_ptr = useranddomain.tchar_ptr; domlen = user.tchar_ptr - useranddomain.tchar_ptr; user.tchar_ptr++; } else { user.tchar_ptr = useranddomain.tchar_ptr; domain.const_tchar_ptr = TEXT(""); domlen = 0; } /* setup ntlm identity's user and length */ dup_user.tchar_ptr = _tcsdup(user.tchar_ptr); if(!dup_user.tchar_ptr) { Curl_unicodefree(useranddomain.tchar_ptr); return CURLE_OUT_OF_MEMORY; } ntlm->identity.User = dup_user.tbyte_ptr; ntlm->identity.UserLength = curlx_uztoul(_tcslen(dup_user.tchar_ptr)); dup_user.tchar_ptr = NULL; /* setup ntlm identity's domain and length */ dup_domain.tchar_ptr = malloc(sizeof(TCHAR) * (domlen + 1)); if(!dup_domain.tchar_ptr) { Curl_unicodefree(useranddomain.tchar_ptr); return CURLE_OUT_OF_MEMORY; } _tcsncpy(dup_domain.tchar_ptr, domain.tchar_ptr, domlen); *(dup_domain.tchar_ptr + domlen) = TEXT('\0'); ntlm->identity.Domain = dup_domain.tbyte_ptr; ntlm->identity.DomainLength = curlx_uztoul(domlen); dup_domain.tchar_ptr = NULL; Curl_unicodefree(useranddomain.tchar_ptr); /* setup ntlm identity's password and length */ passwd.tchar_ptr = Curl_convert_UTF8_to_tchar((char *)passwdp); if(!passwd.tchar_ptr) return CURLE_OUT_OF_MEMORY; dup_passwd.tchar_ptr = _tcsdup(passwd.tchar_ptr); if(!dup_passwd.tchar_ptr) { Curl_unicodefree(passwd.tchar_ptr); return CURLE_OUT_OF_MEMORY; } ntlm->identity.Password = dup_passwd.tbyte_ptr; ntlm->identity.PasswordLength = curlx_uztoul(_tcslen(dup_passwd.tchar_ptr)); dup_passwd.tchar_ptr = NULL; Curl_unicodefree(passwd.tchar_ptr); /* setup ntlm identity's flags */ ntlm->identity.Flags = SECFLAG_WINNT_AUTH_IDENTITY; } else ntlm->p_identity = NULL; status = s_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR *) TEXT("NTLM"), SECPKG_CRED_OUTBOUND, NULL, ntlm->p_identity, NULL, NULL, &ntlm->handle, &tsDummy); if(status != SEC_E_OK) return CURLE_OUT_OF_MEMORY; desc.ulVersion = SECBUFFER_VERSION; desc.cBuffers = 1; desc.pBuffers = &buf; buf.cbBuffer = NTLM_BUFSIZE; buf.BufferType = SECBUFFER_TOKEN; buf.pvBuffer = ntlmbuf; status = s_pSecFn->InitializeSecurityContext(&ntlm->handle, NULL, (TCHAR *) TEXT(""), 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 const char *host = ""; /* empty */ const char *domain = ""; /* empty */ size_t hostlen = 0; size_t domlen = 0; size_t hostoff = 0; size_t domoff = hostoff + hostlen; /* This is 0: remember that host and domain are empty */ (void)userp; (void)passwdp; (void)ntlm; #if USE_NTLM2SESSION #define NTLM2FLAG NTLMFLAG_NEGOTIATE_NTLM2_KEY #else #define NTLM2FLAG 0 #endif snprintf((char *)ntlmbuf, NTLM_BUFSIZE, NTLMSSP_SIGNATURE "%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); ntlm_print_flags(stderr, NTLMFLAG_NEGOTIATE_OEM | NTLMFLAG_REQUEST_TARGET | NTLMFLAG_NEGOTIATE_NTLM_KEY | NTLM2FLAG | NTLMFLAG_NEGOTIATE_ALWAYS_SIGN); fprintf(stderr, "\n****\n"); }); /* Return with binary blob encoded into base64 */ return Curl_base64_encode(NULL, (char *)ntlmbuf, size, outptr, outlen); } /* * Curl_ntlm_create_type3_message() * * This is used to generate an already encoded NTLM type-3 message ready for * sending to the recipient, be it a HTTP or SASL based (such as SMTP, POP3 * or IMAP) server, using the appropriate compile time crypo API. * * Parameters: * * data [in] - The session handle. * userp [in] - The user name in the format User or Domain\User. * passdwp [in] - The user's password. * ntlm [in/out] - The ntlm data struct being used and modified. * outptr [in/out] - The address where a pointer to newly allocated memory * holding the result will be stored upon completion. * outlen [out] - The length of the output message. * * Returns CURLE_OK on success. */ CURLcode Curl_ntlm_create_type3_message(struct SessionHandle *data, const char *userp, const char *passwdp, struct ntlmdata *ntlm, char **outptr, size_t *outlen) { /* NTLM type-3 message structure: 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 Target Name security buffer 36 User Name security buffer 44 Workstation Name security buffer (52) Session Key security buffer (*) (60) Flags long (*) (64) OS Version Structure 8 bytes (*) 52 (64) (72) Start of data block (*) -> Optional */ unsigned char ntlmbuf[NTLM_BUFSIZE]; size_t size; #ifdef USE_WINDOWS_SSPI SecBuffer type_2; SecBuffer type_3; SecBufferDesc type_2_desc; SecBufferDesc type_3_desc; SECURITY_STATUS status; unsigned long attrs; TimeStamp tsDummy; /* For Windows 9x compatibility of SSPI calls */ (void)passwdp; (void)userp; (void)data; 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 = NTLM_BUFSIZE; status = s_pSecFn->InitializeSecurityContext(&ntlm->handle, &ntlm->c_handle, (TCHAR *) TEXT(""), 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; Curl_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 bool unicode = (ntlm->flags & NTLMFLAG_NEGOTIATE_UNICODE) ? TRUE : FALSE; char host[HOSTNAME_MAX + 1] = ""; const char *user; const char *domain = ""; size_t hostoff = 0; size_t useroff = 0; size_t domoff = 0; size_t hostlen = 0; size_t userlen = 0; size_t domlen = 0; CURLcode res; user = strchr(userp, '\\'); if(!user) user = strchr(userp, '/'); if(user) { domain = userp; domlen = (user - domain); user++; } else user = userp; if(user) userlen = strlen(user); /* Get the machine's un-qualified host name as NTLM doesn't like the fully qualified domain name */ if(Curl_gethostname(host, sizeof(host))) { infof(data, "gethostname() failed, continuing without!\n"); hostlen = 0; } else { hostlen = strlen(host); } if(unicode) { domlen = domlen * 2; userlen = userlen * 2; hostlen = hostlen * 2; } #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]; unsigned char entropy[8]; /* Need to create 8 bytes random data */ Curl_ssl_random(data, entropy, sizeof(entropy)); /* 8 bytes random data as challenge in lmresp */ memcpy(lmresp, entropy, 8); /* Pad with zeros */ memset(lmresp + 8, 0, 0x10); /* Fill tmp with challenge(nonce?) + entropy */ memcpy(tmp, &ntlm->nonce[0], 8); memcpy(tmp + 8, entropy, 8); Curl_ssl_md5sum(tmp, 16, md5sum, MD5_DIGEST_LENGTH); /* We shall only use the first 8 bytes of md5sum, but the des code in Curl_ntlm_core_lm_resp only encrypt the first 8 bytes */ if(CURLE_OUT_OF_MEMORY == Curl_ntlm_core_mk_nt_hash(data, passwdp, ntbuffer)) return CURLE_OUT_OF_MEMORY; Curl_ntlm_core_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 if(CURLE_OUT_OF_MEMORY == Curl_ntlm_core_mk_nt_hash(data, passwdp, ntbuffer)) return CURLE_OUT_OF_MEMORY; Curl_ntlm_core_lm_resp(ntbuffer, &ntlm->nonce[0], ntresp); #endif Curl_ntlm_core_mk_lm_hash(data, passwdp, lmbuffer); Curl_ntlm_core_lm_resp(lmbuffer, &ntlm->nonce[0], lmresp); /* A safer but less compatible alternative is: * Curl_ntlm_core_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, NTLM_BUFSIZE, NTLMSSP_SIGNATURE "%c" "\x03%c%c%c" /* 32-bit type = 3 */ "%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)); DEBUGASSERT(size == 64); DEBUGASSERT(size == (size_t)lmrespoff); /* We append the binary hashes */ if(size < (NTLM_BUFSIZE - 0x18)) { memcpy(&ntlmbuf[size], lmresp, 0x18); size += 0x18; } DEBUG_OUT({ fprintf(stderr, "**** TYPE3 header lmresp="); ntlm_print_hex(stderr, (char *)&ntlmbuf[lmrespoff], 0x18); }); #if USE_NTRESPONSES if(size < (NTLM_BUFSIZE - 0x18)) { DEBUGASSERT(size == (size_t)ntrespoff); memcpy(&ntlmbuf[size], ntresp, 0x18); size += 0x18; } DEBUG_OUT({ fprintf(stderr, "\n ntresp="); ntlm_print_hex(stderr, (char *)&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); ntlm_print_flags(stderr, ntlm->flags); fprintf(stderr, "\n****\n"); }); /* Make sure that the domain, user and host strings fit in the buffer before we copy them there. */ if(size + userlen + domlen + hostlen >= NTLM_BUFSIZE) { failf(data, "user + domain + host name too big"); return CURLE_OUT_OF_MEMORY; } DEBUGASSERT(size == domoff); if(unicode) unicodecpy(&ntlmbuf[size], domain, domlen / 2); else memcpy(&ntlmbuf[size], domain, domlen); size += domlen; DEBUGASSERT(size == useroff); if(unicode) unicodecpy(&ntlmbuf[size], user, userlen / 2); else memcpy(&ntlmbuf[size], user, userlen); size += userlen; DEBUGASSERT(size == hostoff); if(unicode) unicodecpy(&ntlmbuf[size], host, hostlen / 2); else memcpy(&ntlmbuf[size], host, hostlen); size += hostlen; /* Convert domain, user, and host to ASCII but leave the rest as-is */ res = Curl_convert_to_network(data, (char *)&ntlmbuf[domoff], size - domoff); if(res) return CURLE_CONV_FAILED; #endif /* Return with binary blob encoded into base64 */ return Curl_base64_encode(NULL, (char *)ntlmbuf, size, outptr, outlen); } #endif /* USE_NTLM */ curl-7.35.0/lib/pipeline.h0000644000175000017500000000377112270035364012232 00000000000000#ifndef HEADER_CURL_PIPELINE_H #define HEADER_CURL_PIPELINE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2013 - 2014, Linus Nielsen Feltzing, * * 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. * ***************************************************************************/ CURLcode Curl_add_handle_to_pipeline(struct SessionHandle *handle, struct connectdata *conn); void Curl_move_handle_from_send_to_recv_pipe(struct SessionHandle *handle, struct connectdata *conn); bool Curl_pipeline_penalized(struct SessionHandle *data, struct connectdata *conn); bool Curl_pipeline_site_blacklisted(struct SessionHandle *handle, struct connectdata *conn); CURLMcode Curl_pipeline_set_site_blacklist(char **sites, struct curl_llist **list_ptr); bool Curl_pipeline_server_blacklisted(struct SessionHandle *handle, char *server_name); CURLMcode Curl_pipeline_set_server_blacklist(char **servers, struct curl_llist **list_ptr); #endif /* HEADER_CURL_PIPELINE_H */ curl-7.35.0/lib/config-mac.h0000644000175000017500000000771012213173003012413 00000000000000#ifndef HEADER_CURL_CONFIG_MAC_H #define HEADER_CURL_CONFIG_MAC_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ /* =================================================================== */ /* Hand crafted config file for Mac OS 9 */ /* =================================================================== */ /* On Mac OS X you must run configure to generate curl_config.h file */ /* =================================================================== */ #define OS "mac" /* Define if you want the built-in manual */ #define USE_MANUAL 1 #define HAVE_ERRNO_H 1 #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_STDLIB_H 1 #define HAVE_TIME_H 1 #define HAVE_UTIME_H 1 #define HAVE_SYS_TIME_H 1 #define HAVE_SYS_UTIME_H 1 #define TIME_WITH_SYS_TIME 1 #define HAVE_ALARM 1 #define HAVE_FTRUNCATE 1 #define HAVE_UTIME 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_SIGACTION 1 #define HAVE_SIGNAL_H 1 #define HAVE_SIG_ATOMIC_T 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_IOCTL 1 #define HAVE_IOCTL_FIONBIO 1 #define RETSIGTYPE void #define SIZEOF_INT 4 #define SIZEOF_SHORT 2 #define SIZEOF_SIZE_T 4 #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_RECVFROM 1 #define RECVFROM_TYPE_ARG1 int #define RECVFROM_TYPE_ARG2 void #define RECVFROM_TYPE_ARG3 size_t #define RECVFROM_TYPE_ARG4 int #define RECVFROM_TYPE_ARG5 struct sockaddr #define RECVFROM_TYPE_ARG6 int #define RECVFROM_TYPE_RETV ssize_t #define RECVFROM_TYPE_ARG2_IS_VOID 1 #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 #define HAVE_EXTRA_STRICMP_H 1 #define HAVE_EXTRA_STRDUP_H 1 #endif /* HEADER_CURL_CONFIG_MAC_H */ curl-7.35.0/lib/escape.c0000644000175000017500000001463512262353672011667 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* Escape and unescape URL encoding in strings. The functions return a new * allocated string or NULL if an error occurred. */ #include "curl_setup.h" #include #include "curl_memory.h" #include "urldata.h" #include "warnless.h" #include "non-ascii.h" #include "escape.h" #define _MPRINTF_REPLACE /* use our functions only */ #include /* The last #include file should be: */ #include "memdebug.h" /* Portable character check (remember EBCDIC). Do not use isalnum() because its behavior is altered by the current locale. See http://tools.ietf.org/html/rfc3986#section-2.3 */ static bool Curl_isunreserved(unsigned char in) { switch (in) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': case '-': case '.': case '_': case '~': return TRUE; default: break; } return FALSE; } /* 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; /* we need to treat the characters unsigned */ size_t newlen = alloc; size_t strindex=0; size_t length; CURLcode res; ns = malloc(alloc); if(!ns) return NULL; length = alloc-1; while(length--) { in = *string; if(Curl_isunreserved(in)) /* just copy this */ ns[strindex++]=in; else { /* 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; } } res = Curl_convert_to_network(handle, &in, 1); if(res) { /* Curl_convert_to_network calls failf if unsuccessful */ free(ns); return NULL; } snprintf(&ns[strindex], 4, "%%%02X", in); strindex+=3; } string++; } ns[strindex]=0; /* terminate it */ return ns; } /* * Curl_urldecode() URL decodes the given string. * * Optionally detects control characters (byte codes lower than 32) in the * data and rejects such data. * * Returns a pointer to a malloced string in *ostring with length given in * *olen. If length == 0, the length is assumed to be strlen(string). * */ CURLcode Curl_urldecode(struct SessionHandle *data, const char *string, size_t length, char **ostring, size_t *olen, bool reject_ctrl) { size_t alloc = (length?length:strlen(string))+1; char *ns = malloc(alloc); unsigned char in; size_t strindex=0; unsigned long hex; CURLcode res; if(!ns) return CURLE_OUT_OF_MEMORY; while(--alloc > 0) { in = *string; if(('%' == in) && (alloc > 2) && 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 = strtoul(hexstr, &ptr, 16); in = curlx_ultouc(hex); /* this long is never bigger than 255 anyway */ res = Curl_convert_from_network(data, &in, 1); if(res) { /* Curl_convert_from_network calls failf if unsuccessful */ free(ns); return res; } string+=2; alloc-=2; } if(reject_ctrl && (in < 0x20)) { free(ns); return CURLE_URL_MALFORMAT; } ns[strindex++] = in; string++; } ns[strindex]=0; /* terminate it */ if(olen) /* store output size */ *olen = strindex; if(ostring) /* store output string */ *ostring = ns; return CURLE_OK; } /* * Unescapes the given URL escaped string of given length. Returns a * pointer to a malloced string with length given in *olen. * If length == 0, the length is assumed to be strlen(string). * If olen == NULL, no output length is stored. */ char *curl_easy_unescape(CURL *handle, const char *string, int length, int *olen) { char *str = NULL; size_t inputlen = length; size_t outputlen; CURLcode res = Curl_urldecode(handle, string, inputlen, &str, &outputlen, FALSE); if(res) return NULL; if(olen) *olen = curlx_uztosi(outputlen); return str; } /* For operating systems/environments that use different malloc/free systems 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); } curl-7.35.0/lib/socks.h0000644000175000017500000000533012213173003011526 00000000000000#ifndef HEADER_CURL_SOCKS_H #define HEADER_CURL_SOCKS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef CURL_DISABLE_PROXY #define Curl_SOCKS4(a,b,c,d,e,f) CURLE_NOT_BUILT_IN #define Curl_SOCKS5(a,b,c,d,e,f) CURLE_NOT_BUILT_IN #else /* * 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... */ int Curl_blockread_all(struct connectdata *conn, curl_socket_t sockfd, char *buf, ssize_t buffersize, ssize_t *n); /* * This function logs in to a SOCKS4(a) proxy and sends the specifics to the * final destination server. */ CURLcode Curl_SOCKS4(const char *proxy_name, const char *hostname, int remote_port, int sockindex, struct connectdata *conn, bool protocol4a); /* * 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, const char *hostname, int remote_port, int sockindex, struct connectdata *conn); #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) /* * This function handles the sockss5 gssapie negotiation and initialisation */ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex, struct connectdata *conn); #endif #endif /* CURL_DISABLE_PROXY */ #endif /* HEADER_CURL_SOCKS_H */ curl-7.35.0/lib/http_proxy.c0000644000175000017500000005232212270035364012634 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP) #include "urldata.h" #include #include "http_proxy.h" #include "sendf.h" #include "http.h" #include "url.h" #include "select.h" #include "rawstr.h" #include "progress.h" #include "non-ascii.h" #include "connect.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curlx.h" #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" CURLcode Curl_proxy_connect(struct connectdata *conn) { if(conn->bits.tunnel_proxy && conn->bits.httpproxy) { #ifndef CURL_DISABLE_PROXY /* for [protocol] tunneled through HTTP proxy */ struct HTTP http_proxy; void *prot_save; CURLcode result; /* BLOCKING */ /* We want "seamless" operations through HTTP proxy tunnel */ /* Curl_proxyCONNECT is based on a pointer to a struct HTTP at the * member conn->proto.http; we want [protocol] 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 pointer * * This function might be called several times in the multi interface case * if the proxy's CONNTECT response is not instant. */ prot_save = conn->data->req.protop; memset(&http_proxy, 0, sizeof(http_proxy)); conn->data->req.protop = &http_proxy; conn->bits.close = FALSE; result = Curl_proxyCONNECT(conn, FIRSTSOCKET, conn->host.name, conn->remote_port); conn->data->req.protop = prot_save; if(CURLE_OK != result) return result; #else return CURLE_NOT_BUILT_IN; #endif } /* no HTTP tunnel proxy, just return */ return CURLE_OK; } /* * 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. */ CURLcode Curl_proxyCONNECT(struct connectdata *conn, int sockindex, const char *hostname, unsigned short remote_port) { int subversion=0; struct SessionHandle *data=conn->data; struct SingleRequest *k = &data->req; CURLcode result; long timeout = data->set.timeout?data->set.timeout:PROXY_TIMEOUT; /* in milliseconds */ curl_socket_t tunnelsocket = conn->sock[sockindex]; curl_off_t cl=0; bool closeConnection = FALSE; bool chunked_encoding = FALSE; long check; #define SELECT_OK 0 #define SELECT_ERROR 1 #define SELECT_TIMEOUT 2 int error = SELECT_OK; if(conn->tunnel_state[sockindex] == TUNNEL_COMPLETE) return CURLE_OK; /* CONNECT is already completed */ conn->bits.proxy_connect_closed = FALSE; do { if(TUNNEL_INIT == conn->tunnel_state[sockindex]) { /* BEGIN CONNECT PHASE */ char *host_port; Curl_send_buffer *req_buffer; infof(data, "Establish HTTP proxy tunnel to %s:%hu\n", hostname, remote_port); if(data->req.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->req.newurl); data->req.newurl = NULL; } /* initialize a dynamic send-buffer */ req_buffer = Curl_add_buffer_init(); if(!req_buffer) return CURLE_OUT_OF_MEMORY; host_port = aprintf("%s:%hu", hostname, remote_port); if(!host_port) { free(req_buffer); return CURLE_OUT_OF_MEMORY; } /* Setup the proxy-authorization header, if any */ result = Curl_http_output_auth(conn, "CONNECT", host_port, TRUE); free(host_port); if(CURLE_OK == result) { char *host=(char *)""; const char *proxyconn=""; const char *useragent=""; const char *http = (conn->proxytype == CURLPROXY_HTTP_1_0) ? "1.0" : "1.1"; char *hostheader= /* host:port with IPv6 support */ aprintf("%s%s%s:%hu", conn->bits.ipv6_ip?"[":"", hostname, conn->bits.ipv6_ip?"]":"", remote_port); if(!hostheader) { free(req_buffer); return CURLE_OUT_OF_MEMORY; } if(!Curl_checkheaders(data, "Host:")) { host = aprintf("Host: %s\r\n", hostheader); if(!host) { free(hostheader); free(req_buffer); return CURLE_OUT_OF_MEMORY; } } if(!Curl_checkheaders(data, "Proxy-Connection:")) proxyconn = "Proxy-Connection: Keep-Alive\r\n"; if(!Curl_checkheaders(data, "User-Agent:") && data->set.str[STRING_USERAGENT]) useragent = conn->allocptr.uagent; result = Curl_add_bufferf(req_buffer, "CONNECT %s HTTP/%s\r\n" "%s" /* Host: */ "%s" /* Proxy-Authorization */ "%s" /* User-Agent */ "%s", /* Proxy-Connection */ hostheader, http, host, conn->allocptr.proxyuserpwd? conn->allocptr.proxyuserpwd:"", useragent, proxyconn); if(host && *host) free(host); free(hostheader); if(CURLE_OK == result) result = Curl_add_custom_headers(conn, req_buffer); if(CURLE_OK == result) /* CRLF terminate the request */ result = Curl_add_bufferf(req_buffer, "\r\n"); if(CURLE_OK == result) { /* Send the connect request to the proxy */ /* BLOCKING */ result = Curl_add_buffer_send(req_buffer, conn, &data->info.request_size, 0, sockindex); } req_buffer = NULL; if(result) failf(data, "Failed sending CONNECT to proxy"); } Curl_safefree(req_buffer); if(result) return result; conn->tunnel_state[sockindex] = TUNNEL_CONNECT; /* now we've issued the CONNECT and we're waiting to hear back, return and get called again polling-style */ return CURLE_OK; } /* END CONNECT PHASE */ { /* BEGIN NEGOTIATION PHASE */ size_t nread; /* total size read */ int perline; /* count bytes per line */ int keepon=TRUE; ssize_t gotbytes; char *ptr; char *line_start; ptr=data->state.buffer; line_start = ptr; nread=0; perline=0; keepon=TRUE; while((nreadnow); /* spent time */ if(check <= 0) { failf(data, "Proxy CONNECT aborted due to timeout"); error = SELECT_TIMEOUT; /* already too little time */ break; } /* loop every second at least, less if the timeout is near */ switch (Curl_socket_ready(tunnelsocket, CURL_SOCKET_BAD, check<1000L?check:1000)) { case -1: /* select() error, stop reading */ error = SELECT_ERROR; failf(data, "Proxy CONNECT aborted due to select/poll error"); break; case 0: /* timeout */ break; default: DEBUGASSERT(ptr+BUFSIZE-nread <= data->state.buffer+BUFSIZE+1); result = Curl_read(conn, tunnelsocket, ptr, BUFSIZE-nread, &gotbytes); if(result==CURLE_AGAIN) continue; /* go loop yourself */ else if(result) keepon = FALSE; else if(gotbytes <= 0) { keepon = FALSE; if(data->set.proxyauth && data->state.authproxy.avail) { /* proxy auth was requested and there was proxy auth available, then deem this as "mere" proxy disconnect */ conn->bits.proxy_connect_closed = TRUE; } else { 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 */ nread = 0; /* make next read start over in the read buffer */ ptr=data->state.buffer; if(cl) { /* A Content-Length based body: simply count down the counter and make sure to break out of the loop when we're done! */ cl -= gotbytes; if(cl<=0) { keepon = FALSE; break; } } else { /* chunked-encoded body, so we need to do the chunked dance properly to know when the end of the body is reached */ CHUNKcode r; ssize_t tookcareof=0; /* now parse the chunked piece of data so that we can properly tell when the stream ends */ r = Curl_httpchunk_read(conn, ptr, gotbytes, &tookcareof); if(r == CHUNKE_STOP) { /* we're done reading chunks! */ infof(data, "chunk reading DONE\n"); keepon = FALSE; /* we did the full CONNECT treatment, go COMPLETE */ conn->tunnel_state[sockindex] = TUNNEL_COMPLETE; } else infof(data, "Read %zd bytes of chunk, continue\n", tookcareof); } } else for(i = 0; i < gotbytes; ptr++, i++) { perline++; /* amount of bytes in this line so far */ if(*ptr == 0x0a) { char letter; int writetype; /* convert from the network encoding */ result = Curl_convert_from_network(data, line_start, perline); /* Curl_convert_from_network calls failf if unsuccessful */ if(result) return result; /* 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); data->info.header_size += (long)perline; data->req.headerbytecount += (long)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 */ nread = 0; /* make next read start over in the read buffer */ ptr=data->state.buffer; if((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; if(cl) { infof(data, "Ignore %" CURL_FORMAT_CURL_OFF_T " bytes of response-body\n", cl); /* remove the remaining chunk of what we already read */ cl -= (gotbytes - i); if(cl<=0) /* if the whole thing was already read, we are done! */ keepon=FALSE; } else if(chunked_encoding) { CHUNKcode r; /* We set ignorebody true here since the chunked decoder function will acknowledge that. Pay attention so that this is cleared again when this function returns! */ k->ignorebody = TRUE; infof(data, "%zd bytes of chunk left\n", gotbytes-i); if(line_start[1] == '\n') { /* this can only be a LF if the letter at index 0 was a CR */ line_start++; i++; } /* now parse the chunked piece of data so that we can properly tell when the stream ends */ r = Curl_httpchunk_read(conn, line_start+1, gotbytes -i, &gotbytes); if(r == CHUNKE_STOP) { /* we're done reading chunks! */ infof(data, "chunk reading DONE\n"); keepon = FALSE; /* we did the full CONNECT treatment, go to COMPLETE */ conn->tunnel_state[sockindex] = TUNNEL_COMPLETE; } else infof(data, "Read %zd bytes of chunk, continue\n", gotbytes); } else { /* without content-length or chunked encoding, we can't keep the connection alive since the close is the end signal so we bail out at once instead */ keepon=FALSE; } } else { keepon = FALSE; if(200 == data->info.httpproxycode) { if(gotbytes - (i+1)) failf(data, "Proxy CONNECT followed by %zd bytes " "of opaque data. Data ignored (known bug #39)", gotbytes - (i+1)); } } /* we did the full CONNECT treatment, go to COMPLETE */ conn->tunnel_state[sockindex] = TUNNEL_COMPLETE; 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))) { bool proxy = (k->httpcode == 407) ? TRUE : FALSE; char *auth = Curl_copy_header_value(line_start); if(!auth) return CURLE_OUT_OF_MEMORY; result = Curl_http_input_auth(conn, proxy, auth); Curl_safefree(auth); if(result) return result; } else if(checkprefix("Content-Length:", line_start)) { cl = curlx_strtoofft(line_start + strlen("Content-Length:"), NULL, 10); } else if(Curl_compareheader(line_start, "Connection:", "close")) closeConnection = TRUE; else if(Curl_compareheader(line_start, "Transfer-Encoding:", "chunked")) { infof(data, "CONNECT responded chunked\n"); chunked_encoding = TRUE; /* init our chunky engine */ Curl_httpchunk_init(conn); } else if(Curl_compareheader(line_start, "Proxy-Connection:", "close")) closeConnection = TRUE; 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 */ if(Curl_pgrsUpdate(conn)) return CURLE_ABORTED_BY_CALLBACK; } /* 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. */ result = Curl_http_auth_act(conn); if(result) return result; if(conn->bits.close) /* the connection has been marked for closure, most likely in the Curl_http_auth_act() function and thus we can kill it at once below */ closeConnection = TRUE; } if(closeConnection && data->req.newurl) { /* Connection closed by server. Don't use it anymore */ Curl_closesocket(conn, conn->sock[sockindex]); conn->sock[sockindex] = CURL_SOCKET_BAD; break; } } /* END NEGOTIATION PHASE */ /* If we are supposed to continue and request a new URL, which basically * means the HTTP authentication is still going on so if the tunnel * is complete we start over in INIT state */ if(data->req.newurl && (TUNNEL_COMPLETE == conn->tunnel_state[sockindex])) { conn->tunnel_state[sockindex] = TUNNEL_INIT; infof(data, "TUNNEL_STATE switched to: %d\n", conn->tunnel_state[sockindex]); } } while(data->req.newurl); if(200 != data->req.httpcode) { failf(data, "Received HTTP code %d from proxy after CONNECT", data->req.httpcode); if(closeConnection && data->req.newurl) conn->bits.proxy_connect_closed = TRUE; if(data->req.newurl) { /* this won't be used anymore for the CONNECT so free it now */ free(data->req.newurl); data->req.newurl = NULL; } /* to back to init state */ conn->tunnel_state[sockindex] = TUNNEL_INIT; return CURLE_RECV_ERROR; } conn->tunnel_state[sockindex] = TUNNEL_COMPLETE; /* 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"); data->req.ignorebody = FALSE; /* put it (back) to non-ignore state */ conn->bits.rewindaftersend = FALSE; /* make sure this isn't set for the document request */ return CURLE_OK; } #endif /* CURL_DISABLE_PROXY */ curl-7.35.0/lib/strtok.h0000644000175000017500000000243712213173003011737 00000000000000#ifndef HEADER_CURL_STRTOK_H #define HEADER_CURL_STRTOK_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ #include "curl_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 /* HEADER_CURL_STRTOK_H */ curl-7.35.0/lib/config-dos.h0000644000175000017500000001251012213173003012432 00000000000000#ifndef HEADER_CURL_CONFIG_DOS_H #define HEADER_CURL_CONFIG_DOS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ /* ================================================================ */ /* lib/config-dos.h - Hand crafted config file for DOS */ /* ================================================================ */ #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_ARPA_INET_H 1 #define HAVE_ERRNO_H 1 #define HAVE_FCNTL_H 1 #define HAVE_GETADDRINFO 1 #define HAVE_GETNAMEINFO 1 #define HAVE_GETPROTOBYNAME 1 #define HAVE_GETTIMEOFDAY 1 #define HAVE_IO_H 1 #define HAVE_IOCTL 1 #define HAVE_IOCTL_FIONBIO 1 #define HAVE_IOCTLSOCKET 1 #define HAVE_IOCTLSOCKET_FIONBIO 1 #define HAVE_LIMITS_H 1 #define HAVE_LOCALE_H 1 #define HAVE_LONGLONG 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_RECV 1 #define HAVE_RECVFROM 1 #define HAVE_SELECT 1 #define HAVE_SEND 1 #define HAVE_SETJMP_H 1 #define HAVE_SETLOCALE 1 #define HAVE_SETMODE 1 #define HAVE_SIGNAL 1 #define HAVE_SOCKET 1 #define HAVE_SPNEGO 1 #define HAVE_STRDUP 1 #define HAVE_STRICMP 1 #define HAVE_STRTOLL 1 #define HAVE_STRUCT_TIMEVAL 1 #define HAVE_STRUCT_IN6_ADDR 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_TIME_H 1 #define HAVE_UNISTD_H 1 #define NEED_MALLOC_H 1 #define RETSIGTYPE void #define SIZEOF_INT 4 #define SIZEOF_LONG_DOUBLE 16 #define SIZEOF_SHORT 2 #define SIZEOF_SIZE_T 4 #define STDC_HEADERS 1 #define TIME_WITH_SYS_TIME 1 /* Qualifiers for send(), recv(), recvfrom() and getnameinfo(). */ #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 RECVFROM_TYPE_ARG1 int #define RECVFROM_TYPE_ARG2 void #define RECVFROM_TYPE_ARG3 int #define RECVFROM_TYPE_ARG4 int #define RECVFROM_TYPE_ARG5 struct sockaddr #define RECVFROM_TYPE_ARG6 int #define RECVFROM_TYPE_RETV int #define RECVFROM_TYPE_ARG2_IS_VOID 1 #define GETNAMEINFO_QUAL_ARG1 const #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * #define GETNAMEINFO_TYPE_ARG2 int #define GETNAMEINFO_TYPE_ARG46 int #define GETNAMEINFO_TYPE_ARG7 int #define BSD /* CURLDEBUG definition enables memory tracking */ /* #define CURLDEBUG */ /* USE_ZLIB on cmd-line */ #ifdef USE_ZLIB #define HAVE_ZLIB_H 1 #define HAVE_LIBZ 1 #endif /* USE_SSLEAY on cmd-line */ #ifdef USE_SSLEAY #define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1 #define HAVE_OPENSSL_ENGINE_H 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 #if defined(__HIGHC__) || \ (defined(__GNUC__) && (__GNUC__ < 4)) #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 #define HAVE_TERMIOS_H 1 #define HAVE_VARIADIC_MACROS_GCC 1 /* 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 #define strerror(e) strerror_s_((e)) #endif #ifdef MSDOS /* Watt-32 */ #define HAVE_CLOSE_S 1 #endif #undef word #undef byte #endif /* HEADER_CURL_CONFIG_DOS_H */ curl-7.35.0/lib/curl_ntlm_core.h0000644000175000017500000000466412267476320013445 00000000000000#ifndef HEADER_CURL_NTLM_CORE_H #define HEADER_CURL_NTLM_CORE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #if defined(USE_NTLM) && !defined(USE_WINDOWS_SSPI) #ifdef USE_SSLEAY # if !defined(OPENSSL_VERSION_NUMBER) && \ !defined(HEADER_SSL_H) && !defined(HEADER_MD5_H) # error "curl_ntlm_core.h shall not be included before OpenSSL headers." # endif # ifdef OPENSSL_NO_MD4 # define USE_NTRESPONSES 0 # define USE_NTLM2SESSION 0 # endif #endif /* * Define USE_NTRESPONSES to 1 in order to make the type-3 message include * the NT response message. Define USE_NTLM2SESSION to 1 in order to make * the type-3 message include the NTLM2Session response message, requires * USE_NTRESPONSES defined to 1. */ #ifndef USE_NTRESPONSES # define USE_NTRESPONSES 1 # define USE_NTLM2SESSION 1 #endif void Curl_ntlm_core_lm_resp(const unsigned char *keys, const unsigned char *plaintext, unsigned char *results); void Curl_ntlm_core_mk_lm_hash(struct SessionHandle *data, const char *password, unsigned char *lmbuffer /* 21 bytes */); #if USE_NTRESPONSES CURLcode Curl_ntlm_core_mk_nt_hash(struct SessionHandle *data, const char *password, unsigned char *ntbuffer /* 21 bytes */); #endif #endif /* USE_NTLM && !USE_WINDOWS_SSPI */ #endif /* HEADER_CURL_NTLM_CORE_H */ curl-7.35.0/lib/non-ascii.h0000644000175000017500000000510312213173003012262 00000000000000#ifndef HEADER_CURL_NON_ASCII_H #define HEADER_CURL_NON_ASCII_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef CURL_DOES_CONVERSIONS #include "urldata.h" /* * Curl_convert_clone() returns a malloced copy of the source string (if * returning CURLE_OK), with the data converted to network format. * * If no conversion was needed *outbuf may be NULL. */ CURLcode Curl_convert_clone(struct SessionHandle *data, const char *indata, size_t insize, char **outbuf); void Curl_convert_init(struct SessionHandle *data); void Curl_convert_setup(struct SessionHandle *data); void Curl_convert_close(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); CURLcode Curl_convert_form(struct SessionHandle *data, struct FormData *form); #else #define Curl_convert_clone(a,b,c,d) ((void)a, CURLE_OK) #define Curl_convert_init(x) Curl_nop_stmt #define Curl_convert_setup(x) Curl_nop_stmt #define Curl_convert_close(x) Curl_nop_stmt #define Curl_convert_to_network(a,b,c) ((void)a, CURLE_OK) #define Curl_convert_from_network(a,b,c) ((void)a, CURLE_OK) #define Curl_convert_from_utf8(a,b,c) ((void)a, CURLE_OK) #define Curl_convert_form(a,b) CURLE_OK #endif #endif /* HEADER_CURL_NON_ASCII_H */ curl-7.35.0/lib/README.memoryleak0000644000175000017500000000365012213173003013262 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| 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. curl-7.35.0/lib/ldap.c0000644000175000017500000005121012262353672011335 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #if !defined(CURL_DISABLE_LDAP) && !defined(USE_OPENLDAP) /* * Notice that USE_OPENLDAP is only a source code selection switch. When * libcurl is built with USE_OPENLDAP defined the libcurl source code that * gets compiled is the code from openldap.c, otherwise the code that gets * compiled is the code from ldap.c. * * When USE_OPENLDAP is defined a recent version of the OpenLDAP library * might be required for compilation and runtime. In order to use ancient * OpenLDAP library versions, USE_OPENLDAP shall not be defined. */ #ifdef CURL_LDAP_WIN /* Use Windows LDAP implementation. */ # include # ifndef LDAP_VENDOR_NAME # error Your Platform SDK is NOT sufficient for LDAP support! \ Update your Platform SDK, or disable LDAP support! # else # include # endif #else # define LDAP_DEPRECATED 1 /* Be sure ldap_init() is defined. */ # ifdef HAVE_LBER_H # include # endif # include # if (defined(HAVE_LDAP_SSL) && defined(HAVE_LDAP_SSL_H)) # include # endif /* HAVE_LDAP_SSL && HAVE_LDAP_SSL_H */ #endif #include "urldata.h" #include #include "sendf.h" #include "escape.h" #include "progress.h" #include "transfer.h" #include "strequal.h" #include "strtok.h" #include "curl_ldap.h" #include "curl_memory.h" #include "curl_base64.h" #include "rawstr.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "memdebug.h" #ifndef HAVE_LDAP_URL_PARSE /* Use our own implementation. */ typedef struct { char *lud_host; int lud_port; char *lud_dn; char **lud_attrs; int lud_scope; char *lud_filter; char **lud_exts; size_t lud_attrs_dups; /* how many were dup'ed, this field is not in the "real" struct so can only be used in code without HAVE_LDAP_URL_PARSE defined */ } CURL_LDAPURLDesc; #undef LDAPURLDesc #define LDAPURLDesc CURL_LDAPURLDesc static int _ldap_url_parse (const struct connectdata *conn, LDAPURLDesc **ludp); static void _ldap_free_urldesc (LDAPURLDesc *ludp); #undef ldap_free_urldesc #define ldap_free_urldesc _ldap_free_urldesc #endif #ifdef DEBUG_LDAP #define LDAP_TRACE(x) do { \ _ldap_trace ("%u: ", __LINE__); \ _ldap_trace x; \ } WHILE_FALSE static void _ldap_trace (const char *fmt, ...); #else #define LDAP_TRACE(x) Curl_nop_stmt #endif static CURLcode Curl_ldap(struct connectdata *conn, bool *done); /* * LDAP protocol handler. */ const struct Curl_handler Curl_handler_ldap = { "LDAP", /* scheme */ ZERO_NULL, /* setup_connection */ Curl_ldap, /* do_it */ ZERO_NULL, /* done */ ZERO_NULL, /* do_more */ ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_LDAP, /* defport */ CURLPROTO_LDAP, /* protocol */ PROTOPT_NONE /* flags */ }; #ifdef HAVE_LDAP_SSL /* * LDAPS protocol handler. */ const struct Curl_handler Curl_handler_ldaps = { "LDAPS", /* scheme */ ZERO_NULL, /* setup_connection */ Curl_ldap, /* do_it */ ZERO_NULL, /* done */ ZERO_NULL, /* do_more */ ZERO_NULL, /* connect_it */ ZERO_NULL, /* connecting */ ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ ZERO_NULL, /* doing_getsock */ ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ PORT_LDAPS, /* defport */ CURLPROTO_LDAP | CURLPROTO_LDAPS, /* protocol */ PROTOPT_SSL /* flags */ }; #endif static CURLcode Curl_ldap(struct connectdata *conn, bool *done) { CURLcode status = CURLE_OK; int rc = 0; LDAP *server = NULL; LDAPURLDesc *ludp = NULL; LDAPMessage *result = NULL; LDAPMessage *entryIterator; int num = 0; struct SessionHandle *data=conn->data; int ldap_proto = LDAP_VERSION3; int ldap_ssl = 0; char *val_b64 = NULL; size_t val_b64_sz = 0; curl_off_t dlsize = 0; #ifdef LDAP_OPT_NETWORK_TIMEOUT struct timeval ldap_timeout = {10,0}; /* 10 sec connection/search timeout */ #endif *done = TRUE; /* unconditionally */ infof(data, "LDAP local: LDAP Vendor = %s ; LDAP Version = %d\n", LDAP_VENDOR_NAME, LDAP_VENDOR_VERSION); infof(data, "LDAP local: %s\n", data->change.url); #ifdef HAVE_LDAP_URL_PARSE rc = ldap_url_parse(data->change.url, &ludp); #else rc = _ldap_url_parse(conn, &ludp); #endif if(rc != 0) { failf(data, "LDAP local: %s", ldap_err2string(rc)); status = CURLE_LDAP_INVALID_URL; goto quit; } /* Get the URL scheme ( either ldap or ldaps ) */ if(conn->given->flags & PROTOPT_SSL) ldap_ssl = 1; infof(data, "LDAP local: trying to establish %s connection\n", ldap_ssl ? "encrypted" : "cleartext"); #ifdef LDAP_OPT_NETWORK_TIMEOUT ldap_set_option(NULL, LDAP_OPT_NETWORK_TIMEOUT, &ldap_timeout); #endif ldap_set_option(NULL, LDAP_OPT_PROTOCOL_VERSION, &ldap_proto); if(ldap_ssl) { #ifdef HAVE_LDAP_SSL #ifdef CURL_LDAP_WIN /* Win32 LDAP SDK doesn't support insecure mode without CA! */ server = ldap_sslinit(conn->host.name, (int)conn->port, 1); ldap_set_option(server, LDAP_OPT_SSL, LDAP_OPT_ON); #else int ldap_option; char* ldap_ca = data->set.str[STRING_SSL_CAFILE]; #if defined(CURL_HAS_NOVELL_LDAPSDK) rc = ldapssl_client_init(NULL, NULL); if(rc != LDAP_SUCCESS) { failf(data, "LDAP local: ldapssl_client_init %s", ldap_err2string(rc)); status = CURLE_SSL_CERTPROBLEM; goto quit; } if(data->set.ssl.verifypeer) { /* Novell SDK supports DER or BASE64 files. */ int cert_type = LDAPSSL_CERT_FILETYPE_B64; if((data->set.str[STRING_CERT_TYPE]) && (Curl_raw_equal(data->set.str[STRING_CERT_TYPE], "DER"))) cert_type = LDAPSSL_CERT_FILETYPE_DER; if(!ldap_ca) { failf(data, "LDAP local: ERROR %s CA cert not set!", (cert_type == LDAPSSL_CERT_FILETYPE_DER ? "DER" : "PEM")); status = CURLE_SSL_CERTPROBLEM; goto quit; } infof(data, "LDAP local: using %s CA cert '%s'\n", (cert_type == LDAPSSL_CERT_FILETYPE_DER ? "DER" : "PEM"), ldap_ca); rc = ldapssl_add_trusted_cert(ldap_ca, cert_type); if(rc != LDAP_SUCCESS) { failf(data, "LDAP local: ERROR setting %s CA cert: %s", (cert_type == LDAPSSL_CERT_FILETYPE_DER ? "DER" : "PEM"), ldap_err2string(rc)); status = CURLE_SSL_CERTPROBLEM; goto quit; } ldap_option = LDAPSSL_VERIFY_SERVER; } else ldap_option = LDAPSSL_VERIFY_NONE; rc = ldapssl_set_verify_mode(ldap_option); if(rc != LDAP_SUCCESS) { failf(data, "LDAP local: ERROR setting cert verify mode: %s", ldap_err2string(rc)); status = CURLE_SSL_CERTPROBLEM; goto quit; } server = ldapssl_init(conn->host.name, (int)conn->port, 1); if(server == NULL) { failf(data, "LDAP local: Cannot connect to %s:%ld", conn->host.name, conn->port); status = CURLE_COULDNT_CONNECT; goto quit; } #elif defined(LDAP_OPT_X_TLS) if(data->set.ssl.verifypeer) { /* OpenLDAP SDK supports BASE64 files. */ if((data->set.str[STRING_CERT_TYPE]) && (!Curl_raw_equal(data->set.str[STRING_CERT_TYPE], "PEM"))) { failf(data, "LDAP local: ERROR OpenLDAP only supports PEM cert-type!"); status = CURLE_SSL_CERTPROBLEM; goto quit; } if(!ldap_ca) { failf(data, "LDAP local: ERROR PEM CA cert not set!"); status = CURLE_SSL_CERTPROBLEM; goto quit; } infof(data, "LDAP local: using PEM CA cert: %s\n", ldap_ca); rc = ldap_set_option(NULL, LDAP_OPT_X_TLS_CACERTFILE, ldap_ca); if(rc != LDAP_SUCCESS) { failf(data, "LDAP local: ERROR setting PEM CA cert: %s", ldap_err2string(rc)); status = CURLE_SSL_CERTPROBLEM; goto quit; } ldap_option = LDAP_OPT_X_TLS_DEMAND; } else ldap_option = LDAP_OPT_X_TLS_NEVER; rc = ldap_set_option(NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &ldap_option); if(rc != LDAP_SUCCESS) { failf(data, "LDAP local: ERROR setting cert verify mode: %s", ldap_err2string(rc)); status = CURLE_SSL_CERTPROBLEM; goto quit; } server = ldap_init(conn->host.name, (int)conn->port); if(server == NULL) { failf(data, "LDAP local: Cannot connect to %s:%ld", conn->host.name, conn->port); status = CURLE_COULDNT_CONNECT; goto quit; } ldap_option = LDAP_OPT_X_TLS_HARD; rc = ldap_set_option(server, LDAP_OPT_X_TLS, &ldap_option); if(rc != LDAP_SUCCESS) { failf(data, "LDAP local: ERROR setting SSL/TLS mode: %s", ldap_err2string(rc)); status = CURLE_SSL_CERTPROBLEM; goto quit; } /* rc = ldap_start_tls_s(server, NULL, NULL); if(rc != LDAP_SUCCESS) { failf(data, "LDAP local: ERROR starting SSL/TLS mode: %s", ldap_err2string(rc)); status = CURLE_SSL_CERTPROBLEM; goto quit; } */ #else /* we should probably never come up to here since configure should check in first place if we can support LDAP SSL/TLS */ failf(data, "LDAP local: SSL/TLS not supported with this version " "of the OpenLDAP toolkit\n"); status = CURLE_SSL_CERTPROBLEM; goto quit; #endif #endif #endif /* CURL_LDAP_USE_SSL */ } else { server = ldap_init(conn->host.name, (int)conn->port); if(server == NULL) { failf(data, "LDAP local: Cannot connect to %s:%ld", conn->host.name, conn->port); status = CURLE_COULDNT_CONNECT; goto quit; } } #ifdef CURL_LDAP_WIN ldap_set_option(server, LDAP_OPT_PROTOCOL_VERSION, &ldap_proto); #endif rc = ldap_simple_bind_s(server, conn->bits.user_passwd ? conn->user : NULL, conn->bits.user_passwd ? conn->passwd : NULL); if(!ldap_ssl && 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: ldap_simple_bind_s %s", ldap_err2string(rc)); status = CURLE_LDAP_CANNOT_BIND; 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++) { BerElement *ber = NULL; char *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); dlsize += strlen(dn)+5; for(attribute = ldap_first_attribute(server, entryIterator, &ber); attribute; attribute = ldap_next_attribute(server, entryIterator, ber)) { BerValue **vals = 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); dlsize += strlen(attribute)+3; if((strlen(attribute) > 7) && (strcmp(";binary", (char *)attribute + (strlen((char *)attribute) - 7)) == 0)) { /* Binary attribute, encode to base64. */ CURLcode error = Curl_base64_encode(data, vals[i]->bv_val, vals[i]->bv_len, &val_b64, &val_b64_sz); if(error) { ldap_value_free_len(vals); ldap_memfree(attribute); ldap_memfree(dn); if(ber) ber_free(ber, 0); status = error; goto quit; } if(val_b64_sz > 0) { Curl_client_write(conn, CLIENTWRITE_BODY, val_b64, val_b64_sz); free(val_b64); dlsize += val_b64_sz; } } else { Curl_client_write(conn, CLIENTWRITE_BODY, vals[i]->bv_val, vals[i]->bv_len); dlsize += vals[i]->bv_len; } Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"\n", 0); dlsize++; } /* Free memory used to store values */ ldap_value_free_len(vals); } Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"\n", 1); dlsize++; Curl_pgrsSetDownloadCounter(data, dlsize); ldap_memfree(attribute); } ldap_memfree(dn); if(ber) ber_free(ber, 0); } quit: if(result) { ldap_msgfree(result); 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); #if defined(HAVE_LDAP_SSL) && defined(CURL_HAS_NOVELL_LDAPSDK) if(ldap_ssl) ldapssl_client_deinit(); #endif /* HAVE_LDAP_SSL && CURL_HAS_NOVELL_LDAPSDK */ /* 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 && strtol(env, NULL, 10) > 0); } if(!do_trace) return; va_start (args, fmt); vfprintf (stderr, fmt, args); va_end (args); } #endif #ifndef HAVE_LDAP_URL_PARSE /* * Return scope-value for a scope-string. */ static int str2scope (const char *p) { if(strequal(p, "one")) return LDAP_SCOPE_ONELEVEL; if(strequal(p, "onetree")) return LDAP_SCOPE_ONELEVEL; if(strequal(p, "base")) return LDAP_SCOPE_BASE; if(strequal(p, "sub")) return LDAP_SCOPE_SUBTREE; if(strequal( 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; ludp->lud_attrs_dups++; } 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->state.path+1'. All fields are optional. * e.g. * ldap://:/??? * yields ludp->lud_dn = "". * * Defined in RFC4516 section 2. */ static int _ldap_url_parse2 (const struct connectdata *conn, LDAPURLDesc *ludp) { char *p, *q; int i; if(!conn->data || !conn->data->state.path || conn->data->state.path[0] != '/' || !checkprefix("LDAP", 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->state.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)); 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(1, sizeof(*ludp)); 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) { size_t 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; i < ludp->lud_attrs_dups; i++) free(ludp->lud_attrs[i]); free(ludp->lud_attrs); } free (ludp); } #endif /* !HAVE_LDAP_URL_PARSE */ #endif /* !CURL_DISABLE_LDAP && !USE_OPENLDAP */ curl-7.35.0/lib/share.h0000644000175000017500000000372112213173003011510 00000000000000#ifndef HEADER_CURL_SHARE_H #define HEADER_CURL_SHARE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #include #include "cookie.h" #include "urldata.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; #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) struct CookieInfo *cookies; #endif struct curl_ssl_session *sslsession; size_t max_ssl_sessions; long sessionage; }; CURLSHcode Curl_share_lock (struct SessionHandle *, curl_lock_data, curl_lock_access); CURLSHcode Curl_share_unlock (struct SessionHandle *, curl_lock_data); #endif /* HEADER_CURL_SHARE_H */ curl-7.35.0/lib/fileinfo.h0000644000175000017500000000243412213173003012201 00000000000000#ifndef HEADER_CURL_FILEINFO_H #define HEADER_CURL_FILEINFO_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2010, 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. * ***************************************************************************/ #include struct curl_fileinfo *Curl_fileinfo_alloc(void); void Curl_fileinfo_dtor(void *, void *); struct curl_fileinfo *Curl_fileinfo_dup(const struct curl_fileinfo *src); #endif /* HEADER_CURL_FILEINFO_H */ curl-7.35.0/lib/asyn-thread.c0000644000175000017500000003756412270035364012646 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef __VMS #include #include #endif #if defined(USE_THREADS_POSIX) # ifdef HAVE_PTHREAD_H # include # endif #elif defined(USE_THREADS_WIN32) # ifdef HAVE_PROCESS_H # include # endif #endif #if (defined(NETWARE) && defined(__NOVELL_LIBC__)) #undef in_addr_t #define in_addr_t unsigned long #endif #ifdef HAVE_GETADDRINFO # define RESOLVER_ENOMEM EAI_MEMORY #else # define RESOLVER_ENOMEM ENOMEM #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 "inet_pton.h" #include "inet_ntop.h" #include "curl_threads.h" #define _MPRINTF_REPLACE /* use our functions only */ #include #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" /*********************************************************************** * Only for threaded name resolves builds **********************************************************************/ #ifdef CURLRES_THREADED /* * Curl_resolver_global_init() * Called from curl_global_init() to initialize global resolver environment. * Does nothing here. */ int Curl_resolver_global_init(void) { return CURLE_OK; } /* * Curl_resolver_global_cleanup() * Called from curl_global_cleanup() to destroy global resolver environment. * Does nothing here. */ void Curl_resolver_global_cleanup(void) { } /* * Curl_resolver_init() * Called from curl_easy_init() -> Curl_open() to initialize resolver * URL-state specific environment ('resolver' member of the UrlState * structure). Does nothing here. */ CURLcode Curl_resolver_init(void **resolver) { (void)resolver; return CURLE_OK; } /* * Curl_resolver_cleanup() * Called from curl_easy_cleanup() -> Curl_close() to cleanup resolver * URL-state specific environment ('resolver' member of the UrlState * structure). Does nothing here. */ void Curl_resolver_cleanup(void *resolver) { (void)resolver; } /* * Curl_resolver_duphandle() * Called from curl_easy_duphandle() to duplicate resolver URL state-specific * environment ('resolver' member of the UrlState structure). Does nothing * here. */ int Curl_resolver_duphandle(void **to, void *from) { (void)to; (void)from; return CURLE_OK; } static void destroy_async_data(struct Curl_async *); /* * Cancel all possibly still on-going resolves for this connection. */ void Curl_resolver_cancel(struct connectdata *conn) { destroy_async_data(&conn->async); } /* This function is used to init a threaded resolve */ static bool init_resolve_thread(struct connectdata *conn, const char *hostname, int port, const struct addrinfo *hints); /* Data for synchronization between resolver thread and its parent */ struct thread_sync_data { curl_mutex_t * mtx; int done; char * hostname; /* hostname to resolve, Curl_async.hostname duplicate */ int port; int sock_error; Curl_addrinfo *res; #ifdef HAVE_GETADDRINFO struct addrinfo hints; #endif }; struct thread_data { curl_thread_t thread_hnd; unsigned int poll_interval; long interval_end; struct thread_sync_data tsd; }; static struct thread_sync_data *conn_thread_sync_data(struct connectdata *conn) { return &(((struct thread_data *)conn->async.os_specific)->tsd); } #define CONN_THREAD_SYNC_DATA(conn) &(((conn)->async.os_specific)->tsd); /* Destroy resolver thread synchronization data */ static void destroy_thread_sync_data(struct thread_sync_data * tsd) { if(tsd->mtx) { Curl_mutex_destroy(tsd->mtx); free(tsd->mtx); } if(tsd->hostname) free(tsd->hostname); if(tsd->res) Curl_freeaddrinfo(tsd->res); memset(tsd,0,sizeof(*tsd)); } /* Initialize resolver thread synchronization data */ static int init_thread_sync_data(struct thread_sync_data * tsd, const char * hostname, int port, const struct addrinfo *hints) { memset(tsd, 0, sizeof(*tsd)); tsd->port = port; #ifdef HAVE_GETADDRINFO DEBUGASSERT(hints); tsd->hints = *hints; #else (void) hints; #endif tsd->mtx = malloc(sizeof(curl_mutex_t)); if(tsd->mtx == NULL) goto err_exit; Curl_mutex_init(tsd->mtx); tsd->sock_error = CURL_ASYNC_SUCCESS; /* Copying hostname string because original can be destroyed by parent * thread during gethostbyname execution. */ tsd->hostname = strdup(hostname); if(!tsd->hostname) goto err_exit; return 1; err_exit: /* Memory allocation failed */ destroy_thread_sync_data(tsd); return 0; } static int getaddrinfo_complete(struct connectdata *conn) { struct thread_sync_data *tsd = conn_thread_sync_data(conn); int rc; rc = Curl_addrinfo_callback(conn, tsd->sock_error, tsd->res); /* The tsd->res structure has been copied to async.dns and perhaps the DNS cache. Set our copy to NULL so destroy_thread_sync_data doesn't free it. */ tsd->res = NULL; return rc; } #ifdef HAVE_GETADDRINFO /* * getaddrinfo_thread() resolves a name and then exits. * * For builds without ARES, but with ENABLE_IPV6, create a resolver thread * and wait on it. */ static unsigned int CURL_STDCALL getaddrinfo_thread (void *arg) { struct thread_sync_data *tsd = (struct thread_sync_data*)arg; char service[12]; int rc; snprintf(service, sizeof(service), "%d", tsd->port); rc = Curl_getaddrinfo_ex(tsd->hostname, service, &tsd->hints, &tsd->res); if(rc != 0) { tsd->sock_error = SOCKERRNO?SOCKERRNO:rc; if(tsd->sock_error == 0) tsd->sock_error = RESOLVER_ENOMEM; } Curl_mutex_acquire(tsd->mtx); tsd->done = 1; Curl_mutex_release(tsd->mtx); return 0; } #else /* HAVE_GETADDRINFO */ /* * gethostbyname_thread() resolves a name and then exits. */ static unsigned int CURL_STDCALL gethostbyname_thread (void *arg) { struct thread_sync_data *tsd = (struct thread_sync_data *)arg; tsd->res = Curl_ipv4_resolve_r(tsd->hostname, tsd->port); if(!tsd->res) { tsd->sock_error = SOCKERRNO; if(tsd->sock_error == 0) tsd->sock_error = RESOLVER_ENOMEM; } Curl_mutex_acquire(tsd->mtx); tsd->done = 1; Curl_mutex_release(tsd->mtx); return 0; } #endif /* HAVE_GETADDRINFO */ /* * destroy_async_data() cleans up async resolver data and thread handle. */ static void destroy_async_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; if(td->thread_hnd != curl_thread_t_null) Curl_thread_join(&td->thread_hnd); destroy_thread_sync_data(&td->tsd); 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 struct addrinfo *hints) { struct thread_data *td = calloc(1, sizeof(struct thread_data)); int err = RESOLVER_ENOMEM; conn->async.os_specific = (void*) td; if(!td) goto err_exit; conn->async.port = port; conn->async.done = FALSE; conn->async.status = 0; conn->async.dns = NULL; td->thread_hnd = curl_thread_t_null; if(!init_thread_sync_data(&td->tsd, hostname, port, hints)) goto err_exit; Curl_safefree(conn->async.hostname); conn->async.hostname = strdup(hostname); if(!conn->async.hostname) goto err_exit; #ifdef HAVE_GETADDRINFO td->thread_hnd = Curl_thread_create(getaddrinfo_thread, &td->tsd); #else td->thread_hnd = Curl_thread_create(gethostbyname_thread, &td->tsd); #endif if(!td->thread_hnd) { #ifndef _WIN32_WCE err = errno; #endif goto err_exit; } return TRUE; err_exit: destroy_async_data(&conn->async); SET_ERRNO(err); return FALSE; } /* * resolver_error() calls failf() with the appropriate message after a resolve * error */ static CURLcode resolver_error(struct connectdata *conn) { const char *host_or_proxy; CURLcode rc; if(conn->bits.httpproxy) { host_or_proxy = "proxy"; rc = CURLE_COULDNT_RESOLVE_PROXY; } else { host_or_proxy = "host"; rc = CURLE_COULDNT_RESOLVE_HOST; } failf(conn->data, "Could not resolve %s: %s", host_or_proxy, conn->async.hostname); return rc; } /* * Curl_resolver_wait_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_resolver_wait_resolv(struct connectdata *conn, struct Curl_dns_entry **entry) { struct thread_data *td = (struct thread_data*) conn->async.os_specific; CURLcode rc = CURLE_OK; DEBUGASSERT(conn && td); /* wait for the thread to resolve the name */ if(Curl_thread_join(&td->thread_hnd)) rc = getaddrinfo_complete(conn); else DEBUGASSERT(0); conn->async.done = TRUE; if(entry) *entry = conn->async.dns; if(!conn->async.dns) /* a name was not resolved, report error */ rc = resolver_error(conn); destroy_async_data(&conn->async); if(!conn->async.dns) conn->bits.close = TRUE; return (rc); } /* * Curl_resolver_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_resolver_is_resolved(struct connectdata *conn, struct Curl_dns_entry **entry) { struct SessionHandle *data = conn->data; struct thread_data *td = (struct thread_data*) conn->async.os_specific; int done = 0; *entry = NULL; if(!td) { DEBUGASSERT(td); return CURLE_COULDNT_RESOLVE_HOST; } Curl_mutex_acquire(td->tsd.mtx); done = td->tsd.done; Curl_mutex_release(td->tsd.mtx); if(done) { getaddrinfo_complete(conn); if(!conn->async.dns) { CURLcode rc = resolver_error(conn); destroy_async_data(&conn->async); return rc; } destroy_async_data(&conn->async); *entry = conn->async.dns; } else { /* poll for name lookup done with exponential backoff up to 250ms */ long elapsed = Curl_tvdiff(Curl_tvnow(), data->progress.t_startsingle); if(elapsed < 0) elapsed = 0; if(td->poll_interval == 0) /* Start at 1ms poll interval */ td->poll_interval = 1; else if(elapsed >= td->interval_end) /* Back-off exponentially if last interval expired */ td->poll_interval *= 2; if(td->poll_interval > 250) td->poll_interval = 250; td->interval_end = elapsed + td->poll_interval; Curl_expire(conn->data, td->poll_interval); } return CURLE_OK; } int Curl_resolver_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { (void)conn; (void)socks; (void)numsocks; return 0; } #ifndef HAVE_GETADDRINFO /* * Curl_getaddrinfo() - for platforms without getaddrinfo */ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn, const char *hostname, int port, int *waitp) { struct in_addr in; *waitp = 0; /* default to synchronous response */ if(Curl_inet_pton(AF_INET, hostname, &in) > 0) /* This is a dotted IP address 123.123.123.123-style */ return Curl_ip2addr(AF_INET, &in, hostname, port); /* fire up a new resolver thread! */ if(init_resolve_thread(conn, hostname, port, NULL)) { *waitp = 1; /* expect asynchronous response */ return NULL; } /* fall-back to blocking version */ return Curl_ipv4_resolve_r(hostname, port); } #else /* !HAVE_GETADDRINFO */ /* * Curl_resolver_getaddrinfo() - for getaddrinfo */ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn, const char *hostname, int port, int *waitp) { struct addrinfo hints; struct in_addr in; Curl_addrinfo *res; int error; char sbuf[12]; int pf = PF_INET; #ifdef CURLRES_IPV6 struct in6_addr in6; #endif /* CURLRES_IPV6 */ *waitp = 0; /* default to synchronous response */ /* First check if this is an IPv4 address string */ if(Curl_inet_pton(AF_INET, hostname, &in) > 0) /* This is a dotted IP address 123.123.123.123-style */ return Curl_ip2addr(AF_INET, &in, hostname, port); #ifdef CURLRES_IPV6 /* check if this is an IPv6 address string */ if(Curl_inet_pton (AF_INET6, hostname, &in6) > 0) /* This is an IPv6 address literal */ return Curl_ip2addr(AF_INET6, &in6, hostname, port); /* * Check if a limited name resolve has been requested. */ switch(conn->ip_version) { case CURL_IPRESOLVE_V4: pf = PF_INET; break; case CURL_IPRESOLVE_V6: pf = PF_INET6; break; default: pf = PF_UNSPEC; break; } if((pf != PF_INET) && !Curl_ipv6works()) /* the stack seems to be a non-ipv6 one */ pf = PF_INET; #endif /* CURLRES_IPV6 */ memset(&hints, 0, sizeof(hints)); hints.ai_family = pf; hints.ai_socktype = conn->socktype; snprintf(sbuf, sizeof(sbuf), "%d", port); /* fire up a new resolver thread! */ if(init_resolve_thread(conn, hostname, port, &hints)) { *waitp = 1; /* expect asynchronous response */ return NULL; } /* fall-back to blocking version */ infof(conn->data, "init_resolve_thread() failed for %s; %s\n", hostname, Curl_strerror(conn, ERRNO)); error = Curl_getaddrinfo_ex(hostname, sbuf, &hints, &res); if(error) { infof(conn->data, "getaddrinfo() failed for %s:%d; %s\n", hostname, port, Curl_strerror(conn, SOCKERRNO)); return NULL; } return res; } #endif /* !HAVE_GETADDRINFO */ CURLcode Curl_set_dns_servers(struct SessionHandle *data, char *servers) { (void)data; (void)servers; return CURLE_NOT_BUILT_IN; } CURLcode Curl_set_dns_interface(struct SessionHandle *data, const char *interf) { (void)data; (void)interf; return CURLE_NOT_BUILT_IN; } CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data, const char *local_ip4) { (void)data; (void)local_ip4; return CURLE_NOT_BUILT_IN; } CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data, const char *local_ip6) { (void)data; (void)local_ip6; return CURLE_NOT_BUILT_IN; } #endif /* CURLRES_THREADED */ curl-7.35.0/lib/http2.c0000644000175000017500000001235312271275502011456 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef USE_NGHTTP2 #define _MPRINTF_REPLACE #include #include #include "urldata.h" #include "http2.h" #include "http.h" #include "sendf.h" #include "curl_base64.h" #include "curl_memory.h" /* include memdebug.h last */ #include "memdebug.h" /* * Store nghttp2 version info in this buffer, Prefix with a space. Return * total length written. */ int Curl_http2_ver(char *p, size_t len) { nghttp2_info *h2 = nghttp2_version(0); return snprintf(p, len, " nghttp2/%s", h2->version_str); } /* * The implementation of nghttp2_send_callback type. Here we write |data| with * size |length| to the network and return the number of bytes actually * written. See the documentation of nghttp2_send_callback for the details. */ static ssize_t send_callback(nghttp2_session *h2, const uint8_t *data, size_t length, int flags, void *userp) { struct connectdata *conn = (struct connectdata *)userp; ssize_t written; CURLcode rc = Curl_write(conn, conn->sock[0], data, length, &written); (void)h2; (void)flags; if(rc) { failf(conn->data, "Failed sending HTTP2 data"); return NGHTTP2_ERR_CALLBACK_FAILURE; } else if(!written) return NGHTTP2_ERR_WOULDBLOCK; return written; } /* * The implementation of nghttp2_recv_callback type. Here we read data from * the network and write them in |buf|. The capacity of |buf| is |length| * bytes. Returns the number of bytes stored in |buf|. See the documentation * of nghttp2_recv_callback for the details. */ static ssize_t recv_callback(nghttp2_session *h2, uint8_t *buf, size_t length, int flags, void *userp) { struct connectdata *conn = (struct connectdata *)userp; ssize_t nread; CURLcode rc = Curl_read(conn, conn->sock[0], (char *)buf, length, &nread); (void)h2; (void)flags; if(rc) { failf(conn->data, "Failed recving HTTP2 data"); return NGHTTP2_ERR_CALLBACK_FAILURE; } if(!nread) return NGHTTP2_ERR_WOULDBLOCK; return nread; } /* * This is all callbacks nghttp2 calls */ static const nghttp2_session_callbacks callbacks = { send_callback, recv_callback, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; /* * The HTTP2 settings we send in the Upgrade request */ static nghttp2_settings_entry settings[] = { { NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, 100 }, { NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE, NGHTTP2_INITIAL_WINDOW_SIZE }, }; /* * Append headers to ask for a HTTP1.1 to HTTP2 upgrade. */ CURLcode Curl_http2_request(Curl_send_buffer *req, struct connectdata *conn) { uint8_t binsettings[80]; CURLcode result; ssize_t binlen; char *base64; size_t blen; if(!conn->proto.httpc.h2) { /* The nghttp2 session is not yet setup, do it */ int rc = nghttp2_session_client_new(&conn->proto.httpc.h2, &callbacks, &conn); if(rc) { failf(conn->data, "Couldn't initialize nghttp2!"); return CURLE_OUT_OF_MEMORY; /* most likely at least */ } } /* As long as we have a fixed set of settings, we don't have to dynamically * figure out the base64 strings since it'll always be the same. However, * the settings will likely not be fixed every time in the future. */ /* this returns number of bytes it wrote */ binlen = nghttp2_pack_settings_payload(binsettings, sizeof(binsettings), settings, sizeof(settings)/sizeof(settings[0])); if(!binlen) { failf(conn->data, "nghttp2 unexpectedly failed on pack_settings_payload"); return CURLE_FAILED_INIT; } result = Curl_base64_encode(conn->data, (const char *)binsettings, binlen, &base64, &blen); if(result) return result; result = Curl_add_bufferf(req, "Connection: Upgrade, HTTP2-Settings\r\n" "Upgrade: %s\r\n" "HTTP2-Settings: %s\r\n", NGHTTP2_PROTO_VERSION_ID, base64); free(base64); return result; } #endif curl-7.35.0/lib/nonblock.c0000644000175000017500000000504312213173003012205 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "curl_setup.h" #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_FCNTL_H #include #endif #if (defined(HAVE_IOCTL_FIONBIO) && defined(NETWARE)) #include #endif #ifdef __VMS #include #include #endif #include "nonblock.h" /* * curlx_nonblock() set the given socket to either blocking or non-blocking * mode based on the 'nonblock' boolean argument. This function is highly * portable. */ int curlx_nonblock(curl_socket_t sockfd, /* operate on this */ int nonblock /* TRUE or FALSE */) { #if defined(USE_BLOCKING_SOCKETS) return 0; /* returns success */ #elif defined(HAVE_FCNTL_O_NONBLOCK) /* most recent unix versions */ int flags; flags = sfcntl(sockfd, F_GETFL, 0); if(nonblock) return sfcntl(sockfd, F_SETFL, flags | O_NONBLOCK); else return sfcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK)); #elif defined(HAVE_IOCTL_FIONBIO) /* older unix versions */ int flags = nonblock ? 1 : 0; return ioctl(sockfd, FIONBIO, &flags); #elif defined(HAVE_IOCTLSOCKET_FIONBIO) /* Windows */ unsigned long flags = nonblock ? 1UL : 0UL; return ioctlsocket(sockfd, FIONBIO, &flags); #elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO) /* Amiga */ long flags = nonblock ? 1L : 0L; return IoctlSocket(sockfd, FIONBIO, flags); #elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK) /* BeOS */ long b = nonblock ? 1L : 0L; return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); #else # error "no non-blocking method was found/used/set" #endif } curl-7.35.0/lib/gopher.h0000644000175000017500000000227012213173003011670 00000000000000#ifndef HEADER_CURL_GOPHER_H #define HEADER_CURL_GOPHER_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2009, 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. * ***************************************************************************/ #ifndef CURL_DISABLE_GOPHER extern const struct Curl_handler Curl_handler_gopher; #endif #endif /* HEADER_CURL_GOPHER_H */ curl-7.35.0/lib/cookie.c0000644000175000017500000011210412270035364011660 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ /*** 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 "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) #define _MPRINTF_REPLACE #include #include "urldata.h" #include "cookie.h" #include "strequal.h" #include "strtok.h" #include "sendf.h" #include "slist.h" #include "curl_memory.h" #include "share.h" #include "strtoofft.h" #include "rawstr.h" #include "curl_memrchr.h" /* The last #include file should be: */ #include "memdebug.h" 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->spath) free(co->spath); 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 *cooke_domain, const char *hostname) { size_t cookie_domain_len = strlen(cooke_domain); size_t hostname_len = strlen(hostname); if(hostname_len < cookie_domain_len) return FALSE; if(!Curl_raw_equal(cooke_domain, hostname+hostname_len-cookie_domain_len)) return FALSE; /* A lead char of cookie_domain is not '.'. RFC6265 4.1.2.3. The Domain Attribute says: For example, if the value of the Domain attribute is "example.com", the user agent will include the cookie in the Cookie header when making HTTP requests to example.com, www.example.com, and www.corp.example.com. */ if(hostname_len == cookie_domain_len) return TRUE; if('.' == *(hostname + hostname_len - cookie_domain_len - 1)) return TRUE; return FALSE; } /* * matching cookie path and url path * RFC6265 5.1.4 Paths and Path-Match */ static bool pathmatch(const char* cookie_path, const char* request_uri) { size_t cookie_path_len; size_t uri_path_len; char* uri_path = NULL; char* pos; bool ret = FALSE; /* cookie_path must not have last '/' separator. ex: /sample */ cookie_path_len = strlen(cookie_path); if(1 == cookie_path_len) { /* cookie_path must be '/' */ return TRUE; } uri_path = strdup(request_uri); if(!uri_path) return FALSE; pos = strchr(uri_path, '?'); if(pos) *pos = 0x0; /* #-fragments are already cut off! */ if(0 == strlen(uri_path) || uri_path[0] != '/') { free(uri_path); uri_path = strdup("/"); if(!uri_path) return FALSE; } /* here, RFC6265 5.1.4 says 4. Output the characters of the uri-path from the first character up to, but not including, the right-most %x2F ("/"). but URL path /hoge?fuga=xxx means /hoge/index.cgi?fuga=xxx in some site without redirect. Ignore this algorithm because /hoge is uri path for this case (uri path is not /). */ uri_path_len = strlen(uri_path); if(uri_path_len < cookie_path_len) { ret = FALSE; goto pathmatched; } /* not using checkprefix() because matching should be case-sensitive */ if(strncmp(cookie_path, uri_path, cookie_path_len)) { ret = FALSE; goto pathmatched; } /* The cookie-path and the uri-path are identical. */ if(cookie_path_len == uri_path_len) { ret = TRUE; goto pathmatched; } /* here, cookie_path_len < url_path_len */ if(uri_path[cookie_path_len] == '/') { ret = TRUE; goto pathmatched; } ret = FALSE; pathmatched: free(uri_path); return ret; } /* * cookie path sanitize */ static char *sanitize_cookie_path(const char *cookie_path) { size_t len; char *new_path = strdup(cookie_path); if(!new_path) return NULL; /* some stupid site sends path attribute with '"'. */ if(new_path[0] == '\"') { memmove((void *)new_path, (const void *)(new_path + 1), strlen(new_path)); } if(new_path[strlen(new_path) - 1] == '\"') { new_path[strlen(new_path) - 1] = 0x0; } /* RFC6265 5.2.4 The Path Attribute */ if(new_path[0] != '/') { /* Let cookie-path be the default-path. */ free(new_path); new_path = strdup("/"); return new_path; } /* convert /hoge/ to /hoge */ len = strlen(new_path); if(1 < len && new_path[len - 1] == '/') { new_path[len - 1] = 0x0; } return new_path; } /* * 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_slist_free_all(data->change.cookielist); /* clean up list */ data->change.cookielist = NULL; /* don't do this again! */ Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); } } /* * strstore() makes a strdup() on the 'newstr' and if '*str' is non-NULL * that will be freed before the allocated string is stored there. * * It is meant to easily replace strdup() */ static void strstore(char **str, const char *newstr) { if(*str) free(*str); *str = strdup(newstr); } /* * remove_expired() removes expired cookies. */ static void remove_expired(struct CookieInfo *cookies) { struct Cookie *co, *nx, *pv; curl_off_t now = (curl_off_t)time(NULL); co = cookies->cookies; pv = NULL; while(co) { nx = co->next; if((co->expirestr || co->maxage) && co->expires < now) { if(co == cookies->cookies) { cookies->cookies = co->next; } else { pv->next = co->next; } cookies->numcookies--; freecookie(co); } else { pv = co; } co = nx; } } /**************************************************************************** * * Curl_cookie_add() * * Add a single cookie line to the cookie keeping object. * * Be aware that sometimes we get an IP-only host name, and that might also be * a numerical IPv6 address. * ***************************************************************************/ 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 */ const char *domain, /* default domain */ const char *path) /* full path used when this cookie is set, used to get default path for the cookie unless set */ { struct Cookie *clist; char name[MAX_NAME]; 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 */ #ifdef CURL_DISABLE_VERBOSE_STRINGS (void)data; #endif /* First, alloc and init a new struct for it */ co = calloc(1, sizeof(struct Cookie)); if(!co) return NULL; /* bail out if we're this low on memory */ if(httpheader) { /* This line was read off a HTTP-header */ const char *ptr; const char *semiptr; char *what; what = malloc(MAX_COOKIE_LINE); if(!what) { free(co); return NULL; } semiptr=strchr(lineptr, ';'); /* first, find a semicolon */ while(*lineptr && ISBLANK(*lineptr)) lineptr++; ptr = lineptr; do { /* we have a = pair or a stand-alone word here */ name[0]=what[0]=0; /* init the buffers */ if(1 <= sscanf(ptr, "%" MAX_NAME_TXT "[^;\r\n =]=%" MAX_COOKIE_LINE_TXT "[^;\r\n]", name, what)) { /* Use strstore() below to properly deal with received cookie headers that have the same string property set more than once, and then we use the last one. */ const char *whatptr; bool done = FALSE; bool sep; size_t len=strlen(what); const char *endofn = &ptr[ strlen(name) ]; /* skip trailing spaces in name */ while(*endofn && ISBLANK(*endofn)) endofn++; /* name ends with a '=' ? */ sep = (*endofn == '=')?TRUE:FALSE; /* Strip off trailing whitespace from the 'what' */ while(len && ISBLANK(what[len-1])) { what[len-1]=0; len--; } /* Skip leading whitespace from the 'what' */ whatptr=what; while(*whatptr && ISBLANK(*whatptr)) whatptr++; if(!len) { /* this was a "=" with no content, and we must allow 'secure' and 'httponly' specified this weirdly */ done = TRUE; if(Curl_raw_equal("secure", name)) co->secure = TRUE; else if(Curl_raw_equal("httponly", name)) co->httponly = TRUE; else if(sep) /* there was a '=' so we're not done parsing this field */ done = FALSE; } if(done) ; else if(Curl_raw_equal("path", name)) { strstore(&co->path, whatptr); if(!co->path) { badcookie = TRUE; /* out of memory bad */ break; } co->spath = sanitize_cookie_path(co->path); if(!co->spath) { badcookie = TRUE; /* out of memory bad */ break; } } else if(Curl_raw_equal("domain", name)) { /* 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 preceding dot */ if(!domain || tailmatch(whatptr, domain)) { const char *tailptr=whatptr; if(tailptr[0] == '.') tailptr++; strstore(&co->domain, 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(Curl_raw_equal("version", name)) { strstore(&co->version, whatptr); if(!co->version) { badcookie = TRUE; break; } } else if(Curl_raw_equal("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. */ strstore(&co->maxage, whatptr); if(!co->maxage) { badcookie = TRUE; break; } } else if(Curl_raw_equal("expires", name)) { strstore(&co->expirestr, whatptr); if(!co->expirestr) { badcookie = TRUE; break; } } 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 */ } if(!semiptr || !*semiptr) { /* we already know there are no more cookies */ semiptr = NULL; continue; } ptr=semiptr+1; while(*ptr && ISBLANK(*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(co->maxage) { co->expires = curlx_strtoofft((*co->maxage=='\"')? &co->maxage[1]:&co->maxage[0], NULL, 10); if(CURL_OFF_T_MAX - now < co->expires) /* avoid overflow */ co->expires = CURL_OFF_T_MAX; else co->expires += now; } else if(co->expirestr) { /* Note that if the date couldn't get parsed for whatever reason, the cookie will be treated as a session cookie */ co->expires = curl_getdate(co->expirestr, NULL); /* Session cookies have expires set to 0 so if we get that back from the date parser let's add a second to make it a non-session cookie */ if(co->expires == 0) co->expires = 1; else if(co->expires < 0) co->expires = 0; } 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. Note that the passed-in path to this function MAY have a '?' and following part that MUST not be stored as part of the path. */ char *queryp = strchr(path, '?'); /* queryp is where the interesting part of the path ends, so now we want to the find the last */ char *endslash; if(!queryp) endslash = strrchr(path, '/'); else endslash = memrchr(path, '/', (size_t)(queryp - path)); if(endslash) { size_t pathlen = (size_t)(endslash-path+1); /* include 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 */ co->spath = sanitize_cookie_path(co->path); if(!co->spath) badcookie = TRUE; /* out of memory bad */ } 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 *ptr; char *firstptr; char *tok_buf=NULL; int fields; /* IE introduced HTTP-only cookies to prevent XSS attacks. Cookies marked with httpOnly after the domain name are not accessible from javascripts, but since curl does not operate at javascript level, we include them anyway. In Firefox's cookie files, these lines are preceded with #HttpOnly_ and then everything is as usual, so we skip 10 characters of the line.. */ if(strncmp(lineptr, "#HttpOnly_", 10) == 0) { lineptr += 10; co->httponly = TRUE; } 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 */ /* 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 preceding 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 = Curl_raw_equal(ptr, "TRUE")?TRUE:FALSE; 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; else { co->spath = sanitize_cookie_path(co->path); if(!co->spath) { badcookie = TRUE; /* out of memory bad */ } } break; } /* this doesn't look like a path, make one up! */ co->path = strdup("/"); if(!co->path) badcookie = TRUE; co->spath = strdup("/"); if(!co->spath) badcookie = TRUE; fields++; /* add a field and fall down to secure */ /* FALLTHROUGH */ case 3: co->secure = Curl_raw_equal(ptr, "TRUE")?TRUE:FALSE; 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 */ /* at first, remove expired cookies */ remove_expired(c); clist = c->cookies; replace_old = FALSE; while(clist) { if(Curl_raw_equal(clist->name, co->name)) { /* the names are identical */ if(clist->domain && co->domain) { if(Curl_raw_equal(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->spath && co->spath) { if(Curl_raw_equal(clist->spath, co->spath)) { replace_old = TRUE; } else replace_old = FALSE; } else if(!clist->spath && !co->spath) 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 */ free(clist->name); if(clist->value) free(clist->value); if(clist->domain) free(clist->domain); if(clist->path) free(clist->path); if(clist->spath) free(clist->spath); 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 %" CURL_FORMAT_CURL_OFF_T "\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, const 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 = 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 = 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 && ISBLANK(*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; } /* sort this so that the longest path gets before the shorter path */ static int cookie_sort(const void *p1, const void *p2) { struct Cookie *c1 = *(struct Cookie **)p1; struct Cookie *c2 = *(struct Cookie **)p2; size_t l1, l2; /* 1 - compare cookie path lengths */ l1 = c1->path ? strlen(c1->path) : 0; l2 = c2->path ? strlen(c2->path) : 0; if(l1 != l2) return (l2 > l1) ? 1 : -1 ; /* avoid size_t <=> int conversions */ /* 2 - compare cookie domain lengths */ l1 = c1->domain ? strlen(c1->domain) : 0; l2 = c2->domain ? strlen(c2->domain) : 0; if(l1 != l2) return (l2 > l1) ? 1 : -1 ; /* avoid size_t <=> int conversions */ /* 3 - compare cookie names */ if(c1->name && c2->name) return strcmp(c1->name, c2->name); /* sorry, can't be more deterministic */ return 0; } /***************************************************************************** * * 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, const char *host, const char *path, bool secure) { struct Cookie *newco; struct Cookie *co; time_t now = time(NULL); struct Cookie *mainco=NULL; size_t matches = 0; if(!c || !c->cookies) return NULL; /* no cookie struct or no cookies in the struct */ /* at first, remove expired cookies */ remove_expired(c); 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 || (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 && Curl_raw_equal(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->spath || pathmatch(co->spath, path) ) { /* and now, we know this is a match and we should create an entry for the return-linked-list */ newco = 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; matches++; } else { fail: /* failure, clear up the allocated chain and return NULL */ while(mainco) { co = mainco->next; free(mainco); mainco = co; } return NULL; } } } } co = co->next; } if(matches) { /* Now we need to make sure that if there is a name appearing more than once, the longest specified path version comes first. To make this the swiftest way, we just sort them all based on path length. */ struct Cookie **array; size_t i; /* alloc an array and store all cookie pointers */ array = malloc(sizeof(struct Cookie *) * matches); if(!array) goto fail; co = mainco; for(i=0; co; co = co->next) array[i++] = co; /* now sort the cookie pointers in path length order */ qsort(array, matches, sizeof(struct Cookie *), cookie_sort); /* remake the linked list order according to the new order */ mainco = array[0]; /* start here */ for(i=0; inext = array[i+1]; array[matches-1]->next = NULL; /* terminate the list */ free(array); /* remove the temporary data again */ } return mainco; /* return the new list */ } /***************************************************************************** * * Curl_cookie_clearall() * * Clear all existing cookies and reset the counter. * ****************************************************************************/ void Curl_cookie_clearall(struct CookieInfo *cookies) { if(cookies) { Curl_cookie_freelist(cookies->cookies, TRUE); cookies->cookies = NULL; cookies->numcookies = 0; } } /***************************************************************************** * * Curl_cookie_freelist() * * Free a list of cookies previously returned by Curl_cookie_getlist(); * * The 'cookiestoo' argument tells this function whether to just free the * list or actually also free all cookies within the list as well. * ****************************************************************************/ void Curl_cookie_freelist(struct Cookie *co, bool cookiestoo) { struct Cookie *next; if(co) { while(co) { next = co->next; if(cookiestoo) freecookie(co); else free(co); /* we only free the struct since the "members" are all just pointed out in the main cookie list! */ 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->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; freecookie(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" /* httponly preamble */ "%s%s\t" /* domain */ "%s\t" /* tailmatch */ "%s\t" /* path */ "%s\t" /* secure */ "%" CURL_FORMAT_CURL_OFF_T "\t" /* expires */ "%s\t" /* name */ "%s", /* value */ co->httponly?"#HttpOnly_":"", /* 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:""); } /* * 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. */ static int cookie_output(struct CookieInfo *c, const 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; /* at first, remove expired cookies */ remove_expired(c); 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://curl.haxx.se/docs/http-cookies.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"); if(!use_stdout) fclose(out); 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; while(c) { /* fill the list with _all_ the cookies we know */ line = get_netscape_format(c); if(!line) { curl_slist_free_all(list); return NULL; } beg = Curl_slist_append_nodup(list, line); if(!beg) { free(line); curl_slist_free_all(list); return NULL; } list = beg; c = c->next; } return list; } void Curl_flush_cookies(struct SessionHandle *data, int cleanup) { if(data->set.str[STRING_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() LOCKS and UNLOCKS the share itself! */ Curl_cookie_loadfiles(data); } Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); /* if we have a destination file for all the cookies to get dumped to */ if(cookie_output(data->cookies, data->set.str[STRING_COOKIEJAR])) infof(data, "WARNING: failed to save cookies in %s\n", data->set.str[STRING_COOKIEJAR]); } else { if(cleanup && 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 */ data->change.cookielist = NULL; } Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); } if(cleanup && (!data->share || (data->cookies != data->share->cookies))) { Curl_cookie_cleanup(data->cookies); } Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); } #endif /* CURL_DISABLE_HTTP || CURL_DISABLE_COOKIES */ curl-7.35.0/lib/strdup.c0000644000175000017500000000273612213173003011727 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ /* * This file is 'mem-include-scan' clean. See test 1132. */ #include "curl_setup.h" #include "strdup.h" #ifndef HAVE_STRDUP char *curlx_strdup(const char *str) { size_t len; char *newstr; if(!str) return (char *)NULL; len = strlen(str); if(len >= ((size_t)-1) / sizeof(char)) return (char *)NULL; newstr = malloc((len+1)*sizeof(char)); if(!newstr) return (char *)NULL; memcpy(newstr,str,(len+1)*sizeof(char)); return newstr; } #endif curl-7.35.0/lib/curlx.h0000644000175000017500000000717712213173003011554 00000000000000#ifndef HEADER_CURL_CURLX_H #define HEADER_CURL_CURLX_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2008, 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. * ***************************************************************************/ /* * 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() */ #include "nonblock.h" /* "nonblock.h" provides curlx_nonblock() */ #include "warnless.h" /* "warnless.h" provides functions: curlx_ultous() curlx_ultouc() curlx_uztosi() */ /* 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_raw_equal Curl_raw_equal #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 transparent 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 /* HEADER_CURL_CURLX_H */ curl-7.35.0/lib/rawstr.h0000644000175000017500000000341012213173003011723 00000000000000#ifndef HEADER_CURL_RAWSTR_H #define HEADER_CURL_RAWSTR_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include /* * Curl_raw_equal() is for doing "raw" case insensitive strings. This is meant * to be locale independent and only compare strings we know are safe for * this. * * The function is capable of comparing a-z case insensitively even for * non-ascii. */ int Curl_raw_equal(const char *first, const char *second); int Curl_raw_nequal(const char *first, const char *second, size_t max); char Curl_raw_toupper(char in); /* checkprefix() is a shorter version of the above, used when the first argument is zero-byte terminated */ #define checkprefix(a,b) Curl_raw_nequal(a,b,strlen(a)) void Curl_strntoupper(char *dest, const char *src, size_t n); #endif /* HEADER_CURL_RAWSTR_H */ curl-7.35.0/lib/http_chunks.c0000644000175000017500000002711312270035364012746 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include "curl_setup.h" #ifndef CURL_DISABLE_HTTP #include "urldata.h" /* it includes http_chunks.h */ #include "sendf.h" /* for the client write stuff */ #include "content_encoding.h" #include "http.h" #include "curl_memory.h" #include "non-ascii.h" /* for Curl_convert_to_network prototype */ #include "strtoofft.h" #include "warnless.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. */ /* Check for an ASCII hex digit. We avoid the use of isxdigit to accommodate non-ASCII hosts. */ static bool Curl_isxdigit(char digit) { return ( (digit >= 0x30 && digit <= 0x39) /* 0-9 */ || (digit >= 0x41 && digit <= 0x46) /* A-F */ || (digit >= 0x61 && digit <= 0x66) /* a-f */ ) ? TRUE : FALSE; } void Curl_httpchunk_init(struct connectdata *conn) { struct Curl_chunker *chunk = &conn->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. * * This function always uses ASCII hex values to accommodate non-ASCII hosts. * For example, 0x0d and 0x0a are used instead of '\r' and '\n'. */ 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 = &conn->chunk; struct SingleRequest *k = &data->req; size_t piece; curl_off_t length = (curl_off_t)datalen; size_t *wrote = (size_t *)wrotep; *wrote = 0; /* nothing's written yet */ /* the original data is written to the client, but we go on with the chunk read process, to properly calculate the content length*/ if(data->set.http_te_skip && !k->ignorebody) { result = Curl_client_write(conn, CLIENTWRITE_BODY, datap, datalen); if(result) return CHUNKE_WRITE_ERROR; } while(length) { switch(ch->state) { case CHUNK_HEX: if(Curl_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 { char *endptr; 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; /* convert to host encoding before calling strtoul */ result = Curl_convert_from_network(conn->data, ch->hexbuffer, ch->hexindex); if(result) { /* Curl_convert_from_network calls failf if unsuccessful */ /* Treat it as a bad hex character */ return CHUNKE_ILLEGAL_HEX ; } ch->datasize=curlx_strtoofft(ch->hexbuffer, &endptr, 16); if(errno == ERANGE) /* over or underflow is an error */ return CHUNKE_ILLEGAL_HEX; ch->state = CHUNK_LF; /* now wait for the CRLF */ } break; case CHUNK_LF: /* waiting for the LF after a chunk size */ if(*datap == 0x0a) { /* we're now expecting data to come, unless size was zero! */ if(0 == ch->datasize) { ch->state = CHUNK_TRAILER; /* now check for trailers */ conn->trlPos=0; } else ch->state = CHUNK_DATA; } datap++; length--; break; case CHUNK_DATA: /* We expect 'datasize' of data. We have 'length' right now, it can be more or less than 'datasize'. Get the smallest piece. */ piece = curlx_sotouz((ch->datasize >= length)?length:ch->datasize); /* Write the data portion available */ #ifdef HAVE_LIBZ switch (conn->data->set.http_ce_skip? IDENTITY : data->req.auto_decoding) { case IDENTITY: #endif if(!k->ignorebody) { if(!data->set.http_te_skip) result = Curl_client_write(conn, CLIENTWRITE_BODY, datap, piece); else result = CURLE_OK; } #ifdef HAVE_LIBZ break; case DEFLATE: /* update data->req.keep.str to point to the chunk data. */ data->req.str = datap; result = Curl_unencode_deflate_write(conn, &data->req, (ssize_t)piece); break; case GZIP: /* update data->req.keep.str to point to the chunk data. */ data->req.str = datap; result = Curl_unencode_gzip_write(conn, &data->req, (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_POSTLF; break; case CHUNK_POSTLF: if(*datap == 0x0a) { /* The last one before we go back to hex state and start all over. */ Curl_httpchunk_init(conn); /* sets state back to CHUNK_HEX */ } else if(*datap != 0x0d) return CHUNKE_BAD_CHUNK; datap++; length--; break; case CHUNK_TRAILER: if((*datap == 0x0d) || (*datap == 0x0a)) { /* this is the end of a trailer, but if the trailer was zero bytes there was no trailer and we move on */ if(conn->trlPos) { /* we allocate trailer with 3 bytes extra room to fit this */ conn->trailer[conn->trlPos++]=0x0d; conn->trailer[conn->trlPos++]=0x0a; conn->trailer[conn->trlPos]=0; /* Convert to host encoding before calling Curl_client_write */ result = Curl_convert_from_network(conn->data, conn->trailer, conn->trlPos); if(result) /* Curl_convert_from_network calls failf if unsuccessful */ /* Treat it as a bad chunk */ return CHUNKE_BAD_CHUNK; if(!data->set.http_te_skip) { result = Curl_client_write(conn, CLIENTWRITE_HEADER, conn->trailer, conn->trlPos); if(result) return CHUNKE_WRITE_ERROR; } conn->trlPos=0; ch->state = CHUNK_TRAILER_CR; if(*datap == 0x0a) /* already on the LF */ break; } else { /* no trailer, we're on the final CRLF pair */ ch->state = CHUNK_TRAILER_POSTCR; break; /* don't advance the pointer */ } } else { /* conn->trailer is assumed to be freed in url.c on a connection basis */ if(conn->trlPos >= conn->trlMax) { /* we always allocate three extra bytes, just because when the full header has been received we append CRLF\0 */ char *ptr; if(conn->trlMax) { conn->trlMax *= 2; ptr = realloc(conn->trailer, conn->trlMax + 3); } else { conn->trlMax=128; ptr = malloc(conn->trlMax + 3); } if(!ptr) return CHUNKE_OUT_OF_MEMORY; conn->trailer = ptr; } conn->trailer[conn->trlPos++]=*datap; } datap++; length--; break; case CHUNK_TRAILER_CR: if(*datap == 0x0a) { ch->state = CHUNK_TRAILER_POSTCR; datap++; length--; } else return CHUNKE_BAD_CHUNK; break; case CHUNK_TRAILER_POSTCR: /* We enter this state when a CR should arrive so we expect to have to first pass a CR before we wait for LF */ if((*datap != 0x0d) && (*datap != 0x0a)) { /* not a CR then it must be another header in the trailer */ ch->state = CHUNK_TRAILER; break; } if(*datap == 0x0d) { /* skip if CR */ datap++; length--; } /* now wait for the final LF */ ch->state = CHUNK_STOP; break; case CHUNK_STOP: if(*datap == 0x0a) { length--; /* Record the length of any data left in the end of the buffer even if there's no more chunks to read */ ch->dataleft = curlx_sotouz(length); return CHUNKE_STOP; /* return stop */ } else return CHUNKE_BAD_CHUNK; } } return CHUNKE_OK; } #endif /* CURL_DISABLE_HTTP */ curl-7.35.0/lib/config-win32ce.h0000644000175000017500000003262312213173003013126 00000000000000#ifndef HEADER_CURL_CONFIG_WIN32CE_H #define HEADER_CURL_CONFIG_WIN32CE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ /* ================================================================ */ /* lib/config-win32ce.h - Hand crafted config file for windows ce */ /* ================================================================ */ /* ---------------------------------------------------------------- */ /* HEADER FILES */ /* ---------------------------------------------------------------- */ /* 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_ERRNO_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_LIMITS_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_SIGNAL_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 sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T 1 /* 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 ioctlsocket function. */ #define HAVE_IOCTLSOCKET 1 /* Define if you have a working ioctlsocket FIONBIO function. */ #define HAVE_IOCTLSOCKET_FIONBIO 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 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 strncasecmp function. */ /* #define HAVE_STRNCASECMP 1 */ /* Define if you have the strnicmp function. */ /* #define HAVE_STRNICMP 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 utime function */ #define HAVE_UTIME 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 recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 SOCKET /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 char /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 int /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 int /* Define to the function return type for recvfrom. */ #define RECVFROM_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 ssize_t if it is not an available 'typedefed' type */ #if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || defined(__POCC__) #elif defined(_WIN64) #define ssize_t __int64 #else #define ssize_t int #endif /* ---------------------------------------------------------------- */ /* TYPE SIZES */ /* ---------------------------------------------------------------- */ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* The size of `long double', as computed by sizeof. */ #define SIZEOF_LONG_DOUBLE 16 /* The size of `long long', as computed by sizeof. */ /* #define SIZEOF_LONG_LONG 8 */ /* The size of `short', as computed by sizeof. */ #define SIZEOF_SHORT 2 /* The size of `size_t', as computed by sizeof. */ #if defined(_WIN64) # define SIZEOF_SIZE_T 8 #else # define SIZEOF_SIZE_T 4 #endif /* ---------------------------------------------------------------- */ /* 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 /* Define this if struct sockaddr_in6 has the sin6_scope_id member */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 /* ---------------------------------------------------------------- */ /* COMPILER SPECIFIC */ /* ---------------------------------------------------------------- */ /* Undef keyword 'const' if it does not work. */ /* #undef const */ /* Define to avoid VS2005 complaining about portable C functions */ #if defined(_MSC_VER) && (_MSC_VER >= 1400) #define _CRT_SECURE_NO_DEPRECATE 1 #define _CRT_NONSTDC_NO_DEPRECATE 1 #endif /* VS2005 and later dafault size for time_t is 64-bit, unless */ /* _USE_32BIT_TIME_T has been defined to get a 32-bit time_t. */ #if defined(_MSC_VER) && (_MSC_VER >= 1400) # ifndef _USE_32BIT_TIME_T # define SIZEOF_TIME_T 8 # else # define SIZEOF_TIME_T 4 # endif #endif /* ---------------------------------------------------------------- */ /* LARGE FILE SUPPORT */ /* ---------------------------------------------------------------- */ #if defined(_MSC_VER) && !defined(_WIN32_WCE) # if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64) # define USE_WIN32_LARGE_FILES # else # define USE_WIN32_SMALL_FILES # endif #endif #if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES) # define USE_WIN32_SMALL_FILES #endif /* ---------------------------------------------------------------- */ /* LDAP SUPPORT */ /* ---------------------------------------------------------------- */ #define CURL_LDAP_WIN 1 #undef HAVE_LDAP_URL_PARSE /* ---------------------------------------------------------------- */ /* ADDITIONAL DEFINITIONS */ /* ---------------------------------------------------------------- */ /* Define cpu-machine-OS */ #undef OS #define OS "i386-pc-win32ce" /* Name of package */ #define PACKAGE "curl" /* ---------------------------------------------------------------- */ /* WinCE */ /* ---------------------------------------------------------------- */ #ifndef UNICODE # define UNICODE #endif #ifndef _UNICODE # define _UNICODE #endif #define CURL_DISABLE_FILE 1 #define CURL_DISABLE_TELNET 1 #define CURL_DISABLE_LDAP 1 #define ENOSPC 1 #define ENOMEM 2 #define EAGAIN 3 extern int stat(const char *path,struct stat *buffer ); #endif /* HEADER_CURL_CONFIG_WIN32CE_H */ curl-7.35.0/curl-config.in0000644000175000017500000001131312262353672012243 00000000000000#! /bin/sh #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 2001 - 2012, 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. # ########################################################################### prefix=@prefix@ exec_prefix=@exec_prefix@ includedir=@includedir@ cppflag_curl_staticlib=@CPPFLAG_CURL_STATICLIB@ usage() { cat <&2 exit 1 fi ;; --configure) echo @CONFIGURE_OPTIONS@ ;; *) echo "unknown option: $1" usage 1 ;; esac shift done exit 0 curl-7.35.0/MacOSX-Framework0000755000175000017500000001310012262353672012452 00000000000000#!/bin/bash # This script performs all of the steps needed to build a # universal binary libcurl.framework for Mac OS X 10.4 or greater. # # Hendrik Visage: # Generalizations added since Snowleopard (10.6) do not include # the 10.4u SDK. # # Also note: # 10.5 is the *ONLY* SDK that support PPC64 :( -- 10.6 do not have ppc64 support #If you need to have PPC64 support then change below to 1 PPC64_NEEDED=0 # Apple does not support building for PPC anymore in Xcode 4 and later. # If you're using Xcode 3 or earlier and need PPC support, then change # the setting below to 1 PPC_NEEDED=0 # For me the default is to develop for the platform I am on, and if you #desire compatibility with older versions then change USE_OLD to 1 :) USE_OLD=0 VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h` FRAMEWORK_VERSION=Versions/Release-$VERSION #I also wanted to "copy over" the system, and thus the reason I added the # version to Versions/Release-7.20.1 etc. # now a simple rsync -vaP libcurl.framework /Library/Frameworks will install it # and setup the right paths to this version, leaving the system version # "intact", so you can "fix" it later with the links to Versions/A/... DEVELOPER_PATH=`xcode-select --print-path` # Around Xcode 4.3, SDKs were moved from the Developer folder into the # MacOSX.platform folder if test -d "$DEVELOPER_PATH/Platforms/MacOSX.platform/Developer/SDKs"; then SDK_PATH="$DEVELOPER_PATH/Platforms/MacOSX.platform/Developer/SDKs" else SDK_PATH="$DEVELOPER_PATH/SDKs"; fi OLD_SDK=`ls $SDK_PATH|head -1` NEW_SDK=`ls -r $SDK_PATH|head -1` if test "0"$USE_OLD -gt 0 then SDK32=$OLD_SDK else SDK32=$NEW_SDK fi MACVER=`echo $SDK32|sed -e s/[a-zA-Z]//g -e s/.\$//` SDK32_DIR=$SDK_PATH/$SDK32 MINVER32='-mmacosx-version-min='$MACVER if test $PPC_NEEDED -gt 0; then ARCHES32='-arch i386 -arch ppc' else ARCHES32='-arch i386' fi if test $PPC64_NEEDED -gt 0 then SDK64=10.5 ARCHES64='-arch x86_64 -arch ppc64' SDK64=`ls $SDK_PATH|grep 10.5|head -1` else ARCHES64='-arch x86_64' #We "know" that 10.4 and earlier do not support 64bit OLD_SDK64=`ls $SDK_PATH|egrep -v "10.[0-4]"|head -1` NEW_SDK64=`ls -r $SDK_PATH|egrep -v "10.[0-4]"|head -1` if test $USE_OLD -gt 0 then SDK64=$OLD_SDK64 else SDK64=$NEW_SDK64 fi fi SDK64_DIR=$SDK_PATH/$SDK64 MACVER64=`echo $SDK64|sed -e s/[a-zA-Z]//g -e s/.\$//` MINVER64='-mmacosx-version-min='$MACVER64 if test ! -z $SDK32; then echo "----Configuring libcurl for 32 bit universal framework..." make clean ./configure --disable-dependency-tracking --disable-static --with-gssapi --with-darwinssl \ CFLAGS="-Os -isysroot $SDK32_DIR $ARCHES32" \ LDFLAGS="-Wl,-syslibroot,$SDK32_DIR $ARCHES32 -Wl,-headerpad_max_install_names" \ CC=$CC echo "----Building 32 bit libcurl..." make -j `sysctl -n hw.logicalcpu_max` echo "----Creating 32 bit framework..." rm -r libcurl.framework mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Resources cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl install_name_tool -id @executable_path/../Frameworks/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl /usr/bin/sed -e "s/7\.12\.3/$VERSION/" lib/libcurl.plist >libcurl.framework/${FRAMEWORK_VERSION}/Resources/Info.plist mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl cp include/curl/*.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl pushd libcurl.framework ln -fs ${FRAMEWORK_VERSION}/libcurl libcurl ln -fs ${FRAMEWORK_VERSION}/Resources Resources ln -fs ${FRAMEWORK_VERSION}/Headers Headers cd Versions ln -fs $(basename "${FRAMEWORK_VERSION}") Current echo Testing for SDK64 if test -d $SDK64_DIR; then echo entering... popd make clean echo "----Configuring libcurl for 64 bit universal framework..." ./configure --disable-dependency-tracking --disable-static --with-gssapi --with-darwinssl \ CFLAGS="-Os -isysroot $SDK64_DIR $ARCHES64" \ LDFLAGS="-Wl,-syslibroot,$SDK64_DIR $ARCHES64 -Wl,-headerpad_max_install_names" \ CC=$CC echo "----Building 64 bit libcurl..." make -j `sysctl -n hw.logicalcpu_max` echo "----Appending 64 bit framework to 32 bit framework..." cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 install_name_tool -id @executable_path/../Frameworks/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 cp libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 pwd lipo libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 -create -output libcurl.framework/${FRAMEWORK_VERSION}/libcurl rm libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 cp libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild32.h cp include/curl/curlbuild.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild64.h cat >libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild.h <, 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. # #*************************************************************************** dnl CURL_CHECK_DEF (SYMBOL, [INCLUDES], [SILENT]) dnl ------------------------------------------------- dnl Use the C preprocessor to find out if the given object-style symbol dnl is defined and get its expansion. This macro will not use default dnl includes even if no INCLUDES argument is given. This macro will run dnl silently when invoked with three arguments. If the expansion would dnl result in a set of double-quoted strings the returned expansion will dnl actually be a single double-quoted string concatenating all them. AC_DEFUN([CURL_CHECK_DEF], [ AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl AS_VAR_PUSHDEF([ac_Def], [curl_cv_def_$1])dnl if test -z "$SED"; then AC_MSG_ERROR([SED not set. Cannot continue without SED being set.]) fi if test -z "$GREP"; then AC_MSG_ERROR([GREP not set. Cannot continue without GREP being set.]) fi ifelse($3,,[AC_MSG_CHECKING([for preprocessor definition of $1])]) tmp_exp="" AC_PREPROC_IFELSE([ AC_LANG_SOURCE( ifelse($2,,,[$2])[[ #ifdef $1 CURL_DEF_TOKEN $1 #endif ]]) ],[ tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[[ ]][[ ]]*//' 2>/dev/null | \ "$SED" 's/[["]][[ ]]*[["]]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "$1"; then tmp_exp="" fi ]) if test -z "$tmp_exp"; then AS_VAR_SET(ac_HaveDef, no) ifelse($3,,[AC_MSG_RESULT([no])]) else AS_VAR_SET(ac_HaveDef, yes) AS_VAR_SET(ac_Def, $tmp_exp) ifelse($3,,[AC_MSG_RESULT([$tmp_exp])]) fi AS_VAR_POPDEF([ac_Def])dnl AS_VAR_POPDEF([ac_HaveDef])dnl ]) dnl CURL_CHECK_DEF_CC (SYMBOL, [INCLUDES], [SILENT]) dnl ------------------------------------------------- dnl Use the C compiler to find out only if the given symbol is defined dnl or not, this can not find out its expansion. This macro will not use dnl default includes even if no INCLUDES argument is given. This macro dnl will run silently when invoked with three arguments. AC_DEFUN([CURL_CHECK_DEF_CC], [ AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl ifelse($3,,[AC_MSG_CHECKING([for compiler definition of $1])]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE( ifelse($2,,,[$2])[[ int main (void) { #ifdef $1 return 0; #else force compilation error #endif } ]]) ],[ tst_symbol_defined="yes" ],[ tst_symbol_defined="no" ]) if test "$tst_symbol_defined" = "yes"; then AS_VAR_SET(ac_HaveDef, yes) ifelse($3,,[AC_MSG_RESULT([yes])]) else AS_VAR_SET(ac_HaveDef, no) ifelse($3,,[AC_MSG_RESULT([no])]) fi AS_VAR_POPDEF([ac_HaveDef])dnl ]) dnl CURL_CHECK_LIB_XNET dnl ------------------------------------------------- dnl Verify if X/Open network library is required. AC_DEFUN([CURL_CHECK_LIB_XNET], [ AC_MSG_CHECKING([if X/Open network library is required]) tst_lib_xnet_required="no" AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ int main (void) { #if defined(__hpux) && defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600) return 0; #elif defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED) return 0; #else force compilation error #endif } ]]) ],[ tst_lib_xnet_required="yes" LIBS="-lxnet $LIBS" ]) AC_MSG_RESULT([$tst_lib_xnet_required]) ]) dnl CURL_CHECK_AIX_ALL_SOURCE dnl ------------------------------------------------- dnl Provides a replacement of traditional AC_AIX with dnl an uniform behaviour across all autoconf versions, dnl and with our own placement rules. AC_DEFUN([CURL_CHECK_AIX_ALL_SOURCE], [ AH_VERBATIM([_ALL_SOURCE], [/* Define to 1 if OS is AIX. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif]) AC_BEFORE([$0], [AC_SYS_LARGEFILE])dnl AC_BEFORE([$0], [CURL_CONFIGURE_REENTRANT])dnl AC_BEFORE([$0], [CURL_CONFIGURE_PULL_SYS_POLL])dnl AC_MSG_CHECKING([if OS is AIX (to define _ALL_SOURCE)]) AC_EGREP_CPP([yes_this_is_aix],[ #ifdef _AIX yes_this_is_aix #endif ],[ AC_MSG_RESULT([yes]) AC_DEFINE(_ALL_SOURCE) ],[ AC_MSG_RESULT([no]) ]) ]) 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 ]],[[ #if defined(__CYGWIN__) || defined(__CEGCC__) 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_NATIVE_WINDOWS dnl ------------------------------------------------- dnl Check if building a native Windows target AC_DEFUN([CURL_CHECK_NATIVE_WINDOWS], [ AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl AC_CACHE_CHECK([whether build target is a native Windows one], [ac_cv_native_windows], [ if test "$ac_cv_header_windows_h" = "no"; then ac_cv_native_windows="no" else AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ #if defined(__MINGW32__) || defined(__MINGW32CE__) || \ (defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64))) int dummy=1; #else Not a native Windows build target. #endif ]]) ],[ ac_cv_native_windows="yes" ],[ ac_cv_native_windows="no" ]) fi ]) AM_CONDITIONAL(DOING_NATIVE_WINDOWS, test "x$ac_cv_native_windows" = xyes) ]) 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 ]],[[ #if defined(__CYGWIN__) || defined(__CEGCC__) 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 ]],[[ #if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) 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 ]],[[ #if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) 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_WINLDAP dnl ------------------------------------------------- dnl Check for compilable and valid winldap.h header AC_DEFUN([CURL_CHECK_HEADER_WINLDAP], [ AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl AC_CACHE_CHECK([for winldap.h], [ac_cv_header_winldap_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #endif #include ]],[[ #if defined(__CYGWIN__) || defined(__CEGCC__) HAVE_WINLDAP_H shall not be defined. #else LDAP *ldp = ldap_init("dummy", LDAP_PORT); ULONG res = ldap_unbind(ldp); #endif ]]) ],[ ac_cv_header_winldap_h="yes" ],[ ac_cv_header_winldap_h="no" ]) ]) case "$ac_cv_header_winldap_h" in yes) AC_DEFINE_UNQUOTED(HAVE_WINLDAP_H, 1, [Define to 1 if you have the winldap.h header file.]) ;; esac ]) dnl CURL_CHECK_HEADER_WINBER dnl ------------------------------------------------- dnl Check for compilable and valid winber.h header AC_DEFUN([CURL_CHECK_HEADER_WINBER], [ AC_REQUIRE([CURL_CHECK_HEADER_WINLDAP])dnl AC_CACHE_CHECK([for winber.h], [ac_cv_header_winber_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #endif #include #include ]],[[ #if defined(__CYGWIN__) || defined(__CEGCC__) HAVE_WINBER_H shall not be defined. #else BERVAL *bvp = NULL; BerElement *bep = ber_init(bvp); ber_free(bep, 1); #endif ]]) ],[ ac_cv_header_winber_h="yes" ],[ ac_cv_header_winber_h="no" ]) ]) case "$ac_cv_header_winber_h" in yes) AC_DEFINE_UNQUOTED(HAVE_WINBER_H, 1, [Define to 1 if you have the winber.h header file.]) ;; esac ]) dnl CURL_CHECK_HEADER_LBER dnl ------------------------------------------------- dnl Check for compilable and valid lber.h header, dnl and check if it is needed even with ldap.h AC_DEFUN([CURL_CHECK_HEADER_LBER], [ AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl AC_CACHE_CHECK([for lber.h], [ac_cv_header_lber_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #else #ifdef HAVE_SYS_TYPES_H #include #endif #endif #ifndef NULL #define NULL (void *)0 #endif #include ]],[[ BerValue *bvp = NULL; BerElement *bep = ber_init(bvp); ber_free(bep, 1); ]]) ],[ ac_cv_header_lber_h="yes" ],[ ac_cv_header_lber_h="no" ]) ]) if test "$ac_cv_header_lber_h" = "yes"; then AC_DEFINE_UNQUOTED(HAVE_LBER_H, 1, [Define to 1 if you have the lber.h header file.]) # AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #else #ifdef HAVE_SYS_TYPES_H #include #endif #endif #ifndef NULL #define NULL (void *)0 #endif #ifndef LDAP_DEPRECATED #define LDAP_DEPRECATED 1 #endif #include ]],[[ BerValue *bvp = NULL; BerElement *bep = ber_init(bvp); ber_free(bep, 1); ]]) ],[ curl_cv_need_header_lber_h="no" ],[ curl_cv_need_header_lber_h="yes" ]) # case "$curl_cv_need_header_lber_h" in yes) AC_DEFINE_UNQUOTED(NEED_LBER_H, 1, [Define to 1 if you need the lber.h header file even with ldap.h]) ;; esac fi ]) dnl CURL_CHECK_HEADER_LDAP dnl ------------------------------------------------- dnl Check for compilable and valid ldap.h header AC_DEFUN([CURL_CHECK_HEADER_LDAP], [ AC_REQUIRE([CURL_CHECK_HEADER_LBER])dnl AC_CACHE_CHECK([for ldap.h], [ac_cv_header_ldap_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #else #ifdef HAVE_SYS_TYPES_H #include #endif #endif #ifndef LDAP_DEPRECATED #define LDAP_DEPRECATED 1 #endif #ifdef NEED_LBER_H #include #endif #include ]],[[ LDAP *ldp = ldap_init("dummy", LDAP_PORT); int res = ldap_unbind(ldp); ]]) ],[ ac_cv_header_ldap_h="yes" ],[ ac_cv_header_ldap_h="no" ]) ]) case "$ac_cv_header_ldap_h" in yes) AC_DEFINE_UNQUOTED(HAVE_LDAP_H, 1, [Define to 1 if you have the ldap.h header file.]) ;; esac ]) dnl CURL_CHECK_HEADER_LDAP_SSL dnl ------------------------------------------------- dnl Check for compilable and valid ldap_ssl.h header AC_DEFUN([CURL_CHECK_HEADER_LDAP_SSL], [ AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl AC_CACHE_CHECK([for ldap_ssl.h], [ac_cv_header_ldap_ssl_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #else #ifdef HAVE_SYS_TYPES_H #include #endif #endif #ifndef LDAP_DEPRECATED #define LDAP_DEPRECATED 1 #endif #ifdef NEED_LBER_H #include #endif #ifdef HAVE_LDAP_H #include #endif #include ]],[[ LDAP *ldp = ldapssl_init("dummy", LDAPS_PORT, 1); ]]) ],[ ac_cv_header_ldap_ssl_h="yes" ],[ ac_cv_header_ldap_ssl_h="no" ]) ]) case "$ac_cv_header_ldap_ssl_h" in yes) AC_DEFINE_UNQUOTED(HAVE_LDAP_SSL_H, 1, [Define to 1 if you have the ldap_ssl.h header file.]) ;; esac ]) dnl CURL_CHECK_HEADER_LDAPSSL dnl ------------------------------------------------- dnl Check for compilable and valid ldapssl.h header AC_DEFUN([CURL_CHECK_HEADER_LDAPSSL], [ AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl AC_CACHE_CHECK([for ldapssl.h], [ac_cv_header_ldapssl_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #else #ifdef HAVE_SYS_TYPES_H #include #endif #endif #ifndef NULL #define NULL (void *)0 #endif #ifndef LDAP_DEPRECATED #define LDAP_DEPRECATED 1 #endif #ifdef NEED_LBER_H #include #endif #ifdef HAVE_LDAP_H #include #endif #include ]],[[ char *cert_label = NULL; LDAP *ldp = ldap_ssl_init("dummy", LDAPS_PORT, cert_label); ]]) ],[ ac_cv_header_ldapssl_h="yes" ],[ ac_cv_header_ldapssl_h="no" ]) ]) case "$ac_cv_header_ldapssl_h" in yes) AC_DEFINE_UNQUOTED(HAVE_LDAPSSL_H, 1, [Define to 1 if you have the ldapssl.h header file.]) ;; esac ]) dnl CURL_CHECK_LIBS_WINLDAP dnl ------------------------------------------------- dnl Check for libraries needed for WINLDAP support, dnl and prepended to LIBS any needed libraries. dnl This macro can take an optional parameter with a dnl white space separated list of libraries to check dnl before the WINLDAP default ones. AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [ AC_REQUIRE([CURL_CHECK_HEADER_WINBER])dnl # AC_MSG_CHECKING([for WINLDAP libraries]) # u_libs="" # ifelse($1,,,[ for x_lib in $1; do case "$x_lib" in -l*) l_lib="$x_lib" ;; *) l_lib="-l$x_lib" ;; esac if test -z "$u_libs"; then u_libs="$l_lib" else u_libs="$u_libs $l_lib" fi done ]) # curl_cv_save_LIBS="$LIBS" curl_cv_ldap_LIBS="unknown" # for x_nlibs in '' "$u_libs" \ '-lwldap32' ; do if test "$curl_cv_ldap_LIBS" = "unknown"; then if test -z "$x_nlibs"; then LIBS="$curl_cv_save_LIBS" else LIBS="$x_nlibs $curl_cv_save_LIBS" fi AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINLDAP_H #include #endif #ifdef HAVE_WINBER_H #include #endif #endif ]],[[ BERVAL *bvp = NULL; BerElement *bep = ber_init(bvp); LDAP *ldp = ldap_init("dummy", LDAP_PORT); ULONG res = ldap_unbind(ldp); ber_free(bep, 1); ]]) ],[ curl_cv_ldap_LIBS="$x_nlibs" ]) fi done # LIBS="$curl_cv_save_LIBS" # case X-"$curl_cv_ldap_LIBS" in X-unknown) AC_MSG_RESULT([cannot find WINLDAP libraries]) ;; X-) AC_MSG_RESULT([no additional lib required]) ;; *) if test -z "$curl_cv_save_LIBS"; then LIBS="$curl_cv_ldap_LIBS" else LIBS="$curl_cv_ldap_LIBS $curl_cv_save_LIBS" fi AC_MSG_RESULT([$curl_cv_ldap_LIBS]) ;; esac # ]) dnl CURL_CHECK_LIBS_LDAP dnl ------------------------------------------------- dnl Check for libraries needed for LDAP support, dnl and prepended to LIBS any needed libraries. dnl This macro can take an optional parameter with a dnl white space separated list of libraries to check dnl before the default ones. AC_DEFUN([CURL_CHECK_LIBS_LDAP], [ AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl # AC_MSG_CHECKING([for LDAP libraries]) # u_libs="" # ifelse($1,,,[ for x_lib in $1; do case "$x_lib" in -l*) l_lib="$x_lib" ;; *) l_lib="-l$x_lib" ;; esac if test -z "$u_libs"; then u_libs="$l_lib" else u_libs="$u_libs $l_lib" fi done ]) # curl_cv_save_LIBS="$LIBS" curl_cv_ldap_LIBS="unknown" # for x_nlibs in '' "$u_libs" \ '-lldap' \ '-llber -lldap' \ '-lldap -llber' \ '-lldapssl -lldapx -lldapsdk' \ '-lldapsdk -lldapx -lldapssl' ; do if test "$curl_cv_ldap_LIBS" = "unknown"; then if test -z "$x_nlibs"; then LIBS="$curl_cv_save_LIBS" else LIBS="$x_nlibs $curl_cv_save_LIBS" fi AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #else #ifdef HAVE_SYS_TYPES_H #include #endif #endif #ifndef NULL #define NULL (void *)0 #endif #ifndef LDAP_DEPRECATED #define LDAP_DEPRECATED 1 #endif #ifdef NEED_LBER_H #include #endif #ifdef HAVE_LDAP_H #include #endif ]],[[ BerValue *bvp = NULL; BerElement *bep = ber_init(bvp); LDAP *ldp = ldap_init("dummy", LDAP_PORT); int res = ldap_unbind(ldp); ber_free(bep, 1); ]]) ],[ curl_cv_ldap_LIBS="$x_nlibs" ]) fi done # LIBS="$curl_cv_save_LIBS" # case X-"$curl_cv_ldap_LIBS" in X-unknown) AC_MSG_RESULT([cannot find LDAP libraries]) ;; X-) AC_MSG_RESULT([no additional lib required]) ;; *) if test -z "$curl_cv_save_LIBS"; then LIBS="$curl_cv_ldap_LIBS" else LIBS="$curl_cv_ldap_LIBS $curl_cv_save_LIBS" fi AC_MSG_RESULT([$curl_cv_ldap_LIBS]) ;; 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_HEADER_MEMORY dnl ------------------------------------------------- dnl Check for compilable and valid memory.h header, dnl and check if it is needed even with stdlib.h for dnl memory related functions. AC_DEFUN([CURL_CHECK_HEADER_MEMORY], [ AC_CACHE_CHECK([for memory.h], [ac_cv_header_memory_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include ]],[[ void *p = malloc(10); void *q = calloc(10,10); free(p); free(q); ]]) ],[ ac_cv_header_memory_h="yes" ],[ ac_cv_header_memory_h="no" ]) ]) if test "$ac_cv_header_memory_h" = "yes"; then AC_DEFINE_UNQUOTED(HAVE_MEMORY_H, 1, [Define to 1 if you have the memory.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_memory_h="no" ],[ curl_cv_need_header_memory_h="yes" ]) # case "$curl_cv_need_header_memory_h" in yes) AC_DEFINE_UNQUOTED(NEED_MEMORY_H, 1, [Define to 1 if you need the memory.h header file even with stdlib.h]) ;; esac fi ]) 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_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_LINK_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ 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_LINK_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 #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 if test "$curl_cv_func_getnameinfo_args" = "unknown"; then 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" ]) fi 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 ]) 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_STDLIB_H #include #endif #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 ]) 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_LINK_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 ]],[[ 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 args 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 if test "$curl_cv_func_recv_args" = "unknown"; then 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" ]) fi 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 ]) 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_LINK_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 ]],[[ 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 args 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 if test "$curl_cv_func_send_args" = "unknown"; then 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" ]) fi 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 ]) 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 ]) 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 sys/socket.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 #ifdef HAVE_SYS_SOCKET_H #include #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 ]) dnl TYPE_SIG_ATOMIC_T dnl ------------------------------------------------- dnl Check if the sig_atomic_t type is available, and dnl verify if it is already defined as volatile. AC_DEFUN([TYPE_SIG_ATOMIC_T], [ AC_CHECK_HEADERS(signal.h) AC_CHECK_TYPE([sig_atomic_t],[ AC_DEFINE(HAVE_SIG_ATOMIC_T, 1, [Define to 1 if sig_atomic_t is an available typedef.]) ], ,[ #ifdef HAVE_SIGNAL_H #include #endif ]) case "$ac_cv_type_sig_atomic_t" in yes) # AC_MSG_CHECKING([if sig_atomic_t is already defined as volatile]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #ifdef HAVE_SIGNAL_H #include #endif ]],[[ static volatile sig_atomic_t dummy = 0; ]]) ],[ AC_MSG_RESULT([no]) ac_cv_sig_atomic_t_volatile="no" ],[ AC_MSG_RESULT([yes]) ac_cv_sig_atomic_t_volatile="yes" ]) # if test "$ac_cv_sig_atomic_t_volatile" = "yes"; then AC_DEFINE(HAVE_SIG_ATOMIC_T_VOLATILE, 1, [Define to 1 if sig_atomic_t is already defined as volatile.]) fi ;; esac ]) 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], ,[ dnl in_addr_t not available AC_CACHE_CHECK([for in_addr_t equivalent], [curl_cv_in_addr_t_equiv], [ curl_cv_in_addr_t_equiv="unknown" for t in "unsigned long" int size_t unsigned long; do if test "$curl_cv_in_addr_t_equiv" = "unknown"; then AC_LINK_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 #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" ]) fi done ]) case "$curl_cv_in_addr_t_equiv" in unknown) AC_MSG_ERROR([Cannot find a type to use in place of in_addr_t]) ;; *) AC_DEFINE_UNQUOTED(in_addr_t, $curl_cv_in_addr_t_equiv, [Type to use in place of in_addr_t when system does not provide it.]) ;; esac ],[ #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 CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC dnl ------------------------------------------------- dnl Check if monotonic clock_gettime is available. AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [ AC_REQUIRE([AC_HEADER_TIME])dnl AC_CHECK_HEADERS(sys/types.h sys/time.h time.h) AC_MSG_CHECKING([for monotonic clock_gettime]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #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 timespec ts; (void)clock_gettime(CLOCK_MONOTONIC, &ts); ]]) ],[ AC_MSG_RESULT([yes]) ac_cv_func_clock_gettime="yes" ],[ AC_MSG_RESULT([no]) ac_cv_func_clock_gettime="no" ]) dnl Definition of HAVE_CLOCK_GETTIME_MONOTONIC is intentionally postponed dnl until library linking and run-time checks for clock_gettime succeed. ]) dnl CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC dnl ------------------------------------------------- dnl If monotonic clock_gettime is available then, dnl check and prepended to LIBS any needed libraries. AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [ AC_REQUIRE([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC])dnl # if test "$ac_cv_func_clock_gettime" = "yes"; then # AC_MSG_CHECKING([for clock_gettime in libraries]) # curl_cv_save_LIBS="$LIBS" curl_cv_gclk_LIBS="unknown" # for x_xlibs in '' '-lrt' '-lposix4' ; do if test "$curl_cv_gclk_LIBS" = "unknown"; then if test -z "$x_xlibs"; then LIBS="$curl_cv_save_LIBS" else LIBS="$x_xlibs $curl_cv_save_LIBS" fi AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #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 timespec ts; (void)clock_gettime(CLOCK_MONOTONIC, &ts); ]]) ],[ curl_cv_gclk_LIBS="$x_xlibs" ]) fi done # LIBS="$curl_cv_save_LIBS" # case X-"$curl_cv_gclk_LIBS" in X-unknown) AC_MSG_RESULT([cannot find clock_gettime]) AC_MSG_WARN([HAVE_CLOCK_GETTIME_MONOTONIC will not be defined]) ac_cv_func_clock_gettime="no" ;; X-) AC_MSG_RESULT([no additional lib required]) ac_cv_func_clock_gettime="yes" ;; *) if test -z "$curl_cv_save_LIBS"; then LIBS="$curl_cv_gclk_LIBS" else LIBS="$curl_cv_gclk_LIBS $curl_cv_save_LIBS" fi AC_MSG_RESULT([$curl_cv_gclk_LIBS]) ac_cv_func_clock_gettime="yes" ;; esac # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$ac_cv_func_clock_gettime" = "yes"; then AC_MSG_CHECKING([if monotonic clock_gettime works]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ #ifdef HAVE_STDLIB_H #include #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 timespec ts; if (0 == clock_gettime(CLOCK_MONOTONIC, &ts)) exit(0); else exit(1); ]]) ],[ AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) AC_MSG_WARN([HAVE_CLOCK_GETTIME_MONOTONIC will not be defined]) ac_cv_func_clock_gettime="no" LIBS="$curl_cv_save_LIBS" ]) fi # case "$ac_cv_func_clock_gettime" in yes) AC_DEFINE_UNQUOTED(HAVE_CLOCK_GETTIME_MONOTONIC, 1, [Define to 1 if you have the clock_gettime function and monotonic timer.]) ;; esac # fi # ]) dnl CURL_CHECK_LIBS_CONNECT dnl ------------------------------------------------- dnl Verify if network connect function is already available dnl using current libraries or if another one is required. AC_DEFUN([CURL_CHECK_LIBS_CONNECT], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl AC_MSG_CHECKING([for connect in libraries]) tst_connect_save_LIBS="$LIBS" tst_connect_need_LIBS="unknown" for tst_lib in '' '-lsocket' ; do if test "$tst_connect_need_LIBS" = "unknown"; then LIBS="$tst_lib $tst_connect_save_LIBS" AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 #ifndef HAVE_WINDOWS_H int connect(int, void*, int); #endif ]],[[ if(0 != connect(0, 0, 0)) return 1; ]]) ],[ tst_connect_need_LIBS="$tst_lib" ]) fi done LIBS="$tst_connect_save_LIBS" # case X-"$tst_connect_need_LIBS" in X-unknown) AC_MSG_RESULT([cannot find connect]) AC_MSG_ERROR([cannot find connect function in libraries.]) ;; X-) AC_MSG_RESULT([yes]) ;; *) AC_MSG_RESULT([$tst_connect_need_LIBS]) LIBS="$tst_connect_need_LIBS $tst_connect_save_LIBS" ;; esac ]) dnl CURL_DEFINE_UNQUOTED (VARIABLE, [VALUE]) dnl ------------------------------------------------- dnl Like AC_DEFINE_UNQUOTED this macro will define a C preprocessor dnl symbol that can be further used in custom template configuration dnl files. This macro, unlike AC_DEFINE_UNQUOTED, does not use a third dnl argument for the description. Symbol definitions done with this dnl macro are intended to be exclusively used in handcrafted *.h.in dnl template files. Contrary to what AC_DEFINE_UNQUOTED does, this one dnl prevents autoheader generation and insertion of symbol template dnl stub and definition into the first configuration header file. Do dnl not use this macro as a replacement for AC_DEFINE_UNQUOTED, each dnl one serves different functional needs. AC_DEFUN([CURL_DEFINE_UNQUOTED], [ cat >>confdefs.h <<_EOF [@%:@define] $1 ifelse($#, 2, [$2], 1) _EOF ]) dnl CURL_CONFIGURE_LONG dnl ------------------------------------------------- dnl Find out the size of long as reported by sizeof() and define dnl CURL_SIZEOF_LONG as appropriate to be used in template file dnl include/curl/curlbuild.h.in to properly configure the library. dnl The size of long is a build time characteristic and as such dnl must be recorded in curlbuild.h AC_DEFUN([CURL_CONFIGURE_LONG], [ if test -z "$ac_cv_sizeof_long" || test "$ac_cv_sizeof_long" -eq "0"; then AC_MSG_ERROR([cannot find out size of long.]) fi CURL_DEFINE_UNQUOTED([CURL_SIZEOF_LONG], [$ac_cv_sizeof_long]) ]) dnl CURL_CONFIGURE_CURL_SOCKLEN_T dnl ------------------------------------------------- dnl Find out suitable curl_socklen_t data type definition and size, making dnl appropriate definitions for template file include/curl/curlbuild.h.in dnl to properly configure and use the library. dnl dnl The need for the curl_socklen_t definition arises mainly to properly dnl interface HP-UX systems which on one hand have a typedef'ed socklen_t dnl data type which is 32 or 64-Bit wide depending on the data model being dnl used, and that on the other hand is only actually used when interfacing dnl the X/Open sockets provided in the xnet library. AC_DEFUN([CURL_CONFIGURE_CURL_SOCKLEN_T], [ AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl AC_REQUIRE([CURL_PREPROCESS_CALLCONV])dnl # AC_BEFORE([$0], [CURL_CONFIGURE_PULL_SYS_POLL])dnl # AC_MSG_CHECKING([for curl_socklen_t data type]) curl_typeof_curl_socklen_t="unknown" for arg1 in int SOCKET; do for arg2 in 'struct sockaddr' void; do for t in socklen_t int size_t 'unsigned int' long 'unsigned long' void; do if test "$curl_typeof_curl_socklen_t" = "unknown"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_ws2tcpip $curl_includes_sys_socket $curl_preprocess_callconv extern int FUNCALLCONV getpeername($arg1, $arg2 *, $t *); ]],[[ $t *lenptr = 0; if(0 != getpeername(0, 0, lenptr)) return 1; ]]) ],[ curl_typeof_curl_socklen_t="$t" ]) fi done done done for t in socklen_t int; do if test "$curl_typeof_curl_socklen_t" = "void"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_socket typedef $t curl_socklen_t; ]],[[ curl_socklen_t dummy; ]]) ],[ curl_typeof_curl_socklen_t="$t" ]) fi done AC_MSG_RESULT([$curl_typeof_curl_socklen_t]) if test "$curl_typeof_curl_socklen_t" = "void" || test "$curl_typeof_curl_socklen_t" = "unknown"; then AC_MSG_ERROR([cannot find data type for curl_socklen_t.]) fi # AC_MSG_CHECKING([size of curl_socklen_t]) curl_sizeof_curl_socklen_t="unknown" curl_pull_headers_socklen_t="unknown" if test "$ac_cv_header_ws2tcpip_h" = "yes"; then tst_pull_header_checks='none ws2tcpip' tst_size_checks='4' else tst_pull_header_checks='none systypes syssocket' tst_size_checks='4 8 2' fi for tst_size in $tst_size_checks; do for tst_pull_headers in $tst_pull_header_checks; do if test "$curl_sizeof_curl_socklen_t" = "unknown"; then case $tst_pull_headers in ws2tcpip) tmp_includes="$curl_includes_ws2tcpip" ;; systypes) tmp_includes="$curl_includes_sys_types" ;; syssocket) tmp_includes="$curl_includes_sys_socket" ;; *) tmp_includes="" ;; esac AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $tmp_includes typedef $curl_typeof_curl_socklen_t curl_socklen_t; typedef char dummy_arr[sizeof(curl_socklen_t) == $tst_size ? 1 : -1]; ]],[[ curl_socklen_t dummy; ]]) ],[ curl_sizeof_curl_socklen_t="$tst_size" curl_pull_headers_socklen_t="$tst_pull_headers" ]) fi done done AC_MSG_RESULT([$curl_sizeof_curl_socklen_t]) if test "$curl_sizeof_curl_socklen_t" = "unknown"; then AC_MSG_ERROR([cannot find out size of curl_socklen_t.]) fi # case $curl_pull_headers_socklen_t in ws2tcpip) CURL_DEFINE_UNQUOTED([CURL_PULL_WS2TCPIP_H]) ;; systypes) CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_TYPES_H]) ;; syssocket) CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_TYPES_H]) CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_SOCKET_H]) ;; esac CURL_DEFINE_UNQUOTED([CURL_TYPEOF_CURL_SOCKLEN_T], [$curl_typeof_curl_socklen_t]) CURL_DEFINE_UNQUOTED([CURL_SIZEOF_CURL_SOCKLEN_T], [$curl_sizeof_curl_socklen_t]) ]) dnl CURL_CONFIGURE_PULL_SYS_POLL dnl ------------------------------------------------- dnl Find out if system header file sys/poll.h must be included by the dnl external interface, making appropriate definitions for template file dnl include/curl/curlbuild.h.in to properly configure and use the library. dnl dnl The need for the sys/poll.h inclusion arises mainly to properly dnl interface AIX systems which define macros 'events' and 'revents'. AC_DEFUN([CURL_CONFIGURE_PULL_SYS_POLL], [ AC_REQUIRE([CURL_INCLUDES_POLL])dnl # tst_poll_events_macro_defined="unknown" # AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_poll ]],[[ #if defined(events) || defined(revents) return 0; #else force compilation error #endif ]]) ],[ tst_poll_events_macro_defined="yes" ],[ tst_poll_events_macro_defined="no" ]) # if test "$tst_poll_events_macro_defined" = "yes"; then if test "x$ac_cv_header_sys_poll_h" = "xyes"; then CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_POLL_H]) fi fi # ]) dnl CURL_CHECK_FUNC_SELECT dnl ------------------------------------------------- dnl Test if the socket select() function is available, dnl and check its return type and the types of its dnl arguments. If the function succeeds HAVE_SELECT dnl will be defined, defining the types of the dnl arguments in SELECT_TYPE_ARG1, SELECT_TYPE_ARG234 dnl and SELECT_TYPE_ARG5, defining the type of the dnl function return value in SELECT_TYPE_RETV, and dnl also defining the type qualifier of fifth argument dnl in SELECT_QUAL_ARG5. AC_DEFUN([CURL_CHECK_FUNC_SELECT], [ AC_REQUIRE([CURL_CHECK_STRUCT_TIMEVAL])dnl AC_CHECK_HEADERS(sys/select.h sys/socket.h) # AC_MSG_CHECKING([for select]) AC_LINK_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 #ifndef HAVE_WINDOWS_H #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #endif ]],[[ select(0, 0, 0, 0, 0); ]]) ],[ AC_MSG_RESULT([yes]) curl_cv_select="yes" ],[ AC_MSG_RESULT([no]) curl_cv_select="no" ]) # if test "$curl_cv_select" = "yes"; then AC_CACHE_CHECK([types of args and return type for select], [curl_cv_func_select_args], [ curl_cv_func_select_args="unknown" for sel_retv in 'int' 'ssize_t'; do for sel_arg1 in 'int' 'ssize_t' 'size_t' 'unsigned long int' 'unsigned int'; do for sel_arg234 in 'fd_set *' 'int *' 'void *'; do for sel_arg5 in 'struct timeval *' 'const struct timeval *'; do if test "$curl_cv_func_select_args" = "unknown"; then 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 SELECTCALLCONV PASCAL #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 #ifndef HAVE_WINDOWS_H #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #define SELECTCALLCONV #endif #ifndef HAVE_STRUCT_TIMEVAL struct timeval { long tv_sec; long tv_usec; }; #endif extern $sel_retv SELECTCALLCONV select($sel_arg1, $sel_arg234, $sel_arg234, $sel_arg234, $sel_arg5); ]],[[ $sel_arg1 nfds=0; $sel_arg234 rfds=0; $sel_arg234 wfds=0; $sel_arg234 efds=0; $sel_retv res = select(nfds, rfds, wfds, efds, 0); ]]) ],[ curl_cv_func_select_args="$sel_arg1,$sel_arg234,$sel_arg5,$sel_retv" ]) fi done done done done ]) # AC-CACHE-CHECK if test "$curl_cv_func_select_args" = "unknown"; then AC_MSG_WARN([Cannot find proper types to use for select args]) AC_MSG_WARN([HAVE_SELECT will not be defined]) else select_prev_IFS=$IFS; IFS=',' set dummy `echo "$curl_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$select_prev_IFS shift # sel_qual_type_arg5=$[3] # AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1, $[1], [Define to the type of arg 1 for select.]) AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234, $[2], [Define to the type of args 2, 3 and 4 for select.]) AC_DEFINE_UNQUOTED(SELECT_TYPE_RETV, $[4], [Define to the function return type for select.]) # prev_sh_opts=$- # case $prev_sh_opts in *f*) ;; *) set -f ;; esac # case "$sel_qual_type_arg5" in const*) sel_qual_arg5=const sel_type_arg5=`echo $sel_qual_type_arg5 | sed 's/^const //'` ;; *) sel_qual_arg5= sel_type_arg5=$sel_qual_type_arg5 ;; esac # AC_DEFINE_UNQUOTED(SELECT_QUAL_ARG5, $sel_qual_arg5, [Define to the type qualifier of arg 5 for select.]) AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5, $sel_type_arg5, [Define to the type of arg 5 for select.]) # case $prev_sh_opts in *f*) ;; *) set +f ;; esac # AC_DEFINE_UNQUOTED(HAVE_SELECT, 1, [Define to 1 if you have the select function.]) ac_cv_func_select="yes" fi 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 ]) dnl CURL_CHECK_VARIADIC_MACROS dnl ------------------------------------------------- dnl Check compiler support of variadic macros AC_DEFUN([CURL_CHECK_VARIADIC_MACROS], [ AC_CACHE_CHECK([for compiler support of C99 variadic macro style], [curl_cv_variadic_macros_c99], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define c99_vmacro3(first, ...) fun3(first, __VA_ARGS__) #define c99_vmacro2(first, ...) fun2(first, __VA_ARGS__) int fun3(int arg1, int arg2, int arg3); int fun2(int arg1, int arg2); int fun3(int arg1, int arg2, int arg3) { return arg1 + arg2 + arg3; } int fun2(int arg1, int arg2) { return arg1 + arg2; } ]],[[ int res3 = c99_vmacro3(1, 2, 3); int res2 = c99_vmacro2(1, 2); ]]) ],[ curl_cv_variadic_macros_c99="yes" ],[ curl_cv_variadic_macros_c99="no" ]) ]) case "$curl_cv_variadic_macros_c99" in yes) AC_DEFINE_UNQUOTED(HAVE_VARIADIC_MACROS_C99, 1, [Define to 1 if compiler supports C99 variadic macro style.]) ;; esac AC_CACHE_CHECK([for compiler support of old gcc variadic macro style], [curl_cv_variadic_macros_gcc], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define gcc_vmacro3(first, args...) fun3(first, args) #define gcc_vmacro2(first, args...) fun2(first, args) int fun3(int arg1, int arg2, int arg3); int fun2(int arg1, int arg2); int fun3(int arg1, int arg2, int arg3) { return arg1 + arg2 + arg3; } int fun2(int arg1, int arg2) { return arg1 + arg2; } ]],[[ int res3 = gcc_vmacro3(1, 2, 3); int res2 = gcc_vmacro2(1, 2); ]]) ],[ curl_cv_variadic_macros_gcc="yes" ],[ curl_cv_variadic_macros_gcc="no" ]) ]) case "$curl_cv_variadic_macros_gcc" in yes) AC_DEFINE_UNQUOTED(HAVE_VARIADIC_MACROS_GCC, 1, [Define to 1 if compiler supports old gcc variadic macro style.]) ;; esac ]) dnl CURL_CHECK_CA_BUNDLE dnl ------------------------------------------------- dnl Check if a default ca-bundle should be used dnl dnl regarding the paths this will scan: dnl /etc/ssl/certs/ca-certificates.crt Debian systems dnl /etc/pki/tls/certs/ca-bundle.crt Redhat and Mandriva dnl /usr/share/ssl/certs/ca-bundle.crt old(er) Redhat dnl /usr/local/share/certs/ca-root.crt FreeBSD dnl /etc/ssl/cert.pem OpenBSD dnl /etc/ssl/certs/ (ca path) SUSE AC_DEFUN([CURL_CHECK_CA_BUNDLE], [ AC_MSG_CHECKING([default CA cert bundle/path]) AC_ARG_WITH(ca-bundle, AC_HELP_STRING([--with-ca-bundle=FILE], [File name to use as CA bundle]) AC_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]), [ want_ca="$withval" if test "x$want_ca" = "xyes"; then AC_MSG_ERROR([--with-ca-bundle=FILE requires a path to the CA bundle]) fi ], [ want_ca="unset" ]) AC_ARG_WITH(ca-path, AC_HELP_STRING([--with-ca-path=DIRECTORY], [Directory to use as CA path]) AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]), [ want_capath="$withval" if test "x$want_capath" = "xyes"; then AC_MSG_ERROR([--with-ca-path=DIRECTORY requires a path to the CA path directory]) fi ], [ want_capath="unset"]) if test "x$want_ca" != "xno" -a "x$want_ca" != "xunset" -a \ "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then dnl both given AC_MSG_ERROR([Can't specify both --with-ca-bundle and --with-ca-path.]) elif test "x$want_ca" != "xno" -a "x$want_ca" != "xunset"; then dnl --with-ca-bundle given ca="$want_ca" capath="no" elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then dnl --with-ca-path given if test "x$OPENSSL_ENABLED" != "x1"; then AC_MSG_ERROR([--with-ca-path only works with openSSL]) fi capath="$want_capath" ca="no" else dnl first try autodetecting a CA bundle , then a CA path dnl both autodetections can be skipped by --without-ca-* ca="no" capath="no" if test "x$cross_compiling" != "xyes"; then dnl NOT cross-compiling and... dnl neither of the --with-ca-* options are provided if test "x$want_ca" = "xunset"; then dnl the path we previously would have installed the curl ca bundle dnl to, and thus we now check for an already existing cert in that dnl place in case we find no other if test "x$prefix" != xNONE; then cac="${prefix}/share/curl/curl-ca-bundle.crt" else cac="$ac_default_prefix/share/curl/curl-ca-bundle.crt" fi for a in /etc/ssl/certs/ca-certificates.crt \ /etc/pki/tls/certs/ca-bundle.crt \ /usr/share/ssl/certs/ca-bundle.crt \ /usr/local/share/certs/ca-root.crt \ /etc/ssl/cert.pem \ "$cac"; do if test -f "$a"; then ca="$a" break fi done fi if test "x$want_capath" = "xunset" -a "x$ca" = "xno" -a \ "x$OPENSSL_ENABLED" = "x1"; then for a in /etc/ssl/certs/; do if test -d "$a" && ls "$a"/[[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]].0 >/dev/null 2>/dev/null; then capath="$a" break fi done fi else dnl no option given and cross-compiling AC_MSG_WARN([skipped the ca-cert path detection when cross-compiling]) fi fi if test "x$ca" != "xno"; then CURL_CA_BUNDLE='"'$ca'"' AC_DEFINE_UNQUOTED(CURL_CA_BUNDLE, "$ca", [Location of default ca bundle]) AC_SUBST(CURL_CA_BUNDLE) AC_MSG_RESULT([$ca]) elif test "x$capath" != "xno"; then CURL_CA_PATH="\"$capath\"" AC_DEFINE_UNQUOTED(CURL_CA_PATH, "$capath", [Location of default ca path]) AC_MSG_RESULT([$capath (capath)]) else AC_MSG_RESULT([no]) fi ]) dnl DO_CURL_OFF_T_CHECK (TYPE, SIZE) dnl ------------------------------------------------- dnl Internal macro for CURL_CONFIGURE_CURL_OFF_T AC_DEFUN([DO_CURL_OFF_T_CHECK], [ AC_REQUIRE([CURL_INCLUDES_INTTYPES])dnl if test "$curl_typeof_curl_off_t" = "unknown" && test ! -z "$1"; then tmp_includes="" tmp_source="" tmp_fmt="" case XC_SH_TR_SH([$1]) in int64_t) tmp_includes="$curl_includes_inttypes" tmp_source="char f@<:@@:>@ = PRId64;" tmp_fmt="PRId64" ;; int32_t) tmp_includes="$curl_includes_inttypes" tmp_source="char f@<:@@:>@ = PRId32;" tmp_fmt="PRId32" ;; int16_t) tmp_includes="$curl_includes_inttypes" tmp_source="char f@<:@@:>@ = PRId16;" tmp_fmt="PRId16" ;; esac AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $tmp_includes typedef $1 curl_off_t; typedef char dummy_arr[sizeof(curl_off_t) == $2 ? 1 : -1]; ]],[[ $tmp_source curl_off_t dummy; ]]) ],[ if test -z "$tmp_fmt"; then curl_typeof_curl_off_t="$1" curl_sizeof_curl_off_t="$2" else CURL_CHECK_DEF([$tmp_fmt], [$curl_includes_inttypes], [silent]) AS_VAR_PUSHDEF([tmp_HaveFmtDef], [curl_cv_have_def_$tmp_fmt])dnl AS_VAR_PUSHDEF([tmp_FmtDef], [curl_cv_def_$tmp_fmt])dnl if test AS_VAR_GET(tmp_HaveFmtDef) = "yes"; then curl_format_curl_off_t=AS_VAR_GET(tmp_FmtDef) curl_typeof_curl_off_t="$1" curl_sizeof_curl_off_t="$2" fi AS_VAR_POPDEF([tmp_FmtDef])dnl AS_VAR_POPDEF([tmp_HaveFmtDef])dnl fi ]) fi ]) dnl DO_CURL_OFF_T_SUFFIX_CHECK (TYPE) dnl ------------------------------------------------- dnl Internal macro for CURL_CONFIGURE_CURL_OFF_T AC_DEFUN([DO_CURL_OFF_T_SUFFIX_CHECK], [ AC_REQUIRE([CURL_INCLUDES_INTTYPES])dnl AC_MSG_CHECKING([constant suffix string for curl_off_t]) # curl_suffix_curl_off_t="unknown" curl_suffix_curl_off_tu="unknown" # case XC_SH_TR_SH([$1]) in long_long | __longlong | __longlong_t) tst_suffixes="LL::" ;; long) tst_suffixes="L::" ;; int) tst_suffixes="::" ;; __int64 | int64_t) tst_suffixes="LL:i64::" ;; __int32 | int32_t) tst_suffixes="L:i32::" ;; __int16 | int16_t) tst_suffixes="L:i16::" ;; *) AC_MSG_ERROR([unexpected data type $1]) ;; esac # old_IFS=$IFS; IFS=':' for tmp_ssuf in $tst_suffixes ; do IFS=$old_IFS if test "x$curl_suffix_curl_off_t" = "xunknown"; then case $tmp_ssuf in i64 | i32 | i16) tmp_usuf="u$tmp_ssuf" ;; LL | L) tmp_usuf="U$tmp_ssuf" ;; *) tmp_usuf="" ;; esac AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_inttypes typedef $1 new_t; ]],[[ new_t s1; new_t s2; s1 = -10$tmp_ssuf ; s2 = 20$tmp_ssuf ; if(s1 > s2) return 1; ]]) ],[ curl_suffix_curl_off_t="$tmp_ssuf" curl_suffix_curl_off_tu="$tmp_usuf" ]) fi done IFS=$old_IFS # if test "x$curl_suffix_curl_off_t" = "xunknown"; then AC_MSG_ERROR([cannot find constant suffix string for curl_off_t.]) else AC_MSG_RESULT([$curl_suffix_curl_off_t]) AC_MSG_CHECKING([constant suffix string for unsigned curl_off_t]) AC_MSG_RESULT([$curl_suffix_curl_off_tu]) fi # ]) dnl CURL_CONFIGURE_CURL_OFF_T dnl ------------------------------------------------- dnl Find out suitable curl_off_t data type definition and associated dnl items, and make the appropriate definitions used in template file dnl include/curl/curlbuild.h.in to properly configure the library. AC_DEFUN([CURL_CONFIGURE_CURL_OFF_T], [ AC_REQUIRE([CURL_INCLUDES_INTTYPES])dnl # AC_BEFORE([$0],[AC_SYS_LARGEFILE])dnl AC_BEFORE([$0],[CURL_CONFIGURE_REENTRANT])dnl AC_BEFORE([$0],[CURL_CHECK_AIX_ALL_SOURCE])dnl # if test -z "$SED"; then AC_MSG_ERROR([SED not set. Cannot continue without SED being set.]) fi # AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(void*) # if test -z "$ac_cv_sizeof_long" || test "$ac_cv_sizeof_long" -eq "0"; then AC_MSG_ERROR([cannot find out size of long.]) fi if test -z "$ac_cv_sizeof_voidp" || test "$ac_cv_sizeof_voidp" -eq "0"; then AC_MSG_ERROR([cannot find out size of void*.]) fi # x_LP64_long="" x_LP32_long="" x_LP16_long="" # if test "$ac_cv_sizeof_long" -eq "8" && test "$ac_cv_sizeof_voidp" -ge "8"; then x_LP64_long="long" elif test "$ac_cv_sizeof_long" -eq "4" && test "$ac_cv_sizeof_voidp" -ge "4"; then x_LP32_long="long" elif test "$ac_cv_sizeof_long" -eq "2" && test "$ac_cv_sizeof_voidp" -ge "2"; then x_LP16_long="long" fi # dnl DO_CURL_OFF_T_CHECK results are stored in next 3 vars # curl_typeof_curl_off_t="unknown" curl_sizeof_curl_off_t="unknown" curl_format_curl_off_t="unknown" curl_format_curl_off_tu="unknown" # if test "$curl_typeof_curl_off_t" = "unknown"; then AC_MSG_CHECKING([for 64-bit curl_off_t data type]) for t8 in \ "$x_LP64_long" \ 'int64_t' \ '__int64' \ 'long long' \ '__longlong' \ '__longlong_t' ; do DO_CURL_OFF_T_CHECK([$t8], [8]) done AC_MSG_RESULT([$curl_typeof_curl_off_t]) fi if test "$curl_typeof_curl_off_t" = "unknown"; then AC_MSG_CHECKING([for 32-bit curl_off_t data type]) for t4 in \ "$x_LP32_long" \ 'int32_t' \ '__int32' \ 'int' ; do DO_CURL_OFF_T_CHECK([$t4], [4]) done AC_MSG_RESULT([$curl_typeof_curl_off_t]) fi if test "$curl_typeof_curl_off_t" = "unknown"; then AC_MSG_CHECKING([for 16-bit curl_off_t data type]) for t2 in \ "$x_LP16_long" \ 'int16_t' \ '__int16' \ 'int' ; do DO_CURL_OFF_T_CHECK([$t2], [2]) done AC_MSG_RESULT([$curl_typeof_curl_off_t]) fi if test "$curl_typeof_curl_off_t" = "unknown"; then AC_MSG_ERROR([cannot find data type for curl_off_t.]) fi # AC_MSG_CHECKING([size of curl_off_t]) AC_MSG_RESULT([$curl_sizeof_curl_off_t]) # AC_MSG_CHECKING([formatting string directive for curl_off_t]) if test "$curl_format_curl_off_t" != "unknown"; then x_pull_headers="yes" curl_format_curl_off_t=`echo "$curl_format_curl_off_t" | "$SED" 's/[["]]//g'` curl_format_curl_off_tu=`echo "$curl_format_curl_off_t" | "$SED" 's/i$/u/'` curl_format_curl_off_tu=`echo "$curl_format_curl_off_tu" | "$SED" 's/d$/u/'` curl_format_curl_off_tu=`echo "$curl_format_curl_off_tu" | "$SED" 's/D$/U/'` else x_pull_headers="no" case XC_SH_TR_SH([$curl_typeof_curl_off_t]) in long_long | __longlong | __longlong_t) curl_format_curl_off_t="lld" curl_format_curl_off_tu="llu" ;; long) curl_format_curl_off_t="ld" curl_format_curl_off_tu="lu" ;; int) curl_format_curl_off_t="d" curl_format_curl_off_tu="u" ;; __int64) curl_format_curl_off_t="I64d" curl_format_curl_off_tu="I64u" ;; __int32) curl_format_curl_off_t="I32d" curl_format_curl_off_tu="I32u" ;; __int16) curl_format_curl_off_t="I16d" curl_format_curl_off_tu="I16u" ;; *) AC_MSG_ERROR([cannot find print format string for curl_off_t.]) ;; esac fi AC_MSG_RESULT(["$curl_format_curl_off_t"]) # AC_MSG_CHECKING([formatting string directive for unsigned curl_off_t]) AC_MSG_RESULT(["$curl_format_curl_off_tu"]) # DO_CURL_OFF_T_SUFFIX_CHECK([$curl_typeof_curl_off_t]) # if test "$x_pull_headers" = "yes"; then if test "x$ac_cv_header_sys_types_h" = "xyes"; then CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_TYPES_H]) fi if test "x$ac_cv_header_stdint_h" = "xyes"; then CURL_DEFINE_UNQUOTED([CURL_PULL_STDINT_H]) fi if test "x$ac_cv_header_inttypes_h" = "xyes"; then CURL_DEFINE_UNQUOTED([CURL_PULL_INTTYPES_H]) fi fi # CURL_DEFINE_UNQUOTED([CURL_TYPEOF_CURL_OFF_T], [$curl_typeof_curl_off_t]) CURL_DEFINE_UNQUOTED([CURL_FORMAT_CURL_OFF_T], ["$curl_format_curl_off_t"]) CURL_DEFINE_UNQUOTED([CURL_FORMAT_CURL_OFF_TU], ["$curl_format_curl_off_tu"]) CURL_DEFINE_UNQUOTED([CURL_FORMAT_OFF_T], ["%$curl_format_curl_off_t"]) CURL_DEFINE_UNQUOTED([CURL_SIZEOF_CURL_OFF_T], [$curl_sizeof_curl_off_t]) CURL_DEFINE_UNQUOTED([CURL_SUFFIX_CURL_OFF_T], [$curl_suffix_curl_off_t]) CURL_DEFINE_UNQUOTED([CURL_SUFFIX_CURL_OFF_TU], [$curl_suffix_curl_off_tu]) # ]) dnl CURL_CHECK_WIN32_LARGEFILE dnl ------------------------------------------------- dnl Check if curl's WIN32 large file will be used AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [ AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl AC_MSG_CHECKING([whether build target supports WIN32 file API]) curl_win32_file_api="no" if test "$ac_cv_header_windows_h" = "yes"; then if test x"$enable_largefile" != "xno"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ #if !defined(_WIN32_WCE) && \ (defined(__MINGW32__) || \ (defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64)))) int dummy=1; #else WIN32 large file API not supported. #endif ]]) ],[ curl_win32_file_api="win32_large_files" ]) fi if test "$curl_win32_file_api" = "no"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ #if defined(_WIN32_WCE) || defined(__MINGW32__) || defined(_MSC_VER) int dummy=1; #else WIN32 small file API not supported. #endif ]]) ],[ curl_win32_file_api="win32_small_files" ]) fi fi case "$curl_win32_file_api" in win32_large_files) AC_MSG_RESULT([yes (large file enabled)]) AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1, [Define to 1 if you are building a Windows target with large file support.]) ;; win32_small_files) AC_MSG_RESULT([yes (large file disabled)]) AC_DEFINE_UNQUOTED(USE_WIN32_SMALL_FILES, 1, [Define to 1 if you are building a Windows target without large file support.]) ;; *) AC_MSG_RESULT([no]) ;; esac ]) dnl CURL_EXPORT_PCDIR ($pcdir) dnl ------------------------ dnl if $pcdir is not empty, set PKG_CONFIG_LIBDIR to $pcdir and export dnl dnl we need this macro since pkg-config distinguishes among empty and unset dnl variable while checking PKG_CONFIG_LIBDIR dnl AC_DEFUN([CURL_EXPORT_PCDIR], [ if test -n "$1"; then PKG_CONFIG_LIBDIR="$1" export PKG_CONFIG_LIBDIR fi ]) dnl CURL_CHECK_PKGCONFIG ($module, [$pcdir]) dnl ------------------------ dnl search for the pkg-config tool. Set the PKGCONFIG variable to hold the dnl path to it, or 'no' if not found/present. dnl dnl If pkg-config is present, check that it has info about the $module or dnl return "no" anyway! dnl dnl Optionally PKG_CONFIG_LIBDIR may be given as $pcdir. dnl AC_DEFUN([CURL_CHECK_PKGCONFIG], [ PKGCONFIG="no" AC_PATH_TOOL( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin) if test x$PKGCONFIG != xno; then AC_MSG_CHECKING([for $1 options with pkg-config]) dnl ask pkg-config about $1 itexists=`CURL_EXPORT_PCDIR([$2]) dnl $PKGCONFIG --exists $1 >/dev/null 2>&1 && echo 1` if test -z "$itexists"; then dnl pkg-config does not have info about the given module! set the dnl variable to 'no' PKGCONFIG="no" AC_MSG_RESULT([no]) else AC_MSG_RESULT([found]) fi fi ]) dnl CURL_GENERATE_CONFIGUREHELP_PM dnl ------------------------------------------------- dnl Generate test harness configurehelp.pm module, defining and dnl initializing some perl variables with values which are known dnl when the configure script runs. For portability reasons, test dnl harness needs information on how to run the C preprocessor. AC_DEFUN([CURL_GENERATE_CONFIGUREHELP_PM], [ AC_REQUIRE([AC_PROG_CPP])dnl tmp_cpp=`eval echo "$ac_cpp" 2>/dev/null` if test -z "$tmp_cpp"; then tmp_cpp='cpp' fi cat >./tests/configurehelp.pm <<_EOF [@%:@] This is a generated file. Do not edit. package configurehelp; use strict; use warnings; use Exporter; use vars qw( @ISA @EXPORT_OK \$Cpreprocessor ); @ISA = qw(Exporter); @EXPORT_OK = qw( \$Cpreprocessor ); \$Cpreprocessor = '$tmp_cpp'; 1; _EOF ]) curl-7.35.0/configure0000755000175000017500000421066612272122665011427 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for curl -. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # # Copyright (c) 1998 - 2014 Daniel Stenberg, # This configure script may be copied, distributed and modified under the # terms of the curl license; see COPYING for more details ## -------------------------------- ## ## XC_CONFIGURE_PREAMBLE ver: 1.0 ## ## -------------------------------- ## xc_configure_preamble_ver_major='1' xc_configure_preamble_ver_minor='0' # # Set IFS to space, tab and newline. # xc_space=' ' xc_tab=' ' xc_newline=' ' IFS="$xc_space$xc_tab$xc_newline" # # Set internationalization behavior variables. # LANG='C' LC_ALL='C' LANGUAGE='C' export LANG export LC_ALL export LANGUAGE # # Some useful variables. # xc_msg_warn='configure: WARNING:' xc_msg_abrt='Can not continue.' xc_msg_err='configure: error:' # # Verify that 'echo' command is available, otherwise abort. # xc_tst_str='unknown' (`echo "$xc_tst_str" >/dev/null 2>&1`) && xc_tst_str='success' case "x$xc_tst_str" in # (( xsuccess) : ;; *) # Try built-in echo, and fail. echo "$xc_msg_err 'echo' command not found. $xc_msg_abrt" >&2 exit 1 ;; esac # # Verify that 'test' command is available, otherwise abort. # xc_tst_str='unknown' (`test -n "$xc_tst_str" >/dev/null 2>&1`) && xc_tst_str='success' case "x$xc_tst_str" in # (( xsuccess) : ;; *) echo "$xc_msg_err 'test' command not found. $xc_msg_abrt" >&2 exit 1 ;; esac # # Verify that 'PATH' variable is set, otherwise abort. # xc_tst_str='unknown' (`test -n "$PATH" >/dev/null 2>&1`) && xc_tst_str='success' case "x$xc_tst_str" in # (( xsuccess) : ;; *) echo "$xc_msg_err 'PATH' variable not set. $xc_msg_abrt" >&2 exit 1 ;; esac # # Verify that 'expr' command is available, otherwise abort. # xc_tst_str='unknown' xc_tst_str=`expr "$xc_tst_str" : '.*' 2>/dev/null` case "x$xc_tst_str" in # (( x7) : ;; *) echo "$xc_msg_err 'expr' command not found. $xc_msg_abrt" >&2 exit 1 ;; esac # # Verify that 'sed' utility is found within 'PATH', otherwise abort. # xc_tst_str='unknown' xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \ | sed -e 's:unknown:success:' 2>/dev/null` case "x$xc_tst_str" in # (( xsuccess) : ;; *) echo "$xc_msg_err 'sed' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac # # Verify that 'grep' utility is found within 'PATH', otherwise abort. # xc_tst_str='unknown' (`echo "$xc_tst_str" 2>/dev/null \ | grep 'unknown' >/dev/null 2>&1`) && xc_tst_str='success' case "x$xc_tst_str" in # (( xsuccess) : ;; *) echo "$xc_msg_err 'grep' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac # # Verify that 'tr' utility is found within 'PATH', otherwise abort. # xc_tst_str="${xc_tab}98s7u6c5c4e3s2s10" xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \ | tr -d "0123456789$xc_tab" 2>/dev/null` case "x$xc_tst_str" in # (( xsuccess) : ;; *) echo "$xc_msg_err 'tr' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac # # Verify that 'wc' utility is found within 'PATH', otherwise abort. # xc_tst_str='unknown unknown unknown unknown' xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \ | wc -w 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null` case "x$xc_tst_str" in # (( x4) : ;; *) echo "$xc_msg_err 'wc' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac # # Verify that 'cat' utility is found within 'PATH', otherwise abort. # xc_tst_str='unknown' xc_tst_str=`cat <<_EOT 2>/dev/null \ | wc -l 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null unknown unknown unknown _EOT` case "x$xc_tst_str" in # (( x3) : ;; *) echo "$xc_msg_err 'cat' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac # # Auto-detect and set 'PATH_SEPARATOR', unless it is already non-empty set. # # Directory count in 'PATH' when using a colon separator. xc_tst_dirs_col='x' xc_tst_prev_IFS=$IFS; IFS=':' for xc_tst_dir in $PATH; do IFS=$xc_tst_prev_IFS xc_tst_dirs_col="x$xc_tst_dirs_col" done IFS=$xc_tst_prev_IFS xc_tst_dirs_col=`expr "$xc_tst_dirs_col" : '.*'` # Directory count in 'PATH' when using a semicolon separator. xc_tst_dirs_sem='x' xc_tst_prev_IFS=$IFS; IFS=';' for xc_tst_dir in $PATH; do IFS=$xc_tst_prev_IFS xc_tst_dirs_sem="x$xc_tst_dirs_sem" done IFS=$xc_tst_prev_IFS xc_tst_dirs_sem=`expr "$xc_tst_dirs_sem" : '.*'` if test $xc_tst_dirs_sem -eq $xc_tst_dirs_col; then # When both counting methods give the same result we do not want to # chose one over the other, and consider auto-detection not possible. if test -z "$PATH_SEPARATOR"; then # Stop dead until user provides 'PATH_SEPARATOR' definition. echo "$xc_msg_err 'PATH_SEPARATOR' variable not set. $xc_msg_abrt" >&2 exit 1 fi else # Separator with the greater directory count is the auto-detected one. if test $xc_tst_dirs_sem -gt $xc_tst_dirs_col; then xc_tst_auto_separator=';' else xc_tst_auto_separator=':' fi if test -z "$PATH_SEPARATOR"; then # Simply use the auto-detected one when not already set. PATH_SEPARATOR=$xc_tst_auto_separator elif test "x$PATH_SEPARATOR" != "x$xc_tst_auto_separator"; then echo "$xc_msg_warn 'PATH_SEPARATOR' does not match auto-detected one." >&2 fi fi xc_PATH_SEPARATOR=$PATH_SEPARATOR xc_configure_preamble_result='yes' ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and a suitable curl $0: mailing list: http://curl.haxx.se/mail/ about your $0: system, including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='curl' PACKAGE_TARNAME='curl' PACKAGE_VERSION='-' PACKAGE_STRING='curl -' PACKAGE_BUGREPORT='a suitable curl mailing list: http://curl.haxx.se/mail/' PACKAGE_URL='' ac_unique_file="lib/urldata.h" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" enable_option_checking=no ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS SUPPORT_PROTOCOLS SUPPORT_FEATURES ENABLE_STATIC ENABLE_SHARED CROSSCOMPILING_FALSE CROSSCOMPILING_TRUE BLANK_AT_MAKETIME CURL_NETWORK_AND_TIME_LIBS CURL_NETWORK_LIBS LIBCURL_LIBS SONAME_BUMP_FALSE SONAME_BUMP_TRUE CFLAG_CURL_SYMBOL_HIDING DOING_CURL_SYMBOL_HIDING_FALSE DOING_CURL_SYMBOL_HIDING_TRUE BUILD_LIBHOSTNAME_FALSE BUILD_LIBHOSTNAME_TRUE USE_EMBEDDED_ARES_FALSE USE_EMBEDDED_ARES_TRUE USE_ARES subdirs USE_MANUAL_FALSE USE_MANUAL_TRUE MANOPT NROFF PERL IPV6_ENABLED USE_NGHTTP2 IDN_ENABLED CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_FALSE CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_TRUE CURL_LT_SHLIB_VERSIONED_FLAVOUR USE_LIBRTMP USE_LIBSSH2 LIBMETALINK_CPPFLAGS LIBMETALINK_LDFLAGS LIBMETALINK_LIBS CURL_CA_BUNDLE SSL_ENABLED USE_AXTLS USE_NSS USE_CYASSL USE_POLARSSL HAVE_GNUTLS_SRP USE_GNUTLS_NETTLE USE_GNUTLS HAVE_SSLEAY_SRP RANDOM_FILE USE_SSLEAY PKGCONFIG USE_DARWINSSL USE_WINDOWS_SSPI USE_SCHANNEL USE_OPENLDAP ZLIB_LIBS HAVE_LIBZ_FALSE HAVE_LIBZ_TRUE HAVE_LIBZ CURL_DISABLE_GOPHER CURL_DISABLE_SMTP CURL_DISABLE_IMAP CURL_DISABLE_POP3 CURL_DISABLE_TFTP CURL_DISABLE_TELNET CURL_DISABLE_DICT CURL_DISABLE_PROXY HAVE_LDAP_SSL CURL_DISABLE_LDAPS CURL_DISABLE_LDAP CURL_DISABLE_FILE CURL_DISABLE_FTP CURL_DISABLE_RTSP CURL_DISABLE_HTTP DOING_NATIVE_WINDOWS_FALSE DOING_NATIVE_WINDOWS_TRUE BUILD_UNITTESTS_FALSE BUILD_UNITTESTS_TRUE CURLDEBUG_FALSE CURLDEBUG_TRUE USE_EXPLICIT_LIB_DEPS_FALSE USE_EXPLICIT_LIB_DEPS_TRUE REQUIRE_LIB_DEPS CPPFLAG_CURL_STATICLIB USE_CPPFLAG_CURL_STATICLIB_FALSE USE_CPPFLAG_CURL_STATICLIB_TRUE CURL_LT_SHLIB_USE_MIMPURE_TEXT_FALSE CURL_LT_SHLIB_USE_MIMPURE_TEXT_TRUE CURL_LT_SHLIB_USE_NO_UNDEFINED_FALSE CURL_LT_SHLIB_USE_NO_UNDEFINED_TRUE CURL_LT_SHLIB_USE_VERSION_INFO_FALSE CURL_LT_SHLIB_USE_VERSION_INFO_TRUE OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP LIBTOOL OBJDUMP DLLTOOL AS host_os host_vendor host_cpu host build_os build_vendor build_cpu build PKGADD_VENDOR PKGADD_NAME PKGADD_PKG VERSIONNUM CURLVERSION AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM libext AR EGREP GREP SED CURL_CFLAG_EXTRAS CONFIGURE_OPTIONS MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME SHELL PATH_SEPARATOR' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_debug enable_optimize enable_warnings enable_werror enable_curldebug enable_symbol_hiding enable_hidden_symbols enable_ares enable_dependency_tracking enable_silent_rules enable_largefile enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock enable_http enable_ftp enable_file enable_ldap enable_ldaps enable_rtsp enable_proxy enable_dict enable_telnet enable_tftp enable_pop3 enable_imap enable_smtp enable_gopher enable_manual enable_libcurl_option enable_libgcc with_zlib with_ldap_lib with_lber_lib enable_ipv6 with_spnego with_gssapi_includes with_gssapi_libs with_gssapi with_winssl with_darwinssl with_ssl with_egd_socket with_random with_gnutls with_polarssl with_cyassl with_nss with_axtls with_ca_bundle with_ca_path with_libmetalink with_libssh2 with_librtmp enable_versioned_symbols with_winidn with_libidn with_nghttp2 enable_threaded_resolver enable_verbose enable_sspi enable_crypto_auth enable_ntlm_wb enable_tls_srp enable_cookies enable_soname_bump ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' ac_subdirs_all='ares' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures curl - to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/curl] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of curl -:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-debug Enable debug build options --disable-debug Disable debug build options --enable-optimize Enable compiler optimizations --disable-optimize Disable compiler optimizations --enable-warnings Enable strict compiler warnings --disable-warnings Disable strict compiler warnings --enable-werror Enable compiler warnings as errors --disable-werror Disable compiler warnings as errors --enable-curldebug Enable curl debug memory tracking --disable-curldebug Disable curl debug memory tracking --enable-symbol-hiding Enable hiding of library internal symbols --disable-symbol-hiding Disable hiding of library internal symbols --enable-hidden-symbols To be deprecated, use --enable-symbol-hiding --disable-hidden-symbols To be deprecated, use --disable-symbol-hiding --enable-ares[=PATH] Enable c-ares for DNS lookups --disable-ares Disable c-ares for DNS lookups --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --disable-largefile omit support for large files --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-http Enable HTTP support --disable-http Disable HTTP support --enable-ftp Enable FTP support --disable-ftp Disable FTP support --enable-file Enable FILE support --disable-file Disable FILE support --enable-ldap Enable LDAP support --disable-ldap Disable LDAP support --enable-ldaps Enable LDAPS support --disable-ldaps Disable LDAPS support --enable-rtsp Enable RTSP support --disable-rtsp Disable RTSP support --enable-proxy Enable proxy support --disable-proxy Disable proxy support --enable-dict Enable DICT support --disable-dict Disable DICT support --enable-telnet Enable TELNET support --disable-telnet Disable TELNET support --enable-tftp Enable TFTP support --disable-tftp Disable TFTP support --enable-pop3 Enable POP3 support --disable-pop3 Disable POP3 support --enable-imap Enable IMAP support --disable-imap Disable IMAP support --enable-smtp Enable SMTP support --disable-smtp Disable SMTP support --enable-gopher Enable Gopher support --disable-gopher Disable Gopher support --enable-manual Enable built-in manual --disable-manual Disable built-in manual --enable-libcurl-option Enable --libcurl C code generation support --disable-libcurl-option Disable --libcurl C code generation support --enable-libgcc use libgcc when linking --enable-ipv6 Enable ipv6 (with ipv4) support --disable-ipv6 Disable ipv6 support --enable-versioned-symbols Enable versioned symbols in shared library --disable-versioned-symbols Disable versioned symbols in shared library --enable-threaded-resolver Enable threaded resolver --disable-threaded-resolver Disable threaded resolver --enable-verbose Enable verbose strings --disable-verbose Disable verbose strings --enable-sspi Enable SSPI --disable-sspi Disable SSPI --enable-crypto-auth Enable cryptographic authentication --disable-crypto-auth Disable cryptographic authentication --enable-ntlm-wb[=FILE] Enable NTLM delegation to winbind's ntlm_auth helper, where FILE is ntlm_auth's absolute filename (default: /usr/bin/ntlm_auth) --disable-ntlm-wb Disable NTLM delegation to winbind's ntlm_auth helper --enable-tls-srp Enable TLS-SRP authentication --disable-tls-srp Disable TLS-SRP authentication --enable-cookies Enable cookies support --disable-cookies Disable cookies support --enable-soname-bump Enable enforced SONAME bump --disable-soname-bump Disable enforced SONAME bump Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-zlib=PATH search for zlib in PATH --without-zlib disable use of zlib --with-ldap-lib=libname Specify name of ldap lib file --with-lber-lib=libname Specify name of lber lib file --with-spnego=DIR Specify location of SPNEGO library fbopenssl --with-gssapi-includes=DIR Specify location of GSSAPI header --with-gssapi-libs=DIR Specify location of GSSAPI libs --with-gssapi=DIR Where to look for GSSAPI --with-winssl enable Windows native SSL/TLS --without-winssl disable Windows native SSL/TLS --with-darwinssl enable iOS/Mac OS X native SSL/TLS --without-darwinssl disable iOS/Mac OS X native SSL/TLS --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 --without-ssl disable OpenSSL --with-egd-socket=FILE Entropy Gathering Daemon socket pathname --with-random=FILE read randomness from FILE (default=/dev/urandom) --with-gnutls=PATH where to look for GnuTLS, PATH points to the installation root --without-gnutls disable GnuTLS detection --with-polarssl=PATH where to look for PolarSSL, PATH points to the installation root --without-polarssl disable PolarSSL detection --with-cyassl=PATH where to look for CyaSSL, PATH points to the installation root (default: system lib default) --without-cyassl disable CyaSSL detection --with-nss=PATH where to look for NSS, PATH points to the installation root --without-nss disable NSS detection --with-axtls=PATH Where to look for axTLS, PATH points to the axTLS installation prefix (default: /usr/local). Ignored if another SSL engine is selected. --without-axtls disable axTLS --with-ca-bundle=FILE File name to use as CA bundle --without-ca-bundle Don't use a default CA bundle --with-ca-path=DIRECTORY Directory to use as CA path --without-ca-path Don't use a default CA path --with-libmetalink=PATH where to look for libmetalink, PATH points to the installation root --without-libmetalink disable libmetalink detection --with-libssh2=PATH Where to look for libssh2, PATH points to the LIBSSH2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option --without-libssh2 disable LIBSSH2 --with-librtmp=PATH Where to look for librtmp, PATH points to the LIBRTMP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option --without-librtmp disable LIBRTMP --with-winidn=PATH enable Windows native IDN --without-winidn disable Windows native IDN --with-libidn=PATH Enable libidn usage --without-libidn Disable libidn usage --with-nghttp2=PATH Enable nghttp2 usage --without-nghttp2 Disable nghttp2 usage Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF curl configure - generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Copyright (c) 1998 - 2014 Daniel Stenberg, This configure script may be copied, distributed and modified under the terms of the curl license; see COPYING for more details _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main (void) { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define $2 innocuous_$2 #ifdef __STDC__ # include #else # include #endif #undef $2 #ifdef __cplusplus extern "C" #endif char $2 (); #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------------------------------------------- ## ## Report this to a suitable curl mailing list: http://curl.haxx.se/mail/ ## ## ---------------------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by curl $as_me -, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # using curl-override.m4 ac_config_headers="$ac_config_headers lib/curl_config.h include/curl/curlbuild.h" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable debug build options" >&5 $as_echo_n "checking whether to enable debug build options... " >&6; } OPT_DEBUG_BUILD="default" # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; OPT_DEBUG_BUILD=$enableval fi case "$OPT_DEBUG_BUILD" in no) want_debug="no" ;; default) want_debug="no" ;; *) want_debug="yes" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_debug" >&5 $as_echo "$want_debug" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable compiler optimizer" >&5 $as_echo_n "checking whether to enable compiler optimizer... " >&6; } OPT_COMPILER_OPTIMIZE="default" # Check whether --enable-optimize was given. if test "${enable_optimize+set}" = set; then : enableval=$enable_optimize; OPT_COMPILER_OPTIMIZE=$enableval fi case "$OPT_COMPILER_OPTIMIZE" in no) want_optimize="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; default) if test "$want_debug" = "yes"; then want_optimize="assume_no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: (assumed) no" >&5 $as_echo "(assumed) no" >&6; } else want_optimize="assume_yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: (assumed) yes" >&5 $as_echo "(assumed) yes" >&6; } fi ;; *) want_optimize="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable strict compiler warnings" >&5 $as_echo_n "checking whether to enable strict compiler warnings... " >&6; } OPT_COMPILER_WARNINGS="default" # Check whether --enable-warnings was given. if test "${enable_warnings+set}" = set; then : enableval=$enable_warnings; OPT_COMPILER_WARNINGS=$enableval fi case "$OPT_COMPILER_WARNINGS" in no) want_warnings="no" ;; default) want_warnings="$want_debug" ;; *) want_warnings="yes" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_warnings" >&5 $as_echo "$want_warnings" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable compiler warnings as errors" >&5 $as_echo_n "checking whether to enable compiler warnings as errors... " >&6; } OPT_COMPILER_WERROR="default" # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : enableval=$enable_werror; OPT_COMPILER_WERROR=$enableval fi case "$OPT_COMPILER_WERROR" in no) want_werror="no" ;; default) want_werror="no" ;; *) want_werror="yes" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_werror" >&5 $as_echo "$want_werror" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable curl debug memory tracking" >&5 $as_echo_n "checking whether to enable curl debug memory tracking... " >&6; } OPT_CURLDEBUG_BUILD="default" # Check whether --enable-curldebug was given. if test "${enable_curldebug+set}" = set; then : enableval=$enable_curldebug; OPT_CURLDEBUG_BUILD=$enableval fi case "$OPT_CURLDEBUG_BUILD" in no) want_curldebug="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; default) if test "$want_debug" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: (assumed) yes" >&5 $as_echo "(assumed) yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi want_curldebug_assumed="yes" want_curldebug="$want_debug" ;; *) want_curldebug="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable hiding of library internal symbols" >&5 $as_echo_n "checking whether to enable hiding of library internal symbols... " >&6; } OPT_SYMBOL_HIDING="default" # Check whether --enable-symbol-hiding was given. if test "${enable_symbol_hiding+set}" = set; then : enableval=$enable_symbol_hiding; OPT_SYMBOL_HIDING=$enableval fi # Check whether --enable-hidden-symbols was given. if test "${enable_hidden_symbols+set}" = set; then : enableval=$enable_hidden_symbols; OPT_SYMBOL_HIDING=$enableval fi case "$OPT_SYMBOL_HIDING" in no) want_symbol_hiding="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; default) want_symbol_hiding="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; *) want_symbol_hiding="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable c-ares for DNS lookups" >&5 $as_echo_n "checking whether to enable c-ares for DNS lookups... " >&6; } OPT_ARES="default" # Check whether --enable-ares was given. if test "${enable_ares+set}" = set; then : enableval=$enable_ares; OPT_ARES=$enableval fi case "$OPT_ARES" in no) want_ares="no" ;; default) want_ares="no" ;; *) want_ares="yes" if test -n "$enableval" && test "$enableval" != "yes"; then want_ares_path="$enableval" fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_ares" >&5 $as_echo "$want_ares" >&6; } # # Check that 'XC_CONFIGURE_PREAMBLE' has already run. # if test -z "$xc_configure_preamble_result"; then as_fn_error $? "xc_configure_preamble_result not set (internal problem)" "$LINENO" 5 fi # # Check that 'PATH_SEPARATOR' has already been set. # if test -z "$xc_PATH_SEPARATOR"; then as_fn_error $? "xc_PATH_SEPARATOR not set (internal problem)" "$LINENO" 5 fi if test -z "$PATH_SEPARATOR"; then as_fn_error $? "PATH_SEPARATOR not set (internal or config.site problem)" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for path separator" >&5 $as_echo_n "checking for path separator... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_SEPARATOR" >&5 $as_echo "$PATH_SEPARATOR" >&6; } if test "x$PATH_SEPARATOR" != "x$xc_PATH_SEPARATOR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initial path separator" >&5 $as_echo_n "checking for initial path separator... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_PATH_SEPARATOR" >&5 $as_echo "$xc_PATH_SEPARATOR" >&6; } as_fn_error $? "path separator mismatch (internal or config.site problem)" "$LINENO" 5 fi # # save the configure arguments # CONFIGURE_OPTIONS="\"$ac_configure_args\"" CURL_CFLAG_EXTRAS="" if test X"$want_werror" = Xyes; then CURL_CFLAG_EXTRAS="-Werror" fi if test -z "$SED"; then # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else case $SED in [\\/]* | ?:[\\/]*) ac_cv_path_SED="$SED" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_SED" && ac_cv_path_SED="not_found" ;; esac fi SED=$ac_cv_path_SED if test -n "$SED"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 $as_echo "$SED" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$SED" || test "$SED" = "not_found"; then as_fn_error $? "sed not found in PATH. Cannot continue without sed." "$LINENO" 5 fi fi if test -z "$GREP"; then # Extract the first word of "grep", so it can be a program name with args. set dummy grep; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else case $GREP in [\\/]* | ?:[\\/]*) ac_cv_path_GREP="$GREP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="not_found" ;; esac fi GREP=$ac_cv_path_GREP if test -n "$GREP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GREP" >&5 $as_echo "$GREP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$GREP" || test "$GREP" = "not_found"; then as_fn_error $? "grep not found in PATH. Cannot continue without grep." "$LINENO" 5 fi fi if test -z "$EGREP"; then if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } EGREP="$GREP -E" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EGREP" >&5 $as_echo "$EGREP" >&6; } else # Extract the first word of "egrep", so it can be a program name with args. set dummy egrep; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else case $EGREP in [\\/]* | ?:[\\/]*) ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_EGREP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_EGREP" && ac_cv_path_EGREP="not_found" ;; esac fi EGREP=$ac_cv_path_EGREP if test -n "$EGREP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EGREP" >&5 $as_echo "$EGREP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$EGREP" || test "$EGREP" = "not_found"; then as_fn_error $? "egrep not found in PATH. Cannot continue without egrep." "$LINENO" 5 fi if test -z "$AR"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_AR+:} false; then : $as_echo_n "(cached) " >&6 else case $AR in [\\/]* | ?:[\\/]*) ac_cv_path_AR="$AR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi AR=$ac_cv_path_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_AR"; then ac_pt_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_AR+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_AR in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_AR="$ac_pt_AR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_AR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_AR=$ac_cv_path_ac_pt_AR if test -n "$ac_pt_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_AR" >&5 $as_echo "$ac_pt_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_AR" = x; then AR="not_found" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_pt_AR fi else AR="$ac_cv_path_AR" fi if test -z "$AR" || test "$AR" = "not_found"; then as_fn_error $? "ar not found in PATH. Cannot continue without ar." "$LINENO" 5 fi fi if test -f ${srcdir}/include/curl/curlbuild.h; then rm -f ${srcdir}/include/curl/curlbuild.h fi CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h` xc_prog_cc_prev_IFS=$IFS xc_prog_cc_prev_LIBS=$LIBS xc_prog_cc_prev_CFLAGS=$CFLAGS xc_prog_cc_prev_LDFLAGS=$LDFLAGS xc_prog_cc_prev_CPPFLAGS=$CPPFLAGS xc_bad_var_libs=no for xc_word in $LIBS; do case "$xc_word" in -l* | --library=*) : ;; *) xc_bad_var_libs=yes ;; esac done if test $xc_bad_var_libs = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: using LIBS: $LIBS" >&5 $as_echo "$as_me: using LIBS: $LIBS" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: LIBS note: LIBS should only be used to specify libraries (-lname)." >&5 $as_echo "$as_me: LIBS note: LIBS should only be used to specify libraries (-lname)." >&6;} fi xc_bad_var_ldflags=no for xc_word in $LDFLAGS; do case "$xc_word" in -D*) xc_bad_var_ldflags=yes ;; -U*) xc_bad_var_ldflags=yes ;; -I*) xc_bad_var_ldflags=yes ;; -l* | --library=*) xc_bad_var_ldflags=yes ;; esac done if test $xc_bad_var_ldflags = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: using LDFLAGS: $LDFLAGS" >&5 $as_echo "$as_me: using LDFLAGS: $LDFLAGS" >&6;} xc_bad_var_msg="LDFLAGS note: LDFLAGS should only be used to specify linker flags, not" for xc_word in $LDFLAGS; do case "$xc_word" in -D*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&6;} ;; -U*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&6;} ;; -I*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&6;} ;; -l* | --library=*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} ;; esac done fi xc_bad_var_cppflags=no for xc_word in $CPPFLAGS; do case "$xc_word" in -rpath*) xc_bad_var_cppflags=yes ;; -L* | --library-path=*) xc_bad_var_cppflags=yes ;; -l* | --library=*) xc_bad_var_cppflags=yes ;; esac done if test $xc_bad_var_cppflags = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: using CPPFLAGS: $CPPFLAGS" >&5 $as_echo "$as_me: using CPPFLAGS: $CPPFLAGS" >&6;} xc_bad_var_msg="CPPFLAGS note: CPPFLAGS should only be used to specify C preprocessor flags, not" for xc_word in $CPPFLAGS; do case "$xc_word" in -rpath*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&6;} ;; -L* | --library-path=*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&6;} ;; -l* | --library=*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} ;; esac done fi xc_bad_var_cflags=no for xc_word in $CFLAGS; do case "$xc_word" in -D*) xc_bad_var_cflags=yes ;; -U*) xc_bad_var_cflags=yes ;; -I*) xc_bad_var_cflags=yes ;; -rpath*) xc_bad_var_cflags=yes ;; -L* | --library-path=*) xc_bad_var_cflags=yes ;; -l* | --library=*) xc_bad_var_cflags=yes ;; esac done if test $xc_bad_var_cflags = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: using CFLAGS: $CFLAGS" >&5 $as_echo "$as_me: using CFLAGS: $CFLAGS" >&6;} xc_bad_var_msg="CFLAGS note: CFLAGS should only be used to specify C compiler flags, not" for xc_word in $CFLAGS; do case "$xc_word" in -D*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&6;} ;; -U*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&6;} ;; -I*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&6;} ;; -rpath*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&6;} ;; -L* | --library-path=*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&6;} ;; -l* | --library=*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} ;; esac done fi if test $xc_bad_var_libs = yes || test $xc_bad_var_cflags = yes || test $xc_bad_var_ldflags = yes || test $xc_bad_var_cppflags = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Continuing even with errors mentioned immediately above this line." >&5 $as_echo "$as_me: WARNING: Continuing even with errors mentioned immediately above this line." >&2;} fi ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main (void) { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu IFS=$xc_prog_cc_prev_IFS LIBS=$xc_prog_cc_prev_LIBS CFLAGS=$xc_prog_cc_prev_CFLAGS LDFLAGS=$xc_prog_cc_prev_LDFLAGS CPPFLAGS=$xc_prog_cc_prev_CPPFLAGS am__api_version='1.14' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` 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= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' ## --------------------------------------- ## ## Start of automake initialization code ## ## --------------------------------------- ## if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='curl' VERSION='-' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ## ------------------------------------- ## ## End of automake initialization code ## ## ------------------------------------- ## { $as_echo "$as_me:${as_lineno-$LINENO}: checking curl version" >&5 $as_echo_n "checking curl version... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CURLVERSION" >&5 $as_echo "$CURLVERSION" >&6; } VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h` PKGADD_PKG="HAXXcurl" PKGADD_NAME="cURL - a client that groks URLs" PKGADD_VENDOR="curl.haxx.se" curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,cyassl,axtls,winssl,darwinssl} )" curl_ssh_msg="no (--with-libssh2)" curl_zlib_msg="no (--with-zlib)" curl_gss_msg="no (--with-gssapi)" curl_spnego_msg="no (--with-spnego)" curl_tls_srp_msg="no (--enable-tls-srp)" curl_res_msg="default (--enable-ares / --enable-threaded-resolver)" curl_ipv6_msg="no (--enable-ipv6)" curl_idn_msg="no (--with-{libidn,winidn})" curl_manual_msg="no (--enable-manual)" curl_libcurl_msg="enabled (--disable-libcurl-option)" curl_verbose_msg="enabled (--disable-verbose)" curl_sspi_msg="no (--enable-sspi)" curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)" curl_ldaps_msg="no (--enable-ldaps)" curl_rtsp_msg="no (--enable-rtsp)" curl_rtmp_msg="no (--with-librtmp)" curl_mtlnk_msg="no (--with-libmetalink)" init_ssl_msg=${curl_ssl_msg} INITIAL_LDFLAGS=$LDFLAGS INITIAL_LIBS=$LIBS # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac cat >>confdefs.h <<_ACEOF #define OS "${host}" _ACEOF curl_includes_inttypes="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif /* includes end */" case $host_os in irix*) ac_cv_header_stdint_h="no" ;; esac for ac_header in sys/types.h stdint.h inttypes.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_inttypes " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # # if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi # # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5 $as_echo_n "checking size of void*... " >&6; } if ${ac_cv_sizeof_voidp+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void*))" "ac_cv_sizeof_voidp" "$ac_includes_default"; then : else if test "$ac_cv_type_voidp" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (void*) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_voidp=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_voidp" >&5 $as_echo "$ac_cv_sizeof_voidp" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOIDP $ac_cv_sizeof_voidp _ACEOF # if test -z "$ac_cv_sizeof_long" || test "$ac_cv_sizeof_long" -eq "0"; then as_fn_error $? "cannot find out size of long." "$LINENO" 5 fi if test -z "$ac_cv_sizeof_voidp" || test "$ac_cv_sizeof_voidp" -eq "0"; then as_fn_error $? "cannot find out size of void*." "$LINENO" 5 fi # x_LP64_long="" x_LP32_long="" x_LP16_long="" # if test "$ac_cv_sizeof_long" -eq "8" && test "$ac_cv_sizeof_voidp" -ge "8"; then x_LP64_long="long" elif test "$ac_cv_sizeof_long" -eq "4" && test "$ac_cv_sizeof_voidp" -ge "4"; then x_LP32_long="long" elif test "$ac_cv_sizeof_long" -eq "2" && test "$ac_cv_sizeof_voidp" -ge "2"; then x_LP16_long="long" fi # # curl_typeof_curl_off_t="unknown" curl_sizeof_curl_off_t="unknown" curl_format_curl_off_t="unknown" curl_format_curl_off_tu="unknown" # if test "$curl_typeof_curl_off_t" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit curl_off_t data type" >&5 $as_echo_n "checking for 64-bit curl_off_t data type... " >&6; } for t8 in \ "$x_LP64_long" \ 'int64_t' \ '__int64' \ 'long long' \ '__longlong' \ '__longlong_t' ; do if test "$curl_typeof_curl_off_t" = "unknown" && test ! -z "$t8"; then tmp_includes="" tmp_source="" tmp_fmt="" case `echo "$t8" | sed 's/[^a-zA-Z0-9_]/_/g'` in int64_t) tmp_includes="$curl_includes_inttypes" tmp_source="char f[] = PRId64;" tmp_fmt="PRId64" ;; int32_t) tmp_includes="$curl_includes_inttypes" tmp_source="char f[] = PRId32;" tmp_fmt="PRId32" ;; int16_t) tmp_includes="$curl_includes_inttypes" tmp_source="char f[] = PRId16;" tmp_fmt="PRId16" ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $tmp_includes typedef $t8 curl_off_t; typedef char dummy_arr[sizeof(curl_off_t) == 8 ? 1 : -1]; int main (void) { $tmp_source curl_off_t dummy; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if test -z "$tmp_fmt"; then curl_typeof_curl_off_t="$t8" curl_sizeof_curl_off_t="8" else as_ac_HaveDef=`$as_echo "curl_cv_have_def_$tmp_fmt" | $as_tr_sh` as_ac_Def=`$as_echo "curl_cv_def_$tmp_fmt" | $as_tr_sh` if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_inttypes #ifdef $tmp_fmt CURL_DEF_TOKEN $tmp_fmt #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "$tmp_fmt"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then eval "$as_ac_HaveDef=no" else eval "$as_ac_HaveDef=yes" eval "$as_ac_Def=\$tmp_exp" fi as_tmp_HaveFmtDef=`$as_echo "curl_cv_have_def_$tmp_fmt" | $as_tr_sh` as_tmp_FmtDef=`$as_echo "curl_cv_def_$tmp_fmt" | $as_tr_sh` if test `eval 'as_val=${'$as_tmp_HaveFmtDef'};$as_echo "$as_val"'` = "yes"; then curl_format_curl_off_t=`eval 'as_val=${'$as_tmp_FmtDef'};$as_echo "$as_val"'` curl_typeof_curl_off_t="$t8" curl_sizeof_curl_off_t="8" fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_typeof_curl_off_t" >&5 $as_echo "$curl_typeof_curl_off_t" >&6; } fi if test "$curl_typeof_curl_off_t" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 32-bit curl_off_t data type" >&5 $as_echo_n "checking for 32-bit curl_off_t data type... " >&6; } for t4 in \ "$x_LP32_long" \ 'int32_t' \ '__int32' \ 'int' ; do if test "$curl_typeof_curl_off_t" = "unknown" && test ! -z "$t4"; then tmp_includes="" tmp_source="" tmp_fmt="" case `echo "$t4" | sed 's/[^a-zA-Z0-9_]/_/g'` in int64_t) tmp_includes="$curl_includes_inttypes" tmp_source="char f[] = PRId64;" tmp_fmt="PRId64" ;; int32_t) tmp_includes="$curl_includes_inttypes" tmp_source="char f[] = PRId32;" tmp_fmt="PRId32" ;; int16_t) tmp_includes="$curl_includes_inttypes" tmp_source="char f[] = PRId16;" tmp_fmt="PRId16" ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $tmp_includes typedef $t4 curl_off_t; typedef char dummy_arr[sizeof(curl_off_t) == 4 ? 1 : -1]; int main (void) { $tmp_source curl_off_t dummy; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if test -z "$tmp_fmt"; then curl_typeof_curl_off_t="$t4" curl_sizeof_curl_off_t="4" else as_ac_HaveDef=`$as_echo "curl_cv_have_def_$tmp_fmt" | $as_tr_sh` as_ac_Def=`$as_echo "curl_cv_def_$tmp_fmt" | $as_tr_sh` if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_inttypes #ifdef $tmp_fmt CURL_DEF_TOKEN $tmp_fmt #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "$tmp_fmt"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then eval "$as_ac_HaveDef=no" else eval "$as_ac_HaveDef=yes" eval "$as_ac_Def=\$tmp_exp" fi as_tmp_HaveFmtDef=`$as_echo "curl_cv_have_def_$tmp_fmt" | $as_tr_sh` as_tmp_FmtDef=`$as_echo "curl_cv_def_$tmp_fmt" | $as_tr_sh` if test `eval 'as_val=${'$as_tmp_HaveFmtDef'};$as_echo "$as_val"'` = "yes"; then curl_format_curl_off_t=`eval 'as_val=${'$as_tmp_FmtDef'};$as_echo "$as_val"'` curl_typeof_curl_off_t="$t4" curl_sizeof_curl_off_t="4" fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_typeof_curl_off_t" >&5 $as_echo "$curl_typeof_curl_off_t" >&6; } fi if test "$curl_typeof_curl_off_t" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 16-bit curl_off_t data type" >&5 $as_echo_n "checking for 16-bit curl_off_t data type... " >&6; } for t2 in \ "$x_LP16_long" \ 'int16_t' \ '__int16' \ 'int' ; do if test "$curl_typeof_curl_off_t" = "unknown" && test ! -z "$t2"; then tmp_includes="" tmp_source="" tmp_fmt="" case `echo "$t2" | sed 's/[^a-zA-Z0-9_]/_/g'` in int64_t) tmp_includes="$curl_includes_inttypes" tmp_source="char f[] = PRId64;" tmp_fmt="PRId64" ;; int32_t) tmp_includes="$curl_includes_inttypes" tmp_source="char f[] = PRId32;" tmp_fmt="PRId32" ;; int16_t) tmp_includes="$curl_includes_inttypes" tmp_source="char f[] = PRId16;" tmp_fmt="PRId16" ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $tmp_includes typedef $t2 curl_off_t; typedef char dummy_arr[sizeof(curl_off_t) == 2 ? 1 : -1]; int main (void) { $tmp_source curl_off_t dummy; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if test -z "$tmp_fmt"; then curl_typeof_curl_off_t="$t2" curl_sizeof_curl_off_t="2" else as_ac_HaveDef=`$as_echo "curl_cv_have_def_$tmp_fmt" | $as_tr_sh` as_ac_Def=`$as_echo "curl_cv_def_$tmp_fmt" | $as_tr_sh` if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_inttypes #ifdef $tmp_fmt CURL_DEF_TOKEN $tmp_fmt #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "$tmp_fmt"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then eval "$as_ac_HaveDef=no" else eval "$as_ac_HaveDef=yes" eval "$as_ac_Def=\$tmp_exp" fi as_tmp_HaveFmtDef=`$as_echo "curl_cv_have_def_$tmp_fmt" | $as_tr_sh` as_tmp_FmtDef=`$as_echo "curl_cv_def_$tmp_fmt" | $as_tr_sh` if test `eval 'as_val=${'$as_tmp_HaveFmtDef'};$as_echo "$as_val"'` = "yes"; then curl_format_curl_off_t=`eval 'as_val=${'$as_tmp_FmtDef'};$as_echo "$as_val"'` curl_typeof_curl_off_t="$t2" curl_sizeof_curl_off_t="2" fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_typeof_curl_off_t" >&5 $as_echo "$curl_typeof_curl_off_t" >&6; } fi if test "$curl_typeof_curl_off_t" = "unknown"; then as_fn_error $? "cannot find data type for curl_off_t." "$LINENO" 5 fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of curl_off_t" >&5 $as_echo_n "checking size of curl_off_t... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_sizeof_curl_off_t" >&5 $as_echo "$curl_sizeof_curl_off_t" >&6; } # { $as_echo "$as_me:${as_lineno-$LINENO}: checking formatting string directive for curl_off_t" >&5 $as_echo_n "checking formatting string directive for curl_off_t... " >&6; } if test "$curl_format_curl_off_t" != "unknown"; then x_pull_headers="yes" curl_format_curl_off_t=`echo "$curl_format_curl_off_t" | "$SED" 's/["]//g'` curl_format_curl_off_tu=`echo "$curl_format_curl_off_t" | "$SED" 's/i$/u/'` curl_format_curl_off_tu=`echo "$curl_format_curl_off_tu" | "$SED" 's/d$/u/'` curl_format_curl_off_tu=`echo "$curl_format_curl_off_tu" | "$SED" 's/D$/U/'` else x_pull_headers="no" case `echo "$curl_typeof_curl_off_t" | sed 's/[^a-zA-Z0-9_]/_/g'` in long_long | __longlong | __longlong_t) curl_format_curl_off_t="lld" curl_format_curl_off_tu="llu" ;; long) curl_format_curl_off_t="ld" curl_format_curl_off_tu="lu" ;; int) curl_format_curl_off_t="d" curl_format_curl_off_tu="u" ;; __int64) curl_format_curl_off_t="I64d" curl_format_curl_off_tu="I64u" ;; __int32) curl_format_curl_off_t="I32d" curl_format_curl_off_tu="I32u" ;; __int16) curl_format_curl_off_t="I16d" curl_format_curl_off_tu="I16u" ;; *) as_fn_error $? "cannot find print format string for curl_off_t." "$LINENO" 5 ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$curl_format_curl_off_t\"" >&5 $as_echo "\"$curl_format_curl_off_t\"" >&6; } # { $as_echo "$as_me:${as_lineno-$LINENO}: checking formatting string directive for unsigned curl_off_t" >&5 $as_echo_n "checking formatting string directive for unsigned curl_off_t... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$curl_format_curl_off_tu\"" >&5 $as_echo "\"$curl_format_curl_off_tu\"" >&6; } # { $as_echo "$as_me:${as_lineno-$LINENO}: checking constant suffix string for curl_off_t" >&5 $as_echo_n "checking constant suffix string for curl_off_t... " >&6; } # curl_suffix_curl_off_t="unknown" curl_suffix_curl_off_tu="unknown" # case `echo "$curl_typeof_curl_off_t" | sed 's/[^a-zA-Z0-9_]/_/g'` in long_long | __longlong | __longlong_t) tst_suffixes="LL::" ;; long) tst_suffixes="L::" ;; int) tst_suffixes="::" ;; __int64 | int64_t) tst_suffixes="LL:i64::" ;; __int32 | int32_t) tst_suffixes="L:i32::" ;; __int16 | int16_t) tst_suffixes="L:i16::" ;; *) as_fn_error $? "unexpected data type $curl_typeof_curl_off_t" "$LINENO" 5 ;; esac # old_IFS=$IFS; IFS=':' for tmp_ssuf in $tst_suffixes ; do IFS=$old_IFS if test "x$curl_suffix_curl_off_t" = "xunknown"; then case $tmp_ssuf in i64 | i32 | i16) tmp_usuf="u$tmp_ssuf" ;; LL | L) tmp_usuf="U$tmp_ssuf" ;; *) tmp_usuf="" ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_inttypes typedef $curl_typeof_curl_off_t new_t; int main (void) { new_t s1; new_t s2; s1 = -10$tmp_ssuf ; s2 = 20$tmp_ssuf ; if(s1 > s2) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_suffix_curl_off_t="$tmp_ssuf" curl_suffix_curl_off_tu="$tmp_usuf" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi done IFS=$old_IFS # if test "x$curl_suffix_curl_off_t" = "xunknown"; then as_fn_error $? "cannot find constant suffix string for curl_off_t." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_suffix_curl_off_t" >&5 $as_echo "$curl_suffix_curl_off_t" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking constant suffix string for unsigned curl_off_t" >&5 $as_echo_n "checking constant suffix string for unsigned curl_off_t... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_suffix_curl_off_tu" >&5 $as_echo "$curl_suffix_curl_off_tu" >&6; } fi # # if test "$x_pull_headers" = "yes"; then if test "x$ac_cv_header_sys_types_h" = "xyes"; then cat >>confdefs.h <<_EOF #define CURL_PULL_SYS_TYPES_H 1 _EOF fi if test "x$ac_cv_header_stdint_h" = "xyes"; then cat >>confdefs.h <<_EOF #define CURL_PULL_STDINT_H 1 _EOF fi if test "x$ac_cv_header_inttypes_h" = "xyes"; then cat >>confdefs.h <<_EOF #define CURL_PULL_INTTYPES_H 1 _EOF fi fi # cat >>confdefs.h <<_EOF #define CURL_TYPEOF_CURL_OFF_T $curl_typeof_curl_off_t _EOF cat >>confdefs.h <<_EOF #define CURL_FORMAT_CURL_OFF_T "$curl_format_curl_off_t" _EOF cat >>confdefs.h <<_EOF #define CURL_FORMAT_CURL_OFF_TU "$curl_format_curl_off_tu" _EOF cat >>confdefs.h <<_EOF #define CURL_FORMAT_OFF_T "%$curl_format_curl_off_t" _EOF cat >>confdefs.h <<_EOF #define CURL_SIZEOF_CURL_OFF_T $curl_sizeof_curl_off_t _EOF cat >>confdefs.h <<_EOF #define CURL_SUFFIX_CURL_OFF_T $curl_suffix_curl_off_t _EOF cat >>confdefs.h <<_EOF #define CURL_SUFFIX_CURL_OFF_TU $curl_suffix_curl_off_tu _EOF # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if OS is AIX (to define _ALL_SOURCE)" >&5 $as_echo_n "checking if OS is AIX (to define _ALL_SOURCE)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _AIX yes_this_is_aix #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes_this_is_aix" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define _ALL_SOURCE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _THREAD_SAFE is already defined" >&5 $as_echo_n "checking if _THREAD_SAFE is already defined... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifdef _THREAD_SAFE int dummy=1; #else force compilation error #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tmp_thread_safe_initially_defined="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tmp_thread_safe_initially_defined="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # if test "$tmp_thread_safe_initially_defined" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _THREAD_SAFE is actually needed" >&5 $as_echo_n "checking if _THREAD_SAFE is actually needed... " >&6; } case $host_os in aix[123].* | aix4.[012].*) tmp_need_thread_safe="no" ;; aix*) tmp_need_thread_safe="yes" ;; *) tmp_need_thread_safe="no" ;; esac if test "$tmp_need_thread_safe" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _THREAD_SAFE is onwards defined" >&5 $as_echo_n "checking if _THREAD_SAFE is onwards defined... " >&6; } if test "$tmp_thread_safe_initially_defined" = "yes" || test "$tmp_need_thread_safe" = "yes"; then $as_echo "#define NEED_THREAD_SAFE 1" >>confdefs.h cat >>confdefs.h <<_EOF #ifndef _THREAD_SAFE # define _THREAD_SAFE #endif _EOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is already defined" >&5 $as_echo_n "checking if _REENTRANT is already defined... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifdef _REENTRANT int dummy=1; #else force compilation error #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tmp_reentrant_initially_defined="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tmp_reentrant_initially_defined="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # if test "$tmp_reentrant_initially_defined" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is actually needed" >&5 $as_echo_n "checking if _REENTRANT is actually needed... " >&6; } case $host_os in solaris*) tmp_need_reentrant="yes" ;; *) tmp_need_reentrant="no" ;; esac if test "$tmp_need_reentrant" = "no"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { if(0 != errno) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tmp_errno="yes" else tmp_errno="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$tmp_errno" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { #ifdef errno int dummy=1; #else force compilation error #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tmp_errno="errno_macro_defined" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _REENTRANT #include int main (void) { #ifdef errno int dummy=1; #else force compilation error #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tmp_errno="errno_macro_needs_reentrant" tmp_need_reentrant="yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi if test "$tmp_need_reentrant" = "no"; then if test "$tmp_need_reentrant" = "no"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define gmtime_r innocuous_gmtime_r #ifdef __STDC__ # include #else # include #endif #undef gmtime_r #ifdef __cplusplus extern "C" #endif char gmtime_r (); #if defined __stub_gmtime_r || defined __stub___gmtime_r choke me #endif int main (void) { return gmtime_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tmp_gmtime_r="yes" else tmp_gmtime_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$tmp_gmtime_r" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "gmtime_r" >/dev/null 2>&1; then : tmp_gmtime_r="proto_declared" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _REENTRANT #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "gmtime_r" >/dev/null 2>&1; then : tmp_gmtime_r="proto_needs_reentrant" tmp_need_reentrant="yes" fi rm -f conftest* fi rm -f conftest* fi fi if test "$tmp_need_reentrant" = "no"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define localtime_r innocuous_localtime_r #ifdef __STDC__ # include #else # include #endif #undef localtime_r #ifdef __cplusplus extern "C" #endif char localtime_r (); #if defined __stub_localtime_r || defined __stub___localtime_r choke me #endif int main (void) { return localtime_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tmp_localtime_r="yes" else tmp_localtime_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$tmp_localtime_r" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "localtime_r" >/dev/null 2>&1; then : tmp_localtime_r="proto_declared" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _REENTRANT #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "localtime_r" >/dev/null 2>&1; then : tmp_localtime_r="proto_needs_reentrant" tmp_need_reentrant="yes" fi rm -f conftest* fi rm -f conftest* fi fi if test "$tmp_need_reentrant" = "no"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define strerror_r innocuous_strerror_r #ifdef __STDC__ # include #else # include #endif #undef strerror_r #ifdef __cplusplus extern "C" #endif char strerror_r (); #if defined __stub_strerror_r || defined __stub___strerror_r choke me #endif int main (void) { return strerror_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tmp_strerror_r="yes" else tmp_strerror_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$tmp_strerror_r" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strerror_r" >/dev/null 2>&1; then : tmp_strerror_r="proto_declared" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _REENTRANT #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strerror_r" >/dev/null 2>&1; then : tmp_strerror_r="proto_needs_reentrant" tmp_need_reentrant="yes" fi rm -f conftest* fi rm -f conftest* fi fi if test "$tmp_need_reentrant" = "no"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define strtok_r innocuous_strtok_r #ifdef __STDC__ # include #else # include #endif #undef strtok_r #ifdef __cplusplus extern "C" #endif char strtok_r (); #if defined __stub_strtok_r || defined __stub___strtok_r choke me #endif int main (void) { return strtok_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tmp_strtok_r="yes" else tmp_strtok_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$tmp_strtok_r" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtok_r" >/dev/null 2>&1; then : tmp_strtok_r="proto_declared" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _REENTRANT #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtok_r" >/dev/null 2>&1; then : tmp_strtok_r="proto_needs_reentrant" tmp_need_reentrant="yes" fi rm -f conftest* fi rm -f conftest* fi fi if test "$tmp_need_reentrant" = "no"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define inet_ntoa_r innocuous_inet_ntoa_r #ifdef __STDC__ # include #else # include #endif #undef inet_ntoa_r #ifdef __cplusplus extern "C" #endif char inet_ntoa_r (); #if defined __stub_inet_ntoa_r || defined __stub___inet_ntoa_r choke me #endif int main (void) { return inet_ntoa_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tmp_inet_ntoa_r="yes" else tmp_inet_ntoa_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$tmp_inet_ntoa_r" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "inet_ntoa_r" >/dev/null 2>&1; then : tmp_inet_ntoa_r="proto_declared" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _REENTRANT #include #include #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "inet_ntoa_r" >/dev/null 2>&1; then : tmp_inet_ntoa_r="proto_needs_reentrant" tmp_need_reentrant="yes" fi rm -f conftest* fi rm -f conftest* fi fi if test "$tmp_need_reentrant" = "no"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define gethostbyaddr_r innocuous_gethostbyaddr_r #ifdef __STDC__ # include #else # include #endif #undef gethostbyaddr_r #ifdef __cplusplus extern "C" #endif char gethostbyaddr_r (); #if defined __stub_gethostbyaddr_r || defined __stub___gethostbyaddr_r choke me #endif int main (void) { return gethostbyaddr_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tmp_gethostbyaddr_r="yes" else tmp_gethostbyaddr_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$tmp_gethostbyaddr_r" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "gethostbyaddr_r" >/dev/null 2>&1; then : tmp_gethostbyaddr_r="proto_declared" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _REENTRANT #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "gethostbyaddr_r" >/dev/null 2>&1; then : tmp_gethostbyaddr_r="proto_needs_reentrant" tmp_need_reentrant="yes" fi rm -f conftest* fi rm -f conftest* fi fi if test "$tmp_need_reentrant" = "no"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define gethostbyname_r innocuous_gethostbyname_r #ifdef __STDC__ # include #else # include #endif #undef gethostbyname_r #ifdef __cplusplus extern "C" #endif char gethostbyname_r (); #if defined __stub_gethostbyname_r || defined __stub___gethostbyname_r choke me #endif int main (void) { return gethostbyname_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tmp_gethostbyname_r="yes" else tmp_gethostbyname_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$tmp_gethostbyname_r" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "gethostbyname_r" >/dev/null 2>&1; then : tmp_gethostbyname_r="proto_declared" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _REENTRANT #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "gethostbyname_r" >/dev/null 2>&1; then : tmp_gethostbyname_r="proto_needs_reentrant" tmp_need_reentrant="yes" fi rm -f conftest* fi rm -f conftest* fi fi if test "$tmp_need_reentrant" = "no"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define getprotobyname_r innocuous_getprotobyname_r #ifdef __STDC__ # include #else # include #endif #undef getprotobyname_r #ifdef __cplusplus extern "C" #endif char getprotobyname_r (); #if defined __stub_getprotobyname_r || defined __stub___getprotobyname_r choke me #endif int main (void) { return getprotobyname_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tmp_getprotobyname_r="yes" else tmp_getprotobyname_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$tmp_getprotobyname_r" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "getprotobyname_r" >/dev/null 2>&1; then : tmp_getprotobyname_r="proto_declared" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _REENTRANT #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "getprotobyname_r" >/dev/null 2>&1; then : tmp_getprotobyname_r="proto_needs_reentrant" tmp_need_reentrant="yes" fi rm -f conftest* fi rm -f conftest* fi fi if test "$tmp_need_reentrant" = "no"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define getservbyport_r innocuous_getservbyport_r #ifdef __STDC__ # include #else # include #endif #undef getservbyport_r #ifdef __cplusplus extern "C" #endif char getservbyport_r (); #if defined __stub_getservbyport_r || defined __stub___getservbyport_r choke me #endif int main (void) { return getservbyport_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tmp_getservbyport_r="yes" else tmp_getservbyport_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$tmp_getservbyport_r" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "getservbyport_r" >/dev/null 2>&1; then : tmp_getservbyport_r="proto_declared" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _REENTRANT #include #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "getservbyport_r" >/dev/null 2>&1; then : tmp_getservbyport_r="proto_needs_reentrant" tmp_need_reentrant="yes" fi rm -f conftest* fi rm -f conftest* fi fi fi if test "$tmp_need_reentrant" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is onwards defined" >&5 $as_echo_n "checking if _REENTRANT is onwards defined... " >&6; } if test "$tmp_reentrant_initially_defined" = "yes" || test "$tmp_need_reentrant" = "yes"; then $as_echo "#define NEED_REENTRANT 1" >>confdefs.h cat >>confdefs.h <<_EOF #ifndef _REENTRANT # define _REENTRANT #endif _EOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv -f conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # ------------------------------------ # # Determine libtool default behavior # # ------------------------------------ # # # Default behavior is to enable shared and static libraries on systems # where libtool knows how to build both library versions, and does not # require separate configuration and build runs for each flavor. # xc_lt_want_enable_shared='yes' xc_lt_want_enable_static='yes' # # User may have disabled shared or static libraries. # case "x$enable_shared" in # ( xno) xc_lt_want_enable_shared='no' ;; esac case "x$enable_static" in # ( xno) xc_lt_want_enable_static='no' ;; esac if test "x$xc_lt_want_enable_shared" = 'xno' && test "x$xc_lt_want_enable_static" = 'xno'; then as_fn_error $? "can not disable shared and static libraries simultaneously" "$LINENO" 5 fi # # Default behavior on systems that require independent configuration # and build runs for shared and static is to enable shared libraries # and disable static ones. On these systems option '--disable-shared' # must be used in order to build a proper static library. # if test "x$xc_lt_want_enable_shared" = 'xyes' && test "x$xc_lt_want_enable_static" = 'xyes'; then case $host_os in # ( mingw* | pw32* | cegcc* | os2* | aix*) xc_lt_want_enable_static='no' ;; esac fi # # Make libtool aware of current shared and static library preferences # taking in account that, depending on host characteristics, libtool # may modify these option preferences later in this configure script. # enable_shared=$xc_lt_want_enable_shared enable_static=$xc_lt_want_enable_static # # Default behavior is to build PIC objects for shared libraries and # non-PIC objects for static libraries. # xc_lt_want_with_pic='default' # # User may have specified PIC preference. # case "x$with_pic" in # (( xno) xc_lt_want_with_pic='no' ;; xyes) xc_lt_want_with_pic='yes' ;; esac # # Default behavior on some systems where building a shared library out # of non-PIC compiled objects will fail with following linker error # "relocation R_X86_64_32 can not be used when making a shared object" # is to build PIC objects even for static libraries. This behavior may # be overriden using 'configure --disable-shared --without-pic'. # if test "x$xc_lt_want_with_pic" = 'xdefault'; then case $host_cpu in # ( x86_64 | amd64 | ia64) case $host_os in # ( linux* | freebsd*) xc_lt_want_with_pic='yes' ;; esac ;; esac fi # # Make libtool aware of current PIC preference taking in account that, # depending on host characteristics, libtool may modify PIC default # behavior to fit host system idiosyncrasies later in this script. # with_pic=$xc_lt_want_with_pic ## ----------------------- ## ## Start of libtool code ## ## ----------------------- ## # Set options enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump enable_dlopen=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv -f $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv -f $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main (void) { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: ## --------------------- ## ## End of libtool code ## ## --------------------- ## # # Verify if finally libtool shared libraries will be built # case "x$enable_shared" in # (( xyes | xno) xc_lt_build_shared=$enable_shared ;; *) as_fn_error $? "unexpected libtool enable_shared value: $enable_shared" "$LINENO" 5 ;; esac # # Verify if finally libtool static libraries will be built # case "x$enable_static" in # (( xyes | xno) xc_lt_build_static=$enable_static ;; *) as_fn_error $? "unexpected libtool enable_static value: $enable_static" "$LINENO" 5 ;; esac # # Verify if libtool shared libraries should be linked using flag -version-info # { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries with -version-info" >&5 $as_echo_n "checking whether to build shared libraries with -version-info... " >&6; } xc_lt_shlib_use_version_info='yes' if test "x$version_type" = 'xnone'; then xc_lt_shlib_use_version_info='no' fi case $host_os in # ( amigaos*) xc_lt_shlib_use_version_info='yes' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_lt_shlib_use_version_info" >&5 $as_echo "$xc_lt_shlib_use_version_info" >&6; } # # Verify if libtool shared libraries should be linked using flag -no-undefined # { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries with -no-undefined" >&5 $as_echo_n "checking whether to build shared libraries with -no-undefined... " >&6; } xc_lt_shlib_use_no_undefined='no' if test "x$allow_undefined" = 'xno'; then xc_lt_shlib_use_no_undefined='yes' elif test "x$allow_undefined_flag" = 'xunsupported'; then xc_lt_shlib_use_no_undefined='yes' fi case $host_os in # ( cygwin* | mingw* | pw32* | cegcc* | os2* | aix*) xc_lt_shlib_use_no_undefined='yes' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_lt_shlib_use_no_undefined" >&5 $as_echo "$xc_lt_shlib_use_no_undefined" >&6; } # # Verify if libtool shared libraries should be linked using flag -mimpure-text # { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries with -mimpure-text" >&5 $as_echo_n "checking whether to build shared libraries with -mimpure-text... " >&6; } xc_lt_shlib_use_mimpure_text='no' case $host_os in # ( solaris2*) if test "x$GCC" = 'xyes'; then xc_lt_shlib_use_mimpure_text='yes' fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_lt_shlib_use_mimpure_text" >&5 $as_echo "$xc_lt_shlib_use_mimpure_text" >&6; } # # Find out wether libtool libraries would be built wit PIC # case "x$pic_mode" in # (((( xdefault) xc_lt_build_shared_with_pic='yes' xc_lt_build_static_with_pic='no' ;; xyes) xc_lt_build_shared_with_pic='yes' xc_lt_build_static_with_pic='yes' ;; xno) xc_lt_build_shared_with_pic='no' xc_lt_build_static_with_pic='no' ;; *) xc_lt_build_shared_with_pic='unknown' xc_lt_build_static_with_pic='unknown' { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unexpected libtool pic_mode value: $pic_mode" >&5 $as_echo "$as_me: WARNING: unexpected libtool pic_mode value: $pic_mode" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries with PIC" >&5 $as_echo_n "checking whether to build shared libraries with PIC... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_lt_build_shared_with_pic" >&5 $as_echo "$xc_lt_build_shared_with_pic" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries with PIC" >&5 $as_echo_n "checking whether to build static libraries with PIC... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_lt_build_static_with_pic" >&5 $as_echo "$xc_lt_build_static_with_pic" >&6; } # # Verify if libtool shared libraries will be built while static not built # { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries only" >&5 $as_echo_n "checking whether to build shared libraries only... " >&6; } if test "$xc_lt_build_shared" = 'yes' && test "$xc_lt_build_static" = 'no'; then xc_lt_build_shared_only='yes' else xc_lt_build_shared_only='no' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_lt_build_shared_only" >&5 $as_echo "$xc_lt_build_shared_only" >&6; } # # Verify if libtool static libraries will be built while shared not built # { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries only" >&5 $as_echo_n "checking whether to build static libraries only... " >&6; } if test "$xc_lt_build_static" = 'yes' && test "$xc_lt_build_shared" = 'no'; then xc_lt_build_static_only='yes' else xc_lt_build_static_only='no' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_lt_build_static_only" >&5 $as_echo "$xc_lt_build_static_only" >&6; } # # Automake conditionals based on libtool related checks # if test "x$xc_lt_shlib_use_version_info" = 'xyes'; then CURL_LT_SHLIB_USE_VERSION_INFO_TRUE= CURL_LT_SHLIB_USE_VERSION_INFO_FALSE='#' else CURL_LT_SHLIB_USE_VERSION_INFO_TRUE='#' CURL_LT_SHLIB_USE_VERSION_INFO_FALSE= fi if test "x$xc_lt_shlib_use_no_undefined" = 'xyes'; then CURL_LT_SHLIB_USE_NO_UNDEFINED_TRUE= CURL_LT_SHLIB_USE_NO_UNDEFINED_FALSE='#' else CURL_LT_SHLIB_USE_NO_UNDEFINED_TRUE='#' CURL_LT_SHLIB_USE_NO_UNDEFINED_FALSE= fi if test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'; then CURL_LT_SHLIB_USE_MIMPURE_TEXT_TRUE= CURL_LT_SHLIB_USE_MIMPURE_TEXT_FALSE='#' else CURL_LT_SHLIB_USE_MIMPURE_TEXT_TRUE='#' CURL_LT_SHLIB_USE_MIMPURE_TEXT_FALSE= fi # # Due to libtool and automake machinery limitations of not allowing # specifying separate CPPFLAGS or CFLAGS when compiling objects for # inclusion of these in shared or static libraries, we are forced to # build using separate configure runs for shared and static libraries # on systems where different CPPFLAGS or CFLAGS are mandatory in order # to compile objects for each kind of library. Notice that relying on # the '-DPIC' CFLAG that libtool provides is not valid given that the # user might for example choose to build static libraries with PIC. # # # Make our Makefile.am files use the staticlib CPPFLAG only when strictly # targeting a static library and not building its shared counterpart. # if test "x$xc_lt_build_static_only" = 'xyes'; then USE_CPPFLAG_CURL_STATICLIB_TRUE= USE_CPPFLAG_CURL_STATICLIB_FALSE='#' else USE_CPPFLAG_CURL_STATICLIB_TRUE='#' USE_CPPFLAG_CURL_STATICLIB_FALSE= fi # # Make staticlib CPPFLAG variable and its definition visible in output # files unconditionally, providing an empty definition unless strictly # targeting a static library and not building its shared counterpart. # CPPFLAG_CURL_STATICLIB= if test "x$xc_lt_build_static_only" = 'xyes'; then CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB' fi # Determine whether all dependent libraries must be specified when linking if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno" then REQUIRE_LIB_DEPS=no else REQUIRE_LIB_DEPS=yes fi if test x$REQUIRE_LIB_DEPS = xyes; then USE_EXPLICIT_LIB_DEPS_TRUE= USE_EXPLICIT_LIB_DEPS_FALSE='#' else USE_EXPLICIT_LIB_DEPS_TRUE='#' USE_EXPLICIT_LIB_DEPS_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac # compiler_id="unknown" compiler_num="0" # flags_dbg_all="unknown" flags_dbg_yes="unknown" flags_dbg_off="unknown" flags_opt_all="unknown" flags_opt_yes="unknown" flags_opt_off="unknown" # flags_prefer_cppflags="no" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is DEC/Compaq/HP C" >&5 $as_echo_n "checking if compiler is DEC/Compaq/HP C... " >&6; } if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __DECC CURL_DEF_TOKEN __DECC #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__DECC"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___DECC=no else curl_cv_have_def___DECC=yes curl_cv_def___DECC=$tmp_exp fi if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __DECC_VER CURL_DEF_TOKEN __DECC_VER #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__DECC_VER"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___DECC_VER=no else curl_cv_have_def___DECC_VER=yes curl_cv_def___DECC_VER=$tmp_exp fi if test "$curl_cv_have_def___DECC" = "yes" && test "$curl_cv_have_def___DECC_VER" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } compiler_id="DEC_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g2" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -O4" flags_opt_yes="-O1" flags_opt_off="-O0" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is HP-UX C" >&5 $as_echo_n "checking if compiler is HP-UX C... " >&6; } if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __HP_cc CURL_DEF_TOKEN __HP_cc #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__HP_cc"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___HP_cc=no else curl_cv_have_def___HP_cc=yes curl_cv_def___HP_cc=$tmp_exp fi if test "$curl_cv_have_def___HP_cc" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } compiler_id="HP_UX_C" flags_dbg_all="-g -s" flags_dbg_yes="-g" flags_dbg_off="-s" flags_opt_all="-O +O0 +O1 +O2 +O3 +O4" flags_opt_yes="+O2" flags_opt_off="+O0" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is IBM C" >&5 $as_echo_n "checking if compiler is IBM C... " >&6; } if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __IBMC__ CURL_DEF_TOKEN __IBMC__ #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__IBMC__"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___IBMC__=no else curl_cv_have_def___IBMC__=yes curl_cv_def___IBMC__=$tmp_exp fi if test "$curl_cv_have_def___IBMC__" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } compiler_id="IBM_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -O4 -O5" flags_opt_all="$flags_opt_all -qnooptimize" flags_opt_all="$flags_opt_all -qoptimize=0" flags_opt_all="$flags_opt_all -qoptimize=1" flags_opt_all="$flags_opt_all -qoptimize=2" flags_opt_all="$flags_opt_all -qoptimize=3" flags_opt_all="$flags_opt_all -qoptimize=4" flags_opt_all="$flags_opt_all -qoptimize=5" flags_opt_yes="-O2" flags_opt_off="-qnooptimize" flags_prefer_cppflags="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is Intel C" >&5 $as_echo_n "checking if compiler is Intel C... " >&6; } if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __INTEL_COMPILER CURL_DEF_TOKEN __INTEL_COMPILER #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__INTEL_COMPILER"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___INTEL_COMPILER=no else curl_cv_have_def___INTEL_COMPILER=yes curl_cv_def___INTEL_COMPILER=$tmp_exp fi if test "$curl_cv_have_def___INTEL_COMPILER" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } compiler_num="$curl_cv_def___INTEL_COMPILER" if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __unix__ CURL_DEF_TOKEN __unix__ #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = ""; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___unix__=no else curl_cv_have_def___unix__=yes curl_cv_def___unix__=$tmp_exp fi if test "$curl_cv_have_def___unix__" = "yes"; then compiler_id="INTEL_UNIX_C" flags_dbg_all="-g -g0" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" flags_opt_yes="-O2" flags_opt_off="-O0" else compiler_id="INTEL_WINDOWS_C" flags_dbg_all="/ZI /Zi /zI /zi /ZD /Zd /zD /zd /Z7 /z7 /Oy /Oy-" flags_dbg_all="$flags_dbg_all /debug" flags_dbg_all="$flags_dbg_all /debug:none" flags_dbg_all="$flags_dbg_all /debug:minimal" flags_dbg_all="$flags_dbg_all /debug:partial" flags_dbg_all="$flags_dbg_all /debug:full" flags_dbg_all="$flags_dbg_all /debug:semantic_stepping" flags_dbg_all="$flags_dbg_all /debug:extended" flags_dbg_yes="/Zi /Oy-" flags_dbg_off="/debug:none /Oy-" flags_opt_all="/O /O0 /O1 /O2 /O3 /Od /Og /Og- /Oi /Oi-" flags_opt_yes="/O2" flags_opt_off="/Od" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is clang" >&5 $as_echo_n "checking if compiler is clang... " >&6; } if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __clang__ CURL_DEF_TOKEN __clang__ #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__clang__"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___clang__=no else curl_cv_have_def___clang__=yes curl_cv_def___clang__=$tmp_exp fi if test "$curl_cv_have_def___clang__" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } compiler_id="CLANG" clangver=`$CC -dumpversion` clangvhi=`echo $clangver | cut -d . -f1` clangvlo=`echo $clangver | cut -d . -f2` compiler_num=`(expr $clangvhi "*" 100 + $clangvlo) 2>/dev/null` flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_all="$flags_dbg_all -ggdb" flags_dbg_all="$flags_dbg_all -gstabs" flags_dbg_all="$flags_dbg_all -gstabs+" flags_dbg_all="$flags_dbg_all -gcoff" flags_dbg_all="$flags_dbg_all -gxcoff" flags_dbg_all="$flags_dbg_all -gdwarf-2" flags_dbg_all="$flags_dbg_all -gvms" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -Os -O3 -O4" flags_opt_yes="-Os" flags_opt_off="-O0" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is GNU C" >&5 $as_echo_n "checking if compiler is GNU C... " >&6; } if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ CURL_DEF_TOKEN __GNUC__ #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__GNUC__"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___GNUC__=no else curl_cv_have_def___GNUC__=yes curl_cv_def___GNUC__=$tmp_exp fi if test "$curl_cv_have_def___GNUC__" = "yes" && test "$compiler_id" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } compiler_id="GNU_C" gccver=`$CC -dumpversion` gccvhi=`echo $gccver | cut -d . -f1` gccvlo=`echo $gccver | cut -d . -f2` compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null` flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_all="$flags_dbg_all -ggdb" flags_dbg_all="$flags_dbg_all -gstabs" flags_dbg_all="$flags_dbg_all -gstabs+" flags_dbg_all="$flags_dbg_all -gcoff" flags_dbg_all="$flags_dbg_all -gxcoff" flags_dbg_all="$flags_dbg_all -gdwarf-2" flags_dbg_all="$flags_dbg_all -gvms" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" flags_opt_yes="-O2" flags_opt_off="-O0" if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _WIN32 CURL_DEF_TOKEN _WIN32 #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "_WIN32"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def__WIN32=no else curl_cv_have_def__WIN32=yes curl_cv_def__WIN32=$tmp_exp fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is LCC" >&5 $as_echo_n "checking if compiler is LCC... " >&6; } if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __LCC__ CURL_DEF_TOKEN __LCC__ #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__LCC__"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___LCC__=no else curl_cv_have_def___LCC__=yes curl_cv_def___LCC__=$tmp_exp fi if test "$curl_cv_have_def___LCC__" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } compiler_id="LCC" flags_dbg_all="-g" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="" flags_opt_yes="" flags_opt_off="" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is SGI MIPSpro C" >&5 $as_echo_n "checking if compiler is SGI MIPSpro C... " >&6; } if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ CURL_DEF_TOKEN __GNUC__ #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__GNUC__"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___GNUC__=no else curl_cv_have_def___GNUC__=yes curl_cv_def___GNUC__=$tmp_exp fi if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _COMPILER_VERSION CURL_DEF_TOKEN _COMPILER_VERSION #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "_COMPILER_VERSION"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def__COMPILER_VERSION=no else curl_cv_have_def__COMPILER_VERSION=yes curl_cv_def__COMPILER_VERSION=$tmp_exp fi if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _SGI_COMPILER_VERSION CURL_DEF_TOKEN _SGI_COMPILER_VERSION #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "_SGI_COMPILER_VERSION"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def__SGI_COMPILER_VERSION=no else curl_cv_have_def__SGI_COMPILER_VERSION=yes curl_cv_def__SGI_COMPILER_VERSION=$tmp_exp fi if test "$curl_cv_have_def___GNUC__" = "no" && (test "$curl_cv_have_def__SGI_COMPILER_VERSION" = "yes" || test "$curl_cv_have_def__COMPILER_VERSION" = "yes"); then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } compiler_id="SGI_MIPSPRO_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast" flags_opt_yes="-O2" flags_opt_off="-O0" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is SGI MIPS C" >&5 $as_echo_n "checking if compiler is SGI MIPS C... " >&6; } if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ CURL_DEF_TOKEN __GNUC__ #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__GNUC__"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___GNUC__=no else curl_cv_have_def___GNUC__=yes curl_cv_def___GNUC__=$tmp_exp fi if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __sgi CURL_DEF_TOKEN __sgi #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__sgi"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___sgi=no else curl_cv_have_def___sgi=yes curl_cv_def___sgi=$tmp_exp fi if test "$curl_cv_have_def___GNUC__" = "no" && test "$curl_cv_have_def___sgi" = "yes" && test "$compiler_id" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } compiler_id="SGI_MIPS_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast" flags_opt_yes="-O2" flags_opt_off="-O0" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is SunPro C" >&5 $as_echo_n "checking if compiler is SunPro C... " >&6; } if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __SUNPRO_C CURL_DEF_TOKEN __SUNPRO_C #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__SUNPRO_C"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___SUNPRO_C=no else curl_cv_have_def___SUNPRO_C=yes curl_cv_def___SUNPRO_C=$tmp_exp fi if test "$curl_cv_have_def___SUNPRO_C" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } compiler_id="SUNPRO_C" flags_dbg_all="-g -s" flags_dbg_yes="-g" flags_dbg_off="-s" flags_opt_all="-O -xO -xO1 -xO2 -xO3 -xO4 -xO5" flags_opt_yes="-xO2" flags_opt_off="" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is Tiny C" >&5 $as_echo_n "checking if compiler is Tiny C... " >&6; } if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __TINYC__ CURL_DEF_TOKEN __TINYC__ #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__TINYC__"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___TINYC__=no else curl_cv_have_def___TINYC__=yes curl_cv_def___TINYC__=$tmp_exp fi if test "$curl_cv_have_def___TINYC__" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } compiler_id="TINY_C" flags_dbg_all="-g -b" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="" flags_opt_yes="" flags_opt_off="" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is Watcom C" >&5 $as_echo_n "checking if compiler is Watcom C... " >&6; } if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __WATCOMC__ CURL_DEF_TOKEN __WATCOMC__ #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__WATCOMC__"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___WATCOMC__=no else curl_cv_have_def___WATCOMC__=yes curl_cv_def___WATCOMC__=$tmp_exp fi if test "$curl_cv_have_def___WATCOMC__" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __UNIX__ CURL_DEF_TOKEN __UNIX__ #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "__UNIX__"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def___UNIX__=no else curl_cv_have_def___UNIX__=yes curl_cv_def___UNIX__=$tmp_exp fi if test "$curl_cv_have_def___UNIX__" = "yes"; then compiler_id="WATCOM_UNIX_C" flags_dbg_all="-g1 -g1+ -g2 -g3" flags_dbg_yes="-g2" flags_dbg_off="" flags_opt_all="-O0 -O1 -O2 -O3" flags_opt_yes="-O2" flags_opt_off="-O0" else compiler_id="WATCOM_WINDOWS_C" flags_dbg_all="" flags_dbg_yes="" flags_dbg_off="" flags_opt_all="" flags_opt_yes="" flags_opt_off="" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # if test "$compiler_id" = "unknown"; then cat <<_EOF 1>&2 *** *** Warning: This configure script does not have information about the *** compiler you are using, relative to the flags required to enable or *** disable generation of debug info, optimization options or warnings. *** *** Whatever settings are present in CFLAGS will be used for this run. *** *** If you wish to help the cURL project to better support your compiler *** you can report this and the required info on the libcurl development *** mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/ *** _EOF fi squeeze() { _sqz_result="" eval _sqz_input=\$$1 for _sqz_token in $_sqz_input; do if test -z "$_sqz_result"; then _sqz_result="$_sqz_token" else _sqz_result="$_sqz_result $_sqz_token" fi done eval $1=\$_sqz_result return 0 } # if test "$compiler_id" != "unknown"; then # if test "$compiler_id" = "GNU_C" || test "$compiler_id" = "CLANG"; then if test "$compiler_id" = "GNU_C" || test "$compiler_id" = "CLANG"; then tmp_has_include="no" tmp_chg_FLAGS="$CFLAGS" for word1 in $tmp_chg_FLAGS; do case "$word1" in -I*) tmp_has_include="yes" ;; esac done if test "$tmp_has_include" = "yes"; then tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` CFLAGS="$tmp_chg_FLAGS" squeeze CFLAGS fi tmp_has_include="no" tmp_chg_FLAGS="$CPPFLAGS" for word1 in $tmp_chg_FLAGS; do case "$word1" in -I*) tmp_has_include="yes" ;; esac done if test "$tmp_has_include" = "yes"; then tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` CPPFLAGS="$tmp_chg_FLAGS" squeeze CPPFLAGS fi fi fi # tmp_save_CPPFLAGS="$CPPFLAGS" tmp_save_CFLAGS="$CFLAGS" tmp_CPPFLAGS="" tmp_CFLAGS="" # case "$compiler_id" in # CLANG) # tmp_CFLAGS="$tmp_CFLAGS -Qunused-arguments" ;; # DEC_C) # tmp_CFLAGS="$tmp_CFLAGS -std1" tmp_CFLAGS="$tmp_CFLAGS -noansi_alias" tmp_CFLAGS="$tmp_CFLAGS -warnprotos" tmp_CFLAGS="$tmp_CFLAGS -msg_fatal toofewargs,toomanyargs" ;; # GNU_C) # tmp_CFLAGS="$tmp_CFLAGS" ;; # HP_UX_C) # tmp_CFLAGS="$tmp_CFLAGS -z" tmp_CFLAGS="$tmp_CFLAGS +W 4227,4255" ;; # IBM_C) # tmp_CPPFLAGS="$tmp_CPPFLAGS -qthreaded" tmp_CPPFLAGS="$tmp_CPPFLAGS -qnoansialias" tmp_CPPFLAGS="$tmp_CPPFLAGS -qhalt=e" ;; # INTEL_UNIX_C) # tmp_CFLAGS="$tmp_CFLAGS -std=gnu89" tmp_CPPFLAGS="$tmp_CPPFLAGS -we140,147,165,266" tmp_CPPFLAGS="$tmp_CPPFLAGS -wd279,981,1469" ;; # INTEL_WINDOWS_C) # tmp_CFLAGS="$tmp_CFLAGS" ;; # LCC) # tmp_CFLAGS="$tmp_CFLAGS -n" ;; # SGI_MIPS_C) # tmp_CFLAGS="$tmp_CFLAGS" ;; # SGI_MIPSPRO_C) # tmp_CFLAGS="$tmp_CFLAGS" ;; # SUNPRO_C) # tmp_CFLAGS="$tmp_CFLAGS" ;; # TINY_C) # tmp_CFLAGS="$tmp_CFLAGS" ;; # WATCOM_UNIX_C) # tmp_CFLAGS="$tmp_CFLAGS" ;; # WATCOM_WINDOWS_C) # tmp_CFLAGS="$tmp_CFLAGS" ;; # esac # squeeze tmp_CPPFLAGS squeeze tmp_CFLAGS # if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts some basic options" >&5 $as_echo_n "checking if compiler accepts some basic options... " >&6; } CPPFLAGS="$tmp_save_CPPFLAGS $tmp_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" squeeze CPPFLAGS squeeze CFLAGS tmp_compiler_works="unknown" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { int i = 1; return i; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tmp_compiler_works="yes" else tmp_compiler_works="no" echo " " >&6 sed 's/^/cc-fail: /' conftest.err >&6 echo " " >&6 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$tmp_compiler_works" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { int i = 1; return i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tmp_compiler_works="yes" else tmp_compiler_works="no" echo " " >&6 sed 's/^/link-fail: /' conftest.err >&6 echo " " >&6 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "x$cross_compiling" != "xyes" && test "$tmp_compiler_works" = "yes"; then if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # ifdef __STDC__ # include # endif int main (void) { int i = 0; exit(i); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : tmp_compiler_works="yes" else tmp_compiler_works="no" echo " " >&6 echo "run-fail: test program exited with status $ac_status" >&6 echo " " >&6 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi if test "$tmp_compiler_works" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS" >&5 $as_echo "$as_me: compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS" >&5 $as_echo "$as_me: WARNING: compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS" >&2;} CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" fi fi # fi # if test "$compiler_id" != "unknown"; then # tmp_save_CFLAGS="$CFLAGS" tmp_save_CPPFLAGS="$CPPFLAGS" # tmp_options="" tmp_CFLAGS="$CFLAGS" tmp_CPPFLAGS="$CPPFLAGS" ac_var_stripped="" for word1 in $tmp_CFLAGS; do ac_var_strip_word="no" for word2 in $flags_dbg_all; do if test "$word1" = "$word2"; then ac_var_strip_word="yes" fi done if test "$ac_var_strip_word" = "no"; then ac_var_stripped="$ac_var_stripped $word1" fi done tmp_CFLAGS="$ac_var_stripped" squeeze tmp_CFLAGS ac_var_stripped="" for word1 in $tmp_CPPFLAGS; do ac_var_strip_word="no" for word2 in $flags_dbg_all; do if test "$word1" = "$word2"; then ac_var_strip_word="yes" fi done if test "$ac_var_strip_word" = "no"; then ac_var_stripped="$ac_var_stripped $word1" fi done tmp_CPPFLAGS="$ac_var_stripped" squeeze tmp_CPPFLAGS # if test "$want_debug" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts debug enabling options" >&5 $as_echo_n "checking if compiler accepts debug enabling options... " >&6; } tmp_options="$flags_dbg_yes" fi if test "$want_debug" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts debug disabling options" >&5 $as_echo_n "checking if compiler accepts debug disabling options... " >&6; } tmp_options="$flags_dbg_off" fi # if test "$flags_prefer_cppflags" = "yes"; then CPPFLAGS="$tmp_CPPFLAGS $tmp_options" CFLAGS="$tmp_CFLAGS" else CPPFLAGS="$tmp_CPPFLAGS" CFLAGS="$tmp_CFLAGS $tmp_options" fi squeeze CPPFLAGS squeeze CFLAGS tmp_compiler_works="unknown" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { int i = 1; return i; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tmp_compiler_works="yes" else tmp_compiler_works="no" echo " " >&6 sed 's/^/cc-fail: /' conftest.err >&6 echo " " >&6 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$tmp_compiler_works" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { int i = 1; return i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tmp_compiler_works="yes" else tmp_compiler_works="no" echo " " >&6 sed 's/^/link-fail: /' conftest.err >&6 echo " " >&6 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "x$cross_compiling" != "xyes" && test "$tmp_compiler_works" = "yes"; then if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # ifdef __STDC__ # include # endif int main (void) { int i = 0; exit(i); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : tmp_compiler_works="yes" else tmp_compiler_works="no" echo " " >&6 echo "run-fail: test program exited with status $ac_status" >&6 echo " " >&6 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi if test "$tmp_compiler_works" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: compiler options added: $tmp_options" >&5 $as_echo "$as_me: compiler options added: $tmp_options" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compiler options rejected: $tmp_options" >&5 $as_echo "$as_me: WARNING: compiler options rejected: $tmp_options" >&2;} CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" fi # fi # if test "$compiler_id" != "unknown"; then # tmp_save_CFLAGS="$CFLAGS" tmp_save_CPPFLAGS="$CPPFLAGS" # tmp_options="" tmp_CFLAGS="$CFLAGS" tmp_CPPFLAGS="$CPPFLAGS" honor_optimize_option="yes" # # if test "$want_optimize" = "assume_no" || test "$want_optimize" = "assume_yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler optimizer assumed setting might be used" >&5 $as_echo_n "checking if compiler optimizer assumed setting might be used... " >&6; } ac_var_match_word="no" for word1 in $tmp_CFLAGS; do for word2 in $flags_opt_all; do if test "$word1" = "$word2"; then ac_var_match_word="yes" fi done done if test "$ac_var_match_word" = "yes"; then honor_optimize_option="no" fi ac_var_match_word="no" for word1 in $tmp_CPPFLAGS; do for word2 in $flags_opt_all; do if test "$word1" = "$word2"; then ac_var_match_word="yes" fi done done if test "$ac_var_match_word" = "yes"; then honor_optimize_option="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $honor_optimize_option" >&5 $as_echo "$honor_optimize_option" >&6; } if test "$honor_optimize_option" = "yes"; then if test "$want_optimize" = "assume_yes"; then want_optimize="yes" fi if test "$want_optimize" = "assume_no"; then want_optimize="no" fi fi fi # if test "$honor_optimize_option" = "yes"; then ac_var_stripped="" for word1 in $tmp_CFLAGS; do ac_var_strip_word="no" for word2 in $flags_opt_all; do if test "$word1" = "$word2"; then ac_var_strip_word="yes" fi done if test "$ac_var_strip_word" = "no"; then ac_var_stripped="$ac_var_stripped $word1" fi done tmp_CFLAGS="$ac_var_stripped" squeeze tmp_CFLAGS ac_var_stripped="" for word1 in $tmp_CPPFLAGS; do ac_var_strip_word="no" for word2 in $flags_opt_all; do if test "$word1" = "$word2"; then ac_var_strip_word="yes" fi done if test "$ac_var_strip_word" = "no"; then ac_var_stripped="$ac_var_stripped $word1" fi done tmp_CPPFLAGS="$ac_var_stripped" squeeze tmp_CPPFLAGS if test "$want_optimize" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts optimizer enabling options" >&5 $as_echo_n "checking if compiler accepts optimizer enabling options... " >&6; } tmp_options="$flags_opt_yes" fi if test "$want_optimize" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts optimizer disabling options" >&5 $as_echo_n "checking if compiler accepts optimizer disabling options... " >&6; } tmp_options="$flags_opt_off" fi if test "$flags_prefer_cppflags" = "yes"; then CPPFLAGS="$tmp_CPPFLAGS $tmp_options" CFLAGS="$tmp_CFLAGS" else CPPFLAGS="$tmp_CPPFLAGS" CFLAGS="$tmp_CFLAGS $tmp_options" fi squeeze CPPFLAGS squeeze CFLAGS tmp_compiler_works="unknown" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { int i = 1; return i; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tmp_compiler_works="yes" else tmp_compiler_works="no" echo " " >&6 sed 's/^/cc-fail: /' conftest.err >&6 echo " " >&6 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$tmp_compiler_works" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { int i = 1; return i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tmp_compiler_works="yes" else tmp_compiler_works="no" echo " " >&6 sed 's/^/link-fail: /' conftest.err >&6 echo " " >&6 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "x$cross_compiling" != "xyes" && test "$tmp_compiler_works" = "yes"; then if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # ifdef __STDC__ # include # endif int main (void) { int i = 0; exit(i); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : tmp_compiler_works="yes" else tmp_compiler_works="no" echo " " >&6 echo "run-fail: test program exited with status $ac_status" >&6 echo " " >&6 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi if test "$tmp_compiler_works" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: compiler options added: $tmp_options" >&5 $as_echo "$as_me: compiler options added: $tmp_options" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compiler options rejected: $tmp_options" >&5 $as_echo "$as_me: WARNING: compiler options rejected: $tmp_options" >&2;} CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" fi fi # fi # if test "$compiler_id" != "unknown"; then # tmp_save_CPPFLAGS="$CPPFLAGS" tmp_save_CFLAGS="$CFLAGS" tmp_CPPFLAGS="" tmp_CFLAGS="" # case "$compiler_id" in # CLANG) # if test "$want_warnings" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS -pedantic" tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra" tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings" tmp_CFLAGS="$tmp_CFLAGS -Wshadow" tmp_CFLAGS="$tmp_CFLAGS -Winline -Wnested-externs" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes" tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long" tmp_CFLAGS="$tmp_CFLAGS -Wfloat-equal" tmp_CFLAGS="$tmp_CFLAGS -Wno-multichar -Wsign-compare" tmp_CFLAGS="$tmp_CFLAGS -Wundef" tmp_CFLAGS="$tmp_CFLAGS -Wno-format-nonliteral" tmp_CFLAGS="$tmp_CFLAGS -Wendif-labels -Wstrict-prototypes" tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" tmp_CFLAGS="$tmp_CFLAGS -Wshorten-64-to-32" # if test "$compiler_num" -ge "101"; then tmp_CFLAGS="$tmp_CFLAGS -Wunused" fi fi ;; # DEC_C) # if test "$want_warnings" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS -msg_enable level3" fi ;; # GNU_C) # if test "$want_warnings" = "yes"; then # if test "x$cross_compiling" != "xyes" || test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS -pedantic" fi # tmp_CFLAGS="$tmp_CFLAGS -Wall -W" # if test "$compiler_num" -ge "104"; then tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings" if test "x$cross_compiling" != "xyes" || test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS -Wunused -Wshadow" fi fi # if test "$compiler_num" -ge "207"; then tmp_CFLAGS="$tmp_CFLAGS -Winline -Wnested-externs" if test "x$cross_compiling" != "xyes" || test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes" fi fi # if test "$compiler_num" -ge "295"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long" fi # if test "$compiler_num" -ge "296"; then tmp_CFLAGS="$tmp_CFLAGS -Wfloat-equal" tmp_CFLAGS="$tmp_CFLAGS -Wno-multichar -Wsign-compare" tmp_CFLAGS="$tmp_CFLAGS -Wundef" fi # if test "$compiler_num" -ge "297"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-format-nonliteral" fi # if test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS" fi # if test "$compiler_num" -ge "303"; then tmp_CFLAGS="$tmp_CFLAGS -Wendif-labels -Wstrict-prototypes" fi # if test "$compiler_num" -ge "304"; then tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" fi # if test "$compiler_num" -ge "400"; then tmp_CFLAGS="$tmp_CFLAGS -Wstrict-aliasing=3" fi # if test "$compiler_num" -ge "402"; then tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" fi # if test "$compiler_num" -ge "403"; then tmp_CFLAGS="$tmp_CFLAGS -Wtype-limits -Wold-style-declaration" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-parameter-type -Wempty-body" tmp_CFLAGS="$tmp_CFLAGS -Wclobbered -Wignored-qualifiers" tmp_CFLAGS="$tmp_CFLAGS -Wconversion -Wno-sign-conversion -Wvla" fi # if test "$compiler_num" -ge "405"; then if test "$curl_cv_have_def__WIN32" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-pedantic-ms-format" fi fi # fi # if test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" else if test "x$cross_compiling" = "xyes"; then if test "$compiler_num" -ge "104"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-unused -Wno-shadow" fi if test "$compiler_num" -ge "207"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-declarations" tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-prototypes" fi fi fi ;; # HP_UX_C) # if test "$want_warnings" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS +w1" fi ;; # IBM_C) # tmp_CFLAGS="$tmp_CFLAGS" ;; # INTEL_UNIX_C) # if test "$want_warnings" = "yes"; then if test "$compiler_num" -gt "600"; then tmp_CPPFLAGS="$tmp_CPPFLAGS -Wall -w2" tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcheck" tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcomment" tmp_CPPFLAGS="$tmp_CPPFLAGS -Wdeprecated" tmp_CPPFLAGS="$tmp_CPPFLAGS -Wmissing-prototypes" tmp_CPPFLAGS="$tmp_CPPFLAGS -Wp64" tmp_CPPFLAGS="$tmp_CPPFLAGS -Wpointer-arith" tmp_CPPFLAGS="$tmp_CPPFLAGS -Wreturn-type" tmp_CPPFLAGS="$tmp_CPPFLAGS -Wshadow" tmp_CPPFLAGS="$tmp_CPPFLAGS -Wuninitialized" tmp_CPPFLAGS="$tmp_CPPFLAGS -Wunused-function" fi fi tmp_CFLAGS="$tmp_CFLAGS -fno-omit-frame-pointer" tmp_CFLAGS="$tmp_CFLAGS -fno-strict-aliasing" tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" if test "$compiler_num" -ge "1000"; then tmp_CFLAGS="$tmp_CFLAGS -vec-report0" fi ;; # INTEL_WINDOWS_C) # tmp_CFLAGS="$tmp_CFLAGS" ;; # LCC) # if test "$want_warnings" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS" fi ;; # SGI_MIPS_C) # if test "$want_warnings" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS -fullwarn" fi ;; # SGI_MIPSPRO_C) # if test "$want_warnings" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS -fullwarn" tmp_CFLAGS="$tmp_CFLAGS -woff 1209" fi ;; # SUNPRO_C) # if test "$want_warnings" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS -v" fi ;; # TINY_C) # if test "$want_warnings" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS -Wall" tmp_CFLAGS="$tmp_CFLAGS -Wwrite-strings" tmp_CFLAGS="$tmp_CFLAGS -Wunsupported" fi ;; # WATCOM_UNIX_C) # if test "$want_warnings" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra" fi ;; # WATCOM_WINDOWS_C) # tmp_CFLAGS="$tmp_CFLAGS" ;; # esac # squeeze tmp_CPPFLAGS squeeze tmp_CFLAGS # if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts strict warning options" >&5 $as_echo_n "checking if compiler accepts strict warning options... " >&6; } CPPFLAGS="$tmp_save_CPPFLAGS $tmp_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" squeeze CPPFLAGS squeeze CFLAGS tmp_compiler_works="unknown" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { int i = 1; return i; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tmp_compiler_works="yes" else tmp_compiler_works="no" echo " " >&6 sed 's/^/cc-fail: /' conftest.err >&6 echo " " >&6 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$tmp_compiler_works" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { int i = 1; return i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tmp_compiler_works="yes" else tmp_compiler_works="no" echo " " >&6 sed 's/^/link-fail: /' conftest.err >&6 echo " " >&6 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "x$cross_compiling" != "xyes" && test "$tmp_compiler_works" = "yes"; then if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # ifdef __STDC__ # include # endif int main (void) { int i = 0; exit(i); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : tmp_compiler_works="yes" else tmp_compiler_works="no" echo " " >&6 echo "run-fail: test program exited with status $ac_status" >&6 echo " " >&6 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi if test "$tmp_compiler_works" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS" >&5 $as_echo "$as_me: compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS" >&5 $as_echo "$as_me: WARNING: compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS" >&2;} CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" fi fi # fi if test "$compiler_id" = "INTEL_UNIX_C"; then # if test "$compiler_num" -ge "1000"; then CFLAGS="$CFLAGS -shared-intel" elif test "$compiler_num" -ge "900"; then CFLAGS="$CFLAGS -i-dynamic" fi # fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler halts on compilation errors" >&5 $as_echo_n "checking if compiler halts on compilation errors... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { force compilation error ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "compiler does not halt on compilation errors." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler halts on negative sized arrays" >&5 $as_echo_n "checking if compiler halts on negative sized arrays... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ typedef char bad_t[sizeof(char) == sizeof(int) ? -1 : -1 ]; int main (void) { bad_t dummy; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "compiler does not halt on negative sized arrays." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler halts on function prototype mismatch" >&5 $as_echo_n "checking if compiler halts on function prototype mismatch... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include int rand(int n); int rand(int n) { if(n) return ++n; else return n; } int main (void) { int i[2]={0,0}; int j = rand(i[0]); if(j) return j; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "compiler does not halt on function prototype mismatch." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports hiding library internal symbols" >&5 $as_echo_n "checking if compiler supports hiding library internal symbols... " >&6; } supports_symbol_hiding="no" symbol_hiding_CFLAGS="" symbol_hiding_EXTERN="" tmp_CFLAGS="" tmp_EXTERN="" case "$compiler_id" in CLANG) tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" ;; GNU_C) if test "$compiler_num" -ge "304"; then if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" fi fi ;; INTEL_UNIX_C) if test "$compiler_num" -ge "900"; then if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then tmp_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include int main (void) { printf("icc fvisibility bug test"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$tmp_save_CFLAGS" fi fi ;; SUNPRO_C) if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then tmp_EXTERN="__global" tmp_CFLAGS="-xldscope=hidden" supports_symbol_hiding="yes" fi ;; esac if test "$supports_symbol_hiding" = "yes"; then tmp_save_CFLAGS="$CFLAGS" CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" squeeze CFLAGS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $tmp_EXTERN char *dummy(char *buff); char *dummy(char *buff) { if(buff) return ++buff; else return buff; } int main (void) { char b[16]; char *r = dummy(&b[0]); if(r) return (int)*r; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : supports_symbol_hiding="yes" if test -f conftest.err; then grep 'visibility' conftest.err >/dev/null if test "$?" -eq "0"; then supports_symbol_hiding="no" fi fi else supports_symbol_hiding="no" echo " " >&6 sed 's/^/cc-src: /' conftest.$ac_ext >&6 sed 's/^/cc-err: /' conftest.err >&6 echo " " >&6 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$tmp_save_CFLAGS" fi if test "$supports_symbol_hiding" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } symbol_hiding_CFLAGS="$tmp_CFLAGS" symbol_hiding_EXTERN="$tmp_EXTERN" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi supports_curldebug="unknown" if test "$want_curldebug" = "yes"; then if test "x$enable_shared" != "xno" && test "x$enable_shared" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown enable_shared setting." >&5 $as_echo "$as_me: WARNING: unknown enable_shared setting." >&2;} supports_curldebug="no" fi if test "x$enable_static" != "xno" && test "x$enable_static" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown enable_static setting." >&5 $as_echo "$as_me: WARNING: unknown enable_static setting." >&2;} supports_curldebug="no" fi if test "$supports_curldebug" != "no"; then if test "$enable_shared" = "yes" && test "x$xc_lt_shlib_use_no_undefined" = 'xyes'; then supports_curldebug="no" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: shared library does not support undefined symbols." >&5 $as_echo "$as_me: WARNING: shared library does not support undefined symbols." >&2;} fi fi fi # if test "$want_curldebug" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if curl debug memory tracking can be enabled" >&5 $as_echo_n "checking if curl debug memory tracking can be enabled... " >&6; } test "$supports_curldebug" = "no" || supports_curldebug="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports_curldebug" >&5 $as_echo "$supports_curldebug" >&6; } if test "$supports_curldebug" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot enable curl debug memory tracking." >&5 $as_echo "$as_me: WARNING: cannot enable curl debug memory tracking." >&2;} want_curldebug="no" fi fi # if test "$want_curldebug" = "yes"; then CPPFLAGS="-DCURLDEBUG $CPPFLAGS" squeeze CPPFLAGS fi if test "$want_debug" = "yes"; then CPPFLAGS="-DDEBUGBUILD $CPPFLAGS" squeeze CPPFLAGS fi if test x$want_curldebug = xyes; then CURLDEBUG_TRUE= CURLDEBUG_FALSE='#' else CURLDEBUG_TRUE='#' CURLDEBUG_FALSE= fi supports_unittests=yes # cross-compilation of unit tests static library/programs fails when # libcurl shared library is built. This might be due to a libtool or # automake issue. In this case we disable unit tests. if test "x$cross_compiling" != "xno" && test "x$enable_shared" != "xno"; then supports_unittests=no fi # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to # a problem related with OpenSSL headers and library versions not matching. # Disable unit tests while time to further investigate this is found. case $host in mips-sgi-irix6.5) if test "$compiler_id" = "GNU_C"; then supports_unittests=no fi ;; esac # All AIX autobuilds fails unit tests linking against unittests library # due to unittests library being built with no symbols or members. Libtool ? # Disable unit tests while time to further investigate this is found. case $host_os in aix*) supports_unittests=no ;; esac if test "x$want_debug" = "xyes" && test "x$supports_unittests" = "xyes"; then want_unittests=yes else want_unittests=no fi if test x$want_unittests = xyes; then BUILD_UNITTESTS_TRUE= BUILD_UNITTESTS_FALSE='#' else BUILD_UNITTESTS_TRUE='#' BUILD_UNITTESTS_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for windows.h" >&5 $as_echo_n "checking for windows.h... " >&6; } if ${ac_cv_header_windows_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include int main (void) { #if defined(__CYGWIN__) || defined(__CEGCC__) HAVE_WINDOWS_H shall not be defined. #else int dummy=2*WINVER; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_windows_h="yes" else ac_cv_header_windows_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_windows_h" >&5 $as_echo "$ac_cv_header_windows_h" >&6; } case "$ac_cv_header_windows_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_WINDOWS_H 1 _ACEOF cat >>confdefs.h <<_ACEOF #define WIN32_LEAN_AND_MEAN 1 _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build target is a native Windows one" >&5 $as_echo_n "checking whether build target is a native Windows one... " >&6; } if ${ac_cv_native_windows+:} false; then : $as_echo_n "(cached) " >&6 else if test "$ac_cv_header_windows_h" = "no"; then ac_cv_native_windows="no" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #if defined(__MINGW32__) || defined(__MINGW32CE__) || \ (defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64))) int dummy=1; #else Not a native Windows build target. #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_native_windows="yes" else ac_cv_native_windows="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_native_windows" >&5 $as_echo "$ac_cv_native_windows" >&6; } if test "x$ac_cv_native_windows" = xyes; then DOING_NATIVE_WINDOWS_TRUE= DOING_NATIVE_WINDOWS_FALSE='#' else DOING_NATIVE_WINDOWS_TRUE='#' DOING_NATIVE_WINDOWS_FALSE= fi case X-"$ac_cv_native_windows" in X-yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winsock.h" >&5 $as_echo_n "checking for winsock.h... " >&6; } if ${ac_cv_header_winsock_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #include int main (void) { #if defined(__CYGWIN__) || defined(__CEGCC__) HAVE_WINSOCK_H shall not be defined. #else int dummy=WSACleanup(); #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_winsock_h="yes" else ac_cv_header_winsock_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_winsock_h" >&5 $as_echo "$ac_cv_header_winsock_h" >&6; } case "$ac_cv_header_winsock_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_WINSOCK_H 1 _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winsock2.h" >&5 $as_echo_n "checking for winsock2.h... " >&6; } if ${ac_cv_header_winsock2_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #include int main (void) { #if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) HAVE_WINSOCK2_H shall not be defined. #else int dummy=2*IPPROTO_ESP; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_winsock2_h="yes" else ac_cv_header_winsock2_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_winsock2_h" >&5 $as_echo "$ac_cv_header_winsock2_h" >&6; } case "$ac_cv_header_winsock2_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_WINSOCK2_H 1 _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ws2tcpip.h" >&5 $as_echo_n "checking for ws2tcpip.h... " >&6; } if ${ac_cv_header_ws2tcpip_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #include #include int main (void) { #if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) HAVE_WS2TCPIP_H shall not be defined. #else int dummy=2*IP_PKTINFO; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_ws2tcpip_h="yes" else ac_cv_header_ws2tcpip_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_ws2tcpip_h" >&5 $as_echo "$ac_cv_header_ws2tcpip_h" >&6; } case "$ac_cv_header_ws2tcpip_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_WS2TCPIP_H 1 _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winldap.h" >&5 $as_echo_n "checking for winldap.h... " >&6; } if ${ac_cv_header_winldap_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #endif #include int main (void) { #if defined(__CYGWIN__) || defined(__CEGCC__) HAVE_WINLDAP_H shall not be defined. #else LDAP *ldp = ldap_init("dummy", LDAP_PORT); ULONG res = ldap_unbind(ldp); #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_winldap_h="yes" else ac_cv_header_winldap_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_winldap_h" >&5 $as_echo "$ac_cv_header_winldap_h" >&6; } case "$ac_cv_header_winldap_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_WINLDAP_H 1 _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winber.h" >&5 $as_echo_n "checking for winber.h... " >&6; } if ${ac_cv_header_winber_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #endif #include #include int main (void) { #if defined(__CYGWIN__) || defined(__CEGCC__) HAVE_WINBER_H shall not be defined. #else BERVAL *bvp = NULL; BerElement *bep = ber_init(bvp); ber_free(bep, 1); #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_winber_h="yes" else ac_cv_header_winber_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_winber_h" >&5 $as_echo "$ac_cv_header_winber_h" >&6; } case "$ac_cv_header_winber_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_WINBER_H 1 _ACEOF ;; esac ;; *) ac_cv_header_winsock_h="no" ac_cv_header_winsock2_h="no" ac_cv_header_ws2tcpip_h="no" ac_cv_header_winldap_h="no" ac_cv_header_winber_h="no" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build target supports WIN32 file API" >&5 $as_echo_n "checking whether build target supports WIN32 file API... " >&6; } curl_win32_file_api="no" if test "$ac_cv_header_windows_h" = "yes"; then if test x"$enable_largefile" != "xno"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #if !defined(_WIN32_WCE) && \ (defined(__MINGW32__) || \ (defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64)))) int dummy=1; #else WIN32 large file API not supported. #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_win32_file_api="win32_large_files" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$curl_win32_file_api" = "no"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #if defined(_WIN32_WCE) || defined(__MINGW32__) || defined(_MSC_VER) int dummy=1; #else WIN32 small file API not supported. #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_win32_file_api="win32_small_files" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi case "$curl_win32_file_api" in win32_large_files) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (large file enabled)" >&5 $as_echo "yes (large file enabled)" >&6; } cat >>confdefs.h <<_ACEOF #define USE_WIN32_LARGE_FILES 1 _ACEOF ;; win32_small_files) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (large file disabled)" >&5 $as_echo "yes (large file disabled)" >&6; } cat >>confdefs.h <<_ACEOF #define USE_WIN32_SMALL_FILES 1 _ACEOF ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support http" >&5 $as_echo_n "checking whether to support http... " >&6; } # Check whether --enable-http was given. if test "${enable_http+set}" = set; then : enableval=$enable_http; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_HTTP 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disable HTTP disables FTP over proxy and RTSP" >&5 $as_echo "$as_me: WARNING: disable HTTP disables FTP over proxy and RTSP" >&2;} CURL_DISABLE_HTTP=1 $as_echo "#define CURL_DISABLE_RTSP 1" >>confdefs.h CURL_DISABLE_RTSP=1 ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support ftp" >&5 $as_echo_n "checking whether to support ftp... " >&6; } # Check whether --enable-ftp was given. if test "${enable_ftp+set}" = set; then : enableval=$enable_ftp; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_FTP 1" >>confdefs.h CURL_DISABLE_FTP=1 ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support file" >&5 $as_echo_n "checking whether to support file... " >&6; } # Check whether --enable-file was given. if test "${enable_file+set}" = set; then : enableval=$enable_file; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_FILE 1" >>confdefs.h CURL_DISABLE_FILE=1 ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support ldap" >&5 $as_echo_n "checking whether to support ldap... " >&6; } # Check whether --enable-ldap was given. if test "${enable_ldap+set}" = set; then : enableval=$enable_ldap; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_LDAP 1" >>confdefs.h CURL_DISABLE_LDAP=1 ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support ldaps" >&5 $as_echo_n "checking whether to support ldaps... " >&6; } # Check whether --enable-ldaps was given. if test "${enable_ldaps+set}" = set; then : enableval=$enable_ldaps; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_LDAPS 1" >>confdefs.h CURL_DISABLE_LDAPS=1 ;; *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: LDAP needs to be enabled to support LDAPS" >&5 $as_echo "LDAP needs to be enabled to support LDAPS" >&6; } $as_echo "#define CURL_DISABLE_LDAPS 1" >>confdefs.h CURL_DISABLE_LDAPS=1 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_LDAP_SSL 1" >>confdefs.h HAVE_LDAP_SSL=1 fi ;; esac else if test "x$CURL_DISABLE_LDAP" = "x1" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_LDAPS 1" >>confdefs.h CURL_DISABLE_LDAPS=1 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_LDAP_SSL 1" >>confdefs.h HAVE_LDAP_SSL=1 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support rtsp" >&5 $as_echo_n "checking whether to support rtsp... " >&6; } # Check whether --enable-rtsp was given. if test "${enable_rtsp+set}" = set; then : enableval=$enable_rtsp; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_RTSP 1" >>confdefs.h CURL_DISABLE_RTSP=1 ;; *) if test x$CURL_DISABLE_HTTP = x1 ; then as_fn_error $? "HTTP support needs to be enabled in order to enable RTSP support!" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } curl_rtsp_msg="enabled" fi ;; esac else if test "x$CURL_DISABLE_HTTP" != "x1"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } curl_rtsp_msg="enabled" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support proxies" >&5 $as_echo_n "checking whether to support proxies... " >&6; } # Check whether --enable-proxy was given. if test "${enable_proxy+set}" = set; then : enableval=$enable_proxy; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_PROXY 1" >>confdefs.h CURL_DISABLE_PROXY=1 ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support dict" >&5 $as_echo_n "checking whether to support dict... " >&6; } # Check whether --enable-dict was given. if test "${enable_dict+set}" = set; then : enableval=$enable_dict; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_DICT 1" >>confdefs.h CURL_DISABLE_DICT=1 ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support telnet" >&5 $as_echo_n "checking whether to support telnet... " >&6; } # Check whether --enable-telnet was given. if test "${enable_telnet+set}" = set; then : enableval=$enable_telnet; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_TELNET 1" >>confdefs.h CURL_DISABLE_TELNET=1 ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support tftp" >&5 $as_echo_n "checking whether to support tftp... " >&6; } # Check whether --enable-tftp was given. if test "${enable_tftp+set}" = set; then : enableval=$enable_tftp; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_TFTP 1" >>confdefs.h CURL_DISABLE_TFTP=1 ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support pop3" >&5 $as_echo_n "checking whether to support pop3... " >&6; } # Check whether --enable-pop3 was given. if test "${enable_pop3+set}" = set; then : enableval=$enable_pop3; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_POP3 1" >>confdefs.h CURL_DISABLE_POP3=1 ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support imap" >&5 $as_echo_n "checking whether to support imap... " >&6; } # Check whether --enable-imap was given. if test "${enable_imap+set}" = set; then : enableval=$enable_imap; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_IMAP 1" >>confdefs.h CURL_DISABLE_IMAP=1 ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support smtp" >&5 $as_echo_n "checking whether to support smtp... " >&6; } # Check whether --enable-smtp was given. if test "${enable_smtp+set}" = set; then : enableval=$enable_smtp; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_SMTP 1" >>confdefs.h CURL_DISABLE_SMTP=1 ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support gopher" >&5 $as_echo_n "checking whether to support gopher... " >&6; } # Check whether --enable-gopher was given. if test "${enable_gopher+set}" = set; then : enableval=$enable_gopher; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_GOPHER 1" >>confdefs.h CURL_DISABLE_GOPHER=1 ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to provide built-in manual" >&5 $as_echo_n "checking whether to provide built-in manual... " >&6; } # Check whether --enable-manual was given. if test "${enable_manual+set}" = set; then : enableval=$enable_manual; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } USE_MANUAL="1" ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } USE_MANUAL="1" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable generation of C code" >&5 $as_echo_n "checking whether to enable generation of C code... " >&6; } # Check whether --enable-libcurl_option was given. if test "${enable_libcurl_option+set}" = set; then : enableval=$enable_libcurl_option; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_LIBCURL_OPTION 1" >>confdefs.h curl_libcurl_msg="no" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use libgcc" >&5 $as_echo_n "checking whether to use libgcc... " >&6; } # Check whether --enable-libgcc was given. if test "${enable_libgcc+set}" = set; then : enableval=$enable_libgcc; case "$enableval" in yes) LIBS="-lgcc $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if X/Open network library is required" >&5 $as_echo_n "checking if X/Open network library is required... " >&6; } tst_lib_xnet_required="no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #if defined(__hpux) && defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600) return 0; #elif defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED) return 0; #else force compilation error #endif } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tst_lib_xnet_required="yes" LIBS="-lxnet $LIBS" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_lib_xnet_required" >&5 $as_echo "$tst_lib_xnet_required" >&6; } ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : HAVE_GETHOSTBYNAME="1" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main (void) { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : HAVE_GETHOSTBYNAME="1" LIBS="-lnsl $LIBS" fi fi if test "$HAVE_GETHOSTBYNAME" != "1" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5 $as_echo_n "checking for gethostbyname in -lsocket... " >&6; } if ${ac_cv_lib_socket_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main (void) { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_gethostbyname=yes else ac_cv_lib_socket_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5 $as_echo "$ac_cv_lib_socket_gethostbyname" >&6; } if test "x$ac_cv_lib_socket_gethostbyname" = xyes; then : HAVE_GETHOSTBYNAME="1" LIBS="-lsocket $LIBS" fi fi if test "$HAVE_GETHOSTBYNAME" != "1" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lwatt" >&5 $as_echo_n "checking for gethostbyname in -lwatt... " >&6; } if ${ac_cv_lib_watt_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lwatt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main (void) { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_watt_gethostbyname=yes else ac_cv_lib_watt_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_watt_gethostbyname" >&5 $as_echo "$ac_cv_lib_watt_gethostbyname" >&6; } if test "x$ac_cv_lib_watt_gethostbyname" = xyes; then : HAVE_GETHOSTBYNAME="1" CPPFLAGS="-I/dev/env/WATT_ROOT/inc" LDFLAGS="-L/dev/env/WATT_ROOT/lib" LIBS="-lwatt $LIBS" fi fi if test "$HAVE_GETHOSTBYNAME" != "1" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname with both nsl and socket libs" >&5 $as_echo_n "checking for gethostbyname with both nsl and socket libs... " >&6; } my_ac_save_LIBS=$LIBS LIBS="-lnsl -lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { gethostbyname(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_GETHOSTBYNAME="1" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } LIBS=$my_ac_save_LIBS fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$HAVE_GETHOSTBYNAME" != "1" then if test "$ac_cv_header_windows_h" = "yes"; then if test "$ac_cv_header_winsock_h" = "yes"; then case $host in *-*-mingw32ce*) winsock_LIB="-lwinsock" ;; *) winsock_LIB="-lwsock32" ;; esac fi if test "$ac_cv_header_winsock2_h" = "yes"; then winsock_LIB="-lws2_32" fi if test ! -z "$winsock_LIB"; then my_ac_save_LIBS=$LIBS LIBS="$winsock_LIB $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in $winsock_LIB" >&5 $as_echo_n "checking for gethostbyname in $winsock_LIB... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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 int main (void) { gethostbyname("www.dummysite.com"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_GETHOSTBYNAME="1" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } winsock_LIB="" LIBS=$my_ac_save_LIBS fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi fi fi if test "$HAVE_GETHOSTBYNAME" != "1" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname for Minix 3" >&5 $as_echo_n "checking for gethostbyname for Minix 3... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Older Minix versions may need here instead */ #include int main (void) { gethostbyname("www.dummysite.com"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_GETHOSTBYNAME="1" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$HAVE_GETHOSTBYNAME" != "1" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname for eCos" >&5 $as_echo_n "checking for gethostbyname for eCos... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { gethostbyname("www.dummysite.com"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_GETHOSTBYNAME="1" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$HAVE_GETHOSTBYNAME" != "1" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnetwork" >&5 $as_echo_n "checking for gethostbyname in -lnetwork... " >&6; } if ${ac_cv_lib_network_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnetwork $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main (void) { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_network_gethostbyname=yes else ac_cv_lib_network_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_gethostbyname" >&5 $as_echo "$ac_cv_lib_network_gethostbyname" >&6; } if test "x$ac_cv_lib_network_gethostbyname" = xyes; then : HAVE_GETHOSTBYNAME="1" LIBS="-lnetwork $LIBS" fi fi if test "$HAVE_GETHOSTBYNAME" != "1" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnet" >&5 $as_echo_n "checking for gethostbyname in -lnet... " >&6; } if ${ac_cv_lib_net_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main (void) { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_net_gethostbyname=yes else ac_cv_lib_net_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_net_gethostbyname" >&5 $as_echo "$ac_cv_lib_net_gethostbyname" >&6; } if test "x$ac_cv_lib_net_gethostbyname" = xyes; then : HAVE_GETHOSTBYNAME="1" LIBS="-lnet $LIBS" fi fi if test "$HAVE_GETHOSTBYNAME" != "1"; then as_fn_error $? "couldn't find libraries for gethostbyname()" "$LINENO" 5 fi ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" if test "x$ac_cv_func_strcasecmp" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strcasecmp in -lresolve" >&5 $as_echo_n "checking for strcasecmp in -lresolve... " >&6; } if ${ac_cv_lib_resolve_strcasecmp+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolve $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char strcasecmp (); int main (void) { return strcasecmp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_resolve_strcasecmp=yes else ac_cv_lib_resolve_strcasecmp=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolve_strcasecmp" >&5 $as_echo "$ac_cv_lib_resolve_strcasecmp" >&6; } if test "x$ac_cv_lib_resolve_strcasecmp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLVE 1 _ACEOF LIBS="-lresolve $LIBS" fi fi if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strcasecmp in -lresolve" >&5 $as_echo_n "checking for strcasecmp in -lresolve... " >&6; } if ${ac_cv_lib_resolve_strcasecmp+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolve -lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char strcasecmp (); int main (void) { return strcasecmp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_resolve_strcasecmp=yes else ac_cv_lib_resolve_strcasecmp=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolve_strcasecmp" >&5 $as_echo "$ac_cv_lib_resolve_strcasecmp" >&6; } if test "x$ac_cv_lib_resolve_strcasecmp" = xyes; then : LIBS="-lresolve $LIBS" fi fi ac_cv_func_strcasecmp="no" curl_includes_winsock2="\ /* includes start */ #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 /* includes end */" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for windows.h" >&5 $as_echo_n "checking for windows.h... " >&6; } if ${ac_cv_header_windows_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include int main (void) { #if defined(__CYGWIN__) || defined(__CEGCC__) HAVE_WINDOWS_H shall not be defined. #else int dummy=2*WINVER; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_windows_h="yes" else ac_cv_header_windows_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_windows_h" >&5 $as_echo "$ac_cv_header_windows_h" >&6; } case "$ac_cv_header_windows_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_WINDOWS_H 1 _ACEOF cat >>confdefs.h <<_ACEOF #define WIN32_LEAN_AND_MEAN 1 _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winsock.h" >&5 $as_echo_n "checking for winsock.h... " >&6; } if ${ac_cv_header_winsock_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #include int main (void) { #if defined(__CYGWIN__) || defined(__CEGCC__) HAVE_WINSOCK_H shall not be defined. #else int dummy=WSACleanup(); #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_winsock_h="yes" else ac_cv_header_winsock_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_winsock_h" >&5 $as_echo "$ac_cv_header_winsock_h" >&6; } case "$ac_cv_header_winsock_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_WINSOCK_H 1 _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winsock2.h" >&5 $as_echo_n "checking for winsock2.h... " >&6; } if ${ac_cv_header_winsock2_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #include int main (void) { #if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) HAVE_WINSOCK2_H shall not be defined. #else int dummy=2*IPPROTO_ESP; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_winsock2_h="yes" else ac_cv_header_winsock2_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_winsock2_h" >&5 $as_echo "$ac_cv_header_winsock2_h" >&6; } case "$ac_cv_header_winsock2_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_WINSOCK2_H 1 _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in libraries" >&5 $as_echo_n "checking for connect in libraries... " >&6; } tst_connect_save_LIBS="$LIBS" tst_connect_need_LIBS="unknown" for tst_lib in '' '-lsocket' ; do if test "$tst_connect_need_LIBS" = "unknown"; then LIBS="$tst_lib $tst_connect_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 #ifndef HAVE_WINDOWS_H int connect(int, void*, int); #endif int main (void) { if(0 != connect(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tst_connect_need_LIBS="$tst_lib" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi done LIBS="$tst_connect_save_LIBS" # case X-"$tst_connect_need_LIBS" in X-unknown) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find connect" >&5 $as_echo "cannot find connect" >&6; } as_fn_error $? "cannot find connect function in libraries." "$LINENO" 5 ;; X-) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_connect_need_LIBS" >&5 $as_echo "$tst_connect_need_LIBS" >&6; } LIBS="$tst_connect_need_LIBS $tst_connect_save_LIBS" ;; esac CURL_NETWORK_LIBS=$LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main (void) { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_header in sys/types.h sys/time.h time.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for monotonic clock_gettime" >&5 $as_echo_n "checking for monotonic clock_gettime... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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 int main (void) { struct timespec ts; (void)clock_gettime(CLOCK_MONOTONIC, &ts); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_func_clock_gettime="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_clock_gettime="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # if test "$ac_cv_func_clock_gettime" = "yes"; then # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in libraries" >&5 $as_echo_n "checking for clock_gettime in libraries... " >&6; } # curl_cv_save_LIBS="$LIBS" curl_cv_gclk_LIBS="unknown" # for x_xlibs in '' '-lrt' '-lposix4' ; do if test "$curl_cv_gclk_LIBS" = "unknown"; then if test -z "$x_xlibs"; then LIBS="$curl_cv_save_LIBS" else LIBS="$x_xlibs $curl_cv_save_LIBS" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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 int main (void) { struct timespec ts; (void)clock_gettime(CLOCK_MONOTONIC, &ts); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : curl_cv_gclk_LIBS="$x_xlibs" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi done # LIBS="$curl_cv_save_LIBS" # case X-"$curl_cv_gclk_LIBS" in X-unknown) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find clock_gettime" >&5 $as_echo "cannot find clock_gettime" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&5 $as_echo "$as_me: WARNING: HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&2;} ac_cv_func_clock_gettime="no" ;; X-) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no additional lib required" >&5 $as_echo "no additional lib required" >&6; } ac_cv_func_clock_gettime="yes" ;; *) if test -z "$curl_cv_save_LIBS"; then LIBS="$curl_cv_gclk_LIBS" else LIBS="$curl_cv_gclk_LIBS $curl_cv_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_gclk_LIBS" >&5 $as_echo "$curl_cv_gclk_LIBS" >&6; } ac_cv_func_clock_gettime="yes" ;; esac # if test "x$cross_compiling" != "xyes" && test "$ac_cv_func_clock_gettime" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if monotonic clock_gettime works" >&5 $as_echo_n "checking if monotonic clock_gettime works... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_STDLIB_H #include #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 int main (void) { struct timespec ts; if (0 == clock_gettime(CLOCK_MONOTONIC, &ts)) exit(0); else exit(1); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&5 $as_echo "$as_me: WARNING: HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&2;} ac_cv_func_clock_gettime="no" LIBS="$curl_cv_save_LIBS" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi # case "$ac_cv_func_clock_gettime" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_CLOCK_GETTIME_MONOTONIC 1 _ACEOF ;; esac # fi # CURL_NETWORK_AND_TIME_LIBS=$LIBS clean_CPPFLAGS=$CPPFLAGS clean_LDFLAGS=$LDFLAGS clean_LIBS=$LIBS ZLIB_LIBS="" # Check whether --with-zlib was given. if test "${with_zlib+set}" = set; then : withval=$with_zlib; OPT_ZLIB="$withval" fi if test "$OPT_ZLIB" = "no" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: zlib disabled" >&5 $as_echo "$as_me: WARNING: zlib disabled" >&2;} else if test "$OPT_ZLIB" = "yes" ; then OPT_ZLIB="" fi if test -z "$OPT_ZLIB" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5 $as_echo_n "checking for inflateEnd in -lz... " >&6; } if ${ac_cv_lib_z_inflateEnd+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char inflateEnd (); int main (void) { return inflateEnd (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_inflateEnd=yes else ac_cv_lib_z_inflateEnd=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd" >&5 $as_echo "$ac_cv_lib_z_inflateEnd" >&6; } if test "x$ac_cv_lib_z_inflateEnd" = xyes; then : HAVE_LIBZ="1" LIBS="-lz $LIBS" else OPT_ZLIB="/usr/local" fi fi if test -n "$OPT_ZLIB"; then CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include" LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff" fi ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : HAVE_ZLIB_H="1" if test "$HAVE_LIBZ" != "1"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5 $as_echo_n "checking for gzread in -lz... " >&6; } if ${ac_cv_lib_z_gzread+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char gzread (); int main (void) { return gzread (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_gzread=yes else ac_cv_lib_z_gzread=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzread" >&5 $as_echo "$ac_cv_lib_z_gzread" >&6; } if test "x$ac_cv_lib_z_gzread" = xyes; then : HAVE_LIBZ="1" LIBS="-lz $LIBS" else CPPFLAGS=$clean_CPPFLAGS LDFLAGS=$clean_LDFLAGS fi fi else CPPFLAGS=$clean_CPPFLAGS LDFLAGS=$clean_LDFLAGS fi if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1" then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: configure found only the libz lib, not the header file!" >&5 $as_echo "$as_me: WARNING: configure found only the libz lib, not the header file!" >&2;} HAVE_LIBZ="" CPPFLAGS=$clean_CPPFLAGS LDFLAGS=$clean_LDFLAGS LIBS=$clean_LIBS elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1" then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: configure found only the libz header file, not the lib!" >&5 $as_echo "$as_me: WARNING: configure found only the libz header file, not the lib!" >&2;} CPPFLAGS=$clean_CPPFLAGS LDFLAGS=$clean_LDFLAGS LIBS=$clean_LIBS elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1" then $as_echo "#define HAVE_ZLIB_H 1" >>confdefs.h $as_echo "#define HAVE_LIBZ 1" >>confdefs.h ZLIB_LIBS="-lz" LIBS="-lz $clean_LIBS" AMFIXLIB="1" { $as_echo "$as_me:${as_lineno-$LINENO}: found both libz and libz.h header" >&5 $as_echo "$as_me: found both libz and libz.h header" >&6;} curl_zlib_msg="enabled" fi fi if test x"$AMFIXLIB" = x1; then HAVE_LIBZ_TRUE= HAVE_LIBZ_FALSE='#' else HAVE_LIBZ_TRUE='#' HAVE_LIBZ_FALSE= fi LDAPLIBNAME="" # Check whether --with-ldap-lib was given. if test "${with_ldap_lib+set}" = set; then : withval=$with_ldap_lib; LDAPLIBNAME="$withval" fi LBERLIBNAME="" # Check whether --with-lber-lib was given. if test "${with_lber_lib+set}" = set; then : withval=$with_lber_lib; LBERLIBNAME="$withval" fi if test x$CURL_DISABLE_LDAP != x1 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lber.h" >&5 $as_echo_n "checking for lber.h... " >&6; } if ${ac_cv_header_lber_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #else #ifdef HAVE_SYS_TYPES_H #include #endif #endif #ifndef NULL #define NULL (void *)0 #endif #include int main (void) { BerValue *bvp = NULL; BerElement *bep = ber_init(bvp); ber_free(bep, 1); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_lber_h="yes" else ac_cv_header_lber_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_lber_h" >&5 $as_echo "$ac_cv_header_lber_h" >&6; } if test "$ac_cv_header_lber_h" = "yes"; then cat >>confdefs.h <<_ACEOF #define HAVE_LBER_H 1 _ACEOF # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #else #ifdef HAVE_SYS_TYPES_H #include #endif #endif #ifndef NULL #define NULL (void *)0 #endif #ifndef LDAP_DEPRECATED #define LDAP_DEPRECATED 1 #endif #include int main (void) { BerValue *bvp = NULL; BerElement *bep = ber_init(bvp); ber_free(bep, 1); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_cv_need_header_lber_h="no" else curl_cv_need_header_lber_h="yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # case "$curl_cv_need_header_lber_h" in yes) cat >>confdefs.h <<_ACEOF #define NEED_LBER_H 1 _ACEOF ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap.h" >&5 $as_echo_n "checking for ldap.h... " >&6; } if ${ac_cv_header_ldap_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #else #ifdef HAVE_SYS_TYPES_H #include #endif #endif #ifndef LDAP_DEPRECATED #define LDAP_DEPRECATED 1 #endif #ifdef NEED_LBER_H #include #endif #include int main (void) { LDAP *ldp = ldap_init("dummy", LDAP_PORT); int res = ldap_unbind(ldp); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_ldap_h="yes" else ac_cv_header_ldap_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_ldap_h" >&5 $as_echo "$ac_cv_header_ldap_h" >&6; } case "$ac_cv_header_ldap_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_LDAP_H 1 _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl.h" >&5 $as_echo_n "checking for ldapssl.h... " >&6; } if ${ac_cv_header_ldapssl_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #else #ifdef HAVE_SYS_TYPES_H #include #endif #endif #ifndef NULL #define NULL (void *)0 #endif #ifndef LDAP_DEPRECATED #define LDAP_DEPRECATED 1 #endif #ifdef NEED_LBER_H #include #endif #ifdef HAVE_LDAP_H #include #endif #include int main (void) { char *cert_label = NULL; LDAP *ldp = ldap_ssl_init("dummy", LDAPS_PORT, cert_label); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_ldapssl_h="yes" else ac_cv_header_ldapssl_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_ldapssl_h" >&5 $as_echo "$ac_cv_header_ldapssl_h" >&6; } case "$ac_cv_header_ldapssl_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_LDAPSSL_H 1 _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_ssl.h" >&5 $as_echo_n "checking for ldap_ssl.h... " >&6; } if ${ac_cv_header_ldap_ssl_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #else #ifdef HAVE_SYS_TYPES_H #include #endif #endif #ifndef LDAP_DEPRECATED #define LDAP_DEPRECATED 1 #endif #ifdef NEED_LBER_H #include #endif #ifdef HAVE_LDAP_H #include #endif #include int main (void) { LDAP *ldp = ldapssl_init("dummy", LDAPS_PORT, 1); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_ldap_ssl_h="yes" else ac_cv_header_ldap_ssl_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_ldap_ssl_h" >&5 $as_echo "$ac_cv_header_ldap_ssl_h" >&6; } case "$ac_cv_header_ldap_ssl_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_LDAP_SSL_H 1 _ACEOF ;; esac if test -z "$LDAPLIBNAME" ; then if test "$ac_cv_native_windows" = "yes"; then LDAPLIBNAME="wldap32" LBERLIBNAME="no" fi fi if test "$LDAPLIBNAME" ; then as_ac_Lib=`$as_echo "ac_cv_lib_"$LDAPLIBNAME"''_ldap_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_init in -l\"$LDAPLIBNAME\"" >&5 $as_echo_n "checking for ldap_init in -l\"$LDAPLIBNAME\"... " >&6; } if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l"$LDAPLIBNAME" $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char ldap_init (); int main (void) { return ldap_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_LIB"$LDAPLIBNAME"" | $as_tr_cpp` 1 _ACEOF LIBS="-l"$LDAPLIBNAME" $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"$LDAPLIBNAME\" is not an LDAP library: LDAP disabled" >&5 $as_echo "$as_me: WARNING: \"$LDAPLIBNAME\" is not an LDAP library: LDAP disabled" >&2;} $as_echo "#define CURL_DISABLE_LDAP 1" >>confdefs.h CURL_DISABLE_LDAP=1 $as_echo "#define CURL_DISABLE_LDAPS 1" >>confdefs.h CURL_DISABLE_LDAPS=1 fi else # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDAP libraries" >&5 $as_echo_n "checking for LDAP libraries... " >&6; } # u_libs="" # # curl_cv_save_LIBS="$LIBS" curl_cv_ldap_LIBS="unknown" # for x_nlibs in '' "$u_libs" \ '-lldap' \ '-llber -lldap' \ '-lldap -llber' \ '-lldapssl -lldapx -lldapsdk' \ '-lldapsdk -lldapx -lldapssl' ; do if test "$curl_cv_ldap_LIBS" = "unknown"; then if test -z "$x_nlibs"; then LIBS="$curl_cv_save_LIBS" else LIBS="$x_nlibs $curl_cv_save_LIBS" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #else #ifdef HAVE_SYS_TYPES_H #include #endif #endif #ifndef NULL #define NULL (void *)0 #endif #ifndef LDAP_DEPRECATED #define LDAP_DEPRECATED 1 #endif #ifdef NEED_LBER_H #include #endif #ifdef HAVE_LDAP_H #include #endif int main (void) { BerValue *bvp = NULL; BerElement *bep = ber_init(bvp); LDAP *ldp = ldap_init("dummy", LDAP_PORT); int res = ldap_unbind(ldp); ber_free(bep, 1); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : curl_cv_ldap_LIBS="$x_nlibs" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi done # LIBS="$curl_cv_save_LIBS" # case X-"$curl_cv_ldap_LIBS" in X-unknown) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find LDAP libraries" >&5 $as_echo "cannot find LDAP libraries" >&6; } ;; X-) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no additional lib required" >&5 $as_echo "no additional lib required" >&6; } ;; *) if test -z "$curl_cv_save_LIBS"; then LIBS="$curl_cv_ldap_LIBS" else LIBS="$curl_cv_ldap_LIBS $curl_cv_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_ldap_LIBS" >&5 $as_echo "$curl_cv_ldap_LIBS" >&6; } ;; esac # case X-"$curl_cv_ldap_LIBS" in X-unknown) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libraries for LDAP support: LDAP disabled" >&5 $as_echo "$as_me: WARNING: Cannot find libraries for LDAP support: LDAP disabled" >&2;} $as_echo "#define CURL_DISABLE_LDAP 1" >>confdefs.h CURL_DISABLE_LDAP=1 $as_echo "#define CURL_DISABLE_LDAPS 1" >>confdefs.h CURL_DISABLE_LDAPS=1 ;; esac fi fi if test x$CURL_DISABLE_LDAP != x1 ; then if test "$LBERLIBNAME" ; then if test "$LBERLIBNAME" != "no" ; then as_ac_Lib=`$as_echo "ac_cv_lib_"$LBERLIBNAME"''_ber_free" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ber_free in -l\"$LBERLIBNAME\"" >&5 $as_echo_n "checking for ber_free in -l\"$LBERLIBNAME\"... " >&6; } if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l"$LBERLIBNAME" $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char ber_free (); int main (void) { return ber_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_LIB"$LBERLIBNAME"" | $as_tr_cpp` 1 _ACEOF LIBS="-l"$LBERLIBNAME" $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"$LBERLIBNAME\" is not an LBER library: LDAP disabled" >&5 $as_echo "$as_me: WARNING: \"$LBERLIBNAME\" is not an LBER library: LDAP disabled" >&2;} $as_echo "#define CURL_DISABLE_LDAP 1" >>confdefs.h CURL_DISABLE_LDAP=1 $as_echo "#define CURL_DISABLE_LDAPS 1" >>confdefs.h CURL_DISABLE_LDAPS=1 fi fi fi fi if test x$CURL_DISABLE_LDAP != x1 ; then for ac_func in ldap_url_parse ldap_init_fd do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "$LDAPLIBNAME" = "wldap32"; then curl_ldap_msg="enabled (winldap)" $as_echo "#define CURL_LDAP_WIN 1" >>confdefs.h else curl_ldap_msg="enabled (OpenLDAP)" if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then $as_echo "#define USE_OPENLDAP 1" >>confdefs.h USE_OPENLDAP=1 fi fi fi if test x$CURL_DISABLE_LDAPS != x1 ; then curl_ldaps_msg="enabled" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable ipv6" >&5 $as_echo_n "checking whether to enable ipv6... " >&6; } # Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then : enableval=$enable_ipv6; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ipv6=no ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ipv6=yes ;; esac else if test "$cross_compiling" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ipv6=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* is AF_INET6 available? */ #include #include #include /* for exit() */ main() { if (socket(AF_INET6, SOCK_STREAM, 0) < 0) exit(1); else exit(0); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ipv6=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ipv6=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi if test "$ipv6" = "yes"; then curl_ipv6_msg="enabled" fi # Check if struct sockaddr_in6 have sin6_scope_id member if test "$ipv6" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if struct sockaddr_in6 has sin6_scope_id member" >&5 $as_echo_n "checking if struct sockaddr_in6 has sin6_scope_id member... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { struct sockaddr_in6 s; s.sin6_scope_id = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : have_sin6_scope_id=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$have_sin6_scope_id" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if argv can be written to" >&5 $as_echo_n "checking if argv can be written to... " >&6; } if test "$cross_compiling" = yes; then : curl_cv_writable_argv=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(int argc, char ** argv) { argv[0][0] = ' '; return (argv[0][0] == ' ')?0:1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : curl_cv_writable_argv=yes else curl_cv_writable_argv=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi case $curl_cv_writable_argv in yes) $as_echo "#define HAVE_WRITABLE_ARGV 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: the previous check could not be made default was used" >&5 $as_echo "$as_me: WARNING: the previous check could not be made default was used" >&2;} ;; esac # Check whether --with-spnego was given. if test "${with_spnego+set}" = set; then : withval=$with_spnego; SPNEGO_ROOT="$withval" if test x"$SPNEGO_ROOT" != xno; then want_spnego="yes" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if SPNEGO support is requested" >&5 $as_echo_n "checking if SPNEGO support is requested... " >&6; } if test x"$want_spnego" = xyes; then if test X"$SPNEGO_ROOT" = Xyes; then as_fn_error $? "FBOpenSSL libs and/or directories were not found where specified!" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else if test -z "$SPNEGO_LIB_DIR"; then LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl" else LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_SPNEGO 1" >>confdefs.h curl_spnego_msg="enabled" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi GSSAPI_ROOT="/usr" # Check whether --with-gssapi-includes was given. if test "${with_gssapi_includes+set}" = set; then : withval=$with_gssapi_includes; GSSAPI_INCS="-I$withval" want_gss="yes" fi # Check whether --with-gssapi-libs was given. if test "${with_gssapi_libs+set}" = set; then : withval=$with_gssapi_libs; GSSAPI_LIB_DIR="-L$withval" want_gss="yes" fi # Check whether --with-gssapi was given. if test "${with_gssapi+set}" = set; then : withval=$with_gssapi; GSSAPI_ROOT="$withval" if test x"$GSSAPI_ROOT" != xno; then want_gss="yes" if test x"$GSSAPI_ROOT" = xyes; then GSSAPI_ROOT="/usr" fi fi fi save_CPPFLAGS="$CPPFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if GSSAPI support is requested" >&5 $as_echo_n "checking if GSSAPI support is requested... " >&6; } if test x"$want_gss" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } 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_fn_c_check_header_mongrel "$LINENO" "gss.h" "ac_cv_header_gss_h" "$ac_includes_default" if test "x$ac_cv_header_gss_h" = xyes; then : $as_echo "#define HAVE_GSSGNU 1" >>confdefs.h gnu_gss=yes else for ac_header in gssapi/gssapi.h do : ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default" if test "x$ac_cv_header_gssapi_gssapi_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GSSAPI_GSSAPI_H 1 _ACEOF else not_mit=1 fi done for ac_header in gssapi/gssapi_generic.h gssapi/gssapi_krb5.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " $ac_includes_default #ifdef HAVE_GSSAPI_GSSAPI_H #include #endif " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else not_mit=1 fi done if test "x$not_mit" = "x1"; then ac_fn_c_check_header_mongrel "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default" if test "x$ac_cv_header_gssapi_h" = xyes; then : $as_echo "#define HAVE_GSSHEIMDAL 1" >>confdefs.h else want_gss=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling GSSAPI since no header files was found" >&5 $as_echo "$as_me: WARNING: disabling GSSAPI since no header files was found" >&2;} fi else $as_echo "#define HAVE_GSSMIT 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE" >&5 $as_echo_n "checking if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main (void) { gss_import_name( (OM_uint32 *)0, (gss_buffer_t)0, GSS_C_NT_HOSTBASED_SERVICE, (gss_name_t *)0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define HAVE_OLD_GSSMIT 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$want_gss" = xyes; then $as_echo "#define HAVE_GSSAPI 1" >>confdefs.h curl_gss_msg="enabled (MIT/Heimdal)" if test -n "$gnu_gss"; then curl_gss_msg="enabled (GNU GSS)" LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" LIBS="-lgss $LIBS" elif test -z "$GSSAPI_LIB_DIR"; then case $host in *-*-darwin*) LIBS="-lgssapi_krb5 -lresolv $LIBS" ;; *-hp-hpux*) if test "$GSSAPI_ROOT" != "yes"; then LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" fi LIBS="-lgss $LIBS" ;; *) if test -f "$GSSAPI_ROOT/bin/krb5-config"; then gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi` LIBS="$gss_libs $LIBS" elif test "$GSSAPI_ROOT" != "yes"; then LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" LIBS="-lgssapi $LIBS" else LIBS="-lgssapi $LIBS" fi ;; esac else LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" case $host in *-hp-hpux*) LIBS="-lgss $LIBS" ;; *) LIBS="-lgssapi $LIBS" ;; esac fi else CPPFLAGS="$save_CPPFLAGS" fi OPT_WINSSL=no # Check whether --with-winssl was given. if test "${with_winssl+set}" = set; then : withval=$with_winssl; OPT_WINSSL=$withval fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Windows native SSL/TLS (Windows native builds only)" >&5 $as_echo_n "checking whether to enable Windows native SSL/TLS (Windows native builds only)... " >&6; } if test "$curl_ssl_msg" = "$init_ssl_msg"; then if test "x$OPT_WINSSL" != "xno" && test "x$ac_cv_native_windows" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define USE_SCHANNEL 1" >>confdefs.h USE_SCHANNEL=1 curl_ssl_msg="enabled (Windows-native)" WINSSL_ENABLED=1 # --with-winssl implies --enable-sspi $as_echo "#define USE_WINDOWS_SSPI 1" >>confdefs.h USE_WINDOWS_SSPI=1 curl_sspi_msg="enabled" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi OPT_DARWINSSL=no # Check whether --with-darwinssl was given. if test "${with_darwinssl+set}" = set; then : withval=$with_darwinssl; OPT_DARWINSSL=$withval fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable iOS/Mac OS X native SSL/TLS" >&5 $as_echo_n "checking whether to enable iOS/Mac OS X native SSL/TLS... " >&6; } if test "$curl_ssl_msg" = "$init_ssl_msg"; then if test "x$OPT_DARWINSSL" != "xno" && test -d "/System/Library/Frameworks/Security.framework"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define USE_DARWINSSL 1" >>confdefs.h USE_DARWINSSL=1 curl_ssl_msg="enabled (iOS/Mac OS X-native)" DARWINSSL_ENABLED=1 LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi OPT_SSL=off ca="no" # Check whether --with-ssl was given. if test "${with_ssl+set}" = set; then : withval=$with_ssl; OPT_SSL=$withval fi if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then CLEANLDFLAGS="$LDFLAGS" CLEANCPPFLAGS="$CPPFLAGS" CLEANLIBS="$LIBS" case "$OPT_SSL" in yes) if test x$cross_compiling != xyes; then PKGTEST="yes" fi PREFIX_OPENSSL=/usr/local/ssl LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" ;; off) if test x$cross_compiling != xyes; then PKGTEST="yes" fi PREFIX_OPENSSL= ;; *) PKGTEST="no" PREFIX_OPENSSL=$OPT_SSL OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig" { $as_echo "$as_me:${as_lineno-$LINENO}: PKG_CONFIG_LIBDIR will be set to \"$OPENSSL_PCDIR\"" >&5 $as_echo "$as_me: PKG_CONFIG_LIBDIR will be set to \"$OPENSSL_PCDIR\"" >&6;} if test -f "$OPENSSL_PCDIR/openssl.pc"; then PKGTEST="yes" fi LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" if test "$PREFIX_OPENSSL" != "/usr" ; then SSL_LDFLAGS="-L$LIB_OPENSSL" SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include" fi SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl" ;; esac if test "$PKGTEST" = "yes"; then PKGCONFIG="no" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 $as_echo "$PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 $as_echo "$ac_pt_PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then PKGCONFIG="no" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG fi else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi if test x$PKGCONFIG != xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl options with pkg-config" >&5 $as_echo_n "checking for openssl options with pkg-config... " >&6; } itexists=` if test -n "$OPENSSL_PCDIR"; then PKG_CONFIG_LIBDIR="$OPENSSL_PCDIR" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --exists openssl >/dev/null 2>&1 && echo 1` if test -z "$itexists"; then PKGCONFIG="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } fi fi if test "$PKGCONFIG" != "no" ; then SSL_LIBS=` if test -n "$OPENSSL_PCDIR"; then PKG_CONFIG_LIBDIR="$OPENSSL_PCDIR" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --libs-only-l openssl 2>/dev/null` SSL_LDFLAGS=` if test -n "$OPENSSL_PCDIR"; then PKG_CONFIG_LIBDIR="$OPENSSL_PCDIR" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --libs-only-L openssl 2>/dev/null` SSL_CPPFLAGS=` if test -n "$OPENSSL_PCDIR"; then PKG_CONFIG_LIBDIR="$OPENSSL_PCDIR" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --cflags-only-I openssl 2>/dev/null` { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config: SSL_LIBS: \"$SSL_LIBS\"" >&5 $as_echo "$as_me: pkg-config: SSL_LIBS: \"$SSL_LIBS\"" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config: SSL_LDFLAGS: \"$SSL_LDFLAGS\"" >&5 $as_echo "$as_me: pkg-config: SSL_LDFLAGS: \"$SSL_LDFLAGS\"" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config: SSL_CPPFLAGS: \"$SSL_CPPFLAGS\"" >&5 $as_echo "$as_me: pkg-config: SSL_CPPFLAGS: \"$SSL_CPPFLAGS\"" >&6;} LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'` LIBS="$SSL_LIBS $LIBS" fi fi CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS" LDFLAGS="$LDFLAGS $SSL_LDFLAGS" case $host in *-*-msys* | *-*-mingw*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gdi32" >&5 $as_echo_n "checking for gdi32... " >&6; } my_ac_save_LIBS=$LIBS LIBS="-lgdi32 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { GdiFlush(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else LIBS=$my_ac_save_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_lock in -lcrypto" >&5 $as_echo_n "checking for CRYPTO_lock in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_CRYPTO_lock+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char CRYPTO_lock (); int main (void) { return CRYPTO_lock (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_CRYPTO_lock=yes else ac_cv_lib_crypto_CRYPTO_lock=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_lock" >&5 $as_echo "$ac_cv_lib_crypto_CRYPTO_lock" >&6; } if test "x$ac_cv_lib_crypto_CRYPTO_lock" = xyes; then : HAVECRYPTO="yes" LIBS="-lcrypto $LIBS" else LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL" CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_add_lock in -lcrypto" >&5 $as_echo_n "checking for CRYPTO_add_lock in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_CRYPTO_add_lock+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char CRYPTO_add_lock (); int main (void) { return CRYPTO_add_lock (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_CRYPTO_add_lock=yes else ac_cv_lib_crypto_CRYPTO_add_lock=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_add_lock" >&5 $as_echo "$ac_cv_lib_crypto_CRYPTO_add_lock" >&6; } if test "x$ac_cv_lib_crypto_CRYPTO_add_lock" = xyes; then : HAVECRYPTO="yes" LIBS="-lcrypto $LIBS" else LDFLAGS="$CLEANLDFLAGS" CPPFLAGS="$CLEANCPPFLAGS" LIBS="$CLEANLIBS" fi fi if test X"$HAVECRYPTO" = X"yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_connect in -lssl" >&5 $as_echo_n "checking for SSL_connect in -lssl... " >&6; } if ${ac_cv_lib_ssl_SSL_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char SSL_connect (); int main (void) { return SSL_connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ssl_SSL_connect=yes else ac_cv_lib_ssl_SSL_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_connect" >&5 $as_echo "$ac_cv_lib_ssl_SSL_connect" >&6; } if test "x$ac_cv_lib_ssl_SSL_connect" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSSL 1 _ACEOF LIBS="-lssl $LIBS" fi if test "$ac_cv_lib_ssl_SSL_connect" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssl with RSAglue/rsaref libs in use" >&5 $as_echo_n "checking for ssl with RSAglue/rsaref libs in use... " >&6; }; OLIBS=$LIBS LIBS="-lRSAglue -lrsaref $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_connect in -lssl" >&5 $as_echo_n "checking for SSL_connect in -lssl... " >&6; } if ${ac_cv_lib_ssl_SSL_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char SSL_connect (); int main (void) { return SSL_connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ssl_SSL_connect=yes else ac_cv_lib_ssl_SSL_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_connect" >&5 $as_echo "$ac_cv_lib_ssl_SSL_connect" >&6; } if test "x$ac_cv_lib_ssl_SSL_connect" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSSL 1 _ACEOF LIBS="-lssl $LIBS" fi if test "$ac_cv_lib_ssl_SSL_connect" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } LIBS=$OLIBS else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi else for ac_header in openssl/x509.h openssl/rsa.h openssl/crypto.h \ openssl/pem.h openssl/ssl.h openssl/err.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF curl_ssl_msg="enabled (OpenSSL)" OPENSSL_ENABLED=1 $as_echo "#define USE_OPENSSL 1" >>confdefs.h fi done if test $ac_cv_header_openssl_x509_h = no; then for ac_header in x509.h rsa.h crypto.h pem.h ssl.h err.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test $ac_cv_header_x509_h = yes && test $ac_cv_header_crypto_h = yes && test $ac_cv_header_ssl_h = yes; then curl_ssl_msg="enabled (OpenSSL)" OPENSSL_ENABLED=1 fi fi fi if test X"$OPENSSL_ENABLED" = X"1"; then $as_echo "#define USE_SSLEAY 1" >>confdefs.h for ac_header in openssl/pkcs12.h do : ac_fn_c_check_header_mongrel "$LINENO" "openssl/pkcs12.h" "ac_cv_header_openssl_pkcs12_h" "$ac_includes_default" if test "x$ac_cv_header_openssl_pkcs12_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENSSL_PKCS12_H 1 _ACEOF fi done else LIBS="$CLEANLIBS" fi USE_SSLEAY="$OPENSSL_ENABLED" if test X"$OPT_SSL" != Xoff && test "$OPENSSL_ENABLED" != "1"; then as_fn_error $? "OpenSSL libs and/or directories were not found where specified!" "$LINENO" 5 fi fi if test X"$OPENSSL_ENABLED" = X"1"; then ac_fn_c_check_func "$LINENO" "ENGINE_init" "ac_cv_func_ENGINE_init" if test "x$ac_cv_func_ENGINE_init" = xyes; then : for ac_header in openssl/engine.h do : ac_fn_c_check_header_mongrel "$LINENO" "openssl/engine.h" "ac_cv_header_openssl_engine_h" "$ac_includes_default" if test "x$ac_cv_header_openssl_engine_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENSSL_ENGINE_H 1 _ACEOF fi done for ac_func in ENGINE_load_builtin_engines do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi for ac_func in RAND_status \ RAND_screen \ RAND_egd \ ENGINE_cleanup \ CRYPTO_cleanup_all_ex_data \ SSL_get_shutdown \ SSLv2_client_method do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yaSSL using OpenSSL compatibility mode" >&5 $as_echo_n "checking for yaSSL using OpenSSL compatibility mode... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { #if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER) int dummy = SSL_ERROR_NONE; #else Not the yaSSL OpenSSL compatibility header. #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define USE_YASSLEMUL 1 _ACEOF curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$OPENSSL_ENABLED" = "1"; then if test -n "$LIB_OPENSSL"; then if test "x$cross_compiling" != "xyes"; then LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL" export LD_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: Added $LIB_OPENSSL to LD_LIBRARY_PATH" >&5 $as_echo "$as_me: Added $LIB_OPENSSL to LD_LIBRARY_PATH" >&6;} fi fi # # tst_api="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL headers version" >&5 $as_echo_n "checking for OpenSSL headers version... " >&6; } if test -z "$SED"; then as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi if test -z "$GREP"; then as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # ifdef USE_OPENSSL # include # else # include # endif #ifdef OPENSSL_VERSION_NUMBER CURL_DEF_TOKEN OPENSSL_VERSION_NUMBER #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ "$SED" 's/["][ ]*["]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "OPENSSL_VERSION_NUMBER"; then tmp_exp="" fi fi rm -f conftest.err conftest.i conftest.$ac_ext if test -z "$tmp_exp"; then curl_cv_have_def_OPENSSL_VERSION_NUMBER=no else curl_cv_have_def_OPENSSL_VERSION_NUMBER=yes curl_cv_def_OPENSSL_VERSION_NUMBER=$tmp_exp fi if test "$curl_cv_have_def_OPENSSL_VERSION_NUMBER" = "yes"; then tst_verlen=`expr "$curl_cv_def_OPENSSL_VERSION_NUMBER" : '.*'` case "x$tst_verlen" in x6) tst_vermaj=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 3` tst_vermin=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 4` tst_verfix=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 5` tst_api=0x$tst_vermaj$tst_vermin$tst_verfix ;; x11|x10) tst_vermaj=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 3` tst_vermin=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 5` tst_verfix=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 7` tst_api=0x$tst_vermaj$tst_vermin$tst_verfix ;; *) tst_api="unknown" ;; esac case $tst_api in 0x110) tst_show="1.1.0" ;; 0x101) tst_show="1.0.1" ;; 0x100) tst_show="1.0.0" ;; 0x099) tst_show="0.9.9" ;; 0x098) tst_show="0.9.8" ;; 0x097) tst_show="0.9.7" ;; 0x096) tst_show="0.9.6" ;; 0x095) tst_show="0.9.5" ;; 0x094) tst_show="0.9.4" ;; 0x093) tst_show="0.9.3" ;; 0x092) tst_show="0.9.2" ;; 0x091) tst_show="0.9.1" ;; *) tst_show="unknown" ;; esac tst_show="$tst_show - $curl_cv_def_OPENSSL_VERSION_NUMBER" else tst_show="unknown" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_show" >&5 $as_echo "$tst_show" >&6; } # curl_openssl_api_headers=$tst_api # tst_api="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL library version" >&5 $as_echo_n "checking for OpenSSL library version... " >&6; } if test "$tst_api" = "unknown"; then case $host in *-*-vms*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define SSL_CTX_set_not_resumbl_sess_cb innocuous_SSL_CTX_set_not_resumbl_sess_cb #ifdef __STDC__ # include #else # include #endif #undef SSL_CTX_set_not_resumbl_sess_cb #ifdef __cplusplus extern "C" #endif char SSL_CTX_set_not_resumbl_sess_cb (); #if defined __stub_SSL_CTX_set_not_resumbl_sess_cb || defined __stub___SSL_CTX_set_not_resumbl_sess_cb choke me #endif int main (void) { return SSL_CTX_set_not_resumbl_sess_cb (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tst_api="0x110" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ;; *) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define SSL_CTX_set_not_resumable_session_callback innocuous_SSL_CTX_set_not_resumable_session_callback #ifdef __STDC__ # include #else # include #endif #undef SSL_CTX_set_not_resumable_session_callback #ifdef __cplusplus extern "C" #endif char SSL_CTX_set_not_resumable_session_callback (); #if defined __stub_SSL_CTX_set_not_resumable_session_callback || defined __stub___SSL_CTX_set_not_resumable_session_callback choke me #endif int main (void) { return SSL_CTX_set_not_resumable_session_callback (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tst_api="0x110" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ;; esac fi if test "$tst_api" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define SSL_renegotiate_abbreviated innocuous_SSL_renegotiate_abbreviated #ifdef __STDC__ # include #else # include #endif #undef SSL_renegotiate_abbreviated #ifdef __cplusplus extern "C" #endif char SSL_renegotiate_abbreviated (); #if defined __stub_SSL_renegotiate_abbreviated || defined __stub___SSL_renegotiate_abbreviated choke me #endif int main (void) { return SSL_renegotiate_abbreviated (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tst_api="0x101" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$tst_api" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define OBJ_add_sigid innocuous_OBJ_add_sigid #ifdef __STDC__ # include #else # include #endif #undef OBJ_add_sigid #ifdef __cplusplus extern "C" #endif char OBJ_add_sigid (); #if defined __stub_OBJ_add_sigid || defined __stub___OBJ_add_sigid choke me #endif int main (void) { return OBJ_add_sigid (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tst_api="0x100" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$tst_api" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define ERR_set_mark innocuous_ERR_set_mark #ifdef __STDC__ # include #else # include #endif #undef ERR_set_mark #ifdef __cplusplus extern "C" #endif char ERR_set_mark (); #if defined __stub_ERR_set_mark || defined __stub___ERR_set_mark choke me #endif int main (void) { return ERR_set_mark (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tst_api="0x098" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$tst_api" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define ERR_peek_last_error innocuous_ERR_peek_last_error #ifdef __STDC__ # include #else # include #endif #undef ERR_peek_last_error #ifdef __cplusplus extern "C" #endif char ERR_peek_last_error (); #if defined __stub_ERR_peek_last_error || defined __stub___ERR_peek_last_error choke me #endif int main (void) { return ERR_peek_last_error (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tst_api="0x097" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$tst_api" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define c2i_ASN1_OBJECT innocuous_c2i_ASN1_OBJECT #ifdef __STDC__ # include #else # include #endif #undef c2i_ASN1_OBJECT #ifdef __cplusplus extern "C" #endif char c2i_ASN1_OBJECT (); #if defined __stub_c2i_ASN1_OBJECT || defined __stub___c2i_ASN1_OBJECT choke me #endif int main (void) { return c2i_ASN1_OBJECT (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tst_api="0x096" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$tst_api" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define SSL_CTX_set_purpose innocuous_SSL_CTX_set_purpose #ifdef __STDC__ # include #else # include #endif #undef SSL_CTX_set_purpose #ifdef __cplusplus extern "C" #endif char SSL_CTX_set_purpose (); #if defined __stub_SSL_CTX_set_purpose || defined __stub___SSL_CTX_set_purpose choke me #endif int main (void) { return SSL_CTX_set_purpose (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tst_api="0x095" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$tst_api" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define OBJ_obj2txt innocuous_OBJ_obj2txt #ifdef __STDC__ # include #else # include #endif #undef OBJ_obj2txt #ifdef __cplusplus extern "C" #endif char OBJ_obj2txt (); #if defined __stub_OBJ_obj2txt || defined __stub___OBJ_obj2txt choke me #endif int main (void) { return OBJ_obj2txt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tst_api="0x094" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$tst_api" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define SSL_get_verify_depth innocuous_SSL_get_verify_depth #ifdef __STDC__ # include #else # include #endif #undef SSL_get_verify_depth #ifdef __cplusplus extern "C" #endif char SSL_get_verify_depth (); #if defined __stub_SSL_get_verify_depth || defined __stub___SSL_get_verify_depth choke me #endif int main (void) { return SSL_get_verify_depth (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tst_api="0x093" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$tst_api" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define SSL_library_init innocuous_SSL_library_init #ifdef __STDC__ # include #else # include #endif #undef SSL_library_init #ifdef __cplusplus extern "C" #endif char SSL_library_init (); #if defined __stub_SSL_library_init || defined __stub___SSL_library_init choke me #endif int main (void) { return SSL_library_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tst_api="0x092" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$tst_api" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define SSL_CTX_set_cipher_list innocuous_SSL_CTX_set_cipher_list #ifdef __STDC__ # include #else # include #endif #undef SSL_CTX_set_cipher_list #ifdef __cplusplus extern "C" #endif char SSL_CTX_set_cipher_list (); #if defined __stub_SSL_CTX_set_cipher_list || defined __stub___SSL_CTX_set_cipher_list choke me #endif int main (void) { return SSL_CTX_set_cipher_list (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : tst_api="0x091" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi case $tst_api in 0x110) tst_show="1.1.0" ;; 0x101) tst_show="1.0.1" ;; 0x100) tst_show="1.0.0" ;; 0x099) tst_show="0.9.9" ;; 0x098) tst_show="0.9.8" ;; 0x097) tst_show="0.9.7" ;; 0x096) tst_show="0.9.6" ;; 0x095) tst_show="0.9.5" ;; 0x094) tst_show="0.9.4" ;; 0x093) tst_show="0.9.3" ;; 0x092) tst_show="0.9.2" ;; 0x091) tst_show="0.9.1" ;; *) tst_show="unknown" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_show" >&5 $as_echo "$tst_show" >&6; } # curl_openssl_api_library=$tst_api # tst_match="yes" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL headers and library versions matching" >&5 $as_echo_n "checking for OpenSSL headers and library versions matching... " >&6; } if test "$curl_openssl_api_headers" = "unknown" || test "$curl_openssl_api_library" = "unknown"; then tst_match="fail" tst_warns="Can not compare OpenSSL headers and library versions." elif test "$curl_openssl_api_headers" != "$curl_openssl_api_library"; then tst_match="no" tst_warns="OpenSSL headers and library versions do not match." fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_match" >&5 $as_echo "$tst_match" >&6; } if test "$tst_match" != "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $tst_warns" >&5 $as_echo "$as_me: WARNING: $tst_warns" >&2;} fi fi fi if test X"$OPENSSL_ENABLED" = X"1"; then # Check whether --with-egd-socket was given. if test "${with_egd_socket+set}" = set; then : withval=$with_egd_socket; EGD_SOCKET="$withval" fi if test -n "$EGD_SOCKET" ; then cat >>confdefs.h <<_ACEOF #define EGD_SOCKET "$EGD_SOCKET" _ACEOF fi # Check whether --with-random was given. if test "${with_random+set}" = set; then : withval=$with_random; RANDOM_FILE="$withval" else if test x$cross_compiling != xyes; then as_ac_File=`$as_echo "ac_cv_file_"/dev/urandom"" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for \"/dev/urandom\"" >&5 $as_echo_n "checking for \"/dev/urandom\"... " >&6; } if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r ""/dev/urandom""; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi eval ac_res=\$$as_ac_File { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes"; then : RANDOM_FILE="/dev/urandom" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: skipped the /dev/urandom detection when cross-compiling" >&5 $as_echo "$as_me: WARNING: skipped the /dev/urandom detection when cross-compiling" >&2;} fi fi if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then cat >>confdefs.h <<_ACEOF #define RANDOM_FILE "$RANDOM_FILE" _ACEOF fi fi if test "$OPENSSL_ENABLED" = "1"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SRP_Calc_client_key in -lcrypto" >&5 $as_echo_n "checking for SRP_Calc_client_key in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_SRP_Calc_client_key+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char SRP_Calc_client_key (); int main (void) { return SRP_Calc_client_key (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_SRP_Calc_client_key=yes else ac_cv_lib_crypto_SRP_Calc_client_key=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SRP_Calc_client_key" >&5 $as_echo "$ac_cv_lib_crypto_SRP_Calc_client_key" >&6; } if test "x$ac_cv_lib_crypto_SRP_Calc_client_key" = xyes; then : $as_echo "#define HAVE_SSLEAY_SRP 1" >>confdefs.h HAVE_SSLEAY_SRP=1 fi fi OPT_GNUTLS=no # Check whether --with-gnutls was given. if test "${with_gnutls+set}" = set; then : withval=$with_gnutls; OPT_GNUTLS=$withval fi if test "$curl_ssl_msg" = "$init_ssl_msg"; then if test X"$OPT_GNUTLS" != Xno; then addld="" addlib="" gtlslib="" version="" addcflags="" if test "x$OPT_GNUTLS" = "xyes"; then PKGCONFIG="no" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 $as_echo "$PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 $as_echo "$ac_pt_PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then PKGCONFIG="no" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG fi else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi if test x$PKGCONFIG != xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls options with pkg-config" >&5 $as_echo_n "checking for gnutls options with pkg-config... " >&6; } itexists=` if test -n ""; then PKG_CONFIG_LIBDIR="" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --exists gnutls >/dev/null 2>&1 && echo 1` if test -z "$itexists"; then PKGCONFIG="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } fi fi if test "$PKGCONFIG" != "no" ; then addlib=`$PKGCONFIG --libs-only-l gnutls` addld=`$PKGCONFIG --libs-only-L gnutls` addcflags=`$PKGCONFIG --cflags-only-I gnutls` version=`$PKGCONFIG --modversion gnutls` gtlslib=`echo $addld | $SED -e 's/-L//'` else check=`libgnutls-config --version 2>/dev/null` if test -n "$check"; then addlib=`libgnutls-config --libs` addcflags=`libgnutls-config --cflags` version=`libgnutls-config --version` gtlslib=`libgnutls-config --prefix`/lib$libsuff fi fi else cfg=$OPT_GNUTLS/bin/libgnutls-config check=`$cfg --version 2>/dev/null` if test -n "$check"; then addlib=`$cfg --libs` addcflags=`$cfg --cflags` version=`$cfg --version` gtlslib=`$cfg --prefix`/lib$libsuff else addlib=-lgnutls addld=-L$OPT_GNUTLS/lib$libsuff addcflags=-I$OPT_GNUTLS/include version="" # we just don't know gtlslib=$OPT_GNUTLS/lib$libsuff fi fi if test -z "$version"; then version="unknown" fi if test -n "$addlib"; then CLEANLIBS="$LIBS" CLEANCPPFLAGS="$CPPFLAGS" CLEANLDFLAGS="$LDFLAGS" LIBS="$addlib $LIBS" LDFLAGS="$LDFLAGS $addld" if test "$addcflags" != "-I/usr/include"; then CPPFLAGS="$CPPFLAGS $addcflags" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls_check_version in -lgnutls" >&5 $as_echo_n "checking for gnutls_check_version in -lgnutls... " >&6; } if ${ac_cv_lib_gnutls_gnutls_check_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgnutls $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char gnutls_check_version (); int main (void) { return gnutls_check_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gnutls_gnutls_check_version=yes else ac_cv_lib_gnutls_gnutls_check_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gnutls_check_version" >&5 $as_echo "$ac_cv_lib_gnutls_gnutls_check_version" >&6; } if test "x$ac_cv_lib_gnutls_gnutls_check_version" = xyes; then : $as_echo "#define USE_GNUTLS 1" >>confdefs.h USE_GNUTLS=1 GNUTLS_ENABLED=1 USE_GNUTLS="yes" curl_ssl_msg="enabled (GnuTLS)" else LIBS="$CLEANLIBS" CPPFLAGS="$CLEANCPPFLAGS" fi if test "x$USE_GNUTLS" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: detected GnuTLS version $version" >&5 $as_echo "$as_me: detected GnuTLS version $version" >&6;} if test -n "$gtlslib"; then if test "x$cross_compiling" != "xyes"; then LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib" export LD_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: Added $gtlslib to LD_LIBRARY_PATH" >&5 $as_echo "$as_me: Added $gtlslib to LD_LIBRARY_PATH" >&6;} fi fi fi fi fi fi if test "$GNUTLS_ENABLED" = "1"; then USE_GNUTLS_NETTLE= # First check if we can detect either crypto library via transitive linking { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_MD5Init in -lgnutls" >&5 $as_echo_n "checking for nettle_MD5Init in -lgnutls... " >&6; } if ${ac_cv_lib_gnutls_nettle_MD5Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgnutls $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char nettle_MD5Init (); int main (void) { return nettle_MD5Init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gnutls_nettle_MD5Init=yes else ac_cv_lib_gnutls_nettle_MD5Init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_nettle_MD5Init" >&5 $as_echo "$ac_cv_lib_gnutls_nettle_MD5Init" >&6; } if test "x$ac_cv_lib_gnutls_nettle_MD5Init" = xyes; then : USE_GNUTLS_NETTLE=1 fi if test "$USE_GNUTLS_NETTLE" = ""; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_control in -lgnutls" >&5 $as_echo_n "checking for gcry_control in -lgnutls... " >&6; } if ${ac_cv_lib_gnutls_gcry_control+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgnutls $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char gcry_control (); int main (void) { return gcry_control (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gnutls_gcry_control=yes else ac_cv_lib_gnutls_gcry_control=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gcry_control" >&5 $as_echo "$ac_cv_lib_gnutls_gcry_control" >&6; } if test "x$ac_cv_lib_gnutls_gcry_control" = xyes; then : USE_GNUTLS_NETTLE=0 fi fi # If not, try linking directly to both of them to see if they are available if test "$USE_GNUTLS_NETTLE" = ""; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_MD5Init in -lnettle" >&5 $as_echo_n "checking for nettle_MD5Init in -lnettle... " >&6; } if ${ac_cv_lib_nettle_nettle_MD5Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnettle $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char nettle_MD5Init (); int main (void) { return nettle_MD5Init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nettle_nettle_MD5Init=yes else ac_cv_lib_nettle_nettle_MD5Init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_MD5Init" >&5 $as_echo "$ac_cv_lib_nettle_nettle_MD5Init" >&6; } if test "x$ac_cv_lib_nettle_nettle_MD5Init" = xyes; then : USE_GNUTLS_NETTLE=1 fi fi if test "$USE_GNUTLS_NETTLE" = ""; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_control in -lgcrypt" >&5 $as_echo_n "checking for gcry_control in -lgcrypt... " >&6; } if ${ac_cv_lib_gcrypt_gcry_control+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgcrypt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char gcry_control (); int main (void) { return gcry_control (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gcrypt_gcry_control=yes else ac_cv_lib_gcrypt_gcry_control=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_control" >&5 $as_echo "$ac_cv_lib_gcrypt_gcry_control" >&6; } if test "x$ac_cv_lib_gcrypt_gcry_control" = xyes; then : USE_GNUTLS_NETTLE=0 fi fi if test "$USE_GNUTLS_NETTLE" = ""; then as_fn_error $? "GnuTLS found, but neither gcrypt nor nettle found" "$LINENO" 5 fi if test "$USE_GNUTLS_NETTLE" = "1"; then $as_echo "#define USE_GNUTLS_NETTLE 1" >>confdefs.h USE_GNUTLS_NETTLE=1 LIBS="-lnettle $LIBS" else LIBS="-lgcrypt $LIBS" fi fi if test "$GNUTLS_ENABLED" = "1"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls_srp_verifier in -lgnutls" >&5 $as_echo_n "checking for gnutls_srp_verifier in -lgnutls... " >&6; } if ${ac_cv_lib_gnutls_gnutls_srp_verifier+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgnutls $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char gnutls_srp_verifier (); int main (void) { return gnutls_srp_verifier (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gnutls_gnutls_srp_verifier=yes else ac_cv_lib_gnutls_gnutls_srp_verifier=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gnutls_srp_verifier" >&5 $as_echo "$ac_cv_lib_gnutls_gnutls_srp_verifier" >&6; } if test "x$ac_cv_lib_gnutls_gnutls_srp_verifier" = xyes; then : $as_echo "#define HAVE_GNUTLS_SRP 1" >>confdefs.h HAVE_GNUTLS_SRP=1 fi fi OPT_POLARSSL=no _cppflags=$CPPFLAGS _ldflags=$LDFLAGS # Check whether --with-polarssl was given. if test "${with_polarssl+set}" = set; then : withval=$with_polarssl; OPT_POLARSSL=$withval fi if test "$curl_ssl_msg" = "$init_ssl_msg"; then if test X"$OPT_POLARSSL" != Xno; then if test "$OPT_POLARSSL" = "yes"; then OPT_POLARSSL="" fi if test -z "$OPT_POLARSSL" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for havege_init in -lpolarssl" >&5 $as_echo_n "checking for havege_init in -lpolarssl... " >&6; } if ${ac_cv_lib_polarssl_havege_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpolarssl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char havege_init (); int main (void) { return havege_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_polarssl_havege_init=yes else ac_cv_lib_polarssl_havege_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_polarssl_havege_init" >&5 $as_echo "$ac_cv_lib_polarssl_havege_init" >&6; } if test "x$ac_cv_lib_polarssl_havege_init" = xyes; then : $as_echo "#define USE_POLARSSL 1" >>confdefs.h USE_POLARSSL=1 POLARSSL_ENABLED=1 USE_POLARSSL="yes" curl_ssl_msg="enabled (PolarSSL)" fi fi addld="" addlib="" addcflags="" polarssllib="" if test "x$USE_POLARSSL" != "xyes"; then addld=-L$OPT_POLARSSL/lib$libsuff addcflags=-I$OPT_POLARSSL/include polarssllib=$OPT_POLARSSL/lib$libsuff LDFLAGS="$LDFLAGS $addld" if test "$addcflags" != "-I/usr/include"; then CPPFLAGS="$CPPFLAGS $addcflags" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssl_init in -lpolarssl" >&5 $as_echo_n "checking for ssl_init in -lpolarssl... " >&6; } if ${ac_cv_lib_polarssl_ssl_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpolarssl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char ssl_init (); int main (void) { return ssl_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_polarssl_ssl_init=yes else ac_cv_lib_polarssl_ssl_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_polarssl_ssl_init" >&5 $as_echo "$ac_cv_lib_polarssl_ssl_init" >&6; } if test "x$ac_cv_lib_polarssl_ssl_init" = xyes; then : $as_echo "#define USE_POLARSSL 1" >>confdefs.h USE_POLARSSL=1 POLARSSL_ENABLED=1 USE_POLARSSL="yes" curl_ssl_msg="enabled (PolarSSL)" else CPPFLAGS=$_cppflags LDFLAGS=$_ldflags fi fi if test "x$USE_POLARSSL" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: detected PolarSSL" >&5 $as_echo "$as_me: detected PolarSSL" >&6;} LIBS="-lpolarssl $LIBS" if test -n "$polarssllib"; then if test "x$cross_compiling" != "xyes"; then LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib" export LD_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: Added $polarssllib to LD_LIBRARY_PATH" >&5 $as_echo "$as_me: Added $polarssllib to LD_LIBRARY_PATH" >&6;} fi fi fi fi fi OPT_CYASSL=no _cppflags=$CPPFLAGS _ldflags=$LDFLAGS # Check whether --with-cyassl was given. if test "${with_cyassl+set}" = set; then : withval=$with_cyassl; OPT_CYASSL=$withval fi if test "$curl_ssl_msg" = "$init_ssl_msg"; then if test X"$OPT_CYASSL" != Xno; then if test "$OPT_CYASSL" = "yes"; then OPT_CYASSL="" fi if test -z "$OPT_CYASSL" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CyaSSL_Init in -lcyassl" >&5 $as_echo_n "checking for CyaSSL_Init in -lcyassl... " >&6; } if ${ac_cv_lib_cyassl_CyaSSL_Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcyassl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char CyaSSL_Init (); int main (void) { return CyaSSL_Init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cyassl_CyaSSL_Init=yes else ac_cv_lib_cyassl_CyaSSL_Init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cyassl_CyaSSL_Init" >&5 $as_echo "$ac_cv_lib_cyassl_CyaSSL_Init" >&6; } if test "x$ac_cv_lib_cyassl_CyaSSL_Init" = xyes; then : $as_echo "#define USE_CYASSL 1" >>confdefs.h USE_CYASSL=1 CYASSL_ENABLED=1 USE_CYASSL="yes" curl_ssl_msg="enabled (CyaSSL)" fi fi addld="" addlib="" addcflags="" cyassllib="" if test "x$USE_CYASSL" != "xyes"; then addld=-L$OPT_CYASSL/lib$libsuff addcflags=-I$OPT_CYASSL/include cyassllib=$OPT_CYASSL/lib$libsuff LDFLAGS="$LDFLAGS $addld" if test "$addcflags" != "-I/usr/include"; then CPPFLAGS="$CPPFLAGS $addcflags" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CyaSSL_Init in -lcyassl" >&5 $as_echo_n "checking for CyaSSL_Init in -lcyassl... " >&6; } if ${ac_cv_lib_cyassl_CyaSSL_Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcyassl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char CyaSSL_Init (); int main (void) { return CyaSSL_Init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cyassl_CyaSSL_Init=yes else ac_cv_lib_cyassl_CyaSSL_Init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cyassl_CyaSSL_Init" >&5 $as_echo "$ac_cv_lib_cyassl_CyaSSL_Init" >&6; } if test "x$ac_cv_lib_cyassl_CyaSSL_Init" = xyes; then : $as_echo "#define USE_CYASSL 1" >>confdefs.h USE_CYASSL=1 CYASSL_ENABLED=1 USE_CYASSL="yes" curl_ssl_msg="enabled (CyaSSL)" else CPPFLAGS=$_cppflags LDFLAGS=$_ldflags fi fi if test "x$USE_CYASSL" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: detected CyaSSL" >&5 $as_echo "$as_me: detected CyaSSL" >&6;} # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 $as_echo_n "checking size of long long... " >&6; } if ${ac_cv_sizeof_long_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 $as_echo "$ac_cv_sizeof_long_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF LIBS="-lcyassl -lm $LIBS" if test -n "$cyassllib"; then if test "x$cross_compiling" != "xyes"; then LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$cyassllib" export LD_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: Added $cyassllib to LD_LIBRARY_PATH" >&5 $as_echo "$as_me: Added $cyassllib to LD_LIBRARY_PATH" >&6;} fi fi fi fi fi OPT_NSS=no # Check whether --with-nss was given. if test "${with_nss+set}" = set; then : withval=$with_nss; OPT_NSS=$withval fi if test "$curl_ssl_msg" = "$init_ssl_msg"; then if test X"$OPT_NSS" != Xno; then addld="" addlib="" addcflags="" nssprefix="" version="" if test "x$OPT_NSS" = "xyes"; then PKGCONFIG="no" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 $as_echo "$PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 $as_echo "$ac_pt_PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then PKGCONFIG="no" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG fi else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi if test x$PKGCONFIG != xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nss options with pkg-config" >&5 $as_echo_n "checking for nss options with pkg-config... " >&6; } itexists=` if test -n ""; then PKG_CONFIG_LIBDIR="" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --exists nss >/dev/null 2>&1 && echo 1` if test -z "$itexists"; then PKGCONFIG="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } fi fi if test "$PKGCONFIG" != "no" ; then addlib=`$PKGCONFIG --libs nss` addcflags=`$PKGCONFIG --cflags nss` version=`$PKGCONFIG --modversion nss` nssprefix=`$PKGCONFIG --variable=prefix nss` else check=`nss-config --version 2>/dev/null` if test -n "$check"; then addlib=`nss-config --libs` addcflags=`nss-config --cflags` version=`nss-config --version` nssprefix=`nss-config --prefix` else addlib="-lnss3" addcflags="" version="unknown" fi fi else # Without pkg-config, we'll kludge in some defaults addlib="-L$OPT_NSS/lib -lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl" addcflags="-I$OPT_NSS/include" version="unknown" nssprefix=$OPT_NSS fi if test -n "$addlib"; then CLEANLIBS="$LIBS" CLEANCPPFLAGS="$CPPFLAGS" LIBS="$addlib $LIBS" if test "$addcflags" != "-I/usr/include"; then CPPFLAGS="$CPPFLAGS $addcflags" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_VersionRangeSet in -lnss3" >&5 $as_echo_n "checking for SSL_VersionRangeSet in -lnss3... " >&6; } if ${ac_cv_lib_nss3_SSL_VersionRangeSet+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnss3 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char SSL_VersionRangeSet (); int main (void) { return SSL_VersionRangeSet (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nss3_SSL_VersionRangeSet=yes else ac_cv_lib_nss3_SSL_VersionRangeSet=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nss3_SSL_VersionRangeSet" >&5 $as_echo "$ac_cv_lib_nss3_SSL_VersionRangeSet" >&6; } if test "x$ac_cv_lib_nss3_SSL_VersionRangeSet" = xyes; then : $as_echo "#define USE_NSS 1" >>confdefs.h USE_NSS=1 USE_NSS="yes" NSS_ENABLED=1 curl_ssl_msg="enabled (NSS)" else LIBS="$CLEANLIBS" CPPFLAGS="$CLEANCPPFLAGS" fi if test "x$USE_NSS" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: detected NSS version $version" >&5 $as_echo "$as_me: detected NSS version $version" >&6;} if test "x$cross_compiling" != "xyes"; then LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff" export LD_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH" >&5 $as_echo "$as_me: Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH" >&6;} fi fi fi fi fi OPT_AXTLS=off # Check whether --with-axtls was given. if test "${with_axtls+set}" = set; then : withval=$with_axtls; OPT_AXTLS=$withval fi if test "$curl_ssl_msg" = "$init_ssl_msg"; then if test X"$OPT_AXTLS" != Xno; then CLEANLDFLAGS="$LDFLAGS" CLEANCPPFLAGS="$CPPFLAGS" CLEANLIBS="$LIBS" case "$OPT_AXTLS" in yes) PREFIX_AXTLS=/usr/local LIB_AXTLS="$PREFIX_AXTLS/lib" LDFLAGS="$LDFLAGS -L$LIB_AXTLS" CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include" ;; off) PREFIX_AXTLS= ;; *) PREFIX_AXTLS=$OPT_AXTLS LIB_AXTLS="$PREFIX_AXTLS/lib" LDFLAGS="$LDFLAGS -L$LIB_AXTLS" CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssl_version in -laxtls" >&5 $as_echo_n "checking for ssl_version in -laxtls... " >&6; } if ${ac_cv_lib_axtls_ssl_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-laxtls $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char ssl_version (); int main (void) { return ssl_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_axtls_ssl_version=yes else ac_cv_lib_axtls_ssl_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_axtls_ssl_version" >&5 $as_echo "$ac_cv_lib_axtls_ssl_version" >&6; } if test "x$ac_cv_lib_axtls_ssl_version" = xyes; then : LIBS="-laxtls $LIBS" $as_echo "#define USE_AXTLS 1" >>confdefs.h USE_AXTLS=1 AXTLS_ENABLED=1 USE_AXTLS="yes" curl_ssl_msg="enabled (axTLS)" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_AXTLS" export LD_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: Added $LIB_AXTLS to LD_LIBRARY_PATH" >&5 $as_echo "$as_me: Added $LIB_AXTLS to LD_LIBRARY_PATH" >&6;} else LDFLAGS="$CLEANLDFLAGS" CPPFLAGS="$CLEANCPPFLAGS" LIBS="$CLEANLIBS" fi fi fi if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED$DARWINSSL_ENABLED" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more." >&5 $as_echo "$as_me: WARNING: SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, or --with-darwinssl to address this." >&5 $as_echo "$as_me: WARNING: Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, or --with-darwinssl to address this." >&2;} else # SSL is enabled, genericly SSL_ENABLED="1" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking default CA cert bundle/path" >&5 $as_echo_n "checking default CA cert bundle/path... " >&6; } # Check whether --with-ca-bundle was given. if test "${with_ca_bundle+set}" = set; then : withval=$with_ca_bundle; want_ca="$withval" if test "x$want_ca" = "xyes"; then as_fn_error $? "--with-ca-bundle=FILE requires a path to the CA bundle" "$LINENO" 5 fi else want_ca="unset" fi # Check whether --with-ca-path was given. if test "${with_ca_path+set}" = set; then : withval=$with_ca_path; want_capath="$withval" if test "x$want_capath" = "xyes"; then as_fn_error $? "--with-ca-path=DIRECTORY requires a path to the CA path directory" "$LINENO" 5 fi else want_capath="unset" fi if test "x$want_ca" != "xno" -a "x$want_ca" != "xunset" -a \ "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then as_fn_error $? "Can't specify both --with-ca-bundle and --with-ca-path." "$LINENO" 5 elif test "x$want_ca" != "xno" -a "x$want_ca" != "xunset"; then ca="$want_ca" capath="no" elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then if test "x$OPENSSL_ENABLED" != "x1"; then as_fn_error $? "--with-ca-path only works with openSSL" "$LINENO" 5 fi capath="$want_capath" ca="no" else ca="no" capath="no" if test "x$cross_compiling" != "xyes"; then if test "x$want_ca" = "xunset"; then if test "x$prefix" != xNONE; then cac="${prefix}/share/curl/curl-ca-bundle.crt" else cac="$ac_default_prefix/share/curl/curl-ca-bundle.crt" fi for a in /etc/ssl/certs/ca-certificates.crt \ /etc/pki/tls/certs/ca-bundle.crt \ /usr/share/ssl/certs/ca-bundle.crt \ /usr/local/share/certs/ca-root.crt \ /etc/ssl/cert.pem \ "$cac"; do if test -f "$a"; then ca="$a" break fi done fi if test "x$want_capath" = "xunset" -a "x$ca" = "xno" -a \ "x$OPENSSL_ENABLED" = "x1"; then for a in /etc/ssl/certs/; do if test -d "$a" && ls "$a"/[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].0 >/dev/null 2>/dev/null; then capath="$a" break fi done fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: skipped the ca-cert path detection when cross-compiling" >&5 $as_echo "$as_me: WARNING: skipped the ca-cert path detection when cross-compiling" >&2;} fi fi if test "x$ca" != "xno"; then CURL_CA_BUNDLE='"'$ca'"' cat >>confdefs.h <<_ACEOF #define CURL_CA_BUNDLE "$ca" _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ca" >&5 $as_echo "$ca" >&6; } elif test "x$capath" != "xno"; then CURL_CA_PATH="\"$capath\"" cat >>confdefs.h <<_ACEOF #define CURL_CA_PATH "$capath" _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $capath (capath)" >&5 $as_echo "$capath (capath)" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi OPT_LIBMETALINK=no # Check whether --with-libmetalink was given. if test "${with_libmetalink+set}" = set; then : withval=$with_libmetalink; OPT_LIBMETALINK=$withval fi if test X"$OPT_LIBMETALINK" != Xno; then addld="" addlib="" addcflags="" version="" libmetalinklib="" PKGTEST="no" if test "x$OPT_LIBMETALINK" = "xyes"; then PKGTEST="yes" PKGCONFIG="no" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 $as_echo "$PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 $as_echo "$ac_pt_PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then PKGCONFIG="no" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG fi else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi if test x$PKGCONFIG != xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmetalink options with pkg-config" >&5 $as_echo_n "checking for libmetalink options with pkg-config... " >&6; } itexists=` if test -n ""; then PKG_CONFIG_LIBDIR="" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --exists libmetalink >/dev/null 2>&1 && echo 1` if test -z "$itexists"; then PKGCONFIG="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } fi fi else LIBMETALINK_PCDIR="$OPT_LIBMETALINK/lib/pkgconfig" { $as_echo "$as_me:${as_lineno-$LINENO}: PKG_CONFIG_LIBDIR will be set to \"$LIBMETALINK_PCDIR\"" >&5 $as_echo "$as_me: PKG_CONFIG_LIBDIR will be set to \"$LIBMETALINK_PCDIR\"" >&6;} if test -f "$LIBMETALINK_PCDIR/libmetalink.pc"; then PKGTEST="yes" fi if test "$PKGTEST" = "yes"; then PKGCONFIG="no" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 $as_echo "$PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 $as_echo "$ac_pt_PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then PKGCONFIG="no" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG fi else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi if test x$PKGCONFIG != xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmetalink options with pkg-config" >&5 $as_echo_n "checking for libmetalink options with pkg-config... " >&6; } itexists=` if test -n "$LIBMETALINK_PCDIR"; then PKG_CONFIG_LIBDIR="$LIBMETALINK_PCDIR" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --exists libmetalink >/dev/null 2>&1 && echo 1` if test -z "$itexists"; then PKGCONFIG="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } fi fi fi fi if test "$PKGTEST" = "yes" && test "$PKGCONFIG" != "no"; then addlib=` if test -n "$LIBMETALINK_PCDIR"; then PKG_CONFIG_LIBDIR="$LIBMETALINK_PCDIR" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --libs-only-l libmetalink` addld=` if test -n "$LIBMETALINK_PCDIR"; then PKG_CONFIG_LIBDIR="$LIBMETALINK_PCDIR" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --libs-only-L libmetalink` addcflags=` if test -n "$LIBMETALINK_PCDIR"; then PKG_CONFIG_LIBDIR="$LIBMETALINK_PCDIR" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --cflags-only-I libmetalink` version=` if test -n "$LIBMETALINK_PCDIR"; then PKG_CONFIG_LIBDIR="$LIBMETALINK_PCDIR" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --modversion libmetalink` libmetalinklib=`echo $addld | $SED -e 's/-L//'` fi if test -n "$addlib"; then clean_CPPFLAGS="$CPPFLAGS" clean_LDFLAGS="$LDFLAGS" clean_LIBS="$LIBS" CPPFLAGS="$addcflags $clean_CPPFLAGS" LDFLAGS="$addld $clean_LDFLAGS" LIBS="$addlib $clean_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libmetalink is recent enough" >&5 $as_echo_n "checking if libmetalink is recent enough... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include int main (void) { if(0 != metalink_strerror(0)) /* added in 0.1.0 */ return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($version)" >&5 $as_echo "yes ($version)" >&6; } want_metalink="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no ($version)" >&5 $as_echo "no ($version)" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: libmetalink library defective or too old" >&5 $as_echo "$as_me: libmetalink library defective or too old" >&6;} want_metalink="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$clean_CPPFLAGS" LDFLAGS="$clean_LDFLAGS" LIBS="$clean_LIBS" if test "$want_metalink" = "yes"; then $as_echo "#define USE_METALINK 1" >>confdefs.h LIBMETALINK_LIBS=$addlib LIBMETALINK_LDFLAGS=$addld LIBMETALINK_CPPFLAGS=$addcflags curl_mtlnk_msg="enabled" fi fi fi OPT_LIBSSH2=off # Check whether --with-libssh2 was given. if test "${with_libssh2+set}" = set; then : withval=$with_libssh2; OPT_LIBSSH2=$withval fi if test X"$OPT_LIBSSH2" != Xno; then CLEANLDFLAGS="$LDFLAGS" CLEANCPPFLAGS="$CPPFLAGS" CLEANLIBS="$LIBS" case "$OPT_LIBSSH2" in yes) PKGCONFIG="no" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 $as_echo "$PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 $as_echo "$ac_pt_PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then PKGCONFIG="no" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG fi else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi if test x$PKGCONFIG != xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libssh2 options with pkg-config" >&5 $as_echo_n "checking for libssh2 options with pkg-config... " >&6; } itexists=` if test -n ""; then PKG_CONFIG_LIBDIR="" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --exists libssh2 >/dev/null 2>&1 && echo 1` if test -z "$itexists"; then PKGCONFIG="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } fi fi if test "$PKGCONFIG" != "no" ; then LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2` LD_SSH2=`$PKGCONFIG --libs-only-L libssh2` CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2` version=`$PKGCONFIG --modversion libssh2` DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'` fi ;; off) ;; *) PREFIX_SSH2=$OPT_LIBSSH2 ;; esac if test -n "$PREFIX_SSH2"; then LIB_SSH2="-lssh2" LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff CPP_SSH2=-I${PREFIX_SSH2}/include DIR_SSH2=${PREFIX_SSH2}/lib$libsuff fi LDFLAGS="$LDFLAGS $LD_SSH2" CPPFLAGS="$CPPFLAGS $CPP_SSH2" LIBS="$LIB_SSH2 $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libssh2_channel_open_ex in -lssh2" >&5 $as_echo_n "checking for libssh2_channel_open_ex in -lssh2... " >&6; } if ${ac_cv_lib_ssh2_libssh2_channel_open_ex+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lssh2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char libssh2_channel_open_ex (); int main (void) { return libssh2_channel_open_ex (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ssh2_libssh2_channel_open_ex=yes else ac_cv_lib_ssh2_libssh2_channel_open_ex=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssh2_libssh2_channel_open_ex" >&5 $as_echo "$ac_cv_lib_ssh2_libssh2_channel_open_ex" >&6; } if test "x$ac_cv_lib_ssh2_libssh2_channel_open_ex" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSSH2 1 _ACEOF LIBS="-lssh2 $LIBS" fi for ac_header in libssh2.h do : ac_fn_c_check_header_mongrel "$LINENO" "libssh2.h" "ac_cv_header_libssh2_h" "$ac_includes_default" if test "x$ac_cv_header_libssh2_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSSH2_H 1 _ACEOF curl_ssh_msg="enabled (libSSH2)" LIBSSH2_ENABLED=1 $as_echo "#define USE_LIBSSH2 1" >>confdefs.h USE_LIBSSH2=1 fi done if test X"$OPT_LIBSSH2" != Xoff && test "$LIBSSH2_ENABLED" != "1"; then as_fn_error $? "libSSH2 libs and/or directories were not found where specified!" "$LINENO" 5 fi if test "$LIBSSH2_ENABLED" = "1"; then if test -n "$DIR_SSH2"; then for ac_func in libssh2_version libssh2_init libssh2_exit \ libssh2_scp_send64 libssh2_session_handshake do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$cross_compiling" != "xyes"; then LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2" export LD_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: Added $DIR_SSH2 to LD_LIBRARY_PATH" >&5 $as_echo "$as_me: Added $DIR_SSH2 to LD_LIBRARY_PATH" >&6;} fi fi else LDFLAGS=$CLEANLDFLAGS CPPFLAGS=$CLEANCPPFLAGS LIBS=$CLEANLIBS fi fi OPT_LIBRTMP=off # Check whether --with-librtmp was given. if test "${with_librtmp+set}" = set; then : withval=$with_librtmp; OPT_LIBRTMP=$withval fi if test X"$OPT_LIBRTMP" != Xno; then CLEANLDFLAGS="$LDFLAGS" CLEANCPPFLAGS="$CPPFLAGS" CLEANLIBS="$LIBS" case "$OPT_LIBRTMP" in yes) PKGCONFIG="no" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 $as_echo "$PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 $as_echo "$ac_pt_PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then PKGCONFIG="no" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG fi else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi if test x$PKGCONFIG != xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for librtmp options with pkg-config" >&5 $as_echo_n "checking for librtmp options with pkg-config... " >&6; } itexists=` if test -n ""; then PKG_CONFIG_LIBDIR="" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --exists librtmp >/dev/null 2>&1 && echo 1` if test -z "$itexists"; then PKGCONFIG="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } fi fi if test "$PKGCONFIG" != "no" ; then LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp` LD_RTMP=`$PKGCONFIG --libs-only-L librtmp` CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp` version=`$PKGCONFIG --modversion librtmp` DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'` else as_fn_error $? "--librtmp was specified but could not find librtmp pkgconfig file." "$LINENO" 5 fi ;; off) LIB_RTMP="-lrtmp" ;; *) PREFIX_RTMP=$OPT_LIBRTMP ;; esac if test -n "$PREFIX_RTMP"; then LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff CPP_RTMP=-I${PREFIX_RTMP}/include DIR_RTMP=${PREFIX_RTMP}/lib$libsuff fi LDFLAGS="$LDFLAGS $LD_RTMP" CPPFLAGS="$CPPFLAGS $CPP_RTMP" LIBS="$LIB_RTMP $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RTMP_Init in -lrtmp" >&5 $as_echo_n "checking for RTMP_Init in -lrtmp... " >&6; } if ${ac_cv_lib_rtmp_RTMP_Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrtmp $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char RTMP_Init (); int main (void) { return RTMP_Init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rtmp_RTMP_Init=yes else ac_cv_lib_rtmp_RTMP_Init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rtmp_RTMP_Init" >&5 $as_echo "$ac_cv_lib_rtmp_RTMP_Init" >&6; } if test "x$ac_cv_lib_rtmp_RTMP_Init" = xyes; then : for ac_header in librtmp/rtmp.h do : ac_fn_c_check_header_mongrel "$LINENO" "librtmp/rtmp.h" "ac_cv_header_librtmp_rtmp_h" "$ac_includes_default" if test "x$ac_cv_header_librtmp_rtmp_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRTMP_RTMP_H 1 _ACEOF curl_rtmp_msg="enabled (librtmp)" LIBRTMP_ENABLED=1 $as_echo "#define USE_LIBRTMP 1" >>confdefs.h USE_LIBRTMP=1 fi done else LDFLAGS=$CLEANLDFLAGS CPPFLAGS=$CLEANCPPFLAGS LIBS=$CLEANLIBS fi if test X"$OPT_LIBRTMP" != Xoff && test "$LIBRTMP_ENABLED" != "1"; then as_fn_error $? "librtmp libs and/or directories were not found where specified!" "$LINENO" 5 fi fi versioned_symbols_flavour= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether versioned symbols are wanted" >&5 $as_echo_n "checking whether versioned symbols are wanted... " >&6; } # Check whether --enable-versioned-symbols was given. if test "${enable_versioned_symbols+set}" = set; then : enableval=$enable_versioned_symbols; case "$enableval" in yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libraries can be versioned" >&5 $as_echo_n "checking if libraries can be versioned... " >&6; } GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` if test -z "$GLD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You need an ld version supporting the --version-script option" >&5 $as_echo "$as_me: WARNING: You need an ld version supporting the --version-script option" >&2;} else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } if test "x$OPENSSL_ENABLED" = "x1"; then versioned_symbols_flavour="OPENSSL_" elif test "x$GNUTLS_ENABLED" == "x1"; then versioned_symbols_flavour="GNUTLS_" elif test "x$NSS_ENABLED" == "x1"; then versioned_symbols_flavour="NSS_" elif test "x$POLARSSL_ENABLED" == "x1"; then versioned_symbols_flavour="POLARSSL_" elif test "x$CYASSL_ENABLED" == "x1"; then versioned_symbols_flavour="CYASSL_" elif test "x$AXTLS_ENABLED" == "x1"; then versioned_symbols_flavour="AXTLS_" elif test "x$WINSSL_ENABLED" == "x1"; then versioned_symbols_flavour="WINSSL_" elif test "x$DARWINSSL_ENABLED" == "x1"; then versioned_symbols_flavour="DARWINSSL_" else versioned_symbols_flavour="" fi versioned_symbols="yes" fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi CURL_LT_SHLIB_VERSIONED_FLAVOUR="$versioned_symbols_flavour" if test "x$versioned_symbols" = 'xyes'; then CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_TRUE= CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_FALSE='#' else CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_TRUE='#' CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Windows native IDN (Windows native builds only)" >&5 $as_echo_n "checking whether to enable Windows native IDN (Windows native builds only)... " >&6; } OPT_WINIDN="default" # Check whether --with-winidn was given. if test "${with_winidn+set}" = set; then : withval=$with_winidn; OPT_WINIDN=$withval fi case "$OPT_WINIDN" in no|default) want_winidn="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; yes) want_winidn="yes" want_winidn_path="default" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; *) want_winidn="yes" want_winidn_path="$withval" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($withval)" >&5 $as_echo "yes ($withval)" >&6; } ;; esac if test "$want_winidn" = "yes"; then clean_CPPFLAGS="$CPPFLAGS" clean_LDFLAGS="$LDFLAGS" clean_LIBS="$LIBS" WINIDN_LIBS="-lnormaliz" # if test "$want_winidn_path" != "default"; then WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff" WINIDN_CPPFLAGS="-I$want_winidn_path/include" WINIDN_DIR="$want_winidn_path/lib$libsuff" fi # CPPFLAGS="$WINIDN_CPPFLAGS $CPPFLAGS" LDFLAGS="$WINIDN_LDFLAGS $LDFLAGS" LIBS="$WINIDN_LIBS $LIBS" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IdnToUnicode can be linked" >&5 $as_echo_n "checking if IdnToUnicode can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define IdnToUnicode innocuous_IdnToUnicode #ifdef __STDC__ # include #else # include #endif #undef IdnToUnicode #ifdef __cplusplus extern "C" #endif char IdnToUnicode (); #if defined __stub_IdnToUnicode || defined __stub___IdnToUnicode choke me #endif int main (void) { return IdnToUnicode (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_winidn="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_winidn="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_winidn" = "yes"; then $as_echo "#define USE_WIN32_IDN 1" >>confdefs.h $as_echo "#define WANT_IDN_PROTOTYPES 1" >>confdefs.h IDN_ENABLED=1 curl_idn_msg="enabled (Windows-native)" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libraries for IDN support: IDN disabled" >&5 $as_echo "$as_me: WARNING: Cannot find libraries for IDN support: IDN disabled" >&2;} CPPFLAGS="$clean_CPPFLAGS" LDFLAGS="$clean_LDFLAGS" LIBS="$clean_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with libidn" >&5 $as_echo_n "checking whether to build with libidn... " >&6; } OPT_IDN="default" # Check whether --with-libidn was given. if test "${with_libidn+set}" = set; then : withval=$with_libidn; OPT_IDN=$withval fi case "$OPT_IDN" in no) want_idn="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; default) want_idn="yes" want_idn_path="default" { $as_echo "$as_me:${as_lineno-$LINENO}: result: (assumed) yes" >&5 $as_echo "(assumed) yes" >&6; } ;; yes) want_idn="yes" want_idn_path="default" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; *) want_idn="yes" want_idn_path="$withval" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($withval)" >&5 $as_echo "yes ($withval)" >&6; } ;; esac if test "$want_idn" = "yes"; then clean_CPPFLAGS="$CPPFLAGS" clean_LDFLAGS="$LDFLAGS" clean_LIBS="$LIBS" PKGCONFIG="no" # if test "$want_idn_path" != "default"; then IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig" PKGCONFIG="no" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 $as_echo "$PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 $as_echo "$ac_pt_PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then PKGCONFIG="no" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG fi else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi if test x$PKGCONFIG != xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libidn options with pkg-config" >&5 $as_echo_n "checking for libidn options with pkg-config... " >&6; } itexists=` if test -n "$IDN_PCDIR"; then PKG_CONFIG_LIBDIR="$IDN_PCDIR" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --exists libidn >/dev/null 2>&1 && echo 1` if test -z "$itexists"; then PKGCONFIG="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } fi fi if test "$PKGCONFIG" != "no"; then IDN_LIBS=` if test -n "$IDN_PCDIR"; then PKG_CONFIG_LIBDIR="$IDN_PCDIR" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --libs-only-l libidn 2>/dev/null` IDN_LDFLAGS=` if test -n "$IDN_PCDIR"; then PKG_CONFIG_LIBDIR="$IDN_PCDIR" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --libs-only-L libidn 2>/dev/null` IDN_CPPFLAGS=` if test -n "$IDN_PCDIR"; then PKG_CONFIG_LIBDIR="$IDN_PCDIR" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --cflags-only-I libidn 2>/dev/null` IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'` else IDN_LIBS="-lidn" IDN_LDFLAGS="-L$want_idn_path/lib$libsuff" IDN_CPPFLAGS="-I$want_idn_path/include" IDN_DIR="$want_idn_path/lib$libsuff" fi else PKGCONFIG="no" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 $as_echo "$PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 $as_echo "$ac_pt_PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then PKGCONFIG="no" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG fi else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi if test x$PKGCONFIG != xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libidn options with pkg-config" >&5 $as_echo_n "checking for libidn options with pkg-config... " >&6; } itexists=` if test -n ""; then PKG_CONFIG_LIBDIR="" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --exists libidn >/dev/null 2>&1 && echo 1` if test -z "$itexists"; then PKGCONFIG="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } fi fi if test "$PKGCONFIG" != "no"; then IDN_LIBS=`$PKGCONFIG --libs-only-l libidn 2>/dev/null` IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn 2>/dev/null` IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn 2>/dev/null` IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'` else IDN_LIBS="-lidn" fi fi # if test "$PKGCONFIG" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config: IDN_LIBS: \"$IDN_LIBS\"" >&5 $as_echo "$as_me: pkg-config: IDN_LIBS: \"$IDN_LIBS\"" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config: IDN_LDFLAGS: \"$IDN_LDFLAGS\"" >&5 $as_echo "$as_me: pkg-config: IDN_LDFLAGS: \"$IDN_LDFLAGS\"" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config: IDN_CPPFLAGS: \"$IDN_CPPFLAGS\"" >&5 $as_echo "$as_me: pkg-config: IDN_CPPFLAGS: \"$IDN_CPPFLAGS\"" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config: IDN_DIR: \"$IDN_DIR\"" >&5 $as_echo "$as_me: pkg-config: IDN_DIR: \"$IDN_DIR\"" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: IDN_LIBS: \"$IDN_LIBS\"" >&5 $as_echo "$as_me: IDN_LIBS: \"$IDN_LIBS\"" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: IDN_LDFLAGS: \"$IDN_LDFLAGS\"" >&5 $as_echo "$as_me: IDN_LDFLAGS: \"$IDN_LDFLAGS\"" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: IDN_CPPFLAGS: \"$IDN_CPPFLAGS\"" >&5 $as_echo "$as_me: IDN_CPPFLAGS: \"$IDN_CPPFLAGS\"" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: IDN_DIR: \"$IDN_DIR\"" >&5 $as_echo "$as_me: IDN_DIR: \"$IDN_DIR\"" >&6;} fi # CPPFLAGS="$IDN_CPPFLAGS $CPPFLAGS" LDFLAGS="$IDN_LDFLAGS $LDFLAGS" LIBS="$IDN_LIBS $LIBS" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if idna_to_ascii_4i can be linked" >&5 $as_echo_n "checking if idna_to_ascii_4i can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define idna_to_ascii_4i innocuous_idna_to_ascii_4i #ifdef __STDC__ # include #else # include #endif #undef idna_to_ascii_4i #ifdef __cplusplus extern "C" #endif char idna_to_ascii_4i (); #if defined __stub_idna_to_ascii_4i || defined __stub___idna_to_ascii_4i choke me #endif int main (void) { return idna_to_ascii_4i (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_libidn="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_libidn="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$tst_links_libidn" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if idna_to_ascii_lz can be linked" >&5 $as_echo_n "checking if idna_to_ascii_lz can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define idna_to_ascii_lz innocuous_idna_to_ascii_lz #ifdef __STDC__ # include #else # include #endif #undef idna_to_ascii_lz #ifdef __cplusplus extern "C" #endif char idna_to_ascii_lz (); #if defined __stub_idna_to_ascii_lz || defined __stub___idna_to_ascii_lz choke me #endif int main (void) { return idna_to_ascii_lz (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_libidn="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_libidn="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # if test "$tst_links_libidn" = "yes"; then $as_echo "#define HAVE_LIBIDN 1" >>confdefs.h for ac_func in idn_free idna_strerror tld_strerror do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in idn-free.h tld.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_header_tld_h" = "xyes"; then IDN_ENABLED=1 curl_idn_msg="enabled" if test -n "$IDN_DIR"; then LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR" export LD_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: Added $IDN_DIR to LD_LIBRARY_PATH" >&5 $as_echo "$as_me: Added $IDN_DIR to LD_LIBRARY_PATH" >&6;} fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libraries for IDN support too old: IDN disabled" >&5 $as_echo "$as_me: WARNING: Libraries for IDN support too old: IDN disabled" >&2;} CPPFLAGS="$clean_CPPFLAGS" LDFLAGS="$clean_LDFLAGS" LIBS="$clean_LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libraries for IDN support: IDN disabled" >&5 $as_echo "$as_me: WARNING: Cannot find libraries for IDN support: IDN disabled" >&2;} CPPFLAGS="$clean_CPPFLAGS" LDFLAGS="$clean_LDFLAGS" LIBS="$clean_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with nghttp2" >&5 $as_echo_n "checking whether to build with nghttp2... " >&6; } OPT_H2="no" # Check whether --with-nghttp2 was given. if test "${with_nghttp2+set}" = set; then : withval=$with_nghttp2; OPT_H2=$withval fi case "$OPT_H2" in no) want_idn="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; default) want_h2="no" want_h2_path="default" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; yes) want_h2="yes" want_h2_path="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; *) want_h2="yes" want_h2_path="$withval" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($withval)" >&5 $as_echo "yes ($withval)" >&6; } ;; esac curl_h2_msg="disabled (--with-nghttp2)" if test X"$OPT_H2" != Xno; then CLEANLDFLAGS="$LDFLAGS" CLEANCPPFLAGS="$CPPFLAGS" CLEANLIBS="$LIBS" h2pcdir=${want_h2_path}/lib/pkgconfig PKGCONFIG="no" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 $as_echo "$PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 $as_echo "$ac_pt_PKGCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then PKGCONFIG="no" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG fi else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi if test x$PKGCONFIG != xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnghttp2 options with pkg-config" >&5 $as_echo_n "checking for libnghttp2 options with pkg-config... " >&6; } itexists=` if test -n "$h2pcdir"; then PKG_CONFIG_LIBDIR="$h2pcdir" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --exists libnghttp2 >/dev/null 2>&1 && echo 1` if test -z "$itexists"; then PKGCONFIG="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } fi fi if test "$PKGCONFIG" != "no" ; then LIB_H2=` if test -n "$h2pcdir"; then PKG_CONFIG_LIBDIR="$h2pcdir" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --libs-only-l libnghttp2` { $as_echo "$as_me:${as_lineno-$LINENO}: -l is $LIB_H2" >&5 $as_echo "$as_me: -l is $LIB_H2" >&6;} CPP_H2=` if test -n "$h2pcdir"; then PKG_CONFIG_LIBDIR="$h2pcdir" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --cflags-only-I libnghttp2` { $as_echo "$as_me:${as_lineno-$LINENO}: -I is $CPP_H2" >&5 $as_echo "$as_me: -I is $CPP_H2" >&6;} LD_H2=` if test -n "$h2pcdir"; then PKG_CONFIG_LIBDIR="$h2pcdir" export PKG_CONFIG_LIBDIR fi $PKGCONFIG --libs-only-L libnghttp2` { $as_echo "$as_me:${as_lineno-$LINENO}: -L is $LD_H2" >&5 $as_echo "$as_me: -L is $LD_H2" >&6;} else as_fn_error $? "--with-nghttp2 was specified but could not find libnghttp2 pkg-config file." "$LINENO" 5 fi LDFLAGS="$LDFLAGS $LD_H2" CPPFLAGS="$CPPFLAGS $CPP_H2" LIBS="$LIB_H2 $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nghttp2_session_client_new in -lnghttp2" >&5 $as_echo_n "checking for nghttp2_session_client_new in -lnghttp2... " >&6; } if ${ac_cv_lib_nghttp2_nghttp2_session_client_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnghttp2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char nghttp2_session_client_new (); int main (void) { return nghttp2_session_client_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nghttp2_nghttp2_session_client_new=yes else ac_cv_lib_nghttp2_nghttp2_session_client_new=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nghttp2_nghttp2_session_client_new" >&5 $as_echo "$ac_cv_lib_nghttp2_nghttp2_session_client_new" >&6; } if test "x$ac_cv_lib_nghttp2_nghttp2_session_client_new" = xyes; then : for ac_header in nghttp2/nghttp2.h do : ac_fn_c_check_header_mongrel "$LINENO" "nghttp2/nghttp2.h" "ac_cv_header_nghttp2_nghttp2_h" "$ac_includes_default" if test "x$ac_cv_header_nghttp2_nghttp2_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NGHTTP2_NGHTTP2_H 1 _ACEOF curl_h2_msg="enabled (nghttp2)" NGHTTP2_ENABLED=1 $as_echo "#define USE_NGHTTP2 1" >>confdefs.h USE_NGHTTP2=1 fi done else LDFLAGS=$CLEANLDFLAGS CPPFLAGS=$CLEANCPPFLAGS LIBS=$CLEANLIBS fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc.h" >&5 $as_echo_n "checking for malloc.h... " >&6; } if ${ac_cv_header_malloc_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { void *p = malloc(10); void *q = calloc(10,10); free(p); free(q); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_malloc_h="yes" else ac_cv_header_malloc_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_malloc_h" >&5 $as_echo "$ac_cv_header_malloc_h" >&6; } if test "$ac_cv_header_malloc_h" = "yes"; then cat >>confdefs.h <<_ACEOF #define HAVE_MALLOC_H 1 _ACEOF # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { void *p = malloc(10); void *q = calloc(10,10); free(p); free(q); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_cv_need_header_malloc_h="no" else curl_cv_need_header_malloc_h="yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # case "$curl_cv_need_header_malloc_h" in yes) cat >>confdefs.h <<_ACEOF #define NEED_MALLOC_H 1 _ACEOF ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for memory.h" >&5 $as_echo_n "checking for memory.h... " >&6; } if ${ac_cv_header_memory_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { void *p = malloc(10); void *q = calloc(10,10); free(p); free(q); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_memory_h="yes" else ac_cv_header_memory_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_memory_h" >&5 $as_echo "$ac_cv_header_memory_h" >&6; } if test "$ac_cv_header_memory_h" = "yes"; then cat >>confdefs.h <<_ACEOF #define HAVE_MEMORY_H 1 _ACEOF # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { void *p = malloc(10); void *q = calloc(10,10); free(p); free(q); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_cv_need_header_memory_h="no" else curl_cv_need_header_memory_h="yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # case "$curl_cv_need_header_memory_h" in yes) cat >>confdefs.h <<_ACEOF #define NEED_MEMORY_H 1 _ACEOF ;; esac fi for ac_header in sys/types.h \ sys/time.h \ sys/select.h \ sys/socket.h \ sys/ioctl.h \ sys/uio.h \ assert.h \ unistd.h \ stdlib.h \ limits.h \ arpa/inet.h \ net/if.h \ netinet/in.h \ sys/un.h \ netinet/tcp.h \ netdb.h \ sys/sockio.h \ sys/stat.h \ sys/param.h \ termios.h \ termio.h \ sgtty.h \ fcntl.h \ alloca.h \ time.h \ io.h \ pwd.h \ utime.h \ sys/utime.h \ sys/poll.h \ poll.h \ socket.h \ sys/resource.h \ libgen.h \ locale.h \ errno.h \ stdbool.h \ arpa/tftp.h \ sys/filio.h \ sys/wait.h \ setjmp.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " #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 #ifdef HAVE_SYS_UN_H #include #endif " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler support of C99 variadic macro style" >&5 $as_echo_n "checking for compiler support of C99 variadic macro style... " >&6; } if ${curl_cv_variadic_macros_c99+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define c99_vmacro3(first, ...) fun3(first, __VA_ARGS__) #define c99_vmacro2(first, ...) fun2(first, __VA_ARGS__) int fun3(int arg1, int arg2, int arg3); int fun2(int arg1, int arg2); int fun3(int arg1, int arg2, int arg3) { return arg1 + arg2 + arg3; } int fun2(int arg1, int arg2) { return arg1 + arg2; } int main (void) { int res3 = c99_vmacro3(1, 2, 3); int res2 = c99_vmacro2(1, 2); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_cv_variadic_macros_c99="yes" else curl_cv_variadic_macros_c99="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_variadic_macros_c99" >&5 $as_echo "$curl_cv_variadic_macros_c99" >&6; } case "$curl_cv_variadic_macros_c99" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_VARIADIC_MACROS_C99 1 _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler support of old gcc variadic macro style" >&5 $as_echo_n "checking for compiler support of old gcc variadic macro style... " >&6; } if ${curl_cv_variadic_macros_gcc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define gcc_vmacro3(first, args...) fun3(first, args) #define gcc_vmacro2(first, args...) fun2(first, args) int fun3(int arg1, int arg2, int arg3); int fun2(int arg1, int arg2); int fun3(int arg1, int arg2, int arg3) { return arg1 + arg2 + arg3; } int fun2(int arg1, int arg2) { return arg1 + arg2; } int main (void) { int res3 = gcc_vmacro3(1, 2, 3); int res2 = gcc_vmacro2(1, 2); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_cv_variadic_macros_gcc="yes" else curl_cv_variadic_macros_gcc="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_variadic_macros_gcc" >&5 $as_echo "$curl_cv_variadic_macros_gcc" >&6; } case "$curl_cv_variadic_macros_gcc" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_VARIADIC_MACROS_GCC 1 _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main (void) { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_header in sys/types.h sys/time.h time.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 $as_echo_n "checking for struct timeval... " >&6; } if ${ac_cv_struct_timeval+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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 #ifdef HAVE_SYS_SOCKET_H #include #endif int main (void) { struct timeval ts; ts.tv_sec = 0; ts.tv_usec = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_timeval="yes" else ac_cv_struct_timeval="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_timeval" >&5 $as_echo "$ac_cv_struct_timeval" >&6; } case "$ac_cv_struct_timeval" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TIMEVAL 1 _ACEOF ;; esac if test "x$cross_compiling" != xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking run-time libs availability" >&5 $as_echo_n "checking run-time libs availability... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ main() { return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: fine" >&5 $as_echo "fine" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } as_fn_error $? "one or more libs available at link-time are not available run-time. Libs used at link-time: $LIBS" "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 $as_echo_n "checking size of size_t... " >&6; } if ${ac_cv_sizeof_size_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : else if test "$ac_cv_type_size_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (size_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_size_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 $as_echo "$ac_cv_sizeof_size_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 $as_echo_n "checking size of short... " >&6; } if ${ac_cv_sizeof_short+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : else if test "$ac_cv_type_short" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 $as_echo "$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF if test -z "$ac_cv_sizeof_long" || test "$ac_cv_sizeof_long" -eq "0"; then as_fn_error $? "cannot find out size of long." "$LINENO" 5 fi cat >>confdefs.h <<_EOF #define CURL_SIZEOF_LONG $ac_cv_sizeof_long _EOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 $as_echo_n "checking size of time_t... " >&6; } if ${ac_cv_sizeof_time_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default"; then : else if test "$ac_cv_type_time_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (time_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_time_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 $as_echo "$ac_cv_sizeof_time_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_TIME_T $ac_cv_sizeof_time_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 $as_echo_n "checking size of off_t... " >&6; } if ${ac_cv_sizeof_off_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : else if test "$ac_cv_type_off_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (off_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_off_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 $as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF soname_bump=no if test x"$ac_cv_native_windows" != "xyes" && test $ac_cv_sizeof_off_t -ne $curl_sizeof_curl_off_t; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This libcurl built is probably not ABI compatible with previous" >&5 $as_echo "$as_me: WARNING: This libcurl built is probably not ABI compatible with previous" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: builds! You MUST read lib/README.curl_off_t to figure it out." >&5 $as_echo "$as_me: WARNING: builds! You MUST read lib/README.curl_off_t to figure it out." >&2;} soname_bump=yes fi ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" if test "x$ac_cv_type_long_long" = xyes; then : $as_echo "#define HAVE_LONGLONG 1" >>confdefs.h longlong="yes" fi if test "xyes" = "x$longlong"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if numberLL works" >&5 $as_echo_n "checking if numberLL works... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { long long val = 1000LL; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_LL 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # check for ssize_t ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : else $as_echo "#define ssize_t int" >>confdefs.h fi # check for bool type ac_fn_c_check_type "$LINENO" "bool" "ac_cv_type_bool" " #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDBOOL_H #include #endif " if test "x$ac_cv_type_bool" = xyes; then : $as_echo "#define HAVE_BOOL_T 1" >>confdefs.h fi curl_includes_ws2tcpip="\ /* includes start */ #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 #endif /* includes end */" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for windows.h" >&5 $as_echo_n "checking for windows.h... " >&6; } if ${ac_cv_header_windows_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include int main (void) { #if defined(__CYGWIN__) || defined(__CEGCC__) HAVE_WINDOWS_H shall not be defined. #else int dummy=2*WINVER; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_windows_h="yes" else ac_cv_header_windows_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_windows_h" >&5 $as_echo "$ac_cv_header_windows_h" >&6; } case "$ac_cv_header_windows_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_WINDOWS_H 1 _ACEOF cat >>confdefs.h <<_ACEOF #define WIN32_LEAN_AND_MEAN 1 _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winsock2.h" >&5 $as_echo_n "checking for winsock2.h... " >&6; } if ${ac_cv_header_winsock2_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #include int main (void) { #if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) HAVE_WINSOCK2_H shall not be defined. #else int dummy=2*IPPROTO_ESP; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_winsock2_h="yes" else ac_cv_header_winsock2_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_winsock2_h" >&5 $as_echo "$ac_cv_header_winsock2_h" >&6; } case "$ac_cv_header_winsock2_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_WINSOCK2_H 1 _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ws2tcpip.h" >&5 $as_echo_n "checking for ws2tcpip.h... " >&6; } if ${ac_cv_header_ws2tcpip_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef inline #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #include #include int main (void) { #if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) HAVE_WS2TCPIP_H shall not be defined. #else int dummy=2*IP_PKTINFO; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_ws2tcpip_h="yes" else ac_cv_header_ws2tcpip_h="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_ws2tcpip_h" >&5 $as_echo "$ac_cv_header_ws2tcpip_h" >&6; } case "$ac_cv_header_ws2tcpip_h" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_WS2TCPIP_H 1 _ACEOF ;; esac curl_includes_sys_socket="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif /* includes end */" for ac_header in sys/types.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_sys_socket " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done curl_preprocess_callconv="\ /* preprocess start */ #ifdef HAVE_WINDOWS_H # define FUNCALLCONV __stdcall #else # define FUNCALLCONV #endif /* preprocess end */" # # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_socklen_t data type" >&5 $as_echo_n "checking for curl_socklen_t data type... " >&6; } curl_typeof_curl_socklen_t="unknown" for arg1 in int SOCKET; do for arg2 in 'struct sockaddr' void; do for t in socklen_t int size_t 'unsigned int' long 'unsigned long' void; do if test "$curl_typeof_curl_socklen_t" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_ws2tcpip $curl_includes_sys_socket $curl_preprocess_callconv extern int FUNCALLCONV getpeername($arg1, $arg2 *, $t *); int main (void) { $t *lenptr = 0; if(0 != getpeername(0, 0, lenptr)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_typeof_curl_socklen_t="$t" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi done done done for t in socklen_t int; do if test "$curl_typeof_curl_socklen_t" = "void"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_sys_socket typedef $t curl_socklen_t; int main (void) { curl_socklen_t dummy; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_typeof_curl_socklen_t="$t" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_typeof_curl_socklen_t" >&5 $as_echo "$curl_typeof_curl_socklen_t" >&6; } if test "$curl_typeof_curl_socklen_t" = "void" || test "$curl_typeof_curl_socklen_t" = "unknown"; then as_fn_error $? "cannot find data type for curl_socklen_t." "$LINENO" 5 fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of curl_socklen_t" >&5 $as_echo_n "checking size of curl_socklen_t... " >&6; } curl_sizeof_curl_socklen_t="unknown" curl_pull_headers_socklen_t="unknown" if test "$ac_cv_header_ws2tcpip_h" = "yes"; then tst_pull_header_checks='none ws2tcpip' tst_size_checks='4' else tst_pull_header_checks='none systypes syssocket' tst_size_checks='4 8 2' fi for tst_size in $tst_size_checks; do for tst_pull_headers in $tst_pull_header_checks; do if test "$curl_sizeof_curl_socklen_t" = "unknown"; then case $tst_pull_headers in ws2tcpip) tmp_includes="$curl_includes_ws2tcpip" ;; systypes) tmp_includes="$curl_includes_sys_types" ;; syssocket) tmp_includes="$curl_includes_sys_socket" ;; *) tmp_includes="" ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $tmp_includes typedef $curl_typeof_curl_socklen_t curl_socklen_t; typedef char dummy_arr[sizeof(curl_socklen_t) == $tst_size ? 1 : -1]; int main (void) { curl_socklen_t dummy; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_sizeof_curl_socklen_t="$tst_size" curl_pull_headers_socklen_t="$tst_pull_headers" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi done done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_sizeof_curl_socklen_t" >&5 $as_echo "$curl_sizeof_curl_socklen_t" >&6; } if test "$curl_sizeof_curl_socklen_t" = "unknown"; then as_fn_error $? "cannot find out size of curl_socklen_t." "$LINENO" 5 fi # case $curl_pull_headers_socklen_t in ws2tcpip) cat >>confdefs.h <<_EOF #define CURL_PULL_WS2TCPIP_H 1 _EOF ;; systypes) cat >>confdefs.h <<_EOF #define CURL_PULL_SYS_TYPES_H 1 _EOF ;; syssocket) cat >>confdefs.h <<_EOF #define CURL_PULL_SYS_TYPES_H 1 _EOF cat >>confdefs.h <<_EOF #define CURL_PULL_SYS_SOCKET_H 1 _EOF ;; esac cat >>confdefs.h <<_EOF #define CURL_TYPEOF_CURL_SOCKLEN_T $curl_typeof_curl_socklen_t _EOF cat >>confdefs.h <<_EOF #define CURL_SIZEOF_CURL_SOCKLEN_T $curl_sizeof_curl_socklen_t _EOF curl_includes_poll="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_POLL_H # include #endif #ifdef HAVE_SYS_POLL_H # include #endif /* includes end */" for ac_header in sys/types.h poll.h sys/poll.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_poll " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_poll_events_macro_defined="unknown" # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_poll int main (void) { #if defined(events) || defined(revents) return 0; #else force compilation error #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tst_poll_events_macro_defined="yes" else tst_poll_events_macro_defined="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # if test "$tst_poll_events_macro_defined" = "yes"; then if test "x$ac_cv_header_sys_poll_h" = "xyes"; then cat >>confdefs.h <<_EOF #define CURL_PULL_SYS_POLL_H 1 _EOF fi fi # ac_fn_c_check_type "$LINENO" "in_addr_t" "ac_cv_type_in_addr_t" " #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 " if test "x$ac_cv_type_in_addr_t" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in_addr_t equivalent" >&5 $as_echo_n "checking for in_addr_t equivalent... " >&6; } if ${curl_cv_in_addr_t_equiv+:} false; then : $as_echo_n "(cached) " >&6 else curl_cv_in_addr_t_equiv="unknown" for t in "unsigned long" int size_t unsigned long; do if test "$curl_cv_in_addr_t_equiv" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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 int main (void) { $t data = inet_addr ("1.2.3.4"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : curl_cv_in_addr_t_equiv="$t" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_in_addr_t_equiv" >&5 $as_echo "$curl_cv_in_addr_t_equiv" >&6; } case "$curl_cv_in_addr_t_equiv" in unknown) as_fn_error $? "Cannot find a type to use in place of in_addr_t" "$LINENO" 5 ;; *) cat >>confdefs.h <<_ACEOF #define in_addr_t $curl_cv_in_addr_t_equiv _ACEOF ;; esac fi ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " #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 " if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then : $as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h fi for ac_header in signal.h do : ac_fn_c_check_header_mongrel "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" if test "x$ac_cv_header_signal_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIGNAL_H 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "sig_atomic_t" "ac_cv_type_sig_atomic_t" " #ifdef HAVE_SIGNAL_H #include #endif " if test "x$ac_cv_type_sig_atomic_t" = xyes; then : $as_echo "#define HAVE_SIG_ATOMIC_T 1" >>confdefs.h fi case "$ac_cv_type_sig_atomic_t" in yes) # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sig_atomic_t is already defined as volatile" >&5 $as_echo_n "checking if sig_atomic_t is already defined as volatile... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SIGNAL_H #include #endif int main (void) { static volatile sig_atomic_t dummy = 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_sig_atomic_t_volatile="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ac_cv_sig_atomic_t_volatile="yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$ac_cv_sig_atomic_t_volatile" = "yes"; then $as_echo "#define HAVE_SIG_ATOMIC_T_VOLATILE 1" >>confdefs.h fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_header in sys/select.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for select" >&5 $as_echo_n "checking for select... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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 #ifndef HAVE_WINDOWS_H #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #endif int main (void) { select(0, 0, 0, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } curl_cv_select="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } curl_cv_select="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$curl_cv_select" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of args and return type for select" >&5 $as_echo_n "checking types of args and return type for select... " >&6; } if ${curl_cv_func_select_args+:} false; then : $as_echo_n "(cached) " >&6 else curl_cv_func_select_args="unknown" for sel_retv in 'int' 'ssize_t'; do for sel_arg1 in 'int' 'ssize_t' 'size_t' 'unsigned long int' 'unsigned int'; do for sel_arg234 in 'fd_set *' 'int *' 'void *'; do for sel_arg5 in 'struct timeval *' 'const struct timeval *'; do if test "$curl_cv_func_select_args" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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 SELECTCALLCONV PASCAL #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 #ifndef HAVE_WINDOWS_H #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #define SELECTCALLCONV #endif #ifndef HAVE_STRUCT_TIMEVAL struct timeval { long tv_sec; long tv_usec; }; #endif extern $sel_retv SELECTCALLCONV select($sel_arg1, $sel_arg234, $sel_arg234, $sel_arg234, $sel_arg5); int main (void) { $sel_arg1 nfds=0; $sel_arg234 rfds=0; $sel_arg234 wfds=0; $sel_arg234 efds=0; $sel_retv res = select(nfds, rfds, wfds, efds, 0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_cv_func_select_args="$sel_arg1,$sel_arg234,$sel_arg5,$sel_retv" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi done done done done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_func_select_args" >&5 $as_echo "$curl_cv_func_select_args" >&6; } # AC-CACHE-CHECK if test "$curl_cv_func_select_args" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find proper types to use for select args" >&5 $as_echo "$as_me: WARNING: Cannot find proper types to use for select args" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: HAVE_SELECT will not be defined" >&5 $as_echo "$as_me: WARNING: HAVE_SELECT will not be defined" >&2;} else select_prev_IFS=$IFS; IFS=',' set dummy `echo "$curl_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$select_prev_IFS shift # sel_qual_type_arg5=$3 # cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG234 $2 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_RETV $4 _ACEOF # prev_sh_opts=$- # case $prev_sh_opts in *f*) ;; *) set -f ;; esac # case "$sel_qual_type_arg5" in const*) sel_qual_arg5=const sel_type_arg5=`echo $sel_qual_type_arg5 | sed 's/^const //'` ;; *) sel_qual_arg5= sel_type_arg5=$sel_qual_type_arg5 ;; esac # cat >>confdefs.h <<_ACEOF #define SELECT_QUAL_ARG5 $sel_qual_arg5 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG5 $sel_type_arg5 _ACEOF # case $prev_sh_opts in *f*) ;; *) set +f ;; esac # cat >>confdefs.h <<_ACEOF #define HAVE_SELECT 1 _ACEOF ac_cv_func_select="yes" fi fi for ac_header in sys/types.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for recv" >&5 $as_echo_n "checking for recv... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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 main (void) { recv(0, 0, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } curl_cv_recv="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } curl_cv_recv="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$curl_cv_recv" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of args and return type for recv" >&5 $as_echo_n "checking types of args and return type for recv... " >&6; } if ${curl_cv_func_recv_args+:} false; then : $as_echo_n "(cached) " >&6 else 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 if test "$curl_cv_func_recv_args" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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); int main (void) { $recv_arg1 s=0; $recv_arg2 buf=0; $recv_arg3 len=0; $recv_arg4 flags=0; $recv_retv res = recv(s, buf, len, flags); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_cv_func_recv_args="$recv_arg1,$recv_arg2,$recv_arg3,$recv_arg4,$recv_retv" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi done done done done done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_func_recv_args" >&5 $as_echo "$curl_cv_func_recv_args" >&6; } # AC-CACHE-CHECK if test "$curl_cv_func_recv_args" = "unknown"; then as_fn_error $? "Cannot find proper types to use for recv args" "$LINENO" 5 else recv_prev_IFS=$IFS; IFS=',' set dummy `echo "$curl_cv_func_recv_args" | sed 's/\*/\*/g'` IFS=$recv_prev_IFS shift # cat >>confdefs.h <<_ACEOF #define RECV_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define RECV_TYPE_ARG2 $2 _ACEOF cat >>confdefs.h <<_ACEOF #define RECV_TYPE_ARG3 $3 _ACEOF cat >>confdefs.h <<_ACEOF #define RECV_TYPE_ARG4 $4 _ACEOF cat >>confdefs.h <<_ACEOF #define RECV_TYPE_RETV $5 _ACEOF # cat >>confdefs.h <<_ACEOF #define HAVE_RECV 1 _ACEOF ac_cv_func_recv="yes" fi else as_fn_error $? "Unable to link function recv" "$LINENO" 5 fi for ac_header in sys/types.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for send" >&5 $as_echo_n "checking for send... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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 main (void) { send(0, 0, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } curl_cv_send="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } curl_cv_send="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$curl_cv_send" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of args and return type for send" >&5 $as_echo_n "checking types of args and return type for send... " >&6; } if ${curl_cv_func_send_args+:} false; then : $as_echo_n "(cached) " >&6 else 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 if test "$curl_cv_func_send_args" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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); int main (void) { $send_arg1 s=0; $send_arg3 len=0; $send_arg4 flags=0; $send_retv res = send(s, 0, len, flags); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_cv_func_send_args="$send_arg1,$send_arg2,$send_arg3,$send_arg4,$send_retv" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi done done done done done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_func_send_args" >&5 $as_echo "$curl_cv_func_send_args" >&6; } # AC-CACHE-CHECK if test "$curl_cv_func_send_args" = "unknown"; then as_fn_error $? "Cannot find proper types to use for send args" "$LINENO" 5 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 # cat >>confdefs.h <<_ACEOF #define SEND_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SEND_TYPE_ARG3 $3 _ACEOF cat >>confdefs.h <<_ACEOF #define SEND_TYPE_ARG4 $4 _ACEOF cat >>confdefs.h <<_ACEOF #define SEND_TYPE_RETV $5 _ACEOF # 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 # cat >>confdefs.h <<_ACEOF #define SEND_QUAL_ARG2 $send_qual_arg2 _ACEOF cat >>confdefs.h <<_ACEOF #define SEND_TYPE_ARG2 $send_type_arg2 _ACEOF # case $prev_sh_opts in *f*) ;; *) set +f ;; esac # cat >>confdefs.h <<_ACEOF #define HAVE_SEND 1 _ACEOF ac_cv_func_send="yes" fi else as_fn_error $? "Unable to link function send" "$LINENO" 5 fi for ac_header in sys/types.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MSG_NOSIGNAL" >&5 $as_echo_n "checking for MSG_NOSIGNAL... " >&6; } if ${ac_cv_msg_nosignal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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 main (void) { int flag=MSG_NOSIGNAL; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_msg_nosignal="yes" else ac_cv_msg_nosignal="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_msg_nosignal" >&5 $as_echo "$ac_cv_msg_nosignal" >&6; } case "$ac_cv_msg_nosignal" in yes) cat >>confdefs.h <<_ACEOF #define HAVE_MSG_NOSIGNAL 1 _ACEOF ;; esac curl_includes_unistd="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif /* includes end */" for ac_header in sys/types.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_unistd " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_alarm="unknown" tst_proto_alarm="unknown" tst_compi_alarm="unknown" tst_allow_alarm="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if alarm can be linked" >&5 $as_echo_n "checking if alarm can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define alarm innocuous_alarm #ifdef __STDC__ # include #else # include #endif #undef alarm #ifdef __cplusplus extern "C" #endif char alarm (); #if defined __stub_alarm || defined __stub___alarm choke me #endif int main (void) { return alarm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_alarm="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_alarm="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_alarm" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if alarm is prototyped" >&5 $as_echo_n "checking if alarm is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_unistd _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "alarm" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_alarm="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_alarm="no" fi rm -f conftest* fi # if test "$tst_proto_alarm" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if alarm is compilable" >&5 $as_echo_n "checking if alarm is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_unistd int main (void) { if(0 != alarm(0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_alarm="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_alarm="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_alarm" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if alarm usage allowed" >&5 $as_echo_n "checking if alarm usage allowed... " >&6; } if test "x$curl_disallow_alarm" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_alarm="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_alarm="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if alarm might be used" >&5 $as_echo_n "checking if alarm might be used... " >&6; } if test "$tst_links_alarm" = "yes" && test "$tst_proto_alarm" = "yes" && test "$tst_compi_alarm" = "yes" && test "$tst_allow_alarm" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_ALARM 1 _ACEOF ac_cv_func_alarm="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_alarm="no" fi curl_includes_string="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_STRINGS_H # include #endif /* includes end */" for ac_header in sys/types.h string.h strings.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_string " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done curl_includes_libgen="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_LIBGEN_H # include #endif /* includes end */" for ac_header in sys/types.h libgen.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_libgen " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_basename="unknown" tst_proto_basename="unknown" tst_compi_basename="unknown" tst_allow_basename="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if basename can be linked" >&5 $as_echo_n "checking if basename can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define basename innocuous_basename #ifdef __STDC__ # include #else # include #endif #undef basename #ifdef __cplusplus extern "C" #endif char basename (); #if defined __stub_basename || defined __stub___basename choke me #endif int main (void) { return basename (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_basename="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_basename="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_basename" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if basename is prototyped" >&5 $as_echo_n "checking if basename is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string $curl_includes_libgen $curl_includes_unistd _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "basename" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_basename="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_basename="no" fi rm -f conftest* fi # if test "$tst_proto_basename" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if basename is compilable" >&5 $as_echo_n "checking if basename is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string $curl_includes_libgen $curl_includes_unistd int main (void) { if(0 != basename(0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_basename="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_basename="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_basename" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if basename usage allowed" >&5 $as_echo_n "checking if basename usage allowed... " >&6; } if test "x$curl_disallow_basename" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_basename="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_basename="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if basename might be used" >&5 $as_echo_n "checking if basename might be used... " >&6; } if test "$tst_links_basename" = "yes" && test "$tst_proto_basename" = "yes" && test "$tst_compi_basename" = "yes" && test "$tst_allow_basename" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_BASENAME 1 _ACEOF ac_cv_func_basename="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_basename="no" fi curl_includes_socket="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SOCKET_H # include #endif /* includes end */" for ac_header in sys/types.h socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_socket " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_closesocket="unknown" tst_proto_closesocket="unknown" tst_compi_closesocket="unknown" tst_allow_closesocket="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if closesocket can be linked" >&5 $as_echo_n "checking if closesocket can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_socket int main (void) { if(0 != closesocket(0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_closesocket="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_closesocket="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_closesocket" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if closesocket is prototyped" >&5 $as_echo_n "checking if closesocket is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_socket _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "closesocket" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_closesocket="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_closesocket="no" fi rm -f conftest* fi # if test "$tst_proto_closesocket" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if closesocket is compilable" >&5 $as_echo_n "checking if closesocket is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_socket int main (void) { if(0 != closesocket(0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_closesocket="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_closesocket="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_closesocket" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if closesocket usage allowed" >&5 $as_echo_n "checking if closesocket usage allowed... " >&6; } if test "x$curl_disallow_closesocket" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_closesocket="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_closesocket="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if closesocket might be used" >&5 $as_echo_n "checking if closesocket might be used... " >&6; } if test "$tst_links_closesocket" = "yes" && test "$tst_proto_closesocket" = "yes" && test "$tst_compi_closesocket" = "yes" && test "$tst_allow_closesocket" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_CLOSESOCKET 1 _ACEOF ac_cv_func_closesocket="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_closesocket="no" fi # tst_links_closesocket_camel="unknown" tst_proto_closesocket_camel="unknown" tst_compi_closesocket_camel="unknown" tst_allow_closesocket_camel="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CloseSocket can be linked" >&5 $as_echo_n "checking if CloseSocket can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_sys_socket int main (void) { if(0 != CloseSocket(0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_closesocket_camel="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_closesocket_camel="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_closesocket_camel" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CloseSocket is prototyped" >&5 $as_echo_n "checking if CloseSocket is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_sys_socket _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "CloseSocket" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_closesocket_camel="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_closesocket_camel="no" fi rm -f conftest* fi # if test "$tst_proto_closesocket_camel" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CloseSocket is compilable" >&5 $as_echo_n "checking if CloseSocket is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_sys_socket int main (void) { if(0 != CloseSocket(0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_closesocket_camel="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_closesocket_camel="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_closesocket_camel" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CloseSocket usage allowed" >&5 $as_echo_n "checking if CloseSocket usage allowed... " >&6; } if test "x$curl_disallow_closesocket_camel" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_closesocket_camel="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_closesocket_camel="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CloseSocket might be used" >&5 $as_echo_n "checking if CloseSocket might be used... " >&6; } if test "$tst_links_closesocket_camel" = "yes" && test "$tst_proto_closesocket_camel" = "yes" && test "$tst_compi_closesocket_camel" = "yes" && test "$tst_allow_closesocket_camel" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_CLOSESOCKET_CAMEL 1 _ACEOF ac_cv_func_closesocket_camel="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_closesocket_camel="no" fi # tst_links_connect="unknown" tst_proto_connect="unknown" tst_compi_connect="unknown" tst_allow_connect="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if connect can be linked" >&5 $as_echo_n "checking if connect can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_sys_socket $curl_includes_socket int main (void) { if(0 != connect(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_connect="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_connect="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_connect" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if connect is prototyped" >&5 $as_echo_n "checking if connect is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_sys_socket $curl_includes_socket _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "connect" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_connect="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_connect="no" fi rm -f conftest* fi # if test "$tst_proto_connect" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if connect is compilable" >&5 $as_echo_n "checking if connect is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_sys_socket $curl_includes_socket int main (void) { if(0 != connect(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_connect="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_connect="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_connect" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if connect usage allowed" >&5 $as_echo_n "checking if connect usage allowed... " >&6; } if test "x$curl_disallow_connect" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_connect="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_connect="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if connect might be used" >&5 $as_echo_n "checking if connect might be used... " >&6; } if test "$tst_links_connect" = "yes" && test "$tst_proto_connect" = "yes" && test "$tst_compi_connect" = "yes" && test "$tst_allow_connect" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_CONNECT 1 _ACEOF ac_cv_func_connect="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_connect="no" fi curl_includes_fcntl="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_FCNTL_H # include #endif /* includes end */" for ac_header in sys/types.h unistd.h fcntl.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_fcntl " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_fcntl="unknown" tst_proto_fcntl="unknown" tst_compi_fcntl="unknown" tst_allow_fcntl="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl can be linked" >&5 $as_echo_n "checking if fcntl can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define fcntl innocuous_fcntl #ifdef __STDC__ # include #else # include #endif #undef fcntl #ifdef __cplusplus extern "C" #endif char fcntl (); #if defined __stub_fcntl || defined __stub___fcntl choke me #endif int main (void) { return fcntl (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_fcntl="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_fcntl="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_fcntl" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl is prototyped" >&5 $as_echo_n "checking if fcntl is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_fcntl _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "fcntl" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_fcntl="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_fcntl="no" fi rm -f conftest* fi # if test "$tst_proto_fcntl" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl is compilable" >&5 $as_echo_n "checking if fcntl is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_fcntl int main (void) { if(0 != fcntl(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_fcntl="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_fcntl="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_fcntl" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl usage allowed" >&5 $as_echo_n "checking if fcntl usage allowed... " >&6; } if test "x$curl_disallow_fcntl" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_fcntl="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_fcntl="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl might be used" >&5 $as_echo_n "checking if fcntl might be used... " >&6; } if test "$tst_links_fcntl" = "yes" && test "$tst_proto_fcntl" = "yes" && test "$tst_compi_fcntl" = "yes" && test "$tst_allow_fcntl" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_FCNTL 1 _ACEOF ac_cv_func_fcntl="yes" # tst_compi_fcntl_o_nonblock="unknown" tst_allow_fcntl_o_nonblock="unknown" # case $host_os in sunos4* | aix3* | beos*) curl_disallow_fcntl_o_nonblock="yes" ;; esac # if test "$ac_cv_func_fcntl" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl O_NONBLOCK is compilable" >&5 $as_echo_n "checking if fcntl O_NONBLOCK is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_fcntl int main (void) { int flags = 0; if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_fcntl_o_nonblock="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_fcntl_o_nonblock="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_fcntl_o_nonblock" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl O_NONBLOCK usage allowed" >&5 $as_echo_n "checking if fcntl O_NONBLOCK usage allowed... " >&6; } if test "x$curl_disallow_fcntl_o_nonblock" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_fcntl_o_nonblock="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_fcntl_o_nonblock="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl O_NONBLOCK might be used" >&5 $as_echo_n "checking if fcntl O_NONBLOCK might be used... " >&6; } if test "$tst_compi_fcntl_o_nonblock" = "yes" && test "$tst_allow_fcntl_o_nonblock" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_FCNTL_O_NONBLOCK 1 _ACEOF ac_cv_func_fcntl_o_nonblock="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_fcntl_o_nonblock="no" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_fcntl="no" fi curl_includes_stdio="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_STDIO_H # include #endif /* includes end */" for ac_header in sys/types.h stdio.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_stdio " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_fdopen="unknown" tst_proto_fdopen="unknown" tst_compi_fdopen="unknown" tst_allow_fdopen="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fdopen can be linked" >&5 $as_echo_n "checking if fdopen can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define fdopen innocuous_fdopen #ifdef __STDC__ # include #else # include #endif #undef fdopen #ifdef __cplusplus extern "C" #endif char fdopen (); #if defined __stub_fdopen || defined __stub___fdopen choke me #endif int main (void) { return fdopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_fdopen="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_fdopen="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_fdopen" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fdopen is prototyped" >&5 $as_echo_n "checking if fdopen is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdio _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "fdopen" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_fdopen="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_fdopen="no" fi rm -f conftest* fi # if test "$tst_proto_fdopen" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fdopen is compilable" >&5 $as_echo_n "checking if fdopen is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdio int main (void) { if(0 != fdopen(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_fdopen="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_fdopen="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_fdopen" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fdopen usage allowed" >&5 $as_echo_n "checking if fdopen usage allowed... " >&6; } if test "x$curl_disallow_fdopen" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_fdopen="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_fdopen="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fdopen might be used" >&5 $as_echo_n "checking if fdopen might be used... " >&6; } if test "$tst_links_fdopen" = "yes" && test "$tst_proto_fdopen" = "yes" && test "$tst_compi_fdopen" = "yes" && test "$tst_allow_fdopen" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_FDOPEN 1 _ACEOF ac_cv_func_fdopen="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_fdopen="no" fi curl_includes_netdb="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_NETDB_H # include #endif /* includes end */" for ac_header in sys/types.h netdb.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_netdb " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_freeaddrinfo="unknown" tst_proto_freeaddrinfo="unknown" tst_compi_freeaddrinfo="unknown" tst_allow_freeaddrinfo="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo can be linked" >&5 $as_echo_n "checking if freeaddrinfo can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_ws2tcpip $curl_includes_sys_socket $curl_includes_netdb int main (void) { freeaddrinfo(0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_freeaddrinfo="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_freeaddrinfo="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_freeaddrinfo" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo is prototyped" >&5 $as_echo_n "checking if freeaddrinfo is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_ws2tcpip $curl_includes_sys_socket $curl_includes_netdb _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "freeaddrinfo" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_freeaddrinfo="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_freeaddrinfo="no" fi rm -f conftest* fi # if test "$tst_proto_freeaddrinfo" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo is compilable" >&5 $as_echo_n "checking if freeaddrinfo is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_ws2tcpip $curl_includes_sys_socket $curl_includes_netdb int main (void) { freeaddrinfo(0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_freeaddrinfo="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_freeaddrinfo="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_freeaddrinfo" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo usage allowed" >&5 $as_echo_n "checking if freeaddrinfo usage allowed... " >&6; } if test "x$curl_disallow_freeaddrinfo" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_freeaddrinfo="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_freeaddrinfo="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo might be used" >&5 $as_echo_n "checking if freeaddrinfo might be used... " >&6; } if test "$tst_links_freeaddrinfo" = "yes" && test "$tst_proto_freeaddrinfo" = "yes" && test "$tst_compi_freeaddrinfo" = "yes" && test "$tst_allow_freeaddrinfo" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_FREEADDRINFO 1 _ACEOF ac_cv_func_freeaddrinfo="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_freeaddrinfo="no" fi curl_includes_ifaddrs="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_IFADDRS_H # include #endif /* includes end */" for ac_header in sys/types.h sys/socket.h netinet/in.h ifaddrs.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_ifaddrs " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_freeifaddrs="unknown" tst_proto_freeifaddrs="unknown" tst_compi_freeifaddrs="unknown" tst_allow_freeifaddrs="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeifaddrs can be linked" >&5 $as_echo_n "checking if freeifaddrs can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define freeifaddrs innocuous_freeifaddrs #ifdef __STDC__ # include #else # include #endif #undef freeifaddrs #ifdef __cplusplus extern "C" #endif char freeifaddrs (); #if defined __stub_freeifaddrs || defined __stub___freeifaddrs choke me #endif int main (void) { return freeifaddrs (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_freeifaddrs="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_freeifaddrs="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_freeifaddrs" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeifaddrs is prototyped" >&5 $as_echo_n "checking if freeifaddrs is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_ifaddrs _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "freeifaddrs" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_freeifaddrs="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_freeifaddrs="no" fi rm -f conftest* fi # if test "$tst_proto_freeifaddrs" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeifaddrs is compilable" >&5 $as_echo_n "checking if freeifaddrs is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_ifaddrs int main (void) { freeifaddrs(0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_freeifaddrs="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_freeifaddrs="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_freeifaddrs" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeifaddrs usage allowed" >&5 $as_echo_n "checking if freeifaddrs usage allowed... " >&6; } if test "x$curl_disallow_freeifaddrs" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_freeifaddrs="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_freeifaddrs="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeifaddrs might be used" >&5 $as_echo_n "checking if freeifaddrs might be used... " >&6; } if test "$tst_links_freeifaddrs" = "yes" && test "$tst_proto_freeifaddrs" = "yes" && test "$tst_compi_freeifaddrs" = "yes" && test "$tst_allow_freeifaddrs" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_FREEIFADDRS 1 _ACEOF ac_cv_func_freeifaddrs="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_freeifaddrs="no" fi curl_includes_sys_xattr="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_XATTR_H # include #endif /* includes end */" for ac_header in sys/types.h sys/xattr.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_sys_xattr " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_fsetxattr="unknown" tst_proto_fsetxattr="unknown" tst_compi_fsetxattr="unknown" tst_allow_fsetxattr="unknown" tst_nargs_fsetxattr="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fsetxattr can be linked" >&5 $as_echo_n "checking if fsetxattr can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define fsetxattr innocuous_fsetxattr #ifdef __STDC__ # include #else # include #endif #undef fsetxattr #ifdef __cplusplus extern "C" #endif char fsetxattr (); #if defined __stub_fsetxattr || defined __stub___fsetxattr choke me #endif int main (void) { return fsetxattr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_fsetxattr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_fsetxattr="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_fsetxattr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fsetxattr is prototyped" >&5 $as_echo_n "checking if fsetxattr is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_sys_xattr _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "fsetxattr" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_fsetxattr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_fsetxattr="no" fi rm -f conftest* fi # if test "$tst_proto_fsetxattr" = "yes"; then if test "$tst_nargs_fsetxattr" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fsetxattr takes 5 args." >&5 $as_echo_n "checking if fsetxattr takes 5 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_sys_xattr int main (void) { if(0 != fsetxattr(0, 0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_fsetxattr="yes" tst_nargs_fsetxattr="5" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_fsetxattr="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$tst_nargs_fsetxattr" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fsetxattr takes 6 args." >&5 $as_echo_n "checking if fsetxattr takes 6 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_sys_xattr int main (void) { if(0 != fsetxattr(0, 0, 0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_fsetxattr="yes" tst_nargs_fsetxattr="6" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_fsetxattr="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fsetxattr is compilable" >&5 $as_echo_n "checking if fsetxattr is compilable... " >&6; } if test "$tst_compi_fsetxattr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # if test "$tst_compi_fsetxattr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fsetxattr usage allowed" >&5 $as_echo_n "checking if fsetxattr usage allowed... " >&6; } if test "x$curl_disallow_fsetxattr" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_fsetxattr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_fsetxattr="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fsetxattr might be used" >&5 $as_echo_n "checking if fsetxattr might be used... " >&6; } if test "$tst_links_fsetxattr" = "yes" && test "$tst_proto_fsetxattr" = "yes" && test "$tst_compi_fsetxattr" = "yes" && test "$tst_allow_fsetxattr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_FSETXATTR 1 _ACEOF # if test "$tst_nargs_fsetxattr" -eq "5"; then $as_echo "#define HAVE_FSETXATTR_5 1" >>confdefs.h elif test "$tst_nargs_fsetxattr" -eq "6"; then $as_echo "#define HAVE_FSETXATTR_6 1" >>confdefs.h fi # ac_cv_func_fsetxattr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_fsetxattr="no" fi # tst_links_ftruncate="unknown" tst_proto_ftruncate="unknown" tst_compi_ftruncate="unknown" tst_allow_ftruncate="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ftruncate can be linked" >&5 $as_echo_n "checking if ftruncate can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define ftruncate innocuous_ftruncate #ifdef __STDC__ # include #else # include #endif #undef ftruncate #ifdef __cplusplus extern "C" #endif char ftruncate (); #if defined __stub_ftruncate || defined __stub___ftruncate choke me #endif int main (void) { return ftruncate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_ftruncate="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_ftruncate="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_ftruncate" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ftruncate is prototyped" >&5 $as_echo_n "checking if ftruncate is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_unistd _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "ftruncate" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_ftruncate="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_ftruncate="no" fi rm -f conftest* fi # if test "$tst_proto_ftruncate" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ftruncate is compilable" >&5 $as_echo_n "checking if ftruncate is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_unistd int main (void) { if(0 != ftruncate(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_ftruncate="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_ftruncate="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_ftruncate" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ftruncate usage allowed" >&5 $as_echo_n "checking if ftruncate usage allowed... " >&6; } if test "x$curl_disallow_ftruncate" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_ftruncate="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_ftruncate="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ftruncate might be used" >&5 $as_echo_n "checking if ftruncate might be used... " >&6; } if test "$tst_links_ftruncate" = "yes" && test "$tst_proto_ftruncate" = "yes" && test "$tst_compi_ftruncate" = "yes" && test "$tst_allow_ftruncate" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_FTRUNCATE 1 _ACEOF ac_cv_func_ftruncate="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_ftruncate="no" fi curl_includes_stdlib="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_STDLIB_H # include #endif /* includes end */" for ac_header in sys/types.h stdlib.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_stdlib " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_getaddrinfo="unknown" tst_proto_getaddrinfo="unknown" tst_compi_getaddrinfo="unknown" tst_works_getaddrinfo="unknown" tst_allow_getaddrinfo="unknown" tst_tsafe_getaddrinfo="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo can be linked" >&5 $as_echo_n "checking if getaddrinfo can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_ws2tcpip $curl_includes_sys_socket $curl_includes_netdb int main (void) { if(0 != getaddrinfo(0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_getaddrinfo="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_getaddrinfo="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_getaddrinfo" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo is prototyped" >&5 $as_echo_n "checking if getaddrinfo is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_ws2tcpip $curl_includes_sys_socket $curl_includes_netdb _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "getaddrinfo" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_getaddrinfo="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_getaddrinfo="no" fi rm -f conftest* fi # if test "$tst_proto_getaddrinfo" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo is compilable" >&5 $as_echo_n "checking if getaddrinfo is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_ws2tcpip $curl_includes_sys_socket $curl_includes_netdb int main (void) { if(0 != getaddrinfo(0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_getaddrinfo="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_getaddrinfo="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "x$cross_compiling" != "xyes" && test "$tst_compi_getaddrinfo" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo seems to work" >&5 $as_echo_n "checking if getaddrinfo seems to work... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_ws2tcpip $curl_includes_stdlib $curl_includes_string $curl_includes_sys_socket $curl_includes_netdb int main (void) { struct addrinfo hints; struct addrinfo *ai = 0; 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", 0, &hints, &ai); if(error || !ai) exit(1); /* fail */ else exit(0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_works_getaddrinfo="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_works_getaddrinfo="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi # if test "$tst_compi_getaddrinfo" = "yes" && test "$tst_works_getaddrinfo" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo usage allowed" >&5 $as_echo_n "checking if getaddrinfo usage allowed... " >&6; } if test "x$curl_disallow_getaddrinfo" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_getaddrinfo="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_getaddrinfo="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo might be used" >&5 $as_echo_n "checking if getaddrinfo might be used... " >&6; } if test "$tst_links_getaddrinfo" = "yes" && test "$tst_proto_getaddrinfo" = "yes" && test "$tst_compi_getaddrinfo" = "yes" && test "$tst_allow_getaddrinfo" = "yes" && test "$tst_works_getaddrinfo" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_GETADDRINFO 1 _ACEOF ac_cv_func_getaddrinfo="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_getaddrinfo="no" ac_cv_func_getaddrinfo_threadsafe="no" fi # if test "$ac_cv_func_getaddrinfo" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo is threadsafe" >&5 $as_echo_n "checking if getaddrinfo is threadsafe... " >&6; } case $host_os in aix[1234].* | aix5.[01].*) tst_tsafe_getaddrinfo="no" ;; aix*) tst_tsafe_getaddrinfo="yes" ;; darwin[12345].*) tst_tsafe_getaddrinfo="no" ;; darwin*) tst_tsafe_getaddrinfo="yes" ;; freebsd[1234].* | freebsd5.[1234]*) tst_tsafe_getaddrinfo="no" ;; freebsd*) tst_tsafe_getaddrinfo="yes" ;; hpux[123456789].* | hpux10.* | hpux11.0* | hpux11.10*) tst_tsafe_getaddrinfo="no" ;; hpux*) tst_tsafe_getaddrinfo="yes" ;; netbsd[123].*) tst_tsafe_getaddrinfo="no" ;; netbsd*) tst_tsafe_getaddrinfo="yes" ;; *bsd*) tst_tsafe_getaddrinfo="no" ;; solaris2*) tst_tsafe_getaddrinfo="yes" ;; esac if test "$tst_tsafe_getaddrinfo" = "unknown" && test "$ac_cv_native_windows" = "yes"; then tst_tsafe_getaddrinfo="yes" fi if test "$tst_tsafe_getaddrinfo" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_sys_socket $curl_includes_netdb int main (void) { #ifdef h_errno return 0; #else force compilation error #endif } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tst_symbol_defined="yes" else tst_symbol_defined="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$tst_symbol_defined" = "yes"; then curl_cv_have_def_h_errno=yes else curl_cv_have_def_h_errno=no fi if test "$curl_cv_have_def_h_errno" = "yes"; then tst_h_errno_macro="yes" else tst_h_errno_macro="no" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_sys_socket $curl_includes_netdb int main (void) { h_errno = 2; if(0 != h_errno) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tst_h_errno_modifiable_lvalue="yes" else tst_h_errno_modifiable_lvalue="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) return 0; #elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700) return 0; #else force compilation error #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tst_h_errno_sbs_issue_7="yes" else tst_h_errno_sbs_issue_7="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$tst_h_errno_macro" = "no" && test "$tst_h_errno_modifiable_lvalue" = "no" && test "$tst_h_errno_sbs_issue_7" = "no"; then tst_tsafe_getaddrinfo="no" else tst_tsafe_getaddrinfo="yes" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_tsafe_getaddrinfo" >&5 $as_echo "$tst_tsafe_getaddrinfo" >&6; } if test "$tst_tsafe_getaddrinfo" = "yes"; then cat >>confdefs.h <<_ACEOF #define HAVE_GETADDRINFO_THREADSAFE 1 _ACEOF ac_cv_func_getaddrinfo_threadsafe="yes" else ac_cv_func_getaddrinfo_threadsafe="no" fi fi # tst_links_gai_strerror="unknown" tst_proto_gai_strerror="unknown" tst_compi_gai_strerror="unknown" tst_allow_gai_strerror="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gai_strerror can be linked" >&5 $as_echo_n "checking if gai_strerror can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_netdb int main (void) { if(0 != gai_strerror(0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_gai_strerror="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_gai_strerror="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_gai_strerror" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gai_strerror is prototyped" >&5 $as_echo_n "checking if gai_strerror is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_netdb _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "gai_strerror" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_gai_strerror="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_gai_strerror="no" fi rm -f conftest* fi # if test "$tst_proto_gai_strerror" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gai_strerror is compilable" >&5 $as_echo_n "checking if gai_strerror is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_netdb int main (void) { if(0 != gai_strerror(0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_gai_strerror="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_gai_strerror="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_gai_strerror" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gai_strerror usage allowed" >&5 $as_echo_n "checking if gai_strerror usage allowed... " >&6; } if test "x$curl_disallow_gai_strerror" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_gai_strerror="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_gai_strerror="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gai_strerror might be used" >&5 $as_echo_n "checking if gai_strerror might be used... " >&6; } if test "$tst_links_gai_strerror" = "yes" && test "$tst_proto_gai_strerror" = "yes" && test "$tst_compi_gai_strerror" = "yes" && test "$tst_allow_gai_strerror" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_GAI_STRERROR 1 _ACEOF ac_cv_func_gai_strerror="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_gai_strerror="no" fi # tst_links_gethostbyaddr="unknown" tst_proto_gethostbyaddr="unknown" tst_compi_gethostbyaddr="unknown" tst_allow_gethostbyaddr="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr can be linked" >&5 $as_echo_n "checking if gethostbyaddr can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_netdb int main (void) { if(0 != gethostbyaddr(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_gethostbyaddr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_gethostbyaddr="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_gethostbyaddr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr is prototyped" >&5 $as_echo_n "checking if gethostbyaddr is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_netdb _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "gethostbyaddr" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_gethostbyaddr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_gethostbyaddr="no" fi rm -f conftest* fi # if test "$tst_proto_gethostbyaddr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr is compilable" >&5 $as_echo_n "checking if gethostbyaddr is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_netdb int main (void) { if(0 != gethostbyaddr(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_gethostbyaddr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_gethostbyaddr="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_gethostbyaddr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr usage allowed" >&5 $as_echo_n "checking if gethostbyaddr usage allowed... " >&6; } if test "x$curl_disallow_gethostbyaddr" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_gethostbyaddr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_gethostbyaddr="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr might be used" >&5 $as_echo_n "checking if gethostbyaddr might be used... " >&6; } if test "$tst_links_gethostbyaddr" = "yes" && test "$tst_proto_gethostbyaddr" = "yes" && test "$tst_compi_gethostbyaddr" = "yes" && test "$tst_allow_gethostbyaddr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_GETHOSTBYADDR 1 _ACEOF ac_cv_func_gethostbyaddr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_gethostbyaddr="no" fi # tst_links_gethostbyaddr_r="unknown" tst_proto_gethostbyaddr_r="unknown" tst_compi_gethostbyaddr_r="unknown" tst_allow_gethostbyaddr_r="unknown" tst_nargs_gethostbyaddr_r="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r can be linked" >&5 $as_echo_n "checking if gethostbyaddr_r can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define gethostbyaddr_r innocuous_gethostbyaddr_r #ifdef __STDC__ # include #else # include #endif #undef gethostbyaddr_r #ifdef __cplusplus extern "C" #endif char gethostbyaddr_r (); #if defined __stub_gethostbyaddr_r || defined __stub___gethostbyaddr_r choke me #endif int main (void) { return gethostbyaddr_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_gethostbyaddr_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_gethostbyaddr_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_gethostbyaddr_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r is prototyped" >&5 $as_echo_n "checking if gethostbyaddr_r is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_netdb _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "gethostbyaddr_r" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_gethostbyaddr_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_gethostbyaddr_r="no" fi rm -f conftest* fi # if test "$tst_proto_gethostbyaddr_r" = "yes"; then if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r takes 5 args." >&5 $as_echo_n "checking if gethostbyaddr_r takes 5 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_netdb int main (void) { if(0 != gethostbyaddr_r(0, 0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_gethostbyaddr_r="yes" tst_nargs_gethostbyaddr_r="5" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_gethostbyaddr_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r takes 7 args." >&5 $as_echo_n "checking if gethostbyaddr_r takes 7 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_netdb int main (void) { if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_gethostbyaddr_r="yes" tst_nargs_gethostbyaddr_r="7" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_gethostbyaddr_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r takes 8 args." >&5 $as_echo_n "checking if gethostbyaddr_r takes 8 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_netdb int main (void) { if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_gethostbyaddr_r="yes" tst_nargs_gethostbyaddr_r="8" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_gethostbyaddr_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r is compilable" >&5 $as_echo_n "checking if gethostbyaddr_r is compilable... " >&6; } if test "$tst_compi_gethostbyaddr_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # if test "$tst_compi_gethostbyaddr_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r usage allowed" >&5 $as_echo_n "checking if gethostbyaddr_r usage allowed... " >&6; } if test "x$curl_disallow_gethostbyaddr_r" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_gethostbyaddr_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_gethostbyaddr_r="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r might be used" >&5 $as_echo_n "checking if gethostbyaddr_r might be used... " >&6; } if test "$tst_links_gethostbyaddr_r" = "yes" && test "$tst_proto_gethostbyaddr_r" = "yes" && test "$tst_compi_gethostbyaddr_r" = "yes" && test "$tst_allow_gethostbyaddr_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_GETHOSTBYADDR_R 1 _ACEOF # if test "$tst_nargs_gethostbyaddr_r" -eq "5"; then $as_echo "#define HAVE_GETHOSTBYADDR_R_5 1" >>confdefs.h elif test "$tst_nargs_gethostbyaddr_r" -eq "7"; then $as_echo "#define HAVE_GETHOSTBYADDR_R_7 1" >>confdefs.h elif test "$tst_nargs_gethostbyaddr_r" -eq "8"; then $as_echo "#define HAVE_GETHOSTBYADDR_R_8 1" >>confdefs.h fi # ac_cv_func_gethostbyaddr_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_gethostbyaddr_r="no" fi # tst_links_gethostbyname="unknown" tst_proto_gethostbyname="unknown" tst_compi_gethostbyname="unknown" tst_allow_gethostbyname="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname can be linked" >&5 $as_echo_n "checking if gethostbyname can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_netdb int main (void) { if(0 != gethostbyname(0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_gethostbyname="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_gethostbyname="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_gethostbyname" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname is prototyped" >&5 $as_echo_n "checking if gethostbyname is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_netdb _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "gethostbyname" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_gethostbyname="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_gethostbyname="no" fi rm -f conftest* fi # if test "$tst_proto_gethostbyname" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname is compilable" >&5 $as_echo_n "checking if gethostbyname is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_netdb int main (void) { if(0 != gethostbyname(0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_gethostbyname="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_gethostbyname="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_gethostbyname" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname usage allowed" >&5 $as_echo_n "checking if gethostbyname usage allowed... " >&6; } if test "x$curl_disallow_gethostbyname" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_gethostbyname="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_gethostbyname="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname might be used" >&5 $as_echo_n "checking if gethostbyname might be used... " >&6; } if test "$tst_links_gethostbyname" = "yes" && test "$tst_proto_gethostbyname" = "yes" && test "$tst_compi_gethostbyname" = "yes" && test "$tst_allow_gethostbyname" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_GETHOSTBYNAME 1 _ACEOF ac_cv_func_gethostbyname="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_gethostbyname="no" fi # tst_links_gethostbyname_r="unknown" tst_proto_gethostbyname_r="unknown" tst_compi_gethostbyname_r="unknown" tst_allow_gethostbyname_r="unknown" tst_nargs_gethostbyname_r="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r can be linked" >&5 $as_echo_n "checking if gethostbyname_r can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define gethostbyname_r innocuous_gethostbyname_r #ifdef __STDC__ # include #else # include #endif #undef gethostbyname_r #ifdef __cplusplus extern "C" #endif char gethostbyname_r (); #if defined __stub_gethostbyname_r || defined __stub___gethostbyname_r choke me #endif int main (void) { return gethostbyname_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_gethostbyname_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_gethostbyname_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_gethostbyname_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r is prototyped" >&5 $as_echo_n "checking if gethostbyname_r is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_netdb _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "gethostbyname_r" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_gethostbyname_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_gethostbyname_r="no" fi rm -f conftest* fi # if test "$tst_proto_gethostbyname_r" = "yes"; then if test "$tst_nargs_gethostbyname_r" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r takes 3 args." >&5 $as_echo_n "checking if gethostbyname_r takes 3 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_netdb int main (void) { if(0 != gethostbyname_r(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_gethostbyname_r="yes" tst_nargs_gethostbyname_r="3" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_gethostbyname_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$tst_nargs_gethostbyname_r" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r takes 5 args." >&5 $as_echo_n "checking if gethostbyname_r takes 5 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_netdb int main (void) { if(0 != gethostbyname_r(0, 0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_gethostbyname_r="yes" tst_nargs_gethostbyname_r="5" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_gethostbyname_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$tst_nargs_gethostbyname_r" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r takes 6 args." >&5 $as_echo_n "checking if gethostbyname_r takes 6 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_netdb int main (void) { if(0 != gethostbyname_r(0, 0, 0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_gethostbyname_r="yes" tst_nargs_gethostbyname_r="6" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_gethostbyname_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r is compilable" >&5 $as_echo_n "checking if gethostbyname_r is compilable... " >&6; } if test "$tst_compi_gethostbyname_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # if test "$tst_compi_gethostbyname_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r usage allowed" >&5 $as_echo_n "checking if gethostbyname_r usage allowed... " >&6; } if test "x$curl_disallow_gethostbyname_r" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_gethostbyname_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_gethostbyname_r="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r might be used" >&5 $as_echo_n "checking if gethostbyname_r might be used... " >&6; } if test "$tst_links_gethostbyname_r" = "yes" && test "$tst_proto_gethostbyname_r" = "yes" && test "$tst_compi_gethostbyname_r" = "yes" && test "$tst_allow_gethostbyname_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_GETHOSTBYNAME_R 1 _ACEOF # if test "$tst_nargs_gethostbyname_r" -eq "3"; then $as_echo "#define HAVE_GETHOSTBYNAME_R_3 1" >>confdefs.h elif test "$tst_nargs_gethostbyname_r" -eq "5"; then $as_echo "#define HAVE_GETHOSTBYNAME_R_5 1" >>confdefs.h elif test "$tst_nargs_gethostbyname_r" -eq "6"; then $as_echo "#define HAVE_GETHOSTBYNAME_R_6 1" >>confdefs.h fi # ac_cv_func_gethostbyname_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_gethostbyname_r="no" fi # tst_links_gethostname="unknown" tst_proto_gethostname="unknown" tst_compi_gethostname="unknown" tst_allow_gethostname="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostname can be linked" >&5 $as_echo_n "checking if gethostname can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_unistd int main (void) { if(0 != gethostname(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_gethostname="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_gethostname="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_gethostname" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostname is prototyped" >&5 $as_echo_n "checking if gethostname is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_unistd _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "gethostname" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_gethostname="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_gethostname="no" fi rm -f conftest* fi # if test "$tst_proto_gethostname" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostname is compilable" >&5 $as_echo_n "checking if gethostname is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_unistd int main (void) { if(0 != gethostname(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_gethostname="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_gethostname="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_gethostname" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostname arg 2 data type" >&5 $as_echo_n "checking for gethostname arg 2 data type... " >&6; } tst_gethostname_type_arg2="unknown" for tst_arg1 in 'char *' 'unsigned char *' 'void *'; do for tst_arg2 in 'int' 'unsigned int' 'size_t'; do if test "$tst_gethostname_type_arg2" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_unistd $curl_preprocess_callconv extern int FUNCALLCONV gethostname($tst_arg1, $tst_arg2); int main (void) { if(0 != gethostname(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tst_gethostname_type_arg2="$tst_arg2" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi done done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_gethostname_type_arg2" >&5 $as_echo "$tst_gethostname_type_arg2" >&6; } if test "$tst_gethostname_type_arg2" != "unknown"; then cat >>confdefs.h <<_ACEOF #define GETHOSTNAME_TYPE_ARG2 $tst_gethostname_type_arg2 _ACEOF fi fi # if test "$tst_compi_gethostname" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostname usage allowed" >&5 $as_echo_n "checking if gethostname usage allowed... " >&6; } if test "x$curl_disallow_gethostname" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_gethostname="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_gethostname="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostname might be used" >&5 $as_echo_n "checking if gethostname might be used... " >&6; } if test "$tst_links_gethostname" = "yes" && test "$tst_proto_gethostname" = "yes" && test "$tst_compi_gethostname" = "yes" && test "$tst_allow_gethostname" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_GETHOSTNAME 1 _ACEOF ac_cv_func_gethostname="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_gethostname="no" fi # tst_links_getifaddrs="unknown" tst_proto_getifaddrs="unknown" tst_compi_getifaddrs="unknown" tst_works_getifaddrs="unknown" tst_allow_getifaddrs="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getifaddrs can be linked" >&5 $as_echo_n "checking if getifaddrs can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define getifaddrs innocuous_getifaddrs #ifdef __STDC__ # include #else # include #endif #undef getifaddrs #ifdef __cplusplus extern "C" #endif char getifaddrs (); #if defined __stub_getifaddrs || defined __stub___getifaddrs choke me #endif int main (void) { return getifaddrs (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_getifaddrs="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_getifaddrs="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_getifaddrs" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getifaddrs is prototyped" >&5 $as_echo_n "checking if getifaddrs is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_ifaddrs _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "getifaddrs" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_getifaddrs="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_getifaddrs="no" fi rm -f conftest* fi # if test "$tst_proto_getifaddrs" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getifaddrs is compilable" >&5 $as_echo_n "checking if getifaddrs is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_ifaddrs int main (void) { if(0 != getifaddrs(0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_getifaddrs="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_getifaddrs="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "x$cross_compiling" != "xyes" && test "$tst_compi_getifaddrs" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getifaddrs seems to work" >&5 $as_echo_n "checking if getifaddrs seems to work... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdlib $curl_includes_ifaddrs int main (void) { struct ifaddrs *ifa = 0; int error; error = getifaddrs(&ifa); if(error || !ifa) exit(1); /* fail */ else exit(0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_works_getifaddrs="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_works_getifaddrs="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi # if test "$tst_compi_getifaddrs" = "yes" && test "$tst_works_getifaddrs" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getifaddrs usage allowed" >&5 $as_echo_n "checking if getifaddrs usage allowed... " >&6; } if test "x$curl_disallow_getifaddrs" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_getifaddrs="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_getifaddrs="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getifaddrs might be used" >&5 $as_echo_n "checking if getifaddrs might be used... " >&6; } if test "$tst_links_getifaddrs" = "yes" && test "$tst_proto_getifaddrs" = "yes" && test "$tst_compi_getifaddrs" = "yes" && test "$tst_allow_getifaddrs" = "yes" && test "$tst_works_getifaddrs" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_GETIFADDRS 1 _ACEOF ac_cv_func_getifaddrs="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_getifaddrs="no" fi # tst_links_getservbyport_r="unknown" tst_proto_getservbyport_r="unknown" tst_compi_getservbyport_r="unknown" tst_allow_getservbyport_r="unknown" tst_nargs_getservbyport_r="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r can be linked" >&5 $as_echo_n "checking if getservbyport_r can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define getservbyport_r innocuous_getservbyport_r #ifdef __STDC__ # include #else # include #endif #undef getservbyport_r #ifdef __cplusplus extern "C" #endif char getservbyport_r (); #if defined __stub_getservbyport_r || defined __stub___getservbyport_r choke me #endif int main (void) { return getservbyport_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_getservbyport_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_getservbyport_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_getservbyport_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r is prototyped" >&5 $as_echo_n "checking if getservbyport_r is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_netdb _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "getservbyport_r" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_getservbyport_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_getservbyport_r="no" fi rm -f conftest* fi # if test "$tst_proto_getservbyport_r" = "yes"; then if test "$tst_nargs_getservbyport_r" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r takes 4 args." >&5 $as_echo_n "checking if getservbyport_r takes 4 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_netdb int main (void) { if(0 != getservbyport_r(0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_getservbyport_r="yes" tst_nargs_getservbyport_r="4" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_getservbyport_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$tst_nargs_getservbyport_r" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r takes 5 args." >&5 $as_echo_n "checking if getservbyport_r takes 5 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_netdb int main (void) { if(0 != getservbyport_r(0, 0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_getservbyport_r="yes" tst_nargs_getservbyport_r="5" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_getservbyport_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$tst_nargs_getservbyport_r" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r takes 6 args." >&5 $as_echo_n "checking if getservbyport_r takes 6 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_netdb int main (void) { if(0 != getservbyport_r(0, 0, 0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_getservbyport_r="yes" tst_nargs_getservbyport_r="6" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_getservbyport_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r is compilable" >&5 $as_echo_n "checking if getservbyport_r is compilable... " >&6; } if test "$tst_compi_getservbyport_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # if test "$tst_compi_getservbyport_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r usage allowed" >&5 $as_echo_n "checking if getservbyport_r usage allowed... " >&6; } if test "x$curl_disallow_getservbyport_r" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_getservbyport_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_getservbyport_r="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r might be used" >&5 $as_echo_n "checking if getservbyport_r might be used... " >&6; } if test "$tst_links_getservbyport_r" = "yes" && test "$tst_proto_getservbyport_r" = "yes" && test "$tst_compi_getservbyport_r" = "yes" && test "$tst_allow_getservbyport_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_GETSERVBYPORT_R 1 _ACEOF cat >>confdefs.h <<_ACEOF #define GETSERVBYPORT_R_ARGS $tst_nargs_getservbyport_r _ACEOF if test "$tst_nargs_getservbyport_r" -eq "4"; then $as_echo "#define GETSERVBYPORT_R_BUFSIZE sizeof(struct servent_data)" >>confdefs.h else $as_echo "#define GETSERVBYPORT_R_BUFSIZE 4096" >>confdefs.h fi ac_cv_func_getservbyport_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_getservbyport_r="no" fi curl_includes_time="\ /* includes start */ #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 /* includes end */" for ac_header in sys/types.h sys/time.h time.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_time " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_gmtime_r="unknown" tst_proto_gmtime_r="unknown" tst_compi_gmtime_r="unknown" tst_works_gmtime_r="unknown" tst_allow_gmtime_r="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gmtime_r can be linked" >&5 $as_echo_n "checking if gmtime_r can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define gmtime_r innocuous_gmtime_r #ifdef __STDC__ # include #else # include #endif #undef gmtime_r #ifdef __cplusplus extern "C" #endif char gmtime_r (); #if defined __stub_gmtime_r || defined __stub___gmtime_r choke me #endif int main (void) { return gmtime_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_gmtime_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_gmtime_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_gmtime_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gmtime_r is prototyped" >&5 $as_echo_n "checking if gmtime_r is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_time _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "gmtime_r" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_gmtime_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_gmtime_r="no" fi rm -f conftest* fi # if test "$tst_proto_gmtime_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gmtime_r is compilable" >&5 $as_echo_n "checking if gmtime_r is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_time int main (void) { if(0 != gmtime_r(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_gmtime_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_gmtime_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "x$cross_compiling" != "xyes" && test "$tst_compi_gmtime_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gmtime_r seems to work" >&5 $as_echo_n "checking if gmtime_r seems to work... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdlib $curl_includes_time int main (void) { time_t local = 1170352587; struct tm *gmt = 0; struct tm result; gmt = gmtime_r(&local, &result); if(gmt) exit(0); else exit(1); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_works_gmtime_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_works_gmtime_r="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi # if test "$tst_compi_gmtime_r" = "yes" && test "$tst_works_gmtime_r" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gmtime_r usage allowed" >&5 $as_echo_n "checking if gmtime_r usage allowed... " >&6; } if test "x$curl_disallow_gmtime_r" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_gmtime_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_gmtime_r="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gmtime_r might be used" >&5 $as_echo_n "checking if gmtime_r might be used... " >&6; } if test "$tst_links_gmtime_r" = "yes" && test "$tst_proto_gmtime_r" = "yes" && test "$tst_compi_gmtime_r" = "yes" && test "$tst_allow_gmtime_r" = "yes" && test "$tst_works_gmtime_r" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_GMTIME_R 1 _ACEOF ac_cv_func_gmtime_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_gmtime_r="no" fi curl_includes_arpa_inet="\ /* includes start */ #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 /* includes end */" for ac_header in sys/types.h sys/socket.h netinet/in.h arpa/inet.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_arpa_inet " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_inet_ntoa_r="unknown" tst_proto_inet_ntoa_r="unknown" tst_compi_inet_ntoa_r="unknown" tst_allow_inet_ntoa_r="unknown" tst_nargs_inet_ntoa_r="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntoa_r can be linked" >&5 $as_echo_n "checking if inet_ntoa_r can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define inet_ntoa_r innocuous_inet_ntoa_r #ifdef __STDC__ # include #else # include #endif #undef inet_ntoa_r #ifdef __cplusplus extern "C" #endif char inet_ntoa_r (); #if defined __stub_inet_ntoa_r || defined __stub___inet_ntoa_r choke me #endif int main (void) { return inet_ntoa_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_inet_ntoa_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_inet_ntoa_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_inet_ntoa_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntoa_r is prototyped" >&5 $as_echo_n "checking if inet_ntoa_r is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_arpa_inet _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "inet_ntoa_r" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_inet_ntoa_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_inet_ntoa_r="no" fi rm -f conftest* fi # if test "$tst_proto_inet_ntoa_r" = "yes"; then if test "$tst_nargs_inet_ntoa_r" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntoa_r takes 2 args." >&5 $as_echo_n "checking if inet_ntoa_r takes 2 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_arpa_inet int main (void) { struct in_addr addr; if(0 != inet_ntoa_r(addr, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_inet_ntoa_r="yes" tst_nargs_inet_ntoa_r="2" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_inet_ntoa_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$tst_nargs_inet_ntoa_r" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntoa_r takes 3 args." >&5 $as_echo_n "checking if inet_ntoa_r takes 3 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_arpa_inet int main (void) { struct in_addr addr; if(0 != inet_ntoa_r(addr, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_inet_ntoa_r="yes" tst_nargs_inet_ntoa_r="3" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_inet_ntoa_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntoa_r is compilable" >&5 $as_echo_n "checking if inet_ntoa_r is compilable... " >&6; } if test "$tst_compi_inet_ntoa_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # if test "$tst_compi_inet_ntoa_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntoa_r usage allowed" >&5 $as_echo_n "checking if inet_ntoa_r usage allowed... " >&6; } if test "x$curl_disallow_inet_ntoa_r" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_inet_ntoa_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_inet_ntoa_r="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntoa_r might be used" >&5 $as_echo_n "checking if inet_ntoa_r might be used... " >&6; } if test "$tst_links_inet_ntoa_r" = "yes" && test "$tst_proto_inet_ntoa_r" = "yes" && test "$tst_compi_inet_ntoa_r" = "yes" && test "$tst_allow_inet_ntoa_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_INET_NTOA_R 1 _ACEOF # if test "$tst_nargs_inet_ntoa_r" -eq "2"; then $as_echo "#define HAVE_INET_NTOA_R_2 1" >>confdefs.h elif test "$tst_nargs_inet_ntoa_r" -eq "3"; then $as_echo "#define HAVE_INET_NTOA_R_3 1" >>confdefs.h fi # ac_cv_func_inet_ntoa_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_inet_ntoa_r="no" fi # tst_links_inet_ntop="unknown" tst_proto_inet_ntop="unknown" tst_compi_inet_ntop="unknown" tst_works_inet_ntop="unknown" tst_allow_inet_ntop="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntop can be linked" >&5 $as_echo_n "checking if inet_ntop can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define inet_ntop innocuous_inet_ntop #ifdef __STDC__ # include #else # include #endif #undef inet_ntop #ifdef __cplusplus extern "C" #endif char inet_ntop (); #if defined __stub_inet_ntop || defined __stub___inet_ntop choke me #endif int main (void) { return inet_ntop (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_inet_ntop="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_inet_ntop="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_inet_ntop" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntop is prototyped" >&5 $as_echo_n "checking if inet_ntop is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_arpa_inet _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "inet_ntop" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_inet_ntop="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_inet_ntop="no" fi rm -f conftest* fi # if test "$tst_proto_inet_ntop" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntop is compilable" >&5 $as_echo_n "checking if inet_ntop is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_arpa_inet int main (void) { if(0 != inet_ntop(0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_inet_ntop="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_inet_ntop="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "x$cross_compiling" != "xyes" && test "$tst_compi_inet_ntop" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntop seems to work" >&5 $as_echo_n "checking if inet_ntop seems to work... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdlib $curl_includes_arpa_inet $curl_includes_string int main (void) { char ipv6res[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; char ipv4res[sizeof "255.255.255.255"]; unsigned char ipv6a[26]; unsigned char ipv4a[5]; char *ipv6ptr = 0; char *ipv4ptr = 0; /* - */ ipv4res[0] = '\0'; ipv4a[0] = 0xc0; ipv4a[1] = 0xa8; ipv4a[2] = 0x64; ipv4a[3] = 0x01; ipv4a[4] = 0x01; /* - */ ipv4ptr = inet_ntop(AF_INET, ipv4a, ipv4res, sizeof(ipv4res)); if(!ipv4ptr) exit(1); /* fail */ if(ipv4ptr != ipv4res) exit(1); /* fail */ if(!ipv4ptr[0]) exit(1); /* fail */ if(memcmp(ipv4res, "192.168.100.1", 13) != 0) exit(1); /* fail */ /* - */ ipv6res[0] = '\0'; memset(ipv6a, 0, sizeof(ipv6a)); ipv6a[0] = 0xfe; ipv6a[1] = 0x80; ipv6a[8] = 0x02; ipv6a[9] = 0x14; ipv6a[10] = 0x4f; ipv6a[11] = 0xff; ipv6a[12] = 0xfe; ipv6a[13] = 0x0b; ipv6a[14] = 0x76; ipv6a[15] = 0xc8; ipv6a[25] = 0x01; /* - */ ipv6ptr = inet_ntop(AF_INET6, ipv6a, ipv6res, sizeof(ipv6res)); if(!ipv6ptr) exit(1); /* fail */ if(ipv6ptr != ipv6res) exit(1); /* fail */ if(!ipv6ptr[0]) exit(1); /* fail */ if(memcmp(ipv6res, "fe80::214:4fff:fe0b:76c8", 24) != 0) exit(1); /* fail */ /* - */ exit(0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_works_inet_ntop="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_works_inet_ntop="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi # if test "$tst_compi_inet_ntop" = "yes" && test "$tst_works_inet_ntop" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntop usage allowed" >&5 $as_echo_n "checking if inet_ntop usage allowed... " >&6; } if test "x$curl_disallow_inet_ntop" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_inet_ntop="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_inet_ntop="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntop might be used" >&5 $as_echo_n "checking if inet_ntop might be used... " >&6; } if test "$tst_links_inet_ntop" = "yes" && test "$tst_proto_inet_ntop" = "yes" && test "$tst_compi_inet_ntop" = "yes" && test "$tst_allow_inet_ntop" = "yes" && test "$tst_works_inet_ntop" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_INET_NTOP 1 _ACEOF ac_cv_func_inet_ntop="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_inet_ntop="no" fi # tst_links_inet_pton="unknown" tst_proto_inet_pton="unknown" tst_compi_inet_pton="unknown" tst_works_inet_pton="unknown" tst_allow_inet_pton="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_pton can be linked" >&5 $as_echo_n "checking if inet_pton can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define inet_pton innocuous_inet_pton #ifdef __STDC__ # include #else # include #endif #undef inet_pton #ifdef __cplusplus extern "C" #endif char inet_pton (); #if defined __stub_inet_pton || defined __stub___inet_pton choke me #endif int main (void) { return inet_pton (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_inet_pton="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_inet_pton="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_inet_pton" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_pton is prototyped" >&5 $as_echo_n "checking if inet_pton is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_arpa_inet _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "inet_pton" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_inet_pton="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_inet_pton="no" fi rm -f conftest* fi # if test "$tst_proto_inet_pton" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_pton is compilable" >&5 $as_echo_n "checking if inet_pton is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_arpa_inet int main (void) { if(0 != inet_pton(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_inet_pton="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_inet_pton="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "x$cross_compiling" != "xyes" && test "$tst_compi_inet_pton" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_pton seems to work" >&5 $as_echo_n "checking if inet_pton seems to work... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdlib $curl_includes_arpa_inet $curl_includes_string int main (void) { unsigned char ipv6a[16+1]; unsigned char ipv4a[4+1]; const char *ipv6src = "fe80::214:4fff:fe0b:76c8"; const char *ipv4src = "192.168.100.1"; /* - */ memset(ipv4a, 1, sizeof(ipv4a)); if(1 != inet_pton(AF_INET, ipv4src, ipv4a)) exit(1); /* fail */ /* - */ if( (ipv4a[0] != 0xc0) || (ipv4a[1] != 0xa8) || (ipv4a[2] != 0x64) || (ipv4a[3] != 0x01) || (ipv4a[4] != 0x01) ) exit(1); /* fail */ /* - */ memset(ipv6a, 1, sizeof(ipv6a)); if(1 != inet_pton(AF_INET6, ipv6src, ipv6a)) exit(1); /* fail */ /* - */ if( (ipv6a[0] != 0xfe) || (ipv6a[1] != 0x80) || (ipv6a[8] != 0x02) || (ipv6a[9] != 0x14) || (ipv6a[10] != 0x4f) || (ipv6a[11] != 0xff) || (ipv6a[12] != 0xfe) || (ipv6a[13] != 0x0b) || (ipv6a[14] != 0x76) || (ipv6a[15] != 0xc8) || (ipv6a[16] != 0x01) ) exit(1); /* fail */ /* - */ if( (ipv6a[2] != 0x0) || (ipv6a[3] != 0x0) || (ipv6a[4] != 0x0) || (ipv6a[5] != 0x0) || (ipv6a[6] != 0x0) || (ipv6a[7] != 0x0) ) exit(1); /* fail */ /* - */ exit(0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_works_inet_pton="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_works_inet_pton="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi # if test "$tst_compi_inet_pton" = "yes" && test "$tst_works_inet_pton" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_pton usage allowed" >&5 $as_echo_n "checking if inet_pton usage allowed... " >&6; } if test "x$curl_disallow_inet_pton" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_inet_pton="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_inet_pton="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_pton might be used" >&5 $as_echo_n "checking if inet_pton might be used... " >&6; } if test "$tst_links_inet_pton" = "yes" && test "$tst_proto_inet_pton" = "yes" && test "$tst_compi_inet_pton" = "yes" && test "$tst_allow_inet_pton" = "yes" && test "$tst_works_inet_pton" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_INET_PTON 1 _ACEOF ac_cv_func_inet_pton="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_inet_pton="no" fi curl_includes_stropts="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_STROPTS_H # include #endif /* includes end */" for ac_header in sys/types.h unistd.h sys/socket.h sys/ioctl.h stropts.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_stropts " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_ioctl="unknown" tst_proto_ioctl="unknown" tst_compi_ioctl="unknown" tst_allow_ioctl="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl can be linked" >&5 $as_echo_n "checking if ioctl can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define ioctl innocuous_ioctl #ifdef __STDC__ # include #else # include #endif #undef ioctl #ifdef __cplusplus extern "C" #endif char ioctl (); #if defined __stub_ioctl || defined __stub___ioctl choke me #endif int main (void) { return ioctl (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_ioctl="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_ioctl="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_ioctl" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl is prototyped" >&5 $as_echo_n "checking if ioctl is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stropts _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "ioctl" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_ioctl="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_ioctl="no" fi rm -f conftest* fi # if test "$tst_proto_ioctl" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl is compilable" >&5 $as_echo_n "checking if ioctl is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stropts int main (void) { if(0 != ioctl(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_ioctl="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_ioctl="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_ioctl" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl usage allowed" >&5 $as_echo_n "checking if ioctl usage allowed... " >&6; } if test "x$curl_disallow_ioctl" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_ioctl="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_ioctl="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl might be used" >&5 $as_echo_n "checking if ioctl might be used... " >&6; } if test "$tst_links_ioctl" = "yes" && test "$tst_proto_ioctl" = "yes" && test "$tst_compi_ioctl" = "yes" && test "$tst_allow_ioctl" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_IOCTL 1 _ACEOF ac_cv_func_ioctl="yes" # tst_compi_ioctl_fionbio="unknown" tst_allow_ioctl_fionbio="unknown" # if test "$ac_cv_func_ioctl" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl FIONBIO is compilable" >&5 $as_echo_n "checking if ioctl FIONBIO is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stropts int main (void) { int flags = 0; if(0 != ioctl(0, FIONBIO, &flags)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_ioctl_fionbio="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_ioctl_fionbio="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_ioctl_fionbio" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl FIONBIO usage allowed" >&5 $as_echo_n "checking if ioctl FIONBIO usage allowed... " >&6; } if test "x$curl_disallow_ioctl_fionbio" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_ioctl_fionbio="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_ioctl_fionbio="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl FIONBIO might be used" >&5 $as_echo_n "checking if ioctl FIONBIO might be used... " >&6; } if test "$tst_compi_ioctl_fionbio" = "yes" && test "$tst_allow_ioctl_fionbio" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_IOCTL_FIONBIO 1 _ACEOF ac_cv_func_ioctl_fionbio="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_ioctl_fionbio="no" fi # tst_compi_ioctl_siocgifaddr="unknown" tst_allow_ioctl_siocgifaddr="unknown" # if test "$ac_cv_func_ioctl" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl SIOCGIFADDR is compilable" >&5 $as_echo_n "checking if ioctl SIOCGIFADDR is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stropts #include int main (void) { struct ifreq ifr; if(0 != ioctl(0, SIOCGIFADDR, &ifr)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_ioctl_siocgifaddr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_ioctl_siocgifaddr="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_ioctl_siocgifaddr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl SIOCGIFADDR usage allowed" >&5 $as_echo_n "checking if ioctl SIOCGIFADDR usage allowed... " >&6; } if test "x$curl_disallow_ioctl_siocgifaddr" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_ioctl_siocgifaddr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_ioctl_siocgifaddr="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl SIOCGIFADDR might be used" >&5 $as_echo_n "checking if ioctl SIOCGIFADDR might be used... " >&6; } if test "$tst_compi_ioctl_siocgifaddr" = "yes" && test "$tst_allow_ioctl_siocgifaddr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_IOCTL_SIOCGIFADDR 1 _ACEOF ac_cv_func_ioctl_siocgifaddr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_ioctl_siocgifaddr="no" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_ioctl="no" fi # tst_links_ioctlsocket="unknown" tst_proto_ioctlsocket="unknown" tst_compi_ioctlsocket="unknown" tst_allow_ioctlsocket="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket can be linked" >&5 $as_echo_n "checking if ioctlsocket can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 int main (void) { if(0 != ioctlsocket(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_ioctlsocket="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_ioctlsocket="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_ioctlsocket" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket is prototyped" >&5 $as_echo_n "checking if ioctlsocket is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "ioctlsocket" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_ioctlsocket="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_ioctlsocket="no" fi rm -f conftest* fi # if test "$tst_proto_ioctlsocket" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket is compilable" >&5 $as_echo_n "checking if ioctlsocket is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 int main (void) { if(0 != ioctlsocket(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_ioctlsocket="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_ioctlsocket="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_ioctlsocket" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket usage allowed" >&5 $as_echo_n "checking if ioctlsocket usage allowed... " >&6; } if test "x$curl_disallow_ioctlsocket" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_ioctlsocket="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_ioctlsocket="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket might be used" >&5 $as_echo_n "checking if ioctlsocket might be used... " >&6; } if test "$tst_links_ioctlsocket" = "yes" && test "$tst_proto_ioctlsocket" = "yes" && test "$tst_compi_ioctlsocket" = "yes" && test "$tst_allow_ioctlsocket" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_IOCTLSOCKET 1 _ACEOF ac_cv_func_ioctlsocket="yes" # tst_compi_ioctlsocket_fionbio="unknown" tst_allow_ioctlsocket_fionbio="unknown" # if test "$ac_cv_func_ioctlsocket" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket FIONBIO is compilable" >&5 $as_echo_n "checking if ioctlsocket FIONBIO is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 int main (void) { int flags = 0; if(0 != ioctlsocket(0, FIONBIO, &flags)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_ioctlsocket_fionbio="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_ioctlsocket_fionbio="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_ioctlsocket_fionbio" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket FIONBIO usage allowed" >&5 $as_echo_n "checking if ioctlsocket FIONBIO usage allowed... " >&6; } if test "x$curl_disallow_ioctlsocket_fionbio" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_ioctlsocket_fionbio="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_ioctlsocket_fionbio="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket FIONBIO might be used" >&5 $as_echo_n "checking if ioctlsocket FIONBIO might be used... " >&6; } if test "$tst_compi_ioctlsocket_fionbio" = "yes" && test "$tst_allow_ioctlsocket_fionbio" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_IOCTLSOCKET_FIONBIO 1 _ACEOF ac_cv_func_ioctlsocket_fionbio="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_ioctlsocket_fionbio="no" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_ioctlsocket="no" fi # tst_links_ioctlsocket_camel="unknown" tst_proto_ioctlsocket_camel="unknown" tst_compi_ioctlsocket_camel="unknown" tst_allow_ioctlsocket_camel="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket can be linked" >&5 $as_echo_n "checking if IoctlSocket can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define IoctlSocket innocuous_IoctlSocket #ifdef __STDC__ # include #else # include #endif #undef IoctlSocket #ifdef __cplusplus extern "C" #endif char IoctlSocket (); #if defined __stub_IoctlSocket || defined __stub___IoctlSocket choke me #endif int main (void) { return IoctlSocket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_ioctlsocket_camel="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_ioctlsocket_camel="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_ioctlsocket_camel" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket is prototyped" >&5 $as_echo_n "checking if IoctlSocket is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stropts _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "IoctlSocket" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_ioctlsocket_camel="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_ioctlsocket_camel="no" fi rm -f conftest* fi # if test "$tst_proto_ioctlsocket_camel" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket is compilable" >&5 $as_echo_n "checking if IoctlSocket is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stropts int main (void) { if(0 != IoctlSocket(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_ioctlsocket_camel="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_ioctlsocket_camel="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_ioctlsocket_camel" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket usage allowed" >&5 $as_echo_n "checking if IoctlSocket usage allowed... " >&6; } if test "x$curl_disallow_ioctlsocket_camel" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_ioctlsocket_camel="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_ioctlsocket_camel="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket might be used" >&5 $as_echo_n "checking if IoctlSocket might be used... " >&6; } if test "$tst_links_ioctlsocket_camel" = "yes" && test "$tst_proto_ioctlsocket_camel" = "yes" && test "$tst_compi_ioctlsocket_camel" = "yes" && test "$tst_allow_ioctlsocket_camel" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_IOCTLSOCKET_CAMEL 1 _ACEOF ac_cv_func_ioctlsocket_camel="yes" # tst_compi_ioctlsocket_camel_fionbio="unknown" tst_allow_ioctlsocket_camel_fionbio="unknown" # if test "$ac_cv_func_ioctlsocket_camel" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket FIONBIO is compilable" >&5 $as_echo_n "checking if IoctlSocket FIONBIO is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stropts int main (void) { long flags = 0; if(0 != ioctlsocket(0, FIONBIO, &flags)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_ioctlsocket_camel_fionbio="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_ioctlsocket_camel_fionbio="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket FIONBIO usage allowed" >&5 $as_echo_n "checking if IoctlSocket FIONBIO usage allowed... " >&6; } if test "x$curl_disallow_ioctlsocket_camel_fionbio" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_ioctlsocket_camel_fionbio="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_ioctlsocket_camel_fionbio="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket FIONBIO might be used" >&5 $as_echo_n "checking if IoctlSocket FIONBIO might be used... " >&6; } if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes" && test "$tst_allow_ioctlsocket_camel_fionbio" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_IOCTLSOCKET_CAMEL_FIONBIO 1 _ACEOF ac_cv_func_ioctlsocket_camel_fionbio="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_ioctlsocket_camel_fionbio="no" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_ioctlsocket_camel="no" fi # tst_links_localtime_r="unknown" tst_proto_localtime_r="unknown" tst_compi_localtime_r="unknown" tst_works_localtime_r="unknown" tst_allow_localtime_r="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if localtime_r can be linked" >&5 $as_echo_n "checking if localtime_r can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define localtime_r innocuous_localtime_r #ifdef __STDC__ # include #else # include #endif #undef localtime_r #ifdef __cplusplus extern "C" #endif char localtime_r (); #if defined __stub_localtime_r || defined __stub___localtime_r choke me #endif int main (void) { return localtime_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_localtime_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_localtime_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_localtime_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if localtime_r is prototyped" >&5 $as_echo_n "checking if localtime_r is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_time _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "localtime_r" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_localtime_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_localtime_r="no" fi rm -f conftest* fi # if test "$tst_proto_localtime_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if localtime_r is compilable" >&5 $as_echo_n "checking if localtime_r is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_time int main (void) { if(0 != localtime_r(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_localtime_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_localtime_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "x$cross_compiling" != "xyes" && test "$tst_compi_localtime_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if localtime_r seems to work" >&5 $as_echo_n "checking if localtime_r seems to work... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdlib $curl_includes_time int main (void) { time_t clock = 1170352587; struct tm *tmp = 0; struct tm result; tmp = localtime_r(&clock, &result); if(tmp) exit(0); else exit(1); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_works_localtime_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_works_localtime_r="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi # if test "$tst_compi_localtime_r" = "yes" && test "$tst_works_localtime_r" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if localtime_r usage allowed" >&5 $as_echo_n "checking if localtime_r usage allowed... " >&6; } if test "x$curl_disallow_localtime_r" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_localtime_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_localtime_r="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if localtime_r might be used" >&5 $as_echo_n "checking if localtime_r might be used... " >&6; } if test "$tst_links_localtime_r" = "yes" && test "$tst_proto_localtime_r" = "yes" && test "$tst_compi_localtime_r" = "yes" && test "$tst_allow_localtime_r" = "yes" && test "$tst_works_localtime_r" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_LOCALTIME_R 1 _ACEOF ac_cv_func_localtime_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_localtime_r="no" fi # tst_links_memrchr="unknown" tst_macro_memrchr="unknown" tst_proto_memrchr="unknown" tst_compi_memrchr="unknown" tst_allow_memrchr="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if memrchr can be linked" >&5 $as_echo_n "checking if memrchr can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define memrchr innocuous_memrchr #ifdef __STDC__ # include #else # include #endif #undef memrchr #ifdef __cplusplus extern "C" #endif char memrchr (); #if defined __stub_memrchr || defined __stub___memrchr choke me #endif int main (void) { return memrchr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_memrchr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_memrchr="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_memrchr" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if memrchr seems a macro" >&5 $as_echo_n "checking if memrchr seems a macro... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string int main (void) { if(0 != memrchr(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_macro_memrchr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_macro_memrchr="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # if test "$tst_links_memrchr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if memrchr is prototyped" >&5 $as_echo_n "checking if memrchr is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memrchr" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_memrchr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_memrchr="no" fi rm -f conftest* fi # if test "$tst_proto_memrchr" = "yes" || test "$tst_macro_memrchr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if memrchr is compilable" >&5 $as_echo_n "checking if memrchr is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string int main (void) { if(0 != memrchr(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_memrchr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_memrchr="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_memrchr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if memrchr usage allowed" >&5 $as_echo_n "checking if memrchr usage allowed... " >&6; } if test "x$curl_disallow_memrchr" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_memrchr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_memrchr="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if memrchr might be used" >&5 $as_echo_n "checking if memrchr might be used... " >&6; } if (test "$tst_proto_memrchr" = "yes" || test "$tst_macro_memrchr" = "yes") && test "$tst_compi_memrchr" = "yes" && test "$tst_allow_memrchr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_MEMRCHR 1 _ACEOF ac_cv_func_memrchr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_memrchr="no" fi # tst_links_poll="unknown" tst_proto_poll="unknown" tst_compi_poll="unknown" tst_works_poll="unknown" tst_allow_poll="unknown" # case $host_os in darwin*|interix*) curl_disallow_poll="yes" ;; esac # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if poll can be linked" >&5 $as_echo_n "checking if poll can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_poll int main (void) { if(0 != poll(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_poll="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_poll="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_poll" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if poll is prototyped" >&5 $as_echo_n "checking if poll is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_poll _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "poll" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_poll="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_poll="no" fi rm -f conftest* fi # if test "$tst_proto_poll" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if poll is compilable" >&5 $as_echo_n "checking if poll is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_poll int main (void) { if(0 != poll(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_poll="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_poll="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "x$cross_compiling" != "xyes" && test "$tst_compi_poll" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if poll seems to work" >&5 $as_echo_n "checking if poll seems to work... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdlib $curl_includes_poll int main (void) { if(0 != poll(0, 0, 10)) exit(1); /* fail */ else exit(0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_works_poll="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_works_poll="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi # if test "$tst_compi_poll" = "yes" && test "$tst_works_poll" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if poll usage allowed" >&5 $as_echo_n "checking if poll usage allowed... " >&6; } if test "x$curl_disallow_poll" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_poll="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_poll="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if poll might be used" >&5 $as_echo_n "checking if poll might be used... " >&6; } if test "$tst_links_poll" = "yes" && test "$tst_proto_poll" = "yes" && test "$tst_compi_poll" = "yes" && test "$tst_allow_poll" = "yes" && test "$tst_works_poll" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_POLL 1 _ACEOF cat >>confdefs.h <<_ACEOF #define HAVE_POLL_FINE 1 _ACEOF ac_cv_func_poll="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_poll="no" fi # tst_links_setsockopt="unknown" tst_proto_setsockopt="unknown" tst_compi_setsockopt="unknown" tst_allow_setsockopt="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt can be linked" >&5 $as_echo_n "checking if setsockopt can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_sys_socket int main (void) { if(0 != setsockopt(0, 0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_setsockopt="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_setsockopt="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_setsockopt" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt is prototyped" >&5 $as_echo_n "checking if setsockopt is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_sys_socket _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "setsockopt" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_setsockopt="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_setsockopt="no" fi rm -f conftest* fi # if test "$tst_proto_setsockopt" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt is compilable" >&5 $as_echo_n "checking if setsockopt is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_sys_socket int main (void) { if(0 != setsockopt(0, 0, 0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_setsockopt="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_setsockopt="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_setsockopt" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt usage allowed" >&5 $as_echo_n "checking if setsockopt usage allowed... " >&6; } if test "x$curl_disallow_setsockopt" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_setsockopt="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_setsockopt="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt might be used" >&5 $as_echo_n "checking if setsockopt might be used... " >&6; } if test "$tst_links_setsockopt" = "yes" && test "$tst_proto_setsockopt" = "yes" && test "$tst_compi_setsockopt" = "yes" && test "$tst_allow_setsockopt" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_SETSOCKOPT 1 _ACEOF ac_cv_func_setsockopt="yes" # tst_compi_setsockopt_so_nonblock="unknown" tst_allow_setsockopt_so_nonblock="unknown" # if test "$ac_cv_func_setsockopt" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt SO_NONBLOCK is compilable" >&5 $as_echo_n "checking if setsockopt SO_NONBLOCK is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_sys_socket int main (void) { if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_setsockopt_so_nonblock="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_setsockopt_so_nonblock="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_setsockopt_so_nonblock" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt SO_NONBLOCK usage allowed" >&5 $as_echo_n "checking if setsockopt SO_NONBLOCK usage allowed... " >&6; } if test "x$curl_disallow_setsockopt_so_nonblock" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_setsockopt_so_nonblock="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_setsockopt_so_nonblock="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt SO_NONBLOCK might be used" >&5 $as_echo_n "checking if setsockopt SO_NONBLOCK might be used... " >&6; } if test "$tst_compi_setsockopt_so_nonblock" = "yes" && test "$tst_allow_setsockopt_so_nonblock" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_SETSOCKOPT_SO_NONBLOCK 1 _ACEOF ac_cv_func_setsockopt_so_nonblock="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_setsockopt_so_nonblock="no" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_setsockopt="no" fi curl_includes_signal="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif /* includes end */" for ac_header in sys/types.h signal.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_signal " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_sigaction="unknown" tst_proto_sigaction="unknown" tst_compi_sigaction="unknown" tst_allow_sigaction="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigaction can be linked" >&5 $as_echo_n "checking if sigaction can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define sigaction innocuous_sigaction #ifdef __STDC__ # include #else # include #endif #undef sigaction #ifdef __cplusplus extern "C" #endif char sigaction (); #if defined __stub_sigaction || defined __stub___sigaction choke me #endif int main (void) { return sigaction (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_sigaction="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_sigaction="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_sigaction" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigaction is prototyped" >&5 $as_echo_n "checking if sigaction is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_signal _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sigaction" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_sigaction="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_sigaction="no" fi rm -f conftest* fi # if test "$tst_proto_sigaction" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigaction is compilable" >&5 $as_echo_n "checking if sigaction is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_signal int main (void) { if(0 != sigaction(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_sigaction="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_sigaction="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_sigaction" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigaction usage allowed" >&5 $as_echo_n "checking if sigaction usage allowed... " >&6; } if test "x$curl_disallow_sigaction" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_sigaction="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_sigaction="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigaction might be used" >&5 $as_echo_n "checking if sigaction might be used... " >&6; } if test "$tst_links_sigaction" = "yes" && test "$tst_proto_sigaction" = "yes" && test "$tst_compi_sigaction" = "yes" && test "$tst_allow_sigaction" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_SIGACTION 1 _ACEOF ac_cv_func_sigaction="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_sigaction="no" fi # tst_links_siginterrupt="unknown" tst_proto_siginterrupt="unknown" tst_compi_siginterrupt="unknown" tst_allow_siginterrupt="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if siginterrupt can be linked" >&5 $as_echo_n "checking if siginterrupt can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define siginterrupt innocuous_siginterrupt #ifdef __STDC__ # include #else # include #endif #undef siginterrupt #ifdef __cplusplus extern "C" #endif char siginterrupt (); #if defined __stub_siginterrupt || defined __stub___siginterrupt choke me #endif int main (void) { return siginterrupt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_siginterrupt="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_siginterrupt="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_siginterrupt" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if siginterrupt is prototyped" >&5 $as_echo_n "checking if siginterrupt is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_signal _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "siginterrupt" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_siginterrupt="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_siginterrupt="no" fi rm -f conftest* fi # if test "$tst_proto_siginterrupt" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if siginterrupt is compilable" >&5 $as_echo_n "checking if siginterrupt is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_signal int main (void) { if(0 != siginterrupt(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_siginterrupt="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_siginterrupt="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_siginterrupt" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if siginterrupt usage allowed" >&5 $as_echo_n "checking if siginterrupt usage allowed... " >&6; } if test "x$curl_disallow_siginterrupt" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_siginterrupt="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_siginterrupt="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if siginterrupt might be used" >&5 $as_echo_n "checking if siginterrupt might be used... " >&6; } if test "$tst_links_siginterrupt" = "yes" && test "$tst_proto_siginterrupt" = "yes" && test "$tst_compi_siginterrupt" = "yes" && test "$tst_allow_siginterrupt" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_SIGINTERRUPT 1 _ACEOF ac_cv_func_siginterrupt="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_siginterrupt="no" fi # tst_links_signal="unknown" tst_proto_signal="unknown" tst_compi_signal="unknown" tst_allow_signal="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if signal can be linked" >&5 $as_echo_n "checking if signal can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define signal innocuous_signal #ifdef __STDC__ # include #else # include #endif #undef signal #ifdef __cplusplus extern "C" #endif char signal (); #if defined __stub_signal || defined __stub___signal choke me #endif int main (void) { return signal (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_signal="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_signal="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_signal" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if signal is prototyped" >&5 $as_echo_n "checking if signal is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_signal _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "signal" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_signal="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_signal="no" fi rm -f conftest* fi # if test "$tst_proto_signal" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if signal is compilable" >&5 $as_echo_n "checking if signal is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_signal int main (void) { if(0 != signal(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_signal="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_signal="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_signal" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if signal usage allowed" >&5 $as_echo_n "checking if signal usage allowed... " >&6; } if test "x$curl_disallow_signal" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_signal="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_signal="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if signal might be used" >&5 $as_echo_n "checking if signal might be used... " >&6; } if test "$tst_links_signal" = "yes" && test "$tst_proto_signal" = "yes" && test "$tst_compi_signal" = "yes" && test "$tst_allow_signal" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_SIGNAL 1 _ACEOF ac_cv_func_signal="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_signal="no" fi curl_includes_setjmp="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SETJMP_H # include #endif /* includes end */" for ac_header in sys/types.h setjmp.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_setjmp " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_sigsetjmp="unknown" tst_macro_sigsetjmp="unknown" tst_proto_sigsetjmp="unknown" tst_compi_sigsetjmp="unknown" tst_allow_sigsetjmp="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp can be linked" >&5 $as_echo_n "checking if sigsetjmp can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define sigsetjmp innocuous_sigsetjmp #ifdef __STDC__ # include #else # include #endif #undef sigsetjmp #ifdef __cplusplus extern "C" #endif char sigsetjmp (); #if defined __stub_sigsetjmp || defined __stub___sigsetjmp choke me #endif int main (void) { return sigsetjmp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_sigsetjmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_sigsetjmp="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_sigsetjmp" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp seems a macro" >&5 $as_echo_n "checking if sigsetjmp seems a macro... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_setjmp int main (void) { sigjmp_buf env; if(0 != sigsetjmp(env, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_macro_sigsetjmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_macro_sigsetjmp="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # if test "$tst_links_sigsetjmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp is prototyped" >&5 $as_echo_n "checking if sigsetjmp is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_setjmp _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sigsetjmp" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_sigsetjmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_sigsetjmp="no" fi rm -f conftest* fi # if test "$tst_proto_sigsetjmp" = "yes" || test "$tst_macro_sigsetjmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp is compilable" >&5 $as_echo_n "checking if sigsetjmp is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_setjmp int main (void) { sigjmp_buf env; if(0 != sigsetjmp(env, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_sigsetjmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_sigsetjmp="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_sigsetjmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp usage allowed" >&5 $as_echo_n "checking if sigsetjmp usage allowed... " >&6; } if test "x$curl_disallow_sigsetjmp" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_sigsetjmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_sigsetjmp="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp might be used" >&5 $as_echo_n "checking if sigsetjmp might be used... " >&6; } if (test "$tst_proto_sigsetjmp" = "yes" || test "$tst_macro_sigsetjmp" = "yes") && test "$tst_compi_sigsetjmp" = "yes" && test "$tst_allow_sigsetjmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_SIGSETJMP 1 _ACEOF ac_cv_func_sigsetjmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_sigsetjmp="no" fi # tst_links_socket="unknown" tst_proto_socket="unknown" tst_compi_socket="unknown" tst_allow_socket="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socket can be linked" >&5 $as_echo_n "checking if socket can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_sys_socket $curl_includes_socket int main (void) { if(0 != socket(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_socket="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_socket="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_socket" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socket is prototyped" >&5 $as_echo_n "checking if socket is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_sys_socket $curl_includes_socket _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "socket" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_socket="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_socket="no" fi rm -f conftest* fi # if test "$tst_proto_socket" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socket is compilable" >&5 $as_echo_n "checking if socket is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 $curl_includes_sys_socket $curl_includes_socket int main (void) { if(0 != socket(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_socket="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_socket="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_socket" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socket usage allowed" >&5 $as_echo_n "checking if socket usage allowed... " >&6; } if test "x$curl_disallow_socket" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_socket="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_socket="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socket might be used" >&5 $as_echo_n "checking if socket might be used... " >&6; } if test "$tst_links_socket" = "yes" && test "$tst_proto_socket" = "yes" && test "$tst_compi_socket" = "yes" && test "$tst_allow_socket" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_SOCKET 1 _ACEOF ac_cv_func_socket="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_socket="no" fi # tst_links_socketpair="unknown" tst_proto_socketpair="unknown" tst_compi_socketpair="unknown" tst_allow_socketpair="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socketpair can be linked" >&5 $as_echo_n "checking if socketpair can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define socketpair innocuous_socketpair #ifdef __STDC__ # include #else # include #endif #undef socketpair #ifdef __cplusplus extern "C" #endif char socketpair (); #if defined __stub_socketpair || defined __stub___socketpair choke me #endif int main (void) { return socketpair (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_socketpair="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_socketpair="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_socketpair" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socketpair is prototyped" >&5 $as_echo_n "checking if socketpair is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_sys_socket $curl_includes_socket _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "socketpair" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_socketpair="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_socketpair="no" fi rm -f conftest* fi # if test "$tst_proto_socketpair" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socketpair is compilable" >&5 $as_echo_n "checking if socketpair is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_sys_socket $curl_includes_socket int main (void) { int sv[2]; if(0 != socketpair(0, 0, 0, sv)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_socketpair="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_socketpair="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_socketpair" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socketpair usage allowed" >&5 $as_echo_n "checking if socketpair usage allowed... " >&6; } if test "x$curl_disallow_socketpair" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_socketpair="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_socketpair="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socketpair might be used" >&5 $as_echo_n "checking if socketpair might be used... " >&6; } if test "$tst_links_socketpair" = "yes" && test "$tst_proto_socketpair" = "yes" && test "$tst_compi_socketpair" = "yes" && test "$tst_allow_socketpair" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_SOCKETPAIR 1 _ACEOF ac_cv_func_socketpair="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_socketpair="no" fi # tst_links_strcasecmp="unknown" tst_proto_strcasecmp="unknown" tst_compi_strcasecmp="unknown" tst_allow_strcasecmp="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcasecmp can be linked" >&5 $as_echo_n "checking if strcasecmp can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define strcasecmp innocuous_strcasecmp #ifdef __STDC__ # include #else # include #endif #undef strcasecmp #ifdef __cplusplus extern "C" #endif char strcasecmp (); #if defined __stub_strcasecmp || defined __stub___strcasecmp choke me #endif int main (void) { return strcasecmp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_strcasecmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_strcasecmp="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_strcasecmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcasecmp is prototyped" >&5 $as_echo_n "checking if strcasecmp is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strcasecmp" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_strcasecmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_strcasecmp="no" fi rm -f conftest* fi # if test "$tst_proto_strcasecmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcasecmp is compilable" >&5 $as_echo_n "checking if strcasecmp is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string int main (void) { if(0 != strcasecmp(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_strcasecmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_strcasecmp="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_strcasecmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcasecmp usage allowed" >&5 $as_echo_n "checking if strcasecmp usage allowed... " >&6; } if test "x$curl_disallow_strcasecmp" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_strcasecmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_strcasecmp="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcasecmp might be used" >&5 $as_echo_n "checking if strcasecmp might be used... " >&6; } if test "$tst_links_strcasecmp" = "yes" && test "$tst_proto_strcasecmp" = "yes" && test "$tst_compi_strcasecmp" = "yes" && test "$tst_allow_strcasecmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_STRCASECMP 1 _ACEOF ac_cv_func_strcasecmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_strcasecmp="no" fi # tst_links_strcmpi="unknown" tst_proto_strcmpi="unknown" tst_compi_strcmpi="unknown" tst_allow_strcmpi="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcmpi can be linked" >&5 $as_echo_n "checking if strcmpi can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define strcmpi innocuous_strcmpi #ifdef __STDC__ # include #else # include #endif #undef strcmpi #ifdef __cplusplus extern "C" #endif char strcmpi (); #if defined __stub_strcmpi || defined __stub___strcmpi choke me #endif int main (void) { return strcmpi (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_strcmpi="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_strcmpi="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_strcmpi" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcmpi is prototyped" >&5 $as_echo_n "checking if strcmpi is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strcmpi" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_strcmpi="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_strcmpi="no" fi rm -f conftest* fi # if test "$tst_proto_strcmpi" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcmpi is compilable" >&5 $as_echo_n "checking if strcmpi is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string int main (void) { if(0 != strcmpi(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_strcmpi="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_strcmpi="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_strcmpi" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcmpi usage allowed" >&5 $as_echo_n "checking if strcmpi usage allowed... " >&6; } if test "x$curl_disallow_strcmpi" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_strcmpi="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_strcmpi="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcmpi might be used" >&5 $as_echo_n "checking if strcmpi might be used... " >&6; } if test "$tst_links_strcmpi" = "yes" && test "$tst_proto_strcmpi" = "yes" && test "$tst_compi_strcmpi" = "yes" && test "$tst_allow_strcmpi" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_STRCMPI 1 _ACEOF ac_cv_func_strcmpi="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_strcmpi="no" fi # tst_links_strdup="unknown" tst_proto_strdup="unknown" tst_compi_strdup="unknown" tst_allow_strdup="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strdup can be linked" >&5 $as_echo_n "checking if strdup can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define strdup innocuous_strdup #ifdef __STDC__ # include #else # include #endif #undef strdup #ifdef __cplusplus extern "C" #endif char strdup (); #if defined __stub_strdup || defined __stub___strdup choke me #endif int main (void) { return strdup (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_strdup="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_strdup="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_strdup" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strdup is prototyped" >&5 $as_echo_n "checking if strdup is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strdup" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_strdup="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_strdup="no" fi rm -f conftest* fi # if test "$tst_proto_strdup" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strdup is compilable" >&5 $as_echo_n "checking if strdup is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string int main (void) { if(0 != strdup(0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_strdup="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_strdup="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_strdup" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strdup usage allowed" >&5 $as_echo_n "checking if strdup usage allowed... " >&6; } if test "x$curl_disallow_strdup" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_strdup="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_strdup="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strdup might be used" >&5 $as_echo_n "checking if strdup might be used... " >&6; } if test "$tst_links_strdup" = "yes" && test "$tst_proto_strdup" = "yes" && test "$tst_compi_strdup" = "yes" && test "$tst_allow_strdup" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_STRDUP 1 _ACEOF ac_cv_func_strdup="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_strdup="no" fi # tst_links_strerror_r="unknown" tst_proto_strerror_r="unknown" tst_compi_strerror_r="unknown" tst_glibc_strerror_r="unknown" tst_posix_strerror_r="unknown" tst_allow_strerror_r="unknown" tst_works_glibc_strerror_r="unknown" tst_works_posix_strerror_r="unknown" tst_glibc_strerror_r_type_arg3="unknown" tst_posix_strerror_r_type_arg3="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r can be linked" >&5 $as_echo_n "checking if strerror_r can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define strerror_r innocuous_strerror_r #ifdef __STDC__ # include #else # include #endif #undef strerror_r #ifdef __cplusplus extern "C" #endif char strerror_r (); #if defined __stub_strerror_r || defined __stub___strerror_r choke me #endif int main (void) { return strerror_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_strerror_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_strerror_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_strerror_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r is prototyped" >&5 $as_echo_n "checking if strerror_r is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strerror_r" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_strerror_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_strerror_r="no" fi rm -f conftest* fi # if test "$tst_proto_strerror_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r is compilable" >&5 $as_echo_n "checking if strerror_r is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string int main (void) { if(0 != strerror_r(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_strerror_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_strerror_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_strerror_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r is glibc like" >&5 $as_echo_n "checking if strerror_r is glibc like... " >&6; } tst_glibc_strerror_r_type_arg3="unknown" for arg3 in 'size_t' 'int' 'unsigned int'; do if test "$tst_glibc_strerror_r_type_arg3" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string char *strerror_r(int errnum, char *workbuf, $arg3 bufsize); int main (void) { if(0 != strerror_r(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tst_glibc_strerror_r_type_arg3="$arg3" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi done case "$tst_glibc_strerror_r_type_arg3" in unknown) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_glibc_strerror_r="no" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_glibc_strerror_r="yes" ;; esac fi # if test "x$cross_compiling" != "xyes" && test "$tst_glibc_strerror_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r seems to work" >&5 $as_echo_n "checking if strerror_r seems to work... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdlib $curl_includes_string # include int main (void) { char buffer[1024]; char *string = 0; buffer[0] = '\0'; string = strerror_r(EACCES, buffer, sizeof(buffer)); if(!string) exit(1); /* fail */ if(!string[0]) exit(1); /* fail */ else exit(0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_works_glibc_strerror_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_works_glibc_strerror_r="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi # if test "$tst_compi_strerror_r" = "yes" && test "$tst_works_glibc_strerror_r" != "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r is POSIX like" >&5 $as_echo_n "checking if strerror_r is POSIX like... " >&6; } tst_posix_strerror_r_type_arg3="unknown" for arg3 in 'size_t' 'int' 'unsigned int'; do if test "$tst_posix_strerror_r_type_arg3" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string int strerror_r(int errnum, char *resultbuf, $arg3 bufsize); int main (void) { if(0 != strerror_r(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : tst_posix_strerror_r_type_arg3="$arg3" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi done case "$tst_posix_strerror_r_type_arg3" in unknown) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_posix_strerror_r="no" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_posix_strerror_r="yes" ;; esac fi # if test "x$cross_compiling" != "xyes" && test "$tst_posix_strerror_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r seems to work" >&5 $as_echo_n "checking if strerror_r seems to work... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdlib $curl_includes_string # include int main (void) { char buffer[1024]; int error = 1; buffer[0] = '\0'; error = strerror_r(EACCES, buffer, sizeof(buffer)); if(error) exit(1); /* fail */ if(buffer[0] == '\0') exit(1); /* fail */ else exit(0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_works_posix_strerror_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_works_posix_strerror_r="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi # if test "$tst_works_glibc_strerror_r" = "yes"; then tst_posix_strerror_r="no" fi if test "$tst_works_posix_strerror_r" = "yes"; then tst_glibc_strerror_r="no" fi if test "$tst_glibc_strerror_r" = "yes" && test "$tst_works_glibc_strerror_r" != "no" && test "$tst_posix_strerror_r" != "yes"; then tst_allow_strerror_r="check" fi if test "$tst_posix_strerror_r" = "yes" && test "$tst_works_posix_strerror_r" != "no" && test "$tst_glibc_strerror_r" != "yes"; then tst_allow_strerror_r="check" fi if test "$tst_allow_strerror_r" = "check"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r usage allowed" >&5 $as_echo_n "checking if strerror_r usage allowed... " >&6; } if test "x$curl_disallow_strerror_r" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_strerror_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_strerror_r="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r might be used" >&5 $as_echo_n "checking if strerror_r might be used... " >&6; } if test "$tst_links_strerror_r" = "yes" && test "$tst_proto_strerror_r" = "yes" && test "$tst_compi_strerror_r" = "yes" && test "$tst_allow_strerror_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } if test "$tst_glibc_strerror_r" = "yes"; then cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR_R 1 _ACEOF cat >>confdefs.h <<_ACEOF #define HAVE_GLIBC_STRERROR_R 1 _ACEOF cat >>confdefs.h <<_ACEOF #define STRERROR_R_TYPE_ARG3 $tst_glibc_strerror_r_type_arg3 _ACEOF fi if test "$tst_posix_strerror_r" = "yes"; then cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR_R 1 _ACEOF cat >>confdefs.h <<_ACEOF #define HAVE_POSIX_STRERROR_R 1 _ACEOF cat >>confdefs.h <<_ACEOF #define STRERROR_R_TYPE_ARG3 $tst_posix_strerror_r_type_arg3 _ACEOF fi ac_cv_func_strerror_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_strerror_r="no" fi # if test "$tst_compi_strerror_r" = "yes" && test "$tst_allow_strerror_r" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine strerror_r() style: edit lib/curl_config.h manually." >&5 $as_echo "$as_me: WARNING: cannot determine strerror_r() style: edit lib/curl_config.h manually." >&2;} fi # # tst_links_stricmp="unknown" tst_proto_stricmp="unknown" tst_compi_stricmp="unknown" tst_allow_stricmp="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if stricmp can be linked" >&5 $as_echo_n "checking if stricmp can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define stricmp innocuous_stricmp #ifdef __STDC__ # include #else # include #endif #undef stricmp #ifdef __cplusplus extern "C" #endif char stricmp (); #if defined __stub_stricmp || defined __stub___stricmp choke me #endif int main (void) { return stricmp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_stricmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_stricmp="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_stricmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if stricmp is prototyped" >&5 $as_echo_n "checking if stricmp is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "stricmp" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_stricmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_stricmp="no" fi rm -f conftest* fi # if test "$tst_proto_stricmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if stricmp is compilable" >&5 $as_echo_n "checking if stricmp is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string int main (void) { if(0 != stricmp(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_stricmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_stricmp="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_stricmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if stricmp usage allowed" >&5 $as_echo_n "checking if stricmp usage allowed... " >&6; } if test "x$curl_disallow_stricmp" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_stricmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_stricmp="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if stricmp might be used" >&5 $as_echo_n "checking if stricmp might be used... " >&6; } if test "$tst_links_stricmp" = "yes" && test "$tst_proto_stricmp" = "yes" && test "$tst_compi_stricmp" = "yes" && test "$tst_allow_stricmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_STRICMP 1 _ACEOF ac_cv_func_stricmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_stricmp="no" fi # tst_links_strncasecmp="unknown" tst_proto_strncasecmp="unknown" tst_compi_strncasecmp="unknown" tst_allow_strncasecmp="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncasecmp can be linked" >&5 $as_echo_n "checking if strncasecmp can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define strncasecmp innocuous_strncasecmp #ifdef __STDC__ # include #else # include #endif #undef strncasecmp #ifdef __cplusplus extern "C" #endif char strncasecmp (); #if defined __stub_strncasecmp || defined __stub___strncasecmp choke me #endif int main (void) { return strncasecmp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_strncasecmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_strncasecmp="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_strncasecmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncasecmp is prototyped" >&5 $as_echo_n "checking if strncasecmp is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strncasecmp" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_strncasecmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_strncasecmp="no" fi rm -f conftest* fi # if test "$tst_proto_strncasecmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncasecmp is compilable" >&5 $as_echo_n "checking if strncasecmp is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string int main (void) { if(0 != strncasecmp(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_strncasecmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_strncasecmp="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_strncasecmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncasecmp usage allowed" >&5 $as_echo_n "checking if strncasecmp usage allowed... " >&6; } if test "x$curl_disallow_strncasecmp" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_strncasecmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_strncasecmp="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncasecmp might be used" >&5 $as_echo_n "checking if strncasecmp might be used... " >&6; } if test "$tst_links_strncasecmp" = "yes" && test "$tst_proto_strncasecmp" = "yes" && test "$tst_compi_strncasecmp" = "yes" && test "$tst_allow_strncasecmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_STRNCASECMP 1 _ACEOF ac_cv_func_strncasecmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_strncasecmp="no" fi # tst_links_strncmpi="unknown" tst_proto_strncmpi="unknown" tst_compi_strncmpi="unknown" tst_allow_strncmpi="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncmpi can be linked" >&5 $as_echo_n "checking if strncmpi can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define strncmpi innocuous_strncmpi #ifdef __STDC__ # include #else # include #endif #undef strncmpi #ifdef __cplusplus extern "C" #endif char strncmpi (); #if defined __stub_strncmpi || defined __stub___strncmpi choke me #endif int main (void) { return strncmpi (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_strncmpi="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_strncmpi="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_strncmpi" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncmpi is prototyped" >&5 $as_echo_n "checking if strncmpi is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strncmpi" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_strncmpi="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_strncmpi="no" fi rm -f conftest* fi # if test "$tst_proto_strncmpi" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncmpi is compilable" >&5 $as_echo_n "checking if strncmpi is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string int main (void) { if(0 != strncmpi(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_strncmpi="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_strncmpi="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_strncmpi" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncmpi usage allowed" >&5 $as_echo_n "checking if strncmpi usage allowed... " >&6; } if test "x$curl_disallow_strncmpi" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_strncmpi="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_strncmpi="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncmpi might be used" >&5 $as_echo_n "checking if strncmpi might be used... " >&6; } if test "$tst_links_strncmpi" = "yes" && test "$tst_proto_strncmpi" = "yes" && test "$tst_compi_strncmpi" = "yes" && test "$tst_allow_strncmpi" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_STRNCMPI 1 _ACEOF ac_cv_func_strncmpi="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_strncmpi="no" fi # tst_links_strnicmp="unknown" tst_proto_strnicmp="unknown" tst_compi_strnicmp="unknown" tst_allow_strnicmp="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strnicmp can be linked" >&5 $as_echo_n "checking if strnicmp can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define strnicmp innocuous_strnicmp #ifdef __STDC__ # include #else # include #endif #undef strnicmp #ifdef __cplusplus extern "C" #endif char strnicmp (); #if defined __stub_strnicmp || defined __stub___strnicmp choke me #endif int main (void) { return strnicmp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_strnicmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_strnicmp="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_strnicmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strnicmp is prototyped" >&5 $as_echo_n "checking if strnicmp is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strnicmp" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_strnicmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_strnicmp="no" fi rm -f conftest* fi # if test "$tst_proto_strnicmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strnicmp is compilable" >&5 $as_echo_n "checking if strnicmp is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string int main (void) { if(0 != strnicmp(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_strnicmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_strnicmp="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_strnicmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strnicmp usage allowed" >&5 $as_echo_n "checking if strnicmp usage allowed... " >&6; } if test "x$curl_disallow_strnicmp" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_strnicmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_strnicmp="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strnicmp might be used" >&5 $as_echo_n "checking if strnicmp might be used... " >&6; } if test "$tst_links_strnicmp" = "yes" && test "$tst_proto_strnicmp" = "yes" && test "$tst_compi_strnicmp" = "yes" && test "$tst_allow_strnicmp" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_STRNICMP 1 _ACEOF ac_cv_func_strnicmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_strnicmp="no" fi # tst_links_strstr="unknown" tst_proto_strstr="unknown" tst_compi_strstr="unknown" tst_allow_strstr="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strstr can be linked" >&5 $as_echo_n "checking if strstr can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define strstr innocuous_strstr #ifdef __STDC__ # include #else # include #endif #undef strstr #ifdef __cplusplus extern "C" #endif char strstr (); #if defined __stub_strstr || defined __stub___strstr choke me #endif int main (void) { return strstr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_strstr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_strstr="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_strstr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strstr is prototyped" >&5 $as_echo_n "checking if strstr is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strstr" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_strstr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_strstr="no" fi rm -f conftest* fi # if test "$tst_proto_strstr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strstr is compilable" >&5 $as_echo_n "checking if strstr is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string int main (void) { if(0 != strstr(0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_strstr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_strstr="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_strstr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strstr usage allowed" >&5 $as_echo_n "checking if strstr usage allowed... " >&6; } if test "x$curl_disallow_strstr" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_strstr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_strstr="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strstr might be used" >&5 $as_echo_n "checking if strstr might be used... " >&6; } if test "$tst_links_strstr" = "yes" && test "$tst_proto_strstr" = "yes" && test "$tst_compi_strstr" = "yes" && test "$tst_allow_strstr" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_STRSTR 1 _ACEOF ac_cv_func_strstr="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_strstr="no" fi # tst_links_strtok_r="unknown" tst_proto_strtok_r="unknown" tst_compi_strtok_r="unknown" tst_allow_strtok_r="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtok_r can be linked" >&5 $as_echo_n "checking if strtok_r can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define strtok_r innocuous_strtok_r #ifdef __STDC__ # include #else # include #endif #undef strtok_r #ifdef __cplusplus extern "C" #endif char strtok_r (); #if defined __stub_strtok_r || defined __stub___strtok_r choke me #endif int main (void) { return strtok_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_strtok_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_strtok_r="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_strtok_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtok_r is prototyped" >&5 $as_echo_n "checking if strtok_r is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtok_r" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_strtok_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_strtok_r="no" fi rm -f conftest* fi # if test "$tst_proto_strtok_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtok_r is compilable" >&5 $as_echo_n "checking if strtok_r is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string int main (void) { if(0 != strtok_r(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_strtok_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_strtok_r="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_strtok_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtok_r usage allowed" >&5 $as_echo_n "checking if strtok_r usage allowed... " >&6; } if test "x$curl_disallow_strtok_r" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_strtok_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_strtok_r="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtok_r might be used" >&5 $as_echo_n "checking if strtok_r might be used... " >&6; } if test "$tst_links_strtok_r" = "yes" && test "$tst_proto_strtok_r" = "yes" && test "$tst_compi_strtok_r" = "yes" && test "$tst_allow_strtok_r" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_STRTOK_R 1 _ACEOF ac_cv_func_strtok_r="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_strtok_r="no" fi # tst_links_strtoll="unknown" tst_proto_strtoll="unknown" tst_compi_strtoll="unknown" tst_allow_strtoll="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtoll can be linked" >&5 $as_echo_n "checking if strtoll can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define strtoll innocuous_strtoll #ifdef __STDC__ # include #else # include #endif #undef strtoll #ifdef __cplusplus extern "C" #endif char strtoll (); #if defined __stub_strtoll || defined __stub___strtoll choke me #endif int main (void) { return strtoll (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_strtoll="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_strtoll="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_strtoll" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtoll is prototyped" >&5 $as_echo_n "checking if strtoll is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdlib _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtoll" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_strtoll="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_strtoll="no" fi rm -f conftest* fi # if test "$tst_proto_strtoll" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtoll is compilable" >&5 $as_echo_n "checking if strtoll is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdlib int main (void) { if(0 != strtoll(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_strtoll="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_strtoll="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_strtoll" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtoll usage allowed" >&5 $as_echo_n "checking if strtoll usage allowed... " >&6; } if test "x$curl_disallow_strtoll" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_strtoll="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_strtoll="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtoll might be used" >&5 $as_echo_n "checking if strtoll might be used... " >&6; } if test "$tst_links_strtoll" = "yes" && test "$tst_proto_strtoll" = "yes" && test "$tst_compi_strtoll" = "yes" && test "$tst_allow_strtoll" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_STRTOLL 1 _ACEOF ac_cv_func_strtoll="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_strtoll="no" fi curl_includes_sys_uio="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif /* includes end */" for ac_header in sys/types.h sys/uio.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_sys_uio " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # tst_links_writev="unknown" tst_proto_writev="unknown" tst_compi_writev="unknown" tst_allow_writev="unknown" # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if writev can be linked" >&5 $as_echo_n "checking if writev can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define writev innocuous_writev #ifdef __STDC__ # include #else # include #endif #undef writev #ifdef __cplusplus extern "C" #endif char writev (); #if defined __stub_writev || defined __stub___writev choke me #endif int main (void) { return writev (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_links_writev="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_links_writev="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_writev" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if writev is prototyped" >&5 $as_echo_n "checking if writev is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_sys_uio _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "writev" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_proto_writev="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_proto_writev="no" fi rm -f conftest* fi # if test "$tst_proto_writev" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if writev is compilable" >&5 $as_echo_n "checking if writev is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_sys_uio int main (void) { if(0 != writev(0, 0, 0)) return 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_compi_writev="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_compi_writev="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # if test "$tst_compi_writev" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if writev usage allowed" >&5 $as_echo_n "checking if writev usage allowed... " >&6; } if test "x$curl_disallow_writev" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } tst_allow_writev="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } tst_allow_writev="no" fi fi # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if writev might be used" >&5 $as_echo_n "checking if writev might be used... " >&6; } if test "$tst_links_writev" = "yes" && test "$tst_proto_writev" = "yes" && test "$tst_compi_writev" = "yes" && test "$tst_allow_writev" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_WRITEV 1 _ACEOF ac_cv_func_writev="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_func_writev="no" fi case $host in *msdosdjgpp) ac_cv_func_pipe=no skipcheck_pipe=yes { $as_echo "$as_me:${as_lineno-$LINENO}: skip check for pipe on msdosdjgpp" >&5 $as_echo "$as_me: skip check for pipe on msdosdjgpp" >&6;} ;; esac for ac_func in fork \ geteuid \ getpass_r \ getppid \ getprotobyname \ getpwuid \ getrlimit \ gettimeofday \ inet_addr \ perror \ pipe \ setlocale \ setmode \ setrlimit \ uname \ utime do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else func="$ac_func" eval skipcheck=\$skipcheck_$func if test "x$skipcheck" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking deeper for $func" >&5 $as_echo_n "checking deeper for $func... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { $func (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } eval "ac_cv_func_$func=yes" cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$func" | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' | sed 's/^A-Z0-9_/_/g'` 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: but still no" >&5 $as_echo "but still no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi fi done for ac_header in sys/types.h sys/socket.h netdb.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo" >&5 $as_echo_n "checking for getnameinfo... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define getnameinfo innocuous_getnameinfo #ifdef __STDC__ # include #else # include #endif #undef getnameinfo #ifdef __cplusplus extern "C" #endif char getnameinfo (); #if defined __stub_getnameinfo || defined __stub___getnameinfo choke me #endif int main (void) { return getnameinfo (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } curl_cv_getnameinfo="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } curl_cv_getnameinfo="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # if test "$curl_cv_getnameinfo" != "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking deeper for getnameinfo" >&5 $as_echo_n "checking deeper for getnameinfo... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { getnameinfo(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } curl_cv_getnameinfo="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: but still no" >&5 $as_echo "but still no" >&6; } curl_cv_getnameinfo="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # if test "$curl_cv_getnameinfo" != "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking deeper and deeper for getnameinfo" >&5 $as_echo_n "checking deeper and deeper for getnameinfo... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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 int main (void) { getnameinfo(0, 0, 0, 0, 0, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } curl_cv_getnameinfo="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: but still no" >&5 $as_echo "but still no" >&6; } curl_cv_getnameinfo="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # if test "$curl_cv_getnameinfo" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for getnameinfo" >&5 $as_echo_n "checking types of arguments for getnameinfo... " >&6; } if ${curl_cv_func_getnameinfo_args+:} false; then : $as_echo_n "(cached) " >&6 else 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 if test "$curl_cv_func_getnameinfo_args" = "unknown"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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); int main (void) { $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); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_cv_func_getnameinfo_args="$gni_arg1,$gni_arg2,$gni_arg46,$gni_arg7" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi done done done done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_func_getnameinfo_args" >&5 $as_echo "$curl_cv_func_getnameinfo_args" >&6; } # AC-CACHE-CHECK if test "$curl_cv_func_getnameinfo_args" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find proper types to use for getnameinfo args" >&5 $as_echo "$as_me: WARNING: Cannot find proper types to use for getnameinfo args" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: HAVE_GETNAMEINFO will not be defined" >&5 $as_echo "$as_me: WARNING: HAVE_GETNAMEINFO will not be defined" >&2;} 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 # cat >>confdefs.h <<_ACEOF #define GETNAMEINFO_TYPE_ARG2 $2 _ACEOF cat >>confdefs.h <<_ACEOF #define GETNAMEINFO_TYPE_ARG46 $3 _ACEOF cat >>confdefs.h <<_ACEOF #define GETNAMEINFO_TYPE_ARG7 $4 _ACEOF # 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 # cat >>confdefs.h <<_ACEOF #define GETNAMEINFO_QUAL_ARG1 $gni_qual_arg1 _ACEOF cat >>confdefs.h <<_ACEOF #define GETNAMEINFO_TYPE_ARG1 $gni_type_arg1 _ACEOF # case $prev_sh_opts in *f*) ;; *) set +f ;; esac # cat >>confdefs.h <<_ACEOF #define HAVE_GETNAMEINFO 1 _ACEOF ac_cv_func_getnameinfo="yes" fi fi if test "$ipv6" = "yes"; then if test "$ac_cv_func_getaddrinfo" = "yes"; then $as_echo "#define ENABLE_IPV6 1" >>confdefs.h IPV6_ENABLED=1 fi for ac_header in stdio.h sys/types.h sys/socket.h \ netdb.h netinet/in.h arpa/inet.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working NI_WITHSCOPEID" >&5 $as_echo_n "checking for working NI_WITHSCOPEID... " >&6; } if ${ac_cv_working_ni_withscopeid+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : # Program is not run when cross-compiling. So we assume # NI_WITHSCOPEID will work if we are able to compile it. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main (void) { unsigned int dummy= NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_working_ni_withscopeid="yes" else ac_cv_working_ni_withscopeid="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # AC-COMPILE-IFELSE else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_STDLIB_H #include #endif #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 int main (void) { #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 ; return 0; } # AC-LANG-PROGRAM _ACEOF if ac_fn_c_try_run "$LINENO"; then : # Exit code == 0. Program worked. ac_cv_working_ni_withscopeid="yes" else # Exit code != 0. Program failed. ac_cv_working_ni_withscopeid="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi # AC-RUN-IFELSE fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_ni_withscopeid" >&5 $as_echo "$ac_cv_working_ni_withscopeid" >&6; } # AC-CACHE-CHECK case "$ac_cv_working_ni_withscopeid" in yes) $as_echo "#define HAVE_NI_WITHSCOPEID 1" >>confdefs.h ;; esac fi # tst_method="unknown" { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to set a socket into non-blocking mode" >&5 $as_echo_n "checking how to set a socket into non-blocking mode... " >&6; } if test "x$ac_cv_func_fcntl_o_nonblock" = "xyes"; then tst_method="fcntl O_NONBLOCK" elif test "x$ac_cv_func_ioctl_fionbio" = "xyes"; then tst_method="ioctl FIONBIO" elif test "x$ac_cv_func_ioctlsocket_fionbio" = "xyes"; then tst_method="ioctlsocket FIONBIO" elif test "x$ac_cv_func_ioctlsocket_camel_fionbio" = "xyes"; then tst_method="IoctlSocket FIONBIO" elif test "x$ac_cv_func_setsockopt_so_nonblock" = "xyes"; then tst_method="setsockopt SO_NONBLOCK" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_method" >&5 $as_echo "$tst_method" >&6; } if test "$tst_method" = "unknown"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine non-blocking socket method." >&5 $as_echo "$as_me: WARNING: cannot determine non-blocking socket method." >&2;} fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin " for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi for ac_prog in gnroff nroff do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_NROFF+:} false; then : $as_echo_n "(cached) " >&6 else case $NROFF in [\\/]* | ?:[\\/]*) ac_cv_path_NROFF="$NROFF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin/:/usr/local/bin " for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_NROFF="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi NROFF=$ac_cv_path_NROFF if test -n "$NROFF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NROFF" >&5 $as_echo "$NROFF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$NROFF" && break done if test -n "$NROFF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to use *nroff to get plain text from man pages" >&5 $as_echo_n "checking how to use *nroff to get plain text from man pages... " >&6; } 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="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: found no *nroff option to get plaintext from man pages" >&5 $as_echo "$as_me: WARNING: found no *nroff option to get plaintext from man pages" >&2;} else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANOPT" >&5 $as_echo "$MANOPT" >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANOPT" >&5 $as_echo "$MANOPT" >&6; } fi fi if test -z "$MANOPT" then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling built-in manual" >&5 $as_echo "$as_me: WARNING: disabling built-in manual" >&2;} USE_MANUAL="no"; fi if test "$USE_MANUAL" = "1"; then $as_echo "#define USE_MANUAL 1" >>confdefs.h curl_manual_msg="enabled" fi if test x"$USE_MANUAL" = x1; then USE_MANUAL_TRUE= USE_MANUAL_FALSE='#' else USE_MANUAL_TRUE='#' USE_MANUAL_FALSE= fi # if test "$want_ares" = "yes"; then clean_CPPFLAGS="$CPPFLAGS" clean_LDFLAGS="$LDFLAGS" clean_LIBS="$LIBS" embedded_ares="unknown" configure_runpath=`pwd` embedded_ares_builddir="$configure_runpath/ares" if test -n "$want_ares_path"; then ares_CPPFLAGS="-I$want_ares_path/include" ares_LDFLAGS="-L$want_ares_path/lib" ares_LIBS="-lcares" else if test -d "$srcdir/ares"; then embedded_ares="yes" subdirs="$subdirs ares" ares_CPPFLAGS="" ares_LDFLAGS="-L$embedded_ares_builddir" ares_LIBS="-lcares" else ares_CPPFLAGS="" ares_LDFLAGS="" ares_LIBS="-lcares" fi fi # CPPFLAGS="$ares_CPPFLAGS $clean_CPPFLAGS" LDFLAGS="$ares_LDFLAGS $clean_LDFLAGS" LIBS="$ares_LIBS $clean_LIBS" # if test "$embedded_ares" != "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking that c-ares is good and recent enough" >&5 $as_echo_n "checking that c-ares is good and recent enough... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* set of dummy functions in case c-ares was built with debug */ void curl_dofree() { } void curl_sclose() { } void curl_domalloc() { } void curl_docalloc() { } void curl_socket() { } int main (void) { ares_channel channel; ares_cancel(channel); /* added in 1.2.0 */ ares_process_fd(channel, 0, 0); /* added in 1.4.0 */ ares_dup(&channel, channel); /* added in 1.6.0 */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "c-ares library defective or too old" "$LINENO" 5 CPPFLAGS="$clean_CPPFLAGS" LDFLAGS="$clean_LDFLAGS" LIBS="$clean_LIBS" # prevent usage want_ares="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$want_ares" = "yes"; then $as_echo "#define USE_ARES 1" >>confdefs.h USE_ARES=1 curl_res_msg="c-ares" fi fi if test x$embedded_ares = xyes; then USE_EMBEDDED_ARES_TRUE= USE_EMBEDDED_ARES_FALSE='#' else USE_EMBEDDED_ARES_TRUE='#' USE_EMBEDDED_ARES_FALSE= fi if test "x$ac_cv_native_windows" != "xyes" && test "x$enable_shared" = "xyes"; then build_libhostname=yes else build_libhostname=no fi if test x$build_libhostname = xyes; then BUILD_LIBHOSTNAME_TRUE= BUILD_LIBHOSTNAME_FALSE='#' else BUILD_LIBHOSTNAME_TRUE='#' BUILD_LIBHOSTNAME_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the threaded resolver" >&5 $as_echo_n "checking whether to enable the threaded resolver... " >&6; } OPT_THRES="default" # Check whether --enable-threaded_resolver was given. if test "${enable_threaded_resolver+set}" = set; then : enableval=$enable_threaded_resolver; OPT_THRES=$enableval fi case "$OPT_THRES" in yes) want_thres="yes" ;; *) want_thres="no" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_thres" >&5 $as_echo "$want_thres" >&6; } if test "x$want_thres" = xyes && test "x$want_ares" = xyes; then as_fn_error $? "Options --enable-threaded-resolver and --enable-ares are mutually exclusive" "$LINENO" 5 fi if test "$want_thres" = "yes"; then ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" if test "x$ac_cv_header_pthread_h" = xyes; then : $as_echo "#define HAVE_PTHREAD_H 1" >>confdefs.h save_CFLAGS="$CFLAGS" ac_fn_c_check_func "$LINENO" "pthread_create" "ac_cv_func_pthread_create" if test "x$ac_cv_func_pthread_create" = xyes; then : USE_THREADS_POSIX=1 fi if test "$USE_THREADS_POSIX" != "1" then CFLAGS="$CFLAGS -pthread" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main (void) { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : USE_THREADS_POSIX=1 else CFLAGS="$save_CFLAGS" fi fi if test "x$USE_THREADS_POSIX" = "x1" then $as_echo "#define USE_THREADS_POSIX 1" >>confdefs.h curl_res_msg="POSIX threaded" fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable verbose strings" >&5 $as_echo_n "checking whether to enable verbose strings... " >&6; } # Check whether --enable-verbose was given. if test "${enable_verbose+set}" = set; then : enableval=$enable_verbose; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_VERBOSE_STRINGS 1" >>confdefs.h curl_verbose_msg="no" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable SSPI support (Windows native builds only)" >&5 $as_echo_n "checking whether to enable SSPI support (Windows native builds only)... " >&6; } # Check whether --enable-sspi was given. if test "${enable_sspi+set}" = set; then : enableval=$enable_sspi; case "$enableval" in yes) if test "$ac_cv_native_windows" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define USE_WINDOWS_SSPI 1" >>confdefs.h USE_WINDOWS_SSPI=1 curl_sspi_msg="enabled" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-sspi Ignored. Only supported on native Windows builds." >&5 $as_echo "$as_me: WARNING: --enable-sspi Ignored. Only supported on native Windows builds." >&2;} fi ;; *) if test "x$WINSSL_ENABLED" = "x1"; then # --with-winssl implies --enable-sspi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; esac else if test "x$WINSSL_ENABLED" = "x1"; then # --with-winssl implies --enable-sspi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable cryptographic authentication methods" >&5 $as_echo_n "checking whether to enable cryptographic authentication methods... " >&6; } # Check whether --enable-crypto-auth was given. if test "${enable_crypto_auth+set}" = set; then : enableval=$enable_crypto_auth; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_CRYPTO_AUTH 1" >>confdefs.h ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi OPT_NTLM_WB="default" # Check whether --enable-ntlm-wb was given. if test "${enable_ntlm_wb+set}" = set; then : enableval=$enable_ntlm_wb; OPT_NTLM_WB=$enableval fi want_ntlm_wb_file="/usr/bin/ntlm_auth" case "$OPT_NTLM_WB" in no) want_ntlm_wb="no" ;; default) want_ntlm_wb="yes" ;; *) want_ntlm_wb="yes" if test -n "$enableval" && test "$enableval" != "yes"; then want_ntlm_wb_file="$enableval" fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable NTLM delegation to winbind's helper" >&5 $as_echo_n "checking whether to enable NTLM delegation to winbind's helper... " >&6; } if test "$ac_cv_native_windows" = "yes" || test "x$SSL_ENABLED" = "x"; then want_ntlm_wb_file="" want_ntlm_wb="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_ntlm_wb" >&5 $as_echo "$want_ntlm_wb" >&6; } if test "$want_ntlm_wb" = "yes"; then $as_echo "#define NTLM_WB_ENABLED 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define NTLM_WB_FILE "$want_ntlm_wb_file" _ACEOF NTLM_WB_ENABLED=1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable TLS-SRP authentication" >&5 $as_echo_n "checking whether to enable TLS-SRP authentication... " >&6; } # Check whether --enable-tls-srp was given. if test "${enable_tls_srp+set}" = set; then : enableval=$enable_tls_srp; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_TLS_SRP 1" >>confdefs.h want_tls_srp=no ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } want_tls_srp=yes ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } want_tls_srp=yes fi if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_SSLEAY_SRP" = "x1") ; then $as_echo "#define USE_TLS_SRP 1" >>confdefs.h USE_TLS_SRP=1 curl_tls_srp_msg="enabled" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable support for cookies" >&5 $as_echo_n "checking whether to enable support for cookies... " >&6; } # Check whether --enable-cookies was given. if test "${enable_cookies+set}" = set; then : enableval=$enable_cookies; case "$enableval" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define CURL_DISABLE_COOKIES 1" >>confdefs.h ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether hiding of library internal symbols will actually happen" >&5 $as_echo_n "checking whether hiding of library internal symbols will actually happen... " >&6; } CFLAG_CURL_SYMBOL_HIDING="" doing_symbol_hiding="no" if test x"$ac_cv_native_windows" != "xyes" && test "$want_symbol_hiding" = "yes" && test "$supports_symbol_hiding" = "yes"; then doing_symbol_hiding="yes" CFLAG_CURL_SYMBOL_HIDING="$symbol_hiding_CFLAGS" cat >>confdefs.h <<_ACEOF #define CURL_EXTERN_SYMBOL $symbol_hiding_EXTERN _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$doing_symbol_hiding = xyes; then DOING_CURL_SYMBOL_HIDING_TRUE= DOING_CURL_SYMBOL_HIDING_FALSE='#' else DOING_CURL_SYMBOL_HIDING_TRUE='#' DOING_CURL_SYMBOL_HIDING_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enforce SONAME bump" >&5 $as_echo_n "checking whether to enforce SONAME bump... " >&6; } # Check whether --enable-soname-bump was given. if test "${enable_soname_bump+set}" = set; then : enableval=$enable_soname_bump; case "$enableval" in yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } soname_bump=yes ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $soname_bump" >&5 $as_echo "$soname_bump" >&6; } fi if test x$soname_bump = xyes; then SONAME_BUMP_TRUE= SONAME_BUMP_FALSE='#' else SONAME_BUMP_TRUE='#' SONAME_BUMP_FALSE= fi LIBCURL_LIBS=$LIBS BLANK_AT_MAKETIME= if test x$cross_compiling = xyes; then CROSSCOMPILING_TRUE= CROSSCOMPILING_FALSE='#' else CROSSCOMPILING_TRUE='#' CROSSCOMPILING_FALSE= fi ENABLE_SHARED="$enable_shared" ENABLE_STATIC="$enable_static" if test "x$USE_SSLEAY" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES SSL" elif test -n "$SSL_ENABLED"; then SUPPORT_FEATURES="$SUPPORT_FEATURES SSL" fi if test "x$IPV6_ENABLED" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6" fi if test "x$HAVE_LIBZ" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES libz" fi if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS" fi if test "x$IDN_ENABLED" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES IDN" fi if test "x$USE_WINDOWS_SSPI" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI" fi if test "x$CURL_DISABLE_HTTP" != "x1"; then if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \ -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \ -o "x$DARWINSSL_ENABLED" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" if test "x$NTLM_WB_ENABLED" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB" fi fi fi if test "x$USE_TLS_SRP" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP" fi if test "x$USE_NGHTTP2" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2" fi if test "x$CURL_DISABLE_HTTP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP" if test "x$SSL_ENABLED" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS" fi fi if test "x$CURL_DISABLE_FTP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP" if test "x$SSL_ENABLED" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS" fi fi if test "x$CURL_DISABLE_FILE" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE" fi if test "x$CURL_DISABLE_TELNET" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET" fi if test "x$CURL_DISABLE_LDAP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP" if test "x$CURL_DISABLE_LDAPS" != "x1"; then if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") || (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS" fi fi fi if test "x$CURL_DISABLE_DICT" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT" fi if test "x$CURL_DISABLE_TFTP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP" fi if test "x$CURL_DISABLE_GOPHER" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER" fi if test "x$CURL_DISABLE_POP3" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3" if test "x$SSL_ENABLED" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S" fi fi if test "x$CURL_DISABLE_IMAP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP" if test "x$SSL_ENABLED" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS" fi fi if test "x$CURL_DISABLE_SMTP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP" if test "x$SSL_ENABLED" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS" fi fi if test "x$USE_LIBSSH2" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP" SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" fi if test "x$CURL_DISABLE_RTSP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP" fi if test "x$USE_LIBRTMP" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP" fi SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '` squeeze CFLAGS squeeze CPPFLAGS squeeze DEFS squeeze LDFLAGS squeeze LIBS squeeze LIBCURL_LIBS squeeze CURL_NETWORK_LIBS squeeze CURL_NETWORK_AND_TIME_LIBS squeeze SUPPORT_FEATURES squeeze SUPPORT_PROTOCOLS xc_bad_var_libs=no for xc_word in $LIBS; do case "$xc_word" in -l* | --library=*) : ;; *) xc_bad_var_libs=yes ;; esac done if test $xc_bad_var_libs = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: using LIBS: $LIBS" >&5 $as_echo "$as_me: using LIBS: $LIBS" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: LIBS note: LIBS should only be used to specify libraries (-lname)." >&5 $as_echo "$as_me: LIBS note: LIBS should only be used to specify libraries (-lname)." >&6;} fi xc_bad_var_ldflags=no for xc_word in $LDFLAGS; do case "$xc_word" in -D*) xc_bad_var_ldflags=yes ;; -U*) xc_bad_var_ldflags=yes ;; -I*) xc_bad_var_ldflags=yes ;; -l* | --library=*) xc_bad_var_ldflags=yes ;; esac done if test $xc_bad_var_ldflags = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: using LDFLAGS: $LDFLAGS" >&5 $as_echo "$as_me: using LDFLAGS: $LDFLAGS" >&6;} xc_bad_var_msg="LDFLAGS note: LDFLAGS should only be used to specify linker flags, not" for xc_word in $LDFLAGS; do case "$xc_word" in -D*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&6;} ;; -U*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&6;} ;; -I*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&6;} ;; -l* | --library=*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} ;; esac done fi xc_bad_var_cppflags=no for xc_word in $CPPFLAGS; do case "$xc_word" in -rpath*) xc_bad_var_cppflags=yes ;; -L* | --library-path=*) xc_bad_var_cppflags=yes ;; -l* | --library=*) xc_bad_var_cppflags=yes ;; esac done if test $xc_bad_var_cppflags = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: using CPPFLAGS: $CPPFLAGS" >&5 $as_echo "$as_me: using CPPFLAGS: $CPPFLAGS" >&6;} xc_bad_var_msg="CPPFLAGS note: CPPFLAGS should only be used to specify C preprocessor flags, not" for xc_word in $CPPFLAGS; do case "$xc_word" in -rpath*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&6;} ;; -L* | --library-path=*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&6;} ;; -l* | --library=*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} ;; esac done fi xc_bad_var_cflags=no for xc_word in $CFLAGS; do case "$xc_word" in -D*) xc_bad_var_cflags=yes ;; -U*) xc_bad_var_cflags=yes ;; -I*) xc_bad_var_cflags=yes ;; -rpath*) xc_bad_var_cflags=yes ;; -L* | --library-path=*) xc_bad_var_cflags=yes ;; -l* | --library=*) xc_bad_var_cflags=yes ;; esac done if test $xc_bad_var_cflags = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: using CFLAGS: $CFLAGS" >&5 $as_echo "$as_me: using CFLAGS: $CFLAGS" >&6;} xc_bad_var_msg="CFLAGS note: CFLAGS should only be used to specify C compiler flags, not" for xc_word in $CFLAGS; do case "$xc_word" in -D*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&6;} ;; -U*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&6;} ;; -I*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&6;} ;; -rpath*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&6;} ;; -L* | --library-path=*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&6;} ;; -l* | --library=*) { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 $as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} ;; esac done fi if test $xc_bad_var_libs = yes || test $xc_bad_var_cflags = yes || test $xc_bad_var_ldflags = yes || test $xc_bad_var_cppflags = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Continuing even with errors mentioned immediately above this line." >&5 $as_echo "$as_me: WARNING: Continuing even with errors mentioned immediately above this line." >&2;} fi if test "x$want_curldebug_assumed" = "xyes" && test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then ac_configure_args="$ac_configure_args --enable-curldebug" fi ac_config_files="$ac_config_files Makefile docs/Makefile docs/examples/Makefile docs/libcurl/Makefile include/Makefile include/curl/Makefile src/Makefile lib/Makefile lib/libcurl.vers tests/Makefile tests/certs/Makefile tests/certs/scripts/Makefile tests/data/Makefile tests/server/Makefile tests/libtest/Makefile tests/unit/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/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" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${CURL_LT_SHLIB_USE_VERSION_INFO_TRUE}" && test -z "${CURL_LT_SHLIB_USE_VERSION_INFO_FALSE}"; then as_fn_error $? "conditional \"CURL_LT_SHLIB_USE_VERSION_INFO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CURL_LT_SHLIB_USE_NO_UNDEFINED_TRUE}" && test -z "${CURL_LT_SHLIB_USE_NO_UNDEFINED_FALSE}"; then as_fn_error $? "conditional \"CURL_LT_SHLIB_USE_NO_UNDEFINED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CURL_LT_SHLIB_USE_MIMPURE_TEXT_TRUE}" && test -z "${CURL_LT_SHLIB_USE_MIMPURE_TEXT_FALSE}"; then as_fn_error $? "conditional \"CURL_LT_SHLIB_USE_MIMPURE_TEXT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_CPPFLAG_CURL_STATICLIB_TRUE}" && test -z "${USE_CPPFLAG_CURL_STATICLIB_FALSE}"; then as_fn_error $? "conditional \"USE_CPPFLAG_CURL_STATICLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_EXPLICIT_LIB_DEPS_TRUE}" && test -z "${USE_EXPLICIT_LIB_DEPS_FALSE}"; then as_fn_error $? "conditional \"USE_EXPLICIT_LIB_DEPS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CURLDEBUG_TRUE}" && test -z "${CURLDEBUG_FALSE}"; then as_fn_error $? "conditional \"CURLDEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_UNITTESTS_TRUE}" && test -z "${BUILD_UNITTESTS_FALSE}"; then as_fn_error $? "conditional \"BUILD_UNITTESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DOING_NATIVE_WINDOWS_TRUE}" && test -z "${DOING_NATIVE_WINDOWS_FALSE}"; then as_fn_error $? "conditional \"DOING_NATIVE_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBZ_TRUE}" && test -z "${HAVE_LIBZ_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBZ\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_TRUE}" && test -z "${CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_FALSE}"; then as_fn_error $? "conditional \"CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_MANUAL_TRUE}" && test -z "${USE_MANUAL_FALSE}"; then as_fn_error $? "conditional \"USE_MANUAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_EMBEDDED_ARES_TRUE}" && test -z "${USE_EMBEDDED_ARES_FALSE}"; then as_fn_error $? "conditional \"USE_EMBEDDED_ARES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_LIBHOSTNAME_TRUE}" && test -z "${BUILD_LIBHOSTNAME_FALSE}"; then as_fn_error $? "conditional \"BUILD_LIBHOSTNAME\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DOING_CURL_SYMBOL_HIDING_TRUE}" && test -z "${DOING_CURL_SYMBOL_HIDING_FALSE}"; then as_fn_error $? "conditional \"DOING_CURL_SYMBOL_HIDING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SONAME_BUMP_TRUE}" && test -z "${SONAME_BUMP_FALSE}"; then as_fn_error $? "conditional \"SONAME_BUMP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CROSSCOMPILING_TRUE}" && test -z "${CROSSCOMPILING_FALSE}"; then as_fn_error $? "conditional \"CROSSCOMPILING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by curl $as_me -, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ curl config.status - configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "lib/curl_config.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/curl_config.h" ;; "include/curl/curlbuild.h") CONFIG_HEADERS="$CONFIG_HEADERS include/curl/curlbuild.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/examples/Makefile") CONFIG_FILES="$CONFIG_FILES docs/examples/Makefile" ;; "docs/libcurl/Makefile") CONFIG_FILES="$CONFIG_FILES docs/libcurl/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/curl/Makefile") CONFIG_FILES="$CONFIG_FILES include/curl/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/libcurl.vers") CONFIG_FILES="$CONFIG_FILES lib/libcurl.vers" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/certs/Makefile") CONFIG_FILES="$CONFIG_FILES tests/certs/Makefile" ;; "tests/certs/scripts/Makefile") CONFIG_FILES="$CONFIG_FILES tests/certs/scripts/Makefile" ;; "tests/data/Makefile") CONFIG_FILES="$CONFIG_FILES tests/data/Makefile" ;; "tests/server/Makefile") CONFIG_FILES="$CONFIG_FILES tests/server/Makefile" ;; "tests/libtest/Makefile") CONFIG_FILES="$CONFIG_FILES tests/libtest/Makefile" ;; "tests/unit/Makefile") CONFIG_FILES="$CONFIG_FILES tests/unit/Makefile" ;; "packages/Makefile") CONFIG_FILES="$CONFIG_FILES packages/Makefile" ;; "packages/Win32/Makefile") CONFIG_FILES="$CONFIG_FILES packages/Win32/Makefile" ;; "packages/Win32/cygwin/Makefile") CONFIG_FILES="$CONFIG_FILES packages/Win32/cygwin/Makefile" ;; "packages/Linux/Makefile") CONFIG_FILES="$CONFIG_FILES packages/Linux/Makefile" ;; "packages/Linux/RPM/Makefile") CONFIG_FILES="$CONFIG_FILES packages/Linux/RPM/Makefile" ;; "packages/Linux/RPM/curl.spec") CONFIG_FILES="$CONFIG_FILES packages/Linux/RPM/curl.spec" ;; "packages/Linux/RPM/curl-ssl.spec") CONFIG_FILES="$CONFIG_FILES packages/Linux/RPM/curl-ssl.spec" ;; "packages/Solaris/Makefile") CONFIG_FILES="$CONFIG_FILES packages/Solaris/Makefile" ;; "packages/EPM/curl.list") CONFIG_FILES="$CONFIG_FILES packages/EPM/curl.list" ;; "packages/EPM/Makefile") CONFIG_FILES="$CONFIG_FILES packages/EPM/Makefile" ;; "packages/vms/Makefile") CONFIG_FILES="$CONFIG_FILES packages/vms/Makefile" ;; "packages/AIX/Makefile") CONFIG_FILES="$CONFIG_FILES packages/AIX/Makefile" ;; "packages/AIX/RPM/Makefile") CONFIG_FILES="$CONFIG_FILES packages/AIX/RPM/Makefile" ;; "packages/AIX/RPM/curl.spec") CONFIG_FILES="$CONFIG_FILES packages/AIX/RPM/curl.spec" ;; "curl-config") CONFIG_FILES="$CONFIG_FILES curl-config" ;; "libcurl.pc") CONFIG_FILES="$CONFIG_FILES libcurl.pc" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file, --srcdir, and --disable-option-checking arguments # so they do not pile up. ac_sub_configure_args= ac_prev= eval "set x $ac_configure_args" shift for ac_arg do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ | --c=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; --disable-option-checking) ;; *) case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_sub_configure_args " '$ac_arg'" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" # Pass --silent if test "$silent" = yes; then ac_sub_configure_args="--silent $ac_sub_configure_args" fi # Always prepend --disable-option-checking to silence warnings, since # different subdirs can have different --enable and --with options. ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 $as_echo "$ac_msg" >&6 as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" # Check for guested configure; otherwise get Cygnus style configure. if test -f "$ac_srcdir/configure.gnu"; then ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure elif test -f "$ac_srcdir/configure.in"; then # This should be Cygnus configure. ac_sub_configure=$ac_aux_dir/configure else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative name. ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 fi cd "$ac_popdir" done fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi tmp_cpp=`eval echo "$ac_cpp" 2>/dev/null` if test -z "$tmp_cpp"; then tmp_cpp='cpp' fi cat >./tests/configurehelp.pm <<_EOF # This is a generated file. Do not edit. package configurehelp; use strict; use warnings; use Exporter; use vars qw( @ISA @EXPORT_OK \$Cpreprocessor ); @ISA = qw(Exporter); @EXPORT_OK = qw( \$Cpreprocessor ); \$Cpreprocessor = '$tmp_cpp'; 1; _EOF ## ---------------------------------- ## ## Start of distclean amending code ## ## ---------------------------------- ## for xc_subdir in lib src tests/unit tests/server tests/libtest docs/examples do if test ! -f "$xc_subdir/Makefile"; then echo "$xc_msg_err $xc_subdir/Makefile file not found. $xc_msg_abrt" >&2 exit 1 fi # Fetch dependency tracking file list from Makefile include lines. xc_inc_lines=`grep '^include .*(DEPDIR)' "$xc_subdir/Makefile" 2>/dev/null` xc_cnt_words=`echo "$xc_inc_lines" | wc -w | tr -d "$xc_space$xc_tab"` # --disable-dependency-tracking might have been used, consequently # there is nothing to amend without a dependency tracking file list. if test $xc_cnt_words -gt 0; then { $as_echo "$as_me:${as_lineno-$LINENO}: amending $xc_subdir/Makefile" >&5 $as_echo "$as_me: amending $xc_subdir/Makefile" >&6;} # Build Makefile specific patch hunk. xc_p="$xc_subdir/xc_patch.tmp" xc_rm_depfiles=`echo "$xc_inc_lines" \ | $SED 's%include% -rm -f%' 2>/dev/null` xc_dep_subdirs=`echo "$xc_inc_lines" \ | $SED 's%include[ ][ ]*%%' 2>/dev/null \ | $SED 's%(DEPDIR)/.*%(DEPDIR)%' 2>/dev/null \ | sort | uniq` echo "$xc_rm_depfiles" >$xc_p for xc_dep_dir in $xc_dep_subdirs; do echo "${xc_tab}@xm_dep_cnt=\`ls $xc_dep_dir | wc -l 2>/dev/null\`; \\" >>$xc_p echo "${xc_tab}if test \$\$xm_dep_cnt -eq 0 && test -d $xc_dep_dir; then \\" >>$xc_p echo "${xc_tab} rm -rf $xc_dep_dir; \\" >>$xc_p echo "${xc_tab}fi" >>$xc_p done # Build Makefile patching sed scripts. xc_s1="$xc_subdir/xc_script_1.tmp" xc_s2="$xc_subdir/xc_script_2.tmp" xc_s3="$xc_subdir/xc_script_3.tmp" cat >$xc_s1 <<\_EOT /^distclean[ ]*:/,/^[^ ][^ ]*:/{ s/^.*(DEPDIR)/___xc_depdir_line___/ } /^maintainer-clean[ ]*:/,/^[^ ][^ ]*:/{ s/^.*(DEPDIR)/___xc_depdir_line___/ } _EOT cat >$xc_s2 <<\_EOT /___xc_depdir_line___$/{ N /___xc_depdir_line___$/D } _EOT cat >$xc_s3 <<_EOT /^___xc_depdir_line___/{ r $xc_p d } _EOT # Apply patch to Makefile and cleanup. $SED -f "$xc_s1" "$xc_subdir/Makefile" >"$xc_subdir/Makefile.tmp1" $SED -f "$xc_s2" "$xc_subdir/Makefile.tmp1" >"$xc_subdir/Makefile.tmp2" $SED -f "$xc_s3" "$xc_subdir/Makefile.tmp2" >"$xc_subdir/Makefile.tmp3" if test -f "$xc_subdir/Makefile.tmp3"; then mv -f "$xc_subdir/Makefile.tmp3" "$xc_subdir/Makefile" fi test -f "$xc_subdir/Makefile.tmp1" && rm -f "$xc_subdir/Makefile.tmp1" test -f "$xc_subdir/Makefile.tmp2" && rm -f "$xc_subdir/Makefile.tmp2" test -f "$xc_subdir/Makefile.tmp3" && rm -f "$xc_subdir/Makefile.tmp3" test -f "$xc_p" && rm -f "$xc_p" test -f "$xc_s1" && rm -f "$xc_s1" test -f "$xc_s2" && rm -f "$xc_s2" test -f "$xc_s3" && rm -f "$xc_s3" fi done ## -------------------------------- ## ## End of distclean amending code ## ## -------------------------------- ## { $as_echo "$as_me:${as_lineno-$LINENO}: Configured to build curl/libcurl: curl version: ${CURLVERSION} Host setup: ${host} Install prefix: ${prefix} Compiler: ${CC} SSL support: ${curl_ssl_msg} SSH support: ${curl_ssh_msg} zlib support: ${curl_zlib_msg} GSSAPI support: ${curl_gss_msg} SPNEGO support: ${curl_spnego_msg} TLS-SRP support: ${curl_tls_srp_msg} resolver: ${curl_res_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} --libcurl option: ${curl_libcurl_msg} Verbose errors: ${curl_verbose_msg} SSPI support: ${curl_sspi_msg} ca cert bundle: ${ca} ca cert path: ${capath} LDAP support: ${curl_ldap_msg} LDAPS support: ${curl_ldaps_msg} RTSP support: ${curl_rtsp_msg} RTMP support: ${curl_rtmp_msg} metalink support: ${curl_mtlnk_msg} HTTP2 support: ${curl_h2_msg} Protocols: ${SUPPORT_PROTOCOLS} " >&5 $as_echo "$as_me: Configured to build curl/libcurl: curl version: ${CURLVERSION} Host setup: ${host} Install prefix: ${prefix} Compiler: ${CC} SSL support: ${curl_ssl_msg} SSH support: ${curl_ssh_msg} zlib support: ${curl_zlib_msg} GSSAPI support: ${curl_gss_msg} SPNEGO support: ${curl_spnego_msg} TLS-SRP support: ${curl_tls_srp_msg} resolver: ${curl_res_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} --libcurl option: ${curl_libcurl_msg} Verbose errors: ${curl_verbose_msg} SSPI support: ${curl_sspi_msg} ca cert bundle: ${ca} ca cert path: ${capath} LDAP support: ${curl_ldap_msg} LDAPS support: ${curl_ldaps_msg} RTSP support: ${curl_rtsp_msg} RTMP support: ${curl_rtmp_msg} metalink support: ${curl_mtlnk_msg} HTTP2 support: ${curl_h2_msg} Protocols: ${SUPPORT_PROTOCOLS} " >&6;} if test "x$soname_bump" = "xyes"; then cat < # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 # TARGTYPE "Win32 (x86) Static Library" 0x0104 CFG=libcurl - Win32 LIB 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 "vc6libcurl.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 "vc6libcurl.mak" CFG="libcurl - Win32 LIB Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "libcurl - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libcurl - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libcurl - Win32 LIB Debug" (based on "Win32 (x86) Static Library") !MESSAGE "libcurl - Win32 LIB Release" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" !IF "$(CFG)" == "libcurl - Win32 DLL Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "dll-debug" # PROP BASE Intermediate_Dir "dll-debug/obj" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "dll-debug" # PROP Intermediate_Dir "dll-debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" CPP=cl.exe # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "BUILDING_LIBCURL" /FD /GZ /c # ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "BUILDING_LIBCURL" /FD /GZ /c MTL=midl.exe # ADD BASE MTL /nologo /D "_DEBUG" /win32 # ADD MTL /nologo /D "_DEBUG" /win32 RSC=rc.exe # 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 wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"dll-debug/libcurld.dll" /implib:"dll-debug/libcurld_imp.lib" /pdbtype:con /fixed:no # ADD LINK32 wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"dll-debug/libcurld.dll" /implib:"dll-debug/libcurld_imp.lib" /pdbtype:con /fixed:no !ELSEIF "$(CFG)" == "libcurl - Win32 DLL Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "dll-release" # PROP BASE Intermediate_Dir "dll-release/obj" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "dll-release" # PROP Intermediate_Dir "dll-release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" CPP=cl.exe # ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "BUILDING_LIBCURL" /FD /c # ADD CPP /nologo /MD /W3 /EHsc /O2 /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "BUILDING_LIBCURL" /FD /c MTL=midl.exe # ADD BASE MTL /nologo /D "NDEBUG" /win32 # ADD MTL /nologo /D "NDEBUG" /win32 RSC=rc.exe # 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 wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /dll /pdb:none /machine:I386 /out:"dll-release/libcurl.dll" /implib:"dll-release/libcurl_imp.lib" /fixed:no /release /incremental:no # ADD LINK32 wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /dll /pdb:none /machine:I386 /out:"dll-release/libcurl.dll" /implib:"dll-release/libcurl_imp.lib" /fixed:no /release /incremental:no !ELSEIF "$(CFG)" == "libcurl - Win32 LIB Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "lib-debug" # PROP BASE Intermediate_Dir "lib-debug/obj" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "lib-debug" # PROP Intermediate_Dir "lib-debug/obj" # PROP Target_Dir "" CPP=cl.exe # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "BUILDING_LIBCURL" /D "CURL_STATICLIB" /FD /GZ /c # ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "BUILDING_LIBCURL" /D "CURL_STATICLIB" /FD /GZ /c RSC=rc.exe # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo /out:"lib-debug/libcurld.lib" /machine:I386 # ADD LIB32 /nologo /out:"lib-debug/libcurld.lib" /machine:I386 !ELSEIF "$(CFG)" == "libcurl - Win32 LIB Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "lib-release" # PROP BASE Intermediate_Dir "lib-release/obj" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "lib-release" # PROP Intermediate_Dir "lib-release/obj" # PROP Target_Dir "" CPP=cl.exe # ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "BUILDING_LIBCURL" /D "CURL_STATICLIB" /FD /c # ADD CPP /nologo /MD /W3 /EHsc /O2 /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "BUILDING_LIBCURL" /D "CURL_STATICLIB" /FD /c RSC=rc.exe # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo /out:"lib-release/libcurl.lib" /machine:I386 # ADD LIB32 /nologo /out:"lib-release/libcurl.lib" /machine:I386 !ENDIF # Begin Target # Name "libcurl - Win32 DLL Debug" # Name "libcurl - Win32 DLL Release" # Name "libcurl - Win32 LIB Debug" # Name "libcurl - Win32 LIB Release" # Begin Group "Source Files" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\lib\amigaos.c # End Source File # Begin Source File SOURCE=..\..\..\lib\asyn-ares.c # End Source File # Begin Source File SOURCE=..\..\..\lib\asyn-thread.c # End Source File # Begin Source File SOURCE=..\..\..\lib\base64.c # End Source File # Begin Source File SOURCE=..\..\..\lib\bundles.c # End Source File # Begin Source File SOURCE=..\..\..\lib\conncache.c # End Source File # Begin Source File SOURCE=..\..\..\lib\connect.c # End Source File # Begin Source File SOURCE=..\..\..\lib\content_encoding.c # End Source File # Begin Source File SOURCE=..\..\..\lib\cookie.c # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_addrinfo.c # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_fnmatch.c # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_gethostname.c # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_gssapi.c # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_memrchr.c # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_multibyte.c # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_ntlm.c # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_ntlm_core.c # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_ntlm_msgs.c # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_ntlm_wb.c # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_rtmp.c # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_sasl.c # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_sspi.c # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_threads.c # End Source File # Begin Source File SOURCE=..\..\..\lib\dict.c # End Source File # Begin Source File SOURCE=..\..\..\lib\dotdot.c # End Source File # Begin Source File SOURCE=..\..\..\lib\easy.c # End Source File # Begin Source File SOURCE=..\..\..\lib\escape.c # End Source File # Begin Source File SOURCE=..\..\..\lib\file.c # End Source File # Begin Source File SOURCE=..\..\..\lib\fileinfo.c # End Source File # Begin Source File SOURCE=..\..\..\lib\formdata.c # End Source File # Begin Source File SOURCE=..\..\..\lib\ftp.c # End Source File # Begin Source File SOURCE=..\..\..\lib\ftplistparser.c # End Source File # Begin Source File SOURCE=..\..\..\lib\getenv.c # End Source File # Begin Source File SOURCE=..\..\..\lib\getinfo.c # End Source File # Begin Source File SOURCE=..\..\..\lib\gopher.c # End Source File # Begin Source File SOURCE=..\..\..\lib\hash.c # End Source File # Begin Source File SOURCE=..\..\..\lib\hmac.c # End Source File # Begin Source File SOURCE=..\..\..\lib\hostasyn.c # End Source File # Begin Source File SOURCE=..\..\..\lib\hostcheck.c # End Source File # Begin Source File SOURCE=..\..\..\lib\hostip4.c # End Source File # Begin Source File SOURCE=..\..\..\lib\hostip6.c # End Source File # Begin Source File SOURCE=..\..\..\lib\hostip.c # End Source File # Begin Source File SOURCE=..\..\..\lib\hostsyn.c # End Source File # Begin Source File SOURCE=..\..\..\lib\http2.c # End Source File # Begin Source File SOURCE=..\..\..\lib\http.c # End Source File # Begin Source File SOURCE=..\..\..\lib\http_chunks.c # End Source File # Begin Source File SOURCE=..\..\..\lib\http_digest.c # End Source File # Begin Source File SOURCE=..\..\..\lib\http_negotiate.c # End Source File # Begin Source File SOURCE=..\..\..\lib\http_negotiate_sspi.c # End Source File # Begin Source File SOURCE=..\..\..\lib\http_proxy.c # End Source File # Begin Source File SOURCE=..\..\..\lib\idn_win32.c # End Source File # Begin Source File SOURCE=..\..\..\lib\if2ip.c # End Source File # Begin Source File SOURCE=..\..\..\lib\imap.c # End Source File # Begin Source File SOURCE=..\..\..\lib\inet_ntop.c # End Source File # Begin Source File SOURCE=..\..\..\lib\inet_pton.c # End Source File # Begin Source File SOURCE=..\..\..\lib\krb5.c # End Source File # Begin Source File SOURCE=..\..\..\lib\ldap.c # End Source File # Begin Source File SOURCE=..\..\..\lib\llist.c # End Source File # Begin Source File SOURCE=..\..\..\lib\md4.c # End Source File # Begin Source File SOURCE=..\..\..\lib\md5.c # End Source File # Begin Source File SOURCE=..\..\..\lib\memdebug.c # End Source File # Begin Source File SOURCE=..\..\..\lib\mprintf.c # End Source File # Begin Source File SOURCE=..\..\..\lib\multi.c # End Source File # Begin Source File SOURCE=..\..\..\lib\netrc.c # End Source File # Begin Source File SOURCE=..\..\..\lib\non-ascii.c # End Source File # Begin Source File SOURCE=..\..\..\lib\nonblock.c # End Source File # Begin Source File SOURCE=..\..\..\lib\openldap.c # End Source File # Begin Source File SOURCE=..\..\..\lib\parsedate.c # End Source File # Begin Source File SOURCE=..\..\..\lib\pingpong.c # End Source File # Begin Source File SOURCE=..\..\..\lib\pipeline.c # End Source File # Begin Source File SOURCE=..\..\..\lib\pop3.c # End Source File # Begin Source File SOURCE=..\..\..\lib\progress.c # End Source File # Begin Source File SOURCE=..\..\..\lib\rawstr.c # End Source File # Begin Source File SOURCE=..\..\..\lib\rtsp.c # End Source File # Begin Source File SOURCE=..\..\..\lib\security.c # End Source File # Begin Source File SOURCE=..\..\..\lib\select.c # End Source File # Begin Source File SOURCE=..\..\..\lib\sendf.c # End Source File # Begin Source File SOURCE=..\..\..\lib\share.c # End Source File # Begin Source File SOURCE=..\..\..\lib\slist.c # End Source File # Begin Source File SOURCE=..\..\..\lib\smtp.c # End Source File # Begin Source File SOURCE=..\..\..\lib\socks.c # End Source File # Begin Source File SOURCE=..\..\..\lib\socks_gssapi.c # End Source File # Begin Source File SOURCE=..\..\..\lib\socks_sspi.c # End Source File # Begin Source File SOURCE=..\..\..\lib\speedcheck.c # End Source File # Begin Source File SOURCE=..\..\..\lib\splay.c # End Source File # Begin Source File SOURCE=..\..\..\lib\ssh.c # End Source File # Begin Source File SOURCE=..\..\..\lib\strdup.c # End Source File # Begin Source File SOURCE=..\..\..\lib\strequal.c # End Source File # Begin Source File SOURCE=..\..\..\lib\strerror.c # End Source File # Begin Source File SOURCE=..\..\..\lib\strtok.c # End Source File # Begin Source File SOURCE=..\..\..\lib\strtoofft.c # End Source File # Begin Source File SOURCE=..\..\..\lib\telnet.c # End Source File # Begin Source File SOURCE=..\..\..\lib\tftp.c # End Source File # Begin Source File SOURCE=..\..\..\lib\timeval.c # End Source File # Begin Source File SOURCE=..\..\..\lib\transfer.c # End Source File # Begin Source File SOURCE=..\..\..\lib\url.c # End Source File # Begin Source File SOURCE=..\..\..\lib\version.c # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/axtls.c # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/curl_darwinssl.c # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/curl_schannel.c # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/cyassl.c # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/gskit.c # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/gtls.c # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/nss.c # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/openssl.c # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/polarssl.c # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/polarssl_threadlock.c # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/qssl.c # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/vtls.c # End Source File # Begin Source File SOURCE=..\..\..\lib\warnless.c # End Source File # Begin Source File SOURCE=..\..\..\lib\wildcard.c # End Source File # Begin Source File SOURCE=..\..\..\lib\x509asn1.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\lib\amigaos.h # End Source File # Begin Source File SOURCE=..\..\..\lib\arpa_telnet.h # End Source File # Begin Source File SOURCE=..\..\..\lib\asyn.h # End Source File # Begin Source File SOURCE=..\..\..\lib\bundles.h # End Source File # Begin Source File SOURCE=..\..\..\lib\config-win32.h # End Source File # Begin Source File SOURCE=..\..\..\lib\conncache.h # End Source File # Begin Source File SOURCE=..\..\..\lib\connect.h # End Source File # Begin Source File SOURCE=..\..\..\lib\content_encoding.h # End Source File # Begin Source File SOURCE=..\..\..\lib\cookie.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_addrinfo.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_base64.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_fnmatch.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_gethostname.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_gssapi.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_hmac.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_ldap.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_md4.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_md5.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_memory.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_memrchr.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_multibyte.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_ntlm_core.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_ntlm.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_ntlm_msgs.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_ntlm_wb.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_rtmp.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_sasl.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_sec.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_setup.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_setup_once.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_sspi.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curl_threads.h # End Source File # Begin Source File SOURCE=..\..\..\lib\curlx.h # End Source File # Begin Source File SOURCE=..\..\..\lib\dict.h # End Source File # Begin Source File SOURCE=..\..\..\lib\dotdot.h # End Source File # Begin Source File SOURCE=..\..\..\lib\easyif.h # End Source File # Begin Source File SOURCE=..\..\..\lib\escape.h # End Source File # Begin Source File SOURCE=..\..\..\lib\file.h # End Source File # Begin Source File SOURCE=..\..\..\lib\fileinfo.h # End Source File # Begin Source File SOURCE=..\..\..\lib\formdata.h # End Source File # Begin Source File SOURCE=..\..\..\lib\ftp.h # End Source File # Begin Source File SOURCE=..\..\..\lib\ftplistparser.h # End Source File # Begin Source File SOURCE=..\..\..\lib\getinfo.h # End Source File # Begin Source File SOURCE=..\..\..\lib\gopher.h # End Source File # Begin Source File SOURCE=..\..\..\lib\hash.h # End Source File # Begin Source File SOURCE=..\..\..\lib\hostcheck.h # End Source File # Begin Source File SOURCE=..\..\..\lib\hostip.h # End Source File # Begin Source File SOURCE=..\..\..\lib\http2.h # End Source File # Begin Source File SOURCE=..\..\..\lib\http_chunks.h # End Source File # Begin Source File SOURCE=..\..\..\lib\http_digest.h # End Source File # Begin Source File SOURCE=..\..\..\lib\http.h # End Source File # Begin Source File SOURCE=..\..\..\lib\http_negotiate.h # End Source File # Begin Source File SOURCE=..\..\..\lib\http_proxy.h # End Source File # Begin Source File SOURCE=..\..\..\lib\if2ip.h # End Source File # Begin Source File SOURCE=..\..\..\lib\imap.h # End Source File # Begin Source File SOURCE=..\..\..\lib\inet_ntop.h # End Source File # Begin Source File SOURCE=..\..\..\lib\inet_pton.h # End Source File # Begin Source File SOURCE=..\..\..\lib\llist.h # End Source File # Begin Source File SOURCE=..\..\..\lib\memdebug.h # End Source File # Begin Source File SOURCE=..\..\..\lib\multihandle.h # End Source File # Begin Source File SOURCE=..\..\..\lib\multiif.h # End Source File # Begin Source File SOURCE=..\..\..\lib\netrc.h # End Source File # Begin Source File SOURCE=..\..\..\lib\non-ascii.h # End Source File # Begin Source File SOURCE=..\..\..\lib\nonblock.h # End Source File # Begin Source File SOURCE=..\..\..\lib\parsedate.h # End Source File # Begin Source File SOURCE=..\..\..\lib\pingpong.h # End Source File # Begin Source File SOURCE=..\..\..\lib\pipeline.h # End Source File # Begin Source File SOURCE=..\..\..\lib\pop3.h # End Source File # Begin Source File SOURCE=..\..\..\lib\progress.h # End Source File # Begin Source File SOURCE=..\..\..\lib\rawstr.h # End Source File # Begin Source File SOURCE=..\..\..\lib\rtsp.h # End Source File # Begin Source File SOURCE=..\..\..\lib\select.h # End Source File # Begin Source File SOURCE=..\..\..\lib\sendf.h # End Source File # Begin Source File SOURCE=..\..\..\lib\setup-vms.h # End Source File # Begin Source File SOURCE=..\..\..\lib\share.h # End Source File # Begin Source File SOURCE=..\..\..\lib\sigpipe.h # End Source File # Begin Source File SOURCE=..\..\..\lib\slist.h # End Source File # Begin Source File SOURCE=..\..\..\lib\smtp.h # End Source File # Begin Source File SOURCE=..\..\..\lib\sockaddr.h # End Source File # Begin Source File SOURCE=..\..\..\lib\socks.h # End Source File # Begin Source File SOURCE=..\..\..\lib\speedcheck.h # End Source File # Begin Source File SOURCE=..\..\..\lib\splay.h # End Source File # Begin Source File SOURCE=..\..\..\lib\ssh.h # End Source File # Begin Source File SOURCE=..\..\..\lib\strdup.h # End Source File # Begin Source File SOURCE=..\..\..\lib\strequal.h # End Source File # Begin Source File SOURCE=..\..\..\lib\strerror.h # End Source File # Begin Source File SOURCE=..\..\..\lib\strtok.h # End Source File # Begin Source File SOURCE=..\..\..\lib\strtoofft.h # End Source File # Begin Source File SOURCE=..\..\..\lib\telnet.h # End Source File # Begin Source File SOURCE=..\..\..\lib\tftp.h # End Source File # Begin Source File SOURCE=..\..\..\lib\timeval.h # End Source File # Begin Source File SOURCE=..\..\..\lib\transfer.h # End Source File # Begin Source File SOURCE=..\..\..\lib\urldata.h # End Source File # Begin Source File SOURCE=..\..\..\lib\url.h # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/axtls.h # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/curl_darwinssl.h # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/curl_schannel.h # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/cyassl.h # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/gskit.h # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/gtls.h # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/nssg.h # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/openssl.h # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/polarssl.h # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/polarssl_threadlock.h # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/qssl.h # End Source File # Begin Source File SOURCE=..\..\..\lib\vtls/vtls.h # End Source File # Begin Source File SOURCE=..\..\..\lib\warnless.h # End Source File # Begin Source File SOURCE=..\..\..\lib\wildcard.h # End Source File # Begin Source File SOURCE=..\..\..\lib\x509asn1.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\lib\libcurl.rc # End Source File # End Group # End Target # End Project curl-7.35.0/vs/vc6/lib/vc6libcurl.dsw0000644000175000017500000000103612213173003014152 00000000000000Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "libcurl"=".\vc6libcurl.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### curl-7.35.0/vs/vc6/src/0000755000175000017500000000000012272124475011477 500000000000000curl-7.35.0/vs/vc6/src/vc6curltool.dsw0000644000175000017500000000104012213173003014375 00000000000000Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "curltool"=".\vc6curltool.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### curl-7.35.0/vs/vc6/src/vc6curltool.dsp0000644000175000017500000003301512213173003014375 00000000000000# Microsoft Developer Studio Project File - Name="curltool" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=curltool - Win32 using libcurl LIB 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 "vc6curltool.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 "vc6curltool.mak" CFG="curltool - Win32 using libcurl LIB Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "curltool - Win32 using libcurl DLL Debug" (based on "Win32 (x86) Console Application") !MESSAGE "curltool - Win32 using libcurl DLL Release" (based on "Win32 (x86) Console Application") !MESSAGE "curltool - Win32 using libcurl LIB Debug" (based on "Win32 (x86) Console Application") !MESSAGE "curltool - Win32 using libcurl LIB Release" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "curltool - Win32 using libcurl DLL Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "dll-debug" # PROP BASE Intermediate_Dir "dll-debug/obj" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "dll-debug" # PROP Intermediate_Dir "dll-debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "..\..\..\lib" /I "..\..\..\include" /I "..\..\..\src" /D "_CONSOLE" /D "WIN32" /D "_DEBUG" /FD /GZ /c # ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "..\..\..\lib" /I "..\..\..\include" /I "..\..\..\src" /D "_CONSOLE" /D "WIN32" /D "_DEBUG" /FD /GZ /c # ADD BASE RSC /l 0x409 /i "..\..\..\include" /d "_DEBUG" # ADD RSC /l 0x409 /i "..\..\..\include" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 libcurld_imp.lib wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"dll-debug/curl.exe" /pdbtype:con /libpath:"..\lib\dll-debug" /fixed:no # ADD LINK32 libcurld_imp.lib wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"dll-debug/curl.exe" /pdbtype:con /libpath:"..\lib\dll-debug" /fixed:no !ELSEIF "$(CFG)" == "curltool - Win32 using libcurl DLL Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "dll-release" # PROP BASE Intermediate_Dir "dll-release/obj" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "dll-release" # PROP Intermediate_Dir "dll-release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "..\..\..\lib" /I "..\..\..\include" /I "..\..\..\src" /D "_CONSOLE" /D "WIN32" /D "NDEBUG" /FD /c # ADD CPP /nologo /MD /W3 /EHsc /O2 /I "..\..\..\lib" /I "..\..\..\include" /I "..\..\..\src" /D "_CONSOLE" /D "WIN32" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /i "..\..\..\include" /d "NDEBUG" # ADD RSC /l 0x409 /i "..\..\..\include" /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 libcurl_imp.lib wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"dll-release/curl.exe" /libpath:"..\lib\dll-release" /fixed:no # ADD LINK32 libcurl_imp.lib wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"dll-release/curl.exe" /libpath:"..\lib\dll-release" /fixed:no !ELSEIF "$(CFG)" == "curltool - Win32 using libcurl LIB Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "lib-debug" # PROP BASE Intermediate_Dir "lib-debug/obj" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "lib-debug" # PROP Intermediate_Dir "lib-debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "..\..\..\lib" /I "..\..\..\include" /I "..\..\..\src" /D "_CONSOLE" /D "WIN32" /D "_DEBUG" /D "CURL_STATICLIB" /FD /GZ /c # ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "..\..\..\lib" /I "..\..\..\include" /I "..\..\..\src" /D "_CONSOLE" /D "WIN32" /D "_DEBUG" /D "CURL_STATICLIB" /FD /GZ /c # ADD BASE RSC /l 0x409 /i "..\..\..\include" /d "_DEBUG" # ADD RSC /l 0x409 /i "..\..\..\include" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 libcurld.lib wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"lib-debug/curl.exe" /pdbtype:con /libpath:"..\lib\lib-debug" /fixed:no # ADD LINK32 libcurld.lib wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"lib-debug/curl.exe" /pdbtype:con /libpath:"..\lib\lib-debug" /fixed:no !ELSEIF "$(CFG)" == "curltool - Win32 using libcurl LIB Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "lib-release" # PROP BASE Intermediate_Dir "lib-release/obj" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "lib-release" # PROP Intermediate_Dir "lib-release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "..\..\..\lib" /I "..\..\..\include" /I "..\..\..\src" /D "_CONSOLE" /D "WIN32" /D "NDEBUG" /D "CURL_STATICLIB" /FD /c # ADD CPP /nologo /MD /W3 /EHsc /O2 /I "..\..\..\lib" /I "..\..\..\include" /I "..\..\..\src" /D "_CONSOLE" /D "WIN32" /D "NDEBUG" /D "CURL_STATICLIB" /FD /c # ADD BASE RSC /l 0x409 /i "..\..\..\include" /d "NDEBUG" # ADD RSC /l 0x409 /i "..\..\..\include" /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 libcurl.lib wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"lib-release/curl.exe" /libpath:"..\lib\lib-release" /fixed:no # ADD LINK32 libcurl.lib wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"lib-release/curl.exe" /libpath:"..\lib\lib-release" /fixed:no !ENDIF # Begin Target # Name "curltool - Win32 using libcurl DLL Debug" # Name "curltool - Win32 using libcurl DLL Release" # Name "curltool - Win32 using libcurl LIB Debug" # Name "curltool - Win32 using libcurl LIB Release" # Begin Group "Source Files" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\lib\nonblock.c # End Source File # Begin Source File SOURCE=..\..\..\lib\rawstr.c # End Source File # Begin Source File SOURCE=..\..\..\lib\strtoofft.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_binmode.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_bname.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_cb_dbg.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_cb_hdr.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_cb_prg.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_cb_rea.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_cb_see.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_cb_wrt.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_cfgable.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_convert.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_dirhie.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_doswin.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_easysrc.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_formparse.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_getparam.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_getpass.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_help.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_helpers.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_homedir.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_hugehelp.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_libinfo.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_main.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_metalink.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_mfiles.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_msgs.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_operate.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_operhlp.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_panykey.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_paramhlp.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_parsecfg.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_setopt.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_sleep.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_urlglob.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_util.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_vms.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_writeenv.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_writeout.c # End Source File # Begin Source File SOURCE=..\..\..\src\tool_xattr.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "" # Begin Source File SOURCE="..\..\..\lib\config-win32.h" # End Source File # Begin Source File SOURCE=..\..\..\lib\nonblock.h # End Source File # Begin Source File SOURCE=..\..\..\lib\rawstr.h # End Source File # Begin Source File SOURCE=..\..\..\lib\strtoofft.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_binmode.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_bname.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_cb_dbg.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_cb_hdr.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_cb_prg.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_cb_rea.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_cb_see.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_cb_wrt.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_cfgable.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_convert.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_dirhie.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_doswin.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_easysrc.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_formparse.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_getparam.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_getpass.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_help.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_helpers.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_homedir.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_hugehelp.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_libinfo.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_main.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_metalink.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_mfiles.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_msgs.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_operate.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_operhlp.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_panykey.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_paramhlp.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_parsecfg.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_sdecls.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_setopt.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_setup.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_sleep.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_urlglob.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_util.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_version.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_vms.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_writeenv.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_writeout.h # End Source File # Begin Source File SOURCE=..\..\..\src\tool_xattr.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\src\curl.rc # End Source File # End Group # End Target # End Project curl-7.35.0/vs/vc6/vc6curl.dsw0000644000175000017500000000150212213173003012713 00000000000000Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "libcurl"=".\lib\vc6libcurl.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "curltool"=".\src\vc6curltool.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name libcurl End Project Dependency }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### curl-7.35.0/vs/vc8/0000755000175000017500000000000012272124475010712 500000000000000curl-7.35.0/vs/vc8/lib/0000755000175000017500000000000012272124475011460 500000000000000curl-7.35.0/vs/vc8/lib/vc8libcurl.vcproj0000644000175000017500000004050512272124475014706 00000000000000 curl-7.35.0/vs/t/0000755000175000017500000000000012272124475010455 500000000000000curl-7.35.0/vs/t/README0000644000175000017500000000052412213173003011240 00000000000000Note: Files located in subdirectory 'vs/t' and below are 'templates' used for the generation of msvc IDE workspace and project files, distributed in subdirectories 'vs/vc6' and 'vs/vc8'. All these template files use UNIX line endings intentionally, in order to allow proper file generation. Don't convert these to crlf line-ends. curl-7.35.0/vs/t/lib/0000755000175000017500000000000012272124475011223 500000000000000curl-7.35.0/vs/t/lib/vc8_libcurl_prj.head0000644000175000017500000000712612213173003015045 00000000000000 curl-7.35.0/vs/t/lib/vc6_libcurl_dsp.foot0000644000175000017500000000024612213173003015100 00000000000000# Begin Group "Resource Files" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\..\lib\libcurl.rc # End Source File # End Group # End Target # End Project curl-7.35.0/vs/t/lib/vc8_libcurl_prj.foot0000644000175000017500000000023512213173003015105 00000000000000 curl-7.35.0/vs/t/lib/vc6_libcurl_dsp.head0000644000175000017500000001346612213173003015042 00000000000000# Microsoft Developer Studio Project File - Name="libcurl" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 # TARGTYPE "Win32 (x86) Static Library" 0x0104 CFG=libcurl - Win32 LIB 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 "vc6libcurl.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 "vc6libcurl.mak" CFG="libcurl - Win32 LIB Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "libcurl - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libcurl - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libcurl - Win32 LIB Debug" (based on "Win32 (x86) Static Library") !MESSAGE "libcurl - Win32 LIB Release" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" !IF "$(CFG)" == "libcurl - Win32 DLL Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "dll-debug" # PROP BASE Intermediate_Dir "dll-debug/obj" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "dll-debug" # PROP Intermediate_Dir "dll-debug/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" CPP=cl.exe # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "BUILDING_LIBCURL" /FD /GZ /c # ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "BUILDING_LIBCURL" /FD /GZ /c MTL=midl.exe # ADD BASE MTL /nologo /D "_DEBUG" /win32 # ADD MTL /nologo /D "_DEBUG" /win32 RSC=rc.exe # 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 wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"dll-debug/libcurld.dll" /implib:"dll-debug/libcurld_imp.lib" /pdbtype:con /fixed:no # ADD LINK32 wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"dll-debug/libcurld.dll" /implib:"dll-debug/libcurld_imp.lib" /pdbtype:con /fixed:no !ELSEIF "$(CFG)" == "libcurl - Win32 DLL Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "dll-release" # PROP BASE Intermediate_Dir "dll-release/obj" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "dll-release" # PROP Intermediate_Dir "dll-release/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" CPP=cl.exe # ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "BUILDING_LIBCURL" /FD /c # ADD CPP /nologo /MD /W3 /EHsc /O2 /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "BUILDING_LIBCURL" /FD /c MTL=midl.exe # ADD BASE MTL /nologo /D "NDEBUG" /win32 # ADD MTL /nologo /D "NDEBUG" /win32 RSC=rc.exe # 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 wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /dll /pdb:none /machine:I386 /out:"dll-release/libcurl.dll" /implib:"dll-release/libcurl_imp.lib" /fixed:no /release /incremental:no # ADD LINK32 wldap32.lib ws2_32.lib advapi32.lib kernel32.lib /nologo /dll /pdb:none /machine:I386 /out:"dll-release/libcurl.dll" /implib:"dll-release/libcurl_imp.lib" /fixed:no /release /incremental:no !ELSEIF "$(CFG)" == "libcurl - Win32 LIB Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "lib-debug" # PROP BASE Intermediate_Dir "lib-debug/obj" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "lib-debug" # PROP Intermediate_Dir "lib-debug/obj" # PROP Target_Dir "" CPP=cl.exe # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "BUILDING_LIBCURL" /D "CURL_STATICLIB" /FD /GZ /c # ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "BUILDING_LIBCURL" /D "CURL_STATICLIB" /FD /GZ /c RSC=rc.exe # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo /out:"lib-debug/libcurld.lib" /machine:I386 # ADD LIB32 /nologo /out:"lib-debug/libcurld.lib" /machine:I386 !ELSEIF "$(CFG)" == "libcurl - Win32 LIB Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "lib-release" # PROP BASE Intermediate_Dir "lib-release/obj" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "lib-release" # PROP Intermediate_Dir "lib-release/obj" # PROP Target_Dir "" CPP=cl.exe # ADD BASE CPP /nologo /MD /W3 /EHsc /O2 /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "BUILDING_LIBCURL" /D "CURL_STATICLIB" /FD /c # ADD CPP /nologo /MD /W3 /EHsc /O2 /I "..\..\..\lib" /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "BUILDING_LIBCURL" /D "CURL_STATICLIB" /FD /c RSC=rc.exe # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo /out:"lib-release/libcurl.lib" /machine:I386 # ADD LIB32 /nologo /out:"lib-release/libcurl.lib" /machine:I386 !ENDIF # Begin Target # Name "libcurl - Win32 DLL Debug" # Name "libcurl - Win32 DLL Release" # Name "libcurl - Win32 LIB Debug" # Name "libcurl - Win32 LIB Release" curl-7.35.0/CHANGES0000644000175000017500000054164012272124477010511 00000000000000 _ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| Changelog Version 7.35.0 (29 Jan 2014) Daniel Stenberg (29 Jan 2014) - RELEASE-NOTES: done for 7.35.0 Dan Fandrich (29 Jan 2014) - tests: make a few lib15?? tests pass the OOM torture tests - lib1900: make the test pass the OOM torture tests - oauth2: Fixed a memory leak in an OOM condition - unit1304: make the test pass the OOM torture tests - unit1396: make the test pass the OOM torture tests Daniel Stenberg (28 Jan 2014) - [Romulo A. Ceccon brought this change] hostip: don't remove DNS entries that are in use hostcache_timestamp_remove() should remove old *unused* entries from the host cache, but it never checked whether the entry was actually in use. This complements commit 030a2b8cb. Bug: http://curl.haxx.se/bug/view.cgi?id=1327 Dan Fandrich (28 Jan 2014) - RELEASE-NOTES: changed encoding to UTF-8 like previous releases Daniel Stenberg (28 Jan 2014) - TFTP: fix crash on time-out tftp_done() can get called with its TFTP state pointer still being NULL on an early time-out, which caused a segfault when dereferenced. Reported-by: Glenn Sheridan Bug: http://curl.haxx.se/mail/lib-2014-01/0246.html Steve Holme (28 Jan 2014) - RELEASE-NOTES: Synced with 5a47062cada9 Daniel Stenberg (28 Jan 2014) - [Maks Naumov brought this change] getpass: fix password parsing from console Incorrect password if use backspace while entered the password. Regression from f7bfdbabf2d5398f4c266eabb0992a04af661f22 The '?:' operator has lower priority than the '-' operator Dan Fandrich (26 Jan 2014) - docs/INSTALL: Updated example minimal binary sizes Marc Hoersken (26 Jan 2014) - testsuite: visualize line-endings in output comparison diffs - sockfilt.c: follow up cleanup commit on 49b63cf3 - http-pipe tests: use text as output data mode to support Windows - sockfilt.c: fixed and simplified Windows select function Since the previous complex select function with initial support for non-socket file descriptors, did not actually work correctly for Console handles, this change simplifies the whole procedure by using an internal waiting thread for the stdin console handle. The previous implementation made it continuously trigger for the stdin handle if it was being redirected to a parent process instead of an actual Console input window. This approach supports actual Console input handles as well as anonymous Pipe handles which are used during input redirection. It depends on the fact that ReadFile supports trying to read zero bytes which makes it wait for the handle to become ready for reading. - http_pipe.py: replaced epoll with select to support Windows Removed Unix-specific functionality in order to support Windows: - select.epoll replaced with select.select - SocketServer.ForkingMixIn replaced with SocketServer.ForkingMixIn - socket.MSG_DONTWAIT replaced with socket.setblocking(False) Even though epoll has a better performance and improved socket handling than select, this change should not affect the actual test case. Dan Fandrich (25 Jan 2014) - tests: Added missing HTTP proxy keywords - tests: added missing http to a number of tests - tests: Added a keyword for tests depending on internal info logs - runtests: Don't log command every torture iteration in verbose - tests: Added missing http feature to tests 509 & 1513 - netrc: Fixed a memory and file descriptor leak on OOM - test1514: Used the macros for host and port number - multi: Fixed a memory leak on OOM condition Daniel Stenberg (23 Jan 2014) - curl_easy_setopt.3: remove what auth types that work for CURLOPT_PROXYAUTH The list was out of date and the paragraph already refers to the CURLOPT_HTTPAUTH explanation. All the auth bits are explained properly there. It also removes the ambiguity for what the "added" phrase refers to. This change based on pull request #85 on github URL: https://github.com/bagder/curl/pull/85 Reported-by: gnawhleinad Dan Fandrich (22 Jan 2014) - test1514: Got rid of a non-const initializer C99ism Steve Holme (21 Jan 2014) - RELEASE-NOTES: added another missing bug ref Daniel Stenberg (21 Jan 2014) - RELEASE-NOTES: added missing bug ref - [Fabian Frank brought this change] axtls: fix compiler warning on conversion ssize_t => int - [Fabian Frank brought this change] SFTP: stat remote file also when CURLOPT_NOBODY is 1 Make it possible to call curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &filesize) and related functions on remote sftp:// files, without downloading them. Reported-by: Yingwei Liu Bug: http://curl.haxx.se/mail/lib-2014-01/0139.html - RELEASE-NOTES: synced with 12ecd56da77 - contributors.sh: output list RELEASE-NOTES formatted - [Cédric Deltheil brought this change] test1514: added - no more negative Content-Length (HTTP POST) This covers changes from commit afd288b2. - [Cédric Deltheil brought this change] HTTP POST: omit Content-Length if data size is unknown This prevents sending a `Content-Length: -1` header, e.g this ocurred with the following combination: * standard HTTP POST (no chunked encoding), * user-defined read function set, * `CURLOPT_POSTFIELDSIZE(_LARGE)` NOT set. With this fix it now behaves like HTTP PUT. - [Fabian Frank brought this change] disable GnuTLS insecure ciphers Make GnuTLS old and new consistent, specify the desired protocol, cipher and certificate type in always in both modes. Disable insecure ciphers as reported by howsmyssl.com. Honor not only --sslv3, but also the --tlsv1[.N] switches. Related Bug: http://curl.haxx.se/bug/view.cgi?id=1323 - curl_getdate.3: edited, removed references to pre 7.12.2 functionality - gtls: fix compiler warnings on conversions size_t => unsigned int Steve Holme (19 Jan 2014) - tool: Fixed incorrect return code if password prompting runs out of memory Due to the changes in commit 3c929ff9f6ea and lack of subsequent updates, curl could return a CURLE_FTP_ACCEPT_FAILED error if checkpasswd() ran out of memory in versions 7.33.0 and 7.34.0. Updated the function declaration and return code to return CURLE_OUT_OF_MEMORY and CURLE_OK where appropriate. - RELEASE-NOTES: Synced with 2cac75c4e400 - http_chunks.c: Fixed compilation warnings under some 32-bit systems conversion from 'curl_off_t' to 'size_t', possible loss of data Where curl_off_t is a 64-bit word and size_t is 32-bit - for example with 32-bit Windows builds. - tool: Fixed incorrect return code if command line parser runs out of memory In the rare instance where getparameter() may return PARAM_NO_MEM whilst parsing a URL, cURL would return this error code, which is equivalent to CURLE_FTP_ACCEPT_FAILED in cURL error codes terms. Instead, return CURLE_FAILED_INIT and output the failure reason as per the other usage of getparameter(). Daniel Stenberg (18 Jan 2014) - [Tobias Markus brought this change] Subject: progress bar: increase update frequency to 10Hz Increasing the update frequency of the progress bar to 10Hz greatly improves the visual appearance of the progress bar (at least in my impression). Signed-off-by: Tobias Markus - [Tobias Markus brought this change] progress bar: always update when at 100% Currently, the progress bar is updated at 5Hz. Because it is often not updated to 100% when the download is finished and curl exits, the bar is often "stuck" at 90-something, thus irritating the user. This patch fixes this by always updating the progress bar (instead of waiting for 200ms to have elapsed) while the download is finished but curl has not yet exited. This should not greatly affect performance because that moment is rather short. Signed-off-by: Tobias Markus Steve Holme (18 Jan 2014) - win32: Added additional preprocessor check for Version Helper API A follow up patch to commit d2671340a613 as _WIN32_WINNT_WIN2K and _WIN32_WINNT_WIN2K may not be defined on all systems. - win32: Corrected the preprocessor check for Version Helper API Following some auto build failures after commit c7a76bb056f31e changed the preprocessor check to use _WIN32_WINNT. Daniel Stenberg (17 Jan 2014) - cookie: max-age fixes 1 - allow >31 bit max-age values 2 - don't overflow on extremely large max-age values when we add the value to the current time 3 - make sure max-age takes precedence over expires as dictated by RFC6265 Bug: http://curl.haxx.se/mail/lib-2014-01/0130.html Reported-by: Chen Prog - test1417: verify chunked-encoding transfer without CR As was introduced in 8f6b4be8af04 - chunked parsing: relax the CR strictness Allow for chunked-encoding data to get parsed with only LF line endings. This is allowed by browsers. - test1416: verify the chunked size overflow detection - chunked-parser: abort on overflows, allow 64 bit chunks Dan Fandrich (17 Jan 2014) - Fixed some XML syntax issues in the test data Also, make the ftp server return a canned response that doesn't cause XML verification problems. Although the test file format isn't technically XML, it's still handy to be able to use XML tools to verify and manipulate them. Daniel Stenberg (16 Jan 2014) - [Michael Osipov brought this change] configure: fix gssapi linking on HP-UX The issue is with HP-UX that is comes with HP flavor of MIT Kerberos. This means that there is no krb5-config and the lib is called libgss.so Bug: http://curl.haxx.se/bug/view.cgi?id=1321 - Curl_cookie_add: remove 'now' from curl_getdate() call The now argument is unused by curl_getdate() Steve Holme (15 Jan 2014) - pop3-dele.c: Added missing CURLOPT_NOBODY following feedback Daniel Stenberg (16 Jan 2014) - connect.c:942:84: warning: Longer than 79 columns Steve Holme (15 Jan 2014) - connect.c: Corrected version compare in commit c7a76bb056f31e - RELEASE-NOTES: Synced with c7a76bb056f31e - win32: Fixed use of deprecated function 'GetVersionInfoEx' for VC12 Starting with Visual Studio 2013 (VC12) and Windows 8.1 the GetVersionInfoEx() function has been marked as deprecated and it's return value atered. Updated connect.c and curl_sspi.c to use VerifyVersionInfo() where possible, which has been available since Windows 2000. Daniel Stenberg (14 Jan 2014) - curl_easy_setopt.3: mention how to unset CURLOPT_INFILESIZE* - TODO: Allow SSL (HTTPS) to proxy - TODO: remove FTP proxy and more SSL libraries - TODO: Detect when called from witin callbacks Marc Hoersken (13 Jan 2014) - secureserver.pl: follow up fix for 87ade5f Since /dev/stdout is not always emulated on Windows, just skip the output option on Windows. MinGW/msys support /dev/stdout only from a new login shell. Daniel Stenberg (13 Jan 2014) - [Colin Hogben brought this change] error message: Sensible message on timeout when transfer size unknown A transfer timeout could result in an error message such as "Operation timed out after 3000 milliseconds with 19 bytes of -1 received". This patch removes the non-sensical "of -1" when the size of the transfer is unknown, mirroring the logic in lib/transfer.c Marc Hoersken (13 Jan 2014) - secureserver.pl: added full support for tstunnel on Windows tstunnel on Windows does not support the pid option and is unable to write to an output log that is already being used as a redirection target for stdout. Therefore it does now output all log data to stdout by default and secureserver.pl creates a fake pidfile on Windows. Steve Holme (12 Jan 2014) - examples: Fixed compilation errors error: 'MULTI_PERFORM_HANG_TIMEOUT' undeclared - imap-multi.c: Corrected typo - smtp-multi.c: Minor coding style tidyup following POP3 and IMAP additions - examples: Added IMAP multi example - pop3-multi.c: Corrected copy/paste typo - examples: Added POP3 multi example - examples: Added comments to SMTP multi example based on other MAIL examples - examples: Removed user information and TLS setup from SMTP multi example Simplified the SMTP multi example as this example should demonstrate the differences the easy and multi interfaces rather than introduce new concepts such as user authentication and TLS which are shown in the TLS and SSL examples. - examples: Updated SMTP MAIL example to return libcurl result code - examples: Synchronised comments between SMTP MAIL examples - examples: Updated SMTP MAIL example to use a read function for data Updated to read data from a callback rather than from stdio as this is more realistic to most use cases. Daniel Stenberg (12 Jan 2014) - OpenSSL: deselect weak ciphers by default By default even recent versions of OpenSSL support and accept both "export strength" ciphers, small-bitsize ciphers as well as downright deprecated ones. This change sets a default cipher set that avoids the worst ciphers, and subsequently makes https://www.howsmyssl.com/a/check no longer grade curl/OpenSSL connects as 'Bad'. Bug: http://curl.haxx.se/bug/view.cgi?id=1323 Reported-by: Jeff Hodges - multi: remove MULTI_TIMEOUT_INACCURACY With the recently added timeout "reminder" functionality, there's no reason left for us to execute timeout code before the time is ripe. Simplifies the handling too. This will make the *TIMEOUT and *CONNECTTIMEOUT options more accurate again, which probably is most important when the *_MS versions are used. In multi_socket, make sure to update 'now' after having handled activity on a socket. Steve Holme (11 Jan 2014) - Makefile.dist: Added support for VC7 Currently VC7 and VC7.1 builds have to be ran with the VC variable set to vc6 which is not only inconsistent with the nmake winbuild system but also with newer versions of Visual Studio supported by this file. Note: This doesn't break the build for anyone still running with the VC variable set to vc6 or not set (which defaults to vc6). - RELEASE-NOTES: Synced with 980659a2caa285 Daniel Stenberg (10 Jan 2014) - multi_socket: remind app if timeout didn't run BACKGROUND: We have learned that on some systems timeout timers are inaccurate and might occasionally fire off too early. To make the multi_socket API work with this, we made libcurl execute timeout actions a bit early too if they are within our MULTI_TIMEOUT_INACCURACY. (added in commit 2c72732ebf, present since 7.21.0) Switching everything to the multi API made this inaccuracy problem slightly more notable as now everyone can be affected. Recently (commit 21091549c02) we tweaked that inaccuracy value to make timeouts more accurate and made it platform specific. We also figured out that we have code at places that check for fixed timeout values so they MUST NOT run too early as then they will not trigger at all (see commit be28223f35 and a691e044705) - so there are definitately problems with running timeouts before they're supposed to run. (We've handled that so far by adding the inaccuracy margin to those specific timeouts.) The libcurl multi_socket API tells the application with a callback that a timeout expires in N milliseconds (and it explicitly will not tell it again for the same timeout), and the application is then supposed to call libcurl when that timeout expires. When libcurl subsequently gets called with curl_multi_socket_action(...CURL_SOCKET_TIMEOUT...), it knows that the application thinks the timeout expired - and alas, if it is within the inaccuracy level libcurl will run code handling that handle. If the application says CURL_SOCKET_TIMEOUT to libcurl and _isn't_ within the inaccuracy level, libcurl will not consider the timeout expired and it will not tell the application again since the timeout value is still the same. NOW: This change introduces a modified behavior here. If the application says CURL_SOCKET_TIMEOUT and libcurl finds no timeout code to run, it will inform the application about the timeout value - *again* even if it is the same timeout that it already told about before (although libcurl will of course tell it the updated time so that it'll still get the correct remaining time). This way, we will not risk that the application believes it has done its job and libcurl thinks the time hasn't come yet to run any code and both just sit waiting. This also allows us to decrease the MULTI_TIMEOUT_INACCURACY margin, but that will be handled in a separate commit. A repeated timeout update to the application risk that the timeout will then fire again immediately and we have what basically is a busy-loop until the time is fine even for libcurl. If that becomes a problem, we need to address it. - threaded-resolver: never use NULL hints with getaddrinfo The net effect of this bug as it appeared to users, would be that libcurl would timeout in the connect phase. When disabling IPv6 use but still using getaddrinfo, libcurl would wrongly not init the "hints" struct field in init_thread_sync() which would subsequently lead to a getaddrinfo() invoke with a zeroed hints with ai_socktype set to 0 instead of SOCK_STREAM. This would lead to different behaviors on different platforms but basically incorrect output. This code was introduced in 483ff1ca75cbea, released in curl 7.20.0. This bug became a problem now due to the happy eyeballs code and how libcurl now traverses the getaddrinfo() results differently. Bug: http://curl.haxx.se/mail/lib-2014-01/0061.html Reported-by: Fabian Frank Debugged-by: Fabian Frank Nick Zitzmann (9 Jan 2014) - darwinssl: un-break Leopard build after PKCS#12 change It turns out errSecDecode wasn't defined in Leopard's headers. So we use the enum's value instead. Bug: http://curl.haxx.se/mail/lib-2013-12/0150.html Reported by: Abram Pousada Daniel Stenberg (8 Jan 2014) - Curl_updateconninfo: don't do anything for UDP "connections" getpeername() doesn't work for UDP sockets since they're not connected Reported-by: Priyanka Shah Bug: http://curl.haxx.se/mail/archive-2014-01/0016.html - info: remove debug output Removed some of the infof() calls that were added with the recent pipeline improvements but they're not useful to the vast majority of readers and the pipelining seems to fundamentaly work - the debugging outputs can easily be added there if debugging these functions is needed again. - runtests: disable memory tracking with threaded resolver The built-in memory debug system doesn't work with multi-threaded use so instead of causing annoying false positives, disable the memory tracking if the threaded resolver is used. - trynextip: fix build for non-IPV6 capable systems AF_INET6 may not exist then Patched-by: Iida Yosiaki Bug: http://curl.haxx.se/bug/view.cgi?id=1322 Steve Holme (8 Jan 2014) - makefile: Added support for VC12 - makefile: Added support for VC11 - winbuild: Follow up fix for a47c142a88c0, 11e8066ef956 and 92b9ae5c5d59 Daniel Stenberg (7 Jan 2014) - mk-ca-bundle.1: document -d Steve Holme (7 Jan 2014) - RELEASE-NOTES: Synced with 8ae35102c43d8d Daniel Stenberg (7 Jan 2014) - ConnectionExists: fix NTLM check for new connection When the requested authentication bitmask includes NTLM, we cannot re-use a connection for another username/password as we then risk re-using NTLM (connection-based auth). This has the unfortunate downside that if you include NTLM as a possible auth, you cannot re-use connections for other usernames/passwords even if NTLM doesn't end up the auth type used. Reported-by: Paras S Patched-by: Paras S Bug: http://curl.haxx.se/mail/lib-2014-01/0046.html Steve Holme (5 Jan 2014) - examples: Added required libcurl version information to SMTP examples Daniel Stenberg (5 Jan 2014) - mk-ca-bundle.pl: avoid warnings with -d without parameter - [Leif W brought this change] mk-ca-bundle: introduces -d and warns about using this script Steve Holme (5 Jan 2014) - Makefile: Added missing WinSSL and x64 configurations Marc Hoersken (5 Jan 2014) - docs/INTERNALS: follow up fix for 11e8066 and 92b9ae5 - packages: follow up fix for a47c142, 11e8066 and 92b9ae5 - multi.c: fix possible dereference of null pointer Steve Holme (5 Jan 2014) - Examples: Renamed SMTP MAIL example to match other email examples - examples: Added POP3 TLS example - examples: Added IMAP NOOP example - examples: Added POP3 NOOP example - pop3-stat.c: Corrected small typo from commit 91d62e9abd761c - examples: Added POP3 STAT example - examples: Added POP3 TOP example - examples: Added POP3 DELE example - examples: Added POP3 UIDL example - examples: Added POP3 RETR example - examples: Added return of error code in POP3 examples - runtests.pl: Updated copyright year after edit from d718abd968aeb4 - examples: Reworked POP3 examples for additional upcoming POP3 examples - examples: Added SMTP SSL example - examples: Added IMAP SSL and TLS examples Marc Hoersken (5 Jan 2014) - runtests.pl: check for tstunnel command on Windows The Windows console version of stunnel is called "tstunnel", while running "stunnel" on Windows spawns a new console window which cannot be handled by the testsuite. - testcurl.pl: always show the last 5 commits even with --nogitpull Daniel Stenberg (4 Jan 2014) - ftp tests: provide LIST responses in the test file itself Previously LIST always returned a fixed hardcoded list that the ftp server code knew about, mostly since the server didn't get any test case number in the LIST scenario. Starting now, doing a CWD to a directory named test-[number] will make the test server remember that number and consider it a test case so that a subsequent LIST command will send the section of that test case back. It allows LIST tests to be made more similar to how all other tests work. Test 100 was updated to provide its own directory listing. Steve Holme (4 Jan 2014) - examples: Standardised username and password settings for all email examples Replaced the use of CURLOPT_USERPWD for the preferred CURLOPT_USERNAME and CURLOPT_PASSWORD options and used the same username and password for all email examples which is the same as that used in the test suite. - Updated copyright year for recent changes Marc Hoersken (4 Jan 2014) - secureserver.pl: support for stunnel-path with nun-alphanum chars This is desired to support stunnel installations on Windows. - conncache.c: fix possible dereference of null pointer - docs: primarily refer to schannel as WinSSL Steve Holme (4 Jan 2014) - examples: Added IMAP COPY example - examples: Added IMAP DELETE example - examples: Added IMAP CREATE example Daniel Stenberg (4 Jan 2014) - FTP parselist: fix "total" parser A regression introduced in 7f3b87d8782eae1 (present in the 7.21.4 release) broke the total parser. Now skip the whitespace and the digits. Reported-by: Justin Maggard Bug: http://curl.haxx.se/mail/lib-2014-01/0019.html - test1513: fix spelling Marc Hoersken (3 Jan 2014) - Makefile.vc6: follow up fix for 11e8066 and 92b9ae5 Daniel Stenberg (3 Jan 2014) - test1513: added - verify early progress callback return fail Verify the change brought in commit 8e11731653061. It makes sure that returning a failure from the progress callback even very early results in the correct return code. - progresscallback: make CURLE_ABORTED_BY_CALLBACK get returned better When the progress callback returned 1 at a very early state, the code would not make CURLE_ABORTED_BY_CALLBACK get returned but the process would still be interrupted. In the HTTP case, this would then cause a CURLE_GOT_NOTHING to erroneously get returned instead. Reported-by: Petr Novak Bug: http://curl.haxx.se/bug/view.cgi?id=1318 Marc Hoersken (3 Jan 2014) - unittests: do not include curl_memory.h memdebug.h already contains all required definitions and including curl_memory.h causes errors like the following: tests/unit/unit1394.c:119: undefined reference to `Curl_cfree' tests/unit/unit1394.c:120: undefined reference to `Curl_cfree' Daniel Stenberg (3 Jan 2014) - pipeline: remove print_pipeline() This is a debug function only and serves no purpose in production code, it only slows things down. I left the code #ifdef'ed for possible future pipeline debugging. Also, this was a global function without proper namespace usage. Reported-by: He Qin Bug: http://curl.haxx.se/bug/view.cgi?id=1320 - openssl: allow explicit sslv2 selection If OpenSSL is built to support SSLv2 this brings back the ability to explicitly select that as a protocol level. Reported-by: Steve Holme Bug: http://curl.haxx.se/mail/lib-2014-01/0013.html Steve Holme (2 Jan 2014) - Bumped copyright year to 2014 - Updated copyright year for recent changes Marc Hoersken (3 Jan 2014) - vtls/nssg.h: fixed include references to moved file Daniel Stenberg (3 Jan 2014) - [Christian Weisgerber brought this change] curl_easy_setopt.3: fix formatting mistakes This fixes two markup typos I noticed in curl_easy_setopt.3. (The use of bold vs. italics seems a bit inconsistent in that page, but it should at least be valid man syntax.) - [Barry Abrahamson brought this change] OpenSSL: Fix forcing SSLv3 connections Some feedback provided by byte_bucket on IRC pointed out that commit db11750cfa5b1 wasn’t really correct because it allows for “upgrading†to a newer protocol when it should be only allowing for SSLv3. This change fixes that. When SSLv3 connection is forced, don't allow SSL negotiations for newer versions. Feedback provided by byte_bucket in #curl. This behavior is also consistent with the other force flags like --tlsv1.1 which doesn't allow for TLSv1.2 negotiation, etc Feedback-by: byte_bucket Bug: http://curl.haxx.se/bug/view.cgi?id=1319 Guenter Knauf (2 Jan 2014) - Trial to fix the nmake Makefile for vtls files. Steve Holme (2 Jan 2014) - examples: Added IMAP SEARCH example - examples: Added IMAP EXAMINE mailbox folder example Guenter Knauf (2 Jan 2014) - Fix NetWare build for vtls files. Daniel Stenberg (1 Jan 2014) - CMakeLists.txt: add standard curl source code header - CMakeLists.txt: add warning about the cmake build's state Steve Holme (1 Jan 2014) - examples: Updated SMTP multi example to be more realistic Updated the contents of the email and payload callback as per the IMAP and other SMTP examples. Daniel Stenberg (1 Jan 2014) - [Barry Abrahamson brought this change] OpenSSL: Fix forcing SSLv3 connections Since ad34a2d5c87c7f4b14e8dded3 (present in 7.34.0 release) forcing SSLv3 will always return the error "curl: (35) Unsupported SSL protocol version" Can be replicated with `curl -I -3 https://www.google.com/`. This fix simply allows for v3 to be forced. Steve Holme (1 Jan 2014) - examples: Corrected unescaped backslash in imap-store.c - examples: Update SMTP TLS example mail content to be RFC-2821 compliant ...and made some minor coding style changes to better match the curl coding standards as well as the other email related examples. - examples: Added IMAP APPEND example - examples: Added IMAP STORE example - RELEASE-NOTES: Synced with 7de2e032584d44 - examples: Added IMAP LIST mailbox example - examples: Updated IMAP fetch example for libcurl 7.30.0 - examples: Rename before adding additional email examples - examples: Added SMTP EXPN command example - examples: Added SMTP email verification example - imap: Fixed line length warning - mprintf: Replaced internal usage of FORMAT_OFF_T and FORMAT_OFF_TU Following commit 0aafd77fa4c6f2, replaced the internal usage of FORMAT_OFF_T and FORMAT_OFF_TU with the external versions that we expect API programmers to use. This negates the need for separate definitions which were subtly different under different platforms/compilers. - examples: Updated copyright year for recent edits - examples: Corrected incorrect indentation in smtp-multi.c - examples: Updated SMTP examples to set CURLOPT_UPLOAD - mprintf: Added support for I, I32 and I64 size specifiers Added support to the built-in printf() replacement functions, for these non-ANSI extensions when compiling under Visual Studio, Borland, Watcom and MinGW. This fixes problems when generating libcurl source code that contains curl_off_t variables. - curl_easy_setopt.3: Added SMTP information to CURLOPT_INFILESIZE_LARGE Although added to CURLOPT_INFILESIZE in commit ee3d3adc6fe155 it was never added to CURLOPT_INFILESIZE_LARGE. - tests: Disabled NTLM tests when running with SSPI enabled - connect.c: Fixed compilation warning warning: 'res' may be used uninitialized in this function - runtests.pl: Fixed slightly incorrect regex in commit 28dd47d4d41900 - [Björn Stenberg brought this change] connect: Try all addresses in first connection attempt Fixes a bug when all addresses in the first family fail immediately, due to "Network unreachable" for example, curl would hang and never try the next address family. Iterate through all address families when to trying establish the first connection attempt. Bug: http://curl.haxx.se/bug/view.cgi?id=1315 Reported-by: Michal Górny and Anthony G. Basile - runtests.pl: Optimised feature present checking code ...to exclude not present features. - runtests.pl: Added the ability to run tests when a feature is not present - ftpserver.pl: Fixed compilation error Unmatched right curly bracket at line 758, at end of line - ftpserver.pl: Reworked SMTP verified server detection Following the addition of informational commands to the SMTP protocol, the test server is no longer required to return the verified server information in responses that curl only outputs in verbose mode. Instead, a similar detection mechanism to that used by FTP, IMAP and POP3 can now be used. - sendf.c: Fixed compilation warning from f2d234a4dd9bcc sendf.c:450:81: warning: Longer than 79 columns - FILE: Fixed sending of data would always return CURLE_WRITE_ERROR Introduced in commit 2a4ee0d2215556 sending of data via the FILE protocol would always return CURLE_WRITE_ERROR regardless of whether CURL_WRITEFUNC_PAUSE was returned from the callback function or not. Daniel Stenberg (26 Dec 2013) - FILE: we don't support paused transfers using this protocol Make sure that we detect such attempts and return a proper error code instead of silently handling this in problematic ways. Updated the documentation to mention this limitation. Bug: http://curl.haxx.se/bug/view.cgi?id=1286 Steve Holme (26 Dec 2013) - vtls: Updated comments referencing sslgen.c and ssluse.c - vtls: Fixed up include of vtls.h Daniel Stenberg (25 Dec 2013) - curl_dofree: allow free(NULL) Previously this memdebug free() replacement didn't properly work with a NULL argument which has made us write code that avoids calling free(NULL) - which causes some extra nuisance and unnecessary code. Starting now, we should allow free(NULL) even when built with the memdebug system enabled. free(NULL) is permitted by POSIX Steve Holme (25 Dec 2013) - RELEASE-NOTES: Synced with 0ff0a994ada62a Daniel Stenberg (25 Dec 2013) - Curl_thread_create: use Curl_safefree to allow NULL better free() itself allows a NULL input but our memory debug system requires Curl_safefree() to be used instead when a "legitimate" NULL may be freed. Like in the code here. Pointed-out-by: Steve Holme - [Luke Dashjr brought this change] threaded resolver: Use pthread_t * for curl_thread_t ... since pthread_t may be non-scalar and/or may represent a real thread with scalar 0. Bug: http://curl.haxx.se/bug/view.cgi?id=1314 Steve Holme (24 Dec 2013) - imap: Fixed auth preference not being honored when CAPABILITY not supported If a user indicated they preferred to authenticate using a SASL mechanism, but SASL authentication wasn't supported by the server, curl would always fall back to clear text when CAPABILITY wasn't supported, even though the user didn't want to use this. - pop3: Fixed auth preference not being honored when CAPA not supported If a user indicated they preferred to authenticate using APOP or a SASL mechanism, but neither were supported by the server, curl would always fall back to clear text when CAPA wasn't supported, even though the user didn't want to use this. This also fixes the auto build failure caused by commit 6f2d5f0562f64a. Daniel Stenberg (24 Dec 2013) - TheArtOfHttpScripting: major update, converted layout and more - Curl_pp_readresp: use memmove not memcpy, possibly overlapping areas Fixes commit 1deac31eba7 Steve Holme (24 Dec 2013) - RELEASE-NOTES: Corrected copy/paste typo - pop3: Fixed APOP being determined by CAPA response rather than by timestamp This commit replaces that of 9f260b5d6610f3 because according to RFC-2449, section 6, there is no APOP capability "...even though APOP is an optional command in [POP3]. Clients discover server support of APOP by the presence in the greeting banner of an initial challenge enclosed in angle brackets." - tests: Removed APOP timestamp from default server greeting - test936: Corrected login details from commit 7246255416617a - ftpserver.pl: Updated custom full text REPLY regex SASL downgrade tests: 833, 835, 879, 881, 935 and 937 would fail as they contained a minus sign in their authentication mechanism and this would be missed by the custom reply parser. - tests: Corrected syntax error from commit 7246255416617a - tests: Added SMTP SASL downgrade tests - tests: Added POP3 SASL downgrade tests - tests: Added IMAP SASL downgrade tests Daniel Stenberg (22 Dec 2013) - docs: mention CURLOPT_MAX_RECV/SEND_SPEED_LARGE don't work for FILE:// - FILE: don't wait due to CURLOPT_MAX_RECV_SPEED_LARGE The FILE:// code doesn't support this option - and it doesn't make sense to support it as long as it works as it does since then it'd only block even longer. But: setting CURLOPT_MAX_RECV_SPEED_LARGE would make the transfer first get done and then libcurl would wait until the average speed would get low enough. This happened because the transfer happens completely in the DO state for FILE:// but then it would still unconditionally continue in to the PERFORM state where the speed check is made. Starting now, the code will skip from DO_DONE to DONE immediately if no socket is set to be recv()ed or send()ed to. Bug: http://curl.haxx.se/bug/view.cgi?id=1312 Reported-by: Mohammad AlSaleh Steve Holme (22 Dec 2013) - ftpserver.pl: Fixed runtime warning from commit 7da9c95bcf1fe6 Use of uninitialized value $FTPARG in concatenation (.) or string at line 3255. - ftpserver.pl: Added the ability to send custom full text replies - ftpserver.pl: Added the ability to specify custom full text replies - ftpserver.pl: Renamed commandreply variable from customreply - tests: Added SASL cancellation keywords Added SASL CANCELLATION keywords to differentiate these tests from the upcoming SASL downgrade tests. - email: Fixed segfault introduced in commit 195b63f99c2fe3 Daniel Stenberg (22 Dec 2013) - code police: fix indent level to silence checksrc complaints Steve Holme (21 Dec 2013) - email: Extended the login options to support multiple auth mechanisms Daniel Stenberg (22 Dec 2013) - Curl_pp_readresp: replace stupid loop with memcpy - Curl_pp_readresp: zero terminate line The comment in the code mentions the zero terminating after having copied data, but it mistakingly zero terminated the source data and not the destination! This caused the test 864 problem discussed on the list: http://curl.haxx.se/mail/lib-2013-12/0113.html Signed-off-by: Daniel Stenberg Steve Holme (21 Dec 2013) - Revert "pop3: Added debug information to assist with test864 failure" This reverts commit 727d798d680f29c8b3cb7d7f03d6b6a3eb4356da. - pop3: Added debug information to assist with test864 failure - RELEASE-NOTES: Synced with 812c5ace759d04 - pop3: Fixed APOP timestamp detection from commit 1cfb436a2f1795 Daniel Stenberg (20 Dec 2013) - Makefile.inc: use standard source header - Makefile.inc: specify the vtls sources+headers separately - vtls: renamed sslgen.[ch] to vtls.[ch] - openssl: renamed backend files to openssl.[ch] - vtls: moved all TLS/SSL source and header files into subdir - vtls: created subdir, moved sslgen.[ch] there, updated all include lines Steve Holme (20 Dec 2013) - pop3: Fixed selection of APOP when server replies with an invalid timestamp Although highlighted by a bug in commit 1cfb436a2f1795, APOP authentication could be chosen if the server was to reply with an empty or missing timestamp in the server greeting and APOP was given in the capability list by the server. - pop3: Fixed processing of more than one response when sent in same packet Added a loop to pop3_statemach_act() in which Curl_pp_readresp() is called until the cache is drained. Without this multiple responses received in a single packet could result in a hang or delay. - pop3: Moved CAPA response handling to pop3_state_capa_resp() Similar to the processing of untagged CAPABILITY responses in IMAP and multi-line EHLO responses in SMTP, moved the processing of multi-line CAPA responses to pop3_state_capa_resp(). - pop3: Moved APOP detection into pop3_state_servergreet_resp() In an effort to reduce what pop3_endofresp() does and bring the POP3 source back inline with the IMAP and SMTP protocols, moved the APOP detection into pop3_state_servergreet_resp(). - curl_easy_setopt: Fixed OAuth 2.0 Bearer option name Bug: http://curl.haxx.se/bug/view.cgi?id=1313 Reported-by: Viktor Szakáts Daniel Stenberg (18 Dec 2013) - curl.1: remove URL encoding phrase from --data description ... it could be misleading a reader into thinking it _has_ to be encoded. Steve Holme (18 Dec 2013) - imap/pop3/smtp: Added support for SASL authentication downgrades Added support for downgrading the SASL authentication mechanism when the decoding of CRAM-MD5, DIGEST-MD5 and NTLM messages fails. This enhances the previously added support for graceful cancellation by allowing the client to retry a lesser SASL mechanism such as LOGIN or PLAIN, or even APOP / clear text (in the case of POP3 and IMAP) when supported by the server. Daniel Stenberg (18 Dec 2013) - RELEASE-PROCEDURE: new document - gitignore: ignore .dirstamp files - smtp: fix compiler warning smtp.c:478:21: error: unused variable 'smtpc' [-Werror=unused-variable] Steve Holme (18 Dec 2013) - smtp: Moved the calculation of SASL login details into a separate function - pop3: Moved the calculation of SASL login details into a separate function - imap: Moved the calculation of SASL login details into a separate function - smtp: Moved the sending of the AUTH command into a separate function - pop3: Moved the sending of the AUTH command into a separate function - imap: Moved the sending of the AUTHENICATE command into a separate function - email: Renamed *_perform_authenticate() functions In preparation for the upcoming SASL downgrade feature renamed the imap__perform_authenticate(), pop3__perform_authenticate() and smtp__perform_authenticate() functions. Daniel Stenberg (17 Dec 2013) - bump: start working on the next release Version 7.34.0 (16 Dec 2013) Daniel Stenberg (16 Dec 2013) - RELEASE-NOTES: synced with c0ef05e67 ... for the pending 7.34.0 release Upped the contributor count - THANKS: add contributors from 7.34.0 release 24 new great friends - gtls: respect *VERIFYHOST independently of *VERIFYPEER Security flaw CVE-2013-6422 This is conceptually the same problem and fix that 3c3622b6 brought to the OpenSSL backend and that resulted in CVE-2013-4545. This version of the problem was independently introduced to the GnuTLS backend with commit 59cf93cc, present in the code since the libcurl 7.21.4 release. Advisory: http://curl.haxx.se/docs/adv_20131217.html Bug: http://curl.haxx.se/mail/lib-2013-11/0214.html Reported-by: Marc Deslauriers - curl.1 document -J doesn't %-decode ...also added as KNOWN_BUG #87 with reference to bug #1294 - multi: add timer inaccuracy margin to timeout/connecttimeout Since all systems have inaccuracy in the timeout handling it is imperative that we add an inaccuracy margin to the general timeout and connecttimeout handling with the multi interface. This way, when the timeout fires we should be fairly sure that it has passed the timeout value and will be suitably detected. For cases where the timeout fire before the actual timeout, we would otherwise consume the timeout action and still not run the timeout code since the condition wasn't met. Reported-by: He Qin Bug: http://curl.haxx.se/bug/view.cgi?id=1298 - RELEASE-NOTES: synced with dd4d9ea542 - curl_easy_setopt: clarify some USERPWD and PROXYUSERPWD details - login options: remove the ;[options] support from CURLOPT_USERPWD To avoid the regression when users pass in passwords containing semi- colons, we now drop the ability to set the login options with the same options. Support for login options in CURLOPT_USERPWD was added in 7.31.0. Test case 83 was modified to verify that colons and semi-colons can be used as part of the password when using -u (CURLOPT_USERPWD). Bug: http://curl.haxx.se/bug/view.cgi?id=1311 Reported-by: Petr Bahula Assisted-by: Steve Holme Signed-off-by: Daniel Stenberg Steve Holme (14 Dec 2013) - imap: Fixed exclude of clear text when using auth=* in commit 75cd7fd66762bb It is not 100% clear whether * should include clear text LOGIN or not from RFC-5092, however, including it is then consistent with current POP3 behaviour where clear text, APOP or SASL may be chosen. - imap: Fixed incorrect fallback to clear text authentication If a specific SASL authentication mechanism was requested by the user as part of the login options but wasn't supported by the server then curl would fallback to clear text, when it shouldn't, rather than reporting "No known authentication mechanisms supported" as the POP3 and SMTP protocols do. Daniel Stenberg (11 Dec 2013) - [Eric Lubin brought this change] parsedate: avoid integer overflow In C, signed integer overflow is undefined behavior. Thus, the compiler is allowed to assume that it will not occur. In the check for an overflow, the developer assumes that the signed integer of type time_t will wrap around if it overflows. However, this behavior is undefined in the C standard. Thus, when the compiler sees this, it simplifies t + delta < t to delta < 0. Since delta > 0 and delta < 0 can't both be true, the entire if statement is optimized out under certain optimization levels. Thus, the parsedate function would return PARSEDATE_OK with an undefined value in the time, instead of return -1 = PARSEDATE_FAIL. - parseconfig: warn if unquoted white spaces are detected Commit 0db811b6 made some existing config files pass on unexpected values to libcurl that made it somewhat hard to track down what was really going on. This code detects unquoted white spaces in the parameter when parsing a config file as that would be one symptom and it is generally a bad syntax anyway. - RELEASE-NOTES: recount contributors and libcurl options - RELEASE-NOTES: synced with c4f46e97ca6c - [James Dury brought this change] TFTP: let tftp_multi_statemach()'s return codes through It would otherwise always clobber the return code with new function calls and it couldn't return timeout etc. Bug: http://curl.haxx.se/bug/view.cgi?id=1310 Nick Zitzmann (7 Dec 2013) - [Melissa Mears brought this change] darwinssl: Fix #if 10.6.0 for SecKeychainSearch The comment here says that SecKeychainSearch causes a deprecation warning when used with a minimum Mac OS X SDK version of 10.7.0, which is correct. However, the #if guard did not match. It was intended to only use the code if 10.6.0 support was enabled, but it had 10.7.0 instead. This caused a warning if the minimum was exactly 10.7.0. Daniel Stenberg (6 Dec 2013) - [Christian Weisgerber brought this change] curl.h: for OpenBSD curl.h should also include on OpenBSD to reliably pull in select(). Typically, including will be enough, but not if strict standards-compliance is requested (e.g. by defining _XOPEN_SOURCE). - digest: fix CURLAUTH_DIGEST_IE The URI that is passed in as part of the Authorization: header needs to be cut off at '?' if CURLAUTH_DIGEST_IE is set. Previously the code only did when calculating the MD5sum. Bug: http://curl.haxx.se/bug/view.cgi?id=1308 Patched-by: Sergey Tatarincev - Curl_is_connected: use proxy name in error message when proxy is used (bug introduced in 255826c4, never present in a release) Reported-by: Dima Tisnek Bug: http://curl.haxx.se/mail/lib-2013-12/0006.html Steve Holme (4 Dec 2013) - imap/pop3: Post graceful cancellation consistency changes - [Melissa Mears brought this change] pop3: Fix POP3_TYPE_ANY signed compilation warning POP3_TYPE_ANY, or ~0, is written to pop3c->preftype in lib/pop3c.c, an unsigned int variable. The result of ~0 is -1, which caused a warning due to writing a negative number to an unsigned variable. To fix this, make the expression ~0U so that its value is considered the unsigned number UINT_MAX which is what SASL_AUTH_ANY does in curl_sasl.h. Kamil Dudka (2 Dec 2013) - tool_metalink: do not use HAVE_NSS_INITCONTEXT ... no longer provided by the configure script - nss: make sure that 'sslver' is always initialized - nss: unconditionally require NSS_InitContext() ... since we depend on NSS 3.14+ because of SSL_VersionRangeSet() anyway - nss: allow to use TLS > 1.0 if built against recent NSS Bug: http://curl.haxx.se/mail/lib-2013-11/0162.html - nss: put SSL version selection into separate fnc - nss: use a better API for controlling SSL version This change introduces a dependency on NSS 3.14+. Patrick Monnerat (2 Dec 2013) - OS400: sync wrappers and RPG binding. Steve Holme (1 Dec 2013) - multi.c: Fixed compilation warning warning: declaration of 'pipe' shadows a global declaration - RELEASE-NOTES: Synced with ad3836448efbb7 - base64: Corrected typo from commit f3ee587775c88a - base64: Post extended extended validation tidy up Reduced the separate processing of the last quantum to be performed in the main decoding loop and renamed some variables for consistency. - base64: Extended validation to look for invalid characters Extended the basic validation in commit e17c1b25bc33eb to return a failure when invalid base64 characters are included. - base64: Post basic validation tidy up Due to the length checks introduced in commit e17c1b25bc33eb there is no need to allow for extra space in the output buffer for a non-padded last quantum. - curl_easy_getinfo: Post CURLINFO_TLS_SESSION tidy up 1) Renamed curl_tlsinfo to curl_tlssessioninfo as discussed on the mailing list. 2) Renamed curl_ssl_backend to curl_sslbackend so it doesn't follow our function naming convention. 3) Updated sessioninfo.c example accordingly. Daniel Stenberg (29 Nov 2013) - parseconfig: dash options can't specified with colon or equals Bug: http://curl.haxx.se/bug/view.cgi?id=1297 Reported-by: Michael Osipov - curl.1: -G also takes --data-urlencode data - globbing: curl glob counter mismatch with {} list use The "fixed string" function wrongly bumped the "urlnum" counter which made curl output the total number of URLs wrong when using {one,two,three} lists in globs. Reported-by: Michael-O Bug: http://curl.haxx.se/bug/view.cgi?id=1305 Steve Holme (28 Nov 2013) - [Christian Grothoff brought this change] sessioninfo.c: Added sample code for CURLINFO_TLS_SESSION Added a simple example to show how one can use CURLINFO_TLS_SESSION for obtaining extensive TLS certificate information. - multi.c: Fixed compilation error introduced in commit a900d45489fc14 Systems that define SIGPIPE_VARIABLE as a noop would not compile as restore_pipe was defined afterwards. - [Christian Grothoff brought this change] curl_easy_getopt: Handle API violation gracefully This fixes a NULL dereference in the case where the client asks for CURLINFO_TLS_SESSION data after the (TLS) session has already been destroyed (i.e. curl_easy_perform has already completed for this handle). Instead of crashing, we now return a CURLSSLBACKEND_NONE error. - KNOWN_BUGS: #86: Disconnect commands may not be sent by IMAP, POP3 and SMTP Daniel Stenberg (27 Nov 2013) - [Jeff King brought this change] curl_multi_cleanup: ignore SIGPIPE This is an extension to the fix in 7d80ed64e43515. We may call Curl_disconnect() while cleaning up the multi handle, which could lead to openssl sending packets, which could get a SIGPIPE. Signed-off-by: Jeff King - [Jeff King brought this change] sigpipe: factor out sigpipe_reset from easy.c Commit 7d80ed64e43515 introduced some helpers to handle sigpipe in easy.c. However, that fix was incomplete, and we need to add more callers in other files. The first step is making the helpers globally accessible. Since the functions are small and should generally end up inlined anyway, we simply define them in the header as static functions. Signed-off-by: Jeff King - [Björn Stenberg brought this change] connect: Try next ip directly after immediate connect fail This fixes a rare Happy Eyeballs bug where if the first IP family runs out of addresses before the second-family-timer fires, and the second IP family's first connect fails immediately, no further IPs of the second family are attempted. - hostip: don't prune DNS cache entries that are in use When adding entries to the DNS cache with CURLOPT_RESOLVE, they are marked 'inuse' forever to prevent them from ever being removed in normal operations. Still, the code that pruned out-of-date DNS entries didn't care for the 'inuse' struct field and pruned it anyway! Reported-by: Romulo A. Ceccon Bug: http://curl.haxx.se/bug/view.cgi?id=1303 Steve Holme (24 Nov 2013) - RELEASE-NOTES: Synced with 35e476a3f6cdd5 - tests: Re-ordered test arguments to match other IMAP tests - tests: Corrected login "username" authentication responses - tests: Added error code explanation comments - tests: Removed expected QUIT response from graceful cancellation tests A failure during authentication, which is performed as part of the CONNECT phrase (for IMAP, POP3 and SMTP) is considered by the multi- interface as being closed prematurely (aka a dead connection). As such these protocols cannot issue the relevant QUIT or LOGOUT command. Temporarily fixed the test cases until we can fix this properly. - tests: Added SMTP graceful authentication cancellation tests - tests: Added POP3 graceful authentication cancellation tests - ftpserver.pl: Reworked fix from commit 7a36b2abc06862 - ftpserver.pl: Fixed unknown IMAP command "*" - ftpserver.pl: Fixed servercmd REPLY with * detection - tests: Added IMAP graceful authentication cancellation tests - tests: Moved CR LF in URL tests to their respective protocol groups - smtp: Post SMTP command expansion tidy up Removed unnecessary SMTP_STOP state changes on failure. Removed hard return on failure in smtp_state_data_resp(). - symbols-in-versions: Added missing CURLSSLBACKEND_* symbols - symbols-in-versions: Fixed missing CURLINFO_TLS_SESSION - [Christian Grothoff brought this change] curl_easy_getinfo: Added CURLINFO_TLS_SESSION for accessing TLS internals Added new API for returning a SSL backend type and pointer, in order to allow access to the TLS internals, that may then be used to obtain X509 certificate information for example. - RELEASE-NOTES: Synced with 8191800a0c8ff7 - smtp: Fixed space being sent in non --mail-rcpt based requests Commands such as NOOP, RSET and HELP would be sent with a space at the end of the command, for example: "NOOP ". - tests: Added SMTP NOOP and RSET tests - test928: Corrected typo in expected data from commit df58084695ce9b - tests: Added SMTP HELP test - smtp: Changed the default command to HELP when no options are specified Otherwise a NOOP operation would be performed which a) only returns a single line response and not a multiline response where -I needs to be used, and b) provides an inconsistent user experience compared to that of the POP3 and IMAP protocols. - smtp:Fixed memory leak from commit dac01ff6d788b2 The buffer allocated by smtp_parse_custom_request() was not freed. - connect: Close open but unconnected socket in singleipconnect() singleipconnect() could return the file descriptor of an open socket even though the function returned a CURLE_COULDNT_CONNECT error code from commit ed1662c374361a and 02fbc26d59c591. This could cause tests 19, 704 and 1233 to fail on FreeBSD, AIX and Solaris. - tests: Added SMTP EXPN command test - test926: Corrected unknown user reply from commit 0d735c29f92748 The error code should not be sent as data as it isn't passed onto the client as body data, so cannot be compared in the test suite against expected data. - tests: Corrected missing data reply sections from 3d50e91aeef8cc - tests: Added SMTP VRFY command tests - ftpserver.pl: Added support for new SMTP commands - smtp: Fixed broken RCPT TO from commit 0ea4a80bb23666 Daniel Stenberg (15 Nov 2013) - smtp_state_mail_resp: removed unused variable 'smtp' Steve Holme (15 Nov 2013) - DOCS: Updated curl_easy_setopt.3 following recent SMTP changes * Added information about the verify and expand commands to CURLOPT_MAIL_RCPT. * Reworked CURLOPT_CUSTOMREQUEST section, adding information about IMAP and SMTP custom commands. - DOCS: Updated manpage following recent SMTP modifications * Added SMTP section to --request * Expanded --mail-rcpt to describe the usage when using the verify and expand commands. - smtp: Simplified the next RCPT TO logic - lib1507.c: Added missing set of CURLOPT_UPLOAD option Although this option should have already been set, the SMTP module can now download information from and send instructional commands to, an SMTP server, requiring the option to be set in order to perform a mail transfer. - smtp.c: Fixed trailing whitespace - smtp: Added support for VRFY and EXPN commands - smtp: Added support for NOOP and RSET commands - smtp: Fixed handling of multiline server greeting responses Incorrectly processed multiline server greeting responses as "wanted" continue responses in smtp_endofresp(), from commit f16c0de4e9bbe3, which in turn broke the SMTP server detection in the test suite, because the EHLO command would not be sent. - smtp.c: Fixed compilation error from commit f16c0de4e9bbe3 warning: unused variable 'smtpc' - smtp: Fixed processing of more than one response when sent in same packet Added a loop to smtp_statemach_act() in which Curl_pp_readresp() is called until the cache is drained. Without this multiple responses received in a single packet could result in a hang or delay. - smtp: Moved EHLO response handling to smtp_state_ehlo_resp() Similar to the processing of untagged CAPABILITY responses in IMAP moved the processing of multiline EHLO responses to smtp_state_ehlo_resp() and introduced an internal response code of one to differentiate a multiline continuation from the end of command. This also allows for the separate processing of multiline responses from commands such as VRFY and EXPN. - connect: Forgot to correct line endings before push in commit ed1662c374361a - [Björn Stenberg brought this change] connect: Return the socket descriptor even on fail singleipconnect() did not return the open socket descriptor on some errors, thereby sometimes causing a socket leak. This patch ensures the socket is always returned. Daniel Stenberg (13 Nov 2013) - configure: Fix test with -Werror=implicit-function-declaration The ipv6 auto-detect test in configure returns a false negative when CFLAGS contains -Werror=implicit-function-declaration. (I have been using this flag to detect code issues that would result in SEGVs on x86_64-cygwin.) Patch-by: Yaakov Selkowitz Bug: http://curl.haxx.se/bug/view.cgi?id=1304 Steve Holme (13 Nov 2013) - test825: Corrected typo from commit b29217d0d682d4 - RELEASE-NOTES: Synced with bde901ad89a6f1 - test922: Corrected title to match other OAuth 2.0 tests - tests: Added IMAP OAuth 2.0 authentication with initial response test - tests: Added IMAP NTLM authentication with initial response test - tests: Added IMAP login authentication with initial response test - tests: Added IMAP plain authentication with initial response test - test873: Use proper padding in NTLM responses Nick Zitzmann (12 Nov 2013) - darwinssl: check for SSLSetSessionOption() presence when toggling BEAST Even though this is only a formality (since not many people build on Mavericks while targeting Leopard), since we still support Leopard at the earliest, we might as well be pedantic. - darwinssl: PKCS#12 import feature now requires Lion or later It turns out that some of the constants necessary to make this feature work are missing from Snow Leopard's Security framework even though they are defined in the headers. Bug: http://curl.haxx.se/mail/lib-2013-11/0076.html Reported by: myriachan Steve Holme (13 Nov 2013) - tests: Added POP3 OAuth 2.0 authentication with initial response test - tests: Added POP3 NTLM authentication with initial response test - tests: Added POP3 login authentication with initial response test - tests: Added POP3 plain authentication with initial response test - TODO: Added auth= in URLs to the wish list for HTTP - curl_easy_setopt: Added the ability to set the login options separately Rather than set the authentication options as part of the login details specified in the URL, or via the older CURLOPT_USERPWD option, added a new libcurl option to allow the login options to be set separately. Daniel Stenberg (12 Nov 2013) - curl.1: mention that -O does no URL decoding Kamil Dudka (12 Nov 2013) - [Tomas Hoger brought this change] curl_easy_setopt.3: clarify CURLOPT_SSL_VERIFYHOST documentation - better describe what happens when 1 is specified as parameter - clarify what "is ignored" means for NSS builds Steve Holme (12 Nov 2013) - runtests.pl: Added SSPI detection - multi: Small code tidy up to avoid hard return - tests: Updated CRAM-MD5 tests to use test user details - [Björn Stenberg brought this change] multi: Set read socket when returning READSOCK(0) This patch fixes and issue introduced in commit 7d7df831981fee, if the tunnel state was TUNNEL_CONNECT, waitconnect_getsock() would return a bitmask indicating a readable socket but never stored the socket in the return array. Daniel Stenberg (11 Nov 2013) - bump: next release will be 7.34.0 Due to all the news and changes. Steve Holme (10 Nov 2013) - [Björn Stenberg brought this change] connect: Close temporary sockets in conn_free() The temporary sockets used for Happy Eyeballs were not closed properly, if curl exited prematurely, which this patch fixes. - tests: Corrected titles of POP3 and SMTP OAuth 2.0 tests - test823: Fixed expected authentication text from commit e10a26a9d6d6de Fixed authentication text due to incorrect digest-uri property. - test821: Fixed expected authentication text from commit 2d5455feac9984 - RELEASE-NOTES: Synced with 0f81fbe5da6643 - [Kim Vandry brought this change] ares: Fixed compilation under Visual Studio 2012 - tests: Added IMAP OAuth 2.0 authentication test - tests: Added IMAP DIGEST-MD5 authentication test - tests: Added IMAP NTLM authentication test - tests: Added IMAP CRAM-MD5 authentication test - test819: Fixed expected authentication text from commit 76f924131c9fd3 - ftpserver.pl: Reworked custom reply handling code 1) To fix issues with IMAP custom replies 2) So initial space is not required in IMAP display text 3) To be more readable and understandable - ftpserver.pl: Reworked unrecognised command responses As the IMAP regex could fail and $1 would not contain the command id updated the unrecognised command response to be more generic and realistic (like those used in the command handlers). Additionally updated the POP3, SMTP and FTP responses. - ftpserver.pl: Fixed processing of IMAP authentication strings Daniel Stenberg (9 Nov 2013) - cmake: fix Windows build with IPv6 support Patch-by: "Z98" Steve Holme (6 Nov 2013) - Revert "ftpserver.pl: Corrected logic from commit 27b7b1062f9d97" This reverts commit 558034ab7002d1 as it appears to break the auto builds. More thought is required for this! - ftpserver.pl: Corrected logic from commit 27b7b1062f9d97 - ftpserver.pl: Fixed IMAP cmdid being sent on custom responses - tests: Added IMAP login authentication test - tests: Added IMAP plain authentication test - url.c: Very small amount of policing - [Björn Stenberg brought this change] url.c: Remove superfluous for loop The reason for this loop's existence was removed in commit 02fbc26d59c591. Daniel Stenberg (5 Nov 2013) - KNOWN_BUGS: STARTTRANSFER for POST requests added 85. Wrong STARTTRANSFER timer accounting for POST requests - Curl_ssl_push_certinfo_len: don't %.*s non-zero-terminated string Our own printf() replacement clearly can't properly handle %.*s with a string that isn't zero terminated. Instead of fixing the printf code or even figuring out what the proper posix behavior is, I reverted this piece of the code back to the previous version where it does malloc + memcpy instead. Regression added in e839446c2a5, released in curl 7.32.0. Reported-by: Felix Yan Bug: http://curl.haxx.se/bug/view.cgi?id=1295 Steve Holme (5 Nov 2013) - RELEASE-NOTES: Synced with 7fc3b2ce382ed6 - connect.h: Updated copyright year for last edit Daniel Stenberg (4 Nov 2013) - [Björn Stenberg brought this change] connect: Add connection delay to Happy Eyeballs. This patch adds a 200ms delay between the first and second address family socket connection attempts. It also iterates over IP addresses in the order returned by the system, meaning most dual-stack systems will try IPv6 first. Additionally, it refactors the connect code, removing most code that handled synchronous connects. Since all sockets are now non-blocking, the logic can be made simpler. Steve Holme (4 Nov 2013) - winbind: Fixed ntlm_auth expecting eol following commit e17c1b25bc33eb - nss.c: Fixed compilation warnings (Take Two) nss.c:702: warning: pointer targets in passing argument 3 of 'Curl_extract_certinfo' differ in signedness nss.c:702: warning: pointer targets in passing argument 4 of 'Curl_extract_certinfo' differ in signedness Made sure the cast was correctly "unsigned char *" to "char *" and not "unsigned char *" to "unsigned char *". - nss.c: Fixed compilation warnings nss.c:700: warning: pointer targets in passing argument 3 of 'Curl_extract_certinfo' differ in signedness nss.c:700: warning: pointer targets in passing argument 4 of 'Curl_extract_certinfo' differ in signedness - tests: Added test for IMAP NOOP command - tests: Added test for IMAP COPY command - tests: Disable IMAP CLOSE and EXPUNGE command tests This is temporary until curl supports either multiple custom commands or post-quote commands in IMAP. - tests: Added tests for IMAP CLOSE and EXPUNGE commands - connect.c: Code policing on commit 5094bb53f4a027 No need for a rhs condition on a bitwise compare. - nss.c: Fixed compilation warnings warning: implicit declaration of function 'Curl_extract_certinfo' - x509asn1.c: Fixed compilation warnings warning: declaration of 'chsize' shadows a global declaration - DOCS: Expanded --request description to include POP3 and IMAP details - tool_help: Updated --list-only description to include POP3 - DOCS: Updated --list-only description to include POP3 Additionally corrected typos in --oauth2-bearer protocol list. - base64: Fixed compilation warnings when using Curl_base64_decode() curl_sasl.c:294: warning: dereferencing type-punned pointer will break strict-aliasing rules getpart.c:201: warning: dereferencing type-punned pointer will break strict-aliasing rules - connect: Fixed "Whut?" no server connection failures Introduced in commit 7d7df831981fee curl would loop displaying "Whut?" if it was trying to connect to an address and port that didn't have anything listening on it. - http: Post base64 decoding tidy up Renamed copy_header_value() to Curl_copy_header_value() as this function is now non static. Simplified proxy flag in Curl_http_input_auth() when calling sub-functions. Removed unnecessary white space removal when using negotiate as it had been missed in commit cdccb422671aeb. Daniel Stenberg (3 Nov 2013) - glob_range: pass the closing bracket for a-z ranges Regression since commit 5ca96cb844102 (release in 7.33.0) Reported-by: Marcin Gryszkalis Steve Holme (2 Nov 2013) - getpart: Fixed base64 encoded parts following commit e17c1b25bc33eb - http: Added proxy tunnel authentication message header value extraction ...following recent changes to Curl_base64_decode() rather than trying to parse a header line for the authentication mechanisms which is CRLF terminated and inline zero terminate it. - http: Added authentication message header value extraction ...following recent changes to Curl_base64_decode() rather than trying to parse a header line for the authentication mechanisms which is CRLF terminated and inline zero terminate it. Daniel Stenberg (30 Oct 2013) - curl_multi_wait: accept 0 from multi_timeout() as valid timeout The code rejected 0 as a valid timeout while in fact the function could indeed legitimately return that and it should be respected. Reported-by: Bjorn Stenberg Steve Holme (30 Oct 2013) - email: Corrected a couple of typos from commit aa0eaef4838ccd - TODO: Removed the 'Graceful base64 decoding failure' sections Updated following the recent changes to support graceful failures during the authentication phrase. - email: Post graceful SASL authentication cancellation tidy up - [Kamil Dudka brought this change] tests: use proper padding in NTLM responses Patrick Monnerat (30 Oct 2013) - NSS: support for CERTINFO feature Daniel Stenberg (30 Oct 2013) - base64: removed trailing white space and updated copyright year Steve Holme (30 Oct 2013) - base64: Added basic validation to base64 input string when decoding A base64 string should be a multiple of 4 characters in length, not contain any more than 2 padding characters and only contain padding characters at the end of string. For example: Y3VybA== Strings such as the following are considered invalid: Y= - Invalid length Y== - Invalid length Y=== - More than two padding characters Y=x= - Padding character contained within string Daniel Stenberg (29 Oct 2013) - RELEASE-NOTES: synced with 255826c40f9316 - [Björn Stenberg brought this change] bugfix: Don't block waiting for socket1 connect. This patch fixes a bug in Happy Eyeballs where curl would wait for a connect response from socket1 before checking socket2. Also, it updates error messages for failed connections, showing the ip addresses that failed rather than just the host name repeatedly. Bug: http://curl.haxx.se/mail/lib-2013-10/0236.html Reported-by: Paul Marks Steve Holme (28 Oct 2013) - sasl: Updated create_digest_md5_message() to use a dynamic buffer Daniel Stenberg (28 Oct 2013) - SECURITY: "curl security for developers" Describes our security process from a project and curl developer's perspective. Patrick Monnerat (28 Oct 2013) - OS400: coding style standards Steve Holme (27 Oct 2013) - email: Added support for cancelling NTLM authentication - sasl: Removed unused variables from commit b87ba2c94217c0 - email: Added support for cancelling DIGEST-MD5 authentication - email: Corrected a couple of typos from 1e39b95682781f Daniel Stenberg (27 Oct 2013) - [Gisle Vanem brought this change] docs/examples/httpput.c: fix build for MSVC "Dan Fandrich" wrote: >> But I'm not sure is needed at all. > > It's needed for close(2). But the only reason that's needed is because fstat > is used instead of stat(2); if you fix that, then you could remove that > include altogether. Okay. I've tested the following with MSVC and MingW. htttput.c now simply uses stat(): Steve Holme (27 Oct 2013) - email: Added support for canceling CRAM-MD5 authentication Daniel Stenberg (27 Oct 2013) - [Björn Stenberg brought this change] Typo fix in trynextip(). - TODO: remove "Happy Eyeball dual stack connect" ... as it was just merged in commit 7d7df - [Björn Stenberg brought this change] Add "Happy Eyeballs" for IPv4/IPv6. This patch invokes two socket connect()s nearly simultaneously, and the socket that is first connected "wins" and is subsequently used for the connection. The other is terminated. There is a very slight IPv4 preference, in that if both sockets connect simultaneously IPv4 is checked first and thus will win. Steve Holme (27 Oct 2013) - email: Added initial support for cancelling authentication Should a client application fail to decode an authentication message received from a server, or not support any of the parameters given by the server in the message, then the authentication phrase should be cancelled gracefully by the client rather than simply terminating the connection. The authentication phrase should be cancelled by simply sending a '*' to the server, in response to erroneous data being received, as per RFC-3501, RFC-4954 and RFC-5034. This patch adds the necessary state machine constants and appropriate response handlers in order to add this functionality for the CRAM-MD5, DIGEST-MD5 and NTLM authentication mechanisms. - email: Moved authentication message parsing into a separate function ...in preparation for upcoming modifications. - ftp: Fixed compiler warning warning: 'result' may be used uninitialized in this function Daniel Stenberg (26 Oct 2013) - FTP: make the data connection work when going through proxy This is a regression since the switch to always-multi internally c43127414d89c. Test 1316 was modified since we now clearly call the Curl_client_write() function when doing the LIST transfer part and then the handler->protocol says FTP and ftpc.transfertype is 'A' which implies text converting even though that the response is initially a HTTP CONNECT response in this case. Steve Holme (26 Oct 2013) - tool_help: Added login options to --user description - email: Added references to SASL LOGIN authentication draft proposal - tests: Tidy up of SMTP and POP3 tests Corrected line endings, RFC references and standardised on user names and passwords used in the tests. - tool_help: Added clarity to the --oauth2-bearer option ...as XOAUTH2 is the extended (or non-standard) SASL identifier and OAuth 2 is the protocol name (and version). - smtp: Fixed response code parsing for bad AUTH continuation responses This workaround had been previously been implemented for IMAP and POP3 but not SMTP. Some of the recent test case additions implemented this behaviour to emulate a bad server and the SMTP code didn't cope with it. - gskit.c: Code policing following commit 2cc9246477285d Corrected 80 character line length error and pointer declarations (some of which were previously incorrect) - test907: Corrected DIGEST-MD5 response given in commit 820ed48a0088cd As the URI, which is contained within the DIGEST-MD5 response, is constructed from the service and realm, the encoded message differs from that generated under POP3. - RELEASE-NOTES: Synced with d24b7953c2132a - tests: Added SMTP OAUTH2 authentication with initial response test - tests: Added SMTP NTLM authentication with initial response test - tests: Added SMTP OAUTH2 authentication test - tests: Added SMTP DIGEST-MD5 authentication test - tests: Regrouped SMTP authentication tests Patrick Monnerat (25 Oct 2013) - OS400: sync RPG wrapper, zlib support, fix header file names, ... IFS compilation support, SSL GSKit backend by default, TLSv1.[12] support in GSKit for OS400 >= V7R1, no more tabs in make scripts. Steve Holme (24 Oct 2013) - sasl: Fixed memory leak in OAUTH2 message creation - ftpserver.pl: Added support for empty pop3 authentication data Daniel Stenberg (23 Oct 2013) - CURLOPT_RESOLVE: mention they don't time-out Clarify in the documentation that DNS entries added with CURLOPT_RESOLVE won't time-out. Bug: http://curl.haxx.se/mail/lib-2013-10/0062.html Reported-by: Romulo Ceccon Steve Holme (23 Oct 2013) - tests: Added POP3 OAUTH2 authentication test - tests: Added empty response support to custom replies ...and fixed up test869 as DIGEST-MD transcript is as follows: S: Challenge C: Authentication String S: Continue Response C: Empty String Daniel Stenberg (23 Oct 2013) - sasl: fix compiler warning error: unused variable 'table16' Steve Holme (23 Oct 2013) - tests: Added POP3 DIGEST-MD5 authentication test Daniel Stenberg (22 Oct 2013) - configure: check for long long when building with cyassl cyassl/ctaocrypt/types.h needs SIZEOF_LONG_LONG Reported-by: Chris Conlon - test1240: verify 867b52a7ac52 (glob ranges with text to the right) - glob: fix regression from commit 5ca96cb844 Plain strings after glob ranges/lists weren't treated correctly but caused broken URLs to get used. Reported-by: Javier Barroso - [Rémy Léone brought this change] Adding a .travis.yml file to use the travis-ci.org From wikipedia: Travis CI is a hosted, distributed continuous integration service used to build and test projects hosted at GitHub. Travis CI is configured by adding a file named .travis.yml, which is a YAML format text file, to the root directory of the GitHub repository. Travis CI automatically detects when a commit has been made and pushed to a GitHub repository that is using Travis CI, and each time this happens, it will try to build the project and run tests. This includes commits to all branches, not just to the master branch. When that process has completed, it will notify a developer in the way it has been configured to do so — for example, by sending an email containing the test results (showing success or failure), or by posting a message on an IRC channel. It can be configured to run the tests on a range of different machines, with different software installed (such as older versions of a programming language, to test for compatibility). Kamil Dudka (21 Oct 2013) - ssh: initialize per-handle data in ssh_connect() ... if not already initialized. This fixes a regression introduced by commit 4ad8e142da463ab208d5b5565e53291c8e5ef038, which caused test619 to intermittently fail on certain machines (namely Fedora build hosts). Daniel Stenberg (20 Oct 2013) - [Gisle Vanem brought this change] curl.1: add missing exit-code I noted a missing text for exit-code 89 in docs/curl.1 - cmake: unbreak for non-Windows platforms Patch-by: Oliver Kuckertz Bug: http://curl.haxx.se/bug/view.cgi?id=1292 Steve Holme (20 Oct 2013) - ftpserver.pl: Fixed syntax error from commit 5b31b38c27bb7a - test866: Fixed user response from commit 7f7fbe7fbdb449 - ftpserver.pl: Fixed processing of POP3 authentication strings ...and corrected response when check fails from 500 to -ERR. - tests: Added POP3 NTLM authentication test - tests: Added POP3 CRAM-MD5 authentication test - tests: Added POP3 login authentication test - tests: Added POP3 plain authentication test - tests: Added POP3 APOP authentication test - ftpserver.pl: Added support for APOP POP3 authentication - tests: Added POP3 RSET test - RELEASE-NOTES: Synced with ce61510127ea60 - email: Fixed QUIT / LOGOUT being sent when SSL connect fails Kamil Dudka (18 Oct 2013) - curl_sasl: initialize NSS before using crypto Steve Holme (17 Oct 2013) - SSL: Follow up work to commits 6a1363128f1107 and 87861c9b0e8155 Changed the failure code when TLS v1.1 and v1.2 is requested but not supported by older OpenSSL versions, following review from libcurl peers, and reduced the number of required preprocessor if statements. - SSL: Added unsupported cipher version check for OpenSSL ...with the use of CURL_SSLVERSION_TLSv1_1 and CURL_SSLVERSION_TLSv1_2 being conditional on OpenSSL v1.0.1 as the appropriate flags are not supported under earlier versions. - DOCS: Added libcurl version number to CURLOPT_SSLVERSION - SSL: Corrected version number for new symbols from commit ad34a2d5c87c7f - SSL: Corrected typo from commit 87861c9b0e8155 - SSL: Fixed OpenSSL builds prior to v1.0.1 Commit ad34a2d5c87c7f relies on definitions that are only present in OpenSSL v1.0.1 and up. This quick fix allows the builds that use older versions of OpenSSL to continue building. - test906: Fixed failing test on some platforms Bug: http://sourceforge.net/p/curl/bugs/1291 Reported-by: David Walser Daniel Stenberg (15 Oct 2013) - [Paul Donohue brought this change] NSS: acknowledge the --no-sessionid/CURLOPT_SSL_SESSIONID_CACHE option - [Tyler Hall brought this change] ssh: Handle successful SSH_USERAUTH_NONE According to the documentation for libssh2_userauth_list(), a NULL return value is not necessarily an error. You must call libssh2_userauth_authenticated() to determine if the SSH_USERAUTH_NONE request was successful. This fixes a segv when using sftp on a server that allows logins with an empty password. When NULL was interpreted as an error, it would free the session but not flag an error since the libssh2 errno would be clear. This resulted in dereferencing a NULL session pointer. Signed-off-by: Tyler Hall - [Ishan SinghLevett brought this change] usercertinmem: fix memory leaks - [Dave Reisner brought this change] build: distribute and install libcurl.m4 by default - [Dave Reisner brought this change] tool: use XFERFUNCTION to save some casts - [Alessandro Ghedini brought this change] curl.1: fix typo conjuction -> conjunction - curl: document the new --tlsv1.[012] options - [Gergely Nagy brought this change] SSL: protocol version can be specified more precisely CURL_SSLVERSION_TLSv1_0, CURL_SSLVERSION_TLSv1_1, CURL_SSLVERSION_TLSv1_2 enum values are added to force exact TLS version (CURL_SSLVERSION_TLSv1 means TLS 1.x). axTLS: axTLS only supports TLS 1.0 and 1.1 but it cannot be set that only one of these should be used, so we don't allow the new enum values. darwinssl: Added support for the new enum values. SChannel: Added support for the new enum values. CyaSSL: Added support for the new enum values. Bug: The original CURL_SSLVERSION_TLSv1 value enables only TLS 1.0 (it did the same before this commit), because CyaSSL cannot be configured to use TLS 1.0-1.2. GSKit: GSKit doesn't seem to support TLS 1.1 and TLS 1.2, so we do not allow those values. Bugfix: There was a typo that caused wrong SSL versions to be passed to GSKit. NSS: TLS minor version cannot be set, so we don't allow the new enum values. QsoSSL: TLS minor version cannot be set, so we don't allow the new enum values. OpenSSL: Added support for the new enum values. Bugfix: The original CURL_SSLVERSION_TLSv1 value enabled only TLS 1.0, now it enables 1.0-1.2. Command-line tool: Added command line options for the new values. Nick Zitzmann (14 Oct 2013) - darwinssl: un-break iOS build after PKCS#12 feature added SecPKCS12Import() returns a few errors that are enumerated in OS X's headers but not in iOS' headers for some reason. Daniel Stenberg (14 Oct 2013) - bump: start working on 7.33.1 - THANKS: added contributors from the 7.33.0 announcement Version 7.33.0 (13 Oct 2013) Daniel Stenberg (13 Oct 2013) - RELEASE-NOTES: synced with 92cf6141ed0de - curl: fix --oauth2-bearer in the --help output After the option rename in 5df04bfafd1 - OpenSSL: improve the grammar of the language in 39beaa5ffbcc Reported-by: Petr Pisar - [Andrej E Baranov brought this change] OpenSSL: use failf() when subjectAltName mismatches Write to CURLOPT_ERRORBUFFER information about mismatch alternative certificate subject names. Signed-off-by: Andrej E Baranov - curl: rename --bearer to --oauth2-bearer The option '--bearer' might be slightly ambiguous in name. It doesn't create any conflict that I am aware of at the moment, however, OAUTH v2 is not the only authentication mechanism which uses "bearer" tokens. Reported-by: Kyle L. Huff URL: http://curl.haxx.se/mail/lib-2013-10/0064.html - [Kamil Dudka brought this change] ssh: improve the logic for detecting blocking direction This fixes a regression introduced by commit 0feeab78 limiting the speed of SCP upload to 16384 B/s on a fast connection (such as localhost). Dan Fandrich (12 Oct 2013) - Fixed typo in Makefile.inc that left http2.h out of the tar ball Daniel Stenberg (11 Oct 2013) - [Heinrich Schaefer brought this change] minor fix in doc - [Gisle Vanem brought this change] curl_setup_once: fix errno access for lwip on Windows lib/curl_setup_once.h assumed lwIP on Windows uses 'SetLastError()' to set network errors. It doesn't; it uses 'errno'. - test1239: verify 4cd444e01ad and the simulated 304 response - [Derek Higgins brought this change] HTTP: Output http response 304 when modified time is too old When using the -w '%{http_code}' flag and simulating a Not Modified then 304 should be output. - contributors: helper script to dig out contributors from git - RELEASE-NOTES: add twos refs to bug reports - RELEASE-NOTES: synced with 173160c0d068 Nick Zitzmann (2 Oct 2013) - darwinssl: block TLS_RSA_WITH_NULL_SHA256 cipher Credit (for catching a cipher I forgot to add to the blocked ciphers list): https://www.ssllabs.com/ssltest/viewMyClient.html Daniel Stenberg (2 Oct 2013) - OpenSSL: acknowledge CURLOPT_SSL_VERIFYHOST without VERIFYPEER Setting only CURLOPT_SSL_VERIFYHOST without CURLOPT_SSL_VERIFYPEER set should still verify that the host name fields in the server certificate is fine or return failure. Bug: http://curl.haxx.se/mail/lib-2013-10/0002.html Reported-by: Ishan SinghLevett - KNOWN_BUGS: #84: CURLINFO_SSL_VERIFYRESULT CURLINFO_SSL_VERIFYRESULT is only implemented for the OpenSSL and NSS backends and not for any other! - [François Charlier brought this change] xattr: add support for FreeBSD xattr API - curl_easy_setopt.3: slight clarification of SEEKFUNCTION Steve Holme (29 Sep 2013) - tests: Fixed typos from commit 25a0c96a494297 - tests: Updated email addresses in SMTP tests following recent changes - test909: Removed custom EHLO response after recent changes ...as it is no longer required following capability and authentication changes and is now causing problems following commit 49341628b50007 as the test number is obtained from the client address in the EHLO. - ftpserver.pl: Fixed compilation error from commit 49341628b50007 - ftpserver.pl: Moved specifying the test number from the RCPT address ...to the client address as this frees the RCPT strings to contain just an email address and by passing the test number into curl as the client address remains consistent with POP3 and IMAP tests as they are specified in the URL. - ftpserver.pl: Added unwanted argument check to SMTP DATA command handler Daniel Stenberg (29 Sep 2013) - getinmemory: remove a comment The comment mentioned the need to free the data, but the example already does that free - postinmemory: new example This is similar to getinmemory.c but with an initial POST. Combined-by: Ulf Samuelsson - win32: fix Visual Studio 2010 build with WINVER >= 0x600 If no WINVER and/or _WIN32_IWNNT define was set, the Windows platform SDK often defaults to high value, e.g. 0x601 (whoch may probably depend on the Windows version being used, in my case Windows 7). If WINVER >= 0x600 then winsock2.h includes some defines for WSAPoll(), e.g. POLLIN, POLLPRI, POLLOUT etc. These defines clash with cURL's lib/select.h. Make sure HAVE_STRUCT_POLLFD is defined then. Bug: http://curl.haxx.se/bug/view.cgi?id=1282 Reported-by: "kdekker" Patch-by: Marcel Raad Steve Holme (28 Sep 2013) - ssluse.c: Fixed compilation warnings when ENGINE not supported The function "ssl_ui_reader" was declared but never referenced The function "ssl_ui_writer" was declared but never referenced Daniel Stenberg (27 Sep 2013) - configure: use icc options without space The latest version(s) of the icc compiler no longer accept the extra space in the -we (warning enable), -wd (warning disable), etc. Reported-by: Elmira A Semenova Bug: http://curl.haxx.se/mail/lib-2013-09/0182.html Steve Holme (25 Sep 2013) - imap: Added clarification to the code about odd continuation responses - ftp.c: Fixed compilation warning There is an implicit conversion from "unsigned long" to "long" - sasl: Centralised the authentication mechanism strings Moved the standard SASL mechanism strings into curl_sasl.h rather than hard coding the same values over and over again in the protocols that use SASL authentication. For more information about the mechanism strings see: http://www.iana.org/assignments/sasl-mechanisms Daniel Stenberg (23 Sep 2013) - RELEASE-NOTES: added recent contributors missing Steve Holme (23 Sep 2013) - test906: Fixed type-2 response - test915: Corrected test number from commit 22bccb0edaf041 - test906: Fixed type-1 message not handled error ...from commit f81d1e16664976 due to copy paste error. - tests: Added SMTP AUTH NTLM test - tests: Added SMTP multiple and invalid --mail-rcpt test - tests: Added SMTP multiple --mail-rcpt test - tests: Added SMTP invalid --mail-rcpt test - tests: Regrouping of SMTP tests Daniel Stenberg (22 Sep 2013) - [Benoit Sigoure brought this change] test1112: Increase the timeout from 7s to 16s As someone reported on the mailing list a while back, the hard-coded arbitrary timeout of 7s in test 1112 is not sufficient in some build environments. At Arista Networks we build and test curl as part of our automated build system, and we've run into this timeout 170 times so far. Our build servers are typically quite busy building and testing a lot of code in parallel, so despite being beefy machines with 32 cores and 128GB of RAM we still hit this 7s timeout regularly. URL: http://curl.haxx.se/mail/lib-2010-02/0200.html Steve Holme (22 Sep 2013) - tests: Fixed smtp rcpt to addresses - ftpserver.pl: Expanded the SMTP RCPT handler to validate TO addresses RCPT_smtp() will now check for a correctly formatted TO address which allows for invalid recipient addresses to be added. - ftpserver.pl: Added cURL SMTP server detection to HELO command handler As curl will send a HELO command after an negative EHLO response, added the same detection from commit b07709f7417c3e to the HELO handler to ensure the test server is identified correctly and an upload isn't performed. - ftpserver.pl: Corrected response code for successful RCPT command - ftpserver.pl: Moved invalid RCPT TO: address detection to RCPT handler Rather than detecting the TO address as missing in the DATA handler, moved the detection to the RCPT command handler where an error response can be generated. - RELEASE-NOTES: Corrected missed addition Somehow commit 60a20461629fda missed the last item in the sync list even though I'm sure I added it during editing. - RELEASE-NOTES: Synced with 6dd8bd8d2f9729 - curl.1: Added information about optional login options to --user in manpage Added missing information, from curl 7.31.0, regarding the use of the optional login options that may be specified as part of --user. For example: --user 'user:password;auth=NTLM' in IMAP, POP3 and SMTP protocols. - ftpserver.pl: Moved cURL SMTP server detection into EHLO command handler Moved the special SMTP server detection code from the DATA command handler, which happens further down the operation chain after EHLO, MAIL and RCPT commands, to the EHLO command as it is the first command to be generated by a SMTP operation as well as containing the special "verifiedserver" string from the URL. This not only makes it easier and quicker to detect but also means that cURL doesn't need to specify "verifiedserver" as --mail-from and --mail-rcpt arguments. More importantly, this also makes the upcoming verification changes to the RCPT handler easier to implement. Daniel Stenberg (21 Sep 2013) - openssl: use correct port number in error message In ossl_connect_step2() when the "Unknown SSL protocol error" occurs, it would output the local port number instead of the remote one which showed when doing SSL over a proxy (but with the correct remote host name). As libcurl only speaks SSL to the remote we know it is the remote port. Bug: http://curl.haxx.se/bug/view.cgi?id=1281 Reported-by: Gordon Marler - test1415: adjusted to work for 32bit time_t The libcurl date parser returns INT_MAX for all dates > 2037 so this test is now made to use 2037 instead of 2038 to work the same for both 32bit and 64bit time_t systems. Steve Holme (21 Sep 2013) - tests: Reworked existing SMTP tests to be single recipient based ...in preparation of upcoming multiple recipient tests. - ftpserver.pl: Corrected SMTP QUIT response to be more realistic Daniel Stenberg (20 Sep 2013) - curl_easy_setopt.3: clarify that TIMEOUT and TIMEOUT_MS set the same value - [Kim Vandry brought this change] Documented --dns-* options in curl manpage Steve Holme (20 Sep 2013) - pop3: Added basic SASL XOAUTH2 support Added the ability to use an XOAUTH2 bearer token [RFC6750] with POP3 for authentication using RFC6749 "OAuth 2.0 Authorization Framework". The bearer token is expected to be valid for the user specified in conn->user. If CURLOPT_XOAUTH2_BEARER is defined and the connection has an advertised auth mechanism of "XOAUTH2", the user and access token are formatted as a base64 encoded string and sent to the server as "AUTH XOAUTH2 ". - curl: Added clarification to the --mail options in the --help output ... that these options apply to SMTP only. - ftpserver.pl: Moved SMTP RCPT response text into command handler - tests: Added SMTP invalid --mail-from test Nick Zitzmann (19 Sep 2013) - darwinssl: enable BEAST workaround on iOS 7 & later iOS 7 finally added the option to enable 1/n-1 when using TLS 1.0 and a CBC cipher, so we now always turn that on unless the user manually turns it off using CURLSSLOPT_ALLOW_BEAST. It appears Apple also added some new PSK ciphers, but no interface to use them yet, so we at least support printing them if we find them. Steve Holme (19 Sep 2013) - tests: Updated SMTP AUTH tests to use the new AUTH directive ...rather than specify a customised EHLO response. - tests: Corrected test913 as the QUIT response is received - tests: Added SMTP large message SIZE test - ftpserver.pl: Updated email regex from commit 98f7ca7e971006 ...to not be as strict as it was rejecting valid numeric email addresses. - tests: Fixed smtp mail from addresses - ftpserver.pl: Standardised CAPA and AUTH responses - ftpserver.pl: Corrected POP3 QUIT reply to be more realistic - runtests.pl: Fixed syntax error in commit c873375123343e Possible unintended interpolation in string at line 796 - runtests.pl: Fixed smtp mail from address Following changes to ftpserver.pl fixed the mail from address to be a correctly formatted address otherwise the server response will be 501 Invalid address. - ftpserver.pl: Fixed syntax error in commit 98f7ca7e971006 Can't modify constant item in scalar assignment line 779, near "0;" - ftpserver.pl: Expanded the SMTP MAIL handler to validate messages MAIl_smtp() will now check for a correctly formatted FROM address as well as the optional SIZE parameter comparing it against the server capability when specified. Daniel Stenberg (17 Sep 2013) - [YAMADA Yasuharu brought this change] cookies: add expiration Implement: Expired Cookies These following situation, curl removes cookie(s) from struct CookieInfo if the cookie expired. - Curl_cookie_add() - Curl_cookie_getlist() - cookie_output() Steve Holme (17 Sep 2013) - ftpserver.pl: Corrected response code for successful MAIL command - ftpserver.pl: Moved SMTP MAIL handler into own function - dns: fix compilation with MinGW from commit df69440d05f113 Avoid 'interface' literal that some MinGW versions define as a macro Additionally, corrected some very, very minor coding style errors. - tests: Fixed test 1406 following recent changes in ftpserver.pl By default the mail server doesn't send the SIZE capability but instead it has to be specified as a supported capability. - tests: Added test for SMTP SIZE capability - ftpserver.pl: Added the ability to include spaces in capabilities For example: CAPA "SIZE 1048576" 8BITMIME BINARYMIME will populate the capabilities list with the following in: SIZE 1048576 8BITMIME BINARYMIME - ftpserver.pl: Corrected response code for successful SMTP QUIT command - ftpserver.pl: Fixed syntax error in commit 33c1f2876b9029 Can't modify constant item in postincrement line 727, near "i++" - ftpserver.pl: Added CAPA & AUTH directive support to the SMTP EHLO handler - ftpserver.pl: Fixed SMTP QUIT handler from dadc495540946e - ftpserver.pl: Moved SMTP EHLO and QUIT handlers in own functions - ftpserver.pl: Added support for SMTP HELO command ...and updated test902 as explicit HELO response is no longer required. - ftpserver.pl: Added mailbox check to IMAP SELECT handler - ftpserver.pl: Corrected invalid user details check ...in both the IMAP LOGIN and POP3 PASS handlers introduced in commit 187ac693744949 and 84ad1569e5fc93 respectively. - ftpserver.pl: Moved IMAP LOGIN handler into own function - ftpserver.pl: Moved POP3 USER and PASS handlers into own functions - ftpserver.pl: Corrected invalid argument check in POP3 TOP handler ...which was accidentally introduced in commit 4d6ef6297ae9b6. - ftpserver.pl: Added capability prerequisite for extended POP3 commands - tests: Updated descriptions to be more meaningful - ftpserver.pl: Added support for IMAP NOOP command - imap: Fixed response check for NOOP command - tests: Updated descriptions to be more meaningful Daniel Stenberg (13 Sep 2013) - curl.1: detail how short/long options work URL: http://curl.haxx.se/bug/view.cgi?id=1279 Suggested-by: Jerry Krinock Steve Holme (13 Sep 2013) - curl: Fixed usage of DNS options when not using c-ares resolver Commit 32352ed6adddcb introduced various DNS options, however, these would cause curl to exit with CURLE_NOT_BUILT_IN when c-ares wasn't being used as the backend resolver even if the options weren't set by the user. Additionally corrected some minor coding style errors from the same commit. Daniel Stenberg (13 Sep 2013) - curl_easy_setopt.3: mention RTMP URL quirks URL: http://curl.haxx.se/bug/view.cgi?id=1278 Reported-by: Gorilla Maguila - [Ben Greear brought this change] curl: Add support for various DNS binding options. (Passed on to c-ares.) Allows something like this: curl --dns-interface sta8 --dns-ipv4-addr 8.8.1.111 --interface sta8 \ --localaddr 8.8.1.111 --dns-servers 8.8.8.1 www.google.com Signed-off-by: Ben Greear - [Kim Vandry brought this change] libcurl: New options to bind DNS to local interfaces or IP addresses - libcurl.3: for multi interface connections are held in the multi handle ... and a few more cleanups/clarifications Steve Holme (12 Sep 2013) - ftpserver.pl: Fixed missing comma from 7fd84b14d219b1 - ftpserver.pl: Fixed variable error introduced in 7fd84b14d219b1 Global symbol "$mailbox" requires explicit package name - ftpserver.pl: Added support for UID command - ftpserver.pl: Added support for LSUB command - imap: Fixed response check for LSUB and UID commands - ftpserver.pl: Added support for IMAP COPY command - ftpserver.pl: Added support for IMAP CLOSE and EXPUNGE commands - ftpserver.pl: Added support for POP3 RSET command - ftpserver.pl: Added the ability to remember what messages are deleted ...as this will be required for IMAP CLOSE and EXPUNGE commands as well as the POP3 RSET command. Daniel Stenberg (10 Sep 2013) - NI_MAXSERV: remove all use of it Solaris with the SunStudio Compiler is reportedly missing this define, but as we're using it without any good reason on all the places it was used I've now instead switched to just use sensible buffer sizes that fit a 32 bit decimal number. Which also happens to be smaller than the common NI_MAXSERV value which is 32 on most machines. Bug: http://curl.haxx.se/bug/view.cgi?id=1277 Reported-by: D.Flinkmann - http2: use the support HTTP2 draft version in the upgrade header ... instead of HTTP/2.0 to work fine with the nghttpx proxy/server. Steve Holme (10 Sep 2013) - ldap.c: Fix compilation warning warning: comparison between signed and unsigned integer expressions - [Jiri Hruska brought this change] imap/pop3/smtp: Speed up SSL connection initialization Don't wait for the next callback call (usually 1 second) before continuing with protocol specific connection initialization. - ldap.c: Corrected build error from commit 857f999353f333 - RELEASE-NOTES: Corrected duplicate in bfefe2400a16b8 - RELEASE-NOTES: Corrected typo from bfefe2400a16b8 - RELEASE-NOTES: synced with 25c68903756d6b Daniel Stenberg (10 Sep 2013) - README.http2: explain nghttp2 a little Steve Holme (9 Sep 2013) - tests: Added test for POP3 TOP command - ftpserver.pl: Added support for POP3 TOP command - tests: Added test for POP3 UIDL command - ftpserver.pl: Added support for POP3 UIDL command Daniel Stenberg (9 Sep 2013) - http2: adjust to new nghttp2_pack_settings_payload proto This function was modified in nghttp2 git commit a1c3f89c72e51 Kamil Dudka (9 Sep 2013) - url: handle abortion by read/write callbacks, too Otherwise, the FTP protocol would unnecessarily hang 60 seconds if aborted in the CURLOPT_HEADERFUNCTION callback. Reported by: Tomas Mlcoch Bug: https://bugzilla.redhat.com/1005686 Daniel Stenberg (9 Sep 2013) - ldap: fix the build for systems with ldap_url_parse() Make sure that the custom struct fields are only used by code that doesn't use a struct defintion from the outside. Attempts to fix the problem introduced in 3dc6fc42bfc61b Steve Holme (9 Sep 2013) - [Jiri Hruska brought this change] pingpong: Check SSL library buffers for already read data Otherwise the connection can get stuck during various phases, waiting for new data on the socket using select() etc., but it will never be received as the data has already been read into SSL library. - imap: Fixed calculation of transfer when partial FETCH received The transfer size would be calculated incorrectly if the email contained within the FETCH response, had been partially received by the pingpong layer. As such the following, example output, would be seen if the amount remaining was smaller than the amount received: * Excess found in a non pipelined read: excess = 1394, size = 262, maxdownload = 262, bytecount = 1374 * transfer closed with -1112 bytes remaining to read Bug: http://curl.haxx.se/mail/lib-2013-08/0170.html Reported-by: John Dunn - ftpserver.pl: Fixed empty array checks ...from commits 28427b408326a1 and e8313697b6554b. - ftpserver: Reworked AUTH support to allow for specifying the mechanisms Renamed SUPPORTAUTH to AUTH and added support for specifying a list of supported SASL mechanisms to return to the client. Additionally added the directive to the FILEFORMAT document. - ftpserver: Reworked CAPA support to allow for specifying the capabilities Renamed SUPPORTCAPA to CAPA and added support for specifying a list of supported capabilities to return to the client. Additionally added the directive to the FILEFORMAT document. - ftpserver.pl: Corrected POP3 LIST as message numbers should be contiguous The message numbers given in the LIST response are an index into the list, which are only valid for the current session, rather than being a unique message identifier. An index would only be missing from the LIST response if a DELE command had been issued within the same session and had not been committed by the end of session QUIT command. Once committed the POP3 server will regenerate the message numbers in the next session to be contiguous again. As such our LIST response should list message numbers contiguously until we support a DELE command in the same session. Should a POP3 user require the unique message ID for any or all messages then they should use the extended UIDL command. This command will be supported by the test ftpserver in an upcoming commit. Daniel Stenberg (8 Sep 2013) - [Clemens Gruber brought this change] curl_easy_pause: suggest one way to unpause Steve Holme (8 Sep 2013) - tests: Updated descriptions to be more meaningful - tests: Added test for POP3 NOOP command - ftpserver.pl: Added support for POP3 NOOP command - ftpserver.pl: Fixed 'Use of uninitialized value $args in string ne' - tests: Added test for POP3 STAT command - ftpserver.pl: Added support for POP STAT command - ftpserver.pl: Moved POP3 QUIT handler into own function - ftpserver.pl: Reordered the POP3 handlers to be alphabetical In preparation for additional POP3 tests, re-ordered the command function defintions to be sorted alphabetically. - ftpserver.pl: Corrected misaligned indentation in POP3 handlers Fixed incorrect indentation used in both the RETR_pop3 and LIST_pop3 functions which was 5 and 9 characters rather than 4 and 8. - tests: Added test for POP3 DELE command unknown (7 Sep 2013) - [Steve Holme brought this change] ftpserver.pl: Added support for POP3 DELE command Daniel Stenberg (7 Sep 2013) - http2: include curl_memory.h Detected by test 1132 Nick Zitzmann (7 Sep 2013) - http: fix build warning under LLVM When building the code using LLVM Clang without NGHTTP2, I was getting this warning: ../lib/http.h:155:1: warning: empty struct is a GNU extension [-Wgnu] Placing a dummy variable into the data structure silenced the warning. Daniel Stenberg (7 Sep 2013) - http2: actually init nghttp2 and send HTTP2-Settings properly - README.http2: how to use it best with the multi API? - http2: first embryo toward Upgrade: - http: rename use_http_1_1 to use_http_1_1plus Since it now actually says if 1.1 or a later version should be used. - configure: improve CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH The compiler test used a variable before it was assigned when it tried to see how it acts on a mismatching prototype, which could cause a false positive. - [Petr Písař brought this change] Pass password to OpenSSL engine by user interface Recent OpenSSL uses user interface abstraction to negotiate access to private keys in the cryprographical engines. An OpenSSL application is expected to implement the user interface. Otherwise a default one provided by OpenSSL (interactive standard I/O) will be used and the aplication will have no way how to pass a password to the engine. Longer-desc: http://curl.haxx.se/mail/lib-2013-08/0265.html - urlglob: improved error messages and column number on bad use Introduce a convenience macro and keep of the column better so that it can point out the offending column better. Updated test 75 accordingly. - urlglob: avoid error code translation By using the correct values from the start we don't have to translate them! - urlglob: avoid NULL pointer dereference Thanks to clang-analyzer - [Gisle Vanem brought this change] http2: use correct include for snprintf Using the first little merge of nghttp2 into libcurl, I stumbeled on the missing 'snprintf' in MSVCRT. Isn't this how we do it for other libcurl files? I.e. use 'curl_msnprintf' and not 'snprintf' directly: - --data: mention CRLF treatment when reading from file - [Geoff Beier brought this change] LDAP: fix bad free() when URL parsing failed When an error occurs parsing an LDAP URL, The ludp->lud_attrs[i] entries could be freed even though they sometimes point to data within an allocated area. This change introduces a lud_attrs_dup[] array for the duplicated string pointers, and it removes the unused lud_exts array. Bug: http://curl.haxx.se/mail/lib-2013-08/0209.html Nick Zitzmann (5 Sep 2013) - darwinssl: add support for PKCS#12 files for client authentication I also documented the fact that the OpenSSL engine also supports them. Daniel Stenberg (5 Sep 2013) - symbols: added HTTP2 symbols and sorted list CURL_HTTP_VERSION_2_0 and CURL_VERSION_HTTP2 are new - configure: add HTTP2 as a curl-config --feature output Fixes the test 1014 failure - curl: unbreak --http1.0 again I broke it in 2eabb7d590 - SASL: fix compiler warnings comparison between signed and unsigned integer expressions suggest parentheses around '&&' within '||' (twice) - curl: add --http1.1 and --http2.0 options - Curl_setopt: refuse CURL_HTTP_VERSION_2_0 if built without support - http2: add http2.[ch] and add nghttp2 version output - curl -V: output HTTP2 as a feature if present - curl.h: add CURL_VERSION_HTTP2 as a feature It isn't added as a separate protocol as HTTP2 will be done over HTTP:// URLs that can be upgraded to HTTP2 if the server supports it as well. Steve Holme (4 Sep 2013) - imap/smtp: Fixed incorrect SASL mechanism selection with XOAUTH2 servers XOAUTH2 would be selected in preference to LOGIN and PLAIN if the IMAP or SMTP server advertised support for it even though a user's password was supplied but bearer token wasn't. Modified the selection logic so that XOAUTH2 will only be selected if the server supports it and A) The curl user/libcurl programmer has specifically asked for XOAUTH via the ;AUTH=XOAUTH login option or 2) The bearer token is specified. Obviously if XOAUTH is asked for via the login option but no token is specified the user will receive a authentication failure which makes more sense than no known authentication mechanisms supported! Daniel Stenberg (4 Sep 2013) - curl.h: added CURL_HTTP_VERSION_2_0 Initial library considerations documented in lib/README.http2 - configure: added --with-nghttp2 - acinclude: fix --without-ca-path when cross-compiling The commit 7b074a460b64811 to CURL_CHECK_CA_BUNDLE in 7.31 (don't check for paths when cross-compiling) causes --without-ca-path to no longer works when cross-compiling, since ca and capath only ever get set to "no" when not cross-compiling, I attach a patch that works for me. Also in the cross-compilation case, no ca-path seems to be a better default (IMVHO) than empty ca-path. Bug: http://curl.haxx.se/bug/view.cgi?id=1273 Patch-by: Stefan Neis Steve Holme (2 Sep 2013) - lib1512.c: Fixed compilation warning An enumerated type is mixed with another type. ...as well as a small coding style error. Guenter Knauf (1 Sep 2013) - Killed warning 'res' might be used uninitialized. Steve Holme (1 Sep 2013) - url.c: Fixed compilation warning An enumerated type is mixed with another type - easy.c: Fixed compilation warning warning: `code' might be used uninitialized in this function Daniel Stenberg (31 Aug 2013) - -x: rephrased the --proxy section somewhat Steve Holme (31 Aug 2013) - tests: Added test for IMAP CHECK command - ftpserver.pl: Added support for the IMAP CHECK command Guenter Knauf (31 Aug 2013) - Removed reference to krb4.c. Steve Holme (31 Aug 2013) - ftpserver.pl: Corrected flawed logic in commit 1ca6ed7b75cad0 - imap: Fixed response check for EXPUNGE command - ftpserver.pl: Added argument check to IMAP command handlers Added BAD argument check to the following IMAP command handlers: APPEND, STORE, LIST, EXAMINE, STATUS and SEARCH - ftpserver.pl: More whitespace corrections LIST_imap() had a second level of indentation at 9 characters and not 8. - ftpserver.pl: Small correction tidy up Corrected some IMAP variable names and whitespace issues. - [Kyle L. Huff brought this change] docs: Added documentation for CURLOPT_BEARER - [Kyle L. Huff brought this change] curl.1: Add usage of '--bearer' option - tests: Added tests for IMAP CREATE, DELETE and RENAME commands Daniel Stenberg (30 Aug 2013) - ftpserver: Bareword "to_mailbox" not allowed Added missing $ Steve Holme (30 Aug 2013) - ftpserver.pl: Added support for IMAP CREATE, DELETE and RENAME commands Daniel Stenberg (29 Aug 2013) - FTP: fix getsock during DO_MORE state ... when doing upload it would return the wrong values at times. This commit attempts to cleanup the mess. Bug: http://curl.haxx.se/mail/lib-2013-08/0109.html Reported-by: Mike Mio - curl_multi_remove_handle: allow multiple removes When removing an already removed handle, avoid that to ruin the internals and just return OK instead. Steve Holme (29 Aug 2013) - ftpserver.pl: Updated IMAP EXAMINE handler to use dynamic test data Daniel Stenberg (29 Aug 2013) - unit1304: include memdebug and free everything correctly - Curl_parsenetrc: document that the arguments must be allocated - easy: rename struct monitor to socketmonitor 'struct monitor', introduced in 6cf8413e, already exists in an IRIX header file (sys/mon.h) which gets included via various standard headers by lib/easy.c cc-1101 cc: ERROR File = ../../curl/lib/easy.c, Line = 458 "monitor" has already been declared in the current scope. Reported-by: Tor Arntsen Steve Holme (29 Aug 2013) - ftpserver.pl: Added SELECT check to IMAP FETCH and STORE handlers - ftpserver.pl: Corrected accidental move of logmsg() call Corrected the call to logmsg() in the IMAP SEARCH handler from commit 4ae7b7ea691497 as it should have been outputting the what argument and not the test number. Daniel Stenberg (28 Aug 2013) - ftpserver: add missing '}' from 4ae7b7ea69149 Steve Holme (28 Aug 2013) - ftpserver.pl: Added SELECT check to IMAP SEARCH command - ftpserver.pl: Fixed IMAP SEARCH command Daniel Stenberg (28 Aug 2013) - bump: next release is 7.33.0 due to added features - symbols-in-versions: add CURLOPT_XOAUTH2_BEARER Steve Holme (28 Aug 2013) - tests: Added test for IMAP SEARCH command Daniel Stenberg (28 Aug 2013) - valgrind.supp: fix for regular curl_easy_perform too When we introduced curl_easy_perform_ev, this got a slightly modified call trace. Without this, test 165 causes a false positive valgrind error. - valgrind.supp: add the event-based call stack-trace too Without this, test 165 triggers a valgrind error when ran with curl_easy_perform_ev - multi_socket: improved 100-continue timeout handling When waiting for a 100-continue response from the server, the Curl_readwrite() will refuse to run if called until the timeout has been reached. We timeout code in multi_socket() allows code to run slightly before the actual timeout time, so for test 154 it could lead to the function being executed but refused in Curl_readwrite() and then the application would just sit idling forever. This was detected with runtests.pl -e on test 154. Steve Holme (27 Aug 2013) - ftpserver.pl: Added support for IMAP SEARCH command - tool_operate.c: Fixed compilation warning warning: implicit declaration of function 'checkpasswd' - curl: Moved check for password out of get parameter loop Moved the calls to checkpasswd() out of the getparameter() function which allows for any related arguments to be specified on the command line before or after --user (and --proxy-user). For example: --bearer doesn't need to be specified before --user to prevent curl from asking for an unnecessary password as is the case with commit e7dcc454c67a2f. - RELEASE-NOTES: synced with acf59be7f09a7 - [Kyle L. Huff brought this change] curl: added --bearer option to help Added the --bearer option to the help output - [Kyle L. Huff brought this change] curl: added basic SASL XOAUTH2 support Added the ability to specify an XOAUTH2 bearer token [RFC6750] via the --bearer option. Example usage: curl --url "imaps://imap.gmail.com:993/INBOX/;UID=1" --ssl-reqd --bearer ya29.AHES6Z...OMfsHYI --user username@example.com - tool_urlglob.c: Fixed compiler warnings warning: 'variable' may be used uninitialized in this function Daniel Stenberg (26 Aug 2013) - security.h: rename to curl_sec.h to avoid name collision I brought back security.h in commit bb5529331334e. As we actually already found out back in 2005 in commit 62970da675249, the file name security.h causes problems so I renamed it curl_sec.h instead. - runtests.pl: allow -vc point to a separate curl binary to verify with The specified curl binary will then be used to verify the running server(s) instead of the development version. This is very useful in some cases when the development version fails to verify correctly as then the test case may not run at all. The actual test will still be run with the "normal" curl executable (unless the test case specifies something differently). Steve Holme (26 Aug 2013) - [Kyle L. Huff brought this change] smtp: added basic SASL XOAUTH2 support Added the ability to use an XOAUTH2 bearer token [RFC6750] with SMTP for authentication using RFC6749 "OAuth 2.0 Authorization Framework". The bearer token is expected to be valid for the user specified in conn->user. If CURLOPT_XOAUTH2_BEARER is defined and the connection has an advertised auth mechanism of "XOAUTH2", the user and access token are formatted as a base64 encoded string and sent to the server as "AUTH XOAUTH2 ". - [Kyle L. Huff brought this change] imap: added basic SASL XOAUTH2 support Added the ability to use an XOAUTH2 bearer token [RFC6750] with IMAP for authentication using RFC6749 "OAuth 2.0 Authorization Framework". The bearer token is expected to be valid for the user specified in conn->user. If CURLOPT_XOAUTH2_BEARER is defined and the connection has an advertised auth mechanism of "XOAUTH2", the user and access token are formatted as a base64 encoded string and sent to the server as "A001 AUTHENTICATE XOAUTH2 ". - security.h: Fixed compilation warning ISO C forbids forward references to 'enum' types Daniel Stenberg (26 Aug 2013) - KNOWN_BUGS: refer to bug numbers with the existing number series The old numbers would still redirect but who knows for how long... Steve Holme (25 Aug 2013) - [Kyle L. Huff brought this change] options: added basic SASL XOAUTH2 support Added the ability to specify an XOAUTH2 bearer token [RFC6750] via the option CURLOPT_XOAUTH2_BEARER for authentication using RFC6749 "OAuth 2.0 Authorization Framework". - [Kyle L. Huff brought this change] sasl: added basic SASL XOAUTH2 support Added the ability to generated a base64 encoded XOAUTH2 token containing: "user=^Aauth=Bearer ^A^A" as per RFC6749 "OAuth 2.0 Authorization Framework". Daniel Stenberg (25 Aug 2013) - FTP: remove krb4 support We've announced this pending removal for a long time and we've repeatedly asked if anyone would care or if anyone objects. Nobody has objected. It has probably not even been working for a good while since nobody has tested/used this code recently. The stuff in krb4.h that was generic enough to be used by other sources is now present in security.h - easy: define away easy_events() for non-debug builds - FAQ: editorial updates Several language fixes. Several reformats that should make the HTML generation of this document look better. Reported-by: Dave Thompson - RELEASE-NOTES: synced with 22adb46a32bee - multi: move on from STATE_DONE faster Make sure we always return CURLM_CALL_MULTI_PERFORM when we reach CURLM_STATE_DONE since the state is transient and it can very well continue executing as there is nothing to wait for. Bug: http://curl.haxx.se/mail/lib-2013-08/0211.html Reported-by: Yi Huang - curl.h: name space pollution by "enum type" Renamed to "enum curl_khtype" now. Will break compilation for programs that rely on the enum name. Bug: https://github.com/bagder/curl/pull/76 Reported-by: Shawn Landden - TFTP: make the CURLOPT_LOW_SPEED* options work ... this also makes sure that the progess callback gets called more often during TFTP transfers. Added test 1238 to verify. Bug: http://curl.haxx.se/bug/view.cgi?id=1269 Reported-by: Jo3 - tftpd: support "writedelay" within - tftpd: convert 6 global variables into local ones - [Gisle Vanem brought this change] curl_easy_perform_ev: make it CURL_EXTERN I build curl.exe (using MingW) with '-DCURLDEBUG' and by importing from libcurl.dll. Which means the new curl_easy_perform_ev() must be exported from libcurl.dll. - CURLM_ADDED_ALREADY: new error code Doing curl_multi_add_handle() on an easy handle that is already added to a multi handle now returns this error code. It previously returned CURLM_BAD_EASY_HANDLE for this condition. - multi_init: moved init code here from add_handle The closure_handle is "owned" by the multi handle and it is unconditional so the setting up of it should be in the Curl_multi_handle function rather than curl_multi_add_handle. - multi: remove dns cache creation code from *add_handle As it is done unconditionally in multi_init() this code will never run! - curl_easy_perform_ev: debug/test function This function is meant to work *exactly* as curl_easy_perform() but will use the event-based libcurl API internally instead of curl_multi_perform(). To avoid relying on an actual event-based library and to not use non-portable functions (like epoll or similar), there's a rather inefficient emulation layer implemented on top of Curl_poll() instead. There's currently some convenience logging done in curl_easy_perform_ev which helps when tracking down problems. They may be suitable to remove or change once things seem to be fine enough. curl has a new --test-event option when built with debug enabled that then uses curl_easy_perform_ev() instead of curl_easy_perform(). If built without debug, using --test-event will only output a warning message. NOTE: curl_easy_perform_ev() is not part if the public API on purpose. It is only present in debug builds of libcurl and MUST NOT be considered stable even then. Use it for libcurl-testing purposes only. runtests.pl now features an -e command line option that makes it use --test-event for all curl command line tests. The man page is updated. - [Gisle Vanem brought this change] transfer: the recent sessionhandle change broke CURL_DOES_CONVERSIONS - test1237: verify 1000+ letter user name + passwords - [Jonathan Nieder brought this change] url: handle arbitrary-length username and password before '@' libcurl quietly truncates usernames, passwords, and options from before an '@' sign in a URL to 255 (= MAX_CURL_PASSWORD_LENGTH - 1) characters to fit in fixed-size buffers on the stack. Allocate a buffer large enough to fit the parsed fields on the fly instead to support longer passwords. After this change, there are no more uses of MAX_CURL_OPTIONS_LENGTH left, so stop defining that constant while at it. The hardcoded max username and password length constants, on the other hand, are still used in HTTP proxy credential handling (which this patch doesn't touch). Reported-by: Colby Ranger - [Jonathan Nieder brought this change] url: handle exceptional cases first in parse_url_login() Instead of nesting "if(success)" blocks and leaving the reader in suspense about what happens in the !success case, deal with failure cases early, usually with a simple goto to clean up and return from the function. No functional change intended. The main effect is to decrease the indentation of this function slightly. - [Jonathan Nieder brought this change] Curl_setopt: handle arbitrary-length username and password libcurl truncates usernames, passwords, and options set with curl_easy_setopt to 255 (= MAX_CURL_PASSWORD_LENGTH - 1) characters. This doesn't affect the return value from curl_easy_setopt(), so from the caller's point of view, there is no sign anything strange has happened, except that authentication fails. For example: # Prepare a long (300-char) password. s=0123456789; s=$s$s$s$s$s$s$s$s$s$s; s=$s$s$s; # Start a server. nc -l -p 8888 | tee out & pid=$! # Tell curl to pass the password to the server. curl --user me:$s http://localhost:8888 & sleep 1; kill $pid # Extract the password. userpass=$( awk '/Authorization: Basic/ {print $3}' setup_connection. Some protocol handlers had to get this function added. 2 - always free at the end of a request. This is also an attempt to keep less memory in the handle after it is completed. - version number: bump to 7.32.1 for now Start working on the next version and up some counters. Version 7.32.0 (11 Aug 2013) Daniel Stenberg (11 Aug 2013) - THANKS: added contributors from the 7.32.0 release notes - [Fabian Keil brought this change] test1228: add 'HTTP proxy' to the keywords - [Fabian Keil brought this change] tests: add keywords for a couple of FILE tests - [Fabian Keil brought this change] tests: add 'FAILURE' keywords to tests 1409 and 1410 - [Fabian Keil brought this change] tests: add keywords for a couple of HTTP tests - [Fabian Keil brought this change] tests: add keywords for a couple of FTP tests - [Fabian Keil brought this change] test1511: consistently terminate headers with CRLF - DISABLED: shut of test 1512 for now It shows intermittent failures and I haven't been able to track them down yet. Disable this test for now. - curl_multi_add_handle.3: ... that timer callback is for event-based - comments: remove old and wrong multi/easy interface statements - curl_multi_add_handle.3: mention the CURLMOPT_TIMERFUNCTION use - [John E. Malmberg brought this change] KNOWN_BUGS: 22 and 57 have been fixed and committed - RELEASE-NOTES: synced with d20def20462e7 - global dns cache: fix memory leak The take down of the global dns cache didn't take CURLOPT_RESOLVE names into account. - global dns cache: didn't work [regression] CURLOPT_DNS_USE_GLOBAL_CACHE broke in commit c43127414d89ccb (been broken since the libcurl 7.29.0 release). While this option has been documented as deprecated for almost a decade and nobody even reported this bug, it should remain functional. Added test case 1512 to verify Yang Tse (8 Aug 2013) - [John Malmberg brought this change] packages/vms: update VMS build files VMS modified files either missing from a previous commit and changes to remove references to CVS repositories. Daniel Stenberg (8 Aug 2013) - FTP: renamed several local functions The previous naming scheme ftp_state_post_XXXX() wasn't really helpful as it wasn't always immediately after 'xxxx' and it wasn't easy to understand what it does based on such a name. This new one is instead ftp_state_yyyy() where yyyy describes what it does or sends. - mk-ca-bundle.1: don't install on make install Since the mk-ca-bundle tool itself isn't installed with make install, there's no point in installing its documentation. Bug: http://curl.haxx.se/mail/lib-2013-08/0057.html Reported-by: Guenter Knauf Yang Tse (7 Aug 2013) - packages/vms/Makefile.am: add latest file additions to EXTRA_DIST - [John Malmberg brought this change] Building_vms_pcsi_kit These are the files needed to build VMS distribution packages known as PCSI kits. Also minor update to the existing files, mainly to the documentation and file clean up code. Daniel Stenberg (6 Aug 2013) - LIBCURL-STRUCTS: new document This is the first version of this new document, detailing the seven perhaps most important internal structs in libcurl source code: 1.1 SessionHandle 1.2 connectdata 1.3 Curl_multi 1.4 Curl_handler 1.5 conncache 1.6 Curl_share 1.7 CookieInfo - CONTRIBUTE: minor language polish - FTP: when EPSV gets a 229 but fails to connect, retry with PASV This is a regression as this logic used to work. It isn't clear when it broke, but I'm assuming in 7.28.0 when we went all-multi internally. This likely never worked with the multi interface. As the failed connection is detected once the multi state has reached DO_MORE, the Curl_do_more() function was now expanded somewhat so that the ftp_do_more() function can request to go "back" to the previous state when it makes another attempt - using PASV. Added test case 1233 to verify this fix. It has the little issue that it assumes no service is listening/accepting connections on port 1... Reported-by: byte_bucket in the #curl IRC channel Nick Zitzmann (5 Aug 2013) - md5: remove use of CommonCrypto-to-OpenSSL macros for the benefit of Leopard For some reason, OS X 10.5's GCC suddenly stopped working correctly with macros that change MD5_Init etc. in the code to CC_MD5_Init etc., so I worked around this by removing use of the macros and inserting static functions that just call CommonCrypto's implementations of the functions instead. Guenter Knauf (5 Aug 2013) - Simplify check for trusted certificates. This changes the previous check for untrusted certs to a check for certs explicitely marked as trusted. The change is backward-compatible (tested with certdata.txt v1.80). Daniel Stenberg (5 Aug 2013) - configure: warn on bad env variable use, don't error Use XC_CHECK_BUILD_FLAGS instead XC_CHECK_USER_FLAGS. - Revert "configure: don't error out on variable confusions, just warn" This reverts commit 6b27703b5f525eccdc0a8409f51de8595c75132a. - formadd: wrong pointer for file name when CURLFORM_BUFFERPTR used The internal function that's used to detect known file extensions for the default Content-Type got the the wrong pointer passed in when CURLFORM_BUFFER + CURLFORM_BUFFERPTR were used. This had the effect that strlen() would be used which could lead to an out-of-bounds read (and thus segfault). In most cases it would only lead to it not finding or using the correct default content-type. It also showed that test 554 and test 587 were testing for the previous/wrong behavior and now they're updated as well. Bug: http://curl.haxx.se/bug/view.cgi?id=1262 Reported-by: Konstantin Isakov Guenter Knauf (4 Aug 2013) - Skip more untrusted certificates. Christian Heimes brought to our attention that the certdata.txt format has recently changed [1], causing ca-bundle.crt created with mk-ca-bundle.[pl|vbs] to include untrusted certs. [1] http://lists.debian.org/debian-release/2012/11/msg00411.html Daniel Stenberg (4 Aug 2013) - configure: don't error out on variable confusions, just warn - configure: rephrase the notice in _XC_CHECK_VAR_* Instead of claiming it is an error, we call it a "note" to reduce the severity level. But the following text now says the [variable] "*should* only be used to specify"... instead of previously having said "may". - multi: remove data->state.current_conn struct field Not needed - multi: remove the one_easy struct field Since the merge of SessionHandle with Curl_one_easy, this indirection isn't used anymore. - multi: rename all Curl_one_easy to SessionHandle - multi: remove the multi_pos struct field Since Curl_one_easy is really a SessionHandle now, this indirection doesn't exist anymore. - multi: remove easy_handle struct field It isn't needed anymore - multi: remove 'Curl_one_easy' struct, phase 1 The motivation for having a separate struct that keep track of an easy handle when using the multi handle was removed when we switched to always using the multi interface internally. Now they were just two separate struct that was always allocated for each easy handle. This first step just moves the Curl_one_easy struct members into the SessionHandle struct and hides this somehow (== keeps the source code changes to a minimum) by defining Curl_one_easy to SessionHandle The biggest changes in this commit are: 1 - the linked list of easy handles had to be changed somewhat due to the new struct layout. This made the main linked list pointer get renamed to 'easyp' and there's also a new pointer to the last node, called easylp. It is no longer circular but ends with ->next pointing to NULL. New nodes are still added last. 2 - easy->state is now called easy->mstate to avoid name collision Steve Holme (2 Aug 2013) - Revert "DOCS: Added IMAP URL example for listing new messages" This reverts commit 82ab5f1b0c7c3f as this was the wrong place to document the complexity of IMAP URLs and Custom Requests. - DOCS: Added IMAP URL example for listing new messages In addition to listing the folder contents, in the URL examples, added an example to list the new messages waiting in the user's inbox. Yang Tse (1 Aug 2013) - packages/vms/Makefile.am: add latest file additions to EXTRA_DIST - [John Malmberg brought this change] Add in the files needed to build libcurl shared images on VMS. Update the packages/vms/readme file to be current. Also some files for the GNV based build were either missing or needed an update. curl_crtl_init.c is a special file that is run before main() to set up the proper C runtime behavior. generate_vax_transfer.com generates the VAX transfer vector modules from the gnv_libcurl_symbols.opt file. gnv_conftest.c_first is a helper file needed for configure scripts to come up with the expected answers on VMS. gnv_libcurl_symbols.opt is the public symbols for the libcurl shared image. gnv_link_curl.com builds the shared libcurl image and rebuilds other programs to use it. macro32_exactcase.patch is a hack to make a local copy of the VMS Macro32 assembler case sensitive, which is needed to build the VAX transfer modules. report_openssl_version.c is a tool for help verify that the libcurl shared image is being built for a minium version of openssl. - curl: second follow-up for commit 5af2bfb9 Display progress-bar unconditionally on first call - curl: follow-up for commit 5af2bfb9 Use tvnow() and tvdiff() to avoid introducing new linkage issues Daniel Stenberg (31 Jul 2013) - curl: --progress-bar max update frequency now at 5Hz - curl: make --progress-bar update the line less frequently Also, use memset() instead of a lame loop. The previous logic that tried to avoid too many updates were very ineffective for really fast transfers, as then it could easily end up doing hundreds of updates per second that would make a significant impact in transfer performance! Bug: http://curl.haxx.se/mail/archive-2013-07/0031.html Reported-by: Marc Doughty Nick Zitzmann (30 Jul 2013) - darwinssl: added LFs to some strings passed into infof() (This doesn't need to appear in the release notes.) I noticed a few places where infof() was called, and there should've been an LF at the end of the string, but there wasn't. - darwinssl: fix build error in crypto authentication under Snow Leopard It turns out Snow Leopard not only has SecItemCopyMatching() defined in a header not included by the omnibus header, but it won't work for our purposes, because searching for SecIdentityRef objects wasn't added to that API until Lion. So we now use the old SecKeychainSearch API instead if the user is building under, or running under, Snow Leopard. Bug: http://sourceforge.net/p/curl/bugs/1255/ Reported by: Edward Rudd - md5 & metalink: use better build macros on Apple operating systems Previously we used __MAC_10_X and __IPHONE_X to mark digest-generating code that was specific to OS X and iOS. Now we use __MAC_OS_X_VERSION_MAX_ALLOWED and __IPHONE_OS_VERSION_MAX_ALLOWED instead of those macros. Bug: http://sourceforge.net/p/curl/bugs/1255/ Reported by: Edward Rudd Yang Tse (29 Jul 2013) - tool_operhlp.c: fix add_file_name_to_url() OOM handling - tool_operate.c: fix brace placement for vi/emacs delimiter matching - tool_operate.c: move header inclusion location Daniel Stenberg (29 Jul 2013) - RELEASE-NOTES: synced with b5478a0e033e7 - curl_easy_pause: on unpause, trigger mulit-socket handling When the multi-socket API is used, we need the handle to be checked again when it gets unpaused. Bug: http://curl.haxx.se/mail/lib-2013-07/0239.html Reported-by: Justin Karneges - [John E. Malmberg brought this change] curl_formadd: fix file upload on VMS For the standard VMS text file formats, VMS needs to read the file to get the actual file size. For the standard VMS binary file formats, VMS needs a special format of fopen() call so that it stops reading at the logical end of file instead of at the end of the blocks allocated to the file. I structured the patch this way as I was not sure about changing the structures or parameters to the routines, but would prefer to only call the stat() function once and pass the information to where the fopen() call is made. Bug: https://sourceforge.net/p/curl/bugs/758/ - formadd: CURLFORM_FILECONTENT wrongly rejected some option combos The code for CURLFORM_FILECONTENT had its check for duplicate options wrong so that it would reject CURLFORM_PTRNAME if used in combination with it (but not CURLFORM_COPYNAME)! The flags field used for this purpose cannot be interpreted that broadly. Bug: http://curl.haxx.se/mail/lib-2013-07/0258.html Reported-by: Byrial Jensen Yang Tse (25 Jul 2013) - packages/vms/Makefile.am: add latest file additions to EXTRA_DIST - [John E. Malmberg brought this change] VMS: intial set of files to allow building using GNV toolkit. - string formatting: fix too many arguments for format - string formatting: fix zero-length printf format string - easy.c: curl_easy_getinfo() fix va_start/va_end matching - imap.c: imap_sendf() fix va_start/va_end matching - string formatting: fix 15+ printf-style format strings Patrick Monnerat (24 Jul 2013) - OS400: sync ILE/RPG binding with current curl.h Yang Tse (24 Jul 2013) - string formatting: fix 25+ printf-style format strings Daniel Stenberg (23 Jul 2013) - Makefile.am: use LDFLAGS as well when linking libcurl Linking on Solaris 10 x86 with Sun Studio 12 failed when we upgraded automake for the release builds. Bug: http://curl.haxx.se/bug/view.cgi?id=1217 Reported-by: Dagobert Michelsen - [Fabian Keil brought this change] url.c: Fix dot file path cleanup when using an HTTP proxy Previously the path was cleaned, but the URL wasn't properly updated. - [Fabian Keil brought this change] tests: test1232 verifies dotdot removal from path with proxy - [Fabian Keil brought this change] dotdot.c: Fix a RFC section number in a comment for Curl_dedotdotify() - [John E. Malmberg brought this change] build_vms.com: fix debug and float options In the reorganization of the build_vms.com the debug and float options were not fixed up correctly. - [John E. Malmberg brought this change] curl: fix upload of a zip file in OpenVMS Two fixes: 1. Force output file format to be stream-lf so that partial downloads can be continued. This should have minor impact as if the file does not exist, it was created with stream-lf format. The only time this was an issue is if there was already an existing file with a different format. 2. Fix file uploads are now fixed. a. VMS binary files such as ZIP archives are now uploaded correctly. b. VMS text files are read once to get the correct size and then converted to line-feed terminated records as they are read into curl. The default VMS text formats do not contain either line-feed or carriage-return terminated records. Those delimiters are added by the operating system file read calls if the application requests them. Bug: http://curl.haxx.se/bug/view.cgi?id=496 Yang Tse (22 Jul 2013) - libtest: fix data type of some *_setopt() 'long' arguments - curl: fix symbolic names for CURL_NETRC_* enum in --libcurl output - curl: fix symbolic names for CURLUSESSL_* enum in --libcurl output - tool_operate.c: fix passing curl_easy_setopt long arg on some x64 ABIs We no longer pass our 'bool' data type variables nor constants as an argument to my_setopt(), instead we use proper 1L or 0L values. This also fixes macro used to pass string argument for CURLOPT_SSLCERT, CURLOPT_SSLKEY and CURLOPT_EGDSOCKET using my_setopt_str() instead of my_setopt(). This also casts enum or int argument data types to long when passed to my_setopt_enum(). Daniel Stenberg (21 Jul 2013) - curl_multi_wait: fix revents Commit 6d30f8ebed34e7276 didn't work properly. First, it used the wrong array index, but this fix also: 1 - only does the copying if indeed there was any activity 2 - makes sure to properly translate between internal and external bitfields, which are not guaranteed to match Reported-by: Evgeny Turnaev - RELEASE-NOTES: synced with d529f3882b9bca - curl_easy_perform: gradually increase the delay time Instead of going 50,100,150 etc millisecond delay time when nothing has been found to do or wait for, we now start lower and double each loop as in 4,8,16,32 etc. This lowers the minimum wait without sacrifizing the longer wait too much with unnecessary CPU cycles burnt. Bug: http://curl.haxx.se/mail/lib-2013-07/0103.html Reported-by: Andreas Malzahn - ftp_do_more: consider DO_MORE complete when server connects back In the case of an active connection when ftp_do_more() detects that the server has connected back, it must make sure to mark it as complete so that the multi_runsingle() function will detect this and move on to the next state. Bug: http://curl.haxx.se/mail/lib-2013-07/0115.html Reported-by: Clemens Gruber Yang Tse (19 Jul 2013) - Makefile.b32: Borland makefile adjustments. Tested with BCC 5.5.1 - WIN32 MemoryTracking: require UNICODE for wide strdup code support Daniel Stenberg (18 Jul 2013) - CURLOPT_XFERINFOFUNCTION: introducing a new progress callback CURLOPT_XFERINFOFUNCTION is now the preferred progress callback function and CURLOPT_PROGRESSFUNCTION is considered deprecated. This new callback uses pure 'curl_off_t' arguments to pass on full resolution sizes. It otherwise retains the same characteristics: the same call rate, the same meanings for the arguments and the return code is used the same way. The progressfunc.c example is updated to show how to use the new callback for newer libcurls while supporting the older one if built with an older libcurl or even built with a newer libcurl while running with an older. Yang Tse (18 Jul 2013) - Reinstate "WIN32 MemoryTracking: track wcsdup() _wcsdup() and _tcsdup() usage". This reverts commit 7ed25cc, reinstating commit 8ec2cb5. As of 18-jul-2013 we still do have code in libcurl that makes use of these memory functions. Commit 8ec2cb5 comment still applies and is yet valid. These memory functions are solely used in Windows builds, so all related code is protected with '#ifdef WIN32' preprocessor conditional compilation directives. Specifically, wcsdup() _wcsdup() are used when building a Windows target with UNICODE and USE_WINDOWS_SSPI preprocessor symbols defined. This is the case when building a Windows UNICODE target with Windows native SSL/TLS support enabled. Realizing that wcsdup() _wcsdup() are used is a bit tricky given that usage of these is hidden behind _tcsdup() which is MS way of dealing with code that must tolerate UNICODE and non-UNICODE compilation. Additionally, MS header files and those compatible from other compilers use this preprocessor conditional compilation directive in order to select at compilation time whether 'wide' or 'ansi' MS API functions are used. Without this code, Windows build targets with Windows native SSL/TLS support enabled and MemoryTracking support enabled misbehave in tracking memory usage, regardless of being a UNICODE enabled build or not. - xc-am-iface.m4: comments refinement - configure: fix 'subdir-objects' distclean related issue See XC_AMEND_DISTCLEAN comments for details. Daniel Stenberg (18 Jul 2013) - [Evgeny Turnaev brought this change] curl_multi_wait: set revents for extra fds Pass back the revents that happened for the user-provided file descriptors. - [Ben Greear brought this change] asyn-ares: Don't blank ares servers if none configured. Best to just let c-ares use it's defaults if none are configured in (lib)curl. Signed-off-by: Ben Greear - [Sergei Nikulov brought this change] cmake: Fix for MSVC2010 project generation Fixed issue with static build for MSVC2010. After some investigation I've discovered known issue http://public.kitware.com/Bug/view.php?id=11240 When .rc file is linked to static lib it fails with following linker error LINK : warning LNK4068: /MACHINE not specified; defaulting to X86 file.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86' Fix add target property /MACHINE: for MSVC generation. Also removed old workarounds - it caused errors during msvc build. Bug: http://curl.haxx.se/mail/lib-2013-07/0046.html - mk-ca-bundle.1: point out certdata.txt format docs Yang Tse (16 Jul 2013) - slist.c: Curl_slist_append_nodup() OOM handling fix Daniel Stenberg (16 Jul 2013) - test1414: FTP PORT download without SIZE support Yang Tse (16 Jul 2013) - tests/Makefile.am: add configurehelp.pm to DISTCLEANFILES Patrick Monnerat (15 Jul 2013) - curl_slist_append(): fix error detection - slist.c: fix indentation - OS400: new SSL backend GSKit - OS400: add slist and certinfo EBCDIC support - config-os400.h: enable system strdup(), strcmpi(), etc. - x509asn1.c,x509asn1.h: new module to support ASN.1/X509 parsing & info extract Use from qssl backend - ssluse.c,sslgen.c,sslgen.h: move certinfo support to generic SSL - Merge branch 'master' of github.com:bagder/curl Merge for resync - slist.c, slist.h, cookie.c: new internal procedure Curl_slist_append_nodup() Yang Tse (15 Jul 2013) - sslgen.c: fix Curl_rand() compiler warning Use simple seeding method upon RANDOM_FILE seeding method failure. - sslgen.c: fix unreleased Curl_rand() infinite recursion Daniel Stenberg (14 Jul 2013) - [Dave Reisner brought this change] src/tool: allow timeouts to accept decimal values Implement wrappers around strtod to convert the user argument to a double with sane error checking. Use this to allow --max-time and --connect-timeout to accept decimal values instead of strictly integers. The manpage is updated to make mention of this feature and, additionally, forewarn that the actual timeout of the operation can vary in its precision (particularly as the value increases in its decimal precision). - [Dave Reisner brought this change] curl.1: fix long line, found by checksrc.pl - [Dave Reisner brought this change] src/tool_paramhlp: try harder to catch negatives strto* functions happily chomp off leading whitespace, so simply checking for str[0] can lead to false negatives. Do the full parse and check the out value instead. - [John E. Malmberg brought this change] build_vms.com: detect and use zlib shared image Update the build_vms.com to detect and use zlib shared image installed by the ZLIB kit produced by Jean-Francois Pieronne, and the also the future ZLIB 1.2.8 kit in addition to the older ZLIB kits. Also fix the indentation to match one of the common standards used for VMS DCL command files and removed the hard tab characters. Tested on OpenVMS 8.4 Alpha and IA64, and OpenVMS 7.3 VAX. Yang Tse (14 Jul 2013) - url.c: fix parse_url_login() OOM handling - http_digest.c: SIGSEGV and OOM handling fixes - url.c: fix parse_login_details() OOM handling - [John E. Malmberg brought this change] setup-vms.h: sk_pop symbol tweak Newer versions of curl are referencing a sk_pop symbol while the HP OpenSSL library has the symbol in uppercase only. - getinfo.c: fix enumerated type mixed with another type - test 1511: fix enumerated type mixed with another type - url.c: fix SIGSEGV - dotdot.c: fix global declaration shadowing - easy.c: fix global declaration shadowing Kamil Dudka (9 Jul 2013) - Revert "curl.1: document the --time-cond option in the man page" This reverts commit 3a0e931fc715a80004958794a96b12cf90503f99 because the documentation of --time-cond was duplicated by mistake. Reported by: Dave Reisner - curl.1: document the --sasl-ir option in the man page - curl.1: document the --post303 option in the man page - curl.1: document the --time-cond option in the man page Yang Tse (9 Jul 2013) - configure: automake 1.14 compatibility tweak (use XC_AUTOMAKE) - xc-am-iface.m4: provide XC_AUTOMAKE macro Guenter Knauf (8 Jul 2013) - Added winssl-zlib target to VC builds. - Synced Makefile.vc6 with recent changes. Issue posted to the list by malinowsky AT FTW DOT at. - Added libmetalink URL; added Android versions. Dan Fandrich (3 Jul 2013) - examples: Moved usercertinmem.c to COMPLICATED_EXAMPLES This prevents it from being built during a "make check" since it depends on OpenSSL. Nick Zitzmann (2 Jul 2013) - Merge branch 'master' of https://github.com/bagder/curl - darwinssl: SSLv2 connections are aborted if unsupported by the OS I just noticed that OS X no longer supports SSLv2. Other TLS engines return an error if the requested protocol isn't supported by the underlying engine, so we do that now for SSLv2 if the framework returns an error when trying to turn on SSLv2 support. (Note: As always, SSLv2 support is only enabled in curl when starting the app with the -2 argument; it's off by default. SSLv2 is really old and insecure.) Marc Hoersken (1 Jul 2013) - lib506.c: Fixed possible use of uninitialized variables Kamil Dudka (30 Jun 2013) - url: restore the functionality of 'curl -u :' This commit fixes a regression introduced in fddb7b44a79d78e05043e1c97e069308b6b85f79. Reported by: Markus Moeller Bug: http://curl.haxx.se/mail/archive-2013-06/0052.html Daniel Stenberg (25 Jun 2013) - digest: append the timer to the random for the nonce - digest: improve nonce generation Use the new improved Curl_rand() to generate better random nonce for Digest auth. - curl.1: fix typo in --xattr description Bug: http://curl.haxx.se/bug/view.cgi?id=1252 Reported-by: Jean-Noël Rouvignac - RELEASE-NOTES: synced with 365c5ba39591 The 10 first bug fixes for the pending release... - formpost: better random boundaries When doing multi-part formposts, libcurl used a pseudo-random value that was seeded with time(). This turns out to be bad for users who formpost data that is provided with users who then can guess how the boundary string will look like and then they can forge a different formpost part and trick the receiver. My advice to such implementors is (still even after this change) to not rely on the boundary strings being cryptographically strong. Fix your code and logic to not depend on them that much! I moved the Curl_rand() function into the sslgen.c source file now to be able to take advantage of the SSL library's random function if it provides one. If not, try to use the RANDOM_FILE for seeding and as a last resort keep the old logic, just modified to also add microseconds which makes it harder to properly guess the exact seed. The formboundary() function in formdata.c is now using 64 bit entropy for the boundary and therefore the string of dashes was reduced by 4 letters and there are 16 hex digits following it. The total length is thus still the same. Bug: http://curl.haxx.se/bug/view.cgi?id=1251 Reported-by: "Floris" - printf: make sure %x are treated unsigned When using %x, the number must be treated as unsigned as otherwise it would get sign-extended on for example 64bit machines and do wrong output. This problem showed when doing printf("%08x", 0xffeeddcc) on a 64bit host. - tests: add test1395 to the tarball - SIGPIPE: don't use 'data' in sigpipe restore Follow-up fix from 7d80ed64e43515. The SessionHandle may not be around to use when we restore the sigpipe sighandler so we store the no_signal boolean in the local struct to know if/how to restore. - TODO: 1.8 Modified buffer size approach Thoughts around buffer sizes and what might be possible to do... - c-ares: improve error message on failed resolve When the c-ares based resolver backend failed to resolve a name, it tried to show the name that failed from existing structs. This caused the wrong output and shown hostname when for example --interface [hostname] was used and that name resolving failed. Now we use the hostname used in the actual resolve attempt in the error message as well. Bug: http://curl.haxx.se/bug/view.cgi?id=1191 Reported-by: Kim Vandry - ossl_recv: check for an OpenSSL error, don't assume When we recently started to treat a zero return code from SSL_read() as an error we also got false positives - which primarily looks to be because the OpenSSL documentation is wrong and a zero return code is not at all an error case in many situations. Now ossl_recv() will check with ERR_get_error() to see if there is a stored error and only then consider it to be a true error if SSL_read() returned zero. Bug: http://curl.haxx.se/bug/view.cgi?id=1249 Reported-by: Nach M. S. Patch-by: Nach M. S. Nick Zitzmann (22 Jun 2013) - Merge branch 'master' of https://github.com/bagder/curl - darwinssl: fix crash that started happening in Lion Something (a recent security update maybe?) changed in Lion, and now it has changed SSLCopyPeerTrust such that it may return noErr but also give us a null trust, which caught us off guard and caused an eventual crash. Daniel Stenberg (22 Jun 2013) - SIGPIPE: ignored while inside the library ... and restore the ordinary handling again when it returns. This is done for curl_easy_perform() and curl_easy_cleanup() only for now - and only when built to use OpenSSL as backend as this is the known culprit for the spurious SIGPIPEs people have received. Bug: http://curl.haxx.se/bug/view.cgi?id=1180 Reported by: Lluís Batlle i Rossell - KNOWN_BUGS: #83 unable to load non-default openssl engines - test1396: invoke the correct test tool! This erroneously run unit test 1310 instead of 1396! Kamil Dudka (22 Jun 2013) - test1230: avoid using hard-wired port number ... to prevent failure when a non-default -b option is given - curl-config.in: replace tabs by spaces Nick Zitzmann (22 Jun 2013) - darwinssl: reform OS-specific #defines This doesn't need to be in the release notes. I cleaned up a lot of the #if lines in the code to use MAC_OS_X_VERSION_MIN_REQUIRED and MAC_OS_X_VERSION_MAX_ALLOWED instead of checking for whether things like __MAC_10_6 or whatever were defined, because for some SDKs Apple has released they were defined out of place. Daniel Stenberg (22 Jun 2013) - [Alessandro Ghedini brought this change] docs: fix typo in curl_easy_getinfo manpage - dotdot: introducing dot file path cleanup RFC3986 details how a path part passed in as part of a URI should be "cleaned" from dot sequences before getting used. The described algorithm is now implemented in lib/dotdot.c with the accompanied test case in test 1395. Bug: http://curl.haxx.se/bug/view.cgi?id=1200 Reported-by: Alex Vinnik - bump: start working towards what most likely will become 7.32.0 - THANKS: added 24 new contributors from the 7.31.0 release Version 7.31.0 (22 Jun 2013) Daniel Stenberg (22 Jun 2013) - RELEASE-NOTES: synced with 0de7249bb39a2 - 7.31.0 - unit1396: unit tests to verify curl_easy_(un)escape - Curl_urldecode: no peeking beyond end of input buffer Security problem: CVE-2013-2174 If a program would give a string like "%FF" to curl_easy_unescape() but ask for it to decode only the first byte, it would still parse and decode the full hex sequence. The function then not only read beyond the allowed buffer but it would also deduct the *unsigned* counter variable for how many more bytes there's left to read in the buffer by two, making the counter wrap. Continuing this, the function would go on reading beyond the buffer and soon writing beyond the allocated target buffer... Bug: http://curl.haxx.se/docs/adv_20130622.html Reported-by: Timo Sirainen Guenter Knauf (20 Jun 2013) - Use opened body.out file and write content to it. Daniel Stenberg (20 Jun 2013) - multi_socket: react on socket close immediately As a remedy to the problem when a socket gets closed and a new one is opened with the same file descriptor number and as a result multi.c:singlesocket() doesn't detect the difference, the new function Curl_multi_closed() gets told when a socket is closed so that it can be removed from the socket hash. When the old one has been removed, a new socket should be detected fine by the singlesocket() on next invoke. Bug: http://curl.haxx.se/bug/view.cgi?id=1248 Reported-by: Erik Johansson - RELEASE-NOTES: synced with e305f5ec715f - TODO: mention the DANE patch from March - CURLOPT_COOKIELIST: take cookie share lock When performing COOKIELIST operations the cookie lock needs to be taken for the cases where the cookies are shared among multiple handles! Verified by Benjamin Gilbert's updated test 506 Bug: http://curl.haxx.se/bug/view.cgi?id=1215 Reported-by: Benjamin Gilbert - [Benjamin Gilbert brought this change] test506: verify that CURLOPT_COOKIELIST takes share lock It doesn't right now: http://curl.haxx.se/bug/view.cgi?id=1215 - TODO: HTTP2/SPDY support - curl_easy_setopt.3: clarify CURLOPT_PROGRESSFUNCTION frequency Make it clearer that the CURLOPT_PROGRESSFUNCTION callback will be called more frequently than once per second when things are happening. - RELEASE-NOTES: synced with 9c3e098259b82 Mention 7 recent bug fixes and their associated contributors - curl_multi_wait.3: clarify the numfds counter - curl_easy_perform: avoid busy-looping When curl_multi_wait() finds no file descriptor to wait for, it returns instantly and this must be handled gracefully within curl_easy_perform() or cause a busy-loop. Starting now, repeated fast returns without any file descriptors is detected and a gradually increasing sleep will be used (up to a max of 1000 milliseconds) before continuing the loop. Bug: http://curl.haxx.se/bug/view.cgi?id=1238 Reported-by: Miguel Angel - [YAMADA Yasuharu brought this change] cookies: follow-up fix for path checking The initial fix to only compare full path names were done in commit 04f52e9b4db0 but found out to be incomplete. This takes should make the change more complete and there's now two additional tests to verify (test 31 and 62). - [Sergei Nikulov brought this change] lib1900: use tutil_tvnow instead of gettimeofday Makes it build on windows - [Eric Hu brought this change] axtls: now done non-blocking - [Eric Hu brought this change] test2033: requires NTLM support - KNOWN_BUGS: #82 failed build with Borland compiler - Curl_output_digest: support auth-int for empty entity body By always returning the md5 for an empty body when auth-int is asked for, libcurl now at least sometimes does the right thing. Bug: http://curl.haxx.se/bug/view.cgi?id=1235 Patched-by: Nach M. S. - multi_socket: reduce timeout inaccuracy margin Allow less room for "triggered too early" mistakes by applications / timers on non-windows platforms. Starting now, we assume that a timeout call is never made earlier than 3 milliseconds before the actual timeout. This greatly improves timeout accuracy on Linux. Bug: http://curl.haxx.se/bug/view.cgi?id=1228 Reported-by: Hang Su - cert_stuff: avoid double free in the PKCS12 code In the pkcs12 code, we get a list of x509 records returned from PKCS12_parse but when iterating over the list and passing each to SSL_CTX_add_extra_chain_cert() we didn't also properly remove them from the "stack", which made them get freed twice (both in sk_X509_pop_free() and then later in SSL_CTX_free). This isn't really documented anywhere... Bug: http://curl.haxx.se/bug/view.cgi?id=1236 Reported-by: Nikaiw - cert_stuff: remove code duplication in the pkcs12 logic - [Aleksey Tulinov brought this change] axtls: honor disabled VERIFYHOST When VERIFYHOST == 0, libcurl should let invalid certificates to pass. - [Peter Gal brought this change] curl_easy_setopt.3: HTTP header with no content Update the documentation on how to specify a HTTP header with no content. - RELEASE-NOTES: synced with 87cf677eca55 Added 11 bugs and 7 contributors - lib1500: remove bad check After curl_multi_wait() returns, this test checked that we got exactly one file descriptor told to read from, but we cannot be sure that is true. curl_multi_wait() will sometimes return earlier without any file descriptor to handle, just just because it is a suitable time to call *perform(). This problem showed up with commit 29bf0598. Bug: http://curl.haxx.se/mail/lib-2013-06/0029.html Reported-by: Fabian Keil - tests/Makefile: typo in the perlcheck target Bug: http://curl.haxx.se/bug/view.cgi?id=1239 Reported-by: Christian Weisgerber - test1230: verify CONNECT to a numerical ipv6-address - sws: support extracting test number from CONNECT ipv6-address! If an ipv6-address is provided to CONNECT, the last hexadecimal group in the address will be used as the test number! For example the address "[1234::ff]" would be treated as test case 255. - curl_multi_wait: only use internal timer if not -1 commit 29bf0598aad5 introduced a problem when the "internal" timeout is prefered to the given if shorter, as it didn't consider the case where -1 was returned. Now the internal timeout is only considered if not -1. Reported-by: Tor Arntsen Bug: http://curl.haxx.se/mail/lib-2013-06/0015.html Dan Fandrich (3 Jun 2013) - libcurl-tutorial.3: added a section on IPv6 Also added a (correctly-escaped) backslash to the autoexec.bat example file and a new Windows character device name with a colon as examples of other characters that are special and potentially dangerous (this reverts and reworks commit 7d8d2a54). Daniel Stenberg (3 Jun 2013) - curl_multi_wait: reduce timeout if the multi handle wants to If the multi handle's pending timeout is less than what is passed into this function, it will now opt to use the shorter time anyway since it is a very good hint that the handle wants to process something in a shorter time than what otherwise would happen. curl_multi_wait.3 was updated accordingly to clarify This is the reason for bug #1224 Bug: http://curl.haxx.se/bug/view.cgi?id=1224 Reported-by: Andrii Moiseiev - multi_runsingle: switch an if() condition for readability ... because there's an identical check right next to it so using the operators in the check in the same order increases readability. Marc Hoersken (2 Jun 2013) - curl_schannel.c: Removed variable unused since 35874298e4 - curl_setup.h: Fixed redefinition warning using mingw-w64 Daniel Stenberg (30 May 2013) - multi_runsingle: add braces to clarify the code - libcurl-tutorial.3: remove incorrect backslash A single backslash in the content is not legal nroff syntax. Reported and fixed by: Eric S. Raymond Bug: http://curl.haxx.se/bug/view.cgi?id=1234 - curl_formadd.3: fixed wrong "end-marker" syntax Reported and fixed by: Eric S. Raymond Bug: http://curl.haxx.se/bug/view.cgi?id=1233 - curl.1: clarify that --silent still outputs data - Digest auth: escape user names with \ or " in them When sending the HTTP Authorization: header for digest, the user name needs to be escaped if it contains a double-quote or backslash. Test 1229 was added to verify Reported and fixed by: Nach M. S Bug: http://curl.haxx.se/bug/view.cgi?id=1230 - [Mike Giancola brought this change] ossl_recv: SSL_read() returning 0 is an error too SSL_read can return 0 for "not successful", according to the open SSL documentation: http://www.openssl.org/docs/ssl/SSL_read.html - [Mike Giancola brought this change] ossl_send: SSL_write() returning 0 is an error too We found that in specific cases if the connection is abruptly closed, the underlying socket is listed in a close_wait state. We continue to call the curl_multi_perform, curl_mutli_fdset etc. None of these APIs report the socket closed / connection finished. Since we have cases where the multi connection is only used once, this can pose a problem for us. I've read that if another connection was to come in, curl would see the socket as bad and attempt to close it at that time - unfortunately, this does not work for us. I found that in specific situations, if SSL_write returns 0, curl did not recognize the socket as closed (or errored out) and did not report it to the application. I believe we need to change the code slightly, to check if ssl_write returns 0. If so, treat it as an error - the same as a negative return code. For OpenSSL - the ssl_write documentation is here: http://www.openssl.org/docs/ssl/SSL_write.html - KNOWN_BUGS: curl -OJC- fails to resume Bug: http://curl.haxx.se/bug/view.cgi?id=1169 - Curl_cookie_add: handle IPv6 hosts 1 - don't skip host names with a colon in them in an attempt to bail out on HTTP headers in the cookie file parser. It was only a shortcut anyway and trying to parse a file with HTTP headers will still be handled, only slightly slower. 2 - don't skip domain names based on number of dots. The original netscape cookie spec had this oddity mentioned and while our code decreased the check to only check for two, the existing cookie spec has no such dot counting required. Bug: http://curl.haxx.se/bug/view.cgi?id=1221 Reported-by: Stefan Neis - curl_easy_setopt.3: expand the PROGRESSFUNCTION section Explain the callback and its arguments better and with more descriptive text. - tests: add test1394 file to the tarball - tarball: include the xmlstream example - [David Strauss brought this change] xmlstream: XML stream parsing example source code Add an XML stream parsing example using Expat. Add missing ignore for the binary from an unrelated example. - [YAMADA Yasuharu brought this change] cookies: only consider full path matches I found a bug which cURL sends cookies to the path not to aim at. For example: - cURL sends a request to http://example.fake/hoge/ - server returns cookie which with path=/hoge; the point is there is NOT the '/' end of path string. - cURL sends a request to http://example.fake/hogege/ with the cookie. The reason for this old "feature" is because that behavior is what is described in the original netscape cookie spec: http://curl.haxx.se/rfc/cookie_spec.html The current cookie spec (RFC6265) clarifies the situation: http://tools.ietf.org/html/rfc6265#section-5.2.4 - [Eric Hu brought this change] axtls: prevent memleaks on SSL handshake failures - Revert "WIN32 MemoryTracking: track wcsdup() _wcsdup() and _tcsdup() usage" This reverts commit 8ec2cb5544b86306b702484ea785b6b9596562ab. We don't have any code anywhere in libcurl (or the curl tool) that use wcsdup so there's no such memory use to track. It seems to cause mild problems with the Borland compiler though that we may avoid by reverting this change again. Bug: http://curl.haxx.se/mail/lib-2013-05/0070.html - RELEASE-NOTES: synced with ae26ee3489588f0 Guenter Knauf (11 May 2013) - Updated zlib version in build files. Daniel Stenberg (9 May 2013) - [Renaud Guillard brought this change] OS X framework: fix invalid symbolic link Kamil Dudka (9 May 2013) - [Daniel Stenberg brought this change] nss: give PR_INTERVAL_NO_WAIT instead of -1 to PR_Recv/PR_Send Reported by: David Strauss Bug: http://curl.haxx.se/mail/lib-2013-05/0088.html Daniel Stenberg (8 May 2013) - libtest: gitignore more binary files - servercert: allow empty subject Bug: http://curl.haxx.se/bug/view.cgi?id=1220 Patch by: John Gardiner Myers - [Steve Holme brought this change] tests: Added new SMTP tests to verify commit 99b40451836d - runtests.pl: support nonewline="yes" in client/stdin sections - build: fixed unit1394 for debug and metlink builds Kamil Dudka (6 May 2013) - unit1394.c: plug the curl tool unit test in - [Jared Jennings brought this change] unit1394.c: basis of a unit test for parse_cert_parameter() - src/Makefile.am: build static lib for unit tests if enabled - tool_getparam: ensure string termination in parse_cert_parameter() - tool_getparam: fix memleak in handling the -E option - tool_getparam: describe what parse_cert_parameter() does ... and de-duplicate the code initializing *passphrase - curl.1: document escape sequences recognized by -E - [Jared Jennings brought this change] curl -E: allow to escape ':' in cert nickname Marc Hoersken (5 May 2013) - curl_schannel.c: Fixed invalid memory access during SSL shutdown Steve Holme (4 May 2013) - smtp: Fix trailing whitespace warning - smtp: Fix compilation warning comparison between signed and unsigned integer expressions - RELEASE-NOTES: synced with 92ef5f19c801 - smtp: Updated RFC-2821 references to RFC-5321 - smtp: Fixed sending of double CRLF caused by first in EOB If the mail sent during the transfer contains a terminating then we should not send the first of the EOB as specified in RFC-5321. Additionally don't send the if there is "no mail data" as the DATA command already includes it. - tests: Corrected MAIL SIZE for CRLF line endings ... which was missed in commit: f5c3d9538452 - tests: Corrected infilesize for CRLF line endings ... which was missed in commit: f5c3d9538452 - tests: Corrected test1406 to be RFC2821 compliant - tests: Corrected test1320 to be RFC2821 compliant - tests: Corrected typo in test909 Introduced in commit: 514817669e9e - tests: Corrected test909 to be RFC2821 compliant - tests: Updated test references to 909 from 1411 ...and removed references to libcurl and test1406. - tests: Renamed test1411 to test909 as this is a main SMTP test Daniel Stenberg (1 May 2013) - [Lars Johannesen brought this change] bindlocal: move brace out of #ifdef The code within #ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID wrongly had two closing braces when it should only have one, so builds without that define would fail. Bug: http://curl.haxx.se/mail/lib-2013-05/0000.html Steve Holme (30 Apr 2013) - smtp: Tidy up to move the eob counter to the per-request structure Move the eob counter from the smtp_conn structure to the SMTP structure as it is associated with a SMTP payload on a per-request basis. - TODO: Updated following the addition of CURLOPT_SASL_IR - smtp: Fixed unknown percentage complete in progress bar The curl command line utility would display the the completed progress bar with a percentage of zero as the progress routines didn't know the size of the transfer. Daniel Stenberg (29 Apr 2013) - ftpserver: silence warnings Fix regressions in commit b56e3d43e5d. Make @data local and filter off non-numerical digits from $testno in STATUS_imap. Steve Holme (29 Apr 2013) - ftpserver.pl: Corrected the imap LOGIN response ...to be more realistic and consistent with the other imap responses. - tests: Added imap STATUS command test - tests: Corrected the SMTP tests to be RFC2821 compliant The emails that are sent to the server during these tests were incorrectly formatted as they contained one or more LF terminated lines rather than being CRLF terminated as per Section 2.3.7 of RFC-2821. This wasn't a problem for the test suite as the data matched the data but anyone using these tests as reference would be sending incorrect data to a server. - email: Tidy up of *_perform_authenticate() Removed the hard returns from imap and pop3 by using the same style for sending the authentication string as smtp. Moved the "Other mechanisms not supported" check in smtp to match that of imap and pop3 to provide consistency between the three email protocols. - smtp: Updated limit check to be more readable like the check in pop3 - pop3: Added 255 octet limit check when sending initial response Added 255 octet limit check as per Section 4. Paragraph 8 of RFC-5034. - DOCS: Corrected line length of recent Secure Transport changes Nick Zitzmann (27 Apr 2013) - darwinssl: add TLS crypto authentication Users using the Secure Transport (darwinssl) back-end can now use a certificate and private key to authenticate with a site using TLS. Because Apple's security system is based around the keychain and does not have any non-public function to create a SecIdentityRef data structure from data loaded outside of the Keychain, the certificate and private key have to be loaded into the Keychain first (using the certtool command line tool or the Security framework's C API) before we can find it and use it. Steve Holme (27 Apr 2013) - Corrected version numbers after bump Daniel Stenberg (27 Apr 2013) - bump version Since we're adding new stuff, the next release will bump the minor version and we're looking forward to 7.31.0 Steve Holme (27 Apr 2013) - RELEASE-NOTES: synced with f4e6e201b146 - DOCS: Updated following the addition of CURLOPT_SASL_IR Documented the the option in curl_easy_setopt() and added it to symbols-in-versions. - tests: Corrected command line arguments in test907 and test908 - tests: Added SMTP AUTH with initial response tests - tests: Updated SMTP tests to decouple client initial response Updated test903 and test904 following the addition of CURLOPT_SASL_IR as the default behaviour of SMTP AUTH responses is now to not include the initial response. New tests with --sasl-ir support to follow. - imap: Added support for overriding the SASL initial response In addition to checking for the SASL-IR capability the user can override the sending of the client's initial response in the AUTHENTICATION command with the use of CURLOPT_SASL_IR should the server erroneously not report SASL-IR when it does support it. - smtp: Added support for disabling the SASL initial response Updated the default behaviour of sending the client's initial response in the AUTH command to not send it and added support for CURLOPT_SASL_IR to allow the user to specify including the response. Related Bug: http://curl.haxx.se/mail/lib-2012-03/0114.html Reported-by: Gokhan Sengun curl-7.35.0/ltmain.sh0000644000175000017500000105202612272122660011322 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.6 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.6" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 curl-7.35.0/buildconf0000755000175000017500000003462712213173003011373 00000000000000#!/bin/sh #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2012, 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. # ########################################################################### #-------------------------------------------------------------------------- # die prints argument string to stdout and exits this shell script. # die(){ echo "buildconf: $@" exit 1 } #-------------------------------------------------------------------------- # findtool works as 'which' but we use a different name to make it more # obvious we aren't using 'which'! ;-) # findtool(){ file="$1" if { echo "$file" | grep "/" >/dev/null 2>&1; } then # when file is given with a path check it first if test -f "$file"; then echo "$file" return fi fi old_IFS=$IFS; IFS=':' for path in $PATH do IFS=$old_IFS # echo "checks for $file in $path" >&2 if test -f "$path/$file"; then echo "$path/$file" return fi done IFS=$old_IFS } #-------------------------------------------------------------------------- # removethis() removes all files and subdirectories with the given name, # inside and below the current subdirectory at invocation time. # removethis(){ if test "$#" = "1"; then find . -depth -name $1 -print > buildconf.tmp.$$ while read fdname do if test -f "$fdname"; then rm -f "$fdname" elif test -d "$fdname"; then rm -f -r "$fdname" fi done < buildconf.tmp.$$ rm -f buildconf.tmp.$$ fi } #-------------------------------------------------------------------------- # Ensure that buildconf runs from the subdirectory where configure.ac lives # if test ! -f configure.ac || test ! -f src/tool_main.c || test ! -f lib/urldata.h || test ! -f include/curl/curl.h || test ! -f m4/curl-functions.m4; then echo "Can not run buildconf from outside of curl's source subdirectory!" echo "Change to the subdirectory where buildconf is found, and try again." exit 1 fi #-------------------------------------------------------------------------- # autoconf 2.57 or newer. Unpatched version 2.67 does not generate proper # configure script. Unpatched version 2.68 is simply unusable, we should # disallow 2.68 usage. # 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 old_IFS=$IFS; IFS='.'; set $ac_version; IFS=$old_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 if test "$1" = "2" -a "$2" -eq "67"; then echo "buildconf: autoconf version $ac_version (BAD)" echo " Unpatched version generates broken configure script." elif test "$1" = "2" -a "$2" -eq "68"; then echo "buildconf: autoconf version $ac_version (BAD)" echo " Unpatched version generates unusable configure script." else echo "buildconf: autoconf version $ac_version (ok)" fi am4te_version=`${AUTOM4TE:-autom4te} --version 2>/dev/null|head -n 1| sed -e 's/autom4te\(.*\)/\1/' -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` if test -z "$am4te_version"; then echo "buildconf: autom4te not found. Weird autoconf installation!" exit 1 fi if test "$am4te_version" = "$ac_version"; then echo "buildconf: autom4te version $am4te_version (ok)" else echo "buildconf: autom4te version $am4te_version (ERROR: does not match autoconf version)" exit 1 fi #-------------------------------------------------------------------------- # 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 old_IFS=$IFS; IFS='.'; set $ah_version; IFS=$old_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 old_IFS=$IFS; IFS='.'; set $am_version; IFS=$old_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)" acloc_version=`${ACLOCAL:-aclocal} --version 2>/dev/null|head -n 1| sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//' -e 's/\(.*\)\(-p.*\)/\1/'` if test -z "$acloc_version"; then echo "buildconf: aclocal not found. Weird automake installation!" exit 1 fi if test "$acloc_version" = "$am_version"; then echo "buildconf: aclocal version $acloc_version (ok)" else echo "buildconf: aclocal version $acloc_version (ERROR: does not match automake version)" exit 1 fi #-------------------------------------------------------------------------- # GNU libtool preliminary check # want_lt_major=1 want_lt_minor=4 want_lt_patch=2 want_lt_version=1.4.2 # This approach that tries 'glibtool' first is intended for systems that # have GNU libtool named as 'glibtool' and libtool not being GNU's. libtool=`findtool glibtool 2>/dev/null` if test ! -x "$libtool"; then libtool=`findtool ${LIBTOOL:-libtool}` fi if test -z "$libtool"; then echo "buildconf: libtool not found." echo " You need GNU libtool $want_lt_version or newer installed." exit 1 fi lt_pver=`$libtool --version 2>/dev/null|head -n 1` lt_qver=`echo $lt_pver|sed -e "s/([^)]*)//g" -e "s/^[^0-9]*//g"` lt_version=`echo $lt_qver|sed -e "s/[- ].*//" -e "s/\([a-z]*\)$//"` if test -z "$lt_version"; then echo "buildconf: libtool not found." echo " You need GNU libtool $want_lt_version or newer installed." exit 1 fi old_IFS=$IFS; IFS='.'; set $lt_version; IFS=$old_IFS lt_major=$1 lt_minor=$2 lt_patch=$3 if test -z "$lt_major"; then lt_status="bad" elif test "$lt_major" -gt "$want_lt_major"; then lt_status="good" elif test "$lt_major" -lt "$want_lt_major"; then lt_status="bad" elif test -z "$lt_minor"; then lt_status="bad" elif test "$lt_minor" -gt "$want_lt_minor"; then lt_status="good" elif test "$lt_minor" -lt "$want_lt_minor"; then lt_status="bad" elif test -z "$lt_patch"; then lt_status="bad" elif test "$lt_patch" -gt "$want_lt_patch"; then lt_status="good" elif test "$lt_patch" -lt "$want_lt_patch"; then lt_status="bad" else lt_status="good" fi if test "$lt_status" != "good"; then echo "buildconf: libtool version $lt_version found." echo " You need GNU libtool $want_lt_version or newer installed." exit 1 fi echo "buildconf: libtool version $lt_version (ok)" #-------------------------------------------------------------------------- # GNU libtoolize check # if test -z "$LIBTOOLIZE"; then # use (g)libtoolize from same location as (g)libtool libtoolize="${libtool}ize" else libtoolize=`findtool $LIBTOOLIZE` fi if test ! -f "$libtoolize"; then echo "buildconf: libtoolize not found." echo " You need GNU libtoolize $want_lt_version or newer installed." exit 1 fi #-------------------------------------------------------------------------- # m4 check # m4=`(${M4:-m4} --version || ${M4:-gm4} --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 if test -z "$m4"; then echo "buildconf: m4 version not recognized. You need a GNU m4 installed!" else echo "buildconf: m4 version $m4 found. You need a GNU m4 installed!" fi exit 1 fi #-------------------------------------------------------------------------- # perl check # PERL=`findtool ${PERL:-perl}` if test -z "$PERL"; then echo "buildconf: perl not found" exit 1 fi #-------------------------------------------------------------------------- # Remove files generated on previous buildconf/configure run. # for fname in .deps \ .libs \ *.la \ *.lo \ *.a \ *.o \ Makefile \ Makefile.in \ aclocal.m4 \ aclocal.m4.bak \ ares_build.h \ ares_config.h \ ares_config.h.in \ autom4te.cache \ compile \ config.guess \ curl_config.h \ curl_config.h.in \ config.log \ config.lt \ config.status \ config.sub \ configure \ configurehelp.pm \ curl-config \ curlbuild.h \ depcomp \ libcares.pc \ libcurl.pc \ libtool \ libtool.m4 \ libtool.m4.tmp \ ltmain.sh \ ltoptions.m4 \ ltsugar.m4 \ ltversion.m4 \ lt~obsolete.m4 \ stamp-h1 \ stamp-h2 \ stamp-h3 ; do removethis "$fname" done #-------------------------------------------------------------------------- # run the correct scripts now # echo "buildconf: running libtoolize" ${libtoolize} --copy --automake --force || die "libtoolize command failed" # When using libtool 1.5.X (X < 26) we copy libtool.m4 to our local m4 # subdirectory and this local copy is patched to fix some warnings that # are triggered when running aclocal and using autoconf 2.62 or later. if test "$lt_major" = "1" && test "$lt_minor" = "5"; then if test -z "$lt_patch" || test "$lt_patch" -lt "26"; then echo "buildconf: copying libtool.m4 to local m4 subdir" ac_dir=`${ACLOCAL:-aclocal} --print-ac-dir` if test -f $ac_dir/libtool.m4; then cp -f $ac_dir/libtool.m4 m4/libtool.m4 else echo "buildconf: $ac_dir/libtool.m4 not found" fi if test -f m4/libtool.m4; then echo "buildconf: renaming some variables in local m4/libtool.m4" $PERL -i.tmp -pe \ 's/lt_prog_compiler_pic_works/lt_cv_prog_compiler_pic_works/g; \ s/lt_prog_compiler_static_works/lt_cv_prog_compiler_static_works/g;' \ m4/libtool.m4 rm -f m4/libtool.m4.tmp fi fi fi if test -f m4/libtool.m4; then echo "buildconf: converting all mv to mv -f in local m4/libtool.m4" $PERL -i.tmp -pe 's/\bmv +([^-\s])/mv -f $1/g' m4/libtool.m4 rm -f m4/libtool.m4.tmp fi echo "buildconf: running aclocal" ${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS || die "aclocal command failed" echo "buildconf: converting all mv to mv -f in local aclocal.m4" $PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4 echo "buildconf: running autoheader" ${AUTOHEADER:-autoheader} || die "autoheader command failed" echo "buildconf: running autoconf" ${AUTOCONF:-autoconf} || die "autoconf command failed" if test -d ares; then cd ares echo "buildconf: running in ares" ./buildconf cd .. fi echo "buildconf: running automake" ${AUTOMAKE:-automake} --add-missing --copy || die "automake command failed" #-------------------------------------------------------------------------- # GNU libtool complementary check # # Depending on the libtool and automake versions being used, config.guess # might not be installed in the subdirectory until automake has finished. # So we can not attempt to use it until this very last buildconf stage. # if test ! -f ./config.guess; then echo "buildconf: config.guess not found" else buildhost=`./config.guess 2>/dev/null|head -n 1` case $buildhost in *-*-darwin*) need_lt_major=1 need_lt_minor=5 need_lt_patch=26 need_lt_check="yes" ;; *-*-hpux*) need_lt_major=1 need_lt_minor=5 need_lt_patch=24 need_lt_check="yes" ;; esac if test ! -z "$need_lt_check"; then if test -z "$lt_major"; then lt_status="bad" elif test "$lt_major" -gt "$need_lt_major"; then lt_status="good" elif test "$lt_major" -lt "$need_lt_major"; then lt_status="bad" elif test -z "$lt_minor"; then lt_status="bad" elif test "$lt_minor" -gt "$need_lt_minor"; then lt_status="good" elif test "$lt_minor" -lt "$need_lt_minor"; then lt_status="bad" elif test -z "$lt_patch"; then lt_status="bad" elif test "$lt_patch" -gt "$need_lt_patch"; then lt_status="good" elif test "$lt_patch" -lt "$need_lt_patch"; then lt_status="bad" else lt_status="good" fi if test "$lt_status" != "good"; then need_lt_version="$need_lt_major.$need_lt_minor.$need_lt_patch" echo "buildconf: libtool version $lt_version found." echo " $buildhost requires GNU libtool $need_lt_version or newer installed." rm -f configure exit 1 fi fi fi #-------------------------------------------------------------------------- # Finished successfully. # echo "buildconf: OK" exit 0 curl-7.35.0/install-sh0000755000175000017500000003325612213173003011501 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # 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. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: curl-7.35.0/m4/0000755000175000017500000000000012272124475010102 500000000000000curl-7.35.0/m4/ltoptions.m40000644000175000017500000003007312272122660012314 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) curl-7.35.0/m4/xc-lt-iface.m40000644000175000017500000002770712213173003012357 00000000000000#--------------------------------------------------------------------------- # # xc-lt-iface.m4 # # Copyright (c) 2013 Daniel Stenberg # # 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 THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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. # #--------------------------------------------------------------------------- # serial 1 dnl _XC_LIBTOOL_PREAMBLE dnl ------------------------------------------------- dnl Private macro. dnl dnl Checks some configure script options related with dnl libtool and customizes its default behavior before dnl libtool code is actually used in script. m4_define([_XC_LIBTOOL_PREAMBLE], [dnl # ------------------------------------ # # Determine libtool default behavior # # ------------------------------------ # # # Default behavior is to enable shared and static libraries on systems # where libtool knows how to build both library versions, and does not # require separate configuration and build runs for each flavor. # xc_lt_want_enable_shared='yes' xc_lt_want_enable_static='yes' # # User may have disabled shared or static libraries. # case "x$enable_shared" in @%:@ ( xno) xc_lt_want_enable_shared='no' ;; esac case "x$enable_static" in @%:@ ( xno) xc_lt_want_enable_static='no' ;; esac if test "x$xc_lt_want_enable_shared" = 'xno' && test "x$xc_lt_want_enable_static" = 'xno'; then AC_MSG_ERROR([can not disable shared and static libraries simultaneously]) fi # # Default behavior on systems that require independent configuration # and build runs for shared and static is to enable shared libraries # and disable static ones. On these systems option '--disable-shared' # must be used in order to build a proper static library. # if test "x$xc_lt_want_enable_shared" = 'xyes' && test "x$xc_lt_want_enable_static" = 'xyes'; then case $host_os in @%:@ ( mingw* | pw32* | cegcc* | os2* | aix*) xc_lt_want_enable_static='no' ;; esac fi # # Make libtool aware of current shared and static library preferences # taking in account that, depending on host characteristics, libtool # may modify these option preferences later in this configure script. # enable_shared=$xc_lt_want_enable_shared enable_static=$xc_lt_want_enable_static # # Default behavior is to build PIC objects for shared libraries and # non-PIC objects for static libraries. # xc_lt_want_with_pic='default' # # User may have specified PIC preference. # case "x$with_pic" in @%:@ (( xno) xc_lt_want_with_pic='no' ;; xyes) xc_lt_want_with_pic='yes' ;; esac # # Default behavior on some systems where building a shared library out # of non-PIC compiled objects will fail with following linker error # "relocation R_X86_64_32 can not be used when making a shared object" # is to build PIC objects even for static libraries. This behavior may # be overriden using 'configure --disable-shared --without-pic'. # if test "x$xc_lt_want_with_pic" = 'xdefault'; then case $host_cpu in @%:@ ( x86_64 | amd64 | ia64) case $host_os in @%:@ ( linux* | freebsd*) xc_lt_want_with_pic='yes' ;; esac ;; esac fi # # Make libtool aware of current PIC preference taking in account that, # depending on host characteristics, libtool may modify PIC default # behavior to fit host system idiosyncrasies later in this script. # with_pic=$xc_lt_want_with_pic dnl m4_define([$0],[])dnl ]) dnl _XC_LIBTOOL_BODY dnl ------------------------------------------------- dnl Private macro. dnl dnl This macro performs embedding of libtool code into dnl configure script, regardless of libtool version in dnl use when generating configure script. m4_define([_XC_LIBTOOL_BODY], [dnl ## ----------------------- ## ## Start of libtool code ## ## ----------------------- ## m4_ifdef([LT_INIT], [dnl LT_INIT([win32-dll]) ],[dnl AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL ])dnl ## --------------------- ## ## End of libtool code ## ## --------------------- ## dnl m4_define([$0], [])[]dnl ]) dnl _XC_CHECK_LT_BUILD_LIBRARIES dnl ------------------------------------------------- dnl Private macro. dnl dnl Checks wether libtool shared and static libraries dnl are finally built depending on user input, default dnl behavior and knowledge that libtool has about host dnl characteristics. dnl Results stored in following shell variables: dnl xc_lt_build_shared dnl xc_lt_build_static m4_define([_XC_CHECK_LT_BUILD_LIBRARIES], [dnl # # Verify if finally libtool shared libraries will be built # case "x$enable_shared" in @%:@ (( xyes | xno) xc_lt_build_shared=$enable_shared ;; *) AC_MSG_ERROR([unexpected libtool enable_shared value: $enable_shared]) ;; esac # # Verify if finally libtool static libraries will be built # case "x$enable_static" in @%:@ (( xyes | xno) xc_lt_build_static=$enable_static ;; *) AC_MSG_ERROR([unexpected libtool enable_static value: $enable_static]) ;; esac dnl m4_define([$0],[])dnl ]) dnl _XC_CHECK_LT_SHLIB_USE_VERSION_INFO dnl ------------------------------------------------- dnl Private macro. dnl dnl Checks if the -version-info linker flag must be dnl provided when building libtool shared libraries. dnl Result stored in xc_lt_shlib_use_version_info. m4_define([_XC_CHECK_LT_SHLIB_USE_VERSION_INFO], [dnl # # Verify if libtool shared libraries should be linked using flag -version-info # AC_MSG_CHECKING([whether to build shared libraries with -version-info]) xc_lt_shlib_use_version_info='yes' if test "x$version_type" = 'xnone'; then xc_lt_shlib_use_version_info='no' fi case $host_os in @%:@ ( amigaos*) xc_lt_shlib_use_version_info='yes' ;; esac AC_MSG_RESULT([$xc_lt_shlib_use_version_info]) dnl m4_define([$0], [])[]dnl ]) dnl _XC_CHECK_LT_SHLIB_USE_NO_UNDEFINED dnl ------------------------------------------------- dnl Private macro. dnl dnl Checks if the -no-undefined linker flag must be dnl provided when building libtool shared libraries. dnl Result stored in xc_lt_shlib_use_no_undefined. m4_define([_XC_CHECK_LT_SHLIB_USE_NO_UNDEFINED], [dnl # # Verify if libtool shared libraries should be linked using flag -no-undefined # AC_MSG_CHECKING([whether to build shared libraries with -no-undefined]) xc_lt_shlib_use_no_undefined='no' if test "x$allow_undefined" = 'xno'; then xc_lt_shlib_use_no_undefined='yes' elif test "x$allow_undefined_flag" = 'xunsupported'; then xc_lt_shlib_use_no_undefined='yes' fi case $host_os in @%:@ ( cygwin* | mingw* | pw32* | cegcc* | os2* | aix*) xc_lt_shlib_use_no_undefined='yes' ;; esac AC_MSG_RESULT([$xc_lt_shlib_use_no_undefined]) dnl m4_define([$0], [])[]dnl ]) dnl _XC_CHECK_LT_SHLIB_USE_MIMPURE_TEXT dnl ------------------------------------------------- dnl Private macro. dnl dnl Checks if the -mimpure-text linker flag must be dnl provided when building libtool shared libraries. dnl Result stored in xc_lt_shlib_use_mimpure_text. m4_define([_XC_CHECK_LT_SHLIB_USE_MIMPURE_TEXT], [dnl # # Verify if libtool shared libraries should be linked using flag -mimpure-text # AC_MSG_CHECKING([whether to build shared libraries with -mimpure-text]) xc_lt_shlib_use_mimpure_text='no' case $host_os in @%:@ ( solaris2*) if test "x$GCC" = 'xyes'; then xc_lt_shlib_use_mimpure_text='yes' fi ;; esac AC_MSG_RESULT([$xc_lt_shlib_use_mimpure_text]) dnl m4_define([$0], [])[]dnl ]) dnl _XC_CHECK_LT_BUILD_WITH_PIC dnl ------------------------------------------------- dnl Private macro. dnl dnl Checks wether libtool shared and static libraries dnl would be built with PIC depending on user input, dnl default behavior and knowledge that libtool has dnl about host characteristics. dnl Results stored in following shell variables: dnl xc_lt_build_shared_with_pic dnl xc_lt_build_static_with_pic m4_define([_XC_CHECK_LT_BUILD_WITH_PIC], [dnl # # Find out wether libtool libraries would be built wit PIC # case "x$pic_mode" in @%:@ (((( xdefault) xc_lt_build_shared_with_pic='yes' xc_lt_build_static_with_pic='no' ;; xyes) xc_lt_build_shared_with_pic='yes' xc_lt_build_static_with_pic='yes' ;; xno) xc_lt_build_shared_with_pic='no' xc_lt_build_static_with_pic='no' ;; *) xc_lt_build_shared_with_pic='unknown' xc_lt_build_static_with_pic='unknown' AC_MSG_WARN([unexpected libtool pic_mode value: $pic_mode]) ;; esac AC_MSG_CHECKING([whether to build shared libraries with PIC]) AC_MSG_RESULT([$xc_lt_build_shared_with_pic]) AC_MSG_CHECKING([whether to build static libraries with PIC]) AC_MSG_RESULT([$xc_lt_build_static_with_pic]) dnl m4_define([$0],[])dnl ]) dnl _XC_CHECK_LT_BUILD_SINGLE_VERSION dnl ------------------------------------------------- dnl Private macro. dnl dnl Checks wether a libtool shared or static library dnl is finally built exclusively without the other. dnl Results stored in following shell variables: dnl xc_lt_build_shared_only dnl xc_lt_build_static_only m4_define([_XC_CHECK_LT_BUILD_SINGLE_VERSION], [dnl # # Verify if libtool shared libraries will be built while static not built # AC_MSG_CHECKING([whether to build shared libraries only]) if test "$xc_lt_build_shared" = 'yes' && test "$xc_lt_build_static" = 'no'; then xc_lt_build_shared_only='yes' else xc_lt_build_shared_only='no' fi AC_MSG_RESULT([$xc_lt_build_shared_only]) # # Verify if libtool static libraries will be built while shared not built # AC_MSG_CHECKING([whether to build static libraries only]) if test "$xc_lt_build_static" = 'yes' && test "$xc_lt_build_shared" = 'no'; then xc_lt_build_static_only='yes' else xc_lt_build_static_only='no' fi AC_MSG_RESULT([$xc_lt_build_static_only]) dnl m4_define([$0],[])dnl ]) dnl _XC_LIBTOOL_POSTLUDE dnl ------------------------------------------------- dnl Private macro. dnl dnl Performs several checks related with libtool that dnl can not be done unless libtool code has already dnl been executed. See individual check descriptions dnl for further info. m4_define([_XC_LIBTOOL_POSTLUDE], [dnl _XC_CHECK_LT_BUILD_LIBRARIES _XC_CHECK_LT_SHLIB_USE_VERSION_INFO _XC_CHECK_LT_SHLIB_USE_NO_UNDEFINED _XC_CHECK_LT_SHLIB_USE_MIMPURE_TEXT _XC_CHECK_LT_BUILD_WITH_PIC _XC_CHECK_LT_BUILD_SINGLE_VERSION dnl m4_define([$0],[])dnl ]) dnl XC_LIBTOOL dnl ------------------------------------------------- dnl Public macro. dnl dnl This macro embeds libtool machinery into configure dnl script, regardless of libtool version, and performs dnl several additional checks whose results can be used dnl later on. dnl dnl Usage of this macro ensures that generated configure dnl script uses equivalent logic irrespective of autoconf dnl or libtool version being used to generate configure dnl script. dnl dnl Results stored in following shell variables: dnl xc_lt_build_shared dnl xc_lt_build_static dnl xc_lt_shlib_use_version_info dnl xc_lt_shlib_use_no_undefined dnl xc_lt_shlib_use_mimpure_text dnl xc_lt_build_shared_with_pic dnl xc_lt_build_static_with_pic dnl xc_lt_build_shared_only dnl xc_lt_build_static_only AC_DEFUN([XC_LIBTOOL], [dnl AC_PREREQ([2.50])dnl dnl AC_BEFORE([$0],[LT_INIT])dnl AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl dnl AC_REQUIRE([XC_CHECK_PATH_SEPARATOR])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl dnl _XC_LIBTOOL_PREAMBLE _XC_LIBTOOL_BODY _XC_LIBTOOL_POSTLUDE dnl m4_ifdef([AC_LIBTOOL_WIN32_DLL], [m4_undefine([AC_LIBTOOL_WIN32_DLL])])dnl m4_ifdef([AC_PROG_LIBTOOL], [m4_undefine([AC_PROG_LIBTOOL])])dnl m4_ifdef([LT_INIT], [m4_undefine([LT_INIT])])dnl dnl m4_define([$0],[])dnl ]) curl-7.35.0/m4/zz50-xc-ovr.m40000644000175000017500000000434512213173003012300 00000000000000#--------------------------------------------------------------------------- # # zz50-xc-ovr.m4 # # Copyright (c) 2011 Daniel Stenberg # # 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 THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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. # #--------------------------------------------------------------------------- # serial 1 dnl The funny name of this file is intentional in order to make it dnl sort alphabetically after any libtool, autoconf or automake dnl provided .m4 macro file that might get copied into this same dnl subdirectory. This allows that macro (re)definitions from this dnl file may override those provided in other files. dnl Override some language related macros dnl ------------------------------------------------- dnl This is done to prevent Libtool 1.5.X from doing dnl unnecesary C++, Fortran and Java tests when only dnl using C language and reduce resulting configure dnl script by nearly 300 Kb. m4_ifdef([AC_LIBTOOL_LANG_CXX_CONFIG], [m4_undefine([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_define([AC_LIBTOOL_LANG_CXX_CONFIG],[:]) m4_ifdef([AC_LIBTOOL_LANG_F77_CONFIG], [m4_undefine([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_define([AC_LIBTOOL_LANG_F77_CONFIG],[:]) m4_ifdef([AC_LIBTOOL_LANG_GCJ_CONFIG], [m4_undefine([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_define([AC_LIBTOOL_LANG_GCJ_CONFIG],[:]) dnl XC_OVR_ZZ50 dnl ------------------------------------------------- dnl Placing a call to this macro in configure.ac will dnl make macros in this file visible to other macros dnl used for same configure script, overriding those dnl provided elsewhere. AC_DEFUN([XC_OVR_ZZ50], [AC_BEFORE([$0],[AC_PROG_LIBTOOL])]) curl-7.35.0/m4/xc-am-iface.m40000644000175000017500000001663012262353672012346 00000000000000#--------------------------------------------------------------------------- # # xc-am-iface.m4 # # Copyright (c) 2013 Daniel Stenberg # # 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 THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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. # #--------------------------------------------------------------------------- # serial 1 dnl _XC_AUTOMAKE_BODY dnl ------------------------------------------------- dnl Private macro. dnl dnl This macro performs embedding of automake initialization dnl code into configure script. When automake version 1.14 or dnl newer is used at configure script generation time, this dnl results in 'subdir-objects' automake option being used. dnl When using automake versions older than 1.14 this option dnl is not used when generating configure script. dnl dnl Existence of automake _AM_PROG_CC_C_O m4 private macro dnl is used to differentiate automake version 1.14 from older dnl ones which lack this macro. m4_define([_XC_AUTOMAKE_BODY], [dnl ## --------------------------------------- ## ## Start of automake initialization code ## ## --------------------------------------- ## m4_ifdef([_AM_PROG_CC_C_O], [ AM_INIT_AUTOMAKE([subdir-objects]) ],[ AM_INIT_AUTOMAKE ])dnl ## ------------------------------------- ## ## End of automake initialization code ## ## ------------------------------------- ## dnl m4_define([$0], [])[]dnl ]) dnl XC_AUTOMAKE dnl ------------------------------------------------- dnl Public macro. dnl dnl This macro embeds automake machinery into configure dnl script regardless of automake version used in order dnl to generate configure script. dnl dnl When using automake version 1.14 or newer, automake dnl initialization option 'subdir-objects' is used to dnl generate the configure script, otherwise this option dnl is not used. AC_DEFUN([XC_AUTOMAKE], [dnl AC_PREREQ([2.50])dnl dnl AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl dnl _XC_AUTOMAKE_BODY dnl m4_ifdef([AM_INIT_AUTOMAKE], [m4_undefine([AM_INIT_AUTOMAKE])])dnl dnl m4_define([$0], [])[]dnl ]) dnl _XC_AMEND_DISTCLEAN_BODY ([LIST-OF-SUBDIRS]) dnl ------------------------------------------------- dnl Private macro. dnl dnl This macro performs shell code embedding into dnl configure script in order to modify distclean dnl and maintainer-clean targets of makefiles which dnl are located in given list of subdirs. dnl dnl See XC_AMEND_DISTCLEAN comments for details. m4_define([_XC_AMEND_DISTCLEAN_BODY], [dnl ## ---------------------------------- ## ## Start of distclean amending code ## ## ---------------------------------- ## for xc_subdir in [$1] do if test ! -f "$xc_subdir/Makefile"; then echo "$xc_msg_err $xc_subdir/Makefile file not found. $xc_msg_abrt" >&2 exit 1 fi # Fetch dependency tracking file list from Makefile include lines. xc_inc_lines=`grep '^include .*(DEPDIR)' "$xc_subdir/Makefile" 2>/dev/null` xc_cnt_words=`echo "$xc_inc_lines" | wc -w | tr -d "$xc_space$xc_tab"` # --disable-dependency-tracking might have been used, consequently # there is nothing to amend without a dependency tracking file list. if test $xc_cnt_words -gt 0; then AC_MSG_NOTICE([amending $xc_subdir/Makefile]) # Build Makefile specific patch hunk. xc_p="$xc_subdir/xc_patch.tmp" xc_rm_depfiles=`echo "$xc_inc_lines" \ | $SED 's%include% -rm -f%' 2>/dev/null` xc_dep_subdirs=`echo "$xc_inc_lines" \ | $SED 's%include[[ ]][[ ]]*%%' 2>/dev/null \ | $SED 's%(DEPDIR)/.*%(DEPDIR)%' 2>/dev/null \ | sort | uniq` echo "$xc_rm_depfiles" >$xc_p for xc_dep_dir in $xc_dep_subdirs; do echo "${xc_tab}@xm_dep_cnt=\`ls $xc_dep_dir | wc -l 2>/dev/null\`; \\" >>$xc_p echo "${xc_tab}if test \$\$xm_dep_cnt -eq 0 && test -d $xc_dep_dir; then \\" >>$xc_p echo "${xc_tab} rm -rf $xc_dep_dir; \\" >>$xc_p echo "${xc_tab}fi" >>$xc_p done # Build Makefile patching sed scripts. xc_s1="$xc_subdir/xc_script_1.tmp" xc_s2="$xc_subdir/xc_script_2.tmp" xc_s3="$xc_subdir/xc_script_3.tmp" cat >$xc_s1 <<\_EOT /^distclean[[ ]]*:/,/^[[^ ]][[^ ]]*:/{ s/^.*(DEPDIR)/___xc_depdir_line___/ } /^maintainer-clean[[ ]]*:/,/^[[^ ]][[^ ]]*:/{ s/^.*(DEPDIR)/___xc_depdir_line___/ } _EOT cat >$xc_s2 <<\_EOT /___xc_depdir_line___$/{ N /___xc_depdir_line___$/D } _EOT cat >$xc_s3 <<_EOT /^___xc_depdir_line___/{ r $xc_p d } _EOT # Apply patch to Makefile and cleanup. $SED -f "$xc_s1" "$xc_subdir/Makefile" >"$xc_subdir/Makefile.tmp1" $SED -f "$xc_s2" "$xc_subdir/Makefile.tmp1" >"$xc_subdir/Makefile.tmp2" $SED -f "$xc_s3" "$xc_subdir/Makefile.tmp2" >"$xc_subdir/Makefile.tmp3" if test -f "$xc_subdir/Makefile.tmp3"; then mv -f "$xc_subdir/Makefile.tmp3" "$xc_subdir/Makefile" fi test -f "$xc_subdir/Makefile.tmp1" && rm -f "$xc_subdir/Makefile.tmp1" test -f "$xc_subdir/Makefile.tmp2" && rm -f "$xc_subdir/Makefile.tmp2" test -f "$xc_subdir/Makefile.tmp3" && rm -f "$xc_subdir/Makefile.tmp3" test -f "$xc_p" && rm -f "$xc_p" test -f "$xc_s1" && rm -f "$xc_s1" test -f "$xc_s2" && rm -f "$xc_s2" test -f "$xc_s3" && rm -f "$xc_s3" fi done ## -------------------------------- ## ## End of distclean amending code ## ## -------------------------------- ## dnl m4_define([$0], [])[]dnl ]) dnl XC_AMEND_DISTCLEAN ([LIST-OF-SUBDIRS]) dnl ------------------------------------------------- dnl Public macro. dnl dnl This macro embeds shell code into configure script dnl that amends, at configure runtime, the distclean dnl and maintainer-clean targets of Makefiles located dnl in all subdirs given in the mandatory white-space dnl separated list argument. dnl dnl Embedding only takes place when using automake 1.14 dnl or newer, otherwise amending code is not included dnl in generated configure script. dnl dnl distclean and maintainer-clean targets are modified dnl to avoid unconditional removal of dependency subdirs dnl which triggers distclean and maintainer-clean errors dnl when using automake 'subdir-objects' option along dnl with per-target objects and source files existing in dnl multiple subdirs used for different build targets. dnl dnl New behavior first removes each dependency tracking dnl file independently, and only removes each dependency dnl subdir when it finds out that it no longer holds any dnl dependency tracking file. dnl dnl When configure option --disable-dependency-tracking dnl is used no amending takes place given that there are dnl no dependency tracking files. AC_DEFUN([XC_AMEND_DISTCLEAN], [dnl AC_PREREQ([2.50])dnl dnl m4_ifdef([_AC_OUTPUT_MAIN_LOOP], [m4_provide_if([_AC_OUTPUT_MAIN_LOOP], [], [m4_fatal([call to AC_OUTPUT needed before $0])])])dnl dnl m4_if([$#], [1], [], [m4_fatal([$0: wrong number of arguments])])dnl m4_if([$1], [], [m4_fatal([$0: missing argument])])dnl dnl AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl dnl m4_ifdef([_AM_PROG_CC_C_O], [ _XC_AMEND_DISTCLEAN_BODY([$1]) ])dnl m4_define([$0], [])[]dnl ]) curl-7.35.0/m4/libtool.m40000644000175000017500000106014412272122660011730 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv -f conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv -f $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv -f $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv -f $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv -f $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv -f \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv -f \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv -f \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv -f conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS curl-7.35.0/m4/xc-translit.m40000644000175000017500000001323712213173003012524 00000000000000#--------------------------------------------------------------------------- # # xc-translit.m4 # # Copyright (c) 2011 Daniel Stenberg # # 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 THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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. # #--------------------------------------------------------------------------- # File version for 'aclocal' use. Keep it a single number. # serial 2 dnl XC_SH_TR_SH (expression) dnl ------------------------------------------------- dnl Shell execution time transliteration of 'expression' dnl argument, where all non-alfanumeric characters are dnl converted to the underscore '_' character. dnl Normal shell expansion and substitution takes place dnl for given 'expression' at shell execution time before dnl transliteration is applied to it. AC_DEFUN([XC_SH_TR_SH], [`echo "$1" | sed 's/[[^a-zA-Z0-9_]]/_/g'`]) dnl XC_SH_TR_SH_EX (expression, [extra]) dnl ------------------------------------------------- dnl Like XC_SH_TR_SH but transliterating characters dnl given in 'extra' argument to lowercase 'p'. For dnl example [*+], [*], and [+] are valid 'extra' args. AC_DEFUN([XC_SH_TR_SH_EX], [ifelse([$2], [], [XC_SH_TR_SH([$1])], [`echo "$1" | sed 's/[[$2]]/p/g' | sed 's/[[^a-zA-Z0-9_]]/_/g'`])]) dnl XC_M4_TR_SH (expression) dnl ------------------------------------------------- dnl m4 execution time transliteration of 'expression' dnl argument, where all non-alfanumeric characters are dnl converted to the underscore '_' character. AC_DEFUN([XC_M4_TR_SH], [patsubst(XC_QPATSUBST(XC_QUOTE($1), [[^a-zA-Z0-9_]], [_]), [\(_\(.*\)_\)], [\2])]) dnl XC_M4_TR_SH_EX (expression, [extra]) dnl ------------------------------------------------- dnl Like XC_M4_TR_SH but transliterating characters dnl given in 'extra' argument to lowercase 'p'. For dnl example [*+], [*], and [+] are valid 'extra' args. AC_DEFUN([XC_M4_TR_SH_EX], [ifelse([$2], [], [XC_M4_TR_SH([$1])], [patsubst(XC_QPATSUBST(XC_QPATSUBST(XC_QUOTE($1), [[$2]], [p]), [[^a-zA-Z0-9_]], [_]), [\(_\(.*\)_\)], [\2])])]) dnl XC_SH_TR_CPP (expression) dnl ------------------------------------------------- dnl Shell execution time transliteration of 'expression' dnl argument, where all non-alfanumeric characters are dnl converted to the underscore '_' character and alnum dnl characters are converted to uppercase. dnl Normal shell expansion and substitution takes place dnl for given 'expression' at shell execution time before dnl transliteration is applied to it. AC_DEFUN([XC_SH_TR_CPP], [`echo "$1" | dnl sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' | dnl sed 's/[[^A-Z0-9_]]/_/g'`]) dnl XC_SH_TR_CPP_EX (expression, [extra]) dnl ------------------------------------------------- dnl Like XC_SH_TR_CPP but transliterating characters dnl given in 'extra' argument to uppercase 'P'. For dnl example [*+], [*], and [+] are valid 'extra' args. AC_DEFUN([XC_SH_TR_CPP_EX], [ifelse([$2], [], [XC_SH_TR_CPP([$1])], [`echo "$1" | dnl sed 's/[[$2]]/P/g' | dnl sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' | dnl sed 's/[[^A-Z0-9_]]/_/g'`])]) dnl XC_M4_TR_CPP (expression) dnl ------------------------------------------------- dnl m4 execution time transliteration of 'expression' dnl argument, where all non-alfanumeric characters are dnl converted to the underscore '_' character and alnum dnl characters are converted to uppercase. AC_DEFUN([XC_M4_TR_CPP], [patsubst(XC_QPATSUBST(XC_QTRANSLIT(XC_QUOTE($1), [abcdefghijklmnopqrstuvwxyz], [ABCDEFGHIJKLMNOPQRSTUVWXYZ]), [[^A-Z0-9_]], [_]), [\(_\(.*\)_\)], [\2])]) dnl XC_M4_TR_CPP_EX (expression, [extra]) dnl ------------------------------------------------- dnl Like XC_M4_TR_CPP but transliterating characters dnl given in 'extra' argument to uppercase 'P'. For dnl example [*+], [*], and [+] are valid 'extra' args. AC_DEFUN([XC_M4_TR_CPP_EX], [ifelse([$2], [], [XC_M4_TR_CPP([$1])], [patsubst(XC_QPATSUBST(XC_QTRANSLIT(XC_QPATSUBST(XC_QUOTE($1), [[$2]], [P]), [abcdefghijklmnopqrstuvwxyz], [ABCDEFGHIJKLMNOPQRSTUVWXYZ]), [[^A-Z0-9_]], [_]), [\(_\(.*\)_\)], [\2])])]) dnl XC_QUOTE (expression) dnl ------------------------------------------------- dnl Expands to quoted result of 'expression' expansion. AC_DEFUN([XC_QUOTE], [[$@]]) dnl XC_QPATSUBST (string, regexp[, repl]) dnl ------------------------------------------------- dnl Expands to quoted result of 'patsubst' expansion. AC_DEFUN([XC_QPATSUBST], [XC_QUOTE(patsubst([$1], [$2], [$3]))]) dnl XC_QTRANSLIT (string, chars, repl) dnl ------------------------------------------------- dnl Expands to quoted result of 'translit' expansion. AC_DEFUN([XC_QTRANSLIT], [XC_QUOTE(translit([$1], [$2], [$3]))]) curl-7.35.0/m4/curl-confopts.m40000644000175000017500000005064212213173003013053 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. # serial 19 dnl CURL_CHECK_OPTION_THREADED_RESOLVER dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-threaded-resolver or --disable-threaded-resolver, and dnl set shell variable want_thres as appropriate. AC_DEFUN([CURL_CHECK_OPTION_THREADED_RESOLVER], [ AC_MSG_CHECKING([whether to enable the threaded resolver]) OPT_THRES="default" AC_ARG_ENABLE(threaded_resolver, AC_HELP_STRING([--enable-threaded-resolver],[Enable threaded resolver]) AC_HELP_STRING([--disable-threaded-resolver],[Disable threaded resolver]), OPT_THRES=$enableval) case "$OPT_THRES" in yes) dnl --enable-threaded-resolver option used want_thres="yes" ;; *) dnl configure option not specified want_thres="no" ;; esac AC_MSG_RESULT([$want_thres]) ]) dnl CURL_CHECK_OPTION_ARES dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-ares or --disable-ares, and dnl set shell variable want_ares as appropriate. AC_DEFUN([CURL_CHECK_OPTION_ARES], [ dnl AC_BEFORE([$0],[CURL_CHECK_OPTION_THREADS])dnl AC_BEFORE([$0],[CURL_CHECK_LIB_ARES])dnl AC_MSG_CHECKING([whether to enable c-ares for DNS lookups]) OPT_ARES="default" AC_ARG_ENABLE(ares, AC_HELP_STRING([--enable-ares@<:@=PATH@:>@],[Enable c-ares for DNS lookups]) AC_HELP_STRING([--disable-ares],[Disable c-ares for DNS lookups]), OPT_ARES=$enableval) case "$OPT_ARES" in no) dnl --disable-ares option used want_ares="no" ;; default) dnl configure option not specified want_ares="no" ;; *) dnl --enable-ares option used want_ares="yes" if test -n "$enableval" && test "$enableval" != "yes"; then want_ares_path="$enableval" fi ;; esac AC_MSG_RESULT([$want_ares]) ]) dnl CURL_CHECK_OPTION_CURLDEBUG dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-curldebug or --disable-curldebug, and set dnl shell variable want_curldebug value as appropriate. AC_DEFUN([CURL_CHECK_OPTION_CURLDEBUG], [ AC_BEFORE([$0],[CURL_CHECK_CURLDEBUG])dnl AC_MSG_CHECKING([whether to enable curl debug memory tracking]) OPT_CURLDEBUG_BUILD="default" AC_ARG_ENABLE(curldebug, AC_HELP_STRING([--enable-curldebug],[Enable curl debug memory tracking]) AC_HELP_STRING([--disable-curldebug],[Disable curl debug memory tracking]), OPT_CURLDEBUG_BUILD=$enableval) case "$OPT_CURLDEBUG_BUILD" in no) dnl --disable-curldebug option used want_curldebug="no" AC_MSG_RESULT([no]) ;; default) dnl configure's curldebug option not specified. Initially we will dnl handle this as a a request to use the same setting as option dnl --enable-debug. IOW, initially, for debug-enabled builds dnl this will be handled as a request to enable curldebug if dnl possible, and for debug-disabled builds this will be handled dnl as a request to disable curldebug. if test "$want_debug" = "yes"; then AC_MSG_RESULT([(assumed) yes]) else AC_MSG_RESULT([no]) fi want_curldebug_assumed="yes" want_curldebug="$want_debug" ;; *) dnl --enable-curldebug option used. dnl The use of this option value is a request to enable curl's dnl debug memory tracking for the libcurl library. This can only dnl be done when some requisites are simultaneously satisfied. dnl Later on, these requisites are verified and if they are not dnl fully satisfied the option will be ignored and act as if dnl --disable-curldebug had been given setting shell variable dnl want_curldebug to 'no'. want_curldebug="yes" AC_MSG_RESULT([yes]) ;; esac ]) dnl CURL_CHECK_OPTION_DEBUG dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-debug or --disable-debug, and set shell dnl variable want_debug value as appropriate. AC_DEFUN([CURL_CHECK_OPTION_DEBUG], [ AC_BEFORE([$0],[CURL_CHECK_OPTION_WARNINGS])dnl AC_BEFORE([$0],[CURL_CHECK_OPTION_CURLDEBUG])dnl AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl AC_MSG_CHECKING([whether to enable debug build options]) OPT_DEBUG_BUILD="default" AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[Enable debug build options]) AC_HELP_STRING([--disable-debug],[Disable debug build options]), OPT_DEBUG_BUILD=$enableval) case "$OPT_DEBUG_BUILD" in no) dnl --disable-debug option used want_debug="no" ;; default) dnl configure option not specified want_debug="no" ;; *) dnl --enable-debug option used want_debug="yes" ;; esac AC_MSG_RESULT([$want_debug]) ]) dnl CURL_CHECK_OPTION_OPTIMIZE dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-optimize or --disable-optimize, and set dnl shell variable want_optimize value as appropriate. AC_DEFUN([CURL_CHECK_OPTION_OPTIMIZE], [ AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl AC_MSG_CHECKING([whether to enable compiler optimizer]) OPT_COMPILER_OPTIMIZE="default" AC_ARG_ENABLE(optimize, AC_HELP_STRING([--enable-optimize],[Enable compiler optimizations]) AC_HELP_STRING([--disable-optimize],[Disable compiler optimizations]), OPT_COMPILER_OPTIMIZE=$enableval) case "$OPT_COMPILER_OPTIMIZE" in no) dnl --disable-optimize option used. We will handle this as dnl a request to disable compiler optimizations if possible. dnl If the compiler is known CFLAGS and CPPFLAGS will be dnl overridden, otherwise this can not be honored. want_optimize="no" AC_MSG_RESULT([no]) ;; default) dnl configure's optimize option not specified. Initially we will dnl handle this as a a request contrary to configure's setting dnl for --enable-debug. IOW, initially, for debug-enabled builds dnl this will be handled as a request to disable optimizations if dnl possible, and for debug-disabled builds this will be handled dnl initially as a request to enable optimizations if possible. dnl Finally, if the compiler is known and CFLAGS and CPPFLAGS do dnl not have any optimizer flag the request will be honored, in dnl any other case the request can not be honored. dnl IOW, existing optimizer flags defined in CFLAGS or CPPFLAGS dnl will always take precedence over any initial assumption. if test "$want_debug" = "yes"; then want_optimize="assume_no" AC_MSG_RESULT([(assumed) no]) else want_optimize="assume_yes" AC_MSG_RESULT([(assumed) yes]) fi ;; *) dnl --enable-optimize option used. We will handle this as dnl a request to enable compiler optimizations if possible. dnl If the compiler is known CFLAGS and CPPFLAGS will be dnl overridden, otherwise this can not be honored. want_optimize="yes" AC_MSG_RESULT([yes]) ;; esac ]) dnl CURL_CHECK_OPTION_SYMBOL_HIDING dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-symbol-hiding or --disable-symbol-hiding, dnl setting shell variable want_symbol_hiding value. AC_DEFUN([CURL_CHECK_OPTION_SYMBOL_HIDING], [ AC_BEFORE([$0],[CURL_CHECK_COMPILER_SYMBOL_HIDING])dnl AC_MSG_CHECKING([whether to enable hiding of library internal symbols]) OPT_SYMBOL_HIDING="default" AC_ARG_ENABLE(symbol-hiding, AC_HELP_STRING([--enable-symbol-hiding],[Enable hiding of library internal symbols]) AC_HELP_STRING([--disable-symbol-hiding],[Disable hiding of library internal symbols]), OPT_SYMBOL_HIDING=$enableval) AC_ARG_ENABLE(hidden-symbols, AC_HELP_STRING([--enable-hidden-symbols],[To be deprecated, use --enable-symbol-hiding]) AC_HELP_STRING([--disable-hidden-symbols],[To be deprecated, use --disable-symbol-hiding]), OPT_SYMBOL_HIDING=$enableval) case "$OPT_SYMBOL_HIDING" in no) dnl --disable-symbol-hiding option used. dnl This is an indication to not attempt hiding of library internal dnl symbols. Default symbol visibility will be used, which normally dnl exposes all library internal symbols. want_symbol_hiding="no" AC_MSG_RESULT([no]) ;; default) dnl configure's symbol-hiding option not specified. dnl Handle this as if --enable-symbol-hiding option was given. want_symbol_hiding="yes" AC_MSG_RESULT([yes]) ;; *) dnl --enable-symbol-hiding option used. dnl This is an indication to attempt hiding of library internal dnl symbols. This is only supported on some compilers/linkers. want_symbol_hiding="yes" AC_MSG_RESULT([yes]) ;; esac ]) dnl CURL_CHECK_OPTION_THREADS dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-threads or --disable-threads, and dnl set shell variable want_threads as appropriate. dnl AC_DEFUN([CURL_CHECK_OPTION_THREADS], [ dnl AC_BEFORE([$0],[CURL_CHECK_LIB_THREADS])dnl dnl AC_MSG_CHECKING([whether to enable threads for DNS lookups]) dnl OPT_THREADS="default" dnl AC_ARG_ENABLE(threads, dnl AC_HELP_STRING([--enable-threads@<:@=PATH@:>@],[Enable threads for DNS lookups]) dnl AC_HELP_STRING([--disable-threads],[Disable threads for DNS lookups]), dnl OPT_THREADS=$enableval) dnl case "$OPT_THREADS" in dnl no) dnl dnl --disable-threads option used dnl want_threads="no" dnl AC_MSG_RESULT([no]) dnl ;; dnl default) dnl dnl configure option not specified dnl want_threads="no" dnl AC_MSG_RESULT([(assumed) no]) dnl ;; dnl *) dnl dnl --enable-threads option used dnl want_threads="yes" dnl want_threads_path="$enableval" dnl AC_MSG_RESULT([yes]) dnl ;; dnl esac dnl # dnl if test "$want_ares" = "assume_yes"; then dnl if test "$want_threads" = "yes"; then dnl AC_MSG_CHECKING([whether to ignore c-ares enabling assumed setting]) dnl AC_MSG_RESULT([yes]) dnl want_ares="no" dnl else dnl want_ares="yes" dnl fi dnl fi dnl if test "$want_threads" = "yes" && test "$want_ares" = "yes"; then dnl AC_MSG_ERROR([options --enable-ares and --enable-threads are mutually exclusive, at most one may be enabled.]) dnl fi dnl ]) dnl CURL_CHECK_OPTION_WARNINGS dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-warnings or --disable-warnings, and set dnl shell variable want_warnings as appropriate. AC_DEFUN([CURL_CHECK_OPTION_WARNINGS], [ AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl AC_BEFORE([$0],[CURL_CHECK_OPTION_WERROR])dnl AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl AC_MSG_CHECKING([whether to enable strict compiler warnings]) OPT_COMPILER_WARNINGS="default" AC_ARG_ENABLE(warnings, AC_HELP_STRING([--enable-warnings],[Enable strict compiler warnings]) AC_HELP_STRING([--disable-warnings],[Disable strict compiler warnings]), OPT_COMPILER_WARNINGS=$enableval) case "$OPT_COMPILER_WARNINGS" in no) dnl --disable-warnings option used want_warnings="no" ;; default) dnl configure option not specified, so dnl use same setting as --enable-debug want_warnings="$want_debug" ;; *) dnl --enable-warnings option used want_warnings="yes" ;; esac AC_MSG_RESULT([$want_warnings]) ]) dnl CURL_CHECK_OPTION_WERROR dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-werror or --disable-werror, and set dnl shell variable want_werror as appropriate. AC_DEFUN([CURL_CHECK_OPTION_WERROR], [ AC_BEFORE([$0],[CURL_CHECK_COMPILER])dnl AC_MSG_CHECKING([whether to enable compiler warnings as errors]) OPT_COMPILER_WERROR="default" AC_ARG_ENABLE(werror, AC_HELP_STRING([--enable-werror],[Enable compiler warnings as errors]) AC_HELP_STRING([--disable-werror],[Disable compiler warnings as errors]), OPT_COMPILER_WERROR=$enableval) case "$OPT_COMPILER_WERROR" in no) dnl --disable-werror option used want_werror="no" ;; default) dnl configure option not specified want_werror="no" ;; *) dnl --enable-werror option used want_werror="yes" ;; esac AC_MSG_RESULT([$want_werror]) ]) dnl CURL_CHECK_NONBLOCKING_SOCKET dnl ------------------------------------------------- dnl Check for how to set a socket into non-blocking state. AC_DEFUN([CURL_CHECK_NONBLOCKING_SOCKET], [ AC_REQUIRE([CURL_CHECK_FUNC_FCNTL])dnl AC_REQUIRE([CURL_CHECK_FUNC_IOCTL])dnl AC_REQUIRE([CURL_CHECK_FUNC_IOCTLSOCKET])dnl AC_REQUIRE([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL])dnl AC_REQUIRE([CURL_CHECK_FUNC_SETSOCKOPT])dnl # tst_method="unknown" AC_MSG_CHECKING([how to set a socket into non-blocking mode]) if test "x$ac_cv_func_fcntl_o_nonblock" = "xyes"; then tst_method="fcntl O_NONBLOCK" elif test "x$ac_cv_func_ioctl_fionbio" = "xyes"; then tst_method="ioctl FIONBIO" elif test "x$ac_cv_func_ioctlsocket_fionbio" = "xyes"; then tst_method="ioctlsocket FIONBIO" elif test "x$ac_cv_func_ioctlsocket_camel_fionbio" = "xyes"; then tst_method="IoctlSocket FIONBIO" elif test "x$ac_cv_func_setsockopt_so_nonblock" = "xyes"; then tst_method="setsockopt SO_NONBLOCK" fi AC_MSG_RESULT([$tst_method]) if test "$tst_method" = "unknown"; then AC_MSG_WARN([cannot determine non-blocking socket method.]) fi ]) dnl CURL_CONFIGURE_SYMBOL_HIDING dnl ------------------------------------------------- dnl Depending on --enable-symbol-hiding or --disable-symbol-hiding dnl configure option, and compiler capability to actually honor such dnl option, this will modify compiler flags as appropriate and also dnl provide needed definitions for configuration and Makefile.am files. dnl This macro should not be used until all compilation tests have dnl been done to prevent interferences on other tests. AC_DEFUN([CURL_CONFIGURE_SYMBOL_HIDING], [ AC_MSG_CHECKING([whether hiding of library internal symbols will actually happen]) CFLAG_CURL_SYMBOL_HIDING="" doing_symbol_hiding="no" if test x"$ac_cv_native_windows" != "xyes" && test "$want_symbol_hiding" = "yes" && test "$supports_symbol_hiding" = "yes"; then doing_symbol_hiding="yes" CFLAG_CURL_SYMBOL_HIDING="$symbol_hiding_CFLAGS" AC_DEFINE_UNQUOTED(CURL_EXTERN_SYMBOL, $symbol_hiding_EXTERN, [Definition to make a library symbol externally visible.]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi AM_CONDITIONAL(DOING_CURL_SYMBOL_HIDING, test x$doing_symbol_hiding = xyes) AC_SUBST(CFLAG_CURL_SYMBOL_HIDING) ]) dnl CURL_CHECK_LIB_ARES dnl ------------------------------------------------- dnl When c-ares library support has been requested, dnl performs necessary checks and adjustsments needed dnl to enable support of this library. AC_DEFUN([CURL_CHECK_LIB_ARES], [ # if test "$want_ares" = "yes"; then dnl c-ares library support has been requested clean_CPPFLAGS="$CPPFLAGS" clean_LDFLAGS="$LDFLAGS" clean_LIBS="$LIBS" embedded_ares="unknown" configure_runpath=`pwd` embedded_ares_builddir="$configure_runpath/ares" if test -n "$want_ares_path"; then dnl c-ares library path has been specified ares_CPPFLAGS="-I$want_ares_path/include" ares_LDFLAGS="-L$want_ares_path/lib" ares_LIBS="-lcares" else dnl c-ares library path has not been given if test -d "$srcdir/ares"; then dnl c-ares sources embedded in curl tree embedded_ares="yes" AC_CONFIG_SUBDIRS(ares) dnl c-ares has installable configured header files, path dnl inclusion fully done in makefiles for in-tree builds. ares_CPPFLAGS="" ares_LDFLAGS="-L$embedded_ares_builddir" ares_LIBS="-lcares" else dnl c-ares path not specified, use defaults ares_CPPFLAGS="" ares_LDFLAGS="" ares_LIBS="-lcares" fi fi # CPPFLAGS="$ares_CPPFLAGS $clean_CPPFLAGS" LDFLAGS="$ares_LDFLAGS $clean_LDFLAGS" LIBS="$ares_LIBS $clean_LIBS" # if test "$embedded_ares" != "yes"; then dnl check if c-ares new enough when not using an embedded dnl source tree one which normally has not been built yet. AC_MSG_CHECKING([that c-ares is good and recent enough]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #include /* set of dummy functions in case c-ares was built with debug */ void curl_dofree() { } void curl_sclose() { } void curl_domalloc() { } void curl_docalloc() { } void curl_socket() { } ]],[[ ares_channel channel; ares_cancel(channel); /* added in 1.2.0 */ ares_process_fd(channel, 0, 0); /* added in 1.4.0 */ ares_dup(&channel, channel); /* added in 1.6.0 */ ]]) ],[ AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) AC_MSG_ERROR([c-ares library defective or too old]) dnl restore initial settings CPPFLAGS="$clean_CPPFLAGS" LDFLAGS="$clean_LDFLAGS" LIBS="$clean_LIBS" # prevent usage want_ares="no" ]) fi if test "$want_ares" = "yes"; then dnl finally c-ares will be used AC_DEFINE(USE_ARES, 1, [Define to enable c-ares support]) AC_SUBST([USE_ARES], [1]) curl_res_msg="c-ares" fi fi ]) dnl CURL_CHECK_OPTION_NTLM_WB dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-ntlm-wb or --disable-ntlm-wb, and set dnl shell variable want_ntlm_wb and want_ntlm_wb_file dnl as appropriate. AC_DEFUN([CURL_CHECK_OPTION_NTLM_WB], [ AC_BEFORE([$0],[CURL_CHECK_NTLM_WB])dnl OPT_NTLM_WB="default" AC_ARG_ENABLE(ntlm-wb, AC_HELP_STRING([--enable-ntlm-wb@<:@=FILE@:>@],[Enable NTLM delegation to winbind's ntlm_auth helper, where FILE is ntlm_auth's absolute filename (default: /usr/bin/ntlm_auth)]) AC_HELP_STRING([--disable-ntlm-wb],[Disable NTLM delegation to winbind's ntlm_auth helper]), OPT_NTLM_WB=$enableval) want_ntlm_wb_file="/usr/bin/ntlm_auth" case "$OPT_NTLM_WB" in no) dnl --disable-ntlm-wb option used want_ntlm_wb="no" ;; default) dnl configure option not specified want_ntlm_wb="yes" ;; *) dnl --enable-ntlm-wb option used want_ntlm_wb="yes" if test -n "$enableval" && test "$enableval" != "yes"; then want_ntlm_wb_file="$enableval" fi ;; esac ]) dnl CURL_CHECK_NTLM_WB dnl ------------------------------------------------- dnl Check if support for NTLM delegation to winbind's dnl ntlm_auth helper will finally be enabled depending dnl on given configure options and target platform. AC_DEFUN([CURL_CHECK_NTLM_WB], [ AC_REQUIRE([CURL_CHECK_OPTION_NTLM_WB])dnl AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl AC_MSG_CHECKING([whether to enable NTLM delegation to winbind's helper]) if test "$ac_cv_native_windows" = "yes" || test "x$SSL_ENABLED" = "x"; then want_ntlm_wb_file="" want_ntlm_wb="no" fi AC_MSG_RESULT([$want_ntlm_wb]) if test "$want_ntlm_wb" = "yes"; then AC_DEFINE(NTLM_WB_ENABLED, 1, [Define to enable NTLM delegation to winbind's ntlm_auth helper.]) AC_DEFINE_UNQUOTED(NTLM_WB_FILE, "$want_ntlm_wb_file", [Define absolute filename for winbind's ntlm_auth helper.]) NTLM_WB_ENABLED=1 fi ]) curl-7.35.0/m4/zz40-xc-ovr.m40000644000175000017500000004351312213173003012277 00000000000000#--------------------------------------------------------------------------- # # zz40-xc-ovr.m4 # # Copyright (c) 2013 Daniel Stenberg # # 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 THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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. # #--------------------------------------------------------------------------- # serial 1 dnl The funny name of this file is intentional in order to make it dnl sort alphabetically after any libtool, autoconf or automake dnl provided .m4 macro file that might get copied into this same dnl subdirectory. This allows that macro (re)definitions from this dnl file may override those provided in other files. dnl Version macros dnl ------------------------------------------------- dnl Public macros. m4_define([XC_CONFIGURE_PREAMBLE_VER_MAJOR],[1])dnl m4_define([XC_CONFIGURE_PREAMBLE_VER_MINOR],[0])dnl dnl _XC_CFG_PRE_PREAMBLE dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_CFG_PRE_PREAMBLE], [ ## -------------------------------- ## @%:@@%:@ [XC_CONFIGURE_PREAMBLE] ver: []dnl XC_CONFIGURE_PREAMBLE_VER_MAJOR.[]dnl XC_CONFIGURE_PREAMBLE_VER_MINOR ## ## -------------------------------- ## xc_configure_preamble_ver_major='XC_CONFIGURE_PREAMBLE_VER_MAJOR' xc_configure_preamble_ver_minor='XC_CONFIGURE_PREAMBLE_VER_MINOR' # # Set IFS to space, tab and newline. # xc_space=' ' xc_tab=' ' xc_newline=' ' IFS="$xc_space$xc_tab$xc_newline" # # Set internationalization behavior variables. # LANG='C' LC_ALL='C' LANGUAGE='C' export LANG export LC_ALL export LANGUAGE # # Some useful variables. # xc_msg_warn='configure: WARNING:' xc_msg_abrt='Can not continue.' xc_msg_err='configure: error:' ]) dnl _XC_CFG_PRE_BASIC_CHK_CMD_ECHO dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'echo' command dnl is available, otherwise aborts execution. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO], [dnl AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl # # Verify that 'echo' command is available, otherwise abort. # xc_tst_str='unknown' (`echo "$xc_tst_str" >/dev/null 2>&1`) && xc_tst_str='success' case "x$xc_tst_str" in @%:@ (( xsuccess) : ;; *) # Try built-in echo, and fail. echo "$xc_msg_err 'echo' command not found. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_CMD_TEST dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'test' command dnl is available, otherwise aborts execution. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_TEST], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl # # Verify that 'test' command is available, otherwise abort. # xc_tst_str='unknown' (`test -n "$xc_tst_str" >/dev/null 2>&1`) && xc_tst_str='success' case "x$xc_tst_str" in @%:@ (( xsuccess) : ;; *) echo "$xc_msg_err 'test' command not found. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_VAR_PATH dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'PATH' variable dnl is set, otherwise aborts execution. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_VAR_PATH], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl # # Verify that 'PATH' variable is set, otherwise abort. # xc_tst_str='unknown' (`test -n "$PATH" >/dev/null 2>&1`) && xc_tst_str='success' case "x$xc_tst_str" in @%:@ (( xsuccess) : ;; *) echo "$xc_msg_err 'PATH' variable not set. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_CMD_EXPR dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'expr' command dnl is available, otherwise aborts execution. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl # # Verify that 'expr' command is available, otherwise abort. # xc_tst_str='unknown' xc_tst_str=`expr "$xc_tst_str" : '.*' 2>/dev/null` case "x$xc_tst_str" in @%:@ (( x7) : ;; *) echo "$xc_msg_err 'expr' command not found. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_UTIL_SED dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'sed' utility dnl is found within 'PATH', otherwise aborts execution. dnl dnl This 'sed' is required in order to allow configure dnl script bootstrapping itself. No fancy testing for a dnl proper 'sed' this early, that should be done later. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_SED], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl # # Verify that 'sed' utility is found within 'PATH', otherwise abort. # xc_tst_str='unknown' xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \ | sed -e 's:unknown:success:' 2>/dev/null` case "x$xc_tst_str" in @%:@ (( xsuccess) : ;; *) echo "$xc_msg_err 'sed' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_UTIL_GREP dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'grep' utility dnl is found within 'PATH', otherwise aborts execution. dnl dnl This 'grep' is required in order to allow configure dnl script bootstrapping itself. No fancy testing for a dnl proper 'grep' this early, that should be done later. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl # # Verify that 'grep' utility is found within 'PATH', otherwise abort. # xc_tst_str='unknown' (`echo "$xc_tst_str" 2>/dev/null \ | grep 'unknown' >/dev/null 2>&1`) && xc_tst_str='success' case "x$xc_tst_str" in @%:@ (( xsuccess) : ;; *) echo "$xc_msg_err 'grep' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_UTIL_TR dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'tr' utility dnl is found within 'PATH', otherwise aborts execution. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_TR], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl # # Verify that 'tr' utility is found within 'PATH', otherwise abort. # xc_tst_str="${xc_tab}98s7u6c5c4e3s2s10" xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \ | tr -d "0123456789$xc_tab" 2>/dev/null` case "x$xc_tst_str" in @%:@ (( xsuccess) : ;; *) echo "$xc_msg_err 'tr' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_UTIL_WC dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'wc' utility dnl is found within 'PATH', otherwise aborts execution. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_WC], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl # # Verify that 'wc' utility is found within 'PATH', otherwise abort. # xc_tst_str='unknown unknown unknown unknown' xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \ | wc -w 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null` case "x$xc_tst_str" in @%:@ (( x4) : ;; *) echo "$xc_msg_err 'wc' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_UTIL_CAT dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'cat' utility dnl is found within 'PATH', otherwise aborts execution. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl # # Verify that 'cat' utility is found within 'PATH', otherwise abort. # xc_tst_str='unknown' xc_tst_str=`cat <<_EOT 2>/dev/null \ | wc -l 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null unknown unknown unknown _EOT` case "x$xc_tst_str" in @%:@ (( x3) : ;; *) echo "$xc_msg_err 'cat' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_CHECK_PATH_SEPARATOR dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that computes the path separator dnl and stores the result in 'PATH_SEPARATOR', unless dnl the user has already set it with a non-empty value. dnl dnl This path separator is the symbol used to separate dnl or diferentiate paths inside the 'PATH' environment dnl variable. dnl dnl Non-empty user provided 'PATH_SEPARATOR' always dnl overrides the auto-detected one. AC_DEFUN([_XC_CFG_PRE_CHECK_PATH_SEPARATOR], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl # # Auto-detect and set 'PATH_SEPARATOR', unless it is already non-empty set. # # Directory count in 'PATH' when using a colon separator. xc_tst_dirs_col='x' xc_tst_prev_IFS=$IFS; IFS=':' for xc_tst_dir in $PATH; do IFS=$xc_tst_prev_IFS xc_tst_dirs_col="x$xc_tst_dirs_col" done IFS=$xc_tst_prev_IFS xc_tst_dirs_col=`expr "$xc_tst_dirs_col" : '.*'` # Directory count in 'PATH' when using a semicolon separator. xc_tst_dirs_sem='x' xc_tst_prev_IFS=$IFS; IFS=';' for xc_tst_dir in $PATH; do IFS=$xc_tst_prev_IFS xc_tst_dirs_sem="x$xc_tst_dirs_sem" done IFS=$xc_tst_prev_IFS xc_tst_dirs_sem=`expr "$xc_tst_dirs_sem" : '.*'` if test $xc_tst_dirs_sem -eq $xc_tst_dirs_col; then # When both counting methods give the same result we do not want to # chose one over the other, and consider auto-detection not possible. if test -z "$PATH_SEPARATOR"; then # Stop dead until user provides 'PATH_SEPARATOR' definition. echo "$xc_msg_err 'PATH_SEPARATOR' variable not set. $xc_msg_abrt" >&2 exit 1 fi else # Separator with the greater directory count is the auto-detected one. if test $xc_tst_dirs_sem -gt $xc_tst_dirs_col; then xc_tst_auto_separator=';' else xc_tst_auto_separator=':' fi if test -z "$PATH_SEPARATOR"; then # Simply use the auto-detected one when not already set. PATH_SEPARATOR=$xc_tst_auto_separator elif test "x$PATH_SEPARATOR" != "x$xc_tst_auto_separator"; then echo "$xc_msg_warn 'PATH_SEPARATOR' does not match auto-detected one." >&2 fi fi xc_PATH_SEPARATOR=$PATH_SEPARATOR AC_SUBST([PATH_SEPARATOR])dnl ]) dnl _XC_CFG_PRE_POSTLUDE dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_CFG_PRE_POSTLUDE], [dnl AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl AC_REQUIRE([_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl dnl xc_configure_preamble_result='yes' ]) dnl XC_CONFIGURE_PREAMBLE dnl ------------------------------------------------- dnl Public macro. dnl dnl This macro emits shell code which does some dnl very basic checks related with the availability dnl of some commands and utilities needed to allow dnl configure script bootstrapping itself when using dnl these to figure out other settings. Also emits dnl code that performs PATH_SEPARATOR auto-detection dnl and sets its value unless it is already set with dnl a non-empty value. dnl dnl These basic checks are intended to be placed and dnl executed as early as possible in the resulting dnl configure script, and as such these must be pure dnl and portable shell code. dnl dnl This macro may be used directly, or indirectly dnl when using other macros that AC_REQUIRE it such dnl as XC_CHECK_PATH_SEPARATOR. dnl dnl Currently the mechanism used to ensure that this dnl macro expands early enough in generated configure dnl script is making it override autoconf and libtool dnl PATH_SEPARATOR check. AC_DEFUN([XC_CONFIGURE_PREAMBLE], [dnl AC_PREREQ([2.50])dnl dnl AC_BEFORE([$0],[_XC_CFG_PRE_PREAMBLE])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl AC_BEFORE([$0],[_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl AC_BEFORE([$0],[_XC_CFG_PRE_POSTLUDE])dnl dnl AC_BEFORE([$0],[AC_CHECK_TOOL])dnl AC_BEFORE([$0],[AC_CHECK_PROG])dnl AC_BEFORE([$0],[AC_CHECK_TOOLS])dnl AC_BEFORE([$0],[AC_CHECK_PROGS])dnl dnl AC_BEFORE([$0],[AC_PATH_TOOL])dnl AC_BEFORE([$0],[AC_PATH_PROG])dnl AC_BEFORE([$0],[AC_PATH_PROGS])dnl dnl AC_BEFORE([$0],[AC_PROG_SED])dnl AC_BEFORE([$0],[AC_PROG_GREP])dnl AC_BEFORE([$0],[AC_PROG_LN_S])dnl AC_BEFORE([$0],[AC_PROG_MKDIR_P])dnl AC_BEFORE([$0],[AC_PROG_INSTALL])dnl AC_BEFORE([$0],[AC_PROG_MAKE_SET])dnl AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl dnl AC_BEFORE([$0],[LT_INIT])dnl AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl dnl AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl AC_REQUIRE([_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl AC_REQUIRE([_XC_CFG_PRE_POSTLUDE])dnl dnl m4_pattern_forbid([^_*XC])dnl m4_define([$0],[])dnl ]) dnl Override autoconf and libtool PATH_SEPARATOR check dnl ------------------------------------------------- dnl Macros overriding. dnl dnl This is done to ensure that the same check is dnl used across different autoconf versions and to dnl allow expansion of XC_CONFIGURE_PREAMBLE macro dnl early enough in the generated configure script. dnl dnl Override when using autoconf 2.53 and newer. dnl m4_ifdef([_AS_PATH_SEPARATOR_PREPARE], [dnl m4_undefine([_AS_PATH_SEPARATOR_PREPARE])dnl m4_defun([_AS_PATH_SEPARATOR_PREPARE], [dnl AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl m4_define([$0],[])dnl ])dnl ]) dnl dnl Override when using autoconf 2.50 to 2.52 dnl m4_ifdef([_AC_INIT_PREPARE_FS_SEPARATORS], [dnl m4_undefine([_AC_INIT_PREPARE_FS_SEPARATORS])dnl m4_defun([_AC_INIT_PREPARE_FS_SEPARATORS], [dnl AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl ac_path_separator=$PATH_SEPARATOR m4_define([$0],[])dnl ])dnl ]) dnl dnl Override when using libtool 1.4.2 dnl m4_ifdef([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], [dnl m4_undefine([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl m4_defun([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], [dnl AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl lt_cv_sys_path_separator=$PATH_SEPARATOR m4_define([$0],[])dnl ])dnl ]) dnl XC_CHECK_PATH_SEPARATOR dnl ------------------------------------------------- dnl Public macro. dnl dnl Usage of this macro ensures that generated configure dnl script uses the same PATH_SEPARATOR check irrespective dnl of autoconf or libtool version being used to generate dnl configure script. dnl dnl Emits shell code that computes the path separator dnl and stores the result in 'PATH_SEPARATOR', unless dnl the user has already set it with a non-empty value. dnl dnl This path separator is the symbol used to separate dnl or diferentiate paths inside the 'PATH' environment dnl variable. dnl dnl Non-empty user provided 'PATH_SEPARATOR' always dnl overrides the auto-detected one. dnl dnl Strictly speaking the check is done in two steps. The dnl first, which does the actual check, takes place in dnl XC_CONFIGURE_PREAMBLE macro and happens very early in dnl generated configure script. The second one shows and dnl logs the result of the check into config.log at a later dnl configure stage. Placement of this second stage in dnl generated configure script will be done where first dnl direct or indirect usage of this macro happens. AC_DEFUN([XC_CHECK_PATH_SEPARATOR], [dnl AC_PREREQ([2.50])dnl dnl AC_BEFORE([$0],[AC_CHECK_TOOL])dnl AC_BEFORE([$0],[AC_CHECK_PROG])dnl AC_BEFORE([$0],[AC_CHECK_TOOLS])dnl AC_BEFORE([$0],[AC_CHECK_PROGS])dnl dnl AC_BEFORE([$0],[AC_PATH_TOOL])dnl AC_BEFORE([$0],[AC_PATH_PROG])dnl AC_BEFORE([$0],[AC_PATH_PROGS])dnl dnl AC_BEFORE([$0],[AC_PROG_SED])dnl AC_BEFORE([$0],[AC_PROG_GREP])dnl AC_BEFORE([$0],[AC_PROG_LN_S])dnl AC_BEFORE([$0],[AC_PROG_MKDIR_P])dnl AC_BEFORE([$0],[AC_PROG_INSTALL])dnl AC_BEFORE([$0],[AC_PROG_MAKE_SET])dnl AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl dnl AC_BEFORE([$0],[LT_INIT])dnl AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl dnl AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl dnl # # Check that 'XC_CONFIGURE_PREAMBLE' has already run. # if test -z "$xc_configure_preamble_result"; then AC_MSG_ERROR([xc_configure_preamble_result not set (internal problem)]) fi # # Check that 'PATH_SEPARATOR' has already been set. # if test -z "$xc_PATH_SEPARATOR"; then AC_MSG_ERROR([xc_PATH_SEPARATOR not set (internal problem)]) fi if test -z "$PATH_SEPARATOR"; then AC_MSG_ERROR([PATH_SEPARATOR not set (internal or config.site problem)]) fi AC_MSG_CHECKING([for path separator]) AC_MSG_RESULT([$PATH_SEPARATOR]) if test "x$PATH_SEPARATOR" != "x$xc_PATH_SEPARATOR"; then AC_MSG_CHECKING([for initial path separator]) AC_MSG_RESULT([$xc_PATH_SEPARATOR]) AC_MSG_ERROR([path separator mismatch (internal or config.site problem)]) fi dnl m4_pattern_forbid([^_*XC])dnl m4_define([$0],[])dnl ]) curl-7.35.0/m4/curl-compilers.m40000644000175000017500000013615012262353672013234 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. # serial 66 dnl CURL_CHECK_COMPILER dnl ------------------------------------------------- dnl Verify if the C compiler being used is known. AC_DEFUN([CURL_CHECK_COMPILER], [ # compiler_id="unknown" compiler_num="0" # flags_dbg_all="unknown" flags_dbg_yes="unknown" flags_dbg_off="unknown" flags_opt_all="unknown" flags_opt_yes="unknown" flags_opt_off="unknown" # flags_prefer_cppflags="no" # CURL_CHECK_COMPILER_DEC_C CURL_CHECK_COMPILER_HPUX_C CURL_CHECK_COMPILER_IBM_C CURL_CHECK_COMPILER_INTEL_C CURL_CHECK_COMPILER_CLANG CURL_CHECK_COMPILER_GNU_C CURL_CHECK_COMPILER_LCC CURL_CHECK_COMPILER_SGI_MIPSPRO_C CURL_CHECK_COMPILER_SGI_MIPS_C CURL_CHECK_COMPILER_SUNPRO_C CURL_CHECK_COMPILER_TINY_C CURL_CHECK_COMPILER_WATCOM_C # if test "$compiler_id" = "unknown"; then cat <<_EOF 1>&2 *** *** Warning: This configure script does not have information about the *** compiler you are using, relative to the flags required to enable or *** disable generation of debug info, optimization options or warnings. *** *** Whatever settings are present in CFLAGS will be used for this run. *** *** If you wish to help the cURL project to better support your compiler *** you can report this and the required info on the libcurl development *** mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/ *** _EOF fi ]) dnl CURL_CHECK_COMPILER_CLANG dnl ------------------------------------------------- dnl Verify if compiler being used is clang. AC_DEFUN([CURL_CHECK_COMPILER_CLANG], [ AC_BEFORE([$0],[CURL_CHECK_COMPILER_GNU_C])dnl AC_MSG_CHECKING([if compiler is clang]) CURL_CHECK_DEF([__clang__], [], [silent]) if test "$curl_cv_have_def___clang__" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="CLANG" clangver=`$CC -dumpversion` clangvhi=`echo $clangver | cut -d . -f1` clangvlo=`echo $clangver | cut -d . -f2` compiler_num=`(expr $clangvhi "*" 100 + $clangvlo) 2>/dev/null` flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_all="$flags_dbg_all -ggdb" flags_dbg_all="$flags_dbg_all -gstabs" flags_dbg_all="$flags_dbg_all -gstabs+" flags_dbg_all="$flags_dbg_all -gcoff" flags_dbg_all="$flags_dbg_all -gxcoff" flags_dbg_all="$flags_dbg_all -gdwarf-2" flags_dbg_all="$flags_dbg_all -gvms" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -Os -O3 -O4" flags_opt_yes="-Os" flags_opt_off="-O0" else AC_MSG_RESULT([no]) fi ]) dnl CURL_CHECK_COMPILER_DEC_C dnl ------------------------------------------------- dnl Verify if compiler being used is DEC C. AC_DEFUN([CURL_CHECK_COMPILER_DEC_C], [ AC_MSG_CHECKING([if compiler is DEC/Compaq/HP C]) CURL_CHECK_DEF([__DECC], [], [silent]) CURL_CHECK_DEF([__DECC_VER], [], [silent]) if test "$curl_cv_have_def___DECC" = "yes" && test "$curl_cv_have_def___DECC_VER" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="DEC_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g2" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -O4" flags_opt_yes="-O1" flags_opt_off="-O0" else AC_MSG_RESULT([no]) fi ]) dnl CURL_CHECK_COMPILER_GNU_C dnl ------------------------------------------------- dnl Verify if compiler being used is GNU C. AC_DEFUN([CURL_CHECK_COMPILER_GNU_C], [ AC_REQUIRE([CURL_CHECK_COMPILER_INTEL_C])dnl AC_REQUIRE([CURL_CHECK_COMPILER_CLANG])dnl AC_MSG_CHECKING([if compiler is GNU C]) CURL_CHECK_DEF([__GNUC__], [], [silent]) if test "$curl_cv_have_def___GNUC__" = "yes" && test "$compiler_id" = "unknown"; then AC_MSG_RESULT([yes]) compiler_id="GNU_C" gccver=`$CC -dumpversion` gccvhi=`echo $gccver | cut -d . -f1` gccvlo=`echo $gccver | cut -d . -f2` compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null` flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_all="$flags_dbg_all -ggdb" flags_dbg_all="$flags_dbg_all -gstabs" flags_dbg_all="$flags_dbg_all -gstabs+" flags_dbg_all="$flags_dbg_all -gcoff" flags_dbg_all="$flags_dbg_all -gxcoff" flags_dbg_all="$flags_dbg_all -gdwarf-2" flags_dbg_all="$flags_dbg_all -gvms" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" flags_opt_yes="-O2" flags_opt_off="-O0" CURL_CHECK_DEF([_WIN32], [], [silent]) else AC_MSG_RESULT([no]) fi ]) dnl CURL_CHECK_COMPILER_HPUX_C dnl ------------------------------------------------- dnl Verify if compiler being used is HP-UX C. AC_DEFUN([CURL_CHECK_COMPILER_HPUX_C], [ AC_MSG_CHECKING([if compiler is HP-UX C]) CURL_CHECK_DEF([__HP_cc], [], [silent]) if test "$curl_cv_have_def___HP_cc" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="HP_UX_C" flags_dbg_all="-g -s" flags_dbg_yes="-g" flags_dbg_off="-s" flags_opt_all="-O +O0 +O1 +O2 +O3 +O4" flags_opt_yes="+O2" flags_opt_off="+O0" else AC_MSG_RESULT([no]) fi ]) dnl CURL_CHECK_COMPILER_IBM_C dnl ------------------------------------------------- dnl Verify if compiler being used is IBM C. AC_DEFUN([CURL_CHECK_COMPILER_IBM_C], [ AC_MSG_CHECKING([if compiler is IBM C]) CURL_CHECK_DEF([__IBMC__], [], [silent]) if test "$curl_cv_have_def___IBMC__" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="IBM_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -O4 -O5" flags_opt_all="$flags_opt_all -qnooptimize" flags_opt_all="$flags_opt_all -qoptimize=0" flags_opt_all="$flags_opt_all -qoptimize=1" flags_opt_all="$flags_opt_all -qoptimize=2" flags_opt_all="$flags_opt_all -qoptimize=3" flags_opt_all="$flags_opt_all -qoptimize=4" flags_opt_all="$flags_opt_all -qoptimize=5" flags_opt_yes="-O2" flags_opt_off="-qnooptimize" flags_prefer_cppflags="yes" else AC_MSG_RESULT([no]) fi ]) dnl CURL_CHECK_COMPILER_INTEL_C dnl ------------------------------------------------- dnl Verify if compiler being used is Intel C. AC_DEFUN([CURL_CHECK_COMPILER_INTEL_C], [ AC_BEFORE([$0],[CURL_CHECK_COMPILER_GNU_C])dnl AC_MSG_CHECKING([if compiler is Intel C]) CURL_CHECK_DEF([__INTEL_COMPILER], [], [silent]) if test "$curl_cv_have_def___INTEL_COMPILER" = "yes"; then AC_MSG_RESULT([yes]) compiler_num="$curl_cv_def___INTEL_COMPILER" CURL_CHECK_DEF([__unix__], [], [silent]) if test "$curl_cv_have_def___unix__" = "yes"; then compiler_id="INTEL_UNIX_C" flags_dbg_all="-g -g0" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" flags_opt_yes="-O2" flags_opt_off="-O0" else compiler_id="INTEL_WINDOWS_C" flags_dbg_all="/ZI /Zi /zI /zi /ZD /Zd /zD /zd /Z7 /z7 /Oy /Oy-" flags_dbg_all="$flags_dbg_all /debug" flags_dbg_all="$flags_dbg_all /debug:none" flags_dbg_all="$flags_dbg_all /debug:minimal" flags_dbg_all="$flags_dbg_all /debug:partial" flags_dbg_all="$flags_dbg_all /debug:full" flags_dbg_all="$flags_dbg_all /debug:semantic_stepping" flags_dbg_all="$flags_dbg_all /debug:extended" flags_dbg_yes="/Zi /Oy-" flags_dbg_off="/debug:none /Oy-" flags_opt_all="/O /O0 /O1 /O2 /O3 /Od /Og /Og- /Oi /Oi-" flags_opt_yes="/O2" flags_opt_off="/Od" fi else AC_MSG_RESULT([no]) fi ]) dnl CURL_CHECK_COMPILER_LCC dnl ------------------------------------------------- dnl Verify if compiler being used is LCC. AC_DEFUN([CURL_CHECK_COMPILER_LCC], [ AC_MSG_CHECKING([if compiler is LCC]) CURL_CHECK_DEF([__LCC__], [], [silent]) if test "$curl_cv_have_def___LCC__" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="LCC" flags_dbg_all="-g" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="" flags_opt_yes="" flags_opt_off="" else AC_MSG_RESULT([no]) fi ]) dnl CURL_CHECK_COMPILER_SGI_MIPS_C dnl ------------------------------------------------- dnl Verify if compiler being used is SGI MIPS C. AC_DEFUN([CURL_CHECK_COMPILER_SGI_MIPS_C], [ AC_REQUIRE([CURL_CHECK_COMPILER_SGI_MIPSPRO_C])dnl AC_MSG_CHECKING([if compiler is SGI MIPS C]) CURL_CHECK_DEF([__GNUC__], [], [silent]) CURL_CHECK_DEF([__sgi], [], [silent]) if test "$curl_cv_have_def___GNUC__" = "no" && test "$curl_cv_have_def___sgi" = "yes" && test "$compiler_id" = "unknown"; then AC_MSG_RESULT([yes]) compiler_id="SGI_MIPS_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast" flags_opt_yes="-O2" flags_opt_off="-O0" else AC_MSG_RESULT([no]) fi ]) dnl CURL_CHECK_COMPILER_SGI_MIPSPRO_C dnl ------------------------------------------------- dnl Verify if compiler being used is SGI MIPSpro C. AC_DEFUN([CURL_CHECK_COMPILER_SGI_MIPSPRO_C], [ AC_BEFORE([$0],[CURL_CHECK_COMPILER_SGI_MIPS_C])dnl AC_MSG_CHECKING([if compiler is SGI MIPSpro C]) CURL_CHECK_DEF([__GNUC__], [], [silent]) CURL_CHECK_DEF([_COMPILER_VERSION], [], [silent]) CURL_CHECK_DEF([_SGI_COMPILER_VERSION], [], [silent]) if test "$curl_cv_have_def___GNUC__" = "no" && (test "$curl_cv_have_def__SGI_COMPILER_VERSION" = "yes" || test "$curl_cv_have_def__COMPILER_VERSION" = "yes"); then AC_MSG_RESULT([yes]) compiler_id="SGI_MIPSPRO_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast" flags_opt_yes="-O2" flags_opt_off="-O0" else AC_MSG_RESULT([no]) fi ]) dnl CURL_CHECK_COMPILER_SUNPRO_C dnl ------------------------------------------------- dnl Verify if compiler being used is SunPro C. AC_DEFUN([CURL_CHECK_COMPILER_SUNPRO_C], [ AC_MSG_CHECKING([if compiler is SunPro C]) CURL_CHECK_DEF([__SUNPRO_C], [], [silent]) if test "$curl_cv_have_def___SUNPRO_C" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="SUNPRO_C" flags_dbg_all="-g -s" flags_dbg_yes="-g" flags_dbg_off="-s" flags_opt_all="-O -xO -xO1 -xO2 -xO3 -xO4 -xO5" flags_opt_yes="-xO2" flags_opt_off="" else AC_MSG_RESULT([no]) fi ]) dnl CURL_CHECK_COMPILER_TINY_C dnl ------------------------------------------------- dnl Verify if compiler being used is Tiny C. AC_DEFUN([CURL_CHECK_COMPILER_TINY_C], [ AC_MSG_CHECKING([if compiler is Tiny C]) CURL_CHECK_DEF([__TINYC__], [], [silent]) if test "$curl_cv_have_def___TINYC__" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="TINY_C" flags_dbg_all="-g -b" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="" flags_opt_yes="" flags_opt_off="" else AC_MSG_RESULT([no]) fi ]) dnl CURL_CHECK_COMPILER_WATCOM_C dnl ------------------------------------------------- dnl Verify if compiler being used is Watcom C. AC_DEFUN([CURL_CHECK_COMPILER_WATCOM_C], [ AC_MSG_CHECKING([if compiler is Watcom C]) CURL_CHECK_DEF([__WATCOMC__], [], [silent]) if test "$curl_cv_have_def___WATCOMC__" = "yes"; then AC_MSG_RESULT([yes]) CURL_CHECK_DEF([__UNIX__], [], [silent]) if test "$curl_cv_have_def___UNIX__" = "yes"; then compiler_id="WATCOM_UNIX_C" flags_dbg_all="-g1 -g1+ -g2 -g3" flags_dbg_yes="-g2" flags_dbg_off="" flags_opt_all="-O0 -O1 -O2 -O3" flags_opt_yes="-O2" flags_opt_off="-O0" else compiler_id="WATCOM_WINDOWS_C" flags_dbg_all="" flags_dbg_yes="" flags_dbg_off="" flags_opt_all="" flags_opt_yes="" flags_opt_off="" fi else AC_MSG_RESULT([no]) fi ]) dnl CURL_CONVERT_INCLUDE_TO_ISYSTEM dnl ------------------------------------------------- dnl Changes standard include paths present in CFLAGS dnl and CPPFLAGS into isystem include paths. This is dnl done to prevent GNUC from generating warnings on dnl headers from these locations, although on ancient dnl GNUC versions these warnings are not silenced. AC_DEFUN([CURL_CONVERT_INCLUDE_TO_ISYSTEM], [ AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl AC_REQUIRE([CURL_CHECK_COMPILER])dnl if test "$compiler_id" = "GNU_C" || test "$compiler_id" = "CLANG"; then tmp_has_include="no" tmp_chg_FLAGS="$CFLAGS" for word1 in $tmp_chg_FLAGS; do case "$word1" in -I*) tmp_has_include="yes" ;; esac done if test "$tmp_has_include" = "yes"; then tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` CFLAGS="$tmp_chg_FLAGS" squeeze CFLAGS fi tmp_has_include="no" tmp_chg_FLAGS="$CPPFLAGS" for word1 in $tmp_chg_FLAGS; do case "$word1" in -I*) tmp_has_include="yes" ;; esac done if test "$tmp_has_include" = "yes"; then tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` CPPFLAGS="$tmp_chg_FLAGS" squeeze CPPFLAGS fi fi ]) dnl CURL_COMPILER_WORKS_IFELSE ([ACTION-IF-WORKS], [ACTION-IF-NOT-WORKS]) dnl ------------------------------------------------- dnl Verify if the C compiler seems to work with the dnl settings that are 'active' at the time the test dnl is performed. AC_DEFUN([CURL_COMPILER_WORKS_IFELSE], [ dnl compilation capability verification tmp_compiler_works="unknown" AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ int i = 1; return i; ]]) ],[ tmp_compiler_works="yes" ],[ tmp_compiler_works="no" echo " " >&6 sed 's/^/cc-fail: /' conftest.err >&6 echo " " >&6 ]) dnl linking capability verification if test "$tmp_compiler_works" = "yes"; then AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ int i = 1; return i; ]]) ],[ tmp_compiler_works="yes" ],[ tmp_compiler_works="no" echo " " >&6 sed 's/^/link-fail: /' conftest.err >&6 echo " " >&6 ]) fi dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tmp_compiler_works" = "yes"; then AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ # ifdef __STDC__ # include # endif ]],[[ int i = 0; exit(i); ]]) ],[ tmp_compiler_works="yes" ],[ tmp_compiler_works="no" echo " " >&6 echo "run-fail: test program exited with status $ac_status" >&6 echo " " >&6 ]) fi dnl branch upon test result if test "$tmp_compiler_works" = "yes"; then ifelse($1,,:,[$1]) ifelse($2,,,[else $2]) fi ]) dnl CURL_SET_COMPILER_BASIC_OPTS dnl ------------------------------------------------- dnl Sets compiler specific options/flags which do not dnl depend on configure's debug, optimize or warnings dnl options. AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ AC_REQUIRE([CURL_CHECK_COMPILER])dnl AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl # if test "$compiler_id" != "unknown"; then # if test "$compiler_id" = "GNU_C" || test "$compiler_id" = "CLANG"; then CURL_CONVERT_INCLUDE_TO_ISYSTEM fi # tmp_save_CPPFLAGS="$CPPFLAGS" tmp_save_CFLAGS="$CFLAGS" tmp_CPPFLAGS="" tmp_CFLAGS="" # case "$compiler_id" in # CLANG) # dnl Disable warnings for unused arguments, otherwise clang will dnl warn about compile-time arguments used during link-time, like dnl -O and -g and -pedantic. tmp_CFLAGS="$tmp_CFLAGS -Qunused-arguments" ;; # DEC_C) # dnl Select strict ANSI C compiler mode tmp_CFLAGS="$tmp_CFLAGS -std1" dnl Turn off optimizer ANSI C aliasing rules tmp_CFLAGS="$tmp_CFLAGS -noansi_alias" dnl Generate warnings for missing function prototypes tmp_CFLAGS="$tmp_CFLAGS -warnprotos" dnl Change some warnings into fatal errors tmp_CFLAGS="$tmp_CFLAGS -msg_fatal toofewargs,toomanyargs" ;; # GNU_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # HP_UX_C) # dnl Disallow run-time dereferencing of null pointers tmp_CFLAGS="$tmp_CFLAGS -z" dnl Disable some remarks dnl #4227: padding struct with n bytes to align member dnl #4255: padding size of struct with n bytes to alignment boundary tmp_CFLAGS="$tmp_CFLAGS +W 4227,4255" ;; # IBM_C) # dnl Ensure that compiler optimizations are always thread-safe. tmp_CPPFLAGS="$tmp_CPPFLAGS -qthreaded" dnl Disable type based strict aliasing optimizations, using worst dnl case aliasing assumptions when compiling. Type based aliasing dnl would restrict the lvalues that could be safely used to access dnl a data object. tmp_CPPFLAGS="$tmp_CPPFLAGS -qnoansialias" dnl Force compiler to stop after the compilation phase, without dnl generating an object code file when compilation has errors. tmp_CPPFLAGS="$tmp_CPPFLAGS -qhalt=e" ;; # INTEL_UNIX_C) # dnl On unix this compiler uses gcc's header files, so dnl we select ANSI C89 dialect plus GNU extensions. tmp_CFLAGS="$tmp_CFLAGS -std=gnu89" dnl Change some warnings into errors dnl #140: too many arguments in function call dnl #147: declaration is incompatible with 'previous one' dnl #165: too few arguments in function call dnl #266: function declared implicitly tmp_CPPFLAGS="$tmp_CPPFLAGS -we140,147,165,266" dnl Disable some remarks dnl #279: controlling expression is constant dnl #981: operands are evaluated in unspecified order dnl #1469: "cc" clobber ignored tmp_CPPFLAGS="$tmp_CPPFLAGS -wd279,981,1469" ;; # INTEL_WINDOWS_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # LCC) # dnl Disallow run-time dereferencing of null pointers tmp_CFLAGS="$tmp_CFLAGS -n" ;; # SGI_MIPS_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # SGI_MIPSPRO_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # SUNPRO_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # TINY_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # WATCOM_UNIX_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # WATCOM_WINDOWS_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # esac # squeeze tmp_CPPFLAGS squeeze tmp_CFLAGS # if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then AC_MSG_CHECKING([if compiler accepts some basic options]) CPPFLAGS="$tmp_save_CPPFLAGS $tmp_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" squeeze CPPFLAGS squeeze CFLAGS CURL_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) AC_MSG_NOTICE([compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS]) ],[ AC_MSG_RESULT([no]) AC_MSG_WARN([compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS]) dnl restore initial settings CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" ]) fi # fi ]) dnl CURL_SET_COMPILER_DEBUG_OPTS dnl ------------------------------------------------- dnl Sets compiler specific options/flags which depend dnl on configure's debug option. AC_DEFUN([CURL_SET_COMPILER_DEBUG_OPTS], [ AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl AC_REQUIRE([CURL_CHECK_COMPILER])dnl AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl # if test "$compiler_id" != "unknown"; then # tmp_save_CFLAGS="$CFLAGS" tmp_save_CPPFLAGS="$CPPFLAGS" # tmp_options="" tmp_CFLAGS="$CFLAGS" tmp_CPPFLAGS="$CPPFLAGS" CURL_VAR_STRIP([tmp_CFLAGS],[$flags_dbg_all]) CURL_VAR_STRIP([tmp_CPPFLAGS],[$flags_dbg_all]) # if test "$want_debug" = "yes"; then AC_MSG_CHECKING([if compiler accepts debug enabling options]) tmp_options="$flags_dbg_yes" fi if test "$want_debug" = "no"; then AC_MSG_CHECKING([if compiler accepts debug disabling options]) tmp_options="$flags_dbg_off" fi # if test "$flags_prefer_cppflags" = "yes"; then CPPFLAGS="$tmp_CPPFLAGS $tmp_options" CFLAGS="$tmp_CFLAGS" else CPPFLAGS="$tmp_CPPFLAGS" CFLAGS="$tmp_CFLAGS $tmp_options" fi squeeze CPPFLAGS squeeze CFLAGS CURL_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) AC_MSG_NOTICE([compiler options added: $tmp_options]) ],[ AC_MSG_RESULT([no]) AC_MSG_WARN([compiler options rejected: $tmp_options]) dnl restore initial settings CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" ]) # fi ]) dnl CURL_SET_COMPILER_OPTIMIZE_OPTS dnl ------------------------------------------------- dnl Sets compiler specific options/flags which depend dnl on configure's optimize option. AC_DEFUN([CURL_SET_COMPILER_OPTIMIZE_OPTS], [ AC_REQUIRE([CURL_CHECK_OPTION_OPTIMIZE])dnl AC_REQUIRE([CURL_CHECK_COMPILER])dnl AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl # if test "$compiler_id" != "unknown"; then # tmp_save_CFLAGS="$CFLAGS" tmp_save_CPPFLAGS="$CPPFLAGS" # tmp_options="" tmp_CFLAGS="$CFLAGS" tmp_CPPFLAGS="$CPPFLAGS" honor_optimize_option="yes" # dnl If optimization request setting has not been explicitly specified, dnl it has been derived from the debug setting and initially assumed. dnl This initially assumed optimizer setting will finally be ignored dnl if CFLAGS or CPPFLAGS already hold optimizer flags. This implies dnl that an initially assumed optimizer setting might not be honored. # if test "$want_optimize" = "assume_no" || test "$want_optimize" = "assume_yes"; then AC_MSG_CHECKING([if compiler optimizer assumed setting might be used]) CURL_VAR_MATCH_IFELSE([tmp_CFLAGS],[$flags_opt_all],[ honor_optimize_option="no" ]) CURL_VAR_MATCH_IFELSE([tmp_CPPFLAGS],[$flags_opt_all],[ honor_optimize_option="no" ]) AC_MSG_RESULT([$honor_optimize_option]) if test "$honor_optimize_option" = "yes"; then if test "$want_optimize" = "assume_yes"; then want_optimize="yes" fi if test "$want_optimize" = "assume_no"; then want_optimize="no" fi fi fi # if test "$honor_optimize_option" = "yes"; then CURL_VAR_STRIP([tmp_CFLAGS],[$flags_opt_all]) CURL_VAR_STRIP([tmp_CPPFLAGS],[$flags_opt_all]) if test "$want_optimize" = "yes"; then AC_MSG_CHECKING([if compiler accepts optimizer enabling options]) tmp_options="$flags_opt_yes" fi if test "$want_optimize" = "no"; then AC_MSG_CHECKING([if compiler accepts optimizer disabling options]) tmp_options="$flags_opt_off" fi if test "$flags_prefer_cppflags" = "yes"; then CPPFLAGS="$tmp_CPPFLAGS $tmp_options" CFLAGS="$tmp_CFLAGS" else CPPFLAGS="$tmp_CPPFLAGS" CFLAGS="$tmp_CFLAGS $tmp_options" fi squeeze CPPFLAGS squeeze CFLAGS CURL_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) AC_MSG_NOTICE([compiler options added: $tmp_options]) ],[ AC_MSG_RESULT([no]) AC_MSG_WARN([compiler options rejected: $tmp_options]) dnl restore initial settings CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" ]) fi # fi ]) dnl CURL_SET_COMPILER_WARNING_OPTS dnl ------------------------------------------------- dnl Sets compiler options/flags which depend on dnl configure's warnings given option. AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ AC_REQUIRE([CURL_CHECK_OPTION_WARNINGS])dnl AC_REQUIRE([CURL_CHECK_COMPILER])dnl AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl # if test "$compiler_id" != "unknown"; then # tmp_save_CPPFLAGS="$CPPFLAGS" tmp_save_CFLAGS="$CFLAGS" tmp_CPPFLAGS="" tmp_CFLAGS="" # case "$compiler_id" in # CLANG) # if test "$want_warnings" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS -pedantic" tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra" tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings" tmp_CFLAGS="$tmp_CFLAGS -Wshadow" tmp_CFLAGS="$tmp_CFLAGS -Winline -Wnested-externs" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes" tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long" tmp_CFLAGS="$tmp_CFLAGS -Wfloat-equal" tmp_CFLAGS="$tmp_CFLAGS -Wno-multichar -Wsign-compare" tmp_CFLAGS="$tmp_CFLAGS -Wundef" tmp_CFLAGS="$tmp_CFLAGS -Wno-format-nonliteral" tmp_CFLAGS="$tmp_CFLAGS -Wendif-labels -Wstrict-prototypes" tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" tmp_CFLAGS="$tmp_CFLAGS -Wshorten-64-to-32" # dnl Only clang 1.1 or later if test "$compiler_num" -ge "101"; then tmp_CFLAGS="$tmp_CFLAGS -Wunused" fi fi ;; # DEC_C) # if test "$want_warnings" = "yes"; then dnl Select a higher warning level than default level2 tmp_CFLAGS="$tmp_CFLAGS -msg_enable level3" fi ;; # GNU_C) # if test "$want_warnings" = "yes"; then # dnl Do not enable -pedantic when cross-compiling with a gcc older dnl than 3.0, to avoid warnings from third party system headers. if test "x$cross_compiling" != "xyes" || test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS -pedantic" fi # dnl Set of options we believe *ALL* gcc versions support: tmp_CFLAGS="$tmp_CFLAGS -Wall -W" # dnl Only gcc 1.4 or later if test "$compiler_num" -ge "104"; then tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings" dnl If not cross-compiling with a gcc older than 3.0 if test "x$cross_compiling" != "xyes" || test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS -Wunused -Wshadow" fi fi # dnl Only gcc 2.7 or later if test "$compiler_num" -ge "207"; then tmp_CFLAGS="$tmp_CFLAGS -Winline -Wnested-externs" dnl If not cross-compiling with a gcc older than 3.0 if test "x$cross_compiling" != "xyes" || test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes" fi fi # dnl Only gcc 2.95 or later if test "$compiler_num" -ge "295"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long" fi # dnl Only gcc 2.96 or later if test "$compiler_num" -ge "296"; then tmp_CFLAGS="$tmp_CFLAGS -Wfloat-equal" tmp_CFLAGS="$tmp_CFLAGS -Wno-multichar -Wsign-compare" dnl -Wundef used only if gcc is 2.96 or later since we get dnl lots of "`_POSIX_C_SOURCE' is not defined" in system dnl headers with gcc 2.95.4 on FreeBSD 4.9 tmp_CFLAGS="$tmp_CFLAGS -Wundef" fi # dnl Only gcc 2.97 or later if test "$compiler_num" -ge "297"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-format-nonliteral" fi # dnl Only gcc 3.0 or later if test "$compiler_num" -ge "300"; then 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. tmp_CFLAGS="$tmp_CFLAGS" fi # dnl Only gcc 3.3 or later if test "$compiler_num" -ge "303"; then tmp_CFLAGS="$tmp_CFLAGS -Wendif-labels -Wstrict-prototypes" fi # dnl Only gcc 3.4 or later if test "$compiler_num" -ge "304"; then tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" fi # dnl Only gcc 4.0 or later if test "$compiler_num" -ge "400"; then tmp_CFLAGS="$tmp_CFLAGS -Wstrict-aliasing=3" fi # dnl Only gcc 4.2 or later if test "$compiler_num" -ge "402"; then tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" fi # dnl Only gcc 4.3 or later if test "$compiler_num" -ge "403"; then tmp_CFLAGS="$tmp_CFLAGS -Wtype-limits -Wold-style-declaration" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-parameter-type -Wempty-body" tmp_CFLAGS="$tmp_CFLAGS -Wclobbered -Wignored-qualifiers" tmp_CFLAGS="$tmp_CFLAGS -Wconversion -Wno-sign-conversion -Wvla" fi # dnl Only gcc 4.5 or later if test "$compiler_num" -ge "405"; then dnl Only windows targets if test "$curl_cv_have_def__WIN32" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-pedantic-ms-format" fi fi # fi # dnl Do not issue warnings for code in system include paths. if test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" else dnl When cross-compiling with a gcc older than 3.0, disable dnl some warnings triggered on third party system headers. if test "x$cross_compiling" = "xyes"; then if test "$compiler_num" -ge "104"; then dnl gcc 1.4 or later tmp_CFLAGS="$tmp_CFLAGS -Wno-unused -Wno-shadow" fi if test "$compiler_num" -ge "207"; then dnl gcc 2.7 or later tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-declarations" tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-prototypes" fi fi fi ;; # HP_UX_C) # if test "$want_warnings" = "yes"; then dnl Issue all warnings tmp_CFLAGS="$tmp_CFLAGS +w1" fi ;; # IBM_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # INTEL_UNIX_C) # if test "$want_warnings" = "yes"; then if test "$compiler_num" -gt "600"; then dnl Show errors, warnings, and remarks tmp_CPPFLAGS="$tmp_CPPFLAGS -Wall -w2" dnl Perform extra compile-time code checking tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcheck" dnl Warn on nested comments tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcomment" dnl Show warnings relative to deprecated features tmp_CPPFLAGS="$tmp_CPPFLAGS -Wdeprecated" dnl Enable warnings for missing prototypes tmp_CPPFLAGS="$tmp_CPPFLAGS -Wmissing-prototypes" dnl Enable warnings for 64-bit portability issues tmp_CPPFLAGS="$tmp_CPPFLAGS -Wp64" dnl Enable warnings for questionable pointer arithmetic tmp_CPPFLAGS="$tmp_CPPFLAGS -Wpointer-arith" dnl Check for function return typw issues tmp_CPPFLAGS="$tmp_CPPFLAGS -Wreturn-type" dnl Warn on variable declarations hiding a previous one tmp_CPPFLAGS="$tmp_CPPFLAGS -Wshadow" dnl Warn when a variable is used before initialized tmp_CPPFLAGS="$tmp_CPPFLAGS -Wuninitialized" dnl Warn if a declared function is not used tmp_CPPFLAGS="$tmp_CPPFLAGS -Wunused-function" fi fi dnl Disable using EBP register in optimizations tmp_CFLAGS="$tmp_CFLAGS -fno-omit-frame-pointer" dnl Disable use of ANSI C aliasing rules in optimizations tmp_CFLAGS="$tmp_CFLAGS -fno-strict-aliasing" dnl Value-safe optimizations on floating-point data tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" dnl Only icc 10.0 or later if test "$compiler_num" -ge "1000"; then dnl Disable vectorizer diagnostic information tmp_CFLAGS="$tmp_CFLAGS -vec-report0" fi ;; # INTEL_WINDOWS_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # LCC) # if test "$want_warnings" = "yes"; then dnl Highest warning level is double -A, next is single -A. dnl Due to the big number of warnings these trigger on third dnl party header files it is impractical for us to use any of dnl them here. If you want them simply define it in CPPFLAGS. tmp_CFLAGS="$tmp_CFLAGS" fi ;; # SGI_MIPS_C) # if test "$want_warnings" = "yes"; then dnl Perform stricter semantic and lint-like checks tmp_CFLAGS="$tmp_CFLAGS -fullwarn" fi ;; # SGI_MIPSPRO_C) # if test "$want_warnings" = "yes"; then dnl Perform stricter semantic and lint-like checks tmp_CFLAGS="$tmp_CFLAGS -fullwarn" dnl Disable some remarks dnl #1209: controlling expression is constant tmp_CFLAGS="$tmp_CFLAGS -woff 1209" fi ;; # SUNPRO_C) # if test "$want_warnings" = "yes"; then dnl Perform stricter semantic and lint-like checks tmp_CFLAGS="$tmp_CFLAGS -v" fi ;; # TINY_C) # if test "$want_warnings" = "yes"; then dnl Activate all warnings tmp_CFLAGS="$tmp_CFLAGS -Wall" dnl Make string constants be of type const char * tmp_CFLAGS="$tmp_CFLAGS -Wwrite-strings" dnl Warn use of unsupported GCC features ignored by TCC tmp_CFLAGS="$tmp_CFLAGS -Wunsupported" fi ;; # WATCOM_UNIX_C) # if test "$want_warnings" = "yes"; then dnl Issue all warnings tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra" fi ;; # WATCOM_WINDOWS_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # esac # squeeze tmp_CPPFLAGS squeeze tmp_CFLAGS # if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then AC_MSG_CHECKING([if compiler accepts strict warning options]) CPPFLAGS="$tmp_save_CPPFLAGS $tmp_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" squeeze CPPFLAGS squeeze CFLAGS CURL_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) AC_MSG_NOTICE([compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS]) ],[ AC_MSG_RESULT([no]) AC_MSG_WARN([compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS]) dnl restore initial settings CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" ]) fi # fi ]) dnl CURL_SHFUNC_SQUEEZE dnl ------------------------------------------------- dnl Declares a shell function squeeze() which removes dnl redundant whitespace out of a shell variable. AC_DEFUN([CURL_SHFUNC_SQUEEZE], [ squeeze() { _sqz_result="" eval _sqz_input=\[$][$]1 for _sqz_token in $_sqz_input; do if test -z "$_sqz_result"; then _sqz_result="$_sqz_token" else _sqz_result="$_sqz_result $_sqz_token" fi done eval [$]1=\$_sqz_result return 0 } ]) dnl CURL_CHECK_CURLDEBUG dnl ------------------------------------------------- dnl Settings which depend on configure's curldebug given dnl option, and other additional configure pre-requisites. dnl Actually the curl debug memory tracking feature can dnl only be used/enabled when libcurl is built as a static dnl library or as a shared one on those systems on which dnl shared libraries support undefined symbols. AC_DEFUN([CURL_CHECK_CURLDEBUG], [ AC_REQUIRE([XC_LIBTOOL])dnl AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl supports_curldebug="unknown" if test "$want_curldebug" = "yes"; then if test "x$enable_shared" != "xno" && test "x$enable_shared" != "xyes"; then AC_MSG_WARN([unknown enable_shared setting.]) supports_curldebug="no" fi if test "x$enable_static" != "xno" && test "x$enable_static" != "xyes"; then AC_MSG_WARN([unknown enable_static setting.]) supports_curldebug="no" fi if test "$supports_curldebug" != "no"; then if test "$enable_shared" = "yes" && test "x$xc_lt_shlib_use_no_undefined" = 'xyes'; then supports_curldebug="no" AC_MSG_WARN([shared library does not support undefined symbols.]) fi fi fi # if test "$want_curldebug" = "yes"; then AC_MSG_CHECKING([if curl debug memory tracking can be enabled]) test "$supports_curldebug" = "no" || supports_curldebug="yes" AC_MSG_RESULT([$supports_curldebug]) if test "$supports_curldebug" = "no"; then AC_MSG_WARN([cannot enable curl debug memory tracking.]) want_curldebug="no" fi fi # if test "$want_curldebug" = "yes"; then CPPFLAGS="-DCURLDEBUG $CPPFLAGS" squeeze CPPFLAGS fi if test "$want_debug" = "yes"; then CPPFLAGS="-DDEBUGBUILD $CPPFLAGS" squeeze CPPFLAGS fi ]) dnl CURL_CHECK_COMPILER_HALT_ON_ERROR dnl ------------------------------------------------- dnl Verifies if the compiler actually halts after the dnl compilation phase without generating any object dnl code file, when the source compiles with errors. AC_DEFUN([CURL_CHECK_COMPILER_HALT_ON_ERROR], [ AC_MSG_CHECKING([if compiler halts on compilation errors]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ force compilation error ]]) ],[ AC_MSG_RESULT([no]) AC_MSG_ERROR([compiler does not halt on compilation errors.]) ],[ AC_MSG_RESULT([yes]) ]) ]) dnl CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE dnl ------------------------------------------------- dnl Verifies if the compiler actually halts after the dnl compilation phase without generating any object dnl code file, when the source code tries to define a dnl type for a constant array with negative dimension. AC_DEFUN([CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE], [ AC_REQUIRE([CURL_CHECK_COMPILER_HALT_ON_ERROR])dnl AC_MSG_CHECKING([if compiler halts on negative sized arrays]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ typedef char bad_t[sizeof(char) == sizeof(int) ? -1 : -1 ]; ]],[[ bad_t dummy; ]]) ],[ AC_MSG_RESULT([no]) AC_MSG_ERROR([compiler does not halt on negative sized arrays.]) ],[ AC_MSG_RESULT([yes]) ]) ]) dnl CURL_CHECK_COMPILER_STRUCT_MEMBER_SIZE dnl ------------------------------------------------- dnl Verifies if the compiler is capable of handling the dnl size of a struct member, struct which is a function dnl result, as a compilation-time condition inside the dnl type definition of a constant array. AC_DEFUN([CURL_CHECK_COMPILER_STRUCT_MEMBER_SIZE], [ AC_REQUIRE([CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE])dnl AC_MSG_CHECKING([if compiler struct member size checking works]) tst_compiler_check_one_works="unknown" AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ struct mystruct { int mi; char mc; struct mystruct *next; }; struct mystruct myfunc(); typedef char good_t1[sizeof(myfunc().mi) == sizeof(int) ? 1 : -1 ]; typedef char good_t2[sizeof(myfunc().mc) == sizeof(char) ? 1 : -1 ]; ]],[[ good_t1 dummy1; good_t2 dummy2; ]]) ],[ tst_compiler_check_one_works="yes" ],[ tst_compiler_check_one_works="no" sed 's/^/cc-src: /' conftest.$ac_ext >&6 sed 's/^/cc-err: /' conftest.err >&6 ]) tst_compiler_check_two_works="unknown" AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ struct mystruct { int mi; char mc; struct mystruct *next; }; struct mystruct myfunc(); typedef char bad_t1[sizeof(myfunc().mi) != sizeof(int) ? 1 : -1 ]; typedef char bad_t2[sizeof(myfunc().mc) != sizeof(char) ? 1 : -1 ]; ]],[[ bad_t1 dummy1; bad_t2 dummy2; ]]) ],[ tst_compiler_check_two_works="no" ],[ tst_compiler_check_two_works="yes" ]) if test "$tst_compiler_check_one_works" = "yes" && test "$tst_compiler_check_two_works" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) AC_MSG_ERROR([compiler fails struct member size checking.]) fi ]) dnl CURL_CHECK_COMPILER_SYMBOL_HIDING dnl ------------------------------------------------- dnl Verify if compiler supports hiding library internal symbols, setting dnl shell variable supports_symbol_hiding value as appropriate, as well as dnl variables symbol_hiding_CFLAGS and symbol_hiding_EXTERN when supported. AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [ AC_REQUIRE([CURL_CHECK_COMPILER])dnl AC_BEFORE([$0],[CURL_CONFIGURE_SYMBOL_HIDING])dnl AC_MSG_CHECKING([if compiler supports hiding library internal symbols]) supports_symbol_hiding="no" symbol_hiding_CFLAGS="" symbol_hiding_EXTERN="" tmp_CFLAGS="" tmp_EXTERN="" case "$compiler_id" in CLANG) dnl All versions of clang support -fvisibility= tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" ;; GNU_C) dnl Only gcc 3.4 or later if test "$compiler_num" -ge "304"; then if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" fi fi ;; INTEL_UNIX_C) dnl Only icc 9.0 or later if test "$compiler_num" -ge "900"; then if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then tmp_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ # include ]],[[ printf("icc fvisibility bug test"); ]]) ],[ tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" ]) CFLAGS="$tmp_save_CFLAGS" fi fi ;; SUNPRO_C) if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then tmp_EXTERN="__global" tmp_CFLAGS="-xldscope=hidden" supports_symbol_hiding="yes" fi ;; esac if test "$supports_symbol_hiding" = "yes"; then tmp_save_CFLAGS="$CFLAGS" CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" squeeze CFLAGS AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $tmp_EXTERN char *dummy(char *buff); char *dummy(char *buff) { if(buff) return ++buff; else return buff; } ]],[[ char b[16]; char *r = dummy(&b[0]); if(r) return (int)*r; ]]) ],[ supports_symbol_hiding="yes" if test -f conftest.err; then grep 'visibility' conftest.err >/dev/null if test "$?" -eq "0"; then supports_symbol_hiding="no" fi fi ],[ supports_symbol_hiding="no" echo " " >&6 sed 's/^/cc-src: /' conftest.$ac_ext >&6 sed 's/^/cc-err: /' conftest.err >&6 echo " " >&6 ]) CFLAGS="$tmp_save_CFLAGS" fi if test "$supports_symbol_hiding" = "yes"; then AC_MSG_RESULT([yes]) symbol_hiding_CFLAGS="$tmp_CFLAGS" symbol_hiding_EXTERN="$tmp_EXTERN" else AC_MSG_RESULT([no]) fi ]) dnl CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH dnl ------------------------------------------------- dnl Verifies if the compiler actually halts after the dnl compilation phase without generating any object dnl code file, when the source code tries to redefine dnl a prototype which does not match previous one. AC_DEFUN([CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH], [ AC_REQUIRE([CURL_CHECK_COMPILER_HALT_ON_ERROR])dnl AC_MSG_CHECKING([if compiler halts on function prototype mismatch]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ # include int rand(int n); int rand(int n) { if(n) return ++n; else return n; } ]],[[ int i[2]={0,0}; int j = rand(i[0]); if(j) return j; ]]) ],[ AC_MSG_RESULT([no]) AC_MSG_ERROR([compiler does not halt on function prototype mismatch.]) ],[ AC_MSG_RESULT([yes]) ]) ]) dnl CURL_VAR_MATCH (VARNAME, VALUE) dnl ------------------------------------------------- dnl Verifies if shell variable VARNAME contains VALUE. dnl Contents of variable VARNAME and VALUE are handled dnl as whitespace separated lists of words. If at least dnl one word of VALUE is present in VARNAME the match dnl is considered positive, otherwise false. AC_DEFUN([CURL_VAR_MATCH], [ ac_var_match_word="no" for word1 in $[$1]; do for word2 in [$2]; do if test "$word1" = "$word2"; then ac_var_match_word="yes" fi done done ]) dnl CURL_VAR_MATCH_IFELSE (VARNAME, VALUE, dnl [ACTION-IF-MATCH], [ACTION-IF-NOT-MATCH]) dnl ------------------------------------------------- dnl This performs a CURL_VAR_MATCH check and executes dnl first branch if the match is positive, otherwise dnl the second branch is executed. AC_DEFUN([CURL_VAR_MATCH_IFELSE], [ CURL_VAR_MATCH([$1],[$2]) if test "$ac_var_match_word" = "yes"; then ifelse($3,,:,[$3]) ifelse($4,,,[else $4]) fi ]) dnl CURL_VAR_STRIP (VARNAME, VALUE) dnl ------------------------------------------------- dnl Contents of variable VARNAME and VALUE are handled dnl as whitespace separated lists of words. Each word dnl from VALUE is removed from VARNAME when present. AC_DEFUN([CURL_VAR_STRIP], [ AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl ac_var_stripped="" for word1 in $[$1]; do ac_var_strip_word="no" for word2 in [$2]; do if test "$word1" = "$word2"; then ac_var_strip_word="yes" fi done if test "$ac_var_strip_word" = "no"; then ac_var_stripped="$ac_var_stripped $word1" fi done dnl squeeze whitespace out of result [$1]="$ac_var_stripped" squeeze [$1] ]) curl-7.35.0/m4/curl-functions.m40000644000175000017500000056216312213173003013236 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. # serial 73 dnl CURL_INCLUDES_ARPA_INET dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when arpa/inet.h is to be included. AC_DEFUN([CURL_INCLUDES_ARPA_INET], [ curl_includes_arpa_inet="\ /* includes start */ #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 /* includes end */" AC_CHECK_HEADERS( sys/types.h sys/socket.h netinet/in.h arpa/inet.h, [], [], [$curl_includes_arpa_inet]) ]) dnl CURL_INCLUDES_FCNTL dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when fcntl.h is to be included. AC_DEFUN([CURL_INCLUDES_FCNTL], [ curl_includes_fcntl="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_FCNTL_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h unistd.h fcntl.h, [], [], [$curl_includes_fcntl]) ]) dnl CURL_INCLUDES_IFADDRS dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when ifaddrs.h is to be included. AC_DEFUN([CURL_INCLUDES_IFADDRS], [ curl_includes_ifaddrs="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_IFADDRS_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h sys/socket.h netinet/in.h ifaddrs.h, [], [], [$curl_includes_ifaddrs]) ]) dnl CURL_INCLUDES_INTTYPES dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when inttypes.h is to be included. AC_DEFUN([CURL_INCLUDES_INTTYPES], [ curl_includes_inttypes="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif /* includes end */" case $host_os in irix*) ac_cv_header_stdint_h="no" ;; esac AC_CHECK_HEADERS( sys/types.h stdint.h inttypes.h, [], [], [$curl_includes_inttypes]) ]) dnl CURL_INCLUDES_LIBGEN dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when libgen.h is to be included. AC_DEFUN([CURL_INCLUDES_LIBGEN], [ curl_includes_libgen="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_LIBGEN_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h libgen.h, [], [], [$curl_includes_libgen]) ]) dnl CURL_INCLUDES_NETDB dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when netdb.h is to be included. AC_DEFUN([CURL_INCLUDES_NETDB], [ curl_includes_netdb="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_NETDB_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h netdb.h, [], [], [$curl_includes_netdb]) ]) dnl CURL_INCLUDES_POLL dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when poll.h is to be included. AC_DEFUN([CURL_INCLUDES_POLL], [ curl_includes_poll="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_POLL_H # include #endif #ifdef HAVE_SYS_POLL_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h poll.h sys/poll.h, [], [], [$curl_includes_poll]) ]) dnl CURL_INCLUDES_SETJMP dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when setjmp.h is to be included. AC_DEFUN([CURL_INCLUDES_SETJMP], [ curl_includes_setjmp="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SETJMP_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h setjmp.h, [], [], [$curl_includes_setjmp]) ]) dnl CURL_INCLUDES_SIGNAL dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when signal.h is to be included. AC_DEFUN([CURL_INCLUDES_SIGNAL], [ curl_includes_signal="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h signal.h, [], [], [$curl_includes_signal]) ]) dnl CURL_INCLUDES_SOCKET dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when socket.h is to be included. AC_DEFUN([CURL_INCLUDES_SOCKET], [ curl_includes_socket="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SOCKET_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h socket.h, [], [], [$curl_includes_socket]) ]) dnl CURL_INCLUDES_STDIO dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when stdio.h is to be included. AC_DEFUN([CURL_INCLUDES_STDIO], [ curl_includes_stdio="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_STDIO_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h stdio.h, [], [], [$curl_includes_stdio]) ]) dnl CURL_INCLUDES_STDLIB dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when stdlib.h is to be included. AC_DEFUN([CURL_INCLUDES_STDLIB], [ curl_includes_stdlib="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_STDLIB_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h stdlib.h, [], [], [$curl_includes_stdlib]) ]) dnl CURL_INCLUDES_STRING dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when string(s).h is to be included. AC_DEFUN([CURL_INCLUDES_STRING], [ curl_includes_string="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_STRINGS_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h string.h strings.h, [], [], [$curl_includes_string]) ]) dnl CURL_INCLUDES_STROPTS dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when stropts.h is to be included. AC_DEFUN([CURL_INCLUDES_STROPTS], [ curl_includes_stropts="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_STROPTS_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h unistd.h sys/socket.h sys/ioctl.h stropts.h, [], [], [$curl_includes_stropts]) ]) dnl CURL_INCLUDES_SYS_SOCKET dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when sys/socket.h is to be included. AC_DEFUN([CURL_INCLUDES_SYS_SOCKET], [ curl_includes_sys_socket="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h sys/socket.h, [], [], [$curl_includes_sys_socket]) ]) dnl CURL_INCLUDES_SYS_TYPES dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when sys/types.h is to be included. AC_DEFUN([CURL_INCLUDES_SYS_TYPES], [ curl_includes_sys_types="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h, [], [], [$curl_includes_sys_types]) ]) dnl CURL_INCLUDES_SYS_UIO dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when sys/uio.h is to be included. AC_DEFUN([CURL_INCLUDES_SYS_UIO], [ curl_includes_sys_uio="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h sys/uio.h, [], [], [$curl_includes_sys_uio]) ]) dnl CURL_INCLUDES_SYS_XATTR dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when sys/xattr.h is to be included. AC_DEFUN([CURL_INCLUDES_SYS_XATTR], [ curl_includes_sys_xattr="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_XATTR_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h sys/xattr.h, [], [], [$curl_includes_sys_xattr]) ]) dnl CURL_INCLUDES_TIME dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when time.h is to be included. AC_DEFUN([CURL_INCLUDES_TIME], [ AC_REQUIRE([AC_HEADER_TIME])dnl curl_includes_time="\ /* includes start */ #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 /* includes end */" AC_CHECK_HEADERS( sys/types.h sys/time.h time.h, [], [], [$curl_includes_time]) ]) dnl CURL_INCLUDES_UNISTD dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when unistd.h is to be included. AC_DEFUN([CURL_INCLUDES_UNISTD], [ curl_includes_unistd="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h unistd.h, [], [], [$curl_includes_unistd]) ]) dnl CURL_INCLUDES_WINSOCK2 dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when winsock(2).h is to be included. AC_DEFUN([CURL_INCLUDES_WINSOCK2], [ curl_includes_winsock2="\ /* includes start */ #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 /* includes end */" CURL_CHECK_HEADER_WINDOWS CURL_CHECK_HEADER_WINSOCK CURL_CHECK_HEADER_WINSOCK2 ]) dnl CURL_INCLUDES_WS2TCPIP dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when ws2tcpip.h is to be included. AC_DEFUN([CURL_INCLUDES_WS2TCPIP], [ curl_includes_ws2tcpip="\ /* includes start */ #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 #endif /* includes end */" CURL_CHECK_HEADER_WINDOWS CURL_CHECK_HEADER_WINSOCK2 CURL_CHECK_HEADER_WS2TCPIP ]) dnl CURL_PREPROCESS_CALLCONV dnl ------------------------------------------------- dnl Set up variable with a preprocessor block which dnl defines function calling convention. AC_DEFUN([CURL_PREPROCESS_CALLCONV], [ curl_preprocess_callconv="\ /* preprocess start */ #ifdef HAVE_WINDOWS_H # define FUNCALLCONV __stdcall #else # define FUNCALLCONV #endif /* preprocess end */" ]) dnl CURL_CHECK_FUNC_ALARM dnl ------------------------------------------------- dnl Verify if alarm is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_alarm, then dnl HAVE_ALARM will be defined. AC_DEFUN([CURL_CHECK_FUNC_ALARM], [ AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl # tst_links_alarm="unknown" tst_proto_alarm="unknown" tst_compi_alarm="unknown" tst_allow_alarm="unknown" # AC_MSG_CHECKING([if alarm can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([alarm]) ],[ AC_MSG_RESULT([yes]) tst_links_alarm="yes" ],[ AC_MSG_RESULT([no]) tst_links_alarm="no" ]) # if test "$tst_links_alarm" = "yes"; then AC_MSG_CHECKING([if alarm is prototyped]) AC_EGREP_CPP([alarm],[ $curl_includes_unistd ],[ AC_MSG_RESULT([yes]) tst_proto_alarm="yes" ],[ AC_MSG_RESULT([no]) tst_proto_alarm="no" ]) fi # if test "$tst_proto_alarm" = "yes"; then AC_MSG_CHECKING([if alarm is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_unistd ]],[[ if(0 != alarm(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_alarm="yes" ],[ AC_MSG_RESULT([no]) tst_compi_alarm="no" ]) fi # if test "$tst_compi_alarm" = "yes"; then AC_MSG_CHECKING([if alarm usage allowed]) if test "x$curl_disallow_alarm" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_alarm="yes" else AC_MSG_RESULT([no]) tst_allow_alarm="no" fi fi # AC_MSG_CHECKING([if alarm might be used]) if test "$tst_links_alarm" = "yes" && test "$tst_proto_alarm" = "yes" && test "$tst_compi_alarm" = "yes" && test "$tst_allow_alarm" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_ALARM, 1, [Define to 1 if you have the alarm function.]) ac_cv_func_alarm="yes" else AC_MSG_RESULT([no]) ac_cv_func_alarm="no" fi ]) dnl CURL_CHECK_FUNC_BASENAME dnl ------------------------------------------------- dnl Verify if basename is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_basename, then dnl HAVE_BASENAME will be defined. AC_DEFUN([CURL_CHECK_FUNC_BASENAME], [ AC_REQUIRE([CURL_INCLUDES_STRING])dnl AC_REQUIRE([CURL_INCLUDES_LIBGEN])dnl AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl # tst_links_basename="unknown" tst_proto_basename="unknown" tst_compi_basename="unknown" tst_allow_basename="unknown" # AC_MSG_CHECKING([if basename can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([basename]) ],[ AC_MSG_RESULT([yes]) tst_links_basename="yes" ],[ AC_MSG_RESULT([no]) tst_links_basename="no" ]) # if test "$tst_links_basename" = "yes"; then AC_MSG_CHECKING([if basename is prototyped]) AC_EGREP_CPP([basename],[ $curl_includes_string $curl_includes_libgen $curl_includes_unistd ],[ AC_MSG_RESULT([yes]) tst_proto_basename="yes" ],[ AC_MSG_RESULT([no]) tst_proto_basename="no" ]) fi # if test "$tst_proto_basename" = "yes"; then AC_MSG_CHECKING([if basename is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string $curl_includes_libgen $curl_includes_unistd ]],[[ if(0 != basename(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_basename="yes" ],[ AC_MSG_RESULT([no]) tst_compi_basename="no" ]) fi # if test "$tst_compi_basename" = "yes"; then AC_MSG_CHECKING([if basename usage allowed]) if test "x$curl_disallow_basename" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_basename="yes" else AC_MSG_RESULT([no]) tst_allow_basename="no" fi fi # AC_MSG_CHECKING([if basename might be used]) if test "$tst_links_basename" = "yes" && test "$tst_proto_basename" = "yes" && test "$tst_compi_basename" = "yes" && test "$tst_allow_basename" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_BASENAME, 1, [Define to 1 if you have the basename function.]) ac_cv_func_basename="yes" else AC_MSG_RESULT([no]) ac_cv_func_basename="no" fi ]) dnl CURL_CHECK_FUNC_CLOSESOCKET dnl ------------------------------------------------- dnl Verify if closesocket is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_closesocket, then dnl HAVE_CLOSESOCKET will be defined. AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl # tst_links_closesocket="unknown" tst_proto_closesocket="unknown" tst_compi_closesocket="unknown" tst_allow_closesocket="unknown" # AC_MSG_CHECKING([if closesocket can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_socket ]],[[ if(0 != closesocket(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_closesocket="yes" ],[ AC_MSG_RESULT([no]) tst_links_closesocket="no" ]) # if test "$tst_links_closesocket" = "yes"; then AC_MSG_CHECKING([if closesocket is prototyped]) AC_EGREP_CPP([closesocket],[ $curl_includes_winsock2 $curl_includes_socket ],[ AC_MSG_RESULT([yes]) tst_proto_closesocket="yes" ],[ AC_MSG_RESULT([no]) tst_proto_closesocket="no" ]) fi # if test "$tst_proto_closesocket" = "yes"; then AC_MSG_CHECKING([if closesocket is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_socket ]],[[ if(0 != closesocket(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_closesocket="yes" ],[ AC_MSG_RESULT([no]) tst_compi_closesocket="no" ]) fi # if test "$tst_compi_closesocket" = "yes"; then AC_MSG_CHECKING([if closesocket usage allowed]) if test "x$curl_disallow_closesocket" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_closesocket="yes" else AC_MSG_RESULT([no]) tst_allow_closesocket="no" fi fi # AC_MSG_CHECKING([if closesocket might be used]) if test "$tst_links_closesocket" = "yes" && test "$tst_proto_closesocket" = "yes" && test "$tst_compi_closesocket" = "yes" && test "$tst_allow_closesocket" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET, 1, [Define to 1 if you have the closesocket function.]) ac_cv_func_closesocket="yes" else AC_MSG_RESULT([no]) ac_cv_func_closesocket="no" fi ]) dnl CURL_CHECK_FUNC_CLOSESOCKET_CAMEL dnl ------------------------------------------------- dnl Verify if CloseSocket is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_closesocket_camel, dnl then HAVE_CLOSESOCKET_CAMEL will be defined. AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET_CAMEL], [ AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl # tst_links_closesocket_camel="unknown" tst_proto_closesocket_camel="unknown" tst_compi_closesocket_camel="unknown" tst_allow_closesocket_camel="unknown" # AC_MSG_CHECKING([if CloseSocket can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_socket ]],[[ if(0 != CloseSocket(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_closesocket_camel="yes" ],[ AC_MSG_RESULT([no]) tst_links_closesocket_camel="no" ]) # if test "$tst_links_closesocket_camel" = "yes"; then AC_MSG_CHECKING([if CloseSocket is prototyped]) AC_EGREP_CPP([CloseSocket],[ $curl_includes_sys_socket ],[ AC_MSG_RESULT([yes]) tst_proto_closesocket_camel="yes" ],[ AC_MSG_RESULT([no]) tst_proto_closesocket_camel="no" ]) fi # if test "$tst_proto_closesocket_camel" = "yes"; then AC_MSG_CHECKING([if CloseSocket is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_socket ]],[[ if(0 != CloseSocket(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_closesocket_camel="yes" ],[ AC_MSG_RESULT([no]) tst_compi_closesocket_camel="no" ]) fi # if test "$tst_compi_closesocket_camel" = "yes"; then AC_MSG_CHECKING([if CloseSocket usage allowed]) if test "x$curl_disallow_closesocket_camel" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_closesocket_camel="yes" else AC_MSG_RESULT([no]) tst_allow_closesocket_camel="no" fi fi # AC_MSG_CHECKING([if CloseSocket might be used]) if test "$tst_links_closesocket_camel" = "yes" && test "$tst_proto_closesocket_camel" = "yes" && test "$tst_compi_closesocket_camel" = "yes" && test "$tst_allow_closesocket_camel" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET_CAMEL, 1, [Define to 1 if you have the CloseSocket camel case function.]) ac_cv_func_closesocket_camel="yes" else AC_MSG_RESULT([no]) ac_cv_func_closesocket_camel="no" fi ]) dnl CURL_CHECK_FUNC_CONNECT dnl ------------------------------------------------- dnl Verify if connect is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_connect, then dnl HAVE_CONNECT will be defined. AC_DEFUN([CURL_CHECK_FUNC_CONNECT], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl # tst_links_connect="unknown" tst_proto_connect="unknown" tst_compi_connect="unknown" tst_allow_connect="unknown" # AC_MSG_CHECKING([if connect can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_sys_socket $curl_includes_socket ]],[[ if(0 != connect(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_connect="yes" ],[ AC_MSG_RESULT([no]) tst_links_connect="no" ]) # if test "$tst_links_connect" = "yes"; then AC_MSG_CHECKING([if connect is prototyped]) AC_EGREP_CPP([connect],[ $curl_includes_winsock2 $curl_includes_sys_socket $curl_includes_socket ],[ AC_MSG_RESULT([yes]) tst_proto_connect="yes" ],[ AC_MSG_RESULT([no]) tst_proto_connect="no" ]) fi # if test "$tst_proto_connect" = "yes"; then AC_MSG_CHECKING([if connect is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_sys_socket $curl_includes_socket ]],[[ if(0 != connect(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_connect="yes" ],[ AC_MSG_RESULT([no]) tst_compi_connect="no" ]) fi # if test "$tst_compi_connect" = "yes"; then AC_MSG_CHECKING([if connect usage allowed]) if test "x$curl_disallow_connect" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_connect="yes" else AC_MSG_RESULT([no]) tst_allow_connect="no" fi fi # AC_MSG_CHECKING([if connect might be used]) if test "$tst_links_connect" = "yes" && test "$tst_proto_connect" = "yes" && test "$tst_compi_connect" = "yes" && test "$tst_allow_connect" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_CONNECT, 1, [Define to 1 if you have the connect function.]) ac_cv_func_connect="yes" else AC_MSG_RESULT([no]) ac_cv_func_connect="no" fi ]) dnl CURL_CHECK_FUNC_FCNTL dnl ------------------------------------------------- dnl Verify if fcntl is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_fcntl, then dnl HAVE_FCNTL will be defined. AC_DEFUN([CURL_CHECK_FUNC_FCNTL], [ AC_REQUIRE([CURL_INCLUDES_FCNTL])dnl # tst_links_fcntl="unknown" tst_proto_fcntl="unknown" tst_compi_fcntl="unknown" tst_allow_fcntl="unknown" # AC_MSG_CHECKING([if fcntl can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([fcntl]) ],[ AC_MSG_RESULT([yes]) tst_links_fcntl="yes" ],[ AC_MSG_RESULT([no]) tst_links_fcntl="no" ]) # if test "$tst_links_fcntl" = "yes"; then AC_MSG_CHECKING([if fcntl is prototyped]) AC_EGREP_CPP([fcntl],[ $curl_includes_fcntl ],[ AC_MSG_RESULT([yes]) tst_proto_fcntl="yes" ],[ AC_MSG_RESULT([no]) tst_proto_fcntl="no" ]) fi # if test "$tst_proto_fcntl" = "yes"; then AC_MSG_CHECKING([if fcntl is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_fcntl ]],[[ if(0 != fcntl(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_fcntl="yes" ],[ AC_MSG_RESULT([no]) tst_compi_fcntl="no" ]) fi # if test "$tst_compi_fcntl" = "yes"; then AC_MSG_CHECKING([if fcntl usage allowed]) if test "x$curl_disallow_fcntl" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_fcntl="yes" else AC_MSG_RESULT([no]) tst_allow_fcntl="no" fi fi # AC_MSG_CHECKING([if fcntl might be used]) if test "$tst_links_fcntl" = "yes" && test "$tst_proto_fcntl" = "yes" && test "$tst_compi_fcntl" = "yes" && test "$tst_allow_fcntl" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_FCNTL, 1, [Define to 1 if you have the fcntl function.]) ac_cv_func_fcntl="yes" CURL_CHECK_FUNC_FCNTL_O_NONBLOCK else AC_MSG_RESULT([no]) ac_cv_func_fcntl="no" fi ]) dnl CURL_CHECK_FUNC_FCNTL_O_NONBLOCK dnl ------------------------------------------------- dnl Verify if fcntl with status flag O_NONBLOCK is dnl available, can be compiled, and seems to work. If dnl all of these are true, then HAVE_FCNTL_O_NONBLOCK dnl will be defined. AC_DEFUN([CURL_CHECK_FUNC_FCNTL_O_NONBLOCK], [ # tst_compi_fcntl_o_nonblock="unknown" tst_allow_fcntl_o_nonblock="unknown" # case $host_os in sunos4* | aix3* | beos*) dnl O_NONBLOCK does not work on these platforms curl_disallow_fcntl_o_nonblock="yes" ;; esac # if test "$ac_cv_func_fcntl" = "yes"; then AC_MSG_CHECKING([if fcntl O_NONBLOCK is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_fcntl ]],[[ int flags = 0; if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_fcntl_o_nonblock="yes" ],[ AC_MSG_RESULT([no]) tst_compi_fcntl_o_nonblock="no" ]) fi # if test "$tst_compi_fcntl_o_nonblock" = "yes"; then AC_MSG_CHECKING([if fcntl O_NONBLOCK usage allowed]) if test "x$curl_disallow_fcntl_o_nonblock" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_fcntl_o_nonblock="yes" else AC_MSG_RESULT([no]) tst_allow_fcntl_o_nonblock="no" fi fi # AC_MSG_CHECKING([if fcntl O_NONBLOCK might be used]) if test "$tst_compi_fcntl_o_nonblock" = "yes" && test "$tst_allow_fcntl_o_nonblock" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_FCNTL_O_NONBLOCK, 1, [Define to 1 if you have a working fcntl O_NONBLOCK function.]) ac_cv_func_fcntl_o_nonblock="yes" else AC_MSG_RESULT([no]) ac_cv_func_fcntl_o_nonblock="no" fi ]) dnl CURL_CHECK_FUNC_FDOPEN dnl ------------------------------------------------- dnl Verify if fdopen is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_fdopen, then dnl HAVE_FDOPEN will be defined. AC_DEFUN([CURL_CHECK_FUNC_FDOPEN], [ AC_REQUIRE([CURL_INCLUDES_STDIO])dnl # tst_links_fdopen="unknown" tst_proto_fdopen="unknown" tst_compi_fdopen="unknown" tst_allow_fdopen="unknown" # AC_MSG_CHECKING([if fdopen can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([fdopen]) ],[ AC_MSG_RESULT([yes]) tst_links_fdopen="yes" ],[ AC_MSG_RESULT([no]) tst_links_fdopen="no" ]) # if test "$tst_links_fdopen" = "yes"; then AC_MSG_CHECKING([if fdopen is prototyped]) AC_EGREP_CPP([fdopen],[ $curl_includes_stdio ],[ AC_MSG_RESULT([yes]) tst_proto_fdopen="yes" ],[ AC_MSG_RESULT([no]) tst_proto_fdopen="no" ]) fi # if test "$tst_proto_fdopen" = "yes"; then AC_MSG_CHECKING([if fdopen is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stdio ]],[[ if(0 != fdopen(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_fdopen="yes" ],[ AC_MSG_RESULT([no]) tst_compi_fdopen="no" ]) fi # if test "$tst_compi_fdopen" = "yes"; then AC_MSG_CHECKING([if fdopen usage allowed]) if test "x$curl_disallow_fdopen" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_fdopen="yes" else AC_MSG_RESULT([no]) tst_allow_fdopen="no" fi fi # AC_MSG_CHECKING([if fdopen might be used]) if test "$tst_links_fdopen" = "yes" && test "$tst_proto_fdopen" = "yes" && test "$tst_compi_fdopen" = "yes" && test "$tst_allow_fdopen" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_FDOPEN, 1, [Define to 1 if you have the fdopen function.]) ac_cv_func_fdopen="yes" else AC_MSG_RESULT([no]) ac_cv_func_fdopen="no" fi ]) dnl CURL_CHECK_FUNC_FGETXATTR dnl ------------------------------------------------- dnl Verify if fgetxattr is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_fgetxattr, then dnl HAVE_FGETXATTR will be defined. AC_DEFUN([CURL_CHECK_FUNC_FGETXATTR], [ AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl # tst_links_fgetxattr="unknown" tst_proto_fgetxattr="unknown" tst_compi_fgetxattr="unknown" tst_allow_fgetxattr="unknown" tst_nargs_fgetxattr="unknown" # AC_MSG_CHECKING([if fgetxattr can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([fgetxattr]) ],[ AC_MSG_RESULT([yes]) tst_links_fgetxattr="yes" ],[ AC_MSG_RESULT([no]) tst_links_fgetxattr="no" ]) # if test "$tst_links_fgetxattr" = "yes"; then AC_MSG_CHECKING([if fgetxattr is prototyped]) AC_EGREP_CPP([fgetxattr],[ $curl_includes_sys_xattr ],[ AC_MSG_RESULT([yes]) tst_proto_fgetxattr="yes" ],[ AC_MSG_RESULT([no]) tst_proto_fgetxattr="no" ]) fi # if test "$tst_proto_fgetxattr" = "yes"; then if test "$tst_nargs_fgetxattr" = "unknown"; then AC_MSG_CHECKING([if fgetxattr takes 4 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != fgetxattr(0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_fgetxattr="yes" tst_nargs_fgetxattr="4" ],[ AC_MSG_RESULT([no]) tst_compi_fgetxattr="no" ]) fi if test "$tst_nargs_fgetxattr" = "unknown"; then AC_MSG_CHECKING([if fgetxattr takes 6 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != fgetxattr(0, 0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_fgetxattr="yes" tst_nargs_fgetxattr="6" ],[ AC_MSG_RESULT([no]) tst_compi_fgetxattr="no" ]) fi AC_MSG_CHECKING([if fgetxattr is compilable]) if test "$tst_compi_fgetxattr" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # if test "$tst_compi_fgetxattr" = "yes"; then AC_MSG_CHECKING([if fgetxattr usage allowed]) if test "x$curl_disallow_fgetxattr" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_fgetxattr="yes" else AC_MSG_RESULT([no]) tst_allow_fgetxattr="no" fi fi # AC_MSG_CHECKING([if fgetxattr might be used]) if test "$tst_links_fgetxattr" = "yes" && test "$tst_proto_fgetxattr" = "yes" && test "$tst_compi_fgetxattr" = "yes" && test "$tst_allow_fgetxattr" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_FGETXATTR, 1, [Define to 1 if you have the fgetxattr function.]) dnl AC_DEFINE_UNQUOTED(FGETXATTR_ARGS, $tst_nargs_fgetxattr, dnl [Specifies the number of arguments to fgetxattr]) # if test "$tst_nargs_fgetxattr" -eq "4"; then AC_DEFINE(HAVE_FGETXATTR_4, 1, [fgetxattr() takes 4 args]) elif test "$tst_nargs_fgetxattr" -eq "6"; then AC_DEFINE(HAVE_FGETXATTR_6, 1, [fgetxattr() takes 6 args]) fi # ac_cv_func_fgetxattr="yes" else AC_MSG_RESULT([no]) ac_cv_func_fgetxattr="no" fi ]) dnl CURL_CHECK_FUNC_FLISTXATTR dnl ------------------------------------------------- dnl Verify if flistxattr is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_flistxattr, then dnl HAVE_FLISTXATTR will be defined. AC_DEFUN([CURL_CHECK_FUNC_FLISTXATTR], [ AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl # tst_links_flistxattr="unknown" tst_proto_flistxattr="unknown" tst_compi_flistxattr="unknown" tst_allow_flistxattr="unknown" tst_nargs_flistxattr="unknown" # AC_MSG_CHECKING([if flistxattr can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([flistxattr]) ],[ AC_MSG_RESULT([yes]) tst_links_flistxattr="yes" ],[ AC_MSG_RESULT([no]) tst_links_flistxattr="no" ]) # if test "$tst_links_flistxattr" = "yes"; then AC_MSG_CHECKING([if flistxattr is prototyped]) AC_EGREP_CPP([flistxattr],[ $curl_includes_sys_xattr ],[ AC_MSG_RESULT([yes]) tst_proto_flistxattr="yes" ],[ AC_MSG_RESULT([no]) tst_proto_flistxattr="no" ]) fi # if test "$tst_proto_flistxattr" = "yes"; then if test "$tst_nargs_flistxattr" = "unknown"; then AC_MSG_CHECKING([if flistxattr takes 3 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != flistxattr(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_flistxattr="yes" tst_nargs_flistxattr="3" ],[ AC_MSG_RESULT([no]) tst_compi_flistxattr="no" ]) fi if test "$tst_nargs_flistxattr" = "unknown"; then AC_MSG_CHECKING([if flistxattr takes 4 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != flistxattr(0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_flistxattr="yes" tst_nargs_flistxattr="4" ],[ AC_MSG_RESULT([no]) tst_compi_flistxattr="no" ]) fi AC_MSG_CHECKING([if flistxattr is compilable]) if test "$tst_compi_flistxattr" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # if test "$tst_compi_flistxattr" = "yes"; then AC_MSG_CHECKING([if flistxattr usage allowed]) if test "x$curl_disallow_flistxattr" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_flistxattr="yes" else AC_MSG_RESULT([no]) tst_allow_flistxattr="no" fi fi # AC_MSG_CHECKING([if flistxattr might be used]) if test "$tst_links_flistxattr" = "yes" && test "$tst_proto_flistxattr" = "yes" && test "$tst_compi_flistxattr" = "yes" && test "$tst_allow_flistxattr" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_FLISTXATTR, 1, [Define to 1 if you have the flistxattr function.]) dnl AC_DEFINE_UNQUOTED(FLISTXATTR_ARGS, $tst_nargs_flistxattr, dnl [Specifies the number of arguments to flistxattr]) # if test "$tst_nargs_flistxattr" -eq "3"; then AC_DEFINE(HAVE_FLISTXATTR_3, 1, [flistxattr() takes 3 args]) elif test "$tst_nargs_flistxattr" -eq "4"; then AC_DEFINE(HAVE_FLISTXATTR_4, 1, [flistxattr() takes 4 args]) fi # ac_cv_func_flistxattr="yes" else AC_MSG_RESULT([no]) ac_cv_func_flistxattr="no" fi ]) dnl CURL_CHECK_FUNC_FREEADDRINFO dnl ------------------------------------------------- dnl Verify if freeaddrinfo is available, prototyped, dnl and can be compiled. If all of these are true, dnl and usage has not been previously disallowed with dnl shell variable curl_disallow_freeaddrinfo, then dnl HAVE_FREEADDRINFO will be defined. AC_DEFUN([CURL_CHECK_FUNC_FREEADDRINFO], [ AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl AC_REQUIRE([CURL_INCLUDES_NETDB])dnl # tst_links_freeaddrinfo="unknown" tst_proto_freeaddrinfo="unknown" tst_compi_freeaddrinfo="unknown" tst_allow_freeaddrinfo="unknown" # AC_MSG_CHECKING([if freeaddrinfo can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_ws2tcpip $curl_includes_sys_socket $curl_includes_netdb ]],[[ freeaddrinfo(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_links_freeaddrinfo="yes" ],[ AC_MSG_RESULT([no]) tst_links_freeaddrinfo="no" ]) # if test "$tst_links_freeaddrinfo" = "yes"; then AC_MSG_CHECKING([if freeaddrinfo is prototyped]) AC_EGREP_CPP([freeaddrinfo],[ $curl_includes_ws2tcpip $curl_includes_sys_socket $curl_includes_netdb ],[ AC_MSG_RESULT([yes]) tst_proto_freeaddrinfo="yes" ],[ AC_MSG_RESULT([no]) tst_proto_freeaddrinfo="no" ]) fi # if test "$tst_proto_freeaddrinfo" = "yes"; then AC_MSG_CHECKING([if freeaddrinfo is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_ws2tcpip $curl_includes_sys_socket $curl_includes_netdb ]],[[ freeaddrinfo(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_freeaddrinfo="yes" ],[ AC_MSG_RESULT([no]) tst_compi_freeaddrinfo="no" ]) fi # if test "$tst_compi_freeaddrinfo" = "yes"; then AC_MSG_CHECKING([if freeaddrinfo usage allowed]) if test "x$curl_disallow_freeaddrinfo" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_freeaddrinfo="yes" else AC_MSG_RESULT([no]) tst_allow_freeaddrinfo="no" fi fi # AC_MSG_CHECKING([if freeaddrinfo might be used]) if test "$tst_links_freeaddrinfo" = "yes" && test "$tst_proto_freeaddrinfo" = "yes" && test "$tst_compi_freeaddrinfo" = "yes" && test "$tst_allow_freeaddrinfo" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_FREEADDRINFO, 1, [Define to 1 if you have the freeaddrinfo function.]) ac_cv_func_freeaddrinfo="yes" else AC_MSG_RESULT([no]) ac_cv_func_freeaddrinfo="no" fi ]) dnl CURL_CHECK_FUNC_FREEIFADDRS dnl ------------------------------------------------- dnl Verify if freeifaddrs is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_freeifaddrs, then dnl HAVE_FREEIFADDRS will be defined. AC_DEFUN([CURL_CHECK_FUNC_FREEIFADDRS], [ AC_REQUIRE([CURL_INCLUDES_IFADDRS])dnl # tst_links_freeifaddrs="unknown" tst_proto_freeifaddrs="unknown" tst_compi_freeifaddrs="unknown" tst_allow_freeifaddrs="unknown" # AC_MSG_CHECKING([if freeifaddrs can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([freeifaddrs]) ],[ AC_MSG_RESULT([yes]) tst_links_freeifaddrs="yes" ],[ AC_MSG_RESULT([no]) tst_links_freeifaddrs="no" ]) # if test "$tst_links_freeifaddrs" = "yes"; then AC_MSG_CHECKING([if freeifaddrs is prototyped]) AC_EGREP_CPP([freeifaddrs],[ $curl_includes_ifaddrs ],[ AC_MSG_RESULT([yes]) tst_proto_freeifaddrs="yes" ],[ AC_MSG_RESULT([no]) tst_proto_freeifaddrs="no" ]) fi # if test "$tst_proto_freeifaddrs" = "yes"; then AC_MSG_CHECKING([if freeifaddrs is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_ifaddrs ]],[[ freeifaddrs(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_freeifaddrs="yes" ],[ AC_MSG_RESULT([no]) tst_compi_freeifaddrs="no" ]) fi # if test "$tst_compi_freeifaddrs" = "yes"; then AC_MSG_CHECKING([if freeifaddrs usage allowed]) if test "x$curl_disallow_freeifaddrs" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_freeifaddrs="yes" else AC_MSG_RESULT([no]) tst_allow_freeifaddrs="no" fi fi # AC_MSG_CHECKING([if freeifaddrs might be used]) if test "$tst_links_freeifaddrs" = "yes" && test "$tst_proto_freeifaddrs" = "yes" && test "$tst_compi_freeifaddrs" = "yes" && test "$tst_allow_freeifaddrs" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_FREEIFADDRS, 1, [Define to 1 if you have the freeifaddrs function.]) ac_cv_func_freeifaddrs="yes" else AC_MSG_RESULT([no]) ac_cv_func_freeifaddrs="no" fi ]) dnl CURL_CHECK_FUNC_FREMOVEXATTR dnl ------------------------------------------------- dnl Verify if fremovexattr is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_fremovexattr, then dnl HAVE_FREMOVEXATTR will be defined. AC_DEFUN([CURL_CHECK_FUNC_FREMOVEXATTR], [ AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl # tst_links_fremovexattr="unknown" tst_proto_fremovexattr="unknown" tst_compi_fremovexattr="unknown" tst_allow_fremovexattr="unknown" tst_nargs_fremovexattr="unknown" # AC_MSG_CHECKING([if fremovexattr can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([fremovexattr]) ],[ AC_MSG_RESULT([yes]) tst_links_fremovexattr="yes" ],[ AC_MSG_RESULT([no]) tst_links_fremovexattr="no" ]) # if test "$tst_links_fremovexattr" = "yes"; then AC_MSG_CHECKING([if fremovexattr is prototyped]) AC_EGREP_CPP([fremovexattr],[ $curl_includes_sys_xattr ],[ AC_MSG_RESULT([yes]) tst_proto_fremovexattr="yes" ],[ AC_MSG_RESULT([no]) tst_proto_fremovexattr="no" ]) fi # if test "$tst_proto_fremovexattr" = "yes"; then if test "$tst_nargs_fremovexattr" = "unknown"; then AC_MSG_CHECKING([if fremovexattr takes 2 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != fremovexattr(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_fremovexattr="yes" tst_nargs_fremovexattr="2" ],[ AC_MSG_RESULT([no]) tst_compi_fremovexattr="no" ]) fi if test "$tst_nargs_fremovexattr" = "unknown"; then AC_MSG_CHECKING([if fremovexattr takes 3 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != fremovexattr(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_fremovexattr="yes" tst_nargs_fremovexattr="3" ],[ AC_MSG_RESULT([no]) tst_compi_fremovexattr="no" ]) fi AC_MSG_CHECKING([if fremovexattr is compilable]) if test "$tst_compi_fremovexattr" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # if test "$tst_compi_fremovexattr" = "yes"; then AC_MSG_CHECKING([if fremovexattr usage allowed]) if test "x$curl_disallow_fremovexattr" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_fremovexattr="yes" else AC_MSG_RESULT([no]) tst_allow_fremovexattr="no" fi fi # AC_MSG_CHECKING([if fremovexattr might be used]) if test "$tst_links_fremovexattr" = "yes" && test "$tst_proto_fremovexattr" = "yes" && test "$tst_compi_fremovexattr" = "yes" && test "$tst_allow_fremovexattr" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_FREMOVEXATTR, 1, [Define to 1 if you have the fremovexattr function.]) dnl AC_DEFINE_UNQUOTED(FREMOVEXATTR_ARGS, $tst_nargs_fremovexattr, dnl [Specifies the number of arguments to fremovexattr]) # if test "$tst_nargs_fremovexattr" -eq "2"; then AC_DEFINE(HAVE_FREMOVEXATTR_2, 1, [fremovexattr() takes 2 args]) elif test "$tst_nargs_fremovexattr" -eq "3"; then AC_DEFINE(HAVE_FREMOVEXATTR_3, 1, [fremovexattr() takes 3 args]) fi # ac_cv_func_fremovexattr="yes" else AC_MSG_RESULT([no]) ac_cv_func_fremovexattr="no" fi ]) dnl CURL_CHECK_FUNC_FSETXATTR dnl ------------------------------------------------- dnl Verify if fsetxattr is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_fsetxattr, then dnl HAVE_FSETXATTR will be defined. AC_DEFUN([CURL_CHECK_FUNC_FSETXATTR], [ AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl # tst_links_fsetxattr="unknown" tst_proto_fsetxattr="unknown" tst_compi_fsetxattr="unknown" tst_allow_fsetxattr="unknown" tst_nargs_fsetxattr="unknown" # AC_MSG_CHECKING([if fsetxattr can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([fsetxattr]) ],[ AC_MSG_RESULT([yes]) tst_links_fsetxattr="yes" ],[ AC_MSG_RESULT([no]) tst_links_fsetxattr="no" ]) # if test "$tst_links_fsetxattr" = "yes"; then AC_MSG_CHECKING([if fsetxattr is prototyped]) AC_EGREP_CPP([fsetxattr],[ $curl_includes_sys_xattr ],[ AC_MSG_RESULT([yes]) tst_proto_fsetxattr="yes" ],[ AC_MSG_RESULT([no]) tst_proto_fsetxattr="no" ]) fi # if test "$tst_proto_fsetxattr" = "yes"; then if test "$tst_nargs_fsetxattr" = "unknown"; then AC_MSG_CHECKING([if fsetxattr takes 5 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != fsetxattr(0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_fsetxattr="yes" tst_nargs_fsetxattr="5" ],[ AC_MSG_RESULT([no]) tst_compi_fsetxattr="no" ]) fi if test "$tst_nargs_fsetxattr" = "unknown"; then AC_MSG_CHECKING([if fsetxattr takes 6 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != fsetxattr(0, 0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_fsetxattr="yes" tst_nargs_fsetxattr="6" ],[ AC_MSG_RESULT([no]) tst_compi_fsetxattr="no" ]) fi AC_MSG_CHECKING([if fsetxattr is compilable]) if test "$tst_compi_fsetxattr" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # if test "$tst_compi_fsetxattr" = "yes"; then AC_MSG_CHECKING([if fsetxattr usage allowed]) if test "x$curl_disallow_fsetxattr" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_fsetxattr="yes" else AC_MSG_RESULT([no]) tst_allow_fsetxattr="no" fi fi # AC_MSG_CHECKING([if fsetxattr might be used]) if test "$tst_links_fsetxattr" = "yes" && test "$tst_proto_fsetxattr" = "yes" && test "$tst_compi_fsetxattr" = "yes" && test "$tst_allow_fsetxattr" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_FSETXATTR, 1, [Define to 1 if you have the fsetxattr function.]) dnl AC_DEFINE_UNQUOTED(FSETXATTR_ARGS, $tst_nargs_fsetxattr, dnl [Specifies the number of arguments to fsetxattr]) # if test "$tst_nargs_fsetxattr" -eq "5"; then AC_DEFINE(HAVE_FSETXATTR_5, 1, [fsetxattr() takes 5 args]) elif test "$tst_nargs_fsetxattr" -eq "6"; then AC_DEFINE(HAVE_FSETXATTR_6, 1, [fsetxattr() takes 6 args]) fi # ac_cv_func_fsetxattr="yes" else AC_MSG_RESULT([no]) ac_cv_func_fsetxattr="no" fi ]) dnl CURL_CHECK_FUNC_FTRUNCATE dnl ------------------------------------------------- dnl Verify if ftruncate is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_ftruncate, then dnl HAVE_FTRUNCATE will be defined. AC_DEFUN([CURL_CHECK_FUNC_FTRUNCATE], [ AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl # tst_links_ftruncate="unknown" tst_proto_ftruncate="unknown" tst_compi_ftruncate="unknown" tst_allow_ftruncate="unknown" # AC_MSG_CHECKING([if ftruncate can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([ftruncate]) ],[ AC_MSG_RESULT([yes]) tst_links_ftruncate="yes" ],[ AC_MSG_RESULT([no]) tst_links_ftruncate="no" ]) # if test "$tst_links_ftruncate" = "yes"; then AC_MSG_CHECKING([if ftruncate is prototyped]) AC_EGREP_CPP([ftruncate],[ $curl_includes_unistd ],[ AC_MSG_RESULT([yes]) tst_proto_ftruncate="yes" ],[ AC_MSG_RESULT([no]) tst_proto_ftruncate="no" ]) fi # if test "$tst_proto_ftruncate" = "yes"; then AC_MSG_CHECKING([if ftruncate is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_unistd ]],[[ if(0 != ftruncate(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ftruncate="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ftruncate="no" ]) fi # if test "$tst_compi_ftruncate" = "yes"; then AC_MSG_CHECKING([if ftruncate usage allowed]) if test "x$curl_disallow_ftruncate" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ftruncate="yes" else AC_MSG_RESULT([no]) tst_allow_ftruncate="no" fi fi # AC_MSG_CHECKING([if ftruncate might be used]) if test "$tst_links_ftruncate" = "yes" && test "$tst_proto_ftruncate" = "yes" && test "$tst_compi_ftruncate" = "yes" && test "$tst_allow_ftruncate" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_FTRUNCATE, 1, [Define to 1 if you have the ftruncate function.]) ac_cv_func_ftruncate="yes" else AC_MSG_RESULT([no]) ac_cv_func_ftruncate="no" fi ]) dnl CURL_CHECK_FUNC_GETADDRINFO dnl ------------------------------------------------- dnl Verify if getaddrinfo is available, prototyped, can dnl be compiled and seems to work. If all of these are dnl true, and usage has not been previously disallowed dnl with shell variable curl_disallow_getaddrinfo, then dnl HAVE_GETADDRINFO will be defined. Additionally when dnl HAVE_GETADDRINFO gets defined this will also attempt dnl to find out if getaddrinfo happens to be threadsafe, dnl defining HAVE_GETADDRINFO_THREADSAFE when true. AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [ AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl AC_REQUIRE([CURL_INCLUDES_STRING])dnl AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl AC_REQUIRE([CURL_INCLUDES_NETDB])dnl AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl # tst_links_getaddrinfo="unknown" tst_proto_getaddrinfo="unknown" tst_compi_getaddrinfo="unknown" tst_works_getaddrinfo="unknown" tst_allow_getaddrinfo="unknown" tst_tsafe_getaddrinfo="unknown" # AC_MSG_CHECKING([if getaddrinfo can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_ws2tcpip $curl_includes_sys_socket $curl_includes_netdb ]],[[ if(0 != getaddrinfo(0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_getaddrinfo="yes" ],[ AC_MSG_RESULT([no]) tst_links_getaddrinfo="no" ]) # if test "$tst_links_getaddrinfo" = "yes"; then AC_MSG_CHECKING([if getaddrinfo is prototyped]) AC_EGREP_CPP([getaddrinfo],[ $curl_includes_ws2tcpip $curl_includes_sys_socket $curl_includes_netdb ],[ AC_MSG_RESULT([yes]) tst_proto_getaddrinfo="yes" ],[ AC_MSG_RESULT([no]) tst_proto_getaddrinfo="no" ]) fi # if test "$tst_proto_getaddrinfo" = "yes"; then AC_MSG_CHECKING([if getaddrinfo is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_ws2tcpip $curl_includes_sys_socket $curl_includes_netdb ]],[[ if(0 != getaddrinfo(0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getaddrinfo="yes" ],[ AC_MSG_RESULT([no]) tst_compi_getaddrinfo="no" ]) fi # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tst_compi_getaddrinfo" = "yes"; then AC_MSG_CHECKING([if getaddrinfo seems to work]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_ws2tcpip $curl_includes_stdlib $curl_includes_string $curl_includes_sys_socket $curl_includes_netdb ]],[[ struct addrinfo hints; struct addrinfo *ai = 0; 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", 0, &hints, &ai); if(error || !ai) exit(1); /* fail */ else exit(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_works_getaddrinfo="yes" ],[ AC_MSG_RESULT([no]) tst_works_getaddrinfo="no" ]) fi # if test "$tst_compi_getaddrinfo" = "yes" && test "$tst_works_getaddrinfo" != "no"; then AC_MSG_CHECKING([if getaddrinfo usage allowed]) if test "x$curl_disallow_getaddrinfo" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_getaddrinfo="yes" else AC_MSG_RESULT([no]) tst_allow_getaddrinfo="no" fi fi # AC_MSG_CHECKING([if getaddrinfo might be used]) if test "$tst_links_getaddrinfo" = "yes" && test "$tst_proto_getaddrinfo" = "yes" && test "$tst_compi_getaddrinfo" = "yes" && test "$tst_allow_getaddrinfo" = "yes" && test "$tst_works_getaddrinfo" != "no"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO, 1, [Define to 1 if you have a working getaddrinfo function.]) ac_cv_func_getaddrinfo="yes" else AC_MSG_RESULT([no]) ac_cv_func_getaddrinfo="no" ac_cv_func_getaddrinfo_threadsafe="no" fi # if test "$ac_cv_func_getaddrinfo" = "yes"; then AC_MSG_CHECKING([if getaddrinfo is threadsafe]) case $host_os in aix[[1234]].* | aix5.[[01]].*) dnl aix 5.1 and older tst_tsafe_getaddrinfo="no" ;; aix*) dnl aix 5.2 and newer tst_tsafe_getaddrinfo="yes" ;; darwin[[12345]].*) dnl darwin 5.0 and mac os x 10.1.X and older tst_tsafe_getaddrinfo="no" ;; darwin*) dnl darwin 6.0 and mac os x 10.2.X and newer tst_tsafe_getaddrinfo="yes" ;; freebsd[[1234]].* | freebsd5.[[1234]]*) dnl freebsd 5.4 and older tst_tsafe_getaddrinfo="no" ;; freebsd*) dnl freebsd 5.5 and newer tst_tsafe_getaddrinfo="yes" ;; hpux[[123456789]].* | hpux10.* | hpux11.0* | hpux11.10*) dnl hpux 11.10 and older tst_tsafe_getaddrinfo="no" ;; hpux*) dnl hpux 11.11 and newer tst_tsafe_getaddrinfo="yes" ;; netbsd[[123]].*) dnl netbsd 3.X and older tst_tsafe_getaddrinfo="no" ;; netbsd*) dnl netbsd 4.X and newer tst_tsafe_getaddrinfo="yes" ;; *bsd*) dnl All other bsd's tst_tsafe_getaddrinfo="no" ;; solaris2*) dnl solaris which have it tst_tsafe_getaddrinfo="yes" ;; esac if test "$tst_tsafe_getaddrinfo" = "unknown" && test "$ac_cv_native_windows" = "yes"; then tst_tsafe_getaddrinfo="yes" fi if test "$tst_tsafe_getaddrinfo" = "unknown"; then CURL_CHECK_DEF_CC([h_errno], [ $curl_includes_sys_socket $curl_includes_netdb ], [silent]) if test "$curl_cv_have_def_h_errno" = "yes"; then tst_h_errno_macro="yes" else tst_h_errno_macro="no" fi AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_socket $curl_includes_netdb ]],[[ h_errno = 2; if(0 != h_errno) return 1; ]]) ],[ tst_h_errno_modifiable_lvalue="yes" ],[ tst_h_errno_modifiable_lvalue="no" ]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ #if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) return 0; #elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700) return 0; #else force compilation error #endif ]]) ],[ tst_h_errno_sbs_issue_7="yes" ],[ tst_h_errno_sbs_issue_7="no" ]) if test "$tst_h_errno_macro" = "no" && test "$tst_h_errno_modifiable_lvalue" = "no" && test "$tst_h_errno_sbs_issue_7" = "no"; then tst_tsafe_getaddrinfo="no" else tst_tsafe_getaddrinfo="yes" fi fi AC_MSG_RESULT([$tst_tsafe_getaddrinfo]) if test "$tst_tsafe_getaddrinfo" = "yes"; then AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO_THREADSAFE, 1, [Define to 1 if the getaddrinfo function is threadsafe.]) ac_cv_func_getaddrinfo_threadsafe="yes" else ac_cv_func_getaddrinfo_threadsafe="no" fi fi ]) dnl CURL_CHECK_FUNC_GETHOSTBYADDR dnl ------------------------------------------------- dnl Verify if gethostbyaddr is available, prototyped, dnl and can be compiled. If all of these are true, dnl and usage has not been previously disallowed with dnl shell variable curl_disallow_gethostbyaddr, then dnl HAVE_GETHOSTBYADDR will be defined. AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYADDR], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CURL_INCLUDES_NETDB])dnl # tst_links_gethostbyaddr="unknown" tst_proto_gethostbyaddr="unknown" tst_compi_gethostbyaddr="unknown" tst_allow_gethostbyaddr="unknown" # AC_MSG_CHECKING([if gethostbyaddr can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_netdb ]],[[ if(0 != gethostbyaddr(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_gethostbyaddr="yes" ],[ AC_MSG_RESULT([no]) tst_links_gethostbyaddr="no" ]) # if test "$tst_links_gethostbyaddr" = "yes"; then AC_MSG_CHECKING([if gethostbyaddr is prototyped]) AC_EGREP_CPP([gethostbyaddr],[ $curl_includes_winsock2 $curl_includes_netdb ],[ AC_MSG_RESULT([yes]) tst_proto_gethostbyaddr="yes" ],[ AC_MSG_RESULT([no]) tst_proto_gethostbyaddr="no" ]) fi # if test "$tst_proto_gethostbyaddr" = "yes"; then AC_MSG_CHECKING([if gethostbyaddr is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_netdb ]],[[ if(0 != gethostbyaddr(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_gethostbyaddr="yes" ],[ AC_MSG_RESULT([no]) tst_compi_gethostbyaddr="no" ]) fi # if test "$tst_compi_gethostbyaddr" = "yes"; then AC_MSG_CHECKING([if gethostbyaddr usage allowed]) if test "x$curl_disallow_gethostbyaddr" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_gethostbyaddr="yes" else AC_MSG_RESULT([no]) tst_allow_gethostbyaddr="no" fi fi # AC_MSG_CHECKING([if gethostbyaddr might be used]) if test "$tst_links_gethostbyaddr" = "yes" && test "$tst_proto_gethostbyaddr" = "yes" && test "$tst_compi_gethostbyaddr" = "yes" && test "$tst_allow_gethostbyaddr" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR, 1, [Define to 1 if you have the gethostbyaddr function.]) ac_cv_func_gethostbyaddr="yes" else AC_MSG_RESULT([no]) ac_cv_func_gethostbyaddr="no" fi ]) dnl CURL_CHECK_FUNC_GAI_STRERROR dnl ------------------------------------------------- dnl Verify if gai_strerror is available, prototyped, dnl and can be compiled. If all of these are true, dnl and usage has not been previously disallowed with dnl shell variable curl_disallow_gai_strerror, then dnl HAVE_GAI_STRERROR will be defined. AC_DEFUN([CURL_CHECK_FUNC_GAI_STRERROR], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CURL_INCLUDES_NETDB])dnl # tst_links_gai_strerror="unknown" tst_proto_gai_strerror="unknown" tst_compi_gai_strerror="unknown" tst_allow_gai_strerror="unknown" # AC_MSG_CHECKING([if gai_strerror can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_netdb ]],[[ if(0 != gai_strerror(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_gai_strerror="yes" ],[ AC_MSG_RESULT([no]) tst_links_gai_strerror="no" ]) # if test "$tst_links_gai_strerror" = "yes"; then AC_MSG_CHECKING([if gai_strerror is prototyped]) AC_EGREP_CPP([gai_strerror],[ $curl_includes_winsock2 $curl_includes_netdb ],[ AC_MSG_RESULT([yes]) tst_proto_gai_strerror="yes" ],[ AC_MSG_RESULT([no]) tst_proto_gai_strerror="no" ]) fi # if test "$tst_proto_gai_strerror" = "yes"; then AC_MSG_CHECKING([if gai_strerror is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_netdb ]],[[ if(0 != gai_strerror(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_gai_strerror="yes" ],[ AC_MSG_RESULT([no]) tst_compi_gai_strerror="no" ]) fi # if test "$tst_compi_gai_strerror" = "yes"; then AC_MSG_CHECKING([if gai_strerror usage allowed]) if test "x$curl_disallow_gai_strerror" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_gai_strerror="yes" else AC_MSG_RESULT([no]) tst_allow_gai_strerror="no" fi fi # AC_MSG_CHECKING([if gai_strerror might be used]) if test "$tst_links_gai_strerror" = "yes" && test "$tst_proto_gai_strerror" = "yes" && test "$tst_compi_gai_strerror" = "yes" && test "$tst_allow_gai_strerror" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GAI_STRERROR, 1, [Define to 1 if you have the gai_strerror function.]) ac_cv_func_gai_strerror="yes" else AC_MSG_RESULT([no]) ac_cv_func_gai_strerror="no" fi ]) dnl CURL_CHECK_FUNC_GETHOSTBYADDR_R dnl ------------------------------------------------- dnl Verify if gethostbyaddr_r is available, prototyped, dnl and can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_gethostbyaddr_r, then dnl HAVE_GETHOSTBYADDR_R will be defined. AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYADDR_R], [ AC_REQUIRE([CURL_INCLUDES_NETDB])dnl # tst_links_gethostbyaddr_r="unknown" tst_proto_gethostbyaddr_r="unknown" tst_compi_gethostbyaddr_r="unknown" tst_allow_gethostbyaddr_r="unknown" tst_nargs_gethostbyaddr_r="unknown" # AC_MSG_CHECKING([if gethostbyaddr_r can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gethostbyaddr_r]) ],[ AC_MSG_RESULT([yes]) tst_links_gethostbyaddr_r="yes" ],[ AC_MSG_RESULT([no]) tst_links_gethostbyaddr_r="no" ]) # if test "$tst_links_gethostbyaddr_r" = "yes"; then AC_MSG_CHECKING([if gethostbyaddr_r is prototyped]) AC_EGREP_CPP([gethostbyaddr_r],[ $curl_includes_netdb ],[ AC_MSG_RESULT([yes]) tst_proto_gethostbyaddr_r="yes" ],[ AC_MSG_RESULT([no]) tst_proto_gethostbyaddr_r="no" ]) fi # if test "$tst_proto_gethostbyaddr_r" = "yes"; then if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then AC_MSG_CHECKING([if gethostbyaddr_r takes 5 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_netdb ]],[[ if(0 != gethostbyaddr_r(0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_gethostbyaddr_r="yes" tst_nargs_gethostbyaddr_r="5" ],[ AC_MSG_RESULT([no]) tst_compi_gethostbyaddr_r="no" ]) fi if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then AC_MSG_CHECKING([if gethostbyaddr_r takes 7 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_netdb ]],[[ if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_gethostbyaddr_r="yes" tst_nargs_gethostbyaddr_r="7" ],[ AC_MSG_RESULT([no]) tst_compi_gethostbyaddr_r="no" ]) fi if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then AC_MSG_CHECKING([if gethostbyaddr_r takes 8 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_netdb ]],[[ if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_gethostbyaddr_r="yes" tst_nargs_gethostbyaddr_r="8" ],[ AC_MSG_RESULT([no]) tst_compi_gethostbyaddr_r="no" ]) fi AC_MSG_CHECKING([if gethostbyaddr_r is compilable]) if test "$tst_compi_gethostbyaddr_r" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # if test "$tst_compi_gethostbyaddr_r" = "yes"; then AC_MSG_CHECKING([if gethostbyaddr_r usage allowed]) if test "x$curl_disallow_gethostbyaddr_r" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_gethostbyaddr_r="yes" else AC_MSG_RESULT([no]) tst_allow_gethostbyaddr_r="no" fi fi # AC_MSG_CHECKING([if gethostbyaddr_r might be used]) if test "$tst_links_gethostbyaddr_r" = "yes" && test "$tst_proto_gethostbyaddr_r" = "yes" && test "$tst_compi_gethostbyaddr_r" = "yes" && test "$tst_allow_gethostbyaddr_r" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR_R, 1, [Define to 1 if you have the gethostbyaddr_r function.]) dnl AC_DEFINE_UNQUOTED(GETHOSTBYADDR_R_ARGS, $tst_nargs_gethostbyaddr_r, dnl [Specifies the number of arguments to gethostbyaddr_r]) # if test "$tst_nargs_gethostbyaddr_r" -eq "5"; then AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args]) elif test "$tst_nargs_gethostbyaddr_r" -eq "7"; then AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, [gethostbyaddr_r() takes 7 args]) elif test "$tst_nargs_gethostbyaddr_r" -eq "8"; then AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, [gethostbyaddr_r() takes 8 args]) fi # ac_cv_func_gethostbyaddr_r="yes" else AC_MSG_RESULT([no]) ac_cv_func_gethostbyaddr_r="no" fi ]) dnl CURL_CHECK_FUNC_GETHOSTBYNAME dnl ------------------------------------------------- dnl Verify if gethostbyname is available, prototyped, dnl and can be compiled. If all of these are true, dnl and usage has not been previously disallowed with dnl shell variable curl_disallow_gethostbyname, then dnl HAVE_GETHOSTBYNAME will be defined. AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CURL_INCLUDES_NETDB])dnl # tst_links_gethostbyname="unknown" tst_proto_gethostbyname="unknown" tst_compi_gethostbyname="unknown" tst_allow_gethostbyname="unknown" # AC_MSG_CHECKING([if gethostbyname can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_netdb ]],[[ if(0 != gethostbyname(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_gethostbyname="yes" ],[ AC_MSG_RESULT([no]) tst_links_gethostbyname="no" ]) # if test "$tst_links_gethostbyname" = "yes"; then AC_MSG_CHECKING([if gethostbyname is prototyped]) AC_EGREP_CPP([gethostbyname],[ $curl_includes_winsock2 $curl_includes_netdb ],[ AC_MSG_RESULT([yes]) tst_proto_gethostbyname="yes" ],[ AC_MSG_RESULT([no]) tst_proto_gethostbyname="no" ]) fi # if test "$tst_proto_gethostbyname" = "yes"; then AC_MSG_CHECKING([if gethostbyname is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_netdb ]],[[ if(0 != gethostbyname(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_gethostbyname="yes" ],[ AC_MSG_RESULT([no]) tst_compi_gethostbyname="no" ]) fi # if test "$tst_compi_gethostbyname" = "yes"; then AC_MSG_CHECKING([if gethostbyname usage allowed]) if test "x$curl_disallow_gethostbyname" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_gethostbyname="yes" else AC_MSG_RESULT([no]) tst_allow_gethostbyname="no" fi fi # AC_MSG_CHECKING([if gethostbyname might be used]) if test "$tst_links_gethostbyname" = "yes" && test "$tst_proto_gethostbyname" = "yes" && test "$tst_compi_gethostbyname" = "yes" && test "$tst_allow_gethostbyname" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME, 1, [Define to 1 if you have the gethostbyname function.]) ac_cv_func_gethostbyname="yes" else AC_MSG_RESULT([no]) ac_cv_func_gethostbyname="no" fi ]) dnl CURL_CHECK_FUNC_GETHOSTBYNAME_R dnl ------------------------------------------------- dnl Verify if gethostbyname_r is available, prototyped, dnl and can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_gethostbyname_r, then dnl HAVE_GETHOSTBYNAME_R will be defined. AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME_R], [ AC_REQUIRE([CURL_INCLUDES_NETDB])dnl # tst_links_gethostbyname_r="unknown" tst_proto_gethostbyname_r="unknown" tst_compi_gethostbyname_r="unknown" tst_allow_gethostbyname_r="unknown" tst_nargs_gethostbyname_r="unknown" # AC_MSG_CHECKING([if gethostbyname_r can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gethostbyname_r]) ],[ AC_MSG_RESULT([yes]) tst_links_gethostbyname_r="yes" ],[ AC_MSG_RESULT([no]) tst_links_gethostbyname_r="no" ]) # if test "$tst_links_gethostbyname_r" = "yes"; then AC_MSG_CHECKING([if gethostbyname_r is prototyped]) AC_EGREP_CPP([gethostbyname_r],[ $curl_includes_netdb ],[ AC_MSG_RESULT([yes]) tst_proto_gethostbyname_r="yes" ],[ AC_MSG_RESULT([no]) tst_proto_gethostbyname_r="no" ]) fi # if test "$tst_proto_gethostbyname_r" = "yes"; then if test "$tst_nargs_gethostbyname_r" = "unknown"; then AC_MSG_CHECKING([if gethostbyname_r takes 3 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_netdb ]],[[ if(0 != gethostbyname_r(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_gethostbyname_r="yes" tst_nargs_gethostbyname_r="3" ],[ AC_MSG_RESULT([no]) tst_compi_gethostbyname_r="no" ]) fi if test "$tst_nargs_gethostbyname_r" = "unknown"; then AC_MSG_CHECKING([if gethostbyname_r takes 5 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_netdb ]],[[ if(0 != gethostbyname_r(0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_gethostbyname_r="yes" tst_nargs_gethostbyname_r="5" ],[ AC_MSG_RESULT([no]) tst_compi_gethostbyname_r="no" ]) fi if test "$tst_nargs_gethostbyname_r" = "unknown"; then AC_MSG_CHECKING([if gethostbyname_r takes 6 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_netdb ]],[[ if(0 != gethostbyname_r(0, 0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_gethostbyname_r="yes" tst_nargs_gethostbyname_r="6" ],[ AC_MSG_RESULT([no]) tst_compi_gethostbyname_r="no" ]) fi AC_MSG_CHECKING([if gethostbyname_r is compilable]) if test "$tst_compi_gethostbyname_r" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # if test "$tst_compi_gethostbyname_r" = "yes"; then AC_MSG_CHECKING([if gethostbyname_r usage allowed]) if test "x$curl_disallow_gethostbyname_r" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_gethostbyname_r="yes" else AC_MSG_RESULT([no]) tst_allow_gethostbyname_r="no" fi fi # AC_MSG_CHECKING([if gethostbyname_r might be used]) if test "$tst_links_gethostbyname_r" = "yes" && test "$tst_proto_gethostbyname_r" = "yes" && test "$tst_compi_gethostbyname_r" = "yes" && test "$tst_allow_gethostbyname_r" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME_R, 1, [Define to 1 if you have the gethostbyname_r function.]) dnl AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_ARGS, $tst_nargs_gethostbyname_r, dnl [Specifies the number of arguments to gethostbyname_r]) # if test "$tst_nargs_gethostbyname_r" -eq "3"; then AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args]) elif test "$tst_nargs_gethostbyname_r" -eq "5"; then AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [gethostbyname_r() takes 5 args]) elif test "$tst_nargs_gethostbyname_r" -eq "6"; then AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [gethostbyname_r() takes 6 args]) fi # ac_cv_func_gethostbyname_r="yes" else AC_MSG_RESULT([no]) ac_cv_func_gethostbyname_r="no" fi ]) dnl CURL_CHECK_FUNC_GETHOSTNAME dnl ------------------------------------------------- dnl Verify if gethostname is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_gethostname, then dnl HAVE_GETHOSTNAME will be defined. AC_DEFUN([CURL_CHECK_FUNC_GETHOSTNAME], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl AC_REQUIRE([CURL_PREPROCESS_CALLCONV])dnl # tst_links_gethostname="unknown" tst_proto_gethostname="unknown" tst_compi_gethostname="unknown" tst_allow_gethostname="unknown" # AC_MSG_CHECKING([if gethostname can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_unistd ]],[[ if(0 != gethostname(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_gethostname="yes" ],[ AC_MSG_RESULT([no]) tst_links_gethostname="no" ]) # if test "$tst_links_gethostname" = "yes"; then AC_MSG_CHECKING([if gethostname is prototyped]) AC_EGREP_CPP([gethostname],[ $curl_includes_winsock2 $curl_includes_unistd ],[ AC_MSG_RESULT([yes]) tst_proto_gethostname="yes" ],[ AC_MSG_RESULT([no]) tst_proto_gethostname="no" ]) fi # if test "$tst_proto_gethostname" = "yes"; then AC_MSG_CHECKING([if gethostname is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_unistd ]],[[ if(0 != gethostname(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_gethostname="yes" ],[ AC_MSG_RESULT([no]) tst_compi_gethostname="no" ]) fi # if test "$tst_compi_gethostname" = "yes"; then AC_MSG_CHECKING([for gethostname arg 2 data type]) tst_gethostname_type_arg2="unknown" for tst_arg1 in 'char *' 'unsigned char *' 'void *'; do for tst_arg2 in 'int' 'unsigned int' 'size_t'; do if test "$tst_gethostname_type_arg2" = "unknown"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_unistd $curl_preprocess_callconv extern int FUNCALLCONV gethostname($tst_arg1, $tst_arg2); ]],[[ if(0 != gethostname(0, 0)) return 1; ]]) ],[ tst_gethostname_type_arg2="$tst_arg2" ]) fi done done AC_MSG_RESULT([$tst_gethostname_type_arg2]) if test "$tst_gethostname_type_arg2" != "unknown"; then AC_DEFINE_UNQUOTED(GETHOSTNAME_TYPE_ARG2, $tst_gethostname_type_arg2, [Define to the type of arg 2 for gethostname.]) fi fi # if test "$tst_compi_gethostname" = "yes"; then AC_MSG_CHECKING([if gethostname usage allowed]) if test "x$curl_disallow_gethostname" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_gethostname="yes" else AC_MSG_RESULT([no]) tst_allow_gethostname="no" fi fi # AC_MSG_CHECKING([if gethostname might be used]) if test "$tst_links_gethostname" = "yes" && test "$tst_proto_gethostname" = "yes" && test "$tst_compi_gethostname" = "yes" && test "$tst_allow_gethostname" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETHOSTNAME, 1, [Define to 1 if you have the gethostname function.]) ac_cv_func_gethostname="yes" else AC_MSG_RESULT([no]) ac_cv_func_gethostname="no" fi ]) dnl CURL_CHECK_FUNC_GETIFADDRS dnl ------------------------------------------------- dnl Verify if getifaddrs is available, prototyped, can dnl be compiled and seems to work. If all of these are dnl true, and usage has not been previously disallowed dnl with shell variable curl_disallow_getifaddrs, then dnl HAVE_GETIFADDRS will be defined. AC_DEFUN([CURL_CHECK_FUNC_GETIFADDRS], [ AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl AC_REQUIRE([CURL_INCLUDES_IFADDRS])dnl # tst_links_getifaddrs="unknown" tst_proto_getifaddrs="unknown" tst_compi_getifaddrs="unknown" tst_works_getifaddrs="unknown" tst_allow_getifaddrs="unknown" # AC_MSG_CHECKING([if getifaddrs can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getifaddrs]) ],[ AC_MSG_RESULT([yes]) tst_links_getifaddrs="yes" ],[ AC_MSG_RESULT([no]) tst_links_getifaddrs="no" ]) # if test "$tst_links_getifaddrs" = "yes"; then AC_MSG_CHECKING([if getifaddrs is prototyped]) AC_EGREP_CPP([getifaddrs],[ $curl_includes_ifaddrs ],[ AC_MSG_RESULT([yes]) tst_proto_getifaddrs="yes" ],[ AC_MSG_RESULT([no]) tst_proto_getifaddrs="no" ]) fi # if test "$tst_proto_getifaddrs" = "yes"; then AC_MSG_CHECKING([if getifaddrs is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_ifaddrs ]],[[ if(0 != getifaddrs(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getifaddrs="yes" ],[ AC_MSG_RESULT([no]) tst_compi_getifaddrs="no" ]) fi # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tst_compi_getifaddrs" = "yes"; then AC_MSG_CHECKING([if getifaddrs seems to work]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stdlib $curl_includes_ifaddrs ]],[[ struct ifaddrs *ifa = 0; int error; error = getifaddrs(&ifa); if(error || !ifa) exit(1); /* fail */ else exit(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_works_getifaddrs="yes" ],[ AC_MSG_RESULT([no]) tst_works_getifaddrs="no" ]) fi # if test "$tst_compi_getifaddrs" = "yes" && test "$tst_works_getifaddrs" != "no"; then AC_MSG_CHECKING([if getifaddrs usage allowed]) if test "x$curl_disallow_getifaddrs" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_getifaddrs="yes" else AC_MSG_RESULT([no]) tst_allow_getifaddrs="no" fi fi # AC_MSG_CHECKING([if getifaddrs might be used]) if test "$tst_links_getifaddrs" = "yes" && test "$tst_proto_getifaddrs" = "yes" && test "$tst_compi_getifaddrs" = "yes" && test "$tst_allow_getifaddrs" = "yes" && test "$tst_works_getifaddrs" != "no"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETIFADDRS, 1, [Define to 1 if you have a working getifaddrs function.]) ac_cv_func_getifaddrs="yes" else AC_MSG_RESULT([no]) ac_cv_func_getifaddrs="no" fi ]) dnl CURL_CHECK_FUNC_GETSERVBYPORT_R dnl ------------------------------------------------- dnl Verify if getservbyport_r is available, prototyped, dnl and can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_getservbyport_r, then dnl HAVE_GETSERVBYPORT_R will be defined. AC_DEFUN([CURL_CHECK_FUNC_GETSERVBYPORT_R], [ AC_REQUIRE([CURL_INCLUDES_NETDB])dnl # tst_links_getservbyport_r="unknown" tst_proto_getservbyport_r="unknown" tst_compi_getservbyport_r="unknown" tst_allow_getservbyport_r="unknown" tst_nargs_getservbyport_r="unknown" # AC_MSG_CHECKING([if getservbyport_r can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getservbyport_r]) ],[ AC_MSG_RESULT([yes]) tst_links_getservbyport_r="yes" ],[ AC_MSG_RESULT([no]) tst_links_getservbyport_r="no" ]) # if test "$tst_links_getservbyport_r" = "yes"; then AC_MSG_CHECKING([if getservbyport_r is prototyped]) AC_EGREP_CPP([getservbyport_r],[ $curl_includes_netdb ],[ AC_MSG_RESULT([yes]) tst_proto_getservbyport_r="yes" ],[ AC_MSG_RESULT([no]) tst_proto_getservbyport_r="no" ]) fi # if test "$tst_proto_getservbyport_r" = "yes"; then if test "$tst_nargs_getservbyport_r" = "unknown"; then AC_MSG_CHECKING([if getservbyport_r takes 4 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_netdb ]],[[ if(0 != getservbyport_r(0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getservbyport_r="yes" tst_nargs_getservbyport_r="4" ],[ AC_MSG_RESULT([no]) tst_compi_getservbyport_r="no" ]) fi if test "$tst_nargs_getservbyport_r" = "unknown"; then AC_MSG_CHECKING([if getservbyport_r takes 5 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_netdb ]],[[ if(0 != getservbyport_r(0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getservbyport_r="yes" tst_nargs_getservbyport_r="5" ],[ AC_MSG_RESULT([no]) tst_compi_getservbyport_r="no" ]) fi if test "$tst_nargs_getservbyport_r" = "unknown"; then AC_MSG_CHECKING([if getservbyport_r takes 6 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_netdb ]],[[ if(0 != getservbyport_r(0, 0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getservbyport_r="yes" tst_nargs_getservbyport_r="6" ],[ AC_MSG_RESULT([no]) tst_compi_getservbyport_r="no" ]) fi AC_MSG_CHECKING([if getservbyport_r is compilable]) if test "$tst_compi_getservbyport_r" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # if test "$tst_compi_getservbyport_r" = "yes"; then AC_MSG_CHECKING([if getservbyport_r usage allowed]) if test "x$curl_disallow_getservbyport_r" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_getservbyport_r="yes" else AC_MSG_RESULT([no]) tst_allow_getservbyport_r="no" fi fi # AC_MSG_CHECKING([if getservbyport_r might be used]) if test "$tst_links_getservbyport_r" = "yes" && test "$tst_proto_getservbyport_r" = "yes" && test "$tst_compi_getservbyport_r" = "yes" && test "$tst_allow_getservbyport_r" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETSERVBYPORT_R, 1, [Define to 1 if you have the getservbyport_r function.]) AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $tst_nargs_getservbyport_r, [Specifies the number of arguments to getservbyport_r]) if test "$tst_nargs_getservbyport_r" -eq "4"; then AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data), [Specifies the size of the buffer to pass to getservbyport_r]) else AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096, [Specifies the size of the buffer to pass to getservbyport_r]) fi ac_cv_func_getservbyport_r="yes" else AC_MSG_RESULT([no]) ac_cv_func_getservbyport_r="no" fi ]) dnl CURL_CHECK_FUNC_GETXATTR dnl ------------------------------------------------- dnl Verify if getxattr is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_getxattr, then dnl HAVE_GETXATTR will be defined. AC_DEFUN([CURL_CHECK_FUNC_GETXATTR], [ AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl # tst_links_getxattr="unknown" tst_proto_getxattr="unknown" tst_compi_getxattr="unknown" tst_allow_getxattr="unknown" tst_nargs_getxattr="unknown" # AC_MSG_CHECKING([if getxattr can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getxattr]) ],[ AC_MSG_RESULT([yes]) tst_links_getxattr="yes" ],[ AC_MSG_RESULT([no]) tst_links_getxattr="no" ]) # if test "$tst_links_getxattr" = "yes"; then AC_MSG_CHECKING([if getxattr is prototyped]) AC_EGREP_CPP([getxattr],[ $curl_includes_sys_xattr ],[ AC_MSG_RESULT([yes]) tst_proto_getxattr="yes" ],[ AC_MSG_RESULT([no]) tst_proto_getxattr="no" ]) fi # if test "$tst_proto_getxattr" = "yes"; then if test "$tst_nargs_getxattr" = "unknown"; then AC_MSG_CHECKING([if getxattr takes 4 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != getxattr(0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getxattr="yes" tst_nargs_getxattr="4" ],[ AC_MSG_RESULT([no]) tst_compi_getxattr="no" ]) fi if test "$tst_nargs_getxattr" = "unknown"; then AC_MSG_CHECKING([if getxattr takes 6 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != getxattr(0, 0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getxattr="yes" tst_nargs_getxattr="6" ],[ AC_MSG_RESULT([no]) tst_compi_getxattr="no" ]) fi AC_MSG_CHECKING([if getxattr is compilable]) if test "$tst_compi_getxattr" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # if test "$tst_compi_getxattr" = "yes"; then AC_MSG_CHECKING([if getxattr usage allowed]) if test "x$curl_disallow_getxattr" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_getxattr="yes" else AC_MSG_RESULT([no]) tst_allow_getxattr="no" fi fi # AC_MSG_CHECKING([if getxattr might be used]) if test "$tst_links_getxattr" = "yes" && test "$tst_proto_getxattr" = "yes" && test "$tst_compi_getxattr" = "yes" && test "$tst_allow_getxattr" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETXATTR, 1, [Define to 1 if you have the getxattr function.]) dnl AC_DEFINE_UNQUOTED(GETXATTR_ARGS, $tst_nargs_getxattr, dnl [Specifies the number of arguments to getxattr]) # if test "$tst_nargs_getxattr" -eq "4"; then AC_DEFINE(HAVE_GETXATTR_4, 1, [getxattr() takes 4 args]) elif test "$tst_nargs_getxattr" -eq "6"; then AC_DEFINE(HAVE_GETXATTR_6, 1, [getxattr() takes 6 args]) fi # ac_cv_func_getxattr="yes" else AC_MSG_RESULT([no]) ac_cv_func_getxattr="no" fi ]) dnl CURL_CHECK_FUNC_GMTIME_R dnl ------------------------------------------------- dnl Verify if gmtime_r is available, prototyped, can dnl be compiled and seems to work. If all of these are dnl true, and usage has not been previously disallowed dnl with shell variable curl_disallow_gmtime_r, then dnl HAVE_GMTIME_R will be defined. AC_DEFUN([CURL_CHECK_FUNC_GMTIME_R], [ AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl AC_REQUIRE([CURL_INCLUDES_TIME])dnl # tst_links_gmtime_r="unknown" tst_proto_gmtime_r="unknown" tst_compi_gmtime_r="unknown" tst_works_gmtime_r="unknown" tst_allow_gmtime_r="unknown" # AC_MSG_CHECKING([if gmtime_r can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gmtime_r]) ],[ AC_MSG_RESULT([yes]) tst_links_gmtime_r="yes" ],[ AC_MSG_RESULT([no]) tst_links_gmtime_r="no" ]) # if test "$tst_links_gmtime_r" = "yes"; then AC_MSG_CHECKING([if gmtime_r is prototyped]) AC_EGREP_CPP([gmtime_r],[ $curl_includes_time ],[ AC_MSG_RESULT([yes]) tst_proto_gmtime_r="yes" ],[ AC_MSG_RESULT([no]) tst_proto_gmtime_r="no" ]) fi # if test "$tst_proto_gmtime_r" = "yes"; then AC_MSG_CHECKING([if gmtime_r is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_time ]],[[ if(0 != gmtime_r(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_gmtime_r="yes" ],[ AC_MSG_RESULT([no]) tst_compi_gmtime_r="no" ]) fi # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tst_compi_gmtime_r" = "yes"; then AC_MSG_CHECKING([if gmtime_r seems to work]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stdlib $curl_includes_time ]],[[ time_t local = 1170352587; struct tm *gmt = 0; struct tm result; gmt = gmtime_r(&local, &result); if(gmt) exit(0); else exit(1); ]]) ],[ AC_MSG_RESULT([yes]) tst_works_gmtime_r="yes" ],[ AC_MSG_RESULT([no]) tst_works_gmtime_r="no" ]) fi # if test "$tst_compi_gmtime_r" = "yes" && test "$tst_works_gmtime_r" != "no"; then AC_MSG_CHECKING([if gmtime_r usage allowed]) if test "x$curl_disallow_gmtime_r" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_gmtime_r="yes" else AC_MSG_RESULT([no]) tst_allow_gmtime_r="no" fi fi # AC_MSG_CHECKING([if gmtime_r might be used]) if test "$tst_links_gmtime_r" = "yes" && test "$tst_proto_gmtime_r" = "yes" && test "$tst_compi_gmtime_r" = "yes" && test "$tst_allow_gmtime_r" = "yes" && test "$tst_works_gmtime_r" != "no"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GMTIME_R, 1, [Define to 1 if you have a working gmtime_r function.]) ac_cv_func_gmtime_r="yes" else AC_MSG_RESULT([no]) ac_cv_func_gmtime_r="no" fi ]) dnl CURL_CHECK_FUNC_INET_NTOA_R dnl ------------------------------------------------- dnl Verify if inet_ntoa_r is available, prototyped, dnl and can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_inet_ntoa_r, then dnl HAVE_INET_NTOA_R will be defined. AC_DEFUN([CURL_CHECK_FUNC_INET_NTOA_R], [ AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl # tst_links_inet_ntoa_r="unknown" tst_proto_inet_ntoa_r="unknown" tst_compi_inet_ntoa_r="unknown" tst_allow_inet_ntoa_r="unknown" tst_nargs_inet_ntoa_r="unknown" # AC_MSG_CHECKING([if inet_ntoa_r can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([inet_ntoa_r]) ],[ AC_MSG_RESULT([yes]) tst_links_inet_ntoa_r="yes" ],[ AC_MSG_RESULT([no]) tst_links_inet_ntoa_r="no" ]) # if test "$tst_links_inet_ntoa_r" = "yes"; then AC_MSG_CHECKING([if inet_ntoa_r is prototyped]) AC_EGREP_CPP([inet_ntoa_r],[ $curl_includes_arpa_inet ],[ AC_MSG_RESULT([yes]) tst_proto_inet_ntoa_r="yes" ],[ AC_MSG_RESULT([no]) tst_proto_inet_ntoa_r="no" ]) fi # if test "$tst_proto_inet_ntoa_r" = "yes"; then if test "$tst_nargs_inet_ntoa_r" = "unknown"; then AC_MSG_CHECKING([if inet_ntoa_r takes 2 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_arpa_inet ]],[[ struct in_addr addr; if(0 != inet_ntoa_r(addr, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_inet_ntoa_r="yes" tst_nargs_inet_ntoa_r="2" ],[ AC_MSG_RESULT([no]) tst_compi_inet_ntoa_r="no" ]) fi if test "$tst_nargs_inet_ntoa_r" = "unknown"; then AC_MSG_CHECKING([if inet_ntoa_r takes 3 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_arpa_inet ]],[[ struct in_addr addr; if(0 != inet_ntoa_r(addr, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_inet_ntoa_r="yes" tst_nargs_inet_ntoa_r="3" ],[ AC_MSG_RESULT([no]) tst_compi_inet_ntoa_r="no" ]) fi AC_MSG_CHECKING([if inet_ntoa_r is compilable]) if test "$tst_compi_inet_ntoa_r" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # if test "$tst_compi_inet_ntoa_r" = "yes"; then AC_MSG_CHECKING([if inet_ntoa_r usage allowed]) if test "x$curl_disallow_inet_ntoa_r" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_inet_ntoa_r="yes" else AC_MSG_RESULT([no]) tst_allow_inet_ntoa_r="no" fi fi # AC_MSG_CHECKING([if inet_ntoa_r might be used]) if test "$tst_links_inet_ntoa_r" = "yes" && test "$tst_proto_inet_ntoa_r" = "yes" && test "$tst_compi_inet_ntoa_r" = "yes" && test "$tst_allow_inet_ntoa_r" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_INET_NTOA_R, 1, [Define to 1 if you have the inet_ntoa_r function.]) dnl AC_DEFINE_UNQUOTED(INET_NTOA_R_ARGS, $tst_nargs_inet_ntoa_r, dnl [Specifies the number of arguments to inet_ntoa_r]) # if test "$tst_nargs_inet_ntoa_r" -eq "2"; then AC_DEFINE(HAVE_INET_NTOA_R_2, 1, [inet_ntoa_r() takes 2 args]) elif test "$tst_nargs_inet_ntoa_r" -eq "3"; then AC_DEFINE(HAVE_INET_NTOA_R_3, 1, [inet_ntoa_r() takes 3 args]) fi # ac_cv_func_inet_ntoa_r="yes" else AC_MSG_RESULT([no]) ac_cv_func_inet_ntoa_r="no" fi ]) dnl CURL_CHECK_FUNC_INET_NTOP dnl ------------------------------------------------- dnl Verify if inet_ntop is available, prototyped, can dnl be compiled and seems to work. If all of these are dnl true, and usage has not been previously disallowed dnl with shell variable curl_disallow_inet_ntop, then dnl HAVE_INET_NTOP will be defined. AC_DEFUN([CURL_CHECK_FUNC_INET_NTOP], [ AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl AC_REQUIRE([CURL_INCLUDES_STRING])dnl # tst_links_inet_ntop="unknown" tst_proto_inet_ntop="unknown" tst_compi_inet_ntop="unknown" tst_works_inet_ntop="unknown" tst_allow_inet_ntop="unknown" # AC_MSG_CHECKING([if inet_ntop can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([inet_ntop]) ],[ AC_MSG_RESULT([yes]) tst_links_inet_ntop="yes" ],[ AC_MSG_RESULT([no]) tst_links_inet_ntop="no" ]) # if test "$tst_links_inet_ntop" = "yes"; then AC_MSG_CHECKING([if inet_ntop is prototyped]) AC_EGREP_CPP([inet_ntop],[ $curl_includes_arpa_inet ],[ AC_MSG_RESULT([yes]) tst_proto_inet_ntop="yes" ],[ AC_MSG_RESULT([no]) tst_proto_inet_ntop="no" ]) fi # if test "$tst_proto_inet_ntop" = "yes"; then AC_MSG_CHECKING([if inet_ntop is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_arpa_inet ]],[[ if(0 != inet_ntop(0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_inet_ntop="yes" ],[ AC_MSG_RESULT([no]) tst_compi_inet_ntop="no" ]) fi # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tst_compi_inet_ntop" = "yes"; then AC_MSG_CHECKING([if inet_ntop seems to work]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stdlib $curl_includes_arpa_inet $curl_includes_string ]],[[ char ipv6res[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; char ipv4res[sizeof "255.255.255.255"]; unsigned char ipv6a[26]; unsigned char ipv4a[5]; char *ipv6ptr = 0; char *ipv4ptr = 0; /* - */ ipv4res[0] = '\0'; ipv4a[0] = 0xc0; ipv4a[1] = 0xa8; ipv4a[2] = 0x64; ipv4a[3] = 0x01; ipv4a[4] = 0x01; /* - */ ipv4ptr = inet_ntop(AF_INET, ipv4a, ipv4res, sizeof(ipv4res)); if(!ipv4ptr) exit(1); /* fail */ if(ipv4ptr != ipv4res) exit(1); /* fail */ if(!ipv4ptr[0]) exit(1); /* fail */ if(memcmp(ipv4res, "192.168.100.1", 13) != 0) exit(1); /* fail */ /* - */ ipv6res[0] = '\0'; memset(ipv6a, 0, sizeof(ipv6a)); ipv6a[0] = 0xfe; ipv6a[1] = 0x80; ipv6a[8] = 0x02; ipv6a[9] = 0x14; ipv6a[10] = 0x4f; ipv6a[11] = 0xff; ipv6a[12] = 0xfe; ipv6a[13] = 0x0b; ipv6a[14] = 0x76; ipv6a[15] = 0xc8; ipv6a[25] = 0x01; /* - */ ipv6ptr = inet_ntop(AF_INET6, ipv6a, ipv6res, sizeof(ipv6res)); if(!ipv6ptr) exit(1); /* fail */ if(ipv6ptr != ipv6res) exit(1); /* fail */ if(!ipv6ptr[0]) exit(1); /* fail */ if(memcmp(ipv6res, "fe80::214:4fff:fe0b:76c8", 24) != 0) exit(1); /* fail */ /* - */ exit(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_works_inet_ntop="yes" ],[ AC_MSG_RESULT([no]) tst_works_inet_ntop="no" ]) fi # if test "$tst_compi_inet_ntop" = "yes" && test "$tst_works_inet_ntop" != "no"; then AC_MSG_CHECKING([if inet_ntop usage allowed]) if test "x$curl_disallow_inet_ntop" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_inet_ntop="yes" else AC_MSG_RESULT([no]) tst_allow_inet_ntop="no" fi fi # AC_MSG_CHECKING([if inet_ntop might be used]) if test "$tst_links_inet_ntop" = "yes" && test "$tst_proto_inet_ntop" = "yes" && test "$tst_compi_inet_ntop" = "yes" && test "$tst_allow_inet_ntop" = "yes" && test "$tst_works_inet_ntop" != "no"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_INET_NTOP, 1, [Define to 1 if you have a IPv6 capable working inet_ntop function.]) ac_cv_func_inet_ntop="yes" else AC_MSG_RESULT([no]) ac_cv_func_inet_ntop="no" fi ]) dnl CURL_CHECK_FUNC_INET_PTON dnl ------------------------------------------------- dnl Verify if inet_pton is available, prototyped, can dnl be compiled and seems to work. If all of these are dnl true, and usage has not been previously disallowed dnl with shell variable curl_disallow_inet_pton, then dnl HAVE_INET_PTON will be defined. AC_DEFUN([CURL_CHECK_FUNC_INET_PTON], [ AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl AC_REQUIRE([CURL_INCLUDES_STRING])dnl # tst_links_inet_pton="unknown" tst_proto_inet_pton="unknown" tst_compi_inet_pton="unknown" tst_works_inet_pton="unknown" tst_allow_inet_pton="unknown" # AC_MSG_CHECKING([if inet_pton can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([inet_pton]) ],[ AC_MSG_RESULT([yes]) tst_links_inet_pton="yes" ],[ AC_MSG_RESULT([no]) tst_links_inet_pton="no" ]) # if test "$tst_links_inet_pton" = "yes"; then AC_MSG_CHECKING([if inet_pton is prototyped]) AC_EGREP_CPP([inet_pton],[ $curl_includes_arpa_inet ],[ AC_MSG_RESULT([yes]) tst_proto_inet_pton="yes" ],[ AC_MSG_RESULT([no]) tst_proto_inet_pton="no" ]) fi # if test "$tst_proto_inet_pton" = "yes"; then AC_MSG_CHECKING([if inet_pton is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_arpa_inet ]],[[ if(0 != inet_pton(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_inet_pton="yes" ],[ AC_MSG_RESULT([no]) tst_compi_inet_pton="no" ]) fi # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tst_compi_inet_pton" = "yes"; then AC_MSG_CHECKING([if inet_pton seems to work]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stdlib $curl_includes_arpa_inet $curl_includes_string ]],[[ unsigned char ipv6a[16+1]; unsigned char ipv4a[4+1]; const char *ipv6src = "fe80::214:4fff:fe0b:76c8"; const char *ipv4src = "192.168.100.1"; /* - */ memset(ipv4a, 1, sizeof(ipv4a)); if(1 != inet_pton(AF_INET, ipv4src, ipv4a)) exit(1); /* fail */ /* - */ if( (ipv4a[0] != 0xc0) || (ipv4a[1] != 0xa8) || (ipv4a[2] != 0x64) || (ipv4a[3] != 0x01) || (ipv4a[4] != 0x01) ) exit(1); /* fail */ /* - */ memset(ipv6a, 1, sizeof(ipv6a)); if(1 != inet_pton(AF_INET6, ipv6src, ipv6a)) exit(1); /* fail */ /* - */ if( (ipv6a[0] != 0xfe) || (ipv6a[1] != 0x80) || (ipv6a[8] != 0x02) || (ipv6a[9] != 0x14) || (ipv6a[10] != 0x4f) || (ipv6a[11] != 0xff) || (ipv6a[12] != 0xfe) || (ipv6a[13] != 0x0b) || (ipv6a[14] != 0x76) || (ipv6a[15] != 0xc8) || (ipv6a[16] != 0x01) ) exit(1); /* fail */ /* - */ if( (ipv6a[2] != 0x0) || (ipv6a[3] != 0x0) || (ipv6a[4] != 0x0) || (ipv6a[5] != 0x0) || (ipv6a[6] != 0x0) || (ipv6a[7] != 0x0) ) exit(1); /* fail */ /* - */ exit(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_works_inet_pton="yes" ],[ AC_MSG_RESULT([no]) tst_works_inet_pton="no" ]) fi # if test "$tst_compi_inet_pton" = "yes" && test "$tst_works_inet_pton" != "no"; then AC_MSG_CHECKING([if inet_pton usage allowed]) if test "x$curl_disallow_inet_pton" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_inet_pton="yes" else AC_MSG_RESULT([no]) tst_allow_inet_pton="no" fi fi # AC_MSG_CHECKING([if inet_pton might be used]) if test "$tst_links_inet_pton" = "yes" && test "$tst_proto_inet_pton" = "yes" && test "$tst_compi_inet_pton" = "yes" && test "$tst_allow_inet_pton" = "yes" && test "$tst_works_inet_pton" != "no"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_INET_PTON, 1, [Define to 1 if you have a IPv6 capable working inet_pton function.]) ac_cv_func_inet_pton="yes" else AC_MSG_RESULT([no]) ac_cv_func_inet_pton="no" fi ]) dnl CURL_CHECK_FUNC_IOCTL dnl ------------------------------------------------- dnl Verify if ioctl is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_ioctl, then dnl HAVE_IOCTL will be defined. AC_DEFUN([CURL_CHECK_FUNC_IOCTL], [ AC_REQUIRE([CURL_INCLUDES_STROPTS])dnl # tst_links_ioctl="unknown" tst_proto_ioctl="unknown" tst_compi_ioctl="unknown" tst_allow_ioctl="unknown" # AC_MSG_CHECKING([if ioctl can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([ioctl]) ],[ AC_MSG_RESULT([yes]) tst_links_ioctl="yes" ],[ AC_MSG_RESULT([no]) tst_links_ioctl="no" ]) # if test "$tst_links_ioctl" = "yes"; then AC_MSG_CHECKING([if ioctl is prototyped]) AC_EGREP_CPP([ioctl],[ $curl_includes_stropts ],[ AC_MSG_RESULT([yes]) tst_proto_ioctl="yes" ],[ AC_MSG_RESULT([no]) tst_proto_ioctl="no" ]) fi # if test "$tst_proto_ioctl" = "yes"; then AC_MSG_CHECKING([if ioctl is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stropts ]],[[ if(0 != ioctl(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ioctl="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ioctl="no" ]) fi # if test "$tst_compi_ioctl" = "yes"; then AC_MSG_CHECKING([if ioctl usage allowed]) if test "x$curl_disallow_ioctl" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ioctl="yes" else AC_MSG_RESULT([no]) tst_allow_ioctl="no" fi fi # AC_MSG_CHECKING([if ioctl might be used]) if test "$tst_links_ioctl" = "yes" && test "$tst_proto_ioctl" = "yes" && test "$tst_compi_ioctl" = "yes" && test "$tst_allow_ioctl" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_IOCTL, 1, [Define to 1 if you have the ioctl function.]) ac_cv_func_ioctl="yes" CURL_CHECK_FUNC_IOCTL_FIONBIO CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR else AC_MSG_RESULT([no]) ac_cv_func_ioctl="no" fi ]) dnl CURL_CHECK_FUNC_IOCTL_FIONBIO dnl ------------------------------------------------- dnl Verify if ioctl with the FIONBIO command is dnl available, can be compiled, and seems to work. If dnl all of these are true, then HAVE_IOCTL_FIONBIO dnl will be defined. AC_DEFUN([CURL_CHECK_FUNC_IOCTL_FIONBIO], [ # tst_compi_ioctl_fionbio="unknown" tst_allow_ioctl_fionbio="unknown" # if test "$ac_cv_func_ioctl" = "yes"; then AC_MSG_CHECKING([if ioctl FIONBIO is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stropts ]],[[ int flags = 0; if(0 != ioctl(0, FIONBIO, &flags)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ioctl_fionbio="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ioctl_fionbio="no" ]) fi # if test "$tst_compi_ioctl_fionbio" = "yes"; then AC_MSG_CHECKING([if ioctl FIONBIO usage allowed]) if test "x$curl_disallow_ioctl_fionbio" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ioctl_fionbio="yes" else AC_MSG_RESULT([no]) tst_allow_ioctl_fionbio="no" fi fi # AC_MSG_CHECKING([if ioctl FIONBIO might be used]) if test "$tst_compi_ioctl_fionbio" = "yes" && test "$tst_allow_ioctl_fionbio" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_IOCTL_FIONBIO, 1, [Define to 1 if you have a working ioctl FIONBIO function.]) ac_cv_func_ioctl_fionbio="yes" else AC_MSG_RESULT([no]) ac_cv_func_ioctl_fionbio="no" fi ]) dnl CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR dnl ------------------------------------------------- dnl Verify if ioctl with the SIOCGIFADDR command is available, dnl struct ifreq is defined, they can be compiled, and seem to dnl work. If all of these are true, then HAVE_IOCTL_SIOCGIFADDR dnl will be defined. AC_DEFUN([CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR], [ # tst_compi_ioctl_siocgifaddr="unknown" tst_allow_ioctl_siocgifaddr="unknown" # if test "$ac_cv_func_ioctl" = "yes"; then AC_MSG_CHECKING([if ioctl SIOCGIFADDR is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stropts #include ]],[[ struct ifreq ifr; if(0 != ioctl(0, SIOCGIFADDR, &ifr)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ioctl_siocgifaddr="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ioctl_siocgifaddr="no" ]) fi # if test "$tst_compi_ioctl_siocgifaddr" = "yes"; then AC_MSG_CHECKING([if ioctl SIOCGIFADDR usage allowed]) if test "x$curl_disallow_ioctl_siocgifaddr" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ioctl_siocgifaddr="yes" else AC_MSG_RESULT([no]) tst_allow_ioctl_siocgifaddr="no" fi fi # AC_MSG_CHECKING([if ioctl SIOCGIFADDR might be used]) if test "$tst_compi_ioctl_siocgifaddr" = "yes" && test "$tst_allow_ioctl_siocgifaddr" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_IOCTL_SIOCGIFADDR, 1, [Define to 1 if you have a working ioctl SIOCGIFADDR function.]) ac_cv_func_ioctl_siocgifaddr="yes" else AC_MSG_RESULT([no]) ac_cv_func_ioctl_siocgifaddr="no" fi ]) dnl CURL_CHECK_FUNC_IOCTLSOCKET dnl ------------------------------------------------- dnl Verify if ioctlsocket is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_ioctlsocket, then dnl HAVE_IOCTLSOCKET will be defined. AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl # tst_links_ioctlsocket="unknown" tst_proto_ioctlsocket="unknown" tst_compi_ioctlsocket="unknown" tst_allow_ioctlsocket="unknown" # AC_MSG_CHECKING([if ioctlsocket can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 ]],[[ if(0 != ioctlsocket(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_ioctlsocket="yes" ],[ AC_MSG_RESULT([no]) tst_links_ioctlsocket="no" ]) # if test "$tst_links_ioctlsocket" = "yes"; then AC_MSG_CHECKING([if ioctlsocket is prototyped]) AC_EGREP_CPP([ioctlsocket],[ $curl_includes_winsock2 ],[ AC_MSG_RESULT([yes]) tst_proto_ioctlsocket="yes" ],[ AC_MSG_RESULT([no]) tst_proto_ioctlsocket="no" ]) fi # if test "$tst_proto_ioctlsocket" = "yes"; then AC_MSG_CHECKING([if ioctlsocket is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 ]],[[ if(0 != ioctlsocket(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ioctlsocket="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ioctlsocket="no" ]) fi # if test "$tst_compi_ioctlsocket" = "yes"; then AC_MSG_CHECKING([if ioctlsocket usage allowed]) if test "x$curl_disallow_ioctlsocket" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ioctlsocket="yes" else AC_MSG_RESULT([no]) tst_allow_ioctlsocket="no" fi fi # AC_MSG_CHECKING([if ioctlsocket might be used]) if test "$tst_links_ioctlsocket" = "yes" && test "$tst_proto_ioctlsocket" = "yes" && test "$tst_compi_ioctlsocket" = "yes" && test "$tst_allow_ioctlsocket" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET, 1, [Define to 1 if you have the ioctlsocket function.]) ac_cv_func_ioctlsocket="yes" CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO else AC_MSG_RESULT([no]) ac_cv_func_ioctlsocket="no" fi ]) dnl CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO dnl ------------------------------------------------- dnl Verify if ioctlsocket with the FIONBIO command is dnl available, can be compiled, and seems to work. If dnl all of these are true, then HAVE_IOCTLSOCKET_FIONBIO dnl will be defined. AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO], [ # tst_compi_ioctlsocket_fionbio="unknown" tst_allow_ioctlsocket_fionbio="unknown" # if test "$ac_cv_func_ioctlsocket" = "yes"; then AC_MSG_CHECKING([if ioctlsocket FIONBIO is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 ]],[[ int flags = 0; if(0 != ioctlsocket(0, FIONBIO, &flags)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ioctlsocket_fionbio="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ioctlsocket_fionbio="no" ]) fi # if test "$tst_compi_ioctlsocket_fionbio" = "yes"; then AC_MSG_CHECKING([if ioctlsocket FIONBIO usage allowed]) if test "x$curl_disallow_ioctlsocket_fionbio" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ioctlsocket_fionbio="yes" else AC_MSG_RESULT([no]) tst_allow_ioctlsocket_fionbio="no" fi fi # AC_MSG_CHECKING([if ioctlsocket FIONBIO might be used]) if test "$tst_compi_ioctlsocket_fionbio" = "yes" && test "$tst_allow_ioctlsocket_fionbio" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_FIONBIO, 1, [Define to 1 if you have a working ioctlsocket FIONBIO function.]) ac_cv_func_ioctlsocket_fionbio="yes" else AC_MSG_RESULT([no]) ac_cv_func_ioctlsocket_fionbio="no" fi ]) dnl CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL dnl ------------------------------------------------- dnl Verify if IoctlSocket is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_ioctlsocket_camel, dnl then HAVE_IOCTLSOCKET_CAMEL will be defined. AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL], [ AC_REQUIRE([CURL_INCLUDES_STROPTS])dnl # tst_links_ioctlsocket_camel="unknown" tst_proto_ioctlsocket_camel="unknown" tst_compi_ioctlsocket_camel="unknown" tst_allow_ioctlsocket_camel="unknown" # AC_MSG_CHECKING([if IoctlSocket can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([IoctlSocket]) ],[ AC_MSG_RESULT([yes]) tst_links_ioctlsocket_camel="yes" ],[ AC_MSG_RESULT([no]) tst_links_ioctlsocket_camel="no" ]) # if test "$tst_links_ioctlsocket_camel" = "yes"; then AC_MSG_CHECKING([if IoctlSocket is prototyped]) AC_EGREP_CPP([IoctlSocket],[ $curl_includes_stropts ],[ AC_MSG_RESULT([yes]) tst_proto_ioctlsocket_camel="yes" ],[ AC_MSG_RESULT([no]) tst_proto_ioctlsocket_camel="no" ]) fi # if test "$tst_proto_ioctlsocket_camel" = "yes"; then AC_MSG_CHECKING([if IoctlSocket is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stropts ]],[[ if(0 != IoctlSocket(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ioctlsocket_camel="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ioctlsocket_camel="no" ]) fi # if test "$tst_compi_ioctlsocket_camel" = "yes"; then AC_MSG_CHECKING([if IoctlSocket usage allowed]) if test "x$curl_disallow_ioctlsocket_camel" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ioctlsocket_camel="yes" else AC_MSG_RESULT([no]) tst_allow_ioctlsocket_camel="no" fi fi # AC_MSG_CHECKING([if IoctlSocket might be used]) if test "$tst_links_ioctlsocket_camel" = "yes" && test "$tst_proto_ioctlsocket_camel" = "yes" && test "$tst_compi_ioctlsocket_camel" = "yes" && test "$tst_allow_ioctlsocket_camel" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL, 1, [Define to 1 if you have the IoctlSocket camel case function.]) ac_cv_func_ioctlsocket_camel="yes" CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO else AC_MSG_RESULT([no]) ac_cv_func_ioctlsocket_camel="no" fi ]) dnl CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO dnl ------------------------------------------------- dnl Verify if IoctlSocket with FIONBIO command is available, dnl can be compiled, and seems to work. If all of these are dnl true, then HAVE_IOCTLSOCKET_CAMEL_FIONBIO will be defined. AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO], [ # tst_compi_ioctlsocket_camel_fionbio="unknown" tst_allow_ioctlsocket_camel_fionbio="unknown" # if test "$ac_cv_func_ioctlsocket_camel" = "yes"; then AC_MSG_CHECKING([if IoctlSocket FIONBIO is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stropts ]],[[ long flags = 0; if(0 != ioctlsocket(0, FIONBIO, &flags)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ioctlsocket_camel_fionbio="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ioctlsocket_camel_fionbio="no" ]) fi # if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes"; then AC_MSG_CHECKING([if IoctlSocket FIONBIO usage allowed]) if test "x$curl_disallow_ioctlsocket_camel_fionbio" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ioctlsocket_camel_fionbio="yes" else AC_MSG_RESULT([no]) tst_allow_ioctlsocket_camel_fionbio="no" fi fi # AC_MSG_CHECKING([if IoctlSocket FIONBIO might be used]) if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes" && test "$tst_allow_ioctlsocket_camel_fionbio" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL_FIONBIO, 1, [Define to 1 if you have a working IoctlSocket camel case FIONBIO function.]) ac_cv_func_ioctlsocket_camel_fionbio="yes" else AC_MSG_RESULT([no]) ac_cv_func_ioctlsocket_camel_fionbio="no" fi ]) dnl CURL_CHECK_FUNC_LISTXATTR dnl ------------------------------------------------- dnl Verify if listxattr is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_listxattr, then dnl HAVE_LISTXATTR will be defined. AC_DEFUN([CURL_CHECK_FUNC_LISTXATTR], [ AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl # tst_links_listxattr="unknown" tst_proto_listxattr="unknown" tst_compi_listxattr="unknown" tst_allow_listxattr="unknown" tst_nargs_listxattr="unknown" # AC_MSG_CHECKING([if listxattr can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([listxattr]) ],[ AC_MSG_RESULT([yes]) tst_links_listxattr="yes" ],[ AC_MSG_RESULT([no]) tst_links_listxattr="no" ]) # if test "$tst_links_listxattr" = "yes"; then AC_MSG_CHECKING([if listxattr is prototyped]) AC_EGREP_CPP([listxattr],[ $curl_includes_sys_xattr ],[ AC_MSG_RESULT([yes]) tst_proto_listxattr="yes" ],[ AC_MSG_RESULT([no]) tst_proto_listxattr="no" ]) fi # if test "$tst_proto_listxattr" = "yes"; then if test "$tst_nargs_listxattr" = "unknown"; then AC_MSG_CHECKING([if listxattr takes 3 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != listxattr(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_listxattr="yes" tst_nargs_listxattr="3" ],[ AC_MSG_RESULT([no]) tst_compi_listxattr="no" ]) fi if test "$tst_nargs_listxattr" = "unknown"; then AC_MSG_CHECKING([if listxattr takes 4 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != listxattr(0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_listxattr="yes" tst_nargs_listxattr="4" ],[ AC_MSG_RESULT([no]) tst_compi_listxattr="no" ]) fi AC_MSG_CHECKING([if listxattr is compilable]) if test "$tst_compi_listxattr" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # if test "$tst_compi_listxattr" = "yes"; then AC_MSG_CHECKING([if listxattr usage allowed]) if test "x$curl_disallow_listxattr" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_listxattr="yes" else AC_MSG_RESULT([no]) tst_allow_listxattr="no" fi fi # AC_MSG_CHECKING([if listxattr might be used]) if test "$tst_links_listxattr" = "yes" && test "$tst_proto_listxattr" = "yes" && test "$tst_compi_listxattr" = "yes" && test "$tst_allow_listxattr" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_LISTXATTR, 1, [Define to 1 if you have the listxattr function.]) dnl AC_DEFINE_UNQUOTED(LISTXATTR_ARGS, $tst_nargs_listxattr, dnl [Specifies the number of arguments to listxattr]) # if test "$tst_nargs_listxattr" -eq "3"; then AC_DEFINE(HAVE_LISTXATTR_3, 1, [listxattr() takes 3 args]) elif test "$tst_nargs_listxattr" -eq "4"; then AC_DEFINE(HAVE_LISTXATTR_4, 1, [listxattr() takes 4 args]) fi # ac_cv_func_listxattr="yes" else AC_MSG_RESULT([no]) ac_cv_func_listxattr="no" fi ]) dnl CURL_CHECK_FUNC_LOCALTIME_R dnl ------------------------------------------------- dnl Verify if localtime_r is available, prototyped, can dnl be compiled and seems to work. If all of these are dnl true, and usage has not been previously disallowed dnl with shell variable curl_disallow_localtime_r, then dnl HAVE_LOCALTIME_R will be defined. AC_DEFUN([CURL_CHECK_FUNC_LOCALTIME_R], [ AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl AC_REQUIRE([CURL_INCLUDES_TIME])dnl # tst_links_localtime_r="unknown" tst_proto_localtime_r="unknown" tst_compi_localtime_r="unknown" tst_works_localtime_r="unknown" tst_allow_localtime_r="unknown" # AC_MSG_CHECKING([if localtime_r can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([localtime_r]) ],[ AC_MSG_RESULT([yes]) tst_links_localtime_r="yes" ],[ AC_MSG_RESULT([no]) tst_links_localtime_r="no" ]) # if test "$tst_links_localtime_r" = "yes"; then AC_MSG_CHECKING([if localtime_r is prototyped]) AC_EGREP_CPP([localtime_r],[ $curl_includes_time ],[ AC_MSG_RESULT([yes]) tst_proto_localtime_r="yes" ],[ AC_MSG_RESULT([no]) tst_proto_localtime_r="no" ]) fi # if test "$tst_proto_localtime_r" = "yes"; then AC_MSG_CHECKING([if localtime_r is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_time ]],[[ if(0 != localtime_r(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_localtime_r="yes" ],[ AC_MSG_RESULT([no]) tst_compi_localtime_r="no" ]) fi # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tst_compi_localtime_r" = "yes"; then AC_MSG_CHECKING([if localtime_r seems to work]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stdlib $curl_includes_time ]],[[ time_t clock = 1170352587; struct tm *tmp = 0; struct tm result; tmp = localtime_r(&clock, &result); if(tmp) exit(0); else exit(1); ]]) ],[ AC_MSG_RESULT([yes]) tst_works_localtime_r="yes" ],[ AC_MSG_RESULT([no]) tst_works_localtime_r="no" ]) fi # if test "$tst_compi_localtime_r" = "yes" && test "$tst_works_localtime_r" != "no"; then AC_MSG_CHECKING([if localtime_r usage allowed]) if test "x$curl_disallow_localtime_r" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_localtime_r="yes" else AC_MSG_RESULT([no]) tst_allow_localtime_r="no" fi fi # AC_MSG_CHECKING([if localtime_r might be used]) if test "$tst_links_localtime_r" = "yes" && test "$tst_proto_localtime_r" = "yes" && test "$tst_compi_localtime_r" = "yes" && test "$tst_allow_localtime_r" = "yes" && test "$tst_works_localtime_r" != "no"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_LOCALTIME_R, 1, [Define to 1 if you have a working localtime_r function.]) ac_cv_func_localtime_r="yes" else AC_MSG_RESULT([no]) ac_cv_func_localtime_r="no" fi ]) dnl CURL_CHECK_FUNC_MEMRCHR dnl ------------------------------------------------- dnl Verify if memrchr is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_memrchr, then dnl HAVE_MEMRCHR will be defined. AC_DEFUN([CURL_CHECK_FUNC_MEMRCHR], [ AC_REQUIRE([CURL_INCLUDES_STRING])dnl # tst_links_memrchr="unknown" tst_macro_memrchr="unknown" tst_proto_memrchr="unknown" tst_compi_memrchr="unknown" tst_allow_memrchr="unknown" # AC_MSG_CHECKING([if memrchr can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([memrchr]) ],[ AC_MSG_RESULT([yes]) tst_links_memrchr="yes" ],[ AC_MSG_RESULT([no]) tst_links_memrchr="no" ]) # if test "$tst_links_memrchr" = "no"; then AC_MSG_CHECKING([if memrchr seems a macro]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ if(0 != memrchr(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_macro_memrchr="yes" ],[ AC_MSG_RESULT([no]) tst_macro_memrchr="no" ]) fi # if test "$tst_links_memrchr" = "yes"; then AC_MSG_CHECKING([if memrchr is prototyped]) AC_EGREP_CPP([memrchr],[ $curl_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_memrchr="yes" ],[ AC_MSG_RESULT([no]) tst_proto_memrchr="no" ]) fi # if test "$tst_proto_memrchr" = "yes" || test "$tst_macro_memrchr" = "yes"; then AC_MSG_CHECKING([if memrchr is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ if(0 != memrchr(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_memrchr="yes" ],[ AC_MSG_RESULT([no]) tst_compi_memrchr="no" ]) fi # if test "$tst_compi_memrchr" = "yes"; then AC_MSG_CHECKING([if memrchr usage allowed]) if test "x$curl_disallow_memrchr" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_memrchr="yes" else AC_MSG_RESULT([no]) tst_allow_memrchr="no" fi fi # AC_MSG_CHECKING([if memrchr might be used]) if (test "$tst_proto_memrchr" = "yes" || test "$tst_macro_memrchr" = "yes") && test "$tst_compi_memrchr" = "yes" && test "$tst_allow_memrchr" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_MEMRCHR, 1, [Define to 1 if you have the memrchr function or macro.]) ac_cv_func_memrchr="yes" else AC_MSG_RESULT([no]) ac_cv_func_memrchr="no" fi ]) dnl CURL_CHECK_FUNC_POLL dnl ------------------------------------------------- dnl Verify if poll is available, prototyped, can dnl be compiled and seems to work. If all of these are dnl true, and usage has not been previously disallowed dnl with shell variable curl_disallow_poll, then dnl HAVE_POLL will be defined. AC_DEFUN([CURL_CHECK_FUNC_POLL], [ AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl AC_REQUIRE([CURL_INCLUDES_POLL])dnl # tst_links_poll="unknown" tst_proto_poll="unknown" tst_compi_poll="unknown" tst_works_poll="unknown" tst_allow_poll="unknown" # case $host_os in darwin*|interix*) dnl poll() does not work on these platforms dnl Interix: "does provide poll(), but the implementing developer must dnl have been in a bad mood, because poll() only works on the /proc dnl filesystem here" curl_disallow_poll="yes" ;; esac # AC_MSG_CHECKING([if poll can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_poll ]],[[ if(0 != poll(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_poll="yes" ],[ AC_MSG_RESULT([no]) tst_links_poll="no" ]) # if test "$tst_links_poll" = "yes"; then AC_MSG_CHECKING([if poll is prototyped]) AC_EGREP_CPP([poll],[ $curl_includes_poll ],[ AC_MSG_RESULT([yes]) tst_proto_poll="yes" ],[ AC_MSG_RESULT([no]) tst_proto_poll="no" ]) fi # if test "$tst_proto_poll" = "yes"; then AC_MSG_CHECKING([if poll is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_poll ]],[[ if(0 != poll(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_poll="yes" ],[ AC_MSG_RESULT([no]) tst_compi_poll="no" ]) fi # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tst_compi_poll" = "yes"; then AC_MSG_CHECKING([if poll seems to work]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stdlib $curl_includes_poll ]],[[ if(0 != poll(0, 0, 10)) exit(1); /* fail */ else exit(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_works_poll="yes" ],[ AC_MSG_RESULT([no]) tst_works_poll="no" ]) fi # if test "$tst_compi_poll" = "yes" && test "$tst_works_poll" != "no"; then AC_MSG_CHECKING([if poll usage allowed]) if test "x$curl_disallow_poll" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_poll="yes" else AC_MSG_RESULT([no]) tst_allow_poll="no" fi fi # AC_MSG_CHECKING([if poll might be used]) if test "$tst_links_poll" = "yes" && test "$tst_proto_poll" = "yes" && test "$tst_compi_poll" = "yes" && test "$tst_allow_poll" = "yes" && test "$tst_works_poll" != "no"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_POLL, 1, [Define to 1 if you have a working poll function.]) AC_DEFINE_UNQUOTED(HAVE_POLL_FINE, 1, [If you have a fine poll]) ac_cv_func_poll="yes" else AC_MSG_RESULT([no]) ac_cv_func_poll="no" fi ]) dnl CURL_CHECK_FUNC_REMOVEXATTR dnl ------------------------------------------------- dnl Verify if removexattr is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_removexattr, then dnl HAVE_REMOVEXATTR will be defined. AC_DEFUN([CURL_CHECK_FUNC_REMOVEXATTR], [ AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl # tst_links_removexattr="unknown" tst_proto_removexattr="unknown" tst_compi_removexattr="unknown" tst_allow_removexattr="unknown" tst_nargs_removexattr="unknown" # AC_MSG_CHECKING([if removexattr can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([removexattr]) ],[ AC_MSG_RESULT([yes]) tst_links_removexattr="yes" ],[ AC_MSG_RESULT([no]) tst_links_removexattr="no" ]) # if test "$tst_links_removexattr" = "yes"; then AC_MSG_CHECKING([if removexattr is prototyped]) AC_EGREP_CPP([removexattr],[ $curl_includes_sys_xattr ],[ AC_MSG_RESULT([yes]) tst_proto_removexattr="yes" ],[ AC_MSG_RESULT([no]) tst_proto_removexattr="no" ]) fi # if test "$tst_proto_removexattr" = "yes"; then if test "$tst_nargs_removexattr" = "unknown"; then AC_MSG_CHECKING([if removexattr takes 2 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != removexattr(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_removexattr="yes" tst_nargs_removexattr="2" ],[ AC_MSG_RESULT([no]) tst_compi_removexattr="no" ]) fi if test "$tst_nargs_removexattr" = "unknown"; then AC_MSG_CHECKING([if removexattr takes 3 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != removexattr(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_removexattr="yes" tst_nargs_removexattr="3" ],[ AC_MSG_RESULT([no]) tst_compi_removexattr="no" ]) fi AC_MSG_CHECKING([if removexattr is compilable]) if test "$tst_compi_removexattr" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # if test "$tst_compi_removexattr" = "yes"; then AC_MSG_CHECKING([if removexattr usage allowed]) if test "x$curl_disallow_removexattr" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_removexattr="yes" else AC_MSG_RESULT([no]) tst_allow_removexattr="no" fi fi # AC_MSG_CHECKING([if removexattr might be used]) if test "$tst_links_removexattr" = "yes" && test "$tst_proto_removexattr" = "yes" && test "$tst_compi_removexattr" = "yes" && test "$tst_allow_removexattr" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_REMOVEXATTR, 1, [Define to 1 if you have the removexattr function.]) dnl AC_DEFINE_UNQUOTED(REMOVEXATTR_ARGS, $tst_nargs_removexattr, dnl [Specifies the number of arguments to removexattr]) # if test "$tst_nargs_removexattr" -eq "2"; then AC_DEFINE(HAVE_REMOVEXATTR_2, 1, [removexattr() takes 2 args]) elif test "$tst_nargs_removexattr" -eq "3"; then AC_DEFINE(HAVE_REMOVEXATTR_3, 1, [removexattr() takes 3 args]) fi # ac_cv_func_removexattr="yes" else AC_MSG_RESULT([no]) ac_cv_func_removexattr="no" fi ]) dnl CURL_CHECK_FUNC_SETSOCKOPT dnl ------------------------------------------------- dnl Verify if setsockopt is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_setsockopt, then dnl HAVE_SETSOCKOPT will be defined. AC_DEFUN([CURL_CHECK_FUNC_SETSOCKOPT], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl # tst_links_setsockopt="unknown" tst_proto_setsockopt="unknown" tst_compi_setsockopt="unknown" tst_allow_setsockopt="unknown" # AC_MSG_CHECKING([if setsockopt can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_sys_socket ]],[[ if(0 != setsockopt(0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_setsockopt="yes" ],[ AC_MSG_RESULT([no]) tst_links_setsockopt="no" ]) # if test "$tst_links_setsockopt" = "yes"; then AC_MSG_CHECKING([if setsockopt is prototyped]) AC_EGREP_CPP([setsockopt],[ $curl_includes_winsock2 $curl_includes_sys_socket ],[ AC_MSG_RESULT([yes]) tst_proto_setsockopt="yes" ],[ AC_MSG_RESULT([no]) tst_proto_setsockopt="no" ]) fi # if test "$tst_proto_setsockopt" = "yes"; then AC_MSG_CHECKING([if setsockopt is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_sys_socket ]],[[ if(0 != setsockopt(0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_setsockopt="yes" ],[ AC_MSG_RESULT([no]) tst_compi_setsockopt="no" ]) fi # if test "$tst_compi_setsockopt" = "yes"; then AC_MSG_CHECKING([if setsockopt usage allowed]) if test "x$curl_disallow_setsockopt" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_setsockopt="yes" else AC_MSG_RESULT([no]) tst_allow_setsockopt="no" fi fi # AC_MSG_CHECKING([if setsockopt might be used]) if test "$tst_links_setsockopt" = "yes" && test "$tst_proto_setsockopt" = "yes" && test "$tst_compi_setsockopt" = "yes" && test "$tst_allow_setsockopt" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT, 1, [Define to 1 if you have the setsockopt function.]) ac_cv_func_setsockopt="yes" CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK else AC_MSG_RESULT([no]) ac_cv_func_setsockopt="no" fi ]) dnl CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK dnl ------------------------------------------------- dnl Verify if setsockopt with the SO_NONBLOCK command is dnl available, can be compiled, and seems to work. If dnl all of these are true, then HAVE_SETSOCKOPT_SO_NONBLOCK dnl will be defined. AC_DEFUN([CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK], [ # tst_compi_setsockopt_so_nonblock="unknown" tst_allow_setsockopt_so_nonblock="unknown" # if test "$ac_cv_func_setsockopt" = "yes"; then AC_MSG_CHECKING([if setsockopt SO_NONBLOCK is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_sys_socket ]],[[ if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_setsockopt_so_nonblock="yes" ],[ AC_MSG_RESULT([no]) tst_compi_setsockopt_so_nonblock="no" ]) fi # if test "$tst_compi_setsockopt_so_nonblock" = "yes"; then AC_MSG_CHECKING([if setsockopt SO_NONBLOCK usage allowed]) if test "x$curl_disallow_setsockopt_so_nonblock" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_setsockopt_so_nonblock="yes" else AC_MSG_RESULT([no]) tst_allow_setsockopt_so_nonblock="no" fi fi # AC_MSG_CHECKING([if setsockopt SO_NONBLOCK might be used]) if test "$tst_compi_setsockopt_so_nonblock" = "yes" && test "$tst_allow_setsockopt_so_nonblock" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT_SO_NONBLOCK, 1, [Define to 1 if you have a working setsockopt SO_NONBLOCK function.]) ac_cv_func_setsockopt_so_nonblock="yes" else AC_MSG_RESULT([no]) ac_cv_func_setsockopt_so_nonblock="no" fi ]) dnl CURL_CHECK_FUNC_SETXATTR dnl ------------------------------------------------- dnl Verify if setxattr is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_setxattr, then dnl HAVE_SETXATTR will be defined. AC_DEFUN([CURL_CHECK_FUNC_SETXATTR], [ AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl # tst_links_setxattr="unknown" tst_proto_setxattr="unknown" tst_compi_setxattr="unknown" tst_allow_setxattr="unknown" tst_nargs_setxattr="unknown" # AC_MSG_CHECKING([if setxattr can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([setxattr]) ],[ AC_MSG_RESULT([yes]) tst_links_setxattr="yes" ],[ AC_MSG_RESULT([no]) tst_links_setxattr="no" ]) # if test "$tst_links_setxattr" = "yes"; then AC_MSG_CHECKING([if setxattr is prototyped]) AC_EGREP_CPP([setxattr],[ $curl_includes_sys_xattr ],[ AC_MSG_RESULT([yes]) tst_proto_setxattr="yes" ],[ AC_MSG_RESULT([no]) tst_proto_setxattr="no" ]) fi # if test "$tst_proto_setxattr" = "yes"; then if test "$tst_nargs_setxattr" = "unknown"; then AC_MSG_CHECKING([if setxattr takes 5 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != setxattr(0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_setxattr="yes" tst_nargs_setxattr="5" ],[ AC_MSG_RESULT([no]) tst_compi_setxattr="no" ]) fi if test "$tst_nargs_setxattr" = "unknown"; then AC_MSG_CHECKING([if setxattr takes 6 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_xattr ]],[[ if(0 != setxattr(0, 0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_setxattr="yes" tst_nargs_setxattr="6" ],[ AC_MSG_RESULT([no]) tst_compi_setxattr="no" ]) fi AC_MSG_CHECKING([if setxattr is compilable]) if test "$tst_compi_setxattr" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # if test "$tst_compi_setxattr" = "yes"; then AC_MSG_CHECKING([if setxattr usage allowed]) if test "x$curl_disallow_setxattr" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_setxattr="yes" else AC_MSG_RESULT([no]) tst_allow_setxattr="no" fi fi # AC_MSG_CHECKING([if setxattr might be used]) if test "$tst_links_setxattr" = "yes" && test "$tst_proto_setxattr" = "yes" && test "$tst_compi_setxattr" = "yes" && test "$tst_allow_setxattr" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_SETXATTR, 1, [Define to 1 if you have the setxattr function.]) dnl AC_DEFINE_UNQUOTED(SETXATTR_ARGS, $tst_nargs_setxattr, dnl [Specifies the number of arguments to setxattr]) # if test "$tst_nargs_setxattr" -eq "5"; then AC_DEFINE(HAVE_SETXATTR_5, 1, [setxattr() takes 5 args]) elif test "$tst_nargs_setxattr" -eq "6"; then AC_DEFINE(HAVE_SETXATTR_6, 1, [setxattr() takes 6 args]) fi # ac_cv_func_setxattr="yes" else AC_MSG_RESULT([no]) ac_cv_func_setxattr="no" fi ]) dnl CURL_CHECK_FUNC_SIGACTION dnl ------------------------------------------------- dnl Verify if sigaction is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_sigaction, then dnl HAVE_SIGACTION will be defined. AC_DEFUN([CURL_CHECK_FUNC_SIGACTION], [ AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl # tst_links_sigaction="unknown" tst_proto_sigaction="unknown" tst_compi_sigaction="unknown" tst_allow_sigaction="unknown" # AC_MSG_CHECKING([if sigaction can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([sigaction]) ],[ AC_MSG_RESULT([yes]) tst_links_sigaction="yes" ],[ AC_MSG_RESULT([no]) tst_links_sigaction="no" ]) # if test "$tst_links_sigaction" = "yes"; then AC_MSG_CHECKING([if sigaction is prototyped]) AC_EGREP_CPP([sigaction],[ $curl_includes_signal ],[ AC_MSG_RESULT([yes]) tst_proto_sigaction="yes" ],[ AC_MSG_RESULT([no]) tst_proto_sigaction="no" ]) fi # if test "$tst_proto_sigaction" = "yes"; then AC_MSG_CHECKING([if sigaction is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_signal ]],[[ if(0 != sigaction(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_sigaction="yes" ],[ AC_MSG_RESULT([no]) tst_compi_sigaction="no" ]) fi # if test "$tst_compi_sigaction" = "yes"; then AC_MSG_CHECKING([if sigaction usage allowed]) if test "x$curl_disallow_sigaction" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_sigaction="yes" else AC_MSG_RESULT([no]) tst_allow_sigaction="no" fi fi # AC_MSG_CHECKING([if sigaction might be used]) if test "$tst_links_sigaction" = "yes" && test "$tst_proto_sigaction" = "yes" && test "$tst_compi_sigaction" = "yes" && test "$tst_allow_sigaction" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_SIGACTION, 1, [Define to 1 if you have the sigaction function.]) ac_cv_func_sigaction="yes" else AC_MSG_RESULT([no]) ac_cv_func_sigaction="no" fi ]) dnl CURL_CHECK_FUNC_SIGINTERRUPT dnl ------------------------------------------------- dnl Verify if siginterrupt is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_siginterrupt, then dnl HAVE_SIGINTERRUPT will be defined. AC_DEFUN([CURL_CHECK_FUNC_SIGINTERRUPT], [ AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl # tst_links_siginterrupt="unknown" tst_proto_siginterrupt="unknown" tst_compi_siginterrupt="unknown" tst_allow_siginterrupt="unknown" # AC_MSG_CHECKING([if siginterrupt can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([siginterrupt]) ],[ AC_MSG_RESULT([yes]) tst_links_siginterrupt="yes" ],[ AC_MSG_RESULT([no]) tst_links_siginterrupt="no" ]) # if test "$tst_links_siginterrupt" = "yes"; then AC_MSG_CHECKING([if siginterrupt is prototyped]) AC_EGREP_CPP([siginterrupt],[ $curl_includes_signal ],[ AC_MSG_RESULT([yes]) tst_proto_siginterrupt="yes" ],[ AC_MSG_RESULT([no]) tst_proto_siginterrupt="no" ]) fi # if test "$tst_proto_siginterrupt" = "yes"; then AC_MSG_CHECKING([if siginterrupt is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_signal ]],[[ if(0 != siginterrupt(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_siginterrupt="yes" ],[ AC_MSG_RESULT([no]) tst_compi_siginterrupt="no" ]) fi # if test "$tst_compi_siginterrupt" = "yes"; then AC_MSG_CHECKING([if siginterrupt usage allowed]) if test "x$curl_disallow_siginterrupt" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_siginterrupt="yes" else AC_MSG_RESULT([no]) tst_allow_siginterrupt="no" fi fi # AC_MSG_CHECKING([if siginterrupt might be used]) if test "$tst_links_siginterrupt" = "yes" && test "$tst_proto_siginterrupt" = "yes" && test "$tst_compi_siginterrupt" = "yes" && test "$tst_allow_siginterrupt" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_SIGINTERRUPT, 1, [Define to 1 if you have the siginterrupt function.]) ac_cv_func_siginterrupt="yes" else AC_MSG_RESULT([no]) ac_cv_func_siginterrupt="no" fi ]) dnl CURL_CHECK_FUNC_SIGNAL dnl ------------------------------------------------- dnl Verify if signal is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_signal, then dnl HAVE_SIGNAL will be defined. AC_DEFUN([CURL_CHECK_FUNC_SIGNAL], [ AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl # tst_links_signal="unknown" tst_proto_signal="unknown" tst_compi_signal="unknown" tst_allow_signal="unknown" # AC_MSG_CHECKING([if signal can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([signal]) ],[ AC_MSG_RESULT([yes]) tst_links_signal="yes" ],[ AC_MSG_RESULT([no]) tst_links_signal="no" ]) # if test "$tst_links_signal" = "yes"; then AC_MSG_CHECKING([if signal is prototyped]) AC_EGREP_CPP([signal],[ $curl_includes_signal ],[ AC_MSG_RESULT([yes]) tst_proto_signal="yes" ],[ AC_MSG_RESULT([no]) tst_proto_signal="no" ]) fi # if test "$tst_proto_signal" = "yes"; then AC_MSG_CHECKING([if signal is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_signal ]],[[ if(0 != signal(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_signal="yes" ],[ AC_MSG_RESULT([no]) tst_compi_signal="no" ]) fi # if test "$tst_compi_signal" = "yes"; then AC_MSG_CHECKING([if signal usage allowed]) if test "x$curl_disallow_signal" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_signal="yes" else AC_MSG_RESULT([no]) tst_allow_signal="no" fi fi # AC_MSG_CHECKING([if signal might be used]) if test "$tst_links_signal" = "yes" && test "$tst_proto_signal" = "yes" && test "$tst_compi_signal" = "yes" && test "$tst_allow_signal" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_SIGNAL, 1, [Define to 1 if you have the signal function.]) ac_cv_func_signal="yes" else AC_MSG_RESULT([no]) ac_cv_func_signal="no" fi ]) dnl CURL_CHECK_FUNC_SIGSETJMP dnl ------------------------------------------------- dnl Verify if sigsetjmp is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_sigsetjmp, then dnl HAVE_SIGSETJMP will be defined. AC_DEFUN([CURL_CHECK_FUNC_SIGSETJMP], [ AC_REQUIRE([CURL_INCLUDES_SETJMP])dnl # tst_links_sigsetjmp="unknown" tst_macro_sigsetjmp="unknown" tst_proto_sigsetjmp="unknown" tst_compi_sigsetjmp="unknown" tst_allow_sigsetjmp="unknown" # AC_MSG_CHECKING([if sigsetjmp can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([sigsetjmp]) ],[ AC_MSG_RESULT([yes]) tst_links_sigsetjmp="yes" ],[ AC_MSG_RESULT([no]) tst_links_sigsetjmp="no" ]) # if test "$tst_links_sigsetjmp" = "no"; then AC_MSG_CHECKING([if sigsetjmp seems a macro]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_setjmp ]],[[ sigjmp_buf env; if(0 != sigsetjmp(env, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_macro_sigsetjmp="yes" ],[ AC_MSG_RESULT([no]) tst_macro_sigsetjmp="no" ]) fi # if test "$tst_links_sigsetjmp" = "yes"; then AC_MSG_CHECKING([if sigsetjmp is prototyped]) AC_EGREP_CPP([sigsetjmp],[ $curl_includes_setjmp ],[ AC_MSG_RESULT([yes]) tst_proto_sigsetjmp="yes" ],[ AC_MSG_RESULT([no]) tst_proto_sigsetjmp="no" ]) fi # if test "$tst_proto_sigsetjmp" = "yes" || test "$tst_macro_sigsetjmp" = "yes"; then AC_MSG_CHECKING([if sigsetjmp is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_setjmp ]],[[ sigjmp_buf env; if(0 != sigsetjmp(env, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_sigsetjmp="yes" ],[ AC_MSG_RESULT([no]) tst_compi_sigsetjmp="no" ]) fi # if test "$tst_compi_sigsetjmp" = "yes"; then AC_MSG_CHECKING([if sigsetjmp usage allowed]) if test "x$curl_disallow_sigsetjmp" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_sigsetjmp="yes" else AC_MSG_RESULT([no]) tst_allow_sigsetjmp="no" fi fi # AC_MSG_CHECKING([if sigsetjmp might be used]) if (test "$tst_proto_sigsetjmp" = "yes" || test "$tst_macro_sigsetjmp" = "yes") && test "$tst_compi_sigsetjmp" = "yes" && test "$tst_allow_sigsetjmp" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_SIGSETJMP, 1, [Define to 1 if you have the sigsetjmp function or macro.]) ac_cv_func_sigsetjmp="yes" else AC_MSG_RESULT([no]) ac_cv_func_sigsetjmp="no" fi ]) dnl CURL_CHECK_FUNC_SOCKET dnl ------------------------------------------------- dnl Verify if socket is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_socket, then dnl HAVE_SOCKET will be defined. AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl # tst_links_socket="unknown" tst_proto_socket="unknown" tst_compi_socket="unknown" tst_allow_socket="unknown" # AC_MSG_CHECKING([if socket can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_sys_socket $curl_includes_socket ]],[[ if(0 != socket(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_socket="yes" ],[ AC_MSG_RESULT([no]) tst_links_socket="no" ]) # if test "$tst_links_socket" = "yes"; then AC_MSG_CHECKING([if socket is prototyped]) AC_EGREP_CPP([socket],[ $curl_includes_winsock2 $curl_includes_sys_socket $curl_includes_socket ],[ AC_MSG_RESULT([yes]) tst_proto_socket="yes" ],[ AC_MSG_RESULT([no]) tst_proto_socket="no" ]) fi # if test "$tst_proto_socket" = "yes"; then AC_MSG_CHECKING([if socket is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_sys_socket $curl_includes_socket ]],[[ if(0 != socket(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_socket="yes" ],[ AC_MSG_RESULT([no]) tst_compi_socket="no" ]) fi # if test "$tst_compi_socket" = "yes"; then AC_MSG_CHECKING([if socket usage allowed]) if test "x$curl_disallow_socket" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_socket="yes" else AC_MSG_RESULT([no]) tst_allow_socket="no" fi fi # AC_MSG_CHECKING([if socket might be used]) if test "$tst_links_socket" = "yes" && test "$tst_proto_socket" = "yes" && test "$tst_compi_socket" = "yes" && test "$tst_allow_socket" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_SOCKET, 1, [Define to 1 if you have the socket function.]) ac_cv_func_socket="yes" else AC_MSG_RESULT([no]) ac_cv_func_socket="no" fi ]) dnl CURL_CHECK_FUNC_SOCKETPAIR dnl ------------------------------------------------- dnl Verify if socketpair is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_socketpair, then dnl HAVE_SOCKETPAIR will be defined. AC_DEFUN([CURL_CHECK_FUNC_SOCKETPAIR], [ AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl # tst_links_socketpair="unknown" tst_proto_socketpair="unknown" tst_compi_socketpair="unknown" tst_allow_socketpair="unknown" # AC_MSG_CHECKING([if socketpair can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([socketpair]) ],[ AC_MSG_RESULT([yes]) tst_links_socketpair="yes" ],[ AC_MSG_RESULT([no]) tst_links_socketpair="no" ]) # if test "$tst_links_socketpair" = "yes"; then AC_MSG_CHECKING([if socketpair is prototyped]) AC_EGREP_CPP([socketpair],[ $curl_includes_sys_socket $curl_includes_socket ],[ AC_MSG_RESULT([yes]) tst_proto_socketpair="yes" ],[ AC_MSG_RESULT([no]) tst_proto_socketpair="no" ]) fi # if test "$tst_proto_socketpair" = "yes"; then AC_MSG_CHECKING([if socketpair is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_socket $curl_includes_socket ]],[[ int sv[2]; if(0 != socketpair(0, 0, 0, sv)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_socketpair="yes" ],[ AC_MSG_RESULT([no]) tst_compi_socketpair="no" ]) fi # if test "$tst_compi_socketpair" = "yes"; then AC_MSG_CHECKING([if socketpair usage allowed]) if test "x$curl_disallow_socketpair" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_socketpair="yes" else AC_MSG_RESULT([no]) tst_allow_socketpair="no" fi fi # AC_MSG_CHECKING([if socketpair might be used]) if test "$tst_links_socketpair" = "yes" && test "$tst_proto_socketpair" = "yes" && test "$tst_compi_socketpair" = "yes" && test "$tst_allow_socketpair" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_SOCKETPAIR, 1, [Define to 1 if you have the socketpair function.]) ac_cv_func_socketpair="yes" else AC_MSG_RESULT([no]) ac_cv_func_socketpair="no" fi ]) dnl CURL_CHECK_FUNC_STRCASECMP dnl ------------------------------------------------- dnl Verify if strcasecmp is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_strcasecmp, then dnl HAVE_STRCASECMP will be defined. AC_DEFUN([CURL_CHECK_FUNC_STRCASECMP], [ AC_REQUIRE([CURL_INCLUDES_STRING])dnl # tst_links_strcasecmp="unknown" tst_proto_strcasecmp="unknown" tst_compi_strcasecmp="unknown" tst_allow_strcasecmp="unknown" # AC_MSG_CHECKING([if strcasecmp can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strcasecmp]) ],[ AC_MSG_RESULT([yes]) tst_links_strcasecmp="yes" ],[ AC_MSG_RESULT([no]) tst_links_strcasecmp="no" ]) # if test "$tst_links_strcasecmp" = "yes"; then AC_MSG_CHECKING([if strcasecmp is prototyped]) AC_EGREP_CPP([strcasecmp],[ $curl_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strcasecmp="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strcasecmp="no" ]) fi # if test "$tst_proto_strcasecmp" = "yes"; then AC_MSG_CHECKING([if strcasecmp is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ if(0 != strcasecmp(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strcasecmp="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strcasecmp="no" ]) fi # if test "$tst_compi_strcasecmp" = "yes"; then AC_MSG_CHECKING([if strcasecmp usage allowed]) if test "x$curl_disallow_strcasecmp" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strcasecmp="yes" else AC_MSG_RESULT([no]) tst_allow_strcasecmp="no" fi fi # AC_MSG_CHECKING([if strcasecmp might be used]) if test "$tst_links_strcasecmp" = "yes" && test "$tst_proto_strcasecmp" = "yes" && test "$tst_compi_strcasecmp" = "yes" && test "$tst_allow_strcasecmp" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRCASECMP, 1, [Define to 1 if you have the strcasecmp function.]) ac_cv_func_strcasecmp="yes" else AC_MSG_RESULT([no]) ac_cv_func_strcasecmp="no" fi ]) dnl CURL_CHECK_FUNC_STRCMPI dnl ------------------------------------------------- dnl Verify if strcmpi is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_strcmpi, then dnl HAVE_STRCMPI will be defined. AC_DEFUN([CURL_CHECK_FUNC_STRCMPI], [ AC_REQUIRE([CURL_INCLUDES_STRING])dnl # tst_links_strcmpi="unknown" tst_proto_strcmpi="unknown" tst_compi_strcmpi="unknown" tst_allow_strcmpi="unknown" # AC_MSG_CHECKING([if strcmpi can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strcmpi]) ],[ AC_MSG_RESULT([yes]) tst_links_strcmpi="yes" ],[ AC_MSG_RESULT([no]) tst_links_strcmpi="no" ]) # if test "$tst_links_strcmpi" = "yes"; then AC_MSG_CHECKING([if strcmpi is prototyped]) AC_EGREP_CPP([strcmpi],[ $curl_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strcmpi="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strcmpi="no" ]) fi # if test "$tst_proto_strcmpi" = "yes"; then AC_MSG_CHECKING([if strcmpi is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ if(0 != strcmpi(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strcmpi="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strcmpi="no" ]) fi # if test "$tst_compi_strcmpi" = "yes"; then AC_MSG_CHECKING([if strcmpi usage allowed]) if test "x$curl_disallow_strcmpi" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strcmpi="yes" else AC_MSG_RESULT([no]) tst_allow_strcmpi="no" fi fi # AC_MSG_CHECKING([if strcmpi might be used]) if test "$tst_links_strcmpi" = "yes" && test "$tst_proto_strcmpi" = "yes" && test "$tst_compi_strcmpi" = "yes" && test "$tst_allow_strcmpi" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRCMPI, 1, [Define to 1 if you have the strcmpi function.]) ac_cv_func_strcmpi="yes" else AC_MSG_RESULT([no]) ac_cv_func_strcmpi="no" fi ]) dnl CURL_CHECK_FUNC_STRDUP dnl ------------------------------------------------- dnl Verify if strdup is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_strdup, then dnl HAVE_STRDUP will be defined. AC_DEFUN([CURL_CHECK_FUNC_STRDUP], [ AC_REQUIRE([CURL_INCLUDES_STRING])dnl # tst_links_strdup="unknown" tst_proto_strdup="unknown" tst_compi_strdup="unknown" tst_allow_strdup="unknown" # AC_MSG_CHECKING([if strdup can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strdup]) ],[ AC_MSG_RESULT([yes]) tst_links_strdup="yes" ],[ AC_MSG_RESULT([no]) tst_links_strdup="no" ]) # if test "$tst_links_strdup" = "yes"; then AC_MSG_CHECKING([if strdup is prototyped]) AC_EGREP_CPP([strdup],[ $curl_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strdup="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strdup="no" ]) fi # if test "$tst_proto_strdup" = "yes"; then AC_MSG_CHECKING([if strdup is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ if(0 != strdup(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strdup="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strdup="no" ]) fi # if test "$tst_compi_strdup" = "yes"; then AC_MSG_CHECKING([if strdup usage allowed]) if test "x$curl_disallow_strdup" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strdup="yes" else AC_MSG_RESULT([no]) tst_allow_strdup="no" fi fi # AC_MSG_CHECKING([if strdup might be used]) if test "$tst_links_strdup" = "yes" && test "$tst_proto_strdup" = "yes" && test "$tst_compi_strdup" = "yes" && test "$tst_allow_strdup" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRDUP, 1, [Define to 1 if you have the strdup function.]) ac_cv_func_strdup="yes" else AC_MSG_RESULT([no]) ac_cv_func_strdup="no" fi ]) dnl CURL_CHECK_FUNC_STRERROR_R dnl ------------------------------------------------- dnl Verify if strerror_r is available, prototyped, can be compiled and dnl seems to work. If all of these are true, and usage has not been dnl previously disallowed with shell variable curl_disallow_strerror_r, dnl then HAVE_STRERROR_R and STRERROR_R_TYPE_ARG3 will be defined, as dnl well as one of HAVE_GLIBC_STRERROR_R or HAVE_POSIX_STRERROR_R. dnl dnl glibc-style strerror_r: dnl dnl char *strerror_r(int errnum, char *workbuf, size_t bufsize); dnl dnl glibc-style strerror_r returns a pointer to the the error string, dnl and might use the provided workbuf as a scratch area if needed. A dnl quick test on a few systems shows that it's usually not used at all. dnl dnl POSIX-style strerror_r: dnl dnl int strerror_r(int errnum, char *resultbuf, size_t bufsize); dnl dnl POSIX-style strerror_r returns 0 upon successful completion and the dnl error string in the provided resultbuf. dnl AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [ AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl AC_REQUIRE([CURL_INCLUDES_STRING])dnl # tst_links_strerror_r="unknown" tst_proto_strerror_r="unknown" tst_compi_strerror_r="unknown" tst_glibc_strerror_r="unknown" tst_posix_strerror_r="unknown" tst_allow_strerror_r="unknown" tst_works_glibc_strerror_r="unknown" tst_works_posix_strerror_r="unknown" tst_glibc_strerror_r_type_arg3="unknown" tst_posix_strerror_r_type_arg3="unknown" # AC_MSG_CHECKING([if strerror_r can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strerror_r]) ],[ AC_MSG_RESULT([yes]) tst_links_strerror_r="yes" ],[ AC_MSG_RESULT([no]) tst_links_strerror_r="no" ]) # if test "$tst_links_strerror_r" = "yes"; then AC_MSG_CHECKING([if strerror_r is prototyped]) AC_EGREP_CPP([strerror_r],[ $curl_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strerror_r="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strerror_r="no" ]) fi # if test "$tst_proto_strerror_r" = "yes"; then AC_MSG_CHECKING([if strerror_r is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ if(0 != strerror_r(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strerror_r="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strerror_r="no" ]) fi # if test "$tst_compi_strerror_r" = "yes"; then AC_MSG_CHECKING([if strerror_r is glibc like]) tst_glibc_strerror_r_type_arg3="unknown" for arg3 in 'size_t' 'int' 'unsigned int'; do if test "$tst_glibc_strerror_r_type_arg3" = "unknown"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string char *strerror_r(int errnum, char *workbuf, $arg3 bufsize); ]],[[ if(0 != strerror_r(0, 0, 0)) return 1; ]]) ],[ tst_glibc_strerror_r_type_arg3="$arg3" ]) fi done case "$tst_glibc_strerror_r_type_arg3" in unknown) AC_MSG_RESULT([no]) tst_glibc_strerror_r="no" ;; *) AC_MSG_RESULT([yes]) tst_glibc_strerror_r="yes" ;; esac fi # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tst_glibc_strerror_r" = "yes"; then AC_MSG_CHECKING([if strerror_r seems to work]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stdlib $curl_includes_string # include ]],[[ char buffer[1024]; char *string = 0; buffer[0] = '\0'; string = strerror_r(EACCES, buffer, sizeof(buffer)); if(!string) exit(1); /* fail */ if(!string[0]) exit(1); /* fail */ else exit(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_works_glibc_strerror_r="yes" ],[ AC_MSG_RESULT([no]) tst_works_glibc_strerror_r="no" ]) fi # if test "$tst_compi_strerror_r" = "yes" && test "$tst_works_glibc_strerror_r" != "yes"; then AC_MSG_CHECKING([if strerror_r is POSIX like]) tst_posix_strerror_r_type_arg3="unknown" for arg3 in 'size_t' 'int' 'unsigned int'; do if test "$tst_posix_strerror_r_type_arg3" = "unknown"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string int strerror_r(int errnum, char *resultbuf, $arg3 bufsize); ]],[[ if(0 != strerror_r(0, 0, 0)) return 1; ]]) ],[ tst_posix_strerror_r_type_arg3="$arg3" ]) fi done case "$tst_posix_strerror_r_type_arg3" in unknown) AC_MSG_RESULT([no]) tst_posix_strerror_r="no" ;; *) AC_MSG_RESULT([yes]) tst_posix_strerror_r="yes" ;; esac fi # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tst_posix_strerror_r" = "yes"; then AC_MSG_CHECKING([if strerror_r seems to work]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stdlib $curl_includes_string # include ]],[[ char buffer[1024]; int error = 1; buffer[0] = '\0'; error = strerror_r(EACCES, buffer, sizeof(buffer)); if(error) exit(1); /* fail */ if(buffer[0] == '\0') exit(1); /* fail */ else exit(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_works_posix_strerror_r="yes" ],[ AC_MSG_RESULT([no]) tst_works_posix_strerror_r="no" ]) fi # if test "$tst_works_glibc_strerror_r" = "yes"; then tst_posix_strerror_r="no" fi if test "$tst_works_posix_strerror_r" = "yes"; then tst_glibc_strerror_r="no" fi if test "$tst_glibc_strerror_r" = "yes" && test "$tst_works_glibc_strerror_r" != "no" && test "$tst_posix_strerror_r" != "yes"; then tst_allow_strerror_r="check" fi if test "$tst_posix_strerror_r" = "yes" && test "$tst_works_posix_strerror_r" != "no" && test "$tst_glibc_strerror_r" != "yes"; then tst_allow_strerror_r="check" fi if test "$tst_allow_strerror_r" = "check"; then AC_MSG_CHECKING([if strerror_r usage allowed]) if test "x$curl_disallow_strerror_r" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strerror_r="yes" else AC_MSG_RESULT([no]) tst_allow_strerror_r="no" fi fi # AC_MSG_CHECKING([if strerror_r might be used]) if test "$tst_links_strerror_r" = "yes" && test "$tst_proto_strerror_r" = "yes" && test "$tst_compi_strerror_r" = "yes" && test "$tst_allow_strerror_r" = "yes"; then AC_MSG_RESULT([yes]) if test "$tst_glibc_strerror_r" = "yes"; then AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1, [Define to 1 if you have the strerror_r function.]) AC_DEFINE_UNQUOTED(HAVE_GLIBC_STRERROR_R, 1, [Define to 1 if you have a working glibc-style strerror_r function.]) AC_DEFINE_UNQUOTED(STRERROR_R_TYPE_ARG3, $tst_glibc_strerror_r_type_arg3, [Define to the type of arg 3 for strerror_r.]) fi if test "$tst_posix_strerror_r" = "yes"; then AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1, [Define to 1 if you have the strerror_r function.]) AC_DEFINE_UNQUOTED(HAVE_POSIX_STRERROR_R, 1, [Define to 1 if you have a working POSIX-style strerror_r function.]) AC_DEFINE_UNQUOTED(STRERROR_R_TYPE_ARG3, $tst_posix_strerror_r_type_arg3, [Define to the type of arg 3 for strerror_r.]) fi ac_cv_func_strerror_r="yes" else AC_MSG_RESULT([no]) ac_cv_func_strerror_r="no" fi # if test "$tst_compi_strerror_r" = "yes" && test "$tst_allow_strerror_r" = "unknown"; then AC_MSG_WARN([cannot determine strerror_r() style: edit lib/curl_config.h manually.]) fi # ]) dnl CURL_CHECK_FUNC_STRICMP dnl ------------------------------------------------- dnl Verify if stricmp is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_stricmp, then dnl HAVE_STRICMP will be defined. AC_DEFUN([CURL_CHECK_FUNC_STRICMP], [ AC_REQUIRE([CURL_INCLUDES_STRING])dnl # tst_links_stricmp="unknown" tst_proto_stricmp="unknown" tst_compi_stricmp="unknown" tst_allow_stricmp="unknown" # AC_MSG_CHECKING([if stricmp can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([stricmp]) ],[ AC_MSG_RESULT([yes]) tst_links_stricmp="yes" ],[ AC_MSG_RESULT([no]) tst_links_stricmp="no" ]) # if test "$tst_links_stricmp" = "yes"; then AC_MSG_CHECKING([if stricmp is prototyped]) AC_EGREP_CPP([stricmp],[ $curl_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_stricmp="yes" ],[ AC_MSG_RESULT([no]) tst_proto_stricmp="no" ]) fi # if test "$tst_proto_stricmp" = "yes"; then AC_MSG_CHECKING([if stricmp is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ if(0 != stricmp(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_stricmp="yes" ],[ AC_MSG_RESULT([no]) tst_compi_stricmp="no" ]) fi # if test "$tst_compi_stricmp" = "yes"; then AC_MSG_CHECKING([if stricmp usage allowed]) if test "x$curl_disallow_stricmp" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_stricmp="yes" else AC_MSG_RESULT([no]) tst_allow_stricmp="no" fi fi # AC_MSG_CHECKING([if stricmp might be used]) if test "$tst_links_stricmp" = "yes" && test "$tst_proto_stricmp" = "yes" && test "$tst_compi_stricmp" = "yes" && test "$tst_allow_stricmp" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRICMP, 1, [Define to 1 if you have the stricmp function.]) ac_cv_func_stricmp="yes" else AC_MSG_RESULT([no]) ac_cv_func_stricmp="no" fi ]) dnl CURL_CHECK_FUNC_STRNCASECMP dnl ------------------------------------------------- dnl Verify if strncasecmp is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_strncasecmp, then dnl HAVE_STRNCASECMP will be defined. AC_DEFUN([CURL_CHECK_FUNC_STRNCASECMP], [ AC_REQUIRE([CURL_INCLUDES_STRING])dnl # tst_links_strncasecmp="unknown" tst_proto_strncasecmp="unknown" tst_compi_strncasecmp="unknown" tst_allow_strncasecmp="unknown" # AC_MSG_CHECKING([if strncasecmp can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strncasecmp]) ],[ AC_MSG_RESULT([yes]) tst_links_strncasecmp="yes" ],[ AC_MSG_RESULT([no]) tst_links_strncasecmp="no" ]) # if test "$tst_links_strncasecmp" = "yes"; then AC_MSG_CHECKING([if strncasecmp is prototyped]) AC_EGREP_CPP([strncasecmp],[ $curl_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strncasecmp="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strncasecmp="no" ]) fi # if test "$tst_proto_strncasecmp" = "yes"; then AC_MSG_CHECKING([if strncasecmp is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ if(0 != strncasecmp(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strncasecmp="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strncasecmp="no" ]) fi # if test "$tst_compi_strncasecmp" = "yes"; then AC_MSG_CHECKING([if strncasecmp usage allowed]) if test "x$curl_disallow_strncasecmp" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strncasecmp="yes" else AC_MSG_RESULT([no]) tst_allow_strncasecmp="no" fi fi # AC_MSG_CHECKING([if strncasecmp might be used]) if test "$tst_links_strncasecmp" = "yes" && test "$tst_proto_strncasecmp" = "yes" && test "$tst_compi_strncasecmp" = "yes" && test "$tst_allow_strncasecmp" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRNCASECMP, 1, [Define to 1 if you have the strncasecmp function.]) ac_cv_func_strncasecmp="yes" else AC_MSG_RESULT([no]) ac_cv_func_strncasecmp="no" fi ]) dnl CURL_CHECK_FUNC_STRNCMPI dnl ------------------------------------------------- dnl Verify if strncmpi is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_strncmpi, then dnl HAVE_STRNCMPI will be defined. AC_DEFUN([CURL_CHECK_FUNC_STRNCMPI], [ AC_REQUIRE([CURL_INCLUDES_STRING])dnl # tst_links_strncmpi="unknown" tst_proto_strncmpi="unknown" tst_compi_strncmpi="unknown" tst_allow_strncmpi="unknown" # AC_MSG_CHECKING([if strncmpi can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strncmpi]) ],[ AC_MSG_RESULT([yes]) tst_links_strncmpi="yes" ],[ AC_MSG_RESULT([no]) tst_links_strncmpi="no" ]) # if test "$tst_links_strncmpi" = "yes"; then AC_MSG_CHECKING([if strncmpi is prototyped]) AC_EGREP_CPP([strncmpi],[ $curl_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strncmpi="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strncmpi="no" ]) fi # if test "$tst_proto_strncmpi" = "yes"; then AC_MSG_CHECKING([if strncmpi is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ if(0 != strncmpi(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strncmpi="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strncmpi="no" ]) fi # if test "$tst_compi_strncmpi" = "yes"; then AC_MSG_CHECKING([if strncmpi usage allowed]) if test "x$curl_disallow_strncmpi" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strncmpi="yes" else AC_MSG_RESULT([no]) tst_allow_strncmpi="no" fi fi # AC_MSG_CHECKING([if strncmpi might be used]) if test "$tst_links_strncmpi" = "yes" && test "$tst_proto_strncmpi" = "yes" && test "$tst_compi_strncmpi" = "yes" && test "$tst_allow_strncmpi" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRNCMPI, 1, [Define to 1 if you have the strncmpi function.]) ac_cv_func_strncmpi="yes" else AC_MSG_RESULT([no]) ac_cv_func_strncmpi="no" fi ]) dnl CURL_CHECK_FUNC_STRNICMP dnl ------------------------------------------------- dnl Verify if strnicmp is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_strnicmp, then dnl HAVE_STRNICMP will be defined. AC_DEFUN([CURL_CHECK_FUNC_STRNICMP], [ AC_REQUIRE([CURL_INCLUDES_STRING])dnl # tst_links_strnicmp="unknown" tst_proto_strnicmp="unknown" tst_compi_strnicmp="unknown" tst_allow_strnicmp="unknown" # AC_MSG_CHECKING([if strnicmp can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strnicmp]) ],[ AC_MSG_RESULT([yes]) tst_links_strnicmp="yes" ],[ AC_MSG_RESULT([no]) tst_links_strnicmp="no" ]) # if test "$tst_links_strnicmp" = "yes"; then AC_MSG_CHECKING([if strnicmp is prototyped]) AC_EGREP_CPP([strnicmp],[ $curl_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strnicmp="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strnicmp="no" ]) fi # if test "$tst_proto_strnicmp" = "yes"; then AC_MSG_CHECKING([if strnicmp is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ if(0 != strnicmp(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strnicmp="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strnicmp="no" ]) fi # if test "$tst_compi_strnicmp" = "yes"; then AC_MSG_CHECKING([if strnicmp usage allowed]) if test "x$curl_disallow_strnicmp" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strnicmp="yes" else AC_MSG_RESULT([no]) tst_allow_strnicmp="no" fi fi # AC_MSG_CHECKING([if strnicmp might be used]) if test "$tst_links_strnicmp" = "yes" && test "$tst_proto_strnicmp" = "yes" && test "$tst_compi_strnicmp" = "yes" && test "$tst_allow_strnicmp" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRNICMP, 1, [Define to 1 if you have the strnicmp function.]) ac_cv_func_strnicmp="yes" else AC_MSG_RESULT([no]) ac_cv_func_strnicmp="no" fi ]) dnl CURL_CHECK_FUNC_STRSTR dnl ------------------------------------------------- dnl Verify if strstr is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_strstr, then dnl HAVE_STRSTR will be defined. AC_DEFUN([CURL_CHECK_FUNC_STRSTR], [ AC_REQUIRE([CURL_INCLUDES_STRING])dnl # tst_links_strstr="unknown" tst_proto_strstr="unknown" tst_compi_strstr="unknown" tst_allow_strstr="unknown" # AC_MSG_CHECKING([if strstr can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strstr]) ],[ AC_MSG_RESULT([yes]) tst_links_strstr="yes" ],[ AC_MSG_RESULT([no]) tst_links_strstr="no" ]) # if test "$tst_links_strstr" = "yes"; then AC_MSG_CHECKING([if strstr is prototyped]) AC_EGREP_CPP([strstr],[ $curl_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strstr="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strstr="no" ]) fi # if test "$tst_proto_strstr" = "yes"; then AC_MSG_CHECKING([if strstr is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ if(0 != strstr(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strstr="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strstr="no" ]) fi # if test "$tst_compi_strstr" = "yes"; then AC_MSG_CHECKING([if strstr usage allowed]) if test "x$curl_disallow_strstr" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strstr="yes" else AC_MSG_RESULT([no]) tst_allow_strstr="no" fi fi # AC_MSG_CHECKING([if strstr might be used]) if test "$tst_links_strstr" = "yes" && test "$tst_proto_strstr" = "yes" && test "$tst_compi_strstr" = "yes" && test "$tst_allow_strstr" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRSTR, 1, [Define to 1 if you have the strstr function.]) ac_cv_func_strstr="yes" else AC_MSG_RESULT([no]) ac_cv_func_strstr="no" fi ]) dnl CURL_CHECK_FUNC_STRTOK_R dnl ------------------------------------------------- dnl Verify if strtok_r is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_strtok_r, then dnl HAVE_STRTOK_R will be defined. AC_DEFUN([CURL_CHECK_FUNC_STRTOK_R], [ AC_REQUIRE([CURL_INCLUDES_STRING])dnl # tst_links_strtok_r="unknown" tst_proto_strtok_r="unknown" tst_compi_strtok_r="unknown" tst_allow_strtok_r="unknown" # AC_MSG_CHECKING([if strtok_r can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strtok_r]) ],[ AC_MSG_RESULT([yes]) tst_links_strtok_r="yes" ],[ AC_MSG_RESULT([no]) tst_links_strtok_r="no" ]) # if test "$tst_links_strtok_r" = "yes"; then AC_MSG_CHECKING([if strtok_r is prototyped]) AC_EGREP_CPP([strtok_r],[ $curl_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strtok_r="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strtok_r="no" ]) fi # if test "$tst_proto_strtok_r" = "yes"; then AC_MSG_CHECKING([if strtok_r is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_string ]],[[ if(0 != strtok_r(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strtok_r="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strtok_r="no" ]) fi # if test "$tst_compi_strtok_r" = "yes"; then AC_MSG_CHECKING([if strtok_r usage allowed]) if test "x$curl_disallow_strtok_r" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strtok_r="yes" else AC_MSG_RESULT([no]) tst_allow_strtok_r="no" fi fi # AC_MSG_CHECKING([if strtok_r might be used]) if test "$tst_links_strtok_r" = "yes" && test "$tst_proto_strtok_r" = "yes" && test "$tst_compi_strtok_r" = "yes" && test "$tst_allow_strtok_r" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRTOK_R, 1, [Define to 1 if you have the strtok_r function.]) ac_cv_func_strtok_r="yes" else AC_MSG_RESULT([no]) ac_cv_func_strtok_r="no" fi ]) dnl CURL_CHECK_FUNC_STRTOLL dnl ------------------------------------------------- dnl Verify if strtoll is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_strtoll, then dnl HAVE_STRTOLL will be defined. AC_DEFUN([CURL_CHECK_FUNC_STRTOLL], [ AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl # tst_links_strtoll="unknown" tst_proto_strtoll="unknown" tst_compi_strtoll="unknown" tst_allow_strtoll="unknown" # AC_MSG_CHECKING([if strtoll can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strtoll]) ],[ AC_MSG_RESULT([yes]) tst_links_strtoll="yes" ],[ AC_MSG_RESULT([no]) tst_links_strtoll="no" ]) # if test "$tst_links_strtoll" = "yes"; then AC_MSG_CHECKING([if strtoll is prototyped]) AC_EGREP_CPP([strtoll],[ $curl_includes_stdlib ],[ AC_MSG_RESULT([yes]) tst_proto_strtoll="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strtoll="no" ]) fi # if test "$tst_proto_strtoll" = "yes"; then AC_MSG_CHECKING([if strtoll is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_stdlib ]],[[ if(0 != strtoll(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strtoll="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strtoll="no" ]) fi # if test "$tst_compi_strtoll" = "yes"; then AC_MSG_CHECKING([if strtoll usage allowed]) if test "x$curl_disallow_strtoll" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strtoll="yes" else AC_MSG_RESULT([no]) tst_allow_strtoll="no" fi fi # AC_MSG_CHECKING([if strtoll might be used]) if test "$tst_links_strtoll" = "yes" && test "$tst_proto_strtoll" = "yes" && test "$tst_compi_strtoll" = "yes" && test "$tst_allow_strtoll" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRTOLL, 1, [Define to 1 if you have the strtoll function.]) ac_cv_func_strtoll="yes" else AC_MSG_RESULT([no]) ac_cv_func_strtoll="no" fi ]) dnl CURL_CHECK_FUNC_WRITEV dnl ------------------------------------------------- dnl Verify if writev is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable curl_disallow_writev, then dnl HAVE_WRITEV will be defined. AC_DEFUN([CURL_CHECK_FUNC_WRITEV], [ AC_REQUIRE([CURL_INCLUDES_SYS_UIO])dnl # tst_links_writev="unknown" tst_proto_writev="unknown" tst_compi_writev="unknown" tst_allow_writev="unknown" # AC_MSG_CHECKING([if writev can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([writev]) ],[ AC_MSG_RESULT([yes]) tst_links_writev="yes" ],[ AC_MSG_RESULT([no]) tst_links_writev="no" ]) # if test "$tst_links_writev" = "yes"; then AC_MSG_CHECKING([if writev is prototyped]) AC_EGREP_CPP([writev],[ $curl_includes_sys_uio ],[ AC_MSG_RESULT([yes]) tst_proto_writev="yes" ],[ AC_MSG_RESULT([no]) tst_proto_writev="no" ]) fi # if test "$tst_proto_writev" = "yes"; then AC_MSG_CHECKING([if writev is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_uio ]],[[ if(0 != writev(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_writev="yes" ],[ AC_MSG_RESULT([no]) tst_compi_writev="no" ]) fi # if test "$tst_compi_writev" = "yes"; then AC_MSG_CHECKING([if writev usage allowed]) if test "x$curl_disallow_writev" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_writev="yes" else AC_MSG_RESULT([no]) tst_allow_writev="no" fi fi # AC_MSG_CHECKING([if writev might be used]) if test "$tst_links_writev" = "yes" && test "$tst_proto_writev" = "yes" && test "$tst_compi_writev" = "yes" && test "$tst_allow_writev" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_WRITEV, 1, [Define to 1 if you have the writev function.]) ac_cv_func_writev="yes" else AC_MSG_RESULT([no]) ac_cv_func_writev="no" fi ]) curl-7.35.0/m4/curl-override.m40000644000175000017500000000372112213173003013033 00000000000000#*************************************************************************** #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. # serial 7 dnl CURL_OVERRIDE_AUTOCONF dnl ------------------------------------------------- dnl Placing a call to this macro in configure.ac after dnl the one to AC_INIT will make macros in this file dnl visible to the rest of the compilation overriding dnl those from Autoconf. AC_DEFUN([CURL_OVERRIDE_AUTOCONF], [ AC_BEFORE([$0],[AC_PROG_LIBTOOL]) # using curl-override.m4 ]) dnl Override Autoconf's AC_LANG_PROGRAM (C) dnl ------------------------------------------------- dnl This is done to prevent compiler warning dnl 'function declaration isn't a prototype' dnl in function main. This requires at least dnl a c89 compiler and does not suport K&R. m4_define([AC_LANG_PROGRAM(C)], [$1 int main (void) { $2 ; return 0; }]) dnl Override Autoconf's AC_LANG_CALL (C) dnl ------------------------------------------------- dnl This is a backport of Autoconf's 2.60 with the dnl embedded comments that hit the resulting script dnl removed. This is done to reduce configure size dnl and use fixed macro across Autoconf versions. m4_define([AC_LANG_CALL(C)], [AC_LANG_PROGRAM([$1 m4_if([$2], [main], , [ #ifdef __cplusplus extern "C" #endif char $2 ();])], [return $2 ();])]) dnl Override Autoconf's AC_LANG_FUNC_LINK_TRY (C) dnl ------------------------------------------------- dnl This is a backport of Autoconf's 2.60 with the dnl embedded comments that hit the resulting script dnl removed. This is done to reduce configure size dnl and use fixed macro across Autoconf versions. m4_define([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_PROGRAM( [ #define $1 innocuous_$1 #ifdef __STDC__ # include #else # include #endif #undef $1 #ifdef __cplusplus extern "C" #endif char $1 (); #if defined __stub_$1 || defined __stub___$1 choke me #endif ], [return $1 ();])]) curl-7.35.0/m4/curl-openssl.m40000644000175000017500000001737112213173003012705 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2011, 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. # #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. # serial 5 dnl CURL_CHECK_OPENSSL_API_HEADERS dnl ------------------------------------------------- dnl Find out OpenSSL headers API version, as reported dnl by OPENSSL_VERSION_NUMBER. No runtime checks dnl allowed here for cross-compilation support. dnl HAVE_OPENSSL_API_HEADERS is defined as apprpriate dnl only for systems which actually run the configure dnl script. Config files generated manually or in any dnl other way shall not define this. AC_DEFUN([CURL_CHECK_OPENSSL_API_HEADERS], [ # tst_api="unknown" # AC_MSG_CHECKING([for OpenSSL headers version]) CURL_CHECK_DEF([OPENSSL_VERSION_NUMBER], [ # ifdef USE_OPENSSL # include # else # include # endif ], [silent]) if test "$curl_cv_have_def_OPENSSL_VERSION_NUMBER" = "yes"; then tst_verlen=`expr "$curl_cv_def_OPENSSL_VERSION_NUMBER" : '.*'` case "x$tst_verlen" in x6) tst_vermaj=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 3` tst_vermin=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 4` tst_verfix=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 5` tst_api=0x$tst_vermaj$tst_vermin$tst_verfix ;; x11|x10) tst_vermaj=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 3` tst_vermin=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 5` tst_verfix=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 7` tst_api=0x$tst_vermaj$tst_vermin$tst_verfix ;; *) tst_api="unknown" ;; esac case $tst_api in 0x110) tst_show="1.1.0" ;; 0x101) tst_show="1.0.1" ;; 0x100) tst_show="1.0.0" ;; 0x099) tst_show="0.9.9" ;; 0x098) tst_show="0.9.8" ;; 0x097) tst_show="0.9.7" ;; 0x096) tst_show="0.9.6" ;; 0x095) tst_show="0.9.5" ;; 0x094) tst_show="0.9.4" ;; 0x093) tst_show="0.9.3" ;; 0x092) tst_show="0.9.2" ;; 0x091) tst_show="0.9.1" ;; *) tst_show="unknown" ;; esac tst_show="$tst_show - $curl_cv_def_OPENSSL_VERSION_NUMBER" else tst_show="unknown" fi AC_MSG_RESULT([$tst_show]) # dnl if test "$tst_api" != "unknown"; then dnl AC_DEFINE_UNQUOTED(HAVE_OPENSSL_API_HEADERS, $tst_api, dnl [OpenSSL headers configure time API. Defined only by configure script. dnl No matter what, do not ever define this manually or by any other means.]) dnl fi curl_openssl_api_headers=$tst_api ]) dnl CURL_CHECK_OPENSSL_API_LIBRARY dnl ------------------------------------------------- dnl Find out OpenSSL library API version, performing dnl only link tests in order to avoid getting fooled dnl by mismatched OpenSSL headers. No runtime checks dnl allowed here for cross-compilation support. dnl HAVE_OPENSSL_API_LIBRARY is defined as apprpriate dnl only for systems which actually run the configure dnl script. Config files generated manually or in any dnl other way shall not define this. dnl dnl Most probably we should not bother attempting to dnl detect OpenSSL library development API versions dnl 0.9.9 and 1.1.0. For our intended use, detecting dnl released versions should be good enough. dnl dnl Given that currently we are not using the result dnl of this check, except for informative purposes, dnl lets try to figure out everything. AC_DEFUN([CURL_CHECK_OPENSSL_API_LIBRARY], [ # tst_api="unknown" # AC_MSG_CHECKING([for OpenSSL library version]) if test "$tst_api" = "unknown"; then case $host in *-*-vms*) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([SSL_CTX_set_not_resumbl_sess_cb]) ],[ tst_api="0x110" ]) ;; *) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([SSL_CTX_set_not_resumable_session_callback]) ],[ tst_api="0x110" ]) ;; esac fi if test "$tst_api" = "unknown"; then AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([SSL_renegotiate_abbreviated]) ],[ tst_api="0x101" ]) fi if test "$tst_api" = "unknown"; then AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([OBJ_add_sigid]) ],[ tst_api="0x100" ]) fi if test "$tst_api" = "unknown"; then AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([ERR_set_mark]) ],[ tst_api="0x098" ]) fi if test "$tst_api" = "unknown"; then AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([ERR_peek_last_error]) ],[ tst_api="0x097" ]) fi if test "$tst_api" = "unknown"; then AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([c2i_ASN1_OBJECT]) ],[ tst_api="0x096" ]) fi if test "$tst_api" = "unknown"; then AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([SSL_CTX_set_purpose]) ],[ tst_api="0x095" ]) fi if test "$tst_api" = "unknown"; then AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([OBJ_obj2txt]) ],[ tst_api="0x094" ]) fi if test "$tst_api" = "unknown"; then AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([SSL_get_verify_depth]) ],[ tst_api="0x093" ]) fi if test "$tst_api" = "unknown"; then AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([SSL_library_init]) ],[ tst_api="0x092" ]) fi if test "$tst_api" = "unknown"; then AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([SSL_CTX_set_cipher_list]) ],[ tst_api="0x091" ]) fi case $tst_api in 0x110) tst_show="1.1.0" ;; 0x101) tst_show="1.0.1" ;; 0x100) tst_show="1.0.0" ;; 0x099) tst_show="0.9.9" ;; 0x098) tst_show="0.9.8" ;; 0x097) tst_show="0.9.7" ;; 0x096) tst_show="0.9.6" ;; 0x095) tst_show="0.9.5" ;; 0x094) tst_show="0.9.4" ;; 0x093) tst_show="0.9.3" ;; 0x092) tst_show="0.9.2" ;; 0x091) tst_show="0.9.1" ;; *) tst_show="unknown" ;; esac AC_MSG_RESULT([$tst_show]) # dnl if test "$tst_api" != "unknown"; then dnl AC_DEFINE_UNQUOTED(HAVE_OPENSSL_API_LIBRARY, $tst_api, dnl [OpenSSL library link time API. Defined only by configure script. dnl No matter what, do not ever define this manually or by any other means.]) dnl fi curl_openssl_api_library=$tst_api ]) dnl CURL_CHECK_OPENSSL_API dnl ------------------------------------------------- AC_DEFUN([CURL_CHECK_OPENSSL_API], [ # CURL_CHECK_OPENSSL_API_HEADERS CURL_CHECK_OPENSSL_API_LIBRARY # tst_match="yes" # AC_MSG_CHECKING([for OpenSSL headers and library versions matching]) if test "$curl_openssl_api_headers" = "unknown" || test "$curl_openssl_api_library" = "unknown"; then tst_match="fail" tst_warns="Can not compare OpenSSL headers and library versions." elif test "$curl_openssl_api_headers" != "$curl_openssl_api_library"; then tst_match="no" tst_warns="OpenSSL headers and library versions do not match." fi AC_MSG_RESULT([$tst_match]) if test "$tst_match" != "yes"; then AC_MSG_WARN([$tst_warns]) fi ]) curl-7.35.0/m4/xc-val-flgs.m40000644000175000017500000001551612262353672012421 00000000000000#--------------------------------------------------------------------------- # # xc-val-flgs.m4 # # Copyright (c) 2013 Daniel Stenberg # # 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 THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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. # #--------------------------------------------------------------------------- # serial 1 dnl _XC_CHECK_VAR_LIBS dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_CHECK_VAR_LIBS], [ xc_bad_var_libs=no for xc_word in $LIBS; do case "$xc_word" in -l* | --library=*) : ;; *) xc_bad_var_libs=yes ;; esac done if test $xc_bad_var_libs = yes; then AC_MSG_NOTICE([using LIBS: $LIBS]) AC_MSG_NOTICE([LIBS note: LIBS should only be used to specify libraries (-lname).]) fi ]) dnl _XC_CHECK_VAR_LDFLAGS dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_CHECK_VAR_LDFLAGS], [ xc_bad_var_ldflags=no for xc_word in $LDFLAGS; do case "$xc_word" in -D*) xc_bad_var_ldflags=yes ;; -U*) xc_bad_var_ldflags=yes ;; -I*) xc_bad_var_ldflags=yes ;; -l* | --library=*) xc_bad_var_ldflags=yes ;; esac done if test $xc_bad_var_ldflags = yes; then AC_MSG_NOTICE([using LDFLAGS: $LDFLAGS]) xc_bad_var_msg="LDFLAGS note: LDFLAGS should only be used to specify linker flags, not" for xc_word in $LDFLAGS; do case "$xc_word" in -D*) AC_MSG_NOTICE([$xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word]) ;; -U*) AC_MSG_NOTICE([$xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word]) ;; -I*) AC_MSG_NOTICE([$xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word]) ;; -l* | --library=*) AC_MSG_NOTICE([$xc_bad_var_msg libraries. Use LIBS for: $xc_word]) ;; esac done fi ]) dnl _XC_CHECK_VAR_CPPFLAGS dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_CHECK_VAR_CPPFLAGS], [ xc_bad_var_cppflags=no for xc_word in $CPPFLAGS; do case "$xc_word" in -rpath*) xc_bad_var_cppflags=yes ;; -L* | --library-path=*) xc_bad_var_cppflags=yes ;; -l* | --library=*) xc_bad_var_cppflags=yes ;; esac done if test $xc_bad_var_cppflags = yes; then AC_MSG_NOTICE([using CPPFLAGS: $CPPFLAGS]) xc_bad_var_msg="CPPFLAGS note: CPPFLAGS should only be used to specify C preprocessor flags, not" for xc_word in $CPPFLAGS; do case "$xc_word" in -rpath*) AC_MSG_NOTICE([$xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word]) ;; -L* | --library-path=*) AC_MSG_NOTICE([$xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word]) ;; -l* | --library=*) AC_MSG_NOTICE([$xc_bad_var_msg libraries. Use LIBS for: $xc_word]) ;; esac done fi ]) dnl _XC_CHECK_VAR_CFLAGS dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_CHECK_VAR_CFLAGS], [ xc_bad_var_cflags=no for xc_word in $CFLAGS; do case "$xc_word" in -D*) xc_bad_var_cflags=yes ;; -U*) xc_bad_var_cflags=yes ;; -I*) xc_bad_var_cflags=yes ;; -rpath*) xc_bad_var_cflags=yes ;; -L* | --library-path=*) xc_bad_var_cflags=yes ;; -l* | --library=*) xc_bad_var_cflags=yes ;; esac done if test $xc_bad_var_cflags = yes; then AC_MSG_NOTICE([using CFLAGS: $CFLAGS]) xc_bad_var_msg="CFLAGS note: CFLAGS should only be used to specify C compiler flags, not" for xc_word in $CFLAGS; do case "$xc_word" in -D*) AC_MSG_NOTICE([$xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word]) ;; -U*) AC_MSG_NOTICE([$xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word]) ;; -I*) AC_MSG_NOTICE([$xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word]) ;; -rpath*) AC_MSG_NOTICE([$xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word]) ;; -L* | --library-path=*) AC_MSG_NOTICE([$xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word]) ;; -l* | --library=*) AC_MSG_NOTICE([$xc_bad_var_msg libraries. Use LIBS for: $xc_word]) ;; esac done fi ]) dnl XC_CHECK_USER_FLAGS dnl ------------------------------------------------- dnl Public macro. dnl dnl Performs some sanity checks for LIBS, LDFLAGS, dnl CPPFLAGS and CFLAGS values that the user might dnl have set. When checks fails, user is noticed dnl about errors detected in all of them and script dnl execution is halted. dnl dnl Intended to be used early in configure script. AC_DEFUN([XC_CHECK_USER_FLAGS], [ AC_PREREQ([2.50])dnl AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl dnl check order below matters _XC_CHECK_VAR_LIBS _XC_CHECK_VAR_LDFLAGS _XC_CHECK_VAR_CPPFLAGS _XC_CHECK_VAR_CFLAGS if test $xc_bad_var_libs = yes || test $xc_bad_var_cflags = yes || test $xc_bad_var_ldflags = yes || test $xc_bad_var_cppflags = yes; then AC_MSG_ERROR([Can not continue. Fix errors mentioned immediately above this line.]) fi ]) dnl XC_CHECK_BUILD_FLAGS dnl ------------------------------------------------- dnl Public macro. dnl dnl Performs some sanity checks for LIBS, LDFLAGS, dnl CPPFLAGS and CFLAGS values that the configure dnl script might have set. When checks fails, user dnl is noticed about errors detected in all of them dnl but script continues execution. dnl dnl Intended to be used very late in configure script. AC_DEFUN([XC_CHECK_BUILD_FLAGS], [ AC_PREREQ([2.50])dnl dnl check order below matters _XC_CHECK_VAR_LIBS _XC_CHECK_VAR_LDFLAGS _XC_CHECK_VAR_CPPFLAGS _XC_CHECK_VAR_CFLAGS if test $xc_bad_var_libs = yes || test $xc_bad_var_cflags = yes || test $xc_bad_var_ldflags = yes || test $xc_bad_var_cppflags = yes; then AC_MSG_WARN([Continuing even with errors mentioned immediately above this line.]) fi ]) curl-7.35.0/m4/ltsugar.m40000644000175000017500000001042412272122660011740 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) curl-7.35.0/m4/zz60-xc-ovr.m40000644000175000017500000000437212213173003012301 00000000000000#--------------------------------------------------------------------------- # # zz60-xc-ovr.m4 # # Copyright (c) 2013 Daniel Stenberg # # 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 THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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. # #--------------------------------------------------------------------------- # serial 1 dnl The funny name of this file is intentional in order to make it dnl sort alphabetically after any libtool, autoconf or automake dnl provided .m4 macro file that might get copied into this same dnl subdirectory. This allows that macro (re)definitions from this dnl file may override those provided in other files. dnl Override an autoconf provided macro dnl ------------------------------------------------- dnl This macro overrides the one provided by autoconf dnl 2.58 or newer, and provides macro definition for dnl autoconf 2.57 or older which lack it. This allows dnl using libtool 2.2 or newer, which requires that dnl this macro is used in configure.ac, with autoconf dnl 2.57 or older. m4_ifdef([AC_CONFIG_MACRO_DIR], [dnl m4_undefine([AC_CONFIG_MACRO_DIR])dnl ]) m4_define([AC_CONFIG_MACRO_DIR],[]) dnl XC_OVR_ZZ60 dnl ------------------------------------------------- dnl Placing a call to this macro in configure.ac will dnl make macros in this file visible to other macros dnl used for same configure script, overriding those dnl provided elsewhere. AC_DEFUN([XC_OVR_ZZ60], [dnl AC_BEFORE([$0],[LT_INIT])dnl AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl dnl AC_BEFORE([$0],[AC_CONFIG_MACRO_DIR])dnl AC_BEFORE([$0],[AC_CONFIG_MACRO_DIRS])dnl ]) curl-7.35.0/m4/lt~obsolete.m40000644000175000017500000001375612272122660012644 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) curl-7.35.0/m4/curl-reentrant.m40000644000175000017500000003726012213173003013223 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2009, 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. # #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. # serial 10 dnl Note 1 dnl ------ dnl None of the CURL_CHECK_NEED_REENTRANT_* macros shall use HAVE_FOO_H to dnl conditionally include header files. These macros are used early in the dnl configure process much before header file availability is known. dnl CURL_CHECK_NEED_REENTRANT_ERRNO dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes errno available as a preprocessor macro. AC_DEFUN([CURL_CHECK_NEED_REENTRANT_ERRNO], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include ]],[[ if(0 != errno) return 1; ]]) ],[ tmp_errno="yes" ],[ tmp_errno="no" ]) if test "$tmp_errno" = "yes"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include ]],[[ #ifdef errno int dummy=1; #else force compilation error #endif ]]) ],[ tmp_errno="errno_macro_defined" ],[ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define _REENTRANT #include ]],[[ #ifdef errno int dummy=1; #else force compilation error #endif ]]) ],[ tmp_errno="errno_macro_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CURL_CHECK_NEED_REENTRANT_GMTIME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function gmtime_r compiler visible. AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GMTIME_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gmtime_r]) ],[ tmp_gmtime_r="yes" ],[ tmp_gmtime_r="no" ]) if test "$tmp_gmtime_r" = "yes"; then AC_EGREP_CPP([gmtime_r],[ #include #include ],[ tmp_gmtime_r="proto_declared" ],[ AC_EGREP_CPP([gmtime_r],[ #define _REENTRANT #include #include ],[ tmp_gmtime_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CURL_CHECK_NEED_REENTRANT_LOCALTIME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function localtime_r compiler visible. AC_DEFUN([CURL_CHECK_NEED_REENTRANT_LOCALTIME_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([localtime_r]) ],[ tmp_localtime_r="yes" ],[ tmp_localtime_r="no" ]) if test "$tmp_localtime_r" = "yes"; then AC_EGREP_CPP([localtime_r],[ #include #include ],[ tmp_localtime_r="proto_declared" ],[ AC_EGREP_CPP([localtime_r],[ #define _REENTRANT #include #include ],[ tmp_localtime_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CURL_CHECK_NEED_REENTRANT_STRERROR_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function strerror_r compiler visible. AC_DEFUN([CURL_CHECK_NEED_REENTRANT_STRERROR_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strerror_r]) ],[ tmp_strerror_r="yes" ],[ tmp_strerror_r="no" ]) if test "$tmp_strerror_r" = "yes"; then AC_EGREP_CPP([strerror_r],[ #include #include ],[ tmp_strerror_r="proto_declared" ],[ AC_EGREP_CPP([strerror_r],[ #define _REENTRANT #include #include ],[ tmp_strerror_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CURL_CHECK_NEED_REENTRANT_STRTOK_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function strtok_r compiler visible. AC_DEFUN([CURL_CHECK_NEED_REENTRANT_STRTOK_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strtok_r]) ],[ tmp_strtok_r="yes" ],[ tmp_strtok_r="no" ]) if test "$tmp_strtok_r" = "yes"; then AC_EGREP_CPP([strtok_r],[ #include #include ],[ tmp_strtok_r="proto_declared" ],[ AC_EGREP_CPP([strtok_r],[ #define _REENTRANT #include #include ],[ tmp_strtok_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CURL_CHECK_NEED_REENTRANT_INET_NTOA_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function inet_ntoa_r compiler visible. AC_DEFUN([CURL_CHECK_NEED_REENTRANT_INET_NTOA_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([inet_ntoa_r]) ],[ tmp_inet_ntoa_r="yes" ],[ tmp_inet_ntoa_r="no" ]) if test "$tmp_inet_ntoa_r" = "yes"; then AC_EGREP_CPP([inet_ntoa_r],[ #include #include #include #include ],[ tmp_inet_ntoa_r="proto_declared" ],[ AC_EGREP_CPP([inet_ntoa_r],[ #define _REENTRANT #include #include #include #include ],[ tmp_inet_ntoa_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CURL_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function gethostbyaddr_r compiler visible. AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gethostbyaddr_r]) ],[ tmp_gethostbyaddr_r="yes" ],[ tmp_gethostbyaddr_r="no" ]) if test "$tmp_gethostbyaddr_r" = "yes"; then AC_EGREP_CPP([gethostbyaddr_r],[ #include #include ],[ tmp_gethostbyaddr_r="proto_declared" ],[ AC_EGREP_CPP([gethostbyaddr_r],[ #define _REENTRANT #include #include ],[ tmp_gethostbyaddr_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CURL_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function gethostbyname_r compiler visible. AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gethostbyname_r]) ],[ tmp_gethostbyname_r="yes" ],[ tmp_gethostbyname_r="no" ]) if test "$tmp_gethostbyname_r" = "yes"; then AC_EGREP_CPP([gethostbyname_r],[ #include #include ],[ tmp_gethostbyname_r="proto_declared" ],[ AC_EGREP_CPP([gethostbyname_r],[ #define _REENTRANT #include #include ],[ tmp_gethostbyname_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CURL_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function getprotobyname_r compiler visible. AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getprotobyname_r]) ],[ tmp_getprotobyname_r="yes" ],[ tmp_getprotobyname_r="no" ]) if test "$tmp_getprotobyname_r" = "yes"; then AC_EGREP_CPP([getprotobyname_r],[ #include #include ],[ tmp_getprotobyname_r="proto_declared" ],[ AC_EGREP_CPP([getprotobyname_r],[ #define _REENTRANT #include #include ],[ tmp_getprotobyname_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CURL_CHECK_NEED_REENTRANT_GETSERVBYPORT_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function getservbyport_r compiler visible. AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GETSERVBYPORT_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getservbyport_r]) ],[ tmp_getservbyport_r="yes" ],[ tmp_getservbyport_r="no" ]) if test "$tmp_getservbyport_r" = "yes"; then AC_EGREP_CPP([getservbyport_r],[ #include #include ],[ tmp_getservbyport_r="proto_declared" ],[ AC_EGREP_CPP([getservbyport_r],[ #define _REENTRANT #include #include ],[ tmp_getservbyport_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes several _r functions compiler visible. dnl Internal macro for CURL_CONFIGURE_REENTRANT. AC_DEFUN([CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R], [ if test "$tmp_need_reentrant" = "no"; then CURL_CHECK_NEED_REENTRANT_GMTIME_R fi if test "$tmp_need_reentrant" = "no"; then CURL_CHECK_NEED_REENTRANT_LOCALTIME_R fi if test "$tmp_need_reentrant" = "no"; then CURL_CHECK_NEED_REENTRANT_STRERROR_R fi if test "$tmp_need_reentrant" = "no"; then CURL_CHECK_NEED_REENTRANT_STRTOK_R fi if test "$tmp_need_reentrant" = "no"; then CURL_CHECK_NEED_REENTRANT_INET_NTOA_R fi if test "$tmp_need_reentrant" = "no"; then CURL_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R fi if test "$tmp_need_reentrant" = "no"; then CURL_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R fi if test "$tmp_need_reentrant" = "no"; then CURL_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R fi if test "$tmp_need_reentrant" = "no"; then CURL_CHECK_NEED_REENTRANT_GETSERVBYPORT_R fi ]) dnl CURL_CHECK_NEED_REENTRANT_SYSTEM dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl must be unconditionally done for this platform. dnl Internal macro for CURL_CONFIGURE_REENTRANT. AC_DEFUN([CURL_CHECK_NEED_REENTRANT_SYSTEM], [ case $host_os in solaris*) tmp_need_reentrant="yes" ;; *) tmp_need_reentrant="no" ;; esac ]) dnl CURL_CHECK_NEED_THREAD_SAFE_SYSTEM dnl ------------------------------------------------- dnl Checks if the preprocessor _THREAD_SAFE definition dnl must be unconditionally done for this platform. dnl Internal macro for CURL_CONFIGURE_THREAD_SAFE. AC_DEFUN([CURL_CHECK_NEED_THREAD_SAFE_SYSTEM], [ case $host_os in aix[[123]].* | aix4.[[012]].*) dnl aix 4.2 and older tmp_need_thread_safe="no" ;; aix*) dnl AIX 4.3 and newer tmp_need_thread_safe="yes" ;; *) tmp_need_thread_safe="no" ;; esac ]) dnl CURL_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT dnl ------------------------------------------------- dnl This macro ensures that configuration tests done dnl after this will execute with preprocessor symbol dnl _REENTRANT defined. This macro also ensures that dnl the generated config file defines NEED_REENTRANT dnl and that in turn curl_setup.h will define _REENTRANT. dnl Internal macro for CURL_CONFIGURE_REENTRANT. AC_DEFUN([CURL_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT], [ AC_DEFINE(NEED_REENTRANT, 1, [Define to 1 if _REENTRANT preprocessor symbol must be defined.]) cat >>confdefs.h <<_EOF #ifndef _REENTRANT # define _REENTRANT #endif _EOF ]) dnl CURL_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE dnl ------------------------------------------------- dnl This macro ensures that configuration tests done dnl after this will execute with preprocessor symbol dnl _THREAD_SAFE defined. This macro also ensures that dnl the generated config file defines NEED_THREAD_SAFE dnl and that in turn curl_setup.h will define _THREAD_SAFE. dnl Internal macro for CURL_CONFIGURE_THREAD_SAFE. AC_DEFUN([CURL_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE], [ AC_DEFINE(NEED_THREAD_SAFE, 1, [Define to 1 if _THREAD_SAFE preprocessor symbol must be defined.]) cat >>confdefs.h <<_EOF #ifndef _THREAD_SAFE # define _THREAD_SAFE #endif _EOF ]) dnl CURL_CONFIGURE_REENTRANT dnl ------------------------------------------------- dnl This first checks if the preprocessor _REENTRANT dnl symbol is already defined. If it isn't currently dnl defined a set of checks are performed to verify dnl if its definition is required to make visible to dnl the compiler a set of *_r functions. Finally, if dnl _REENTRANT is already defined or needed it takes dnl care of making adjustments necessary to ensure dnl that it is defined equally for further configure dnl tests and generated config file. AC_DEFUN([CURL_CONFIGURE_REENTRANT], [ AC_PREREQ([2.50])dnl # AC_MSG_CHECKING([if _REENTRANT is already defined]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ #ifdef _REENTRANT int dummy=1; #else force compilation error #endif ]]) ],[ AC_MSG_RESULT([yes]) tmp_reentrant_initially_defined="yes" ],[ AC_MSG_RESULT([no]) tmp_reentrant_initially_defined="no" ]) # if test "$tmp_reentrant_initially_defined" = "no"; then AC_MSG_CHECKING([if _REENTRANT is actually needed]) CURL_CHECK_NEED_REENTRANT_SYSTEM if test "$tmp_need_reentrant" = "no"; then CURL_CHECK_NEED_REENTRANT_ERRNO fi if test "$tmp_need_reentrant" = "no"; then CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R fi if test "$tmp_need_reentrant" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # AC_MSG_CHECKING([if _REENTRANT is onwards defined]) if test "$tmp_reentrant_initially_defined" = "yes" || test "$tmp_need_reentrant" = "yes"; then CURL_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi # ]) dnl CURL_CONFIGURE_THREAD_SAFE dnl ------------------------------------------------- dnl This first checks if the preprocessor _THREAD_SAFE dnl symbol is already defined. If it isn't currently dnl defined a set of checks are performed to verify dnl if its definition is required. Finally, if dnl _THREAD_SAFE is already defined or needed it takes dnl care of making adjustments necessary to ensure dnl that it is defined equally for further configure dnl tests and generated config file. AC_DEFUN([CURL_CONFIGURE_THREAD_SAFE], [ AC_PREREQ([2.50])dnl # AC_MSG_CHECKING([if _THREAD_SAFE is already defined]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ #ifdef _THREAD_SAFE int dummy=1; #else force compilation error #endif ]]) ],[ AC_MSG_RESULT([yes]) tmp_thread_safe_initially_defined="yes" ],[ AC_MSG_RESULT([no]) tmp_thread_safe_initially_defined="no" ]) # if test "$tmp_thread_safe_initially_defined" = "no"; then AC_MSG_CHECKING([if _THREAD_SAFE is actually needed]) CURL_CHECK_NEED_THREAD_SAFE_SYSTEM if test "$tmp_need_thread_safe" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # AC_MSG_CHECKING([if _THREAD_SAFE is onwards defined]) if test "$tmp_thread_safe_initially_defined" = "yes" || test "$tmp_need_thread_safe" = "yes"; then CURL_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi # ]) curl-7.35.0/m4/xc-cc-check.m40000644000175000017500000000560612262353672012345 00000000000000#--------------------------------------------------------------------------- # # xc-cc-check.m4 # # Copyright (c) 2013 Daniel Stenberg # # 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 THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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. # #--------------------------------------------------------------------------- # serial 1 dnl _XC_PROG_CC_PREAMBLE dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_PROG_CC_PREAMBLE], [ xc_prog_cc_prev_IFS=$IFS xc_prog_cc_prev_LIBS=$LIBS xc_prog_cc_prev_CFLAGS=$CFLAGS xc_prog_cc_prev_LDFLAGS=$LDFLAGS xc_prog_cc_prev_CPPFLAGS=$CPPFLAGS ]) dnl _XC_PROG_CC_POSTLUDE dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_PROG_CC_POSTLUDE], [ IFS=$xc_prog_cc_prev_IFS LIBS=$xc_prog_cc_prev_LIBS CFLAGS=$xc_prog_cc_prev_CFLAGS LDFLAGS=$xc_prog_cc_prev_LDFLAGS CPPFLAGS=$xc_prog_cc_prev_CPPFLAGS AC_SUBST([CC])dnl AC_SUBST([CPP])dnl AC_SUBST([LIBS])dnl AC_SUBST([CFLAGS])dnl AC_SUBST([LDFLAGS])dnl AC_SUBST([CPPFLAGS])dnl ]) dnl _XC_PROG_CC dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_PROG_CC], [ AC_REQUIRE([_XC_PROG_CC_PREAMBLE])dnl AC_REQUIRE([XC_CHECK_BUILD_FLAGS])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AM_PROG_CC_C_O])dnl AC_REQUIRE([AC_PROG_CPP])dnl AC_REQUIRE([_XC_PROG_CC_POSTLUDE])dnl ]) dnl XC_CHECK_PROG_CC dnl ------------------------------------------------- dnl Public macro. dnl dnl Checks for C compiler and C preprocessor programs, dnl while doing some previous sanity validation on user dnl provided LIBS, LDFLAGS, CPPFLAGS and CFLAGS values dnl that must succeed in order to continue execution. dnl dnl This sets variables CC and CPP, while preventing dnl LIBS, LDFLAGS, CFLAGS, CPPFLAGS and IFS from being dnl unexpectedly changed by underlying macros. AC_DEFUN([XC_CHECK_PROG_CC], [ AC_PREREQ([2.50])dnl AC_BEFORE([$0],[_XC_PROG_CC_PREAMBLE])dnl AC_BEFORE([$0],[AC_PROG_INSTALL])dnl AC_BEFORE([$0],[AC_PROG_CC])dnl AC_BEFORE([$0],[AM_PROG_CC_C_O])dnl AC_BEFORE([$0],[AC_PROG_CPP])dnl AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl AC_BEFORE([$0],[_XC_PROG_CC_POSTLUDE])dnl AC_REQUIRE([_XC_PROG_CC])dnl ]) curl-7.35.0/m4/ltversion.m40000644000175000017500000000126212272122660012304 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) curl-7.35.0/RELEASE-NOTES0000644000175000017500000001253112272123246011370 00000000000000Curl and libcurl 7.35.0 Public curl releases: 137 Command line options: 161 curl_easy_setopt() options: 206 Public functions in libcurl: 58 Known libcurl bindings: 42 Contributors: 1104 This release includes the following changes: o imap/pop3/smtp: Added support for SASL authentication downgrades o imap/pop3/smtp: Extended the login options to support multiple auth mechanisms o TheArtOfHttpScripting: major update, converted layout and more o mprintf: Added support for I, I32 and I64 size specifiers o makefile: Added support for VC7, VC11 and VC12 This release includes the following bugfixes: o SECURITY ADVISORY: re-use of wrong HTTP NTLM connection [25] o curl_easy_setopt: Fixed OAuth 2.0 Bearer option name [1] o pop3: Fixed APOP being determined by CAPA response rather than by timestamp o Curl_pp_readresp: zero terminate line [2] o FILE: don't wait due to CURLOPT_MAX_RECV_SPEED_LARGE [3] o docs: mention CURLOPT_MAX_RECV/SEND_SPEED_LARGE don't work for FILE:// o pop3: Fixed auth preference not being honored when CAPA not supported o imap: Fixed auth preference not being honored when CAPABILITY not supported o threaded resolver: Use pthread_t * for curl_thread_t [4] o FILE: we don't support paused transfers using this protocol [5] o connect: Try all addresses in first connection attempt [6] o curl_easy_setopt.3: Added SMTP information to CURLOPT_INFILESIZE_LARGE o OpenSSL: Fix forcing SSLv3 connections [7] o openssl: allow explicit sslv2 selection [8] o FTP parselist: fix "total" parser [9] o conncache: fix possible dereference of null pointer o multi.c: fix possible dereference of null pointer o mk-ca-bundle: introduces -d and warns about using this script o ConnectionExists: fix NTLM check for new connection [10] o trynextip: fix build for non-IPV6 capable systems [11] o Curl_updateconninfo: don't do anything for UDP "connections" [12] o darwinssl: un-break Leopard build after PKCS#12 change [13] o threaded-resolver: never use NULL hints with getaddrinf [14] o multi_socket: remind app if timeout didn't run o OpenSSL: deselect weak ciphers by default [15] o error message: Sensible message on timeout when transfer size unknown [16] o curl_easy_setopt.3: mention how to unset CURLOPT_INFILESIZE* o win32: Fixed use of deprecated function 'GetVersionInfoEx' for VC12 [17] o configure: fix gssapi linking on HP-UX [18] o chunked-parser: abort on overflows, allow 64 bit chunks o chunked parsing: relax the CR strictness [19] o cookie: max-age fixes [20] o progress bar: always update when at 100% o progress bar: increase update frequency to 10Hz o tool: Fixed incorrect return code if command line parser runs out of memory o tool: Fixed incorrect return code if password prompting runs out of memory o HTTP POST: omit Content-Length if data size is unknown [21] o GnuTLS: disable insecure ciphers o GnuTLS: honor --slv2 and the --tlsv1[.N] switches o multi: Fixed a memory leak on OOM condition o netrc: Fixed a memory and file descriptor leak on OOM o getpass: fix password parsing from console [22] o TFTP: fix crash on time-out [23] o hostip: don't remove DNS entries that are in use [24] o tests: lots of tests fixed to pass the OOM torture tests This release includes the following known bugs: o see docs/KNOWN_BUGS (http://curl.haxx.se/docs/knownbugs.html) This release would not have looked like this without help, code, reports and advice from friends like these: Abram Pousada, Barry Abrahamson, Björn Stenberg, Cédric Deltheil, Chen Prog, Christian Weisgerber, Colin Hogben, Dan Fandrich, Daniel Stenberg, Fabian Frank, Glenn Sheridan, Guenter Knauf, He Qin, Iida Yosiaki, Jeff Hodges, Justin Maggard, Leif W, Luke Dashjr, Maks Naumov, Marc Hoersken, Michael Osipov, Michal Górny and Anthony G. Basile, Mohammad AlSaleh, Nick Zitzmann, Paras Sethia, Petr Novak, Priyanka Shah, Romulo A. Ceccon, Steve Holme, Tobias Markus, Viktor Szakáts, Yehezkel Horowitz, Yingwei Liu Thanks! (and sorry if I forgot to mention someone) References to bug reports and discussions on issues: [1] = http://curl.haxx.se/bug/view.cgi?id=1313 [2] = http://curl.haxx.se/mail/lib-2013-12/0113.html [3] = http://curl.haxx.se/bug/view.cgi?id=1312 [4] = http://curl.haxx.se/bug/view.cgi?id=1314 [5] = http://curl.haxx.se/bug/view.cgi?id=1286 [6] = http://curl.haxx.se/bug/view.cgi?id=1315 [7] = http://curl.haxx.se/mail/lib-2014-01/0002.html [8] = http://curl.haxx.se/mail/lib-2014-01/0013.html [9] = http://curl.haxx.se/mail/lib-2014-01/0019.html [10] = http://curl.haxx.se/mail/lib-2014-01/0046.html [11] = http://curl.haxx.se/bug/view.cgi?id=1322 [12] = http://curl.haxx.se/mail/archive-2014-01/0016.html [13] = http://curl.haxx.se/mail/lib-2013-12/0150.html [14] = http://curl.haxx.se/mail/lib-2014-01/0061.html [15] = http://curl.haxx.se/bug/view.cgi?id=1323 [16] = http://curl.haxx.se/mail/lib-2014-01/0115.html [17] = http://curl.haxx.se/mail/lib-2014-01/0134.html [18] = http://curl.haxx.se/bug/view.cgi?id=1321 [19] = http://curl.haxx.se/mail/archive-2014-01/0000.html [20] = http://curl.haxx.se/mail/lib-2014-01/0130.html [21] = http://curl.haxx.se/mail/lib-2014-01/0103.html [22] = https://github.com/bagder/curl/pull/87 [23] = http://curl.haxx.se/mail/lib-2014-01/0246.html [24] = http://curl.haxx.se/bug/view.cgi?id=1327 [25] = http://curl.haxx.se/docs/adv_20140129.html curl-7.35.0/src/0000755000175000017500000000000012272124477010353 500000000000000curl-7.35.0/src/tool_cfgable.c0000644000175000017500000000761212262353672013065 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #include "tool_cfgable.h" #include "memdebug.h" /* keep this as LAST include */ void free_config_fields(struct Configurable *config) { struct getout *urlnode; if(config->easy) { curl_easy_cleanup(config->easy); config->easy = NULL; } Curl_safefree(config->random_file); Curl_safefree(config->egd_file); Curl_safefree(config->useragent); Curl_safefree(config->cookie); Curl_safefree(config->cookiejar); Curl_safefree(config->cookiefile); Curl_safefree(config->postfields); Curl_safefree(config->referer); Curl_safefree(config->headerfile); Curl_safefree(config->ftpport); Curl_safefree(config->iface); Curl_safefree(config->range); Curl_safefree(config->userpwd); Curl_safefree(config->tls_username); Curl_safefree(config->tls_password); Curl_safefree(config->tls_authtype); Curl_safefree(config->proxyuserpwd); Curl_safefree(config->proxy); Curl_safefree(config->dns_ipv6_addr); Curl_safefree(config->dns_ipv4_addr); Curl_safefree(config->dns_interface); Curl_safefree(config->dns_servers); Curl_safefree(config->noproxy); Curl_safefree(config->mail_from); curl_slist_free_all(config->mail_rcpt); Curl_safefree(config->mail_auth); Curl_safefree(config->netrc_file); urlnode = config->url_list; while(urlnode) { struct getout *next = urlnode->next; Curl_safefree(urlnode->url); Curl_safefree(urlnode->outfile); Curl_safefree(urlnode->infile); Curl_safefree(urlnode); urlnode = next; } config->url_list = NULL; config->url_last = NULL; config->url_get = NULL; config->url_out = NULL; Curl_safefree(config->cipher_list); Curl_safefree(config->cert); Curl_safefree(config->cert_type); Curl_safefree(config->cacert); Curl_safefree(config->capath); Curl_safefree(config->crlfile); Curl_safefree(config->key); Curl_safefree(config->key_type); Curl_safefree(config->key_passwd); Curl_safefree(config->pubkey); Curl_safefree(config->hostpubmd5); Curl_safefree(config->engine); Curl_safefree(config->customrequest); Curl_safefree(config->krblevel); Curl_safefree(config->trace_dump); Curl_safefree(config->xoauth2_bearer); config->trace_stream = NULL; /* closed elsewhere when appropriate */ Curl_safefree(config->writeout); config->errors = NULL; /* closed elsewhere when appropriate */ curl_slist_free_all(config->quote); curl_slist_free_all(config->postquote); curl_slist_free_all(config->prequote); curl_slist_free_all(config->headers); if(config->httppost) { curl_formfree(config->httppost); config->httppost = NULL; } config->last_post = NULL; curl_slist_free_all(config->telnet_options); curl_slist_free_all(config->resolve); Curl_safefree(config->socksproxy); Curl_safefree(config->socks5_gssapi_service); Curl_safefree(config->ftp_account); Curl_safefree(config->ftp_alternative_to_user); Curl_safefree(config->libcurl); } curl-7.35.0/src/tool_hugehelp.h0000644000175000017500000000224112213173003013261 00000000000000#ifndef HEADER_CURL_TOOL_HUGEHELP_H #define HEADER_CURL_TOOL_HUGEHELP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" void hugehelp(void); #endif /* HEADER_CURL_TOOL_HUGEHELP_H */ curl-7.35.0/src/tool_setup.h0000644000175000017500000000452712213173003012631 00000000000000#ifndef HEADER_CURL_TOOL_SETUP_H #define HEADER_CURL_TOOL_SETUP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #define CURL_NO_OLDIES /* * curl_setup.h may define preprocessor macros such as _FILE_OFFSET_BITS and * _LARGE_FILES in order to support files larger than 2 GB. On platforms * where this happens it is mandatory that these macros are defined before * any system header file is included, otherwise file handling function * prototypes will be misdeclared and curl tool may not build properly; * therefore we must include curl_setup.h before curl.h when building curl. */ #include "curl_setup.h" /* from the lib directory */ /* * curl tool certainly uses libcurl's external interface. */ #include /* external interface */ /* * Platform specific stuff. */ #if defined(macintosh) && defined(__MRC__) # define main(x,y) curl_main(x,y) #endif #ifdef TPF # undef select /* change which select is used for the curl command line tool */ # define select(a,b,c,d,e) tpf_select_bsd(a,b,c,d,e) /* and turn off the progress meter */ # define CONF_DEFAULT (0|CONF_NOPROGRESS) #endif #ifndef OS # define OS "unknown" #endif #ifndef UNPRINTABLE_CHAR /* define what to use for unprintable characters */ # define UNPRINTABLE_CHAR '.' #endif #ifndef HAVE_STRDUP # include "strdup.h" # define strdup(ptr) curlx_strdup(ptr) #endif #endif /* HEADER_CURL_TOOL_SETUP_H */ curl-7.35.0/src/tool_panykey.c0000644000175000017500000000265512213173003013144 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #if defined(__SYMBIAN32__) || defined(NETWARE) #ifdef NETWARE # ifdef __NOVELL_LIBC__ # include # else # include # endif #endif #include "tool_panykey.h" #include "memdebug.h" /* keep this as LAST include */ void tool_pressanykey(void) { #if defined(__SYMBIAN32__) getchar(); #elif defined(NETWARE) pressanykey(); #endif } #endif /* __SYMBIAN32__ || NETWARE */ curl-7.35.0/src/tool_binmode.h0000644000175000017500000000240712213173003013101 00000000000000#ifndef HEADER_CURL_TOOL_BINMODE_H #define HEADER_CURL_TOOL_BINMODE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #ifdef HAVE_SETMODE void set_binmode(FILE *stream); #else #define set_binmode(x) Curl_nop_stmt #endif /* HAVE_SETMODE */ #endif /* HEADER_CURL_TOOL_BINMODE_H */ curl-7.35.0/src/tool_cfgable.h0000644000175000017500000001736212262353672013075 00000000000000#ifndef HEADER_CURL_TOOL_CFGABLE_H #define HEADER_CURL_TOOL_CFGABLE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "tool_setup.h" #include "tool_sdecls.h" #include "tool_metalink.h" struct Configurable { CURL *easy; /* once we have one, we keep it here */ 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 */ bool tr_encoding; /* Transfer-Encoding please */ unsigned long authtype; /* auth bitmask */ bool use_resume; bool resume_from_current; bool disable_epsv; bool disable_eprt; bool ftp_pret; long proto; bool proto_present; long proto_redir; bool proto_redir_present; curl_off_t resume_from; char *postfields; curl_off_t postfieldsize; char *referer; double timeout; double 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; char *dns_servers; /* dot notation: 1.1.1.1;2.2.2.2 */ char *dns_interface; /* interface name */ char *dns_ipv4_addr; /* dot notation */ char *dns_ipv6_addr; /* dot notation */ int showerror; /* -1 == unset, default => show errors 0 => -s is used to NOT show errors 1 => -S has been used to show errors */ char *userpwd; char *login_options; char *tls_username; char *tls_password; char *tls_authtype; char *proxyuserpwd; char *proxy; int proxyver; /* set to CURLPROXY_HTTP* define */ char *noproxy; char *mail_from; struct curl_slist *mail_rcpt; char *mail_auth; bool sasl_ir; /* Enable/disable SASL initial response */ bool proxytunnel; bool ftp_append; /* APPE on ftp */ bool mute; /* don't show messages, --silent given */ bool use_ascii; /* select ascii or text transfer */ bool autoreferer; /* automatically set referer */ bool failonerror; /* fail on (HTTP) errors */ bool include_headers; /* send headers to data output */ bool no_body; /* don't get the body */ bool dirlistonly; /* only get the FTP dir list */ bool followlocation; /* follow http redirects */ bool unrestricted_auth; /* Continue to send authentication (user+password) when following ocations, even when hostname changed */ bool netrc_opt; bool netrc; char *netrc_file; bool noprogress; /* don't show progress meter, --silent given */ bool isatty; /* updated internally only if output is a tty */ 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 *crlfile; char *key; char *key_type; char *key_passwd; char *pubkey; char *hostpubmd5; char *engine; bool list_engines; bool crlf; char *customrequest; char *krblevel; 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; int progressmode; /* CURL_PROGRESS_BAR or CURL_PROGRESS_STATS */ bool nobuffer; bool readbusy; /* set when reading input returns EAGAIN */ 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 proxynegotiate; 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; /* errors stream, defaults to stderr */ bool errors_fopened; /* whether errors stream isn't stderr */ 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; struct curl_slist *resolve; HttpReq httpreq; /* for bandwidth limiting features: */ curl_off_t sendpersecond; /* send to peer */ curl_off_t recvpersecond; /* receive from peer */ bool ftp_ssl; bool ftp_ssl_reqd; bool ftp_ssl_control; bool ftp_ssl_ccc; int ftp_ssl_ccc_mode; char *socksproxy; /* set to server string */ int socksver; /* set to CURLPROXY_SOCKS* define */ char *socks5_gssapi_service; /* set service name for gssapi principal * default rcmd */ int socks5_gssapi_nec ; /* The NEC reference server does not protect * the encryption type exchange */ 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; long tftp_blksize; /* TFTP BLKSIZE option */ bool ignorecl; /* --ignore-content-length */ bool disable_sessionid; char *libcurl; /* output libcurl code to this file name */ bool raw; bool post301; bool post302; bool post303; bool nokeepalive; /* for keepalive needs */ long alivetime; bool content_disposition; /* use Content-disposition filename */ int default_node_flags; /* default flags to search for each 'node', which is basically each given URL to transfer */ bool xattr; /* store metadata in extended attributes */ long gssapi_delegation; bool ssl_allow_beast; /* allow this SSL vulnerability */ bool use_metalink; /* process given URLs as metalink XML file */ metalinkfile *metalinkfile_list; /* point to the first node */ metalinkfile *metalinkfile_last; /* point to the last/current node */ #ifdef CURLDEBUG bool test_event_based; #endif char *xoauth2_bearer; /* XOAUTH2 bearer token */ }; /* struct Configurable */ void free_config_fields(struct Configurable *config); #endif /* HEADER_CURL_TOOL_CFGABLE_H */ curl-7.35.0/src/tool_cb_hdr.h0000644000175000017500000000365512213173003012713 00000000000000#ifndef HEADER_CURL_TOOL_CB_HDR_H #define HEADER_CURL_TOOL_CB_HDR_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" /* * curl operates using a single HdrCbData struct variable, a * pointer to this is passed as userdata pointer to tool_header_cb. * * 'outs' member is a pointer to the OutStruct variable used to keep * track of information relative to curl's output writing. * * 'heads' member is a pointer to the OutStruct variable used to keep * track of information relative to header response writing. * * 'honor_cd_filename' member is TRUE when tool_header_cb is allowed * to honor Content-Disposition filename property and accordingly * set 'outs' filename, otherwise FALSE; */ struct HdrCbData { struct OutStruct *outs; struct OutStruct *heads; bool honor_cd_filename; }; /* ** callback for CURLOPT_HEADERFUNCTION */ size_t tool_header_cb(void *ptr, size_t size, size_t nmemb, void *userdata); #endif /* HEADER_CURL_TOOL_CB_HDR_H */ curl-7.35.0/src/Makefile.inc0000644000175000017500000000406512213173003012470 00000000000000# ./src/Makefile.inc # Using the backslash as line continuation character might be problematic # with some make flavours, as Watcom's wmake showed us already. If we # ever want to change this in a portable manner then we should consider # this idea (posted to the libcurl list by Adam Kellas): # CSRC1 = file1.c file2.c file3.c # CSRC2 = file4.c file5.c file6.c # CSOURCES = $(CSRC1) $(CSRC2) # 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 = \ ../lib/strtoofft.c \ ../lib/strdup.c \ ../lib/rawstr.c \ ../lib/nonblock.c CURL_CFILES = \ tool_binmode.c \ tool_bname.c \ tool_cb_dbg.c \ tool_cb_hdr.c \ tool_cb_prg.c \ tool_cb_rea.c \ tool_cb_see.c \ tool_cb_wrt.c \ tool_cfgable.c \ tool_convert.c \ tool_dirhie.c \ tool_doswin.c \ tool_easysrc.c \ tool_formparse.c \ tool_getparam.c \ tool_getpass.c \ tool_help.c \ tool_helpers.c \ tool_homedir.c \ tool_hugehelp.c \ tool_libinfo.c \ tool_main.c \ tool_metalink.c \ tool_mfiles.c \ tool_msgs.c \ tool_operate.c \ tool_operhlp.c \ tool_panykey.c \ tool_paramhlp.c \ tool_parsecfg.c \ tool_setopt.c \ tool_sleep.c \ tool_urlglob.c \ tool_util.c \ tool_vms.c \ tool_writeenv.c \ tool_writeout.c \ tool_xattr.c CURL_HFILES = \ tool_binmode.h \ tool_bname.h \ tool_cb_dbg.h \ tool_cb_hdr.h \ tool_cb_prg.h \ tool_cb_rea.h \ tool_cb_see.h \ tool_cb_wrt.h \ tool_cfgable.h \ tool_convert.h \ tool_dirhie.h \ tool_doswin.h \ tool_easysrc.h \ tool_formparse.h \ tool_getparam.h \ tool_getpass.h \ tool_help.h \ tool_helpers.h \ tool_homedir.h \ tool_hugehelp.h \ tool_libinfo.h \ tool_main.h \ tool_metalink.h \ tool_mfiles.h \ tool_msgs.h \ tool_operate.h \ tool_operhlp.h \ tool_panykey.h \ tool_paramhlp.h \ tool_parsecfg.h \ tool_sdecls.h \ tool_setopt.h \ tool_setup.h \ tool_sleep.h \ tool_urlglob.h \ tool_util.h \ tool_version.h \ tool_vms.h \ tool_writeenv.h \ tool_writeout.h \ tool_xattr.h curl_SOURCES = $(CURL_CFILES) $(CURLX_ONES) $(CURL_HFILES) curl-7.35.0/src/tool_convert.h0000644000175000017500000000306212213173003013142 00000000000000#ifndef HEADER_CURL_TOOL_CONVERT_H #define HEADER_CURL_TOOL_CONVERT_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #ifdef CURL_DOES_CONVERSIONS #ifdef HAVE_ICONV CURLcode convert_to_network(char *buffer, size_t length); CURLcode convert_from_network(char *buffer, size_t length); void convert_cleanup(void); #endif /* HAVE_ICONV */ char convert_char(curl_infotype infotype, char this_char); #endif /* CURL_DOES_CONVERSIONS */ #if !defined(CURL_DOES_CONVERSIONS) || !defined(HAVE_ICONV) #define convert_cleanup() Curl_nop_stmt #endif #endif /* HEADER_CURL_TOOL_CONVERT_H */ curl-7.35.0/src/makefile.dj0000644000175000017500000000247712213173003012361 00000000000000# # Adapted for djgpp2 / Watt-32 / DOS by # Gisle Vanem # DEPEND_PREREQ = # tool_hugehelp.c TOPDIR = .. include ../packages/DOS/common.dj include Makefile.inc CSOURCES = $(CURL_CFILES) ifeq ($(USE_SSL),1) EX_LIBS += $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a endif ifeq ($(USE_ARES),1) EX_LIBS += $(ARES_ROOT)/libcares.a endif ifeq ($(USE_ZLIB),1) EX_LIBS += $(ZLIB_ROOT)/libz.a CFLAGS += -DUSE_MANUAL endif ifeq ($(USE_IDNA),1) EX_LIBS += $(LIBIDN_ROOT)/lib/dj_obj/libidn.a -liconv endif EX_LIBS += $(WATT32_ROOT)/lib/libwatt.a CFLAGS += -DUSE_ENVIRONMENT PROGRAM = curl.exe OBJECTS += $(addprefix $(OBJ_DIR)/, $(CSOURCES:.c=.o)) all: $(OBJ_DIR) $(PROGRAM) @echo Welcome to cURL $(PROGRAM): $(OBJECTS) ../lib/libcurl.a $(CC) -o $@ $^ $(LDFLAGS) $(EX_LIBS) # # groff 1.18+ requires "-P -c" # tool_hugehelp.c: ../docs/MANUAL ../docs/curl.1 mkhelp.pl groff -Tascii -man ../docs/curl.1 | \ perl -w mkhelp.pl ../docs/MANUAL > $@ # clean generated files # genclean: - $(DELETE) tool_hugehelp.c # clean object files and subdir # objclean: genclean - $(DELETE) $(OBJ_DIR)$(DS)*.o - $(RMDIR) $(OBJ_DIR) # clean without removing built program # clean: objclean - $(DELETE) depend.dj # clean everything # realclean vclean: clean - $(DELETE) $(PROGRAM) -include depend.dj curl-7.35.0/src/version.h0000644000175000017500000000265012272124477012134 00000000000000#ifndef HEADER_CURL_VERSION_H #define HEADER_CURL_VERSION_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, 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. * ***************************************************************************/ #include #define CURL_NAME "curl" #define CURL_COPYRIGHT LIBCURL_COPYRIGHT #define CURL_VERSION "7.22.0" #define CURL_VERSION_MAJOR LIBCURL_VERSION_MAJOR #define CURL_VERSION_MINOR LIBCURL_VERSION_MINOR #define CURL_VERSION_PATCH LIBCURL_VERSION_PATCH #define CURL_ID CURL_NAME " " CURL_VERSION " (" OS ") " #endif /* HEADER_CURL_VERSION_H */ curl-7.35.0/src/tool_operhlp.h0000644000175000017500000000324112213173003013132 00000000000000#ifndef HEADER_CURL_TOOL_OPERHLP_H #define HEADER_CURL_TOOL_OPERHLP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" char *my_useragent(void); void list_engines(const struct curl_slist *engines); void clean_getout(struct Configurable *config); bool output_expected(const char *url, const char *uploadfile); bool stdin_upload(const char *uploadfile); char *add_file_name_to_url(CURL *curl, char *url, const char *filename); CURLcode get_url_file_name(char **filename, const char *url); CURLcode main_init(void); void main_free(void); #ifdef CURLDEBUG void memory_tracking_init(void); #else # define memory_tracking_init() Curl_nop_stmt #endif #endif /* HEADER_CURL_TOOL_OPERHLP_H */ curl-7.35.0/src/tool_helpers.h0000644000175000017500000000237212213173003013127 00000000000000#ifndef HEADER_CURL_TOOL_HELPERS_H #define HEADER_CURL_TOOL_HELPERS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" const char *param2text(int res); int SetHTTPrequest(struct Configurable *config, HttpReq req, HttpReq *store); #endif /* HEADER_CURL_TOOL_HELPERS_H */ curl-7.35.0/src/tool_cb_dbg.c0000644000175000017500000002013412213173003012654 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" #include "tool_msgs.h" #include "tool_cb_dbg.h" #include "tool_util.h" #include "memdebug.h" /* keep this as LAST include */ static void dump(const char *timebuf, const char *text, FILE *stream, const unsigned char *ptr, size_t size, trace tracetype, curl_infotype infotype); /* ** callback for CURLOPT_DEBUGFUNCTION */ int tool_debug_cb(CURL *handle, curl_infotype type, unsigned char *data, size_t size, void *userdata) { struct Configurable *config = userdata; FILE *output = config->errors; const char *text; struct timeval tv; struct tm *now; char timebuf[20]; time_t secs; static time_t epoch_offset; static int known_offset; (void)handle; /* not used */ if(config->tracetime) { tv = tvnow(); if(!known_offset) { epoch_offset = time(NULL) - tv.tv_sec; known_offset = 1; } secs = epoch_offset + tv.tv_sec; now = localtime(&secs); /* not thread safe but we don't care */ snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld ", now->tm_hour, now->tm_min, now->tm_sec, (long)tv.tv_usec); } else timebuf[0] = 0; if(!config->trace_stream) { /* open for append */ if(curlx_strequal("-", config->trace_dump)) config->trace_stream = stdout; else if(curlx_strequal("%", config->trace_dump)) /* Ok, this is somewhat hackish but we do it undocumented for now */ config->trace_stream = config->errors; /* aka stderr */ else { config->trace_stream = fopen(config->trace_dump, "w"); config->trace_fopened = TRUE; } } if(config->trace_stream) output = config->trace_stream; if(!output) { warnf(config, "Failed to create/open output"); return 0; } if(config->tracetype == TRACE_PLAIN) { /* * This is the trace look that is similar to what libcurl makes on its * own. */ static const char * const s_infotype[] = { "*", "<", ">", "{", "}", "{", "}" }; size_t i; size_t st = 0; static bool newl = FALSE; static bool traced_data = FALSE; switch(type) { case CURLINFO_HEADER_OUT: if(size > 0) { for(i = 0; i < size - 1; i++) { if(data[i] == '\n') { /* LF */ if(!newl) { fprintf(output, "%s%s ", timebuf, s_infotype[type]); } (void)fwrite(data + st, i - st + 1, 1, output); st = i + 1; newl = FALSE; } } if(!newl) fprintf(output, "%s%s ", timebuf, s_infotype[type]); (void)fwrite(data + st, i - st + 1, 1, output); } newl = (size && (data[size - 1] != '\n')) ? TRUE : FALSE; traced_data = FALSE; break; case CURLINFO_TEXT: case CURLINFO_HEADER_IN: if(!newl) fprintf(output, "%s%s ", timebuf, s_infotype[type]); (void)fwrite(data, size, 1, output); newl = (size && (data[size - 1] != '\n')) ? TRUE : FALSE; traced_data = FALSE; break; case CURLINFO_DATA_OUT: case CURLINFO_DATA_IN: case CURLINFO_SSL_DATA_IN: case CURLINFO_SSL_DATA_OUT: if(!traced_data) { /* if the data is output to a tty and we're sending this debug trace to stderr or stdout, we don't display the alert about the data not being shown as the data _is_ shown then just not via this function */ if(!config->isatty || ((output != stderr) && (output != stdout))) { if(!newl) fprintf(output, "%s%s ", timebuf, s_infotype[type]); fprintf(output, "[data not shown]\n"); newl = FALSE; traced_data = TRUE; } } break; default: /* nada */ newl = FALSE; traced_data = FALSE; break; } return 0; } #ifdef CURL_DOES_CONVERSIONS /* Special processing is needed for CURLINFO_HEADER_OUT blocks * if they contain both headers and data (separated by CRLFCRLF). * We dump the header text and then switch type to CURLINFO_DATA_OUT. */ if((type == CURLINFO_HEADER_OUT) && (size > 4)) { size_t i; for(i = 0; i < size - 4; i++) { if(memcmp(&data[i], "\r\n\r\n", 4) == 0) { /* dump everything through the CRLFCRLF as a sent header */ text = "=> Send header"; dump(timebuf, text, output, data, i + 4, config->tracetype, type); data += i + 3; size -= i + 4; type = CURLINFO_DATA_OUT; data += 1; break; } } } #endif /* CURL_DOES_CONVERSIONS */ switch (type) { case CURLINFO_TEXT: fprintf(output, "%s== Info: %s", timebuf, data); default: /* in case a new one is introduced to shock us */ return 0; case CURLINFO_HEADER_OUT: text = "=> Send header"; break; case CURLINFO_DATA_OUT: text = "=> Send data"; break; case CURLINFO_HEADER_IN: text = "<= Recv header"; break; case CURLINFO_DATA_IN: text = "<= Recv data"; break; case CURLINFO_SSL_DATA_IN: text = "<= Recv SSL data"; break; case CURLINFO_SSL_DATA_OUT: text = "=> Send SSL data"; break; } dump(timebuf, text, output, data, size, config->tracetype, type); return 0; } static void dump(const char *timebuf, const char *text, FILE *stream, const unsigned char *ptr, size_t size, trace tracetype, curl_infotype infotype) { size_t i; size_t c; unsigned int width = 0x10; if(tracetype == TRACE_ASCII) /* without the hex output, we can fit more on screen */ width = 0x40; fprintf(stream, "%s%s, %zd bytes (0x%zx)\n", timebuf, text, size, size); for(i = 0; i < size; i += width) { fprintf(stream, "%04zx: ", i); if(tracetype == TRACE_BIN) { /* hex not disabled, show it */ for(c = 0; c < width; c++) if(i+c < size) fprintf(stream, "%02x ", ptr[i+c]); else fputs(" ", stream); } for(c = 0; (c < width) && (i+c < size); c++) { /* check for 0D0A; if found, skip past and start a new line of output */ if((tracetype == TRACE_ASCII) && (i+c+1 < size) && (ptr[i+c] == 0x0D) && (ptr[i+c+1] == 0x0A)) { i += (c+2-width); break; } #ifdef CURL_DOES_CONVERSIONS /* repeat the 0D0A check above but use the host encoding for CRLF */ if((tracetype == TRACE_ASCII) && (i+c+1 < size) && (ptr[i+c] == '\r') && (ptr[i+c+1] == '\n')) { i += (c+2-width); break; } /* convert to host encoding and print this character */ fprintf(stream, "%c", convert_char(infotype, ptr[i+c])); #else (void)infotype; fprintf(stream, "%c", ((ptr[i+c] >= 0x20) && (ptr[i+c] < 0x80)) ? ptr[i+c] : UNPRINTABLE_CHAR); #endif /* CURL_DOES_CONVERSIONS */ /* check again for 0D0A, to avoid an extra \n if it's at width */ if((tracetype == TRACE_ASCII) && (i+c+2 < size) && (ptr[i+c+1] == 0x0D) && (ptr[i+c+2] == 0x0A)) { i += (c+3-width); break; } } fputc('\n', stream); /* newline */ } fflush(stream); } curl-7.35.0/src/tool_version.h0000644000175000017500000000266612272124477013200 00000000000000#ifndef HEADER_CURL_TOOL_VERSION_H #define HEADER_CURL_TOOL_VERSION_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include #define CURL_NAME "curl" #define CURL_COPYRIGHT LIBCURL_COPYRIGHT #define CURL_VERSION "7.35.0" #define CURL_VERSION_MAJOR LIBCURL_VERSION_MAJOR #define CURL_VERSION_MINOR LIBCURL_VERSION_MINOR #define CURL_VERSION_PATCH LIBCURL_VERSION_PATCH #define CURL_ID CURL_NAME " " CURL_VERSION " (" OS ") " #endif /* HEADER_CURL_TOOL_VERSION_H */ curl-7.35.0/src/tool_bname.c0000644000175000017500000000264212213173003012542 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #include "tool_bname.h" #include "memdebug.h" /* keep this as LAST include */ #ifndef HAVE_BASENAME char *tool_basename(char *path) { char *s1; char *s2; s1 = strrchr(path, '/'); s2 = strrchr(path, '\\'); if(s1 && s2) { path = (s1 > s2) ? s1 + 1 : s2 + 1; } else if(s1) path = s1 + 1; else if(s2) path = s2 + 1; return path; } #endif /* HAVE_BASENAME */ curl-7.35.0/src/tool_paramhlp.c0000644000175000017500000003047312270035364013301 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include "tool_setup.h" #include "rawstr.h" #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" #include "tool_getparam.h" #include "tool_getpass.h" #include "tool_homedir.h" #include "tool_msgs.h" #include "tool_paramhlp.h" #include "memdebug.h" /* keep this as LAST include */ struct getout *new_getout(struct Configurable *config) { struct getout *node = calloc(1, sizeof(struct getout)); struct getout *last = config->url_last; if(node) { /* append this new node last in the list */ if(last) last->next = node; else config->url_list = node; /* first node */ /* move the last pointer */ config->url_last = node; node->flags = config->default_node_flags; } return node; } ParameterError file2string(char **bufp, FILE *file) { char buffer[256]; char *ptr; char *string = NULL; size_t stringlen = 0; size_t buflen; if(file) { while(fgets(buffer, sizeof(buffer), file)) { if((ptr = strchr(buffer, '\r')) != NULL) *ptr = '\0'; if((ptr = strchr(buffer, '\n')) != NULL) *ptr = '\0'; buflen = strlen(buffer); if((ptr = realloc(string, stringlen+buflen+1)) == NULL) { Curl_safefree(string); return PARAM_NO_MEM; } string = ptr; strcpy(string+stringlen, buffer); stringlen += buflen; } } *bufp = string; return PARAM_OK; } ParameterError file2memory(char **bufp, size_t *size, FILE *file) { char *newbuf; char *buffer = NULL; size_t alloc = 512; size_t nused = 0; size_t nread; if(file) { do { if(!buffer || (alloc == nused)) { /* size_t overflow detection for huge files */ if(alloc+1 > ((size_t)-1)/2) { Curl_safefree(buffer); return PARAM_NO_MEM; } alloc *= 2; /* allocate an extra char, reserved space, for null termination */ if((newbuf = realloc(buffer, alloc+1)) == NULL) { Curl_safefree(buffer); return PARAM_NO_MEM; } buffer = newbuf; } nread = fread(buffer+nused, 1, alloc-nused, file); nused += nread; } while(nread); /* null terminate the buffer in case it's used as a string later */ buffer[nused] = '\0'; /* free trailing slack space, if possible */ if(alloc != nused) { if((newbuf = realloc(buffer, nused+1)) == NULL) { Curl_safefree(buffer); return PARAM_NO_MEM; } buffer = newbuf; } /* discard buffer if nothing was read */ if(!nused) { Curl_safefree(buffer); /* no string */ } } *size = nused; *bufp = buffer; return PARAM_OK; } void cleanarg(char *str) { #ifdef HAVE_WRITABLE_ARGV /* now that GetStr has copied the contents of nextarg, wipe the next * argument out so that the username:password isn't displayed in the * system process list */ if(str) { size_t len = strlen(str); memset(str, ' ', len); } #else (void)str; #endif } /* * Parse the string and write the long in the given address. Return PARAM_OK * on success, otherwise a parameter specific error enum. * * Since this function gets called with the 'nextarg' pointer from within the * getparameter a lot, we must check it for NULL before accessing the str * data. */ ParameterError str2num(long *val, const char *str) { if(str) { char *endptr; long num = strtol(str, &endptr, 10); if((endptr != str) && (endptr == str + strlen(str))) { *val = num; return PARAM_OK; /* Ok */ } } return PARAM_BAD_NUMERIC; /* badness */ } /* * Parse the string and write the long in the given address. Return PARAM_OK * on success, otherwise a parameter error enum. ONLY ACCEPTS POSITIVE NUMBERS! * * Since this function gets called with the 'nextarg' pointer from within the * getparameter a lot, we must check it for NULL before accessing the str * data. */ ParameterError str2unum(long *val, const char *str) { ParameterError result = str2num(val, str); if(result != PARAM_OK) return result; if(*val < 0) return PARAM_NEGATIVE_NUMERIC; return PARAM_OK; } /* * Parse the string and write the double in the given address. Return PARAM_OK * on success, otherwise a parameter specific error enum. * * Since this function gets called with the 'nextarg' pointer from within the * getparameter a lot, we must check it for NULL before accessing the str * data. */ ParameterError str2double(double *val, const char *str) { if(str) { char *endptr; double num = strtod(str, &endptr); if((endptr != str) && (endptr == str + strlen(str))) { *val = num; return PARAM_OK; /* Ok */ } } return PARAM_BAD_NUMERIC; /* badness */ } /* * Parse the string and write the double in the given address. Return PARAM_OK * on success, otherwise a parameter error enum. ONLY ACCEPTS POSITIVE NUMBERS! * * Since this function gets called with the 'nextarg' pointer from within the * getparameter a lot, we must check it for NULL before accessing the str * data. */ ParameterError str2udouble(double *val, const char *str) { ParameterError result = str2double(val, str); if(result != PARAM_OK) return result; if(*val < 0) return PARAM_NEGATIVE_NUMERIC; return PARAM_OK; } /* * Parse the string and modify the long in the given address. Return * non-zero on failure, zero on success. * * The string is a list of protocols * * Since this function gets called with the 'nextarg' pointer from within the * getparameter a lot, we must check it for NULL before accessing the str * data. */ long proto2num(struct Configurable *config, long *val, const char *str) { char *buffer; const char *sep = ","; char *token; static struct sprotos { const char *name; long bit; } const protos[] = { { "all", CURLPROTO_ALL }, { "http", CURLPROTO_HTTP }, { "https", CURLPROTO_HTTPS }, { "ftp", CURLPROTO_FTP }, { "ftps", CURLPROTO_FTPS }, { "scp", CURLPROTO_SCP }, { "sftp", CURLPROTO_SFTP }, { "telnet", CURLPROTO_TELNET }, { "ldap", CURLPROTO_LDAP }, { "ldaps", CURLPROTO_LDAPS }, { "dict", CURLPROTO_DICT }, { "file", CURLPROTO_FILE }, { "tftp", CURLPROTO_TFTP }, { "imap", CURLPROTO_IMAP }, { "imaps", CURLPROTO_IMAPS }, { "pop3", CURLPROTO_POP3 }, { "pop3s", CURLPROTO_POP3S }, { "smtp", CURLPROTO_SMTP }, { "smtps", CURLPROTO_SMTPS }, { "rtsp", CURLPROTO_RTSP }, { "gopher", CURLPROTO_GOPHER }, { NULL, 0 } }; if(!str) return 1; buffer = strdup(str); /* because strtok corrupts it */ if(!buffer) return 1; for(token = strtok(buffer, sep); token; token = strtok(NULL, sep)) { enum e_action { allow, deny, set } action = allow; struct sprotos const *pp; /* Process token modifiers */ while(!ISALNUM(*token)) { /* may be NULL if token is all modifiers */ switch (*token++) { case '=': action = set; break; case '-': action = deny; break; case '+': action = allow; break; default: /* Includes case of terminating NULL */ Curl_safefree(buffer); return 1; } } for(pp=protos; pp->name; pp++) { if(curlx_raw_equal(token, pp->name)) { switch (action) { case deny: *val &= ~(pp->bit); break; case allow: *val |= pp->bit; break; case set: *val = pp->bit; break; } break; } } if(!(pp->name)) { /* unknown protocol */ /* If they have specified only this protocol, we say treat it as if no protocols are allowed */ if(action == set) *val = 0; warnf(config, "unrecognized protocol '%s'\n", token); } } Curl_safefree(buffer); return 0; } /** * Parses the given string looking for an offset (which may be a * larger-than-integer value). The offset CANNOT be negative! * * @param val the offset to populate * @param str the buffer containing the offset * @return PARAM_OK if successful, a parameter specific error enum if failure. */ ParameterError str2offset(curl_off_t *val, const char *str) { char *endptr; if(str[0] == '-') /* offsets aren't negative, this indicates weird input */ return PARAM_NEGATIVE_NUMERIC; #if(CURL_SIZEOF_CURL_OFF_T > CURL_SIZEOF_LONG) *val = curlx_strtoofft(str, &endptr, 0); if((*val == CURL_OFF_T_MAX || *val == CURL_OFF_T_MIN) && (ERRNO == ERANGE)) return PARAM_BAD_NUMERIC; #else *val = strtol(str, &endptr, 0); if((*val == LONG_MIN || *val == LONG_MAX) && ERRNO == ERANGE) return PARAM_BAD_NUMERIC; #endif if((endptr != str) && (endptr == str + strlen(str))) return PARAM_OK; return PARAM_BAD_NUMERIC; } CURLcode checkpasswd(const char *kind, /* for what purpose */ char **userpwd) /* pointer to allocated string */ { char *psep; char *osep; if(!*userpwd) return CURLE_OK; /* Attempt to find the password separator */ psep = strchr(*userpwd, ':'); /* Attempt to find the options separator */ osep = strchr(*userpwd, ';'); if(!psep && **userpwd != ';') { /* no password present, prompt for one */ char passwd[256] = ""; char prompt[256]; size_t passwdlen; size_t userlen = strlen(*userpwd); char *passptr; if(osep) *osep = '\0'; /* build a nice-looking prompt */ curlx_msnprintf(prompt, sizeof(prompt), "Enter %s password for user '%s':", kind, *userpwd); /* get password */ getpass_r(prompt, passwd, sizeof(passwd)); passwdlen = strlen(passwd); if(osep) *osep = ';'; /* extend the allocated memory area to fit the password too */ passptr = realloc(*userpwd, passwdlen + 1 + /* an extra for the colon */ userlen + 1); /* an extra for the zero */ if(!passptr) return CURLE_OUT_OF_MEMORY; /* append the password separated with a colon */ passptr[userlen] = ':'; memcpy(&passptr[userlen+1], passwd, passwdlen+1); *userpwd = passptr; } return CURLE_OK; } ParameterError add2list(struct curl_slist **list, const char *ptr) { struct curl_slist *newlist = curl_slist_append(*list, ptr); if(newlist) *list = newlist; else return PARAM_NO_MEM; return PARAM_OK; } int ftpfilemethod(struct Configurable *config, const char *str) { if(curlx_raw_equal("singlecwd", str)) return CURLFTPMETHOD_SINGLECWD; if(curlx_raw_equal("nocwd", str)) return CURLFTPMETHOD_NOCWD; if(curlx_raw_equal("multicwd", str)) return CURLFTPMETHOD_MULTICWD; warnf(config, "unrecognized ftp file method '%s', using default\n", str); return CURLFTPMETHOD_MULTICWD; } int ftpcccmethod(struct Configurable *config, const char *str) { if(curlx_raw_equal("passive", str)) return CURLFTPSSL_CCC_PASSIVE; if(curlx_raw_equal("active", str)) return CURLFTPSSL_CCC_ACTIVE; warnf(config, "unrecognized ftp CCC method '%s', using default\n", str); return CURLFTPSSL_CCC_PASSIVE; } long delegation(struct Configurable *config, char *str) { if(curlx_raw_equal("none", str)) return CURLGSSAPI_DELEGATION_NONE; if(curlx_raw_equal("policy", str)) return CURLGSSAPI_DELEGATION_POLICY_FLAG; if(curlx_raw_equal("always", str)) return CURLGSSAPI_DELEGATION_FLAG; warnf(config, "unrecognized delegation method '%s', using none\n", str); return CURLGSSAPI_DELEGATION_NONE; } curl-7.35.0/src/tool_homedir.c0000644000175000017500000000527512213173003013114 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #ifdef HAVE_PWD_H # include #endif #include "tool_homedir.h" #include "memdebug.h" /* keep this as LAST include */ 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; /* no length control */ env = getenv(variable); #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) { home = pw->pw_dir; if(home && home[0]) home = strdup(home); else home = NULL; } } #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; } curl-7.35.0/src/makefile.amiga0000644000175000017500000000133112213173003013026 00000000000000# # $VER: cURL 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 LIBS = ../lib/libcurl.a -lssl -lcrypto -lz MANPAGE = ../docs/curl.1 README = ../docs/MANUAL MKHELP = ../src/mkhelp.pl include Makefile.inc OBJS = $(CURL_CFILES:.c=.o) $(CURLX_ONES:.c=.o) all: tool_hugehelp.c $(OBJS) $(CC) $(CFLAGS) -o cURL $(OBJS) $(LIBS) -Wl,-Map,cURL.map,--cref tool_hugehelp.c: $(README) $(MANPAGE) mkhelp.pl rm -f tool_hugehelp.c /bin/nroff -man $(MANPAGE) | /bin/perl $(MKHELP) -c $(README) > tool_hugehelp.c install: $(INSTALL) -c cURL /c/cURL curl-7.35.0/src/curl.rc0000644000175000017500000000406112213173003011547 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2009, 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. * ***************************************************************************/ #include #include "tool_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 defined(DEBUGBUILD) || defined(_DEBUG) FILEFLAGS 1 #else FILEFLAGS 0 #endif FILEOS VOS__WINDOWS32 FILETYPE VFT_APP 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", "© " CURL_COPYRIGHT "\0" VALUE "License", "http://curl.haxx.se/docs/copyright.html\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END curl-7.35.0/src/tool_operhlp.c0000644000175000017500000001506012262353672013147 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "tool_setup.h" #include "rawstr.h" #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" #include "tool_convert.h" #include "tool_operhlp.h" #include "tool_version.h" #include "tool_metalink.h" #include "memdebug.h" /* keep this as LAST include */ /* * my_useragent: returns allocated string with default user agent */ char *my_useragent(void) { return strdup( CURL_NAME "/" CURL_VERSION ); } /* * Print list of OpenSSL supported engines */ void list_engines(const struct curl_slist *engines) { puts("Build-time engines:"); if(!engines) { puts(" "); return; } for(; engines; engines = engines->next) printf(" %s\n", engines->data); } void clean_getout(struct Configurable *config) { struct getout *next; struct getout *node = config->url_list; while(node) { next = node->next; Curl_safefree(node->url); Curl_safefree(node->outfile); Curl_safefree(node->infile); Curl_safefree(node); node = next; } config->url_list = NULL; } bool output_expected(const char *url, const char *uploadfile) { if(!uploadfile) return TRUE; /* download */ if(checkprefix("http://", url) || checkprefix("https://", url)) return TRUE; /* HTTP(S) upload */ return FALSE; /* non-HTTP upload, probably no output should be expected */ } bool stdin_upload(const char *uploadfile) { return (curlx_strequal(uploadfile, "-") || curlx_strequal(uploadfile, ".")) ? TRUE : FALSE; } /* * Adds the file name to the URL if it doesn't already have one. * url will be freed before return if the returned pointer is different */ char *add_file_name_to_url(CURL *curl, char *url, const char *filename) { /* If no file name part is given in the URL, we add this file name */ char *ptr = strstr(url, "://"); if(ptr) ptr += 3; else ptr = url; ptr = strrchr(ptr, '/'); if(!ptr || !strlen(++ptr)) { /* The URL has no file name part, add the local file name. In order to be able to do so, we have to create a new URL in another buffer.*/ /* We only want the part of the local path that is on the right side of the rightmost slash and backslash. */ const char *filep = strrchr(filename, '/'); char *file2 = strrchr(filep?filep:filename, '\\'); char *encfile; if(file2) filep = file2 + 1; else if(filep) filep++; else filep = filename; /* URL encode the file name */ encfile = curl_easy_escape(curl, filep, 0 /* use strlen */); if(encfile) { char *urlbuffer; if(ptr) /* there is a trailing slash on the URL */ urlbuffer = aprintf("%s%s", url, encfile); else /* there is no trailing slash on the URL */ urlbuffer = aprintf("%s/%s", url, encfile); curl_free(encfile); Curl_safefree(url); if(!urlbuffer) return NULL; url = urlbuffer; /* use our new URL instead! */ } else Curl_safefree(url); } return url; } /* Extracts the name portion of the URL. * Returns a pointer to a heap-allocated string or NULL if * no name part, at location indicated by first argument. */ CURLcode get_url_file_name(char **filename, const char *url) { const char *pc; *filename = NULL; /* Find and get the remote file name */ pc = strstr(url, "://"); if(pc) pc += 3; else pc = url; pc = strrchr(pc, '/'); if(pc) { /* duplicate the string beyond the slash */ pc++; if(*pc) { *filename = strdup(pc); if(!*filename) return CURLE_OUT_OF_MEMORY; } } /* in case we built debug enabled, we allow an environment variable * named CURL_TESTDIR to prefix the given file name to put it into a * specific directory */ #ifdef DEBUGBUILD { char *tdir = curlx_getenv("CURL_TESTDIR"); if(tdir) { char buffer[512]; /* suitably large */ snprintf(buffer, sizeof(buffer), "%s/%s", tdir, *filename); Curl_safefree(*filename); *filename = strdup(buffer); /* clone the buffer */ curl_free(tdir); } } #endif return CURLE_OK; } /* * 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. */ CURLcode main_init(void) { #if defined(__DJGPP__) || defined(__GO32__) /* stop stat() wasting time */ _djstat_flags |= _STAT_INODE | _STAT_EXEC_MAGIC | _STAT_DIRSIZE; #endif return curl_global_init(CURL_GLOBAL_DEFAULT); } /* * This is the main global destructor for the app. Call this after * _all_ libcurl usage is done. */ void main_free(void) { curl_global_cleanup(); convert_cleanup(); metalink_cleanup(); } #ifdef CURLDEBUG void memory_tracking_init(void) { char *env; /* if CURL_MEMDEBUG is set, this starts memory tracking message logging */ env = curlx_getenv("CURL_MEMDEBUG"); if(env) { /* use the value as file name */ char fname[CURL_MT_LOGFNAME_BUFSIZE]; if(strlen(env) >= CURL_MT_LOGFNAME_BUFSIZE) env[CURL_MT_LOGFNAME_BUFSIZE-1] = '\0'; strcpy(fname, env); curl_free(env); curl_memdebug(fname); /* this weird stuff here is to make curl_free() get called before curl_memdebug() as otherwise memory tracking will log a free() without an alloc! */ } /* if CURL_MEMLIMIT is set, this enables fail-on-alloc-number-N feature */ env = curlx_getenv("CURL_MEMLIMIT"); if(env) { char *endptr; long num = strtol(env, &endptr, 10); if((endptr != env) && (endptr == env + strlen(env)) && (num > 0)) curl_memlimit(num); curl_free(env); } } #endif curl-7.35.0/src/tool_doswin.c0000644000175000017500000002006212213173003012757 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #if defined(MSDOS) || defined(WIN32) #if defined(HAVE_LIBGEN_H) && defined(HAVE_BASENAME) # include #endif #ifdef WIN32 # include "tool_cfgable.h" # include "tool_libinfo.h" #endif #include "tool_bname.h" #include "tool_doswin.h" #include "memdebug.h" /* keep this as LAST include */ /* * Macros ALWAYS_TRUE and ALWAYS_FALSE are used to avoid compiler warnings. */ #define ALWAYS_TRUE (1) #define ALWAYS_FALSE (0) #if defined(_MSC_VER) && !defined(__POCC__) # undef ALWAYS_TRUE # undef ALWAYS_FALSE # if (_MSC_VER < 1500) # define ALWAYS_TRUE (0, 1) # define ALWAYS_FALSE (1, 0) # else # define ALWAYS_TRUE \ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ (1) \ __pragma(warning(pop)) # define ALWAYS_FALSE \ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ (0) \ __pragma(warning(pop)) # endif #endif #ifdef WIN32 # undef PATH_MAX # define PATH_MAX MAX_PATH #endif #ifndef S_ISCHR # ifdef S_IFCHR # define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) # else # define S_ISCHR(m) (0) /* cannot tell if file is a device */ # endif #endif #ifdef WIN32 # define _use_lfn(f) ALWAYS_TRUE /* long file names always available */ #elif !defined(__DJGPP__) || (__DJGPP__ < 2) /* DJGPP 2.0 has _use_lfn() */ # define _use_lfn(f) ALWAYS_FALSE /* long file names never available */ #elif defined(__DJGPP__) # include /* _use_lfn(f) prototype */ #endif static const char *msdosify (const char *file_name); static char *rename_if_dos_device_name (char *file_name); /* * sanitize_dos_name: returns a newly allocated string holding a * valid file name which will be a transformation of given argument * in case this wasn't already a valid file name. * * This function takes ownership of given argument, free'ing it before * returning. Caller is responsible of free'ing returned string. Upon * out of memory condition function returns NULL. */ char *sanitize_dos_name(char *file_name) { char new_name[PATH_MAX]; if(!file_name) return NULL; if(strlen(file_name) >= PATH_MAX) file_name[PATH_MAX-1] = '\0'; /* truncate it */ strcpy(new_name, msdosify(file_name)); Curl_safefree(file_name); return strdup(rename_if_dos_device_name(new_name)); } /* The following functions are taken with modification from the DJGPP * port of tar 1.12. They use algorithms originally from DJTAR. */ static const char *msdosify (const char *file_name) { static char dos_name[PATH_MAX]; static const char illegal_chars_dos[] = ".+, ;=[]" /* illegal in DOS */ "|<>\\\":?*"; /* illegal in DOS & W95 */ static const char *illegal_chars_w95 = &illegal_chars_dos[8]; int idx, dot_idx; const char *s = file_name; char *d = dos_name; const char *const dlimit = dos_name + sizeof(dos_name) - 1; const char *illegal_aliens = illegal_chars_dos; size_t len = sizeof(illegal_chars_dos) - 1; /* Support for Windows 9X VFAT systems, when available. */ if(_use_lfn(file_name)) { illegal_aliens = illegal_chars_w95; len -= (illegal_chars_w95 - illegal_chars_dos); } /* Get past the drive letter, if any. */ if(s[0] >= 'A' && s[0] <= 'z' && s[1] == ':') { *d++ = *s++; *d++ = *s++; } for(idx = 0, dot_idx = -1; *s && d < dlimit; s++, d++) { if(memchr(illegal_aliens, *s, len)) { /* Dots are special: DOS doesn't allow them as the leading character, and a file name cannot have more than a single dot. We leave the first non-leading dot alone, unless it comes too close to the beginning of the name: we want sh.lex.c to become sh_lex.c, not sh.lex-c. */ if(*s == '.') { if(idx == 0 && (s[1] == '/' || (s[1] == '.' && s[2] == '/'))) { /* Copy "./" and "../" verbatim. */ *d++ = *s++; if(*s == '.') *d++ = *s++; *d = *s; } else if(idx == 0) *d = '_'; else if(dot_idx >= 0) { if(dot_idx < 5) { /* 5 is a heuristic ad-hoc'ery */ d[dot_idx - idx] = '_'; /* replace previous dot */ *d = '.'; } else *d = '-'; } else *d = '.'; if(*s == '.') dot_idx = idx; } else if(*s == '+' && s[1] == '+') { if(idx - 2 == dot_idx) { /* .c++, .h++ etc. */ *d++ = 'x'; *d = 'x'; } else { /* libg++ etc. */ memcpy (d, "plus", 4); d += 3; } s++; idx++; } else *d = '_'; } else *d = *s; if(*s == '/') { idx = 0; dot_idx = -1; } else idx++; } *d = '\0'; return dos_name; } static char *rename_if_dos_device_name (char *file_name) { /* We could have a file whose name is a device on MS-DOS. Trying to * retrieve such a file would fail at best and wedge us at worst. We need * to rename such files. */ char *base; struct_stat st_buf; char fname[PATH_MAX]; strncpy(fname, file_name, PATH_MAX-1); fname[PATH_MAX-1] = '\0'; base = basename(fname); if(((stat(base, &st_buf)) == 0) && (S_ISCHR(st_buf.st_mode))) { size_t blen = strlen(base); if(strlen(fname) >= PATH_MAX-1) { /* Make room for the '_' */ blen--; base[blen] = '\0'; } /* Prepend a '_'. */ memmove(base + 1, base, blen + 1); base[0] = '_'; strcpy(file_name, fname); } return file_name; } #if defined(MSDOS) && (defined(__DJGPP__) || defined(__GO32__)) /* * Disable program default argument globbing. We do it on our own. */ char **__crt0_glob_function(char *arg) { (void)arg; return (char**)0; } #endif /* MSDOS && (__DJGPP__ || __GO32__) */ #ifdef WIN32 /* * Function to find CACert bundle on a Win32 platform using SearchPath. * (SearchPath is already declared via inclusions done in setup header file) * (Use the ASCII version instead of the unicode one!) * The order of the directories it searches is: * 1. application's directory * 2. current working directory * 3. Windows System directory (e.g. C:\windows\system32) * 4. Windows Directory (e.g. C:\windows) * 5. all directories along %PATH% * * For WinXP and later search order actually depends on registry value: * HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\SafeProcessSearchMode */ CURLcode FindWin32CACert(struct Configurable *config, const char *bundle_file) { CURLcode result = CURLE_OK; /* search and set cert file only if libcurl supports SSL */ if(curlinfo->features & CURL_VERSION_SSL) { DWORD res_len; DWORD buf_tchar_size = PATH_MAX + 1; DWORD buf_bytes_size = sizeof(TCHAR) * buf_tchar_size; char *ptr = NULL; char *buf = malloc(buf_bytes_size); if(!buf) return CURLE_OUT_OF_MEMORY; buf[0] = '\0'; res_len = SearchPathA(NULL, bundle_file, NULL, buf_tchar_size, buf, &ptr); if(res_len > 0) { Curl_safefree(config->cacert); config->cacert = strdup(buf); if(!config->cacert) result = CURLE_OUT_OF_MEMORY; } Curl_safefree(buf); } return result; } #endif /* WIN32 */ #endif /* MSDOS || WIN32 */ curl-7.35.0/src/tool_getpass.c0000644000175000017500000001453612271735214013147 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #ifndef HAVE_GETPASS_R /* this file is only for systems without getpass_r() */ #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_TERMIOS_H # include #elif defined(HAVE_TERMIO_H) # include #endif #ifdef __VMS # include descrip # include starlet # include iodef #endif #ifdef WIN32 # include #endif #ifdef NETWARE # ifdef __NOVELL_LIBC__ # include # else # include # endif #endif #define _MPRINTF_REPLACE #include #include "tool_getpass.h" #include "memdebug.h" /* keep this as LAST include */ #ifdef __VMS /* VMS implementation */ 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 __SYMBIAN32__ # define getch() getchar() #endif #if defined(WIN32) || defined(__SYMBIAN32__) char *getpass_r(const char *prompt, char *buffer, size_t buflen) { size_t i; fputs(prompt, stderr); for(i = 0; i < buflen; i++) { buffer[i] = (char)getch(); if(buffer[i] == '\r' || buffer[i] == '\n') { buffer[i] = '\0'; break; } else if(buffer[i] == '\b') /* remove this letter and if this is not the first key, remove the previous one as well */ i = i - (i >= 1 ? 2 : 1); } #ifndef __SYMBIAN32__ /* since echo is disabled, print a newline */ fputs("\n", stderr); #endif /* 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 || __SYMBIAN32__ */ #ifdef NETWARE /* NetWare implementation */ #ifdef __NOVELL_LIBC__ char *getpass_r(const char *prompt, char *buffer, size_t buflen) { return getpassword(prompt, buffer, buflen); } #else char *getpass_r(const char *prompt, char *buffer, size_t buflen) { size_t i = 0; printf("%s", prompt); do { buffer[i++] = getch(); if(buffer[i-1] == '\b') { /* remove this letter and if this is not the first key, remove the previous one as well */ if(i > 1) { printf("\b \b"); i = i - 2; } else { RingTheBell(); i = i - 1; } } else if(buffer[i-1] != 13) putchar('*'); } while((buffer[i-1] != 13) && (i < buflen)); buffer[i-1] = '\0'; printf("\r\n"); return buffer; } #endif /* __NOVELL_LIBC__ */ #define DONE #endif /* NETWARE */ #ifndef DONE /* not previously provided */ #ifdef HAVE_TERMIOS_H # define struct_term struct termios #elif defined(HAVE_TERMIO_H) # define struct_term struct termio #else # undef struct_term #endif static bool ttyecho(bool enable, int fd) { #ifdef struct_term static struct_term withecho; static struct_term noecho; #endif if(!enable) { /* disable 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); #elif defined(HAVE_TERMIO_H) ioctl(fd, TCGETA, &withecho); noecho = withecho; noecho.c_lflag &= ~ECHO; ioctl(fd, TCSETA, &noecho); #else /* neither HAVE_TERMIO_H nor HAVE_TERMIOS_H, we can't disable echo! */ (void)fd; return FALSE; /* not disabled */ #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); #elif defined(HAVE_TERMIO_H) ioctl(fd, TCSETA, &withecho); #else return FALSE; /* not enabled */ #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 */ curl-7.35.0/src/Makefile.Watcom0000644000175000017500000001056312262353672013171 00000000000000# # Watcom / OpenWatcom / Win32 makefile for cURL. # G. Vanem # !ifndef %watcom !error WATCOM environment variable not set! !endif !ifdef %libname LIBNAME = $(%libname) !else LIBNAME = libcurl !endif TARGETS = $(LIBNAME).dll $(LIBNAME)_imp.lib $(LIBNAME).lib CC = wcc386 LD = wlink AR = wlib RC = wrc !ifdef __LOADDLL__ ! loaddll wcc386 wccd386 ! loaddll wpp386 wppd386 ! loaddll wlib wlibd ! if $(__VERSION__) > 1270 ! loaddll wlink wlinkd ! else ! loaddll wlink wlink ! endif !endif !ifdef __LINUX__ DS = / CP = cp MD = mkdir -p RD = rmdir -p RM = rm -f !else DS = $(X)\$(X) CP = copy 2>NUL MD = mkdir RD = rmdir /q /s 2>NUL !if $(__VERSION__) < 1250 RM = del /q /f 2>NUL !else RM = rm -f !endif !endif SYS_INCL = -I$(%watcom)$(DS)h$(DS)nt -I$(%watcom)$(DS)h SYS_LIBS = $(%watcom)$(DS)lib386$(DS)nt;$(%watcom)$(DS)lib386 CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -s -fr=con -w2 -fpi -oilrtfm & -wcd=201 -bt=nt -bc -d+ -dWIN32 -dHAVE_STRTOLL & -I..$(DS)include -I..$(DS)lib $(SYS_INCL) !ifdef %debug DEBUG = -dDEBUG=1 -dDEBUGBUILD CFLAGS += -d3 $(DEBUG) !else CFLAGS += -d0 !endif !ifdef %use_ipv6 CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6 !endif # # Change to suite. # !ifdef %zlib_root ZLIB_ROOT = $(%zlib_root) !else ZLIB_ROOT = ..$(DS)..$(DS)zlib-1.2.8 !endif !ifdef %libssh2_root LIBSSH2_ROOT = $(%libssh2_root) !else LIBSSH2_ROOT = ..$(DS)..$(DS)libssh2-1.4.3 !endif !ifdef %librtmp_root LIBRTMP_ROOT = $(%librtmp_root) !else LIBRTMP_ROOT = ..$(DS)..$(DS)rtmpdump-2.3 !endif !ifdef %openssl_root OPENSSL_ROOT = $(%openssl_root) !else OPENSSL_ROOT = ..$(DS)..$(DS)openssl-0.9.8y !endif !ifdef %ares_root ARES_ROOT = $(%ares_root) !else ARES_ROOT = ..$(DS)ares !endif !ifdef %use_ssl CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_SSLEAY -I$(OPENSSL_ROOT)$(DS)inc32 !endif OBJ_DIR = WC_Win32.obj LINK_ARG = $(OBJ_DIR)$(DS)wlink.arg # In order to process Makefile.inc wmake must be called with -u switch! !ifndef %MAKEFLAGS !error You MUST call wmake with the -u switch! !else !include Makefile.inc !endif # For now we still define the CURLX_ONES sources here unless we know how # to split off the prefixed path. CURLX_SOURCES = rawstr.c nonblock.c OBJS = $(CURL_CFILES:.c=.obj) !ifdef %curl_static CFLAGS += -DCURL_STATICLIB !else CFLAGS += -br OBJS += $(CURLX_SOURCES:.c=.obj) !endif !ifdef __LINUX__ OBJS = $OBJ_DIR/$(OBJS: = $OBJ_DIR/) !else OBJS = $OBJ_DIR\$(OBJS: = $OBJ_DIR\) !endif RESOURCE = $(OBJ_DIR)$(DS)curl.res all: tool_hugehelp.c $(OBJ_DIR) curl.exe .SYMBOLIC @echo Welcome to cURL clean: .SYMBOLIC -$(RM) $(OBJS) -$(RM) $(RESOURCE) $(LINK_ARG) vclean distclean: clean .SYMBOLIC -$(RD) $(OBJ_DIR) -$(RM) curl.exe curl.map curl.sym tool_hugehelp.c tool_hugehelp.c: tool_hugehelp.c.cvs $(CP) $[@ $^@ tool_hugehelp.c.cvs: .EXISTSONLY $(CP) tool_hugehelp.c $^@ $(OBJ_DIR): -$(MD) $^@ curl.exe: $(OBJS) $(RESOURCE) $(LINK_ARG) $(LD) name $^@ @$]@ $(RESOURCE): curl.rc $(RC) $(DEBUG) -q -r -zm -bt=nt -I..$(DS)include $(SYS_INCL) $[@ -fo=$^@ # suffix search path - vpath-like hack .c: ..$(DS)lib .ERASE .c{$(OBJ_DIR)}.obj: $(CC) $(CFLAGS) $[@ -fo=$^@ $(LINK_ARG): $(__MAKEFILES__) %create $^@ @%append $^@ system nt @%append $^@ file { $(OBJS) } !ifdef %debug @%append $^@ debug all @%append $^@ option symfile !endif @%append $^@ option quiet, map, caseexact, eliminate, @%append $^@ res=$(RESOURCE) libpath $(SYS_LIBS) !ifdef %curl_static @%append $^@ library wldap32.lib @%append $^@ library ..$(DS)lib$(DS)$(LIBNAME).lib !ifdef %use_zlib @%append $^@ library $(ZLIB_ROOT)$(DS)zlib.lib !endif !ifdef %use_rtmp @%append $^@ library $(LIBRTMP_ROOT)$(DS)librtmp$(DS)librtmp.lib, winmm.lib !endif !ifdef %use_ssh2 @%append $^@ library $(LIBSSH2_ROOT)$(DS)win32$(DS)libssh2.lib !endif !ifdef %use_ssl @%append $^@ library $(OPENSSL_ROOT)$(DS)out32$(DS)libeay32.lib, $(OPENSSL_ROOT)$(DS)out32$(DS)ssleay32.lib !endif !ifdef %use_ares @%append $^@ library $(ARES_ROOT)$(DS)cares.lib !endif !ifdef %use_winidn ! if $(__VERSION__) > 1290 @%append $^@ library normaliz.lib ! else @%append $^@ import '_IdnToAscii@20' 'NORMALIZ.DLL'.'IdnToAscii' @%append $^@ import '_IdnToUnicode@20' 'NORMALIZ.DLL'.'IdnToUnicode' ! endif !endif !else @%append $^@ library ..$(DS)lib$(DS)$(LIBNAME)_imp.lib !endif !ifeq USE_WATT32 1 @%append $^@ library $(%watt_root)$(DS)lib$(DS)wattcpw_imp.lib !else @%append $^@ library ws2_32.lib !endif curl-7.35.0/src/tool_sdecls.h0000644000175000017500000001174212213173003012743 00000000000000#ifndef HEADER_CURL_TOOL_SDECLS_H #define HEADER_CURL_TOOL_SDECLS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #ifdef USE_METALINK # include #endif /* USE_METALINK */ /* * OutStruct variables keep track of information relative to curl's * output writing, which may take place to a standard stream or a file. * * 'filename' member is either a pointer to a file name string or NULL * when dealing with a standard stream. * * 'alloc_filename' member is TRUE when string pointed by 'filename' has been * dynamically allocated and 'belongs' to this OutStruct, otherwise FALSE. * * 'is_cd_filename' member is TRUE when string pointed by 'filename' has been * set using a server-specified Content-Disposition filename, otherwise FALSE. * * 's_isreg' member is TRUE when output goes to a regular file, this also * implies that output is 'seekable' and 'appendable' and also that member * 'filename' points to file name's string. For any standard stream member * 's_isreg' will be FALSE. * * 'fopened' member is TRUE when output goes to a regular file and it * has been fopen'ed, requiring it to be closed later on. In any other * case this is FALSE. * * 'stream' member is a pointer to a stream controlling object as returned * from a 'fopen' call or a standard stream. * * 'config' member is a pointer to associated 'Configurable' struct. * * 'bytes' member represents amount written so far. * * 'init' member holds original file size or offset at which truncation is * taking place. Always zero unless appending to a non-empty regular file. * * 'metalink_parser' member is a pointer to Metalink XML parser * context. */ struct OutStruct { char *filename; bool alloc_filename; bool is_cd_filename; bool s_isreg; bool fopened; FILE *stream; struct Configurable *config; curl_off_t bytes; curl_off_t init; #ifdef USE_METALINK metalink_parser_context_t *metalink_parser; #endif /* USE_METALINK */ }; /* * InStruct variables keep track of information relative to curl's * input reading, which may take place from stdin or from some file. * * 'fd' member is either 'stdin' file descriptor number STDIN_FILENO * or a file descriptor as returned from an 'open' call for some file. * * 'config' member is a pointer to associated 'Configurable' struct. */ struct InStruct { int fd; struct Configurable *config; }; /* * A linked list of these 'getout' nodes contain URL's to fetch, * as well as information relative to where URL contents should * be stored or which file should be uploaded. */ 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 - composed of GETOUT_* bits */ }; #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 */ #define GETOUT_METALINK (1<<5) /* set when Metalink download */ /* * 'trace' enumeration represents curl's output look'n feel possibilities. */ typedef enum { TRACE_NONE, /* no trace/verbose output at all */ TRACE_BIN, /* tcpdump inspired look */ TRACE_ASCII, /* like *BIN but without the hex output */ TRACE_PLAIN /* -v/--verbose type */ } trace; /* * 'HttpReq' enumeration represents HTTP request types. */ typedef enum { HTTPREQ_UNSPEC, /* first in list */ HTTPREQ_GET, HTTPREQ_HEAD, HTTPREQ_POST, HTTPREQ_SIMPLEPOST, HTTPREQ_CUSTOM, HTTPREQ_LAST /* last in list */ } HttpReq; /* * Complete struct declarations which have Configurable struct members, * just in case this header is directly included in some source file. */ #include "tool_cfgable.h" #endif /* HEADER_CURL_TOOL_SDECLS_H */ curl-7.35.0/src/tool_main.h0000644000175000017500000000273012213173003012407 00000000000000#ifndef HEADER_CURL_TOOL_MAIN_H #define HEADER_CURL_TOOL_MAIN_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #define DEFAULT_MAXREDIRS 50L #define RETRY_SLEEP_DEFAULT 1000L /* ms */ #define RETRY_SLEEP_MAX 600000L /* ms == 10 minutes */ #ifndef STDIN_FILENO # define STDIN_FILENO fileno(stdin) #endif #ifndef STDOUT_FILENO # define STDOUT_FILENO fileno(stdout) #endif #ifndef STDERR_FILENO # define STDERR_FILENO fileno(stderr) #endif #endif /* HEADER_CURL_TOOL_MAIN_H */ curl-7.35.0/src/tool_formparse.h0000644000175000017500000000253612213173003013465 00000000000000#ifndef HEADER_CURL_TOOL_FORMPARSE_H #define HEADER_CURL_TOOL_FORMPARSE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" int formparse(struct Configurable *config, const char *input, struct curl_httppost **httppost, struct curl_httppost **last_post, bool literal_value); #endif /* HEADER_CURL_TOOL_FORMPARSE_H */ curl-7.35.0/src/tool_cb_wrt.c0000644000175000017500000001032312213173003012733 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" #include "tool_msgs.h" #include "tool_cb_wrt.h" #include "memdebug.h" /* keep this as LAST include */ /* ** callback for CURLOPT_WRITEFUNCTION */ size_t tool_write_cb(void *buffer, size_t sz, size_t nmemb, void *userdata) { size_t rc; struct OutStruct *outs = userdata; struct Configurable *config = outs->config; /* * Once that libcurl has called back tool_write_cb() the returned value * is checked against the amount that was intended to be written, if * it does not match then it fails with CURLE_WRITE_ERROR. So at this * point returning a value different from sz*nmemb indicates failure. */ const size_t failure = (sz * nmemb) ? 0 : 1; if(!config) return failure; #ifdef DEBUGBUILD if(config->include_headers) { if(sz * nmemb > (size_t)CURL_MAX_HTTP_HEADER) { warnf(config, "Header data size exceeds single call write limit!\n"); return failure; } } else { if(sz * nmemb > (size_t)CURL_MAX_WRITE_SIZE) { warnf(config, "Data size exceeds single call write limit!\n"); return failure; } } { /* Some internal congruency checks on received OutStruct */ bool check_fails = FALSE; if(outs->filename) { /* regular file */ if(!*outs->filename) check_fails = TRUE; if(!outs->s_isreg) check_fails = TRUE; if(outs->fopened && !outs->stream) check_fails = TRUE; if(!outs->fopened && outs->stream) check_fails = TRUE; if(!outs->fopened && outs->bytes) check_fails = TRUE; } else { /* standard stream */ if(!outs->stream || outs->s_isreg || outs->fopened) check_fails = TRUE; if(outs->alloc_filename || outs->is_cd_filename || outs->init) check_fails = TRUE; } if(check_fails) { warnf(config, "Invalid output struct data for write callback\n"); return failure; } } #endif if(!outs->stream) { FILE *file; if(!outs->filename || !*outs->filename) { warnf(config, "Remote filename has no length!\n"); return failure; } if(outs->is_cd_filename) { /* don't overwrite existing files */ file = fopen(outs->filename, "rb"); if(file) { fclose(file); warnf(config, "Refusing to overwrite %s: %s\n", outs->filename, strerror(EEXIST)); return failure; } } /* open file for writing */ file = fopen(outs->filename, "wb"); if(!file) { warnf(config, "Failed to create the file %s: %s\n", outs->filename, strerror(errno)); return failure; } outs->s_isreg = TRUE; outs->fopened = TRUE; outs->stream = file; outs->bytes = 0; outs->init = 0; } rc = fwrite(buffer, sz, nmemb, outs->stream); if((sz * nmemb) == rc) /* we added this amount of data to the output */ outs->bytes += (sz * nmemb); if(config->readbusy) { config->readbusy = FALSE; curl_easy_pause(config->easy, CURLPAUSE_CONT); } if(config->nobuffer) { /* output buffering disabled */ int res = fflush(outs->stream); if(res) return failure; } return rc; } curl-7.35.0/src/tool_writeout.c0000644000175000017500000002644312213173003013347 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #define _MPRINTF_REPLACE /* we want curl-functions instead of native ones */ #include #include "tool_cfgable.h" #include "tool_writeout.h" #include "memdebug.h" /* keep this as LAST include */ typedef enum { VAR_NONE, /* must be the first */ VAR_TOTAL_TIME, VAR_NAMELOOKUP_TIME, VAR_CONNECT_TIME, VAR_APPCONNECT_TIME, VAR_PRETRANSFER_TIME, VAR_STARTTRANSFER_TIME, VAR_SIZE_DOWNLOAD, VAR_SIZE_UPLOAD, VAR_SPEED_DOWNLOAD, VAR_SPEED_UPLOAD, VAR_HTTP_CODE, VAR_HTTP_CODE_PROXY, VAR_HEADER_SIZE, VAR_REQUEST_SIZE, VAR_EFFECTIVE_URL, VAR_CONTENT_TYPE, VAR_NUM_CONNECTS, VAR_REDIRECT_TIME, VAR_REDIRECT_COUNT, VAR_FTP_ENTRY_PATH, VAR_REDIRECT_URL, VAR_SSL_VERIFY_RESULT, VAR_EFFECTIVE_FILENAME, VAR_PRIMARY_IP, VAR_PRIMARY_PORT, VAR_LOCAL_IP, VAR_LOCAL_PORT, VAR_NUM_OF_VARS /* must be the last */ } replaceid; struct variable { const char *name; replaceid id; }; static const struct variable replacements[]={ {"url_effective", VAR_EFFECTIVE_URL}, {"http_code", VAR_HTTP_CODE}, {"response_code", VAR_HTTP_CODE}, {"http_connect", VAR_HTTP_CODE_PROXY}, {"time_total", VAR_TOTAL_TIME}, {"time_namelookup", VAR_NAMELOOKUP_TIME}, {"time_connect", VAR_CONNECT_TIME}, {"time_appconnect", VAR_APPCONNECT_TIME}, {"time_pretransfer", VAR_PRETRANSFER_TIME}, {"time_starttransfer", VAR_STARTTRANSFER_TIME}, {"size_header", VAR_HEADER_SIZE}, {"size_request", VAR_REQUEST_SIZE}, {"size_download", VAR_SIZE_DOWNLOAD}, {"size_upload", VAR_SIZE_UPLOAD}, {"speed_download", VAR_SPEED_DOWNLOAD}, {"speed_upload", VAR_SPEED_UPLOAD}, {"content_type", VAR_CONTENT_TYPE}, {"num_connects", VAR_NUM_CONNECTS}, {"time_redirect", VAR_REDIRECT_TIME}, {"num_redirects", VAR_REDIRECT_COUNT}, {"ftp_entry_path", VAR_FTP_ENTRY_PATH}, {"redirect_url", VAR_REDIRECT_URL}, {"ssl_verify_result", VAR_SSL_VERIFY_RESULT}, {"filename_effective", VAR_EFFECTIVE_FILENAME}, {"remote_ip", VAR_PRIMARY_IP}, {"remote_port", VAR_PRIMARY_PORT}, {"local_ip", VAR_LOCAL_IP}, {"local_port", VAR_LOCAL_PORT}, {NULL, VAR_NONE} }; void ourWriteOut(CURL *curl, struct OutStruct *outs, const char *writeinfo) { FILE *stream = stdout; const char *ptr = writeinfo; char *stringp; long longinfo; double doubleinfo; while(ptr && *ptr) { if('%' == *ptr) { if('%' == ptr[1]) { /* an escaped %-letter */ fputc('%', stream); ptr += 2; } else { /* this is meant as a variable to output */ char *end; char keepit; int i; if(('{' == ptr[1]) && ((end = strchr(ptr, '}')) != NULL)) { bool match = FALSE; ptr += 2; /* pass the % and the { */ keepit = *end; *end = 0; /* zero terminate */ for(i = 0; replacements[i].name; i++) { if(curl_strequal(ptr, replacements[i].name)) { match = TRUE; switch(replacements[i].id) { case VAR_EFFECTIVE_URL: if((CURLE_OK == curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &stringp)) && stringp) fputs(stringp, stream); break; case VAR_HTTP_CODE: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &longinfo)) fprintf(stream, "%03ld", longinfo); break; case VAR_HTTP_CODE_PROXY: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_HTTP_CONNECTCODE, &longinfo)) fprintf(stream, "%03ld", longinfo); break; case VAR_HEADER_SIZE: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &longinfo)) fprintf(stream, "%ld", longinfo); break; case VAR_REQUEST_SIZE: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_REQUEST_SIZE, &longinfo)) fprintf(stream, "%ld", longinfo); break; case VAR_NUM_CONNECTS: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_NUM_CONNECTS, &longinfo)) fprintf(stream, "%ld", longinfo); break; case VAR_REDIRECT_COUNT: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_REDIRECT_COUNT, &longinfo)) fprintf(stream, "%ld", longinfo); break; case VAR_REDIRECT_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_REDIRECT_TIME, &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; case VAR_TOTAL_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; case VAR_NAMELOOKUP_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_NAMELOOKUP_TIME, &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; case VAR_CONNECT_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME, &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; case VAR_APPCONNECT_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_APPCONNECT_TIME, &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; case VAR_PRETRANSFER_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME, &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; case VAR_STARTTRANSFER_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME, &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; case VAR_SIZE_UPLOAD: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD, &doubleinfo)) fprintf(stream, "%.0f", doubleinfo); break; case VAR_SIZE_DOWNLOAD: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD, &doubleinfo)) fprintf(stream, "%.0f", doubleinfo); break; case VAR_SPEED_DOWNLOAD: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD, &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; case VAR_SPEED_UPLOAD: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD, &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; case VAR_CONTENT_TYPE: if((CURLE_OK == curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &stringp)) && stringp) fputs(stringp, stream); break; case VAR_FTP_ENTRY_PATH: if((CURLE_OK == curl_easy_getinfo(curl, CURLINFO_FTP_ENTRY_PATH, &stringp)) && stringp) fputs(stringp, stream); break; case VAR_REDIRECT_URL: if((CURLE_OK == curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &stringp)) && stringp) fputs(stringp, stream); break; case VAR_SSL_VERIFY_RESULT: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_SSL_VERIFYRESULT, &longinfo)) fprintf(stream, "%ld", longinfo); break; case VAR_EFFECTIVE_FILENAME: if(outs->filename) fprintf(stream, "%s", outs->filename); break; case VAR_PRIMARY_IP: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_PRIMARY_IP, &stringp)) fprintf(stream, "%s", stringp); break; case VAR_PRIMARY_PORT: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_PRIMARY_PORT, &longinfo)) fprintf(stream, "%ld", longinfo); break; case VAR_LOCAL_IP: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_LOCAL_IP, &stringp)) fprintf(stream, "%s", stringp); break; case VAR_LOCAL_PORT: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_LOCAL_PORT, &longinfo)) fprintf(stream, "%ld", longinfo); break; default: break; } break; } } if(!match) { fprintf(stderr, "curl: unknown --write-out variable: '%s'\n", ptr); } ptr = end + 1; /* pass the end */ *end = keepit; } else { /* illegal syntax, then just output the characters that are used */ fputc('%', stream); fputc(ptr[1], stream); ptr += 2; } } } else if('\\' == *ptr) { switch(ptr[1]) { case 'r': fputc('\r', stream); break; case 'n': fputc('\n', stream); break; case 't': fputc('\t', stream); break; default: /* unknown, just output this */ fputc(*ptr, stream); fputc(ptr[1], stream); break; } ptr += 2; } else { fputc(*ptr, stream); ptr++; } } } curl-7.35.0/src/mkhelp.pl0000644000175000017500000001424512213173003012076 00000000000000#!/usr/local/bin/perl #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2011, 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. # ########################################################################### # Yeah, I know, probably 1000 other persons already wrote a script like # this, but I'll tell ya: # THEY DON'T FIT ME :-) # Get readme file as parameter: if($ARGV[0] eq "-c") { $c=1; shift @ARGV; } my $README = $ARGV[0]; if($README eq "") { print "usage: mkreadme.pl [-c] < manpage\n"; exit; } push @out, " _ _ ____ _\n"; push @out, " Project ___| | | | _ \\| |\n"; push @out, " / __| | | | |_) | |\n"; push @out, " | (__| |_| | _ <| |___\n"; push @out, " \\___|\\___/|_| \\_\\_____|\n"; my $olen=0; while () { my $line = $_; # this should be removed: $line =~ s/(.|_)//g; if($line =~ /^([ \t]*\n|curl)/i) { # cut off headers and empty lines $wline++; # count number of cut off lines next; } my $text = $line; $text =~ s/^\s+//g; # cut off preceding... $text =~ s/\s+$//g; # and trailing whitespaces $tlen = length($text); if($wline && ($olen == $tlen)) { # if the previous line with contents was exactly as long as # this line, then we ignore the newlines! # We do this magic because a header may abort a paragraph at # any line, but we don't want that to be noticed in the output # here $wline=0; } $olen = $tlen; if($wline) { # we only make one empty line max $wline = 0; push @out, "\n"; } push @out, $line; } push @out, "\n"; # just an extra newline open(READ, "<$README") || die "couldn't read the README infile $README"; while() { push @out, $_; } close(READ); # if compressed if($c) { my @test = `gzip --version 2>&1`; if($test[0] =~ /gzip/) { open(GZIP, ">dumpit") || die "can't create the dumpit file, try without -c"; binmode GZIP; for(@out) { print GZIP $_; $gzip += length($_); } close(GZIP); system("gzip --best --no-name dumpit"); open(GZIP, ") { push @gzip, $_; $gzipped += length($_); } close(GZIP); unlink("dumpit.gz"); } else { # no gzip, no compression! undef $c; print STDERR "MEEEP: Couldn't find gzip, disable compression\n"; } } $now = localtime; print < #include "memdebug.h" /* keep this as LAST include */ static const unsigned char hugehelpgz[] = { /* This mumbo-jumbo is the huge help text compressed with gzip. Thanks to this operation, the size of this data shrunk from $gzip to $gzipped bytes. You can disable the use of compressed help texts by NOT passing -c to the mkhelp.pl tool. */ HEAD ; my $c=0; print " "; for(@gzip) { my @all=split(//, $_); for(@all) { my $num=ord($_); printf(" 0x%02x,", 0+$num); if(++$c>11) { print "\n "; $c=0; } } } print "\n};\n"; print < 500) { # terminate and make another fputs() call here print ", stdout);\n fputs(\n"; $outsize=length($new)+1; } printf("\"%s\\n\"\n", $new); } print ", stdout) ;\n}\n"; foot(); sub foot { print <, 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. # #*************************************************************************** # All files in the Makefile.vc* series are generated automatically from the # one made for MSVC version 6. Alas, if you want to do changes to any of the # files and send back to the project, edit the version six, make your diff and # mail curl-users. ############################################################# # ## Makefile for building curl.exe with MSVC8 ## 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. ## # ############################################################# PROGRAM_NAME = curl.exe # ------------------------------------------- # Verify that current subdir is curl's 'src' # ------------------------------------------- !IF ! EXIST(.\tool_main.c) ! MESSAGE Can not process this makefile from outside of curl's 'src' subdirectory. ! MESSAGE Change to curl's 'src' subdirectory, and try again. ! ERROR See previous message. !ENDIF # ------------------------------------------------ # Makefile.msvc.names provides libcurl file names # ------------------------------------------------ !INCLUDE ..\winbuild\Makefile.msvc.names !IFNDEF OPENSSL_PATH OPENSSL_PATH = ../../openssl-0.9.8y !ENDIF !IFNDEF ZLIB_PATH ZLIB_PATH = ../../zlib-1.2.8 !ENDIF !IFNDEF MACHINE MACHINE = X86 !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". Since at least with MSVC8 the sspi.h # header is broken it is either required to install the Windows SDK, # or to fix sspi.h with adding this define at the beginning of sspi.h: # #define FreeCredentialHandle FreeCredentialsHandle # # 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/ # WINDOWS_SSPI = 1 !IFDEF WINDOWS_SSPI !IFNDEF WINDOWS_SDK_PATH WINDOWS_SDK_PATH = "$(PROGRAMFILES)\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 user32.lib WINSSL_CFLAGS = /DUSE_SCHANNEL #WINSSL_LIBS = gdi32.lib user32.lib # Runtime library configuration RTLIB = /MD RTLIBD = /MDd !IF "$(RTLIBCFG)" == "static" RTLIB = /MT RTLIBD = /MTd !ENDIF ## Release CCR = cl.exe $(RTLIB) /O2 /DNDEBUG LINKR = link.exe /incremental:no /libpath:"../lib" RCR = rc.exe /dDEBUGBUILD=0 ## Debug CCD = cl.exe $(RTLIBD) /Gm /ZI /Od /D_DEBUG /RTC1 LINKD = link.exe /incremental:yes /debug /libpath:"../lib" RCD = rc.exe /dDEBUGBUILD=1 CFLAGS = /I../lib /I../include /nologo /W3 /EHsc /DWIN32 /FD /c /D_BIND_TO_CURRENT_VCLIBS_VERSION=1 LFLAGS = /nologo /out:$(PROGRAM_NAME) /subsystem:console /machine:$(MACHINE) RESFLAGS = /i../include # This manifest thing is for VC8, enabled by the maketgz script that # builds the VC8 version of this makefile. Left commented out in the VC8 # version! #MANIFESTTOOL = mt -manifest $(PROGRAM_NAME).manifest -outputresource:$(PROGRAM_NAME);1 !IFDEF WINDOWS_SSPI CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include !ENDIF RELEASE_OBJS= \ nonblockr.obj \ rawstrr.obj \ strtoofftr.obj \ tool_binmoder.obj \ tool_bnamer.obj \ tool_cb_dbgr.obj \ tool_cb_hdrr.obj \ tool_cb_prgr.obj \ tool_cb_rear.obj \ tool_cb_seer.obj \ tool_cb_wrtr.obj \ tool_cfgabler.obj \ tool_convertr.obj \ tool_dirhier.obj \ tool_doswinr.obj \ tool_easysrcr.obj \ tool_formparser.obj \ tool_getparamr.obj \ tool_getpassr.obj \ tool_helpr.obj \ tool_helpersr.obj \ tool_homedirr.obj \ tool_hugehelpr.obj \ tool_libinfor.obj \ tool_mainr.obj \ tool_metalinkr.obj \ tool_mfilesr.obj \ tool_msgsr.obj \ tool_operater.obj \ tool_operhlpr.obj \ tool_panykeyr.obj \ tool_paramhlpr.obj \ tool_parsecfgr.obj \ tool_setoptr.obj \ tool_sleepr.obj \ tool_urlglobr.obj \ tool_utilr.obj \ tool_vmsr.obj \ tool_writeenvr.obj \ tool_writeoutr.obj \ tool_xattrr.obj \ curlr.res DEBUG_OBJS= \ nonblockd.obj \ rawstrd.obj \ strtoofftd.obj \ tool_binmoded.obj \ tool_bnamed.obj \ tool_cb_dbgd.obj \ tool_cb_hdrd.obj \ tool_cb_prgd.obj \ tool_cb_read.obj \ tool_cb_seed.obj \ tool_cb_wrtd.obj \ tool_cfgabled.obj \ tool_convertd.obj \ tool_dirhied.obj \ tool_doswind.obj \ tool_easysrcd.obj \ tool_formparsed.obj \ tool_getparamd.obj \ tool_getpassd.obj \ tool_helpd.obj \ tool_helpersd.obj \ tool_homedird.obj \ tool_hugehelpd.obj \ tool_libinfod.obj \ tool_maind.obj \ tool_metalinkd.obj \ tool_mfilesd.obj \ tool_msgsd.obj \ tool_operated.obj \ tool_operhlpd.obj \ tool_panykeyd.obj \ tool_paramhlpd.obj \ tool_parsecfgd.obj \ tool_setoptd.obj \ tool_sleepd.obj \ tool_urlglobd.obj \ tool_utild.obj \ tool_vmsd.obj \ tool_writeenvd.obj \ tool_writeoutd.obj \ tool_xattrd.obj \ curld.res ################################################# # If CFG not specified, use static libs CFLAGS = $(CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) ################################################# # release dynamic library !IF "$(CFG)" == "release-dll" LINKLIBS = $(LIBCURL_IMP_LIB_REL) LINKLIBS_DEBUG = $(LIBCURL_IMP_LIB_DBG) !ENDIF ################################################# # release static library with zlib !IF "$(CFG)" == "release-zlib" CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) $(ZLIB_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(ZLIB_LIBS) LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS) !ENDIF ################################################# # release static library with ssl !IF "$(CFG)" == "release-ssl" CFLAGS = $(CFLAGS) $(SSL_CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) $(SSL_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(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_REL) $(SSL_LIBS) LINKLIBS_DEBUG = $(LIBCURL_IMP_LIB_DBG) $(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_STA_LIB_REL) $(SSL_LIBS) $(ZLIB_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(SSL_LIBS) $(ZLIB_LIBS) LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(ZLIB_LFLAGS) !ENDIF ################################################# # release static library with winssl and zlib !IF "$(CFG)" == "release-winssl-zlib" CFLAGS = $(CFLAGS) $(WINSSL_CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) $(WINSSL_LIBS) $(ZLIB_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(WINSSL_LIBS) $(ZLIB_LIBS) LFLAGS = $(LFLAGS) $(WINSSL_LFLAGS) $(ZLIB_LFLAGS) !ENDIF ################################################# # release static library with dynamic ssl !IF "$(CFG)" == "release-ssl-dll" CFLAGS = $(CFLAGS) $(SSL_CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) $(SSL_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(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_STA_LIB_REL) $(ZLIB_IMP_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(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_REL) $(ZLIB_IMP_LIBS) LINKLIBS_DEBUG = $(LIBCURL_IMP_LIB_DBG) $(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_STA_LIB_REL) $(SSL_LIBS) $(ZLIB_IMP_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(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_REL) $(SSL_LIBS) $(ZLIB_IMP_LIBS) LINKLIBS_DEBUG = $(LIBCURL_IMP_LIB_DBG) $(SSL_LIBS) $(ZLIB_IMP_LIBS) LFLAGS = $(LFLAGS) $(SSL_IMP_LFLAGS) $(ZLIB_LFLAGS) !ENDIF LINKLIBS = $(LINKLIBS) ws2_32.lib bufferoverflowu.lib wldap32.lib advapi32.lib LINKLIBS_DEBUG = $(LINKLIBS_DEBUG) ws2_32.lib bufferoverflowu.lib wldap32.lib advapi32.lib all : release release: $(RELEASE_OBJS) $(LINKR) $(LFLAGS) $(LINKLIBS) $(RELEASE_OBJS) $(MANIFESTTOOL) debug: $(DEBUG_OBJS) $(LINKD) $(LFLAGS) $(LINKLIBS_DEBUG) $(DEBUG_OBJS) $(MANIFESTTOOL) ## Release nonblockr.obj: ../lib/nonblock.c $(CCR) $(CFLAGS) /Fo"$@" ../lib/nonblock.c rawstrr.obj: ../lib/rawstr.c $(CCR) $(CFLAGS) /Fo"$@" ../lib/rawstr.c strtoofftr.obj: ../lib/strtoofft.c $(CCR) $(CFLAGS) /Fo"$@" ../lib/strtoofft.c tool_binmoder.obj: tool_binmode.c $(CCR) $(CFLAGS) /Fo"$@" tool_binmode.c tool_bnamer.obj: tool_bname.c $(CCR) $(CFLAGS) /Fo"$@" tool_bname.c tool_cb_dbgr.obj: tool_cb_dbg.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_dbg.c tool_cb_hdrr.obj: tool_cb_hdr.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_hdr.c tool_cb_prgr.obj: tool_cb_prg.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_prg.c tool_cb_rear.obj: tool_cb_rea.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_rea.c tool_cb_seer.obj: tool_cb_see.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_see.c tool_cb_wrtr.obj: tool_cb_wrt.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_wrt.c tool_cfgabler.obj: tool_cfgable.c $(CCR) $(CFLAGS) /Fo"$@" tool_cfgable.c tool_convertr.obj: tool_convert.c $(CCR) $(CFLAGS) /Fo"$@" tool_convert.c tool_dirhier.obj: tool_dirhie.c $(CCR) $(CFLAGS) /Fo"$@" tool_dirhie.c tool_doswinr.obj: tool_doswin.c $(CCR) $(CFLAGS) /Fo"$@" tool_doswin.c tool_easysrcr.obj: tool_easysrc.c $(CCR) $(CFLAGS) /Fo"$@" tool_easysrc.c tool_formparser.obj: tool_formparse.c $(CCR) $(CFLAGS) /Fo"$@" tool_formparse.c tool_getparamr.obj: tool_getparam.c $(CCR) $(CFLAGS) /Fo"$@" tool_getparam.c tool_getpassr.obj: tool_getpass.c $(CCR) $(CFLAGS) /Fo"$@" tool_getpass.c tool_helpr.obj: tool_help.c $(CCR) $(CFLAGS) /Fo"$@" tool_help.c tool_helpersr.obj: tool_helpers.c $(CCR) $(CFLAGS) /Fo"$@" tool_helpers.c tool_homedirr.obj: tool_homedir.c $(CCR) $(CFLAGS) /Fo"$@" tool_homedir.c tool_hugehelpr.obj: tool_hugehelp.c $(CCR) $(CFLAGS) /Zm200 /Fo"$@" tool_hugehelp.c tool_libinfor.obj: tool_libinfo.c $(CCR) $(CFLAGS) /Fo"$@" tool_libinfo.c tool_mainr.obj: tool_main.c $(CCR) $(CFLAGS) /Fo"$@" tool_main.c tool_metalinkr.obj: tool_metalink.c $(CCR) $(CFLAGS) /Fo"$@" tool_metalink.c tool_mfilesr.obj: tool_mfiles.c $(CCR) $(CFLAGS) /Fo"$@" tool_mfiles.c tool_msgsr.obj: tool_msgs.c $(CCR) $(CFLAGS) /Fo"$@" tool_msgs.c tool_operater.obj: tool_operate.c $(CCR) $(CFLAGS) /Fo"$@" tool_operate.c tool_operhlpr.obj: tool_operhlp.c $(CCR) $(CFLAGS) /Fo"$@" tool_operhlp.c tool_panykeyr.obj: tool_panykey.c $(CCR) $(CFLAGS) /Fo"$@" tool_panykey.c tool_paramhlpr.obj: tool_paramhlp.c $(CCR) $(CFLAGS) /Fo"$@" tool_paramhlp.c tool_parsecfgr.obj: tool_parsecfg.c $(CCR) $(CFLAGS) /Fo"$@" tool_parsecfg.c tool_setoptr.obj: tool_setopt.c $(CCR) $(CFLAGS) /Fo"$@" tool_setopt.c tool_sleepr.obj: tool_sleep.c $(CCR) $(CFLAGS) /Fo"$@" tool_sleep.c tool_urlglobr.obj: tool_urlglob.c $(CCR) $(CFLAGS) /Fo"$@" tool_urlglob.c tool_utilr.obj: tool_util.c $(CCR) $(CFLAGS) /Fo"$@" tool_util.c tool_vmsr.obj: tool_vms.c $(CCR) $(CFLAGS) /Fo"$@" tool_vms.c tool_writeenvr.obj: tool_writeenv.c $(CCR) $(CFLAGS) /Fo"$@" tool_writeenv.c tool_writeoutr.obj: tool_writeout.c $(CCR) $(CFLAGS) /Fo"$@" tool_writeout.c tool_xattrr.obj: tool_xattr.c $(CCR) $(CFLAGS) /Fo"$@" tool_xattr.c curlr.res : curl.rc $(RCR) $(RESFLAGS) /Fo"$@" curl.rc ## Debug nonblockd.obj: ../lib/nonblock.c $(CCD) $(CFLAGS) /Fo"$@" ../lib/nonblock.c rawstrd.obj: ../lib/rawstr.c $(CCD) $(CFLAGS) /Fo"$@" ../lib/rawstr.c strtoofftd.obj: ../lib/strtoofft.c $(CCD) $(CFLAGS) /Fo"$@" ../lib/strtoofft.c tool_binmoded.obj: tool_binmode.c $(CCD) $(CFLAGS) /Fo"$@" tool_binmode.c tool_bnamed.obj: tool_bname.c $(CCD) $(CFLAGS) /Fo"$@" tool_bname.c tool_cb_dbgd.obj: tool_cb_dbg.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_dbg.c tool_cb_hdrd.obj: tool_cb_hdr.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_hdr.c tool_cb_prgd.obj: tool_cb_prg.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_prg.c tool_cb_read.obj: tool_cb_rea.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_rea.c tool_cb_seed.obj: tool_cb_see.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_see.c tool_cb_wrtd.obj: tool_cb_wrt.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_wrt.c tool_cfgabled.obj: tool_cfgable.c $(CCD) $(CFLAGS) /Fo"$@" tool_cfgable.c tool_convertd.obj: tool_convert.c $(CCD) $(CFLAGS) /Fo"$@" tool_convert.c tool_dirhied.obj: tool_dirhie.c $(CCD) $(CFLAGS) /Fo"$@" tool_dirhie.c tool_doswind.obj: tool_doswin.c $(CCD) $(CFLAGS) /Fo"$@" tool_doswin.c tool_easysrcd.obj: tool_easysrc.c $(CCD) $(CFLAGS) /Fo"$@" tool_easysrc.c tool_formparsed.obj: tool_formparse.c $(CCD) $(CFLAGS) /Fo"$@" tool_formparse.c tool_getparamd.obj: tool_getparam.c $(CCD) $(CFLAGS) /Fo"$@" tool_getparam.c tool_getpassd.obj: tool_getpass.c $(CCD) $(CFLAGS) /Fo"$@" tool_getpass.c tool_helpd.obj: tool_help.c $(CCD) $(CFLAGS) /Fo"$@" tool_help.c tool_helpersd.obj: tool_helpers.c $(CCD) $(CFLAGS) /Fo"$@" tool_helpers.c tool_homedird.obj: tool_homedir.c $(CCD) $(CFLAGS) /Fo"$@" tool_homedir.c tool_hugehelpd.obj: tool_hugehelp.c $(CCD) $(CFLAGS) /Zm200 /Fo"$@" tool_hugehelp.c tool_libinfod.obj: tool_libinfo.c $(CCD) $(CFLAGS) /Fo"$@" tool_libinfo.c tool_maind.obj: tool_main.c $(CCD) $(CFLAGS) /Fo"$@" tool_main.c tool_metalinkd.obj: tool_metalink.c $(CCD) $(CFLAGS) /Fo"$@" tool_metalink.c tool_mfilesd.obj: tool_mfiles.c $(CCD) $(CFLAGS) /Fo"$@" tool_mfiles.c tool_msgsd.obj: tool_msgs.c $(CCD) $(CFLAGS) /Fo"$@" tool_msgs.c tool_operated.obj: tool_operate.c $(CCD) $(CFLAGS) /Fo"$@" tool_operate.c tool_operhlpd.obj: tool_operhlp.c $(CCD) $(CFLAGS) /Fo"$@" tool_operhlp.c tool_panykeyd.obj: tool_panykey.c $(CCD) $(CFLAGS) /Fo"$@" tool_panykey.c tool_paramhlpd.obj: tool_paramhlp.c $(CCD) $(CFLAGS) /Fo"$@" tool_paramhlp.c tool_parsecfgd.obj: tool_parsecfg.c $(CCD) $(CFLAGS) /Fo"$@" tool_parsecfg.c tool_setoptd.obj: tool_setopt.c $(CCD) $(CFLAGS) /Fo"$@" tool_setopt.c tool_sleepd.obj: tool_sleep.c $(CCD) $(CFLAGS) /Fo"$@" tool_sleep.c tool_urlglobd.obj: tool_urlglob.c $(CCD) $(CFLAGS) /Fo"$@" tool_urlglob.c tool_utild.obj: tool_util.c $(CCD) $(CFLAGS) /Fo"$@" tool_util.c tool_vmsd.obj: tool_vms.c $(CCD) $(CFLAGS) /Fo"$@" tool_vms.c tool_writeenvd.obj: tool_writeenv.c $(CCD) $(CFLAGS) /Fo"$@" tool_writeenv.c tool_writeoutd.obj: tool_writeout.c $(CCD) $(CFLAGS) /Fo"$@" tool_writeout.c tool_xattrd.obj: tool_xattr.c $(CCD) $(CFLAGS) /Fo"$@" tool_xattr.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 curl-7.35.0/src/Makefile.vc100000644000175000017500000004242512272124477012512 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1999 - 2013, 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. # #*************************************************************************** # All files in the Makefile.vc* series are generated automatically from the # one made for MSVC version 6. Alas, if you want to do changes to any of the # files and send back to the project, edit the version six, make your diff and # mail curl-users. ############################################################# # ## Makefile for building curl.exe with MSVC10 ## Use: nmake -f makefile.vc10 [release | debug] [CFG=release-ssl] ## (default is release) ## "nmake -f makefile.vc10 CFG=release-ssl" statically links OpenSSL ## into curl.exe producing a standalone SSL-enabled executable. ## # ############################################################# PROGRAM_NAME = curl.exe # ------------------------------------------- # Verify that current subdir is curl's 'src' # ------------------------------------------- !IF ! EXIST(.\tool_main.c) ! MESSAGE Can not process this makefile from outside of curl's 'src' subdirectory. ! MESSAGE Change to curl's 'src' subdirectory, and try again. ! ERROR See previous message. !ENDIF # ------------------------------------------------ # Makefile.msvc.names provides libcurl file names # ------------------------------------------------ !INCLUDE ..\winbuild\Makefile.msvc.names !IFNDEF OPENSSL_PATH OPENSSL_PATH = ../../openssl-0.9.8y !ENDIF !IFNDEF ZLIB_PATH ZLIB_PATH = ../../zlib-1.2.8 !ENDIF !IFNDEF MACHINE MACHINE = X86 !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". Since at least with MSVC10 the sspi.h # header is broken it is either required to install the Windows SDK, # or to fix sspi.h with adding this define at the beginning of sspi.h: # #define FreeCredentialHandle FreeCredentialsHandle # # 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/ # WINDOWS_SSPI = 1 !IFDEF WINDOWS_SSPI !IFNDEF WINDOWS_SDK_PATH WINDOWS_SDK_PATH = "$(PROGRAMFILES)\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 user32.lib WINSSL_CFLAGS = /DUSE_SCHANNEL #WINSSL_LIBS = gdi32.lib user32.lib # Runtime library configuration RTLIB = /MD RTLIBD = /MDd !IF "$(RTLIBCFG)" == "static" RTLIB = /MT RTLIBD = /MTd !ENDIF ## Release CCR = cl.exe $(RTLIB) /O2 /DNDEBUG LINKR = link.exe /incremental:no /libpath:"../lib" RCR = rc.exe /dDEBUGBUILD=0 ## Debug CCD = cl.exe $(RTLIBD) /Gm /ZI /Od /D_DEBUG /RTC1 LINKD = link.exe /incremental:yes /debug /libpath:"../lib" RCD = rc.exe /dDEBUGBUILD=1 CFLAGS = /I../lib /I../include /nologo /W3 /EHsc /DWIN32 /FD /c /D_BIND_TO_CURRENT_VCLIBS_VERSION=1 LFLAGS = /nologo /out:$(PROGRAM_NAME) /subsystem:console /machine:$(MACHINE) RESFLAGS = /i../include # This manifest thing is for VC8, enabled by the maketgz script that # builds the VC8 version of this makefile. Left commented out in the VC10 # version! #MANIFESTTOOL = mt -manifest $(PROGRAM_NAME).manifest -outputresource:$(PROGRAM_NAME);1 !IFDEF WINDOWS_SSPI CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include !ENDIF RELEASE_OBJS= \ nonblockr.obj \ rawstrr.obj \ strtoofftr.obj \ tool_binmoder.obj \ tool_bnamer.obj \ tool_cb_dbgr.obj \ tool_cb_hdrr.obj \ tool_cb_prgr.obj \ tool_cb_rear.obj \ tool_cb_seer.obj \ tool_cb_wrtr.obj \ tool_cfgabler.obj \ tool_convertr.obj \ tool_dirhier.obj \ tool_doswinr.obj \ tool_easysrcr.obj \ tool_formparser.obj \ tool_getparamr.obj \ tool_getpassr.obj \ tool_helpr.obj \ tool_helpersr.obj \ tool_homedirr.obj \ tool_hugehelpr.obj \ tool_libinfor.obj \ tool_mainr.obj \ tool_metalinkr.obj \ tool_mfilesr.obj \ tool_msgsr.obj \ tool_operater.obj \ tool_operhlpr.obj \ tool_panykeyr.obj \ tool_paramhlpr.obj \ tool_parsecfgr.obj \ tool_setoptr.obj \ tool_sleepr.obj \ tool_urlglobr.obj \ tool_utilr.obj \ tool_vmsr.obj \ tool_writeenvr.obj \ tool_writeoutr.obj \ tool_xattrr.obj \ curlr.res DEBUG_OBJS= \ nonblockd.obj \ rawstrd.obj \ strtoofftd.obj \ tool_binmoded.obj \ tool_bnamed.obj \ tool_cb_dbgd.obj \ tool_cb_hdrd.obj \ tool_cb_prgd.obj \ tool_cb_read.obj \ tool_cb_seed.obj \ tool_cb_wrtd.obj \ tool_cfgabled.obj \ tool_convertd.obj \ tool_dirhied.obj \ tool_doswind.obj \ tool_easysrcd.obj \ tool_formparsed.obj \ tool_getparamd.obj \ tool_getpassd.obj \ tool_helpd.obj \ tool_helpersd.obj \ tool_homedird.obj \ tool_hugehelpd.obj \ tool_libinfod.obj \ tool_maind.obj \ tool_metalinkd.obj \ tool_mfilesd.obj \ tool_msgsd.obj \ tool_operated.obj \ tool_operhlpd.obj \ tool_panykeyd.obj \ tool_paramhlpd.obj \ tool_parsecfgd.obj \ tool_setoptd.obj \ tool_sleepd.obj \ tool_urlglobd.obj \ tool_utild.obj \ tool_vmsd.obj \ tool_writeenvd.obj \ tool_writeoutd.obj \ tool_xattrd.obj \ curld.res ################################################# # If CFG not specified, use static libs CFLAGS = $(CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) ################################################# # release dynamic library !IF "$(CFG)" == "release-dll" LINKLIBS = $(LIBCURL_IMP_LIB_REL) LINKLIBS_DEBUG = $(LIBCURL_IMP_LIB_DBG) !ENDIF ################################################# # release static library with zlib !IF "$(CFG)" == "release-zlib" CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) $(ZLIB_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(ZLIB_LIBS) LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS) !ENDIF ################################################# # release static library with ssl !IF "$(CFG)" == "release-ssl" CFLAGS = $(CFLAGS) $(SSL_CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) $(SSL_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(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_REL) $(SSL_LIBS) LINKLIBS_DEBUG = $(LIBCURL_IMP_LIB_DBG) $(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_STA_LIB_REL) $(SSL_LIBS) $(ZLIB_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(SSL_LIBS) $(ZLIB_LIBS) LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(ZLIB_LFLAGS) !ENDIF ################################################# # release static library with winssl and zlib !IF "$(CFG)" == "release-winssl-zlib" CFLAGS = $(CFLAGS) $(WINSSL_CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) $(WINSSL_LIBS) $(ZLIB_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(WINSSL_LIBS) $(ZLIB_LIBS) LFLAGS = $(LFLAGS) $(WINSSL_LFLAGS) $(ZLIB_LFLAGS) !ENDIF ################################################# # release static library with dynamic ssl !IF "$(CFG)" == "release-ssl-dll" CFLAGS = $(CFLAGS) $(SSL_CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) $(SSL_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(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_STA_LIB_REL) $(ZLIB_IMP_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(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_REL) $(ZLIB_IMP_LIBS) LINKLIBS_DEBUG = $(LIBCURL_IMP_LIB_DBG) $(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_STA_LIB_REL) $(SSL_LIBS) $(ZLIB_IMP_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(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_REL) $(SSL_LIBS) $(ZLIB_IMP_LIBS) LINKLIBS_DEBUG = $(LIBCURL_IMP_LIB_DBG) $(SSL_LIBS) $(ZLIB_IMP_LIBS) LFLAGS = $(LFLAGS) $(SSL_IMP_LFLAGS) $(ZLIB_LFLAGS) !ENDIF LINKLIBS = $(LINKLIBS) ws2_32.lib wldap32.lib advapi32.lib LINKLIBS_DEBUG = $(LINKLIBS_DEBUG) ws2_32.lib wldap32.lib advapi32.lib all : release release: $(RELEASE_OBJS) $(LINKR) $(LFLAGS) $(LINKLIBS) $(RELEASE_OBJS) $(MANIFESTTOOL) debug: $(DEBUG_OBJS) $(LINKD) $(LFLAGS) $(LINKLIBS_DEBUG) $(DEBUG_OBJS) $(MANIFESTTOOL) ## Release nonblockr.obj: ../lib/nonblock.c $(CCR) $(CFLAGS) /Fo"$@" ../lib/nonblock.c rawstrr.obj: ../lib/rawstr.c $(CCR) $(CFLAGS) /Fo"$@" ../lib/rawstr.c strtoofftr.obj: ../lib/strtoofft.c $(CCR) $(CFLAGS) /Fo"$@" ../lib/strtoofft.c tool_binmoder.obj: tool_binmode.c $(CCR) $(CFLAGS) /Fo"$@" tool_binmode.c tool_bnamer.obj: tool_bname.c $(CCR) $(CFLAGS) /Fo"$@" tool_bname.c tool_cb_dbgr.obj: tool_cb_dbg.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_dbg.c tool_cb_hdrr.obj: tool_cb_hdr.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_hdr.c tool_cb_prgr.obj: tool_cb_prg.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_prg.c tool_cb_rear.obj: tool_cb_rea.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_rea.c tool_cb_seer.obj: tool_cb_see.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_see.c tool_cb_wrtr.obj: tool_cb_wrt.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_wrt.c tool_cfgabler.obj: tool_cfgable.c $(CCR) $(CFLAGS) /Fo"$@" tool_cfgable.c tool_convertr.obj: tool_convert.c $(CCR) $(CFLAGS) /Fo"$@" tool_convert.c tool_dirhier.obj: tool_dirhie.c $(CCR) $(CFLAGS) /Fo"$@" tool_dirhie.c tool_doswinr.obj: tool_doswin.c $(CCR) $(CFLAGS) /Fo"$@" tool_doswin.c tool_easysrcr.obj: tool_easysrc.c $(CCR) $(CFLAGS) /Fo"$@" tool_easysrc.c tool_formparser.obj: tool_formparse.c $(CCR) $(CFLAGS) /Fo"$@" tool_formparse.c tool_getparamr.obj: tool_getparam.c $(CCR) $(CFLAGS) /Fo"$@" tool_getparam.c tool_getpassr.obj: tool_getpass.c $(CCR) $(CFLAGS) /Fo"$@" tool_getpass.c tool_helpr.obj: tool_help.c $(CCR) $(CFLAGS) /Fo"$@" tool_help.c tool_helpersr.obj: tool_helpers.c $(CCR) $(CFLAGS) /Fo"$@" tool_helpers.c tool_homedirr.obj: tool_homedir.c $(CCR) $(CFLAGS) /Fo"$@" tool_homedir.c tool_hugehelpr.obj: tool_hugehelp.c $(CCR) $(CFLAGS) /Zm200 /Fo"$@" tool_hugehelp.c tool_libinfor.obj: tool_libinfo.c $(CCR) $(CFLAGS) /Fo"$@" tool_libinfo.c tool_mainr.obj: tool_main.c $(CCR) $(CFLAGS) /Fo"$@" tool_main.c tool_metalinkr.obj: tool_metalink.c $(CCR) $(CFLAGS) /Fo"$@" tool_metalink.c tool_mfilesr.obj: tool_mfiles.c $(CCR) $(CFLAGS) /Fo"$@" tool_mfiles.c tool_msgsr.obj: tool_msgs.c $(CCR) $(CFLAGS) /Fo"$@" tool_msgs.c tool_operater.obj: tool_operate.c $(CCR) $(CFLAGS) /Fo"$@" tool_operate.c tool_operhlpr.obj: tool_operhlp.c $(CCR) $(CFLAGS) /Fo"$@" tool_operhlp.c tool_panykeyr.obj: tool_panykey.c $(CCR) $(CFLAGS) /Fo"$@" tool_panykey.c tool_paramhlpr.obj: tool_paramhlp.c $(CCR) $(CFLAGS) /Fo"$@" tool_paramhlp.c tool_parsecfgr.obj: tool_parsecfg.c $(CCR) $(CFLAGS) /Fo"$@" tool_parsecfg.c tool_setoptr.obj: tool_setopt.c $(CCR) $(CFLAGS) /Fo"$@" tool_setopt.c tool_sleepr.obj: tool_sleep.c $(CCR) $(CFLAGS) /Fo"$@" tool_sleep.c tool_urlglobr.obj: tool_urlglob.c $(CCR) $(CFLAGS) /Fo"$@" tool_urlglob.c tool_utilr.obj: tool_util.c $(CCR) $(CFLAGS) /Fo"$@" tool_util.c tool_vmsr.obj: tool_vms.c $(CCR) $(CFLAGS) /Fo"$@" tool_vms.c tool_writeenvr.obj: tool_writeenv.c $(CCR) $(CFLAGS) /Fo"$@" tool_writeenv.c tool_writeoutr.obj: tool_writeout.c $(CCR) $(CFLAGS) /Fo"$@" tool_writeout.c tool_xattrr.obj: tool_xattr.c $(CCR) $(CFLAGS) /Fo"$@" tool_xattr.c curlr.res : curl.rc $(RCR) $(RESFLAGS) /Fo"$@" curl.rc ## Debug nonblockd.obj: ../lib/nonblock.c $(CCD) $(CFLAGS) /Fo"$@" ../lib/nonblock.c rawstrd.obj: ../lib/rawstr.c $(CCD) $(CFLAGS) /Fo"$@" ../lib/rawstr.c strtoofftd.obj: ../lib/strtoofft.c $(CCD) $(CFLAGS) /Fo"$@" ../lib/strtoofft.c tool_binmoded.obj: tool_binmode.c $(CCD) $(CFLAGS) /Fo"$@" tool_binmode.c tool_bnamed.obj: tool_bname.c $(CCD) $(CFLAGS) /Fo"$@" tool_bname.c tool_cb_dbgd.obj: tool_cb_dbg.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_dbg.c tool_cb_hdrd.obj: tool_cb_hdr.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_hdr.c tool_cb_prgd.obj: tool_cb_prg.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_prg.c tool_cb_read.obj: tool_cb_rea.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_rea.c tool_cb_seed.obj: tool_cb_see.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_see.c tool_cb_wrtd.obj: tool_cb_wrt.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_wrt.c tool_cfgabled.obj: tool_cfgable.c $(CCD) $(CFLAGS) /Fo"$@" tool_cfgable.c tool_convertd.obj: tool_convert.c $(CCD) $(CFLAGS) /Fo"$@" tool_convert.c tool_dirhied.obj: tool_dirhie.c $(CCD) $(CFLAGS) /Fo"$@" tool_dirhie.c tool_doswind.obj: tool_doswin.c $(CCD) $(CFLAGS) /Fo"$@" tool_doswin.c tool_easysrcd.obj: tool_easysrc.c $(CCD) $(CFLAGS) /Fo"$@" tool_easysrc.c tool_formparsed.obj: tool_formparse.c $(CCD) $(CFLAGS) /Fo"$@" tool_formparse.c tool_getparamd.obj: tool_getparam.c $(CCD) $(CFLAGS) /Fo"$@" tool_getparam.c tool_getpassd.obj: tool_getpass.c $(CCD) $(CFLAGS) /Fo"$@" tool_getpass.c tool_helpd.obj: tool_help.c $(CCD) $(CFLAGS) /Fo"$@" tool_help.c tool_helpersd.obj: tool_helpers.c $(CCD) $(CFLAGS) /Fo"$@" tool_helpers.c tool_homedird.obj: tool_homedir.c $(CCD) $(CFLAGS) /Fo"$@" tool_homedir.c tool_hugehelpd.obj: tool_hugehelp.c $(CCD) $(CFLAGS) /Zm200 /Fo"$@" tool_hugehelp.c tool_libinfod.obj: tool_libinfo.c $(CCD) $(CFLAGS) /Fo"$@" tool_libinfo.c tool_maind.obj: tool_main.c $(CCD) $(CFLAGS) /Fo"$@" tool_main.c tool_metalinkd.obj: tool_metalink.c $(CCD) $(CFLAGS) /Fo"$@" tool_metalink.c tool_mfilesd.obj: tool_mfiles.c $(CCD) $(CFLAGS) /Fo"$@" tool_mfiles.c tool_msgsd.obj: tool_msgs.c $(CCD) $(CFLAGS) /Fo"$@" tool_msgs.c tool_operated.obj: tool_operate.c $(CCD) $(CFLAGS) /Fo"$@" tool_operate.c tool_operhlpd.obj: tool_operhlp.c $(CCD) $(CFLAGS) /Fo"$@" tool_operhlp.c tool_panykeyd.obj: tool_panykey.c $(CCD) $(CFLAGS) /Fo"$@" tool_panykey.c tool_paramhlpd.obj: tool_paramhlp.c $(CCD) $(CFLAGS) /Fo"$@" tool_paramhlp.c tool_parsecfgd.obj: tool_parsecfg.c $(CCD) $(CFLAGS) /Fo"$@" tool_parsecfg.c tool_setoptd.obj: tool_setopt.c $(CCD) $(CFLAGS) /Fo"$@" tool_setopt.c tool_sleepd.obj: tool_sleep.c $(CCD) $(CFLAGS) /Fo"$@" tool_sleep.c tool_urlglobd.obj: tool_urlglob.c $(CCD) $(CFLAGS) /Fo"$@" tool_urlglob.c tool_utild.obj: tool_util.c $(CCD) $(CFLAGS) /Fo"$@" tool_util.c tool_vmsd.obj: tool_vms.c $(CCD) $(CFLAGS) /Fo"$@" tool_vms.c tool_writeenvd.obj: tool_writeenv.c $(CCD) $(CFLAGS) /Fo"$@" tool_writeenv.c tool_writeoutd.obj: tool_writeout.c $(CCD) $(CFLAGS) /Fo"$@" tool_writeout.c tool_xattrd.obj: tool_xattr.c $(CCD) $(CFLAGS) /Fo"$@" tool_xattr.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 curl-7.35.0/src/tool_cb_see.h0000644000175000017500000000277412213173003012713 00000000000000#ifndef HEADER_CURL_TOOL_CB_SEE_H #define HEADER_CURL_TOOL_CB_SEE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #if defined(WIN32) && !defined(__MINGW64__) int tool_ftruncate64(int fd, curl_off_t where); #undef ftruncate #define ftruncate(fd,where) tool_ftruncate64(fd,where) #ifndef HAVE_FTRUNCATE # define HAVE_FTRUNCATE 1 #endif #endif /* WIN32 && ! __MINGW64__ */ /* ** callback for CURLOPT_SEEKFUNCTION */ int tool_seek_cb(void *userdata, curl_off_t offset, int whence); #endif /* HEADER_CURL_TOOL_CB_SEE_H */ curl-7.35.0/src/tool_panykey.h0000644000175000017500000000242012213173003013137 00000000000000#ifndef HEADER_CURL_TOOL_PANYKEY_H #define HEADER_CURL_TOOL_PANYKEY_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #if defined(__SYMBIAN32__) || defined(NETWARE) void tool_pressanykey(void); #else #define tool_pressanykey() Curl_nop_stmt #endif #endif /* HEADER_CURL_TOOL_PANYKEY_H */ curl-7.35.0/src/tool_dirhie.c0000644000175000017500000000747112213173003012731 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "tool_setup.h" #include #ifdef WIN32 # include #endif #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ #include "curlx.h" #include "tool_dirhie.h" #include "memdebug.h" /* keep this as LAST include */ #ifdef NETWARE # ifndef __NOVELL_LIBC__ # define mkdir mkdir_510 # endif #endif #ifdef WIN32 # define mkdir(x,y) (mkdir)((x)) # ifndef __POCC__ # define F_OK 0 # endif #endif static void show_dir_errno(FILE *errors, const char *name) { switch(ERRNO) { #ifdef EACCES case EACCES: fprintf(errors, "You don't have permission to create %s.\n", name); break; #endif #ifdef ENAMETOOLONG case ENAMETOOLONG: fprintf(errors, "The directory name %s is too long.\n", name); break; #endif #ifdef EROFS case EROFS: fprintf(errors, "%s resides on a read-only file system.\n", name); break; #endif #ifdef ENOSPC case ENOSPC: fprintf(errors, "No space left on the file system that will " "contain the directory %s.\n", name); break; #endif #ifdef EDQUOT case EDQUOT: fprintf(errors, "Cannot create directory %s because you " "exceeded your quota.\n", name); break; #endif default : fprintf(errors, "Error creating directory %s.\n", name); break; } } /* * Create the needed directory hierarchy recursively in order to save * multi-GETs in file output, ie: * curl "http://my.site/dir[1-5]/file[1-5].txt" -o "dir#1/file#2.txt" * should create all the dir* automagically */ CURLcode create_dir_hierarchy(const char *outfile, FILE *errors) { char *tempdir; char *tempdir2; char *outdup; char *dirbuildup; CURLcode result = CURLE_OK; size_t outlen; outlen = strlen(outfile); outdup = strdup(outfile); if(!outdup) return CURLE_OUT_OF_MEMORY; dirbuildup = malloc(outlen + 1); if(!dirbuildup) { Curl_safefree(outdup); return CURLE_OUT_OF_MEMORY; } dirbuildup[0] = '\0'; tempdir = strtok(outdup, DIR_CHAR); while(tempdir != NULL) { tempdir2 = strtok(NULL, DIR_CHAR); /* since strtok returns a token for the last word even if not ending with DIR_CHAR, we need to prune it */ if(tempdir2 != NULL) { size_t dlen = strlen(dirbuildup); if(dlen) snprintf(&dirbuildup[dlen], outlen - dlen, "%s%s", DIR_CHAR, tempdir); else { if(0 != strncmp(outdup, DIR_CHAR, 1)) strcpy(dirbuildup, tempdir); else snprintf(dirbuildup, outlen, "%s%s", DIR_CHAR, tempdir); } if(access(dirbuildup, F_OK) == -1) { if(-1 == mkdir(dirbuildup,(mode_t)0000750)) { show_dir_errno(errors, dirbuildup); result = CURLE_WRITE_ERROR; break; /* get out of loop */ } } } tempdir = tempdir2; } Curl_safefree(dirbuildup); Curl_safefree(outdup); return result; } curl-7.35.0/src/tool_metalink.h0000644000175000017500000001247312213173003013274 00000000000000#ifndef HEADER_CURL_TOOL_METALINK_H #define HEADER_CURL_TOOL_METALINK_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "tool_setup.h" /* returns 1 for success, 0 otherwise (we use OpenSSL *_Init fncs directly) */ typedef int (* Curl_digest_init_func)(void *context); typedef void (* Curl_digest_update_func)(void *context, const unsigned char *data, unsigned int len); typedef void (* Curl_digest_final_func)(unsigned char *result, void *context); typedef struct { Curl_digest_init_func digest_init; /* Initialize context procedure */ Curl_digest_update_func digest_update; /* Update context with data */ Curl_digest_final_func digest_final; /* Get final result procedure */ unsigned int digest_ctxtsize; /* Context structure size */ unsigned int digest_resultlen; /* Result length (bytes) */ } digest_params; typedef struct { const digest_params *digest_hash; /* Hash function definition */ void *digest_hashctx; /* Hash function context */ } digest_context; digest_context * Curl_digest_init(const digest_params *dparams); int Curl_digest_update(digest_context *context, const unsigned char *data, unsigned int len); int Curl_digest_final(digest_context *context, unsigned char *result); typedef struct { const char *hash_name; const digest_params *dparams; } metalink_digest_def; typedef struct { const char *alias_name; const metalink_digest_def *digest_def; } metalink_digest_alias; typedef struct metalink_checksum { const metalink_digest_def *digest_def; /* raw digest value, not ascii hex digest */ unsigned char *digest; } metalink_checksum; typedef struct metalink_resource { struct metalink_resource *next; char *url; } metalink_resource; typedef struct metalinkfile { struct metalinkfile *next; char *filename; metalink_checksum *checksum; metalink_resource *resource; } metalinkfile; #ifdef USE_METALINK /* * curl requires libmetalink 0.1.0 or newer */ #define CURL_REQ_LIBMETALINK_MAJOR 0 #define CURL_REQ_LIBMETALINK_MINOR 1 #define CURL_REQ_LIBMETALINK_PATCH 0 #define CURL_REQ_LIBMETALINK_VERS ((CURL_REQ_LIBMETALINK_MAJOR * 10000) + \ (CURL_REQ_LIBMETALINK_MINOR * 100) + \ CURL_REQ_LIBMETALINK_PATCH) extern const digest_params MD5_DIGEST_PARAMS[1]; extern const digest_params SHA1_DIGEST_PARAMS[1]; extern const digest_params SHA256_DIGEST_PARAMS[1]; #include /* * Counts the resource in the metalinkfile. */ int count_next_metalink_resource(metalinkfile *mlfile); void clean_metalink(struct Configurable *config); /* * Performs final parse operation and extracts information from * Metalink and creates metalinkfile structs. * * This function returns 0 if it succeeds without warnings, or one of * the following negative error codes: * * -1: Parsing failed; or no file is found * -2: Parsing succeeded with some warnings. */ int parse_metalink(struct Configurable *config, struct OutStruct *outs, const char *metalink_url); /* * Callback function for CURLOPT_WRITEFUNCTION */ size_t metalink_write_cb(void *buffer, size_t sz, size_t nmemb, void *userdata); /* * Returns nonzero if content_type includes "application/metalink+xml" * media-type. The check is done in case-insensitive manner. */ int check_metalink_content_type(const char *content_type); /* * Check checksum of file denoted by filename. * * This function returns 1 if the checksum matches or one of the * following integers: * * 0: * Checksum didn't match. * -1: * Could not open file; or could not read data from file. * -2: * No checksum in Metalink supported, hash algorithm not available, or * Metalink does not contain checksum. */ int metalink_check_hash(struct Configurable *config, metalinkfile *mlfile, const char *filename); /* * Release resources allocated at global scope. */ void metalink_cleanup(void); #else /* USE_METALINK */ #define count_next_metalink_resource(x) 0 #define clean_metalink(x) Curl_nop_stmt /* metalink_cleanup() takes no arguments */ #define metalink_cleanup() Curl_nop_stmt #endif /* USE_METALINK */ #endif /* HEADER_CURL_TOOL_METALINK_H */ curl-7.35.0/src/tool_setopt.h0000644000175000017500000001240112262353672013015 00000000000000#ifndef HEADER_CURL_TOOL_SETOPT_H #define HEADER_CURL_TOOL_SETOPT_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "tool_setup.h" /* * Macros used in operate() */ #define SETOPT_CHECK(v) do { \ res = (v); \ if(res) \ goto show_error; \ } WHILE_FALSE #ifndef CURL_DISABLE_LIBCURL_OPTION /* Associate symbolic names with option values */ typedef struct { const char *name; long value; } NameValue; typedef struct { const char *name; unsigned long value; } NameValueUnsigned; extern const NameValue setopt_nv_CURLPROXY[]; extern const NameValue setopt_nv_CURL_HTTP_VERSION[]; extern const NameValue setopt_nv_CURL_SSLVERSION[]; extern const NameValue setopt_nv_CURL_TIMECOND[]; extern const NameValue setopt_nv_CURLFTPSSL_CCC[]; extern const NameValue setopt_nv_CURLUSESSL[]; extern const NameValue setopt_nv_CURL_NETRC[]; extern const NameValue setopt_nv_CURLPROTO[]; extern const NameValueUnsigned setopt_nv_CURLAUTH[]; /* Map options to NameValue sets */ #define setopt_nv_CURLOPT_HTTP_VERSION setopt_nv_CURL_HTTP_VERSION #define setopt_nv_CURLOPT_HTTPAUTH setopt_nv_CURLAUTH #define setopt_nv_CURLOPT_SSLVERSION setopt_nv_CURL_SSLVERSION #define setopt_nv_CURLOPT_TIMECONDITION setopt_nv_CURL_TIMECOND #define setopt_nv_CURLOPT_FTP_SSL_CCC setopt_nv_CURLFTPSSL_CCC #define setopt_nv_CURLOPT_USE_SSL setopt_nv_CURLUSESSL #define setopt_nv_CURLOPT_NETRC setopt_nv_CURL_NETRC #define setopt_nv_CURLOPT_PROTOCOLS setopt_nv_CURLPROTO #define setopt_nv_CURLOPT_REDIR_PROTOCOLS setopt_nv_CURLPROTO #define setopt_nv_CURLOPT_PROXYTYPE setopt_nv_CURLPROXY #define setopt_nv_CURLOPT_PROXYAUTH setopt_nv_CURLAUTH /* Intercept setopt calls for --libcurl */ CURLcode tool_setopt_enum(CURL *curl, struct Configurable *config, const char *name, CURLoption tag, const NameValue *nv, long lval); CURLcode tool_setopt_flags(CURL *curl, struct Configurable *config, const char *name, CURLoption tag, const NameValue *nv, long lval); CURLcode tool_setopt_bitmask(CURL *curl, struct Configurable *config, const char *name, CURLoption tag, const NameValueUnsigned *nv, long lval); CURLcode tool_setopt_httppost(CURL *curl, struct Configurable *config, const char *name, CURLoption tag, struct curl_httppost *httppost); CURLcode tool_setopt_slist(CURL *curl, struct Configurable *config, const char *name, CURLoption tag, struct curl_slist *list); CURLcode tool_setopt(CURL *curl, bool str, struct Configurable *config, const char *name, CURLoption tag, ...); #define my_setopt(x,y,z) \ SETOPT_CHECK(tool_setopt(x, FALSE, config, #y, y, z)) #define my_setopt_str(x,y,z) \ SETOPT_CHECK(tool_setopt(x, TRUE, config, #y, y, z)) #define my_setopt_enum(x,y,z) \ SETOPT_CHECK(tool_setopt_enum(x, config, #y, y, setopt_nv_ ## y, z)) #define my_setopt_flags(x,y,z) \ SETOPT_CHECK(tool_setopt_flags(x, config, #y, y, setopt_nv_ ## y, z)) #define my_setopt_bitmask(x,y,z) \ SETOPT_CHECK(tool_setopt_bitmask(x, config, #y, y, setopt_nv_ ## y, z)) #define my_setopt_httppost(x,y,z) \ SETOPT_CHECK(tool_setopt_httppost(x, config, #y, y, z)) #define my_setopt_slist(x,y,z) \ SETOPT_CHECK(tool_setopt_slist(x, config, #y, y, z)) #define res_setopt(x,y,z) tool_setopt(x, FALSE, config, #y, y, z) #define res_setopt_str(x,y,z) tool_setopt(x, TRUE, config, #y, y, z) #else /* CURL_DISABLE_LIBCURL_OPTION */ /* No --libcurl, so pass options directly to library */ #define my_setopt(x,y,z) \ SETOPT_CHECK(curl_easy_setopt(x, y, z)) #define my_setopt_str(x,y,z) \ SETOPT_CHECK(curl_easy_setopt(x, y, z)) #define my_setopt_enum(x,y,z) \ SETOPT_CHECK(curl_easy_setopt(x, y, z)) #define my_setopt_flags(x,y,z) \ SETOPT_CHECK(curl_easy_setopt(x, y, z)) #define my_setopt_bitmask(x,y,z) \ SETOPT_CHECK(curl_easy_setopt(x, y, z)) #define my_setopt_httppost(x,y,z) \ SETOPT_CHECK(curl_easy_setopt(x, y, z)) #define my_setopt_slist(x,y,z) \ SETOPT_CHECK(curl_easy_setopt(x, y, z)) #define res_setopt(x,y,z) curl_easy_setopt(x,y,z) #define res_setopt_str(x,y,z) curl_easy_setopt(x,y,z) #endif /* CURL_DISABLE_LIBCURL_OPTION */ #endif /* HEADER_CURL_TOOL_SETOPT_H */ curl-7.35.0/src/tool_cb_wrt.h0000644000175000017500000000240112213173003012736 00000000000000#ifndef HEADER_CURL_TOOL_CB_WRT_H #define HEADER_CURL_TOOL_CB_WRT_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" /* ** callback for CURLOPT_WRITEFUNCTION */ size_t tool_write_cb(void *buffer, size_t sz, size_t nmemb, void *userdata); #endif /* HEADER_CURL_TOOL_CB_WRT_H */ curl-7.35.0/src/tool_xattr.c0000644000175000017500000000550312262353672012641 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "tool_setup.h" #ifdef HAVE_FSETXATTR # include /* header from libc, not from libattr */ # define USE_XATTR #elif defined(__FreeBSD_version) && (__FreeBSD_version > 500000) # include # include # define USE_XATTR #endif #include "tool_xattr.h" #include "memdebug.h" /* keep this as LAST include */ #ifdef USE_XATTR /* mapping table of curl metadata to extended attribute names */ static const struct xattr_mapping { const char *attr; /* name of the xattr */ CURLINFO info; } mappings[] = { /* mappings proposed by * http://freedesktop.org/wiki/CommonExtendedAttributes */ { "user.xdg.origin.url", CURLINFO_EFFECTIVE_URL }, { "user.mime_type", CURLINFO_CONTENT_TYPE }, { NULL, CURLINFO_NONE } /* last element, abort loop here */ }; /* store metadata from the curl request alongside the downloaded * file using extended attributes */ int fwrite_xattr(CURL *curl, int fd) { int i = 0; int err = 0; /* loop through all xattr-curlinfo pairs and abort on a set error */ while(err == 0 && mappings[i].attr != NULL) { char *value = NULL; CURLcode rc = curl_easy_getinfo(curl, mappings[i].info, &value); if(rc == CURLE_OK && value) { #ifdef HAVE_FSETXATTR_6 err = fsetxattr(fd, mappings[i].attr, value, strlen(value), 0, 0); #elif defined(HAVE_FSETXATTR_5) err = fsetxattr(fd, mappings[i].attr, value, strlen(value), 0); #elif defined(__FreeBSD_version) err = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, mappings[i].attr, value, strlen(value)); /* FreeBSD's extattr_set_fd returns the length of the extended attribute */ err = err < 0 ? err : 0; #endif } i++; } return err; } #else int fwrite_xattr(CURL *curl, int fd) { (void)curl; (void)fd; return 0; } #endif curl-7.35.0/src/tool_dirhie.h0000644000175000017500000000231112213173003012722 00000000000000#ifndef HEADER_CURL_TOOL_DIRHIE_H #define HEADER_CURL_TOOL_DIRHIE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" CURLcode create_dir_hierarchy(const char *outfile, FILE *errors); #endif /* HEADER_CURL_TOOL_DIRHIE_H */ curl-7.35.0/src/tool_bname.h0000644000175000017500000000240012213173003012537 00000000000000#ifndef HEADER_CURL_TOOL_BNAME_H #define HEADER_CURL_TOOL_BNAME_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #ifndef HAVE_BASENAME char *tool_basename(char *path); #define basename(x) tool_basename((x)) #endif /* HAVE_BASENAME */ #endif /* HEADER_CURL_TOOL_BNAME_H */ curl-7.35.0/src/tool_writeenv.h0000644000175000017500000000237112213173003013327 00000000000000#ifndef HEADER_CURL_TOOL_WRITEENV_H #define HEADER_CURL_TOOL_WRITEENV_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #ifdef USE_ENVIRONMENT void ourWriteEnv(CURL *curl); #else # define ourWriteEnv(x) Curl_nop_stmt #endif #endif /* HEADER_CURL_TOOL_WRITEENV_H */ curl-7.35.0/src/tool_sleep.c0000644000175000017500000000316612213173003012572 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_SYS_POLL_H # include #elif defined(HAVE_POLL_H) # include #endif #ifdef MSDOS # include #endif #include "tool_sleep.h" #include "memdebug.h" /* keep this as LAST include */ void tool_go_sleep(long ms) { #if defined(MSDOS) delay(ms); #elif defined(WIN32) Sleep(ms); #elif defined(HAVE_POLL_FINE) poll((void *)0, 0, (int)ms); #else struct timeval timeout; timeout.tv_sec = ms / 1000L; ms = ms % 1000L; timeout.tv_usec = ms * 1000L; select(0, NULL, NULL, NULL, &timeout); #endif } curl-7.35.0/src/tool_easysrc.h0000644000175000017500000000411112213173003013127 00000000000000#ifndef HEADER_CURL_TOOL_EASYSRC_H #define HEADER_CURL_TOOL_EASYSRC_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #ifndef CURL_DISABLE_LIBCURL_OPTION /* global variable declarations, for easy-interface source code generation */ extern struct curl_slist *easysrc_decl; /* Variable declarations */ extern struct curl_slist *easysrc_data; /* Build slists, forms etc. */ extern struct curl_slist *easysrc_code; /* Setopt calls etc. */ extern struct curl_slist *easysrc_toohard; /* Unconvertible setopt */ extern struct curl_slist *easysrc_clean; /* Clean up (reverse order) */ extern int easysrc_form_count; /* Number of curl_httppost variables */ extern int easysrc_slist_count; /* Number of curl_slist variables */ extern CURLcode easysrc_init(void); extern CURLcode easysrc_add(struct curl_slist **plist, const char *bupf); extern CURLcode easysrc_addf(struct curl_slist **plist, const char *fmt, ...); extern CURLcode easysrc_perform(void); extern CURLcode easysrc_cleanup(void); void dumpeasysrc(struct Configurable *config); #endif /* CURL_DISABLE_LIBCURL_OPTION */ #endif /* HEADER_CURL_TOOL_EASYSRC_H */ curl-7.35.0/src/tool_homedir.h0000644000175000017500000000223612213173003013113 00000000000000#ifndef HEADER_CURL_TOOL_HOMEDIR_H #define HEADER_CURL_TOOL_HOMEDIR_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" char *homedir(void); #endif /* HEADER_CURL_TOOL_HOMEDIR_H */ curl-7.35.0/src/tool_help.c0000644000175000017500000003125112262353672012426 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "tool_setup.h" #include "tool_panykey.h" #include "tool_help.h" #include "memdebug.h" /* keep this as LAST include */ #ifdef MSDOS # define USE_WATT32 #endif /* * A few of these source lines are >80 columns wide, but that's only because * breaking the strings narrower makes this chunk look even worse! * * Starting with 7.18.0, this list of command line options is sorted based * on the long option name. It is not done automatically, although a command * line like the following can help out: * * curl --help | cut -c5- | grep "^-" | sort */ static const char *const helptext[] = { "Usage: curl [options...] ", "Options: (H) means HTTP/HTTPS only, (F) means FTP only", " --anyauth Pick \"any\" authentication method (H)", " -a, --append Append to target file when uploading (F/SFTP)", " --basic Use HTTP Basic Authentication (H)", " --cacert FILE CA certificate to verify peer against (SSL)", " --capath DIR CA directory to verify peer against (SSL)", " -E, --cert CERT[:PASSWD] Client certificate file and password (SSL)", " --cert-type TYPE Certificate file type (DER/PEM/ENG) (SSL)", " --ciphers LIST SSL ciphers to use (SSL)", " --compressed Request compressed response (using deflate or gzip)", " -K, --config FILE Specify which config file to read", " --connect-timeout SECONDS Maximum time allowed for connection", " -C, --continue-at OFFSET Resumed transfer offset", " -b, --cookie STRING/FILE String or file to read cookies from (H)", " -c, --cookie-jar FILE Write cookies to this file after operation (H)", " --create-dirs Create necessary local directory hierarchy", " --crlf Convert LF to CRLF in upload", " --crlfile FILE Get a CRL list in PEM format from the given file", " -d, --data DATA HTTP POST data (H)", " --data-ascii DATA HTTP POST ASCII data (H)", " --data-binary DATA HTTP POST binary data (H)", " --data-urlencode DATA HTTP POST data url encoded (H)", " --delegation STRING GSS-API delegation permission", " --digest Use HTTP Digest Authentication (H)", " --disable-eprt Inhibit using EPRT or LPRT (F)", " --disable-epsv Inhibit using EPSV (F)", " --dns-servers DNS server addrs to use: 1.1.1.1;2.2.2.2", " --dns-interface Interface to use for DNS requests", " --dns-ipv4-addr IPv4 address to use for DNS requests, dot notation", " --dns-ipv6-addr IPv6 address to use for DNS requests, dot notation", " -D, --dump-header FILE Write the headers to this file", " --egd-file FILE EGD socket path for random data (SSL)", " --engine ENGINE Crypto engine (SSL). \"--engine list\" for list", #ifdef USE_ENVIRONMENT " --environment Write results to environment variables (RISC OS)", #endif " -f, --fail Fail silently (no output at all) on HTTP errors (H)", " -F, --form CONTENT Specify HTTP multipart POST data (H)", " --form-string STRING Specify HTTP multipart POST data (H)", " --ftp-account DATA Account data string (F)", " --ftp-alternative-to-user COMMAND " "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)", " -P, --ftp-port ADR Use PORT with given address instead of PASV (F)", " --ftp-skip-pasv-ip Skip the IP address for PASV (F)\n" " --ftp-pret Send PRET before PASV (for drftpd) (F)", " --ftp-ssl-ccc Send CCC after authenticating (F)", " --ftp-ssl-ccc-mode ACTIVE/PASSIVE Set CCC mode (F)", " --ftp-ssl-control Require SSL/TLS for ftp login, " "clear for transfer (F)", " -G, --get Send the -d data with a HTTP GET (H)", " -g, --globoff Disable URL sequences and ranges using {} and []", " -H, --header LINE Custom header to pass to server (H)", " -I, --head Show document info only", " -h, --help This help text", " --hostpubmd5 MD5 " "Hex encoded MD5 string of the host public key. (SSH)", " -0, --http1.0 Use HTTP 1.0 (H)", " --http1.1 Use HTTP 1.1 (H)", " --http2.0 Use HTTP 2.0 (H)", " --ignore-content-length Ignore the HTTP Content-Length header", " -i, --include Include protocol headers in the output (H/F)", " -k, --insecure Allow connections to SSL sites without certs (H)", " --interface INTERFACE Specify network interface/address to use", " -4, --ipv4 Resolve name to IPv4 address", " -6, --ipv6 Resolve name to IPv6 address", " -j, --junk-session-cookies Ignore session cookies read from file (H)", " --keepalive-time SECONDS Interval between keepalive probes", " --key KEY Private key file name (SSL/SSH)", " --key-type TYPE Private key file type (DER/PEM/ENG) (SSL)", " --krb LEVEL Enable Kerberos with specified security level (F)", #ifndef CURL_DISABLE_LIBCURL_OPTION " --libcurl FILE Dump libcurl equivalent code of this command line", #endif " --limit-rate RATE Limit transfer speed to this rate", " -l, --list-only List only mode (F/POP3)", " --local-port RANGE Force use of these local port numbers", " -L, --location Follow redirects (H)", " --location-trusted like --location and send auth to other hosts (H)", " -M, --manual Display the full manual", " --mail-from FROM Mail from this address (SMTP)", " --mail-rcpt TO Mail to this/these addresses (SMTP)", " --mail-auth AUTH Originator address of the original email (SMTP)", " --max-filesize BYTES Maximum file size to download (H/F)", " --max-redirs NUM Maximum number of redirects allowed (H)", " -m, --max-time SECONDS Maximum time allowed for the transfer", " --metalink Process given URLs as metalink XML file", " --negotiate Use HTTP Negotiate Authentication (H)", " -n, --netrc Must read .netrc for user name and password", " --netrc-optional Use either .netrc or URL; overrides -n", " --netrc-file FILE Set up the netrc filename to use", " -N, --no-buffer Disable buffering of the output stream", " --no-keepalive Disable keepalive use on the connection", " --no-sessionid Disable SSL session-ID reusing (SSL)", " --noproxy List of hosts which do not use proxy", " --ntlm Use HTTP NTLM authentication (H)", " --oauth2-bearer TOKEN OAuth 2 Bearer Token (IMAP, POP3, SMTP)", " -o, --output FILE Write output to instead of stdout", " --pass PASS Pass phrase for the private key (SSL/SSH)", " --post301 " "Do not switch to GET after following a 301 redirect (H)", " --post302 " "Do not switch to GET after following a 302 redirect (H)", " --post303 " "Do not switch to GET after following a 303 redirect (H)", " -#, --progress-bar Display transfer progress as a progress bar", " --proto PROTOCOLS Enable/disable specified protocols", " --proto-redir PROTOCOLS " "Enable/disable specified protocols on redirect", " -x, --proxy [PROTOCOL://]HOST[:PORT] Use proxy on given port", " --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-negotiate Use Negotiate authentication on the proxy (H)", " --proxy-ntlm Use NTLM authentication on the proxy (H)", " -U, --proxy-user USER[:PASSWORD] Proxy user and password", " --proxy1.0 HOST[:PORT] Use HTTP/1.0 proxy on given port", " -p, --proxytunnel Operate through a HTTP proxy tunnel (using CONNECT)", " --pubkey KEY Public key file name (SSH)", " -Q, --quote CMD Send command(s) to server before transfer (F/SFTP)", " --random-file FILE File for reading random data from (SSL)", " -r, --range RANGE Retrieve only the bytes within a range", " --raw Do HTTP \"raw\", without any transfer decoding (H)", " -e, --referer Referer URL (H)", " -J, --remote-header-name Use the header-provided filename (H)", " -O, --remote-name Write output to a file named as the remote file", " --remote-name-all Use the remote file name for all URLs", " -R, --remote-time Set the remote file's time on the local output", " -X, --request COMMAND Specify request command to use", " --resolve HOST:PORT:ADDRESS Force resolve of HOST:PORT to ADDRESS", " --retry NUM " "Retry request NUM times if transient problems occur", " --retry-delay SECONDS " "When retrying, wait this many seconds between each", " --retry-max-time SECONDS Retry only within this period", " --sasl-ir Enable initial response in SASL authentication", " -S, --show-error " "Show error. With -s, make curl show errors when they occur", " -s, --silent Silent mode. Don't output anything", " --socks4 HOST[:PORT] SOCKS4 proxy on given host + port", " --socks4a HOST[:PORT] SOCKS4a proxy on given host + port", " --socks5 HOST[:PORT] SOCKS5 proxy on given host + port", " --socks5-hostname HOST[:PORT] " "SOCKS5 proxy, pass host name to proxy", #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) " --socks5-gssapi-service NAME SOCKS5 proxy service name for gssapi", " --socks5-gssapi-nec Compatibility with NEC SOCKS5 server", #endif " -Y, --speed-limit RATE " "Stop transfers below speed-limit for 'speed-time' secs", " -y, --speed-time SECONDS " "Time for trig speed-limit abort. Defaults to 30", " --ssl Try SSL/TLS (FTP, IMAP, POP3, SMTP)", " --ssl-reqd Require SSL/TLS (FTP, IMAP, POP3, SMTP)", " -2, --sslv2 Use SSLv2 (SSL)", " -3, --sslv3 Use SSLv3 (SSL)", " --ssl-allow-beast Allow security flaw to improve interop (SSL)", " --stderr FILE Where to redirect stderr. - means stdout", " --tcp-nodelay Use the TCP_NODELAY option", " -t, --telnet-option OPT=VAL Set telnet option", " --tftp-blksize VALUE Set TFTP BLKSIZE option (must be >512)", " -z, --time-cond TIME Transfer based on a time condition", " -1, --tlsv1 Use TLSv1 (SSL)", " --trace FILE Write a debug trace to the given file", " --trace-ascii FILE Like --trace but without the hex output", " --trace-time Add time stamps to trace/verbose output", " --tr-encoding Request compressed transfer encoding (H)", " -T, --upload-file FILE Transfer FILE to destination", " --url URL URL to work with", " -B, --use-ascii Use ASCII/text transfer", " -u, --user USER[:PASSWORD][;OPTIONS] Server user, password and login" " options", " --tlsuser USER TLS username", " --tlspassword STRING TLS password", " --tlsauthtype STRING TLS authentication type (default SRP)", " -A, --user-agent STRING User-Agent to send to server (H)", " -v, --verbose Make the operation more talkative", " -V, --version Show version number and quit", #ifdef USE_WATT32 " --wdebug Turn on Watt-32 debugging", #endif " -w, --write-out FORMAT What to output after completion", " --xattr Store metadata in extended file attributes", " -q If used as the first parameter disables .curlrc", NULL }; #ifdef NETWARE # define PRINT_LINES_PAUSE 23 #endif #ifdef __SYMBIAN32__ # define PRINT_LINES_PAUSE 16 #endif void tool_help(void) { int i; for(i = 0; helptext[i]; i++) { puts(helptext[i]); #ifdef PRINT_LINES_PAUSE if(i && ((i % PRINT_LINES_PAUSE) == 0)) tool_pressanykey(); #endif } } curl-7.35.0/src/tool_binmode.c0000644000175000017500000000266012213173003013075 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #ifdef HAVE_SETMODE #ifdef HAVE_IO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #include "tool_binmode.h" #include "memdebug.h" /* keep this as LAST include */ void set_binmode(FILE *stream) { #ifdef O_BINARY # ifdef __HIGHC__ _setmode(stream, O_BINARY); # else setmode(fileno(stream), O_BINARY); # endif #else (void)stream; #endif } #endif /* HAVE_SETMODE */ curl-7.35.0/src/tool_getparam.h0000644000175000017500000000346512262353672013311 00000000000000#ifndef HEADER_CURL_TOOL_GETPARAM_H #define HEADER_CURL_TOOL_GETPARAM_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" typedef enum { PARAM_OK = 0, PARAM_OPTION_AMBIGUOUS, PARAM_OPTION_UNKNOWN, PARAM_REQUIRES_PARAMETER, PARAM_BAD_USE, PARAM_HELP_REQUESTED, PARAM_GOT_EXTRA_PARAMETER, PARAM_BAD_NUMERIC, PARAM_NEGATIVE_NUMERIC, PARAM_LIBCURL_DOESNT_SUPPORT, PARAM_NO_MEM, PARAM_LAST } ParameterError; struct Configurable; ParameterError getparameter(char *flag, char *nextarg, bool *usedarg, struct Configurable *config); #ifdef UNITTESTS void parse_cert_parameter(const char *cert_parameter, char **certname, char **passphrase); #endif #endif /* HEADER_CURL_TOOL_GETPARAM_H */ curl-7.35.0/src/tool_cb_hdr.c0000644000175000017500000001354412213173003012704 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #include "rawstr.h" #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" #include "tool_msgs.h" #include "tool_cb_hdr.h" #include "memdebug.h" /* keep this as LAST include */ static char *parse_filename(const char *ptr, size_t len); /* ** callback for CURLOPT_HEADERFUNCTION */ size_t tool_header_cb(void *ptr, size_t size, size_t nmemb, void *userdata) { struct HdrCbData *hdrcbdata = userdata; struct OutStruct *outs = hdrcbdata->outs; struct OutStruct *heads = hdrcbdata->heads; const char *str = ptr; const size_t cb = size * nmemb; const char *end = (char*)ptr + cb; /* * Once that libcurl has called back tool_header_cb() the returned value * is checked against the amount that was intended to be written, if * it does not match then it fails with CURLE_WRITE_ERROR. So at this * point returning a value different from sz*nmemb indicates failure. */ size_t failure = (size * nmemb) ? 0 : 1; if(!heads->config) return failure; #ifdef DEBUGBUILD if(size * nmemb > (size_t)CURL_MAX_HTTP_HEADER) { warnf(heads->config, "Header data exceeds single call write limit!\n"); return failure; } #endif /* * Write header data when curl option --dump-header (-D) is given. */ if(heads->config->headerfile && heads->stream) { size_t rc = fwrite(ptr, size, nmemb, heads->stream); if(rc != cb) return rc; } /* * This callback sets the filename where output shall be written when * curl options --remote-name (-O) and --remote-header-name (-J) have * been simultaneously given and additionally server returns an HTTP * Content-Disposition header specifying a filename property. */ if(hdrcbdata->honor_cd_filename && (cb > 20) && checkprefix("Content-disposition:", str)) { const char *p = str + 20; /* look for the 'filename=' parameter (encoded filenames (*=) are not supported) */ for(;;) { char *filename; size_t len; while(*p && (p < end) && !ISALPHA(*p)) p++; if(p > end - 9) break; if(memcmp(p, "filename=", 9)) { /* no match, find next parameter */ while((p < end) && (*p != ';')) p++; continue; } p += 9; /* this expression below typecasts 'cb' only to avoid warning: signed and unsigned type in conditional expression */ len = (ssize_t)cb - (p - str); filename = parse_filename(p, len); if(filename) { outs->filename = filename; outs->alloc_filename = TRUE; outs->is_cd_filename = TRUE; outs->s_isreg = TRUE; outs->fopened = FALSE; outs->stream = NULL; hdrcbdata->honor_cd_filename = FALSE; break; } else return failure; } } return cb; } /* * Copies a file name part and returns an ALLOCATED data buffer. */ static char *parse_filename(const char *ptr, size_t len) { char *copy; char *p; char *q; char stop = '\0'; /* simple implementation of strndup() */ copy = malloc(len+1); if(!copy) return NULL; memcpy(copy, ptr, len); copy[len] = '\0'; p = copy; if(*p == '\'' || *p == '"') { /* store the starting quote */ stop = *p; p++; } else stop = ';'; /* if the filename contains a path, only use filename portion */ q = strrchr(copy, '/'); if(q) { p = q + 1; if(!*p) { Curl_safefree(copy); return NULL; } } /* If the filename contains a backslash, only use filename portion. The idea is that even systems that don't handle backslashes as path separators probably want the path removed for convenience. */ q = strrchr(p, '\\'); if(q) { p = q + 1; if(!*p) { Curl_safefree(copy); return NULL; } } /* scan for the end letter and stop there */ q = p; while(*q) { if(q[1] && (q[0] == '\\')) q++; else if(q[0] == stop) break; q++; } *q = '\0'; /* make sure the file name doesn't end in \r or \n */ q = strchr(p, '\r'); if(q) *q = '\0'; q = strchr(p, '\n'); if(q) *q = '\0'; if(copy != p) memmove(copy, p, strlen(p) + 1); /* in case we built debug enabled, we allow an evironment variable * named CURL_TESTDIR to prefix the given file name to put it into a * specific directory */ #ifdef DEBUGBUILD { char *tdir = curlx_getenv("CURL_TESTDIR"); if(tdir) { char buffer[512]; /* suitably large */ snprintf(buffer, sizeof(buffer), "%s/%s", tdir, copy); Curl_safefree(copy); copy = strdup(buffer); /* clone the buffer, we don't use the libcurl aprintf() or similar since we want to use the same memory code as the "real" parse_filename function */ curl_free(tdir); } } #endif return copy; } curl-7.35.0/src/tool_cb_dbg.h0000644000175000017500000000247712213173003012673 00000000000000#ifndef HEADER_CURL_TOOL_CB_DBG_H #define HEADER_CURL_TOOL_CB_DBG_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" /* ** callback for CURLOPT_DEBUGFUNCTION */ int tool_debug_cb(CURL *handle, curl_infotype type, unsigned char *data, size_t size, void *userdata); #endif /* HEADER_CURL_TOOL_CB_DBG_H */ curl-7.35.0/src/tool_help.h0000644000175000017500000000222712213173003012414 00000000000000#ifndef HEADER_CURL_TOOL_HELP_H #define HEADER_CURL_TOOL_HELP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" void tool_help(void); #endif /* HEADER_CURL_TOOL_HELP_H */ curl-7.35.0/src/tool_cb_rea.c0000644000175000017500000000330012213173003012663 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" #include "tool_cb_rea.h" #include "memdebug.h" /* keep this as LAST include */ /* ** callback for CURLOPT_READFUNCTION */ size_t tool_read_cb(void *buffer, size_t sz, size_t nmemb, void *userdata) { ssize_t rc; struct InStruct *in = userdata; rc = read(in->fd, buffer, sz*nmemb); if(rc < 0) { if(errno == EAGAIN) { errno = 0; in->config->readbusy = TRUE; return CURL_READFUNC_PAUSE; } /* since size_t is unsigned we can't return negative values fine */ rc = 0; } in->config->readbusy = FALSE; return (size_t)rc; } curl-7.35.0/src/tool_msgs.h0000644000175000017500000000236112213173003012434 00000000000000#ifndef HEADER_CURL_TOOL_MSGS_H #define HEADER_CURL_TOOL_MSGS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" void warnf(struct Configurable *config, const char *fmt, ...); void helpf(FILE *errors, const char *fmt, ...); #endif /* HEADER_CURL_TOOL_MSGS_H */ curl-7.35.0/src/Makefile.vc60000644000175000017500000004242012262353672012432 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1999 - 2013, 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. # #*************************************************************************** # All files in the Makefile.vc* series are generated automatically from the # one made for MSVC version 6. Alas, if you want to do changes to any of the # files and send back to the project, edit the version six, make your diff and # mail curl-users. ############################################################# # ## 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. ## # ############################################################# PROGRAM_NAME = curl.exe # ------------------------------------------- # Verify that current subdir is curl's 'src' # ------------------------------------------- !IF ! EXIST(.\tool_main.c) ! MESSAGE Can not process this makefile from outside of curl's 'src' subdirectory. ! MESSAGE Change to curl's 'src' subdirectory, and try again. ! ERROR See previous message. !ENDIF # ------------------------------------------------ # Makefile.msvc.names provides libcurl file names # ------------------------------------------------ !INCLUDE ..\winbuild\Makefile.msvc.names !IFNDEF OPENSSL_PATH OPENSSL_PATH = ../../openssl-0.9.8y !ENDIF !IFNDEF ZLIB_PATH ZLIB_PATH = ../../zlib-1.2.8 !ENDIF !IFNDEF MACHINE MACHINE = X86 !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". Since at least with MSVC6 the sspi.h # header is broken it is either required to install the Windows SDK, # or to fix sspi.h with adding this define at the beginning of sspi.h: # #define FreeCredentialHandle FreeCredentialsHandle # # 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/ # WINDOWS_SSPI = 1 !IFDEF WINDOWS_SSPI !IFNDEF WINDOWS_SDK_PATH WINDOWS_SDK_PATH = "$(PROGRAMFILES)\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 user32.lib WINSSL_CFLAGS = /DUSE_SCHANNEL #WINSSL_LIBS = gdi32.lib user32.lib # Runtime library configuration RTLIB = /MD RTLIBD = /MDd !IF "$(RTLIBCFG)" == "static" RTLIB = /MT RTLIBD = /MTd !ENDIF ## Release CCR = cl.exe $(RTLIB) /O2 /DNDEBUG LINKR = link.exe /incremental:no /libpath:"../lib" RCR = rc.exe /dDEBUGBUILD=0 ## Debug CCD = cl.exe $(RTLIBD) /Gm /ZI /Od /D_DEBUG /GZ LINKD = link.exe /incremental:yes /debug /libpath:"../lib" RCD = rc.exe /dDEBUGBUILD=1 CFLAGS = /I../lib /I../include /nologo /W3 /GX /DWIN32 /YX /FD /c /D_BIND_TO_CURRENT_VCLIBS_VERSION=1 LFLAGS = /nologo /out:$(PROGRAM_NAME) /subsystem:console /machine:$(MACHINE) RESFLAGS = /i../include # This manifest thing is for VC8, enabled by the maketgz script that # builds the VC8 version of this makefile. Left commented out in the VC6 # version! #MANIFESTTOOL = mt -manifest $(PROGRAM_NAME).manifest -outputresource:$(PROGRAM_NAME);1 !IFDEF WINDOWS_SSPI CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include !ENDIF RELEASE_OBJS= \ nonblockr.obj \ rawstrr.obj \ strtoofftr.obj \ tool_binmoder.obj \ tool_bnamer.obj \ tool_cb_dbgr.obj \ tool_cb_hdrr.obj \ tool_cb_prgr.obj \ tool_cb_rear.obj \ tool_cb_seer.obj \ tool_cb_wrtr.obj \ tool_cfgabler.obj \ tool_convertr.obj \ tool_dirhier.obj \ tool_doswinr.obj \ tool_easysrcr.obj \ tool_formparser.obj \ tool_getparamr.obj \ tool_getpassr.obj \ tool_helpr.obj \ tool_helpersr.obj \ tool_homedirr.obj \ tool_hugehelpr.obj \ tool_libinfor.obj \ tool_mainr.obj \ tool_metalinkr.obj \ tool_mfilesr.obj \ tool_msgsr.obj \ tool_operater.obj \ tool_operhlpr.obj \ tool_panykeyr.obj \ tool_paramhlpr.obj \ tool_parsecfgr.obj \ tool_setoptr.obj \ tool_sleepr.obj \ tool_urlglobr.obj \ tool_utilr.obj \ tool_vmsr.obj \ tool_writeenvr.obj \ tool_writeoutr.obj \ tool_xattrr.obj \ curlr.res DEBUG_OBJS= \ nonblockd.obj \ rawstrd.obj \ strtoofftd.obj \ tool_binmoded.obj \ tool_bnamed.obj \ tool_cb_dbgd.obj \ tool_cb_hdrd.obj \ tool_cb_prgd.obj \ tool_cb_read.obj \ tool_cb_seed.obj \ tool_cb_wrtd.obj \ tool_cfgabled.obj \ tool_convertd.obj \ tool_dirhied.obj \ tool_doswind.obj \ tool_easysrcd.obj \ tool_formparsed.obj \ tool_getparamd.obj \ tool_getpassd.obj \ tool_helpd.obj \ tool_helpersd.obj \ tool_homedird.obj \ tool_hugehelpd.obj \ tool_libinfod.obj \ tool_maind.obj \ tool_metalinkd.obj \ tool_mfilesd.obj \ tool_msgsd.obj \ tool_operated.obj \ tool_operhlpd.obj \ tool_panykeyd.obj \ tool_paramhlpd.obj \ tool_parsecfgd.obj \ tool_setoptd.obj \ tool_sleepd.obj \ tool_urlglobd.obj \ tool_utild.obj \ tool_vmsd.obj \ tool_writeenvd.obj \ tool_writeoutd.obj \ tool_xattrd.obj \ curld.res ################################################# # If CFG not specified, use static libs CFLAGS = $(CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) ################################################# # release dynamic library !IF "$(CFG)" == "release-dll" LINKLIBS = $(LIBCURL_IMP_LIB_REL) LINKLIBS_DEBUG = $(LIBCURL_IMP_LIB_DBG) !ENDIF ################################################# # release static library with zlib !IF "$(CFG)" == "release-zlib" CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) $(ZLIB_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(ZLIB_LIBS) LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS) !ENDIF ################################################# # release static library with ssl !IF "$(CFG)" == "release-ssl" CFLAGS = $(CFLAGS) $(SSL_CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) $(SSL_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(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_REL) $(SSL_LIBS) LINKLIBS_DEBUG = $(LIBCURL_IMP_LIB_DBG) $(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_STA_LIB_REL) $(SSL_LIBS) $(ZLIB_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(SSL_LIBS) $(ZLIB_LIBS) LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(ZLIB_LFLAGS) !ENDIF ################################################# # release static library with winssl and zlib !IF "$(CFG)" == "release-winssl-zlib" CFLAGS = $(CFLAGS) $(WINSSL_CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) $(WINSSL_LIBS) $(ZLIB_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(WINSSL_LIBS) $(ZLIB_LIBS) LFLAGS = $(LFLAGS) $(WINSSL_LFLAGS) $(ZLIB_LFLAGS) !ENDIF ################################################# # release static library with dynamic ssl !IF "$(CFG)" == "release-ssl-dll" CFLAGS = $(CFLAGS) $(SSL_CFLAGS) /DCURL_STATICLIB LINKLIBS = $(LIBCURL_STA_LIB_REL) $(SSL_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(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_STA_LIB_REL) $(ZLIB_IMP_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(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_REL) $(ZLIB_IMP_LIBS) LINKLIBS_DEBUG = $(LIBCURL_IMP_LIB_DBG) $(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_STA_LIB_REL) $(SSL_LIBS) $(ZLIB_IMP_LIBS) LINKLIBS_DEBUG = $(LIBCURL_STA_LIB_DBG) $(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_REL) $(SSL_LIBS) $(ZLIB_IMP_LIBS) LINKLIBS_DEBUG = $(LIBCURL_IMP_LIB_DBG) $(SSL_LIBS) $(ZLIB_IMP_LIBS) LFLAGS = $(LFLAGS) $(SSL_IMP_LFLAGS) $(ZLIB_LFLAGS) !ENDIF LINKLIBS = $(LINKLIBS) ws2_32.lib wldap32.lib advapi32.lib LINKLIBS_DEBUG = $(LINKLIBS_DEBUG) ws2_32.lib wldap32.lib advapi32.lib all : release release: $(RELEASE_OBJS) $(LINKR) $(LFLAGS) $(LINKLIBS) $(RELEASE_OBJS) $(MANIFESTTOOL) debug: $(DEBUG_OBJS) $(LINKD) $(LFLAGS) $(LINKLIBS_DEBUG) $(DEBUG_OBJS) $(MANIFESTTOOL) ## Release nonblockr.obj: ../lib/nonblock.c $(CCR) $(CFLAGS) /Fo"$@" ../lib/nonblock.c rawstrr.obj: ../lib/rawstr.c $(CCR) $(CFLAGS) /Fo"$@" ../lib/rawstr.c strtoofftr.obj: ../lib/strtoofft.c $(CCR) $(CFLAGS) /Fo"$@" ../lib/strtoofft.c tool_binmoder.obj: tool_binmode.c $(CCR) $(CFLAGS) /Fo"$@" tool_binmode.c tool_bnamer.obj: tool_bname.c $(CCR) $(CFLAGS) /Fo"$@" tool_bname.c tool_cb_dbgr.obj: tool_cb_dbg.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_dbg.c tool_cb_hdrr.obj: tool_cb_hdr.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_hdr.c tool_cb_prgr.obj: tool_cb_prg.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_prg.c tool_cb_rear.obj: tool_cb_rea.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_rea.c tool_cb_seer.obj: tool_cb_see.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_see.c tool_cb_wrtr.obj: tool_cb_wrt.c $(CCR) $(CFLAGS) /Fo"$@" tool_cb_wrt.c tool_cfgabler.obj: tool_cfgable.c $(CCR) $(CFLAGS) /Fo"$@" tool_cfgable.c tool_convertr.obj: tool_convert.c $(CCR) $(CFLAGS) /Fo"$@" tool_convert.c tool_dirhier.obj: tool_dirhie.c $(CCR) $(CFLAGS) /Fo"$@" tool_dirhie.c tool_doswinr.obj: tool_doswin.c $(CCR) $(CFLAGS) /Fo"$@" tool_doswin.c tool_easysrcr.obj: tool_easysrc.c $(CCR) $(CFLAGS) /Fo"$@" tool_easysrc.c tool_formparser.obj: tool_formparse.c $(CCR) $(CFLAGS) /Fo"$@" tool_formparse.c tool_getparamr.obj: tool_getparam.c $(CCR) $(CFLAGS) /Fo"$@" tool_getparam.c tool_getpassr.obj: tool_getpass.c $(CCR) $(CFLAGS) /Fo"$@" tool_getpass.c tool_helpr.obj: tool_help.c $(CCR) $(CFLAGS) /Fo"$@" tool_help.c tool_helpersr.obj: tool_helpers.c $(CCR) $(CFLAGS) /Fo"$@" tool_helpers.c tool_homedirr.obj: tool_homedir.c $(CCR) $(CFLAGS) /Fo"$@" tool_homedir.c tool_hugehelpr.obj: tool_hugehelp.c $(CCR) $(CFLAGS) /Zm200 /Fo"$@" tool_hugehelp.c tool_libinfor.obj: tool_libinfo.c $(CCR) $(CFLAGS) /Fo"$@" tool_libinfo.c tool_mainr.obj: tool_main.c $(CCR) $(CFLAGS) /Fo"$@" tool_main.c tool_metalinkr.obj: tool_metalink.c $(CCR) $(CFLAGS) /Fo"$@" tool_metalink.c tool_mfilesr.obj: tool_mfiles.c $(CCR) $(CFLAGS) /Fo"$@" tool_mfiles.c tool_msgsr.obj: tool_msgs.c $(CCR) $(CFLAGS) /Fo"$@" tool_msgs.c tool_operater.obj: tool_operate.c $(CCR) $(CFLAGS) /Fo"$@" tool_operate.c tool_operhlpr.obj: tool_operhlp.c $(CCR) $(CFLAGS) /Fo"$@" tool_operhlp.c tool_panykeyr.obj: tool_panykey.c $(CCR) $(CFLAGS) /Fo"$@" tool_panykey.c tool_paramhlpr.obj: tool_paramhlp.c $(CCR) $(CFLAGS) /Fo"$@" tool_paramhlp.c tool_parsecfgr.obj: tool_parsecfg.c $(CCR) $(CFLAGS) /Fo"$@" tool_parsecfg.c tool_setoptr.obj: tool_setopt.c $(CCR) $(CFLAGS) /Fo"$@" tool_setopt.c tool_sleepr.obj: tool_sleep.c $(CCR) $(CFLAGS) /Fo"$@" tool_sleep.c tool_urlglobr.obj: tool_urlglob.c $(CCR) $(CFLAGS) /Fo"$@" tool_urlglob.c tool_utilr.obj: tool_util.c $(CCR) $(CFLAGS) /Fo"$@" tool_util.c tool_vmsr.obj: tool_vms.c $(CCR) $(CFLAGS) /Fo"$@" tool_vms.c tool_writeenvr.obj: tool_writeenv.c $(CCR) $(CFLAGS) /Fo"$@" tool_writeenv.c tool_writeoutr.obj: tool_writeout.c $(CCR) $(CFLAGS) /Fo"$@" tool_writeout.c tool_xattrr.obj: tool_xattr.c $(CCR) $(CFLAGS) /Fo"$@" tool_xattr.c curlr.res : curl.rc $(RCR) $(RESFLAGS) /Fo"$@" curl.rc ## Debug nonblockd.obj: ../lib/nonblock.c $(CCD) $(CFLAGS) /Fo"$@" ../lib/nonblock.c rawstrd.obj: ../lib/rawstr.c $(CCD) $(CFLAGS) /Fo"$@" ../lib/rawstr.c strtoofftd.obj: ../lib/strtoofft.c $(CCD) $(CFLAGS) /Fo"$@" ../lib/strtoofft.c tool_binmoded.obj: tool_binmode.c $(CCD) $(CFLAGS) /Fo"$@" tool_binmode.c tool_bnamed.obj: tool_bname.c $(CCD) $(CFLAGS) /Fo"$@" tool_bname.c tool_cb_dbgd.obj: tool_cb_dbg.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_dbg.c tool_cb_hdrd.obj: tool_cb_hdr.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_hdr.c tool_cb_prgd.obj: tool_cb_prg.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_prg.c tool_cb_read.obj: tool_cb_rea.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_rea.c tool_cb_seed.obj: tool_cb_see.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_see.c tool_cb_wrtd.obj: tool_cb_wrt.c $(CCD) $(CFLAGS) /Fo"$@" tool_cb_wrt.c tool_cfgabled.obj: tool_cfgable.c $(CCD) $(CFLAGS) /Fo"$@" tool_cfgable.c tool_convertd.obj: tool_convert.c $(CCD) $(CFLAGS) /Fo"$@" tool_convert.c tool_dirhied.obj: tool_dirhie.c $(CCD) $(CFLAGS) /Fo"$@" tool_dirhie.c tool_doswind.obj: tool_doswin.c $(CCD) $(CFLAGS) /Fo"$@" tool_doswin.c tool_easysrcd.obj: tool_easysrc.c $(CCD) $(CFLAGS) /Fo"$@" tool_easysrc.c tool_formparsed.obj: tool_formparse.c $(CCD) $(CFLAGS) /Fo"$@" tool_formparse.c tool_getparamd.obj: tool_getparam.c $(CCD) $(CFLAGS) /Fo"$@" tool_getparam.c tool_getpassd.obj: tool_getpass.c $(CCD) $(CFLAGS) /Fo"$@" tool_getpass.c tool_helpd.obj: tool_help.c $(CCD) $(CFLAGS) /Fo"$@" tool_help.c tool_helpersd.obj: tool_helpers.c $(CCD) $(CFLAGS) /Fo"$@" tool_helpers.c tool_homedird.obj: tool_homedir.c $(CCD) $(CFLAGS) /Fo"$@" tool_homedir.c tool_hugehelpd.obj: tool_hugehelp.c $(CCD) $(CFLAGS) /Zm200 /Fo"$@" tool_hugehelp.c tool_libinfod.obj: tool_libinfo.c $(CCD) $(CFLAGS) /Fo"$@" tool_libinfo.c tool_maind.obj: tool_main.c $(CCD) $(CFLAGS) /Fo"$@" tool_main.c tool_metalinkd.obj: tool_metalink.c $(CCD) $(CFLAGS) /Fo"$@" tool_metalink.c tool_mfilesd.obj: tool_mfiles.c $(CCD) $(CFLAGS) /Fo"$@" tool_mfiles.c tool_msgsd.obj: tool_msgs.c $(CCD) $(CFLAGS) /Fo"$@" tool_msgs.c tool_operated.obj: tool_operate.c $(CCD) $(CFLAGS) /Fo"$@" tool_operate.c tool_operhlpd.obj: tool_operhlp.c $(CCD) $(CFLAGS) /Fo"$@" tool_operhlp.c tool_panykeyd.obj: tool_panykey.c $(CCD) $(CFLAGS) /Fo"$@" tool_panykey.c tool_paramhlpd.obj: tool_paramhlp.c $(CCD) $(CFLAGS) /Fo"$@" tool_paramhlp.c tool_parsecfgd.obj: tool_parsecfg.c $(CCD) $(CFLAGS) /Fo"$@" tool_parsecfg.c tool_setoptd.obj: tool_setopt.c $(CCD) $(CFLAGS) /Fo"$@" tool_setopt.c tool_sleepd.obj: tool_sleep.c $(CCD) $(CFLAGS) /Fo"$@" tool_sleep.c tool_urlglobd.obj: tool_urlglob.c $(CCD) $(CFLAGS) /Fo"$@" tool_urlglob.c tool_utild.obj: tool_util.c $(CCD) $(CFLAGS) /Fo"$@" tool_util.c tool_vmsd.obj: tool_vms.c $(CCD) $(CFLAGS) /Fo"$@" tool_vms.c tool_writeenvd.obj: tool_writeenv.c $(CCD) $(CFLAGS) /Fo"$@" tool_writeenv.c tool_writeoutd.obj: tool_writeout.c $(CCD) $(CFLAGS) /Fo"$@" tool_writeout.c tool_xattrd.obj: tool_xattr.c $(CCD) $(CFLAGS) /Fo"$@" tool_xattr.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 curl-7.35.0/src/tool_cb_rea.h0000644000175000017500000000237712213173003012705 00000000000000#ifndef HEADER_CURL_TOOL_CB_REA_H #define HEADER_CURL_TOOL_CB_REA_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" /* ** callback for CURLOPT_READFUNCTION */ size_t tool_read_cb(void *buffer, size_t sz, size_t nmemb, void *userdata); #endif /* HEADER_CURL_TOOL_CB_REA_H */ curl-7.35.0/src/tool_convert.c0000644000175000017500000001061712213173003013141 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" #ifdef CURL_DOES_CONVERSIONS #ifdef HAVE_ICONV # include #endif #include "tool_convert.h" #include "memdebug.h" /* keep this as LAST include */ #ifdef HAVE_ICONV /* curl tool iconv conversion descriptors */ static iconv_t inbound_cd = (iconv_t)-1; static iconv_t outbound_cd = (iconv_t)-1; /* set default codesets for iconv */ #ifndef CURL_ICONV_CODESET_OF_NETWORK # define CURL_ICONV_CODESET_OF_NETWORK "ISO8859-1" #endif /* * convert_to_network() is a curl tool function to convert * from the host encoding to ASCII on non-ASCII platforms. */ CURLcode convert_to_network(char *buffer, size_t length) { /* translate from the host encoding to the network encoding */ char *input_ptr, *output_ptr; size_t res, in_bytes, out_bytes; /* open an iconv conversion descriptor if necessary */ if(outbound_cd == (iconv_t)-1) { outbound_cd = iconv_open(CURL_ICONV_CODESET_OF_NETWORK, CURL_ICONV_CODESET_OF_HOST); if(outbound_cd == (iconv_t)-1) { return CURLE_CONV_FAILED; } } /* call iconv */ input_ptr = output_ptr = buffer; in_bytes = out_bytes = length; res = iconv(outbound_cd, &input_ptr, &in_bytes, &output_ptr, &out_bytes); if((res == (size_t)-1) || (in_bytes != 0)) { return CURLE_CONV_FAILED; } return CURLE_OK; } /* * convert_from_network() is a curl tool function * for performing ASCII conversions on non-ASCII platforms. */ CURLcode convert_from_network(char *buffer, size_t length) { /* translate from the network encoding to the host encoding */ char *input_ptr, *output_ptr; size_t res, in_bytes, out_bytes; /* open an iconv conversion descriptor if necessary */ if(inbound_cd == (iconv_t)-1) { inbound_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST, CURL_ICONV_CODESET_OF_NETWORK); if(inbound_cd == (iconv_t)-1) { return CURLE_CONV_FAILED; } } /* call iconv */ input_ptr = output_ptr = buffer; in_bytes = out_bytes = length; res = iconv(inbound_cd, &input_ptr, &in_bytes, &output_ptr, &out_bytes); if((res == (size_t)-1) || (in_bytes != 0)) { return CURLE_CONV_FAILED; } return CURLE_OK; } void convert_cleanup(void) { /* close iconv conversion descriptors */ if(inbound_cd != (iconv_t)-1) (void)iconv_close(inbound_cd); if(outbound_cd != (iconv_t)-1) (void)iconv_close(outbound_cd); } #endif /* HAVE_ICONV */ char convert_char(curl_infotype infotype, char this_char) { /* determine how this specific character should be displayed */ switch(infotype) { case CURLINFO_DATA_IN: case CURLINFO_DATA_OUT: case CURLINFO_SSL_DATA_IN: case CURLINFO_SSL_DATA_OUT: /* data, treat as ASCII */ if((this_char >= 0x20) && (this_char < 0x7f)) { /* printable ASCII hex value: convert to host encoding */ (void)convert_from_network(&this_char, 1); } else { /* non-printable ASCII, use a replacement character */ return UNPRINTABLE_CHAR; } /* fall through to default */ default: /* treat as host encoding */ if(ISPRINT(this_char) && (this_char != '\t') && (this_char != '\r') && (this_char != '\n')) { /* printable characters excluding tabs and line end characters */ return this_char; } break; } /* non-printable, use a replacement character */ return UNPRINTABLE_CHAR; } #endif /* CURL_DOES_CONVERSIONS */ curl-7.35.0/src/tool_xattr.h0000644000175000017500000000225112213173003012623 00000000000000#ifndef HEADER_CURL_TOOL_XATTR_H #define HEADER_CURL_TOOL_XATTR_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "tool_setup.h" int fwrite_xattr(CURL *curl, int fd); #endif /* HEADER_CURL_TOOL_XATTR_H */ curl-7.35.0/src/Makefile.b320000644000175000017500000000702112262353672012320 00000000000000############################################################ # # 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 # # Initially written by Jaepil Kim, pit@paradise.net.nz ############################################################ !if "$(__MAKE__)" == "" !error __MAKE__ not defined. Use Borlands's MAKE to process this makefile. !endif # Borland's $(MAKEDIR) expands to the path where make.exe is located, # use this feature to define BCCDIR when user has not defined BCCDIR. !ifndef BCCDIR BCCDIR = $(MAKEDIR)\.. !endif # Edit the path below to point to the base of your Zlib sources. !ifndef ZLIB_PATH ZLIB_PATH = ..\..\zlib-1.2.8 !endif # Edit the path below to point to the base of your OpenSSL package. !ifndef OPENSSL_PATH OPENSSL_PATH = ..\..\openssl-0.9.8y !endif # Set program's name PROGNAME = curl.exe # Setup environment PP_CMD = cpp32 -q -P- CC_CMD = bcc32 -q -c LD = bcc32 RM = del 2>NUL MKDIR = md RMDIR = rd /q 2>NUL COPY = $(COMSPEC) /c copy /y CC_FLAGS = -5 -O2 -tWM -w -w-aus -w-ccc -w-dup -w-prc -w-pro -w-rch -w-sig -w-spa -w-inl -w-pia -w-pin -Dinline=__inline LDFLAGS = -q -lq -lap SRCDIRS = .;..\lib OBJDIR = .\BCC_objs INCDIRS = -I.;..\include;..\lib LINKLIB = $(BCCDIR)\lib\cw32mt.lib $(BCCDIR)\lib\ws2_32.lib DEFINES = -DNDEBUG -DWIN32 !ifdef DYNAMIC LIBCURL_LIB = ..\lib\libcurl_imp.lib !else LIBCURL_LIB = ..\lib\libcurl.lib DEFINES = $(DEFINES) -DCURL_STATICLIB !endif # ZLIB support is enabled setting WITH_ZLIB=1 !ifdef WITH_ZLIB DEFINES = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H INCDIRS = $(INCDIRS);$(ZLIB_PATH) LINKLIB = $(LINKLIB) $(ZLIB_PATH)\zlib.lib !endif # SSL support is enabled setting WITH_SSL=1 !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 .path.c = $(SRCDIRS) .path.obj = $(OBJDIR) .path.int = $(OBJDIR) # Makefile.inc provides the CSOURCES and HHEADERS defines !include Makefile.inc CSOURCES = $(CURL_CFILES) $(CURLX_ONES:../lib/=) OBJECTS = $(CSOURCES:.c=.obj) PREPROCESSED = $(CSOURCES:.c=.int) # Borland's command line compiler (BCC32) version 5.5.1 integrated # preprocessor has a bug which results in silently generating wrong # definitions for libcurl macros such as CURL_OFF_T_C, on the other # hand Borland's command line preprocessor (CPP32) version 5.5.1 does # not have the bug and achieves proper results. In order to avoid the # silent bug we first preprocess source files and later compile the # preprocessed result. .c.obj: @-$(RM) $(@R).int $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<) $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int all: $(OBJDIR) tool_hugehelp $(PROGNAME) clean: cd $(OBJDIR) @-$(RM) $(OBJECTS) @-$(RM) $(PREPROCESSED) cd .. @-$(RMDIR) $(OBJDIR) @-$(RM) $(PROGNAME) @-$(RM) curl.tds $(OBJDIR): @-$(RMDIR) $(OBJDIR) @-$(MKDIR) $(OBJDIR) !ifdef WITH_ZLIB tool_hugehelp: ..\docs\MANUAL ..\docs\curl.1 mkhelp.pl groff -Tascii -man -P -c ../docs/curl.1 > tool_hugehelp.tmp perl -w mkhelp.pl -c ../docs/MANUAL < tool_hugehelp.tmp > tool_hugehelp.c @-$(RM) tool_hugehelp.tmp !else tool_hugehelp: if exist ..\GIT-INFO $(COPY) tool_hugehelp.c.cvs tool_hugehelp.c !endif $(PROGNAME): $(OBJECTS) $(LIBCURL_LIB) $(LINKLIB) @-$(RM) $(PROGNAME) $(LD) $(LDFLAGS) -e$@ @&&! $(**: = ^ ) ! # End of Makefile.b32 curl-7.35.0/src/tool_paramhlp.h0000644000175000017500000000377212270035364013310 00000000000000#ifndef HEADER_CURL_TOOL_PARAMHLP_H #define HEADER_CURL_TOOL_PARAMHLP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include "tool_setup.h" struct getout *new_getout(struct Configurable *config); ParameterError file2string(char **bufp, FILE *file); ParameterError file2memory(char **bufp, size_t *size, FILE *file); void cleanarg(char *str); ParameterError str2num(long *val, const char *str); ParameterError str2unum(long *val, const char *str); ParameterError str2double(double *val, const char *str); ParameterError str2udouble(double *val, const char *str); long proto2num(struct Configurable *config, long *val, const char *str); ParameterError str2offset(curl_off_t *val, const char *str); CURLcode checkpasswd(const char *kind, char **userpwd); ParameterError add2list(struct curl_slist **list, const char *ptr); int ftpfilemethod(struct Configurable *config, const char *str); int ftpcccmethod(struct Configurable *config, const char *str); long delegation(struct Configurable *config, char *str); #endif /* HEADER_CURL_TOOL_PARAMHLP_H */ curl-7.35.0/src/tool_setopt.c0000644000175000017500000003651112262353672013020 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "tool_setup.h" #ifndef CURL_DISABLE_LIBCURL_OPTION #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" #include "tool_easysrc.h" #include "tool_setopt.h" #include "memdebug.h" /* keep this as LAST include */ /* Lookup tables for converting setopt values back to symbols */ /* For enums, values may be in any order. */ /* For bit masks, put combinations first, then single bits, */ /* and finally any "NONE" value. */ #define NV(e) {#e, e} #define NV1(e, v) {#e, (v)} #define NVEND {NULL, 0} /* sentinel to mark end of list */ const NameValue setopt_nv_CURLPROXY[] = { NV(CURLPROXY_HTTP), NV(CURLPROXY_HTTP_1_0), NV(CURLPROXY_SOCKS4), NV(CURLPROXY_SOCKS5), NV(CURLPROXY_SOCKS4A), NV(CURLPROXY_SOCKS5_HOSTNAME), NVEND, }; const NameValueUnsigned setopt_nv_CURLAUTH[] = { NV(CURLAUTH_ANY), /* combination */ NV(CURLAUTH_ANYSAFE), /* combination */ NV(CURLAUTH_BASIC), NV(CURLAUTH_DIGEST), NV(CURLAUTH_GSSNEGOTIATE), NV(CURLAUTH_NTLM), NV(CURLAUTH_DIGEST_IE), NV(CURLAUTH_NTLM_WB), NV(CURLAUTH_ONLY), NV(CURLAUTH_NONE), NVEND, }; const NameValue setopt_nv_CURL_HTTP_VERSION[] = { NV(CURL_HTTP_VERSION_NONE), NV(CURL_HTTP_VERSION_1_0), NV(CURL_HTTP_VERSION_1_1), NVEND, }; const NameValue setopt_nv_CURL_SSLVERSION[] = { NV(CURL_SSLVERSION_DEFAULT), NV(CURL_SSLVERSION_TLSv1), NV(CURL_SSLVERSION_SSLv2), NV(CURL_SSLVERSION_SSLv3), NV(CURL_SSLVERSION_TLSv1_0), NV(CURL_SSLVERSION_TLSv1_1), NV(CURL_SSLVERSION_TLSv1_2), NVEND, }; const NameValue setopt_nv_CURL_TIMECOND[] = { NV(CURL_TIMECOND_IFMODSINCE), NV(CURL_TIMECOND_IFUNMODSINCE), NV(CURL_TIMECOND_LASTMOD), NV(CURL_TIMECOND_NONE), NVEND, }; const NameValue setopt_nv_CURLFTPSSL_CCC[] = { NV(CURLFTPSSL_CCC_NONE), NV(CURLFTPSSL_CCC_PASSIVE), NV(CURLFTPSSL_CCC_ACTIVE), NVEND, }; const NameValue setopt_nv_CURLUSESSL[] = { NV(CURLUSESSL_NONE), NV(CURLUSESSL_TRY), NV(CURLUSESSL_CONTROL), NV(CURLUSESSL_ALL), NVEND, }; const NameValue setopt_nv_CURL_NETRC[] = { NV(CURL_NETRC_IGNORED), NV(CURL_NETRC_OPTIONAL), NV(CURL_NETRC_REQUIRED), NVEND, }; /* These mappings essentially triplicated - see * tool_libinfo.c and tool_paramhlp.c */ const NameValue setopt_nv_CURLPROTO[] = { NV(CURLPROTO_ALL), /* combination */ NV(CURLPROTO_DICT), NV(CURLPROTO_FILE), NV(CURLPROTO_FTP), NV(CURLPROTO_FTPS), NV(CURLPROTO_GOPHER), NV(CURLPROTO_HTTP), NV(CURLPROTO_HTTPS), NV(CURLPROTO_IMAP), NV(CURLPROTO_IMAPS), NV(CURLPROTO_LDAP), NV(CURLPROTO_LDAPS), NV(CURLPROTO_POP3), NV(CURLPROTO_POP3S), NV(CURLPROTO_RTSP), NV(CURLPROTO_SCP), NV(CURLPROTO_SFTP), NV(CURLPROTO_SMTP), NV(CURLPROTO_SMTPS), NV(CURLPROTO_TELNET), NV(CURLPROTO_TFTP), NVEND, }; /* These options have non-zero default values. */ static const NameValue setopt_nv_CURLNONZERODEFAULTS[] = { NV1(CURLOPT_SSL_VERIFYPEER, 1), NV1(CURLOPT_SSL_VERIFYHOST, 1), NVEND }; /* Format and add code; jump to nomem on malloc error */ #define ADD(args) do { \ ret = easysrc_add args; \ if(ret) \ goto nomem; \ } WHILE_FALSE #define ADDF(args) do { \ ret = easysrc_addf args; \ if(ret) \ goto nomem; \ } WHILE_FALSE #define DECL0(s) ADD((&easysrc_decl, s)) #define DECL1(f,a) ADDF((&easysrc_decl, f,a)) #define DATA0(s) ADD((&easysrc_data, s)) #define DATA1(f,a) ADDF((&easysrc_data, f,a)) #define DATA2(f,a,b) ADDF((&easysrc_data, f,a,b)) #define DATA3(f,a,b,c) ADDF((&easysrc_data, f,a,b,c)) #define CODE0(s) ADD((&easysrc_code, s)) #define CODE1(f,a) ADDF((&easysrc_code, f,a)) #define CODE2(f,a,b) ADDF((&easysrc_code, f,a,b)) #define CODE3(f,a,b,c) ADDF((&easysrc_code, f,a,b,c)) #define CLEAN0(s) ADD((&easysrc_clean, s)) #define CLEAN1(f,a) ADDF((&easysrc_clean, f,a)) #define REM0(s) ADD((&easysrc_toohard, s)) #define REM1(f,a) ADDF((&easysrc_toohard, f,a)) #define REM2(f,a,b) ADDF((&easysrc_toohard, f,a,b)) /* Escape string to C string syntax. Return NULL if out of memory. * Is this correct for those wacky EBCDIC guys? */ static char *c_escape(const char *str) { size_t len = 0; const char *s; unsigned char c; char *escaped, *e; /* Allocate space based on worst-case */ len = strlen(str); escaped = malloc(4 * len + 1); if(!escaped) return NULL; e = escaped; for(s=str; (c=*s) != '\0'; s++) { if(c=='\n') { strcpy(e, "\\n"); e += 2; } else if(c=='\r') { strcpy(e, "\\r"); e += 2; } else if(c=='\t') { strcpy(e, "\\t"); e += 2; } else if(c=='\\') { strcpy(e, "\\\\"); e += 2; } else if(c=='"') { strcpy(e, "\\\""); e += 2; } else if(! isprint(c)) { snprintf(e, 4, "\\%03o", c); e += 4; } else *e++ = c; } *e = '\0'; return escaped; } /* setopt wrapper for enum types */ CURLcode tool_setopt_enum(CURL *curl, struct Configurable *config, const char *name, CURLoption tag, const NameValue *nvlist, long lval) { CURLcode ret = CURLE_OK; bool skip = FALSE; ret = curl_easy_setopt(curl, tag, lval); if(!lval) skip = TRUE; if(config->libcurl && !skip && !ret) { /* we only use this for real if --libcurl was used */ const NameValue *nv = NULL; for(nv=nvlist; nv->name; nv++) { if(nv->value == lval) break; /* found it */ } if(! nv->name) { /* If no definition was found, output an explicit value. * This could happen if new values are defined and used * but the NameValue list is not updated. */ CODE2("curl_easy_setopt(hnd, %s, %ldL);", name, lval); } else { CODE2("curl_easy_setopt(hnd, %s, (long)%s);", name, nv->name); } } nomem: return ret; } /* setopt wrapper for flags */ CURLcode tool_setopt_flags(CURL *curl, struct Configurable *config, const char *name, CURLoption tag, const NameValue *nvlist, long lval) { CURLcode ret = CURLE_OK; bool skip = FALSE; ret = curl_easy_setopt(curl, tag, lval); if(!lval) skip = TRUE; if(config->libcurl && !skip && !ret) { /* we only use this for real if --libcurl was used */ char preamble[80]; /* should accommodate any symbol name */ long rest = lval; /* bits not handled yet */ const NameValue *nv = NULL; snprintf(preamble, sizeof(preamble), "curl_easy_setopt(hnd, %s, ", name); for(nv=nvlist; nv->name; nv++) { if((nv->value & ~ rest) == 0) { /* all value flags contained in rest */ rest &= ~ nv->value; /* remove bits handled here */ CODE3("%s(long)%s%s", preamble, nv->name, rest ? " |" : ");"); if(!rest) break; /* handled them all */ /* replace with all spaces for continuation line */ snprintf(preamble, sizeof(preamble), "%*s", strlen(preamble), ""); } } /* If any bits have no definition, output an explicit value. * This could happen if new bits are defined and used * but the NameValue list is not updated. */ if(rest) CODE2("%s%ldL);", preamble, rest); } nomem: return ret; } /* setopt wrapper for bitmasks */ CURLcode tool_setopt_bitmask(CURL *curl, struct Configurable *config, const char *name, CURLoption tag, const NameValueUnsigned *nvlist, long lval) { CURLcode ret = CURLE_OK; bool skip = FALSE; ret = curl_easy_setopt(curl, tag, lval); if(!lval) skip = TRUE; if(config->libcurl && !skip && !ret) { /* we only use this for real if --libcurl was used */ char preamble[80]; unsigned long rest = (unsigned long)lval; const NameValueUnsigned *nv = NULL; snprintf(preamble, sizeof(preamble), "curl_easy_setopt(hnd, %s, ", name); for(nv=nvlist; nv->name; nv++) { if((nv->value & ~ rest) == 0) { /* all value flags contained in rest */ rest &= ~ nv->value; /* remove bits handled here */ CODE3("%s(long)%s%s", preamble, nv->name, rest ? " |" : ");"); if(!rest) break; /* handled them all */ /* replace with all spaces for continuation line */ snprintf(preamble, sizeof(preamble), "%*s", strlen(preamble), ""); } } /* If any bits have no definition, output an explicit value. * This could happen if new bits are defined and used * but the NameValue list is not updated. */ if(rest) CODE2("%s%luUL);", preamble, rest); } nomem: return ret; } /* setopt wrapper for CURLOPT_HTTPPOST */ CURLcode tool_setopt_httppost(CURL *curl, struct Configurable *config, const char *name, CURLoption tag, struct curl_httppost *post) { CURLcode ret = CURLE_OK; char *escaped = NULL; bool skip = FALSE; ret = curl_easy_setopt(curl, tag, post); if(!post) skip = TRUE; if(config->libcurl && !skip && !ret) { struct curl_httppost *pp, *p; int i; /* May use several httppost lists, if multiple POST actions */ i = ++ easysrc_form_count; DECL1("struct curl_httppost *post%d;", i); DATA1("post%d = NULL;", i); CLEAN1("curl_formfree(post%d);", i); CLEAN1("post%d = NULL;", i); if(i == 1) DECL0("struct curl_httppost *postend;"); DATA0("postend = NULL;"); for(p=post; p; p=p->next) { DATA1("curl_formadd(&post%d, &postend,", i); DATA1(" CURLFORM_COPYNAME, \"%s\",", p->name); for(pp=p; pp; pp=pp->more) { /* May be several files uploaded for one name; * these are linked through the 'more' pointer */ Curl_safefree(escaped); escaped = c_escape(pp->contents); if(!escaped) { ret = CURLE_OUT_OF_MEMORY; goto nomem; } if(pp->flags & HTTPPOST_FILENAME) { /* file upload as for -F @filename */ DATA1(" CURLFORM_FILE, \"%s\",", escaped); } else if(pp->flags & HTTPPOST_READFILE) { /* content from file as for -F showfilename) { Curl_safefree(escaped); escaped = c_escape(pp->showfilename); if(!escaped) { ret = CURLE_OUT_OF_MEMORY; goto nomem; } DATA1(" CURLFORM_FILENAME, \"%s\",", escaped); } if(pp->contenttype) { Curl_safefree(escaped); escaped = c_escape(pp->contenttype); if(!escaped) { ret = CURLE_OUT_OF_MEMORY; goto nomem; } DATA1(" CURLFORM_CONTENTTYPE, \"%s\",", escaped); } } DATA0(" CURLFORM_END);"); } CODE2("curl_easy_setopt(hnd, %s, post%d);", name, i); } nomem: Curl_safefree(escaped); return ret; } /* setopt wrapper for curl_slist options */ CURLcode tool_setopt_slist(CURL *curl, struct Configurable *config, const char *name, CURLoption tag, struct curl_slist *list) { CURLcode ret = CURLE_OK; char *escaped = NULL; bool skip = FALSE; ret = curl_easy_setopt(curl, tag, list); if(!list) skip = TRUE; if(config->libcurl && !skip && !ret) { struct curl_slist *s; int i; /* May need several slist variables, so invent name */ i = ++ easysrc_slist_count; DECL1("struct curl_slist *slist%d;", i); DATA1("slist%d = NULL;", i); CLEAN1("curl_slist_free_all(slist%d);", i); CLEAN1("slist%d = NULL;", i); for(s=list; s; s=s->next) { Curl_safefree(escaped); escaped = c_escape(s->data); if(!escaped) { ret = CURLE_OUT_OF_MEMORY; goto nomem; } DATA3("slist%d = curl_slist_append(slist%d, \"%s\");", i, i, escaped); } CODE2("curl_easy_setopt(hnd, %s, slist%d);", name, i); } nomem: Curl_safefree(escaped); return ret; } /* generic setopt wrapper for all other options. * Some type information is encoded in the tag value. */ CURLcode tool_setopt(CURL *curl, bool str, struct Configurable *config, const char *name, CURLoption tag, ...) { va_list arg; char buf[256]; const char *value = NULL; bool remark = FALSE; bool skip = FALSE; bool escape = FALSE; char *escaped = NULL; CURLcode ret = CURLE_OK; va_start(arg, tag); if(tag < CURLOPTTYPE_OBJECTPOINT) { /* Value is expected to be a long */ long lval = va_arg(arg, long); long defval = 0L; const NameValue *nv = NULL; for(nv=setopt_nv_CURLNONZERODEFAULTS; nv->name; nv++) { if(!strcmp(name, nv->name)) { defval = nv->value; break; /* found it */ } } snprintf(buf, sizeof(buf), "%ldL", lval); value = buf; ret = curl_easy_setopt(curl, tag, lval); if(lval == defval) skip = TRUE; } else if(tag < CURLOPTTYPE_OFF_T) { /* Value is some sort of object pointer */ void *pval = va_arg(arg, void *); /* function pointers are never printable */ if(tag >= CURLOPTTYPE_FUNCTIONPOINT) { if(pval) { value = "functionpointer"; remark = TRUE; } else skip = TRUE; } else if(pval && str) { value = (char *)pval; escape = TRUE; } else if(pval) { value = "objectpointer"; remark = TRUE; } else skip = TRUE; ret = curl_easy_setopt(curl, tag, pval); } else { /* Value is expected to be curl_off_t */ curl_off_t oval = va_arg(arg, curl_off_t); snprintf(buf, sizeof(buf), "(curl_off_t)%" CURL_FORMAT_CURL_OFF_T, oval); value = buf; ret = curl_easy_setopt(curl, tag, oval); if(!oval) skip = TRUE; } va_end(arg); if(config->libcurl && !skip && !ret) { /* we only use this for real if --libcurl was used */ if(remark) REM2("%s set to a %s", name, value); else { if(escape) { escaped = c_escape(value); if(!escaped) { ret = CURLE_OUT_OF_MEMORY; goto nomem; } CODE2("curl_easy_setopt(hnd, %s, \"%s\");", name, escaped); } else CODE2("curl_easy_setopt(hnd, %s, %s);", name, value); } } nomem: Curl_safefree(escaped); return ret; } #endif /* CURL_DISABLE_LIBCURL_OPTION */ curl-7.35.0/src/tool_hugehelp.c0000644000175000017500000162457312272122742013310 00000000000000#include "tool_setup.h" #ifndef HAVE_LIBZ /* * NEVER EVER edit this manually, fix the mkhelp.pl script instead! * Generation time: Wed Jan 29 07:55:30 2014 */ #ifdef USE_MANUAL #include "tool_hugehelp.h" void hugehelp(void) { fputs( " _ _ ____ _\n" " Project ___| | | | _ \\| |\n" " / __| | | | |_) | |\n" " | (__| |_| | _ <| |___\n" " \\___|\\___/|_| \\_\\_____|\n" "\n" "NAME\n" " curl - transfer a URL\n" "\n" "SYNOPSIS\n" " curl [options] [URL...]\n" "\n" "DESCRIPTION\n" " curl is a tool to transfer data from or to a server, using one of the\n" " supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP,\n" , stdout); fputs( " IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS,\n" " TELNET and TFTP). The command is designed to work without user inter-\n" " action.\n" "\n" " curl offers a busload of useful tricks like proxy support, user authen-\n" " tication, FTP upload, HTTP post, SSL connections, cookies, file trans-\n" " fer resume, Metalink, and more. As you will see below, the number of\n" " features will make your head spin!\n" "\n" , stdout); fputs( " curl is powered by libcurl for all transfer-related features. See\n" " libcurl(3) for details.\n" "\n" "URL\n" " The URL syntax is protocol-dependent. You'll find a detailed descrip-\n" " tion in RFC 3986.\n" "\n" " You can specify multiple URLs or parts of URLs by writing part sets\n" " within braces as in:\n" "\n" " http://site.{one,two,three}.com\n" "\n" " or you can get sequences of alphanumeric series by using [] as in:\n" "\n" " ftp://ftp.numericals.com/file[1-100].txt\n" , stdout); fputs( " ftp://ftp.numericals.com/file[001-100].txt (with leading zeros)\n" " ftp://ftp.letters.com/file[a-z].txt\n" "\n" " Nested sequences are not supported, but you can use several ones next\n" " to each other:\n" "\n" " http://any.org/archive[1996-1999]/vol[1-4]/part{a,b,c}.html\n" "\n" " You can specify any amount of URLs on the command line. They will be\n" " fetched in a sequential manner in the specified order.\n" "\n" , stdout); fputs( " You can specify a step counter for the ranges to get every Nth number\n" " or letter:\n" "\n" " http://www.numericals.com/file[1-100:10].txt\n" " http://www.letters.com/file[a-z:2].txt\n" "\n" " If you specify URL without protocol:// prefix, curl will attempt to\n" " guess what protocol you might want. It will then default to HTTP but\n" " try other protocols based on often-used host name prefixes. For exam-\n" , stdout); fputs( " ple, for host names starting with \"ftp.\" curl will assume you want to\n" " speak FTP.\n" "\n" " curl will do its best to use what you pass to it as a URL. It is not\n" " trying to validate it as a syntactically correct URL by any means but\n" " is instead very liberal with what it accepts.\n" "\n" " curl will attempt to re-use connections for multiple file transfers, so\n" " that getting many files from the same server will not do multiple con-\n" , stdout); fputs( " nects / handshakes. This improves speed. Of course this is only done on\n" " files specified on a single command line and cannot be used between\n" " separate curl invokes.\n" "\n" "PROGRESS METER\n" " curl normally displays a progress meter during operations, indicating\n" " the amount of transferred data, transfer speeds and estimated time\n" " left, etc.\n" "\n" " curl displays this data to the terminal by default, so if you invoke\n" , stdout); fputs( " curl to do an operation and it is about to write data to the terminal,\n" " it disables the progress meter as otherwise it would mess up the output\n" " mixing progress meter and response data.\n" "\n" " If you want a progress meter for HTTP POST or PUT requests, you need to\n" " redirect the response output to a file, using shell redirect (>), -o\n" " [file] or similar.\n" "\n" " It is not the same case for FTP upload as that operation does not spit\n" , stdout); fputs( " out any response data to the terminal.\n" "\n" " If you prefer a progress \"bar\" instead of the regular meter, -# is your\n" " friend.\n" "OPTIONS\n" " Options start with one or two dashes. Many of the options require an\n" " addition value next to it.\n" "\n" " The short \"single-dash\" form of the options, -d for example, may be\n" " used with or without a space between it and its value, although a space\n" " is a recommended separator. The long \"double-dash\" form, --data for\n" , stdout); fputs( " example, requires a space between it and its value.\n" "\n" " Short version options that don't need any additional values can be used\n" " immediately next to each other, like for example you can specify all\n" " the options -O, -L and -v at once as -OLv.\n" "\n" " In general, all boolean options are enabled with --option and yet again\n" " disabled with --no-option. That is, you use the exact same option name\n" , stdout); fputs( " but prefix it with \"no-\". However, in this list we mostly only list and\n" " show the --option version of them. (This concept with --no options was\n" " added in 7.19.0. Previously most options were toggled on/off on\n" " repeated use of the same command line option.)\n" "\n" " -#, --progress-bar\n" " Make curl display progress as a simple progress bar instead of\n" " the standard, more informational, meter.\n" "\n" " -0, --http1.0\n" , stdout); fputs( " (HTTP) Tells curl to use HTTP version 1.0 instead of using its\n" " internally preferred: HTTP 1.1.\n" "\n" " --http1.1\n" " (HTTP) Tells curl to use HTTP version 1.1. This is the internal\n" " default version. (Added in 7.33.0)\n" "\n" " --http2.0\n" " (HTTP) Tells curl to issue its requests using HTTP 2.0. This\n" " requires that the underlying libcurl was built to support it.\n" " (Added in 7.33.0)\n" "\n" " -1, --tlsv1\n" , stdout); fputs( " (SSL) Forces curl to use TLS version 1 when negotiating with a\n" " remote TLS server.\n" "\n" " -2, --sslv2\n" " (SSL) Forces curl to use SSL version 2 when negotiating with a\n" " remote SSL server.\n" "\n" " -3, --sslv3\n" " (SSL) Forces curl to use SSL version 3 when negotiating with a\n" " remote SSL server.\n" "\n" " -4, --ipv4\n" " If curl is capable of resolving an address to multiple IP ver-\n" , stdout); fputs( " sions (which it is if it is IPv6-capable), this option tells\n" " curl to resolve names to IPv4 addresses only.\n" "\n" " -6, --ipv6\n" " If curl is capable of resolving an address to multiple IP ver-\n" " sions (which it is if it is IPv6-capable), this option tells\n" " curl to resolve names to IPv6 addresses only.\n" "\n" " -a, --append\n" " (FTP/SFTP) When used in an upload, this will tell curl to append\n" , stdout); fputs( " to the target file instead of overwriting it. If the file\n" " doesn't exist, it will be created. Note that this flag is\n" " ignored by some SSH servers (including OpenSSH).\n" "\n" " -A, --user-agent \n" " (HTTP) Specify the User-Agent string to send to the HTTP server.\n" " Some badly done CGIs fail if this field isn't set to\n" " \"Mozilla/4.0\". To encode blanks in the string, surround the\n" , stdout); fputs( " string with single quote marks. This can also be set with the\n" " -H, --header option of course.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " --anyauth\n" " (HTTP) Tells curl to figure out authentication method by itself,\n" " and use the most secure one the remote site claims to support.\n" " This is done by first doing a request and checking the response-\n" , stdout); fputs( " headers, thus possibly inducing an extra network round-trip.\n" " This is used instead of setting a specific authentication\n" " method, which you can do with --basic, --digest, --ntlm, and\n" " --negotiate.\n" "\n" " Note that using --anyauth is not recommended if you do uploads\n" " from stdin, since it may require data to be sent twice and then\n" , stdout); fputs( " the client must be able to rewind. If the need should arise when\n" " uploading from stdin, the upload operation will fail.\n" "\n" " -b, --cookie \n" " (HTTP) Pass the data to the HTTP server as a cookie. It is sup-\n" " posedly the data previously received from the server in a \"Set-\n" " Cookie:\" line. The data should be in the format \"NAME1=VALUE1;\n" " NAME2=VALUE2\".\n" "\n" , stdout); fputs( " If no '=' symbol is used in the line, it is treated as a file-\n" " name to use to read previously stored cookie lines from, which\n" " should be used in this session if they match. Using this method\n" " also activates the \"cookie parser\" which will make curl record\n" " incoming cookies too, which may be handy if you're using this in\n" " combination with the -L, --location option. The file format of\n" , stdout); fputs( " the file to read cookies from should be plain HTTP headers or\n" " the Netscape/Mozilla cookie file format.\n" "\n" " NOTE that the file specified with -b, --cookie is only used as\n" " input. No cookies will be stored in the file. To store cookies,\n" " use the -c, --cookie-jar option or you could even save the HTTP\n" " headers to a file using -D, --dump-header!\n" "\n" , stdout); fputs( " If this option is used several times, the last one will be used.\n" "\n" " -B, --use-ascii\n" " (FTP/LDAP) Enable ASCII transfer. For FTP, this can also be\n" " enforced by using an URL that ends with \";type=A\". This option\n" " causes data sent to stdout to be in text mode for win32 systems.\n" "\n" " --basic\n" " (HTTP) Tells curl to use HTTP Basic authentication. This is the\n" , stdout); fputs( " default and this option is usually pointless, unless you use it\n" " to override a previously set option that sets a different\n" " authentication method (such as --ntlm, --digest, or --negoti-\n" " ate).\n" "\n" " -c, --cookie-jar \n" " (HTTP) Specify to which file you want curl to write all cookies\n" " after a completed operation. Curl writes all cookies previously\n" , stdout); fputs( " read from a specified file as well as all cookies received from\n" " remote server(s). If no cookies are known, no file will be writ-\n" " ten. The file will be written using the Netscape cookie file\n" " format. If you set the file name to a single dash, \"-\", the\n" " cookies will be written to stdout.\n" "\n" " This command line option will activate the cookie engine that\n" , stdout); fputs( " makes curl record and use cookies. Another way to activate it is\n" " to use the -b, --cookie option.\n" "\n" " If the cookie jar can't be created or written to, the whole curl\n" " operation won't fail or even report an error clearly. Using -v\n" " will get a warning displayed, but that is the only visible feed-\n" " back you get about this possibly lethal situation.\n" "\n" , stdout); fputs( " If this option is used several times, the last specified file\n" " name will be used.\n" "\n" " -C, --continue-at \n" " Continue/Resume a previous file transfer at the given offset.\n" " The given offset is the exact number of bytes that will be\n" " skipped, counting from the beginning of the source file before\n" " it is transferred to the destination. If used with uploads, the\n" , stdout); fputs( " FTP server command SIZE will not be used by curl.\n" "\n" " Use \"-C -\" to tell curl to automatically find out where/how to\n" " resume the transfer. It then uses the given output/input files\n" " to figure that out.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " --ciphers \n" " (SSL) Specifies which ciphers to use in the connection. The list\n" , stdout); fputs( " of ciphers must specify valid ciphers. Read up on SSL cipher\n" " list details on this URL:\n" " http://www.openssl.org/docs/apps/ciphers.html\n" "\n" " NSS ciphers are done differently than OpenSSL and GnuTLS. The\n" " full list of NSS ciphers is in the NSSCipherSuite entry at this\n" " URL: http://git.fedora-\n" , stdout); fputs( " hosted.org/cgit/mod_nss.git/plain/docs/mod_nss.html#Directives\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " --compressed\n" " (HTTP) Request a compressed response using one of the algorithms\n" " curl supports, and save the uncompressed document. If this\n" " option is used and the server sends an unsupported encoding,\n" " curl will report an error.\n" "\n" " --connect-timeout \n" , stdout); fputs( " Maximum time in seconds that you allow the connection to the\n" " server to take. This only limits the connection phase, once\n" " curl has connected this option is of no more use. Since 7.32.0,\n" " this option accepts decimal values, but the actual timeout will\n" " decrease in accuracy as the specified timeout increases in deci-\n" " mal precision. See also the -m, --max-time option.\n" "\n" , stdout); fputs( " If this option is used several times, the last one will be used.\n" "\n" " --create-dirs\n" " When used in conjunction with the -o option, curl will create\n" " the necessary local directory hierarchy as needed. This option\n" " creates the dirs mentioned with the -o option, nothing else. If\n" " the -o file name uses no dir or if the dirs it mentions already\n" " exist, no dir will be created.\n" "\n" , stdout); fputs( " To create remote directories when using FTP or SFTP, try --ftp-\n" " create-dirs.\n" "\n" " --crlf (FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).\n" "\n" " --crlfile \n" " (HTTPS/FTPS) Provide a file using PEM format with a Certificate\n" " Revocation List that may specify peer certificates that are to\n" " be considered revoked.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" , stdout); fputs( " (Added in 7.19.7)\n" " -d, --data \n" " (HTTP) Sends the specified data in a POST request to the HTTP\n" " server, in the same way that a browser does when a user has\n" " filled in an HTML form and presses the submit button. This will\n" " cause curl to pass the data to the server using the content-type\n" " application/x-www-form-urlencoded. Compare to -F, --form.\n" "\n" , stdout); fputs( " -d, --data is the same as --data-ascii. To post data purely\n" " binary, you should instead use the --data-binary option. To URL-\n" " encode the value of a form field you may use --data-urlencode.\n" "\n" " If any of these options is used more than once on the same com-\n" " mand line, the data pieces specified will be merged together\n" " with a separating &-symbol. Thus, using '-d name=daniel -d\n" , stdout); fputs( " skill=lousy' would generate a post chunk that looks like\n" " 'name=daniel&skill=lousy'.\n" "\n" " If you start the data with the letter @, the rest should be a\n" " file name to read the data from, or - if you want curl to read\n" " the data from stdin. Multiple files can also be specified. Post-\n" " ing data from a file named 'foobar' would thus be done with\n" , stdout); fputs( " --data @foobar. When --data is told to read from a file like\n" " that, carriage returns and newlines will be stripped out.\n" "\n" " -D, --dump-header \n" " Write the protocol headers to the specified file.\n" "\n" " This option is handy to use when you want to store the headers\n" " that an HTTP site sends to you. Cookies from the headers could\n" " then be read in a second curl invocation by using the -b,\n" , stdout); fputs( " --cookie option! The -c, --cookie-jar option is however a better\n" " way to store cookies.\n" "\n" " When used in FTP, the FTP server response lines are considered\n" " being \"headers\" and thus are saved there.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " --data-ascii \n" " See -d, --data.\n" "\n" " --data-binary \n" " (HTTP) This posts data exactly as specified with no extra pro-\n" , stdout); fputs( " cessing whatsoever.\n" "\n" " If you start the data with the letter @, the rest should be a\n" " filename. Data is posted in a similar manner as --data-ascii\n" " does, except that newlines and carriage returns are preserved\n" " and conversions are never done.\n" "\n" " If this option is used several times, the ones following the\n" " first will append data as described in -d, --data.\n" "\n" " --data-urlencode \n" , stdout); fputs( " (HTTP) This posts data, similar to the other --data options with\n" " the exception that this performs URL-encoding. (Added in 7.18.0)\n" " To be CGI-compliant, the part should begin with a name\n" " followed by a separator and a content specification. The \n" " part can be passed to curl using one of the following syntaxes:\n" "\n" " content\n" " This will make curl URL-encode the content and pass that\n" , stdout); fputs( " on. Just be careful so that the content doesn't contain\n" " any = or @ symbols, as that will then make the syntax\n" " match one of the other cases below!\n" "\n" " =content\n" " This will make curl URL-encode the content and pass that\n" " on. The preceding = symbol is not included in the data.\n" "\n" " name=content\n" , stdout); fputs( " This will make curl URL-encode the content part and pass\n" " that on. Note that the name part is expected to be URL-\n" " encoded already.\n" "\n" " @filename\n" " This will make curl load data from the given file\n" " (including any newlines), URL-encode that data and pass\n" " it on in the POST.\n" "\n" " name@filename\n" , stdout); fputs( " This will make curl load data from the given file\n" " (including any newlines), URL-encode that data and pass\n" " it on in the POST. The name part gets an equal sign\n" " appended, resulting in name=urlencoded-file-content. Note\n" " that the name is expected to be URL-encoded already.\n" "\n" " --delegation LEVEL\n" " Set LEVEL to tell the server what it is allowed to delegate when\n" , stdout); fputs( " it comes to user credentials. Used with GSS/kerberos.\n" "\n" " none Don't allow any delegation.\n" "\n" " policy Delegates if and only if the OK-AS-DELEGATE flag is set\n" " in the Kerberos service ticket, which is a matter of\n" " realm policy.\n" "\n" " always Unconditionally allow the server to delegate.\n" "\n" " --digest\n" " (HTTP) Enables HTTP Digest authentication. This is an authenti-\n" , stdout); fputs( " cation scheme that prevents the password from being sent over\n" " the wire in clear text. Use this in combination with the normal\n" " -u, --user option to set user name and password. See also\n" " --ntlm, --negotiate and --anyauth for related options.\n" "\n" " If this option is used several times, only the first one is\n" " used.\n" "\n" " --disable-eprt\n" , stdout); fputs( " (FTP) Tell curl to disable the use of the EPRT and LPRT commands\n" " when doing active FTP transfers. Curl will normally always first\n" " attempt to use EPRT, then LPRT before using PORT, but with this\n" " option, it will use PORT right away. EPRT and LPRT are exten-\n" " sions to the original FTP protocol, and may not work on all\n" " servers, but they enable more functionality in a better way than\n" , stdout); fputs( " the traditional PORT command.\n" "\n" " --eprt can be used to explicitly enable EPRT again and --no-eprt\n" " is an alias for --disable-eprt.\n" "\n" " Disabling EPRT only changes the active behavior. If you want to\n" " switch to passive mode you need to not use -P, --ftp-port or\n" " force it with --ftp-pasv.\n" "\n" " --disable-epsv\n" " (FTP) Tell curl to disable the use of the EPSV command when\n" , stdout); fputs( " doing passive FTP transfers. Curl will normally always first\n" " attempt to use EPSV before PASV, but with this option, it will\n" " not try using EPSV.\n" "\n" " --epsv can be used to explicitly enable EPSV again and --no-epsv\n" " is an alias for --disable-epsv.\n" "\n" " Disabling EPSV only changes the passive behavior. If you want to\n" " switch to active mode you need to use -P, --ftp-port.\n" "\n" , stdout); fputs( " --dns-interface \n" " Tell curl to send outgoing DNS requests through .\n" " This option is a counterpart to --interface (which does not\n" " affect DNS). The supplied string must be an interface name (not\n" " an address).\n" "\n" " This option requires that libcurl was built with a resolver\n" " backend that supports this operation. The c-ares backend is the\n" , stdout); fputs( " only such one. (Added in 7.33.0)\n" "\n" " --dns-ipv4-addr \n" " Tell curl to bind to when making IPv4 DNS requests,\n" " so that the DNS requests originate from this address. The argu-\n" " ment should be a single IPv4 address.\n" "\n" " This option requires that libcurl was built with a resolver\n" " backend that supports this operation. The c-ares backend is the\n" , stdout); fputs( " only such one. (Added in 7.33.0)\n" "\n" " --dns-ipv6-addr \n" " Tell curl to bind to when making IPv6 DNS requests,\n" " so that the DNS requests originate from this address. The argu-\n" " ment should be a single IPv6 address.\n" "\n" " This option requires that libcurl was built with a resolver\n" " backend that supports this operation. The c-ares backend is the\n" , stdout); fputs( " only such one. (Added in 7.33.0)\n" "\n" " --dns-servers \n" " Set the list of DNS servers to be used instead of the system\n" " default. The list of IP addresses should be separated with com-\n" " mas. Port numbers may also optionally be given as :\n" " after each IP address.\n" "\n" " This option requires that libcurl was built with a resolver\n" , stdout); fputs( " backend that supports this operation. The c-ares backend is the\n" " only such one. (Added in 7.33.0)\n" "\n" " -e, --referer \n" " (HTTP) Sends the \"Referer Page\" information to the HTTP server.\n" " This can also be set with the -H, --header flag of course. When\n" " used with -L, --location you can append \";auto\" to the --referer\n" " URL to make curl automatically set the previous URL when it fol-\n" , stdout); fputs( " lows a Location: header. The \";auto\" string can be used alone,\n" " even if you don't set an initial --referer.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " -E, --cert \n" " (SSL) Tells curl to use the specified client certificate file\n" " when getting a file with HTTPS, FTPS or another SSL-based proto-\n" " col. The certificate must be in PKCS#12 format if using Secure\n" , stdout); fputs( " Transport, or PEM format if using any other engine. If the\n" " optional password isn't specified, it will be queried for on the\n" " terminal. Note that this option assumes a \"certificate\" file\n" " that is the private key and the private certificate concate-\n" " nated! See --cert and --key to specify them independently.\n" "\n" " If curl is built against the NSS SSL library then this option\n" , stdout); fputs( " can tell curl the nickname of the certificate to use within the\n" " NSS database defined by the environment variable SSL_DIR (or by\n" " default /etc/pki/nssdb). If the NSS PEM PKCS#11 module (lib-\n" " nsspem.so) is available then PEM files may be loaded. If you\n" " want to use a file from the current directory, please precede it\n" " with \"./\" prefix, in order to avoid confusion with a nickname.\n" , stdout); fputs( " If the nickname contains \":\", it needs to be preceded by \"\\\" so\n" " that it is not recognized as password delimiter. If the nick-\n" " name contains \"\\\", it needs to be escaped as \"\\\\\" so that it is\n" " not recognized as an escape character.\n" "\n" " (iOS and Mac OS X only) If curl is built against Secure Trans-\n" " port, then the certificate string can either be the name of a\n" , stdout); fputs( " certificate/private key in the system or user keychain, or the\n" " path to a PKCS#12-encoded certificate and private key. If you\n" " want to use a file from the current directory, please precede it\n" " with \"./\" prefix, in order to avoid confusion with a nickname.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " --engine \n" " Select the OpenSSL crypto engine to use for cipher operations.\n" , stdout); fputs( " Use --engine list to print a list of build-time supported\n" " engines. Note that not all (or none) of the engines may be\n" " available at run-time.\n" "\n" " --environment\n" " (RISC OS ONLY) Sets a range of environment variables, using the\n" " names the -w option supports, to allow easier extraction of use-\n" " ful information after having run curl.\n" "\n" " --egd-file \n" , stdout); fputs( " (SSL) Specify the path name to the Entropy Gathering Daemon\n" " socket. The socket is used to seed the random engine for SSL\n" " connections. See also the --random-file option.\n" "\n" " --cert-type \n" " (SSL) Tells curl what certificate type the provided certificate\n" " is in. PEM, DER and ENG are recognized types. If not specified,\n" " PEM is assumed.\n" "\n" , stdout); fputs( " If this option is used several times, the last one will be used.\n" "\n" " --cacert \n" " (SSL) Tells curl to use the specified certificate file to verify\n" " the peer. The file may contain multiple CA certificates. The\n" " certificate(s) must be in PEM format. Normally curl is built to\n" " use a default file for this, so this option is typically used to\n" " alter that default file.\n" "\n" , stdout); fputs( " curl recognizes the environment variable named 'CURL_CA_BUNDLE'\n" " if it is set, and uses the given path as a path to a CA cert\n" " bundle. This option overrides that variable.\n" "\n" " The windows version of curl will automatically look for a CA\n" " certs file named 'curl-ca-bundle.crt', either in the same direc-\n" " tory as curl.exe, or in the Current Working Directory, or in any\n" " folder along your PATH.\n" "\n" , stdout); fputs( " If curl is built against the NSS SSL library, the NSS PEM\n" " PKCS#11 module (libnsspem.so) needs to be available for this\n" " option to work properly.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " --capath \n" " (SSL) Tells curl to use the specified certificate directory to\n" " verify the peer. Multiple paths can be provided by separating\n" , stdout); fputs( " them with \":\" (e.g. \"path1:path2:path3\"). The certificates must\n" " be in PEM format, and if curl is built against OpenSSL, the\n" " directory must have been processed using the c_rehash utility\n" " supplied with OpenSSL. Using --capath can allow OpenSSL-powered\n" " curl to make SSL-connections much more efficiently than using\n" " --cacert if the --cacert file contains many CA certificates.\n" "\n" , stdout); fputs( " If this option is set, the default capath value will be ignored,\n" " and if it is used several times, the last one will be used.\n" "\n" " -f, --fail\n" " (HTTP) Fail silently (no output at all) on server errors. This\n" " is mostly done to better enable scripts etc to better deal with\n" " failed attempts. In normal cases when an HTTP server fails to\n" " deliver a document, it returns an HTML document stating so\n" , stdout); fputs( " (which often also describes why and more). This flag will pre-\n" " vent curl from outputting that and return error 22.\n" "\n" " This method is not fail-safe and there are occasions where non-\n" " successful response codes will slip through, especially when\n" " authentication is involved (response codes 401 and 407).\n" "\n" " -F, --form \n" " (HTTP) This lets curl emulate a filled-in form in which a user\n" , stdout); fputs( " has pressed the submit button. This causes curl to POST data\n" " using the Content-Type multipart/form-data according to RFC\n" " 2388. This enables uploading of binary files etc. To force the\n" " 'content' part to be a file, prefix the file name with an @\n" " sign. To just get the content part from a file, prefix the file\n" " name with the symbol <. The difference between @ and < is then\n" , stdout); fputs( " that @ makes a file get attached in the post as a file upload,\n" " while the < makes a text field and just get the contents for\n" " that text field from a file.\n" "\n" " Example, to send your password file to the server, where 'pass-\n" " word' is the name of the form-field to which /etc/passwd will be\n" " the input:\n" "\n" " curl -F password=@/etc/passwd www.mypasswords.com\n" "\n" , stdout); fputs( " To read content from stdin instead of a file, use - as the file-\n" " name. This goes for both @ and < constructs.\n" "\n" " You can also tell curl what Content-Type to use by using\n" " 'type=', in a manner similar to:\n" "\n" " curl -F \"web=@index.html;type=text/html\" url.com\n" "\n" " or\n" "\n" " curl -F \"name=daniel;type=text/foo\" url.com\n" "\n" " You can also explicitly change the name field of a file upload\n" , stdout); fputs( " part by setting filename=, like this:\n" "\n" " curl -F \"file=@localfile;filename=nameinpost\" url.com\n" "\n" " If filename/path contains ',' or ';', it must be quoted by dou-\n" " ble-quotes like:\n" "\n" " curl -F \"file=@\\\"localfile\\\";filename=\\\"nameinpost\\\"\" url.com\n" "\n" " or\n" "\n" " curl -F 'file=@\"localfile\";filename=\"nameinpost\"' url.com\n" "\n" " Note that if a filename/path is quoted by double-quotes, any\n" , stdout); fputs( " double-quote or backslash within the filename must be escaped by\n" " backslash.\n" "\n" " See further examples and details in the MANUAL.\n" "\n" " This option can be used multiple times.\n" "\n" " --ftp-account [data]\n" " (FTP) When an FTP server asks for \"account data\" after user name\n" " and password has been provided, this data is sent off using the\n" " ACCT command. (Added in 7.13.0)\n" "\n" , stdout); fputs( " If this option is used several times, the last one will be used.\n" "\n" " --ftp-alternative-to-user \n" " (FTP) If authenticating with the USER and PASS commands fails,\n" " send this command. When connecting to Tumbleweed's Secure\n" " Transport server over FTPS using a client certificate, using\n" " \"SITE AUTH\" will tell the server to retrieve the username from\n" " the certificate. (Added in 7.15.5)\n" "\n" , stdout); fputs( " --ftp-create-dirs\n" " (FTP/SFTP) When an FTP or SFTP URL/operation uses a path that\n" " doesn't currently exist on the server, the standard behavior of\n" " curl is to fail. Using this option, curl will instead attempt to\n" " create missing directories.\n" "\n" " --ftp-method [method]\n" " (FTP) Control what method curl should use to reach a file on an\n" " FTP(S) server. The method argument should be one of the follow-\n" , stdout); fputs( " ing alternatives:\n" "\n" " multicwd\n" " curl does a single CWD operation for each path part in\n" " the given URL. For deep hierarchies this means very many\n" " commands. This is how RFC 1738 says it should be done.\n" " This is the default but the slowest behavior.\n" "\n" " nocwd curl does no CWD at all. curl will do SIZE, RETR, STOR\n" , stdout); fputs( " etc and give a full path to the server for all these com-\n" " mands. This is the fastest behavior.\n" "\n" " singlecwd\n" " curl does one CWD with the full target directory and then\n" " operates on the file \"normally\" (like in the multicwd\n" " case). This is somewhat more standards compliant than\n" " 'nocwd' but without the full penalty of 'multicwd'.\n" " (Added in 7.15.1)\n" "\n" , stdout); fputs( " --ftp-pasv\n" " (FTP) Use passive mode for the data connection. Passive is the\n" " internal default behavior, but using this option can be used to\n" " override a previous -P/-ftp-port option. (Added in 7.11.0)\n" "\n" " If this option is used several times, only the first one is\n" " used. Undoing an enforced passive really isn't doable but you\n" " must then instead enforce the correct -P, --ftp-port again.\n" "\n" , stdout); fputs( " Passive mode means that curl will try the EPSV command first and\n" " then PASV, unless --disable-epsv is used.\n" "\n" " --ftp-skip-pasv-ip\n" " (FTP) Tell curl to not use the IP address the server suggests in\n" " its response to curl's PASV command when curl connects the data\n" " connection. Instead curl will re-use the same IP address it\n" " already uses for the control connection. (Added in 7.14.2)\n" "\n" , stdout); fputs( " This option has no effect if PORT, EPRT or EPSV is used instead\n" " of PASV.\n" "\n" " --ftp-pret\n" " (FTP) Tell curl to send a PRET command before PASV (and EPSV).\n" " Certain FTP servers, mainly drftpd, require this non-standard\n" " command for directory listings as well as up and downloads in\n" " PASV mode. (Added in 7.20.x)\n" "\n" " --ftp-ssl-ccc\n" , stdout); fputs( " (FTP) Use CCC (Clear Command Channel) Shuts down the SSL/TLS\n" " layer after authenticating. The rest of the control channel com-\n" " munication will be unencrypted. This allows NAT routers to fol-\n" " low the FTP transaction. The default mode is passive. See --ftp-\n" " ssl-ccc-mode for other modes. (Added in 7.16.1)\n" "\n" " --ftp-ssl-ccc-mode [active/passive]\n" , stdout); fputs( " (FTP) Use CCC (Clear Command Channel) Sets the CCC mode. The\n" " passive mode will not initiate the shutdown, but instead wait\n" " for the server to do it, and will not reply to the shutdown from\n" " the server. The active mode initiates the shutdown and waits for\n" " a reply from the server. (Added in 7.16.2)\n" "\n" " --ftp-ssl-control\n" " (FTP) Require SSL/TLS for the FTP login, clear for transfer.\n" , stdout); fputs( " Allows secure authentication, but non-encrypted data transfers\n" " for efficiency. Fails the transfer if the server doesn't sup-\n" " port SSL/TLS. (Added in 7.16.0) that can still be used but will\n" " be removed in a future version.\n" "\n" " --form-string \n" " (HTTP) Similar to --form except that the value string for the\n" " named parameter is used literally. Leading '@' and '<' charac-\n" , stdout); fputs( " ters, and the ';type=' string in the value have no special mean-\n" " ing. Use this in preference to --form if there's any possibility\n" " that the string value may accidentally trigger the '@' or '<'\n" " features of --form.\n" "\n" " -g, --globoff\n" " This option switches off the \"URL globbing parser\". When you set\n" " this option, you can specify URLs that contain the letters {}[]\n" , stdout); fputs( " without having them being interpreted by curl itself. Note that\n" " these letters are not normal legal URL contents but they should\n" " be encoded according to the URI standard.\n" "\n" " -G, --get\n" " When used, this option will make all data specified with -d,\n" " --data, --data-binary or --data-urlencode to be used in an HTTP\n" " GET request instead of the POST request that otherwise would be\n" , stdout); fputs( " used. The data will be appended to the URL with a '?' separator.\n" " If used in combination with -I, the POST data will instead be\n" " appended to the URL with a HEAD request.\n" "\n" " If this option is used several times, only the first one is\n" " used. This is because undoing a GET doesn't make sense, but you\n" " should then instead enforce the alternative method you prefer.\n" "\n" " -H, --header
\n" , stdout); fputs( " (HTTP) Extra header to use when getting a web page. You may\n" " specify any number of extra headers. Note that if you should add\n" " a custom header that has the same name as one of the internal\n" " ones curl would use, your externally set header will be used\n" " instead of the internal one. This allows you to make even trick-\n" " ier stuff than curl would normally do. You should not replace\n" , stdout); fputs( " internally set headers without knowing perfectly well what\n" " you're doing. Remove an internal header by giving a replacement\n" " without content on the right side of the colon, as in: -H\n" " \"Host:\". If you send the custom header with no-value then its\n" " header must be terminated with a semicolon, such as -H \"X-Cus-\n" " tom-Header;\" to send \"X-Custom-Header:\".\n" "\n" , stdout); fputs( " curl will make sure that each header you add/replace is sent\n" " with the proper end-of-line marker, you should thus not add that\n" " as a part of the header content: do not add newlines or carriage\n" " returns, they will only mess things up for you.\n" "\n" " See also the -A, --user-agent and -e, --referer options.\n" "\n" " This option can be used multiple times to add/replace/remove\n" " multiple headers.\n" "\n" , stdout); fputs( " --hostpubmd5 \n" " (SCP/SFTP) Pass a string containing 32 hexadecimal digits. The\n" " string should be the 128 bit MD5 checksum of the remote host's\n" " public key, curl will refuse the connection with the host unless\n" " the md5sums match. (Added in 7.17.1)\n" "\n" " --ignore-content-length\n" " (HTTP) Ignore the Content-Length header. This is particularly\n" , stdout); fputs( " useful for servers running Apache 1.x, which will report incor-\n" " rect Content-Length for files larger than 2 gigabytes.\n" "\n" " -i, --include\n" " (HTTP) Include the HTTP-header in the output. The HTTP-header\n" " includes things like server-name, date of the document, HTTP-\n" " version and more...\n" "\n" " -I, --head\n" " (HTTP/FTP/FILE) Fetch the HTTP-header only! HTTP-servers feature\n" , stdout); fputs( " the command HEAD which this uses to get nothing but the header\n" " of a document. When used on an FTP or FILE file, curl displays\n" " the file size and last modification time only.\n" "\n" " --interface \n" " Perform an operation using a specified interface. You can enter\n" " interface name, IP address or host name. An example could look\n" " like:\n" "\n" " curl --interface eth0:1 http://www.netscape.com/\n" "\n" , stdout); fputs( " If this option is used several times, the last one will be used.\n" "\n" " -j, --junk-session-cookies\n" " (HTTP) When curl is told to read cookies from a given file, this\n" " option will make it discard all \"session cookies\". This will\n" " basically have the same effect as if a new session is started.\n" " Typical browsers always discard session cookies when they're\n" " closed down.\n" "\n" " -J, --remote-header-name\n" , stdout); fputs( " (HTTP) This option tells the -O, --remote-name option to use the\n" " server-specified Content-Disposition filename instead of\n" " extracting a filename from the URL.\n" "\n" " There's no attempt to decode %-sequences (yet) in the provided\n" " file name, so this option may provide you with rather unexpected\n" " file names.\n" "\n" " -k, --insecure\n" " (SSL) This option explicitly allows curl to perform \"insecure\"\n" , stdout); fputs( " SSL connections and transfers. All SSL connections are attempted\n" " to be made secure by using the CA certificate bundle installed\n" " by default. This makes all connections considered \"insecure\"\n" " fail unless -k, --insecure is used.\n" "\n" " See this online resource for further details:\n" " http://curl.haxx.se/docs/sslcerts.html\n" "\n" " -K, --config \n" , stdout); fputs( " Specify which config file to read curl arguments from. The con-\n" " fig file is a text file in which command line arguments can be\n" " written which then will be used as if they were written on the\n" " actual command line.\n" "\n" " Options and their parameters must be specified on the same con-\n" " fig file line, separated by whitespace, colon, or the equals\n" , stdout); fputs( " sign. Long option names can optionally be given in the config\n" " file without the initial double dashes and if so, the colon or\n" " equals characters can be used as separators. If the option is\n" " specified with one or two dashes, there can be no colon or\n" " equals character between the option and its parameter.\n" "\n" " If the parameter is to contain whitespace, the parameter must be\n" , stdout); fputs( " enclosed within quotes. Within double quotes, the following\n" " escape sequences are available: \\\\, \\\", \\t, \\n, \\r and \\v. A\n" " backslash preceding any other letter is ignored. If the first\n" " column of a config line is a '#' character, the rest of the line\n" " will be treated as a comment. Only write one option per physical\n" " line in the config file.\n" "\n" , stdout); fputs( " Specify the filename to -K, --config as '-' to make curl read\n" " the file from stdin.\n" "\n" " Note that to be able to specify a URL in the config file, you\n" " need to specify it using the --url option, and not by simply\n" " writing the URL on its own line. So, it could look similar to\n" " this:\n" "\n" " url = \"http://curl.haxx.se/docs/\"\n" "\n" , stdout); fputs( " When curl is invoked, it always (unless -q is used) checks for a\n" " default config file and uses it if found. The default config\n" " file is checked for in the following places in this order:\n" "\n" " 1) curl tries to find the \"home dir\": It first checks for the\n" " CURL_HOME and then the HOME environment variables. Failing that,\n" " it uses getpwuid() on UNIX-like systems (which returns the home\n" , stdout); fputs( " dir given the current user in your system). On Windows, it then\n" " checks for the APPDATA variable, or as a last resort the '%USER-\n" " PROFILE%\\Application Data'.\n" "\n" " 2) On windows, if there is no _curlrc file in the home dir, it\n" " checks for one in the same dir the curl executable is placed. On\n" " UNIX-like systems, it will simply try to load .curlrc from the\n" " determined home dir.\n" "\n" , stdout); fputs( " # --- Example file ---\n" " # this is a comment\n" " url = \"curl.haxx.se\"\n" " output = \"curlhere.html\"\n" " user-agent = \"superagent/1.0\"\n" "\n" " # and fetch another URL too\n" " url = \"curl.haxx.se/docs/manpage.html\"\n" " -O\n" " referer = \"http://nowhereatall.com/\"\n" " # --- End of example file ---\n" "\n" " This option can be used multiple times to load multiple config\n" " files.\n" "\n" , stdout); fputs( " --keepalive-time \n" " This option sets the time a connection needs to remain idle\n" " before sending keepalive probes and the time between individual\n" " keepalive probes. It is currently effective on operating systems\n" " offering the TCP_KEEPIDLE and TCP_KEEPINTVL socket options\n" " (meaning Linux, recent AIX, HP-UX and more). This option has no\n" " effect if --no-keepalive is used. (Added in 7.18.0)\n" "\n" , stdout); fputs( " If this option is used several times, the last one will be used.\n" " If unspecified, the option defaults to 60 seconds.\n" "\n" " --key \n" " (SSL/SSH) Private key file name. Allows you to provide your pri-\n" " vate key in this separate file.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " --key-type \n" " (SSL) Private key file type. Specify which type your --key pro-\n" , stdout); fputs( " vided private key is. DER, PEM, and ENG are supported. If not\n" " specified, PEM is assumed.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " --krb \n" " (FTP) Enable Kerberos authentication and use. The level must be\n" " entered and should be one of 'clear', 'safe', 'confidential', or\n" " 'private'. Should you use a level that is not one of these,\n" , stdout); fputs( " 'private' will instead be used.\n" "\n" " This option requires a library built with kerberos4 or GSSAPI\n" " (GSS-Negotiate) support. This is not very common. Use -V, --ver-\n" " sion to see if your curl supports it.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " -l, --list-only\n" " (FTP) When listing an FTP directory, this switch forces a name-\n" , stdout); fputs( " only view. This is especially useful if the user wants to\n" " machine-parse the contents of an FTP directory since the normal\n" " directory view doesn't use a standard look or format. When used\n" " like this, the option causes a NLST command to be sent to the\n" " server instead of LIST.\n" "\n" " Note: Some FTP servers list only files in their response to\n" , stdout); fputs( " NLST; they do not include sub-directories and symbolic links.\n" "\n" " (POP3) When retrieving a specific email from POP3, this switch\n" " forces a LIST command to be performed instead of RETR. This is\n" " particularly useful if the user wants to see if a specific mes-\n" " sage id exists on the server and what size it is.\n" "\n" " Note: When combined with -X, --request , this option\n" , stdout); fputs( " can be used to send an UIDL command instead, so the user may use\n" " the email's unique identifier rather than it's message id to\n" " make the request. (Added in 7.21.5)\n" "\n" " -L, --location\n" " (HTTP/HTTPS) If the server reports that the requested page has\n" " moved to a different location (indicated with a Location: header\n" " and a 3XX response code), this option will make curl redo the\n" , stdout); fputs( " request on the new place. If used together with -i, --include or\n" " -I, --head, headers from all requested pages will be shown. When\n" " authentication is used, curl only sends its credentials to the\n" " initial host. If a redirect takes curl to a different host, it\n" " won't be able to intercept the user+password. See also --loca-\n" " tion-trusted on how to change this. You can limit the amount of\n" , stdout); fputs( " redirects to follow by using the --max-redirs option.\n" "\n" " When curl follows a redirect and the request is not a plain GET\n" " (for example POST or PUT), it will do the following request with\n" " a GET if the HTTP response was 301, 302, or 303. If the response\n" " code was any other 3xx code, curl will re-send the following\n" " request using the same unmodified method.\n" "\n" " --libcurl \n" , stdout); fputs( " Append this option to any ordinary curl command line, and you\n" " will get a libcurl-using C source code written to the file that\n" " does the equivalent of what your command-line operation does!\n" "\n" " If this option is used several times, the last given file name\n" " will be used. (Added in 7.16.1)\n" "\n" " --limit-rate \n" " Specify the maximum transfer rate you want curl to use. This\n" , stdout); fputs( " feature is useful if you have a limited pipe and you'd like your\n" " transfer not to use your entire bandwidth.\n" "\n" " The given speed is measured in bytes/second, unless a suffix is\n" " appended. Appending 'k' or 'K' will count the number as kilo-\n" " bytes, 'm' or M' makes it megabytes, while 'g' or 'G' makes it\n" " gigabytes. Examples: 200K, 3m and 1G.\n" "\n" , stdout); fputs( " The given rate is the average speed counted during the entire\n" " transfer. It means that curl might use higher transfer speeds in\n" " short bursts, but over time it uses no more than the given rate.\n" " If you also use the -Y, --speed-limit option, that option will\n" " take precedence and might cripple the rate-limiting slightly, to\n" " help keeping the speed-limit logic working.\n" "\n" , stdout); fputs( " If this option is used several times, the last one will be used.\n" "\n" " --local-port [-num]\n" " Set a preferred number or range of local port numbers to use for\n" " the connection(s). Note that port numbers by nature are a\n" " scarce resource that will be busy at times so setting this range\n" " to something too narrow might cause unnecessary connection setup\n" " failures. (Added in 7.15.2)\n" "\n" " --location-trusted\n" , stdout); fputs( " (HTTP/HTTPS) Like -L, --location, but will allow sending the\n" " name + password to all hosts that the site may redirect to. This\n" " may or may not introduce a security breach if the site redirects\n" " you to a site to which you'll send your authentication info\n" " (which is plaintext in the case of HTTP Basic authentication).\n" "\n" " -m, --max-time \n" , stdout); fputs( " Maximum time in seconds that you allow the whole operation to\n" " take. This is useful for preventing your batch jobs from hang-\n" " ing for hours due to slow networks or links going down. Since\n" " 7.32.0, this option accepts decimal values, but the actual time-\n" " out will decrease in accuracy as the specified timeout increases\n" " in decimal precision. See also the --connect-timeout option.\n" "\n" , stdout); fputs( " If this option is used several times, the last one will be used.\n" "\n" " --mail-auth
\n" " (SMTP) Specify a single address. This will be used to specify\n" " the authentication address (identity) of a submitted message\n" " that is being relayed to another server.\n" "\n" " (Added in 7.25.0)\n" "\n" " --mail-from
\n" " (SMTP) Specify a single address that the given mail should get\n" " sent from.\n" "\n" , stdout); fputs( " (Added in 7.20.0)\n" "\n" " --max-filesize \n" " Specify the maximum size (in bytes) of a file to download. If\n" " the file requested is larger than this value, the transfer will\n" " not start and curl will return with exit code 63.\n" "\n" " NOTE: The file size is not always known prior to download, and\n" " for such files this option has no effect even if the file trans-\n" , stdout); fputs( " fer ends up being larger than this given limit. This concerns\n" " both FTP and HTTP transfers.\n" "\n" " --mail-rcpt
\n" " (SMTP) Specify a single address, user name or mailing list name.\n" " When performing a mail transfer, the recipient should specify a\n" " valid email address to send the mail to. (Added in 7.20.0)\n" "\n" " When performing an address verification (VRFY command), the\n" , stdout); fputs( " recipient should be specified as the user name or user name and\n" " domain (as per Section 3.5 of RFC5321). (Added in 7.34.0)\n" "\n" " When performing a mailing list expand (EXPN command), the recip-\n" " ient should be specified using the mailing list name, such as\n" " \"Friends\" or \"London-Office\". (Added in 7.34.0)\n" "\n" " --max-redirs \n" " Set maximum number of redirection-followings allowed. If -L,\n" , stdout); fputs( " --location is used, this option can be used to prevent curl from\n" " following redirections \"in absurdum\". By default, the limit is\n" " set to 50 redirections. Set this option to -1 to make it limit-\n" " less.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " --metalink\n" " This option can tell curl to parse and process a given URI as\n" , stdout); fputs( " Metalink file (both version 3 and 4 (RFC 5854) are supported)\n" " and make use of the mirrors listed within for failover if there\n" " are errors (such as the file or server not being available). It\n" " will also verify the hash of the file after the download com-\n" " pletes. The Metalink file itself is downloaded and processed in\n" " memory and not stored in the local file system.\n" "\n" , stdout); fputs( " Example to use a remote Metalink file:\n" "\n" " curl --metalink http://www.example.com/example.metalink\n" "\n" " To use a Metalink file in the local file system, use FILE proto-\n" " col (file://):\n" "\n" " curl --metalink file://example.metalink\n" "\n" " Please note that if FILE protocol is disabled, there is no way\n" " to use a local Metalink file at the time of this writing. Also\n" , stdout); fputs( " note that if --metalink and --include are used together,\n" " --include will be ignored. This is because including headers in\n" " the response will break Metalink parser and if the headers are\n" " included in the file described in Metalink file, hash check will\n" " fail.\n" "\n" " (Added in 7.27.0, if built against the libmetalink library.)\n" "\n" " -n, --netrc\n" , stdout); fputs( " Makes curl scan the .netrc (_netrc on Windows) file in the\n" " user's home directory for login name and password. This is typi-\n" " cally used for FTP on UNIX. If used with HTTP, curl will enable\n" " user authentication. See netrc(4) or ftp(1) for details on the\n" " file format. Curl will not complain if that file doesn't have\n" " the right permissions (it should not be either world- or group-\n" , stdout); fputs( " readable). The environment variable \"HOME\" is used to find the\n" " home directory.\n" "\n" " A quick and very simple example of how to setup a .netrc to\n" " allow curl to FTP to the machine host.domain.com with user name\n" " 'myself' and password 'secret' should look similar to:\n" "\n" " machine host.domain.com login myself password secret\n" "\n" " -N, --no-buffer\n" , stdout); fputs( " Disables the buffering of the output stream. In normal work sit-\n" " uations, curl will use a standard buffered output stream that\n" " will have the effect that it will output the data in chunks, not\n" " necessarily exactly when the data arrives. Using this option\n" " will disable that buffering.\n" "\n" " Note that this is the negated option name documented. You can\n" " thus use --buffer to enforce the buffering.\n" "\n" , stdout); fputs( " --netrc-file\n" " This option is similar to --netrc, except that you provide the\n" " path (absolute or relative) to the netrc file that Curl should\n" " use. You can only specify one netrc file per invocation. If\n" " several --netrc-file options are provided, only the last one\n" " will be used. (Added in 7.21.5)\n" "\n" " This option overrides any use of --netrc as they are mutually\n" , stdout); fputs( " exclusive. It will also abide by --netrc-optional if specified.\n" "\n" " --netrc-optional\n" " Very similar to --netrc, but this option makes the .netrc usage\n" " optional and not mandatory as the --netrc option does.\n" "\n" " --negotiate\n" " (HTTP) Enables GSS-Negotiate authentication. The GSS-Negotiate\n" " method was designed by Microsoft and is used in their web appli-\n" , stdout); fputs( " cations. It is primarily meant as a support for Kerberos5\n" " authentication but may be also used along with another authenti-\n" " cation method. For more information see IETF draft draft-brezak-\n" " spnego-http-04.txt.\n" "\n" " If you want to enable Negotiate for your proxy authentication,\n" " then use --proxy-negotiate.\n" "\n" " This option requires a library built with GSSAPI support. This\n" , stdout); fputs( " is not very common. Use -V, --version to see if your version\n" " supports GSS-Negotiate.\n" "\n" " When using this option, you must also provide a fake -u, --user\n" " option to activate the authentication code properly. Sending a\n" " '-u :' is enough as the user name and password from the -u\n" " option aren't actually used.\n" "\n" " If this option is used several times, only the first one is\n" " used.\n" "\n" , stdout); fputs( " --no-keepalive\n" " Disables the use of keepalive messages on the TCP connection, as\n" " by default curl enables them.\n" "\n" " Note that this is the negated option name documented. You can\n" " thus use --keepalive to enforce keepalive.\n" "\n" " --no-sessionid\n" " (SSL) Disable curl's use of SSL session-ID caching. By default\n" " all transfers are done using the cache. Note that while nothing\n" , stdout); fputs( " should ever get hurt by attempting to reuse SSL session-IDs,\n" " there seem to be broken SSL implementations in the wild that may\n" " require you to disable this in order for you to succeed. (Added\n" " in 7.16.0)\n" "\n" " Note that this is the negated option name documented. You can\n" " thus use --sessionid to enforce session-ID caching.\n" "\n" " --noproxy \n" , stdout); fputs( " Comma-separated list of hosts which do not use a proxy, if one\n" " is specified. The only wildcard is a single * character, which\n" " matches all hosts, and effectively disables the proxy. Each name\n" " in this list is matched as either a domain which contains the\n" " hostname, or the hostname itself. For example, local.com would\n" " match local.com, local.com:80, and www.local.com, but not\n" , stdout); fputs( " www.notlocal.com. (Added in 7.19.4).\n" "\n" " --ntlm (HTTP) Enables NTLM authentication. The NTLM authentication\n" " method was designed by Microsoft and is used by IIS web servers.\n" " It is a proprietary protocol, reverse-engineered by clever peo-\n" " ple and implemented in curl based on their efforts. This kind of\n" " behavior should not be endorsed, you should encourage everyone\n" , stdout); fputs( " who uses NTLM to switch to a public and documented authentica-\n" " tion method instead, such as Digest.\n" "\n" " If you want to enable NTLM for your proxy authentication, then\n" " use --proxy-ntlm.\n" "\n" " This option requires a library built with SSL support. Use -V,\n" " --version to see if your curl supports NTLM.\n" "\n" " If this option is used several times, only the first one is\n" " used.\n" "\n" , stdout); fputs( " -o, --output \n" " Write output to instead of stdout. If you are using {} or\n" " [] to fetch multiple documents, you can use '#' followed by a\n" " number in the specifier. That variable will be replaced\n" " with the current string for the URL being fetched. Like in:\n" "\n" " curl http://{one,two}.site.com -o \"file_#1.txt\"\n" "\n" " or use several variables like:\n" "\n" , stdout); fputs( " curl http://{site,host}.host[1-5].com -o \"#1_#2\"\n" "\n" " You may use this option as many times as the number of URLs you\n" " have.\n" "\n" " See also the --create-dirs option to create the local directo-\n" " ries dynamically. Specifying the output as '-' (a single dash)\n" " will force the output to be done to stdout.\n" "\n" " -O, --remote-name\n" " Write output to a local file named like the remote file we get.\n" , stdout); fputs( " (Only the file part of the remote file is used, the path is cut\n" " off.)\n" "\n" " The remote file name to use for saving is extracted from the\n" " given URL, nothing else.\n" "\n" " Consequentially, the file will be saved in the current working\n" " directory. If you want the file saved in a different directory,\n" " make sure you change current working directory before you invoke\n" , stdout); fputs( " curl with the -O, --remote-name flag!\n" "\n" " There is no URL decoding done on the file name. If it has %20 or\n" " other URL encoded parts of the name, they will end up as-is as\n" " file name.\n" "\n" " You may use this option as many times as the number of URLs you\n" " have.\n" "\n" " --oauth2-bearer\n" " (IMAP, POP3, SMTP) Specify the Bearer Token for OAUTH 2.0 server\n" , stdout); fputs( " authentication. The Bearer Token is used in conjunction with the\n" " user name which can be specified as part of the --url or -u,\n" " --user options.\n" "\n" " The Bearer Token and user name are formatted according to RFC\n" " 6750.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " -p, --proxytunnel\n" " When an HTTP proxy is used (-x, --proxy), this option will cause\n" , stdout); fputs( " non-HTTP protocols to attempt to tunnel through the proxy\n" " instead of merely using it to do HTTP-like operations. The tun-\n" " nel approach is made with the HTTP proxy CONNECT request and\n" " requires that the proxy allows direct connect to the remote port\n" " number curl wants to tunnel through to.\n" "\n" " -P, --ftp-port
\n" " (FTP) Reverses the default initiator/listener roles when con-\n" , stdout); fputs( " necting with FTP. This switch makes curl use active mode. In\n" " practice, curl then tells the server to connect back to the\n" " client's specified address and port, while passive mode asks the\n" " server to setup an IP address and port for it to connect to.\n" "
should be one of:\n" "\n" " interface\n" " i.e \"eth0\" to specify which interface's IP address you\n" , stdout); fputs( " want to use (Unix only)\n" "\n" " IP address\n" " i.e \"192.168.10.1\" to specify the exact IP address\n" "\n" " host name\n" " i.e \"my.host.domain\" to specify the machine\n" "\n" " - make curl pick the same IP address that is already used\n" " for the control connection\n" "\n" " If this option is used several times, the last one will be used. Dis-\n" , stdout); fputs( " able the use of PORT with --ftp-pasv. Disable the attempt to use the\n" " EPRT command instead of PORT by using --disable-eprt. EPRT is really\n" " PORT++.\n" "\n" " Starting in 7.19.5, you can append \":[start]-[end]\" to the right of the\n" " address, to tell curl what TCP port range to use. That means you spec-\n" " ify a port range, from a lower to a higher number. A single number\n" " works as well, but do note that it increases the risk of failure since\n" , stdout); fputs( " the port may not be available.\n" "\n" " --pass \n" " (SSL/SSH) Passphrase for the private key\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " --post301\n" " (HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert\n" " POST requests into GET requests when following a 301 redirect-\n" " ion. The non-RFC behaviour is ubiquitous in web browsers, so\n" , stdout); fputs( " curl does the conversion by default to maintain consistency.\n" " However, a server may require a POST to remain a POST after such\n" " a redirection. This option is meaningful only when using -L,\n" " --location (Added in 7.17.1)\n" "\n" " --post302\n" " (HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert\n" " POST requests into GET requests when following a 302 redirect-\n" , stdout); fputs( " ion. The non-RFC behaviour is ubiquitous in web browsers, so\n" " curl does the conversion by default to maintain consistency.\n" " However, a server may require a POST to remain a POST after such\n" " a redirection. This option is meaningful only when using -L,\n" " --location (Added in 7.19.1)\n" "\n" " --post303\n" " (HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert\n" , stdout); fputs( " POST requests into GET requests when following a 303 redirect-\n" " ion. The non-RFC behaviour is ubiquitous in web browsers, so\n" " curl does the conversion by default to maintain consistency.\n" " However, a server may require a POST to remain a POST after such\n" " a redirection. This option is meaningful only when using -L,\n" " --location (Added in 7.26.0)\n" "\n" " --proto \n" , stdout); fputs( " Tells curl to use the listed protocols for its initial\n" " retrieval. Protocols are evaluated left to right, are comma sep-\n" " arated, and are each a protocol name or 'all', optionally pre-\n" " fixed by zero or more modifiers. Available modifiers are:\n" "\n" " + Permit this protocol in addition to protocols already permit-\n" " ted (this is the default if no modifier is used).\n" "\n" , stdout); fputs( " - Deny this protocol, removing it from the list of protocols\n" " already permitted.\n" "\n" " = Permit only this protocol (ignoring the list already permit-\n" " ted), though subject to later modification by subsequent\n" " entries in the comma separated list.\n" "\n" " For example:\n" "\n" " --proto -ftps uses the default protocols, but disables ftps\n" "\n" " --proto -all,https,+http\n" , stdout); fputs( " only enables http and https\n" "\n" " --proto =http,https\n" " also only enables http and https\n" "\n" " Unknown protocols produce a warning. This allows scripts to\n" " safely rely on being able to disable potentially dangerous pro-\n" " tocols, without relying upon support for that protocol being\n" " built into curl to avoid an error.\n" "\n" , stdout); fputs( " This option can be used multiple times, in which case the effect\n" " is the same as concatenating the protocols into one instance of\n" " the option.\n" "\n" " (Added in 7.20.2)\n" "\n" " --proto-redir \n" " Tells curl to use the listed protocols after a redirect. See\n" " --proto for how protocols are represented.\n" "\n" " (Added in 7.20.2)\n" "\n" " --proxy-anyauth\n" , stdout); fputs( " Tells curl to pick a suitable authentication method when commu-\n" " nicating with the given proxy. This might cause an extra\n" " request/response round-trip. (Added in 7.13.2)\n" "\n" " --proxy-basic\n" " Tells curl to use HTTP Basic authentication when communicating\n" " with the given proxy. Use --basic for enabling HTTP Basic with a\n" " remote host. Basic is the default authentication method curl\n" , stdout); fputs( " uses with proxies.\n" "\n" " --proxy-digest\n" " Tells curl to use HTTP Digest authentication when communicating\n" " with the given proxy. Use --digest for enabling HTTP Digest with\n" " a remote host.\n" "\n" " --proxy-negotiate\n" " Tells curl to use HTTP Negotiate authentication when communicat-\n" " ing with the given proxy. Use --negotiate for enabling HTTP\n" " Negotiate with a remote host. (Added in 7.17.1)\n" "\n" , stdout); fputs( " --proxy-ntlm\n" " Tells curl to use HTTP NTLM authentication when communicating\n" " with the given proxy. Use --ntlm for enabling NTLM with a remote\n" " host.\n" "\n" " --proxy1.0 \n" " Use the specified HTTP 1.0 proxy. If the port number is not\n" " specified, it is assumed at port 1080.\n" "\n" " The only difference between this and the HTTP proxy option (-x,\n" , stdout); fputs( " --proxy), is that attempts to use CONNECT through the proxy will\n" " specify an HTTP 1.0 protocol instead of the default HTTP 1.1.\n" "\n" " --pubkey \n" " (SSH) Public key file name. Allows you to provide your public\n" " key in this separate file.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " -q If used as the first parameter on the command line, the curlrc\n" , stdout); fputs( " config file will not be read and used. See the -K, --config for\n" " details on the default config file search path.\n" "\n" " -Q, --quote \n" " (FTP/SFTP) Send an arbitrary command to the remote FTP or SFTP\n" " server. Quote commands are sent BEFORE the transfer takes place\n" " (just after the initial PWD command in an FTP transfer, to be\n" " exact). To make commands take place after a successful transfer,\n" , stdout); fputs( " prefix them with a dash '-'. To make commands be sent after\n" " curl has changed the working directory, just before the transfer\n" " command(s), prefix the command with a '+' (this is only sup-\n" " ported for FTP). You may specify any number of commands. If the\n" " server returns failure for one of the commands, the entire oper-\n" " ation will be aborted. You must send syntactically correct FTP\n" , stdout); fputs( " commands as RFC 959 defines to FTP servers, or one of the com-\n" " mands listed below to SFTP servers. This option can be used\n" " multiple times. When speaking to an FTP server, prefix the com-\n" " mand with an asterisk (*) to make curl continue even if the com-\n" " mand fails as by default curl will stop at first failure.\n" "\n" " SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP\n" , stdout); fputs( " quote commands itself before sending them to the server. File\n" " names may be quoted shell-style to embed spaces or special char-\n" " acters. Following is the list of all supported SFTP quote com-\n" " mands:\n" "\n" " chgrp group file\n" " The chgrp command sets the group ID of the file named by\n" " the file operand to the group ID specified by the group\n" , stdout); fputs( " operand. The group operand is a decimal integer group ID.\n" "\n" " chmod mode file\n" " The chmod command modifies the file mode bits of the\n" " specified file. The mode operand is an octal integer mode\n" " number.\n" "\n" " chown user file\n" " The chown command sets the owner of the file named by the\n" " file operand to the user ID specified by the user oper-\n" , stdout); fputs( " and. The user operand is a decimal integer user ID.\n" "\n" " ln source_file target_file\n" " The ln and symlink commands create a symbolic link at the\n" " target_file location pointing to the source_file loca-\n" " tion.\n" "\n" " mkdir directory_name\n" " The mkdir command creates the directory named by the\n" " directory_name operand.\n" "\n" , stdout); fputs( " pwd The pwd command returns the absolute pathname of the cur-\n" " rent working directory.\n" "\n" " rename source target\n" " The rename command renames the file or directory named by\n" " the source operand to the destination path named by the\n" " target operand.\n" "\n" " rm file\n" " The rm command removes the file specified by the file op-\n" " erand.\n" "\n" , stdout); fputs( " rmdir directory\n" " The rmdir command removes the directory entry specified\n" " by the directory operand, provided it is empty.\n" "\n" " symlink source_file target_file\n" " See ln.\n" "\n" " -r, --range \n" " (HTTP/FTP/SFTP/FILE) Retrieve a byte range (i.e a partial docu-\n" " ment) from a HTTP/1.1, FTP or SFTP server or a local FILE.\n" " Ranges can be specified in a number of ways.\n" "\n" , stdout); fputs( " 0-499 specifies the first 500 bytes\n" "\n" " 500-999 specifies the second 500 bytes\n" "\n" " -500 specifies the last 500 bytes\n" "\n" " 9500- specifies the bytes from offset 9500 and forward\n" "\n" " 0-0,-1 specifies the first and last byte only(*)(H)\n" "\n" " 500-700,600-799\n" " specifies 300 bytes from offset 500(H)\n" "\n" " 100-199,500-599\n" , stdout); fputs( " specifies two separate 100-byte ranges(*)(H)\n" "\n" " (*) = NOTE that this will cause the server to reply with a multipart\n" " response!\n" "\n" " Only digit characters (0-9) are valid in the 'start' and 'stop' fields\n" " of the 'start-stop' range syntax. If a non-digit character is given in\n" " the range, the server's response will be unspecified, depending on the\n" " server's configuration.\n" "\n" , stdout); fputs( " You should also be aware that many HTTP/1.1 servers do not have this\n" " feature enabled, so that when you attempt to get a range, you'll\n" " instead get the whole document.\n" "\n" " FTP and SFTP range downloads only support the simple 'start-stop' syn-\n" " tax (optionally with one of the numbers omitted). FTP use depends on\n" " the extended FTP command SIZE.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " -R, --remote-time\n" , stdout); fputs( " When used, this will make curl attempt to figure out the time-\n" " stamp of the remote file, and if that is available make the\n" " local file get that same timestamp.\n" "\n" " --random-file \n" " (SSL) Specify the path name to file containing what will be con-\n" " sidered as random data. The data is used to seed the random\n" " engine for SSL connections. See also the --egd-file option.\n" "\n" , stdout); fputs( " --raw (HTTP) When used, it disables all internal HTTP decoding of con-\n" " tent or transfer encodings and instead makes them passed on\n" " unaltered, raw. (Added in 7.16.2)\n" "\n" " --remote-name-all\n" " This option changes the default action for all given URLs to be\n" " dealt with as if -O, --remote-name were used for each one. So if\n" " you want to disable that for a specific URL after --remote-name-\n" , stdout); fputs( " all has been used, you must use \"-o -\" or --no-remote-name.\n" " (Added in 7.19.0)\n" "\n" " --resolve \n" " Provide a custom address for a specific host and port pair.\n" " Using this, you can make the curl requests(s) use a specified\n" " address and prevent the otherwise normally resolved address to\n" " be used. Consider it a sort of /etc/hosts alternative provided\n" , stdout); fputs( " on the command line. The port number should be the number used\n" " for the specific protocol the host will be used for. It means\n" " you need several entries if you want to provide address for the\n" " same host but different ports.\n" "\n" " This option can be used many times to add many host names to\n" " resolve.\n" "\n" " (Added in 7.21.3)\n" "\n" " --retry \n" , stdout); fputs( " If a transient error is returned when curl tries to perform a\n" " transfer, it will retry this number of times before giving up.\n" " Setting the number to 0 makes curl do no retries (which is the\n" " default). Transient error means either: a timeout, an FTP 4xx\n" " response code or an HTTP 5xx response code.\n" "\n" " When curl is about to retry a transfer, it will first wait one\n" , stdout); fputs( " second and then for all forthcoming retries it will double the\n" " waiting time until it reaches 10 minutes which then will be the\n" " delay between the rest of the retries. By using --retry-delay\n" " you disable this exponential backoff algorithm. See also\n" " --retry-max-time to limit the total time allowed for retries.\n" " (Added in 7.12.3)\n" "\n" , stdout); fputs( " If this option is used several times, the last one will be used.\n" "\n" " --retry-delay \n" " Make curl sleep this amount of time before each retry when a\n" " transfer has failed with a transient error (it changes the\n" " default backoff time algorithm between retries). This option is\n" " only interesting if --retry is also used. Setting this delay to\n" , stdout); fputs( " zero will make curl use the default backoff time. (Added in\n" " 7.12.3)\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " --retry-max-time \n" " The retry timer is reset before the first transfer attempt.\n" " Retries will be done as usual (see --retry) as long as the timer\n" " hasn't reached this given limit. Notice that if the timer hasn't\n" , stdout); fputs( " reached the limit, the request will be made and while perform-\n" " ing, it may take longer than this given time period. To limit a\n" " single request's maximum time, use -m, --max-time. Set this\n" " option to zero to not timeout retries. (Added in 7.12.3)\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " -s, --silent\n" " Silent or quiet mode. Don't show progress meter or error mes-\n" , stdout); fputs( " sages. Makes Curl mute. It will still output the data you ask\n" " for, potentially even to the terminal/stdout unless you redirect\n" " it.\n" "\n" " --sasl-ir\n" " Enable initial response in SASL authentication. (Added in\n" " 7.31.0)\n" "\n" " -S, --show-error\n" " When used with -s it makes curl show an error message if it\n" " fails.\n" "\n" " --ssl (FTP, POP3, IMAP, SMTP) Try to use SSL/TLS for the connection.\n" , stdout); fputs( " Reverts to a non-secure connection if the server doesn't support\n" " SSL/TLS. See also --ftp-ssl-control and --ssl-reqd for differ-\n" " ent levels of encryption required. (Added in 7.20.0)\n" "\n" " This option was formerly known as --ftp-ssl (Added in 7.11.0).\n" " That option name can still be used but will be removed in a\n" " future version.\n" "\n" " --ssl-reqd\n" , stdout); fputs( " (FTP, POP3, IMAP, SMTP) Require SSL/TLS for the connection.\n" " Terminates the connection if the server doesn't support SSL/TLS.\n" " (Added in 7.20.0)\n" "\n" " This option was formerly known as --ftp-ssl-reqd (added in\n" " 7.15.5). That option name can still be used but will be removed\n" " in a future version.\n" "\n" " --ssl-allow-beast\n" " (SSL) This option tells curl to not work around a security flaw\n" , stdout); fputs( " in the SSL3 and TLS1.0 protocols known as BEAST. If this option\n" " isn't used, the SSL layer may use work-arounds known to cause\n" " interoperability problems with some older SSL implementations.\n" " WARNING: this option loosens the SSL security, and by using this\n" " flag you ask for exactly that. (Added in 7.25.0)\n" "\n" " --socks4 \n" " Use the specified SOCKS4 proxy. If the port number is not speci-\n" , stdout); fputs( " fied, it is assumed at port 1080. (Added in 7.15.2)\n" "\n" " This option overrides any previous use of -x, --proxy, as they\n" " are mutually exclusive.\n" "\n" " Since 7.21.7, this option is superfluous since you can specify a\n" " socks4 proxy with -x, --proxy using a socks4:// protocol prefix.\n" " If this option is used several times, the last one will be used.\n" "\n" " --socks4a \n" , stdout); fputs( " Use the specified SOCKS4a proxy. If the port number is not spec-\n" " ified, it is assumed at port 1080. (Added in 7.18.0)\n" "\n" " This option overrides any previous use of -x, --proxy, as they\n" " are mutually exclusive.\n" "\n" " Since 7.21.7, this option is superfluous since you can specify a\n" " socks4a proxy with -x, --proxy using a socks4a:// protocol pre-\n" " fix.\n" "\n" , stdout); fputs( " If this option is used several times, the last one will be used.\n" "\n" " --socks5-hostname \n" " Use the specified SOCKS5 proxy (and let the proxy resolve the\n" " host name). If the port number is not specified, it is assumed\n" " at port 1080. (Added in 7.18.0)\n" "\n" " This option overrides any previous use of -x, --proxy, as they\n" " are mutually exclusive.\n" "\n" , stdout); fputs( " Since 7.21.7, this option is superfluous since you can specify a\n" " socks5 hostname proxy with -x, --proxy using a socks5h:// proto-\n" " col prefix.\n" "\n" " If this option is used several times, the last one will be used.\n" " (This option was previously wrongly documented and used as\n" " --socks without the number appended.)\n" "\n" " --socks5 \n" , stdout); fputs( " Use the specified SOCKS5 proxy - but resolve the host name\n" " locally. If the port number is not specified, it is assumed at\n" " port 1080.\n" "\n" " This option overrides any previous use of -x, --proxy, as they\n" " are mutually exclusive.\n" "\n" " Since 7.21.7, this option is superfluous since you can specify a\n" " socks5 proxy with -x, --proxy using a socks5:// protocol prefix.\n" , stdout); fputs( " If this option is used several times, the last one will be used.\n" " (This option was previously wrongly documented and used as\n" " --socks without the number appended.)\n" "\n" " This option (as well as --socks4) does not work with IPV6, FTPS\n" " or LDAP.\n" "\n" " --socks5-gssapi-service \n" " The default service name for a socks server is rcmd/server-fqdn.\n" " This option allows you to change it.\n" "\n" , stdout); fputs( " Examples: --socks5 proxy-name --socks5-gssapi-service sockd\n" " would use sockd/proxy-name --socks5 proxy-name --socks5-gssapi-\n" " service sockd/real-name would use sockd/real-name for cases\n" " where the proxy-name does not match the principal name. (Added\n" " in 7.19.4).\n" "\n" " --socks5-gssapi-nec\n" " As part of the gssapi negotiation a protection mode is negoti-\n" , stdout); fputs( " ated. RFC 1961 says in section 4.3/4.4 it should be protected,\n" " but the NEC reference implementation does not. The option\n" " --socks5-gssapi-nec allows the unprotected exchange of the pro-\n" " tection mode negotiation. (Added in 7.19.4).\n" "\n" " --stderr \n" " Redirect all writes to stderr to the specified file instead. If\n" " the file name is a plain '-', it is instead written to stdout.\n" "\n" , stdout); fputs( " If this option is used several times, the last one will be used.\n" "\n" " -t, --telnet-option \n" " Pass options to the telnet protocol. Supported options are:\n" "\n" " TTYPE= Sets the terminal type.\n" "\n" " XDISPLOC= Sets the X display location.\n" "\n" " NEW_ENV= Sets an environment variable.\n" "\n" " -T, --upload-file \n" " This transfers the specified local file to the remote URL. If\n" , stdout); fputs( " there is no file part in the specified URL, Curl will append the\n" " local file name. NOTE that you must use a trailing / on the last\n" " directory to really prove to Curl that there is no file name or\n" " curl will think that your last directory name is the remote file\n" " name to use. That will most likely cause the upload operation to\n" " fail. If this is used on an HTTP(S) server, the PUT command will\n" " be used.\n" "\n" , stdout); fputs( " Use the file name \"-\" (a single dash) to use stdin instead of a\n" " given file. Alternately, the file name \".\" (a single period)\n" " may be specified instead of \"-\" to use stdin in non-blocking\n" " mode to allow reading server output while stdin is being\n" " uploaded.\n" "\n" " You can specify one -T for each URL on the command line. Each -T\n" , stdout); fputs( " + URL pair specifies what to upload and to where. curl also sup-\n" " ports \"globbing\" of the -T argument, meaning that you can upload\n" " multiple files to a single URL by using the same URL globbing\n" " style supported in the URL, like this:\n" "\n" " curl -T \"{file1,file2}\" http://www.uploadtothissite.com\n" "\n" " or even\n" "\n" " curl -T \"img[1-1000].png\" ftp://ftp.picturemania.com/upload/\n" "\n" " --tcp-nodelay\n" , stdout); fputs( " Turn on the TCP_NODELAY option. See the curl_easy_setopt(3) man\n" " page for details about this option. (Added in 7.11.2)\n" "\n" " --tftp-blksize \n" " (TFTP) Set TFTP BLKSIZE option (must be >512). This is the block\n" " size that curl will try to use when transferring data to or from\n" " a TFTP server. By default 512 bytes will be used.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" , stdout); fputs( " (Added in 7.20.0)\n" "\n" " --tlsauthtype \n" " Set TLS authentication type. Currently, the only supported\n" " option is \"SRP\", for TLS-SRP (RFC 5054). If --tlsuser and\n" " --tlspassword are specified but --tlsauthtype is not, then this\n" " option defaults to \"SRP\". (Added in 7.21.4)\n" "\n" " --tlspassword \n" " Set password for use with the TLS authentication method speci-\n" , stdout); fputs( " fied with --tlsauthtype. Requires that --tlsuser also be set.\n" " (Added in 7.21.4)\n" "\n" " --tlsuser \n" " Set username for use with the TLS authentication method speci-\n" " fied with --tlsauthtype. Requires that --tlspassword also be\n" " set. (Added in 7.21.4)\n" "\n" " --tlsv1.0\n" " (SSL) Forces curl to use TLS version 1.0 when negotiating with a\n" " remote TLS server. (Added in 7.34.0)\n" "\n" " --tlsv1.1\n" , stdout); fputs( " (SSL) Forces curl to use TLS version 1.1 when negotiating with a\n" " remote TLS server. (Added in 7.34.0)\n" "\n" " --tlsv1.2\n" " (SSL) Forces curl to use TLS version 1.2 when negotiating with a\n" " remote TLS server. (Added in 7.34.0)\n" "\n" " --tr-encoding\n" " (HTTP) Request a compressed Transfer-Encoding response using one\n" " of the algorithms curl supports, and uncompress the data while\n" " receiving it.\n" "\n" , stdout); fputs( " (Added in 7.21.6)\n" "\n" " --trace \n" " Enables a full trace dump of all incoming and outgoing data,\n" " including descriptive information, to the given output file. Use\n" " \"-\" as filename to have the output sent to stdout.\n" "\n" " This option overrides previous uses of -v, --verbose or --trace-\n" " ascii.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " --trace-ascii \n" , stdout); fputs( " Enables a full trace dump of all incoming and outgoing data,\n" " including descriptive information, to the given output file. Use\n" " \"-\" as filename to have the output sent to stdout.\n" "\n" " This is very similar to --trace, but leaves out the hex part and\n" " only shows the ASCII part of the dump. It makes smaller output\n" " that might be easier to read for untrained humans.\n" "\n" , stdout); fputs( " This option overrides previous uses of -v, --verbose or --trace.\n" " If this option is used several times, the last one will be used.\n" "\n" " --trace-time\n" " Prepends a time stamp to each trace or verbose line that curl\n" " displays. (Added in 7.14.0)\n" "\n" " -u, --user \n" " Specify the user name, password and optional login options to\n" , stdout); fputs( " use for server authentication. Overrides -n, --netrc and\n" " --netrc-optional.\n" "\n" " If you simply specify the user name, with or without the login\n" " options, curl will prompt for a password.\n" "\n" " If you use an SSPI-enabled curl binary and perform NTLM authen-\n" " tication, you can force curl to select the user name and pass-\n" " word from your environment by simply specifying a single colon\n" , stdout); fputs( " with this option: \"-u :\" or by specfying the login options on\n" " their own, for example \"-u ;auth=NTLM\".\n" "\n" " You can use the optional login options part to specify protocol\n" " specific options that may be used during authentication. At\n" " present only IMAP, POP3 and SMTP support login options as part\n" " of the user login information. For more information about the\n" , stdout); fputs( " login options please see RFC 2384, RFC 5092 and IETF draft\n" " draft-earhart-url-smtp-00.txt (Added in 7.31.0).\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " -U, --proxy-user \n" " Specify the user name and password to use for proxy authentica-\n" " tion.\n" "\n" " If you use an SSPI-enabled curl binary and do NTLM authentica-\n" , stdout); fputs( " tion, you can force curl to pick up the user name and password\n" " from your environment by simply specifying a single colon with\n" " this option: \"-U :\".\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " --url \n" " Specify a URL to fetch. This option is mostly handy when you\n" " want to specify URL(s) in a config file.\n" "\n" , stdout); fputs( " This option may be used any number of times. To control where\n" " this URL is written, use the -o, --output or the -O, --remote-\n" " name options.\n" " -v, --verbose\n" " Makes the fetching more verbose/talkative. Mostly useful for\n" " debugging. A line starting with '>' means \"header data\" sent by\n" " curl, '<' means \"header data\" received by curl that is hidden in\n" , stdout); fputs( " normal cases, and a line starting with '*' means additional info\n" " provided by curl.\n" "\n" " Note that if you only want HTTP headers in the output, -i,\n" " --include might be the option you're looking for.\n" "\n" " If you think this option still doesn't give you enough details,\n" " consider using --trace or --trace-ascii instead.\n" "\n" " This option overrides previous uses of --trace-ascii or --trace.\n" "\n" , stdout); fputs( " Use -s, --silent to make curl quiet.\n" "\n" " -w, --write-out \n" " Defines what to display on stdout after a completed and success-\n" " ful operation. The format is a string that may contain plain\n" " text mixed with any number of variables. The string can be spec-\n" " ified as \"string\", to get read from a particular file you spec-\n" " ify it \"@filename\" and to tell curl to read the format from\n" , stdout); fputs( " stdin you write \"@-\".\n" "\n" " The variables present in the output format will be substituted\n" " by the value or text that curl thinks fit, as described below.\n" " All variables are specified as %{variable_name} and to output a\n" " normal % you just write them as %%. You can output a newline by\n" " using \\n, a carriage return with \\r and a tab space with \\t.\n" "\n" , stdout); fputs( " NOTE: The %-symbol is a special symbol in the win32-environment,\n" " where all occurrences of % must be doubled when using this\n" " option.\n" "\n" " The variables available are:\n" "\n" " content_type The Content-Type of the requested document, if\n" " there was any.\n" "\n" " filename_effective\n" " The ultimate filename that curl writes out to.\n" , stdout); fputs( " This is only meaningful if curl is told to write\n" " to a file with the --remote-name or --output\n" " option. It's most useful in combination with the\n" " --remote-header-name option. (Added in 7.25.1)\n" "\n" " ftp_entry_path The initial path curl ended up in when logging on\n" " to the remote FTP server. (Added in 7.15.4)\n" "\n" , stdout); fputs( " http_code The numerical response code that was found in the\n" " last retrieved HTTP(S) or FTP(s) transfer. In\n" " 7.18.2 the alias response_code was added to show\n" " the same info.\n" "\n" " http_connect The numerical code that was found in the last\n" " response (from a proxy) to a curl CONNECT\n" " request. (Added in 7.12.4)\n" "\n" , stdout); fputs( " local_ip The IP address of the local end of the most\n" " recently done connection - can be either IPv4 or\n" " IPv6 (Added in 7.29.0)\n" "\n" " local_port The local port number of the most recently done\n" " connection (Added in 7.29.0)\n" "\n" " num_connects Number of new connects made in the recent trans-\n" " fer. (Added in 7.12.3)\n" "\n" , stdout); fputs( " num_redirects Number of redirects that were followed in the\n" " request. (Added in 7.12.3)\n" "\n" " redirect_url When an HTTP request was made without -L to fol-\n" " low redirects, this variable will show the actual\n" " URL a redirect would take you to. (Added in\n" " 7.18.2)\n" "\n" " remote_ip The remote IP address of the most recently done\n" , stdout); fputs( " connection - can be either IPv4 or IPv6 (Added in\n" " 7.29.0)\n" "\n" " remote_port The remote port number of the most recently done\n" " connection (Added in 7.29.0)\n" "\n" " size_download The total amount of bytes that were downloaded.\n" "\n" " size_header The total amount of bytes of the downloaded head-\n" " ers.\n" "\n" , stdout); fputs( " size_request The total amount of bytes that were sent in the\n" " HTTP request.\n" "\n" " size_upload The total amount of bytes that were uploaded.\n" "\n" " speed_download The average download speed that curl measured for\n" " the complete download. Bytes per second.\n" "\n" " speed_upload The average upload speed that curl measured for\n" " the complete upload. Bytes per second.\n" "\n" , stdout); fputs( " ssl_verify_result\n" " The result of the SSL peer certificate verifica-\n" " tion that was requested. 0 means the verification\n" " was successful. (Added in 7.19.0)\n" "\n" " time_appconnect\n" " The time, in seconds, it took from the start\n" " until the SSL/SSH/etc connect/handshake to the\n" , stdout); fputs( " remote host was completed. (Added in 7.19.0)\n" "\n" " time_connect The time, in seconds, it took from the start\n" " until the TCP connect to the remote host (or\n" " proxy) was completed.\n" "\n" " time_namelookup\n" " The time, in seconds, it took from the start\n" " until the name resolving was completed.\n" "\n" " time_pretransfer\n" , stdout); fputs( " The time, in seconds, it took from the start\n" " until the file transfer was just about to begin.\n" " This includes all pre-transfer commands and nego-\n" " tiations that are specific to the particular pro-\n" " tocol(s) involved.\n" "\n" " time_redirect The time, in seconds, it took for all redirection\n" , stdout); fputs( " steps include name lookup, connect, pretransfer\n" " and transfer before the final transaction was\n" " started. time_redirect shows the complete execu-\n" " tion time for multiple redirections. (Added in\n" " 7.12.3)\n" "\n" " time_starttransfer\n" " The time, in seconds, it took from the start\n" , stdout); fputs( " until the first byte was just about to be trans-\n" " ferred. This includes time_pretransfer and also\n" " the time the server needed to calculate the\n" " result.\n" "\n" " time_total The total time, in seconds, that the full opera-\n" " tion lasted. The time will be displayed with mil-\n" " lisecond resolution.\n" "\n" , stdout); fputs( " url_effective The URL that was fetched last. This is most mean-\n" " ingful if you've told curl to follow location:\n" " headers.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " -x, --proxy <[protocol://][user:password@]proxyhost[:port]>\n" " Use the specified proxy.\n" "\n" " The proxy string can be specified with a protocol:// prefix to\n" , stdout); fputs( " specify alternative proxy protocols. Use socks4://, socks4a://,\n" " socks5:// or socks5h:// to request the specific SOCKS version to\n" " be used. No protocol specified, http:// and all others will be\n" " treated as HTTP proxies. (The protocol support was added in curl\n" " 7.21.7)\n" "\n" " If the port number is not specified in the proxy string, it is\n" " assumed to be 1080.\n" "\n" , stdout); fputs( " This option overrides existing environment variables that set\n" " the proxy to use. If there's an environment variable setting a\n" " proxy, you can set proxy to \"\" to override it.\n" "\n" " All operations that are performed over an HTTP proxy will trans-\n" " parently be converted to HTTP. It means that certain protocol\n" " specific operations might not be available. This is not the case\n" , stdout); fputs( " if you can tunnel through the proxy, as one with the -p, --prox-\n" " ytunnel option.\n" "\n" " User and password that might be provided in the proxy string are\n" " URL decoded by curl. This allows you to pass in special charac-\n" " ters such as @ by using %40 or pass in a colon with %3a.\n" "\n" " The proxy host can be specified the exact same way as the proxy\n" " environment variables, including the protocol prefix (http://)\n" , stdout); fputs( " and the embedded user + password.\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " -X, --request \n" " (HTTP) Specifies a custom request method to use when communicat-\n" " ing with the HTTP server. The specified request will be used\n" " instead of the method otherwise used (which defaults to GET).\n" " Read the HTTP 1.1 specification for details and explanations.\n" , stdout); fputs( " Common additional HTTP requests include PUT and DELETE, but\n" " related technologies like WebDAV offers PROPFIND, COPY, MOVE and\n" " more.\n" "\n" " Normally you don't need this option. All sorts of GET, HEAD,\n" " POST and PUT requests are rather invoked by using dedicated com-\n" " mand line options.\n" "\n" " This option only changes the actual word used in the HTTP\n" , stdout); fputs( " request, it does not alter the way curl behaves. So for example\n" " if you want to make a proper HEAD request, using -X HEAD will\n" " not suffice. You need to use the -I, --head option.\n" "\n" " (FTP) Specifies a custom FTP command to use instead of LIST when\n" " doing file lists with FTP.\n" "\n" " (POP3) Specifies a custom POP3 command to use instead of LIST or\n" " RETR. (Added in 7.26.0)\n" "\n" , stdout); fputs( " (IMAP) Specifies a custom IMAP command to use insead of LIST.\n" " (Added in 7.30.0)\n" "\n" " (SMTP) Specifies a custom SMTP command to use instead of HELP or\n" " VRFY. (Added in 7.34.0)\n" "\n" " If this option is used several times, the last one will be used.\n" "\n" " --xattr\n" " When saving output to a file, this option tells curl to store\n" " certain file metadata in extended file attributes. Currently,\n" , stdout); fputs( " the URL is stored in the xdg.origin.url attribute and, for HTTP,\n" " the content type is stored in the mime_type attribute. If the\n" " file system does not support extended attributes, a warning is\n" " issued.\n" "\n" " -y, --speed-time

This is GNUTLS

Session ID: 003030000100000001000000000000000030330001000000B062410001000000

If your browser supports session resuming, then you should see the same session ID, when you press the reload button.

Connected as user 'jsmith'.

Protocol version:TLS1.2
Key Exchange:SRP
CompressionNULL
CipherAES-128-CBC
MACSHA1
CiphersuiteSRP_SHA_AES_128_CBC_SHA1


Your HTTP header was:

User-Agent: curl/7.21.4-DEV (x86_64-apple-darwin10.5.0) libcurl/7.21.4-DEV GnuTLS/2.10.4 zlib/1.2.5 libidn/1.19
Host: localhost:9011
Accept: */*

# Client-side httptls+srp TLS-SRP simple TLS-SRP HTTPS GET, check user in response --insecure --tlsauthtype SRP --tlsuser jsmith --tlspassword abc https://%HOSTIP:%HTTPTLSSRPPORT # Verify data after the test has been "shot" HTTP/1.0 200 OK Content-type: text/html

This is GNUTLS

If your browser supports session resuming, then you should see the same session ID, when you press the reload button.

Connected as user 'jsmith'.

Key Exchange:SRP
CompressionNULL
CipherAES-128-CBC
MACSHA1
CiphersuiteSRP_SHA_AES_128_CBC_SHA1

Host: %HOSTIP:%HTTPTLSSRPPORT
Accept: */*

s/^

Session ID:.*// s/^


Your HTTP header was:

.*/
/
s/Protocol version:.*[0-9]//




curl-7.35.0/tests/data/test5980000644000175000017500000000220012213173003012701 00000000000000


HTTP
HTTP GET
HTTP set cookie
cookies
CURLOPT_REFERER
curl_easy_reset


#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Connection: close
Content-Type: text/html

-foo-


# since the request runs twice

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Connection: close
Content-Type: text/html

-foo-
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Connection: close
Content-Type: text/html

-foo-




# Client-side


http

# tool is what to use instead of 'curl'

lib598


 
curl_easy_reset with referer and other strings set
 
 
http://%HOSTIP:%HTTPPORT/598



#
# Verify data after the test has been "shot"


GET /598 HTTP/1.1
User-Agent: the-moo agent next generation
Host: %HOSTIP:%HTTPPORT
Accept: */*
Referer: http://example.com/the-moo
Cookie: name=moo

GET /598 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test10970000644000175000017500000000343312270035364012777 00000000000000


HTTP
HTTP POST
HTTP CONNECT
HTTP proxy
HTTP proxy NTLM auth



# Server-side


HTTP/1.1 200 We are fine and cool
Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2
Content-Length: 27

This is all fine and dandy



HTTP/1.1 200 We are fine and cool
Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2
Content-Length: 27

This is all fine and dandy



HTTP/1.1 200 We are fine and cool
Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2
Content-Length: 27

HTTP/1.1 200 We are fine and cool
Server: Apache/1.3.27 (Dorw1n) PHP/44.1.2
Content-Length: 27

This is all fine and dandy



# Client-side


https


NTLM
!SSPI

 
HTTP POST using CONNECT with --proxy-ntlm but no auth is required
 
 
http://test.a.galaxy.far.far.away.1097:%HTTPPORT/1097 --proxy http://%HOSTIP:%HTTPPORT --proxy-user foo:bar --proxy-ntlm -d "dummy=value" -p



# Verify data after the test has been "shot"


^User-Agent: curl/.*


CONNECT test.a.galaxy.far.far.away.1097:%HTTPPORT HTTP/1.1
Host: test.a.galaxy.far.far.away.1097:%HTTPPORT
Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
User-Agent: curl/7.19.5-CVS (i686-pc-linux-gnu) libcurl/7.19.5-CVS OpenSSL/0.9.8g zlib/1.2.3.3 c-ares/1.6.1-CVS libidn/1.12 libssh2/1.0.1_CVS
Proxy-Connection: Keep-Alive

POST /1097 HTTP/1.1
User-Agent: curl/7.19.5-CVS (i686-pc-linux-gnu) libcurl/7.19.5-CVS OpenSSL/0.9.8g zlib/1.2.3.3 c-ares/1.6.1-CVS libidn/1.12 libssh2/1.0.1_CVS
Host: test.a.galaxy.far.far.away.1097:%HTTPPORT
Accept: */*
Content-Length: 0
Content-Type: application/x-www-form-urlencoded





curl-7.35.0/tests/data/test13860000644000175000017500000000226612213173003012771 00000000000000


FTP
RETR



# Server-side

# file1386 contents...

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1386; charset=funny; option=strange

MOOOO



# Client-side


ftp


FTP DL, file with Content-Disposition inside, using -o fname


ftp://%HOSTIP:%FTPPORT/path/file1386 -o log/download1386


perl %SRCDIR/libtest/notexists.pl log/file1386 log/name1386



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1386
RETR file1386
QUIT



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1386; charset=funny; option=strange

MOOOO







curl-7.35.0/tests/data/test12190000644000175000017500000000104612262102135012761 00000000000000


FTP
PASV
RETR


# Server-side


data
    to
      see
that FTP
works
  so does it?


REPLY welcome 230 welcome without password



# Client-side


ftp

 
FTP with no user+password required (230 response)
 
 
ftp://%HOSTIP:%FTPPORT/1219




# Verify data after the test has been "shot"


PWD
EPSV
TYPE I
SIZE 1219
RETR 1219
QUIT



curl-7.35.0/tests/data/test8230000644000175000017500000000245412262353672012723 00000000000000


IMAP
IMAP AUTH DIGEST-MD5
RFC2831



#
# Server-side


AUTH DIGEST-MD5
REPLY AUTHENTICATE + cmVhbG09ImN1cmwiLG5vbmNlPSI1MzAwZDE3YTFkNjk1YmQ0MTFlNGNkZjk2Zjk1NDhjMjNjZWQ2MTc1IixhbGdvcml0aG09bWQ1LXNlc3MscW9wPSJhdXRoIg==
REPLY dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIxMjM0NTY3OCIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJpbWFwL2N1cmwiLHJlc3BvbnNlPWNmN2U4ZjIzNjI2OTg1ODAyN2YwNzFjM2I0MGQ4YjJm +
REPLY  A002 OK AUTHENTICATE completed


From: me@somewhere
To: fake@nowhere

body

--
  yours sincerely



#
# Client-side


imap


debug
crypto

 
IMAP DIGEST-MD5 authentication
 
 
'imap://%HOSTIP:%IMAPPORT/823/;UID=1' -u user:secret



#
# Verify data after the test has been "shot"


A001 CAPABILITY
A002 AUTHENTICATE DIGEST-MD5
dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIxMjM0NTY3OCIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJpbWFwL2N1cmwiLHJlc3BvbnNlPWNmN2U4ZjIzNjI2OTg1ODAyN2YwNzFjM2I0MGQ4YjJm

A003 SELECT 823
A004 FETCH 1 BODY[]
A005 LOGOUT



curl-7.35.0/tests/data/test13390000644000175000017500000000214412213173003012762 00000000000000


HTTP
HTTP GET
-J



#


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html

12345



#
# Client-side

# this relies on the debug feature to allow us to set directory to store the
# -O and -J output in, using the CURL_TESTDIR variable

debug


http


HTTP GET with -O -J without Content-Disposition, -D stdout


CURL_TESTDIR=%PWD/log


http://%HOSTIP:%HTTPPORT/1339 -J -O -D -



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1339 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




12345



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html





curl-7.35.0/tests/data/test9260000644000175000017500000000077212262353672012730 00000000000000


SMTP
VRFY



#
# Server-side


REPLY VRFY 550 Unknown user



#
# Client-side


smtp

 
SMTP unknown user VRFY
 
 
smtp://%HOSTIP:%SMTPPORT/926 --mail-rcpt recipient



#
# Verify data after the test has been "shot"

# 56 - CURLE_RECV_ERROR

56


EHLO 926
VRFY recipient
QUIT



curl-7.35.0/tests/data/test10310000644000175000017500000000256412213173003012755 00000000000000


HTTP
HTTP GET
followlocation


# Server-side


HTTP/1.1 301 This is a weirdo text message swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Location: ?coolsite=yes/10310002.txt
Connection: close

This server reply is for testing a simple Location: following



HTTP/1.1 200 Followed here fine swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 52

If this is received, the location following worked



HTTP/1.1 301 This is a weirdo text message swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Location: ?coolsite=yes/10310002.txt
Connection: close

HTTP/1.1 200 Followed here fine swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 52

If this is received, the location following worked




# Client-side


http

 
HTTP Location: following to a query string
 
 
http://%HOSTIP:%HTTPPORT/want/this/1031 -L



# Verify data after the test has been "shot"


^User-Agent:.*


GET /want/this/1031 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /want/this/1031?coolsite=yes/10310002.txt HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test550000644000175000017500000000171312213173003012615 00000000000000


HTTP
HTTP GET
followlocation




HTTP/1.1 302 OK swsclose
Location: 550002
Date: Thu, 09 Nov 2010 14:50:00 GMT
Connection: close



HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:50:00 GMT
Connection: close

body


HTTP/1.1 302 OK swsclose
Location: 550002
Date: Thu, 09 Nov 2010 14:50:00 GMT
Connection: close

HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:50:00 GMT
Connection: close

body





http

 
HTTP follow redirect with single slash in path
 
 
http://%HOSTIP:%HTTPPORT/55 -L





^User-Agent:.*


GET /55 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /550002 HTTP/1.1
User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test10990000644000175000017500000000116112213173003012763 00000000000000


TFTP
TFTP RRQ
FAILURE





data for 1099



#
# Client-side


tftp

 
TFTP get first a non-existing file then an existing
 
 
tftp://%HOSTIP:%TFTPPORT/an/invalid-file tftp://%HOSTIP:%TFTPPORT//1099 --trace-ascii log/traceit



#
# Verify pseudo protocol after the test has been "shot"


opcode: 1
filename: an/invalid-file
mode: octet
opcode: 1
filename: /1099
mode: octet


data for 1099



curl-7.35.0/tests/data/test870000644000175000017500000000153012262353672012637 00000000000000


[] range
FAILURE


#
# Server-side


HTTP/1.1 200 OK
Funny-head: yesyes
Content-Length: 15

the number one


HTTP/1.1 200 OK
Funny-head: yesyes
Content-Length: 16

two is nice too



#
# Client-side


http


http

 
urlglob with out of range -o #[num] usage
 
 
"http://%HOSTIP:%HTTPPORT/[870001-870002]" -o "log/dumpit#2.dump"



#
# Verify data after the test has been "shot". Note that the command line
# will write both responses into the same file name so only the second
# survives
#


HTTP/1.1 200 OK
Funny-head: yesyes
Content-Length: 16

two is nice too



curl-7.35.0/tests/data/test13400000644000175000017500000000253112213173003012752 00000000000000


HTTP
HTTP GET
-J



#


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1340; charset=funny; option=strange

12345



#
# Client-side

# this relies on the debug feature to allow us to set directory to store the
# -O and -J output in, using the CURL_TESTDIR variable

debug


http


HTTP GET with -O -J and Content-Disposition, -D file


CURL_TESTDIR=%PWD/log


http://%HOSTIP:%HTTPPORT/1340 -J -O -D log/heads1340



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1340 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




12345



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1340; charset=funny; option=strange




curl: Saved to filename '%PWD/log/name1340'




curl-7.35.0/tests/data/test8280000644000175000017500000000142312262353672012723 00000000000000


IMAP
IMAP AUTH OAUTH2 SASL-IR
RFC6749



#
# Server-side


AUTH XOAUTH2
CAPA SASL-IR
REPLY AUTHENTICATE A002 OK AUTHENTICATE completed


From: me@somewhere
To: fake@nowhere

body

--
  yours sincerely



#
# Client-side


imap

 
IMAP OAuth 2.0 authentication with initial response
 
 
'imap://%HOSTIP:%IMAPPORT/828/;UID=1' -u user --oauth2-bearer mF_9.B5f-4.1JqM



#
# Verify data after the test has been "shot"


A001 CAPABILITY
A002 AUTHENTICATE XOAUTH2 dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB
A003 SELECT 828
A004 FETCH 1 BODY[]
A005 LOGOUT



curl-7.35.0/tests/data/test2770000644000175000017500000000216112262353672012721 00000000000000


HTTP
HTTP FORMPOST


# Server-side


HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 11

blablabla




# Client-side


http

 
HTTP RFC1867-type formposting with custom Content-Type
 
 
http://%HOSTIP:%HTTPPORT/want/277 -F name=daniel -H "Content-Type: text/info"



# Verify data after the test has been "shot"


^User-Agent:.*


s/^--------------------------[a-z0-9]*/--------------------------/
s/boundary=------------------------[a-z0-9]*/boundary=------------------------/


POST /want/277 HTTP/1.1
User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 145
Expect: 100-continue
Content-Type: text/info; boundary=------------------------

--------------------------
Content-Disposition: form-data; name="name"

daniel
----------------------------



curl-7.35.0/tests/data/test8540000644000175000017500000000075712213173003012713 00000000000000


POP3
LIST



#
# Server-side


REPLY LIST +OK but no messages\r\n.





#
# Client-side


pop3

 
POP3 LIST no messages available
 
 
pop3://%HOSTIP:%POP3PORT/ -u user:secret



#
# Verify data after the test has been "shot"


CAPA
USER user
PASS secret
LIST
QUIT



curl-7.35.0/tests/data/test1530000644000175000017500000000730312213173003012675 00000000000000


HTTP
HTTP GET
HTTP Digest auth



# Server-side

# reply back and ask for Digest auth

HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 26

This is not the real page


# This is supposed to be returned when the server gets a
# Authorization: Digest line passed-in from the client

HTTP/1.1 200 OK
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 23

This IS the real page!


#
# This is the second request, and this sends back a response saying that
# the request contained stale data. We want an update. Set swsbounce to
# bounce on to data1003 on the second request.

HTTP/1.1 401 Authorization re-negotiation please swsbounce
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 25

This is not the real page


# The second request to the 1002 section will bounce this one back instead
# thanks to the swsbounce keyword up there

HTTP/1.1 200 OK
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 30

This IS the second real page!



# Client-side


http


crypto

 
HTTP with Digest authorization with stale=true
 
 
http://%HOSTIP:%HTTPPORT/1530001 -u testuser:testpass --digest http://%HOSTIP:%HTTPPORT/1530002



# Verify data after the test has been "shot"


^Authorization.*cnonce
^User-Agent:.*


GET /1530001 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /1530001 HTTP/1.1
Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/1530001", response="f4f83139396995bac665f24a1f1055c7"
User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /1530002 HTTP/1.1
Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/1530002", response="f84511b014fdd0ba6494f42871079c32"
User-Agent: curl/7.11.0-CVS (i686-pc-linux-gnu) libcurl/7.11.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /1530002 HTTP/1.1
Authorization: Digest username="testuser", realm="testrealm", nonce="999999", uri="/1530002", cnonce="MTA4MzIy", nc="00000001", qop="auth", response="25291c357671604a16c0242f56721c07", algorithm="MD5"
User-Agent: curl/7.11.0-CVS (i686-pc-linux-gnu) libcurl/7.11.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS
Host: %HOSTIP:%HTTPPORT
Accept: */*



HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 26

HTTP/1.1 200 OK
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 23

This IS the real page!
HTTP/1.1 401 Authorization re-negotiation please swsbounce
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 25

HTTP/1.1 200 OK
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 30

This IS the second real page!



curl-7.35.0/tests/data/test11140000644000175000017500000000713012213173003012751 00000000000000


FTP
wildcardmatch
ftplistparser



# Server-side





# Client-side


ftp


lib576

 
FTP wildcard download - skip/parser_correctness/CURLOPT_FNMATCH_FUNCTION (DOS)
 
 
ftp://%HOSTIP:%FTPPORT/fully_simulated/DOS/*



# Verify data after the test has been "shot"


0


=============================================================
Remains:      12
Filename:     .
Size:         0B
Time:         04-27-10  05:12AM
Filetype:     directory
=============================================================
Remains:      11
Filename:     ..
Size:         0B
Time:         04-23-10  03:12AM
Filetype:     directory
=============================================================
Remains:      10
Filename:     chmod1
Size:         38B
Time:         01-11-10  10:00AM
Filetype:     regular file
Content:
-------------------------------------------------------------
This file should have permissions 444
-------------------------------------------------------------
=============================================================
Remains:      9
Filename:     chmod2
Size:         38B
Time:         02-01-10  08:00AM
Filetype:     regular file
Content:
-------------------------------------------------------------
This file should have permissions 666
-------------------------------------------------------------
=============================================================
Remains:      8
Filename:     chmod3
Size:         38B
Time:         02-01-10  08:00AM
Filetype:     regular file
Content:
-------------------------------------------------------------
This file should have permissions 777
-------------------------------------------------------------
=============================================================
Remains:      7
Filename:     chmod4
Size:         0B
Time:         05-04-10  04:31AM
Filetype:     directory
=============================================================
Remains:      6
Filename:     chmod5
Size:         0B
Time:         05-04-10  04:31AM
Filetype:     directory
=============================================================
Remains:      5
Filename:     empty_file.dat
Size:         0B
Time:         04-27-10  11:01AM
Filetype:     regular file
Content:
-------------------------------------------------------------
-------------------------------------------------------------
=============================================================
Remains:      4
Filename:     file.txt
Size:         35B
Time:         04-27-10  11:01AM
Filetype:     regular file
Content:
-------------------------------------------------------------
This is content of file "file.txt"
-------------------------------------------------------------
=============================================================
Remains:      3
Filename:     .NeXT
Size:         0B
Time:         01-23-05  02:05AM
Filetype:     directory
=============================================================
Remains:      2
Filename:     someothertext.txt
Size:         47B
Time:         04-27-10  11:01AM
Filetype:     regular file
Content:
-------------------------------------------------------------
# THIS CONTENT WAS SKIPPED IN CHUNK_BGN CALLBACK #
-------------------------------------------------------------
=============================================================
Remains:      1
Filename:     weirddir.txt
Size:         0B
Time:         04-23-10  03:12AM
Filetype:     directory
=============================================================



curl-7.35.0/tests/data/test3540000644000175000017500000000103112213173003012670 00000000000000


FTP
PASV
RETR


# Server-side


data
    to
      see
that FTP
works
  so does it?


REPLY USER 200 fine, proceed without password



# Client-side


ftp

 
FTP without password
 
 
ftp://%HOSTIP:%FTPPORT/354




# Verify data after the test has been "shot"


USER anonymous
PWD
EPSV
TYPE I
SIZE 354
RETR 354
QUIT



curl-7.35.0/tests/data/test8160000644000175000017500000000123212262353672012716 00000000000000


IMAP
STORE
EXPUNGE
CUSTOMREQUEST



#
# Server-side


* 123 FETCH (FLAGS (\Seen \Deleted))


* 123 EXPUNGE



#
# Client-side


imap

 
IMAP delete message with confirmation (CUSTOMREQUEST)
 
 
imap://%HOSTIP:%IMAPPORT/816 -X 'STORE 123 +Flags \Deleted' -Q -EXPUNGE -u user:secret 



#
# Verify data after the test has been "shot"


A001 CAPABILITY
A002 LOGIN user secret
A003 SELECT 816
A004 STORE 123 +Flags \Deleted
A005 EXPUNGE
A006 LOGOUT



curl-7.35.0/tests/data/test2880000644000175000017500000000105312262353672012722 00000000000000


FILE



# Server-side


foo
   bar
bar
   foo
moo



# Client-side


none


file

 
file:// with (unsupported) proxy, authentication and range
 

all_proxy=http://fake:user@%HOSTIP:%HTTPPORT/

 
file://localhost/%PWD/log/test288.txt


foo
   bar
bar
   foo
moo



# Verify data after the test has been "shot"



curl-7.35.0/tests/data/test10940000644000175000017500000000110212213173003012751 00000000000000


TFTP
TFTP RRQ
mode=



#
# Server-side


a chunk of
data
returned
 to client


a chunk of
data
returned
 to client



#
# Client-side


tftp

 
TFTP retrieve with mode=netascii
 
 
"tftp://%HOSTIP:%TFTPPORT//1094;mode=netascii" --trace-ascii log/traceit



#
# Verify pseudo protocol after the test has been "shot"


opcode: 1
filename: /1094
mode: netascii



curl-7.35.0/tests/data/test900000644000175000017500000001340312270035364012625 00000000000000


HTTP
HTTP GET
HTTP NTLM auth
--anyauth
followlocation


# Server-side



HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Basic
WWW-Authenticate: Wild-and-crazy
WWW-Authenticate: NTLM
Content-Type: text/html; charset=iso-8859-1
Content-Length: 26

This is not the real page


# This is supposed to be returned when the server gets a first
# Authorization: NTLM line passed-in from the client

HTTP/1.1 401 Now gimme that second request of crap
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 34
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

This is not the real page either!


# This is supposed to be returned when the server gets the second
# Authorization: NTLM line passed-in from the client

HTTP/1.1 301 Things are fine in server land swsclose
Server: Microsoft-IIS/5.0
Connection: close
Location: /you/900010



# This is the first reply after the redirection

HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Basic
WWW-Authenticate: Wild-and-crazy
WWW-Authenticate: NTLM
Content-Type: text/html; charset=iso-8859-1
Content-Length: 26

This is not the real page



HTTP/1.1 401 Now gimme that second round of crap
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 34
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

This is not the real page either!


# This is supposed to be returned when the server gets the second
# Authorization: NTLM line passed-in from the client

HTTP/1.1 200 Things are fine in server land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!



HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Basic
WWW-Authenticate: Wild-and-crazy
WWW-Authenticate: NTLM
Content-Type: text/html; charset=iso-8859-1
Content-Length: 26

HTTP/1.1 401 Now gimme that second request of crap
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 34
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

HTTP/1.1 301 Things are fine in server land swsclose
Server: Microsoft-IIS/5.0
Connection: close
Location: /you/900010

HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Basic
WWW-Authenticate: Wild-and-crazy
WWW-Authenticate: NTLM
Content-Type: text/html; charset=iso-8859-1
Content-Length: 26

HTTP/1.1 401 Now gimme that second round of crap
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 34
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

HTTP/1.1 200 Things are fine in server land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!




# Client-side


NTLM
!SSPI


http

 
HTTP with NTLM via --anyauth, and then follow-location with NTLM again
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
http://%HOSTIP:%HTTPPORT/90 -u testuser:testpass --anyauth -L


chkhostname curlhost



# Verify data after the test has been "shot"


^User-Agent:.*


GET /90 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /90 HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /90 HTTP/1.1
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /you/900010 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /you/900010 HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
User-Agent: curl/7.10.8-pre1 (i686-pc-linux-gnu) libcurl/7.10.8-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3 GSS
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /you/900010 HTTP/1.1
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
User-Agent: curl/7.10.8-pre1 (i686-pc-linux-gnu) libcurl/7.10.8-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3 GSS
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test13610000644000175000017500000000360612270035364012773 00000000000000


FTP
RETR



# Server-side

# file1361 contents...

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1361; charset=funny; option=strange

MOOOO



# Client-side

# this relies on the debug feature to allow us to set directory to store the
# -O output in, using the CURL_TESTDIR variable

debug


ftp


FTP download, file with C-D inside, using -O -i -D file


CURL_TESTDIR=%PWD/log


ftp://%HOSTIP:%FTPPORT/path/file1361 -O -i -D log/heads1361


perl %SRCDIR/libtest/notexists.pl log/name1361



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1361
RETR file1361
QUIT



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1361; charset=funny; option=strange

MOOOO



220-        _   _ ____  _     
220-    ___| | | |  _ \| |    
220-   / __| | | | |_) | |    
220-  | (__| |_| |  _ {| |___ 
220    \___|\___/|_| \_\_____|
331 We are happy you popped in!
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 214
150 Binary data connection for 1361 () (214 bytes).
226 File transfer complete


s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/







curl-7.35.0/tests/data/test10510000644000175000017500000000400712213173003012751 00000000000000


HTTP
HTTP PUT
followlocation



# Server-side


HTTP/1.1 301 Redirect swsclose
Date: Thu, 29 Jul 2008 14:49:00 GMT
Server: test-server/fake
Location: data/10510002.txt?coolsite=yes
Content-Length: 0
Connection: close



HTTP/1.1 100 Continue

HTTP/1.1 200 Followed here fine swsclose
Date: Thu, 29 Jul 2008 14:49:00 GMT
Server: test-server/fake
Content-Length: 51

If this is received, the location following worked


HTTP/1.1 301 Redirect swsclose
Date: Thu, 29 Jul 2008 14:49:00 GMT
Server: test-server/fake
Location: data/10510002.txt?coolsite=yes
Content-Length: 0
Connection: close

HTTP/1.1 100 Continue

HTTP/1.1 200 Followed here fine swsclose
Date: Thu, 29 Jul 2008 14:49:00 GMT
Server: test-server/fake
Content-Length: 51

If this is received, the location following worked



# Client-side


http

 
HTTP PUT with Location: following
 
 
http://%HOSTIP:%HTTPPORT/want/1051 -L -T log/test1051.txt


Weird
     file
         to
   upload
for
   testing
the
   PUT
      feature



# Verify data after the test has been "shot"


^User-Agent:.*


# The primary reason libcurl sends the data part twice in this test is that
# the test HTTP server is blocking until it has read the entire request,
# including the full request-body before it responds. So in this test the
# server says 301 and 100 _after_ the entire PUT body has been sent.


PUT /want/1051 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 78
Expect: 100-continue

Weird
     file
         to
   upload
for
   testing
the
   PUT
      feature
PUT /want/data/10510002.txt?coolsite=yes HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 78
Expect: 100-continue

Weird
     file
         to
   upload
for
   testing
the
   PUT
      feature



curl-7.35.0/tests/data/test2580000644000175000017500000000636212213173003012707 00000000000000


HTTP
HTTP FORMPOST
HTTP replaced headers
HTTP proxy
HTTP proxy Digest auth
--proxy-anyauth



# Server-side

# The stupid test server doesn't response anything at all until the full
# request has been sent, and then of course the full POST has already been
# sent!

HTTP/1.1 407 no, tell me who you are first swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Proxy-Authenticate: Digest realm="many secrets", nonce="911"
Proxy-Connection: close
Content-Length: 0



HTTP/1.1 200 A OK
Server: Microsoft-IIS/6.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 3

ok


HTTP/1.1 407 no, tell me who you are first swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Proxy-Authenticate: Digest realm="many secrets", nonce="911"
Proxy-Connection: close
Content-Length: 0

HTTP/1.1 200 A OK
Server: Microsoft-IIS/6.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 3

ok




# Client-side


http


crypto

 
HTTP POST multipart without Expect: header using proxy anyauth (Digest)
 
 
-x http://%HOSTIP:%HTTPPORT http://remotehost:54321/we/want/258 -F name=daniel -F tool=curl -F file=@log/test258.txt -H "Expect:" -U uuuser:pppassword --proxy-anyauth

# We create this file before the command is invoked!

foo-
This is a moo-
bar



# Verify data after the test has been "shot"


^(User-Agent:|Content-Type: multipart/form-data;|------).*


POST http://remotehost:54321/we/want/258 HTTP/1.1
User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: remotehost:54321
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 409
Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce

------------------------------7c633d5c27ce
Content-Disposition: form-data; name="name"

daniel
------------------------------7c633d5c27ce
Content-Disposition: form-data; name="tool"

curl
------------------------------7c633d5c27ce
Content-Disposition: form-data; name="file"; filename="test258.txt"
Content-Type: text/plain

foo-
This is a moo-
bar

------------------------------7c633d5c27ce--
POST http://remotehost:54321/we/want/258 HTTP/1.1
User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Proxy-Authorization: Digest username="uuuser", realm="many secrets", nonce="911", uri="/we/want/258", response="2501654ca391f0b5c8c12a1da77e34cd"
Host: remotehost:54321
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 409
Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce

------------------------------7c633d5c27ce
Content-Disposition: form-data; name="name"

daniel
------------------------------7c633d5c27ce
Content-Disposition: form-data; name="tool"

curl
------------------------------7c633d5c27ce
Content-Disposition: form-data; name="file"; filename="test258.txt"
Content-Type: text/plain

foo-
This is a moo-
bar

------------------------------7c633d5c27ce--



curl-7.35.0/tests/data/test6100000644000175000017500000000136712213173003012677 00000000000000


SFTP
post-quote



#
# Server-side


Dummy test file for rmdir test



#
# Client-side


sftp


perl %SRCDIR/libtest/test610.pl mkdir %PWD/log/test610.dir

 
SFTP post-quote rmdir
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "-rmdir %PWD/log/test610.dir" sftp://%HOSTIP:%SSHPORT%PWD/log/file610.txt --insecure


perl %SRCDIR/libtest/test610.pl gone %PWD/log/test610.dir


Dummy test file for rmdir test



#
# Verify data after the test has been "shot"


disable



curl-7.35.0/tests/data/test1110000644000175000017500000000075312213173003012671 00000000000000


FTP
EPSV
Resume
FAILURE


# Server-side


85



# Client-side


ftp

 
FTP download resume beyond file size
 
 
ftp://%HOSTIP:%FTPPORT/111 -C 2000



# Verify data after the test has been "shot"


36


USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
SIZE 111
QUIT



curl-7.35.0/tests/data/test2610000644000175000017500000000103012213173003012664 00000000000000


FTP
EPSV
RETR


#
# Server-side


hepp


REPLY TYPE 226 Kind of on the positive side!



#
# Client-side


ftp

 
FTP RETR with 226 response code to TYPE
 
 
ftp://%HOSTIP:%FTPPORT/261



#
# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
SIZE 261
RETR 261
QUIT



curl-7.35.0/tests/data/test920000644000175000017500000000156112213173003012617 00000000000000


HTTP
HTTP GET
Content-Range
Resume



# Server-side


HTTP/1.1 416 Requested Range Not Satisfiable
Date: Fri, 24 Oct 2003 21:33:12 GMT
Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.3.1
Last-Modified: Fri, 24 Oct 2003 18:01:23 GMT
ETag: "ab57a-507-3f9968f3"
Accept-Ranges: bytes
Content-Length: 4
Content-Range: bytes */87
Content-Type: image/gif

bad



# Client-side


http

 
HTTP resume transfer with the whole file already downloaded
 
 
http://%HOSTIP:%HTTPPORT/want/92 -C 87



# Verify data after the test has been "shot"


^User-Agent:.*


GET /want/92 HTTP/1.1
Range: bytes=87-
Host: %HOSTIP:%HTTPPORT
Accept: */*





curl-7.35.0/tests/data/test2990000644000175000017500000000140012213173003012700 00000000000000


FTP
HTTP
CURLOPT_USERPWD
HTTP proxy



# Server-side


HTTP/1.0 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake

blablabla




# Client-side


http


ftp

 
FTP over HTTP proxy with user:pass not in url
 
 
-x http://%HOSTIP:%HTTPPORT -u michal:aybabtu ftp://host.com/we/want/299



# Verify data after the test has been "shot"


^User-Agent:.*


GET ftp://michal:aybabtu@host.com/we/want/299 HTTP/1.1
Authorization: Basic bWljaGFsOmF5YmFidHU=
Host: host.com:21
Accept: */*
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test6020000644000175000017500000000106612213173003012674 00000000000000


SFTP
SFTP put



#
# Server-side



#
# Client-side


sftp

 
SFTP put
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file602.txt sftp://%HOSTIP:%SSHPORT%PWD/log/upload.602 --insecure


Test data
for ssh upload test



#
# Verify data after the test has been "shot"


Test data
for ssh upload test


disable



curl-7.35.0/tests/data/test1380000644000175000017500000000111512213173003012673 00000000000000


FTP
RETR


# Server-side


this is file contents


-1


RETRNOSIZE



# Client-side


ftp

 
FTP download without size in RETR string and no SIZE command
 
 
ftp://%HOSTIP:%FTPPORT/blalbla/lululul/138



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD blalbla
CWD lululul
EPSV
TYPE I
SIZE 138
RETR 138
QUIT



curl-7.35.0/tests/data/test14080000644000175000017500000000173312213173003012762 00000000000000


HTTP
HTTP GET
IPV6
cookies
cookiejar


#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Connection: close
Content-Type: text/html
Set-Cookie: time=1

-foo-


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Connection: close
Content-Type: text/html
Set-Cookie: time=2

-foo-





#
# Client-side


ipv6


http-ipv6

 
HTTP receive cookies over IPV6
 
 
-c log/jar1408 -g http://%HOST6IP:%HTTP6PORT/path/14080001 http://%HOST6IP:%HTTP6PORT/path/14080002



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /path/14080001 HTTP/1.1
Host: %HOST6IP:%HTTP6PORT
Accept: */*

GET /path/14080002 HTTP/1.1
Host: %HOST6IP:%HTTP6PORT
Accept: */*
Cookie: time=1





curl-7.35.0/tests/data/test4060000644000175000017500000000263612213173003012702 00000000000000


FTPS
PORT
LIST


#
# Server-side

# When doing LIST, we get the default list output hard-coded in the test
# FTPS server

total 20
drwxr-xr-x   8 98       98           512 Oct 22 13:06 .
drwxr-xr-x   8 98       98           512 Oct 22 13:06 ..
drwxr-xr-x   2 98       98           512 May  2  1996 .NeXT
-r--r--r--   1 0        1             35 Jul 16  1996 README
lrwxrwxrwx   1 0        1              7 Dec  9  1999 bin -> usr/bin
dr-xr-xr-x   2 0        1            512 Oct  1  1997 dev
drwxrwxrwx   2 98       98           512 May 29 16:04 download.html
dr-xr-xr-x   2 0        1            512 Nov 30  1995 etc
drwxrwxrwx   2 98       1            512 Oct 30 14:33 pub
dr-xr-xr-x   5 0        1            512 Oct  1  1997 usr



#
# Client-side


SSL


ftps

 
FTPS dir list, PORT with specified IP
 
 
-k --ftp-ssl-control -P %CLIENTIP ftps://%HOSTIP:%FTPSPORT/



#
# Verify data after the test has been "shot"

# Strip all valid kinds of PORT and EPRT that curl can send

^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|


USER anonymous
PASS ftp@example.com
PBSZ 0
PROT C
PWD
PORT 127,0,0,1,243,212
TYPE A
LIST
QUIT



curl-7.35.0/tests/data/test13330000644000175000017500000000131512213173003012753 00000000000000


HTTP
HTTP GET



#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Accept-Ranges: bytes
Content-Length: 6
Connection: close

-foo-



#
# Client-side


http

 
HTTP POST zero length, chunked-encoded
 
 
-d "" --header "Transfer-Encoding: chunked" http://%HOSTIP:%HTTPPORT/1333



#
# Verify data after the test has been "shot"


^User-Agent:.*


POST /1333 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Transfer-Encoding: chunked
Content-Type: application/x-www-form-urlencoded

0




curl-7.35.0/tests/data/test13550000644000175000017500000000151512213173003012761 00000000000000


FTP
RETR



# Server-side


fooo
mooo



# Client-side

# this relies on the debug feature to allow us to set directory to store the
# -O output in, using the CURL_TESTDIR variable

debug


ftp


FTP download, file without C-D inside, using -O -i, without -D


CURL_TESTDIR=%PWD/log


ftp://%HOSTIP:%FTPPORT/path/file1355 -O -i



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1355
RETR file1355
QUIT



fooo
mooo







curl-7.35.0/tests/data/test10470000644000175000017500000000225012213173003012754 00000000000000


FTP
PASV
LIST
--interface



#
# Server-side

# When doing LIST, we get the default list output hard-coded in the test
# FTP server

total 20
drwxr-xr-x   8 98       98           512 Oct 22 13:06 .
drwxr-xr-x   8 98       98           512 Oct 22 13:06 ..
drwxr-xr-x   2 98       98           512 May  2  1996 .NeXT
-r--r--r--   1 0        1             35 Jul 16  1996 README
lrwxrwxrwx   1 0        1              7 Dec  9  1999 bin -> usr/bin
dr-xr-xr-x   2 0        1            512 Oct  1  1997 dev
drwxrwxrwx   2 98       98           512 May 29 16:04 download.html
dr-xr-xr-x   2 0        1            512 Nov 30  1995 etc
drwxrwxrwx   2 98       1            512 Oct 30 14:33 pub
dr-xr-xr-x   5 0        1            512 Oct  1  1997 usr



#
# Client-side


ftp

 
FTP dir list PASV with localhost --interface
 
 
ftp://%HOSTIP:%FTPPORT/ --interface %CLIENTIP



#
# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE A
LIST
QUIT



curl-7.35.0/tests/data/test2590000644000175000017500000000626512213173003012712 00000000000000


HTTP
HTTP FORMPOST
HTTP proxy
HTTP proxy Digest auth
--proxy-anyauth


# Server-side

# The stupid test server doesn't response anything at all until the full
# request has been sent, and then of course the full POST has already been
# sent!

HTTP/1.1 407 no, tell me who you are first
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Proxy-Authenticate: Digest realm="many secrets", nonce="911"
Content-Length: 0



HTTP/1.1 200 A OK
Server: Microsoft-IIS/6.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 3

ok


HTTP/1.1 407 no, tell me who you are first
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Proxy-Authenticate: Digest realm="many secrets", nonce="911"
Content-Length: 0

HTTP/1.1 200 A OK
Server: Microsoft-IIS/6.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 3

ok




# Client-side


http


crypto

 
HTTP POST multipart with Expect: header using proxy anyauth (Digest)
 
 
-x http://%HOSTIP:%HTTPPORT http://remotehost:54321/we/want/259 -F name=daniel -F tool=curl -F file=@log/test259.txt -U uuuser:pppassword --proxy-anyauth

# We create this file before the command is invoked!

foo-
This is a moo-
bar



# Verify data after the test has been "shot"


^(User-Agent:|Content-Type: multipart/form-data;|------).*


POST http://remotehost:54321/we/want/259 HTTP/1.1
User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: remotehost:54321
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 409
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce

------------------------------7c633d5c27ce
Content-Disposition: form-data; name="name"

daniel
------------------------------7c633d5c27ce
Content-Disposition: form-data; name="tool"

curl
------------------------------7c633d5c27ce
Content-Disposition: form-data; name="file"; filename="test259.txt"
Content-Type: text/plain

foo-
This is a moo-
bar

------------------------------7c633d5c27ce--
POST http://remotehost:54321/we/want/259 HTTP/1.1
User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Proxy-Authorization: Digest username="uuuser", realm="many secrets", nonce="911", uri="/we/want/259", response="b479994d13e60f3aa192a67c5892ddc5"
Host: remotehost:54321
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 409
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce

------------------------------7c633d5c27ce
Content-Disposition: form-data; name="name"

daniel
------------------------------7c633d5c27ce
Content-Disposition: form-data; name="tool"

curl
------------------------------7c633d5c27ce
Content-Disposition: form-data; name="file"; filename="test259.txt"
Content-Type: text/plain

foo-
This is a moo-
bar

------------------------------7c633d5c27ce--



curl-7.35.0/tests/data/test210000644000175000017500000000061612213173003012607 00000000000000


FAILURE
multiple HTTP requests


# Server-side





# Client-side


http

 
use curl with multiple request methods
 
 
-I -d FOOO -F moo=moo localhost



# Verify data after the test has been "shot"


2



curl-7.35.0/tests/data/test1550000644000175000017500000000725112270035364012713 00000000000000


HTTP
HTTP PUT



# Server-side


auth_required


HTTP/1.1 401 NTLM Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
WWW-Authenticate: NTLM
Content-Type: text/html; charset=iso-8859-1
Connection: close

moo


# This is supposed to be returned when the server gets a first
# Authorization: NTLM line passed-in from the client

HTTP/1.1 401 Type-1 received, send back type-2
Server: Microsoft-IIS/5.0
Content-Length: 34
Content-Type: text/html; charset=iso-8859-1
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

This is not the real page either!


# This is supposed to be returned when the server gets the second
# Authorization: NTLM line passed-in from the client

HTTP/1.1 200 Type-3 Recevied and all Things are fine swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!



HTTP/1.1 401 NTLM Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
WWW-Authenticate: NTLM
Content-Type: text/html; charset=iso-8859-1
Connection: close

HTTP/1.1 401 Type-1 received, send back type-2
Server: Microsoft-IIS/5.0
Content-Length: 34
Content-Type: text/html; charset=iso-8859-1
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

HTTP/1.1 200 Type-3 Recevied and all Things are fine swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!




# Client-side


NTLM
!SSPI


http

 
HTTP PUT with --anyauth authorization (picking NTLM)
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
http://%HOSTIP:%HTTPPORT/155 -T log/put155 -u testuser:testpass --anyauth


chkhostname curlhost


This is data we upload with PUT
a second line
line three
four is the number of lines



# Verify data after the test has been "shot"


^User-Agent:.*


PUT /155 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 85
Expect: 100-continue

PUT /155 HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 0
Expect: 100-continue

PUT /155 HTTP/1.1
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 85
Expect: 100-continue

This is data we upload with PUT
a second line
line three
four is the number of lines



curl-7.35.0/tests/data/test8340000644000175000017500000000236612270035364012721 00000000000000


IMAP
IMAP AUTH NTLM SASL DOWNGRADE



#
# Server-side


AUTH NTLM PLAIN
REPLY "AUTHENTICATE NTLM" +
REPLY TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= + Rubbish
REPLY * A002 NO AUTH exchange cancelled by client
REPLY "AUTHENTICATE PLAIN" +
REPLY dXNlcgB1c2VyAHNlY3JldA== A003 OK AUTHENTICATE completed


From: me@somewhere
To: fake@nowhere

body

--
  yours sincerely



#
# Client-side


imap


NTLM
!SSPI

 
IMAP NTLM authentication with SASL downgrade
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
'imap://%HOSTIP:%IMAPPORT/834/;UID=1' -u user:secret


chkhostname curlhost



#
# Verify data after the test has been "shot"


A001 CAPABILITY
A002 AUTHENTICATE NTLM
TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
*
A003 AUTHENTICATE PLAIN
dXNlcgB1c2VyAHNlY3JldA==
A004 SELECT 834
A005 FETCH 1 BODY[]
A006 LOGOUT



curl-7.35.0/tests/data/test13830000644000175000017500000000245212270035364012775 00000000000000


FTP
RETR



# Server-side


fooo
mooo



# Client-side


ftp


FTP DL, file without C-D inside, using -o fname -i -D file


ftp://%HOSTIP:%FTPPORT/path/file1383 -o log/download1383 -i -D log/heads1383


perl %SRCDIR/libtest/notexists.pl log/file1383



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1383
RETR file1383
QUIT



fooo
mooo



220-        _   _ ____  _     
220-    ___| | | |  _ \| |    
220-   / __| | | | |_) | |    
220-  | (__| |_| |  _ {| |___ 
220    \___|\___/|_| \_\_____|
331 We are happy you popped in!
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for 1383 () (10 bytes).
226 File transfer complete


s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/







curl-7.35.0/tests/data/test12130000644000175000017500000000160512213173003012752 00000000000000


HTTP
HTTP GET
HTTP proxy



# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Type: text/html
Funny-head: yesyes
Content-Length: 22

the content goes here



# Client-side


http

 
HTTP with proxy and host-only URL
 
# the thing here is that this sloppy form is accepted and we convert it
# for normal server use, and we need to make sure it gets converted to
# RFC style even for proxies
 
-x %HOSTIP:%HTTPPORT we.want.that.site.com.1213



# Verify data after the test has been "shot"


^User-Agent:.*


GET HTTP://we.want.that.site.com.1213/ HTTP/1.1
Host: we.want.that.site.com.1213
Accept: */*
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test30000644000175000017500000000174012213173003012526 00000000000000


HTTP
HTTP POST
HTTP Basic auth


#
# Server-side


HTTP/1.0 200 OK
Server: test-server/fake
Content-Type: text/html
Content-Length: 0

this is data even though Content-Length is set to zero


HTTP/1.0 200 OK
Server: test-server/fake
Content-Type: text/html
Content-Length: 0




#
# Client-side


http

 
HTTP POST with auth and contents but with content-length set to 0
 
 
 -d "fooo=mooo&pooo=clue&doo=%20%20%20++++" -u "fake:-user" http://%HOSTIP:%HTTPPORT/3



#
# Verify data after the test has been "shot"


^User-Agent:.*


POST /3 HTTP/1.1
Authorization: Basic ZmFrZTotdXNlcg==
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 37
Content-Type: application/x-www-form-urlencoded

fooo=mooo&pooo=clue&doo=%20%20%20++++



curl-7.35.0/tests/data/test13840000644000175000017500000000237112270035364012776 00000000000000


FTP
RETR



# Server-side


fooo
mooo



# Client-side


ftp


FTP DL, file without C-D inside, using -o fname -i -D stdout


ftp://%HOSTIP:%FTPPORT/path/file1384 -o log/download1384 -i -D -


perl %SRCDIR/libtest/notexists.pl log/file1384



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1384
RETR file1384
QUIT



fooo
mooo



220-        _   _ ____  _     
220-    ___| | | |  _ \| |    
220-   / __| | | | |_) | |    
220-  | (__| |_| |  _ {| |___ 
220    \___|\___/|_| \_\_____|
331 We are happy you popped in!
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for 1384 () (10 bytes).
226 File transfer complete


s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/




curl-7.35.0/tests/data/test1920000644000175000017500000000133712262353672012721 00000000000000


HTTP
HTTP GET



#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 8
Connection: close

monster



#
# Client-side


http

 
HTTP GET -w num_connects with one simple connect
 
 
http://%HOSTIP:%HTTPPORT/192 -w "%{num_connects}\n"



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /192 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 8
Connection: close

monster
1



curl-7.35.0/tests/data/test2630000644000175000017500000000135412213173003012677 00000000000000


HTTP
HTTP GET
IPv6
HTTP proxy


#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Content-Type: text/html

hello



#
# Client-side


ipv6


http-ipv6

 
HTTP-IPv6 GET with proxy specified using IPv6-numerical address
 
 
-g -x "http://%HOST6IP:%HTTP6PORT" http://veryveryremotesite.com/263



#
# Verify data after the test has been "shot"


^User-Agent:


GET http://veryveryremotesite.com/263 HTTP/1.1
Host: veryveryremotesite.com
Accept: */*
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test11210000644000175000017500000000115612213173003012751 00000000000000


HTTP


#
# Server-side


HTTP/1.0 200 OK
Server: test-server/fake
Content-Type: text/html
Content-Length: 6

blaha



#
# Client-side


http

 
HTTP multiple provided Host: headers
 
 
-H "Host: host1" -H "Host: host2" -H "Host: host3" http://%HOSTIP:%HTTPPORT/1121



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1121 HTTP/1.1
Accept: */*
Host: host1
Host: host2
Host: host3




curl-7.35.0/tests/data/test360000644000175000017500000000150712213173003012615 00000000000000


HTTP
HTTP GET
chunked Transfer-Encoding
FAILURE


#
# Server-side


HTTP/1.1 200 funky chunky!
Server: fakeit/0.9 fakeitbad/1.0
Transfer-Encoding: chunked
Connection: mooo

2
a

ILLEGAL
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb


HTTP/1.1 200 funky chunky!
Server: fakeit/0.9 fakeitbad/1.0
Transfer-Encoding: chunked
Connection: mooo

a



#
# Client-side


http

 
HTTP GET with bad chunked Transfer-Encoding
 
 
http://%HOSTIP:%HTTPPORT/36



#
# Verify data after the test has been "shot"


56


^User-Agent:.*


GET /36 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*





curl-7.35.0/tests/data/test13820000644000175000017500000000237412270035364012777 00000000000000


FTP
RETR
-J



# Server-side


fooo
mooo



# Client-side


ftp


FTP DL, file without C-D inside, using -o fname -J -D stdout


ftp://%HOSTIP:%FTPPORT/path/file1382 -o log/download1382 -J -D -


perl %SRCDIR/libtest/notexists.pl log/file1382



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1382
RETR file1382
QUIT



fooo
mooo



220-        _   _ ____  _     
220-    ___| | | |  _ \| |    
220-   / __| | | | |_) | |    
220-  | (__| |_| |  _ {| |___ 
220    \___|\___/|_| \_\_____|
331 We are happy you popped in!
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for 1382 () (10 bytes).
226 File transfer complete


s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/




curl-7.35.0/tests/data/test4040000644000175000017500000000056712213173003012701 00000000000000


FTPS
FAILURE



# Client-side


SSL


ftps

 
FTPS with invalid cacert
 
 
--ftp-ssl-control --cacert moooo ftps://%HOSTIP:%FTPSPORT/



# Verify data after the test has been "shot"


77



curl-7.35.0/tests/data/test9250000644000175000017500000000072212262353672012722 00000000000000


SMTP
VRFY



#
# Server-side


252 Send some mail and I'll try my best



#
# Client-side


smtp

 
SMTP external VRFY
 
 
smtp://%HOSTIP:%SMTPPORT/925 --mail-rcpt user@example.net



#
# Verify data after the test has been "shot"


EHLO 925
VRFY user@example.net
QUIT



curl-7.35.0/tests/data/test660000644000175000017500000000074712213173003012625 00000000000000


HTTP
HTTP GET


# Server-side


no headers swsclose



# Client-side


http

 
HTTP GET without headers in the response
 
 
http://%HOSTIP:%HTTPPORT/66



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /66 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test1670000644000175000017500000000344012213173003012700 00000000000000


HTTP
HTTP GET
HTTP proxy
HTTP proxy Basic auth
HTTP Digest auth



# Server-side


HTTP/1.1 401 Authorization Required swsclose
WWW-Authenticate: Digest realm="weirdorealm", nonce="12345"




HTTP/1.1 200 OK swsclose
Server: no
Content-Length: 15

Nice auth sir!



HTTP/1.1 401 Authorization Required swsclose
WWW-Authenticate: Digest realm="weirdorealm", nonce="12345"

HTTP/1.1 200 OK swsclose
Server: no
Content-Length: 15

Nice auth sir!



# Client-side


http


crypto

 
HTTP with proxy-requiring-Basic to site-requiring-Digest
 
 
http://data.from.server.requiring.digest.hohoho.com/167 --proxy http://%HOSTIP:%HTTPPORT --proxy-user foo:bar --digest --user digest:alot



# Verify data after the test has been "shot"


^User-Agent: curl/.*


GET http://data.from.server.requiring.digest.hohoho.com/167 HTTP/1.1
Proxy-Authorization: Basic Zm9vOmJhcg==
User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b zlib/1.1.4 c-ares/1.2.0 libidn/0.4.3
Host: data.from.server.requiring.digest.hohoho.com
Accept: */*
Proxy-Connection: Keep-Alive

GET http://data.from.server.requiring.digest.hohoho.com/167 HTTP/1.1
Proxy-Authorization: Basic Zm9vOmJhcg==
Authorization: Digest username="digest", realm="weirdorealm", nonce="12345", uri="/167", response="13c7c02a252cbe1c46d8669898a3be26"
User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b zlib/1.1.4 c-ares/1.2.0 libidn/0.4.3
Host: data.from.server.requiring.digest.hohoho.com
Accept: */*
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test6200000644000175000017500000000112612213173003012671 00000000000000


SFTP
FAILURE



#
# Client-side


sftp

 
SFTP retrieval of missing file followed by good file
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/not-a-valid-file-moooo sftp://%HOSTIP:%SSHPORT%PWD/log/file620.txt --insecure


Test data
for ssh test



#
# Verify data after the test has been "shot"


disable


Test data
for ssh test



curl-7.35.0/tests/data/test13800000644000175000017500000000236312270035364012773 00000000000000


FTP
RETR



# Server-side


fooo
mooo



# Client-side


ftp


FTP DL, file without C-D inside, using -o fname -D stdout


ftp://%HOSTIP:%FTPPORT/path/file1380 -o log/download1380 -D -


perl %SRCDIR/libtest/notexists.pl log/file1380



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1380
RETR file1380
QUIT



fooo
mooo



220-        _   _ ____  _     
220-    ___| | | |  _ \| |    
220-   / __| | | | |_) | |    
220-  | (__| |_| |  _ {| |___ 
220    \___|\___/|_| \_\_____|
331 We are happy you popped in!
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for 1380 () (10 bytes).
226 File transfer complete


s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/




curl-7.35.0/tests/data/test2260000644000175000017500000000053512213173003012676 00000000000000


FTP
FAILURE



# Client-side


ftp

 
FTP %0d-code in URL's CWD part
 
 
ftp://%HOSTIP:%FTPPORT/226%0d



# Verify data after the test has been "shot"

# 3 == CURLE_URL_MALFORMAT

3



curl-7.35.0/tests/data/test10530000644000175000017500000000540612213173003012757 00000000000000
# Based on test 9


HTTP
HTTP FORMPOST
HTTP file upload
followlocation



# Server-side


HTTP/1.1 307 Redirect swsclose
Date: Thu, 29 Jul 2008 14:49:00 GMT
Server: test-server/fake
Location: data/10530002.txt?coolsite=yes
Content-Length: 0
Connection: close



HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 11
Connection: close

blablabla



HTTP/1.1 307 Redirect swsclose
Date: Thu, 29 Jul 2008 14:49:00 GMT
Server: test-server/fake
Location: data/10530002.txt?coolsite=yes
Content-Length: 0
Connection: close

HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 11
Connection: close

blablabla




# Client-side


http

 
HTTP RFC1867-type formposting from file with Location: following
 
 
http://%HOSTIP:%HTTPPORT/we/want/1053 -L -F name=daniel -F tool=curl -F file=@log/test1053.txt

# We create this file before the command is invoked!

foo-
This is a moo-
bar



# Verify data after the test has been "shot"


^(User-Agent:|Content-Type: multipart/form-data;|------------).*


POST /we/want/1053 HTTP/1.1
User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 410
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763

------------------------------9ef8d6205763
Content-Disposition: form-data; name="name"

daniel
------------------------------9ef8d6205763
Content-Disposition: form-data; name="tool"

curl
------------------------------9ef8d6205763
Content-Disposition: form-data; name="file"; filename="test1053.txt"
Content-Type: text/plain

foo-
This is a moo-
bar

------------------------------9ef8d6205763--
POST /we/want/data/10530002.txt?coolsite=yes HTTP/1.1
User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 410
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763

------------------------------9ef8d6205763
Content-Disposition: form-data; name="name"

daniel
------------------------------9ef8d6205763
Content-Disposition: form-data; name="tool"

curl
------------------------------9ef8d6205763
Content-Disposition: form-data; name="file"; filename="test1053.txt"
Content-Type: text/plain

foo-
This is a moo-
bar

------------------------------9ef8d6205763--



curl-7.35.0/tests/data/test15100000644000175000017500000000334012271241025012754 00000000000000


HTTP
verbose logs



# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 47

file contents should appear once for each file


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 47

file contents should appear once for each file


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 47

file contents should appear once for each file


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 47

file contents should appear once for each file



# Client-side


http


lib1510

 
HTTP GET connection cache limit (CURLOPT_MAXCONNECTS)
 
 
http://%HOSTIP:%HTTPPORT/path/1510 %HOSTIP %HTTPPORT



# Verify data after the test has been "shot"


GET /path/15100001 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /path/15100002 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /path/15100003 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /path/15100004 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*



^Host:.*


* Connection #0 to host server1.example.com left intact
* Connection #1 to host server2.example.com left intact
* Connection #2 to host server3.example.com left intact
* Closing connection 0
* Connection #3 to host server4.example.com left intact


$_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/))



curl-7.35.0/tests/data/test2010000644000175000017500000000057412262353672012712 00000000000000


FILE
FAILURE



# Server-side





# Client-side


file

 
missing file:// file
 
 
file://localhost/%PWD/log/non-existant-file.txt



# Verify data after the test has been "shot"


37



curl-7.35.0/tests/data/test1050000644000175000017500000000117412213173003012672 00000000000000


FTP
PASV
TYPE A
RETR


# Server-side


data
    to
      see
that FTP
works
  so does it?


REPLY EPSV 500 no such command
REPLY SIZE 500 no such command



# Client-side


ftp

 
FTP user+password in URL and ASCII transfer
 
 
ftp://userdude:passfellow@%HOSTIP:%FTPPORT/105 --use-ascii



# Verify data after the test has been "shot"


USER userdude
PASS passfellow
PWD
EPSV
PASV
TYPE A
SIZE 105
RETR 105
QUIT



curl-7.35.0/tests/data/test840000644000175000017500000000160512213173003012617 00000000000000


HTTP
HTTP GET
HTTP Basic auth
HTTP proxy


#
# Server-side


HTTP/1.0 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes

contents



#
# Client-side


http

 
HTTP over proxy with site authentication
 
 
http://%HOSTIP:%HTTPPORT/we/want/that/page/84 -x %HOSTIP:%HTTPPORT --user iam:myself



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET http://%HOSTIP:%HTTPPORT/we/want/that/page/84 HTTP/1.1
Authorization: Basic aWFtOm15c2VsZg==
User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test10320000644000175000017500000000136112213173003012750 00000000000000


HTTP
HTTP HEAD
range



#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes




#
# Client-side


http

 
HTTP HEAD with --range
 
 
--range 1-3 --head http://%HOSTIP:%HTTPPORT/1032



#
# Verify data after the test has been "shot"


^User-Agent:.*


HEAD /1032 HTTP/1.1
Range: bytes=1-3
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test1430000644000175000017500000000074712213173003012701 00000000000000


FTP
RETR
type=


# Server-side


bla bla bla



# Client-side


ftp

 
FTP URL with type=a
 
 
"ftp://%HOSTIP:%FTPPORT/%2ftmp/moo/143;type=a"



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD /tmp
CWD moo
EPSV
TYPE A
SIZE 143
RETR 143
QUIT



curl-7.35.0/tests/data/test620000644000175000017500000000230512262353672012631 00000000000000


HTTP
HTTP GET
HTTP replaced headers
cookies
httponly



# Server-side


HTTP/1.0 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Type: text/html

boo



# Client-side


http

 
HTTP, send cookies when using custom Host:
 
 
http://%HOSTIP:%HTTPPORT/we/want/62 http://%HOSTIP:%HTTPPORT/we/want?hoge=fuga -b log/jar62.txt -H "Host: www.host.foo.com"


# Netscape HTTP Cookie File
# http://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.

#HttpOnly_.foo.com	TRUE	/we/want/	FALSE	2054030187	test	yes
.host.foo.com	TRUE	/we/want/	FALSE	2054030187	test2	yes
.fake.host.foo.com	TRUE	/we/want/	FALSE	2054030187	test4	yes

.foo.com	TRUE	/moo	TRUE	0	test3	maybe



# Verify data after the test has been "shot"


^User-Agent:.*


GET /we/want/62 HTTP/1.1
Accept: */*
Cookie: test2=yes; test=yes
Host: www.host.foo.com

GET /we/want?hoge=fuga HTTP/1.1
Accept: */*
Cookie: test2=yes; test=yes
Host: www.host.foo.com




curl-7.35.0/tests/data/test1500000644000175000017500000000537112270035364012707 00000000000000







HTTP/1.1 401 Now gimme that second request of crap
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 34
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

This is not the real page either!


# This is supposed to be returned when the server gets the second
# Authorization: NTLM line passed-in from the client

HTTP/1.1 200 Things are fine in server land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!



HTTP/1.1 401 Now gimme that second request of crap
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 34
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

HTTP/1.1 200 Things are fine in server land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!




# Client-side


NTLM
!SSPI


http

 
HTTP with NTLM authorization and --fail
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
http://%HOSTIP:%HTTPPORT/150 -u testuser:testpass --ntlm --fail


chkhostname curlhost



# Verify data after the test has been "shot"


^User-Agent:.*


GET /150 HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /150 HTTP/1.1
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test20010000644000175000017500000000271412213173003012750 00000000000000


HTTP
HTTP GET
FTP
PASV
FILE
multiprotocol



#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes

-foo-


data
    to
      see
that FTP
works
  so does it?



#
# Client-side


http
ftp
file

 
HTTP GET followed by FTP RETR followed by FILE
 
 
http://%HOSTIP:%HTTPPORT/20010001 ftp://%HOSTIP:%FTPPORT/20010002 file://localhost/%PWD/log/test2001.txt


foo
   bar
bar
   foo
moo



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /20010001 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
SIZE 20010002
RETR 20010002
QUIT


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes

-foo-
data
    to
      see
that FTP
works
  so does it?
foo
   bar
bar
   foo
moo



curl-7.35.0/tests/data/test13680000644000175000017500000000206312213173003012764 00000000000000


HTTP
HTTP GET
-J



#


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html

12345



#
# Client-side


http


HTTP GET -o fname -J without Content-Disposition, -D file


http://%HOSTIP:%HTTPPORT/1368 -J -o log/outfile1368 -D log/heads1368


perl %SRCDIR/libtest/notexists.pl log/1368



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1368 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




12345



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html








curl-7.35.0/tests/data/test830000644000175000017500000000255012262353672012636 00000000000000


HTTP
HTTP GET
HTTP CONNECT
HTTP Basic auth
proxytunnel


#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
Content-Length: 9

contents


HTTP/1.1 200 Mighty fine indeed



HTTP/1.1 200 Mighty fine indeed

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
Content-Length: 9

contents



#
# Client-side


http
http-proxy

 
HTTP over proxy-tunnel with site authentication
 
 
http://test.83:%HTTPPORT/we/want/that/page/83 -p -x %HOSTIP:%PROXYPORT --user 'iam:my:;self'



#
# Verify data after the test has been "shot"


^User-Agent:.*


CONNECT test.83:%HTTPPORT HTTP/1.1
User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
Host: test.83:%HTTPPORT
Proxy-Connection: Keep-Alive



GET /we/want/that/page/83 HTTP/1.1
Authorization: Basic aWFtOm15OjtzZWxm
User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
Host: test.83:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test780000644000175000017500000000174612213173003012630 00000000000000


HTTP
HTTP GET
-z


#
# Server-side


HTTP/1.1 200 OK
Server: test-server/fake
Last-Modified: Tue, 13 Jun 1990 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes

-foo-


HTTP/1.1 200 OK
Server: test-server/fake
Last-Modified: Tue, 13 Jun 1990 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes




#
# Client-side


http

 
HTTP with -z "newer date"
 
 
http://%HOSTIP:%HTTPPORT/78 -z "dec 12 11:00:00 1999 GMT"



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /78 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
If-Modified-Since: Sun, 12 Dec 1999 11:00:00 GMT




curl-7.35.0/tests/data/test15000000644000175000017500000000101112213173003012740 00000000000000


HTTP
HTTP GET
multi



# Server-side


HTTP/1.1 200 all good!
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Type: text/html
Content-Length: 12
Connection: close

Hello World



# Client-side


http


http

# tool is what to use instead of 'curl'

lib1500


 
curl_multi_wait
 
 
http://%HOSTIP:%HTTPPORT/1500



curl-7.35.0/tests/data/test8780000644000175000017500000000142712270035364012726 00000000000000


POP3
POP3 AUTH DIGEST-MD5 SASL CANCELLATION
RFC1734
RFC2831
RFC5034



#
# Server-side


AUTH DIGEST-MD5
REPLY AUTH + Rubbish
REPLY * -ERR AUTH exchange cancelled by client



#
# Client-side


pop3


debug
crypto

 
POP3 DIGEST-MD5 graceful cancellation
 
 
pop3://%HOSTIP:%POP3PORT/878 -u user:secret



#
# Verify data after the test has been "shot"

# 67 - CURLE_LOGIN_DENIED

67

#
# The multi interface considers a broken "CONNECT" as a prematurely broken
# transfer and such a connection will not get a "QUIT"

CAPA
AUTH DIGEST-MD5
*



curl-7.35.0/tests/data/test420000644000175000017500000000233012213173003012605 00000000000000


HTTP
HTTP GET
followlocation


#
# Server-side


HTTP/1.1 302 OK swsclose
Location: ../m o o.html/420002    
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close



HTTP/1.1 200 OK swsclose
Location: this should be ignored
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close

body


HTTP/1.1 302 OK swsclose
Location: ../m o o.html/420002    
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close

HTTP/1.1 200 OK swsclose
Location: this should be ignored
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close

body



#
# Client-side


http

 
HTTP redirect with whitespace in path (and conversion)
 
 
http://%HOSTIP:%HTTPPORT/we/are/all/twits/42 -L



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /we/are/all/twits/42 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /we/are/all/m%20o%20o.html/420002 HTTP/1.1
User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test6220000644000175000017500000000111512213173003012671 00000000000000


SFTP
SFTP put
FAILURE



#
# Server-side



#
# Client-side


sftp

 
SFTP put failure
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file622.txt sftp://%HOSTIP:%SSHPORT%PWD/log/nonexistent-directory/nonexistent-file --insecure


Test data
for ssh upload test



#
# Verify data after the test has been "shot"


78


disable



curl-7.35.0/tests/data/test4090000644000175000017500000000116312213173003012677 00000000000000


FTPS
EPSV
STOR



# Client-side


SSL


ftps

 
FTPS PASV upload file
 

data
    to
      see
that FTP
works
  so does it?

 
-k --ftp-ssl-control ftps://%HOSTIP:%FTPSPORT/409 -T log/test409.txt



# Verify data after the test has been "shot"


data
    to
      see
that FTP
works
  so does it?


USER anonymous
PASS ftp@example.com
PBSZ 0
PROT C
PWD
EPSV
TYPE I
STOR 409
QUIT



curl-7.35.0/tests/data/test1570000644000175000017500000000134012262353672012714 00000000000000


HTTP
HTTP GET
--anyauth



# Server-side


HTTP/1.1 200 No Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Connection: close

GET received and served just fine. Thank you very much



# Client-side


http

 
HTTP GET with --anyauth (when the server requires none)
 
 
http://%HOSTIP:%HTTPPORT/157 -u testuser:testpass --anyauth



# Verify data after the test has been "shot"


^User-Agent:.*


GET /157 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test2870000644000175000017500000000156012213173003012704 00000000000000


HTTP
HTTP CONNECT
HTTP proxy
proxytunnel



# Server-side



HTTP/1.1 405 Method Not Allowed swsclose

And you should ignore this data.




# Client-side


http

 
HTTP proxy CONNECT with custom User-Agent header
 
 
http://test.remote.example.com.287:%HTTPPORT/path/287 -H "User-Agent: looser/2007" --proxy http://%HOSTIP:%HTTPPORT --proxytunnel



# Verify data after the test has been "shot"


CONNECT test.remote.example.com.287:%HTTPPORT HTTP/1.1
Host: test.remote.example.com.287:%HTTPPORT
Proxy-Connection: Keep-Alive
User-Agent: looser/2007


# CURLE_RECV_ERROR

56


HTTP/1.1 405 Method Not Allowed swsclose




curl-7.35.0/tests/data/test110000644000175000017500000000253012213173003012603 00000000000000


HTTP
HTTP GET
followlocation


# Server-side


HTTP/1.1 301 This is a weirdo text message swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Location: data/110002.txt?coolsite=yes
Connection: close

This server reply is for testing a simple Location: following



HTTP/1.1 200 Followed here fine swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 52

If this is received, the location following worked



HTTP/1.1 301 This is a weirdo text message swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Location: data/110002.txt?coolsite=yes
Connection: close

HTTP/1.1 200 Followed here fine swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 52

If this is received, the location following worked




# Client-side


http

 
simple HTTP Location: following
 
 
http://%HOSTIP:%HTTPPORT/want/11 -L



# Verify data after the test has been "shot"


^User-Agent:.*


GET /want/11 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /want/data/110002.txt?coolsite=yes HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test5920000644000175000017500000000214712213173003012705 00000000000000#
# For this test the server rejects the EPRT command,
# code in lib591 makes use of curl_multi_timeout()
# and server does not establish data connection.
#



FTP
PORT
STOR
multi
EPRT refused
NODATACONN421



# Server-side




NODATACONN421
REPLY EPRT 500 we don't like EPRT now



# Client-side


ftp


lib591

 
FTP multi PORT and 421 on upload
 
 
ftp://%HOSTIP:%FTPPORT/path/592 %FTPTIME2 log/upload592


Moooooooooooo for 592
 upload this



# Verify data after the test has been "shot"

# Strip off parts of the PORT and EPRT commands that might differ

s/^PORT (.*)/PORT/
s/^EPRT \|1\|(.*)/EPRT \|1\|/

# a 421 response must prevent further commands from being sent

USER anonymous
PASS ftp@example.com
PWD
CWD path
EPRT |1|
PORT
TYPE I
STOR 592
QUIT

# CURLE_FTP_ACCEPT_FAILED = 10

10





curl-7.35.0/tests/data/test6360000644000175000017500000000105112213173003012675 00000000000000


SFTP
Range



#
# Server-side


data
for ssh test



#
# Client-side


sftp

 
SFTP retrieval with X- byte range
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/file636.txt -r 5- --insecure


Test data
for ssh test



#
# Verify data after the test has been "shot"


disable



curl-7.35.0/tests/data/test10670000644000175000017500000000272112213173003012761 00000000000000


HTTP
HTTP GET
followlocation


# Server-side


HTTP/1.1 301 This is a weirdo text message swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Location: data/10670002.txt?coolsite=yes
Connection: close

This server reply is for testing a simple Location: following



HTTP/1.1 200 Followed here fine swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 52

If this is received, the location following worked



HTTP/1.1 301 This is a weirdo text message swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Location: data/10670002.txt?coolsite=yes
Connection: close

HTTP/1.1 200 Followed here fine swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 52

If this is received, the location following worked




# Client-side


http

 
HTTP Location: following with auto-referer
 
 
http://%HOSTIP:%HTTPPORT/want/1067 -L --referer "firstone.html;auto"



# Verify data after the test has been "shot"


^User-Agent:.*


GET /want/1067 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Referer: firstone.html

GET /want/data/10670002.txt?coolsite=yes HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Referer: http://%HOSTIP:%HTTPPORT/want/1067




curl-7.35.0/tests/data/test3230000644000175000017500000000066712213173003012702 00000000000000


HTTPS
TLS-SRP
FAILURE



# Client-side


https


TLS-SRP

 
TLS-SRP to non-TLS-SRP server
 

--insecure --tlsauthtype SRP --tlsuser jsmith --tlspassword badpass https://%HOSTIP:%HTTPSPORT/want/323



# Verify data after the test has been "shot"


35




curl-7.35.0/tests/data/test10590000644000175000017500000000150712213173003012763 00000000000000


HTTP
HTTP CONNECT
proxytunnel
FTP
FAILURE



#
# Server-side


HTTP/1.1 501 Method not implemented swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close
Content-Length: 0




#
# Client-side


ftp


http

 
HTTP CONNECT with proxytunnel to unsupported FTP URL
 
 
ftp://test-number:1059/wanted/page -p -x %HOSTIP:%HTTPPORT



#
# Verify data after the test has been "shot"

# The server doesn't implement CONNECT for ftp, so this must be a failure test

56


^User-Agent:.*


CONNECT test-number:1059 HTTP/1.1
Host: test-number:1059
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test10700000644000175000017500000000622712213173003012760 00000000000000


HTTP
HTTP POST


#
# Server-side


HTTP/1.1 403 Go away and swsclose
Server: test-server/fake
Content-Type: text/html
Content-Length: 55
Connection: close

you are not supposed to be allowed to send things here


skip: 2300



#
# Client-side


http

 
HTTP POST with server closing connection before (all) data is received
 
 
 -d @log/input1070 http://%HOSTIP:%HTTPPORT/1070


This creates the named file with this content before the test case is run,
which is useful if the test case needs a file to act on. We create this file
rather large (larger than your typical TCP packet) so that not all of it can nor
will be sent in one go as that is kind of the point of this test!

Here's 2000 x 'O':
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO



#
# Verify data after the test has been "shot"


^User-Agent:.*


POST /1070 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 2313
Content-Type: application/x-www-form-urlencoded
Expect: 100-continue

This creates 



curl-7.35.0/tests/data/test8610000644000175000017500000000113612262353672012721 00000000000000


POP3
UIDL
CUSTOMREQUEST
RFC2449



#
# Server-side


CAPA UIDL USER

# When doing UIDL, we get the default list output hard-coded in the test
# POP3 server

1 1
2 2
3 4



#
# Client-side


pop3

 
POP3 UIDL (CUSTOMREQUEST)
 
 
pop3://%HOSTIP:%POP3PORT -u user:secret -X UIDL



#
# Verify data after the test has been "shot"


CAPA
USER user
PASS secret
UIDL
QUIT



curl-7.35.0/tests/data/test3120000644000175000017500000000126312213173003012671 00000000000000


HTTPS
HTTP GET
PEM certificate



#
# Server-side



#
# Client-side


SSL


https Server-localhost.nn-sv.pem

 
HTTPS GET to localhost and null-prefixed CN cert
 
 
--cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/312

# Ensure that we're running on localhost because we're checking the host name

perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"



#
# Verify data after the test has been "shot"


51



curl-7.35.0/tests/data/test8050000644000175000017500000000213212262353672012714 00000000000000


IMAP
APPEND
UPLOAD



#
# Server-side



#
# Client-side


imap

 
IMAP APPEND message
 
 
imap://%HOSTIP:%IMAPPORT/805 -T log/upload805 -u user:secret


Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
From: Fred Foobar 
Subject: afternoon meeting
To: joe@example.com
Message-Id: 
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII

Hello Joe, do you think we can meet at 3:30 tomorrow?



#
# Verify data after the test has been "shot"


A001 CAPABILITY
A002 LOGIN user secret
A003 APPEND 805 (\Seen) {295}
A004 LOGOUT


Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
From: Fred Foobar 
Subject: afternoon meeting
To: joe@example.com
Message-Id: 
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII

Hello Joe, do you think we can meet at 3:30 tomorrow?



curl-7.35.0/tests/data/test10070000644000175000017500000000105012213173003012745 00000000000000


TFTP
TFTP WRQ
FAILURE



#
# Client-side


tftp

 
TFTP send with invalid permission on server
 
 
-T log/test1007.txt tftp://%HOSTIP:%TFTPPORT//invalid-file --trace-ascii log/traceit


This data will not be sent



#
# Verify pseudo protocol after the test has been "shot"


69


opcode: 2
filename: /invalid-file
mode: octet



curl-7.35.0/tests/data/test1780000644000175000017500000000115012262353672012716 00000000000000


HTTP
HTTP GET



#
# Server-side


HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: -6
Content-Type: text/html
Funny-head: yesyes

moooooooooooo



#
# Client-side


http

 
simple HTTP GET with negative Content-Length
 
 
http://%HOSTIP:%HTTPPORT/178



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /178 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test4030000644000175000017500000000234212213173003012671 00000000000000


FTPS
PASV
LIST
CCC
FAILURE


#
# Server-side

# When doing LIST, we get the default list output hard-coded in the test
# FTPS server

total 20
drwxr-xr-x   8 98       98           512 Oct 22 13:06 .
drwxr-xr-x   8 98       98           512 Oct 22 13:06 ..
drwxr-xr-x   2 98       98           512 May  2  1996 .NeXT
-r--r--r--   1 0        1             35 Jul 16  1996 README
lrwxrwxrwx   1 0        1              7 Dec  9  1999 bin -> usr/bin
dr-xr-xr-x   2 0        1            512 Oct  1  1997 dev
drwxrwxrwx   2 98       98           512 May 29 16:04 download.html
dr-xr-xr-x   2 0        1            512 Nov 30  1995 etc
drwxrwxrwx   2 98       1            512 Oct 30 14:33 pub
dr-xr-xr-x   5 0        1            512 Oct  1  1997 usr



#
# Client-side


SSL


ftps

 
FTPS with CCC not supported by server
 
 
-k --ftp-ssl-control --ftp-ssl-ccc ftps://%HOSTIP:%FTPSPORT/



#
# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PBSZ 0
PROT C
CCC
PWD
EPSV
TYPE A
LIST
QUIT



curl-7.35.0/tests/data/test7100000644000175000017500000000141112213173003012666 00000000000000


HTTP
HTTP GET
SOCKS5



#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes

-foo-



#
# Client-side


http
socks5

 
HTTP GET via SOCKS5 set with --proxy
 
 
http://%HOSTIP:%HTTPPORT/710 --proxy socks5://%HOSTIP:%SOCKSPORT 



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /710 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test1640000644000175000017500000000226112262353672012715 00000000000000


HTTP
HTTP GET



# Server-side
# This particular response is an exact excerpt from an actual Apache
# server when asked for a 0-10,12-15 range (except gt/lt changed to {}
# to avoid XML escaping problems).


HTTP/1.1 206 Partial Content swsclose
Date: Sat, 24 Apr 2004 09:24:49 GMT
Server: Apache/1.3.29 (Unix) mod_throttle/3.1.2 PHP/4.3.4 mod_fastcgi/2.4.0
Last-Modified: Tue, 23 Mar 2004 08:23:14 GMT
ETag: "53814a-ec5-405ff3f2"
Accept-Ranges: bytes
Content-Length: 187
Content-Type: multipart/byteranges; boundary=408a326132c

--408a326132c
Content-type: text/html
Content-range: bytes 0-10/3781

{html}
{hea

--408a326132c
Content-type: text/html
Content-range: bytes 12-15/3781

}
{t

--408a326132c--



# Client-side


http

 
HTTP range with multiple ranges
 
 
http://%HOSTIP:%HTTPPORT/want/164 -r 0-10,12-15



# Verify data after the test has been "shot"


^User-Agent:.*


GET /want/164 HTTP/1.1
Range: bytes=0-10,12-15
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test6300000644000175000017500000000077212213173003012700 00000000000000


SFTP
FAILURE
server key check



#
# Client-side


sftp

 
SFTP incorrect host key
 
 
--hostpubmd5 00000000000000000000000000000000 --key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/irrelevant-file --insecure



#
# Verify data after the test has been "shot"


51


disable



curl-7.35.0/tests/data/test760000644000175000017500000000070212213173003012615 00000000000000


FAILURE


#
# Server-side



#
# Client-side


none


http

 
HTTP, -O with no file name part in the URL
 
 
http://%HOSTIP:%HTTPPORT/76/ -O



#
# Verify data after the test has been "shot"


^User-Agent:.*


23



curl-7.35.0/tests/data/test720000644000175000017500000000361312213173003012615 00000000000000


HTTP
HTTP GET
HTTP Digest auth


# Server-side


HTTP/1.1 401 Authorization Required
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Basic realm="foothis"
WWW-Authenticate: Digest realm="testrealm", nonce="1053604199"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 26

This is not the real page


# This is supposed to be returned when the server gets a
# Authorization: Digest line passed-in from the client

HTTP/1.1 200 OK
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 23

This IS the real page!



HTTP/1.1 401 Authorization Required
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Basic realm="foothis"
WWW-Authenticate: Digest realm="testrealm", nonce="1053604199"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 26

HTTP/1.1 200 OK
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 23

This IS the real page!




# Client-side


http


crypto

 
HTTP with Digest *OR* Basic authorization
 
 
http://%HOSTIP:%HTTPPORT/72 -u testuser:testpass --anyauth



# Verify data after the test has been "shot"


^User-Agent:.*


GET /72 HTTP/1.1
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /72 HTTP/1.1
Authorization: Digest username="testuser", realm="testrealm", nonce="1053604199", uri="/72", response="9fcd1330377365a09bbcb33b2cbb25bd"
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test10760000644000175000017500000000253612213173003012765 00000000000000


HTTP
HTTP POST
followlocation


#
# Server-side


HTTP/1.1 302 OK swsclose
Location: moo.html&testcase=/10760002
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close



HTTP/1.1 200 OK swsclose
Location: this should be ignored
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close

body


HTTP/1.1 302 OK swsclose
Location: moo.html&testcase=/10760002
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close

HTTP/1.1 200 OK swsclose
Location: this should be ignored
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close

body



#
# Client-side


http

 
HTTP POST with 302 redirect and --post302
 
 
http://%HOSTIP:%HTTPPORT/blah/1076 -L -d "moo" --post302



#
# Verify data after the test has been "shot"


^User-Agent:.*


POST /blah/1076 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 3
Content-Type: application/x-www-form-urlencoded

mooPOST /blah/moo.html&testcase=/10760002 HTTP/1.1
User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 3
Content-Type: application/x-www-form-urlencoded

moo



curl-7.35.0/tests/data/test8680000644000175000017500000000302512270035364012721 00000000000000


POP3
POP3 AUTH NTLM
RFC1734
RFC5034



#
# Server-side


AUTH NTLM
REPLY AUTH +
REPLY TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= + TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
REPLY TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q= +OK Login successful


From: me@somewhere
To: fake@nowhere

body

--
  yours sincerely



#
# Client-side


pop3


NTLM
!SSPI

 
POP3 NTLM authentication
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
pop3://%HOSTIP:%POP3PORT/868 -u testuser:testpass


chkhostname curlhost



#
# Verify data after the test has been "shot"


CAPA
AUTH NTLM
TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
RETR 868
QUIT



curl-7.35.0/tests/data/test15020000644000175000017500000000143512213173003012754 00000000000000


HTTP
HTTP GET
multi
CURLOPT_RESOLVE





HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes

-foo-



#
# Client-side


http


lib1502

 
HTTP multi with CURLOPT_RESOLVE, cleanup sequence UA
 
 
http://google.com:%HTTPPORT/1502 %HTTPPORT %HOSTIP



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1502 HTTP/1.1
Host: google.com:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test1140000644000175000017500000000074012213173003012670 00000000000000


FTP
FAILURE


# Server-side


REPLY PASS 314 bluah you f00l!



# Client-side


ftp

 
FTP download, failed login: PASS not valid
 
 
ftp://%HOSTIP:%FTPPORT/114



# Verify data after the test has been "shot"


67


USER anonymous
PASS ftp@example.com



curl-7.35.0/tests/data/test2450000644000175000017500000000342412213173003012677 00000000000000


HTTP
HTTP POST
HTTP Digest auth



# Server-side


HTTP/1.1 401 authentication please swsbounce
Server: Microsoft-IIS/6.0
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 0



HTTP/1.1 200 A OK
Server: Microsoft-IIS/6.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 3

ok



HTTP/1.1 401 authentication please swsbounce
Server: Microsoft-IIS/6.0
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 0

HTTP/1.1 200 A OK
Server: Microsoft-IIS/6.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 3

ok




# Client-side

# 

http


crypto

 
HTTP POST --digest
 
 
http://%HOSTIP:%HTTPPORT/245 -u auser:apasswd --digest -d "junkelijunk"



# Verify data after the test has been "shot"


^User-Agent:.*


POST /245 HTTP/1.1
User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

POST /245 HTTP/1.1
Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/245", response="379a439b1737ba257c1d2f103914b18b"
User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 11
Content-Type: application/x-www-form-urlencoded

junkelijunk



curl-7.35.0/tests/data/test9220000644000175000017500000000145512262353672012723 00000000000000


SMTP
SMTP AUTH OAUTH2 SASL-IR
RFC4954
RFC6749



#
# Server-side


AUTH XOAUTH2
REPLY AUTH 235 Authenticated



#
# Client-side


smtp

 
SMTP OAuth 2.0 authentication with initial response
 

mail body

 
smtp://%HOSTIP:%SMTPPORT/922 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM --sasl-ir -T -



#
# Verify data after the test has been "shot"


EHLO 922
AUTH XOAUTH2 dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB
MAIL FROM:
RCPT TO:
DATA
QUIT


mail body
.



curl-7.35.0/tests/data/test5420000644000175000017500000000126212213173003012675 00000000000000


FTP
PASV
RETR


# Server-side


data
    to
      see
that FTP
works
  so does it?


Content-Length: 51
Accept-ranges: bytes



# Client-side


ftp


lib542

 
FTP a file with NOBODY yes and HEADER no
 
 
ftp://%HOSTIP:%FTPPORT/542




# Verify data after the test has been "shot"
#
# There's no MTDM in the protocol here since this code doesn't ask for the
# time/date of the file


USER anonymous
PASS ftp@example.com
PWD
TYPE I
SIZE 542
REST 0
QUIT



curl-7.35.0/tests/data/test13900000644000175000017500000000326712270035364013000 00000000000000


FTP
RETR
-J



# Server-side

# file1390 contents...

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1390; charset=funny; option=strange

MOOOO



# Client-side


ftp


FTP DL, file with C-D inside, using -o fname -J -D stdout


ftp://%HOSTIP:%FTPPORT/path/file1390 -o log/download1390 -J -D -


perl %SRCDIR/libtest/notexists.pl log/file1390 log/name1390



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1390
RETR file1390
QUIT



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1390; charset=funny; option=strange

MOOOO



220-        _   _ ____  _     
220-    ___| | | |  _ \| |    
220-   / __| | | | |_) | |    
220-  | (__| |_| |  _ {| |___ 
220    \___|\___/|_| \_\_____|
331 We are happy you popped in!
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 214
150 Binary data connection for 1390 () (214 bytes).
226 File transfer complete


s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/




curl-7.35.0/tests/data/test13020000644000175000017500000000036312213173003012751 00000000000000


unittest
base64



#
# Client-side


none


unittest

 
base64 encode/decode unit tests
 

unit1302




curl-7.35.0/tests/data/test12300000644000175000017500000000221112271241025012747 00000000000000


HTTP
HTTP CONNECT
HTTP proxy
IPv6



#
# Server-side



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 9

mooooooo



HTTP/1.1 200 welcome dear
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 0




HTTP/1.1 200 welcome dear
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 0

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 9

mooooooo



#
# Client-side


ipv6


http-proxy
http-ipv6
http

 
HTTP CONNECT to IPv6 numerical address
 
# 0x4ce == 1230, the test number
 
-g http://[1234:1234:1234::4ce]:%HTTPPORT/wanted/page/1230 -p -x %HOSTIP:%HTTPPORT



#
# Verify data after the test has been "shot"


^User-Agent:.*


CONNECT [1234:1234:1234::4ce]:%HTTPPORT HTTP/1.1
Host: [1234:1234:1234::4ce]:%HTTPPORT
Proxy-Connection: Keep-Alive

GET /wanted/page/1230 HTTP/1.1
Host: [1234:1234:1234::4ce]:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test10160000644000175000017500000000072512213173003012755 00000000000000


FILE
Range








# Client-side


none


file

 
X-Y range on a file:// URL to stdout
 
 
-r 1-4 file://localhost/%PWD/log/test1016.txt 


1234567890



# Verify data after the test has been "shot"


2345



curl-7.35.0/tests/data/test4050000644000175000017500000000076512213173003012702 00000000000000


FTPS
FAILURE



# Client-side


SSL


ftp

 
FTPS operation to FTP port
 
 
-m 5 -k ftps://%HOSTIP:%FTPPORT/path/to/file/405



# Verify data after the test has been "shot"

# error code 35 is CURLE_SSL_CONNECT_ERROR
# GnuTLS seems to not fail on its handshake but instead times out which gives
# error 28

35,28



curl-7.35.0/tests/data/test1330000644000175000017500000000255412213173003012676 00000000000000


FTP
EPSV
LIST
netrc


#
# Server-side

# When doing LIST, we get the default list output hard-coded in the test
# FTP server

total 20
drwxr-xr-x   8 98       98           512 Oct 22 13:06 .
drwxr-xr-x   8 98       98           512 Oct 22 13:06 ..
drwxr-xr-x   2 98       98           512 May  2  1996 .NeXT
-r--r--r--   1 0        1             35 Jul 16  1996 README
lrwxrwxrwx   1 0        1              7 Dec  9  1999 bin -> usr/bin
dr-xr-xr-x   2 0        1            512 Oct  1  1997 dev
drwxrwxrwx   2 98       98           512 May 29 16:04 download.html
dr-xr-xr-x   2 0        1            512 Nov 30  1995 etc
drwxrwxrwx   2 98       1            512 Oct 30 14:33 pub
dr-xr-xr-x   5 0        1            512 Oct  1  1997 usr



#
# Client-side


ftp

 
FTP (compulsory .netrc; ignored user/passwd) dir list PASV
 
 
-n --netrc-file log/netrc133 ftp://mary:mark@%HOSTIP:%FTPPORT/


# the following two lines were created while testing curl
machine %HOSTIP login user1 password passwd1
machine %HOSTIP login user2 password passwd2



#
# Verify data after the test has been "shot"


USER user1
PASS passwd1
PWD
EPSV
TYPE A
LIST
QUIT



curl-7.35.0/tests/data/test610000644000175000017500000000322712213173003012614 00000000000000


HTTP
HTTP GET
cookies
cookiejar
HTTP replaced headers
httponly


# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Type: text/html
Funny-head: yesyes
Set-Cookie: test=yes; httponly; domain=foo.com; expires=Fri Feb 2 11:56:27 GMT 2035
SET-COOKIE: test2=yes; domain=host.foo.com; expires=Fri Feb 2 11:56:27 GMT 2035
Set-Cookie: test3=maybe; domain=foo.com; path=/moo; secure
Set-Cookie: test4=no; domain=nope.foo.com; path=/moo; secure
Set-Cookie: test5=name; domain=anything.com; path=/ ; secure
Set-Cookie: fake=fooledyou; domain=..com; path=/;
Content-Length: 4

boo



# Client-side


http

 
HTTP with various cookies and custom Host:
 
# Explicitly set the time zone to a known good one, in case the user is
# using one of the 'right' zones that take into account leap seconds
# which causes the cookie expiry times to be different.

TZ=GMT

 
http://%HOSTIP:%HTTPPORT/we/want/61 -c log/jar61.txt -H "Host: www.host.foo.com"



# Verify data after the test has been "shot"


^User-Agent:.*


GET /we/want/61 HTTP/1.1
Accept: */*
Host: www.host.foo.com



# Netscape HTTP Cookie File
# http://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.

#HttpOnly_.foo.com	TRUE	/we/want/	FALSE	2054030187	test	yes
.host.foo.com	TRUE	/we/want/	FALSE	2054030187	test2	yes
.foo.com	TRUE	/moo	TRUE	0	test3	maybe



curl-7.35.0/tests/data/test1690000644000175000017500000000772012270035364012721 00000000000000


HTTP
HTTP GET
HTTP proxy
HTTP proxy NTLM auth
HTTP Digest auth



# Server-side


# this is returned first since we get no proxy-auth

HTTP/1.1 407 Authorization Required to proxy me my dear swsclose
Proxy-Authenticate: NTLM

And you should ignore this data.


# then this is returned since we get no server-auth

HTTP/1.1 200 Authorizated fine
Content-Length: 27

Welcome to the end station



HTTP/1.1 407 NTLM type-1 received sending back type-2
Server: Microsoft-IIS/5.0
Content-Length: 34
Content-Type: text/html; charset=iso-8859-1
Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

This is not the real page either!


# This is supposed to be returned when the server gets the second
# Authorization: NTLM line passed-in from the client

HTTP/1.1 401 You now need to authenticate with the host
Server: Microsoft-IIS/5.0
WWW-Authenticate: Digest realm="r e a l m", nonce="abcdef"
Content-Length: 46
Content-Type: text/html; charset=iso-8859-1

We have not authenticated with the server yet



HTTP/1.1 407 NTLM type-1 received sending back type-2
Server: Microsoft-IIS/5.0
Content-Length: 34
Content-Type: text/html; charset=iso-8859-1
Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

HTTP/1.1 401 You now need to authenticate with the host
Server: Microsoft-IIS/5.0
WWW-Authenticate: Digest realm="r e a l m", nonce="abcdef"
Content-Length: 46
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 200 Authorizated fine
Content-Length: 27

Welcome to the end station



# Client-side


http


NTLM
!SSPI

 
HTTP with proxy-requiring-NTLM to site-requiring-Digest
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
http://data.from.server.requiring.digest.hohoho.com/169 --proxy http://%HOSTIP:%HTTPPORT --proxy-user foo:bar --proxy-ntlm --digest --user digest:alot


chkhostname curlhost



# Verify data after the test has been "shot"


^User-Agent: curl/.*


GET http://data.from.server.requiring.digest.hohoho.com/169 HTTP/1.1
Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.3
Host: data.from.server.requiring.digest.hohoho.com
Accept: */*
Proxy-Connection: Keep-Alive

GET http://data.from.server.requiring.digest.hohoho.com/169 HTTP/1.1
Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAAAwADAHAAAAAIAAgAcwAAAAAAAAAAAAAABoKBAIP6B+XVQ6vQsx3DfDXUVhd9436GAxPu0IYcl2Z7LxHmNeOAWQ+vxUmhuCFJBUgXCWZvb2N1cmxob3N0
User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.3
Host: data.from.server.requiring.digest.hohoho.com
Accept: */*
Proxy-Connection: Keep-Alive

GET http://data.from.server.requiring.digest.hohoho.com/169 HTTP/1.1
Authorization: Digest username="digest", realm="r e a l m", nonce="abcdef", uri="/169", response="95d48591985a03c4b49cb962aa7bd3e6"
User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.3
Host: data.from.server.requiring.digest.hohoho.com
Accept: */*
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test410000644000175000017500000000060212213173003012604 00000000000000


HTTP
HTTP FORMPOST
FAILURE


# Server-side



# Client-side


http

 
HTTP formpost with missing file
 
 
http://%HOSTIP:%HTTPPORT/want/41 -F moo=@boo



# Verify data after the test has been "shot"


26



curl-7.35.0/tests/data/test10860000644000175000017500000001053512213173003012764 00000000000000


FTP
EPSV
RETR
timeout
FAILURE



# Server-side

# Overload some standard FTP responses to make them shorter and faster
# to avoid wasting time waiting for the data phase to start

SLOWDOWN
REPLY USER 331 OK
REPLY PASS 230 OK
REPLY PWD 257 "/"
REPLY TYPE 200 OK


Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.
Long chunk of data that couldn't possibly be sent in the time allotted.



# Client-side


ftp


ftp

 
FTP download with strict timeout and slow data transfer
 
 
ftp://%HOSTIP:%FTPPORT/1086 -m 7



# Verify data after the test has been "shot"

# 28 is CURLE_OPERATION_TIMEDOUT

28


USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
SIZE 1086
RETR 1086



curl-7.35.0/tests/data/test3130000644000175000017500000000123212213173003012666 00000000000000


HTTPS
HTTP GET
PEM certificate
CRL



#
# Client-side


SSL


https Server-localhost-sv.pem

 
CRL test
 
 
--cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --crlfile %SRCDIR/certs/Server-localhost-sv.crl https://localhost:%HTTPSPORT/313

# Ensure that we're running on localhost because we're checking the host name

perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"



#
# Verify data after the test has been "shot"


60



curl-7.35.0/tests/data/test1790000644000175000017500000000170512213173003012705 00000000000000


HTTP
HTTP GET
HTTP proxy
cookies



# Server-side


HTTP/1.1 200 OK
Server: Microsoft-IIS/4.0
Date: Tue, 25 Sep 2001 19:37:44 GMT
Content-Type: text/html
Connection: close
Content-Length: 21

This server says moo



# Client-side


http

 
HTTP using proxy and cookies with path checks
 
 
http://supertrooper.fake/c/179 -b log/injar179 -x %HOSTIP:%HTTPPORT


supertrooper.fake	FALSE	/a	FALSE	2139150993	mooo	indeed
supertrooper.fake	FALSE	/b	FALSE	0		moo1	indeed
supertrooper.fake	FALSE	/c	FALSE	2139150993	moo2	indeed



# Verify data after the test has been "shot"


^User-Agent:.*


GET http://supertrooper.fake/c/179 HTTP/1.1
Host: supertrooper.fake
Accept: */*
Proxy-Connection: Keep-Alive
Cookie: moo2=indeed




curl-7.35.0/tests/data/test5930000644000175000017500000000205012213173003012677 00000000000000#
# For this test the server rejects the EPRT command,
# code in lib591 makes use of curl_multi_timeout()
# and server does not establish data connection.
#



FTP
PORT
STOR
multi
EPRT refused
NODATACONN150



# Server-side




NODATACONN150
REPLY EPRT 500 we don't like EPRT now



# Client-side


ftp


lib591

 
FTP multi PORT upload, no data conn and no transient neg. reply
 
 
ftp://%HOSTIP:%FTPPORT/path/593 %FTPTIME2 log/upload593


Moooooooooooo for 593
 upload this



# Verify data after the test has been "shot"

# Strip off parts of the PORT and EPRT commands that might differ

s/^PORT (.*)/PORT/
s/^EPRT \|1\|(.*)/EPRT \|1\|/


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPRT |1|
PORT
TYPE I
STOR 593
QUIT


12





curl-7.35.0/tests/data/test5460000644000175000017500000000153312213173003012702 00000000000000


FTP
PASV
RETR
multi


# Server-side


data
    to
      see
that FTP
works
  so does it?



REPLY RETR 550 the file doesn't exist
COUNT RETR 1
REPLY SIZE 550 Can't check for file existence
COUNT SIZE 1



# Client-side


ftp


lib533

 
FTP RETR a non-existing file then a found one using the multi interface
 
 
ftp://%HOSTIP:%FTPPORT/path/546 ftp://%HOSTIP:%FTPPORT/path/546



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE 546
RETR 546
EPSV
SIZE 546
RETR 546
QUIT


data
    to
      see
that FTP
works
  so does it?



curl-7.35.0/tests/data/test8600000644000175000017500000000065312262353672012723 00000000000000


POP3
NOOP
CUSTOMREQUEST



#
# Server-side



#
# Client-side


pop3

 
POP3 NOOP (CUSTOMREQUEST)
 
 
pop3://%HOSTIP:%POP3PORT -u user:secret -X NOOP -I



#
# Verify data after the test has been "shot"


CAPA
USER user
PASS secret
NOOP
QUIT



curl-7.35.0/tests/data/test2150000644000175000017500000000233712213173003012676 00000000000000


FTP



# Server-side

# When doing LIST, we get the default list output hard-coded in the test
# FTP server

total 20
drwxr-xr-x   8 98       98           512 Oct 22 13:06 .
drwxr-xr-x   8 98       98           512 Oct 22 13:06 ..
drwxr-xr-x   2 98       98           512 May  2  1996 .NeXT
-r--r--r--   1 0        1             35 Jul 16  1996 README
lrwxrwxrwx   1 0        1              7 Dec  9  1999 bin -> usr/bin
dr-xr-xr-x   2 0        1            512 Oct  1  1997 dev
drwxrwxrwx   2 98       98           512 May 29 16:04 download.html
dr-xr-xr-x   2 0        1            512 Nov 30  1995 etc
drwxrwxrwx   2 98       1            512 Oct 30 14:33 pub
dr-xr-xr-x   5 0        1            512 Oct  1  1997 usr




# Client-side


ftp

 
Get two FTP dir listings from the same remote dir: no second CWD
 
 
ftp://%HOSTIP:%FTPPORT/a/path/215/ ftp://%HOSTIP:%FTPPORT/a/path/215/



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD a
CWD path
CWD 215
EPSV
TYPE A
LIST
EPSV
LIST
QUIT



curl-7.35.0/tests/data/test14020000644000175000017500000000553212213173003012755 00000000000000


HTTP
HTTP POST
--libcurl



# Server-side


HTTP/1.1 200 OK
Date: Thu, 29 Jul 2008 14:49:00 GMT
Server: test-server/fake
Content-Length: 0
Content-Type: text/plain
Connection: close




# Client-side


http

 
--libcurl for simple POST
 
 
http://%HOSTIP:%HTTPPORT/we/want/1402 --libcurl log/test1402.c -d "foo=bar" -d "baz=quux"



# Verify data after the test has been "shot"


^User-Agent:.*


POST /we/want/1402 HTTP/1.1
User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 16
Content-Type: application/x-www-form-urlencoded

foo=bar&baz=quux


# curl's default user-agent varies with version, libraries etc.
s/(USERAGENT, \")[^\"]+/${1}stripped/
# CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
# ignore them
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/


/********* Sample code generated by the curl command line tool **********
 * All curl_easy_setopt() options are documented at:
 * http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
 ************************************************************************/
#include 

int main(int argc, char *argv[])
{
  CURLcode ret;
  CURL *hnd;

  hnd = curl_easy_init();
  curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1402");
  curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
  curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "foo=bar&baz=quux");
  curl_easy_setopt(hnd, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)16);
  curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped");
  curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
  curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
  curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);

  /* Here is a list of options the curl code used that cannot get generated
     as source easily. You may select to either not use them or implement
     them yourself.

  CURLOPT_WRITEDATA set to a objectpointer
  CURLOPT_WRITEFUNCTION set to a functionpointer
  CURLOPT_READDATA set to a objectpointer
  CURLOPT_READFUNCTION set to a functionpointer
  CURLOPT_SEEKDATA set to a objectpointer
  CURLOPT_SEEKFUNCTION set to a functionpointer
  CURLOPT_ERRORBUFFER set to a objectpointer
  CURLOPT_STDERR set to a objectpointer
  CURLOPT_DEBUGFUNCTION set to a functionpointer
  CURLOPT_DEBUGDATA set to a objectpointer
  CURLOPT_HEADERFUNCTION set to a functionpointer
  CURLOPT_HEADERDATA set to a objectpointer

  */

  ret = curl_easy_perform(hnd);

  curl_easy_cleanup(hnd);
  hnd = NULL;

  return (int)ret;
}
/**** End of sample code ****/





curl-7.35.0/tests/data/test2420000644000175000017500000000126112213173003012671 00000000000000


HTTP
HTTP GET
IPv6
HTTP Basic auth


#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Connection: close

hello



#
# Client-side


ipv6


http-ipv6

 
HTTP-IPv6 GET with username+password in URL
 
 
-g "http://foobar:barfoo@%HOST6IP:%HTTP6PORT/242"



#
# Verify data after the test has been "shot"


^User-Agent:


GET /242 HTTP/1.1
Authorization: Basic Zm9vYmFyOmJhcmZvbw==
Host: %HOST6IP:%HTTP6PORT
Accept: */*




curl-7.35.0/tests/data/test12230000644000175000017500000000155612213173003012760 00000000000000


HTTP
HTTP GET



#
# disable data check since it gets sent to stdout and is verified there


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 4
Connection: close
Content-Type: text/html

hej



#
# Client-side


http

 
HTTP GET -w remote_ip and -w remote_port
 
 
http://%HOSTIP:%HTTPPORT/1223 -w 'IP %{remote_ip} and PORT %{remote_port}\n'



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1223 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 4
Connection: close
Content-Type: text/html

hej
IP %HOSTIP and PORT %HTTPPORT



curl-7.35.0/tests/data/test11040000644000175000017500000000340512213173003012751 00000000000000


HTTP
HTTP GET
HTTP proxy
cookies



# Server-side


HTTP/1.1 301 Moved
Date: Thu, 09 Nov 2010 14:49:00 GMT
Location: /want/data/11040002
Server: test-server/fake
Set-Cookie: test=true; domain=127.0.0.1; path=/; expires=Thu Jan  1 00:00:00 GMT 1970;
Set-Cookie: test2=true; domain=127.0.0.1; path=/; expires=Fri Feb 2 11:56:27 GMT 2035;
Connection: close

This server reply is for testing a set-cookie



HTTP/1.1 200 Followed here fine swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 52

If this is received, the location following worked



HTTP/1.1 301 Moved
Date: Thu, 09 Nov 2010 14:49:00 GMT
Location: /want/data/11040002
Server: test-server/fake
Set-Cookie: test=true; domain=127.0.0.1; path=/; expires=Thu Jan  1 00:00:00 GMT 1970;
Set-Cookie: test2=true; domain=127.0.0.1; path=/; expires=Fri Feb 2 11:56:27 GMT 2035;
Connection: close

HTTP/1.1 200 Followed here fine swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 52

If this is received, the location following worked




# Client-side


http

 
HTTP cookie expiry date at Jan 1 00:00:00 GMT 1970
 
 
http://%HOSTIP:%HTTPPORT/want/1104 -L -x %HOSTIP:%HTTPPORT -c log/cookies.jar



# Verify data after the test has been "shot"


^User-Agent:.*


GET http://%HOSTIP:%HTTPPORT/want/1104 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Proxy-Connection: Keep-Alive

GET http://%HOSTIP:%HTTPPORT/want/data/11040002 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Proxy-Connection: Keep-Alive
Cookie: test2=true




curl-7.35.0/tests/data/test1650000644000175000017500000000137112213173003012677 00000000000000


HTTP
HTTP GET
HTTP proxy
IDN



#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes




#
# Client-side


http


idn


CHARSET=ISO8859-1

 
HTTP over proxy with IDN host name
 
 
http://www.åäö.se/page/165 -x %HOSTIP:%HTTPPORT



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET http://www.xn--4cab6c.se/page/165 HTTP/1.1
Host: www.xn--4cab6c.se
Accept: */*
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test15030000644000175000017500000000143512213173003012755 00000000000000


HTTP
HTTP GET
multi
CURLOPT_RESOLVE





HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes

-foo-



#
# Client-side


http


lib1503

 
HTTP multi with CURLOPT_RESOLVE, cleanup sequence PA
 
 
http://google.com:%HTTPPORT/1503 %HTTPPORT %HOSTIP



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1503 HTTP/1.1
Host: google.com:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test880000644000175000017500000000406412213173003012625 00000000000000


HTTP
HTTP PUT
HTTP Digest auth



# Server-side


auth_required


HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
Content-Type: text/html; charset=iso-8859-1
Connection: close

This is not the real page


# This is supposed to be returned when the server gets a
# Authorization: Digest line passed-in from the client

HTTP/1.1 200 OK swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Connection: close

This IS the real page!



HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
Content-Type: text/html; charset=iso-8859-1
Connection: close

HTTP/1.1 200 OK swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Connection: close

This IS the real page!




# Client-side


http


crypto

 
HTTP PUT with Digest authorization
 
 
http://%HOSTIP:%HTTPPORT/88 -T log/put88 -u testuser:testpass --digest


This is data we upload with PUT
a second line
line three
four is the number of lines



# Verify data after the test has been "shot"


^User-Agent:.*


PUT /88 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 0
Expect: 100-continue

PUT /88 HTTP/1.1
Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/88", response="78a49fa53d0c228778297687d4168e71"
User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 85
Expect: 100-continue

This is data we upload with PUT
a second line
line three
four is the number of lines



curl-7.35.0/tests/data/test2900000644000175000017500000000076212213173003012701 00000000000000


FTP
--max-filesize


# Server-side


85



# Client-side


ftp

 
FTP download maximum filesize exceeded
 
 
ftp://%HOSTIP:%FTPPORT/290 --max-filesize 30



# Verify data after the test has been "shot"


63


USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
SIZE 290
QUIT



curl-7.35.0/tests/data/DISABLED0000644000175000017500000000037412262353672012655 00000000000000# This file can be used to specify test cases that should not run when all
# test cases are run by runtests.pl. Just add the plain test case numbers, one
# per line.
# Lines starting with '#' letters are treated as comments.
594
815
816
1209
1211
1512
curl-7.35.0/tests/data/test3110000644000175000017500000000125112213173003012665 00000000000000


HTTPS
HTTP GET
PEM certificate



#
# Server-side



#
# Client-side


SSL


https Server-localhost0h-sv.pem

 
HTTPS wrong subjectAltName but right CN
 
 
--cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/311

# Ensure that we're running on localhost because we're checking the host name

perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"



#
# Verify data after the test has been "shot"


51



curl-7.35.0/tests/data/test40000644000175000017500000000157512213173003012535 00000000000000


HTTP
HTTP GET
HTTP added headers
HTTP replaced headers


#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes




#
# Client-side


http

 
Replaced internal and added custom HTTP headers
 
 
 -H "extra-header: here" -H "Accept: replaced" -H "X-Custom-Header;" -H "X-Test: foo; " -H "X-Test:" -H "X-Test2: foo;" -H "X-Test3:  " -H "X-Test4;  " -H "X-Test5;ignored" http://%HOSTIP:%HTTPPORT/4



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /4 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
extra-header: here
Accept: replaced
X-Custom-Header:
X-Test: foo; 
X-Test2: foo;




curl-7.35.0/tests/data/test5780000644000175000017500000000145312213173003012710 00000000000000


HTTP
HTTP POST


#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes

-foo-



# Client-side


http

# tool is what to use instead of 'curl'

lib578


 
HTTP POST lower than MAX_INITIAL_POST_SIZE with progress callback
 
 
http://%HOSTIP:%HTTPPORT/500 log/ip578



#
# Verify data after the test has been "shot"


PASSED, UL data matched data size



curl-7.35.0/tests/data/test2230000644000175000017500000000613112213173003012671 00000000000000


HTTP
HTTP GET
compressed
FAILURE


#
# Server-side

# this deflate chunk has three bytes removed from the beginning

SFRUUC8xLjEgMjAwIE9LDQpEYXRlOiBNb24sIDI5IE5vdiAyMDA0IDIxOjU2OjUzIEdNVA0KU2Vy
dmVyOiBBcGFjaGUvMS4zLjMxIChEZWJpYW4gR05VL0xpbnV4KSBtb2RfZ3ppcC8xLjMuMjYuMWEg
UEhQLzQuMy45LTEgbW9kX3NzbC8yLjguMjAgT3BlblNTTC8wLjkuN2QgbW9kX3BlcmwvMS4yOQ0K
VmFyeTogQWNjZXB0LUVuY29kaW5nDQpDb250ZW50LVR5cGU6IHRleHQvaHRtbDsgY2hhcnNldD1J
U08tODg1OS0xDQpDb250ZW50LUVuY29kaW5nOiBkZWZsYXRlDQpDb250ZW50LUxlbmd0aDogMTMw
NQ0KDQpY227jNhB9N5B/YP3UArZuthM5cLQoctkEzTbB2gW6TwYt0TYbSRRIyrk89Ns7lCiJsRyv
d4O+BEhicuacw+EMSZOZfHpKYrQhXFCWnnVdy+kikoYsounqrHszvev7/mjcd7ufgs7kl4u789m3
+0uUcfYPCWU/pkICEE2/TWeXX1B3LWV2attLTsQ6IVhaKZH2AocPJI3sZdLXPNF3rKEVyagLolta
QQehyqbaTW9Oo8A9dr2JbRhKRIQlmeMoIoAYj/2+4/c9FznDU8c99cYT2/AbhDxTH1HgOc6w7zp9
10eOd+rBz0BTKsSrOFKckLlYMy6DMOdxHY5hb+OXeRwXcITTCMV00aYWEB0eEaGWOmdJUlJSgiRj
tQDH/BktGUdhTEkq+4JGBP319RZJjlOxhIpaMItGyFDeGQyiAuFyBKVaqXBV3yWNiTjq5EJ11Bji
OZX4yUI3Eok8y0BfoOvZ7L5X/J320BW0jzpXRfvi5nzWQ7PL2z8v4fP24neAXd3cXvaK4T/f3V9f
foU2DPBIYoiplOpnTMiebubQChl7oEQU2ijPYoYjGAKWWp6QqJl1D2VYiEfGI9WEyNI8WRT26fT2
qBMSLumShlBXMP1BOPiYKEOBajzBCMW0IBsZeyScREedxXOVpB6Sa/JmxquyWEed2RqoCMPvgqZq
MwlIbZ1qlWAGmw55zlEnxukqxysiihhIuqGcpQkMIEBHl9BYGxsqcUzl81yEjJNgdOIPrdHJxN6y
b4EzwkOQDAaWe2xgK/MWGubzAHttbCALk17XLMtjzJuxjkdjiGEIy3nb0yJUA7oDy3dfEV6HYjjK
YJzRK7QRDsfFueFbI2di647pmYcsB13Prbza8ApTDuIPaowxgMgXIuQ0k3BEimCgTofXphIGpU/D
9Vzt5eCCLHEey4ltGksY1H9eHWAZlD3YeWhWJ6Wt1os9sVusRmzNEvK2ECxgyksVdXjaJkPr1gKN
ply9HC4HYK2kaI3I4sU7XATAWkTRGpEXmh0uAmAtomiNSLiGPUZitjpcqqZowUaikeVZcrgggLWU
ojUiEVkcLgJgLaJojQgTT4eLAFiLKJpRLxGp8/IHalYSqrppurHMcw5pEyTQ67fqGoXZiB8oyUZU
xdgIQ0TdHA5XUWgtUxAbnYRyzvjhSiVea2myWdeEBVWtoFl6YgqHHKTgy83M/hudw+kBKaN5gm5L
x8SuEBqvvqfknJOY1Jlrmef6/hacWK5nwQXpDfcbbHWvOjl2/FGLWF2w2hx1L9p9cdoFLOdi75rM
BM5RAhNeMzmXa/iqhpy1TCUS5xJuMqIOqexX3dqgT2CcUhKjqSQpfMOvJrbpbFGgSrvr/u8CryKi
imwgW3TOYhLcPaaE17jCVEVqm6FWvWoJqy94ThOaYmnOTnK4IRS1gYLWnZbX8473uQd7ufucru/v
5bp7x4WlsT/qvW73eLjPPd5L9sd7vc5etzv6TtzfCWx/ZIPW2OX9brv8sCYyeDLBQwyuo7VObXxG
8jkjZ11OQngdKJt6SdWLssGZG9lRQ+1y7CTqewu4T4aqGDtdO5nG46xF3X64vcWVVKoNBXa4s6Nf
9W3qt51aJbbeaQ3i7byx4t6G4/8vac5PZ2w4eGfG1Pvq4yfK9QYj9x2ZeoGn2MfP0sBzhifvyNI1
oUmE44+fqOFwNPDekaiwD0998TN5Miz6rK//KxR0/gMAAP//gjMRo2MAAAAA//8DAN04jtE=



HTTP/1.1 200 OK
Date: Mon, 29 Nov 2004 21:56:53 GMT
Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29
Vary: Accept-Encoding
Content-Type: text/html; charset=ISO-8859-1
Content-Encoding: deflate
Content-Length: 1305





#
# Client-side


libz


http

 
HTTP GET deflate compressed content with broken deflate header
 
 
http://%HOSTIP:%HTTPPORT/223 --compressed



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /223 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Accept-Encoding: deflate, gzip



61



curl-7.35.0/tests/data/test8640000644000175000017500000000122212270035364012712 00000000000000


POP3
POP3 APOP



#
# Server-side


CAPA APOP
REPLY welcome +OK cURL POP3 server ready to serve <1972.987654321\@curl>


From: me@somewhere
To: fake@nowhere

body

--
  yours sincerely



#
# Client-side


pop3


crypto

 
POP3 APOP authentication
 
 
pop3://%HOSTIP:%POP3PORT/864 -u user:secret



#
# Verify data after the test has been "shot"


CAPA
APOP user 7501b4cdc224d469940e65e7b5e4d6eb
RETR 864
QUIT



curl-7.35.0/tests/data/test1770000644000175000017500000000162612213173003012705 00000000000000


HTTP
HTTP POST
HTTP Digest auth
followlocation



# Server-side


HTTP/1.1 302 *MOVED* swsclose swsbounce
Server: Microsoft-IIS/6.0
Location: /mooooo/177
Content-Type: text/html; charset=iso-8859-1




# Client-side

# 

http


crypto

 
HTTP POST --digest to server doing a 302-location response
 
 
http://%HOSTIP:%HTTPPORT/177 -u auser:apasswd --digest -d "junkelijunk"



# Verify data after the test has been "shot"


^User-Agent:.*


POST /177 HTTP/1.1
User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 0
Content-Type: application/x-www-form-urlencoded




curl-7.35.0/tests/data/test2110000644000175000017500000000121212213173003012661 00000000000000


FTP



# Server-side


data blobb


REPLY EPSV 500 no such command



# Client-side


ftp

 
Get two FTP files with no remote EPSV support
 
 
ftp://%HOSTIP:%FTPPORT/a/path/211 ftp://%HOSTIP:%FTPPORT/a/path/211


data blobb
data blobb



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD a
CWD path
EPSV
PASV
TYPE I
SIZE 211
RETR 211
PASV
SIZE 211
RETR 211
QUIT



curl-7.35.0/tests/data/test2020000644000175000017500000000100112262353672012675 00000000000000


FILE



# Server-side





# Client-side


file

 
two file:// URLs to stdout
 
 
file://localhost/%PWD/log/test202.txt FILE://localhost/%PWD/log/test202.txt


contents in a single file



# Verify data after the test has been "shot"


contents in a single file
contents in a single file



curl-7.35.0/tests/data/test5080000644000175000017500000000155512213173003012704 00000000000000
#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Connection: close
Content-Type: text/html

hello



# Client-side


http

# tool is what to use instead of 'curl'

lib508


 
send HTTP POST using read callback
 
 
http://%HOSTIP:%HTTPPORT/508



#
# Verify data after the test has been "shot"


# remove CR that CURLOPT_TRANSFERTEXT added, when CharConv enabled:
s/^(this is what we post to the silly web server)\r\n/$1\n/ if($has_charconv)


POST /508 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 45
Content-Type: application/x-www-form-urlencoded

this is what we post to the silly web server



curl-7.35.0/tests/data/test11310000644000175000017500000000313712213173003012753 00000000000000


HTTP
HTTP PUT
Expect: 100-continue



#
# Server-side


HTTP/1.1 400 NOOOOOOOOO
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 9
Content-Type: text/html

FAILURE1



HTTP/1.1 400 NEITHER
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 9
Content-Type: text/html

FAILURE2


# we use skip to make the test server never read the full payload off
# the socket and instead return the response at once 

skip: 100



#
# Client-side

# 100 x 'x'

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


http

 
HTTP PUT expect 100-continue with a 400
 
 
-T log/file1131 http://%HOSTIP:%HTTPPORT/1131 -T log/file1131 http://%HOSTIP:%HTTPPORT/11310001



#
# Verify data after the test has been "shot"


HTTP/1.1 400 NOOOOOOOOO
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 9
Content-Type: text/html

FAILURE1
HTTP/1.1 400 NEITHER
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 9
Content-Type: text/html

FAILURE2


^User-Agent:.*


PUT /1131 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 100
Expect: 100-continue

PUT /11310001 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 100
Expect: 100-continue




curl-7.35.0/tests/data/test9110000644000175000017500000000105612262353672012716 00000000000000


SMTP



#
# Server-side



#
# Client-side


smtp

 
SMTP with no mail data
 





 
smtp://%HOSTIP:%SMTPPORT/911 --mail-rcpt recipient@example.com --mail-from sender@example.com -T -



#
# Verify data after the test has been "shot"


EHLO 911
MAIL FROM:
RCPT TO:
DATA
QUIT



.



curl-7.35.0/tests/data/test130000644000175000017500000000114212213173003012603 00000000000000


HTTP
HTTP custom request


# Server-side


HTTP/1.1 200 Read you
Content-Length: 29
Deleted: suppose we got a header like this! ;-)

blabla custom request result



# Client-side


http

 
HTTP custom request 'DELETE'
 
 
http://%HOSTIP:%HTTPPORT/want/13 -X DELETE



# Verify data after the test has been "shot"


^User-Agent:.*


DELETE /want/13 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test5970000644000175000017500000000057712213173003012717 00000000000000


FTP
CONNECT_ONLY



# Client-side


ftp


lib597

 
FTP connect only option
 


ftp://%HOSTIP:%FTPPORT




#
# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
QUIT



curl-7.35.0/tests/data/test10400000644000175000017500000000201112213173003012740 00000000000000
# Similar to test92


HTTP
HTTP GET
Resume



# Server-side


HTTP/1.1 416 Invalid range
Connection: close
Content-Length: 0



# The file data that exists at the start of the test must be included in
# the verification.

012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
HTTP/1.1 416 Invalid range
Connection: close
Content-Length: 0





# Client-side


http

 
HTTP GET with resume from end of entirely-downloaded file
 
 
http://%HOSTIP:%HTTPPORT/1040 -C -


012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678



# Verify data after the test has been "shot"


^User-Agent:.*


GET /1040 HTTP/1.1
Range: bytes=100-
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test170000644000175000017500000000142412213173003012612 00000000000000


HTTP
HTTP custom request
config file


# Server-side


HTTP/1.1 200 OK
Funny-head: yesyes
Content-Length: 27

This is the proof it works



# Client-side


http

 
HTTP with config file on stdin
 
 
#
# Use a silly request without '--':
request MOOO
#
# Set the user-agent using a short-option:
-A "agent007 license to drill\t"
#
# long option *with* '--':
--max-time 180
 
 
-K - %HOSTIP:%HTTPPORT/that.site.com/17



# Verify data after the test has been "shot"


MOOO /that.site.com/17 HTTP/1.1
User-Agent: agent007 license to drill	
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test1000000644000175000017500000000217712270035364012703 00000000000000


FTP
PASV
LIST


#
# Server-side

# When doing LIST, we get the default list output hard-coded in the test
# FTP server

total 20
drwxr-xr-x   8 98       98           512 Oct 22 13:06 .
drwxr-xr-x   8 98       98           512 Oct 22 13:06 ..
drwxr-xr-x   2 98       98           512 May  2  1996 curl-releases
-r--r--r--   1 0        1             35 Jul 16  1996 README
lrwxrwxrwx   1 0        1              7 Dec  9  1999 bin -> usr/bin
dr-xr-xr-x   2 0        1            512 Oct  1  1997 dev
drwxrwxrwx   2 98       98           512 May 29 16:04 download.html
dr-xr-xr-x   2 0        1            512 Nov 30  1995 etc
drwxrwxrwx   2 98       1            512 Oct 30 14:33 pub
dr-xr-xr-x   5 0        1            512 Oct  1  1997 usr



#
# Client-side


ftp

 
FTP dir list PASV
 
 
ftp://%HOSTIP:%FTPPORT/test-100/



#
# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD test-100
EPSV
TYPE A
LIST
QUIT



curl-7.35.0/tests/data/test10190000644000175000017500000000074612213173003012763 00000000000000


FILE
Range



# Server-side





# Client-side


none


file

 
X- range on a file:// URL to stdout
 
 
-r 7- file://localhost/%PWD/log/test1019.txt 


1234567890
1234567890



# Verify data after the test has been "shot"


890
1234567890



curl-7.35.0/tests/data/test8330000644000175000017500000000163512270035364012716 00000000000000


IMAP
IMAP AUTH CRAM-MD5 SASL DOWNGRADE
RFC2195



#
# Server-side


AUTH CRAM-MD5 PLAIN
REPLY "AUTHENTICATE CRAM-MD5" + Rubbish
REPLY * A002 NO AUTH exchange cancelled by client
REPLY "AUTHENTICATE PLAIN" +
REPLY dXNlcgB1c2VyAHNlY3JldA== A003 OK AUTHENTICATE completed


From: me@somewhere
To: fake@nowhere

body

--
  yours sincerely



#
# Client-side


imap


crypto

 
IMAP CRAM-MD5 authentication with SASL downgrade
 
 
'imap://%HOSTIP:%IMAPPORT/833/;UID=1' -u user:secret



#
# Verify data after the test has been "shot"


A001 CAPABILITY
A002 AUTHENTICATE CRAM-MD5
*
A003 AUTHENTICATE PLAIN
dXNlcgB1c2VyAHNlY3JldA==
A004 SELECT 833
A005 FETCH 1 BODY[]
A006 LOGOUT



curl-7.35.0/tests/data/test13930000644000175000017500000000227012213173003012762 00000000000000


FTP
RETR



# Server-side

# file1393 contents...

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1393; charset=funny; option=strange

MOOOO



# Client-side


ftp


FTP DL, file with C-D inside, using -o fname -i, without -D


ftp://%HOSTIP:%FTPPORT/path/file1393 -o log/download1393 -i


perl %SRCDIR/libtest/notexists.pl log/file1393 log/name1393



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1393
RETR file1393
QUIT



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1393; charset=funny; option=strange

MOOOO







curl-7.35.0/tests/data/test9070000644000175000017500000000251512262353672012724 00000000000000


SMTP
SMTP AUTH DIGEST-MD5
RFC2831
RFC4954



#
# Server-side


AUTH DIGEST-MD5
REPLY AUTH 334 cmVhbG09ImN1cmwiLG5vbmNlPSI1MzAwZDE3YTFkNjk1YmQ0MTFlNGNkZjk2Zjk1NDhjMjNjZWQ2MTc1IixhbGdvcml0aG09bWQ1LXNlc3MscW9wPSJhdXRoIg==
REPLY dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIxMjM0NTY3OCIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJzbXRwL2N1cmwiLHJlc3BvbnNlPTU3MjBiYjgxZDgwNjI3YmU1ZDExYTAwYTU2M2Q3MGU1 334
REPLY  235 Authenticated



#
# Client-side


smtp


debug
crypto

 
SMTP DIGEST-MD5 authentication
 

mail body

 
smtp://%HOSTIP:%SMTPPORT/907 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret -T -



#
# Verify data after the test has been "shot"


EHLO 907
AUTH DIGEST-MD5
dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIxMjM0NTY3OCIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJzbXRwL2N1cmwiLHJlc3BvbnNlPTU3MjBiYjgxZDgwNjI3YmU1ZDExYTAwYTU2M2Q3MGU1

MAIL FROM:
RCPT TO:
DATA
QUIT


mail body
.



curl-7.35.0/tests/data/test13480000644000175000017500000000154312213173003012764 00000000000000


FTP
RETR



# Server-side


fooo
mooo



# Client-side

# this relies on the debug feature to allow us to set directory to store the
# -O output in, using the CURL_TESTDIR variable

debug


ftp


FTP download, file without Content-Disposition inside, using -O


CURL_TESTDIR=%PWD/log


ftp://%HOSTIP:%FTPPORT/path/file1348 -O



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1348
RETR file1348
QUIT



fooo
mooo







curl-7.35.0/tests/data/test13030000644000175000017500000000036312213173003012752 00000000000000


unittest
Curl_timeleft



#
# Client-side


none


unittest

 
Curl_timeleft unit tests
 

unit1303




curl-7.35.0/tests/data/test14010000644000175000017500000000647012213173003012756 00000000000000


HTTP
HTTP GET
HTTP Basic auth
HTTP set cookie
cookies
--libcurl



# Server-side


HTTP/1.1 200 OK
Date: Thu, 29 Jul 2008 14:49:00 GMT
Server: test-server/fake
Content-Length: 0
Content-Type: text/plain
Connection: close




# Client-side


http

 
--libcurl for GET with various options
 
 
http://%HOSTIP:%HTTPPORT/we/want/1401 --libcurl log/test1401.c --basic -u fake:user -H "X-Files: Mulder" -H "X-Men: cyclops, iceman" -A MyUA -b chocolate=chip --proto "=http,ftp,file"



# Verify data after the test has been "shot"


^User-Agent:.*


GET /we/want/1401 HTTP/1.1
User-Agent: stripped
Authorization: Basic ZmFrZTp1c2Vy
Host: %HOSTIP:%HTTPPORT
Accept: */*
Cookie: chocolate=chip
X-Files: Mulder
X-Men: cyclops, iceman



# CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
# ignore them
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/


/********* Sample code generated by the curl command line tool **********
 * All curl_easy_setopt() options are documented at:
 * http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
 ************************************************************************/
#include 

int main(int argc, char *argv[])
{
  CURLcode ret;
  CURL *hnd;
  struct curl_slist *slist1;

  slist1 = NULL;
  slist1 = curl_slist_append(slist1, "X-Files: Mulder");
  slist1 = curl_slist_append(slist1, "X-Men: cyclops, iceman");

  hnd = curl_easy_init();
  curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1401");
  curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
  curl_easy_setopt(hnd, CURLOPT_USERPWD, "fake:user");
  curl_easy_setopt(hnd, CURLOPT_USERAGENT, "MyUA");
  curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, slist1);
  curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
  curl_easy_setopt(hnd, CURLOPT_HTTPAUTH, (long)CURLAUTH_BASIC);
  curl_easy_setopt(hnd, CURLOPT_COOKIE, "chocolate=chip");
  curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
  curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
  curl_easy_setopt(hnd, CURLOPT_PROTOCOLS, (long)CURLPROTO_FILE |
                                           (long)CURLPROTO_FTP |
                                           (long)CURLPROTO_HTTP);

  /* Here is a list of options the curl code used that cannot get generated
     as source easily. You may select to either not use them or implement
     them yourself.

  CURLOPT_WRITEDATA set to a objectpointer
  CURLOPT_WRITEFUNCTION set to a functionpointer
  CURLOPT_READDATA set to a objectpointer
  CURLOPT_READFUNCTION set to a functionpointer
  CURLOPT_SEEKDATA set to a objectpointer
  CURLOPT_SEEKFUNCTION set to a functionpointer
  CURLOPT_ERRORBUFFER set to a objectpointer
  CURLOPT_STDERR set to a objectpointer
  CURLOPT_DEBUGFUNCTION set to a functionpointer
  CURLOPT_DEBUGDATA set to a objectpointer
  CURLOPT_HEADERFUNCTION set to a functionpointer
  CURLOPT_HEADERDATA set to a objectpointer

  */

  ret = curl_easy_perform(hnd);

  curl_easy_cleanup(hnd);
  hnd = NULL;
  curl_slist_free_all(slist1);
  slist1 = NULL;

  return (int)ret;
}
/**** End of sample code ****/





curl-7.35.0/tests/data/test10550000644000175000017500000000250712213173003012760 00000000000000


HTTP
HTTP PUT
followlocation
FTP
EPSV
STOR



#
# Server-side


HTTP/1.1 307 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Location: ftp://127.0.0.1:8992/1055
Content-Length: 0
Connection: close




#
# Client-side


http
ftp

 
HTTP PUT Location: redirect to FTP URL
 
 
http://%HOSTIP:%HTTPPORT/1055 -L -T log/test1055.txt

# The data section doesn't do variable substitution, so we must assert this

perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%FTPPORT' ne '8992' );"


Weird
     file
         to
   upload
for
   testing
the
   PUT
      feature



#
# Verify data after the test has been "shot"


^User-Agent:.*


PUT /1055 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 78
Expect: 100-continue

Weird
     file
         to
   upload
for
   testing
the
   PUT
      feature
USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
STOR 1055
QUIT


Weird
     file
         to
   upload
for
   testing
the
   PUT
      feature



curl-7.35.0/tests/data/test970000644000175000017500000000131012213173003012614 00000000000000


HTTP
HTTP POST
HTTP replaced headers


#
# Server-side


HTTP/1.0 200 OK
Server: test-server/fake
Content-Type: text/html
Content-Length: 6

blaha



#
# Client-side


http

 
HTTP POST with custom content-type
 
 
 -d "hejsanallabarn" -H "Content-Type: silly/type" http://%HOSTIP:%HTTPPORT/97



#
# Verify data after the test has been "shot"


^User-Agent:.*


POST /97 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Type: silly/type
Content-Length: 14

hejsanallabarn



curl-7.35.0/tests/data/test6210000644000175000017500000000112112213173003012665 00000000000000


SCP
FAILURE



#
# Client-side


scp

 
SCP retrieval of missing file followed by good file
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: scp://%HOSTIP:%SSHPORT%PWD/log/not-a-valid-file-moooo scp://%HOSTIP:%SSHPORT%PWD/log/file621.txt --insecure


Test data
for ssh test



#
# Verify data after the test has been "shot"


disable


Test data
for ssh test



curl-7.35.0/tests/data/test3040000644000175000017500000000652112213173003012674 00000000000000


HTTPS
HTTP POST



# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 10

blablabla



# Client-side


SSL


https

 
HTTPS multipart formpost
 
 
-k https://%HOSTIP:%HTTPSPORT/we/want/304 -F name=daniel -F tool=curl -F file=@log/test304.txt

# We create this file before the command is invoked!

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa



# Verify data after the test has been "shot"


^(User-Agent:|Content-Type: multipart/form-data;|------).*


POST /we/want/304 HTTP/1.1
User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPSPORT
Accept: */*
Content-Length: 1386
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------c3b2ef7f0bb8

------------------------------c3b2ef7f0bb8
Content-Disposition: form-data; name="name"

daniel
------------------------------c3b2ef7f0bb8
Content-Disposition: form-data; name="tool"

curl
------------------------------c3b2ef7f0bb8
Content-Disposition: form-data; name="file"; filename="test304.txt"
Content-Type: text/plain

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

------------------------------c3b2ef7f0bb8--



curl-7.35.0/tests/data/test2720000644000175000017500000000076212213173003012701 00000000000000


FTP
PASV
RETR


# Server-side


213 20040101121212



# Client-side


ftp

 
FTP timed conditioned get file with identical time stamp 
 
 
ftp://%HOSTIP:%FTPPORT/272 -z "2004 jan 1 12:12:12 UTC"




# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
MDTM 272
QUIT



curl-7.35.0/tests/data/test5260000644000175000017500000000153412213173003012701 00000000000000


FTP
PASV
RETR
multi



# Server-side


file contents should appear once for each file


file contents should appear once for each file
file contents should appear once for each file
file contents should appear once for each file
file contents should appear once for each file



# Client-side


ftp


lib526

 
FTP RETR same file using different handles but same connection
 
 
ftp://%HOSTIP:%FTPPORT/path/526



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE 526
RETR 526
EPSV
SIZE 526
RETR 526
EPSV
SIZE 526
RETR 526
EPSV
SIZE 526
RETR 526
QUIT



curl-7.35.0/tests/data/test6290000644000175000017500000000064512213173003012707 00000000000000


SCP
FAILURE



#
# Client-side


scp

 
SCP invalid user login (password authentication)
 
 
-u not-a-valid-user: scp://%HOSTIP:%SSHPORT%PWD/irrelevant-file --insecure



#
# Verify data after the test has been "shot"


67


disable



curl-7.35.0/tests/data/test6310000644000175000017500000000076612213173003012704 00000000000000


SCP
FAILURE
server key check



#
# Client-side


scp

 
SCP incorrect host key
 
 
--hostpubmd5 00000000000000000000000000000000 --key curl_client_key --pubkey curl_client_key.pub -u %USER: scp://%HOSTIP:%SSHPORT%PWD/log/irrelevant-file --insecure



#
# Verify data after the test has been "shot"


51


disable



curl-7.35.0/tests/data/test7000000644000175000017500000000137612213173003012677 00000000000000


HTTP
HTTP GET
SOCKS4



#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes

-foo-



#
# Client-side


http
socks4

 
HTTP GET via SOCKS4 proxy
 
 
--socks4 %HOSTIP:%SOCKSPORT http://%HOSTIP:%HTTPPORT/700



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /700 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test12100000644000175000017500000000157512213173003012755 00000000000000


HTTP
HTTP GET
-J



#


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html

12345



#
# Client-side

# this relies on the debug feature to allow us to set directory to store the
# -O output in, using the CURL_TESTDIR variable

debug


http


HTTP GET with -J without Content-Disposition


CURL_TESTDIR=%PWD/log


http://%HOSTIP:%HTTPPORT/1210 -J -O



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1210 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*



12345




curl-7.35.0/tests/data/test6240000644000175000017500000000141212213173003012673 00000000000000


SFTP
SFTP put
--ftp-create-dirs



#
# Server-side



#
# Client-side


sftp

 
SFTP put with --ftp-create-dirs
 
 
--ftp-create-dirs --key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file624.txt sftp://%HOSTIP:%SSHPORT%PWD/log/test624.dir/upload.624 --insecure


perl %SRCDIR/libtest/test610.pl move %PWD/log/test624.dir/upload.624 %PWD/log/upload.624 rmdir %PWD/log/test624.dir


Test data
for ssh upload test



#
# Verify data after the test has been "shot"


Test data
for ssh upload test


disable



curl-7.35.0/tests/data/test5500000644000175000017500000000171212213173003012674 00000000000000


FTP
HTTP proxy
CURLOPT_PROXY_TRANSFER_MODE
CURLOPT_PROXY



#
# Server-side


HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6

hello



#
# Client-side


http


ftp


lib549

 
FTP RETR over proxy with CURLOPT_PROXY_TRANSFER_MODE and ASCII transfer
 
# first URL then proxy
 
ftp://www.example.com/moo/550 http://%HOSTIP:%HTTPPORT ascii



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET ftp://www.example.com/moo/550;type=a HTTP/1.1
Host: www.example.com:21
Accept: */*
Proxy-Connection: Keep-Alive



hello



curl-7.35.0/tests/data/test13370000644000175000017500000000244412213173003012763 00000000000000


HTTP
HTTP GET



#


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1337; charset=funny; option=strange

12345



#
# Client-side

# this relies on the debug feature to allow us to set directory to store the
# -O output in, using the CURL_TESTDIR variable

debug


http


HTTP GET with -O and Content-Disposition, -D stdout


CURL_TESTDIR=%PWD/log


http://%HOSTIP:%HTTPPORT/1337 -O -D -


perl %SRCDIR/libtest/notexists.pl log/name1337



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1337 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




12345



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1337; charset=funny; option=strange





curl-7.35.0/tests/data/test19010000644000175000017500000000162712271275507013002 00000000000000


HTTP
pipelining
multi



# Server-side


Adding handle 0
Handle 0 Completed with status 0
Adding handle 1
Adding handle 2
Adding handle 3
Adding handle 4
Adding handle 5
Adding handle 6
Handle 2 Completed with status 0
Handle 3 Completed with status 0
Handle 4 Completed with status 0
Handle 1 Completed with status 0
Handle 5 Completed with status 0
Handle 6 Completed with status 0



# Client-side


http-pipe


http


lib1900

 
HTTP GET using pipelining, blacklisted site
 
 
http://%HOSTIP:%HTTPPIPEPORT/


blacklist_site 127.0.0.1:%HTTPPIPEPORT
0 1k.txt
1000 100k.txt
0 1k.txt
0 1k.txt
0 1k.txt
0 1k.txt
0 1k.txt



# Verify data after the test has been "shot"



curl-7.35.0/tests/data/test5380000644000175000017500000000114012213173003012675 00000000000000


FTP
FAILURE
multi



# Server-side


REPLY PASS 314 bluah you f00l!



# Client-side


ftp

# NOTE that we use the 504 tool for this case

lib504

 
FTP multi-interface download, failed login: PASS not valid
 
 
ftp://%HOSTIP:%FTPPORT/538



# Verify data after the test has been "shot"
# TEST_ERR_SUCCESS is errorcode 120


120


USER anonymous
PASS ftp@example.com



curl-7.35.0/tests/data/test10540000644000175000017500000000243612213173003012760 00000000000000


HTTP
HTTP POST
followlocation



#
# Server-side


HTTP/1.1 301 OK swsclose
Location: moo/testcase/10540002
Date: Thu, 31 Jul 2008 14:49:00 GMT
Connection: close



HTTP/1.1 200 OK swsclose
Date: Thu, 31 Jul 2008 14:49:00 GMT
Connection: close

body


HTTP/1.1 301 OK swsclose
Location: moo/testcase/10540002
Date: Thu, 31 Jul 2008 14:49:00 GMT
Connection: close

HTTP/1.1 200 OK swsclose
Date: Thu, 31 Jul 2008 14:49:00 GMT
Connection: close

body



#
# Client-side


http

 
HTTP POST from file with 301 redirect and --post301
 

field=data

 
http://%HOSTIP:%HTTPPORT/blah/1054 -L -d @log/test1054.txt --post301



#
# Verify data after the test has been "shot"


^User-Agent:.*


POST /blah/1054 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 10
Content-Type: application/x-www-form-urlencoded

field=dataPOST /blah/moo/testcase/10540002 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 10
Content-Type: application/x-www-form-urlencoded

field=data



curl-7.35.0/tests/data/test1470000644000175000017500000000144712213173003012703 00000000000000


FTP



# Server-side


foo


REPLY CWD 550 I won't allow this on my server
COUNT CWD 1



# Client-side


ftp

 
FTP with --ftp-create-dirs (failing CWD)
 
 
ftp://%HOSTIP:%FTPPORT/first/dir/here/147 --ftp-create-dirs



# Verify data after the test has been "shot"

# Strip all valid kinds of PORT and EPRT that curl can send

^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|


USER anonymous
PASS ftp@example.com
PWD
CWD first
MKD first
CWD first
CWD dir
CWD here
EPSV
TYPE I
SIZE 147
RETR 147
QUIT



curl-7.35.0/tests/data/test13580000644000175000017500000000351712270035364013002 00000000000000


FTP
RETR



# Server-side

# file1358 contents...

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1358; charset=funny; option=strange

MOOOO



# Client-side

# this relies on the debug feature to allow us to set directory to store the
# -O output in, using the CURL_TESTDIR variable

debug


ftp


FTP download, file with C-D inside, using -O -D stdout


CURL_TESTDIR=%PWD/log


ftp://%HOSTIP:%FTPPORT/path/file1358 -O -D -


perl %SRCDIR/libtest/notexists.pl log/name1358



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1358
RETR file1358
QUIT



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1358; charset=funny; option=strange

MOOOO



220-        _   _ ____  _     
220-    ___| | | |  _ \| |    
220-   / __| | | | |_) | |    
220-  | (__| |_| |  _ {| |___ 
220    \___|\___/|_| \_\_____|
331 We are happy you popped in!
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 214
150 Binary data connection for 1358 () (214 bytes).
226 File transfer complete


s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/




curl-7.35.0/tests/data/test380000644000175000017500000000202212213173003012610 00000000000000


HTTP
HTTP GET
Resume
FAILURE


# Server-side


HTTP/1.0 200 Mooo
Date: Mon, 13 Nov 2000 13:41:09 GMT
Server: myown/1.0
Connection: close

todelooooo lalalala yada yada, we know nothing about ranges ;-)



# Client-side


http

 
HTTP resume request without server supporting it
 
 
http://%HOSTIP:%HTTPPORT/want/38 -C - --no-include -o log/fewl.txt


This text is here to simulate a partly downloaded file to resume
download on.



# Verify data after the test has been "shot"


33


^User-Agent:.*


GET /want/38 HTTP/1.1
Range: bytes=78-
Host: %HOSTIP:%HTTPPORT
Accept: */*



# the download target file must remain untouched

This text is here to simulate a partly downloaded file to resume
download on.



curl-7.35.0/tests/data/test6260000644000175000017500000000110312213173003012672 00000000000000


SFTP
pre-quote
FAILURE



#
# Server-side



#
# Client-side


sftp

 
SFTP invalid quote command
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "invalid-command foo bar" sftp://%HOSTIP:%SSHPORT%PWD/log/file626.txt --insecure


Test file for rename test



#
# Verify data after the test has been "shot"


21


disable



curl-7.35.0/tests/data/test15090000644000175000017500000000265012213173003012763 00000000000000


HTTP
HTTP GET
HTTP CONNECT
HTTP proxy
proxytunnel



# Server-side


connection-monitor


HTTP/1.1 200 Mighty fine indeed
Server: the beast that eats naughty clients




HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"



HTTP/1.1 200 Mighty fine indeed
Server: the beast that eats naughty clients

HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"

header length is ........: 239
header length should be..: 239



# Client-side


http
http-proxy

# tool is what to use instead of 'curl'

lib1509


 
simple multi http:// through proxytunnel with authentication info
 
 
http://the.old.moo.1509:%HTTPPORT/1509 %HOSTIP:%PROXYPORT


foo
   bar
bar
   foo
moo



# Verify data after the test has been "shot"


CONNECT the.old.moo.1509:%HTTPPORT HTTP/1.1
Host: the.old.moo.1509:%HTTPPORT
Proxy-Connection: Keep-Alive



GET /1509 HTTP/1.1
Host: the.old.moo.1509:%HTTPPORT
Accept: */*

[DISCONNECT]



curl-7.35.0/tests/data/test9340000644000175000017500000000153212270035364012714 00000000000000


SMTP
SMTP AUTH DIGEST-MD5 SASL CANCELLATION
RFC2831
RFC4954



#
# Server-side


AUTH DIGEST-MD5
REPLY AUTH 334 Rubbish
REPLY * 501 AUTH exchange cancelled by client



#
# Client-side


smtp


debug
crypto

 
SMTP DIGEST-MD5 graceful cancellation
 
 
smtp://%HOSTIP:%SMTPPORT/934 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret -T -



#
# Verify data after the test has been "shot"

# 67 - CURLE_LOGIN_DENIED

67

#
# The multi interface considers a broken "CONNECT" as a prematurely broken
# transfer and such a connection will not get a "QUIT"

EHLO 934
AUTH DIGEST-MD5
*



curl-7.35.0/tests/data/test5650000644000175000017500000000355012213173003012704 00000000000000


HTTP
HTTP POST
HTTP Digest auth


#
# Server-side


HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Date: Sun, 03 Apr 2005 14:57:45 GMT
X-Powered-By: ASP.NET

HTTP/1.1 401 authentication please swsbounce
Server: Microsoft-IIS/6.0
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 0



HTTP/1.1 200 A OK
Server: Microsoft-IIS/6.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 3

ok


HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Date: Sun, 03 Apr 2005 14:57:45 GMT
X-Powered-By: ASP.NET

HTTP/1.1 401 authentication please swsbounce
Server: Microsoft-IIS/6.0
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 0

HTTP/1.1 200 A OK
Server: Microsoft-IIS/6.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 3

ok



# Client-side


http

# tool is what to use instead of 'curl'

lib565


 
send HTTP POST using read callback, chunked transfer-encoding and Digest
 
 
http://%HOSTIP:%HTTPPORT/565



#
# Verify data after the test has been "shot"


POST /565 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Transfer-Encoding: chunked
Content-Type: application/x-www-form-urlencoded

0

POST /565 HTTP/1.1
Authorization: Digest username="foo", realm="testrealm", nonce="1053604144", uri="/565", response="877424f750af047634dbd94f9933217b"
Host: %HOSTIP:%HTTPPORT
Accept: */*
Transfer-Encoding: chunked
Content-Type: application/x-www-form-urlencoded
Expect: 100-continue

3
one
3
two
5
three
1d
and a final longer crap: four
0




curl-7.35.0/tests/data/test8670000644000175000017500000000140512262353672012726 00000000000000


POP3
POP3 AUTH CRAM-MD5
RFC1734
RFC2195
RFC5034



#
# Server-side


AUTH CRAM-MD5
REPLY AUTH + PDE5NzIuOTg3NjU0MzIxQGN1cmw+
REPLY dXNlciA3MDMxNzI1NTk5ZmRiYjVkNDEyNjg5YWEzMjNlM2UwYg== +OK Login successful


From: me@somewhere
To: fake@nowhere

body

--
  yours sincerely



#
# Client-side


pop3


crypto

 
POP3 CRAM-MD5 authentication
 
 
pop3://%HOSTIP:%POP3PORT/867 -u user:secret



#
# Verify data after the test has been "shot"


CAPA
AUTH CRAM-MD5
dXNlciA3MDMxNzI1NTk5ZmRiYjVkNDEyNjg5YWEzMjNlM2UwYg==
RETR 867
QUIT



curl-7.35.0/tests/data/test2400000644000175000017500000000135312213173003012671 00000000000000


HTTP
HTTP GET
IPv6


#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes

-foo-



#
# Client-side


ipv6


http-ipv6

 
HTTP-IPv6 GET
 
 
-g "http://%HOST6IP:%HTTP6PORT/240"



#
# Verify data after the test has been "shot"


^User-Agent:


GET /240 HTTP/1.1
Host: %HOST6IP:%HTTP6PORT
Accept: */*




curl-7.35.0/tests/data/test10780000644000175000017500000000310412213173003012757 00000000000000


HTTP
HTTP/1.0
HTTP GET
HTTP CONNECT
HTTP proxy
proxytunnel



#
# Server-side


HTTP/1.1 200 Mighty fine indeed
Server: test tunnel 2000




HTTP/1.0 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Type: text/html
Funny-head: yesyes
Content-Length: 9
Connection: keep-alive

contents



#
# Client-side


http
http-proxy

 
HTTP 1.0 CONNECT with proxytunnel and downgrade GET to HTTP/1.0
 
 
--proxy1.0 %HOSTIP:%PROXYPORT -p http://%HOSTIP.1078:%HTTPPORT/we/want/that/page/1078 http://%HOSTIP.1078:%HTTPPORT/we/want/that/page/1078



#
# Verify data after the test has been "shot"


^User-Agent:.*


CONNECT %HOSTIP.1078:%HTTPPORT HTTP/1.0
Host: %HOSTIP.1078:%HTTPPORT
Proxy-Connection: Keep-Alive



GET /we/want/that/page/1078 HTTP/1.1
Host: %HOSTIP.1078:%HTTPPORT
Accept: */*

GET /we/want/that/page/1078 HTTP/1.0
Host: %HOSTIP.1078:%HTTPPORT
Accept: */*



HTTP/1.1 200 Mighty fine indeed
Server: test tunnel 2000

HTTP/1.0 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Type: text/html
Funny-head: yesyes
Content-Length: 9
Connection: keep-alive

contents
HTTP/1.0 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Type: text/html
Funny-head: yesyes
Content-Length: 9
Connection: keep-alive

contents



curl-7.35.0/tests/data/test5860000644000175000017500000000117212213173003012705 00000000000000


FTP
PASV
CURLOPT_PORT


#
# Server-side


line 1
line 2
last line


[OPEN] counter: 1
[OPEN] counter: 2
line 1
line 2
last line
[CLOSE] counter: 2
[CLOSE] counter: 1



#
# Client-side


ftp


lib585

 
FTP and open/close socket callbacks
 
 
ftp://%HOSTIP:%FTPPORT/586



#
# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
SIZE 586
RETR 586
QUIT



curl-7.35.0/tests/data/test5440000644000175000017500000000136212262353672012720 00000000000000


HTTP
HTTP POST



#
# Server-side


HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 3

OK



# Client-side


http

# tool is what to use instead of 'curl'

lib544


 
HTTP POST text data using CURLOPT_COPYPOSTFIELDS
 
 
http://%HOSTIP:%HTTPPORT/544



#
# Verify data after the test has been "shot"


^User-Agent:.*


POST /544 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 4
Content-Type: application/x-www-form-urlencoded

This



curl-7.35.0/tests/data/test120000644000175000017500000000161412213173003012606 00000000000000


HTTP
HTTP GET
Content-Range



# Server-side


HTTP/1.1 206 Partial Content
Date: Mon, 13 Nov 2000 13:41:09 GMT
Server: Apache/1.3.11 (Unix) PHP/3.0.14
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 101
Content-Range: bytes 100-200/3527
Connection: close
Content-Type: text/html

..partial data returned from the
server as a result of setting an explicit byte range
in the request



# Client-side


http

 
HTTP range support
 
 
http://%HOSTIP:%HTTPPORT/want/12 -r 100-200



# Verify data after the test has been "shot"


^User-Agent:.*


GET /want/12 HTTP/1.1
Range: bytes=100-200
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test2090000644000175000017500000000613412270035364012712 00000000000000


HTTP
HTTP GET
HTTP CONNECT
HTTP proxy
HTTP proxy NTLM auth



# Server-side


# this is returned first since we get no proxy-auth

HTTP/1.1 407 Authorization Required to proxy me my dear
Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

And you should ignore this data.


# This is supposed to be returned when the server gets the second
# Authorization: NTLM line passed-in from the client

HTTP/1.1 200 Things are fine in proxy land
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1



# this is returned when we get a GET!

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 7
Connection: close
Content-Type: text/html
Funny-head: yesyes

daniel


# then this is returned when we get proxy-auth

HTTP/1.1 200 OK swsbounce
Server: no

Nice proxy auth sir!



HTTP/1.1 407 Authorization Required to proxy me my dear
Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

HTTP/1.1 200 Things are fine in proxy land
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 7
Connection: close
Content-Type: text/html
Funny-head: yesyes

daniel



# Client-side


http


NTLM
!SSPI

 
HTTP proxy CONNECT auth NTLM
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
http://test.remote.example.com.209:%HTTPPORT/path/2090002 --proxy http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-ntlm --proxytunnel


chkhostname curlhost



# Verify data after the test has been "shot"


^User-Agent: curl/.*


CONNECT test.remote.example.com.209:%HTTPPORT HTTP/1.1
Host: test.remote.example.com.209:%HTTPPORT
Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
Proxy-Connection: Keep-Alive

CONNECT test.remote.example.com.209:%HTTPPORT HTTP/1.1
Host: test.remote.example.com.209:%HTTPPORT
Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAKAeQjzKtCQ7ubW8S6MN7B59436GAxPu0CVROwwNBsgxML49gcbAXLT/bU+H5wrS9XNpbGx5Y3VybGhvc3Q=
Proxy-Connection: Keep-Alive

GET /path/2090002 HTTP/1.1
User-Agent: curl/7.12.3-CVS (i686-pc-linux-gnu) libcurl/7.12.3-CVS OpenSSL/0.9.6b zlib/1.1.4
Host: test.remote.example.com.209:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test2220000644000175000017500000001761712213173003012703 00000000000000


HTTP
HTTP GET
compressed


#
# Server-side


SFRUUC8xLjEgMjAwIE9LDQpEYXRlOiBNb24sIDI5IE5vdiAyMDA0IDIxOjU2OjUzIEdNVA0KU2Vy
dmVyOiBBcGFjaGUvMS4zLjMxIChEZWJpYW4gR05VL0xpbnV4KSBtb2RfZ3ppcC8xLjMuMjYuMWEg
UEhQLzQuMy45LTEgbW9kX3NzbC8yLjguMjAgT3BlblNTTC8wLjkuN2QgbW9kX3BlcmwvMS4yOQ0K
VmFyeTogQWNjZXB0LUVuY29kaW5nDQpDb250ZW50LVR5cGU6IHRleHQvaHRtbDsgY2hhcnNldD1J
U08tODg1OS0xDQpDb250ZW50LUVuY29kaW5nOiBkZWZsYXRlDQpDb250ZW50LUxlbmd0aDogMTMw
NQ0KDQp4nNxY227jNhB9N5B/YP3UArZuthM5cLQoctkEzTbB2gW6TwYt0TYbSRRIyrk89Ns7lCiJ
sRyvd4O+BEhicuacw+EMSZOZfHpKYrQhXFCWnnVdy+kikoYsounqrHszvev7/mjcd7ufgs7kl4u7
89m3+0uUcfYPCWU/pkICEE2/TWeXX1B3LWV2attLTsQ6IVhaKZH2AocPJI3sZdLXPNF3rKEVyagL
oltaQQehyqbaTW9Oo8A9dr2JbRhKRIQlmeMoIoAYj/2+4/c9FznDU8c99cYT2/AbhDxTH1HgOc6w
7zp910eOd+rBz0BTKsSrOFKckLlYMy6DMOdxHY5hb+OXeRwXcITTCMV00aYWEB0eEaGWOmdJUlJS
giRjtQDH/BktGUdhTEkq+4JGBP319RZJjlOxhIpaMItGyFDeGQyiAuFyBKVaqXBV3yWNiTjq5EJ1
1BjiOZX4yUI3Eok8y0BfoOvZ7L5X/J320BW0jzpXRfvi5nzWQ7PL2z8v4fP24neAXd3cXvaK4T/f
3V9ffoU2DPBIYoiplOpnTMiebubQChl7oEQU2ijPYoYjGAKWWp6QqJl1D2VYiEfGI9WEyNI8WRT2
6fT2qBMSLumShlBXMP1BOPiYKEOBajzBCMW0IBsZeyScREedxXOVpB6Sa/JmxquyWEed2RqoCMPv
gqZqMwlIbZ1qlWAGmw55zlEnxukqxysiihhIuqGcpQkMIEBHl9BYGxsqcUzl81yEjJNgdOIPrdHJ
xN6yb4EzwkOQDAaWe2xgK/MWGubzAHttbCALk17XLMtjzJuxjkdjiGEIy3nb0yJUA7oDy3dfEV6H
YjjKYJzRK7QRDsfFueFbI2di647pmYcsB13Prbza8ApTDuIPaowxgMgXIuQ0k3BEimCgTofXphIG
pU/D9Vzt5eCCLHEey4ltGksY1H9eHWAZlD3YeWhWJ6Wt1os9sVusRmzNEvK2ECxgyksVdXjaJkPr
1gKNply9HC4HYK2kaI3I4sU7XATAWkTRGpEXmh0uAmAtomiNSLiGPUZitjpcqqZowUaikeVZcrgg
gLWUojUiEVkcLgJgLaJojQgTT4eLAFiLKJpRLxGp8/IHalYSqrppurHMcw5pEyTQ67fqGoXZiB8o
yUZUxdgIQ0TdHA5XUWgtUxAbnYRyzvjhSiVea2myWdeEBVWtoFl6YgqHHKTgy83M/hudw+kBKaN5
gm5Lx8SuEBqvvqfknJOY1Jlrmef6/hacWK5nwQXpDfcbbHWvOjl2/FGLWF2w2hx1L9p9cdoFLOdi
75rMBM5RAhNeMzmXa/iqhpy1TCUS5xJuMqIOqexX3dqgT2CcUhKjqSQpfMOvJrbpbFGgSrvr/u8C
ryKiimwgW3TOYhLcPaaE17jCVEVqm6FWvWoJqy94ThOaYmnOTnK4IRS1gYLWnZbX8473uQd7ufuc
ru/v5bp7x4WlsT/qvW73eLjPPd5L9sd7vc5etzv6TtzfCWx/ZIPW2OX9brv8sCYyeDLBQwyuo7VO
bXxG8jkjZ11OQngdKJt6SdWLssGZG9lRQ+1y7CTqewu4T4aqGDtdO5nG46xF3X64vcWVVKoNBXa4
s6Nf9W3qt51aJbbeaQ3i7byx4t6G4/8vac5PZ2w4eGfG1Pvq4yfK9QYj9x2ZeoGn2MfP0sBzhifv
yNI1oUmE44+fqOFwNPDekaiwD0998TN5Miz6rK//KxR0/gMAAP//gjMRo2MAAAAA//8DAN04jtE=



HTTP/1.1 200 OK
Date: Mon, 29 Nov 2004 21:56:53 GMT
Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29
Vary: Accept-Encoding
Content-Type: text/html; charset=ISO-8859-1
Content-Encoding: deflate
Content-Length: 1305




  
    1612
    1998-08-21 04:01:29
    2004-10-18 02:22:23
    curl
    curl and libcurl
    Command line tool and library for client-side URL transfers.
    curl and libcurl is a tool for transferring files
using URL syntax. It supports HTTP, HTTPS, FTP,
FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as
well as HTTP-post, HTTP-put, cookies, FTP upload,
resumed transfers, passwords, portnumbers, SSL
certificates, Kerberos, and proxies. It is powered
by libcurl, the client-side URL transfer library.
There are bindings to libcurl for over 20
languages and environments.

    5784.57
    3.16
    169
    6594.54
    13.81
    105
    8.50
    21
    183
    323
    Default
    http://freshmeat.net/projects/curl/
    http://freshmeat.net/redir/curl/1612/url_homepage/
    http://freshmeat.net/redir/curl/1612/url_tgz/
    http://freshmeat.net/redir/curl/1612/url_bz2/
    http://freshmeat.net/redir/curl/1612/url_zip/
    http://freshmeat.net/redir/curl/1612/url_changelog/
    http://freshmeat.net/redir/curl/1612/url_rpm/
    http://freshmeat.net/redir/curl/1612/url_deb/
    http://freshmeat.net/redir/curl/1612/url_osx/
    http://freshmeat.net/redir/curl/1612/url_bsdport/
    
    http://freshmeat.net/redir/curl/1612/url_cvs/
    http://freshmeat.net/redir/curl/1612/url_list/
    http://freshmeat.net/redir/curl/1612/url_mirror/
    
    MIT/X Consortium License
    
      7.12.2
      176085
      2004-10-18 02:22:23
    
    
    
      
        Daniel Stenberg
        http://freshmeat.net/~bagder/
        Owner
      
    
    
      12
      226
      3
      2
      188
      216
      200
      220
      164
      90
      89
      809
      150
      224
      900
      839
    
    
      
        0
        7464
        7464
        OpenSSL (Default)
      
      
        0
        0
        7443
        OpenLDAP
      
      
        0
        0
        12351
        zlib
      
      
        0
        0
        32047
        Heimdal
      
      
        0
        0
        44532
        c-ares
      
    
  





#
# Client-side


libz


http

 
HTTP GET deflate compressed content
 
 
http://%HOSTIP:%HTTPPORT/222 --compressed



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /222 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Accept-Encoding: deflate, gzip




curl-7.35.0/tests/data/test7080000644000175000017500000000143312213173003012701 00000000000000


HTTP
HTTP GET
SOCKS4



#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes

-foo-



#
# Client-side


http
socks4


all_proxy=socks4://%HOSTIP:%SOCKSPORT

 
HTTP GET via SOCKS4 proxy
 
 
http://%HOSTIP:%HTTPPORT/708



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /708 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test8720000644000175000017500000000123512262353672012723 00000000000000


POP3
POP3 AUTH LOGIN SASL-IR 
RFC1734
RFC5034



#
# Server-side


AUTH LOGIN
REPLY AUTH + UGFzc3dvcmQ6
REPLY c2VjcmV0 +OK Login successful


From: me@somewhere
To: fake@nowhere

body

--
  yours sincerely



#
# Client-side


pop3

 
POP3 login authentication with initial response
 
 
pop3://%HOSTIP:%POP3PORT/872 -u user:secret --sasl-ir



#
# Verify data after the test has been "shot"


CAPA
AUTH LOGIN dXNlcg==
c2VjcmV0
RETR 872
QUIT



curl-7.35.0/tests/data/test10010000644000175000017500000000414512213173003012747 00000000000000


HTTP
HTTP PUT
HTTP proxy
HTTP Digest auth
Resume
Content-Range
CUSTOMREQUEST



# Server-side


HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Date: Sun, 03 Apr 2005 14:57:45 GMT
X-Powered-By: ASP.NET

HTTP/1.1 401 authentication please swsbounce
Server: Microsoft-IIS/6.0
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 0



HTTP/1.1 200 A OK
Server: Microsoft-IIS/6.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 3

ok



HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Date: Sun, 03 Apr 2005 14:57:45 GMT
X-Powered-By: ASP.NET

HTTP/1.1 401 authentication please swsbounce
Server: Microsoft-IIS/6.0
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 0

HTTP/1.1 200 A OK
Server: Microsoft-IIS/6.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 3

ok




# Client-side

# 

http

 
HTTP POST --digest with PUT and resumed upload and modified method
 
 
http://%HOSTIP:%HTTPPORT/1001 -u auser:apasswd --digest -T log/1001 -x  http://%HOSTIP:%HTTPPORT -C 2 -X GET


test



# Verify data after the test has been "shot"


^User-Agent:.*


GET http://%HOSTIP:%HTTPPORT/1001 HTTP/1.1
Content-Range: bytes 2-4/5
User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
Host: %HOSTIP:%HTTPPORT
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 0
Expect: 100-continue

GET http://%HOSTIP:%HTTPPORT/1001 HTTP/1.1
Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/1001", response="6af4d89c952f4dd4cc215a6878dc499d"
Content-Range: bytes 2-4/5
Host: %HOSTIP:%HTTPPORT
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 3
Expect: 100-continue

st



curl-7.35.0/tests/data/test540000644000175000017500000000112212213173003012606 00000000000000


HTTP
HTTP GET
followlocation


# Server-side


HTTP/1.1 302 This is a weirdo text message swsclose
Connection: close
Location:  

This server reply is for testing



# Client-side


http

 
HTTP with blank Location:
 
 
http://%HOSTIP:%HTTPPORT/want/54 -L



# Verify data after the test has been "shot"


^User-Agent:.*


GET /want/54 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test2800000644000175000017500000000247512213173003012703 00000000000000


FTP
PASV
LIST
--ftp-alternative-to-user


#
# Server-side

# When doing LIST, we get the default list output hard-coded in the test
# FTP server

total 20
drwxr-xr-x   8 98       98           512 Oct 22 13:06 .
drwxr-xr-x   8 98       98           512 Oct 22 13:06 ..
drwxr-xr-x   2 98       98           512 May  2  1996 .NeXT
-r--r--r--   1 0        1             35 Jul 16  1996 README
lrwxrwxrwx   1 0        1              7 Dec  9  1999 bin -> usr/bin
dr-xr-xr-x   2 0        1            512 Oct  1  1997 dev
drwxrwxrwx   2 98       98           512 May 29 16:04 download.html
dr-xr-xr-x   2 0        1            512 Nov 30  1995 etc
drwxrwxrwx   2 98       1            512 Oct 30 14:33 pub
dr-xr-xr-x   5 0        1            512 Oct  1  1997 usr


REPLY USER 530 We don't like USER commands
COUNT USER 1



#
# Client-side


ftp

 
FTP --ftp-alternative-to-user on USER failure
 
 
ftp://%HOSTIP:%FTPPORT/280/ --ftp-alternative-to-user "USER replacement"



#
# Verify data after the test has been "shot"


USER anonymous
USER replacement
PASS ftp@example.com
PWD
CWD 280
EPSV
TYPE A
LIST
QUIT



curl-7.35.0/tests/data/test5190000644000175000017500000000223112262353672012716 00000000000000


HTTP
HTTP GET



#
# Server-side


HTTP/1.1 200 OK swsbounce
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 8

content


HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 9

content2


HTTP/1.1 200 OK swsbounce
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 8

content
HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 9

content2



# Client-side


http

# tool is what to use instead of 'curl'

lib519


 
GET same URL twice with different users
 
 
http://%HOSTIP:%HTTPPORT/519



#
# Verify data after the test has been "shot"


GET /519 HTTP/1.1
Authorization: Basic bW9uc3Rlcjp1bmRlcmJlZA==
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /519 HTTP/1.1
Authorization: Basic YW5vdGhlcm1vbnN0ZXI6aW53YXJkcm9iZQ==
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test10100000644000175000017500000000225112213173003012743 00000000000000


FTP
PASV
LIST


#
# Server-side

# When doing LIST, we get the default list output hard-coded in the test
# FTP server

total 20
drwxr-xr-x   8 98       98           512 Oct 22 13:06 .
drwxr-xr-x   8 98       98           512 Oct 22 13:06 ..
drwxr-xr-x   2 98       98           512 May  2  1996 .NeXT
-r--r--r--   1 0        1             35 Jul 16  1996 README
lrwxrwxrwx   1 0        1              7 Dec  9  1999 bin -> usr/bin
dr-xr-xr-x   2 0        1            512 Oct  1  1997 dev
drwxrwxrwx   2 98       98           512 May 29 16:04 download.html
dr-xr-xr-x   2 0        1            512 Nov 30  1995 etc
drwxrwxrwx   2 98       1            512 Oct 30 14:33 pub
dr-xr-xr-x   5 0        1            512 Oct  1  1997 usr



#
# Client-side


ftp

 
FTP dir list nocwd
 
 
ftp://%HOSTIP:%FTPPORT//list/this/path/1010/ --ftp-method nocwd



#
# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE A
LIST /list/this/path/1010/
QUIT



curl-7.35.0/tests/data/test2510000644000175000017500000000257512213173003012702 00000000000000


FTP



# Server-side

# When doing LIST, we get the default list output hard-coded in the test
# FTP server

total 20
drwxr-xr-x   8 98       98           512 Oct 22 13:06 .
drwxr-xr-x   8 98       98           512 Oct 22 13:06 ..
drwxr-xr-x   2 98       98           512 May  2  1996 .NeXT
-r--r--r--   1 0        1             35 Jul 16  1996 README
lrwxrwxrwx   1 0        1              7 Dec  9  1999 bin -> usr/bin
dr-xr-xr-x   2 0        1            512 Oct  1  1997 dev
drwxrwxrwx   2 98       98           512 May 29 16:04 download.html
dr-xr-xr-x   2 0        1            512 Nov 30  1995 etc
drwxrwxrwx   2 98       1            512 Oct 30 14:33 pub
dr-xr-xr-x   5 0        1            512 Oct  1  1997 usr


SLOWDOWN



# Client-side


ftp

 
FTP dir list, PORT with specified IP and slow response
 
 
ftp://%HOSTIP:%FTPPORT/ -P %CLIENTIP



# Verify data after the test has been "shot"

# Strip all valid kinds of PORT and EPRT that curl can send

^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|


USER anonymous
PASS ftp@example.com
PWD
PORT 127,0,0,1,243,212
TYPE A
LIST
QUIT



curl-7.35.0/tests/data/test13090000644000175000017500000006650412213173003012771 00000000000000


unittest
splay



#
# Client-side


none


unittest

 
splay unit tests
 

unit1309





Result:
      0.1013[3]
    0.1003[2]
      0.954[3]
  0.944[1]
0.934[0]
  0.895[1]
        0.885[4]
      0.875[3]
        0.836[4]
              0.826[7]
            0.816[6]
          0.777[5]
                  0.767[9]
                0.757[8]
              0.718[7]
                    0.708[10]
                  0.698[9]
                0.659[8]
                  0.649[9]
                    0.639[10]
                        0.600[12]
                          0.590[13]
                      0.580[11]
            0.541[6]
                  0.531[9]
                    0.521[10]
                0.472[8]
                  0.462[9]
              0.413[7]
    0.403[2]
      0.393[3]
          0.354[5]
        0.344[4]
          0.334[5]
              0.295[7]
            0.285[6]
              0.275[7]
                  0.236[9]
                0.226[8]
                  0.216[9]
                      0.177[11]
                        0.167[12]
                    0.157[10]
                      0.118[11]
                          0.108[13]
                        0.98[12]
                          0.59[13]
                              0.49[15]
                            0.39[14]
                              0.0[15]
Tree look:
      0.1013[3]
    0.1003[2]
      0.954[3]
  0.944[1]
0.934[0]
  0.895[1]
        0.885[4]
      0.875[3]
        0.836[4]
              0.826[7]
            0.816[6]
          0.777[5]
                  0.767[9]
                0.757[8]
              0.718[7]
                    0.708[10]
                  0.698[9]
                0.659[8]
                  0.649[9]
                    0.639[10]
                        0.600[12]
                          0.590[13]
                      0.580[11]
            0.541[6]
                  0.531[9]
                    0.521[10]
                0.472[8]
                  0.462[9]
              0.413[7]
    0.403[2]
      0.393[3]
          0.354[5]
        0.344[4]
          0.334[5]
              0.295[7]
            0.285[6]
              0.275[7]
                  0.236[9]
                0.226[8]
                  0.216[9]
                      0.177[11]
                        0.167[12]
                    0.157[10]
                      0.118[11]
                          0.108[13]
                        0.98[12]
                          0.59[13]
                              0.49[15]
                            0.39[14]
                              0.0[15]
remove pointer 7, payload 718
Tree look:
          0.1013[5]
        0.1003[4]
          0.954[5]
      0.944[3]
    0.934[2]
  0.895[1]
        0.885[4]
      0.875[3]
    0.836[2]
          0.826[5]
        0.816[4]
      0.777[3]
          0.767[5]
        0.757[4]
0.708[0]
    0.698[2]
      0.659[3]
        0.649[4]
          0.639[5]
              0.600[7]
                0.590[8]
            0.580[6]
  0.541[1]
          0.531[5]
            0.521[6]
        0.472[4]
          0.462[5]
      0.413[3]
    0.403[2]
      0.393[3]
          0.354[5]
        0.344[4]
          0.334[5]
              0.295[7]
            0.285[6]
              0.275[7]
                  0.236[9]
                0.226[8]
                  0.216[9]
                      0.177[11]
                        0.167[12]
                    0.157[10]
                      0.118[11]
                          0.108[13]
                        0.98[12]
                          0.59[13]
                              0.49[15]
                            0.39[14]
                              0.0[15]
remove pointer 8, payload 236
Tree look:
              0.1013[7]
            0.1003[6]
              0.954[7]
          0.944[5]
        0.934[4]
      0.895[3]
            0.885[6]
          0.875[5]
        0.836[4]
              0.826[7]
            0.816[6]
          0.777[5]
              0.767[7]
            0.757[6]
    0.708[2]
      0.698[3]
        0.659[4]
          0.649[5]
            0.639[6]
                0.600[8]
                  0.590[9]
              0.580[7]
  0.541[1]
            0.531[6]
              0.521[7]
          0.472[5]
            0.462[6]
        0.413[4]
      0.403[3]
    0.393[2]
          0.354[5]
        0.344[4]
      0.334[3]
            0.295[6]
          0.285[5]
        0.275[4]
0.226[0]
  0.216[1]
      0.177[3]
        0.167[4]
    0.157[2]
      0.118[3]
          0.108[5]
        0.98[4]
          0.59[5]
              0.49[7]
            0.39[6]
              0.0[7]
remove pointer 9, payload 777
Tree look:
            0.1013[6]
          0.1003[5]
            0.954[6]
        0.944[4]
      0.934[3]
    0.895[2]
        0.885[4]
      0.875[3]
  0.836[1]
      0.826[3]
    0.816[2]
0.767[0]
    0.757[2]
  0.708[1]
      0.698[3]
        0.659[4]
          0.649[5]
            0.639[6]
                0.600[8]
                  0.590[9]
              0.580[7]
    0.541[2]
                0.531[8]
                  0.521[9]
              0.472[7]
                0.462[8]
            0.413[6]
          0.403[5]
        0.393[4]
              0.354[7]
            0.344[6]
          0.334[5]
                0.295[8]
              0.285[7]
            0.275[6]
      0.226[3]
        0.216[4]
            0.177[6]
              0.167[7]
          0.157[5]
            0.118[6]
                0.108[8]
              0.98[7]
                0.59[8]
                    0.49[10]
                  0.39[9]
                    0.0[10]
remove pointer 10, payload 295
Tree look:
                0.1013[8]
              0.1003[7]
                0.954[8]
            0.944[6]
          0.934[5]
        0.895[4]
            0.885[6]
          0.875[5]
      0.836[3]
          0.826[5]
        0.816[4]
    0.767[2]
      0.757[3]
  0.708[1]
      0.698[3]
        0.659[4]
          0.649[5]
            0.639[6]
                0.600[8]
                  0.590[9]
              0.580[7]
    0.541[2]
                0.531[8]
                  0.521[9]
              0.472[7]
                0.462[8]
            0.413[6]
          0.403[5]
        0.393[4]
            0.354[6]
          0.344[5]
      0.334[3]
0.285[0]
    0.275[2]
  0.226[1]
    0.216[2]
        0.177[4]
          0.167[5]
      0.157[3]
        0.118[4]
            0.108[6]
          0.98[5]
            0.59[6]
                0.49[8]
              0.39[7]
                0.0[8]
remove pointer 11, payload 836
Tree look:
          0.1013[5]
        0.1003[4]
          0.954[5]
      0.944[3]
    0.934[2]
  0.895[1]
      0.885[3]
    0.875[2]
0.826[0]
    0.816[2]
  0.767[1]
      0.757[3]
    0.708[2]
          0.698[5]
            0.659[6]
              0.649[7]
                0.639[8]
                    0.600[10]
                      0.590[11]
                  0.580[9]
        0.541[4]
                    0.531[10]
                      0.521[11]
                  0.472[9]
                    0.462[10]
                0.413[8]
              0.403[7]
            0.393[6]
                0.354[8]
              0.344[7]
          0.334[5]
      0.285[3]
          0.275[5]
        0.226[4]
          0.216[5]
              0.177[7]
                0.167[8]
            0.157[6]
              0.118[7]
                  0.108[9]
                0.98[8]
                  0.59[9]
                      0.49[11]
                    0.39[10]
                      0.0[11]
remove pointer 12, payload 354
Tree look:
              0.1013[7]
            0.1003[6]
              0.954[7]
          0.944[5]
        0.934[4]
      0.895[3]
          0.885[5]
        0.875[4]
    0.826[2]
      0.816[3]
  0.767[1]
      0.757[3]
    0.708[2]
        0.698[4]
          0.659[5]
            0.649[6]
              0.639[7]
                  0.600[9]
                    0.590[10]
                0.580[8]
      0.541[3]
                0.531[8]
                  0.521[9]
              0.472[7]
                0.462[8]
            0.413[6]
          0.403[5]
        0.393[4]
0.344[0]
  0.334[1]
    0.285[2]
        0.275[4]
      0.226[3]
        0.216[4]
            0.177[6]
              0.167[7]
          0.157[5]
            0.118[6]
                0.108[8]
              0.98[7]
                0.59[8]
                    0.49[10]
                  0.39[9]
                    0.0[10]
remove pointer 13, payload 895
Tree look:
        0.1013[4]
      0.1003[3]
        0.954[4]
    0.944[2]
  0.934[1]
0.885[0]
    0.875[2]
  0.826[1]
      0.816[3]
    0.767[2]
          0.757[5]
        0.708[4]
            0.698[6]
              0.659[7]
                0.649[8]
                  0.639[9]
                      0.600[11]
                        0.590[12]
                    0.580[10]
          0.541[5]
                    0.531[10]
                      0.521[11]
                  0.472[9]
                    0.462[10]
                0.413[8]
              0.403[7]
            0.393[6]
      0.344[3]
        0.334[4]
          0.285[5]
              0.275[7]
            0.226[6]
              0.216[7]
                  0.177[9]
                    0.167[10]
                0.157[8]
                  0.118[9]
                      0.108[11]
                    0.98[10]
                      0.59[11]
                          0.49[13]
                        0.39[12]
                          0.0[13]
remove pointer 14, payload 413
Tree look:
            0.1013[6]
          0.1003[5]
            0.954[6]
        0.944[4]
      0.934[3]
    0.885[2]
      0.875[3]
  0.826[1]
      0.816[3]
    0.767[2]
          0.757[5]
        0.708[4]
          0.698[5]
            0.659[6]
              0.649[7]
                0.639[8]
                    0.600[10]
                      0.590[11]
                  0.580[9]
      0.541[3]
          0.531[5]
            0.521[6]
        0.472[4]
          0.462[5]
0.403[0]
    0.393[2]
  0.344[1]
    0.334[2]
      0.285[3]
          0.275[5]
        0.226[4]
          0.216[5]
              0.177[7]
                0.167[8]
            0.157[6]
              0.118[7]
                  0.108[9]
                0.98[8]
                  0.59[9]
                      0.49[11]
                    0.39[10]
                      0.0[11]
remove pointer 15, payload 954
Tree look:
    0.1013[2]
  0.1003[1]
0.944[0]
  0.934[1]
      0.885[3]
        0.875[4]
    0.826[2]
          0.816[5]
        0.767[4]
              0.757[7]
            0.708[6]
              0.698[7]
                0.659[8]
                  0.649[9]
                    0.639[10]
                        0.600[12]
                          0.590[13]
                      0.580[11]
          0.541[5]
              0.531[7]
                0.521[8]
            0.472[6]
              0.462[7]
      0.403[3]
          0.393[5]
        0.344[4]
          0.334[5]
            0.285[6]
                0.275[8]
              0.226[7]
                0.216[8]
                    0.177[10]
                      0.167[11]
                  0.157[9]
                    0.118[10]
                        0.108[12]
                      0.98[11]
                        0.59[12]
                            0.49[14]
                          0.39[13]
                            0.0[14]
remove pointer 16, payload 472
Tree look:
        0.1013[4]
      0.1003[3]
    0.944[2]
  0.934[1]
      0.885[3]
        0.875[4]
    0.826[2]
          0.816[5]
        0.767[4]
            0.757[6]
          0.708[5]
            0.698[6]
              0.659[7]
                0.649[8]
                  0.639[9]
                      0.600[11]
                        0.590[12]
                    0.580[10]
      0.541[3]
        0.531[4]
          0.521[5]
0.462[0]
  0.403[1]
      0.393[3]
    0.344[2]
      0.334[3]
        0.285[4]
            0.275[6]
          0.226[5]
            0.216[6]
                0.177[8]
                  0.167[9]
              0.157[7]
                0.118[8]
                    0.108[10]
                  0.98[9]
                    0.59[10]
                        0.49[12]
                      0.39[11]
                        0.0[12]
remove pointer 17, payload 1013
Tree look:
0.1003[0]
    0.944[2]
  0.934[1]
        0.885[4]
          0.875[5]
      0.826[3]
            0.816[6]
          0.767[5]
              0.757[7]
            0.708[6]
              0.698[7]
                0.659[8]
                  0.649[9]
                    0.639[10]
                        0.600[12]
                          0.590[13]
                      0.580[11]
        0.541[4]
          0.531[5]
            0.521[6]
    0.462[2]
      0.403[3]
          0.393[5]
        0.344[4]
          0.334[5]
            0.285[6]
                0.275[8]
              0.226[7]
                0.216[8]
                    0.177[10]
                      0.167[11]
                  0.157[9]
                    0.118[10]
                        0.108[12]
                      0.98[11]
                        0.59[12]
                            0.49[14]
                          0.39[13]
                            0.0[14]
remove pointer 18, payload 531
Tree look:
    0.1003[2]
      0.944[3]
  0.934[1]
        0.885[4]
          0.875[5]
      0.826[3]
          0.816[5]
        0.767[4]
            0.757[6]
          0.708[5]
            0.698[6]
              0.659[7]
                0.649[8]
                  0.639[9]
                      0.600[11]
                        0.590[12]
                    0.580[10]
    0.541[2]
0.521[0]
  0.462[1]
    0.403[2]
        0.393[4]
      0.344[3]
        0.334[4]
          0.285[5]
              0.275[7]
            0.226[6]
              0.216[7]
                  0.177[9]
                    0.167[10]
                0.157[8]
                  0.118[9]
                      0.108[11]
                    0.98[10]
                      0.59[11]
                          0.49[13]
                        0.39[12]
                          0.0[13]
remove pointer 19, payload 49
Tree look:
        0.1003[4]
          0.944[5]
      0.934[3]
            0.885[6]
              0.875[7]
          0.826[5]
              0.816[7]
            0.767[6]
                0.757[8]
              0.708[7]
                0.698[8]
                  0.659[9]
                    0.649[10]
                      0.639[11]
                          0.600[13]
                            0.590[14]
                        0.580[12]
        0.541[4]
    0.521[2]
  0.462[1]
      0.403[3]
        0.393[4]
    0.344[2]
        0.334[4]
      0.285[3]
            0.275[6]
          0.226[5]
        0.216[4]
              0.177[7]
                0.167[8]
            0.157[6]
          0.118[5]
                0.108[8]
              0.98[7]
            0.59[6]
0.39[0]
  0.0[1]
remove pointer 20, payload 590
Tree look:
    0.1003[2]
      0.944[3]
  0.934[1]
        0.885[4]
          0.875[5]
      0.826[3]
        0.816[4]
    0.767[2]
          0.757[5]
        0.708[4]
      0.698[3]
          0.659[5]
        0.649[4]
          0.639[5]
            0.600[6]
0.580[0]
    0.541[2]
  0.521[1]
    0.462[2]
          0.403[5]
            0.393[6]
        0.344[4]
            0.334[6]
          0.285[5]
                0.275[8]
              0.226[7]
            0.216[6]
                  0.177[9]
                    0.167[10]
                0.157[8]
              0.118[7]
                    0.108[10]
                  0.98[9]
                0.59[8]
      0.39[3]
        0.0[4]
remove pointer 21, payload 108
Tree look:
        0.1003[4]
          0.944[5]
      0.934[3]
            0.885[6]
              0.875[7]
          0.826[5]
            0.816[6]
        0.767[4]
              0.757[7]
            0.708[6]
          0.698[5]
              0.659[7]
            0.649[6]
              0.639[7]
                0.600[8]
    0.580[2]
      0.541[3]
  0.521[1]
    0.462[2]
          0.403[5]
            0.393[6]
        0.344[4]
          0.334[5]
      0.285[3]
              0.275[7]
            0.226[6]
          0.216[5]
              0.177[7]
                0.167[8]
            0.157[6]
        0.118[4]
0.98[0]
    0.59[2]
  0.39[1]
    0.0[2]
remove pointer 22, payload 649
Tree look:
      0.1003[3]
        0.944[4]
    0.934[2]
        0.885[4]
          0.875[5]
      0.826[3]
        0.816[4]
  0.767[1]
        0.757[4]
      0.708[3]
    0.698[2]
      0.659[3]
0.639[0]
    0.600[2]
  0.580[1]
      0.541[3]
    0.521[2]
        0.462[4]
              0.403[7]
                0.393[8]
            0.344[6]
              0.334[7]
          0.285[5]
                  0.275[9]
                0.226[8]
              0.216[7]
                  0.177[9]
                    0.167[10]
                0.157[8]
            0.118[6]
      0.98[3]
          0.59[5]
        0.39[4]
          0.0[5]
remove pointer 23, payload 167
Tree look:
          0.1003[5]
            0.944[6]
        0.934[4]
            0.885[6]
              0.875[7]
          0.826[5]
            0.816[6]
      0.767[3]
            0.757[6]
          0.708[5]
        0.698[4]
          0.659[5]
    0.639[2]
      0.600[3]
  0.580[1]
      0.541[3]
    0.521[2]
        0.462[4]
            0.403[6]
              0.393[7]
          0.344[5]
            0.334[6]
      0.285[3]
            0.275[6]
          0.226[5]
        0.216[4]
          0.177[5]
0.157[0]
  0.118[1]
    0.98[2]
        0.59[4]
      0.39[3]
        0.0[4]
remove pointer 24, payload 708
Tree look:
      0.1003[3]
        0.944[4]
    0.934[2]
        0.885[4]
          0.875[5]
      0.826[3]
        0.816[4]
  0.767[1]
    0.757[2]
0.698[0]
    0.659[2]
  0.639[1]
      0.600[3]
    0.580[2]
          0.541[5]
        0.521[4]
            0.462[6]
                0.403[8]
                  0.393[9]
              0.344[7]
                0.334[8]
          0.285[5]
                0.275[8]
              0.226[7]
            0.216[6]
              0.177[7]
      0.157[3]
        0.118[4]
          0.98[5]
              0.59[7]
            0.39[6]
              0.0[7]
remove pointer 25, payload 226
Tree look:
          0.1003[5]
            0.944[6]
        0.934[4]
            0.885[6]
              0.875[7]
          0.826[5]
            0.816[6]
      0.767[3]
        0.757[4]
    0.698[2]
      0.659[3]
  0.639[1]
      0.600[3]
    0.580[2]
          0.541[5]
        0.521[4]
          0.462[5]
              0.403[7]
                0.393[8]
            0.344[6]
              0.334[7]
      0.285[3]
        0.275[4]
0.216[0]
    0.177[2]
  0.157[1]
    0.118[2]
      0.98[3]
          0.59[5]
        0.39[4]
          0.0[5]
remove pointer 26, payload 767
Tree look:
    0.1003[2]
      0.944[3]
  0.934[1]
      0.885[3]
        0.875[4]
    0.826[2]
      0.816[3]
0.757[0]
  0.698[1]
      0.659[3]
    0.639[2]
          0.600[5]
        0.580[4]
              0.541[7]
            0.521[6]
              0.462[7]
                  0.403[9]
                    0.393[10]
                0.344[8]
                  0.334[9]
          0.285[5]
            0.275[6]
      0.216[3]
          0.177[5]
        0.157[4]
          0.118[5]
            0.98[6]
                0.59[8]
              0.39[7]
                0.0[8]
remove pointer 27, payload 285
Tree look:
        0.1003[4]
          0.944[5]
      0.934[3]
          0.885[5]
            0.875[6]
        0.826[4]
          0.816[5]
    0.757[2]
  0.698[1]
      0.659[3]
    0.639[2]
        0.600[4]
      0.580[3]
          0.541[5]
        0.521[4]
          0.462[5]
              0.403[7]
                0.393[8]
            0.344[6]
              0.334[7]
0.275[0]
  0.216[1]
      0.177[3]
    0.157[2]
      0.118[3]
        0.98[4]
            0.59[6]
          0.39[5]
            0.0[6]
remove pointer 28, payload 826
Tree look:
    0.1003[2]
      0.944[3]
  0.934[1]
    0.885[2]
      0.875[3]
0.816[0]
  0.757[1]
    0.698[2]
          0.659[5]
        0.639[4]
            0.600[6]
          0.580[5]
              0.541[7]
            0.521[6]
              0.462[7]
                  0.403[9]
                    0.393[10]
                0.344[8]
                  0.334[9]
      0.275[3]
        0.216[4]
            0.177[6]
          0.157[5]
            0.118[6]
              0.98[7]
                  0.59[9]
                0.39[8]
                  0.0[9]
remove pointer 29, payload 344
Tree look:
        0.1003[4]
          0.944[5]
      0.934[3]
        0.885[4]
          0.875[5]
    0.816[2]
  0.757[1]
    0.698[2]
          0.659[5]
        0.639[4]
          0.600[5]
      0.580[3]
            0.541[6]
          0.521[5]
        0.462[4]
          0.403[5]
            0.393[6]
0.334[0]
  0.275[1]
    0.216[2]
        0.177[4]
      0.157[3]
        0.118[4]
          0.98[5]
              0.59[7]
            0.39[6]
              0.0[7]
remove pointer 30, payload 885
Tree look:
    0.1003[2]
      0.944[3]
  0.934[1]
0.875[0]
  0.816[1]
    0.757[2]
        0.698[4]
              0.659[7]
            0.639[6]
              0.600[7]
          0.580[5]
                0.541[8]
              0.521[7]
            0.462[6]
              0.403[7]
                0.393[8]
      0.334[3]
        0.275[4]
          0.216[5]
              0.177[7]
            0.157[6]
              0.118[7]
                0.98[8]
                    0.59[10]
                  0.39[9]
                    0.0[10]
remove pointer 31, payload 403
Tree look:
        0.1003[4]
          0.944[5]
      0.934[3]
    0.875[2]
  0.816[1]
    0.757[2]
        0.698[4]
            0.659[6]
          0.639[5]
            0.600[6]
      0.580[3]
            0.541[6]
          0.521[5]
        0.462[4]
0.393[0]
  0.334[1]
    0.275[2]
      0.216[3]
          0.177[5]
        0.157[4]
          0.118[5]
            0.98[6]
                0.59[8]
              0.39[7]
                0.0[8]
remove pointer 32, payload 944
Tree look:
  0.1003[1]
0.934[0]
    0.875[2]
  0.816[1]
      0.757[3]
          0.698[5]
              0.659[7]
            0.639[6]
              0.600[7]
        0.580[4]
              0.541[7]
            0.521[6]
          0.462[5]
    0.393[2]
      0.334[3]
        0.275[4]
          0.216[5]
              0.177[7]
            0.157[6]
              0.118[7]
                0.98[8]
                    0.59[10]
                  0.39[9]
                    0.0[10]
remove pointer 33, payload 462
Tree look:
      0.1003[3]
    0.934[2]
      0.875[3]
  0.816[1]
      0.757[3]
        0.698[4]
            0.659[6]
          0.639[5]
            0.600[6]
    0.580[2]
        0.541[4]
      0.521[3]
0.393[0]
  0.334[1]
    0.275[2]
      0.216[3]
          0.177[5]
        0.157[4]
          0.118[5]
            0.98[6]
                0.59[8]
              0.39[7]
                0.0[8]
remove pointer 34, payload 1003
Tree look:
0.934[0]
    0.875[2]
  0.816[1]
        0.757[4]
          0.698[5]
              0.659[7]
            0.639[6]
              0.600[7]
      0.580[3]
          0.541[5]
        0.521[4]
    0.393[2]
      0.334[3]
        0.275[4]
          0.216[5]
              0.177[7]
            0.157[6]
              0.118[7]
                0.98[8]
                    0.59[10]
                  0.39[9]
                    0.0[10]
remove pointer 35, payload 521
Tree look:
    0.934[2]
      0.875[3]
  0.816[1]
      0.757[3]
        0.698[4]
            0.659[6]
          0.639[5]
            0.600[6]
    0.580[2]
      0.541[3]
0.393[0]
  0.334[1]
    0.275[2]
      0.216[3]
          0.177[5]
        0.157[4]
          0.118[5]
            0.98[6]
                0.59[8]
              0.39[7]
                0.0[8]
remove pointer 36, payload 39
Tree look:
        0.934[4]
          0.875[5]
      0.816[3]
          0.757[5]
            0.698[6]
                0.659[8]
              0.639[7]
                0.600[8]
        0.580[4]
          0.541[5]
    0.393[2]
  0.334[1]
      0.275[3]
    0.216[2]
          0.177[5]
        0.157[4]
      0.118[3]
        0.98[4]
          0.59[5]
0.0[0]
remove pointer 37, payload 580
Tree look:
    0.934[2]
      0.875[3]
  0.816[1]
    0.757[2]
      0.698[3]
          0.659[5]
        0.639[4]
          0.600[5]
0.541[0]
  0.393[1]
    0.334[2]
          0.275[5]
        0.216[4]
              0.177[7]
            0.157[6]
          0.118[5]
            0.98[6]
              0.59[7]
      0.0[3]
remove pointer 38, payload 98
Tree look:
        0.934[4]
          0.875[5]
      0.816[3]
        0.757[4]
          0.698[5]
              0.659[7]
            0.639[6]
              0.600[7]
    0.541[2]
  0.393[1]
    0.334[2]
          0.275[5]
        0.216[4]
            0.177[6]
          0.157[5]
      0.118[3]
0.59[0]
  0.0[1]
remove pointer 39, payload 639
Tree look:
      0.934[3]
        0.875[4]
    0.816[2]
  0.757[1]
    0.698[2]
      0.659[3]
0.600[0]
  0.541[1]
    0.393[2]
        0.334[4]
              0.275[7]
            0.216[6]
                0.177[8]
              0.157[7]
          0.118[5]
      0.59[3]
        0.0[4]
remove pointer 40, payload 157
Tree look:
          0.934[5]
            0.875[6]
        0.816[4]
      0.757[3]
        0.698[4]
          0.659[5]
    0.600[2]
  0.541[1]
    0.393[2]
      0.334[3]
          0.275[5]
        0.216[4]
          0.177[5]
0.118[0]
  0.59[1]
    0.0[2]
remove pointer 41, payload 698
Tree look:
      0.934[3]
        0.875[4]
    0.816[2]
  0.757[1]
0.659[0]
  0.600[1]
    0.541[2]
        0.393[4]
          0.334[5]
              0.275[7]
            0.216[6]
              0.177[7]
      0.118[3]
        0.59[4]
          0.0[5]
remove pointer 42, payload 216
Tree look:
          0.934[5]
            0.875[6]
        0.816[4]
      0.757[3]
    0.659[2]
  0.600[1]
    0.541[2]
        0.393[4]
      0.334[3]
        0.275[4]
0.177[0]
  0.118[1]
    0.59[2]
      0.0[3]
remove pointer 43, payload 757
Tree look:
    0.934[2]
      0.875[3]
  0.816[1]
0.659[0]
  0.600[1]
      0.541[3]
          0.393[5]
        0.334[4]
          0.275[5]
    0.177[2]
      0.118[3]
        0.59[4]
          0.0[5]
remove pointer 44, payload 275
Tree look:
        0.934[4]
          0.875[5]
      0.816[3]
    0.659[2]
  0.600[1]
      0.541[3]
        0.393[4]
    0.334[2]
0.177[0]
  0.118[1]
    0.59[2]
      0.0[3]
remove pointer 45, payload 816
Tree look:
  0.934[1]
    0.875[2]
0.659[0]
  0.600[1]
        0.541[4]
          0.393[5]
      0.334[3]
    0.177[2]
      0.118[3]
        0.59[4]
          0.0[5]
remove pointer 46, payload 334
Tree look:
      0.934[3]
        0.875[4]
    0.659[2]
  0.600[1]
    0.541[2]
      0.393[3]
0.177[0]
  0.118[1]
    0.59[2]
      0.0[3]
remove pointer 47, payload 875
Tree look:
  0.934[1]
0.659[0]
  0.600[1]
      0.541[3]
        0.393[4]
    0.177[2]
      0.118[3]
        0.59[4]
          0.0[5]
remove pointer 48, payload 393
Tree look:
      0.934[3]
    0.659[2]
  0.600[1]
    0.541[2]
0.177[0]
  0.118[1]
    0.59[2]
      0.0[3]
remove pointer 49, payload 934
Tree look:
0.659[0]
  0.600[1]
      0.541[3]
    0.177[2]
      0.118[3]
        0.59[4]
          0.0[5]
remove pointer 0, payload 0
Tree look:
  0.659[1]
0.600[0]
      0.541[3]
    0.177[2]
  0.118[1]
    0.59[2]
remove pointer 1, payload 541
Tree look:
    0.659[2]
  0.600[1]
0.177[0]
  0.118[1]
    0.59[2]
remove pointer 2, payload 59
Tree look:
      0.659[3]
    0.600[2]
  0.177[1]
0.118[0]
remove pointer 3, payload 600
Tree look:
  0.659[1]
0.177[0]
  0.118[1]
remove pointer 4, payload 118
Tree look:
  0.659[1]
0.177[0]
remove pointer 5, payload 659
Tree look:
0.177[0]
remove pointer 6, payload 177




curl-7.35.0/tests/data/test13100000644000175000017500000000742312213173003012754 00000000000000


HTTP
HTTP GET
HTTP NTLM auth


# Server-side





HTTP/1.1 401 Now gimme that second request of crap
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 34
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

This is not the real page either!


# This is supposed to be returned when the server gets the second
# Authorization: NTLM line passed-in from the client

HTTP/1.1 200 Things are fine in server land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!



HTTP/1.1 401 Now gimme that second request of crap
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 34
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

HTTP/1.1 200 Things are fine in server land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!




# Client-side


NTLM_WB
debug


http

 
HTTP with NTLM delegation to winbind helper
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
# set path to fake_auth instead of real ntlm_auth to generate NTLM type1 and type 3 messages
CURL_NTLM_WB_FILE=%PWD/server/fake_ntlm
# set source directory so fake_ntlm can find the test files
CURL_NTLM_AUTH_SRCDIR=%SRCDIR
# set the test number
CURL_NTLM_AUTH_TESTNUM=1310
 
 
http://%HOSTIP:%HTTPPORT/1310 -u testuser:anypasswd --ntlm-wb


chkhostname curlhost



# Verify data after the test has been "shot"


^User-Agent:.*


GET /1310 HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAA
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /1310 HTTP/1.1
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAE8AAAAYABgAZwAAAAAAAABAAAAACAAIAEAAAAAHAAcASAAAAAAAAAAAAAAAggEAAHRlc3R1c2VyVU5LTk9XTlpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOQ==
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*



# Input and output (type 1 message) for fake_ntlm


YR


YR TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAA


# Input and output (type 3 message) for fake_ntlm


TT TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==


KK TlRMTVNTUAADAAAAGAAYAE8AAAAYABgAZwAAAAAAAABAAAAACAAIAEAAAAAHAAcASAAAAAAAAAAAAAAAggEAAHRlc3R1c2VyVU5LTk9XTlpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOQ==



curl-7.35.0/tests/data/test4010000644000175000017500000000116512213173003012671 00000000000000


FTPS
EPSV
STOR



# Client-side


SSL


ftps

 
FTPS PASV upload file
 

data
    to
      see
that FTPS
works
  so does it?

 
-k --ftp-ssl-control ftps://%HOSTIP:%FTPSPORT/401 -T log/test401.txt



# Verify data after the test has been "shot"


data
    to
      see
that FTPS
works
  so does it?


USER anonymous
PASS ftp@example.com
PBSZ 0
PROT C
PWD
EPSV
TYPE I
STOR 401
QUIT



curl-7.35.0/tests/data/test5640000644000175000017500000000124112213173003012676 00000000000000


FTP
PASV
RETR
multi
SOCKS4


# Server-side


data
    to
      see
that FTP
works
  so does it?




# Client-side


ftp
socks4


lib564

 
FTP RETR a file over a SOCKS proxy using the multi interface
 

ftp://%HOSTIP:%FTPPORT/path/564 %HOSTIP:%SOCKSPORT



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE 564
RETR 564
QUIT


data
    to
      see
that FTP
works
  so does it?



curl-7.35.0/tests/data/test5370000644000175000017500000000166212262353672012725 00000000000000


HTTP
HTTP GET



#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes

-foo-



# Client-side


http


getrlimit

# tool is what to use instead of 'curl'

lib537

# precheck is a command line to run before the test, to see if we can execute
# the test or not

./libtest/lib537 check


 
HTTP GET with a HUGE number of file descriptors open
 
 
http://%HOSTIP:%HTTPPORT/537



#
# Verify data after the test has been "shot"


GET /537 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test2680000644000175000017500000000145012213173003012701 00000000000000


HTTP
HTTP POST


#
# Server-side


HTTP/1.0 200 OK
Server: test-server/fake
Content-Type: text/html
Content-Length: 0

this is data even though Content-Length is set to zero


HTTP/1.0 200 OK
Server: test-server/fake
Content-Type: text/html
Content-Length: 0




#
# Client-side


http

 
HTTP POST a non-existing file
 
 
 -d @nonesuchfile http://%HOSTIP:%HTTPPORT/268



#
# Verify data after the test has been "shot"


^User-Agent:.*


POST /268 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 0
Content-Type: application/x-www-form-urlencoded




curl-7.35.0/tests/data/Makefile.am0000644000175000017500000002066212270035364013613 00000000000000iall:
install:
test:

# this list is in numerical order
TESTCASES = test1 test2 test3 test4 test5 test6 test7 test8 test9       \
test10 test11 test12 test13 test14 test15 test16 test17 test18 test19   \
test20 test21 test22 test23 test24 test25 test26 test27 test28 test29   \
test30 test31 test32 test33 test34 test35 test36 test37 test38 test39   \
test40 test41 test42 test43 test44 test45 test46 test47 test48 test49   \
test50 test51 test52 test53 test54 test55 test56 test57 test58 test59   \
test60 test61 test62 test63 test64 test65 test66 test67 test68 test69   \
test70 test71 test72 test73 test74 test75 test76 test77 test78 test79   \
test80 test81 test82 test83 test84 test85 test86 test87 test88 test89   \
test90 test91 test92 test93 test94 test95 test96 test97 test98 test99   \
test100 test101 test102 test103 test104 test105 test106 test107 test108 \
test109 test110 test111 test112 test113 test114 test115 test116 test117 \
test118 test119 test120 test121 test122 test123 test124 test125 test126 \
test127 test128 test129 test130 test131 test132 test133 test134 test135 \
test136 test137 test138 test139 test140 test141 test142 test143 test144 \
test145 test146 test147 test148 test149 test150 test151 test152 test153 \
test154 test155 test156 test157 test158 test159 test160 test161 test162 \
test163 test164 test165 test166 test167 test168 test169 test170 test171 \
test172 test173 test174 test175 test176 test177 test178 test179 test180 \
test181 test182 test183 test184 test185 test186 test187 test188 test189 \
test190 test191 test192 test193 test194 test195 test196 test197 test198 \
test199 test200 test201 test202 test203 test204 test205 test206 test207 \
test208 test209 test210 test211 test212 test213 test214 test215 test216 \
test217 test218         test220 test221 test222 test223 test224 test225 \
test226 test227 test228 test229         test231         test233 test234 \
test235 test236 test237 test238 test239 test240 test241 test242 test243 \
        test245 test246 test247 test248 test249 test250 test251 test252 \
test253 test254 test255 test256 test257 test258 test259 test260 test261 \
test262 test263 test264 test265 test266 test267 test268 test269 test270 \
test271 test272 test273 test274 test275 test276 test277 test278 test279 \
test280 test281 test282 test283 test284 test285 test286 test287 test288 \
test289 test290 test291 test292 test293 test294 test295 test296 test297 \
test298 test299 test300 test301 test302 test303 test304 test305 test306 \
test307 test308 test309 test310 test311 test312 test313                 \
                                test320 test321 test322 test323 test324 \
test350 test351 test352 test353 test354 \
\
test400 test401 test402 test403 test404 test405 test406 test407 test408 \
test409 \
\
test500 test501 test502 test503 test504 test505 test506 test507 test508 \
test509 test510 test511 test512 test513 test514 test515 test516 test517 \
test518 test519 test520 test521 test522 test523 test524 test525 test526 \
test527 test528 test529 test530 test531 test532 test533 test534 test535 \
test536 test537 test538 test539 test540 test541 test542 test543 test544 \
test545 test546 test547 test548 test549 test550 test551 test552 test553 \
test554 test555 test556 test557 test558         test560 test561 test562 \
test563 test564 test565 test566 test567 test568 test569 test570 test571 \
test572 test573 test574 test575 test576         test578 test579 test580 \
test581 test582 test583 test584 test585 test586 test587 test588         \
test590 test591 test592 test593 test594 test595 test596 test597 test598 \
test599 test600 test601 test602 test603 test604 test605 test606 test607 \
test608 test609 test610 test611 test612 test613 test614 test615 test616 \
test617 test618 test619 test620 test621 test622 test623 test624 test625 \
test626 test627 test628 test629 test630 test631 test632 test633 test634 \
test635 test636 test637 test638 test639 \
\
test700 test701 test702 test703 test704 test705 test706 test707 test708 \
test709 test710 test711 test712 \
\
test800 test801 test802 test803 test804 test805 test806 test807 test808 \
test809 test810 test811 test812 test813 test814 test815 test816 test817 \
test818 test819 test820 test821 test822 test823 test824 test825 test826 \
test827 test828 test829 test830 test831 test832 test833 test834 test835 \
\
test850 test851 test852 test853 test854 test855 test856 test857 test858 \
test859 test860 test861 test862 test863 test864 test865 test866 test867 \
test868 test869 test870 test871 test872 test873 test874 test875 test876 \
test877 test878 test879 test880 test881 \
\
test900 test901 test902 test903 test904 test905 test906 test907 test908 \
test909 test910 test911 test912 test913 test914 test915 test916 test917 \
test918 test919 test920 test921 test922 test923 test924 test925 test926 \
test927 test928 test929 test930 test931 test932 test933 test934 test935 \
test936 test937 \
\
test1000 test1001 test1002 test1003 test1004 test1005 test1006 test1007 \
test1008 test1009 test1010 test1011 test1012 test1013 test1014 test1015 \
test1016 test1017 test1018 test1019 test1020 test1021 test1022 test1023 \
test1024 test1025 test1026 test1027 test1028 test1029 test1030 test1031 \
test1032 test1033 test1034 test1035 test1036 test1037 test1038 test1039 \
test1040 test1041 test1042 test1043 test1044 test1045 test1046 test1047 \
test1048 test1049 test1050 test1051 test1052 test1053 test1054 test1055 \
test1056 test1057 test1058 test1059 test1060 test1061 test1062 test1063 \
test1064 test1065 test1066 test1067 test1068 test1069 test1070 test1071 \
test1072 test1073 test1074 test1075 test1076 test1077 test1078 test1079 \
test1080 test1081 test1082 test1083 test1084 test1085 test1086 test1087 \
test1088 test1089 test1090 test1091 test1092 test1093 test1094 test1095 \
test1096 test1097 test1098 test1099 test1100 test1101 test1102 test1103 \
test1104 test1105 test1106 test1107 test1108 test1109 test1110 test1111 \
test1112 test1113 test1114 test1115 test1116 test1117 test1118 test1119 \
test1120 test1121 test1122 test1123 test1124 test1125 test1126 test1127 \
test1128 test1129 test1130 test1131 test1132 test1133 \
\
test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \
test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \
test1216 test1217 test1218 test1219 \
test1220 test1221 test1222 test1223 test1224 test1225 test1226 test1227 \
test1228 test1229 test1230 test1231 test1232 test1233 test1234 test1235 \
test1236 test1237 test1238 test1239 test1240 \
\
test1300 test1301 test1302 test1303 test1304 test1305 test1306 test1307 \
test1308 test1309 test1310 test1311 test1312 test1313 test1314 test1315 \
test1316 test1317 test1318 test1319 test1320 test1321                   \
         test1325 test1326 test1327 test1328 test1329 test1330 test1331 \
test1332 test1333 test1334 test1335 test1336 test1337 test1338 test1339 \
test1340 test1341 test1342 test1343 test1344 test1345 test1346 test1347 \
test1348 test1349 test1350 test1351 test1352 test1353 test1354 test1355 \
test1356 test1357 test1358 test1359 test1360 test1361 test1362 test1363 \
test1364 test1365 test1366 test1367 test1368 test1369 test1370 test1371 \
test1372 test1373 test1374 test1375 test1376 test1377 test1378 test1379 \
test1380 test1381 test1382 test1383 test1384 test1385 test1386 test1387 \
test1388 test1389 test1390 test1391 test1392 test1393 test1394 test1395 \
test1396 \
\
test1400 test1401 test1402 test1403 test1404 test1405 test1406 test1407 \
test1408 test1409 test1410          test1412 test1413 test1414 test1415 \
test1416 test1417 \
\
test1500 test1501 test1502 test1503 test1504 test1505 test1506 test1507 \
test1508 test1509 test1510 test1511 test1512 test1513 test1514 \
\
test1900 test1901 test1902 test1903 \
\
test2000 test2001 test2002 test2003 test2004 test2005 test2006 test2007 \
test2008 test2009 test2010 test2011 test2012 test2013 test2014 test2015 \
test2016 test2017 test2018 test2019 test2020 test2021 test2022 test2023 \
test2024 test2025 test2026 test2027 test2028 test2029 test2030 test2031 \
test2032 test2033

EXTRA_DIST = $(TESTCASES) DISABLED

filecheck:
	@mkdir test-place; \
	cp "$(top_srcdir)"/tests/data/test[0-9]* test-place/; \
	rm test-place/*~; \
	for f in $(EXTRA_DIST); do \
	  if test -f "$(top_srcdir)/tests/data/$$f"; then \
	    rm -f "test-place/$$f"; \
	  else \
	    echo "$$f is listed but missing!"; \
	  fi \
	done; \
	echo "Local files not present in EXTRA_DIST:" ; \
	ls test-place; \
	! ls test-place | grep . >/dev/null ; \
	RC=$$? ; \
	rm -rf test-place ; \
	exit $$RC

show:
	@echo $(EXTRA_DIST)
curl-7.35.0/tests/data/test10370000644000175000017500000000124012213173003012751 00000000000000


FTP
PASV
RETR
Resume



# Server-side


expected to be a file without the first part
but we emulate that


65


REPLY EPSV 500 no such command



# Client-side


ftp

 
FTP download resume from end of empty file
 
 
ftp://%HOSTIP:%FTPPORT/1037 -C -





# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
EPSV
PASV
TYPE I
SIZE 1037
RETR 1037
QUIT



curl-7.35.0/tests/data/Makefile.in0000644000175000017500000005533712272122667013640 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994-2013 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
  case $${target_option-} in \
      ?) ;; \
      *) echo "am__make_running_with_option: internal error: invalid" \
              "target option '$${target_option-}' specified" >&2; \
         exit 1;; \
  esac; \
  has_opt=no; \
  sane_makeflags=$$MAKEFLAGS; \
  if $(am__is_gnu_make); then \
    sane_makeflags=$$MFLAGS; \
  else \
    case $$MAKEFLAGS in \
      *\\[\ \	]*) \
        bs=\\; \
        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
    esac; \
  fi; \
  skip_next=no; \
  strip_trailopt () \
  { \
    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
  }; \
  for flg in $$sane_makeflags; do \
    test $$skip_next = yes && { skip_next=no; continue; }; \
    case $$flg in \
      *=*|--*) continue;; \
        -*I) strip_trailopt 'I'; skip_next=yes;; \
      -*I?*) strip_trailopt 'I';; \
        -*O) strip_trailopt 'O'; skip_next=yes;; \
      -*O?*) strip_trailopt 'O';; \
        -*l) strip_trailopt 'l'; skip_next=yes;; \
      -*l?*) strip_trailopt 'l';; \
      -[dEDm]) skip_next=yes;; \
      -[JT]) skip_next=yes;; \
    esac; \
    case $$flg in \
      *$$target_option*) has_opt=yes; break;; \
    esac; \
  done; \
  test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = tests/data
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
	$(top_srcdir)/mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \
	$(top_srcdir)/m4/curl-confopts.m4 \
	$(top_srcdir)/m4/curl-functions.m4 \
	$(top_srcdir)/m4/curl-openssl.m4 \
	$(top_srcdir)/m4/curl-override.m4 \
	$(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \
	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
	$(top_srcdir)/m4/xc-am-iface.m4 \
	$(top_srcdir)/m4/xc-cc-check.m4 \
	$(top_srcdir)/m4/xc-lt-iface.m4 \
	$(top_srcdir)/m4/xc-translit.m4 \
	$(top_srcdir)/m4/xc-val-flgs.m4 \
	$(top_srcdir)/m4/zz40-xc-ovr.m4 \
	$(top_srcdir)/m4/zz50-xc-ovr.m4 \
	$(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \
	$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \
	$(top_builddir)/include/curl/curlbuild.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo "  GEN     " $@;
am__v_GEN_1 = 
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 = 
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
  case $$AM_UPDATE_INFO_DIR in \
    n|no|NO) false;; \
    *) (install-info --version) >/dev/null 2>&1;; \
  esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@
CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@
CURLVERSION = @CURLVERSION@
CURL_CA_BUNDLE = @CURL_CA_BUNDLE@
CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@
CURL_DISABLE_DICT = @CURL_DISABLE_DICT@
CURL_DISABLE_FILE = @CURL_DISABLE_FILE@
CURL_DISABLE_FTP = @CURL_DISABLE_FTP@
CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@
CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@
CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@
CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@
CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@
CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@
CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@
CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@
CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@
CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@
CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@
CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@
CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@
CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_SHARED = @ENABLE_SHARED@
ENABLE_STATIC = @ENABLE_STATIC@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@
HAVE_LDAP_SSL = @HAVE_LDAP_SSL@
HAVE_LIBZ = @HAVE_LIBZ@
HAVE_SSLEAY_SRP = @HAVE_SSLEAY_SRP@
IDN_ENABLED = @IDN_ENABLED@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IPV6_ENABLED = @IPV6_ENABLED@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBCURL_LIBS = @LIBCURL_LIBS@
LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@
LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@
LIBMETALINK_LIBS = @LIBMETALINK_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MANOPT = @MANOPT@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
NROFF = @NROFF@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKGADD_NAME = @PKGADD_NAME@
PKGADD_PKG = @PKGADD_PKG@
PKGADD_VENDOR = @PKGADD_VENDOR@
PKGCONFIG = @PKGCONFIG@
RANDOM_FILE = @RANDOM_FILE@
RANLIB = @RANLIB@
REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SSL_ENABLED = @SSL_ENABLED@
STRIP = @STRIP@
SUPPORT_FEATURES = @SUPPORT_FEATURES@
SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@
USE_ARES = @USE_ARES@
USE_AXTLS = @USE_AXTLS@
USE_CYASSL = @USE_CYASSL@
USE_DARWINSSL = @USE_DARWINSSL@
USE_GNUTLS = @USE_GNUTLS@
USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@
USE_LIBRTMP = @USE_LIBRTMP@
USE_LIBSSH2 = @USE_LIBSSH2@
USE_NGHTTP2 = @USE_NGHTTP2@
USE_NSS = @USE_NSS@
USE_OPENLDAP = @USE_OPENLDAP@
USE_POLARSSL = @USE_POLARSSL@
USE_SCHANNEL = @USE_SCHANNEL@
USE_SSLEAY = @USE_SSLEAY@
USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@
VERSION = @VERSION@
VERSIONNUM = @VERSIONNUM@
ZLIB_LIBS = @ZLIB_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
libext = @libext@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
subdirs = @subdirs@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@

# this list is in numerical order
TESTCASES = test1 test2 test3 test4 test5 test6 test7 test8 test9       \
test10 test11 test12 test13 test14 test15 test16 test17 test18 test19   \
test20 test21 test22 test23 test24 test25 test26 test27 test28 test29   \
test30 test31 test32 test33 test34 test35 test36 test37 test38 test39   \
test40 test41 test42 test43 test44 test45 test46 test47 test48 test49   \
test50 test51 test52 test53 test54 test55 test56 test57 test58 test59   \
test60 test61 test62 test63 test64 test65 test66 test67 test68 test69   \
test70 test71 test72 test73 test74 test75 test76 test77 test78 test79   \
test80 test81 test82 test83 test84 test85 test86 test87 test88 test89   \
test90 test91 test92 test93 test94 test95 test96 test97 test98 test99   \
test100 test101 test102 test103 test104 test105 test106 test107 test108 \
test109 test110 test111 test112 test113 test114 test115 test116 test117 \
test118 test119 test120 test121 test122 test123 test124 test125 test126 \
test127 test128 test129 test130 test131 test132 test133 test134 test135 \
test136 test137 test138 test139 test140 test141 test142 test143 test144 \
test145 test146 test147 test148 test149 test150 test151 test152 test153 \
test154 test155 test156 test157 test158 test159 test160 test161 test162 \
test163 test164 test165 test166 test167 test168 test169 test170 test171 \
test172 test173 test174 test175 test176 test177 test178 test179 test180 \
test181 test182 test183 test184 test185 test186 test187 test188 test189 \
test190 test191 test192 test193 test194 test195 test196 test197 test198 \
test199 test200 test201 test202 test203 test204 test205 test206 test207 \
test208 test209 test210 test211 test212 test213 test214 test215 test216 \
test217 test218         test220 test221 test222 test223 test224 test225 \
test226 test227 test228 test229         test231         test233 test234 \
test235 test236 test237 test238 test239 test240 test241 test242 test243 \
        test245 test246 test247 test248 test249 test250 test251 test252 \
test253 test254 test255 test256 test257 test258 test259 test260 test261 \
test262 test263 test264 test265 test266 test267 test268 test269 test270 \
test271 test272 test273 test274 test275 test276 test277 test278 test279 \
test280 test281 test282 test283 test284 test285 test286 test287 test288 \
test289 test290 test291 test292 test293 test294 test295 test296 test297 \
test298 test299 test300 test301 test302 test303 test304 test305 test306 \
test307 test308 test309 test310 test311 test312 test313                 \
                                test320 test321 test322 test323 test324 \
test350 test351 test352 test353 test354 \
\
test400 test401 test402 test403 test404 test405 test406 test407 test408 \
test409 \
\
test500 test501 test502 test503 test504 test505 test506 test507 test508 \
test509 test510 test511 test512 test513 test514 test515 test516 test517 \
test518 test519 test520 test521 test522 test523 test524 test525 test526 \
test527 test528 test529 test530 test531 test532 test533 test534 test535 \
test536 test537 test538 test539 test540 test541 test542 test543 test544 \
test545 test546 test547 test548 test549 test550 test551 test552 test553 \
test554 test555 test556 test557 test558         test560 test561 test562 \
test563 test564 test565 test566 test567 test568 test569 test570 test571 \
test572 test573 test574 test575 test576         test578 test579 test580 \
test581 test582 test583 test584 test585 test586 test587 test588         \
test590 test591 test592 test593 test594 test595 test596 test597 test598 \
test599 test600 test601 test602 test603 test604 test605 test606 test607 \
test608 test609 test610 test611 test612 test613 test614 test615 test616 \
test617 test618 test619 test620 test621 test622 test623 test624 test625 \
test626 test627 test628 test629 test630 test631 test632 test633 test634 \
test635 test636 test637 test638 test639 \
\
test700 test701 test702 test703 test704 test705 test706 test707 test708 \
test709 test710 test711 test712 \
\
test800 test801 test802 test803 test804 test805 test806 test807 test808 \
test809 test810 test811 test812 test813 test814 test815 test816 test817 \
test818 test819 test820 test821 test822 test823 test824 test825 test826 \
test827 test828 test829 test830 test831 test832 test833 test834 test835 \
\
test850 test851 test852 test853 test854 test855 test856 test857 test858 \
test859 test860 test861 test862 test863 test864 test865 test866 test867 \
test868 test869 test870 test871 test872 test873 test874 test875 test876 \
test877 test878 test879 test880 test881 \
\
test900 test901 test902 test903 test904 test905 test906 test907 test908 \
test909 test910 test911 test912 test913 test914 test915 test916 test917 \
test918 test919 test920 test921 test922 test923 test924 test925 test926 \
test927 test928 test929 test930 test931 test932 test933 test934 test935 \
test936 test937 \
\
test1000 test1001 test1002 test1003 test1004 test1005 test1006 test1007 \
test1008 test1009 test1010 test1011 test1012 test1013 test1014 test1015 \
test1016 test1017 test1018 test1019 test1020 test1021 test1022 test1023 \
test1024 test1025 test1026 test1027 test1028 test1029 test1030 test1031 \
test1032 test1033 test1034 test1035 test1036 test1037 test1038 test1039 \
test1040 test1041 test1042 test1043 test1044 test1045 test1046 test1047 \
test1048 test1049 test1050 test1051 test1052 test1053 test1054 test1055 \
test1056 test1057 test1058 test1059 test1060 test1061 test1062 test1063 \
test1064 test1065 test1066 test1067 test1068 test1069 test1070 test1071 \
test1072 test1073 test1074 test1075 test1076 test1077 test1078 test1079 \
test1080 test1081 test1082 test1083 test1084 test1085 test1086 test1087 \
test1088 test1089 test1090 test1091 test1092 test1093 test1094 test1095 \
test1096 test1097 test1098 test1099 test1100 test1101 test1102 test1103 \
test1104 test1105 test1106 test1107 test1108 test1109 test1110 test1111 \
test1112 test1113 test1114 test1115 test1116 test1117 test1118 test1119 \
test1120 test1121 test1122 test1123 test1124 test1125 test1126 test1127 \
test1128 test1129 test1130 test1131 test1132 test1133 \
\
test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \
test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \
test1216 test1217 test1218 test1219 \
test1220 test1221 test1222 test1223 test1224 test1225 test1226 test1227 \
test1228 test1229 test1230 test1231 test1232 test1233 test1234 test1235 \
test1236 test1237 test1238 test1239 test1240 \
\
test1300 test1301 test1302 test1303 test1304 test1305 test1306 test1307 \
test1308 test1309 test1310 test1311 test1312 test1313 test1314 test1315 \
test1316 test1317 test1318 test1319 test1320 test1321                   \
         test1325 test1326 test1327 test1328 test1329 test1330 test1331 \
test1332 test1333 test1334 test1335 test1336 test1337 test1338 test1339 \
test1340 test1341 test1342 test1343 test1344 test1345 test1346 test1347 \
test1348 test1349 test1350 test1351 test1352 test1353 test1354 test1355 \
test1356 test1357 test1358 test1359 test1360 test1361 test1362 test1363 \
test1364 test1365 test1366 test1367 test1368 test1369 test1370 test1371 \
test1372 test1373 test1374 test1375 test1376 test1377 test1378 test1379 \
test1380 test1381 test1382 test1383 test1384 test1385 test1386 test1387 \
test1388 test1389 test1390 test1391 test1392 test1393 test1394 test1395 \
test1396 \
\
test1400 test1401 test1402 test1403 test1404 test1405 test1406 test1407 \
test1408 test1409 test1410          test1412 test1413 test1414 test1415 \
test1416 test1417 \
\
test1500 test1501 test1502 test1503 test1504 test1505 test1506 test1507 \
test1508 test1509 test1510 test1511 test1512 test1513 test1514 \
\
test1900 test1901 test1902 test1903 \
\
test2000 test2001 test2002 test2003 test2004 test2005 test2006 test2007 \
test2008 test2009 test2010 test2011 test2012 test2013 test2014 test2015 \
test2016 test2017 test2018 test2019 test2020 test2021 test2022 test2023 \
test2024 test2025 test2026 test2027 test2028 test2029 test2030 test2031 \
test2032 test2033

EXTRA_DIST = $(TESTCASES) DISABLED
all: all-am

.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
	        && { if test -f $@; then exit 0; else break; fi; }; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/data/Makefile'; \
	$(am__cd) $(top_srcdir) && \
	  $(AUTOMAKE) --gnu tests/data/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs
tags TAGS:

ctags CTAGS:

cscope cscopelist:


distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d "$(distdir)/$$file"; then \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
	  else \
	    test -f "$(distdir)/$$file" \
	    || cp -p $$d/$$file "$(distdir)/$$file" \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	if test -z '$(STRIP)'; then \
	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	      install; \
	else \
	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
	fi
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-am

clean-am: clean-generic clean-libtool mostlyclean-am

distclean: distclean-am
	-rm -f Makefile
distclean-am: clean-am distclean-generic

dvi: dvi-am

dvi-am:

html: html-am

html-am:

info: info-am

info-am:

install-data-am:

install-dvi: install-dvi-am

install-dvi-am:

install-exec-am:

install-html: install-html-am

install-html-am:

install-info: install-info-am

install-info-am:

install-man:

install-pdf: install-pdf-am

install-pdf-am:

install-ps: install-ps-am

install-ps-am:

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-generic mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am:

.MAKE: install-am install-strip

.PHONY: all all-am check check-am clean clean-generic clean-libtool \
	cscopelist-am ctags-am distclean distclean-generic \
	distclean-libtool distdir dvi dvi-am html html-am info info-am \
	install install-am install-data install-data-am install-dvi \
	install-dvi-am install-exec install-exec-am install-html \
	install-html-am install-info install-info-am install-man \
	install-pdf install-pdf-am install-ps install-ps-am \
	install-strip installcheck installcheck-am installdirs \
	maintainer-clean maintainer-clean-generic mostlyclean \
	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
	tags-am uninstall uninstall-am

iall:
install:
test:

filecheck:
	@mkdir test-place; \
	cp "$(top_srcdir)"/tests/data/test[0-9]* test-place/; \
	rm test-place/*~; \
	for f in $(EXTRA_DIST); do \
	  if test -f "$(top_srcdir)/tests/data/$$f"; then \
	    rm -f "test-place/$$f"; \
	  else \
	    echo "$$f is listed but missing!"; \
	  fi \
	done; \
	echo "Local files not present in EXTRA_DIST:" ; \
	ls test-place; \
	! ls test-place | grep . >/dev/null ; \
	RC=$$? ; \
	rm -rf test-place ; \
	exit $$RC

show:
	@echo $(EXTRA_DIST)

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
curl-7.35.0/tests/data/test10290000644000175000017500000000203712213173003012757 00000000000000


HTTP
HTTP GET
redirect_url
followlocation
--write-out



# Server-side


HTTP/1.1 301 This is a weirdo text message swsclose
Location: data/10290002.txt?coolsite=yes
Content-Length: 62
Connection: close

This server reply is for testing a simple Location: following



# Client-side


http

 
HTTP Location: and 'redirect_url' check
 
 
http://%HOSTIP:%HTTPPORT/we/want/our/1029 -w '%{redirect_url}\n'



# Verify data after the test has been "shot"


^User-Agent:.*


GET /we/want/our/1029 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*



HTTP/1.1 301 This is a weirdo text message swsclose
Location: data/10290002.txt?coolsite=yes
Content-Length: 62
Connection: close

This server reply is for testing a simple Location: following
http://%HOSTIP:%HTTPPORT/we/want/our/data/10290002.txt?coolsite=yes



curl-7.35.0/tests/data/test1880000644000175000017500000000220412213173003012700 00000000000000


HTTP
HTTP GET
Content-Range
Resume
followlocation



# Server-side


HTTP/1.1 301 OK swsbounce
Location: /188
Content-Length: 2

OK


HTTP/1.1 200 OK 
Connection: close
Content-Length: 15
Content-Range: bytes 50-

Actual content



HTTP/1.1 301 OK swsbounce
Location: /188
Content-Length: 2

HTTP/1.1 200 OK 
Connection: close
Content-Length: 15
Content-Range: bytes 50-

Actual content




# Client-side


http

 
HTTP GET with resume and redirect
 
 
http://%HOSTIP:%HTTPPORT/188 -C 50 -L



# Verify data after the test has been "shot"


^User-Agent:.*


GET /188 HTTP/1.1
Range: bytes=50-
User-Agent: curl/7.6 (sparc-sun-solaris2.7) libcurl 7.6-pre4 (SSL 0.9.6) (krb4 enabled)
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /188 HTTP/1.1
Range: bytes=50-
User-Agent: curl/7.12.2-CVS (i686-pc-linux-gnu) libcurl/7.12.2-CVS OpenSSL/0.9.7d zlib/1.2.1.2 libidn/0.5.2
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test6140000644000175000017500000000203012213173003012667 00000000000000


SFTP
pre-quote
directory



#
# Server-side


d?????????    N U         U               N ???  N NN:NN .
d?????????    N U         U               N ???  N NN:NN ..
d?????????    N U         U               N ???  N NN:NN asubdir
-r-?r-?r-?    1 U         U              37 Jan  1  2000 plainfile.txt
-r-?r-?r-?    1 U         U              47 Dec 31  2000 rofile.txt



#
# Client-side


sftp


perl %SRCDIR/libtest/test613.pl prepare %PWD/log/test614.dir

 
SFTP pre-quote chmod
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "chmod 444 %PWD/log/test614.dir/plainfile.txt" sftp://%HOSTIP:%SSHPORT%PWD/log/test614.dir/ --insecure


perl %SRCDIR/libtest/test613.pl postprocess %PWD/log/test614.dir %PWD/log/curl614.out



#
# Verify data after the test has been "shot"


disable



curl-7.35.0/tests/data/test950000644000175000017500000000264112213173003012622 00000000000000


HTTP
HTTP POST
HTTP CONNECT
proxytunnel



#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
Content-Length: 9

contents


HTTP/1.1 200 Mighty fine indeed



HTTP/1.1 200 Mighty fine indeed

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
Content-Length: 9

contents



#
# Client-side


http
http-proxy

 
HTTP over proxytunnel using POST
 
 
http://test.95:%HTTPPORT/we/want/that/page/95 -p -x %HOSTIP:%PROXYPORT -d "datatopost=ohthatsfunyesyes"



#
# Verify data after the test has been "shot"


^User-Agent:.*


CONNECT test.95:%HTTPPORT HTTP/1.1
User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
Host: test.95:%HTTPPORT
Proxy-Connection: Keep-Alive



POST /we/want/that/page/95 HTTP/1.1
User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
Host: test.95:%HTTPPORT
Accept: */*
Content-Length: 27
Content-Type: application/x-www-form-urlencoded

datatopost=ohthatsfunyesyes



curl-7.35.0/tests/data/test1440000644000175000017500000000133012213173003012667 00000000000000


FTP
PORT
NLST
--data-binary


# Server-side




REPLY NLST 450 No files found



# Client-side


ftp

 
FTP NLST dir list without contents, using PORT
 
 
ftp://%HOSTIP:%FTPPORT/ -P - -l



# Verify data after the test has been "shot"

# Strip all valid kinds of PORT and EPRT that curl can send

^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|


USER anonymous
PASS ftp@example.com
PWD
PORT 127,0,0,1,243,212
TYPE A
NLST
QUIT



curl-7.35.0/tests/data/test11080000644000175000017500000000107012213173003012751 00000000000000


FTP
PASV
RETR
PRET


# Server-side



REPLY PRET 550 unkown command



# Client-side


ftp

 
FTP RETR PASV with PRET not supported
 
 
ftp://%HOSTIP:%FTPPORT/1108 --ftp-pret




# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
PRET RETR 1108

# we expect that the server doesn't understand PRET

84



curl-7.35.0/tests/data/test490000644000175000017500000000223112213173003012614 00000000000000


HTTP
HTTP GET
followlocation


#
# Server-side


HTTP/1.1 302 OK swsclose
Location: ../moo.html/490002
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close



HTTP/1.1 200 OK swsclose
Location: this should be ignored
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close

body


HTTP/1.1 302 OK swsclose
Location: ../moo.html/490002
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close

HTTP/1.1 200 OK swsclose
Location: this should be ignored
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close

body



#
# Client-side


http

 
HTTP follow redirect with ../
 
 
http://%HOSTIP:%HTTPPORT/we/are/all/twits/49 -L



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /we/are/all/twits/49 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /we/are/all/moo.html/490002 HTTP/1.1
User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test9040000644000175000017500000000137212262353672012721 00000000000000


SMTP
SMTP AUTH LOGIN
RFC4954



#
# Server-side


AUTH LOGIN
REPLY AUTH 334 VXNlcm5hbWU6
REPLY dXNlcg== 334 UGFzc3dvcmQ6
REPLY c2VjcmV0 235 Authenticated



#
# Client-side


smtp

 
SMTP login authentication
 

mail body

 
smtp://%HOSTIP:%SMTPPORT/904 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret -T -



#
# Verify data after the test has been "shot"


EHLO 904
AUTH LOGIN
dXNlcg==
c2VjcmV0
MAIL FROM:
RCPT TO:
DATA
QUIT


mail body
.



curl-7.35.0/tests/data/test9350000644000175000017500000000166512270035364012724 00000000000000


SMTP
SMTP AUTH CRAM-MD5 SASL DOWNGRADE
RFC2195
RFC4954



#
# Server-side


AUTH CRAM-MD5 PLAIN
REPLY "AUTH CRAM-MD5" 334 Rubbish
REPLY * 501 AUTH exchange cancelled by client
REPLY "AUTH PLAIN" 334 PLAIN supported
REPLY dXNlcgB1c2VyAHNlY3JldA== 235 Authenticated



#
# Client-side


smtp


crypto

 
SMTP CRAM-MD5 authentication with SASL downgrade
 

mail body

 
smtp://%HOSTIP:%SMTPPORT/935 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret -T -



#
# Verify data after the test has been "shot"


EHLO 935
AUTH CRAM-MD5
*
AUTH PLAIN
dXNlcgB1c2VyAHNlY3JldA==
MAIL FROM:
RCPT TO:
DATA
QUIT


mail body
.



curl-7.35.0/tests/data/test320000644000175000017500000000151212213173003012605 00000000000000


HTTP
HTTP GET
-G


#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes

-foo-



#
# Client-side


http

 
HTTP with -d and -G
 
 
-d "foo=moo&moo=poo" http://%HOSTIP:%HTTPPORT/32 -G



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /32?foo=moo&moo=poo HTTP/1.1
User-Agent: curl/7.9.5 (i686-pc-linux-gnu) libcurl 7.9.5-cvs (OpenSSL 0.9.5) (ipv6 enabled)
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test10870000644000175000017500000000411112213173003012756 00000000000000


HTTP
HTTP proxy
HTTP Basic auth
HTTP proxy Basic auth
followlocation
--anyauth



#
# Server-side


HTTP/1.1 401 Authorization Required
WWW-Authenticate: Basic
Content-Type: text/plain
Content-Length: 0



HTTP/1.1 302 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/plain
Funny-head: yesyes
Location: http://goto.second.host.now/10871002
Content-Length: 0
Connection: close



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/plain
Funny-head: yesyes
Content-Length: 9

contents



HTTP/1.1 401 Authorization Required
WWW-Authenticate: Basic
Content-Type: text/plain
Content-Length: 0

HTTP/1.1 302 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/plain
Funny-head: yesyes
Location: http://goto.second.host.now/10871002
Content-Length: 0
Connection: close

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/plain
Funny-head: yesyes
Content-Length: 9

contents



#
# Client-side


http

 
HTTP, proxy with --anyauth and Location: to new host
 
 
http://first.host.it.is/we/want/that/page/10871000 -x %HOSTIP:%HTTPPORT --user iam:myself --location --anyauth



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET http://first.host.it.is/we/want/that/page/10871000 HTTP/1.1
Host: first.host.it.is
Accept: */*
Proxy-Connection: Keep-Alive

GET http://first.host.it.is/we/want/that/page/10871000 HTTP/1.1
Authorization: Basic aWFtOm15c2VsZg==
Host: first.host.it.is
Accept: */*
Proxy-Connection: Keep-Alive

GET http://goto.second.host.now/10871002 HTTP/1.1
Host: goto.second.host.now
Accept: */*
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test5410000644000175000017500000000116712262353672012720 00000000000000


FTP



# Server-side



# Client-side


ftp

# tool is what to use instead of 'curl'

lib541


 
FTP upload and upload same file again without rewind
 
 
ftp://%HOSTIP:%FTPPORT/541 log/upload541


Contents
of
a file
to verify
ftp
upload


works?



# Verify data after the test has been "shot"




USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
STOR 541
EPSV
STOR 541
QUIT



curl-7.35.0/tests/data/test11250000644000175000017500000000260012213173003012750 00000000000000


HTTP
HTTP GET
compressed
Transfer-Encoding


#
# Server-side


SFRUUC8xLjEgMjAwIE9LDQpEYXRlOiBNb24sIDI5IE5vdiAyMDA0IDIxOjU2OjUzIEdNVA0KU2Vy
dmVyOiBBcGFjaGUvMS4zLjMxIChEZWJpYW4gR05VL0xpbnV4KSBtb2RfZ3ppcC8xLjMuMjYuMWEg
UEhQLzQuMy45LTEgbW9kX3NzbC8yLjguMjAgT3BlblNTTC8wLjkuN2QgbW9kX3BlcmwvMS4yOQ0K
VmFyeTogQWNjZXB0LUVuY29kaW5nDQpDb250ZW50LVR5cGU6IHRleHQvaHRtbDsgY2hhcnNldD1J
U08tODg1OS0xDQpUcmFuc2Zlci1FbmNvZGluZzogZ3ppcA0KQ29udGVudC1MZW5ndGg6IDQ0DQoN
Ch+LCAh5nqtBAANsYWxhbGEAy8nMS1Uw5FLIAdFGXAoQhjEXAAoCcWAYAAAA



HTTP/1.1 200 OK
Date: Mon, 29 Nov 2004 21:56:53 GMT
Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29
Vary: Accept-Encoding
Content-Type: text/html; charset=ISO-8859-1
Transfer-Encoding: gzip
Content-Length: 44

line 1
 line 2
  line 3




#
# Client-side


libz


http

 
HTTP GET transfer-encoding with custom Connection:
 
 
http://%HOSTIP:%HTTPPORT/1125 --tr-encoding -H "Connection: close"



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1125 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Connection: close, TE
TE: gzip




curl-7.35.0/tests/data/test9210000644000175000017500000000315512270035364012713 00000000000000


SMTP
SMTP AUTH NTLM SASL-IR
RFC4954



#
# Server-side


AUTH NTLM
REPLY AUTH 334 TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
REPLY TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q= 235 Authenticated



#
# Client-side


smtp


NTLM
!SSPI

 
SMTP NTLM authentication with initial response
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 

mail body

 
smtp://%HOSTIP:%SMTPPORT/921 --mail-rcpt recipient@example.com --mail-from sender@example.com -u testuser:testpass --sasl-ir -T -


chkhostname curlhost



#
# Verify data after the test has been "shot"


EHLO 921
AUTH NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
MAIL FROM:
RCPT TO:
DATA
QUIT


mail body
.



curl-7.35.0/tests/data/test6340000644000175000017500000000107112213173003012675 00000000000000


SFTP
Range



#
# Server-side


data
for ssh test



#
# Client-side


sftp

 
SFTP retrieval with byte range past end of file
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/file634.txt -r 5-99 --insecure


Test data
for ssh test



#
# Verify data after the test has been "shot"


disable



curl-7.35.0/tests/data/test70000644000175000017500000000220712213173003012531 00000000000000


HTTP
HTTP GET
cookies
header dump



# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Type: text/html
Funny-head: yesyes swsclose
Set-Cookie: foobar=name; domain=127.0.0.1; path=/;
Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/";
Set-Cookie: partmatch=present; domain=.0.0.1; path=/;




# Client-side


http

 
HTTP with cookie parser and header recording
 
 
http://%HOSTIP:%HTTPPORT/we/want/7 -b none -D log/heads7.txt



# Verify data after the test has been "shot"


^User-Agent:.*


GET /we/want/7 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Type: text/html
Funny-head: yesyes swsclose
Set-Cookie: foobar=name; domain=127.0.0.1; path=/;
Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/";
Set-Cookie: partmatch=present; domain=.0.0.1; path=/;




curl-7.35.0/tests/data/test20210000644000175000017500000000342412213173003012751 00000000000000


Metalink
HTTP
HTTP GET



#
# Server-side


HTTP/1.1 200 OK
Date: Wed, 20 Jun 2012 14:49:00 GMT
Server: test-server/fake
Content-Length: 56
Connection: close
Content-Type: text/html
Content-Disposition: filename=name2021; charset=funny; option=strange
Funny-head: yesyes

Data that should not be delivered from an HTTP resource



#
# Client-side


http


file
Metalink

 
Metalink local XML file, attempt UNIX questionable file name IV
 

--metalink file://%PWD/log/test2021.metalink

# local metalink file written before test command runs



 
  
   
    c7d03debe90ca29492203ea921d76941fa98640cf3b744f2a16c9b58465eab82
   
   
    http://%HOSTIP:%HTTPPORT/2021
   
  
 



perl %SRCDIR/libtest/notexists.pl log/2021 log/name2021 log/download2021



#
# Verify data after the test has been "shot"




Metalink: parsing (file://%PWD/log/test2021.metalink) metalink/XML...
Metalink: parsing (file://%PWD/log/test2021.metalink) WARNING (missing or invalid file name)
Metalink: parsing (file://%PWD/log/test2021.metalink) FAILED


$_ = '' if (($_ !~ /^Metalink: /) && ($_ !~ /error/i) && ($_ !~ /warn/i))



curl-7.35.0/tests/data/test8730000644000175000017500000000300612270035364012714 00000000000000


POP3
POP3 AUTH NTLM SASL-IR
RFC1734
RFC5034



#
# Server-side


AUTH NTLM
REPLY AUTH + TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
REPLY TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q= +OK Login successful


From: me@somewhere
To: fake@nowhere

body

--
  yours sincerely



#
# Client-side


pop3


NTLM
!SSPI

 
POP3 NTLM authentication with initial response
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
pop3://%HOSTIP:%POP3PORT/873 -u testuser:testpass --sasl-ir


chkhostname curlhost



#
# Verify data after the test has been "shot"


CAPA
AUTH NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
RETR 873
QUIT



curl-7.35.0/tests/data/test3010000644000175000017500000000136312213173003012670 00000000000000


HTTPS
HTTP GET
HTTP Basic auth



#
# Server-side


HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Type: text/html
Funny-head: yesyes




#
# Client-side


SSL


https

 
HTTPS GET with user and password
 
 
-k -u fake:user https://%HOSTIP:%HTTPSPORT/301



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /301 HTTP/1.1
Authorization: Basic ZmFrZTp1c2Vy
Host: %HOSTIP:%HTTPSPORT
Accept: */*



[insert full protocol verifiction dump here]



curl-7.35.0/tests/data/test12070000644000175000017500000000117612213173003012760 00000000000000


FTP
PORT
RETR
NODATACONN421


# Server-side


some bytes


NODATACONN421



# Client-side


ftp

 
FTP PORT and 421 on download
 
 
--max-time %FTPTIME2 ftp://%HOSTIP:%FTPPORT/1207 -P -




# Verify data after the test has been "shot"


s/^EPRT \|1\|(.*)/EPRT \|1\|/


USER anonymous
PASS ftp@example.com
PWD
EPRT |1|
TYPE I
SIZE 1207
RETR 1207
QUIT


10



curl-7.35.0/tests/data/test10960000644000175000017500000000117112213173003012761 00000000000000


FTP
PASV
RETR
FAILURE


# Server-side


REPLY RETR 550 no such file!



# Client-side


ftp

 
Two FTP downloads, with failed RETR but re-used control connection
 
 
ftp://%HOSTIP:%FTPPORT/dir/1096 ftp://%HOSTIP:%FTPPORT/dir/1096



# Verify data after the test has been "shot"


78


USER anonymous
PASS ftp@example.com
PWD
CWD dir
EPSV
TYPE I
SIZE 1096
RETR 1096
EPSV
SIZE 1096
RETR 1096
QUIT



curl-7.35.0/tests/data/test13200000644000175000017500000000212412271241025012752 00000000000000


SMTP
HTTP
HTTP CONNECT
HTTP proxy



#
# Server-side


HTTP/1.1 200 Mighty fine indeed
smtp: sure hit me




#
# Client-side


smtp
http-proxy


http

 
SMTP send tunneled through HTTP proxy
 

From: different
To: another

body

 
smtp://smtp.1320:%SMTPPORT/1320 --mail-rcpt recipient@example.com --mail-from sender@example.com -T - -p -x %HOSTIP:%PROXYPORT



#
# Verify data after the test has been "shot"


^User-Agent: curl/.*


EHLO 1320
MAIL FROM:
RCPT TO:
DATA
QUIT


From: different
To: another

body
.


CONNECT smtp.1320:%SMTPPORT HTTP/1.1
Host: smtp.1320:%SMTPPORT
User-Agent: curl/7.24.0-DEV (i686-pc-linux-gnu) libcurl/7.24.0-DEV OpenSSL/1.0.0e zlib/1.2.3.4 c-ares/1.7.6-DEV libidn/1.23 libssh2/1.4.0_DEV librtmp/2.2e
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test8690000644000175000017500000000234612262353672012735 00000000000000


POP3
POP3 AUTH DIGEST-MD5
RFC1734
RFC2831
RFC5034



#
# Server-side


AUTH DIGEST-MD5
REPLY AUTH + cmVhbG09ImN1cmwiLG5vbmNlPSI1MzAwZDE3YTFkNjk1YmQ0MTFlNGNkZjk2Zjk1NDhjMjNjZWQ2MTc1IixhbGdvcml0aG09bWQ1LXNlc3MscW9wPSJhdXRoIg==
REPLY dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIxMjM0NTY3OCIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJwb3AvY3VybCIscmVzcG9uc2U9YTA2OTE1YTA1ODA3ZDc0MTg0YTkxYjM2NjE2ZTZiOGM= +
REPLY  +OK Login successful


From: me@somewhere
To: fake@nowhere

body

--
  yours sincerely



#
# Client-side


pop3


debug
crypto

 
POP3 DIGEST-MD5 authentication
 
 
pop3://%HOSTIP:%POP3PORT/869 -u user:secret



#
# Verify data after the test has been "shot"


CAPA
AUTH DIGEST-MD5
dXNlcm5hbWU9InVzZXIiLHJlYWxtPSJjdXJsIixub25jZT0iNTMwMGQxN2ExZDY5NWJkNDExZTRjZGY5NmY5NTQ4YzIzY2VkNjE3NSIsY25vbmNlPSIxMjM0NTY3OCIsbmM9IjAwMDAwMDAxIixkaWdlc3QtdXJpPSJwb3AvY3VybCIscmVzcG9uc2U9YTA2OTE1YTA1ODA3ZDc0MTg0YTkxYjM2NjE2ZTZiOGM=

RETR 869
QUIT



curl-7.35.0/tests/data/test1220000644000175000017500000000102312213173003012662 00000000000000


FTP
PASV
Resume


# Server-side


5


REPLY EPSV 500 no such command



# Client-side


ftp

 
FTP download resume with whole file already downloaded
 
 
ftp://%HOSTIP:%FTPPORT/122 -C 5



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
EPSV
PASV
TYPE I
SIZE 122
QUIT



curl-7.35.0/tests/data/test2530000644000175000017500000000234312213173003012675 00000000000000


FTP-ipv6
IPv6
EPRT


#
# Server-side

# When doing LIST, we get the default list output hard-coded in the test
# FTP server

total 20
drwxr-xr-x   8 98       98           512 Oct 22 13:06 .
drwxr-xr-x   8 98       98           512 Oct 22 13:06 ..
drwxr-xr-x   2 98       98           512 May  2  1996 .NeXT
-r--r--r--   1 0        1             35 Jul 16  1996 README
lrwxrwxrwx   1 0        1              7 Dec  9  1999 bin -> usr/bin
dr-xr-xr-x   2 0        1            512 Oct  1  1997 dev
drwxrwxrwx   2 98       98           512 May 29 16:04 download.html
dr-xr-xr-x   2 0        1            512 Nov 30  1995 etc
drwxrwxrwx   2 98       1            512 Oct 30 14:33 pub
dr-xr-xr-x   5 0        1            512 Oct  1  1997 usr



#
# Client-side


ipv6


ftp-ipv6

 
FTP IPv6 dir list with EPRT
 
 
-g "ftp://%HOST6IP:%FTP6PORT/" -P -



#
# Verify data after the test has been "shot"


s/^(EPRT \|2\|::1\|)(.*)/$1/


USER anonymous
PASS ftp@example.com
PWD
EPRT |2|::1|
TYPE A
LIST
QUIT



curl-7.35.0/tests/data/test2830000644000175000017500000000070412213173003012677 00000000000000


TFTP
TFTP RRQ
FAILURE



#
# Client-side


tftp

 
TFTP retrieve on invalid file
 
 
tftp://%HOSTIP:%TFTPPORT//invalid-file --trace-ascii log/traceit



#
# Verify pseudo protocol after the test has been "shot"


69


opcode: 1
filename: /invalid-file
mode: octet



curl-7.35.0/tests/data/test10520000644000175000017500000000365712213173003012764 00000000000000


HTTP
HTTP PUT
followlocation



# Server-side


HTTP/1.0 301 Redirect swsclose
Date: Thu, 29 Jul 2008 14:49:00 GMT
Server: test-server/fake
Location: data/10520002.txt?coolsite=yes
Content-Length: 0
Connection: close



HTTP/1.0 200 Followed here fine swsclose
Date: Thu, 29 Jul 2008 14:49:00 GMT
Server: test-server/fake
Content-Length: 51

If this is received, the location following worked


HTTP/1.0 301 Redirect swsclose
Date: Thu, 29 Jul 2008 14:49:00 GMT
Server: test-server/fake
Location: data/10520002.txt?coolsite=yes
Content-Length: 0
Connection: close

HTTP/1.0 200 Followed here fine swsclose
Date: Thu, 29 Jul 2008 14:49:00 GMT
Server: test-server/fake
Content-Length: 51

If this is received, the location following worked



# Client-side


http

 
HTTP 1.0 PUT with Location: following
 
 
http://%HOSTIP:%HTTPPORT/want/1052 -0 -L -T log/test1052.txt


Weird
     file
         to
   upload
for
   testing
the
   PUT
      feature



# Verify data after the test has been "shot"


^User-Agent:.*


# The primary reason libcurl sends the data part twice in this test is that
# the test HTTP server is blocking until it has read the entire request,
# including the full request-body before it responds. So in this test the
# server says 301 and 200 _after_ the entire PUT body has been sent.

PUT /want/1052 HTTP/1.0
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 78

Weird
     file
         to
   upload
for
   testing
the
   PUT
      feature
PUT /want/data/10520002.txt?coolsite=yes HTTP/1.0
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 78

Weird
     file
         to
   upload
for
   testing
the
   PUT
      feature



curl-7.35.0/tests/data/test2700000644000175000017500000000107012213173003012670 00000000000000


FTP
PASV
RETR


# Server-side


data
    to
      see
that FTP
works
  so does it?


PASVBADIP



# Client-side


ftp

 
FTP RETR PASV --ftp-skip-pasv-ip
 
 
ftp://%HOSTIP:%FTPPORT/270 --ftp-skip-pasv-ip --disable-epsv



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
PASV
TYPE I
SIZE 270
RETR 270
QUIT



curl-7.35.0/tests/data/test8630000644000175000017500000000065412262353672012727 00000000000000


POP3
RSET
CUSTOMREQUEST



#
# Server-side



#
# Client-side


pop3

 
POP3 RSET (CUSTOMREQUEST)
 
 
pop3://%HOSTIP:%POP3PORT -u user:secret -X RSET -I



#
# Verify data after the test has been "shot"


CAPA
USER user
PASS secret
RSET
QUIT



curl-7.35.0/tests/data/test20000644000175000017500000000131312213173003012521 00000000000000


HTTP
HTTP GET
HTTP Basic auth


#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes




#
# Client-side


http

 
HTTP GET with user and password
 
 
 -u fake:user http://%HOSTIP:%HTTPPORT/2



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /2 HTTP/1.1
Authorization: Basic ZmFrZTp1c2Vy
Host: %HOSTIP:%HTTPPORT
Accept: */*



[insert full protocol verifiction dump here]



curl-7.35.0/tests/data/test6130000644000175000017500000000174012213173003012675 00000000000000


SFTP
directory



#
# Server-side


d?????????    N U         U               N ???  N NN:NN .
d?????????    N U         U               N ???  N NN:NN ..
d?????????    N U         U               N ???  N NN:NN asubdir
-rw?rw?rw?    1 U         U              37 Jan  1  2000 plainfile.txt
-r-?r-?r-?    1 U         U              47 Dec 31  2000 rofile.txt



#
# Client-side


sftp


perl %SRCDIR/libtest/test613.pl prepare %PWD/log/test613.dir

 
SFTP directory retrieval
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/test613.dir/ --insecure


perl %SRCDIR/libtest/test613.pl postprocess %PWD/log/test613.dir %PWD/log/curl613.out



#
# Verify data after the test has been "shot"


disable



curl-7.35.0/tests/data/test10170000644000175000017500000000074312213173003012756 00000000000000


FILE
Range



# Server-side





# Client-side


none


file

 
0-Y range on a file:// URL to stdout
 
 
-r 0-3 file://localhost/%PWD/log/test1017.txt 


1234567890



# Verify data after the test has been "shot"


1234



curl-7.35.0/tests/data/test10580000644000175000017500000000144612213173003012764 00000000000000


HTTP
HTTP GET
Content-Range



# Server-side


HTTP/1.1 206 Partial Content
Date: Thu, 31 Jul 2008 13:41:09 GMT
Accept-Ranges: bytes
Content-Length: 101
Content-Range: bytes 100-200/201
Connection: close
Content-Type: text/html

..partial data returned from the
server as a result of setting an explicit byte range
in the request



# Client-side


http

 
HTTP range relative to end of file
 
 
http://%HOSTIP:%HTTPPORT/want/1058 -r -101



# Verify data after the test has been "shot"


^User-Agent:.*


GET /want/1058 HTTP/1.1
Range: bytes=-101
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test8500000644000175000017500000000075012262353672012720 00000000000000


POP3
RETR



#
# Server-side


From: me@somewhere
To: fake@nowhere

body

--
  yours sincerely



#
# Client-side


pop3

 
POP3 RETR message
 
 
pop3://%HOSTIP:%POP3PORT/850 -u user:secret



#
# Verify data after the test has been "shot"


CAPA
USER user
PASS secret
RETR 850
QUIT



curl-7.35.0/tests/data/test2050000644000175000017500000000072112262353672012710 00000000000000


FILE
FAILURE



# no Server-side

# Client-side


file

 
"upload" with file://
 
 
file://localhost/%PWD/log/nonexisting/result205.txt -T log/upload205.txt


data
in
file
to
write



# Verify data after the test has been "shot"

# 23 => CURLE_WRITE_ERROR

23



curl-7.35.0/tests/data/test2470000644000175000017500000000112312213173003012673 00000000000000


FTP





213 20030409102659



# Client-side


ftp

 
FTP upload time condition evaluates TRUE => skip upload
 

data
    to
      see
that FTP
works
  so does it?

 
ftp://%HOSTIP:%FTPPORT/247 -T log/test247.txt -z "apr 1 2005 08:00:00"



# Verify data after the test has been "shot"




USER anonymous
PASS ftp@example.com
PWD
MDTM 247
QUIT



curl-7.35.0/tests/data/test1350000644000175000017500000000114212213173003012670 00000000000000


FTP
EPSV
RETR
Range


# Server-side


0123456789abcdef
0123456789abcdef
0123456789abcdef
0123456789abcdef


0123456789abc


64



# Client-side


ftp

 
FTP retrieve a byte-range
 
 
-r 4-16 ftp://%HOSTIP:%FTPPORT/135



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
SIZE 135
REST 4
RETR 135
ABOR
QUIT



curl-7.35.0/tests/data/test20290000644000175000017500000001356612270035364013003 00000000000000


HTTP
HTTP GET
HTTP Basic auth
HTTP NTLM auth


# Server-side






HTTP/1.1 401 Need Basic or NTLM auth
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 27
WWW-Authenticate: NTLM
WWW-Authenticate: Basic realm="testrealm"

This is not the real page!



HTTP/1.1 401 NTLM intermediate
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 33
WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=

This is still not the real page!



HTTP/1.1 401 Sorry wrong password
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: Basic realm="testrealm"
WWW-Authenticate: NTLM

This is a bad password page!




HTTP/1.1 200 Things are fine in server land
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!




HTTP/1.1 401 Need Basic or NTLM auth (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 27
WWW-Authenticate: NTLM
WWW-Authenticate: Basic realm="testrealm"

This is not the real page!



HTTP/1.1 401 NTLM intermediate (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 33
WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=

This is still not the real page!



HTTP/1.1 401 Sorry wrong password (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: Basic realm="testrealm"
WWW-Authenticate: NTLM

This is a bad password page!




HTTP/1.1 401 Sorry wrong password (3)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: NTLM
WWW-Authenticate: Basic realm="testrealm"

This is a bad password page!




HTTP/1.1 200 Things are fine in server land (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!



HTTP/1.1 401 NTLM intermediate
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 33
WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=

HTTP/1.1 401 Sorry wrong password
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: Basic realm="testrealm"
WWW-Authenticate: NTLM

This is a bad password page!
HTTP/1.1 200 Things are fine in server land
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!
HTTP/1.1 401 NTLM intermediate (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 33
WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=

HTTP/1.1 401 Sorry wrong password (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: Basic realm="testrealm"
WWW-Authenticate: NTLM

This is a bad password page!
HTTP/1.1 401 Sorry wrong password (3)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: NTLM
WWW-Authenticate: Basic realm="testrealm"

This is a bad password page!
HTTP/1.1 200 Things are fine in server land (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!




# Client-side


NTLM
!SSPI


http


libauthretry


 
HTTP authorization retry (NTLM switching to Basic)
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
http://%HOSTIP:%HTTPPORT/2029 ntlm basic


chkhostname curlhost



# Verify data after the test has been "shot"


^User-Agent:.*


GET /20290100 HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20290100 HTTP/1.1
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q=
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20290200 HTTP/1.1
Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20290300 HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20290300 HTTP/1.1
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q=
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20290400 HTTP/1.1
Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20290500 HTTP/1.1
Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test20320000644000175000017500000000622412270035364012766 00000000000000


HTTP
HTTP GET
HTTP Basic auth
HTTP NTLM auth


# Server-side




HTTP/1.1 401 Need Basic or NTLM auth
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: NTLM
WWW-Authenticate: Basic realm="testrealm"

This is a bad password page!




HTTP/1.1 401 Need Basic or NTLM auth (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 27
WWW-Authenticate: NTLM
WWW-Authenticate: Basic realm="testrealm"

This is not the real page!



HTTP/1.1 401 NTLM intermediate (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 33
WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=

This is still not the real page!



HTTP/1.1 200 Things are fine in server land
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!



HTTP/1.1 401 Need Basic or NTLM auth
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: NTLM
WWW-Authenticate: Basic realm="testrealm"

This is a bad password page!
HTTP/1.1 401 Need Basic or NTLM auth
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: NTLM
WWW-Authenticate: Basic realm="testrealm"

This is a bad password page!
HTTP/1.1 401 NTLM intermediate (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 33
WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=

HTTP/1.1 200 Things are fine in server land
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!




# Client-side


NTLM
!SSPI


http


libntlmconnect


 
NTLM connection mapping
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
http://%HOSTIP:%HTTPPORT/2032


chkhostname curlhost



# Verify data after the test has been "shot"


^User-Agent:.*


GET /20320100 HTTP/1.1
Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
Host: 127.0.0.1:%HTTPPORT
Accept: */*

GET /20320100 HTTP/1.1
Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
Host: 127.0.0.1:%HTTPPORT
Accept: */*

GET /20320200 HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
Host: 127.0.0.1:%HTTPPORT
Accept: */*

GET /20320200 HTTP/1.1
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q=
Host: 127.0.0.1:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test5310000644000175000017500000000154312213173003012675 00000000000000


FTP
PORT
STOR
multi



# Server-side




REPLY STOR 425 Permission Denied. File Exists.



# Client-side


ftp


lib525

 
FTP PORT upload using multi interface and get 425 response
 
 
ftp://%HOSTIP:%FTPPORT/path/531 log/upload531


Moooooooooooo
don't upload this



# Verify data after the test has been "shot"

# Strip all valid kinds of PORT and EPRT that curl can send

^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|


USER anonymous
PASS ftp@example.com
PWD
CWD path
PORT 127,0,0,1,5,109
TYPE I
STOR 531
QUIT




curl-7.35.0/tests/data/test14120000644000175000017500000000543112213173003012754 00000000000000


HTTP
HTTP GET
HTTP Digest auth
--anyauth



# Server-side


auth_required


HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
Content-Type: text/html; charset=iso-8859-1
Connection: close

This is not the real page


# This is supposed to be returned when the server gets a
# Authorization: Digest line passed-in from the client

HTTP/1.1 200 OK swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 23
Connection: close

This IS the real page!


# This is the second request

HTTP/1.1 200 OK swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 23
Connection: close

This IS the second real page!



HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
Content-Type: text/html; charset=iso-8859-1
Connection: close

HTTP/1.1 200 OK swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 23
Connection: close

This IS the real page!




# Client-side


http


crypto

 
HTTP GET with --anyauth with two URLs (picking Digest) 
 
 
http://%HOSTIP:%HTTPPORT/1412 -u testuser:testpass --anyauth http://%HOSTIP:%HTTPPORT/14120001


This is data we upload with PUT
a second line
line three
four is the number of lines



# Verify data after the test has been "shot"


^User-Agent:.*


GET /1412 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /1412 HTTP/1.1
Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/1412", response="0390dbe89e31adca0413d11f91f30e7f"
User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /14120001 HTTP/1.1
Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/14120001", response="0085df91870374c8bf4e94415e7fbf8e"
User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test12060000644000175000017500000000117612213173003012757 00000000000000


FTP
PORT
RETR
NODATACONN425


# Server-side


some bytes


NODATACONN425



# Client-side


ftp

 
FTP PORT and 425 on download
 
 
--max-time %FTPTIME2 ftp://%HOSTIP:%FTPPORT/1206 -P -




# Verify data after the test has been "shot"


s/^EPRT \|1\|(.*)/EPRT \|1\|/


USER anonymous
PASS ftp@example.com
PWD
EPRT |1|
TYPE I
SIZE 1206
RETR 1206
QUIT


10



curl-7.35.0/tests/data/test10950000644000175000017500000000343512213173003012765 00000000000000


HTTP
HTTP GET
HTTP Digest auth


# Server-side


HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Digest realm="test \"this\" realm!!", nonce="1053604145"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 26

This is not the real page


# This is supposed to be returned when the server gets a
# Authorization: Digest line passed-in from the client

HTTP/1.1 200 OK swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 23

This IS the real page!



HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Digest realm="test \"this\" realm!!", nonce="1053604145"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 26

HTTP/1.1 200 OK swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 23

This IS the real page!




# Client-side


http


crypto

 
HTTP with Digest and realm with quoted quotes
 
 
http://%HOSTIP:%HTTPPORT/1095 -u testuser:testpass --digest



# Verify data after the test has been "shot"


^User-Agent:.*


GET /1095 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /1095 HTTP/1.1
Authorization: Digest username="testuser", realm="test \"this\" realm!!", nonce="1053604145", uri="/1095", response="a1c7931ece9e8617bae2715045e4f49f"
User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test2390000644000175000017500000000565312270035364012722 00000000000000


HTTP
HTTP POST
HTTP proxy
HTTP proxy NTLM auth



# Server-side


# this is returned first since we get no proxy-auth

HTTP/1.1 407 Authorization Required to proxy me my dear
Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
Content-Length: 34

Hey you, authenticate or go away!


# This is supposed to be returned when the server gets the second
# Authorization: NTLM line passed-in from the client

HTTP/1.1 200 Things are fine in proxy land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 42

Contents of that page you requested, sir.



HTTP/1.1 407 Authorization Required to proxy me my dear
Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
Content-Length: 34

HTTP/1.1 200 Things are fine in proxy land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 42

Contents of that page you requested, sir.



# Client-side


http


NTLM
!SSPI

 
HTTP proxy-auth NTLM and then POST
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
http://%HOSTIP:%HTTPPORT/239 --proxy http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-ntlm -d "postit"


chkhostname curlhost



# Verify data after the test has been "shot"


^User-Agent: curl/.*


POST http://%HOSTIP:%HTTPPORT/239 HTTP/1.1
Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
Host: %HOSTIP:%HTTPPORT
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

POST http://%HOSTIP:%HTTPPORT/239 HTTP/1.1
Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAKAeQjzKtCQ7ubW8S6MN7B59436GAxPu0CVROwwNBsgxML49gcbAXLT/bU+H5wrS9XNpbGx5Y3VybGhvc3Q=
User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
Host: %HOSTIP:%HTTPPORT
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 6
Content-Type: application/x-www-form-urlencoded

postit



curl-7.35.0/tests/data/test12090000644000175000017500000000177612213173003012770 00000000000000


FTP
PORT
RETR
NODATACONN


# Server-side


some bytes


NODATACONN



# Client-side


ftp

 
FTP PORT download, no data conn and no positive preliminary reply
 
 
--max-time %FTPTIME2 ftp://%HOSTIP:%FTPPORT/1209 -P -




# Verify data after the test has been "shot"


s/^EPRT \|1\|(.*)/EPRT \|1\|/


# The protocol part does not include QUIT simply because the error is
# CURLE_OPERATION_TIMEDOUT (28) which is a generic timeout error without
# specificly saying for which connection it concerns, and for timeouts libcurl
# marks the control channel as "invalid". As this test case times out for the
# data connection it could still use the control channel.

USER anonymous
PASS ftp@example.com
PWD
EPRT |1|
TYPE I
SIZE 1209
RETR 1209


28



curl-7.35.0/tests/data/test2430000644000175000017500000000755712270035364012722 00000000000000


HTTP
HTTP GET
HTTP proxy
HTTP proxy NTLM auth
--proxy-anyauth



# Server-side



HTTP/1.1 407 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"
Proxy-Authenticate: NTLM
Content-Type: text/html; charset=iso-8859-1
Connection: close

This is not the real page


# this is returned first since we get no proxy-auth

HTTP/1.1 407 Authorization Required to proxy me my dear
Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
Content-Length: 34

Hey you, authenticate or go away!


# This is supposed to be returned when the server gets the second
# Authorization: NTLM line passed-in from the client

HTTP/1.1 200 Things are fine in proxy land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 42

Contents of that page you requested, sir.



HTTP/1.1 407 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"
Proxy-Authenticate: NTLM
Content-Type: text/html; charset=iso-8859-1
Connection: close

HTTP/1.1 407 Authorization Required to proxy me my dear
Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
Content-Length: 34

HTTP/1.1 200 Things are fine in proxy land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 42

Contents of that page you requested, sir.



# Client-side


http


NTLM
!SSPI

 
HTTP POST with --proxy-anyauth, picking NTLM
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
http://%HOSTIP:%HTTPPORT/243 --proxy http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-anyauth -d "postit"


chkhostname curlhost



# Verify data after the test has been "shot"


^User-Agent: curl/.*


POST http://%HOSTIP:%HTTPPORT/243 HTTP/1.1
User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
Host: %HOSTIP:%HTTPPORT
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 6
Content-Type: application/x-www-form-urlencoded

postitPOST http://%HOSTIP:%HTTPPORT/243 HTTP/1.1
Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
Host: %HOSTIP:%HTTPPORT
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

POST http://%HOSTIP:%HTTPPORT/243 HTTP/1.1
Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAKAeQjzKtCQ7ubW8S6MN7B59436GAxPu0CVROwwNBsgxML49gcbAXLT/bU+H5wrS9XNpbGx5Y3VybGhvc3Q=
User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
Host: %HOSTIP:%HTTPPORT
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 6
Content-Type: application/x-www-form-urlencoded

postit



curl-7.35.0/tests/data/test10830000644000175000017500000000163712213173003012764 00000000000000


HTTP
HTTP GET
--interface
IPv6



#
# Server-side


HTTP/1.1 200 OK
Date: Mon, 28 Jul 2008 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/plain

-foo-



#
# Client-side


ipv6


http-ipv6

 
HTTP-IPv6 GET with ip6-localhost --interface
 
 
-g "http://%HOST6IP:%HTTP6PORT/1083" --interface ip6-localhost


perl -e "if ('%CLIENT6IP' ne '[::1]') {print 'Test requires default test server host address';} else {exec './server/resolve --ipv6 ip6-localhost'; print 'Cannot run precheck resolve';}"



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1083 HTTP/1.1
Host: %HOST6IP:%HTTP6PORT
Accept: */*




curl-7.35.0/tests/data/test5850000644000175000017500000000172112213173003012704 00000000000000


HTTP
HTTP GET
multi
CURLOPT_OPENSOCKETFUNCTION
CURLOPT_CLOSESOCKETFUNCTION



# Server-side


HTTP/1.1 302 eat this!
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Location: this-is-the-first.html
Content-Length: 0
Connection: close



[OPEN] counter: 1
HTTP/1.1 302 eat this!
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Location: this-is-the-first.html
Content-Length: 0
Connection: close

[CLOSE] counter: 1



# Client-side


http


http

# tool is what to use instead of 'curl'

lib585


 
socket open/close callbacks
 
 
http://%HOSTIP:%HTTPPORT/585



# Verify data after the test has been "shot"


^User-Agent:.*


GET /585 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test6390000644000175000017500000000151012213173003012700 00000000000000


SFTP
post-quote
acceptfail
asterisk



#
# Server-side


Dummy test file for rename test



#
# Client-side


sftp


perl %SRCDIR/libtest/test610.pl mkdir %PWD/log/test639.dir

 
SFTP post-quote rename * asterisk accept-fail
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "-*rename %PWD/log/test639-not-exists-dir %PWD/log/test639.new" sftp://%HOSTIP:%SSHPORT%PWD/log/file639.txt --insecure


perl %SRCDIR/libtest/test610.pl rmdir %PWD/log/test639.dir


Dummy test file for rename test



#
# Verify data after the test has been "shot"


disable



curl-7.35.0/tests/data/test8240000644000175000017500000000144612262353672012724 00000000000000


IMAP
IMAP AUTH OAUTH2
RFC6749



#
# Server-side


AUTH XOAUTH2
REPLY AUTHENTICATE +
REPLY dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB A002 OK AUTHENTICATE completed


From: me@somewhere
To: fake@nowhere

body

--
  yours sincerely



#
# Client-side


imap

 
IMAP OAuth 2.0 authentication
 
 
'imap://%HOSTIP:%IMAPPORT/824/;UID=1' -u user --oauth2-bearer mF_9.B5f-4.1JqM



#
# Verify data after the test has been "shot"


A001 CAPABILITY
A002 AUTHENTICATE XOAUTH2
dXNlcj11c2VyAWF1dGg9QmVhcmVyIG1GXzkuQjVmLTQuMUpxTQEB
A003 SELECT 824
A004 FETCH 1 BODY[]
A005 LOGOUT



curl-7.35.0/tests/data/test6320000644000175000017500000000074412213173003012701 00000000000000


SFTP
FAILURE
server key check



#
# Client-side


none


sftp

 
SFTP syntactically invalid host key
 
 
--hostpubmd5 00 --key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/irrelevant-file --insecure



#
# Verify data after the test has been "shot"


2



curl-7.35.0/tests/data/test630000644000175000017500000000145612213173003012620 00000000000000


HTTP
HTTP GET
HTTP proxy
HTTP proxy Basic auth


# Server-side


HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Type: text/html
Content-Length: 26

the content would go here



# Client-side


http

 
HTTP with proxy authorization set in environment
 

http_proxy=http://fake:user@%HOSTIP:%HTTPPORT/

 
http://we.want.that.site.com/63



# Verify data after the test has been "shot"


^User-Agent:.*


GET http://we.want.that.site.com/63 HTTP/1.1
Proxy-Authorization: Basic ZmFrZTp1c2Vy
Host: we.want.that.site.com
Accept: */*
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test12110000644000175000017500000000114412213173003012746 00000000000000


FTP
PORT
RETR
NODATACONN425


# Server-side


some bytes


NODATACONN425



# Client-side


ftp

 
FTP PORT and 425 on download
 
 
ftp://%HOSTIP:%FTPPORT/1211 -P -




# Verify data after the test has been "shot"


s/^EPRT \|1\|(.*)/EPRT \|1\|/



USER anonymous
PASS ftp@example.com
PWD
EPRT |1|
TYPE I
SIZE 1211
RETR 1211


28



curl-7.35.0/tests/data/test390000644000175000017500000000474012213173003012622 00000000000000


HTTP
HTTP FORMPOST


# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 10

blablabla



# Client-side


http

 
HTTP RFC1867-type formposting with filename= and type=
 
 
http://%HOSTIP:%HTTPPORT/we/want/39 -F name=daniel -F tool=curl --form-string "str1=@literal" --form-string "str2=
# We create this file before the command is invoked!

foo bar
This is a bar foo
bar
foo



# Verify data after the test has been "shot"


^(User-Agent:|Content-Type: multipart/form-data;|-------).*


POST /we/want/39 HTTP/1.1
User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 1184
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32

------------------------------24e78000bd32
Content-Disposition: form-data; name="name"

daniel
------------------------------24e78000bd32
Content-Disposition: form-data; name="tool"

curl
------------------------------24e78000bd32
Content-Disposition: form-data; name="str1"

@literal
------------------------------24e78000bd32
Content-Disposition: form-data; name="str2"




curl-7.35.0/tests/data/test13570000644000175000017500000000360012270035364012772 00000000000000


FTP
RETR



# Server-side

# file1357 contents...

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1357; charset=funny; option=strange

MOOOO



# Client-side

# this relies on the debug feature to allow us to set directory to store the
# -O output in, using the CURL_TESTDIR variable

debug


ftp


FTP download, file with C-D inside, using -O -D file


CURL_TESTDIR=%PWD/log


ftp://%HOSTIP:%FTPPORT/path/file1357 -O -D log/heads1357


perl %SRCDIR/libtest/notexists.pl log/name1357



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1357
RETR file1357
QUIT



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1357; charset=funny; option=strange

MOOOO



220-        _   _ ____  _     
220-    ___| | | |  _ \| |    
220-   / __| | | | |_) | |    
220-  | (__| |_| |  _ {| |___ 
220    \___|\___/|_| \_\_____|
331 We are happy you popped in!
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 214
150 Binary data connection for 1357 () (214 bytes).
226 File transfer complete


s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/







curl-7.35.0/tests/data/test2330000644000175000017500000000332312213173003012672 00000000000000


HTTP
HTTP proxy
HTTP Basic auth
HTTP proxy Basic auth
followlocation


#
# Server-side


HTTP/1.1 302 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
Location: http://goto.second.host.now/2330002
Content-Length: 8
Connection: close

contents


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
Content-Length: 9

contents



HTTP/1.1 302 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
Location: http://goto.second.host.now/2330002
Content-Length: 8
Connection: close

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
Content-Length: 9

contents



#
# Client-side


http

 
HTTP, proxy, site+proxy auth and Location: to new host
 
 
http://first.host.it.is/we/want/that/page/233 -x %HOSTIP:%HTTPPORT --user iam:myself --proxy-user testing:this --location



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET http://first.host.it.is/we/want/that/page/233 HTTP/1.1
Proxy-Authorization: Basic dGVzdGluZzp0aGlz
Authorization: Basic aWFtOm15c2VsZg==
Host: first.host.it.is
Accept: */*
Proxy-Connection: Keep-Alive

GET http://goto.second.host.now/2330002 HTTP/1.1
Proxy-Authorization: Basic dGVzdGluZzp0aGlz
Host: goto.second.host.now
Accept: */*
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test100000644000175000017500000000146112213173003012604 00000000000000


HTTP
HTTP PUT


# Server-side


HTTP/1.0 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake

blablabla




# Client-side


http

 
simple HTTP PUT from file
 
 
http://%HOSTIP:%HTTPPORT/we/want/10 -T log/test10.txt


Weird
     file
         to
   upload
for
   testing
the
   PUT
      feature



# Verify data after the test has been "shot"


^User-Agent:.*


PUT /we/want/10 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 78
Expect: 100-continue

Weird
     file
         to
   upload
for
   testing
the
   PUT
      feature



curl-7.35.0/tests/data/test15070000644000175000017500000000112512262353672012775 00000000000000


SMTP
multi



#
# Server-side



#
# Client-side


smtp


lib1507


# based on bug report #1184
 
SMTP with multi interface and CURLE_ABORTED_BY_CALLBACK
 

From: different
To: another

body

 
smtp://%HOSTIP:%SMTPPORT/1507



#
# Verify data after the test has been "shot"


EHLO 1507
MAIL FROM:<1507-realuser@example.com>
RCPT TO:<1507-recipient@example.com>
DATA





curl-7.35.0/tests/data/test1080000644000175000017500000000145012213173003012672 00000000000000


FTP
PORT
STOR


# Server-side





# Client-side


ftp

 
FTP PORT upload with CWD
 
 
ftp://%HOSTIP:%FTPPORT/CWD/STOR/RETR/108 -T log/upload108 -P -


Moooooooooooo
 upload this



# Verify data after the test has been "shot"

# Strip all valid kinds of PORT and EPRT that curl can send

^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|


USER anonymous
PASS ftp@example.com
PWD
CWD CWD
CWD STOR
CWD RETR
PORT 127,0,0,1,5,109
TYPE I
STOR 108
QUIT


Moooooooooooo
 upload this



curl-7.35.0/tests/data/test2250000644000175000017500000000055712213173003012701 00000000000000


FTP
FAILURE


# Client-side


ftp

 
FTP %0a-code in URL's name part
 
 
ftp://bad%0auser:passwd@%HOSTIP:%FTPPORT/225%0a



# Verify data after the test has been "shot"

# 3 == CURLE_URL_MALFORMAT

3



curl-7.35.0/tests/data/test15080000644000175000017500000000060712213173003012762 00000000000000


HTTP
multi



# Client-side


none


lib1508

 
Close a multi handle without using it
 
 
http://%HOSTIP:%HTTPPORT/path/1508



# Verify data after the test has been "shot"


We are done



curl-7.35.0/tests/data/test2810000644000175000017500000000163512213173003012701 00000000000000


HTTP
HTTP PUT


# Server-side


HTTP/1.1 100 Continue

HTTP/1.1 401 Bad Auth swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
WWW-Authenticate: Basic Realm=authenticate
Server: test-server/fake


HTTP/1.1 100 Continue





# Client-side


http

 
HTTP PUT from file with 100 + 401 responses and -f without auth given
 
 
http://%HOSTIP:%HTTPPORT/we/want/281 -f -T log/test281.txt


Weird
     file
         to
   upload



# Verify data after the test has been "shot"


22


^User-Agent:.*


PUT /we/want/281 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 38
Expect: 100-continue

Weird
     file
         to
   upload



curl-7.35.0/tests/data/test5940000644000175000017500000000204412213173003012703 00000000000000#
# For this test the server rejects the EPRT command,
# code in lib591 makes use of curl_multi_timeout()
# and server does not establish data connection.
#



FTP
PORT
STOR
multi
EPRT refused
NODATACONN



# Server-side




NODATACONN
REPLY EPRT 500 we don't like EPRT now



# Client-side


ftp


lib591

 
FTP multi PORT upload, no data conn and no positive prelim. reply
 
 
ftp://%HOSTIP:%FTPPORT/path/594 %FTPTIME2 log/upload594


Moooooooooooo for 594
 upload this



# Verify data after the test has been "shot"

# Strip off parts of the PORT and EPRT commands that might differ

s/^PORT (.*)/PORT/
s/^EPRT \|1\|(.*)/EPRT \|1\|/


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPRT |1|
PORT
TYPE I
STOR 594
QUIT


28





curl-7.35.0/tests/data/test10900000644000175000017500000000301012213173003012745 00000000000000


HTTP
HTTP GET
followlocation
chunked Transfer-Encoding
--write-out



#
# Server-side


HTTP/1.1 302 OK swsbounce swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 8
Connection: close
Content-Type: text/plain
Location: ./10900001

monster


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Transfer-Encoding: chunked
Connection: close
Content-Type: text/plain; charset=us-ascii

0007
bigger 
0008
monster

0





#
# Client-side


http

 
HTTP GET --write-out with redirected fetch and chunked reply
 
 
http://%HOSTIP:%HTTPPORT/1090 -w "%{num_connects}\n%{num_redirects}\n%{size_download}\n%{url_effective}\n%{content_type}\n%{response_code}\n" -L



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1090 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /10900001 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




HTTP/1.1 302 OK swsbounce swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 8
Connection: close
Content-Type: text/plain
Location: ./10900001

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Transfer-Encoding: chunked
Connection: close
Content-Type: text/plain; charset=us-ascii

bigger monster
2
1
15
http://%HOSTIP:%HTTPPORT/10900001
text/plain; charset=us-ascii
200




curl-7.35.0/tests/data/test20090000644000175000017500000000473712213173003012767 00000000000000


Metalink
HTTP
HTTP GET
-J



#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 21 Jun 2012 16:27:17 GMT
Server: test-server/fake
Content-Length: 46
Connection: close
Content-Type: text/html
Content-Disposition: filename=name2009; charset=funny; option=strange
Funny-head: yesyes

Some contents delivered from an HTTP resource



#
# Client-side


file
Metalink


http

 
Metalink local XML file, HTTP resource, using -o fname -J -D file
 

--metalink file://%PWD/log/test2009.metalink -J -o log/outfile2009 -D log/heads2009

# local metalink file written before test command runs



 
  
   
    we-only-check-the-strongest-hash-provided
    e4c5b83384ba7d5f8e201d61747a14f29baacd7dfadce0fbd56661db4bba72b2
   
   
    http://%HOSTIP:%HTTPPORT/2009
   
  
 



perl %SRCDIR/libtest/notexists.pl log/2009 log/name2009 log/outfile2009



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /2009 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*



Some contents delivered from an HTTP resource


HTTP/1.1 200 OK
Date: Thu, 21 Jun 2012 16:27:17 GMT
Server: test-server/fake
Content-Length: 46
Connection: close
Content-Type: text/html
Content-Disposition: filename=name2009; charset=funny; option=strange
Funny-head: yesyes





Metalink: parsing (file://%PWD/log/test2009.metalink) metalink/XML...
Metalink: parsing (file://%PWD/log/test2009.metalink) OK
Metalink: fetching (log/download2009) from (http://%HOSTIP:%HTTPPORT/2009)...
Metalink: fetching (log/download2009) from (http://%HOSTIP:%HTTPPORT/2009) OK
Metalink: validating (log/download2009)...
Metalink: validating (log/download2009) [sha-256] OK


$_ = '' if (($_ !~ /^Metalink: /) && ($_ !~ /error/i) && ($_ !~ /warn/i))



curl-7.35.0/tests/data/test1750000644000175000017500000000340712213173003012702 00000000000000


HTTP
HTTP POST
HTTP Digest auth



# Server-side


HTTP/1.1 200 beng swsclose swsbounce
Server: Microsoft-IIS/6.0
Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth
Content-Type: text/html; charset=iso-8859-1

This is not the real page



HTTP/1.1 200 moo swsclose
Server: Microsoft-IIS/6.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 16

content for you



HTTP/1.1 200 beng swsclose swsbounce
Server: Microsoft-IIS/6.0
Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 200 moo swsclose
Server: Microsoft-IIS/6.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 16

content for you




# Client-side

# 

http


crypto

 
HTTP POST --digest to server not requiring any auth at all
 
 
http://%HOSTIP:%HTTPPORT/175 -u auser:apasswd --digest -d "junkelijunk"



# Verify data after the test has been "shot"


^User-Agent:.*


POST /175 HTTP/1.1
User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

POST /175 HTTP/1.1
User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 11
Content-Type: application/x-www-form-urlencoded

junkelijunk



curl-7.35.0/tests/data/test19030000644000175000017500000000163712271275507013005 00000000000000


HTTP
pipelining
multi



# Server-side


Adding handle 0
Handle 0 Completed with status 0
Adding handle 1
Adding handle 2
Adding handle 3
Adding handle 4
Adding handle 5
Adding handle 6
Handle 2 Completed with status 0
Handle 3 Completed with status 0
Handle 4 Completed with status 0
Handle 5 Completed with status 0
Handle 6 Completed with status 0
Handle 1 Completed with status 0



# Client-side


http-pipe


http


lib1900

 
HTTP GET using pipelining, penalized on content-length
 
 
http://%HOSTIP:%HTTPPIPEPORT/


0 1k.txt
1000 100k.txt
550 alphabet.txt
10 alphabet.txt
10 alphabet.txt
10 alphabet.txt
10 alphabet.txt



# Verify data after the test has been "shot"



curl-7.35.0/tests/data/test50000644000175000017500000000127212213173003012530 00000000000000


HTTP
HTTP GET
HTTP proxy


#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes




#
# Client-side


http

 
HTTP over proxy
 
 
http://%HOSTIP:%HTTPPORT/we/want/that/page/5#5 -x %HOSTIP:%HTTPPORT



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET http://%HOSTIP:%HTTPPORT/we/want/that/page/5 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test690000644000175000017500000000663712270035364012646 00000000000000


HTTP
HTTP GET
HTTP NTLM auth


# Server-side


HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Basic
WWW-Authenticate: Wild-and-crazy
WWW-Authenticate: NTLM
Content-Type: text/html; charset=iso-8859-1
Content-Length: 26

This is not the real page


# This is supposed to be returned when the server gets a first
# Authorization: NTLM line passed-in from the client

HTTP/1.1 401 Now gimme that second request of crap
Server: Microsoft-IIS/5.0
Content-Length: 34
Content-Type: text/html; charset=iso-8859-1
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

This is not the real page either!


# This is supposed to be returned when the server gets the second
# Authorization: NTLM line passed-in from the client

HTTP/1.1 200 Things are fine in server land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!



HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Basic
WWW-Authenticate: Wild-and-crazy
WWW-Authenticate: NTLM
Content-Type: text/html; charset=iso-8859-1
Content-Length: 26

HTTP/1.1 401 Now gimme that second request of crap
Server: Microsoft-IIS/5.0
Content-Length: 34
Content-Type: text/html; charset=iso-8859-1
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

HTTP/1.1 200 Things are fine in server land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!




# Client-side


NTLM
!SSPI


http

 
HTTP with NTLM, Basic or Wild-and-crazy authorization
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
http://%HOSTIP:%HTTPPORT/69 -u testuser:testpass --anyauth


chkhostname curlhost



# Verify data after the test has been "shot"


^User-Agent:.*


GET /69 HTTP/1.1
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /69 HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /69 HTTP/1.1
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test13850000644000175000017500000000137712213173003012772 00000000000000


FTP
RETR



# Server-side


fooo
mooo



# Client-side


ftp


FTP DL, file without C-D inside, using -o fname -i, without -D


ftp://%HOSTIP:%FTPPORT/path/file1385 -o log/download1385 -i


perl %SRCDIR/libtest/notexists.pl log/file1385



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1385
RETR file1385
QUIT



fooo
mooo







curl-7.35.0/tests/data/test7070000644000175000017500000000226312213173003012702 00000000000000
#based off test 100


FTP
PASV
LIST
SOCKS5


#
# Server-side

# When doing LIST, we get the default list output hard-coded in the test
# FTP server

total 20
drwxr-xr-x   8 98       98           512 Oct 22 13:06 .
drwxr-xr-x   8 98       98           512 Oct 22 13:06 ..
drwxr-xr-x   2 98       98           512 May  2  1996 .NeXT
-r--r--r--   1 0        1             35 Jul 16  1996 README
lrwxrwxrwx   1 0        1              7 Dec  9  1999 bin -> usr/bin
dr-xr-xr-x   2 0        1            512 Oct  1  1997 dev
drwxrwxrwx   2 98       98           512 May 29 16:04 download.html
dr-xr-xr-x   2 0        1            512 Nov 30  1995 etc
drwxrwxrwx   2 98       1            512 Oct 30 14:33 pub
dr-xr-xr-x   5 0        1            512 Oct  1  1997 usr



#
# Client-side


ftp
socks5

 
FTP dir list PASV via SOCKS5
 
 
--socks5 %HOSTIP:%SOCKSPORT ftp://%HOSTIP:%FTPPORT/



#
# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE A
LIST
QUIT



curl-7.35.0/tests/data/test20280000644000175000017500000002036612270035364012776 00000000000000


HTTP
HTTP GET
HTTP Digest auth
HTTP NTLM auth


# Server-side






HTTP/1.1 401 Need Digest or NTLM auth
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 27
WWW-Authenticate: NTLM
WWW-Authenticate: Digest realm="testrealm", nonce="1"

This is not the real page!



HTTP/1.1 401 Sorry wrong password
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: Digest realm="testrealm", nonce="2"
WWW-Authenticate: NTLM

This is a bad password page!




HTTP/1.1 401 Need Digest or NTLM auth (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 27
WWW-Authenticate: NTLM
WWW-Authenticate: Digest realm="testrealm", nonce="3"

This is not the real page!



HTTP/1.1 401 NTLM intermediate
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 33
WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=

This is still not the real page!



HTTP/1.1 200 Things are fine in server land
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!




HTTP/1.1 401 Need Digest or NTLM auth (3)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 27
WWW-Authenticate: Digest realm="testrealm", nonce="4"
WWW-Authenticate: NTLM

This is not the real page!



HTTP/1.1 401 Sorry wrong password (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: NTLM
WWW-Authenticate: Digest realm="testrealm", nonce="5"

This is a bad password page!




HTTP/1.1 401 Need Digest or NTLM auth (4)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 27
WWW-Authenticate: Digest realm="testrealm", nonce="6"
WWW-Authenticate: NTLM

This is not the real page!



HTTP/1.1 401 NTLM intermediate (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 33
WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=

This is still not the real page!



HTTP/1.1 401 Sorry wrong password (3)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: NTLM
WWW-Authenticate: Digest realm="testrealm", nonce="7"

This is a bad password page!




HTTP/1.1 401 Need Digest or NTLM auth (5)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 27
WWW-Authenticate: Digest realm="testrealm", nonce="8"
WWW-Authenticate: NTLM

This is not the real page!



HTTP/1.1 401 NTLM intermediate (3)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 33
WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=

This is still not the real page!



HTTP/1.1 200 Things are fine in server land (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!



HTTP/1.1 401 Need Digest or NTLM auth
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 27
WWW-Authenticate: NTLM
WWW-Authenticate: Digest realm="testrealm", nonce="1"

HTTP/1.1 401 Sorry wrong password
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: Digest realm="testrealm", nonce="2"
WWW-Authenticate: NTLM

This is a bad password page!
HTTP/1.1 401 NTLM intermediate
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 33
WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=

HTTP/1.1 200 Things are fine in server land
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!
HTTP/1.1 401 Need Digest or NTLM auth (3)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 27
WWW-Authenticate: Digest realm="testrealm", nonce="4"
WWW-Authenticate: NTLM

HTTP/1.1 401 Sorry wrong password (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: NTLM
WWW-Authenticate: Digest realm="testrealm", nonce="5"

This is a bad password page!
HTTP/1.1 401 NTLM intermediate (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 33
WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=

HTTP/1.1 401 Sorry wrong password (3)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29
WWW-Authenticate: NTLM
WWW-Authenticate: Digest realm="testrealm", nonce="7"

This is a bad password page!
HTTP/1.1 401 NTLM intermediate (3)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 33
WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAAAGggEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg=

HTTP/1.1 200 Things are fine in server land (2)
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 32

Finally, this is the real page!




# Client-side


NTLM
!SSPI


http


libauthretry


 
HTTP authorization retry (Digest switching to NTLM)
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
http://%HOSTIP:%HTTPPORT/2028 digest ntlm


chkhostname curlhost



# Verify data after the test has been "shot"


^User-Agent:.*


GET /20280100 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20280100 HTTP/1.1
Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/20280100", response="53c80666f5e3a4a55f92a66aaf0078bb"
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20280200 HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20280200 HTTP/1.1
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q=
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20280300 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20280300 HTTP/1.1
Authorization: Digest username="testuser", realm="testrealm", nonce="4", uri="/20280300", response="1aa5d90da9803ca12d04b24e0f19476e"
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20280400 HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20280400 HTTP/1.1
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q=
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20280500 HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /20280500 HTTP/1.1
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoIBAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q=
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test5620000644000175000017500000000133212213173003012675 00000000000000


FTP
PASV
RETR


# Server-side


silly data
over FTP



# Client-side


ftp


lib562

 
FTP a type=A URL and CURLOPT_PORT set
 

# note that we need quotes around the URL below to make sure the shell doesn't
# treat the semicolon as a separator!
 
'ftp://%HOSTIP:23456/562;type=A' %FTPPORT




# Verify data after the test has been "shot"
#
# There's no MTDM in the protocol here since this code doesn't ask for the
# time/date of the file


USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE A
SIZE 562
RETR 562
QUIT



curl-7.35.0/tests/data/test13960000644000175000017500000000043012262353672013001 00000000000000


unittest
curl_easy_escape
curl_easy_unescape



#
# Client-side


none


unittest

 
curl_easy_escape and curl_easy_unescape
 

unit1396




curl-7.35.0/tests/data/test5700000644000175000017500000000202412213173003012673 00000000000000

#Informational


RTSP
Mismatch checking



# Server-side


RTSP/1.0 200 OK
Server: RTSPD/libcurl-test
CSeq: 2
Public: DESCRIBE, OPTIONS, SETUP, TEARDOWN, PLAY, PAUSE
Informational: CSeq Mismatch



RTSP/1.0 200 OK
Server: RTSPD/libcurl-test
Session: asdf
CSeq: 999



RTSP/1.0 200 OK
Server: RTSPD/libcurl-test
Session: asdfWRONG
Informational: Session ID mismatch
Curl-Private: swsclose
CSeq: 1000





# Client-Side


rtsp


lib570



RTSP CSeq and Session Mismatch checks


rtsp://%HOSTIP:%RTSPPORT/570





^If-Modified-Since:.*


OPTIONS rtsp://%HOSTIP:%RTSPPORT/5700001 RTSP/1.0
CSeq: 1

SETUP rtsp://%HOSTIP:%RTSPPORT/5700002 RTSP/1.0
CSeq: 999
Transport: RAW/RAW/UDP;unicast;client_port=3056-3057

PLAY rtsp://%HOSTIP:%RTSPPORT/5700003 RTSP/1.0
CSeq: 1000
Session: asdf






curl-7.35.0/tests/data/test290000644000175000017500000000120012213173003012605 00000000000000


HTTP
HTTP GET
timeout
FAILURE


# Server-side


HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close

_data_result_data_


wait 10



# Client-side


http

 
HTTP with 2 secs timeout
 
 
http://%HOSTIP:%HTTPPORT/want/29 -m 2



# Verify data after the test has been "shot"


^User-Agent:.*


GET /want/29 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*



28



curl-7.35.0/tests/data/test6190000644000175000017500000000107412213173003012703 00000000000000


SCP



#
# Client-side


scp

 
SCP retrieval of two files
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: scp://%HOSTIP:%SSHPORT%PWD/log/file619.txt scp://%HOSTIP:%SSHPORT%PWD/log/file619.txt --insecure


Test data
for ssh test



#
# Verify data after the test has been "shot"


disable


Test data
for ssh test
Test data
for ssh test



curl-7.35.0/tests/data/test10490000644000175000017500000000102212213173003012752 00000000000000


TFTP
TFTP RRQ
--interface



#
# Server-side


a chunk of
data
returned
 to client



#
# Client-side


tftp

 
TFTP retrieve with localhost --interface
 
 
tftp://%HOSTIP:%TFTPPORT//1049 --trace-ascii log/traceit --interface %CLIENTIP



#
# Verify pseudo protocol after the test has been "shot"


opcode: 1
filename: /1049
mode: octet



curl-7.35.0/tests/data/test5830000644000175000017500000000130112213173003012674 00000000000000


SFTP
multi



# Server-side





# Client-side


sftp


lib583

 
SFTP with multi interface, remove handle early
 

# The command here uses 'localhost' just to make sure that curl_multi_perform
# won't reach too far in the first invoke. When using c-ares at least, the
# name resolve will cause it to return rather quickly and thus we could trigger
# the problem we're looking to verify.
 
sftp://localhost:%SSHPORT%PWD/log/upload583.txt %USER:



# Verify data after the test has been "shot"


0



curl-7.35.0/tests/data/test11280000644000175000017500000000270612213173003012762 00000000000000


HTTP
HTTP GET
If-Modified-Since


#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 1980 12:10:00 GMT
Content-Length: 11
Content-Type: text/html

0123456789


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:01 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2002 12:10:00 GMT
Content-Length: 11
Content-Type: text/html

0123456789



#
# Client-side


http

 
HTTP 200 If-Modified-Since with old+new documents
 
 
http://%HOSTIP:%HTTPPORT/1128 http://%HOSTIP:%HTTPPORT/11280001 -z "dec 12 12:00:00 1999 GMT"



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1128 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT

GET /11280001 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT




HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 1980 12:10:00 GMT
Content-Length: 11
Content-Type: text/html

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:01 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2002 12:10:00 GMT
Content-Length: 11
Content-Type: text/html

0123456789



curl-7.35.0/tests/data/test9160000644000175000017500000000110212262353672012713 00000000000000


SMTP



#
# Server-side



#
# Client-side


smtp

 
SMTP with invalid --mail-rcpt
 

From: different
To: another

body

 
smtp://%HOSTIP:%SMTPPORT/916 --mail-rcpt invalid --mail-from sender@example.com -T -



#
# Verify data after the test has been "shot"

# 55 - CURLE_SEND_ERROR

55


EHLO 916
MAIL FROM:
RCPT TO:
QUIT



curl-7.35.0/tests/data/test2980000644000175000017500000000105312213173003012703 00000000000000


FTP
PASV
CWD
--ftp-method
nocwd


#
# Server-side


bla bla bla



# Client-side


ftp

 
FTP CWD with --ftp-method nocwd
 
 
--ftp-method nocwd ftp://%HOSTIP:%FTPPORT/first/second/third/298



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
SIZE first/second/third/298
RETR first/second/third/298
QUIT



curl-7.35.0/tests/data/test8350000644000175000017500000000165512270035364012722 00000000000000


IMAP
IMAP AUTH DIGEST-MD5 SASL DOWNGRADE
RFC2831



#
# Server-side


AUTH DIGEST-MD5 PLAIN
REPLY "AUTHENTICATE DIGEST-MD5" + Rubbish
REPLY * A002 NO AUTH exchange cancelled by client
REPLY "AUTHENTICATE PLAIN" +
REPLY dXNlcgB1c2VyAHNlY3JldA== A003 OK AUTHENTICATE completed


From: me@somewhere
To: fake@nowhere

body

--
  yours sincerely



#
# Client-side


imap


debug
crypto

 
IMAP DIGEST-MD5 authentication with SASL downgrade
 
 
'imap://%HOSTIP:%IMAPPORT/835/;UID=1' -u user:secret



#
# Verify data after the test has been "shot"


A001 CAPABILITY
A002 AUTHENTICATE DIGEST-MD5
*
A003 AUTHENTICATE PLAIN
dXNlcgB1c2VyAHNlY3JldA==
A004 SELECT 835
A005 FETCH 1 BODY[]
A006 LOGOUT



curl-7.35.0/tests/data/test8300000644000175000017500000000147212270035364012712 00000000000000


IMAP
IMAP AUTH CRAM-MD5 SASL CANCELLATION
RFC2195



#
# Server-side


AUTH CRAM-MD5
CAPA LOGINDISABLED
REPLY AUTHENTICATE + Rubbish
REPLY * A002 NO AUTH exchange cancelled by client



#
# Client-side


imap


crypto

 
IMAP CRAM-MD5 graceful cancellation
 
 
'imap://%HOSTIP:%IMAPPORT/830/;UID=1' -u user:secret



#
# Verify data after the test has been "shot"

# 67 - CURLE_LOGIN_DENIED

67

#
# The multi interface considers a broken "CONNECT" as a prematurely broken
# transfer and such a connection will not get a "LOGOUT"

A001 CAPABILITY
A002 AUTHENTICATE CRAM-MD5
*



curl-7.35.0/tests/data/test10130000644000175000017500000000070712213173003012752 00000000000000


curl-config



#
# Server-side



#
# Client-side


none

 
Compare curl --version with curl-config --protocols
 
 
--version


%SRCDIR/libtest/test1013.pl ../curl-config log/stdout1013 protocols



#
# Verify data after the test has been "shot"


0



curl-7.35.0/tests/data/test11270000644000175000017500000000166312213173003012762 00000000000000


HTTP
HTTP GET
If-Modified-Since


#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 1980 12:10:00 GMT
Content-Length: 11
Content-Type: text/html

0123456789


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 1980 12:10:00 GMT
Content-Length: 11
Content-Type: text/html




#
# Client-side


http

 
HTTP 200 If-Modified-Since with older document
 
 
http://%HOSTIP:%HTTPPORT/1127 -z "dec 12 12:00:00 1999 GMT"



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1127 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
If-Modified-Since: Sun, 12 Dec 1999 12:00:00 GMT




curl-7.35.0/tests/data/test1270000644000175000017500000000100312213173003012665 00000000000000


FTP
PASV
RETR
--disable-epsv


# Server-side


moooooooo



# Client-side


ftp

 
FTP --disable-epsv
 
 
ftp://%HOSTIP:%FTPPORT/path/to/file/127 --disable-epsv



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
CWD to
CWD file
PASV
TYPE I
SIZE 127
RETR 127
QUIT



curl-7.35.0/tests/data/test10050000644000175000017500000004323412213173003012755 00000000000000


FTP
RETR
huge response


# Server-side


mooo

# a long set of response strings to CWD to make sure the ftp parser deals
# with it nicely

REPLY CWD 250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250 Finally, here is the response



# Client-side


ftp

 
FTP with excessively large number of server command response lines
 
 
ftp://%HOSTIP:%FTPPORT/path/1005



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE 1005
RETR 1005
QUIT



curl-7.35.0/tests/data/test10280000644000175000017500000000257112213173003012761 00000000000000


HTTP
HTTP GET
followlocation
FTP
PASV
FILE



#
# Server-side


HTTP/1.1 302 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
Location: ftp://127.0.0.1:8992/10280002
Content-Length: 0
Connection: close



data
    to
      see
that FTP
works
  so does it?



#
# Client-side


http
ftp

 
HTTP Location: redirect to FTP URL
 
 
http://%HOSTIP:%HTTPPORT/10280001 -L

# The data section doesn't do variable substitution, so we must assert this

perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%FTPPORT' ne '8992' );"



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /10280001 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
SIZE 10280002
RETR 10280002
QUIT


HTTP/1.1 302 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
Location: ftp://%HOSTIP:%FTPPORT/10280002
Content-Length: 0
Connection: close

data
    to
      see
that FTP
works
  so does it?



curl-7.35.0/tests/data/test8530000644000175000017500000000124212262353672012720 00000000000000


POP3
LIST



#
# Server-side

# We use SLOWDOWN to really exercise the end-of-body parsing over multiple
# packets

SLOWDOWN

# When doing LIST, we get the default list output hard-coded in the test
# POP3 server

1 100
2 4294967400
3 200



#
# Client-side


pop3

 
POP3 LIST messages from *SLOW* server
 
 
pop3://%HOSTIP:%POP3PORT/ -u user:secret



#
# Verify data after the test has been "shot"


CAPA
USER user
PASS secret
LIST
QUIT



curl-7.35.0/tests/data/test13660000644000175000017500000000227712213173003012771 00000000000000


HTTP
HTTP GET



#


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1366; charset=funny; option=strange

12345



#
# Client-side


http


HTTP GET -o fname and Content-Disposition, -D file


http://%HOSTIP:%HTTPPORT/1366 -o log/outfile1366 -D log/heads1366


perl %SRCDIR/libtest/notexists.pl log/1366 log/name1366



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1366 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




12345



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1366; charset=funny; option=strange








curl-7.35.0/tests/data/test1610000644000175000017500000000116012213173003012667 00000000000000


FTP
CURLE_PARTIAL_FILE
RETR
PASV




1oooooooooooooooooooooooooooooooooooooooooo2


10928



# Client-side


ftp

 
FTP RETR PASV
 
 
ftp://%HOSTIP:%FTPPORT/161




# Verify data after the test has been "shot"

# This gets QUIT sent because CURLE_PARTIAL_FILE does NOT mark the control
# connection as bad

USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
SIZE 161
RETR 161
QUIT


18



curl-7.35.0/tests/data/test10620000644000175000017500000004216612213173003012763 00000000000000


FTP
RETR
huge response



# Server-side


mooo

# a long set of response strings to CWD to make sure the ftp parser deals
# with it nicely

REPLY CWD 250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n250-A Exactly fill curl's buffer\r\n250 Finally, here is the response, boundary condition



# Client-side


ftp

 
FTP with excessively long server command response lines, boundary condition
 
 
ftp://%HOSTIP:%FTPPORT/path/1062



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE 1062
RETR 1062
QUIT



curl-7.35.0/tests/data/test5550000644000175000017500000001045712270035364012721 00000000000000
# NOTE: this test case is a duplicate of 547 but the tool is built to use the
# multi interface instead of easy, but that shouldn't be noticable at all in
# this file!


HTTP
HTTP POST
POST callback
HTTP proxy
HTTP proxy NTLM auth
multi



# Server-side



HTTP/1.1 407 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"
Proxy-Authenticate: NTLM
Content-Type: text/html; charset=iso-8859-1
Connection: close

This is not the real page


# this is returned first since we get no proxy-auth

HTTP/1.1 407 Authorization Required to proxy me my dear
Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
Content-Length: 34

Hey you, authenticate or go away!


# This is supposed to be returned when the server gets the second
# Authorization: NTLM line passed-in from the client

HTTP/1.1 200 Things are fine in proxy land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 42

Contents of that page you requested, sir.



HTTP/1.1 407 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"
Proxy-Authenticate: NTLM
Content-Type: text/html; charset=iso-8859-1
Connection: close

HTTP/1.1 407 Authorization Required to proxy me my dear
Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
Content-Length: 34

HTTP/1.1 200 Things are fine in proxy land swsclose
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 42

Contents of that page you requested, sir.



# Client-side


http

# tool to use

lib555


NTLM
!SSPI

 
HTTP proxy auth NTLM with POST data from read callback multi-if
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
http://test.remote.example.com/path/555 http://%HOSTIP:%HTTPPORT s1lly:pers0n


chkhostname curlhost



# Verify data after the test has been "shot"


^User-Agent: curl/.*


# remove CR that CURLOPT_TRANSFERTEXT added, when CharConv enabled:
s/^(this is the blurb we want to upload)\r\n/$1\n/ if($has_charconv)


POST http://test.remote.example.com/path/555 HTTP/1.1
User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
Host: test.remote.example.com
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 36
Content-Type: application/x-www-form-urlencoded

this is the blurb we want to upload
POST http://test.remote.example.com/path/555 HTTP/1.1
Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
Host: test.remote.example.com
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

POST http://test.remote.example.com/path/555 HTTP/1.1
Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAIYrD1xJmhNBNL9fLzuk9PV9436GAxPu0EKWzqQ/sZDVLXnp1JrySgl8A+cibE6z4HMxbGx5Y3VybGhvc3Q=
User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
Host: test.remote.example.com
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 36
Content-Type: application/x-www-form-urlencoded

this is the blurb we want to upload



curl-7.35.0/tests/data/test300000644000175000017500000000077012213173003012610 00000000000000


HTTP
HTTP GET
FAILURE


# Server-side





# Client-side


http

 
HTTP with no data in server reply
 
 
http://%HOSTIP:%HTTPPORT/want/30



# Verify data after the test has been "shot"


^User-Agent:.*


GET /want/30 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*



52



curl-7.35.0/tests/data/test9010000644000175000017500000000121712262353672012714 00000000000000


SMTP



#
# Server-side



#
# Client-side


smtp

 
SMTP with CRLF-dot-CRLF in data
 

From: different
To: another


.
.

.

body

 
smtp://%HOSTIP:%SMTPPORT/901 --mail-rcpt recipient@example.com --mail-from sender@example.com -T -



#
# Verify data after the test has been "shot"


EHLO 901
MAIL FROM:
RCPT TO:
DATA
QUIT


From: different
To: another


..
..

..

body
.



curl-7.35.0/tests/data/test10660000644000175000017500000000225612213173003012763 00000000000000


HTTP
HTTP GET



# Server-side


HTTP/1.1 200 OK
Server: thebest/1.0
Content-Type: text/plain
Content-Length: 6

first


HTTP/1.1 200 OK
Server: thebest/1.0
Content-Type: text/plain
Content-Length: 7

second



# Client-side


http

 
HTTP --dump-header - with two URLs
 
 
http://%HOSTIP:%HTTPPORT/want/1066 http://%HOSTIP:%HTTPPORT/want/10660001 --dump-header -



# Verify data after the test has been "shot"


^User-Agent:.*


GET /want/1066 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /want/10660001 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*



HTTP/1.1 200 OK
HTTP/1.1 200 OK
Server: thebest/1.0
Server: thebest/1.0
Content-Type: text/plain
Content-Type: text/plain
Content-Length: 6
Content-Length: 6


first
HTTP/1.1 200 OK
HTTP/1.1 200 OK
Server: thebest/1.0
Server: thebest/1.0
Content-Type: text/plain
Content-Type: text/plain
Content-Length: 7
Content-Length: 7


second



curl-7.35.0/tests/data/test60000644000175000017500000000131712213173003012531 00000000000000


HTTP
HTTP GET
HTTP set cookie
cookies


# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Type: text/html
Funny-head: yesyes
swsclose: booo




# Client-side


http

 
HTTP with simple cookie send
 
 
http://%HOSTIP:%HTTPPORT/we/want/that/page/6 -b "name=contents;name2=content2"



# Verify data after the test has been "shot"


^User-Agent:.*


GET /we/want/that/page/6 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Cookie: name=contents;name2=content2




curl-7.35.0/tests/data/test10840000644000175000017500000000073012213173003012756 00000000000000


HTTP
HTTP GET
--interface
FAILURE
non-existing host



#
# Server-side



#
# Client-side


http


none

 
HTTP GET with invalid --interface
 
 
http://%HOSTIP:%HTTPPORT/1084 --interface non-existing-host.haxx.se.



#
# Verify data after the test has been "shot"


45



curl-7.35.0/tests/data/test1910000644000175000017500000000074012213173003012675 00000000000000


FTP



# Server-side


data in file



# Client-side


ftp

 
FTP URL with ?-letters in username and password 
 
 
"ftp://use%3fr:pass%3fword@%HOSTIP:%FTPPORT/191"



# Verify data after the test has been "shot"


USER use?r
PASS pass?word
PWD
EPSV
TYPE I
SIZE 191
RETR 191
QUIT



curl-7.35.0/tests/data/test14150000644000175000017500000000360012271241025012757 00000000000000


HTTP
HTTP GET
HTTP proxy
cookies
cookiejar
delete expired cookie



# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 4
Content-Type: text/html
Funny-head: yesyes
Set-Cookie: test1value=test1; domain=example.com; path=/;
Set-Cookie: test2value=test2; expires=Friday, 01-Jan-2037 00:00:00 GMT; domain=example.com; path=/;
Set-Cookie: test3value=test3; expires=Monday, 13-Jun-1988 03:04:55 GMT; domain=example.com; path=/;
Set-Cookie: test4value=test4; expires=Friday, 01-Jan-2037 00:00:00 GMT; domain=example.com; path=/;
Set-Cookie: test5value=test5; expires=Monday, 13-Jun-1988 03:04:55 GMT; domain=example.com; path=/;
Set-Cookie: test6value=test6; expires=Monday, 13-Jun-1988 03:04:55 GMT; domain=example.com; path=/;
Set-Cookie: test7value=test7; expires=Friday, 01-Jan-2037 00:00:00 GMT; domain=example.com; path=/;
Set-Cookie: test8value=test8; expires=Monday, 13-Jun-1988 03:04:55 GMT; domain=example.com; path=/;

boo



# Client-side


http


Delete expired cookies


TZ=GMT


http://example.com/we/want/1415 -b none -c log/jar1415.txt -x %HOSTIP:%HTTPPORT



# Verify data after the test has been "shot"


^User-Agent:.*


GET http://example.com/we/want/1415 HTTP/1.1
Host: example.com
Accept: */*
Proxy-Connection: Keep-Alive




# Netscape HTTP Cookie File
# http://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.

.example.com	TRUE	/	FALSE	0	test1value	test1
.example.com	TRUE	/	FALSE	2114380800	test2value	test2
.example.com	TRUE	/	FALSE	2114380800	test4value	test4
.example.com	TRUE	/	FALSE	2114380800	test7value	test7



curl-7.35.0/tests/data/test3030000644000175000017500000000122612213173003012670 00000000000000


HTTPS
HTTP GET
timeout



# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Connection: close

_data_result_data_


wait 20



# Client-side


SSL


https

 
HTTPS with 8 secs timeout
 
 
-k https://%HOSTIP:%HTTPSPORT/want/303 -m 8



# Verify data after the test has been "shot"


^User-Agent:.*


GET /want/303 HTTP/1.1
Host: %HOSTIP:%HTTPSPORT
Accept: */*



28



curl-7.35.0/tests/data/test13280000644000175000017500000000162712213173003012765 00000000000000


HTTP
HTTP GET
-f





HTTP/1.1 404 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Funny-head: yesyes

-noo-


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Connection: close
Funny-head: yesyes

-yes-


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Connection: close
Funny-head: yesyes

-yes-



#
# Client-side


http

 
HTTP GET a globbed range with -f
 
 
-f 'http://%HOSTIP:%HTTPPORT/[13280000-13280001]' -o log/#1



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /13280000 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /13280001 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test1390000644000175000017500000000104612213173003012677 00000000000000


FTP
RETR
-z


# Server-side


this is file contents


213 20030409102659



# Client-side


ftp

 
FTP download a newer file with -z
 
 
ftp://%HOSTIP:%FTPPORT/blalbla/139 -z "1 jan 1989"



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD blalbla
MDTM 139
EPSV
TYPE I
SIZE 139
RETR 139
QUIT



curl-7.35.0/tests/data/test10890000644000175000017500000000266712213173003012776 00000000000000


HTTP
HTTP GET
followlocation
--write-out



#
# Server-side


HTTP/1.1 302 OK swsbounce swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 8
Connection: close
Content-Type: text/plain
Location: ./10890001

monster


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 15
Connection: close
Content-Type: text/plain; charset=us-ascii

bigger monster




#
# Client-side


http

 
HTTP GET --write-out with redirected fetch
 
 
http://%HOSTIP:%HTTPPORT/1089 -w "%{num_connects}\n%{num_redirects}\n%{size_download}\n%{url_effective}\n%{content_type}\n%{response_code}\n" -L



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1089 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /10890001 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




HTTP/1.1 302 OK swsbounce swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 8
Connection: close
Content-Type: text/plain
Location: ./10890001

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 15
Connection: close
Content-Type: text/plain; charset=us-ascii

bigger monster
2
1
15
http://%HOSTIP:%HTTPPORT/10890001
text/plain; charset=us-ascii
200




curl-7.35.0/tests/data/test8030000644000175000017500000000107512213173003012677 00000000000000


IMAP
SELECT
UIDVALIDITY
FAILURE



#
# Server-side



#
# Client-side


imap

 
IMAP SELECT UIDVALIDITY Failure
 
 
'imap://%HOSTIP:%IMAPPORT/803;UIDVALIDITY=12345/;UID=123' -u user:secret



#
# Verify data after the test has been "shot"

# CURLE_REMOTE_FILE_NOT_FOUND - UIDVALIDITY mismatch

78


A001 CAPABILITY
A002 LOGIN user secret
A003 SELECT 803
A004 LOGOUT



curl-7.35.0/tests/data/test5600000644000175000017500000000117212213173003012675 00000000000000


HTTPS
HTTP GET
multi



#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 7

MooMoo



#
# Client-side


SSL


https


lib560

 
simple HTTPS GET with multi interface
 
 
https://%HOSTIP:%HTTPSPORT/560



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /560 HTTP/1.1
Host: %HOSTIP:%HTTPSPORT
Accept: */*




curl-7.35.0/tests/data/test8060000644000175000017500000000103112262353672012712 00000000000000


IMAP
LIST



#
# Server-side


* LIST () "/" /806/blurdybloop
* LIST (\Noselect) "/" /806/foo
* LIST () "/" /806/foo/bar



#
# Client-side


imap

 
IMAP LIST mailbox
 
 
imap://%HOSTIP:%IMAPPORT/806 -u user:secret



#
# Verify data after the test has been "shot"


A001 CAPABILITY
A002 LOGIN user secret
A003 LIST "806" *
A004 LOGOUT



curl-7.35.0/tests/data/test13670000644000175000017500000000220212213173003012756 00000000000000


HTTP
HTTP GET



#


HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1367; charset=funny; option=strange

12345



#
# Client-side


http


HTTP GET -o fname and Content-Disposition, -D stdout


http://%HOSTIP:%HTTPPORT/1367 -o log/outfile1367 -D -


perl %SRCDIR/libtest/notexists.pl log/1367 log/name1367



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /1367 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




12345



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1367; charset=funny; option=strange





curl-7.35.0/tests/data/test8520000644000175000017500000000077212213173003012706 00000000000000


POP3
LIST
FAILURE



#
# Server-side


REPLY LIST -ERR no such message



#
# Client-side


pop3

 
POP3 LIST invalid message
 
 
pop3://%HOSTIP:%POP3PORT/852 -l -u user:secret



#
# Verify data after the test has been "shot"


56


CAPA
USER user
PASS secret
LIST 852
QUIT



curl-7.35.0/tests/data/test330000644000175000017500000000153512213173003012613 00000000000000


HTTP
HTTP PUT
Resume
Content-Range


# Server-side


HTTP/1.1 OK swsclose




# Client-side


http

 
HTTP PUT with resume
 

012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678

 
http://%HOSTIP:%HTTPPORT/33 -Tlog/test33.txt -C 50



# Verify data after the test has been "shot"


^User-Agent:.*


PUT /33 HTTP/1.1
Content-Range: bytes 50-99/100
User-Agent: curl/7.6 (sparc-sun-solaris2.7) libcurl 7.6-pre4 (SSL 0.9.6) (krb4 enabled)
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 50
Expect: 100-continue

012345678
012345678
012345678
012345678
012345678



curl-7.35.0/tests/data/test12030000644000175000017500000000076112213173003012753 00000000000000


GOPHER-ipv6
IPv6
INDEX



#
# Server-side


iMenu results		error.host	1
0Selector 	/bar	bar.foo.invalid	70
.



# Client-side


ipv6


gopher-ipv6

 
Gopher IPv6 index
 
 
-g gopher://%HOST6IP:%GOPHER6PORT/1/moo/1203



#
# Verify data after the test has been "shot"


/moo/1203



curl-7.35.0/tests/data/test10000000644000175000017500000000067512213173003012752 00000000000000


FTP
PASV
LIST
NOBODY


#
# Server-side





#
# Client-side


ftp

 
FTP dir list PASV with -I
 
 
ftp://%HOSTIP:%FTPPORT/1000/ -I



#
# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD 1000
QUIT



curl-7.35.0/tests/data/test2640000644000175000017500000000144112213173003012675 00000000000000


HTTP
HTTP GET
HTTP proxy
HTTP proxy Basic auth


# Server-side


HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Type: text/html
Content-Length: 26

the content would go here



# Client-side


http

 
HTTP with proxy string including http:// and user+password
 
 
http://we.want.that.site.com/264 -x http://f%61ke:user@%HOSTIP:%HTTPPORT



# Verify data after the test has been "shot"


^User-Agent:.*


GET http://we.want.that.site.com/264 HTTP/1.1
Proxy-Authorization: Basic ZmFrZTp1c2Vy
Host: we.want.that.site.com
Accept: */*
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test2970000644000175000017500000000105112213173003012700 00000000000000


FTP
PASV
CWD
--ftp-method
singlecwd


#
# Server-side


bla bla bla



# Client-side


ftp

 
FTP CWD with --ftp-method singlecwd
 
 
--ftp-method singlecwd ftp://%HOSTIP:%FTPPORT/first/second/third/297



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD first/second/third
EPSV
TYPE I
SIZE 297
RETR 297
QUIT



curl-7.35.0/tests/data/test6150000644000175000017500000000131712213173003012677 00000000000000


SFTP
SFTP put
FAILURE



#
# Client-side


sftp


perl %SRCDIR/libtest/test613.pl prepare %PWD/log/test615.dir

 
SFTP put remote failure
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file615.txt sftp://%HOSTIP:%SSHPORT%PWD/log/test615.dir/rofile.txt --insecure


perl %SRCDIR/libtest/test613.pl postprocess %PWD/log/test615.dir


Test data
for ssh upload test



#
# Verify data after the test has been "shot"


9


disable



curl-7.35.0/tests/data/test10410000644000175000017500000000224312213173003012750 00000000000000
# Similar to test33


HTTP
HTTP PUT
Resume
Content-Range



# Server-side


HTTP/1.1 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Accept-Ranges: bytes
Content-Length: 0
Connection: close
Content-Type: text/html




# Client-side


http

 
HTTP PUT with resume from end of already-uploaded file
 

012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678

 
http://%HOSTIP:%HTTPPORT/1041 -Tlog/test1041.txt -C -



# Verify data after the test has been "shot"


^User-Agent:.*

# curl doesn't do a HEAD request on the remote file so it has no idea whether
# it can skip part of the file or not.  Instead, it sends the entire file.

PUT /1041 HTTP/1.1
Content-Range: bytes 0-99/100
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 100
Expect: 100-continue

012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678
012345678



curl-7.35.0/tests/data/test9270000644000175000017500000000110012262353672012713 00000000000000


SMTP
EXPN
CUSTOMREQUEST



#
# Server-side


250-Joe Smith 
250-Harry Smith 
250 Melvin Smith 



#
# Client-side


smtp

 
SMTP mailing list EXPN (CUSTOMREQUEST)
 
 
smtp://%HOSTIP:%SMTPPORT/927 --mail-rcpt Friends -X EXPN



#
# Verify data after the test has been "shot"


EHLO 927
EXPN Friends
QUIT



curl-7.35.0/tests/data/test20070000644000175000017500000000527512213173003012763 00000000000000


Metalink
HTTP
HTTP GET
-J



#
# Server-side


HTTP/1.1 200 OK
Date: Thu, 21 Jun 2012 14:50:02 GMT
Server: test-server/fake
Content-Length: 42
Connection: close
Content-Type: text/html
Content-Disposition: filename=name2007; charset=funny; option=strange
Funny-head: yesyes

Something delivered from an HTTP resource



#
# Client-side

# This relies on the debug feature to allow us to set directory to store the
# -O and -J output in, using the CURL_TESTDIR variable. This test might use
# it upon failure only, successful execution won't actually use it.

debug
file
Metalink


http

 
Metalink local XML file, HTTP resource, using -O -J -D file
 

CURL_TESTDIR=%PWD/log


--metalink file://%PWD/log/test2007.metalink -J -O -D log/heads2007

# local metalink file written before test command runs



 
  
   
    we-only-check-the-strongest-hash-provided
    52899e30f80e3490632d505653204e1fb5b02bda141048704ce9a0ed00b8a3f5
   
   
    http://%HOSTIP:%HTTPPORT/2007
   
  
 



perl %SRCDIR/libtest/notexists.pl log/2007 log/name2007



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /2007 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*



Something delivered from an HTTP resource


HTTP/1.1 200 OK
Date: Thu, 21 Jun 2012 14:50:02 GMT
Server: test-server/fake
Content-Length: 42
Connection: close
Content-Type: text/html
Content-Disposition: filename=name2007; charset=funny; option=strange
Funny-head: yesyes





Metalink: parsing (file://%PWD/log/test2007.metalink) metalink/XML...
Metalink: parsing (file://%PWD/log/test2007.metalink) OK
Metalink: fetching (log/download2007) from (http://%HOSTIP:%HTTPPORT/2007)...
Metalink: fetching (log/download2007) from (http://%HOSTIP:%HTTPPORT/2007) OK
Metalink: validating (log/download2007)...
Metalink: validating (log/download2007) [sha-256] OK


$_ = '' if (($_ !~ /^Metalink: /) && ($_ !~ /error/i) && ($_ !~ /warn/i))



curl-7.35.0/tests/data/test10720000644000175000017500000000272212213173003012756 00000000000000
# Authorization is used to force curl to realize that the server is
# speaking HTTP 1.0. The request is impossible to satisfy with HTTP 1.0
# because chunked encoding is unavailable, so the request must fail.


HTTP
HTTP PUT
HTTP Digest auth
--anyauth
HTTP/1.0
chunked Transfer-Encoding



# Server-side


HTTP/1.0 401 Authorization Required swsclose
Server: testcurl
WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
Content-Type: text/plain
Content-Length: 0
Connection: close




# Client-side


http


crypto

 
HTTP chunked PUT to HTTP 1.0 server with authorization
 
 
http://%HOSTIP:%HTTPPORT/1072 -T - -u testuser:testpass --anyauth


This is data we upload with PUT
it comes from stdin so MUST be sent
with chunked encoding
which is impossible in HTTP/1.0



# Verify data after the test has been "shot"


25


^User-Agent:.*


PUT /1072 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Transfer-Encoding: chunked
Expect: 100-continue

7a
This is data we upload with PUT
it comes from stdin so MUST be sent
with chunked encoding
which is impossible in HTTP/1.0

0




curl-7.35.0/tests/data/test350000644000175000017500000000145212213173003012613 00000000000000


HTTP
HTTP POST
--data-binary




HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake

blablabla




# Client-side


http

 
HTTP POST binary data with embedded NUL
 
 
http://%HOSTIP:%HTTPPORT/we/want/35 --data-binary @log/test35.txt


This is binary data with an embedded NUL byte



# Verify data after the test has been "shot"


^User-Agent:.*


POST /we/want/35 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 47
Content-Type: application/x-www-form-urlencoded

This is binary data with an embedded NUL byte



curl-7.35.0/tests/data/test8660000644000175000017500000000122312262353672012723 00000000000000


POP3
POP3 AUTH LOGIN
RFC1734
RFC5034



#
# Server-side


AUTH LOGIN
REPLY AUTH + VXNlcm5hbWU6
REPLY dXNlcg== + UGFzc3dvcmQ6
REPLY c2VjcmV0 +OK Login successful


From: me@somewhere
To: fake@nowhere

body

--
  yours sincerely



#
# Client-side


pop3

 
POP3 login authentication
 
 
pop3://%HOSTIP:%POP3PORT/866 -u user:secret



#
# Verify data after the test has been "shot"


CAPA
AUTH LOGIN
dXNlcg==
c2VjcmV0
RETR 866
QUIT



curl-7.35.0/tests/data/test6050000644000175000017500000000070512213173003012676 00000000000000


SCP
FAILURE



#
# Client-side


scp

 
SCP retrieval of nonexistent file
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: scp://%HOSTIP:%SSHPORT%PWD/not-a-valid-file-moooo --insecure



#
# Verify data after the test has been "shot"


79


disable



curl-7.35.0/tests/data/test13630000644000175000017500000000253112213173003012757 00000000000000


FTP
RETR



# Server-side

# file1363 contents...

HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1363; charset=funny; option=strange

MOOOO



# Client-side

# this relies on the debug feature to allow us to set directory to store the
# -O output in, using the CURL_TESTDIR variable

debug


ftp


FTP download, file with C-D inside, using -O -i, without -D


CURL_TESTDIR=%PWD/log


ftp://%HOSTIP:%FTPPORT/path/file1363 -O -i


perl %SRCDIR/libtest/notexists.pl log/name1363



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1363
RETR file1363
QUIT



HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html
Content-Disposition: filename=name1363; charset=funny; option=strange

MOOOO







curl-7.35.0/tests/data/test6380000644000175000017500000000147512213173003012711 00000000000000


SFTP
post-quote
acceptfail
asterisk



#
# Server-side


Dummy test file for rename test



#
# Client-side


sftp


perl %SRCDIR/libtest/test610.pl mkdir %PWD/log/test638.dir

 
SFTP post-quote rename * asterisk accept-fail
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "-*rename %PWD/log/test638.dir %PWD/log/test638.new" sftp://%HOSTIP:%SSHPORT%PWD/log/file638.txt --insecure


perl %SRCDIR/libtest/test610.pl rmdir %PWD/log/test638.new


Dummy test file for rename test



#
# Verify data after the test has been "shot"


disable



curl-7.35.0/tests/data/test2850000644000175000017500000000101312213173003012673 00000000000000


TFTP
TFTP WRQ



#
# Client-side


tftp

 
TFTP send
 
 
-T log/test285.txt tftp://%HOSTIP:%TFTPPORT// --trace-ascii log/traceit


a chunk of
data
sent
 to server



#
# Verify pseudo protocol after the test has been "shot"


a chunk of
data
sent
 to server


opcode: 2
filename: /test285.txt
mode: octet



curl-7.35.0/tests/data/test5840000644000175000017500000000257512213173003012713 00000000000000


HTTP
pipelining
multi



# Server-side
# Silly division of the first request is solely to appease the server which expects n_data_items == n_requests


HTTP/1.1 200 OK
Server: test-server/fake
Content-Length: 4

584


HTTP/1.1 200 OK


Server: test-server/fake


Content-Length: 0

HTTP/1.1 200 OK
Server: test-server/fake
Content-Length: 5

585

HTTP/1.1 200 OK
Server: test-server/fake
Content-Length: 4

586



# Client-side


http


lib530

 
HTTP GET using pipelining (nonzero length after zero length)
 
 
http://%HOSTIP:%HTTPPORT/path/584



# Verify data after the test has been "shot"


GET /path/5840001 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /path/5840002 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /path/5840003 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /path/5840004 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*



HTTP/1.1 200 OK
Server: test-server/fake
Content-Length: 4

584
HTTP/1.1 200 OK
Server: test-server/fake
Content-Length: 0

HTTP/1.1 200 OK
Server: test-server/fake
Content-Length: 5

585

HTTP/1.1 200 OK
Server: test-server/fake
Content-Length: 4

586



curl-7.35.0/tests/data/test2790000644000175000017500000000142612213173003012706 00000000000000


HTTP
HTTP GET
HTTP proxy
HTTP proxy Basic auth



# Server-side


HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Type: text/html
Content-Length: 27

the content would go here



# Client-side


http

 
HTTP with proxy string including http:// and user only
 
 
http://we.want.that.site.com/279 -x http://f%61ke@%HOSTIP:%HTTPPORT



# Verify data after the test has been "shot"


^User-Agent:.*


GET http://we.want.that.site.com/279 HTTP/1.1
Proxy-Authorization: Basic ZmFrZTo=
Host: we.want.that.site.com
Accept: */*
Proxy-Connection: Keep-Alive




curl-7.35.0/tests/data/test5120000644000175000017500000000120312262353672012705 00000000000000


HTTP
HTTP GET



#
# Server-side


HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: yes
Connection: close

hello



# Client-side


http

# tool is what to use instead of 'curl'

lib512


 
simple curl_easy_duplicate() test
 
 
http://%HOSTIP:%HTTPPORT/512



#
# Verify data after the test has been "shot"


^User-Agent:.*


GET /512 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test2370000644000175000017500000000176712213173003012710 00000000000000


FTP



# Server-side


REPLY PASV 227 Entering Passiv Mode (1216,256,2,127,127,127)



# Client-side


ftp

 
FTP getting bad host in 227-response to PASV
 
 
ftp://%HOSTIP:%FTPPORT/237 --disable-epsv



# Verify data after the test has been "shot"
# The bogus address used here is chosen specifically so that when processed on
# certain hosts with buggy resolver code, the resulting address (192.0.2.127)
# is from an address block that is guaranteed never to be assigned (RFC3330).

# curl: (15) Can't resolve new host 1216.256.2.127:32639
# 15 => CURLE_FTP_CANT_GET_HOST
# some systems just don't fail on the illegal host name/address but instead
# moves on and attempt to connect to... yes, to what?
# 7= CURLE_COULDNT_CONNECT

15, 7


USER anonymous
PASS ftp@example.com
PWD
PASV



curl-7.35.0/tests/data/test10240000644000175000017500000000377112213173003012760 00000000000000


HTTP
HTTP GET
followlocation
cookies



# Server-side


HTTP/1.1 301 This is a weirdo text message
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Location: ../data/10240002.txt
Set-Cookie: firstcookie=want; path=/want/
Content-Length: 69

This server reply is for testing a Location: following with cookies



HTTP/1.1 301 This is a weirdo text message
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Location: ../want/10240003.txt
Set-Cookie: nextcookie=data; path=/data/
Content-Length: 69

This server reply is for testing a Location: following with cookies



HTTP/1.1 200 Followed here fine
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 52

If this is received, the location following worked



HTTP/1.1 301 This is a weirdo text message
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Location: ../data/10240002.txt
Set-Cookie: firstcookie=want; path=/want/
Content-Length: 69

HTTP/1.1 301 This is a weirdo text message
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Location: ../want/10240003.txt
Set-Cookie: nextcookie=data; path=/data/
Content-Length: 69

HTTP/1.1 200 Followed here fine
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 52

If this is received, the location following worked




# Client-side


http

 
HTTP Location: following with cookies
 
 
http://%HOSTIP:%HTTPPORT/want/1024 -L -c log/jar1024



# Verify data after the test has been "shot"


^User-Agent:.*


GET /want/1024 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /data/10240002.txt HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /want/10240003.txt HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Cookie: firstcookie=want




curl-7.35.0/tests/data/test12020000644000175000017500000000110012213173003012736 00000000000000


GOPHER
QUERY



#
# Server-side


iSearch results		error.host	1
0Query query succeeded	/foo	foo.bar.invalid	70
0Selector /the/search/engine	/bar	bar.foo.invalid	70
.



# Client-side


gopher

 
Gopher query
 
 
"gopher://%HOSTIP:%GOPHERPORT/7/the/search/engine?query%20succeeded/1202"



#
# Verify data after the test has been "shot"


/the/search/engine	query succeeded/1202



curl-7.35.0/tests/data/test6000000644000175000017500000000101712213173003012666 00000000000000


SFTP



#
# Server-side


Test data
for ssh test



#
# Client-side


sftp

 
SFTP retrieval
 
 
--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/file600.txt --insecure


Test data
for ssh test



#
# Verify data after the test has been "shot"


disable



curl-7.35.0/tests/data/test13530000644000175000017500000000302612270035364012770 00000000000000


FTP
RETR



# Server-side


fooo
mooo



# Client-side

# this relies on the debug feature to allow us to set directory to store the
# -O output in, using the CURL_TESTDIR variable

debug


ftp


FTP download, file without C-D inside, using -O -i -D file


CURL_TESTDIR=%PWD/log


ftp://%HOSTIP:%FTPPORT/path/file1353 -O -i -D log/heads1353



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE file1353
RETR file1353
QUIT



fooo
mooo


# The final "221 bye bye baby" response to QUIT will not be recorded
# since that is not considered part of this particular transfer!

220-        _   _ ____  _     
220-    ___| | | |  _ \| |    
220-   / __| | | | |_) | |    
220-  | (__| |_| |  _ {| |___ 
220    \___|\___/|_| \_\_____|
331 We are happy you popped in!
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for 1353 () (10 bytes).
226 File transfer complete


s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/







curl-7.35.0/tests/data/test8310000644000175000017500000000223512270035364012711 00000000000000


IMAP
IMAP AUTH NTLM SASL CANCELLATION



#
# Server-side


AUTH NTLM
CAPA LOGINDISABLED
REPLY AUTHENTICATE +
REPLY TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= + Rubbish
REPLY * A002 NO AUTH exchange cancelled by client



#
# Client-side


imap


NTLM
!SSPI

 
IMAP NTLM graceful cancellation
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
'imap://%HOSTIP:%IMAPPORT/831/;UID=1' -u testuser:testpass


chkhostname curlhost



#
# Verify data after the test has been "shot"

# 67 - CURLE_LOGIN_DENIED

67

#
# The multi interface considers a broken "CONNECT" as a prematurely broken
# transfer and such a connection will not get a "LOGOUT"

A001 CAPABILITY
A002 AUTHENTICATE NTLM
TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
*



curl-7.35.0/tests/data/test1760000644000175000017500000000366112270035364012717 00000000000000


HTTP
HTTP POST



# Server-side

# the first request has NTLM type-1 included, and then the 1001 is returned

HTTP/1.1 200 beng swsclose swsbounce
Server: Microsoft-IIS/6.0
Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth
Content-Type: text/html; charset=iso-8859-1



# the second request should be auth-less and then this is returned.

HTTP/1.1 200 moo swsclose
Server: Microsoft-IIS/6.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 16

content for you



HTTP/1.1 200 beng swsclose swsbounce
Server: Microsoft-IIS/6.0
Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 200 moo swsclose
Server: Microsoft-IIS/6.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 16

content for you




# Client-side


NTLM
!SSPI


http

 
HTTP POST --ntlm to server not requiring any auth at all
 
 
http://%HOSTIP:%HTTPPORT/176 -u auser:apasswd --ntlm -d "junkelijunk"



# Verify data after the test has been "shot"


^User-Agent:.*


POST /176 HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

POST /176 HTTP/1.1
User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 11
Content-Type: application/x-www-form-urlencoded

junkelijunk



curl-7.35.0/tests/data/test11000000644000175000017500000000633012270035364012757 00000000000000


HTTP
HTTP POST
HTTP NTLM auth


# Server-side



HTTP/1.1 200 Thanks for this! swsclose
Content-Length: 25

This is the final page !



HTTP/1.1 401 Now gimme that second request of crap
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 34
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

This is not the real page either!


# This is supposed to be returned when the server gets the second
# Authorization: NTLM line passed-in from the client

HTTP/1.1 302 Thanks for this, but we want to redir you!
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Location: /1100
Content-Length: 34

This is not the real page either!



HTTP/1.1 401 Now gimme that second request of crap
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 34
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==

HTTP/1.1 302 Thanks for this, but we want to redir you!
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Location: /1100
Content-Length: 34

HTTP/1.1 200 Thanks for this! swsclose
Content-Length: 25

This is the final page !




# Client-side


NTLM
!SSPI


http

 
HTTP POST with NTLM authorization and following a 302 redirect
 
 
# we force our own host name, in order to make the test machine independent
CURL_GETHOSTNAME=curlhost
# we try to use the LD_PRELOAD hack, if not a debug build
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
 
 
http://%HOSTIP:%HTTPPORT/1100 -u testuser:testpass --ntlm -L -d "stuff to send away" 


chkhostname curlhost



# Verify data after the test has been "shot"


^User-Agent:.*


POST /1100 HTTP/1.1
Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

POST /1100 HTTP/1.1
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
Host: %HOSTIP:%HTTPPORT
Accept: */*
Content-Length: 18
Content-Type: application/x-www-form-urlencoded

stuff to send awayGET /1100 HTTP/1.1
User-Agent: curl/7.19.5-CVS (i686-pc-linux-gnu) libcurl/7.19.5-CVS GnuTLS/2.6.6 zlib/1.2.3.3 c-ares/1.6.1-CVS libidn/1.14 libssh2/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test1950000644000175000017500000000076412213173003012707 00000000000000


FTP



# Server-side


REPLY PASS 530 temporarily not available



# Client-side


ftp

 
FTP response 530 after PASS, temporarily not allowed access
 
 
ftp://%HOSTIP:%FTPPORT/195



# Verify data after the test has been "shot"


67


USER anonymous
PASS ftp@example.com



curl-7.35.0/tests/data/test2710000644000175000017500000000072312213173003012675 00000000000000


TFTP
TFTP RRQ



#
# Server-side


a chunk of
data
returned
 to client



#
# Client-side


tftp

 
TFTP retrieve
 
 
tftp://%HOSTIP:%TFTPPORT//271 --trace-ascii log/traceit



#
# Verify pseudo protocol after the test has been "shot"


opcode: 1
filename: /271
mode: octet



curl-7.35.0/tests/data/test12370000644000175000017500000001222612262353672013001 00000000000000


HTTP
Basic


# Server-side


HTTP/1.1 200 OK
Server: test-server/fake
Content-Length: 6
Connection: close
Content-Type: text/html

-foo-



# Client-side


http

 
URL with 1000+ letter user name + password
 
 
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB@%HOSTIP:%HTTPPORT/1237"



# Verify data after the test has been "shot"


^User-Agent:.*


GET /1237 HTTP/1.1
Authorization: Basic QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQTpCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkI=
Host: %HOSTIP:%HTTPPORT
Accept: */*




curl-7.35.0/tests/data/test12330000644000175000017500000000113612262353672012773 00000000000000


FTP



# Server-side


# Assuming there's nothing listening on port 1
REPLY EPSV 229 Entering Passiv Mode (|||1|)


here are some bytes



# Client-side


ftp

 
FTP failing to connect to EPSV port, switching to PASV
 
 
ftp://%HOSTIP:%FTPPORT/1233



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
EPSV
PASV
TYPE I
SIZE 1233
RETR 1233
QUIT



curl-7.35.0/tests/data/test10030000644000175000017500000004234212213173003012752 00000000000000


FTP
RETR
huge response


# Server-side


mooo

# a ~17000 bytes response string to CWD to make sure the ftp parser deals
# with it nicely

REPLY CWD 250 CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB



# Client-side


ftp

 
FTP with excessively large server command response line
 
 
ftp://%HOSTIP:%FTPPORT/path/1003



# Verify data after the test has been "shot"


USER anonymous
PASS ftp@example.com
PWD
CWD path
EPSV
TYPE I
SIZE 1003
RETR 1003
QUIT



curl-7.35.0/tests/certs/0000755000175000017500000000000012272124476012045 500000000000000curl-7.35.0/tests/certs/Server-localhost0h-sv.crt0000644000175000017500000001006012213173003016567 00000000000000Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            0b:98:95:00:0c:7e
        Signature Algorithm: sha1WithRSAEncryption
        Issuer:
            countryName               = NN
            organizationName          = Edel Curl Arctic Illudium Research Cloud
            commonName                = Nothern Nowhere Trust Anchor
        Validity
            Not Before: May 27 21:37:54 2010 GMT
            Not After : Aug 13 21:37:54 2018 GMT
        Subject:
            countryName               = NN
            organizationName          = Edel Curl Arctic Illudium Research Cloud
            commonName                = localhost
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (1024 bit)
                Modulus:
                    00:cc:a9:91:2b:22:e8:90:2b:e5:4c:dc:ae:6d:da:
                    4c:f3:32:cc:a5:68:67:5a:3b:b9:86:a3:95:88:3e:
                    e8:63:c3:ed:00:60:19:03:2b:5d:5b:56:8a:da:21:
                    5e:71:5c:d1:e3:de:51:18:c1:17:14:b1:33:90:00:
                    5c:9a:e5:73:0b:a8:88:9c:d0:0b:54:bc:ea:3a:39:
                    dd:f6:65:81:4b:29:99:4c:71:d3:f7:69:7f:80:e8:
                    e8:6d:61:41:83:87:eb:ac:2c:bd:0f:eb:1b:fd:a2:
                    37:97:6d:31:56:ba:4b:51:dd:b1:01:eb:89:f8:25:
                    de:5b:a3:e5:b2:3f:4c:77:53
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Subject Alternative Name: 
                DNS:localhost
            X509v3 Key Usage: 
                Key Encipherment
            X509v3 Extended Key Usage: 
                TLS Web Server Authentication
            X509v3 Subject Key Identifier: 
                3B:2B:84:0D:23:3C:46:F9:9B:E5:C2:FA:B7:30:E7:AC:E3:ED:09:C3
            X509v3 Authority Key Identifier: 
                keyid:AD:3E:E2:39:07:B8:5C:AA:26:90:94:4C:26:69:21:83:E2:4E:36:94

            X509v3 Basic Constraints: critical
                CA:FALSE
    Signature Algorithm: sha1WithRSAEncryption
        a2:fa:61:4e:c0:10:1f:f8:38:2c:fd:a6:74:85:df:8e:ee:41:
        90:a1:d7:c9:32:65:5d:61:d5:13:51:3b:11:1c:7b:01:06:70:
        9f:93:52:54:15:bd:93:3a:f8:40:e3:e2:ab:01:96:fb:73:c5:
        42:2c:ad:ce:e8:52:57:db:b6:15:90:75:e3:e5:75:99:b0:83:
        ed:b0:fc:f2:d0:d9:3d:68:1c:d9:b4:cd:a1:a9:40:19:44:46:
        14:8b:11:6e:2e:1c:65:85:73:45:f0:8b:4f:ea:01:2d:61:0f:
        ae:0d:70:0c:d3:3c:1c:1f:24:66:a3:0b:62:d1:87:1e:8e:96:
        f6:43:cf:1c:24:e7:94:d0:7e:b0:ee:1b:6f:14:1f:04:35:e8:
        fc:3c:c8:9e:e3:6e:0e:4c:7d:a9:23:97:2d:6e:b1:4d:e3:05:
        1b:ce:86:2f:2f:b3:c9:60:47:58:ac:ea:4c:cb:c2:7b:0f:08:
        b8:a7:90:e7:22:32:70:f6:09:3e:f9:54:94:b0:37:50:22:60:
        49:1c:84:9e:1a:22:0c:3e:a9:16:7c:5e:b1:50:13:6b:82:14:
        d3:8a:3d:4d:ed:18:ca:40:59:d6:b9:72:9f:64:e5:0b:e7:a6:
        b8:ee:29:b5:6a:ec:82:b2:94:56:36:e3:87:b3:07:aa:69:b8:
        2c:ef:0c:14
-----BEGIN CERTIFICATE-----
MIIDQzCCAiugAwIBAgIGC5iVAAx+MA0GCSqGSIb3DQEBBQUAMGcxCzAJBgNVBAYT
Ak5OMTEwLwYDVQQKDChFZGVsIEN1cmwgQXJjdGljIElsbHVkaXVtIFJlc2VhcmNo
IENsb3VkMSUwIwYDVQQDDBxOb3RoZXJuIE5vd2hlcmUgVHJ1c3QgQW5jaG9yMB4X
DTEwMDUyNzIxMzc1NFoXDTE4MDgxMzIxMzc1NFowVDELMAkGA1UEBhMCTk4xMTAv
BgNVBAoMKEVkZWwgQ3VybCBBcmN0aWMgSWxsdWRpdW0gUmVzZWFyY2ggQ2xvdWQx
EjAQBgNVBAMMCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
zKmRKyLokCvlTNyubdpM8zLMpWhnWju5hqOViD7oY8PtAGAZAytdW1aK2iFecVzR
495RGMEXFLEzkABcmuVzC6iInNALVLzqOjnd9mWBSymZTHHT92l/gOjobWFBg4fr
rCy9D+sb/aI3l20xVrpLUd2xAeuJ+CXeW6Plsj9Md1MCAwEAAaOBizCBiDAWBgNV
HREEDzANggtsb2NhbGhvc3QAaDALBgNVHQ8EBAMCBSAwEwYDVR0lBAwwCgYIKwYB
BQUHAwEwHQYDVR0OBBYEFDsrhA0jPEb5m+XC+rcw56zj7QnDMB8GA1UdIwQYMBaA
FK0+4jkHuFyqJpCUTCZpIYPiTjaUMAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQEF
BQADggEBAKL6YU7AEB/4OCz9pnSF347uQZCh18kyZV1h1RNROxEcewEGcJ+TUlQV
vZM6+EDj4qsBlvtzxUIsrc7oUlfbthWQdePldZmwg+2w/PLQ2T1oHNm0zaGpQBlE
RhSLEW4uHGWFc0Xwi0/qAS1hD64NcAzTPBwfJGajC2LRhx6OlvZDzxwk55TQfrDu
G28UHwQ16Pw8yJ7jbg5Mfakjly1usU3jBRvOhi8vs8lgR1is6kzLwnsPCLinkOci
MnD2CT75VJSwN1AiYEkchJ4aIgw+qRZ8XrFQE2uCFNOKPU3tGMpAWda5cp9k5Qvn
prjuKbVq7IKylFY244ezB6ppuCzvDBQ=
-----END CERTIFICATE-----
curl-7.35.0/tests/certs/Server-localhost-sv.der0000644000175000017500000000150512213173003016325 000000000000000‚A0‚) ˜”ù|j0
	*†H†÷
0g10	UNN110/U
(Edel Curl Arctic Illudium Research Cloud1%0#UNothern Nowhere Trust Anchor0
100527213711Z
180813213711Z0T10	UNN110/U
(Edel Curl Arctic Illudium Research Cloud10U	localhost0Ÿ0
	*†H†÷
0‰°'y&,¹äÑ
	Òvþšáh³rw—8ä`q™÷&{!µmªŸvl¤*-}îöoŠXÄ“Þþ¡%ÿWIÀÙ”Ùy¿Œmúñ‚g ?×1‚ì¹9iìì“[r‘“²k˜fcþa)ç­†º¿‹UWa¥JöÊçÆÑ¸eB«gd£‰0†0U
0‚	localhost0U 0U%0
+0U¼i†„p:­Þ*pÆ;GŒ?àšm0U#0€­>â9¸\ª&”L&i!ƒâN6”0Uÿ00
	*†H†÷
‚{ð° ÙБ8›þÏxÈÖ0]‡³¹n‹Zst“Ë0IÑyZÂq£“_ÞÓZûmAƒ‰O
e–ybátÝÆØÏ_(‡×†V´Ðˆ€ñ§ÍýX»mæ«Dö›ÖÌÇÛ=:Ä rô88Àï€`?N0@V)pª‘_p‰Q¯¨í Nv»Ï¨ˆš%:–&P*¯ó‹!œÏÿù üþÀ7•ÇÍ
zSÙ&8,ö•ÚÐ÷2‘§5DÇCû#.Dæî©É 7	¸®!OK·†MãA„N)¨’™ècÃí`+][VŠÚ!^q\ÑãÞQÁ±3\šås¨ˆœÐT¼ê:9ÝöeK)™LqÓ÷i€èèmaAƒ‡ë¬,½ëý¢7—m1VºKQݱë‰ø%Þ[£å²?LwS£‹0ˆ0U0
‚localhosth0U 0U%0
+0U;+„
#â9¸\ª&”L&i!ƒâN6”0Uÿ00
	*†H†÷
‚¢úaNÀø8,ý¦t…ߎîA¡×É2e]aÕQ;{pŸ“RT½“:ø@ãâ«–ûsÅB,­ÎèRWÛ¶uãåu™°ƒí°üòÐÙ=hÙ´Í¡©@DF‹n.e…sEð‹Oê-a®
pÓ<$f£bчŽ–öCÏ$ç”Ð~°îo5èü<ÈžãnL}©#—-n±MãΆ//³É`GX¬êLËÂ{¸§ç"2pö	>ùT”°7P"`I„ž">©|^±Pk‚ÓŠ=MíÊ@YÖ¹rŸdå禸î)µj삲”V6ㇳªi¸,ïcurl-7.35.0/tests/certs/Server-localhost0h-sv.p120000644000175000017500000000563212213173003016412 000000000000000‚–0‚\	*†H†÷
 ‚M‚I0‚E0‚	*†H†÷
 ‚0‚ü0‚õ	*†H†÷
0
*†H†÷
02äЖ+;€‚ȱHh÷n:µ
…>Vâ¬`÷[¸8?	Pª¥K·/è±Ýe+Ó46&«¿¡kÕ¯`tž}.ç5=© Øc°«À× |òáfÔHæA]SÖÍwˆ.ÊDˆ3±‹î4BFñgúP"'ý^e¬,Ùz¯ÙÖû9U2§‚¹ìX~ÜC„êÅÊòyBΠ5©Á;‰èa3…FQ9jd×´ŒTŒrEUxé¡*úÇÍSŠd‚ÉHA(6Õz¯«¨e5ÌìÎ@™ï*À³QÂëT"$c{t)5 °WbÄ
jšiwë6gwÁ©«ThKÿ3PŠËh¶²*@³òo¿”ê^Â(:Q”&Zg(úmÿÑT2¸ƒu!ÑÒ¢aEˆG l>'¿²þS÷°”€^?üÊx
"<ô
ÉÖ%Lkø¾Ü†<ë‘ý¶­f*DŠ.|èˆî")
<ºÐ&ýÞ
5(Àã:À—æW9Ïjñèè¹ãIr6dýù/~“£fîd¿†0˜Ö0ÖBf^œìr8éú|nçÂ	;"€{×Ï*±Û¦ôHù‹ã„7­m1¡{äsB’XãŠB™Ï÷'~³Sà¢)É4ò„GR?ÜlA´©Œ$ÚX?¾‹ðcCï
))™m4ìnüÍÚøŸPKE‰‘?Ç• Úl}œ™¬0Áµ-!éÁAëû2§Ù‰Æžýø„¡Tñ¢ém®4ÿ0ãø.+rx&#yqÃáÞˆÉ­Âøýã‰5º4ÎMYRM P÷ÆDP¹ºo.^ÆtŽ5†Ã6f—ªHœN'µŒí×l…U[d£'ˆè”ƒfc{k“ÇÓNì¥l„pªËéʰN#‰,·‡µx2(¿ï£`#q9%êÿ£ãõrŸ±ë,0Ëô…[ÿMîÁ‘³}GÝF‘‚Fï©F+¤0&›¾]ÂïíÒ	ÿû4EÿX{Â-*5i
»t˜ Âüø€p	„†Xs%4×]ŠŠŽšwªŇXíA‡Ó×u»%BÍ:¼·càfß	…ۨɮ¾e“Éø
ä
pµ/‹ÈPcïû¾—\•”5ÆÜ\èáxºô‡éƒ®‰—¯;*Pê;H·¶íݸ˽¯mì÷仳«ØMLÊ·÷‹s
×¼ºW6Sî%'«'LÝUªbšy£€Bº0@¯3_vS²íYý"¬Sy` ~•Éþ”°ëäd  »c™ÞßÛ‰H[ͲöVbZ?›íè0$Ê"ïÒ‹ÂðÐæè2óL€œìèSïœuí
–¶tq'ž¹‡Ýø£”âö=º¹4‚Y6=­ëÒÉ•2[ˆJâdÐÈo ’ÃaC=8F_WXB„_føcÐV’vìp"”¨`ÔPº^Ú®¾Ùù·–Ó#Ìxå–qÊà¡h*†èó†Ö'©™9º>mòMâ'¶©ç@®flâç>mð*\ºâVÏý-3]Œü-iù<ù·
éñgàÎø;µ¶÷2íÁ’‡ûb4“¸ÊPï@_J"ÀƒjÊø×[p“çOŒçhªû#†—%æp-Ø	RfJÙ§¶
:2D“<ž^k‡ë¾aJ®ç“”­ÅÄC^uÇe:D³«&ñ#)î;½L7„ȸÏý©H­C,Bƒ3˜²¢*Q§.’Mãq•$¹ìk<8Ïð·®öár¾Õa_ý‡}
Z%ß0æMfir¦ˆX2^ðA0v„B'iBü½œ¡Öêî-o—kÁÀ¸-Ì9îx¥¢KûPÎD®Cöµ—^}í¸EÜY0¨….VœÊÀ·ªCï~§ï
ÐszÂ-Ôfí	úê©TLзKXøóÁ]‘ƒà…´‰ÞA¦ea[ÉØÃe#DúgµÝA(¤Ï5¾m)ÈéJ¥%’n#%=¬þ³ØA่²ÓÎTzîE%â‘0Ú¡ø®°?©¨Œó;xyÔóhIfߘ¤!¦
¼¥À÷žó:Ð\ê3ÙbJÏ‘ÄÏëhqG î±ÿ;çÆÏBÙÞh¢8dÿ˳Œ™c`ȹêü›òà‘*Ê.%¬u‹=[[,ß¿7`B,Šœ­Ó,ºc¨
BÜ\M ¬è¸Þ¥¥‰Ï}Í}úeÿƒ0‚.	*†H†÷
 ‚‚0‚0‚*†H†÷

 ‚¦0‚¢0
*†H†÷
0îÀ«†q­ÉÓ‚€Mÿ†çÿ.bch^sR+Îá̱ïUÁDd«ÝüðèÁû‘o³Ö¿q©Ÿht ÒGœEIOo$ª„xucþx"ï=†¡ýJ8È“öŸÁ¾YhëyêÍ`M,â_2]¨j¡n[Ÿrâzž±‘^GikgE Áš&~Y>D“ýg•‡ûEóê7kîK¼QÚÉøíÔ}òFÖiJ‚µ üVÍHUGªïü¶%>Ó!°3 …–º^gË¿ùµ}kZ½£ì÷BqºÇspþpý¶Tþ.„ø¿ø&w;°ªåÎä(п€2Î0!«ÜO‰‘²»[àˆ˜¦õ".®Ó_~ï &pBËvÚBøÉæeEXB.3ìÑàILfYû½Ƕýì2ípfÞN_8 FëÃM¹;ùµUcA³A6|
#Ty_ï:·Øx±ÙAfVyñðìMBe{1³^§ýUùÃCìÈÏHÇ]~GIwR£,-®£D!1ˆ^Éw>ï5PµóÈRj‚±ÏFÅ:{éÆì‘¹hCŽ/ø#`PÃ9 '_eŒ1ÜäH§­¥À:ÐN™ˆ½Jp¾;[kÿ^o)m§UJâCçI™TYh4Ø©ûÈ
Z@Ëpõ;ÀB9ùc­Ù)S¯B•¶ŠØAØ71
—Z¬ÿnq3k~ˆ í¾5ÿçiHÀx.FôÂMpnBú“ëÎ;ÑõÎ?)\Œ½Yƒä¡Á<Ž>8Uó™°ßötÉŽ(ô8
E ÖÛÀs¢æŒn˜Ÿ£B0@0Uÿ0ÿ0Uÿ0U­>â9¸\ª&”L&i!ƒâN6”0
	*†H†÷
‚†ÝEÈkñ—ð%²÷XÄj¥V2Ë-zŒ®G}çsl;–u´å‰§~¶RVZâk8ä(›Áoò-š$§ÚÍÌó¼curl-7.35.0/tests/certs/scripts/0000755000175000017500000000000012272124476013534 500000000000000curl-7.35.0/tests/certs/scripts/genserv.sh0000755000175000017500000000636612213173003015460 00000000000000#!/bin/bash

# (c) CopyRight EdelWeb for EdelKey and OpenEvidence, 2000-2004, 2009
# Author: Peter Sylvester

# "libre" for integration with curl

OPENSSL=openssl
if [ -f /usr/local/ssl/bin/openssl ] ; then
   OPENSSL=/usr/local/ssl/bin/openssl
fi

USAGE="echo Usage is genserv.sh  "

HOME=`pwd`
cd $HOME

KEYSIZE=1024
DURATION=3000

REQ=YES
P12=NO
DHP=NO

PREFIX=$1
if [ ".$PREFIX" = . ] ; then
	echo No configuration prefix
	NOTOK=1
else
    if [ ! -f $PREFIX-sv.prm ] ; then
	echo No configuration file $PREFIX-sv.prm
	NOTOK=1
    fi
fi

CAPREFIX=$2
if [ ".$CAPREFIX" = . ] ; then
	echo No CA prefix
	NOTOK=1
else
    if [ ! -f $CAPREFIX-ca.cacert ] ; then
	echo No CA certficate file $CAPREFIX-ca.caert
	NOTOK=1
    fi
    if [ ! -f $CAPREFIX-ca.key ] ; then
	echo No $CAPREFIX key
        NOTOK=1
    fi
fi

if [ ".$NOTOK" != . ] ; then
    echo "Sorry, I can't do that for you."
    $USAGE
    exit
fi

if [ ".$SERIAL" = . ] ; then
	GETSERIAL="\$t = time ;\$d =  \$t . substr(\$t+$$ ,-4,4)-1;print \$d"
	SERIAL=`/usr/bin/env perl -e "$GETSERIAL"`
fi

echo SERIAL=$SERIAL PREFIX=$PREFIX CAPREFIX=$CAPREFIX DURATION=$DURATION KEYSIZE=$KEYSIZE

if [ "$DHP." = YES. ] ; then
   echo "openssl dhparam -2 -out $PREFIX-sv.dhp $KEYSIZE"
   $OPENSSL dhparam -2 -out $PREFIX-sv.dhp $KEYSIZE
fi

if [ "$REQ." = YES. ] ; then
   echo "openssl req -config $PREFIX-sv.prm -newkey rsa:$KEYSIZE -keyout $PREFIX-sv.key -out $PREFIX-sv.csr -passout XXX"
   $OPENSSL req -config $PREFIX-sv.prm -newkey rsa:$KEYSIZE -keyout $PREFIX-sv.key -out $PREFIX-sv.csr -passout pass:secret
fi

echo "openssl rsa -in $PREFIX-sv.key -out $PREFIX-sv.key"
$OPENSSL rsa -in $PREFIX-sv.key -out $PREFIX-sv.key -passin pass:secret
echo pseudo secrets generated

echo "openssl x509 -set_serial $SERIAL -extfile $PREFIX-sv.prm -days $DURATION  -CA $CAPREFIX-ca.cacert -CAkey $CAPREFIX-ca.key -in $PREFIX-sv.csr -req -out $PREFIX-sv.crt -text -nameopt multiline -sha1"

$OPENSSL x509 -set_serial $SERIAL -extfile $PREFIX-sv.prm -days $DURATION  -CA $CAPREFIX-ca.cacert -CAkey $CAPREFIX-ca.key -in $PREFIX-sv.csr -req -out $PREFIX-sv.crt -text -nameopt multiline -sha1

if [ "$P12." = YES. ] ; then

   echo "$OPENSSL pkcs12 -export -des3 -out $PREFIX-sv.p12 -caname $CAPREFIX -name $PREFIX -inkey $PREFIX-sv.key -in $PREFIX-sv.crt -certfile $CAPREFIX-ca.crt "

   $OPENSSL pkcs12 -export -des3 -out $PREFIX-sv.p12 -caname $CAPREFIX -name $PREFIX -inkey $PREFIX-sv.key -in $PREFIX-sv.crt -certfile $CAPREFIX-ca.crt
fi

echo "openssl x509 -noout -text -hash -in $PREFIX-sv.selfcert -nameopt multiline"
$OPENSSL x509 -noout -text -hash -in $PREFIX-sv.crt -nameopt multiline

# revoke server cert
touch $CAPREFIX-ca.db
echo 01 > $CAPREFIX-ca.cnt
echo "openssl ca -config $CAPREFIX-ca.cnf -revoke $PREFIX-sv.crt"
$OPENSSL ca -config $CAPREFIX-ca.cnf -revoke $PREFIX-sv.crt

# issue CRL
echo "openssl ca -config $CAPREFIX-ca.cnf -gencrl -out $PREFIX-sv.crl"
$OPENSSL ca -config $CAPREFIX-ca.cnf -gencrl -out $PREFIX-sv.crl

echo "openssl x509 -in $PREFIX-sv.crt -outform der -out $PREFIX-sv.der "
$OPENSSL x509 -in $PREFIX-sv.crt -outform der -out $PREFIX-sv.der

# all together now
touch $PREFIX-sv.dhp
cat $PREFIX-sv.prm $PREFIX-sv.key  $PREFIX-sv.crt $PREFIX-sv.dhp >$PREFIX-sv.pem
chmod o-r $PREFIX-sv.prm

echo "$PREFIX-sv.pem done"


curl-7.35.0/tests/certs/scripts/genroot.sh0000755000175000017500000000417712213173003015462 00000000000000#!/bin/bash

# (c) CopyRight EdelWeb for EdelKey and OpenEvidence, 2000-2004, 2009
# Author: Peter Sylvester

# "libre" for integration with curl

OPENSSL=openssl
if [ -f /usr/local/ssl/bin/openssl ] ; then
OPENSSL=/usr/local/ssl/bin/openssl
fi

USAGE="echo Usage is genroot.sh \"

HOME=`pwd`
cd $HOME

KEYSIZE=2048
DURATION=6000

PREFIX=$1
if [ ".$PREFIX" = . ] ; then
	echo No configuration prefix
	NOTOK=1
else
    if [ ! -f $PREFIX-ca.prm ] ; then
	echo No configuration file $PREFIX-ca.prm
	NOTOK=1
    fi
fi

if [ ".$NOTOK" != . ] ; then
    echo "Sorry, I can't do that for you."
    $USAGE
    exit
fi

GETSERIAL="\$t = time ;\$d =  \$t . substr(\$t+$$ ,-4,4)-1;print \$d"
SERIAL=`/usr/bin/env perl -e "$GETSERIAL"`

echo SERIAL=$SERIAL PREFIX=$PREFIX DURATION=$DURATION KEYSIZE=$KEYSIZE

echo "openssl genrsa -out $PREFIX-ca.key $KEYSIZE -passout XXX"
openssl genrsa -out $PREFIX-ca.key $KEYSIZE -passout pass:secret

echo "openssl req -config $PREFIX-ca.prm -new -key $PREFIX-ca.key -out $PREFIX-ca.csr"
$OPENSSL req -config $PREFIX-ca.prm -new -key $PREFIX-ca.key -out $PREFIX-ca.csr -passin pass:secret

echo "openssl x509 -set_serial $SERIAL -extfile $PREFIX-ca.prm -days $DURATION -req -signkey $PREFIX-ca.key -in $PREFIX-ca.csr -out $PREFIX-$SERIAL.ca-cacert -sha1 "

$OPENSSL x509  -set_serial $SERIAL -extfile $PREFIX-ca.prm -days $DURATION -req -signkey $PREFIX-ca.key -in $PREFIX-ca.csr -out $PREFIX-$SERIAL-ca.cacert -sha1

echo "openssl x509 -text -hash -out $PREFIX-ca.cacert -in $PREFIX-$SERIAL-ca.cacert -nameopt multiline"
$OPENSSL x509 -text -hash -out $PREFIX-ca.cacert -in $PREFIX-$SERIAL-ca.cacert -nameopt multiline

echo "openssl x509 -in $PREFIX-ca.cacert -outform der -out $PREFIX-ca.der "
$OPENSSL x509 -in $PREFIX-ca.cacert -outform der -out $PREFIX-ca.der

echo "openssl x509 -in $PREFIX-ca.cacert -text -out $PREFIX-ca.crt -nameopt multiline"

$OPENSSL x509 -in $PREFIX-ca.cacert -text -out $PREFIX-ca.crt -nameopt multiline

echo "openssl x509 -noout -text -in $PREFIX-ca.cacert -nameopt multiline"
$OPENSSL x509 -noout -text -in $PREFIX-ca.cacert -nameopt multiline

#$OPENSSL rsa -in ../keys/$PREFIX-ca.key -text -noout -pubout
curl-7.35.0/tests/certs/scripts/Makefile.am0000644000175000017500000000212212213173003015466 00000000000000#***************************************************************************
#                                  _   _ ____  _
#  Project                     ___| | | |  _ \| |
#                             / __| | | | |_) | |
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2013, 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.
#
###########################################################################
AUTOMAKE_OPTIONS = foreign

SCRIPTFILES = \
  genroot.sh \
  genserv.sh

EXTRA_DIST = $(SCRIPTFILES)

curl-7.35.0/tests/certs/scripts/Makefile.in0000644000175000017500000003666512272122667015541 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994-2013 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
  case $${target_option-} in \
      ?) ;; \
      *) echo "am__make_running_with_option: internal error: invalid" \
              "target option '$${target_option-}' specified" >&2; \
         exit 1;; \
  esac; \
  has_opt=no; \
  sane_makeflags=$$MAKEFLAGS; \
  if $(am__is_gnu_make); then \
    sane_makeflags=$$MFLAGS; \
  else \
    case $$MAKEFLAGS in \
      *\\[\ \	]*) \
        bs=\\; \
        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
    esac; \
  fi; \
  skip_next=no; \
  strip_trailopt () \
  { \
    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
  }; \
  for flg in $$sane_makeflags; do \
    test $$skip_next = yes && { skip_next=no; continue; }; \
    case $$flg in \
      *=*|--*) continue;; \
        -*I) strip_trailopt 'I'; skip_next=yes;; \
      -*I?*) strip_trailopt 'I';; \
        -*O) strip_trailopt 'O'; skip_next=yes;; \
      -*O?*) strip_trailopt 'O';; \
        -*l) strip_trailopt 'l'; skip_next=yes;; \
      -*l?*) strip_trailopt 'l';; \
      -[dEDm]) skip_next=yes;; \
      -[JT]) skip_next=yes;; \
    esac; \
    case $$flg in \
      *$$target_option*) has_opt=yes; break;; \
    esac; \
  done; \
  test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = tests/certs/scripts
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
	$(top_srcdir)/mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \
	$(top_srcdir)/m4/curl-confopts.m4 \
	$(top_srcdir)/m4/curl-functions.m4 \
	$(top_srcdir)/m4/curl-openssl.m4 \
	$(top_srcdir)/m4/curl-override.m4 \
	$(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \
	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
	$(top_srcdir)/m4/xc-am-iface.m4 \
	$(top_srcdir)/m4/xc-cc-check.m4 \
	$(top_srcdir)/m4/xc-lt-iface.m4 \
	$(top_srcdir)/m4/xc-translit.m4 \
	$(top_srcdir)/m4/xc-val-flgs.m4 \
	$(top_srcdir)/m4/zz40-xc-ovr.m4 \
	$(top_srcdir)/m4/zz50-xc-ovr.m4 \
	$(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \
	$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \
	$(top_builddir)/include/curl/curlbuild.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo "  GEN     " $@;
am__v_GEN_1 = 
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 = 
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
  case $$AM_UPDATE_INFO_DIR in \
    n|no|NO) false;; \
    *) (install-info --version) >/dev/null 2>&1;; \
  esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@
CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@
CURLVERSION = @CURLVERSION@
CURL_CA_BUNDLE = @CURL_CA_BUNDLE@
CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@
CURL_DISABLE_DICT = @CURL_DISABLE_DICT@
CURL_DISABLE_FILE = @CURL_DISABLE_FILE@
CURL_DISABLE_FTP = @CURL_DISABLE_FTP@
CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@
CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@
CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@
CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@
CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@
CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@
CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@
CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@
CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@
CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@
CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@
CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@
CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@
CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_SHARED = @ENABLE_SHARED@
ENABLE_STATIC = @ENABLE_STATIC@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@
HAVE_LDAP_SSL = @HAVE_LDAP_SSL@
HAVE_LIBZ = @HAVE_LIBZ@
HAVE_SSLEAY_SRP = @HAVE_SSLEAY_SRP@
IDN_ENABLED = @IDN_ENABLED@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IPV6_ENABLED = @IPV6_ENABLED@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBCURL_LIBS = @LIBCURL_LIBS@
LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@
LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@
LIBMETALINK_LIBS = @LIBMETALINK_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MANOPT = @MANOPT@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
NROFF = @NROFF@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKGADD_NAME = @PKGADD_NAME@
PKGADD_PKG = @PKGADD_PKG@
PKGADD_VENDOR = @PKGADD_VENDOR@
PKGCONFIG = @PKGCONFIG@
RANDOM_FILE = @RANDOM_FILE@
RANLIB = @RANLIB@
REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SSL_ENABLED = @SSL_ENABLED@
STRIP = @STRIP@
SUPPORT_FEATURES = @SUPPORT_FEATURES@
SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@
USE_ARES = @USE_ARES@
USE_AXTLS = @USE_AXTLS@
USE_CYASSL = @USE_CYASSL@
USE_DARWINSSL = @USE_DARWINSSL@
USE_GNUTLS = @USE_GNUTLS@
USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@
USE_LIBRTMP = @USE_LIBRTMP@
USE_LIBSSH2 = @USE_LIBSSH2@
USE_NGHTTP2 = @USE_NGHTTP2@
USE_NSS = @USE_NSS@
USE_OPENLDAP = @USE_OPENLDAP@
USE_POLARSSL = @USE_POLARSSL@
USE_SCHANNEL = @USE_SCHANNEL@
USE_SSLEAY = @USE_SSLEAY@
USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@
VERSION = @VERSION@
VERSIONNUM = @VERSIONNUM@
ZLIB_LIBS = @ZLIB_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
libext = @libext@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
subdirs = @subdirs@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@

#***************************************************************************
#                                  _   _ ____  _
#  Project                     ___| | | |  _ \| |
#                             / __| | | | |_) | |
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2013, 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.
#
###########################################################################
AUTOMAKE_OPTIONS = foreign
SCRIPTFILES = \
  genroot.sh \
  genserv.sh

EXTRA_DIST = $(SCRIPTFILES)
all: all-am

.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
	        && { if test -f $@; then exit 0; else break; fi; }; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/certs/scripts/Makefile'; \
	$(am__cd) $(top_srcdir) && \
	  $(AUTOMAKE) --foreign tests/certs/scripts/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs
tags TAGS:

ctags CTAGS:

cscope cscopelist:


distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d "$(distdir)/$$file"; then \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
	  else \
	    test -f "$(distdir)/$$file" \
	    || cp -p $$d/$$file "$(distdir)/$$file" \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	if test -z '$(STRIP)'; then \
	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	      install; \
	else \
	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
	fi
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-am

clean-am: clean-generic clean-libtool mostlyclean-am

distclean: distclean-am
	-rm -f Makefile
distclean-am: clean-am distclean-generic

dvi: dvi-am

dvi-am:

html: html-am

html-am:

info: info-am

info-am:

install-data-am:

install-dvi: install-dvi-am

install-dvi-am:

install-exec-am:

install-html: install-html-am

install-html-am:

install-info: install-info-am

install-info-am:

install-man:

install-pdf: install-pdf-am

install-pdf-am:

install-ps: install-ps-am

install-ps-am:

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-generic mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am:

.MAKE: install-am install-strip

.PHONY: all all-am check check-am clean clean-generic clean-libtool \
	cscopelist-am ctags-am distclean distclean-generic \
	distclean-libtool distdir dvi dvi-am html html-am info info-am \
	install install-am install-data install-data-am install-dvi \
	install-dvi-am install-exec install-exec-am install-html \
	install-html-am install-info install-info-am install-man \
	install-pdf install-pdf-am install-ps install-ps-am \
	install-strip installcheck installcheck-am installdirs \
	maintainer-clean maintainer-clean-generic mostlyclean \
	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
	tags-am uninstall uninstall-am


# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
curl-7.35.0/tests/certs/Server-localhost-sv.p120000644000175000017500000000561612213173003016164 000000000000000‚Š0‚P	*†H†÷
 ‚A‚=0‚90‚	*†H†÷
 ‚ø0‚ô0‚í	*†H†÷
0
*†H†÷
0ÝÉv'a?€‚ÀNßÅIA¨C™Åkµ
ò|mQØç2ýÑæìø¦]ßŵJÖÒVà.CÊŠšíZ·l¦—Gv܉r
$#®ÃÜ{¼`•sßêÀú f©+Ü(Ñi–Ô\|c€Ñï¾Tç—Ô xÖ)v­Æ~@‰¥˜ZfrfzÊÞŸµð}*ü_©érÁ¸ö;–CI©i3H,§¿kf
d(ƒ¤« êîHh O
Ít"r… ÁâÙS¾â±â¿õÙA¡”à:,ìÿÍ|•b®1ñ+BX0eèx2 hROëz”Ø\QŠ«	×Íkc€¼6ËÓõ:Ûeù˜Ø˜#©ÄëFƒaB†—a¬2ÿß4kËFÜÇhÍŠWÌù~O.‡h›D’Õ76¥šÊÔ®H,¶ÒWš	W5¼BL1@µ ë4±ŽÇ1šçFÓ0__¬Ýsí~O‡X…ãœ$°
ËYÀ½F?(œï|ýø]Þõü™ùî̘̎›8'¿ÅêaS‘ч+‰!ÙÓh\s1$Å)JO.>;Þ>~È!›ßTë„Dæ:Q¾+ÀSôãÝhâ w1*B’{ud§Èõs†#weÄB´J®ÕnÍm]ª»90–>5«B<î<ì$a—!ÎÚÌ0yÝËxX™ë½ºô(LOâ*q(Ìý`ïûç9bX=Éç-bEÌ"l÷¹
2­*ˆi´ ¦SàæP±¿˜ÄñòÊi:”4ž¾ðwõh»[D!¦yk²ín=Ž0E$ŸVN§n<דÒISÈÖøGú©,ýìÈ`×i²oUG}»ÏšcYWI¹™aÃÿñÖšˆý~Îx¹»˜
‘¬«À_RTÆo&Q¬@©_BÏiR@ Þ˜”µwŽ'µ9zÑeÎô¿fÄð™™?Q9ƒ
ÍT¶#o¦VßÈá2‚_÷ë™Í•›SòZãû²Y´!I[:—î,Ó¦ò&GËø¦h]Cí÷‹"ÏDJyÞ5&C~°ªÜÿÁƒúA:ì_!A}„#@¡ó*¾Ûλ9ŒN®%K3<7…ŒË5ãTzN¢w),¤ÆñZ7e]jö[BXìUù:5K¯1–,´ÁGÓ
ýViFúTЭÛSɪ>„jÿ6ÿa¾…½„ÓNyúu×=«õ-¸ÛZgWì0’=ÿÕHÙQGö¥C?áƒ(Âo<³öøÂr‹ê=ù^<ÌŠ¢USœ.²ùG¿„S°x­ú.Úõ—G.ᤴ¡UOm®±Ì¾RÙ‚ÔòÈ0Ôa*82
`7 F?š·×ÿ§Ï€Á2ÌjÙŠàÍO¤Øæm,AѼ€¿ØãžÕè¢pQGzÞSô.Ûp9 ~ÙÏgŒº(.Ž­º	7K(¦L¾$“–®Pq¼vŽòiUñú†*lblu©øP
5ò+ç¿$?·8eÕsEPµèUÃÉZ«§EÚNîâD"³ëèxE­™=†(†1ÊB\…dzzMk%õGâ	+	Ógn„lç8Yþçé@@PÜq”‹"Òÿ:ågKã,DÓì	ÐqX½B°HÝÒ·‚fØeÌ È5¢›/l†c9­ž›÷wi‚†õR˜U‡×´4yÒ‹z†ºÝ¡‚pAø¬SåúÁPÇãûí$>üé3Å5âÐV;~’ÓÛv5‹J§Íî_Øîá1%
©°ðÜ0”ýzQ˜¹,‡\Ì\ð=šè+›ùÛ}¾U.Î^Bº]njÌïžT8]øl6l®´…Íõ#ÙðSå²Ô²ÌÊ4%ìÄÓaŠÖLÓMa9h÷Ç8ÏVùw=ÉCW“vWPm€âñT°[Ÿáõ³6ßC'áç)¹:¿ß'?õÕ™µiç#wDñqAŽbvˈŽÔ›ZyfqÓnUüø'öÄö¿+}°ŠØp!†÷3ü¶ãž§Û	£þD`Ü­9Šè‰©»â/Í@`a=ÉlKÕñ«Ÿá¼©þï4ãË’•86	ÓÙ•¨C´º¿µ%æç›ßæªu3g‹ØQÕÍéØf9vr«ÍÐÎQ*Ç
C¹™êqÁÉ[Ubc”ˆ}yk^š±(õË5Nç®èÝã«U"HïºiÚÍΟÝaï,s´
w5—™tÈIµ@X±s`iÛ«® ÙœÓxu“¤…?Œ¥•»ì*`AºP®pÆFV½Cú”×@UŽÃr^¨AÜ›…L¤5tèH:vLþîÂõu`´£ø;¿\"Z»ì~}v$ÓKçúòv´¸Ð׸-„[²Úê8±—T¶¹ÊÕ›zéÃF2¼¹'»6Mš×ßhÇ¥—¸^v=*N·r|N¥ëJ0ÜOˆúøÚ€zÕ'¡´qøèÃ)gg¤vÒ;7ª
ÕU0‚*	*†H†÷
 ‚‚0‚0‚*†H†÷

 ‚¦0‚¢0
*†H†÷
0ÜÆñ<ƒz±ç‚€Ô_"œà–ûõDº%½*(DgÖè)‘_CÿñëUèª{ÃùªÙûf|ä¨zŒLØ}Sõf>¼Å7²†dQgq/rÌO™æ&Û¸V(½„+²-)C‡ŽˆCMME€qF¦Ü	\ëÒê-i§á¨‡À{»¡‚%{°ÿh|ÿX`Ò6–ýÿÍpï“ÌÆ“ÈNB\>Ô–¬T-ƒ¸uÒ*_Àùÿ;û.£ZûSà€Æî9ÁŒŒ¤;RßÄ©^zˆ|õk1071²ý9Ás–Dµ‡‘~ËÄgëÑóZÕ•‘n­‡òŒëE6Í®%ˉnjðfS£ª5×ÃéÀM´H½Wߥì!Ùª¬‹z¶–9ÄÙîðâ‘ïž‹düa¡¹kS6è©ÎíÈÝä“Éð$½_ˇâ:_Á…c7žÂúvE8%93þ˜ÏCÔ»L§Ž£GOXK~éXwKã1Æw›£øRÙ”
‚RcмÖ<7ÏG¿–ªïCÆéüA/˜Dt^¦šš$BIq×o™U ÏÃHØyÔÄeìü•ÖªÛžwZS±É€‘Ÿ&µµ>")àgν
Ü÷®'B“‹ƒugèe`süø2[Ci%ûü>dq·Æú	[Ÿ"Ž÷ܨ¿¥4Ÿa:~Š#UGªõônM‚I)NÒô“Yª+»gÿhnÌ—:$8n½ÞÑÞ	ôà9Ҳȼ»6—œÞ†P³´yù†M¿`úf:á€1(;kbV¹Ñ!N.¡R¨õ>~K`8ùe{æV?Me͉i}Ì!Txº8¾9•M‹:Gˆ~PÊý|õlbÄžyuËJ01V0#	*†H†÷
	1(ësõ—‘ͳ¢ôêZ¼aŸB0/	*†H†÷
	1" Server-localhost010!0	+«ŽØ0o;dÓºË9F˜ §sN‘¶Ÿ»þWZˆcurl-7.35.0/tests/certs/Server-localhost.nn-sv.dhp0000644000175000017500000000036512213173003016743 00000000000000-----BEGIN DH PARAMETERS-----
MIGHAoGBAPrtEVPhZfEczB9JnWXbln79YnTh/V6ehXMWe414wyn/VT1ow25sLEev
H2+eT84aDp5e+TfBSFjA6or96/lyQvsgAE+cE6f6uuw9ApVG2MK+BCn4snxHBb6G
LFQf+9qHZ4BEkpBL60p1fkGu8BM1wXGXEaeYhgGumNA9fm5YJrl7AgEC
-----END DH PARAMETERS-----
curl-7.35.0/tests/certs/Server-localhost.nn-sv.key0000644000175000017500000000157312213173003016762 00000000000000-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQDT1E7bY1w/OjpeOAmU5k1wnQ2vSeaCXQe39c2g369x8c+/1Zq9
r3x4XVU/FL27LA5zndaCmtXm9iFdCJKicV+AX1zO8MI3N3kPTT3U8oBtRzZF0dKL
ei4ScUtHhvWMma/nDs+1yU16dfeydAxB46u7LJ1vVAgTWjrvfCf3PwsLcQIDAQAB
AoGBALr1HQxAq8AaMj3KE5rZkOudkeBtxwaz+QYB6hTcl8pnc8aKTmKwKZlKNtzP
/4zdG3wriJII+lU4UsX7tP+uNGxKxALrDQRuBPyi8XQfUT1nJth6qkp8g3V/ixfE
Yah3od9dL3+xsOH28RKKUC5kjmnNupO9KQZ6/CyYfUHAEG+pAkEA+PP+7FIvpPQ+
7bbG4IIqn7QKVxGbtaFY8pdLnsUkrnIqwEIbZoU12iEKm5qMoXNv30GknXrvxU53
tdIZU5Z28wJBANnTTMb/jac+Q1SaqmWQnrpcmvuPZ/8xRM6xeSJh+MDpK768WpYe
nivHvinQjQZBQmNM3IPYbJ33nTAdJylmFQsCQQCn4crATPAKOheRsJdO4RijWAM9
EgfCJUtZVMPPDr0c0qqXujzGFwDo1y1TH5bEbZc8pATBmhzFHpRFzaf8oVQXAkAX
Hch5GefDhuUIVn2c17MwneFIrxhfSbA+qzDqyDDo8BXXYQ/P/KHWjZUNxPciYcyU
0zRXvaERRpTk5UMhrpavAkEAy4ZyhH1UViuWsmTQaRjc5mDs8aXkd2y85A7jnfWA
8r7CL+sOe4TU1/CVyJf2FJaqHfD/GG6fqqeFoHuaqwTyiw==
-----END RSA PRIVATE KEY-----
curl-7.35.0/tests/certs/Server-localhost0h-sv.csr0000644000175000017500000000115712213173003016575 00000000000000-----BEGIN CERTIFICATE REQUEST-----
MIIBkzCB/QIBADBUMQswCQYDVQQGEwJOTjExMC8GA1UECgwoRWRlbCBDdXJsIEFy
Y3RpYyBJbGx1ZGl1bSBSZXNlYXJjaCBDbG91ZDESMBAGA1UEAwwJbG9jYWxob3N0
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMqZErIuiQK+VM3K5t2kzzMsyl
aGdaO7mGo5WIPuhjw+0AYBkDK11bVoraIV5xXNHj3lEYwRcUsTOQAFya5XMLqIic
0AtUvOo6Od32ZYFLKZlMcdP3aX+A6OhtYUGDh+usLL0P6xv9ojeXbTFWuktR3bEB
64n4Jd5bo+WyP0x3UwIDAQABoAAwDQYJKoZIhvcNAQELBQADgYEAPor+2apn3kPJ
ZdjyyT/iXETRTrN87PuBaujcV+oVeVSWW+YgGUzDHi+RkEKTxWdz3leW2goE41X9
2D/n66ASQGs1x8wXwIMIX83MjkWtjqdfcrJVi1l6T7NjzZt6EyJdvreRntCUu8zc
J5tK3rl/tIeudKUE2COc0Ngu9JUB1j8=
-----END CERTIFICATE REQUEST-----
curl-7.35.0/tests/certs/Server-localhost.nn-sv.csr0000644000175000017500000000116312213173003016754 00000000000000-----BEGIN CERTIFICATE REQUEST-----
MIIBlzCCAQACAQAwVzELMAkGA1UEBhMCTk4xMTAvBgNVBAoMKEVkZWwgQ3VybCBB
cmN0aWMgSWxsdWRpdW0gUmVzZWFyY2ggQ2xvdWQxFTATBgNVBAMMDGxvY2FsaG9z
dC5ubjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA09RO22NcPzo6XjgJlOZN
cJ0Nr0nmgl0Ht/XNoN+vcfHPv9Wava98eF1VPxS9uywOc53WgprV5vYhXQiSonFf
gF9czvDCNzd5D0091PKAbUc2RdHSi3ouEnFLR4b1jJmv5w7PtclNenX3snQMQeOr
uyydb1QIE1o673wn9z8LC3ECAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4GBAM5PenDC
AtDhzdVKrX6DcJINWck5XFEnvWQksSYU7iDeiQVycQxR+LYKGZiy04u+9C+MN7eq
JmHAIi+88r7/ZaGJLujqSUOJn8ocZ+vwhJOwh2XBhhLaCjIW/H05g0aNlk80Ye6m
OA9DCIZUINF0lDQaJCpKXxwNVcz4Rifp5/9T
-----END CERTIFICATE REQUEST-----
curl-7.35.0/tests/certs/Server-localhost0h-sv.key0000644000175000017500000000156712213173003016603 00000000000000-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQDMqZErIuiQK+VM3K5t2kzzMsylaGdaO7mGo5WIPuhjw+0AYBkD
K11bVoraIV5xXNHj3lEYwRcUsTOQAFya5XMLqIic0AtUvOo6Od32ZYFLKZlMcdP3
aX+A6OhtYUGDh+usLL0P6xv9ojeXbTFWuktR3bEB64n4Jd5bo+WyP0x3UwIDAQAB
AoGAGT+OBilPUYHoztumtSyqM5J/xqQjo/EcSSzjJKTGHJCuK06vp0FxSfRaOuDE
+u09g4QIsyoXA9l8h/ZTdlR6Jax5nc+iRFs/21isrgKAsZYj4DghjgXJ9LWGHXnb
7xstVFkFBGnOaeY7dVr54907TYUQwtJg4fk7Vror05gb1qECQQDykAxr2D/CxLk9
RjWDi/P6JnfF0ZxZzCe0yATvuZ89+rpWQ5uxEJDq5FqwW4QXX+0G2aWDv64YExPS
JmWQTlojAkEA2AAHDv2KBWFcXeTlWnKZTdzUOniE8PzS5zipi2ssiqXScrj9NX2U
yCCOkv/42blPXBKbaVnfWBEhtj7pQxHJEQJBAOTvXjnfVXafs/IINPPegLyF2B/G
EZqTXJp8+mPEP28BGSPYFbdN2mlIc+vlxEtHh3AitdweatNgFiIPiWZk/R8CQEIf
EAoYtw2alknv7f3YIvHg7d7QUfHrkyxQ/iW9sy7mQBv6YRjkzozM2phJX4ZW4eJP
l9+SMXqmE+nULFfps+ECQFVkjPDF065x++Fh3BVtNJ0goYStTJM6IcmYKflap+Ux
cORZUWJ8tvDavlSSwQQYK8kOVTINC6iFwwEQ41HlYLE=
-----END RSA PRIVATE KEY-----
curl-7.35.0/tests/certs/Makefile.am0000644000175000017500000000406212213173003014004 00000000000000#***************************************************************************
#                                  _   _ ____  _
#  Project                     ___| | | |  _ \| |
#                             / __| | | | |_) | |
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2013, 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.
#
###########################################################################
AUTOMAKE_OPTIONS = foreign

SUBDIRS = scripts

CERTFILES = \
  EdelCurlRoot-ca.cacert \
  EdelCurlRoot-ca.cnf \
  EdelCurlRoot-ca.crt \
  EdelCurlRoot-ca.csr \
  EdelCurlRoot-ca.der \
  EdelCurlRoot-ca.key \
  EdelCurlRoot-ca.prm \
  Server-localhost-sv.crl \
  Server-localhost-sv.crt \
  Server-localhost-sv.csr \
  Server-localhost-sv.der \
  Server-localhost-sv.dhp \
  Server-localhost-sv.key \
  Server-localhost-sv.p12 \
  Server-localhost-sv.pem \
  Server-localhost-sv.prm \
  Server-localhost.nn-sv.crl \
  Server-localhost.nn-sv.crt \
  Server-localhost.nn-sv.csr \
  Server-localhost.nn-sv.der \
  Server-localhost.nn-sv.dhp \
  Server-localhost.nn-sv.key \
  Server-localhost.nn-sv.pem \
  Server-localhost.nn-sv.prm \
  Server-localhost0h-sv.crl \
  Server-localhost0h-sv.crt \
  Server-localhost0h-sv.csr \
  Server-localhost0h-sv.der \
  Server-localhost0h-sv.dhp \
  Server-localhost0h-sv.key \
  Server-localhost0h-sv.p12 \
  Server-localhost0h-sv.pem \
  Server-localhost0h-sv.prm

SRPFILES = \
  srp-verifier-conf \
  srp-verifier-db

EXTRA_DIST = $(CERTFILES) $(SRPFILES)

curl-7.35.0/tests/certs/Makefile.in0000644000175000017500000005515112272122667014041 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994-2013 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
  case $${target_option-} in \
      ?) ;; \
      *) echo "am__make_running_with_option: internal error: invalid" \
              "target option '$${target_option-}' specified" >&2; \
         exit 1;; \
  esac; \
  has_opt=no; \
  sane_makeflags=$$MAKEFLAGS; \
  if $(am__is_gnu_make); then \
    sane_makeflags=$$MFLAGS; \
  else \
    case $$MAKEFLAGS in \
      *\\[\ \	]*) \
        bs=\\; \
        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
    esac; \
  fi; \
  skip_next=no; \
  strip_trailopt () \
  { \
    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
  }; \
  for flg in $$sane_makeflags; do \
    test $$skip_next = yes && { skip_next=no; continue; }; \
    case $$flg in \
      *=*|--*) continue;; \
        -*I) strip_trailopt 'I'; skip_next=yes;; \
      -*I?*) strip_trailopt 'I';; \
        -*O) strip_trailopt 'O'; skip_next=yes;; \
      -*O?*) strip_trailopt 'O';; \
        -*l) strip_trailopt 'l'; skip_next=yes;; \
      -*l?*) strip_trailopt 'l';; \
      -[dEDm]) skip_next=yes;; \
      -[JT]) skip_next=yes;; \
    esac; \
    case $$flg in \
      *$$target_option*) has_opt=yes; break;; \
    esac; \
  done; \
  test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = tests/certs
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
	$(top_srcdir)/mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \
	$(top_srcdir)/m4/curl-confopts.m4 \
	$(top_srcdir)/m4/curl-functions.m4 \
	$(top_srcdir)/m4/curl-openssl.m4 \
	$(top_srcdir)/m4/curl-override.m4 \
	$(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \
	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
	$(top_srcdir)/m4/xc-am-iface.m4 \
	$(top_srcdir)/m4/xc-cc-check.m4 \
	$(top_srcdir)/m4/xc-lt-iface.m4 \
	$(top_srcdir)/m4/xc-translit.m4 \
	$(top_srcdir)/m4/xc-val-flgs.m4 \
	$(top_srcdir)/m4/zz40-xc-ovr.m4 \
	$(top_srcdir)/m4/zz50-xc-ovr.m4 \
	$(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \
	$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \
	$(top_builddir)/include/curl/curlbuild.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo "  GEN     " $@;
am__v_GEN_1 = 
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 = 
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
	ctags-recursive dvi-recursive html-recursive info-recursive \
	install-data-recursive install-dvi-recursive \
	install-exec-recursive install-html-recursive \
	install-info-recursive install-pdf-recursive \
	install-ps-recursive install-recursive installcheck-recursive \
	installdirs-recursive pdf-recursive ps-recursive \
	tags-recursive uninstall-recursive
am__can_run_installinfo = \
  case $$AM_UPDATE_INFO_DIR in \
    n|no|NO) false;; \
    *) (install-info --version) >/dev/null 2>&1;; \
  esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
  distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
  $(RECURSIVE_TARGETS) \
  $(RECURSIVE_CLEAN_TARGETS) \
  $(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
	distdir
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates.  Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
  BEGIN { nonempty = 0; } \
  { items[$$0] = 1; nonempty = 1; } \
  END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique.  This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
  list='$(am__tagged_files)'; \
  unique=`for i in $$list; do \
    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
  dir0=`pwd`; \
  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
  sed_rest='s,^[^/]*/*,,'; \
  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
  sed_butlast='s,/*[^/]*$$,,'; \
  while test -n "$$dir1"; do \
    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
    if test "$$first" != "."; then \
      if test "$$first" = ".."; then \
        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
      else \
        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
        if test "$$first2" = "$$first"; then \
          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
        else \
          dir2="../$$dir2"; \
        fi; \
        dir0="$$dir0"/"$$first"; \
      fi; \
    fi; \
    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
  done; \
  reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@
CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@
CURLVERSION = @CURLVERSION@
CURL_CA_BUNDLE = @CURL_CA_BUNDLE@
CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@
CURL_DISABLE_DICT = @CURL_DISABLE_DICT@
CURL_DISABLE_FILE = @CURL_DISABLE_FILE@
CURL_DISABLE_FTP = @CURL_DISABLE_FTP@
CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@
CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@
CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@
CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@
CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@
CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@
CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@
CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@
CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@
CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@
CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@
CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@
CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@
CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_SHARED = @ENABLE_SHARED@
ENABLE_STATIC = @ENABLE_STATIC@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@
HAVE_LDAP_SSL = @HAVE_LDAP_SSL@
HAVE_LIBZ = @HAVE_LIBZ@
HAVE_SSLEAY_SRP = @HAVE_SSLEAY_SRP@
IDN_ENABLED = @IDN_ENABLED@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IPV6_ENABLED = @IPV6_ENABLED@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBCURL_LIBS = @LIBCURL_LIBS@
LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@
LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@
LIBMETALINK_LIBS = @LIBMETALINK_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MANOPT = @MANOPT@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
NROFF = @NROFF@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKGADD_NAME = @PKGADD_NAME@
PKGADD_PKG = @PKGADD_PKG@
PKGADD_VENDOR = @PKGADD_VENDOR@
PKGCONFIG = @PKGCONFIG@
RANDOM_FILE = @RANDOM_FILE@
RANLIB = @RANLIB@
REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SSL_ENABLED = @SSL_ENABLED@
STRIP = @STRIP@
SUPPORT_FEATURES = @SUPPORT_FEATURES@
SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@
USE_ARES = @USE_ARES@
USE_AXTLS = @USE_AXTLS@
USE_CYASSL = @USE_CYASSL@
USE_DARWINSSL = @USE_DARWINSSL@
USE_GNUTLS = @USE_GNUTLS@
USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@
USE_LIBRTMP = @USE_LIBRTMP@
USE_LIBSSH2 = @USE_LIBSSH2@
USE_NGHTTP2 = @USE_NGHTTP2@
USE_NSS = @USE_NSS@
USE_OPENLDAP = @USE_OPENLDAP@
USE_POLARSSL = @USE_POLARSSL@
USE_SCHANNEL = @USE_SCHANNEL@
USE_SSLEAY = @USE_SSLEAY@
USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@
VERSION = @VERSION@
VERSIONNUM = @VERSIONNUM@
ZLIB_LIBS = @ZLIB_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
libext = @libext@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
subdirs = @subdirs@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@

#***************************************************************************
#                                  _   _ ____  _
#  Project                     ___| | | |  _ \| |
#                             / __| | | | |_) | |
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2013, 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.
#
###########################################################################
AUTOMAKE_OPTIONS = foreign
SUBDIRS = scripts
CERTFILES = \
  EdelCurlRoot-ca.cacert \
  EdelCurlRoot-ca.cnf \
  EdelCurlRoot-ca.crt \
  EdelCurlRoot-ca.csr \
  EdelCurlRoot-ca.der \
  EdelCurlRoot-ca.key \
  EdelCurlRoot-ca.prm \
  Server-localhost-sv.crl \
  Server-localhost-sv.crt \
  Server-localhost-sv.csr \
  Server-localhost-sv.der \
  Server-localhost-sv.dhp \
  Server-localhost-sv.key \
  Server-localhost-sv.p12 \
  Server-localhost-sv.pem \
  Server-localhost-sv.prm \
  Server-localhost.nn-sv.crl \
  Server-localhost.nn-sv.crt \
  Server-localhost.nn-sv.csr \
  Server-localhost.nn-sv.der \
  Server-localhost.nn-sv.dhp \
  Server-localhost.nn-sv.key \
  Server-localhost.nn-sv.pem \
  Server-localhost.nn-sv.prm \
  Server-localhost0h-sv.crl \
  Server-localhost0h-sv.crt \
  Server-localhost0h-sv.csr \
  Server-localhost0h-sv.der \
  Server-localhost0h-sv.dhp \
  Server-localhost0h-sv.key \
  Server-localhost0h-sv.p12 \
  Server-localhost0h-sv.pem \
  Server-localhost0h-sv.prm

SRPFILES = \
  srp-verifier-conf \
  srp-verifier-db

EXTRA_DIST = $(CERTFILES) $(SRPFILES)
all: all-recursive

.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
	        && { if test -f $@; then exit 0; else break; fi; }; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/certs/Makefile'; \
	$(am__cd) $(top_srcdir) && \
	  $(AUTOMAKE) --foreign tests/certs/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs

# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
#     (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
	@fail=; \
	if $(am__make_keepgoing); then \
	  failcom='fail=yes'; \
	else \
	  failcom='exit 1'; \
	fi; \
	dot_seen=no; \
	target=`echo $@ | sed s/-recursive//`; \
	case "$@" in \
	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
	  *) list='$(SUBDIRS)' ;; \
	esac; \
	for subdir in $$list; do \
	  echo "Making $$target in $$subdir"; \
	  if test "$$subdir" = "."; then \
	    dot_seen=yes; \
	    local_target="$$target-am"; \
	  else \
	    local_target="$$target"; \
	  fi; \
	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
	  || eval $$failcom; \
	done; \
	if test "$$dot_seen" = "no"; then \
	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
	fi; test -z "$$fail"

ID: $(am__tagged_files)
	$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags

tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
	set x; \
	here=`pwd`; \
	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
	  include_option=--etags-include; \
	  empty_fix=.; \
	else \
	  include_option=--include; \
	  empty_fix=; \
	fi; \
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  if test "$$subdir" = .; then :; else \
	    test ! -f $$subdir/TAGS || \
	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
	  fi; \
	done; \
	$(am__define_uniq_tagged_files); \
	shift; \
	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  if test $$# -gt 0; then \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      "$$@" $$unique; \
	  else \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      $$unique; \
	  fi; \
	fi
ctags: ctags-recursive

CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
	$(am__define_uniq_tagged_files); \
	test -z "$(CTAGS_ARGS)$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && $(am__cd) $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive

cscopelist-am: $(am__tagged_files)
	list='$(am__tagged_files)'; \
	case "$(srcdir)" in \
	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
	  *) sdir=$(subdir)/$(srcdir) ;; \
	esac; \
	for i in $$list; do \
	  if test -f "$$i"; then \
	    echo "$(subdir)/$$i"; \
	  else \
	    echo "$$sdir/$$i"; \
	  fi; \
	done >> $(top_builddir)/cscope.files

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d "$(distdir)/$$file"; then \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
	  else \
	    test -f "$(distdir)/$$file" \
	    || cp -p $$d/$$file "$(distdir)/$$file" \
	    || exit 1; \
	  fi; \
	done
	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
	  if test "$$subdir" = .; then :; else \
	    $(am__make_dryrun) \
	      || test -d "$(distdir)/$$subdir" \
	      || $(MKDIR_P) "$(distdir)/$$subdir" \
	      || exit 1; \
	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
	    $(am__relativize); \
	    new_distdir=$$reldir; \
	    dir1=$$subdir; dir2="$(top_distdir)"; \
	    $(am__relativize); \
	    new_top_distdir=$$reldir; \
	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
	    ($(am__cd) $$subdir && \
	      $(MAKE) $(AM_MAKEFLAGS) \
	        top_distdir="$$new_top_distdir" \
	        distdir="$$new_distdir" \
		am__remove_distdir=: \
		am__skip_length_check=: \
		am__skip_mode_fix=: \
	        distdir) \
	      || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-recursive
install-strip:
	if test -z '$(STRIP)'; then \
	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	      install; \
	else \
	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
	fi
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive

clean-am: clean-generic clean-libtool mostlyclean-am

distclean: distclean-recursive
	-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags

dvi: dvi-recursive

dvi-am:

html: html-recursive

html-am:

info: info-recursive

info-am:

install-data-am:

install-dvi: install-dvi-recursive

install-dvi-am:

install-exec-am:

install-html: install-html-recursive

install-html-am:

install-info: install-info-recursive

install-info-am:

install-man:

install-pdf: install-pdf-recursive

install-pdf-am:

install-ps: install-ps-recursive

install-ps-am:

installcheck-am:

maintainer-clean: maintainer-clean-recursive
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-recursive

mostlyclean-am: mostlyclean-generic mostlyclean-libtool

pdf: pdf-recursive

pdf-am:

ps: ps-recursive

ps-am:

uninstall-am:

.MAKE: $(am__recursive_targets) install-am install-strip

.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
	check-am clean clean-generic clean-libtool cscopelist-am ctags \
	ctags-am distclean distclean-generic distclean-libtool \
	distclean-tags distdir dvi dvi-am html html-am info info-am \
	install install-am install-data install-data-am install-dvi \
	install-dvi-am install-exec install-exec-am install-html \
	install-html-am install-info install-info-am install-man \
	install-pdf install-pdf-am install-ps install-ps-am \
	install-strip installcheck installcheck-am installdirs \
	installdirs-am maintainer-clean maintainer-clean-generic \
	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
	ps ps-am tags tags-am uninstall uninstall-am


# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
curl-7.35.0/tests/certs/Server-localhost.nn-sv.der0000644000175000017500000000151312213173003016736 000000000000000‚G0‚/ ˜”ûx_0
	*†H†÷
0g10	UNN110/U
(Edel Curl Arctic Illudium Research Cloud1%0#UNothern Nowhere Trust Anchor0
100527213724Z
180813213724Z0W10	UNN110/U
(Edel Curl Arctic Illudium Research Cloud10Ulocalhost.nn0Ÿ0
	*†H†÷
0‰ÓÔNÛc\?::^8	”æMp
¯Iæ‚]·õ߯͠qñϿ՚½¯|x]U?½»,sÖ‚šÕæö!]’¢q_€_\ÎðÂ77yM=Ôò€mG6EÑÒ‹z.qKG†õŒ™¯çϵÉMzu÷²tAã«»,oTZ:ï|'÷?q£Œ0‰0U0‚localhost.nn0U 0U%0
+0U&ùuÌœ-<6dhA÷â9¸\ª&”L&i!ƒâN6”0Uÿ00
	*†H†÷
‚eŒHXŒÔ•g)RíZnA¼+ ĉ:nËÁÿ«ay_Î'“<ÿ)z%h'óh0ðýÿ	*%±E“«Žš¸¤uÐÊòfksÝ‹»4ÖpÜ4çz0êPP/ˆg³ø³UbD~>ßYO¨Wƒ@Ÿ¿R¿ý,n½A·x›úÄÿÃ+F¤§=u)kÏðeÔQ‡’¨=~€„­^N¶ïšÄ•ìÃè¡iBËÚc5oкbžs6cXÌ%ÈYsß;¹ZÚ=á?
AĈ-’ˆÔTáWS«køÈ>0LõrÏðÔpÁx…0œþ”ôÂlIz'curl-7.35.0/tests/certs/Server-localhost-sv.dhp0000644000175000017500000000036512213173003016331 00000000000000-----BEGIN DH PARAMETERS-----
MIGHAoGBAP5mA7oYimErFUulbvNC8V0HwyB62NCj6TZb6YXJwElCksQc8RyHnkrY
9Wx2+lduFqHjUWalgVF7Gma7CfR/pt+fiU6Jn2vWR2v7KT6hYeRKsJrONJlth+NK
V7/d4zyvleJ/VSp0TuuSxmMMQ6hG3i5YhSGXyCh4h0pl4Wu/hdVTAgEC
-----END DH PARAMETERS-----
curl-7.35.0/tests/certs/Server-localhost0h-sv.prm0000644000175000017500000000144312213173003016602 00000000000000extensions = x509v3
[ x509v3 ]
#subjectAltName = DNS:localhost\0h
subjectAltName = DER:30:0d:82:0b:6c:6f:63:61:6c:68:6f:73:74:00:68
keyUsage	= keyEncipherment
extendedKeyUsage = serverAuth
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid
basicConstraints = critical,CA:false
[ req ]
default_bits                    = 1024
distinguished_name              = req_DN
default_md			= sha256
string_mask			= utf8only
[ req_DN ]
countryName                     = "Country Name is Northern Nowhere"
countryName_value            = NN
organizationName              = "Organization Name"
organizationName_value     = Edel Curl Arctic Illudium Research Cloud
commonName                      = "Common Name"
commonName_value              = localhost 

[something]
# The key
# the certificate
# some dhparam
curl-7.35.0/tests/certs/Server-localhost-sv.crl0000644000175000017500000000127212213173003016334 00000000000000-----BEGIN X509 CRL-----
MIIB2zCBxAIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJOTjExMC8GA1UE
CgwoRWRlbCBDdXJsIEFyY3RpYyBJbGx1ZGl1bSBSZXNlYXJjaCBDbG91ZDElMCMG
A1UEAwwcTm90aGVybiBOb3doZXJlIFRydXN0IEFuY2hvchcNMTAwNTI3MjEzNzEx
WhcNMTAwNjI2MjEzNzExWjAZMBcCBguYlPl8ahcNMTAwNTI3MjEzNzExWqAOMAww
CgYDVR0UBAMCAQEwDQYJKoZIhvcNAQEFBQADggEBAFuPZJ/cNNCeAzkSxVvPPPRX
Wsv9T6Dt61C5Fmq9eSNN2kRf7/dq5A5nqTIlHbXXiLdj3UqNhUHXe2oA1UpbdHz9
0JlfwWm1Y/gMr1fh1n0oFebEtCuOgDRpd07Uiz8AqOUBykDNDUlMvVwR9raHL8hj
NRwzugsfIxl0CvLLqrBpUWMxW3qemk4cWW39yrDdZgKo6eOZAOR3FQYlLIrw6Jcr
Kmm0PjdcJIfRgJvNysgyx1dIIKe7QXvFTR/QzdHWIWTkiYIW7wUKSzSICvDCr094
eo3nr3n9BtOqT61Z1m6FGCP6Mm0wFl6xLTCNd6ygfFo7pcAdWlUsdBgKzics0Kc=
-----END X509 CRL-----
curl-7.35.0/tests/certs/Server-localhost-sv.prm0000644000175000017500000000133412213173003016351 00000000000000extensions = x509v3
[ x509v3 ]
subjectAltName = DNS:localhost
keyUsage	= keyEncipherment
extendedKeyUsage = serverAuth
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid
basicConstraints = critical,CA:false
[ req ]
default_bits                    = 1024
distinguished_name              = req_DN
default_md			= sha256
string_mask			= utf8only
[ req_DN ]
countryName                     = "Country Name is Northern Nowhere"
countryName_value            = NN
organizationName              = "Organization Name"
organizationName_value     = Edel Curl Arctic Illudium Research Cloud
commonName                      = "Common Name"
commonName_value              = localhost 

[something]
# The key
# the certficate
# some dhparam
curl-7.35.0/tests/certs/EdelCurlRoot-ca.cacert0000644000175000017500000001073012213173003016056 00000000000000Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            0b:98:94:f5:ab:a6
        Signature Algorithm: sha1WithRSAEncryption
        Issuer:
            countryName               = NN
            organizationName          = Edel Curl Arctic Illudium Research Cloud
            commonName                = Nothern Nowhere Trust Anchor
        Validity
            Not Before: May 27 21:36:46 2010 GMT
            Not After : Oct 30 21:36:46 2026 GMT
        Subject:
            countryName               = NN
            organizationName          = Edel Curl Arctic Illudium Research Cloud
            commonName                = Nothern Nowhere Trust Anchor
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (2048 bit)
                Modulus:
                    00:c1:a9:0a:ef:76:06:7d:fe:78:3a:f1:0e:40:6d:
                    c2:5b:ae:8f:8d:7f:f0:d5:89:9e:42:2a:f0:17:94:
                    d9:2e:67:c7:2d:01:1c:95:a3:b1:a6:86:d4:12:3c:
                    47:3a:70:e6:7b:1f:11:06:d3:73:ae:df:ca:24:19:
                    03:e4:62:0a:eb:67:d4:dc:ef:9d:2d:e0:82:77:fe:
                    2a:30:5a:fb:57:e5:b8:4f:36:52:4c:2f:57:ad:12:
                    6a:94:3e:e4:48:a7:ad:a5:c0:3a:d0:4e:00:99:88:
                    8f:bd:4a:70:be:3b:5b:6b:ff:5e:6f:29:6d:0c:a7:
                    55:4a:e2:43:e7:49:0f:99:54:59:68:81:34:d8:a9:
                    fb:c8:0d:14:5a:40:cb:70:1e:f5:3b:c0:42:39:06:
                    f9:63:ad:d9:29:14:53:af:42:10:1d:18:95:b6:15:
                    8a:d8:41:d8:37:31:0a:97:5a:1b:10:90:ac:1d:ff:
                    6e:71:33:6b:7e:88:18:20:ed:be:35:ff:e7:69:48:
                    05:c0:78:2e:04:46:f4:c2:8d:4d:70:6e:42:fa:93:
                    eb:ce:12:3b:d1:f5:ce:3f:29:5c:8c:bd:59:83:e4:
                    a1:c1:3c:8e:3e:38:55:f3:99:18:b0:df:f6:74:c9:
                    8e:28:f4:38:0d:45:20:d6:db:c0:73:a2:e6:8c:6e:
                    98:9f
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Basic Constraints: critical
                CA:TRUE
            X509v3 Key Usage: critical
                Certificate Sign, CRL Sign
            X509v3 Subject Key Identifier: 
                AD:3E:E2:39:07:B8:5C:AA:26:90:94:4C:26:69:21:83:E2:4E:36:94
    Signature Algorithm: sha1WithRSAEncryption
        86:1f:9d:dd:45:11:c8:6b:f1:97:1a:f0:25:b2:0c:f7:1f:58:
        c4:6a:a5:56:07:32:cb:2d:7a:8c:ae:47:1e:7d:e7:73:6c:3b:
        96:1e:75:b4:e5:89:05:a7:7e:b6:52:56:5a:e2:6b:38:e4:18:
        3c:64:6f:be:bd:d3:01:76:b4:83:7f:7a:1e:9c:cb:40:1b:9a:
        dd:43:cb:9a:db:8a:f8:76:50:ab:ad:85:7f:cf:3a:6f:4b:e2:
        27:b0:8c:a9:0a:e0:d8:45:00:05:5e:29:ab:a0:8a:78:e5:09:
        89:48:8a:0d:42:49:1e:ad:c2:85:2f:29:9d:af:2e:c8:ef:b9:
        dc:74:33:eb:e9:45:e9:a2:b3:00:ba:76:0b:74:59:c9:a8:96:
        4c:f3:cd:9b:34:5a:4a:87:b2:6a:52:74:5b:be:f3:81:f8:32:
        d0:1f:c9:cc:9f:8a:6a:eb:6e:f3:6d:2c:54:20:86:f6:87:62:
        c0:ed:55:03:9d:97:a9:5a:ae:39:a0:7e:e4:a6:95:e9:26:19:
        91:e6:0f:b6:18:f7:49:6c:a7:ce:fd:c1:04:c2:f9:27:27:4c:
        59:e9:bf:7a:f6:65:a0:d9:a0:71:a6:54:c6:6f:9a:5d:23:19:
        57:49:59:2c:06:91:3e:28:9b:c1:6f:f2:2d:9a:24:a7:0b:da:
        cd:cc:f3:bc
-----BEGIN CERTIFICATE-----
MIIDkDCCAnigAwIBAgIGC5iU9aumMA0GCSqGSIb3DQEBBQUAMGcxCzAJBgNVBAYT
Ak5OMTEwLwYDVQQKDChFZGVsIEN1cmwgQXJjdGljIElsbHVkaXVtIFJlc2VhcmNo
IENsb3VkMSUwIwYDVQQDDBxOb3RoZXJuIE5vd2hlcmUgVHJ1c3QgQW5jaG9yMB4X
DTEwMDUyNzIxMzY0NloXDTI2MTAzMDIxMzY0NlowZzELMAkGA1UEBhMCTk4xMTAv
BgNVBAoMKEVkZWwgQ3VybCBBcmN0aWMgSWxsdWRpdW0gUmVzZWFyY2ggQ2xvdWQx
JTAjBgNVBAMMHE5vdGhlcm4gTm93aGVyZSBUcnVzdCBBbmNob3IwggEiMA0GCSqG
SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDBqQrvdgZ9/ng68Q5AbcJbro+Nf/DViZ5C
KvAXlNkuZ8ctARyVo7GmhtQSPEc6cOZ7HxEG03Ou38okGQPkYgrrZ9Tc750t4IJ3
/iowWvtX5bhPNlJML1etEmqUPuRIp62lwDrQTgCZiI+9SnC+O1tr/15vKW0Mp1VK
4kPnSQ+ZVFlogTTYqfvIDRRaQMtwHvU7wEI5BvljrdkpFFOvQhAdGJW2FYrYQdg3
MQqXWhsQkKwd/25xM2t+iBgg7b41/+dpSAXAeC4ERvTCjU1wbkL6k+vOEjvR9c4/
KVyMvVmD5KHBPI4+OFXzmRiw3/Z0yY4o9DgNRSDW28BzouaMbpifAgMBAAGjQjBA
MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBStPuI5
B7hcqiaQlEwmaSGD4k42lDANBgkqhkiG9w0BAQUFAAOCAQEAhh+d3UURyGvxlxrw
JbIM9x9YxGqlVgcyyy16jK5HHn3nc2w7lh51tOWJBad+tlJWWuJrOOQYPGRvvr3T
AXa0g396HpzLQBua3UPLmtuK+HZQq62Ff886b0viJ7CMqQrg2EUABV4pq6CKeOUJ
iUiKDUJJHq3ChS8pna8uyO+53HQz6+lF6aKzALp2C3RZyaiWTPPNmzRaSoeyalJ0
W77zgfgy0B/JzJ+Kautu820sVCCG9odiwO1VA52XqVquOaB+5KaV6SYZkeYPthj3
SWynzv3BBML5JydMWem/evZloNmgcaZUxm+aXSMZV0lZLAaRPiibwW/yLZokpwva
zczzvA==
-----END CERTIFICATE-----
curl-7.35.0/tests/rtspserver.pl0000755000175000017500000000570412213173003013413 00000000000000#!/usr/bin/env perl
#***************************************************************************
#                                  _   _ ____  _
#  Project                     ___| | | |  _ \| |
#                             / __| | | | |_) | |
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2010, 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.
#
#***************************************************************************

BEGIN {
    push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
    push(@INC, ".");
}

use strict;
use warnings;

use serverhelp qw(
    server_pidfilename
    server_logfilename
    );

my $verbose = 0;     # set to 1 for debugging
my $port = 8990;     # just a default
my $ipvnum = 4;      # default IP version of rtsp server
my $idnum = 1;       # dafault rtsp server instance number
my $proto = 'rtsp';  # protocol the rtsp server speaks
my $pidfile;         # rtsp server pid file
my $logfile;         # rtsp server log file
my $srcdir;

my $flags  = "";
my $path   = '.';
my $logdir = $path .'/log';

while(@ARGV) {
    if($ARGV[0] eq '--pidfile') {
        if($ARGV[1]) {
            $pidfile = $ARGV[1];
            shift @ARGV;
        }
    }
    elsif($ARGV[0] eq '--logfile') {
        if($ARGV[1]) {
            $logfile = $ARGV[1];
            shift @ARGV;
        }
    }
    elsif($ARGV[0] eq '--srcdir') {
        if($ARGV[1]) {
            $srcdir = $ARGV[1];
            shift @ARGV;
        }
    }
    elsif($ARGV[0] eq '--ipv4') {
        $ipvnum = 4;
    }
    elsif($ARGV[0] eq '--ipv6') {
        $ipvnum = 6;
    }
    elsif($ARGV[0] eq '--port') {
        if($ARGV[1] =~ /^(\d+)$/) {
            $port = $1;
            shift @ARGV;
        }
    }
    elsif($ARGV[0] eq '--id') {
        if($ARGV[1] =~ /^(\d+)$/) {
            $idnum = $1 if($1 > 0);
            shift @ARGV;
        }
    }
    elsif($ARGV[0] eq '--verbose') {
        $verbose = 1;
    }
    else {
        print STDERR "\nWarning: rtspserver.pl unknown parameter: $ARGV[0]\n";
    }
    shift @ARGV;
}

if(!$srcdir) {
    $srcdir = $ENV{'srcdir'} || '.';
}
if(!$pidfile) {
    $pidfile = "$path/". server_pidfilename($proto, $ipvnum, $idnum);
}
if(!$logfile) {
    $logfile = server_logfilename($logdir, $proto, $ipvnum, $idnum);
}

$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
$flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";

exec("server/rtspd $flags");
curl-7.35.0/tests/testcurl.10000644000175000017500000001207112213173003012556 00000000000000.\" **************************************************************************
.\" *                                  _   _ ____  _
.\" *  Project                     ___| | | |  _ \| |
.\" *                             / __| | | | |_) | |
.\" *                            | (__| |_| |  _ <| |___
.\" *                             \___|\___/|_| \_\_____|
.\" *
.\" * Copyright (C) 1998 - 2010, 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.
.\" *
.\" **************************************************************************
.\"
.TH testcurl.pl 1 "24 Mar 2010" "Curl 7.20.1" "testcurl"
.SH NAME
testcurl.pl \- (automatically) test curl
.SH SYNOPSIS
.B testcurl.pl [options] [dir] > output
.SH DESCRIPTION
\fItestcurl.pl\fP is the master script to use for automatic testing of curl
off git or daily snapshots. It is written for the purpose of being run from a
crontab job or similar at a regular interval. The output is suitable to be
mailed to curl-autocompile@haxx.se to be dealt with automatically (make sure
the subject includes the word "autobuild" as the mail gets silently discarded
otherwise).  The most current build status (with a reasonable backlog) will be
published on the curl site, at http://curl.haxx.se/auto/

\fIoptions\fP may be omitted. See \fI--setup\fP for what happens then.

\fIdir\fP is a curl source dir, possibly a daily snapshot one. Using this will
make testcurl.pl skip the 'buildconf' stage and thus it removes the dependency
on automake, autoconf, libtool, GNU m4 and possibly a few other things.

testcurl.pl will run 'buildconf' (or similar), run configure, build curl and
libcurl in a separate build directory and then run 'make test' to test the
fresh build.
.SH OPTIONS
.IP "--configure=[options]"
Configure options passed to configure.
.IP "--crosscompile"
This is a cross-compile. Makes \fItestcurl.pl\fP skip a few things.
.IP "--desc=[desc]"
Description of your test system. Displayed on the build summary page on the
weba site.
.IP "--email=[email]"
Set email address to report as. Displayed in the build logs on the site.
.IP "--mktarball=[command]"
Generic command to run after completed test.
.IP "--name=[name]"
Set name to report as. Displayed in the build summary on the site.
.IP "--nobuildconf"
Don't run buildconf. Useful when many builds use the same source tree, as then
only one need to do this. Also, if multiple processes run tests simultaneously
on the same source tree (like several hosts on a NFS mounted dir),
simultaneous buildconf invokes may cause problems. (Added in 7.14.1)
.IP "--nogitpull"
Don't update from git even though it is a git tree. Useful to still be able to
test even though your network is down, or similar.
.IP "--runtestopts=[options]"
Options that is passed to the runtests.pl script. Useful for disabling valgrind
by force, and similar.
.IP "--setup=[file name]"
File name to read setup from (deprecated). The old style of providing info.
If info is missing when testcurl.pl is started, it will prompt you and then
store the info in a 'setup' file, which it will look for on each invoke. Use
\fI--name\fP, \fI--email\fP, \fI--configure\fP and \fI--desc\fP instead.
.IP "--target=[your os]"
Specify your target environment. Recognized strings include 'vc', 'mingw32',
\&'borland' and 'netware'.
.SH "INITIAL SETUP"
First you make a checkout from git (or you write a script that downloads daily
snapshots automatically, find inspiration at
http://curl.haxx.se/auto/autocurl.txt):

.nf
  $ mkdir daily-curl
  $ cd daily-curl
  $ git clone git://github.com/bagder/curl.git
.fi

With the curl sources checked out, or downloaded, you can start testing right
away. If you want to use \fItestcurl.pl\fP without command line arguments and
to have it store and remember the config in its 'setup' file, then start it
manually now and fill in the answers to the questions it prompts you for:

.nf
  $ ./curl/tests/testcurl.pl
.fi

Now you are ready to go. If you let the script run, it will perform a full
cycle and spit out lots of output. Mail us that output as described above.
.SH "CRONTAB EXAMPLE"
The crontab could include something like this:

.nf
\# autobuild curl:
0 4 * * * cd daily-curl && ./testit.sh
.fi

Where testit.sh is a shell script that could look similar to this:

.nf
mail="mail -s autobuild curl-autocompile@haxx.se"
name="--name=whoami"
email="--email=iamme@nowhere"
desc='"--desc=supermachine Turbo 2000"'
testprog="perl ./curl/tests/testcurl.pl $name $email $desc"
opts1="--configure=--enable-debug"
opts2="--configure=--enable-ipv6"

# run first test
$testprog $opts1 | $mail

# run second test
$testprog $opts2 | $mail
curl-7.35.0/tests/symbol-scan.pl0000644000175000017500000001063212213173003013414 00000000000000#!/usr/bin/env perl
#***************************************************************************
#                                  _   _ ____  _
#  Project                     ___| | | |  _ \| |
#                             / __| | | | |_) | |
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#
# Copyright (C) 2010-2011, 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.
#
###########################################################################
#
# This script grew out of help from Przemyslaw Iskra and Balint Szilakszi
# a late evening in the #curl IRC channel on freenode.
#

use strict;
use warnings;

#
# configurehelp perl module is generated by configure script
#
use configurehelp qw(
    $Cpreprocessor
    );

# we may get the dir root pointed out
my $root=$ARGV[0] || ".";

# need an include directory when building out-of-tree
my $i = ($ARGV[1]) ? "-I$ARGV[1] " : '';

my $h = "$root/include/curl/curl.h";
my $mh = "$root/include/curl/multi.h";

my $verbose=0;
my $summary=0;
my $misses=0;

my @syms;
my %doc;
my %rem;

open H_IN, "-|", "$Cpreprocessor $i$h" || die "Cannot preprocess curl.h";
while (  ) {
    if ( /enum\s+(\S+\s+)?{/ .. /}/ ) {
        s/^\s+//;
        next unless /^CURL/;
        chomp;
        s/[,\s].*//;
        push @syms, $_;
    }
}
close H_IN || die "Error preprocessing curl.h";

sub scanheader {
    my ($f)=@_;
    open H, "<$f";
    while() {
        if (/^#define (CURL[A-Za-z0-9_]*)/) {
            push @syms, $1;
        }
    }
    close H;
}

scanheader($h);
scanheader($mh);

open S, "<$root/docs/libcurl/symbols-in-versions";
while() {
    if(/(^CURL[^ \n]*) *(.*)/) {
        my ($sym, $rest)=($1, $2);
        if($doc{$sym}) {
            print "Detected duplicate symbol: $sym\n";
            $misses++;
            next;
        }
        $doc{$sym}=$sym;
        my @a=split(/ +/, $rest);
        if($a[2]) {
            # this symbol is documented to have been present the last time
            # in this release
            $rem{$sym}=$a[2];
        }
    }
}
close S;

my $ignored=0;
for my $e (sort @syms) {
    # OBSOLETE - names that are just placeholders for a position where we
    # previously had a name, that is now removed. The OBSOLETE names should
    # never be used for anything.
    #
    # CURL_EXTERN - is a define used for libcurl functions that are external,
    # public. No app or other code should ever use it.
    #
    # *_LAST and *_LASTENTRY are just prefix for the placeholders used for the
    # last entry in many enum series.
    #

    if($e =~ /(OBSOLETE|^CURL_EXTERN|_LAST\z|_LASTENTRY\z)/) {
        $ignored++;
        next;
    }
    if($doc{$e}) {
        if($verbose) {
            print $e."\n";
        }
        $doc{$e}="used";
        next;
    }
    else {
        print $e."\n";
        $misses++;
    }
}

#
# now scan through all symbols that were present in the symbols-in-versions
# but not in the headers
#
# If the symbols were marked 'removed' in symbols-in-versions we don't output
# anything about it since that is perfectly fine.
#

my $anyremoved;

for my $e (sort keys %doc) {
    if(($doc{$e} ne "used") && !$rem{$e}) {

        if(!$anyremoved++) {
            print "Missing symbols mentioned in symbols-in-versions\n";
            print "Add them to a header, or mark them as removed.\n";
        }

        print "$e\n";
        $misses++;
    }
}

if($summary) {
    print "Summary:\n";
    printf "%d symbols in headers (out of which %d are ignored)\n", scalar(@syms),
    $ignored;
    printf "%d symbols in headers are interesting\n",
    scalar(@syms)- $ignored;
    printf "%d symbols are listed in symbols-in-versions\n (out of which %d are listed as removed)\n", scalar(keys %doc), scalar(keys %rem);
    printf "%d symbols in symbols-in-versions should match the ones in headers\n", scalar(keys %doc) - scalar(keys %rem);
}

if($misses) {
    exit 2; # there are stuff to attend to!
}
curl-7.35.0/tests/directories.pm0000644000175000017500000001727012213173003013507 00000000000000#***************************************************************************
#                                  _   _ ____  _
#  Project                     ___| | | |  _ \| |
#                             / __| | | | |_) | |
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2011, 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.
#
###########################################################################
%file_chmod1 = (
  'name'      => 'chmod1',
  'content'   => "This file should have permissions 444\n",
  'perm'      => 'r--r--r--',
  'time'      => 'Jan 11 10:00',
  'dostime'   => '01-11-10  10:00AM',
);

%file_chmod2 = (
  'name'      => 'chmod2',
  'content'   => "This file should have permissions 666\n",
  'perm'      => 'rw-rw-rw-',
  'time'      => 'Feb  1  8:00',
  'dostime'   => '02-01-10  08:00AM',
);

%file_chmod3 = (
  'name'      => 'chmod3',
  'content'   => "This file should have permissions 777\n",
  'perm'      => 'rwxrwxrwx',
  'time'      => 'Feb  1  8:00',
  'dostime'   => '02-01-10  08:00AM',
);

%file_chmod4 = (
  'type'      => 'd',
  'name'      => 'chmod4',
  'content'   => "This file should have permissions 001\n",
  'perm'      => '--S--S--t',
  'time'      => 'May  4  4:31',
  'dostime'   => '05-04-10  04:31AM'
);

%file_chmod5 = (
  'type'      => 'd',
  'name'      => 'chmod5',
  'content'   => "This file should have permissions 110\n",
  'perm'      => '--s--s--T',
  'time'      => 'May  4  4:31',
  'dostime'   => '05-04-10  04:31AM'
);

%link_link = (
  'type'      => 'l',
  'name'      => 'link -> file.txt',
  'size'      => '8',
  'perm'      => 'rwxrwxrwx',
  'time'      => 'Jan  6  4:42'
);

%link_link_absolute = (
  'type'      => 'l',
  'name'      => 'link_absolute -> /data/ftp/file.txt',
  'size'      => '15',
  'perm'      => 'rwxrwxrwx',
  'time'      => 'Jan  6  4:45'
);

%dir_dot = (
  'type'      => "d",
  'name'      => ".",
  'hlink'     => "4",
  'time'      => "Apr 27  5:12",
  'size'      => "20480",
  'dostime'   => "04-27-10  05:12AM",
  'perm'      => "rwxrwxrwx"
);

%dir_ddot = (
  'type'      => "d",
  'name'      => "..",
  'hlink'     => "4",
  'size'      => "20480",
  'time'      => "Apr 23  3:12",
  'dostime'   => "04-23-10  03:12AM",
  'perm'      => "rwxrwxrwx"
);

%dir_weirddir_txt = (
  'type'      => "d",
  'name'      => "weirddir.txt",
  'hlink'     => "2",
  'size'      => "4096",
  'time'      => "Apr 23  3:12",
  'dostime'   => "04-23-10  03:12AM",
  'perm'      => "rwxr-xrwx"
);

%dir_UNIX = (
  'type'      => "d",
  'name'      => "UNIX",
  'hlink'     => "11",
  'size'      => "4096",
  'time'      => "Nov 01  2008",
  'dostime'   => "11-01-08  11:11AM",
  'perm'      => "rwx--x--x"
);

%dir_DOS = (
  'type'      => "d",
  'name'      => "DOS",
  'hlink'     => "11",
  'size'      => "4096",
  'time'      => "Nov 01  2008",
  'dostime'   => "11-01-08  11:11AM",
  'perm'      => "rwx--x--x"
);

%dir_dot_NeXT = (
  'type'      => "d",
  'name'      => ".NeXT",
  'hlink'     => "4",
  'size'      => "4096",
  'time'      => "Jan 23  2:05",
  'dostime'   => "01-23-05  02:05AM",
  'perm'      => "rwxrwxrwx"
);

%file_empty_file_dat = (
  'name'      => "empty_file.dat",
  'content'   => "",
  'perm'      => "rw-r--r--",
  'time'      => "Apr 27 11:01",
  'dostime'   => "04-27-10  11:01AM"
);

%file_file_txt = (
  'name'      => "file.txt",
  'content'   => "This is content of file \"file.txt\"\n",
  'time'      => "Apr 27 11:01",
  'dostime'   => "04-27-10  11:01AM",
  'perm'      => "rw-r--r--"
);

%file_someothertext_txt = (
  'name'      => "someothertext.txt",
  'content'   => "Some junk ;-) This file does not really exist.\n",
  'time'      => "Apr 27 11:01",
  'dostime'   => "04-27-10  11:01AM",
  'perm'      => "rw-r--r--"
);

%lists = (
  '/fully_simulated/' => {
    'files'   => [ \%dir_dot, \%dir_ddot, \%dir_DOS, \%dir_UNIX ],
    'eol'     => "\r\n",
    'type'    => "unix"
  },
  '/fully_simulated/UNIX/' => {
    'files'   => [ \%dir_dot, \%dir_ddot,
                   \%file_chmod1, \%file_chmod2, \%file_chmod3, \%file_chmod4, \%file_chmod5,
                   \%file_empty_file_dat, \%file_file_txt,
                   \%link_link, \%link_link_absolute, \%dir_dot_NeXT,
                   \%file_someothertext_txt, \%dir_weirddir_txt ],
    'eol'     => "\r\n",
    'type'    => 'unix'
  },
  '/fully_simulated/DOS/' => {
    'files'   => [ \%dir_dot, \%dir_ddot,
                   \%file_chmod1, \%file_chmod2, \%file_chmod3, \%file_chmod4, \%file_chmod5,
                   \%file_empty_file_dat, \%file_file_txt,
                   \%dir_dot_NeXT, \%file_someothertext_txt, \%dir_weirddir_txt ],
    'eol'     => "\r\n",
    'type'    => 'dos'
  }
);

sub ftp_createcontent($) {
  my (%list) = @_;

  $type = $$list{'type'};
  $eol  = $$list{'eol'};
  $list_ref = $$list{'files'};

  my @diroutput;
  my @contentlist;
  if($type eq "unix") {
    for(@$list_ref) {
      my %file = %$_;
      my $line = "";
      my $ftype  = $file{'type'}  ? $file{'type'}  : "-";
      my $fperm  = $file{'perm'}  ? $file{'perm'}  : "rwxr-xr-x";
      my $fuser  = $file{'user'}  ? sprintf("%15s", $file{'user'})   : "ftp-default";
      my $fgroup = $file{'group'} ? sprintf("%15s", $file{'group'})  : "ftp-default";
      my $fsize = "";
      if($file{'type'} eq "d") {
        $fsize = $file{'size'} ? sprintf("%7s", $file{'size'}) : sprintf("%7d", 4096);
      }
      else {
        $fsize = sprintf("%7d", length $file{'content'});
      }
      my $fhlink = $file{'hlink'} ? sprintf("%4d",  $file{'hlink'})  : "   1";
      my $ftime  = $file{'time'}  ? sprintf("%10s", $file{'time'})   : "Jan 9  1933";
      push(@contentlist, "$ftype$fperm $fhlink $fuser $fgroup $fsize $ftime $file{'name'}$eol");
    }

    return @contentlist;
  }
  elsif($type =~ /^dos$/) {
    for(@$list_ref) {
      my %file = %$_;
      my $line = "";
      my $time = $file{'dostime'} ? $file{'dostime'} : "06-25-97  09:12AM";
      my $size_or_dir;
      if($file{'type'} =~ /^d$/) {
        $size_or_dir = "               ";
      }
      else {
        $size_or_dir = sprintf("%20d", length $file{'content'});
      }
      push(@contentlist, "$time $size_or_dir $file{'name'}$eol");
    }
    return @contentlist;
  }
}

sub wildcard_filesize($$) {
  my ($list_type, $file) = @_;
  $list = $lists{$list_type};
  if($list) {
    my $files = $list->{'files'};
    for(@$files) {
      my %f = %$_;
      if ($f{'name'} eq $file) {
        if($f{'content'}) {
          return length $f{'content'};
        }
        elsif ($f{'type'} ne "d"){
          return 0;
        }
        else {
          return -1;
        }
      }
    }
  }
  return -1;
}
sub wildcard_getfile($$) {
  my ($list_type, $file) = @_;
  $list = $lists{$list_type};
  if($list) {
    my $files = $list->{'files'};
    for(@$files) {
      my %f = %$_;
      if ($f{'name'} eq $file) {
        if($f{'content'}) {
          return (length $f{'content'}, $f{'content'});
        }
        elsif ($f{'type'} ne "d"){
          return (0, "");
        }
        else {
          return (-1, 0);
        }
      }
    }
  }
  return (-1, 0);
}

sub ftp_contentlist {
  my $listname = $_[0];
  $list = $lists{$listname};
  return ftp_createcontent(\$list);
}
curl-7.35.0/tests/mem-include-scan.pl0000644000175000017500000000511512213173003014306 00000000000000#!/usr/bin/env perl
#***************************************************************************
#                                  _   _ ____  _
#  Project                     ___| | | |  _ \| |
#                             / __| | | | |_) | |
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#
# Copyright (C) 2010-2012, 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.
#
###########################################################################
#
# This script scans C source files. If they seem to use memory functions,
# it also makes sure that it #includes the correct two header files!
#
# You can also mark a C source as fine by using 'mem-include-scan' anywhere in
# it.
#

use strict;
use warnings;

my $dir = $ARGV[0] || die "specify directory!";

sub scanfile {
    my ($file) = @_;
    my $memfunc;
    my $memdebug;
    my $curlmem;

    print STDERR "checking $file...\n";

    open(F, "<$file");
    while() {
        if($_ =~ /(free|alloc|strdup)\(/) {
            $memfunc++;
        }
        elsif($_ =~ /^ *# *include \"memdebug.h\"/) {
            $memdebug++;
        }
        elsif($_ =~ /^ *# *include \"curl_memory.h\"/) {
            $curlmem++;
        }
        elsif($_ =~ /mem-include-scan/) {
            # free pass
            close(F);
            return 0;
        }
        if($memfunc && $memdebug && $curlmem) {
            last;
        }
    }
    close(F);


    if($memfunc) {
        if($memdebug && $curlmem) {
            return 0;
        }
        else {
            if(!$memdebug) {
                print STDERR "$file doesn't include \"memdebug.h\"!\n";
            }
            if(!$curlmem) {
                print STDERR "$file doesn't include \"curl_memory.h\"!\n";
            }
            return 1;
        }
    }
    return 0;
}

opendir(my $dh, $dir) || die "can't opendir $dir: $!";
my @cfiles = grep { /\.c\z/ && -f "$dir/$_" } readdir($dh);
closedir $dh;

my $errs;
for(@cfiles) {
    $errs += scanfile("$dir/$_");
}

if($errs) {
    print STDERR "----\n$errs errors detected!\n";
    exit 2;
}
curl-7.35.0/tests/runtests.10000644000175000017500000001265012262353672012623 00000000000000.\" **************************************************************************
.\" *                                  _   _ ____  _
.\" *  Project                     ___| | | |  _ \| |
.\" *                             / __| | | | |_) | |
.\" *                            | (__| |_| |  _ <| |___
.\" *                             \___|\___/|_| \_\_____|
.\" *
.\" * Copyright (C) 1998 - 2013, 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.
.\" *
.\" **************************************************************************
.\"
.TH runtests.pl 1 "2 Feb 2010" "Curl 7.20.0" "runtests"
.SH NAME
runtests.pl \- run one or more test cases
.SH SYNOPSIS
.B runtests.pl [options] [test number] [!test number] [key word] [!key word]
.SH DESCRIPTION
\fIruntests.pl\fP runs one, several or all the existing test cases in curl's
test suite. It is often called from the root Makefile of the curl package with
\&'make test'.
.SH "TEST NUMBER"
If no test case number is given, all existing tests that the script can find
will be considered for running. You can specify single test cases to run,
space-separated, like "1 3 5 7 11", and you can specify a range like "45 to
67". You can also specify only the tests you don't want to run by listing
the numbers with a leading exclamation point, like "!66".
.P
It is also possible to specify tests to skip based on a key word describing
the test. These are specified with a leading exclamation point and the
key word or phrase, like "!HTTP NTLM auth".  Likewise, tests to run can
be specified simply by specifying the unadorned key words, like "FTPS".
Remember that the exclamation marks and spaces will need to be quoted somehow
when entered at many command shells.
.SH OPTIONS
.IP "-a"
Continue running the rest of the test cases even if one test fails. By
default, the test script stops as soon as an error is detected.
.IP "-bN"
Use N as the base TCP/UDP port number on which to start the test servers.
.IP "-c "
Provide a path to a custom curl binary to run the tests with. Default is the
curl executable in the build tree.
.IP "-d"
Enable protocol debug: have the servers display protocol output.
.IP "-e"
Run the test event-based (if possible). This will make runtests invoke curl
with --test-event option. This option only works if both curl and libcurl were
built debug-enabled.
.IP "-g"
Run the given test(s) with gdb. This is best used on a single test case and
curl built --disable-shared. This then fires up gdb with command line set to
run the specified test case. Simply (set a break-point and) type 'run' to
start.
.IP "-h"
Displays a help text about this program's command line options.
.IP "-k"
Keep output and log files in log/ after a test run, even if no error was
detected. Useful for debugging.
.IP "-l"
Lists all test case names.
.IP "-n"
Disable the check for and use of valgrind.
.IP "-p"
Prints out all files in "log/" to stdout when a test case fails. Very
practical when used in the automated and distributed tests since then the
people checking the failures and the reasons for them might not have physical
access to the machine and logs.
.IP "-r"
Display run time statistics. (Requires Perl Time::HiRes module)
.IP "-rf"
Display full run time statistics. (Requires Perl Time::HiRes module)
.IP "-s"
Shorter output. Speaks less than default.
.IP "-t[num]"
Selects a \fBtorture\fP test for the given tests. This makes runtests.pl first
run the tests once and count the number of memory allocations made. It then
reruns the test that number of times, each time forcing one of the allocations
to fail until all allocs have been tested. By setting \fInum\fP you can force
the allocation with that number to be set to fail at once instead of looping
through everyone, which is very handy when debugging and then often in
combination with \fI-g\fP.
.IP "-v"
Enable verbose output. Speaks more than default.
.IP "-vc "
Provide a path to a custom curl binary to run when verifying that the servers
running are indeed our test servers. Default is the curl executable in the
build tree.
.SH "RUNNING TESTS"
Many tests have conditions that must be met before the test case can run
fine. They could depend on built-in features in libcurl or features present in
the operating system or even in third-party libraries that curl may or may not
use.
.P
The test script checks most of these by itself to determine when it is
safe to attempt to run each test.  Those which cannot be run due to
failed requirements will simply be skipped and listed at the completion
of all test cases.  In some unusual configurations, the test script
cannot make the correct determination for all tests.  In these cases,
the problematic tests can be skipped using the "!keyword" skip feature
documented earlier.
.SH "WRITING TESTS"
The simplest way to write test cases is to start with a similar existing test,
save it with a new number and then adjust it to fit. There's an attempt to
document the test case file format in the tests/FILEFORMAT.
curl-7.35.0/tests/ftpserver.pl0000755000175000017500000026125012270035364013226 00000000000000#!/usr/bin/env perl
#***************************************************************************
#                                  _   _ ____  _
#  Project                     ___| | | |  _ \| |
#                             / __| | | | |_) | |
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2014, 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.
#
###########################################################################

# This is a server designed for the curl test suite.
#
# In December 2009 we started remaking the server to support more protocols
# that are similar in spirit. Like POP3, IMAP and SMTP in addition to the FTP
# it already supported since a long time. Note that it still only supports one
# protocol per invoke. You need to start multiple servers to support multiple
# protocols simultaneously.
#
# It is meant to exercise curl, it is not meant to be a fully working
# or even very standard compliant server.
#
# You may optionally specify port on the command line, otherwise it'll
# default to port 8921.
#
# All socket/network/TCP related stuff is done by the 'sockfilt' program.
#

BEGIN {
    push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
    push(@INC, ".");
    # sub second timestamping needs Time::HiRes
    eval {
        no warnings "all";
        require Time::HiRes;
        import  Time::HiRes qw( gettimeofday );
    }
}

use strict;
use warnings;
use IPC::Open2;
use Digest::MD5;

require "getpart.pm";
require "ftp.pm";
require "directories.pm";

use serverhelp qw(
    servername_str
    server_pidfilename
    server_logfilename
    mainsockf_pidfilename
    mainsockf_logfilename
    datasockf_pidfilename
    datasockf_logfilename
    );

#**********************************************************************
# global vars...
#
my $verbose = 0;    # set to 1 for debugging
my $idstr = "";     # server instance string
my $idnum = 1;      # server instance number
my $ipvnum = 4;     # server IPv number (4 or 6)
my $proto = 'ftp';  # default server protocol
my $srcdir;         # directory where ftpserver.pl is located
my $srvrname;       # server name for presentation purposes
my $cwd_testno;     # test case numbers extracted from CWD command
my $path   = '.';
my $logdir = $path .'/log';

#**********************************************************************
# global vars used for server address and primary listener port
#
my $port = 8921;               # default primary listener port
my $listenaddr = '127.0.0.1';  # default address for listener port

#**********************************************************************
# global vars used for file names
#
my $pidfile;            # server pid file name
my $logfile;            # server log file name
my $mainsockf_pidfile;  # pid file for primary connection sockfilt process
my $mainsockf_logfile;  # log file for primary connection sockfilt process
my $datasockf_pidfile;  # pid file for secondary connection sockfilt process
my $datasockf_logfile;  # log file for secondary connection sockfilt process

#**********************************************************************
# global vars used for server logs advisor read lock handling
#
my $SERVERLOGS_LOCK = 'log/serverlogs.lock';
my $serverlogslocked = 0;

#**********************************************************************
# global vars used for child processes PID tracking
#
my $sfpid;        # PID for primary connection sockfilt process
my $slavepid;     # PID for secondary connection sockfilt process

#**********************************************************************
# global typeglob filehandle vars to read/write from/to sockfilters
#
local *SFREAD;    # used to read from primary connection
local *SFWRITE;   # used to write to primary connection
local *DREAD;     # used to read from secondary connection
local *DWRITE;    # used to write to secondary connection

my $sockfilt_timeout = 5;  # default timeout for sockfilter eXsysreads

#**********************************************************************
# global vars which depend on server protocol selection
#
my %commandfunc;   # protocol command specific function callbacks
my %displaytext;   # text returned to client before callback runs

#**********************************************************************
# global vars customized for each test from the server commands file
#
my $ctrldelay;     # set if server should throttle ctrl stream
my $datadelay;     # set if server should throttle data stream
my $retrweirdo;    # set if ftp server should use RETRWEIRDO
my $retrnosize;    # set if ftp server should use RETRNOSIZE
my $pasvbadip;     # set if ftp server should use PASVBADIP
my $nosave;        # set if ftp server should not save uploaded data
my $nodataconn;    # set if ftp srvr doesn't establish or accepts data channel
my $nodataconn425; # set if ftp srvr doesn't establish data ch and replies 425
my $nodataconn421; # set if ftp srvr doesn't establish data ch and replies 421
my $nodataconn150; # set if ftp srvr doesn't establish data ch and replies 150
my @capabilities;  # set if server supports capability commands
my @auth_mechs;    # set if server supports authentication commands
my %fulltextreply; #
my %commandreply;  #
my %customcount;   #
my %delayreply;    #

#**********************************************************************
# global variables for to test ftp wildcardmatching or other test that
# need flexible LIST responses.. and corresponding files.
# $ftptargetdir is keeping the fake "name" of LIST directory.
#
my $ftplistparserstate;
my $ftptargetdir="";

#**********************************************************************
# global variables used when running a ftp server to keep state info
# relative to the secondary or data sockfilt process. Values of these
# variables should only be modified using datasockf_state() sub, given
# that they are closely related and relationship is a bit awkward.
#
my $datasockf_state = 'STOPPED'; # see datasockf_state() sub
my $datasockf_mode = 'none';     # ['none','active','passive']
my $datasockf_runs = 'no';       # ['no','yes']
my $datasockf_conn = 'no';       # ['no','yes']

#**********************************************************************
# global vars used for signal handling
#
my $got_exit_signal = 0; # set if program should finish execution ASAP
my $exit_signal;         # first signal handled in exit_signal_handler

#**********************************************************************
# Mail related definitions
#
my $TEXT_USERNAME = "user";
my $TEXT_PASSWORD = "secret";
my $POP3_TIMESTAMP = "<1972.987654321\@curl>";

#**********************************************************************
# exit_signal_handler will be triggered to indicate that the program
# should finish its execution in a controlled way as soon as possible.
# For now, program will also terminate from within this handler.
#
sub exit_signal_handler {
    my $signame = shift;
    # For now, simply mimic old behavior.
    killsockfilters($proto, $ipvnum, $idnum, $verbose);
    unlink($pidfile);
    if($serverlogslocked) {
        $serverlogslocked = 0;
        clear_advisor_read_lock($SERVERLOGS_LOCK);
    }
    exit;
}

#**********************************************************************
# logmsg is general message logging subroutine for our test servers.
#
sub logmsg {
    my $now;
    # sub second timestamping needs Time::HiRes
    if($Time::HiRes::VERSION) {
        my ($seconds, $usec) = gettimeofday();
        my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
            localtime($seconds);
        $now = sprintf("%02d:%02d:%02d.%06d ", $hour, $min, $sec, $usec);
    }
    else {
        my $seconds = time();
        my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
            localtime($seconds);
        $now = sprintf("%02d:%02d:%02d ", $hour, $min, $sec);
    }
    if(open(LOGFILEFH, ">>$logfile")) {
        print LOGFILEFH $now;
        print LOGFILEFH @_;
        close(LOGFILEFH);
    }
}

sub ftpmsg {
  # append to the server.input file
  open(INPUT, ">>log/server$idstr.input") ||
    logmsg "failed to open log/server$idstr.input\n";

  print INPUT @_;
  close(INPUT);

  # use this, open->print->close system only to make the file
  # open as little as possible, to make the test suite run
  # better on windows/cygwin
}

#**********************************************************************
# eXsysread is a wrapper around perl's sysread() function. This will
# repeat the call to sysread() until it has actually read the complete
# number of requested bytes or an unrecoverable condition occurs.
# On success returns a positive value, the number of bytes requested.
# On failure or timeout returns zero.
#
sub eXsysread {
    my $FH      = shift;
    my $scalar  = shift;
    my $nbytes  = shift;
    my $timeout = shift; # A zero timeout disables eXsysread() time limit
    #
    my $time_limited = 0;
    my $timeout_rest = 0;
    my $start_time = 0;
    my $nread  = 0;
    my $rc;

    $$scalar = "";

    if((not defined $nbytes) || ($nbytes < 1)) {
        logmsg "Error: eXsysread() failure: " .
               "length argument must be positive\n";
        return 0;
    }
    if((not defined $timeout) || ($timeout < 0)) {
        logmsg "Error: eXsysread() failure: " .
               "timeout argument must be zero or positive\n";
        return 0;
    }
    if($timeout > 0) {
        # caller sets eXsysread() time limit
        $time_limited = 1;
        $timeout_rest = $timeout;
        $start_time = int(time());
    }

    while($nread < $nbytes) {
        if($time_limited) {
            eval {
                local $SIG{ALRM} = sub { die "alarm\n"; };
                alarm $timeout_rest;
                $rc = sysread($FH, $$scalar, $nbytes - $nread, $nread);
                alarm 0;
            };
            $timeout_rest = $timeout - (int(time()) - $start_time);
            if($timeout_rest < 1) {
                logmsg "Error: eXsysread() failure: timed out\n";
                return 0;
            }
        }
        else {
            $rc = sysread($FH, $$scalar, $nbytes - $nread, $nread);
        }
        if($got_exit_signal) {
            logmsg "Error: eXsysread() failure: signalled to die\n";
            return 0;
        }
        if(not defined $rc) {
            if($!{EINTR}) {
                logmsg "Warning: retrying sysread() interrupted system call\n";
                next;
            }
            if($!{EAGAIN}) {
                logmsg "Warning: retrying sysread() due to EAGAIN\n";
                next;
            }
            if($!{EWOULDBLOCK}) {
                logmsg "Warning: retrying sysread() due to EWOULDBLOCK\n";
                next;
            }
            logmsg "Error: sysread() failure: $!\n";
            return 0;
        }
        if($rc < 0) {
            logmsg "Error: sysread() failure: returned negative value $rc\n";
            return 0;
        }
        if($rc == 0) {
            logmsg "Error: sysread() failure: read zero bytes\n";
            return 0;
        }
        $nread += $rc;
    }
    return $nread;
}

#**********************************************************************
# read_mainsockf attempts to read the given amount of output from the
# sockfilter which is in use for the main or primary connection. This
# reads untranslated sockfilt lingo which may hold data read from the
# main or primary socket. On success returns 1, otherwise zero.
#
sub read_mainsockf {
    my $scalar  = shift;
    my $nbytes  = shift;
    my $timeout = shift; # Optional argument, if zero blocks indefinitively
    my $FH = \*SFREAD;

    if(not defined $timeout) {
        $timeout = $sockfilt_timeout + ($nbytes >> 12);
    }
    if(eXsysread($FH, $scalar, $nbytes, $timeout) != $nbytes) {
        my ($fcaller, $lcaller) = (caller)[1,2];
        logmsg "Error: read_mainsockf() failure at $fcaller " .
               "line $lcaller. Due to eXsysread() failure\n";
        return 0;
    }
    return 1;
}

#**********************************************************************
# read_datasockf attempts to read the given amount of output from the
# sockfilter which is in use for the data or secondary connection. This
# reads untranslated sockfilt lingo which may hold data read from the
# data or secondary socket. On success returns 1, otherwise zero.
#
sub read_datasockf {
    my $scalar = shift;
    my $nbytes = shift;
    my $timeout = shift; # Optional argument, if zero blocks indefinitively
    my $FH = \*DREAD;

    if(not defined $timeout) {
        $timeout = $sockfilt_timeout + ($nbytes >> 12);
    }
    if(eXsysread($FH, $scalar, $nbytes, $timeout) != $nbytes) {
        my ($fcaller, $lcaller) = (caller)[1,2];
        logmsg "Error: read_datasockf() failure at $fcaller " .
               "line $lcaller. Due to eXsysread() failure\n";
        return 0;
    }
    return 1;
}

sub sysread_or_die {
    my $FH     = shift;
    my $scalar = shift;
    my $length = shift;
    my $fcaller;
    my $lcaller;
    my $result;

    $result = sysread($$FH, $$scalar, $length);

    if(not defined $result) {
        ($fcaller, $lcaller) = (caller)[1,2];
        logmsg "Failed to read input\n";
        logmsg "Error: $srvrname server, sysread error: $!\n";
        logmsg "Exited from sysread_or_die() at $fcaller " .
               "line $lcaller. $srvrname server, sysread error: $!\n";
        killsockfilters($proto, $ipvnum, $idnum, $verbose);
        unlink($pidfile);
        if($serverlogslocked) {
            $serverlogslocked = 0;
            clear_advisor_read_lock($SERVERLOGS_LOCK);
        }
        exit;
    }
    elsif($result == 0) {
        ($fcaller, $lcaller) = (caller)[1,2];
        logmsg "Failed to read input\n";
        logmsg "Error: $srvrname server, read zero\n";
        logmsg "Exited from sysread_or_die() at $fcaller " .
               "line $lcaller. $srvrname server, read zero\n";
        killsockfilters($proto, $ipvnum, $idnum, $verbose);
        unlink($pidfile);
        if($serverlogslocked) {
            $serverlogslocked = 0;
            clear_advisor_read_lock($SERVERLOGS_LOCK);
        }
        exit;
    }

    return $result;
}

sub startsf {
    my $mainsockfcmd = "./server/sockfilt " .
        "--ipv$ipvnum --port $port " .
        "--pidfile \"$mainsockf_pidfile\" " .
        "--logfile \"$mainsockf_logfile\"";
    $sfpid = open2(*SFREAD, *SFWRITE, $mainsockfcmd);

    print STDERR "$mainsockfcmd\n" if($verbose);

    print SFWRITE "PING\n";
    my $pong;
    sysread_or_die(\*SFREAD, \$pong, 5);

    if($pong !~ /^PONG/) {
        logmsg "Failed sockfilt command: $mainsockfcmd\n";
        killsockfilters($proto, $ipvnum, $idnum, $verbose);
        unlink($pidfile);
        if($serverlogslocked) {
            $serverlogslocked = 0;
            clear_advisor_read_lock($SERVERLOGS_LOCK);
        }
        die "Failed to start sockfilt!";
    }
}


sub sockfilt {
    my $l;
    foreach $l (@_) {
        printf SFWRITE "DATA\n%04x\n", length($l);
        print SFWRITE $l;
    }
}


sub sockfiltsecondary {
    my $l;
    foreach $l (@_) {
        printf DWRITE "DATA\n%04x\n", length($l);
        print DWRITE $l;
    }
}


# Send data to the client on the control stream, which happens to be plain
# stdout.

sub sendcontrol {
    if(!$ctrldelay) {
        # spit it all out at once
        sockfilt @_;
    }
    else {
        my $a = join("", @_);
        my @a = split("", $a);

        for(@a) {
            sockfilt $_;
            select(undef, undef, undef, 0.01);
        }
    }
    my $log;
    foreach $log (@_) {
        my $l = $log;
        $l =~ s/\r/[CR]/g;
        $l =~ s/\n/[LF]/g;
        logmsg "> \"$l\"\n";
    }
}

#**********************************************************************
# Send data to the FTP client on the data stream when data connection
# is actually established. Given that this sub should only be called
# when a data connection is supposed to be established, calling this
# without a data connection is an indication of weak logic somewhere.
#
sub senddata {
    my $l;
    if($datasockf_conn eq 'no') {
        logmsg "WARNING: Detected data sending attempt without DATA channel\n";
        foreach $l (@_) {
            logmsg "WARNING: Data swallowed: $l\n"
        }
        return;
    }
    foreach $l (@_) {
      if(!$datadelay) {
        # spit it all out at once
        sockfiltsecondary $l;
      }
      else {
          # pause between each byte
          for (split(//,$l)) {
              sockfiltsecondary $_;
              select(undef, undef, undef, 0.01);
          }
      }
    }
}

#**********************************************************************
# protocolsetup initializes the 'displaytext' and 'commandfunc' hashes
# for the given protocol. References to protocol command callbacks are
# stored in 'commandfunc' hash, and text which will be returned to the
# client before the command callback runs is stored in 'displaytext'.
#
sub protocolsetup {
    my $proto = $_[0];

    if($proto eq 'ftp') {
        %commandfunc = (
            'PORT' => \&PORT_ftp,
            'EPRT' => \&PORT_ftp,
            'LIST' => \&LIST_ftp,
            'NLST' => \&NLST_ftp,
            'PASV' => \&PASV_ftp,
            'CWD'  => \&CWD_ftp,
            'PWD'  => \&PWD_ftp,
            'EPSV' => \&PASV_ftp,
            'RETR' => \&RETR_ftp,
            'SIZE' => \&SIZE_ftp,
            'REST' => \&REST_ftp,
            'STOR' => \&STOR_ftp,
            'APPE' => \&STOR_ftp, # append looks like upload
            'MDTM' => \&MDTM_ftp,
        );
        %displaytext = (
            'USER' => '331 We are happy you popped in!',
            'PASS' => '230 Welcome you silly person',
            'PORT' => '200 You said PORT - I say FINE',
            'TYPE' => '200 I modify TYPE as you wanted',
            'LIST' => '150 here comes a directory',
            'NLST' => '150 here comes a directory',
            'CWD'  => '250 CWD command successful.',
            'SYST' => '215 UNIX Type: L8', # just fake something
            'QUIT' => '221 bye bye baby', # just reply something
            'MKD'  => '257 Created your requested directory',
            'REST' => '350 Yeah yeah we set it there for you',
            'DELE' => '200 OK OK OK whatever you say',
            'RNFR' => '350 Received your order. Please provide more',
            'RNTO' => '250 Ok, thanks. File renaming completed.',
            'NOOP' => '200 Yes, I\'m very good at doing nothing.',
            'PBSZ' => '500 PBSZ not implemented',
            'PROT' => '500 PROT not implemented',
            'welcome' => join("",
            '220-        _   _ ____  _     '."\r\n",
            '220-    ___| | | |  _ \| |    '."\r\n",
            '220-   / __| | | | |_) | |    '."\r\n",
            '220-  | (__| |_| |  _ {| |___ '."\r\n",
            '220    \___|\___/|_| \_\_____|'."\r\n")
        );
    }
    elsif($proto eq 'pop3') {
        %commandfunc = (
            'APOP' => \&APOP_pop3,
            'AUTH' => \&AUTH_pop3,
            'CAPA' => \&CAPA_pop3,
            'DELE' => \&DELE_pop3,
            'LIST' => \&LIST_pop3,
            'NOOP' => \&NOOP_pop3,
            'PASS' => \&PASS_pop3,
            'QUIT' => \&QUIT_pop3,
            'RETR' => \&RETR_pop3,
            'RSET' => \&RSET_pop3,
            'STAT' => \&STAT_pop3,
            'TOP'  => \&TOP_pop3,
            'UIDL' => \&UIDL_pop3,
            'USER' => \&USER_pop3,
        );
        %displaytext = (
            'welcome' => join("",
            '        _   _ ____  _     '."\r\n",
            '    ___| | | |  _ \| |    '."\r\n",
            '   / __| | | | |_) | |    '."\r\n",
            '  | (__| |_| |  _ {| |___ '."\r\n",
            '   \___|\___/|_| \_\_____|'."\r\n",
            '+OK cURL POP3 server ready to serve '."\r\n")
        );
    }
    elsif($proto eq 'imap') {
        %commandfunc = (
            'APPEND'     => \&APPEND_imap,
            'CAPABILITY' => \&CAPABILITY_imap,
            'CHECK'      => \&CHECK_imap,
            'CLOSE'      => \&CLOSE_imap,
            'COPY'       => \©_imap,
            'CREATE'     => \&CREATE_imap,
            'DELETE'     => \&DELETE_imap,
            'EXAMINE'    => \&EXAMINE_imap,
            'EXPUNGE'    => \&EXPUNGE_imap,
            'FETCH'      => \&FETCH_imap,
            'LIST'       => \&LIST_imap,
            'LSUB'       => \&LSUB_imap,
            'LOGIN'      => \&LOGIN_imap,
            'LOGOUT'     => \&LOGOUT_imap,
            'NOOP'       => \&NOOP_imap,
            'RENAME'     => \&RENAME_imap,
            'SEARCH'     => \&SEARCH_imap,
            'SELECT'     => \&SELECT_imap,
            'STATUS'     => \&STATUS_imap,
            'STORE'      => \&STORE_imap,
            'UID'        => \&UID_imap,
        );
        %displaytext = (
            'welcome' => join("",
            '        _   _ ____  _     '."\r\n",
            '    ___| | | |  _ \| |    '."\r\n",
            '   / __| | | | |_) | |    '."\r\n",
            '  | (__| |_| |  _ {| |___ '."\r\n",
            '   \___|\___/|_| \_\_____|'."\r\n",
            '* OK cURL IMAP server ready to serve'."\r\n")
        );
    }
    elsif($proto eq 'smtp') {
        %commandfunc = (
            'DATA' => \&DATA_smtp,
            'EHLO' => \&EHLO_smtp,
            'EXPN' => \&EXPN_smtp,
            'HELO' => \&HELO_smtp,
            'HELP' => \&HELP_smtp,
            'MAIL' => \&MAIL_smtp,
            'NOOP' => \&NOOP_smtp,
            'RSET' => \&RSET_smtp,
            'RCPT' => \&RCPT_smtp,
            'VRFY' => \&VRFY_smtp,
            'QUIT' => \&QUIT_smtp,
        );
        %displaytext = (
            'welcome' => join("",
            '220-        _   _ ____  _     '."\r\n",
            '220-    ___| | | |  _ \| |    '."\r\n",
            '220-   / __| | | | |_) | |    '."\r\n",
            '220-  | (__| |_| |  _ {| |___ '."\r\n",
            '220    \___|\___/|_| \_\_____|'."\r\n")
        );
    }
}

sub close_dataconn {
    my ($closed)=@_; # non-zero if already disconnected

    my $datapid = processexists($datasockf_pidfile);

    logmsg "=====> Closing $datasockf_mode DATA connection...\n";

    if(!$closed) {
        if($datapid > 0) {
            logmsg "Server disconnects $datasockf_mode DATA connection\n";
            print DWRITE "DISC\n";
            my $i;
            sysread DREAD, $i, 5;
        }
        else {
            logmsg "Server finds $datasockf_mode DATA connection already ".
                   "disconnected\n";
        }
    }
    else {
        logmsg "Server knows $datasockf_mode DATA connection is already ".
               "disconnected\n";
    }

    if($datapid > 0) {
        print DWRITE "QUIT\n";
        waitpid($datapid, 0);
        unlink($datasockf_pidfile) if(-f $datasockf_pidfile);
        logmsg "DATA sockfilt for $datasockf_mode data channel quits ".
               "(pid $datapid)\n";
    }
    else {
        logmsg "DATA sockfilt for $datasockf_mode data channel already ".
               "dead\n";
    }

    logmsg "=====> Closed $datasockf_mode DATA connection\n";

    datasockf_state('STOPPED');
}

################
################ SMTP commands
################

# The type of server (SMTP or ESMTP)
my $smtp_type;

# The client (which normally contains the test number)
my $smtp_client;

sub EHLO_smtp {
    my ($client) = @_;
    my @data;

    # TODO: Get the IP address of the client connection to use in the
    # EHLO response when the client doesn't specify one but for now use
    # 127.0.0.1
    if(!$client) {
        $client = "[127.0.0.1]";
    }

    # Set the server type to ESMTP
    $smtp_type = "ESMTP";

    # Calculate the EHLO response
    push @data, "$smtp_type pingpong test server Hello $client";

    if((@capabilities) || (@auth_mechs)) {
        my $mechs;

        for my $c (@capabilities) {
            push @data, $c;
        }

        for my $am (@auth_mechs) {
            if(!$mechs) {
                $mechs = "$am";
            }
            else {
                $mechs .= " $am";
            }
        }

        if($mechs) {
            push @data, "AUTH $mechs";
        }
    }

    # Send the EHLO response
    for(my $i = 0; $i < @data; $i++) {
        my $d = $data[$i];

        if($i < @data - 1) {
            sendcontrol "250-$d\r\n";
        }
        else {
            sendcontrol "250 $d\r\n";
        }
    }

    # Store the client (as it may contain the test number)
    $smtp_client = $client;

    return 0;
}

sub HELO_smtp {
    my ($client) = @_;

    # TODO: Get the IP address of the client connection to use in the HELO
    # response when the client doesn't specify one but for now use 127.0.0.1
    if(!$client) {
        $client = "[127.0.0.1]";
    }

    # Set the server type to SMTP
    $smtp_type = "SMTP";

    # Send the HELO response
    sendcontrol "250 $smtp_type pingpong test server Hello $client\r\n";

    # Store the client (as it may contain the test number)
    $smtp_client = $client;

    return 0;
}

sub MAIL_smtp {
    my ($args) = @_;

    logmsg "MAIL_smtp got $args\n";

    if (!$args) {
        sendcontrol "501 Unrecognized parameter\r\n";
    }
    else {
        my $from;
        my $size;
        my @elements = split(/ /, $args);

        # Get the FROM and SIZE parameters
        for my $e (@elements) {
            if($e =~ /^FROM:(.*)$/) {
                $from = $1;
            }
            elsif($e =~ /^SIZE=(\d+)$/) {
                $size = $1;
            }
        }

        # Validate the from address (only <> and a valid email address inside
        # <> are allowed, such as )
        if ((!$from) || (($from ne "<>") && ($from !~
            /^<([a-zA-Z0-9._%+-]+)\@([a-zA-Z0-9.-]+).([a-zA-Z]{2,4})>$/))) {
            sendcontrol "501 Invalid address\r\n";
        }
        else {
            my @found;
            my $valid = 1;

            # Check the capabilities for SIZE and if the specified size is
            # greater than the message size then reject it
            if (@found = grep /^SIZE (\d+)$/, @capabilities) {
                if ($found[0] =~ /^SIZE (\d+)$/) {
                    if ($size > $1) {
                        $valid = 0;
                    }
                }
            }

            if(!$valid) {
                sendcontrol "552 Message size too large\r\n";
            }
            else {
                sendcontrol "250 Sender OK\r\n";
            }
        }
    }

    return 0;
}

sub RCPT_smtp {
    my ($args) = @_;

    logmsg "RCPT_smtp got $args\n";

    # Get the TO parameter
    if($args !~ /^TO:(.*)/) {
        sendcontrol "501 Unrecognized parameter\r\n";
    }
    else {
        my $to = $1;

        # Validate the to address (only a valid email address inside <> is
        # allowed, such as )
        if ($to !~
            /^<([a-zA-Z0-9._%+-]+)\@([a-zA-Z0-9.-]+).([a-zA-Z]{2,4})>$/) {
            sendcontrol "501 Invalid address\r\n";
        }
        else {
            sendcontrol "250 Recipient OK\r\n";
        }
    }

    return 0;
}

sub DATA_smtp {
    my ($args) = @_;

    if ($args) {
        sendcontrol "501 Unrecognized parameter\r\n";
    }
    elsif ($smtp_client !~ /^(\d*)$/) {
        sendcontrol "501 Invalid arguments\r\n";
    }
    else {
        sendcontrol "354 Show me the mail\r\n";

        my $testno = $smtp_client;
        my $filename = "log/upload.$testno";

        logmsg "Store test number $testno in $filename\n";

        open(FILE, ">$filename") ||
            return 0; # failed to open output

        my $line;
        my $ulsize=0;
        my $disc=0;
        my $raw;
        while (5 == (sysread \*SFREAD, $line, 5)) {
            if($line eq "DATA\n") {
                my $i;
                my $eob;
                sysread \*SFREAD, $i, 5;

                my $size = 0;
                if($i =~ /^([0-9a-fA-F]{4})\n/) {
                    $size = hex($1);
                }

                read_mainsockf(\$line, $size);

                $ulsize += $size;
                print FILE $line if(!$nosave);

                $raw .= $line;
                if($raw =~ /\x0d\x0a\x2e\x0d\x0a/) {
                    # end of data marker!
                    $eob = 1;
                }

                logmsg "> Appending $size bytes to file\n";

                if($eob) {
                    logmsg "Found SMTP EOB marker\n";
                    last;
                }
            }
            elsif($line eq "DISC\n") {
                # disconnect!
                $disc=1;
                last;
            }
            else {
                logmsg "No support for: $line";
                last;
            }
        }

        if($nosave) {
            print FILE "$ulsize bytes would've been stored here\n";
        }

        close(FILE);

        logmsg "received $ulsize bytes upload\n";

        sendcontrol "250 OK, data received!\r\n";
    }

    return 0;
}

sub NOOP_smtp {
    my ($args) = @_;

    if($args) {
        sendcontrol "501 Unrecognized parameter\r\n";
    }
    else {
        sendcontrol "250 OK\r\n";
    }

    return 0;
}

sub RSET_smtp {
    my ($args) = @_;

    if($args) {
        sendcontrol "501 Unrecognized parameter\r\n";
    }
    else {
        sendcontrol "250 Resetting\r\n";
    }

    return 0;
}

sub HELP_smtp {
    my ($args) = @_;

    # One argument is optional
    if($args) {
        logmsg "HELP_smtp got $args\n";
    }

    if($smtp_client eq "verifiedserver") {
        # This is the secret command that verifies that this actually is
        # the curl test server
        sendcontrol "214 WE ROOLZ: $$\r\n";

        if($verbose) {
            print STDERR "FTPD: We returned proof we are the test server\n";
        }

        logmsg "return proof we are we\n";
    }
    else {
        sendcontrol "214-This server supports the following commands:\r\n";

        if(@auth_mechs) {
            sendcontrol "214 HELO EHLO RCPT DATA RSET MAIL VRFY EXPN QUIT HELP AUTH\r\n";
        }
        else {
            sendcontrol "214 HELO EHLO RCPT DATA RSET MAIL VRFY EXPN QUIT HELP\r\n";
        }
    }

    return 0;
}

sub VRFY_smtp {
    my ($args) = @_;
    my ($username, $address) = split(/ /, $args, 2);

    logmsg "VRFY_smtp got $args\n";

    if($username eq "") {
        sendcontrol "501 Unrecognized parameter\r\n";
    }
    else {
        my $testno = $smtp_client;

        $testno =~ s/^([^0-9]*)//;
        my $testpart = "";
        if ($testno > 10000) {
            $testpart = $testno % 10000;
            $testno = int($testno / 10000);
        }

        loadtest("$srcdir/data/test$testno");

        my @data = getpart("reply", "data$testpart");

        for my $d (@data) {
            sendcontrol $d;
        }
    }

    return 0;
}

sub EXPN_smtp {
    my ($list_name) = @_;

    logmsg "EXPN_smtp got $list_name\n";

    if(!$list_name) {
        sendcontrol "501 Unrecognized parameter\r\n";
    }
    else {
        my $testno = $smtp_client;

        $testno =~ s/^([^0-9]*)//;
        my $testpart = "";
        if ($testno > 10000) {
            $testpart = $testno % 10000;
            $testno = int($testno / 10000);
        }

        loadtest("$srcdir/data/test$testno");

        my @data = getpart("reply", "data$testpart");

        for my $d (@data) {
            sendcontrol $d;
        }
    }

    return 0;
}

sub QUIT_smtp {
    sendcontrol "221 cURL $smtp_type server signing off\r\n";

    return 0;
}

# What was deleted by IMAP STORE / POP3 DELE commands
my @deleted;

################
################ IMAP commands
################

# global to allow the command functions to read it
my $cmdid;

# what was picked by SELECT
my $selected;

# Any IMAP parameter can come in escaped and in double quotes.
# This function is dumb (so far) and just removes the quotes if present.
sub fix_imap_params {
    foreach (@_) {
        $_ = $1 if /^"(.*)"$/;
    }
}

sub CAPABILITY_imap {
    my ($testno) = @_;

    if((!@capabilities) && (!@auth_mechs)) {
        sendcontrol "$cmdid BAD Command\r\n";
    }
    else {
        my $data;

        # Calculate the CAPABILITY response
        $data = "* CAPABILITY IMAP4";

        for my $c (@capabilities) {
            $data .= " $c";
        }

        for my $am (@auth_mechs) {
            $data .= " AUTH=$am";
        }

        $data .= " pingpong test server\r\n";

        # Send the CAPABILITY response
        sendcontrol $data;
        sendcontrol "$cmdid OK CAPABILITY completed\r\n";
    }

    return 0;
}

sub LOGIN_imap {
    my ($args) = @_;
    my ($user, $password) = split(/ /, $args, 2);
    fix_imap_params($user, $password);

    logmsg "LOGIN_imap got $args\n";

    if ($user eq "") {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    elsif (($user ne $TEXT_USERNAME) || ($password ne $TEXT_PASSWORD)) {
        sendcontrol "$cmdid NO LOGIN failed\r\n";
    }
    else {
        sendcontrol "$cmdid OK LOGIN completed\r\n";
    }

    return 0;
}

sub SELECT_imap {
    my ($mailbox) = @_;
    fix_imap_params($mailbox);

    logmsg "SELECT_imap got test $mailbox\n";

    if($mailbox eq "") {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        # Example from RFC 3501, 6.3.1. SELECT Command
        sendcontrol "* 172 EXISTS\r\n";
        sendcontrol "* 1 RECENT\r\n";
        sendcontrol "* OK [UNSEEN 12] Message 12 is first unseen\r\n";
        sendcontrol "* OK [UIDVALIDITY 3857529045] UIDs valid\r\n";
        sendcontrol "* OK [UIDNEXT 4392] Predicted next UID\r\n";
        sendcontrol "* FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\r\n";
        sendcontrol "* OK [PERMANENTFLAGS (\\Deleted \\Seen \\*)] Limited\r\n";
        sendcontrol "$cmdid OK [READ-WRITE] SELECT completed\r\n";

        $selected = $mailbox;
    }

    return 0;
}

sub FETCH_imap {
    my ($args) = @_;
    my ($uid, $how) = split(/ /, $args, 2);
    fix_imap_params($uid, $how);

    logmsg "FETCH_imap got $args\n";

    if ($selected eq "") {
        sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
    }
    else {
        my @data;
        my $size;

        if($selected eq "verifiedserver") {
            # this is the secret command that verifies that this actually is
            # the curl test server
            my $response = "WE ROOLZ: $$\r\n";
            if($verbose) {
                print STDERR "FTPD: We returned proof we are the test server\n";
            }
            $data[0] = $response;
            logmsg "return proof we are we\n";
        }
        else {
            logmsg "retrieve a mail\n";

            my $testno = $selected;
            $testno =~ s/^([^0-9]*)//;
            my $testpart = "";
            if ($testno > 10000) {
                $testpart = $testno % 10000;
                $testno = int($testno / 10000);
            }

            # send mail content
            loadtest("$srcdir/data/test$testno");

            @data = getpart("reply", "data$testpart");
        }

        for (@data) {
            $size += length($_);
        }

        sendcontrol "* $uid FETCH ($how {$size}\r\n";

        for my $d (@data) {
            sendcontrol $d;
        }

        sendcontrol ")\r\n";
        sendcontrol "$cmdid OK FETCH completed\r\n";
    }

    return 0;
}

sub APPEND_imap {
    my ($args) = @_;

    logmsg "APPEND_imap got $args\r\n";

    $args =~ /^([^ ]+) [^{]*\{(\d+)\}$/;
    my ($mailbox, $size) = ($1, $2);
    fix_imap_params($mailbox);

    if($mailbox eq "") {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        sendcontrol "+ Ready for literal data\r\n";

        my $testno = $mailbox;
        my $filename = "log/upload.$testno";

        logmsg "Store test number $testno in $filename\n";

        open(FILE, ">$filename") ||
            return 0; # failed to open output

        my $received = 0;
        my $line;
        while(5 == (sysread \*SFREAD, $line, 5)) {
            if($line eq "DATA\n") {
                sysread \*SFREAD, $line, 5;

                my $chunksize = 0;
                if($line =~ /^([0-9a-fA-F]{4})\n/) {
                    $chunksize = hex($1);
                }

                read_mainsockf(\$line, $chunksize);

                my $left = $size - $received;
                my $datasize = ($left > $chunksize) ? $chunksize : $left;

                if($datasize > 0) {
                    logmsg "> Appending $datasize bytes to file\n";
                    print FILE substr($line, 0, $datasize) if(!$nosave);
                    $line = substr($line, $datasize);

                    $received += $datasize;
                    if($received == $size) {
                        logmsg "Received all data, waiting for final CRLF.\n";
                    }
                }

                if($received == $size && $line eq "\r\n") {
                    last;
                }
            }
            elsif($line eq "DISC\n") {
                logmsg "Unexpected disconnect!\n";
                last;
            }
            else {
                logmsg "No support for: $line";
                last;
            }
        }

        if($nosave) {
            print FILE "$size bytes would've been stored here\n";
        }

        close(FILE);

        logmsg "received $size bytes upload\n";

        sendcontrol "$cmdid OK APPEND completed\r\n";
    }

    return 0;
}

sub STORE_imap {
    my ($args) = @_;
    my ($uid, $what, $value) = split(/ /, $args, 3);
    fix_imap_params($uid);

    logmsg "STORE_imap got $args\n";

    if ($selected eq "") {
        sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
    }
    elsif (($uid eq "") || ($what ne "+Flags") || ($value eq "")) {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        if($value eq "\\Deleted") {
            push(@deleted, $uid);
        }

        sendcontrol "* $uid FETCH (FLAGS (\\Seen $value))\r\n";
        sendcontrol "$cmdid OK STORE completed\r\n";
    }

    return 0;
}

sub LIST_imap {
    my ($args) = @_;
    my ($reference, $mailbox) = split(/ /, $args, 2);
    fix_imap_params($reference, $mailbox);

    logmsg "LIST_imap got $args\n";

    if ($reference eq "") {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    elsif ($reference eq "verifiedserver") {
        # this is the secret command that verifies that this actually is
        # the curl test server
        sendcontrol "* LIST () \"/\" \"WE ROOLZ: $$\"\r\n";
        sendcontrol "$cmdid OK LIST Completed\r\n";

        if($verbose) {
            print STDERR "FTPD: We returned proof we are the test server\n";
        }

        logmsg "return proof we are we\n";
    }
    else {
        my $testno = $reference;

        $testno =~ s/^([^0-9]*)//;
        my $testpart = "";
        if ($testno > 10000) {
            $testpart = $testno % 10000;
            $testno = int($testno / 10000);
        }

        loadtest("$srcdir/data/test$testno");

        my @data = getpart("reply", "data$testpart");

        for my $d (@data) {
            sendcontrol $d;
        }

        sendcontrol "$cmdid OK LIST Completed\r\n";
    }

    return 0;
}

sub LSUB_imap {
    my ($args) = @_;
    my ($reference, $mailbox) = split(/ /, $args, 2);
    fix_imap_params($reference, $mailbox);

    logmsg "LSUB_imap got $args\n";

    if ($reference eq "") {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        my $testno = $reference;

        $testno =~ s/^([^0-9]*)//;
        my $testpart = "";
        if ($testno > 10000) {
            $testpart = $testno % 10000;
            $testno = int($testno / 10000);
        }

        loadtest("$srcdir/data/test$testno");

        my @data = getpart("reply", "data$testpart");

        for my $d (@data) {
            sendcontrol $d;
        }

        sendcontrol "$cmdid OK LSUB Completed\r\n";
    }

    return 0;
}

sub EXAMINE_imap {
    my ($testno) = @_;
    fix_imap_params($testno);

    logmsg "EXAMINE_imap got $testno\n";

    if ($testno eq "") {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        $testno =~ s/[^0-9]//g;
        my $testpart = "";
        if ($testno > 10000) {
            $testpart = $testno % 10000;
            $testno = int($testno / 10000);
        }

        loadtest("$srcdir/data/test$testno");

        my @data = getpart("reply", "data$testpart");

        for my $d (@data) {
            sendcontrol $d;
        }

        sendcontrol "$cmdid OK [READ-ONLY] EXAMINE completed\r\n";
    }

    return 0;
}

sub STATUS_imap {
    my ($testno) = @_;
    fix_imap_params($testno);

    logmsg "STATUS_imap got $testno\n";

    if ($testno eq "") {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        $testno =~ s/[^0-9]//g;
        my $testpart = "";
        if ($testno > 10000) {
            $testpart = $testno % 10000;
            $testno = int($testno / 10000);
        }

        loadtest("$srcdir/data/test$testno");

        my @data = getpart("reply", "data$testpart");

        for my $d (@data) {
            sendcontrol $d;
        }

        sendcontrol "$cmdid OK STATUS completed\r\n";
    }

    return 0;
}

sub SEARCH_imap {
    my ($what) = @_;
    fix_imap_params($what);

    logmsg "SEARCH_imap got $what\n";

    if ($selected eq "") {
        sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
    }
    elsif ($what eq "") {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        my $testno = $selected;

        $testno =~ s/^([^0-9]*)//;
        my $testpart = "";
        if ($testno > 10000) {
            $testpart = $testno % 10000;
            $testno = int($testno / 10000);
        }

        loadtest("$srcdir/data/test$testno");

        my @data = getpart("reply", "data$testpart");

        for my $d (@data) {
            sendcontrol $d;
        }

        sendcontrol "$cmdid OK SEARCH completed\r\n";
    }

    return 0;
}

sub CREATE_imap {
    my ($args) = @_;
    fix_imap_params($args);

    logmsg "CREATE_imap got $args\n";

    if ($args eq "") {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        sendcontrol "$cmdid OK CREATE completed\r\n";
    }

    return 0;
}

sub DELETE_imap {
    my ($args) = @_;
    fix_imap_params($args);

    logmsg "DELETE_imap got $args\n";

    if ($args eq "") {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        sendcontrol "$cmdid OK DELETE completed\r\n";
    }

    return 0;
}

sub RENAME_imap {
    my ($args) = @_;
    my ($from_mailbox, $to_mailbox) = split(/ /, $args, 2);
    fix_imap_params($from_mailbox, $to_mailbox);

    logmsg "RENAME_imap got $args\n";

    if (($from_mailbox eq "") || ($to_mailbox eq "")) {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        sendcontrol "$cmdid OK RENAME completed\r\n";
    }

    return 0;
}

sub CHECK_imap {
    if ($selected eq "") {
        sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
    }
    else {
        sendcontrol "$cmdid OK CHECK completed\r\n";
    }

    return 0;
}

sub CLOSE_imap {
    if ($selected eq "") {
        sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
    }
    elsif (!@deleted) {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        sendcontrol "$cmdid OK CLOSE completed\r\n";

        @deleted = ();
    }

    return 0;
}

sub EXPUNGE_imap {
    if ($selected eq "") {
        sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
    }
    else {
        if (!@deleted) {
            # Report the number of existing messages as per the SELECT
            # command
            sendcontrol "* 172 EXISTS\r\n";
        }
        else {
            # Report the message UIDs being deleted
            for my $d (@deleted) {
                sendcontrol "* $d EXPUNGE\r\n";
            }

            @deleted = ();
        }

        sendcontrol "$cmdid OK EXPUNGE completed\r\n";
    }

    return 0;
}

sub COPY_imap {
    my ($args) = @_;
    my ($uid, $mailbox) = split(/ /, $args, 2);
    fix_imap_params($uid, $mailbox);

    logmsg "COPY_imap got $args\n";

    if (($uid eq "") || ($mailbox eq "")) {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        sendcontrol "$cmdid OK COPY completed\r\n";
    }

    return 0;
}

sub UID_imap {
    my ($args) = @_;
    my ($command) = split(/ /, $args, 1);
    fix_imap_params($command);

    logmsg "UID_imap got $args\n";

    if ($selected eq "") {
        sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
    }
    elsif (($command ne "COPY") && ($command ne "FETCH") &&
           ($command ne "STORE") && ($command ne "SEARCH")) {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        my $testno = $selected;

        $testno =~ s/^([^0-9]*)//;
        my $testpart = "";
        if ($testno > 10000) {
            $testpart = $testno % 10000;
            $testno = int($testno / 10000);
        }

        loadtest("$srcdir/data/test$testno");

        my @data = getpart("reply", "data$testpart");

        for my $d (@data) {
            sendcontrol $d;
        }

        sendcontrol "$cmdid OK $command completed\r\n";
    }

    return 0;
}

sub NOOP_imap {
    my ($args) = @_;
    my @data = (
        "* 22 EXPUNGE\r\n",
        "* 23 EXISTS\r\n",
        "* 3 RECENT\r\n",
        "* 14 FETCH (FLAGS (\\Seen \\Deleted))\r\n",
    );

    if ($args) {
        sendcontrol "$cmdid BAD Command Argument\r\n";
    }
    else {
        for my $d (@data) {
            sendcontrol $d;
        }

        sendcontrol "$cmdid OK NOOP completed\r\n";
    }

    return 0;
}

sub LOGOUT_imap {
    sendcontrol "* BYE cURL IMAP server signing off\r\n";
    sendcontrol "$cmdid OK LOGOUT completed\r\n";

    return 0;
}

################
################ POP3 commands
################

# Who is attempting to log in
my $username;

sub CAPA_pop3 {
    my ($testno) = @_;
    my @list = ();
    my $mechs;

    # Calculate the capability list based on the specified capabilities
    # (except APOP) and any authentication mechanisms
    for my $c (@capabilities) {
        push @list, "$c\r\n" unless $c eq "APOP";
    }

    for my $am (@auth_mechs) {
        if(!$mechs) {
            $mechs = "$am";
        }
        else {
            $mechs .= " $am";
        }
    }

    if($mechs) {
        push @list, "SASL $mechs\r\n";
    }

    if(!@list) {
        sendcontrol "-ERR Unrecognized command\r\n";
    }
    else {
        my @data = ();

        # Calculate the CAPA response
        push @data, "+OK List of capabilities follows\r\n";

        for my $l (@list) {
            push @data, "$l\r\n";
        }

        push @data, "IMPLEMENTATION POP3 pingpong test server\r\n";

        # Send the CAPA response
        for my $d (@data) {
            sendcontrol $d;
        }

        # End with the magic 3-byte end of listing marker
        sendcontrol ".\r\n";
    }

    return 0;
}

sub APOP_pop3 {
    my ($args) = @_;
    my ($user, $secret) = split(/ /, $args, 2);

    if (!grep /^APOP$/, @capabilities) {
        sendcontrol "-ERR Unrecognized command\r\n";
    }
    elsif (($user eq "") || ($secret eq "")) {
        sendcontrol "-ERR Protocol error\r\n";
    }
    else {
        my $digest = Digest::MD5::md5_hex($POP3_TIMESTAMP, $TEXT_PASSWORD);

        if (($user ne $TEXT_USERNAME) || ($secret ne $digest)) {
            sendcontrol "-ERR Login failure\r\n";
        }
        else {
            sendcontrol "+OK Login successful\r\n";
        }
    }

    return 0;
}

sub AUTH_pop3 {
    my ($testno) = @_;

    if(!@auth_mechs) {
        sendcontrol "-ERR Unrecognized command\r\n";
    }
    else {
        my @data = ();

        # Calculate the AUTH response
        push @data, "+OK List of supported mechanisms follows\r\n";

        for my $am (@auth_mechs) {
            push @data, "$am\r\n";
        }

        # Send the AUTH response
        for my $d (@data) {
            sendcontrol $d;
        }

        # End with the magic 3-byte end of listing marker
        sendcontrol ".\r\n";
    }

    return 0;
}

sub USER_pop3 {
    my ($user) = @_;

    logmsg "USER_pop3 got $user\n";

    if (!$user) {
        sendcontrol "-ERR Protocol error\r\n";
    }
    else {
        $username = $user;

        sendcontrol "+OK\r\n";
    }

    return 0;
}

sub PASS_pop3 {
    my ($password) = @_;

    logmsg "PASS_pop3 got $password\n";

    if (($username ne $TEXT_USERNAME) || ($password ne $TEXT_PASSWORD)) {
        sendcontrol "-ERR Login failure\r\n";
    }
    else {
        sendcontrol "+OK Login successful\r\n";
    }

    return 0;
}

sub RETR_pop3 {
    my ($testno) = @_;
    my @data;

    if($testno =~ /^verifiedserver$/) {
        # this is the secret command that verifies that this actually is
        # the curl test server
        my $response = "WE ROOLZ: $$\r\n";
        if($verbose) {
            print STDERR "FTPD: We returned proof we are the test server\n";
        }
        $data[0] = $response;
        logmsg "return proof we are we\n";
    }
    else {
        logmsg "retrieve a mail\n";

        $testno =~ s/^([^0-9]*)//;
        my $testpart = "";
        if ($testno > 10000) {
            $testpart = $testno % 10000;
            $testno = int($testno / 10000);
        }

        # send mail content
        loadtest("$srcdir/data/test$testno");

        @data = getpart("reply", "data$testpart");
    }

    sendcontrol "+OK Mail transfer starts\r\n";

    for my $d (@data) {
        sendcontrol $d;
    }

    # end with the magic 3-byte end of mail marker, assumes that the
    # mail body ends with a CRLF!
    sendcontrol ".\r\n";

    return 0;
}

sub LIST_pop3 {
    # This is a built-in fake-message list
    my @data = (
        "1 100\r\n",
        "2 4294967400\r\n",	# > 4 GB
        "3 200\r\n",
    );

    logmsg "retrieve a message list\n";

    sendcontrol "+OK Listing starts\r\n";

    for my $d (@data) {
        sendcontrol $d;
    }

    # End with the magic 3-byte end of listing marker
    sendcontrol ".\r\n";

    return 0;
}

sub DELE_pop3 {
    my ($msg) = @_;

    logmsg "DELE_pop3 got $msg\n";

    if (!$msg) {
        sendcontrol "-ERR Protocol error\r\n";
    }
    else {
        push (@deleted, $msg);

        sendcontrol "+OK\r\n";
    }

    return 0;
}

sub STAT_pop3 {
    my ($args) = @_;

    if ($args) {
        sendcontrol "-ERR Protocol error\r\n";
    }
    else {
        # Send statistics for the built-in fake message list as
        # detailed in the LIST_pop3 function above
        sendcontrol "+OK 3 4294967800\r\n";
    }

    return 0;
}

sub NOOP_pop3 {
    my ($args) = @_;

    if ($args) {
        sendcontrol "-ERR Protocol error\r\n";
    }
    else {
        sendcontrol "+OK\r\n";
    }

    return 0;
}

sub UIDL_pop3 {
    # This is a built-in fake-message UID list
    my @data = (
        "1 1\r\n",
        "2 2\r\n",
        "3 4\r\n", # Note that UID 3 is a simulated "deleted" message
    );

    if (!grep /^UIDL$/, @capabilities) {
        sendcontrol "-ERR Unrecognized command\r\n";
    }
    else {
        logmsg "retrieve a message UID list\n";

        sendcontrol "+OK Listing starts\r\n";

        for my $d (@data) {
            sendcontrol $d;
        }

        # End with the magic 3-byte end of listing marker
        sendcontrol ".\r\n";
    }

    return 0;
}

sub TOP_pop3 {
    my ($args) = @_;
    my ($msg, $lines) = split(/ /, $args, 2);

    logmsg "TOP_pop3 got $args\n";

    if (!grep /^TOP$/, @capabilities) {
        sendcontrol "-ERR Unrecognized command\r\n";
    }
    elsif (($msg eq "") || ($lines eq "")) {
        sendcontrol "-ERR Protocol error\r\n";
    }
    else {
        my @data;

        if ($lines == "0") {
            logmsg "retrieve header of mail\n";
        }
        else {
            logmsg "retrieve top $lines lines of mail\n";
        }

        my $testno = $msg;
        $testno =~ s/^([^0-9]*)//;
        my $testpart = "";
        if ($testno > 10000) {
            $testpart = $testno % 10000;
            $testno = int($testno / 10000);
        }

        loadtest("$srcdir/data/test$testno");

        @data = getpart("reply", "data$testpart");

        sendcontrol "+OK Mail transfer starts\r\n";

        # Send mail content
        for my $d (@data) {
            sendcontrol $d;
        }

        # End with the magic 3-byte end of mail marker, assumes that the
        # mail body ends with a CRLF!
        sendcontrol ".\r\n";
    }

    return 0;
}

sub RSET_pop3 {
    my ($args) = @_;

    if ($args) {
        sendcontrol "-ERR Protocol error\r\n";
    }
    else {
        if (@deleted) {
            logmsg "resetting @deleted message(s)\n";

            @deleted = ();
        }

        sendcontrol "+OK\r\n";
    }

    return 0;
}

sub QUIT_pop3 {
    if(@deleted) {
        logmsg "deleting @deleted message(s)\n";

        @deleted = ();
    }

    sendcontrol "+OK cURL POP3 server signing off\r\n";

    return 0;
}

################
################ FTP commands
################
my $rest=0;
sub REST_ftp {
    $rest = $_[0];
    logmsg "Set REST position to $rest\n"
}

sub switch_directory_goto {
  my $target_dir = $_;

  if(!$ftptargetdir) {
    $ftptargetdir = "/";
  }

  if($target_dir eq "") {
    $ftptargetdir = "/";
  }
  elsif($target_dir eq "..") {
    if($ftptargetdir eq "/") {
      $ftptargetdir = "/";
    }
    else {
      $ftptargetdir =~ s/[[:alnum:]]+\/$//;
    }
  }
  else {
    $ftptargetdir .= $target_dir . "/";
  }
}

sub switch_directory {
    my $target_dir = $_[0];

    if($target_dir =~ /^test-(\d+)/) {
        $cwd_testno = $1;
    }
    elsif($target_dir eq "/") {
        $ftptargetdir = "/";
    }
    else {
        my @dirs = split("/", $target_dir);
        for(@dirs) {
          switch_directory_goto($_);
        }
    }
}

sub CWD_ftp {
  my ($folder, $fullcommand) = $_[0];
  switch_directory($folder);
  if($ftptargetdir =~ /^\/fully_simulated/) {
    $ftplistparserstate = "enabled";
  }
  else {
    undef $ftplistparserstate;
  }
}

sub PWD_ftp {
    my $mydir;
    $mydir = $ftptargetdir ? $ftptargetdir : "/";

    if($mydir ne "/") {
        $mydir =~ s/\/$//;
    }
    sendcontrol "257 \"$mydir\" is current directory\r\n";
}

sub LIST_ftp {
    #  print "150 ASCII data connection for /bin/ls (193.15.23.1,59196) (0 bytes)\r\n";

# this is a built-in fake-dir ;-)
my @ftpdir=("total 20\r\n",
"drwxr-xr-x   8 98       98           512 Oct 22 13:06 .\r\n",
"drwxr-xr-x   8 98       98           512 Oct 22 13:06 ..\r\n",
"drwxr-xr-x   2 98       98           512 May  2  1996 .NeXT\r\n",
"-r--r--r--   1 0        1             35 Jul 16  1996 README\r\n",
"lrwxrwxrwx   1 0        1              7 Dec  9  1999 bin -> usr/bin\r\n",
"dr-xr-xr-x   2 0        1            512 Oct  1  1997 dev\r\n",
"drwxrwxrwx   2 98       98           512 May 29 16:04 download.html\r\n",
"dr-xr-xr-x   2 0        1            512 Nov 30  1995 etc\r\n",
"drwxrwxrwx   2 98       1            512 Oct 30 14:33 pub\r\n",
"dr-xr-xr-x   5 0        1            512 Oct  1  1997 usr\r\n");

    if($datasockf_conn eq 'no') {
        if($nodataconn425) {
            sendcontrol "150 Opening data connection\r\n";
            sendcontrol "425 Can't open data connection\r\n";
        }
        elsif($nodataconn421) {
            sendcontrol "150 Opening data connection\r\n";
            sendcontrol "421 Connection timed out\r\n";
        }
        elsif($nodataconn150) {
            sendcontrol "150 Opening data connection\r\n";
            # client shall timeout
        }
        else {
            # client shall timeout
        }
        return 0;
    }

    if($ftplistparserstate) {
      @ftpdir = ftp_contentlist($ftptargetdir);
    }

    logmsg "pass LIST data on data connection\n";

    if($cwd_testno) {
        loadtest("$srcdir/data/test$cwd_testno");

        my @data = getpart("reply", "data");
        for(@data) {
            my $send = $_;
            logmsg "send $send as data\n";
            senddata $send;
        }
        $cwd_testno = 0; # forget it again
    }
    else {
        # old hard-coded style
        for(@ftpdir) {
            senddata $_;
        }
    }
    close_dataconn(0);
    sendcontrol "226 ASCII transfer complete\r\n";
    return 0;
}

sub NLST_ftp {
    my @ftpdir=("file", "with space", "fake", "..", " ..", "funny", "README");

    if($datasockf_conn eq 'no') {
        if($nodataconn425) {
            sendcontrol "150 Opening data connection\r\n";
            sendcontrol "425 Can't open data connection\r\n";
        }
        elsif($nodataconn421) {
            sendcontrol "150 Opening data connection\r\n";
            sendcontrol "421 Connection timed out\r\n";
        }
        elsif($nodataconn150) {
            sendcontrol "150 Opening data connection\r\n";
            # client shall timeout
        }
        else {
            # client shall timeout
        }
        return 0;
    }

    logmsg "pass NLST data on data connection\n";
    for(@ftpdir) {
        senddata "$_\r\n";
    }
    close_dataconn(0);
    sendcontrol "226 ASCII transfer complete\r\n";
    return 0;
}

sub MDTM_ftp {
    my $testno = $_[0];
    my $testpart = "";
    if ($testno > 10000) {
        $testpart = $testno % 10000;
        $testno = int($testno / 10000);
    }

    loadtest("$srcdir/data/test$testno");

    my @data = getpart("reply", "mdtm");

    my $reply = $data[0];
    chomp $reply if($reply);

    if($reply && ($reply =~ /^[+-]?\d+$/) && ($reply < 0)) {
        sendcontrol "550 $testno: no such file.\r\n";
    }
    elsif($reply) {
        sendcontrol "$reply\r\n";
    }
    else {
        sendcontrol "500 MDTM: no such command.\r\n";
    }
    return 0;
}

sub SIZE_ftp {
    my $testno = $_[0];
    if($ftplistparserstate) {
        my $size = wildcard_filesize($ftptargetdir, $testno);
        if($size == -1) {
            sendcontrol "550 $testno: No such file or directory.\r\n";
        }
        else {
            sendcontrol "213 $size\r\n";
        }
        return 0;
    }

    if($testno =~ /^verifiedserver$/) {
        my $response = "WE ROOLZ: $$\r\n";
        my $size = length($response);
        sendcontrol "213 $size\r\n";
        return 0;
    }

    if($testno =~ /(\d+)\/?$/) {
        $testno = $1;
    }
    else {
        print STDERR "SIZE_ftp: invalid test number: $testno\n";
        return 1;
    }

    my $testpart = "";
    if($testno > 10000) {
        $testpart = $testno % 10000;
        $testno = int($testno / 10000);
    }

    loadtest("$srcdir/data/test$testno");

    my @data = getpart("reply", "size");

    my $size = $data[0];

    if($size) {
        if($size > -1) {
            sendcontrol "213 $size\r\n";
        }
        else {
            sendcontrol "550 $testno: No such file or directory.\r\n";
        }
    }
    else {
        $size=0;
        @data = getpart("reply", "data$testpart");
        for(@data) {
            $size += length($_);
        }
        if($size) {
            sendcontrol "213 $size\r\n";
        }
        else {
            sendcontrol "550 $testno: No such file or directory.\r\n";
        }
    }
    return 0;
}

sub RETR_ftp {
    my ($testno) = @_;

    if($datasockf_conn eq 'no') {
        if($nodataconn425) {
            sendcontrol "150 Opening data connection\r\n";
            sendcontrol "425 Can't open data connection\r\n";
        }
        elsif($nodataconn421) {
            sendcontrol "150 Opening data connection\r\n";
            sendcontrol "421 Connection timed out\r\n";
        }
        elsif($nodataconn150) {
            sendcontrol "150 Opening data connection\r\n";
            # client shall timeout
        }
        else {
            # client shall timeout
        }
        return 0;
    }

    if($ftplistparserstate) {
        my @content = wildcard_getfile($ftptargetdir, $testno);
        if($content[0] == -1) {
            #file not found
        }
        else {
            my $size = length $content[1];
            sendcontrol "150 Binary data connection for $testno ($size bytes).\r\n",
            senddata $content[1];
            close_dataconn(0);
            sendcontrol "226 File transfer complete\r\n";
        }
        return 0;
    }

    if($testno =~ /^verifiedserver$/) {
        # this is the secret command that verifies that this actually is
        # the curl test server
        my $response = "WE ROOLZ: $$\r\n";
        my $len = length($response);
        sendcontrol "150 Binary junk ($len bytes).\r\n";
        senddata "WE ROOLZ: $$\r\n";
        close_dataconn(0);
        sendcontrol "226 File transfer complete\r\n";
        if($verbose) {
            print STDERR "FTPD: We returned proof we are the test server\n";
        }
        return 0;
    }

    $testno =~ s/^([^0-9]*)//;
    my $testpart = "";
    if ($testno > 10000) {
        $testpart = $testno % 10000;
        $testno = int($testno / 10000);
    }

    loadtest("$srcdir/data/test$testno");

    my @data = getpart("reply", "data$testpart");

    my $size=0;
    for(@data) {
        $size += length($_);
    }

    my %hash = getpartattr("reply", "data$testpart");

    if($size || $hash{'sendzero'}) {

        if($rest) {
            # move read pointer forward
            $size -= $rest;
            logmsg "REST $rest was removed from size, makes $size left\n";
            $rest = 0; # reset REST offset again
        }
        if($retrweirdo) {
            sendcontrol "150 Binary data connection for $testno () ($size bytes).\r\n",
            "226 File transfer complete\r\n";

            for(@data) {
                my $send = $_;
                senddata $send;
            }
            close_dataconn(0);
            $retrweirdo=0; # switch off the weirdo again!
        }
        else {
            my $sz = "($size bytes)";
            if($retrnosize) {
                $sz = "size?";
            }

            sendcontrol "150 Binary data connection for $testno () $sz.\r\n";

            for(@data) {
                my $send = $_;
                senddata $send;
            }
            close_dataconn(0);
            sendcontrol "226 File transfer complete\r\n";
        }
    }
    else {
        sendcontrol "550 $testno: No such file or directory.\r\n";
    }
    return 0;
}

sub STOR_ftp {
    my $testno=$_[0];

    my $filename = "log/upload.$testno";

    if($datasockf_conn eq 'no') {
        if($nodataconn425) {
            sendcontrol "150 Opening data connection\r\n";
            sendcontrol "425 Can't open data connection\r\n";
        }
        elsif($nodataconn421) {
            sendcontrol "150 Opening data connection\r\n";
            sendcontrol "421 Connection timed out\r\n";
        }
        elsif($nodataconn150) {
            sendcontrol "150 Opening data connection\r\n";
            # client shall timeout
        }
        else {
            # client shall timeout
        }
        return 0;
    }

    logmsg "STOR test number $testno in $filename\n";

    sendcontrol "125 Gimme gimme gimme!\r\n";

    open(FILE, ">$filename") ||
        return 0; # failed to open output

    my $line;
    my $ulsize=0;
    my $disc=0;
    while (5 == (sysread DREAD, $line, 5)) {
        if($line eq "DATA\n") {
            my $i;
            sysread DREAD, $i, 5;

            my $size = 0;
            if($i =~ /^([0-9a-fA-F]{4})\n/) {
                $size = hex($1);
            }

            read_datasockf(\$line, $size);

            #print STDERR "  GOT: $size bytes\n";

            $ulsize += $size;
            print FILE $line if(!$nosave);
            logmsg "> Appending $size bytes to file\n";
        }
        elsif($line eq "DISC\n") {
            # disconnect!
            $disc=1;
            last;
        }
        else {
            logmsg "No support for: $line";
            last;
        }
    }
    if($nosave) {
        print FILE "$ulsize bytes would've been stored here\n";
    }
    close(FILE);
    close_dataconn($disc);
    logmsg "received $ulsize bytes upload\n";
    sendcontrol "226 File transfer complete\r\n";
    return 0;
}

sub PASV_ftp {
    my ($arg, $cmd)=@_;
    my $pasvport;
    my $bindonly = ($nodataconn) ? '--bindonly' : '';

    # kill previous data connection sockfilt when alive
    if($datasockf_runs eq 'yes') {
        killsockfilters($proto, $ipvnum, $idnum, $verbose, 'data');
        logmsg "DATA sockfilt for $datasockf_mode data channel killed\n";
    }
    datasockf_state('STOPPED');

    logmsg "====> Passive DATA channel requested by client\n";

    logmsg "DATA sockfilt for passive data channel starting...\n";

    # We fire up a new sockfilt to do the data transfer for us.
    my $datasockfcmd = "./server/sockfilt " .
        "--ipv$ipvnum $bindonly --port 0 " .
        "--pidfile \"$datasockf_pidfile\" " .
        "--logfile \"$datasockf_logfile\"";
    $slavepid = open2(\*DREAD, \*DWRITE, $datasockfcmd);

    if($nodataconn) {
        datasockf_state('PASSIVE_NODATACONN');
    }
    else {
        datasockf_state('PASSIVE');
    }

    print STDERR "$datasockfcmd\n" if($verbose);

    print DWRITE "PING\n";
    my $pong;
    sysread_or_die(\*DREAD, \$pong, 5);

    if($pong =~ /^FAIL/) {
        logmsg "DATA sockfilt said: FAIL\n";
        logmsg "DATA sockfilt for passive data channel failed\n";
        logmsg "DATA sockfilt not running\n";
        datasockf_state('STOPPED');
        sendcontrol "500 no free ports!\r\n";
        return;
    }
    elsif($pong !~ /^PONG/) {
        logmsg "DATA sockfilt unexpected response: $pong\n";
        logmsg "DATA sockfilt for passive data channel failed\n";
        logmsg "DATA sockfilt killed now\n";
        killsockfilters($proto, $ipvnum, $idnum, $verbose, 'data');
        logmsg "DATA sockfilt not running\n";
        datasockf_state('STOPPED');
        sendcontrol "500 no free ports!\r\n";
        return;
    }

    logmsg "DATA sockfilt for passive data channel started (pid $slavepid)\n";

    # Find out on what port we listen on or have bound
    my $i;
    print DWRITE "PORT\n";

    # READ the response code
    sysread_or_die(\*DREAD, \$i, 5);

    # READ the response size
    sysread_or_die(\*DREAD, \$i, 5);

    my $size = 0;
    if($i =~ /^([0-9a-fA-F]{4})\n/) {
        $size = hex($1);
    }

    # READ the response data
    read_datasockf(\$i, $size);

    # The data is in the format
    # IPvX/NNN

    if($i =~ /IPv(\d)\/(\d+)/) {
        # FIX: deal with IP protocol version
        $pasvport = $2;
    }

    if(!$pasvport) {
        logmsg "DATA sockfilt unknown listener port\n";
        logmsg "DATA sockfilt for passive data channel failed\n";
        logmsg "DATA sockfilt killed now\n";
        killsockfilters($proto, $ipvnum, $idnum, $verbose, 'data');
        logmsg "DATA sockfilt not running\n";
        datasockf_state('STOPPED');
        sendcontrol "500 no free ports!\r\n";
        return;
    }

    if($nodataconn) {
        my $str = nodataconn_str();
        logmsg "DATA sockfilt for passive data channel ($str) bound on port ".
               "$pasvport\n";
    }
    else {
        logmsg "DATA sockfilt for passive data channel listens on port ".
               "$pasvport\n";
    }

    if($cmd ne "EPSV") {
        # PASV reply
        my $p=$listenaddr;
        $p =~ s/\./,/g;
        if($pasvbadip) {
            $p="1,2,3,4";
        }
        sendcontrol sprintf("227 Entering Passive Mode ($p,%d,%d)\n",
                            int($pasvport/256), int($pasvport%256));
    }
    else {
        # EPSV reply
        sendcontrol sprintf("229 Entering Passive Mode (|||%d|)\n", $pasvport);
    }

    logmsg "Client has been notified that DATA conn ".
           "will be accepted on port $pasvport\n";

    if($nodataconn) {
        my $str = nodataconn_str();
        logmsg "====> Client fooled ($str)\n";
        return;
    }

    eval {
        local $SIG{ALRM} = sub { die "alarm\n" };

        # assume swift operations unless explicitly slow
        alarm ($datadelay?20:10);

        # Wait for 'CNCT'
        my $input;

        # FIX: Monitor ctrl conn for disconnect

        while(sysread(DREAD, $input, 5)) {

            if($input !~ /^CNCT/) {
                # we wait for a connected client
                logmsg "Odd, we got $input from client\n";
                next;
            }
            logmsg "Client connects to port $pasvport\n";
            last;
        }
        alarm 0;
    };
    if ($@) {
        # timed out
        logmsg "$srvrname server timed out awaiting data connection ".
            "on port $pasvport\n";
        logmsg "accept failed or connection not even attempted\n";
        logmsg "DATA sockfilt killed now\n";
        killsockfilters($proto, $ipvnum, $idnum, $verbose, 'data');
        logmsg "DATA sockfilt not running\n";
        datasockf_state('STOPPED');
        return;
    }
    else {
        logmsg "====> Client established passive DATA connection ".
               "on port $pasvport\n";
    }

    return;
}

#
# Support both PORT and EPRT here.
#

sub PORT_ftp {
    my ($arg, $cmd) = @_;
    my $port;
    my $addr;

    # kill previous data connection sockfilt when alive
    if($datasockf_runs eq 'yes') {
        killsockfilters($proto, $ipvnum, $idnum, $verbose, 'data');
        logmsg "DATA sockfilt for $datasockf_mode data channel killed\n";
    }
    datasockf_state('STOPPED');

    logmsg "====> Active DATA channel requested by client\n";

    # We always ignore the given IP and use localhost.

    if($cmd eq "PORT") {
        if($arg !~ /(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)/) {
            logmsg "DATA sockfilt for active data channel not started ".
                   "(bad PORT-line: $arg)\n";
            sendcontrol "500 silly you, go away\r\n";
            return;
        }
        $port = ($5<<8)+$6;
        $addr = "$1.$2.$3.$4";
    }
    # EPRT |2|::1|49706|
    elsif($cmd eq "EPRT") {
        if($arg !~ /(\d+)\|([^\|]+)\|(\d+)/) {
            logmsg "DATA sockfilt for active data channel not started ".
                   "(bad EPRT-line: $arg)\n";
            sendcontrol "500 silly you, go away\r\n";
            return;
        }
        sendcontrol "200 Thanks for dropping by. We contact you later\r\n";
        $port = $3;
        $addr = $2;
    }
    else {
        logmsg "DATA sockfilt for active data channel not started ".
               "(invalid command: $cmd)\n";
        sendcontrol "500 we don't like $cmd now\r\n";
        return;
    }

    if(!$port || $port > 65535) {
        logmsg "DATA sockfilt for active data channel not started ".
               "(illegal PORT number: $port)\n";
        return;
    }

    if($nodataconn) {
        my $str = nodataconn_str();
        logmsg "DATA sockfilt for active data channel not started ($str)\n";
        datasockf_state('ACTIVE_NODATACONN');
        logmsg "====> Active DATA channel not established\n";
        return;
    }

    logmsg "DATA sockfilt for active data channel starting...\n";

    # We fire up a new sockfilt to do the data transfer for us.
    my $datasockfcmd = "./server/sockfilt " .
        "--ipv$ipvnum --connect $port --addr \"$addr\" " .
        "--pidfile \"$datasockf_pidfile\" " .
        "--logfile \"$datasockf_logfile\"";
    $slavepid = open2(\*DREAD, \*DWRITE, $datasockfcmd);

    datasockf_state('ACTIVE');

    print STDERR "$datasockfcmd\n" if($verbose);

    print DWRITE "PING\n";
    my $pong;
    sysread_or_die(\*DREAD, \$pong, 5);

    if($pong =~ /^FAIL/) {
        logmsg "DATA sockfilt said: FAIL\n";
        logmsg "DATA sockfilt for active data channel failed\n";
        logmsg "DATA sockfilt not running\n";
        datasockf_state('STOPPED');
        # client shall timeout awaiting connection from server
        return;
    }
    elsif($pong !~ /^PONG/) {
        logmsg "DATA sockfilt unexpected response: $pong\n";
        logmsg "DATA sockfilt for active data channel failed\n";
        logmsg "DATA sockfilt killed now\n";
        killsockfilters($proto, $ipvnum, $idnum, $verbose, 'data');
        logmsg "DATA sockfilt not running\n";
        datasockf_state('STOPPED');
        # client shall timeout awaiting connection from server
        return;
    }

    logmsg "DATA sockfilt for active data channel started (pid $slavepid)\n";

    logmsg "====> Active DATA channel connected to client port $port\n";

    return;
}

#**********************************************************************
# datasockf_state is used to change variables that keep state info
# relative to the FTP secondary or data sockfilt process as soon as
# one of the five possible stable states is reached. Variables that
# are modified by this sub may be checked independently but should
# not be changed except by calling this sub.
#
sub datasockf_state {
    my $state = $_[0];

  if($state eq 'STOPPED') {
    # Data sockfilter initial state, not running,
    # not connected and not used.
    $datasockf_state = $state;
    $datasockf_mode = 'none';
    $datasockf_runs = 'no';
    $datasockf_conn = 'no';
  }
  elsif($state eq 'PASSIVE') {
    # Data sockfilter accepted connection from client.
    $datasockf_state = $state;
    $datasockf_mode = 'passive';
    $datasockf_runs = 'yes';
    $datasockf_conn = 'yes';
  }
  elsif($state eq 'ACTIVE') {
    # Data sockfilter has connected to client.
    $datasockf_state = $state;
    $datasockf_mode = 'active';
    $datasockf_runs = 'yes';
    $datasockf_conn = 'yes';
  }
  elsif($state eq 'PASSIVE_NODATACONN') {
    # Data sockfilter bound port without listening,
    # client won't be able to establish data connection.
    $datasockf_state = $state;
    $datasockf_mode = 'passive';
    $datasockf_runs = 'yes';
    $datasockf_conn = 'no';
  }
  elsif($state eq 'ACTIVE_NODATACONN') {
    # Data sockfilter does not even run,
    # client awaits data connection from server in vain.
    $datasockf_state = $state;
    $datasockf_mode = 'active';
    $datasockf_runs = 'no';
    $datasockf_conn = 'no';
  }
  else {
      die "Internal error. Unknown datasockf state: $state!";
  }
}

#**********************************************************************
# nodataconn_str returns string of efective nodataconn command. Notice
# that $nodataconn may be set alone or in addition to a $nodataconnXXX.
#
sub nodataconn_str {
    my $str;
    # order matters
    $str = 'NODATACONN' if($nodataconn);
    $str = 'NODATACONN425' if($nodataconn425);
    $str = 'NODATACONN421' if($nodataconn421);
    $str = 'NODATACONN150' if($nodataconn150);
    return "$str";
}

#**********************************************************************
# customize configures test server operation for each curl test, reading
# configuration commands/parameters from server commands file each time
# a new client control connection is established with the test server.
# On success returns 1, otherwise zero.
#
sub customize {
    $ctrldelay = 0;     # default is no throttling of the ctrl stream
    $datadelay = 0;     # default is no throttling of the data stream
    $retrweirdo = 0;    # default is no use of RETRWEIRDO
    $retrnosize = 0;    # default is no use of RETRNOSIZE
    $pasvbadip = 0;     # default is no use of PASVBADIP
    $nosave = 0;        # default is to actually save uploaded data to file
    $nodataconn = 0;    # default is to establish or accept data channel
    $nodataconn425 = 0; # default is to not send 425 without data channel
    $nodataconn421 = 0; # default is to not send 421 without data channel
    $nodataconn150 = 0; # default is to not send 150 without data channel
    @capabilities = (); # default is to not support capability commands
    @auth_mechs = ();   # default is to not support authentication commands
    %fulltextreply = ();#
    %commandreply = (); #
    %customcount = ();  #
    %delayreply = ();   #

    open(CUSTOM, ") {
        if($_ =~ /REPLY \"([A-Z]+ [A-Za-z0-9+-\/=\*]+)\" (.*)/) {
            $fulltextreply{$1}=eval "qq{$2}";
            logmsg "FTPD: set custom reply for $1\n";
        }
        elsif($_ =~ /REPLY ([A-Za-z0-9+\/=\*]*) (.*)/) {
            $commandreply{$1}=eval "qq{$2}";
            if($1 eq "") {
                logmsg "FTPD: set custom reply for empty command\n";
            }
            else {
                logmsg "FTPD: set custom reply for $1 command\n";
            }
        }
        elsif($_ =~ /COUNT ([A-Z]+) (.*)/) {
            # we blank the custom reply for this command when having
            # been used this number of times
            $customcount{$1}=$2;
            logmsg "FTPD: blank custom reply for $1 command after $2 uses\n";
        }
        elsif($_ =~ /DELAY ([A-Z]+) (\d*)/) {
            $delayreply{$1}=$2;
            logmsg "FTPD: delay reply for $1 with $2 seconds\n";
        }
        elsif($_ =~ /SLOWDOWN/) {
            $ctrldelay=1;
            $datadelay=1;
            logmsg "FTPD: send response with 0.01 sec delay between each byte\n";
        }
        elsif($_ =~ /RETRWEIRDO/) {
            logmsg "FTPD: instructed to use RETRWEIRDO\n";
            $retrweirdo=1;
        }
        elsif($_ =~ /RETRNOSIZE/) {
            logmsg "FTPD: instructed to use RETRNOSIZE\n";
            $retrnosize=1;
        }
        elsif($_ =~ /PASVBADIP/) {
            logmsg "FTPD: instructed to use PASVBADIP\n";
            $pasvbadip=1;
        }
        elsif($_ =~ /NODATACONN425/) {
            # applies to both active and passive FTP modes
            logmsg "FTPD: instructed to use NODATACONN425\n";
            $nodataconn425=1;
            $nodataconn=1;
        }
        elsif($_ =~ /NODATACONN421/) {
            # applies to both active and passive FTP modes
            logmsg "FTPD: instructed to use NODATACONN421\n";
            $nodataconn421=1;
            $nodataconn=1;
        }
        elsif($_ =~ /NODATACONN150/) {
            # applies to both active and passive FTP modes
            logmsg "FTPD: instructed to use NODATACONN150\n";
            $nodataconn150=1;
            $nodataconn=1;
        }
        elsif($_ =~ /NODATACONN/) {
            # applies to both active and passive FTP modes
            logmsg "FTPD: instructed to use NODATACONN\n";
            $nodataconn=1;
        }
        elsif($_ =~ /CAPA (.*)/) {
            logmsg "FTPD: instructed to support CAPABILITY command\n";
            @capabilities = split(/ (?!(?:[^" ]|[^"] [^"])+")/, $1);
            foreach (@capabilities) {
                $_ = $1 if /^"(.*)"$/;
            }
        }
        elsif($_ =~ /AUTH (.*)/) {
            logmsg "FTPD: instructed to support AUTHENTICATION command\n";
            @auth_mechs = split(/ /, $1);
        }
        elsif($_ =~ /NOSAVE/) {
            # don't actually store the file we upload - to be used when
            # uploading insanely huge amounts
            $nosave = 1;
            logmsg "FTPD: NOSAVE prevents saving of uploaded data\n";
        }
    }
    close(CUSTOM);
}

#----------------------------------------------------------------------
#----------------------------------------------------------------------
#---------------------------  END OF SUBS  ----------------------------
#----------------------------------------------------------------------
#----------------------------------------------------------------------

#**********************************************************************
# Parse command line options
#
# Options:
#
# --verbose   # verbose
# --srcdir    # source directory
# --id        # server instance number
# --proto     # server protocol
# --pidfile   # server pid file
# --logfile   # server log file
# --ipv4      # server IP version 4
# --ipv6      # server IP version 6
# --port      # server listener port
# --addr      # server address for listener port binding
#
while(@ARGV) {
    if($ARGV[0] eq '--verbose') {
        $verbose = 1;
    }
    elsif($ARGV[0] eq '--srcdir') {
        if($ARGV[1]) {
            $srcdir = $ARGV[1];
            shift @ARGV;
        }
    }
    elsif($ARGV[0] eq '--id') {
        if($ARGV[1] && ($ARGV[1] =~ /^(\d+)$/)) {
            $idnum = $1 if($1 > 0);
            shift @ARGV;
        }
    }
    elsif($ARGV[0] eq '--proto') {
        if($ARGV[1] && ($ARGV[1] =~ /^(ftp|imap|pop3|smtp)$/)) {
            $proto = $1;
            shift @ARGV;
        }
        else {
            die "unsupported protocol $ARGV[1]";
        }
    }
    elsif($ARGV[0] eq '--pidfile') {
        if($ARGV[1]) {
            $pidfile = $ARGV[1];
            shift @ARGV;
        }
    }
    elsif($ARGV[0] eq '--logfile') {
        if($ARGV[1]) {
            $logfile = $ARGV[1];
            shift @ARGV;
        }
    }
    elsif($ARGV[0] eq '--ipv4') {
        $ipvnum = 4;
        $listenaddr = '127.0.0.1' if($listenaddr eq '::1');
    }
    elsif($ARGV[0] eq '--ipv6') {
        $ipvnum = 6;
        $listenaddr = '::1' if($listenaddr eq '127.0.0.1');
    }
    elsif($ARGV[0] eq '--port') {
        if($ARGV[1] && ($ARGV[1] =~ /^(\d+)$/)) {
            $port = $1 if($1 > 1024);
            shift @ARGV;
        }
    }
    elsif($ARGV[0] eq '--addr') {
        if($ARGV[1]) {
            my $tmpstr = $ARGV[1];
            if($tmpstr =~ /^(\d\d?\d?)\.(\d\d?\d?)\.(\d\d?\d?)\.(\d\d?\d?)$/) {
                $listenaddr = "$1.$2.$3.$4" if($ipvnum == 4);
            }
            elsif($ipvnum == 6) {
                $listenaddr = $tmpstr;
                $listenaddr =~ s/^\[(.*)\]$/$1/;
            }
            shift @ARGV;
        }
    }
    else {
        print STDERR "\nWarning: ftpserver.pl unknown parameter: $ARGV[0]\n";
    }
    shift @ARGV;
}

#***************************************************************************
# Initialize command line option dependant variables
#

if(!$srcdir) {
    $srcdir = $ENV{'srcdir'} || '.';
}
if(!$pidfile) {
    $pidfile = "$path/". server_pidfilename($proto, $ipvnum, $idnum);
}
if(!$logfile) {
    $logfile = server_logfilename($logdir, $proto, $ipvnum, $idnum);
}

$mainsockf_pidfile = "$path/".
    mainsockf_pidfilename($proto, $ipvnum, $idnum);
$mainsockf_logfile =
    mainsockf_logfilename($logdir, $proto, $ipvnum, $idnum);

if($proto eq 'ftp') {
    $datasockf_pidfile = "$path/".
        datasockf_pidfilename($proto, $ipvnum, $idnum);
    $datasockf_logfile =
        datasockf_logfilename($logdir, $proto, $ipvnum, $idnum);
}

$srvrname = servername_str($proto, $ipvnum, $idnum);

$idstr = "$idnum" if($idnum > 1);

protocolsetup($proto);

$SIG{INT} = \&exit_signal_handler;
$SIG{TERM} = \&exit_signal_handler;

startsf();

logmsg sprintf("%s server listens on port IPv${ipvnum}/${port}\n", uc($proto));

open(PID, ">$pidfile");
print PID $$."\n";
close(PID);

logmsg("logged pid $$ in $pidfile\n");


while(1) {

    # kill previous data connection sockfilt when alive
    if($datasockf_runs eq 'yes') {
        killsockfilters($proto, $ipvnum, $idnum, $verbose, 'data');
        logmsg "DATA sockfilt for $datasockf_mode data channel killed now\n";
    }
    datasockf_state('STOPPED');

    #
    # We read 'sockfilt' commands.
    #
    my $input;

    logmsg "Awaiting input\n";
    sysread_or_die(\*SFREAD, \$input, 5);

    if($input !~ /^CNCT/) {
        # we wait for a connected client
        logmsg "MAIN sockfilt said: $input";
        next;
    }
    logmsg "====> Client connect\n";

    set_advisor_read_lock($SERVERLOGS_LOCK);
    $serverlogslocked = 1;

    # flush data:
    $| = 1;

    &customize(); # read test control instructions

    my $welcome = $commandreply{"welcome"};
    if(!$welcome) {
        $welcome = $displaytext{"welcome"};
    }
    else {
        # clear it after use
        $commandreply{"welcome"}="";
        if($welcome !~ /\r\n\z/) {
            $welcome .= "\r\n";
        }
    }
    sendcontrol $welcome;

    #remove global variables from last connection
    if($ftplistparserstate) {
      undef $ftplistparserstate;
    }
    if($ftptargetdir) {
      undef $ftptargetdir;
    }

    if($verbose) {
        print STDERR "OUT: $welcome";
    }

    my $full = "";

    while(1) {
        my $i;

        # Now we expect to read DATA\n[hex size]\n[prot], where the [prot]
        # part only is FTP lingo.

        # COMMAND
        sysread_or_die(\*SFREAD, \$i, 5);

        if($i !~ /^DATA/) {
            logmsg "MAIN sockfilt said $i";
            if($i =~ /^DISC/) {
                # disconnect
                last;
            }
            next;
        }

        # SIZE of data
        sysread_or_die(\*SFREAD, \$i, 5);

        my $size = 0;
        if($i =~ /^([0-9a-fA-F]{4})\n/) {
            $size = hex($1);
        }

        # data
        read_mainsockf(\$input, $size);

        ftpmsg $input;

        $full .= $input;

        # Loop until command completion
        next unless($full =~ /\r\n$/);

        # Remove trailing CRLF.
        $full =~ s/[\n\r]+$//;

        my $FTPCMD;
        my $FTPARG;
        if($proto eq "imap") {
            # IMAP is different with its identifier first on the command line
            if(($full =~ /^([^ ]+) ([^ ]+) (.*)/) ||
               ($full =~ /^([^ ]+) ([^ ]+)/)) {
                $cmdid=$1; # set the global variable
                $FTPCMD=$2;
                $FTPARG=$3;
            }
            # IMAP authentication cancellation
            elsif($full =~ /^\*$/) {
                # Command id has already been set
                $FTPCMD="*";
                $FTPARG="";
            }
            # IMAP long "commands" are base64 authentication data
            elsif($full =~ /^[A-Z0-9+\/]*={0,2}$/i) {
                # Command id has already been set
                $FTPCMD=$full;
                $FTPARG="";
            }
            else {
                sendcontrol "$full BAD Command\r\n";
                last;
            }
        }
        elsif($full =~ /^([A-Z]{3,4})(\s(.*))?$/i) {
            $FTPCMD=$1;
            $FTPARG=$3;
        }
        elsif($proto eq "pop3") {
            # POP3 authentication cancellation
            if($full =~ /^\*$/) {
                $FTPCMD="*";
                $FTPARG="";
            }
            # POP3 long "commands" are base64 authentication data
            elsif($full =~ /^[A-Z0-9+\/]*={0,2}$/i) {
                $FTPCMD=$full;
                $FTPARG="";
            }
            else {
                sendcontrol "-ERR Unrecognized command\r\n";
                last;
            }
        }
        elsif($proto eq "smtp") {
            # SMTP authentication cancellation
            if($full =~ /^\*$/) {
                $FTPCMD="*";
                $FTPARG="";
            }
            # SMTP long "commands" are base64 authentication data
            elsif($full =~ /^[A-Z0-9+\/]{0,512}={0,2}$/i) {
                $FTPCMD=$full;
                $FTPARG="";
            }
            else {
                sendcontrol "500 Unrecognized command\r\n";
                last;
            }
        }
        else {
            sendcontrol "500 Unrecognized command\r\n";
            last;
        }

        logmsg "< \"$full\"\n";

        if($verbose) {
            print STDERR "IN: $full\n";
        }

        $full = "";

        my $delay = $delayreply{$FTPCMD};
        if($delay) {
            # just go sleep this many seconds!
            logmsg("Sleep for $delay seconds\n");
            my $twentieths = $delay * 20;
            while($twentieths--) {
                select(undef, undef, undef, 0.05) unless($got_exit_signal);
            }
        }

        my $check = 1; # no response yet

        # See if there is a custom reply for the full text
        my $fulltext = $FTPARG ? $FTPCMD . " " . $FTPARG : $FTPCMD;
        my $text = $fulltextreply{$fulltext};
        if($text && ($text ne "")) {
            sendcontrol "$text\r\n";
            $check = 0;
        }
        else {
            # See if there is a custom reply for the command
            $text = $commandreply{$FTPCMD};
            if($text && ($text ne "")) {
                if($customcount{$FTPCMD} && (!--$customcount{$FTPCMD})) {
                    # used enough times so blank the custom command reply
                    $commandreply{$FTPCMD}="";
                }

                sendcontrol "$text\r\n";
                $check = 0;
            }
            else {
                # See if there is any display text for the command
                $text = $displaytext{$FTPCMD};
                if($text && ($text ne "")) {
                    if($proto eq 'imap') {
                        sendcontrol "$cmdid $text\r\n";
                    }
                    else {
                        sendcontrol "$text\r\n";
                    }

                    $check = 0;
                }

                # only perform this if we're not faking a reply
                my $func = $commandfunc{$FTPCMD};
                if($func) {
                    &$func($FTPARG, $FTPCMD);
                    $check = 0;
                }
            }
        }

        if($check) {
            logmsg "$FTPCMD wasn't handled!\n";
            if($proto eq 'pop3') {
                sendcontrol "-ERR $FTPCMD is not dealt with!\r\n";
            }
            elsif($proto eq 'imap') {
                sendcontrol "$cmdid BAD $FTPCMD is not dealt with!\r\n";
            }
            else {
                sendcontrol "500 $FTPCMD is not dealt with!\r\n";
            }
        }

    } # while(1)
    logmsg "====> Client disconnected\n";

    if($serverlogslocked) {
        $serverlogslocked = 0;
        clear_advisor_read_lock($SERVERLOGS_LOCK);
    }
}

killsockfilters($proto, $ipvnum, $idnum, $verbose);
unlink($pidfile);
if($serverlogslocked) {
    $serverlogslocked = 0;
    clear_advisor_read_lock($SERVERLOGS_LOCK);
}

exit;
curl-7.35.0/tests/CMakeLists.txt0000644000175000017500000000006312213173003013365 00000000000000add_subdirectory(libtest)
add_subdirectory(server)
curl-7.35.0/tests/testcurl.html0000644000175000017500000001537312227001411013370 00000000000000

testcurl.pl man page




NAME

testcurl.pl - (automatically) test curl

SYNOPSIS

testcurl.pl [options] [dir] > output

DESCRIPTION

testcurl.pl is the master script to use for automatic testing of curl off git or daily snapshots. It is written for the purpose of being run from a crontab job or similar at a regular interval. The output is suitable to be mailed to curl-autocompile@haxx.se to be dealt with automatically (make sure the subject includes the word "autobuild" as the mail gets silently discarded otherwise). The most current build status (with a reasonable backlog) will be published on the curl site, at http://curl.haxx.se/auto/

options may be omitted. See --setup for what happens then.

dir is a curl source dir, possibly a daily snapshot one. Using this will make testcurl.pl skip the 'buildconf' stage and thus it removes the dependency on automake, autoconf, libtool, GNU m4 and possibly a few other things.

testcurl.pl will run 'buildconf' (or similar), run configure, build curl and libcurl in a separate build directory and then run 'make test' to test the fresh build.

OPTIONS

--configure=[options]

Configure options passed to configure.

--crosscompile

This is a cross-compile. Makes testcurl.pl skip a few things.

--desc=[desc]

Description of your test system. Displayed on the build summary page on the weba site.

--email=[email]

Set email address to report as. Displayed in the build logs on the site.

--mktarball=[command]

Generic command to run after completed test.

--name=[name]

Set name to report as. Displayed in the build summary on the site.

--nobuildconf

Don't run buildconf. Useful when many builds use the same source tree, as then only one need to do this. Also, if multiple processes run tests simultaneously on the same source tree (like several hosts on a NFS mounted dir), simultaneous buildconf invokes may cause problems. (Added in 7.14.1)

--nogitpull

Don't update from git even though it is a git tree. Useful to still be able to test even though your network is down, or similar.

--runtestopts=[options]

Options that is passed to the runtests.pl script. Useful for disabling valgrind by force, and similar.

--setup=[file name]

File name to read setup from (deprecated). The old style of providing info. If info is missing when testcurl.pl is started, it will prompt you and then store the info in a 'setup' file, which it will look for on each invoke. Use --name, --email, --configure and --desc instead.

--target=[your os]

Specify your target environment. Recognized strings include 'vc', 'mingw32', 'borland' and 'netware'.

INITIAL SETUP

First you make a checkout from git (or you write a script that downloads daily snapshots automatically, find inspiration at http://curl.haxx.se/auto/autocurl.txt):

  $ mkdir daily-curl   $ cd daily-curl   $ git clone git://github.com/bagder/curl.git

With the curl sources checked out, or downloaded, you can start testing right away. If you want to use testcurl.pl without command line arguments and to have it store and remember the config in its 'setup' file, then start it manually now and fill in the answers to the questions it prompts you for:

  $ ./curl/tests/testcurl.pl

Now you are ready to go. If you let the script run, it will perform a full cycle and spit out lots of output. Mail us that output as described above.

CRONTAB EXAMPLE

The crontab could include something like this:

# autobuild curl: 0 4 * * * cd daily-curl && ./testit.sh

Where testit.sh is a shell script that could look similar to this:

mail="mail -s autobuild curl-autocompile@haxx.se" name="--name=whoami" email="--email=iamme@nowhere" desc='"--desc=supermachine Turbo 2000"' testprog="perl ./curl/tests/testcurl.pl $name $email $desc" opts1="--configure=--enable-debug" opts2="--configure=--enable-ipv6"

# run first test $testprog $opts1 | $mail

# run second test $testprog $opts2 | $mail

This HTML page was made with roffit. curl-7.35.0/tests/runtests.html0000644000175000017500000001566012272124476013432 00000000000000 runtests.pl man page

NAME

runtests.pl - run one or more test cases

SYNOPSIS

runtests.pl [options] [test number] [!test number] [key word] [!key word]

DESCRIPTION

runtests.pl runs one, several or all the existing test cases in curl's test suite. It is often called from the root Makefile of the curl package with 'make test'.

TEST NUMBER

If no test case number is given, all existing tests that the script can find will be considered for running. You can specify single test cases to run, space-separated, like "1 3 5 7 11", and you can specify a range like "45 to 67". You can also specify only the tests you don't want to run by listing the numbers with a leading exclamation point, like "!66".

It is also possible to specify tests to skip based on a key word describing the test. These are specified with a leading exclamation point and the key word or phrase, like "!HTTP NTLM auth". Likewise, tests to run can be specified simply by specifying the unadorned key words, like "FTPS". Remember that the exclamation marks and spaces will need to be quoted somehow when entered at many command shells.

OPTIONS

-a

Continue running the rest of the test cases even if one test fails. By default, the test script stops as soon as an error is detected.

-bN

Use N as the base TCP/UDP port number on which to start the test servers.

-c <curl>

Provide a path to a custom curl binary to run the tests with. Default is the curl executable in the build tree.

-d

Enable protocol debug: have the servers display protocol output.

-e

Run the test event-based (if possible). This will make runtests invoke curl with --test-event option. This option only works if both curl and libcurl were built debug-enabled.

-g

Run the given test(s) with gdb. This is best used on a single test case and curl built --disable-shared. This then fires up gdb with command line set to run the specified test case. Simply (set a break-point and) type 'run' to start.

-h

Displays a help text about this program's command line options.

-k

Keep output and log files in log/ after a test run, even if no error was detected. Useful for debugging.

-l

Lists all test case names.

-n

Disable the check for and use of valgrind.

-p

Prints out all files in "log/" to stdout when a test case fails. Very practical when used in the automated and distributed tests since then the people checking the failures and the reasons for them might not have physical access to the machine and logs.

-r

Display run time statistics. (Requires Perl Time::HiRes module)

-rf

Display full run time statistics. (Requires Perl Time::HiRes module)

-s

Shorter output. Speaks less than default.

-t[num]

Selects a torture test for the given tests. This makes runtests.pl first run the tests once and count the number of memory allocations made. It then reruns the test that number of times, each time forcing one of the allocations to fail until all allocs have been tested. By setting num you can force the allocation with that number to be set to fail at once instead of looping through everyone, which is very handy when debugging and then often in combination with -g.

-v

Enable verbose output. Speaks more than default.

-vc <curl>

Provide a path to a custom curl binary to run when verifying that the servers running are indeed our test servers. Default is the curl executable in the build tree.

RUNNING TESTS

Many tests have conditions that must be met before the test case can run fine. They could depend on built-in features in libcurl or features present in the operating system or even in third-party libraries that curl may or may not use.

The test script checks most of these by itself to determine when it is safe to attempt to run each test. Those which cannot be run due to failed requirements will simply be skipped and listed at the completion of all test cases. In some unusual configurations, the test script cannot make the correct determination for all tests. In these cases, the problematic tests can be skipped using the "!keyword" skip feature documented earlier.

WRITING TESTS

The simplest way to write test cases is to start with a similar existing test, save it with a new number and then adjust it to fit. There's an attempt to document the test case file format in the tests/FILEFORMAT.

This HTML page was made with roffit. curl-7.35.0/tests/valgrind.pm0000644000175000017500000000754012213173003013000 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2010, 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. # ########################################################################### use File::Basename; sub valgrindparse { my ($srcdir, # the dir in which the runtests script resides $sslenabled, $file) = @_; my $leak; my $invalidread; my $uninitedvar; my $error; my $partial; my $us; my @o; my $bt=0; my $nssinit=0; open(VAL, "<$file"); while() { if($bt) { # back trace parsing if($_ =~ /^==(\d+)== *(at|by) 0x([0-9A-F]+): (.*)/) { my $w = $4; if($w =~ /(.*) \(([^:]*):(\d+)/) { my ($func, $source, $line)=($1, $2, $3); my $sourcename = basename($source); if(-f "$srcdir/../src/$sourcename" || -f "$srcdir/../lib/$sourcename") { # this is our source # print "$func() at $source:$line\n"; $us++; } #else {print "Not our source: $func, $source, $line\n";} } # the memory leakage within NSS_InitContext is not a bug of curl if($w =~ /NSS_InitContext/) { $nssinit++; } } else { if($us and not $nssinit) { # the stack trace included source details about us $error++; if($leak) { push @o, "\n Leaked $leak bytes\n"; } if($invalidread) { push @o, "\n Read $invalidread invalid bytes\n"; } if($uninitedvar) { push @o, "\n Conditional jump or move depends on uninitialised value(s)\n"; } } $bt = 0; # no more backtrace $us = 0; $nssinit = 0; } } else { if($_ =~ /(\d+) bytes in (\d+) blocks are definitely lost/) { $leak = $1; if($leak) { $error++; } $bt = 1; } elsif($_ =~ /Invalid read of size (\d+)/) { $invalidread = $1; $error++; $bt = 1; } elsif($_ =~ /Conditional jump or move/) { # If we require SSL, this test case most probaly makes # us use OpenSSL. OpenSSL produces numerous valgrind # errors of this kind, rendering it impossible for us to # detect (valid) reports on actual curl or libcurl code. if(!$sslenabled) { $uninitedvar = 1; $error++; $bt = 1; } else { $partial=1; } } } } close(VAL); return @o; } 1; curl-7.35.0/tests/httpserver.pl0000755000175000017500000000653212213173003013402 00000000000000#!/usr/bin/env perl #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2012, 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. # #*************************************************************************** BEGIN { push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'}); push(@INC, "."); } use strict; use warnings; use serverhelp qw( server_pidfilename server_logfilename ); my $verbose = 0; # set to 1 for debugging my $port = 8990; # just a default my $ipvnum = 4; # default IP version of http server my $idnum = 1; # dafault http server instance number my $proto = 'http'; # protocol the http server speaks my $pidfile; # http server pid file my $logfile; # http server log file my $connect; # IP to connect to on CONNECT my $srcdir; my $gopher = 0; my $flags = ""; my $path = '.'; my $logdir = $path .'/log'; while(@ARGV) { if($ARGV[0] eq '--pidfile') { if($ARGV[1]) { $pidfile = $ARGV[1]; shift @ARGV; } } elsif($ARGV[0] eq '--logfile') { if($ARGV[1]) { $logfile = $ARGV[1]; shift @ARGV; } } elsif($ARGV[0] eq '--srcdir') { if($ARGV[1]) { $srcdir = $ARGV[1]; shift @ARGV; } } elsif($ARGV[0] eq '--ipv4') { $ipvnum = 4; } elsif($ARGV[0] eq '--ipv6') { $ipvnum = 6; } elsif($ARGV[0] eq '--gopher') { $gopher = 1; } elsif($ARGV[0] eq '--port') { if($ARGV[1] =~ /^(\d+)$/) { $port = $1; shift @ARGV; } } elsif($ARGV[0] eq '--connect') { if($ARGV[1]) { $connect = $ARGV[1]; shift @ARGV; } } elsif($ARGV[0] eq '--id') { if($ARGV[1] =~ /^(\d+)$/) { $idnum = $1 if($1 > 0); shift @ARGV; } } elsif($ARGV[0] eq '--verbose') { $verbose = 1; } else { print STDERR "\nWarning: httpserver.pl unknown parameter: $ARGV[0]\n"; } shift @ARGV; } if(!$srcdir) { $srcdir = $ENV{'srcdir'} || '.'; } if(!$pidfile) { $pidfile = "$path/". server_pidfilename($proto, $ipvnum, $idnum); } if(!$logfile) { $logfile = server_logfilename($logdir, $proto, $ipvnum, $idnum); } $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" "; $flags .= "--gopher " if($gopher); $flags .= "--connect $connect " if($connect); $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\""; if($verbose) { print STDERR "RUN: server/sws $flags\n"; } exec("server/sws $flags"); curl-7.35.0/tests/runtests.pdf0000644000175000017500000001672712272124476013244 00000000000000%PDF-1.4 %Çì¢ 5 0 obj <> stream xœYÛrÛF}×WLô"p+@0¸#µµUÛ©8k+Z‰Ùª””’X‹eýƒeÿqOÏPJvË.›Ó=§»OŸ~b¾Ç™Oôÿåñâ»Û”íû Ÿí/>]pùéÿÊ#ûaýb½»Pïp–,ÍC/ËÙúxÁ“Ÿb¶~ºpº±D?ôÞ©~pøÃŠ™_°ó'«õ¿/\ß 8ö(a"‡ vÙ]„ [¸p®ÿ¾º‚WxÊc/ÎCX^o/œïèÕÙ§À÷"?e.è±îû™fm#XÛ±cÛ FXYô¢W;Y¦]ØvyâeÒÔÝo׿Üܽ¿›—i÷´±û…¡ûö4TmÓÿÎfõ¦ ~°,¥>“Ët™öëÇj{?° îïá‚Ø²]×¥']ÛÊ­Ü E &Ñ"{î…ŒQ$™#¾ÖÈœ|d§¢|,ö‚=UÃ]±”<¼ØøwÅÂ]Žý̃~¸ò^æ^à‡pÆŠêúÝÝš]ÿúñ‡w·Ë€ÍA…û‘<ùûkÚPnÁ¾Zû™g€ûÃØ9Í·2lòq­<7X—í öÀ§$H}ÙU'r¢a_›-`Â6`‡Ê¨¶¢£0 '[ ^öØoÊBâE<í(Ž‚Àóý`J_Ú±?‰²Ú=³ïÖv%³¡¥=‘ªˆp{q*ºbÛoY]=J^J~—AzQ˜™—« <î'ã”ËhJ@";0@ñK‚ã<·#³)XW4ÈËŠ9ò=?MM¼/'”9–¾9i›“šSâqœ©,ĉ’ô’â>e££MußNöÛ¦~–°«({Û¶1U”Ò^82O½,Ñ6‡§Ù™ÐKâTCáÍ Qd›gHG÷`r©W)_°Z[‰LÉâ{£~†2埊Aš, ôÂQ >°vÑ=›Ö8÷Zâj½ v%N‚bÒŠbI¿!úpIñå´W9u©JZ3,(»lÇLzÕٌ֙Ýa«UÙ ¡ÂÅ^¶ÈñH“Ôy×HS§®Ú²­ÅÍ*ÐÇ÷ß³CqÞAüIJ ¤©Ï@d®ÇÈ‹g±¨à%U(ÃSÄØ¶êOuñ<mÇá4*’.cè3«D]±,Á I¥Ù[+g5†-‚”óE½"E°•¢ÆfpUçpªÝ$VÔ£+Ís¤ô•ÂK2uÐÄ ÌPªˆW@ÓHjˆÕŒ¿UcÇ1„¾ ²É¿Ö8¿Œ#º«rïéd“feç' l“âÁuÉ »Äz”'ÿ ÀÀÔ «kÃLˆV´Ž$"j™RŸOSþ·Ôঅ#²ˆŒëj#??Ù™•]Š…ÒËQ+Eº¹BfãVgÂbÂu÷v çƒ“ì,8›r0Ò†á’dCÉc¯Úî%i8˘~xpú‡•Âu¿Ý,6IÐwbcÀ[Ï{ a%–—ša4üÝP®Ž“Æ<c$^Št,à8‰“ë¢hWIH:Íš“Hõ¥þ=¹Õy;PKýЮį@¤ÔM²®ªËÁf¶IM.yìNi"`µ²’Ñ*Ö¹w6(ÝIx±áù$ØÕ*¦v”†t‘p5Qù+Á4½UÜ€ÖÂÐÃOðC‘=òã v߀*à(ÎòØwÅñj1}砹鲠´K2 }¾ÔòøúÊFå{à'^’Ú9·” &ùœ;efõ‰Ê×òï¤9M@»g_kuÇÏß±b•ƒJåÔz&rºQ;K^?Ë_W!úŒB3}lÅ,Â}.=TêóÞ‘}[×n;…ÕÁºôn¬å N*;,ö Ó»P«Š"2(ÑtžÑ÷4Ó¿š9ÜAγÚž(Q^ Í÷ÅQœ5sÊ-·™Cv*Ù[¢|”Þ¼(']ŸWNQﻪÑâ¸'¥¦àèb¼Á8@¹DN˜Ø\Rp.U¢néáÕOa9iµz©°þ¥²/Ê!Ç绨\1“è¨ÅåP•E­ö’•¯Ú: >­Ѽ?] f”£GºÂ‡Dù %{RIƒ.ÒžH¤ªÖiß“hOµÆÈS%ƒ$ôxj¨ÉOÕh‡“ŒDfdD1÷( /~>*Õ« x¬ö(¶v ‘°è¾$0皘DÂI¯òcÝǬîðlõ¤é^OQšÄ¯(1qÈ¡Žœ<åêW——.`}Ç´ÒQÆ…‘¡ÅsÕQ tÃQ"Šέø4VÂ÷®Wa¬PÆÊï¿ÿ©ºÅ“c»IH$efv;lžø|Ú%Sÿßhr£?·ÐÃ@–fÎÝÚ˜d±ÒIìîÂíY-9@„oµ%ŸI„šüî!¨_A¢r˹5нW„n]ncPæ‰a—vÇn…[gŽÐ×ÐÓœÒÅ« ¡šATÖœ·ã˜H(çg”ÆÓðÏû1Ím!Ÿûq¯›Öb1M5FÖÐÑ"} lÛ€¨XÖ’î-UŒìµíØ ùÓ„d]·äzlž.SÁ2˜²[Ô5h£-å… 9³U×Ͳ;!¯Í'a*§îù}J Lý¢ áŸ­vêñ„›– K*^ùµ…(m“¨‚ü~ È90Ã)ð/‘™\Ö¿Ðí¡mfaÉMQnÓ¸}}¥×✄ú&Jˆ€A_þYß2d™—䑉Ž»¨éV)óóykE=æ2•N«:`Ѩ¥küœëÛÐJÉØØª-g4O§ ,’¯œ¢Ø uÛž9ví¸?¼ÔPž‘Ÿ,Òõ½Ü=ËoG䨪ÝCr¦˜‘°ŸåWTžÔP²ÛgÕŒ&.÷Ô> 7ú» úb¤=Ò:\—á„>&"4í”»_bŸAû¾yª›s„ŠS&‘V:oHs¦u—Ž ÷LÇ~´¯}ëvvß«×ÂÌ‹ 8œ~ón}ñOüù/‹%ºaendstream endobj 6 0 obj 3035 endobj 14 0 obj <> stream xœuVÛŽÛ6}÷WL󹈑ºE^6ÅIÚnTôaÓZ¢×ìêâPÔ:þ‡ýèÎ’l'-Œµ j83gæÌ™ý!ãÒgzVíêõ]Ã*„‡Õ§w/azT-üX¢ANånåïpÈdEÄòÊvÅS¿(«ÀŒUƒØ¡ùðk˜àË7ëòŸU”Âÿʃãíû`ó´Þˆ,Í‚›NnOkž°0Ì¢@™m?(èG{-ƒ%h{£ÀîeµÚ­ V"Í96–­ÿ.ÅÔXåÛ:®à»j4Í÷ë—.,6øÝô”X9b£\X.ŸÏ“®H8H»Ûã¯jlßy‚­î¤9Ñ9bƒã^u”oÌŠ<‰1_½;éî²³ø¥`PÆÃáqН]E:²ˆAwµRµËy3'3å8•¦ P'?1aÍȃŸ;lЃ æTÞ¶áT+ÇÜc >+ÂÒyÁD^ä±qT£uµ×ó´]óÂÇuSƒ5J±Ùo$ rðú®@~0¢Ànµ"a&ïJ‘îþ\"!ú8S™ƒ÷ïoßÿå͇òYœY&B–p¤ØÜ¤w²#Á’0snrÆóÉÉžý‡%ãsC2GR:þí%™-Å)Ëâ´˜M£Éô Kwv—2}í®ïjmuß ¾·-R¶ ZEg¤ò½ª$r¶BzCž;Å Ü«+,"IÏâËEpΊ‹Ã0õÁGlB­ª«¡ï°;hŸæ¬Èò¹Ø&»Ñ®b›8ÌX’,LbaìÇt§¤¨ÉÞ:¶ô–ã~©ÎÎèÊHK\NƒU-Ùª/ʲ8M¦žfŒqúëôZ$1Kò(謣’Œ]O-€cx¯M½9HcO”©‘F«©ð.ëVž0—‹(0¬êåÜô¾ë-ŒÒ–jËxÁÝ›rnÒP}@w{U9IÁ£~G¸±wÛh;¨fGc^+«L«;å‡]»iäN9m°Xt3É’ÕÞ¹g(8® ÙTœrBvîÎ9_†Âçgý¸×xyC™#µÈa=º04é8ÅBR7ª£>Ú¨»5ÀQ7 º=4'º6<êÃm$r¥ÑØ8ü鵨êÑF‰ ªl¯–‚´’³ÈçQ~{,,Øz“F)K±k· }«`ìÆa” zëžFbÅ«3ûçÂz­|tQpm¤Ž¢àØå©*Ê^2?Ì“‰ù”ÍDJÛUÙ¥."àÈ9TÒ(Œ‹Eß#óØÝö»nÝ\D+¢l™­b¶q-wh=ŠƒéQ [ Sßb4Ë•/ñ ^|óx= Öª˜Áæw_CpìÏÀ1w^Ì—LýÂÅ™§ê¾©Ï¸'T”§0ZÖÄ} ¤i´2ë„vLR^¦¯ÅÙ­¾I™ý€üuw[þŸ÷$ŽfynÒØ8ŠQ‡nç†" ¤[„G£í…ô nõ0Xœ_d'nQI—u#I@Ünqð¹éêˆ÷^á@]¯­w]”%K³|"¤ÔÚõ:š–‹HÅ\={<—Õ›„W@ŸL§fÂÅÂÍ“¥bnMwµ¹¸àg'Â9Û­24_¾#yÎr^\ %©õ?´%´“‡gëÖ€Q/'•ô«Ëý;5I$Ö@ÄTZ”Hy!‘5b!ÈYpff|±xžq‹ãp g!w$~ýæöíÍ›ßîÞý0±×9ϱé,Rl¾‰£7=lâ<žVúO¤¼CÅ/ Üyˆ7—åÓp®©Ú‚¹¿å,žÇ@ÐÉM¹ú?ÿXìendstream endobj 15 0 obj 1352 endobj 4 0 obj <> /Contents 5 0 R >> endobj 13 0 obj <> /Contents 14 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 13 0 R ] /Count 2 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 11 0 obj <> endobj 12 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <> endobj 10 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <> endobj 18 0 obj <> endobj 19 0 obj <>stream 2014-01-29T08:09:50+01:00 2014-01-29T08:09:50+01:00 groff version 1.22.2 Untitled endstream endobj 2 0 obj <>endobj xref 0 20 0000000000 65535 f 0000004973 00000 n 0000006932 00000 n 0000004907 00000 n 0000004585 00000 n 0000000015 00000 n 0000003120 00000 n 0000005038 00000 n 0000005361 00000 n 0000005296 00000 n 0000005228 00000 n 0000005079 00000 n 0000005109 00000 n 0000004745 00000 n 0000003140 00000 n 0000004564 00000 n 0000005159 00000 n 0000005189 00000 n 0000005443 00000 n 0000005509 00000 n trailer << /Size 20 /Root 1 0 R /Info 2 0 R /ID [<0077119BC61BE283EB881243D23E1B80><0077119BC61BE283EB881243D23E1B80>] >> startxref 7086 %%EOF curl-7.35.0/tests/http_pipe.py0000755000175000017500000003353412271241025013213 00000000000000#!/usr/bin/python # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # Modified by Linus Nielsen Feltzing for inclusion in the libcurl test # framework # import SocketServer import argparse import re import select import socket import time import pprint import os INFO_MESSAGE = ''' This is a test server to test the libcurl pipelining functionality. It is a modified version if Google's HTTP pipelining test server. More information can be found here: http://dev.chromium.org/developers/design-documents/network-stack/http-pipelining Source code can be found here: http://code.google.com/p/http-pipelining-test/ ''' MAX_REQUEST_SIZE = 1024 # bytes MIN_POLL_TIME = 0.01 # seconds. Minimum time to poll, in order to prevent # excessive looping because Python refuses to poll for # small timeouts. SEND_BUFFER_TIME = 0.5 # seconds TIMEOUT = 30 # seconds class Error(Exception): pass class RequestTooLargeError(Error): pass class ServeIndexError(Error): pass class UnexpectedMethodError(Error): pass class RequestParser(object): """Parses an input buffer looking for HTTP GET requests.""" global logfile LOOKING_FOR_GET = 1 READING_HEADERS = 2 HEADER_RE = re.compile('([^:]+):(.*)\n') REQUEST_RE = re.compile('([^ ]+) ([^ ]+) HTTP/(\d+)\.(\d+)\n') def __init__(self): """Initializer.""" self._buffer = "" self._pending_headers = {} self._pending_request = "" self._state = self.LOOKING_FOR_GET self._were_all_requests_http_1_1 = True self._valid_requests = [] def ParseAdditionalData(self, data): """Finds HTTP requests in |data|. Args: data: (String) Newly received input data from the socket. Returns: (List of Tuples) (String) The request path. (Map of String to String) The header name and value. Raises: RequestTooLargeError: If the request exceeds MAX_REQUEST_SIZE. UnexpectedMethodError: On a non-GET method. Error: On a programming error. """ logfile = open('log/server.input', 'a') logfile.write(data) logfile.close() self._buffer += data.replace('\r', '') should_continue_parsing = True while should_continue_parsing: if self._state == self.LOOKING_FOR_GET: should_continue_parsing = self._DoLookForGet() elif self._state == self.READING_HEADERS: should_continue_parsing = self._DoReadHeader() else: raise Error('Unexpected state: ' + self._state) if len(self._buffer) > MAX_REQUEST_SIZE: raise RequestTooLargeError( 'Request is at least %d bytes' % len(self._buffer)) valid_requests = self._valid_requests self._valid_requests = [] return valid_requests @property def were_all_requests_http_1_1(self): return self._were_all_requests_http_1_1 def _DoLookForGet(self): """Tries to parse an HTTTP request line. Returns: (Boolean) True if a request was found. Raises: UnexpectedMethodError: On a non-GET method. """ m = self.REQUEST_RE.match(self._buffer) if not m: return False method, path, http_major, http_minor = m.groups() if method != 'GET': raise UnexpectedMethodError('Unexpected method: ' + method) if path in ['/', '/index.htm', '/index.html']: raise ServeIndexError() if http_major != '1' or http_minor != '1': self._were_all_requests_http_1_1 = False # print method, path self._pending_request = path self._buffer = self._buffer[m.end():] self._state = self.READING_HEADERS return True def _DoReadHeader(self): """Tries to parse a HTTP header. Returns: (Boolean) True if it found the end of the request or a HTTP header. """ if self._buffer.startswith('\n'): self._buffer = self._buffer[1:] self._state = self.LOOKING_FOR_GET self._valid_requests.append((self._pending_request, self._pending_headers)) self._pending_headers = {} self._pending_request = "" return True m = self.HEADER_RE.match(self._buffer) if not m: return False header = m.group(1).lower() value = m.group(2).strip().lower() if header not in self._pending_headers: self._pending_headers[header] = value self._buffer = self._buffer[m.end():] return True class ResponseBuilder(object): """Builds HTTP responses for a list of accumulated requests.""" def __init__(self): """Initializer.""" self._max_pipeline_depth = 0 self._requested_paths = [] self._processed_end = False self._were_all_requests_http_1_1 = True def QueueRequests(self, requested_paths, were_all_requests_http_1_1): """Adds requests to the queue of requests. Args: requested_paths: (List of Strings) Requested paths. """ self._requested_paths.extend(requested_paths) self._were_all_requests_http_1_1 = were_all_requests_http_1_1 def Chunkify(self, data, chunksize): """ Divides a string into chunks """ return [hex(chunksize)[2:] + "\r\n" + data[i:i+chunksize] + "\r\n" for i in range(0, len(data), chunksize)] def BuildResponses(self): """Converts the queue of requests into responses. Returns: (String) Buffer containing all of the responses. """ result = "" self._max_pipeline_depth = max(self._max_pipeline_depth, len(self._requested_paths)) for path, headers in self._requested_paths: if path == '/verifiedserver': body = "WE ROOLZ: {}\r\n".format(os.getpid()); result += self._BuildResponse( '200 OK', ['Server: Apache', 'Content-Length: {}'.format(len(body)), 'Cache-Control: no-store'], body) elif path == '/alphabet.txt': body = 'abcdefghijklmnopqrstuvwxyz' result += self._BuildResponse( '200 OK', ['Server: Apache', 'Content-Length: 26', 'Cache-Control: no-store'], body) elif path == '/reverse.txt': body = 'zyxwvutsrqponmlkjihgfedcba' result += self._BuildResponse( '200 OK', ['Content-Length: 26', 'Cache-Control: no-store'], body) elif path == '/chunked.txt': body = ('7\r\nchunked\r\n' '8\r\nencoding\r\n' '2\r\nis\r\n' '3\r\nfun\r\n' '0\r\n\r\n') result += self._BuildResponse( '200 OK', ['Transfer-Encoding: chunked', 'Cache-Control: no-store'], body) elif path == '/cached.txt': body = 'azbycxdwevfugthsirjqkplomn' result += self._BuildResponse( '200 OK', ['Content-Length: 26', 'Cache-Control: max-age=60'], body) elif path == '/connection_close.txt': body = 'azbycxdwevfugthsirjqkplomn' result += self._BuildResponse( '200 OK', ['Content-Length: 26', 'Cache-Control: max-age=60', 'Connection: close'], body) self._processed_end = True elif path == '/1k.txt': str = '0123456789abcdef' body = ''.join([str for num in xrange(64)]) result += self._BuildResponse( '200 OK', ['Server: Apache', 'Content-Length: 1024', 'Cache-Control: max-age=60'], body) elif path == '/10k.txt': str = '0123456789abcdef' body = ''.join([str for num in xrange(640)]) result += self._BuildResponse( '200 OK', ['Server: Apache', 'Content-Length: 10240', 'Cache-Control: max-age=60'], body) elif path == '/100k.txt': str = '0123456789abcdef' body = ''.join([str for num in xrange(6400)]) result += self._BuildResponse( '200 OK', ['Server: Apache', 'Content-Length: 102400', 'Cache-Control: max-age=60'], body) elif path == '/100k_chunked.txt': str = '0123456789abcdef' moo = ''.join([str for num in xrange(6400)]) body = self.Chunkify(moo, 20480) body.append('0\r\n\r\n') body = ''.join(body) result += self._BuildResponse( '200 OK', ['Transfer-Encoding: chunked', 'Cache-Control: no-store'], body) elif path == '/stats.txt': results = { 'max_pipeline_depth': self._max_pipeline_depth, 'were_all_requests_http_1_1': int(self._were_all_requests_http_1_1), } body = ','.join(['%s:%s' % (k, v) for k, v in results.items()]) result += self._BuildResponse( '200 OK', ['Content-Length: %s' % len(body), 'Cache-Control: no-store'], body) self._processed_end = True else: result += self._BuildResponse('404 Not Found', ['Content-Length: 7'], 'Go away') if self._processed_end: break self._requested_paths = [] return result def WriteError(self, status, error): """Returns an HTTP response for the specified error. Args: status: (String) Response code and descrtion (e.g. "404 Not Found") Returns: (String) Text of HTTP response. """ return self._BuildResponse( status, ['Connection: close', 'Content-Type: text/plain'], error) @property def processed_end(self): return self._processed_end def _BuildResponse(self, status, headers, body): """Builds an HTTP response. Args: status: (String) Response code and descrtion (e.g. "200 OK") headers: (List of Strings) Headers (e.g. "Connection: close") body: (String) Response body. Returns: (String) Text of HTTP response. """ return ('HTTP/1.1 %s\r\n' '%s\r\n' '\r\n' '%s' % (status, '\r\n'.join(headers), body)) class PipelineRequestHandler(SocketServer.BaseRequestHandler): """Called on an incoming TCP connection.""" def _GetTimeUntilTimeout(self): return self._start_time + TIMEOUT - time.time() def _GetTimeUntilNextSend(self): if not self._last_queued_time: return TIMEOUT return self._last_queued_time + SEND_BUFFER_TIME - time.time() def handle(self): self._request_parser = RequestParser() self._response_builder = ResponseBuilder() self._last_queued_time = 0 self._num_queued = 0 self._num_written = 0 self._send_buffer = "" self._start_time = time.time() try: while not self._response_builder.processed_end or self._send_buffer: time_left = self._GetTimeUntilTimeout() time_until_next_send = self._GetTimeUntilNextSend() max_poll_time = min(time_left, time_until_next_send) + MIN_POLL_TIME rlist, wlist, xlist = [], [], [] fileno = self.request.fileno() if max_poll_time > 0: rlist.append(fileno) if self._send_buffer: wlist.append(fileno) rlist, wlist, xlist = select.select(rlist, wlist, xlist, max_poll_time) if self._GetTimeUntilTimeout() <= 0: return if self._GetTimeUntilNextSend() <= 0: self._send_buffer += self._response_builder.BuildResponses() self._num_written = self._num_queued self._last_queued_time = 0 if fileno in rlist: self.request.setblocking(False) new_data = self.request.recv(MAX_REQUEST_SIZE) self.request.setblocking(True) if not new_data: return new_requests = self._request_parser.ParseAdditionalData(new_data) self._response_builder.QueueRequests( new_requests, self._request_parser.were_all_requests_http_1_1) self._num_queued += len(new_requests) self._last_queued_time = time.time() elif fileno in wlist: num_bytes_sent = self.request.send(self._send_buffer[0:4096]) self._send_buffer = self._send_buffer[num_bytes_sent:] time.sleep(0.05) except RequestTooLargeError as e: self.request.send(self._response_builder.WriteError( '413 Request Entity Too Large', e)) raise except UnexpectedMethodError as e: self.request.send(self._response_builder.WriteError( '405 Method Not Allowed', e)) raise except ServeIndexError: self.request.send(self._response_builder.WriteError( '200 OK', INFO_MESSAGE)) except Exception as e: print e self.request.close() class PipelineServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer): pass parser = argparse.ArgumentParser() parser.add_argument("--port", action="store", default=0, type=int, help="port to listen on") parser.add_argument("--verbose", action="store", default=0, type=int, help="verbose output") parser.add_argument("--pidfile", action="store", default=0, help="file name for the PID") parser.add_argument("--logfile", action="store", default=0, help="file name for the log") parser.add_argument("--srcdir", action="store", default=0, help="test directory") parser.add_argument("--id", action="store", default=0, help="server ID") parser.add_argument("--ipv4", action="store_true", default=0, help="IPv4 flag") args = parser.parse_args() if args.pidfile: pid = os.getpid() f = open(args.pidfile, 'w') f.write('{}'.format(pid)) f.close() server = PipelineServer(('0.0.0.0', args.port), PipelineRequestHandler) server.allow_reuse_address = True server.serve_forever() curl-7.35.0/tests/runtests.pl0000755000175000017500000047327512271241025013103 00000000000000#!/usr/bin/env perl #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2014, 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. # ########################################################################### # Experimental hooks are available to run tests remotely on machines that # are able to run curl but are unable to run the test harness. # The following sections need to be modified: # # $HOSTIP, $HOST6IP - Set to the address of the host running the test suite # $CLIENTIP, $CLIENT6IP - Set to the address of the host running curl # runclient, runclientoutput - Modify to copy all the files in the log/ # directory to the system running curl, run the given command remotely # and save the return code or returned stdout (respectively), then # copy all the files from the remote system's log/ directory back to # the host running the test suite. This can be done a few ways, such # as using scp & ssh, rsync & telnet, or using a NFS shared directory # and ssh. # # 'make && make test' needs to be done on both machines before making the # above changes and running runtests.pl manually. In the shared NFS case, # the contents of the tests/server/ directory must be from the host # running the test suite, while the rest must be from the host running curl. # # Note that even with these changes a number of tests will still fail (mainly # to do with cookies, those that set environment variables, or those that # do more than touch the file system in a or # section). These can be added to the $TESTCASES line below, # e.g. $TESTCASES="!8 !31 !63 !cookies..." # # Finally, to properly support -g and -n, checktestcmd needs to change # to check the remote system's PATH, and the places in the code where # the curl binary is read directly to determine its type also need to be # fixed. As long as the -g option is never given, and the -n is always # given, this won't be a problem. # These should be the only variables that might be needed to get edited: BEGIN { push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'}); push(@INC, "."); # run time statistics needs Time::HiRes eval { no warnings "all"; require Time::HiRes; import Time::HiRes qw( time ); } } use strict; use warnings; use Cwd; # Subs imported from serverhelp module use serverhelp qw( serverfactors servername_id servername_str servername_canon server_pidfilename server_logfilename ); # Variables and subs imported from sshhelp module use sshhelp qw( $sshdexe $sshexe $sftpexe $sshconfig $sftpconfig $sshdlog $sshlog $sftplog $sftpcmds display_sshdconfig display_sshconfig display_sftpconfig display_sshdlog display_sshlog display_sftplog exe_ext find_sshd find_ssh find_sftp find_httptlssrv sshversioninfo ); require "getpart.pm"; # array functions require "valgrind.pm"; # valgrind report parser require "ftp.pm"; my $HOSTIP="127.0.0.1"; # address on which the test server listens my $HOST6IP="[::1]"; # address on which the test server listens my $CLIENTIP="127.0.0.1"; # address which curl uses for incoming connections my $CLIENT6IP="[::1]"; # address which curl uses for incoming connections my $base = 8990; # base port number my $HTTPPORT; # HTTP server port my $HTTP6PORT; # HTTP IPv6 server port my $HTTPSPORT; # HTTPS (stunnel) server port my $FTPPORT; # FTP server port my $FTP2PORT; # FTP server 2 port my $FTPSPORT; # FTPS (stunnel) server port my $FTP6PORT; # FTP IPv6 server port my $TFTPPORT; # TFTP my $TFTP6PORT; # TFTP my $SSHPORT; # SCP/SFTP my $SOCKSPORT; # SOCKS4/5 port my $POP3PORT; # POP3 my $POP36PORT; # POP3 IPv6 server port my $IMAPPORT; # IMAP my $IMAP6PORT; # IMAP IPv6 server port my $SMTPPORT; # SMTP my $SMTP6PORT; # SMTP IPv6 server port my $RTSPPORT; # RTSP my $RTSP6PORT; # RTSP IPv6 server port my $GOPHERPORT; # Gopher my $GOPHER6PORT; # Gopher IPv6 server port my $HTTPTLSPORT; # HTTP TLS (non-stunnel) server port my $HTTPTLS6PORT; # HTTP TLS (non-stunnel) IPv6 server port my $HTTPPROXYPORT; # HTTP proxy port, when using CONNECT my $HTTPPIPEPORT; # HTTP pipelining port my $srcdir = $ENV{'srcdir'} || '.'; my $CURL="../src/curl".exe_ext(); # what curl executable to run on the tests my $VCURL=$CURL; # what curl binary to use to verify the servers with # VCURL is handy to set to the system one when the one you # just built hangs or crashes and thus prevent verification my $DBGCURL=$CURL; #"../src/.libs/curl"; # alternative for debugging my $LOGDIR="log"; my $TESTDIR="$srcdir/data"; my $LIBDIR="./libtest"; my $UNITDIR="./unit"; # TODO: change this to use server_inputfilename() my $SERVERIN="$LOGDIR/server.input"; # what curl sent the server my $SERVER2IN="$LOGDIR/server2.input"; # what curl sent the second server my $PROXYIN="$LOGDIR/proxy.input"; # what curl sent the proxy my $CURLLOG="$LOGDIR/curl.log"; # all command lines run my $FTPDCMD="$LOGDIR/ftpserver.cmd"; # copy ftp server instructions here my $SERVERLOGS_LOCK="$LOGDIR/serverlogs.lock"; # server logs advisor read lock my $CURLCONFIG="../curl-config"; # curl-config from current build # Normally, all test cases should be run, but at times it is handy to # simply run a particular one: my $TESTCASES="all"; # To run specific test cases, set them like: # $TESTCASES="1 2 3 7 8"; ####################################################################### # No variables below this point should need to be modified # # invoke perl like this: my $perl="perl -I$srcdir"; my $server_response_maxtime=13; my $debug_build=0; # built debug enabled (--enable-debug) my $has_memory_tracking=0; # built with memory tracking (--enable-curldebug) my $libtool; # name of the file that the memory debugging creates: my $memdump="$LOGDIR/memdump"; # the path to the script that analyzes the memory debug output file: my $memanalyze="$perl $srcdir/memanalyze.pl"; my $pwd = getcwd(); # current working directory my $start; my $ftpchecktime=1; # time it took to verify our test FTP server my $stunnel = checkcmd("stunnel4") || checkcmd("tstunnel") || checkcmd("stunnel"); my $valgrind = checktestcmd("valgrind"); my $valgrind_logfile="--logfile"; my $valgrind_tool; my $gdb = checktestcmd("gdb"); my $httptlssrv = find_httptlssrv(); my $ssl_version; # set if libcurl is built with SSL support my $large_file; # set if libcurl is built with large file support my $has_idn; # set if libcurl is built with IDN support my $http_ipv6; # set if HTTP server has IPv6 support my $ftp_ipv6; # set if FTP server has IPv6 support my $tftp_ipv6; # set if TFTP server has IPv6 support my $gopher_ipv6; # set if Gopher server has IPv6 support my $has_ipv6; # set if libcurl is built with IPv6 support my $has_libz; # set if libcurl is built with libz support my $has_getrlimit; # set if system has getrlimit() my $has_ntlm; # set if libcurl is built with NTLM support my $has_ntlm_wb; # set if libcurl is built with NTLM delegation to winbind my $has_sspi; # set if libcurl is built with SSPI support my $has_charconv;# set if libcurl is built with CharConv support my $has_tls_srp; # set if libcurl is built with TLS-SRP support my $has_metalink;# set if curl is built with Metalink support my $has_openssl; # built with a lib using an OpenSSL-like API my $has_gnutls; # built with GnuTLS my $has_nss; # built with NSS my $has_yassl; # built with yassl my $has_polarssl; # built with polarssl my $has_axtls; # built with axTLS my $has_winssl; # built with WinSSL (Secure Channel aka Schannel) my $has_darwinssl;# build with DarwinSSL (Secure Transport) my $has_shared = "unknown"; # built shared my $resolver; # string to hold the resolver backend my $has_cares; # if built with c-ares my $has_threadedres; # if built with threaded resolver my $ssllib; # name of the lib we use (for human presentation) my $has_crypto; # set if libcurl is built with cryptographic support my $has_textaware; # set if running on a system that has a text mode concept # on files. Windows for example my @protocols; # array of lowercase supported protocol servers my $skipped=0; # number of tests skipped; reported in main loop my %skipped; # skipped{reason}=counter, reasons for skip my @teststat; # teststat[testnum]=reason, reasons for skip my %disabled_keywords; # key words of tests to skip my %enabled_keywords; # key words of tests to run my %disabled; # disabled test cases my $sshdid; # for socks server, ssh daemon version id my $sshdvernum; # for socks server, ssh daemon version number my $sshdverstr; # for socks server, ssh daemon version string my $sshderror; # for socks server, ssh daemon version error my $defserverlogslocktimeout = 20; # timeout to await server logs lock removal my $defpostcommanddelay = 0; # delay between command and postcheck sections my $timestats; # time stamping and stats generation my $fullstats; # show time stats for every single test my %timeprepini; # timestamp for each test preparation start my %timesrvrini; # timestamp for each test required servers verification start my %timesrvrend; # timestamp for each test required servers verification end my %timetoolini; # timestamp for each test command run starting my %timetoolend; # timestamp for each test command run stopping my %timesrvrlog; # timestamp for each test server logs lock removal my %timevrfyend; # timestamp for each test result verification end my $testnumcheck; # test number, set in singletest sub. my %oldenv; ####################################################################### # variables that command line options may set # my $short; my $automakestyle; my $verbose; my $debugprotocol; my $anyway; my $gdbthis; # run test case with gdb debugger my $gdbxwin; # use windowed gdb when using gdb my $keepoutfiles; # keep stdout and stderr files after tests my $listonly; # only list the tests my $postmortem; # display detailed info about failed tests my $run_event_based; # run curl with --test-event to test the event API my %run; # running server my %doesntrun; # servers that don't work, identified by pidfile my %serverpidfile;# all server pid file names, identified by server id my %runcert; # cert file currently in use by an ssl running server # torture test variables my $torture; my $tortnum; my $tortalloc; ####################################################################### # logmsg is our general message logging subroutine. # sub logmsg { for(@_) { print "$_"; } } # get the name of the current user my $USER = $ENV{USER}; # Linux if (!$USER) { $USER = $ENV{USERNAME}; # Windows if (!$USER) { $USER = $ENV{LOGNAME}; # Some UNIX (I think) } } # enable memory debugging if curl is compiled with it $ENV{'CURL_MEMDEBUG'} = $memdump; $ENV{'HOME'}=$pwd; sub catch_zap { my $signame = shift; logmsg "runtests.pl received SIG$signame, exiting\n"; stopservers($verbose); die "Somebody sent me a SIG$signame"; } $SIG{INT} = \&catch_zap; $SIG{TERM} = \&catch_zap; ########################################################################## # Clear all possible '*_proxy' environment variables for various protocols # to prevent them to interfere with our testing! my $protocol; foreach $protocol (('ftp', 'http', 'ftps', 'https', 'no', 'all')) { my $proxy = "${protocol}_proxy"; # clear lowercase version delete $ENV{$proxy} if($ENV{$proxy}); # clear uppercase version delete $ENV{uc($proxy)} if($ENV{uc($proxy)}); } # make sure we don't get affected by other variables that control our # behaviour delete $ENV{'SSL_CERT_DIR'} if($ENV{'SSL_CERT_DIR'}); delete $ENV{'SSL_CERT_PATH'} if($ENV{'SSL_CERT_PATH'}); delete $ENV{'CURL_CA_BUNDLE'} if($ENV{'CURL_CA_BUNDLE'}); ####################################################################### # Load serverpidfile hash with pidfile names for all possible servers. # sub init_serverpidfile_hash { for my $proto (('ftp', 'http', 'imap', 'pop3', 'smtp', 'http')) { for my $ssl (('', 's')) { for my $ipvnum ((4, 6)) { for my $idnum ((1, 2, 3)) { my $serv = servername_id("$proto$ssl", $ipvnum, $idnum); my $pidf = server_pidfilename("$proto$ssl", $ipvnum, $idnum); $serverpidfile{$serv} = $pidf; } } } } for my $proto (('tftp', 'sftp', 'socks', 'ssh', 'rtsp', 'gopher', 'httptls')) { for my $ipvnum ((4, 6)) { for my $idnum ((1, 2)) { my $serv = servername_id($proto, $ipvnum, $idnum); my $pidf = server_pidfilename($proto, $ipvnum, $idnum); $serverpidfile{$serv} = $pidf; } } } } ####################################################################### # Check if a given child process has just died. Reaps it if so. # sub checkdied { use POSIX ":sys_wait_h"; my $pid = $_[0]; if(not defined $pid || $pid <= 0) { return 0; } my $rc = waitpid($pid, &WNOHANG); return ($rc == $pid)?1:0; } ####################################################################### # Start a new thread/process and run the given command line in there. # Return the pids (yes plural) of the new child process to the parent. # sub startnew { my ($cmd, $pidfile, $timeout, $fake)=@_; logmsg "startnew: $cmd\n" if ($verbose); my $child = fork(); my $pid2 = 0; if(not defined $child) { logmsg "startnew: fork() failure detected\n"; return (-1,-1); } if(0 == $child) { # Here we are the child. Run the given command. # Put an "exec" in front of the command so that the child process # keeps this child's process ID. exec("exec $cmd") || die "Can't exec() $cmd: $!"; # exec() should never return back here to this process. We protect # ourselves by calling die() just in case something goes really bad. die "error: exec() has returned"; } # Ugly hack but ssh client and gnutls-serv don't support pid files if ($fake) { if(open(OUT, ">$pidfile")) { print OUT $child . "\n"; close(OUT); logmsg "startnew: $pidfile faked with pid=$child\n" if($verbose); } else { logmsg "startnew: failed to write fake $pidfile with pid=$child\n"; } # could/should do a while connect fails sleep a bit and loop sleep $timeout; if (checkdied($child)) { logmsg "startnew: child process has failed to start\n" if($verbose); return (-1,-1); } } my $count = $timeout; while($count--) { if(-f $pidfile && -s $pidfile && open(PID, "<$pidfile")) { $pid2 = 0 + ; close(PID); if(($pid2 > 0) && pidexists($pid2)) { # if $pid2 is valid, then make sure this pid is alive, as # otherwise it is just likely to be the _previous_ pidfile or # similar! last; } # invalidate $pid2 if not actually alive $pid2 = 0; } if (checkdied($child)) { logmsg "startnew: child process has died, server might start up\n" if($verbose); # We can't just abort waiting for the server with a # return (-1,-1); # because the server might have forked and could still start # up normally. Instead, just reduce the amount of time we remain # waiting. $count >>= 2; } sleep(1); } # Return two PIDs, the one for the child process we spawned and the one # reported by the server itself (in case it forked again on its own). # Both (potentially) need to be killed at the end of the test. return ($child, $pid2); } ####################################################################### # Check for a command in the PATH of the test server. # sub checkcmd { my ($cmd)=@_; my @paths=(split(":", $ENV{'PATH'}), "/usr/sbin", "/usr/local/sbin", "/sbin", "/usr/bin", "/usr/local/bin", "./libtest/.libs", "./libtest"); for(@paths) { if( -x "$_/$cmd" && ! -d "$_/$cmd") { # executable bit but not a directory! return "$_/$cmd"; } } } ####################################################################### # Get the list of tests that the tests/data/Makefile.am knows about! # my $disttests; sub get_disttests { my @dist = `cd data && make show`; $disttests = join("", @dist); } ####################################################################### # Check for a command in the PATH of the machine running curl. # sub checktestcmd { my ($cmd)=@_; return checkcmd($cmd); } ####################################################################### # Run the application under test and return its return code # sub runclient { my ($cmd)=@_; my $ret = system($cmd); print "CMD ($ret): $cmd\n" if($verbose && !$torture); return $ret; # This is one way to test curl on a remote machine # my $out = system("ssh $CLIENTIP cd \'$pwd\' \\; \'$cmd\'"); # sleep 2; # time to allow the NFS server to be updated # return $out; } ####################################################################### # Run the application under test and return its stdout # sub runclientoutput { my ($cmd)=@_; return `$cmd`; # This is one way to test curl on a remote machine # my @out = `ssh $CLIENTIP cd \'$pwd\' \\; \'$cmd\'`; # sleep 2; # time to allow the NFS server to be updated # return @out; } ####################################################################### # Memory allocation test and failure torture testing. # sub torture { my $testcmd = shift; my $gdbline = shift; # remove memdump first to be sure we get a new nice and clean one unlink($memdump); # First get URL from test server, ignore the output/result runclient($testcmd); logmsg " CMD: $testcmd\n" if($verbose); # memanalyze -v is our friend, get the number of allocations made my $count=0; my @out = `$memanalyze -v $memdump`; for(@out) { if(/^Allocations: (\d+)/) { $count = $1; last; } } if(!$count) { logmsg " found no allocs to make fail\n"; return 0; } logmsg " $count allocations to make fail\n"; for ( 1 .. $count ) { my $limit = $_; my $fail; my $dumped_core; if($tortalloc && ($tortalloc != $limit)) { next; } if($verbose) { my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()); my $now = sprintf("%02d:%02d:%02d ", $hour, $min, $sec); logmsg "Fail alloc no: $limit at $now\r"; } # make the memory allocation function number $limit return failure $ENV{'CURL_MEMLIMIT'} = $limit; # remove memdump first to be sure we get a new nice and clean one unlink($memdump); logmsg "*** Alloc number $limit is now set to fail ***\n" if($gdbthis); my $ret = 0; if($gdbthis) { runclient($gdbline) } else { $ret = runclient($testcmd); } #logmsg "$_ Returned " . $ret >> 8 . "\n"; # Now clear the variable again delete $ENV{'CURL_MEMLIMIT'} if($ENV{'CURL_MEMLIMIT'}); if(-r "core") { # there's core file present now! logmsg " core dumped\n"; $dumped_core = 1; $fail = 2; } # verify that it returns a proper error code, doesn't leak memory # and doesn't core dump if($ret & 255) { logmsg " system() returned $ret\n"; $fail=1; } else { my @memdata=`$memanalyze $memdump`; my $leak=0; for(@memdata) { if($_ ne "") { # well it could be other memory problems as well, but # we call it leak for short here $leak=1; } } if($leak) { logmsg "** MEMORY FAILURE\n"; logmsg @memdata; logmsg `$memanalyze -l $memdump`; $fail = 1; } } if($fail) { logmsg " Failed on alloc number $limit in test.\n", " invoke with \"-t$limit\" to repeat this single case.\n"; stopservers($verbose); return 1; } } logmsg "torture OK\n"; return 0; } ####################################################################### # Stop a test server along with pids which aren't in the %run hash yet. # This also stops all servers which are relative to the given one. # sub stopserver { my ($server, $pidlist) = @_; # # kill sockfilter processes for pingpong relative server # if($server =~ /^(ftp|imap|pop3|smtp)s?(\d*)(-ipv6|)$/) { my $proto = $1; my $idnum = ($2 && ($2 > 1)) ? $2 : 1; my $ipvnum = ($3 && ($3 =~ /6$/)) ? 6 : 4; killsockfilters($proto, $ipvnum, $idnum, $verbose); } # # All servers relative to the given one must be stopped also # my @killservers; if($server =~ /^(ftp|http|imap|pop3|smtp|httppipe)s((\d*)(-ipv6|))$/) { # given a stunnel based ssl server, also kill non-ssl underlying one push @killservers, "${1}${2}"; } elsif($server =~ /^(ftp|http|imap|pop3|smtp|httppipe)((\d*)(-ipv6|))$/) { # given a non-ssl server, also kill stunnel based ssl piggybacking one push @killservers, "${1}s${2}"; } elsif($server =~ /^(socks)((\d*)(-ipv6|))$/) { # given a socks server, also kill ssh underlying one push @killservers, "ssh${2}"; } elsif($server =~ /^(ssh)((\d*)(-ipv6|))$/) { # given a ssh server, also kill socks piggybacking one push @killservers, "socks${2}"; } push @killservers, $server; # # kill given pids and server relative ones clearing them in %run hash # foreach my $server (@killservers) { if($run{$server}) { # we must prepend a space since $pidlist may already contain a pid $pidlist .= " $run{$server}"; $run{$server} = 0; } $runcert{$server} = 0 if($runcert{$server}); } killpid($verbose, $pidlist); # # cleanup server pid files # foreach my $server (@killservers) { my $pidfile = $serverpidfile{$server}; my $pid = processexists($pidfile); if($pid > 0) { logmsg "Warning: $server server unexpectedly alive\n"; killpid($verbose, $pid); } unlink($pidfile) if(-f $pidfile); } } ####################################################################### # Verify that the server that runs on $ip, $port is our server. This also # implies that we can speak with it, as there might be occasions when the # server runs fine but we cannot talk to it ("Failed to connect to ::1: Can't # assign requested address") # sub verifyhttp { my ($proto, $ipvnum, $idnum, $ip, $port) = @_; my $server = servername_id($proto, $ipvnum, $idnum); my $pid = 0; my $bonus=""; my $verifyout = "$LOGDIR/". servername_canon($proto, $ipvnum, $idnum) .'_verify.out'; unlink($verifyout) if(-f $verifyout); my $verifylog = "$LOGDIR/". servername_canon($proto, $ipvnum, $idnum) .'_verify.log'; unlink($verifylog) if(-f $verifylog); if($proto eq "gopher") { # gopher is funny $bonus="1/"; } my $flags = "--max-time $server_response_maxtime "; $flags .= "--output $verifyout "; $flags .= "--silent "; $flags .= "--verbose "; $flags .= "--globoff "; $flags .= "-1 " if($has_axtls); $flags .= "--insecure " if($proto eq 'https'); $flags .= "\"$proto://$ip:$port/${bonus}verifiedserver\""; my $cmd = "$VCURL $flags 2>$verifylog"; # verify if our/any server is running on this port logmsg "RUN: $cmd\n" if($verbose); my $res = runclient($cmd); $res >>= 8; # rotate the result if($res & 128) { logmsg "RUN: curl command died with a coredump\n"; return -1; } if($res && $verbose) { logmsg "RUN: curl command returned $res\n"; if(open(FILE, "<$verifylog")) { while(my $string = ) { logmsg "RUN: $string" if($string !~ /^([ \t]*)$/); } close(FILE); } } my $data; if(open(FILE, "<$verifyout")) { while(my $string = ) { $data = $string; last; # only want first line } close(FILE); } if($data && ($data =~ /WE ROOLZ: (\d+)/)) { $pid = 0+$1; } elsif($res == 6) { # curl: (6) Couldn't resolve host '::1' logmsg "RUN: failed to resolve host ($proto://$ip:$port/verifiedserver)\n"; return -1; } elsif($data || ($res && ($res != 7))) { logmsg "RUN: Unknown server on our $server port: $port ($res)\n"; return -1; } return $pid; } ####################################################################### # Verify that the server that runs on $ip, $port is our server. This also # implies that we can speak with it, as there might be occasions when the # server runs fine but we cannot talk to it ("Failed to connect to ::1: Can't # assign requested address") # sub verifyftp { my ($proto, $ipvnum, $idnum, $ip, $port) = @_; my $server = servername_id($proto, $ipvnum, $idnum); my $pid = 0; my $time=time(); my $extra=""; my $verifylog = "$LOGDIR/". servername_canon($proto, $ipvnum, $idnum) .'_verify.log'; unlink($verifylog) if(-f $verifylog); if($proto eq "ftps") { $extra .= "--insecure --ftp-ssl-control "; } my $flags = "--max-time $server_response_maxtime "; $flags .= "--silent "; $flags .= "--verbose "; $flags .= "--globoff "; $flags .= $extra; $flags .= "\"$proto://$ip:$port/verifiedserver\""; my $cmd = "$VCURL $flags 2>$verifylog"; # check if this is our server running on this port: logmsg "RUN: $cmd\n" if($verbose); my @data = runclientoutput($cmd); my $res = $? >> 8; # rotate the result if($res & 128) { logmsg "RUN: curl command died with a coredump\n"; return -1; } foreach my $line (@data) { if($line =~ /WE ROOLZ: (\d+)/) { # this is our test server with a known pid! $pid = 0+$1; last; } } if($pid <= 0 && @data && $data[0]) { # this is not a known server logmsg "RUN: Unknown server on our $server port: $port\n"; return 0; } # we can/should use the time it took to verify the FTP server as a measure # on how fast/slow this host/FTP is. my $took = int(0.5+time()-$time); if($verbose) { logmsg "RUN: Verifying our test $server server took $took seconds\n"; } $ftpchecktime = $took>=1?$took:1; # make sure it never is below 1 return $pid; } ####################################################################### # Verify that the server that runs on $ip, $port is our server. This also # implies that we can speak with it, as there might be occasions when the # server runs fine but we cannot talk to it ("Failed to connect to ::1: Can't # assign requested address") # sub verifyrtsp { my ($proto, $ipvnum, $idnum, $ip, $port) = @_; my $server = servername_id($proto, $ipvnum, $idnum); my $pid = 0; my $verifyout = "$LOGDIR/". servername_canon($proto, $ipvnum, $idnum) .'_verify.out'; unlink($verifyout) if(-f $verifyout); my $verifylog = "$LOGDIR/". servername_canon($proto, $ipvnum, $idnum) .'_verify.log'; unlink($verifylog) if(-f $verifylog); my $flags = "--max-time $server_response_maxtime "; $flags .= "--output $verifyout "; $flags .= "--silent "; $flags .= "--verbose "; $flags .= "--globoff "; # currently verification is done using http $flags .= "\"http://$ip:$port/verifiedserver\""; my $cmd = "$VCURL $flags 2>$verifylog"; # verify if our/any server is running on this port logmsg "RUN: $cmd\n" if($verbose); my $res = runclient($cmd); $res >>= 8; # rotate the result if($res & 128) { logmsg "RUN: curl command died with a coredump\n"; return -1; } if($res && $verbose) { logmsg "RUN: curl command returned $res\n"; if(open(FILE, "<$verifylog")) { while(my $string = ) { logmsg "RUN: $string" if($string !~ /^([ \t]*)$/); } close(FILE); } } my $data; if(open(FILE, "<$verifyout")) { while(my $string = ) { $data = $string; last; # only want first line } close(FILE); } if($data && ($data =~ /RTSP_SERVER WE ROOLZ: (\d+)/)) { $pid = 0+$1; } elsif($res == 6) { # curl: (6) Couldn't resolve host '::1' logmsg "RUN: failed to resolve host ($proto://$ip:$port/verifiedserver)\n"; return -1; } elsif($data || ($res != 7)) { logmsg "RUN: Unknown server on our $server port: $port\n"; return -1; } return $pid; } ####################################################################### # Verify that the ssh server has written out its pidfile, recovering # the pid from the file and returning it if a process with that pid is # actually alive. # sub verifyssh { my ($proto, $ipvnum, $idnum, $ip, $port) = @_; my $server = servername_id($proto, $ipvnum, $idnum); my $pidfile = server_pidfilename($proto, $ipvnum, $idnum); my $pid = 0; if(open(FILE, "<$pidfile")) { $pid=0+; close(FILE); } if($pid > 0) { # if we have a pid it is actually our ssh server, # since runsshserver() unlinks previous pidfile if(!pidexists($pid)) { logmsg "RUN: SSH server has died after starting up\n"; checkdied($pid); unlink($pidfile); $pid = -1; } } return $pid; } ####################################################################### # Verify that we can connect to the sftp server, properly authenticate # with generated config and key files and run a simple remote pwd. # sub verifysftp { my ($proto, $ipvnum, $idnum, $ip, $port) = @_; my $server = servername_id($proto, $ipvnum, $idnum); my $verified = 0; # Find out sftp client canonical file name my $sftp = find_sftp(); if(!$sftp) { logmsg "RUN: SFTP server cannot find $sftpexe\n"; return -1; } # Find out ssh client canonical file name my $ssh = find_ssh(); if(!$ssh) { logmsg "RUN: SFTP server cannot find $sshexe\n"; return -1; } # Connect to sftp server, authenticate and run a remote pwd # command using our generated configuration and key files my $cmd = "$sftp -b $sftpcmds -F $sftpconfig -S $ssh $ip > $sftplog 2>&1"; my $res = runclient($cmd); # Search for pwd command response in log file if(open(SFTPLOGFILE, "<$sftplog")) { while() { if(/^Remote working directory: /) { $verified = 1; last; } } close(SFTPLOGFILE); } return $verified; } ####################################################################### # Verify that the non-stunnel HTTP TLS extensions capable server that runs # on $ip, $port is our server. This also implies that we can speak with it, # as there might be occasions when the server runs fine but we cannot talk # to it ("Failed to connect to ::1: Can't assign requested address") # sub verifyhttptls { my ($proto, $ipvnum, $idnum, $ip, $port) = @_; my $server = servername_id($proto, $ipvnum, $idnum); my $pidfile = server_pidfilename($proto, $ipvnum, $idnum); my $pid = 0; my $verifyout = "$LOGDIR/". servername_canon($proto, $ipvnum, $idnum) .'_verify.out'; unlink($verifyout) if(-f $verifyout); my $verifylog = "$LOGDIR/". servername_canon($proto, $ipvnum, $idnum) .'_verify.log'; unlink($verifylog) if(-f $verifylog); my $flags = "--max-time $server_response_maxtime "; $flags .= "--output $verifyout "; $flags .= "--verbose "; $flags .= "--globoff "; $flags .= "--insecure "; $flags .= "--tlsauthtype SRP "; $flags .= "--tlsuser jsmith "; $flags .= "--tlspassword abc "; $flags .= "\"https://$ip:$port/verifiedserver\""; my $cmd = "$VCURL $flags 2>$verifylog"; # verify if our/any server is running on this port logmsg "RUN: $cmd\n" if($verbose); my $res = runclient($cmd); $res >>= 8; # rotate the result if($res & 128) { logmsg "RUN: curl command died with a coredump\n"; return -1; } if($res && $verbose) { logmsg "RUN: curl command returned $res\n"; if(open(FILE, "<$verifylog")) { while(my $string = ) { logmsg "RUN: $string" if($string !~ /^([ \t]*)$/); } close(FILE); } } my $data; if(open(FILE, "<$verifyout")) { while(my $string = ) { $data .= $string; } close(FILE); } if($data && ($data =~ /GNUTLS/) && open(FILE, "<$pidfile")) { $pid=0+; close(FILE); if($pid > 0) { # if we have a pid it is actually our httptls server, # since runhttptlsserver() unlinks previous pidfile if(!pidexists($pid)) { logmsg "RUN: $server server has died after starting up\n"; checkdied($pid); unlink($pidfile); $pid = -1; } } return $pid; } elsif($res == 6) { # curl: (6) Couldn't resolve host '::1' logmsg "RUN: failed to resolve host (https://$ip:$port/verifiedserver)\n"; return -1; } elsif($data || ($res && ($res != 7))) { logmsg "RUN: Unknown server on our $server port: $port ($res)\n"; return -1; } return $pid; } ####################################################################### # STUB for verifying socks # sub verifysocks { my ($proto, $ipvnum, $idnum, $ip, $port) = @_; my $server = servername_id($proto, $ipvnum, $idnum); my $pidfile = server_pidfilename($proto, $ipvnum, $idnum); my $pid = 0; if(open(FILE, "<$pidfile")) { $pid=0+; close(FILE); } if($pid > 0) { # if we have a pid it is actually our socks server, # since runsocksserver() unlinks previous pidfile if(!pidexists($pid)) { logmsg "RUN: SOCKS server has died after starting up\n"; checkdied($pid); unlink($pidfile); $pid = -1; } } return $pid; } ####################################################################### # Verify that the server that runs on $ip, $port is our server. # Retry over several seconds before giving up. The ssh server in # particular can take a long time to start if it needs to generate # keys on a slow or loaded host. # # Just for convenience, test harness uses 'https' and 'httptls' literals # as values for 'proto' variable in order to differentiate different # servers. 'https' literal is used for stunnel based https test servers, # and 'httptls' is used for non-stunnel https test servers. # my %protofunc = ('http' => \&verifyhttp, 'https' => \&verifyhttp, 'rtsp' => \&verifyrtsp, 'ftp' => \&verifyftp, 'pop3' => \&verifyftp, 'imap' => \&verifyftp, 'smtp' => \&verifyftp, 'httppipe' => \&verifyhttp, 'ftps' => \&verifyftp, 'tftp' => \&verifyftp, 'ssh' => \&verifyssh, 'socks' => \&verifysocks, 'gopher' => \&verifyhttp, 'httptls' => \&verifyhttptls); sub verifyserver { my ($proto, $ipvnum, $idnum, $ip, $port) = @_; my $count = 30; # try for this many seconds my $pid; while($count--) { my $fun = $protofunc{$proto}; $pid = &$fun($proto, $ipvnum, $idnum, $ip, $port); if($pid > 0) { last; } elsif($pid < 0) { # a real failure, stop trying and bail out return 0; } sleep(1); } return $pid; } ####################################################################### # Single shot server responsiveness test. This should only be used # to verify that a server present in %run hash is still functional # sub responsiveserver { my ($proto, $ipvnum, $idnum, $ip, $port) = @_; my $prev_verbose = $verbose; $verbose = 0; my $fun = $protofunc{$proto}; my $pid = &$fun($proto, $ipvnum, $idnum, $ip, $port); $verbose = $prev_verbose; if($pid > 0) { return 1; # responsive } my $srvrname = servername_str($proto, $ipvnum, $idnum); logmsg " server precheck FAILED (unresponsive $srvrname server)\n"; return 0; } ####################################################################### # start the http server # sub runhttpserver { my ($proto, $verbose, $alt, $port) = @_; my $ip = $HOSTIP; my $ipvnum = 4; my $idnum = 1; my $server; my $srvrname; my $pidfile; my $logfile; my $flags = ""; my $exe = "$perl $srcdir/httpserver.pl"; my $verbose_flag = "--verbose "; if($alt eq "ipv6") { # if IPv6, use a different setup $ipvnum = 6; $ip = $HOST6IP; } elsif($alt eq "proxy") { # basically the same, but another ID $idnum = 2; } elsif($alt eq "pipe") { # basically the same, but another ID $idnum = 3; $exe = "python $srcdir/http_pipe.py"; $verbose_flag .= "1 "; } $server = servername_id($proto, $ipvnum, $idnum); $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work if ($doesntrun{$pidfile}) { return (0,0); } my $pid = processexists($pidfile); if($pid > 0) { stopserver($server, "$pid"); } unlink($pidfile) if(-f $pidfile); $srvrname = servername_str($proto, $ipvnum, $idnum); $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum); $flags .= "--gopher " if($proto eq "gopher"); $flags .= "--connect $HOSTIP " if($alt eq "proxy"); $flags .= $verbose_flag if($debugprotocol); $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" "; $flags .= "--id $idnum " if($idnum > 1); $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\""; my $cmd = "$exe $flags"; my ($httppid, $pid2) = startnew($cmd, $pidfile, 15, 0); if($httppid <= 0 || !pidexists($httppid)) { # it is NOT alive logmsg "RUN: failed to start the $srvrname server\n"; stopserver($server, "$pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return (0,0); } # Server is up. Verify that we can speak to it. my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port); if(!$pid3) { logmsg "RUN: $srvrname server failed verification\n"; # failed to talk to it properly. Kill the server and return failure stopserver($server, "$httppid $pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return (0,0); } $pid2 = $pid3; if($verbose) { logmsg "RUN: $srvrname server is now running PID $httppid\n"; } sleep(1); return ($httppid, $pid2); } ####################################################################### # start the http server # sub runhttp_pipeserver { my ($proto, $verbose, $alt, $port) = @_; my $ip = $HOSTIP; my $ipvnum = 4; my $idnum = 1; my $server; my $srvrname; my $pidfile; my $logfile; my $flags = ""; if($alt eq "ipv6") { # No IPv6 } $server = servername_id($proto, $ipvnum, $idnum); $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work if ($doesntrun{$pidfile}) { return (0,0); } my $pid = processexists($pidfile); if($pid > 0) { stopserver($server, "$pid"); } unlink($pidfile) if(-f $pidfile); $srvrname = servername_str($proto, $ipvnum, $idnum); $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum); $flags .= "--verbose 1 " if($debugprotocol); $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" "; $flags .= "--id $idnum " if($idnum > 1); $flags .= "--port $port --srcdir \"$srcdir\""; my $cmd = "$srcdir/http_pipe.py $flags"; my ($httppid, $pid2) = startnew($cmd, $pidfile, 15, 0); if($httppid <= 0 || !pidexists($httppid)) { # it is NOT alive logmsg "RUN: failed to start the $srvrname server\n"; stopserver($server, "$pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return (0,0); } # Server is up. Verify that we can speak to it. my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port); if(!$pid3) { logmsg "RUN: $srvrname server failed verification\n"; # failed to talk to it properly. Kill the server and return failure stopserver($server, "$httppid $pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return (0,0); } $pid2 = $pid3; if($verbose) { logmsg "RUN: $srvrname server is now running PID $httppid\n"; } sleep(1); return ($httppid, $pid2); } ####################################################################### # start the https stunnel based server # sub runhttpsserver { my ($verbose, $ipv6, $certfile) = @_; my $proto = 'https'; my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP"; my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4; my $idnum = 1; my $server; my $srvrname; my $pidfile; my $logfile; my $flags = ""; if(!$stunnel) { return (0,0); } $server = servername_id($proto, $ipvnum, $idnum); $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work if ($doesntrun{$pidfile}) { return (0,0); } my $pid = processexists($pidfile); if($pid > 0) { stopserver($server, "$pid"); } unlink($pidfile) if(-f $pidfile); $srvrname = servername_str($proto, $ipvnum, $idnum); $certfile = 'stunnel.pem' unless($certfile); $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum); $flags .= "--verbose " if($debugprotocol); $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" "; $flags .= "--id $idnum " if($idnum > 1); $flags .= "--ipv$ipvnum --proto $proto "; $flags .= "--certfile \"$certfile\" " if($certfile ne 'stunnel.pem'); $flags .= "--stunnel \"$stunnel\" --srcdir \"$srcdir\" "; $flags .= "--connect $HTTPPORT --accept $HTTPSPORT"; my $cmd = "$perl $srcdir/secureserver.pl $flags"; my ($httpspid, $pid2) = startnew($cmd, $pidfile, 15, 0); if($httpspid <= 0 || !pidexists($httpspid)) { # it is NOT alive logmsg "RUN: failed to start the $srvrname server\n"; stopserver($server, "$pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return(0,0); } # Server is up. Verify that we can speak to it. my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $HTTPSPORT); if(!$pid3) { logmsg "RUN: $srvrname server failed verification\n"; # failed to talk to it properly. Kill the server and return failure stopserver($server, "$httpspid $pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return (0,0); } # Here pid3 is actually the pid returned by the unsecure-http server. $runcert{$server} = $certfile; if($verbose) { logmsg "RUN: $srvrname server is now running PID $httpspid\n"; } sleep(1); return ($httpspid, $pid2); } ####################################################################### # start the non-stunnel HTTP TLS extensions capable server # sub runhttptlsserver { my ($verbose, $ipv6) = @_; my $proto = "httptls"; my $port = ($ipv6 && ($ipv6 =~ /6$/)) ? $HTTPTLS6PORT : $HTTPTLSPORT; my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP"; my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4; my $idnum = 1; my $server; my $srvrname; my $pidfile; my $logfile; my $flags = ""; if(!$httptlssrv) { return (0,0); } $server = servername_id($proto, $ipvnum, $idnum); $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work if ($doesntrun{$pidfile}) { return (0,0); } my $pid = processexists($pidfile); if($pid > 0) { stopserver($server, "$pid"); } unlink($pidfile) if(-f $pidfile); $srvrname = servername_str($proto, $ipvnum, $idnum); $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum); $flags .= "--http "; $flags .= "--debug 1 " if($debugprotocol); $flags .= "--port $port "; $flags .= "--srppasswd $srcdir/certs/srp-verifier-db "; $flags .= "--srppasswdconf $srcdir/certs/srp-verifier-conf"; my $cmd = "$httptlssrv $flags > $logfile 2>&1"; my ($httptlspid, $pid2) = startnew($cmd, $pidfile, 10, 1); # fake pidfile if($httptlspid <= 0 || !pidexists($httptlspid)) { # it is NOT alive logmsg "RUN: failed to start the $srvrname server\n"; stopserver($server, "$pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return (0,0); } # Server is up. Verify that we can speak to it. PID is from fake pidfile my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port); if(!$pid3) { logmsg "RUN: $srvrname server failed verification\n"; # failed to talk to it properly. Kill the server and return failure stopserver($server, "$httptlspid $pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return (0,0); } $pid2 = $pid3; if($verbose) { logmsg "RUN: $srvrname server is now running PID $httptlspid\n"; } sleep(1); return ($httptlspid, $pid2); } ####################################################################### # start the pingpong server (FTP, POP3, IMAP, SMTP) # sub runpingpongserver { my ($proto, $id, $verbose, $ipv6) = @_; my $port; my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP"; my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4; my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1; my $server; my $srvrname; my $pidfile; my $logfile; my $flags = ""; if($proto eq "ftp") { $port = ($idnum>1)?$FTP2PORT:$FTPPORT; if($ipvnum==6) { # if IPv6, use a different setup $port = $FTP6PORT; } } elsif($proto eq "pop3") { $port = ($ipvnum==6) ? $POP36PORT : $POP3PORT; } elsif($proto eq "imap") { $port = ($ipvnum==6) ? $IMAP6PORT : $IMAPPORT; } elsif($proto eq "smtp") { $port = ($ipvnum==6) ? $SMTP6PORT : $SMTPPORT; } else { print STDERR "Unsupported protocol $proto!!\n"; return 0; } $server = servername_id($proto, $ipvnum, $idnum); $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work if ($doesntrun{$pidfile}) { return (0,0); } my $pid = processexists($pidfile); if($pid > 0) { stopserver($server, "$pid"); } unlink($pidfile) if(-f $pidfile); $srvrname = servername_str($proto, $ipvnum, $idnum); $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum); $flags .= "--verbose " if($debugprotocol); $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" "; $flags .= "--srcdir \"$srcdir\" --proto $proto "; $flags .= "--id $idnum " if($idnum > 1); $flags .= "--ipv$ipvnum --port $port --addr \"$ip\""; my $cmd = "$perl $srcdir/ftpserver.pl $flags"; my ($ftppid, $pid2) = startnew($cmd, $pidfile, 15, 0); if($ftppid <= 0 || !pidexists($ftppid)) { # it is NOT alive logmsg "RUN: failed to start the $srvrname server\n"; stopserver($server, "$pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return (0,0); } # Server is up. Verify that we can speak to it. my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port); if(!$pid3) { logmsg "RUN: $srvrname server failed verification\n"; # failed to talk to it properly. Kill the server and return failure stopserver($server, "$ftppid $pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return (0,0); } $pid2 = $pid3; if($verbose) { logmsg "RUN: $srvrname server is now running PID $ftppid\n"; } sleep(1); return ($pid2, $ftppid); } ####################################################################### # start the ftps server (or rather, tunnel) # sub runftpsserver { my ($verbose, $ipv6, $certfile) = @_; my $proto = 'ftps'; my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP"; my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4; my $idnum = 1; my $server; my $srvrname; my $pidfile; my $logfile; my $flags = ""; if(!$stunnel) { return (0,0); } $server = servername_id($proto, $ipvnum, $idnum); $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work if ($doesntrun{$pidfile}) { return (0,0); } my $pid = processexists($pidfile); if($pid > 0) { stopserver($server, "$pid"); } unlink($pidfile) if(-f $pidfile); $srvrname = servername_str($proto, $ipvnum, $idnum); $certfile = 'stunnel.pem' unless($certfile); $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum); $flags .= "--verbose " if($debugprotocol); $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" "; $flags .= "--id $idnum " if($idnum > 1); $flags .= "--ipv$ipvnum --proto $proto "; $flags .= "--certfile \"$certfile\" " if($certfile ne 'stunnel.pem'); $flags .= "--stunnel \"$stunnel\" --srcdir \"$srcdir\" "; $flags .= "--connect $FTPPORT --accept $FTPSPORT"; my $cmd = "$perl $srcdir/secureserver.pl $flags"; my ($ftpspid, $pid2) = startnew($cmd, $pidfile, 15, 0); if($ftpspid <= 0 || !pidexists($ftpspid)) { # it is NOT alive logmsg "RUN: failed to start the $srvrname server\n"; stopserver($server, "$pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return(0,0); } # Server is up. Verify that we can speak to it. my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $FTPSPORT); if(!$pid3) { logmsg "RUN: $srvrname server failed verification\n"; # failed to talk to it properly. Kill the server and return failure stopserver($server, "$ftpspid $pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return (0,0); } # Here pid3 is actually the pid returned by the unsecure-ftp server. $runcert{$server} = $certfile; if($verbose) { logmsg "RUN: $srvrname server is now running PID $ftpspid\n"; } sleep(1); return ($ftpspid, $pid2); } ####################################################################### # start the tftp server # sub runtftpserver { my ($id, $verbose, $ipv6) = @_; my $port = $TFTPPORT; my $ip = $HOSTIP; my $proto = 'tftp'; my $ipvnum = 4; my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1; my $server; my $srvrname; my $pidfile; my $logfile; my $flags = ""; if($ipv6) { # if IPv6, use a different setup $ipvnum = 6; $port = $TFTP6PORT; $ip = $HOST6IP; } $server = servername_id($proto, $ipvnum, $idnum); $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work if ($doesntrun{$pidfile}) { return (0,0); } my $pid = processexists($pidfile); if($pid > 0) { stopserver($server, "$pid"); } unlink($pidfile) if(-f $pidfile); $srvrname = servername_str($proto, $ipvnum, $idnum); $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum); $flags .= "--verbose " if($debugprotocol); $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" "; $flags .= "--id $idnum " if($idnum > 1); $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\""; my $cmd = "$perl $srcdir/tftpserver.pl $flags"; my ($tftppid, $pid2) = startnew($cmd, $pidfile, 15, 0); if($tftppid <= 0 || !pidexists($tftppid)) { # it is NOT alive logmsg "RUN: failed to start the $srvrname server\n"; stopserver($server, "$pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return (0,0); } # Server is up. Verify that we can speak to it. my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port); if(!$pid3) { logmsg "RUN: $srvrname server failed verification\n"; # failed to talk to it properly. Kill the server and return failure stopserver($server, "$tftppid $pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return (0,0); } $pid2 = $pid3; if($verbose) { logmsg "RUN: $srvrname server is now running PID $tftppid\n"; } sleep(1); return ($pid2, $tftppid); } ####################################################################### # start the rtsp server # sub runrtspserver { my ($verbose, $ipv6) = @_; my $port = $RTSPPORT; my $ip = $HOSTIP; my $proto = 'rtsp'; my $ipvnum = 4; my $idnum = 1; my $server; my $srvrname; my $pidfile; my $logfile; my $flags = ""; if($ipv6) { # if IPv6, use a different setup $ipvnum = 6; $port = $RTSP6PORT; $ip = $HOST6IP; } $server = servername_id($proto, $ipvnum, $idnum); $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work if ($doesntrun{$pidfile}) { return (0,0); } my $pid = processexists($pidfile); if($pid > 0) { stopserver($server, "$pid"); } unlink($pidfile) if(-f $pidfile); $srvrname = servername_str($proto, $ipvnum, $idnum); $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum); $flags .= "--verbose " if($debugprotocol); $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" "; $flags .= "--id $idnum " if($idnum > 1); $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\""; my $cmd = "$perl $srcdir/rtspserver.pl $flags"; my ($rtsppid, $pid2) = startnew($cmd, $pidfile, 15, 0); if($rtsppid <= 0 || !pidexists($rtsppid)) { # it is NOT alive logmsg "RUN: failed to start the $srvrname server\n"; stopserver($server, "$pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return (0,0); } # Server is up. Verify that we can speak to it. my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port); if(!$pid3) { logmsg "RUN: $srvrname server failed verification\n"; # failed to talk to it properly. Kill the server and return failure stopserver($server, "$rtsppid $pid2"); displaylogs($testnumcheck); $doesntrun{$pidfile} = 1; return (0,0); } $pid2 = $pid3; if($verbose) { logmsg "RUN: $srvrname server is now running PID $rtsppid\n"; } sleep(1); return ($rtsppid, $pid2); } ####################################################################### # Start the ssh (scp/sftp) server # sub runsshserver { my ($id, $verbose, $ipv6) = @_; my $ip=$HOSTIP; my $port = $SSHPORT; my $socksport = $SOCKSPORT; my $proto = 'ssh'; my $ipvnum = 4; my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1; my $server; my $srvrname; my $pidfile; my $logfile; my $flags = ""; $server = servername_id($proto, $ipvnum, $idnum); $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work if ($doesntrun{$pidfile}) { return (0,0); } my $pid = processexists($pidfile); if($pid > 0) { stopserver($server, "$pid"); } unlink($pidfile) if(-f $pidfile); $srvrname = servername_str($proto, $ipvnum, $idnum); $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum); $flags .= "--verbose " if($verbose); $flags .= "--debugprotocol " if($debugprotocol); $flags .= "--pidfile \"$pidfile\" "; $flags .= "--id $idnum " if($idnum > 1); $flags .= "--ipv$ipvnum --addr \"$ip\" "; $flags .= "--sshport $port --socksport $socksport "; $flags .= "--user \"$USER\""; my $cmd = "$perl $srcdir/sshserver.pl $flags"; my ($sshpid, $pid2) = startnew($cmd, $pidfile, 60, 0); # on loaded systems sshserver start up can take longer than the timeout # passed to startnew, when this happens startnew completes without being # able to read the pidfile and consequently returns a zero pid2 above. if($sshpid <= 0 || !pidexists($sshpid)) { # it is NOT alive logmsg "RUN: failed to start the $srvrname server\n"; stopserver($server, "$pid2"); $doesntrun{$pidfile} = 1; return (0,0); } # ssh server verification allows some extra time for the server to start up # and gives us the opportunity of recovering the pid from the pidfile, when # this verification succeeds the recovered pid is assigned to pid2. my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port); if(!$pid3) { logmsg "RUN: $srvrname server failed verification\n"; # failed to fetch server pid. Kill the server and return failure stopserver($server, "$sshpid $pid2"); $doesntrun{$pidfile} = 1; return (0,0); } $pid2 = $pid3; # once it is known that the ssh server is alive, sftp server verification # is performed actually connecting to it, authenticating and performing a # very simple remote command. This verification is tried only one time. $sshdlog = server_logfilename($LOGDIR, 'ssh', $ipvnum, $idnum); $sftplog = server_logfilename($LOGDIR, 'sftp', $ipvnum, $idnum); if(verifysftp('sftp', $ipvnum, $idnum, $ip, $port) < 1) { logmsg "RUN: SFTP server failed verification\n"; # failed to talk to it properly. Kill the server and return failure display_sftplog(); display_sftpconfig(); display_sshdlog(); display_sshdconfig(); stopserver($server, "$sshpid $pid2"); $doesntrun{$pidfile} = 1; return (0,0); } if($verbose) { logmsg "RUN: $srvrname server is now running PID $pid2\n"; } return ($pid2, $sshpid); } ####################################################################### # Start the socks server # sub runsocksserver { my ($id, $verbose, $ipv6) = @_; my $ip=$HOSTIP; my $port = $SOCKSPORT; my $proto = 'socks'; my $ipvnum = 4; my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1; my $server; my $srvrname; my $pidfile; my $logfile; my $flags = ""; $server = servername_id($proto, $ipvnum, $idnum); $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work if ($doesntrun{$pidfile}) { return (0,0); } my $pid = processexists($pidfile); if($pid > 0) { stopserver($server, "$pid"); } unlink($pidfile) if(-f $pidfile); $srvrname = servername_str($proto, $ipvnum, $idnum); $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum); # The ssh server must be already running if(!$run{'ssh'}) { logmsg "RUN: SOCKS server cannot find running SSH server\n"; $doesntrun{$pidfile} = 1; return (0,0); } # Find out ssh daemon canonical file name my $sshd = find_sshd(); if(!$sshd) { logmsg "RUN: SOCKS server cannot find $sshdexe\n"; $doesntrun{$pidfile} = 1; return (0,0); } # Find out ssh daemon version info ($sshdid, $sshdvernum, $sshdverstr, $sshderror) = sshversioninfo($sshd); if(!$sshdid) { # Not an OpenSSH or SunSSH ssh daemon logmsg "$sshderror\n" if($verbose); logmsg "SCP, SFTP and SOCKS tests require OpenSSH 2.9.9 or later\n"; $doesntrun{$pidfile} = 1; return (0,0); } logmsg "ssh server found $sshd is $sshdverstr\n" if($verbose); # Find out ssh client canonical file name my $ssh = find_ssh(); if(!$ssh) { logmsg "RUN: SOCKS server cannot find $sshexe\n"; $doesntrun{$pidfile} = 1; return (0,0); } # Find out ssh client version info my ($sshid, $sshvernum, $sshverstr, $ssherror) = sshversioninfo($ssh); if(!$sshid) { # Not an OpenSSH or SunSSH ssh client logmsg "$ssherror\n" if($verbose); logmsg "SCP, SFTP and SOCKS tests require OpenSSH 2.9.9 or later\n"; $doesntrun{$pidfile} = 1; return (0,0); } # Verify minimum ssh client version if((($sshid =~ /OpenSSH/) && ($sshvernum < 299)) || (($sshid =~ /SunSSH/) && ($sshvernum < 100))) { logmsg "ssh client found $ssh is $sshverstr\n"; logmsg "SCP, SFTP and SOCKS tests require OpenSSH 2.9.9 or later\n"; $doesntrun{$pidfile} = 1; return (0,0); } logmsg "ssh client found $ssh is $sshverstr\n" if($verbose); # Verify if ssh client and ssh daemon versions match if(($sshdid ne $sshid) || ($sshdvernum != $sshvernum)) { # Our test harness might work with slightly mismatched versions logmsg "Warning: version mismatch: sshd $sshdverstr - ssh $sshverstr\n" if($verbose); } # Config file options for ssh client are previously set from sshserver.pl if(! -e $sshconfig) { logmsg "RUN: SOCKS server cannot find $sshconfig\n"; $doesntrun{$pidfile} = 1; return (0,0); } $sshlog = server_logfilename($LOGDIR, 'socks', $ipvnum, $idnum); # start our socks server my $cmd="$ssh -N -F $sshconfig $ip > $sshlog 2>&1"; my ($sshpid, $pid2) = startnew($cmd, $pidfile, 30, 1); # fake pidfile if($sshpid <= 0 || !pidexists($sshpid)) { # it is NOT alive logmsg "RUN: failed to start the $srvrname server\n"; display_sshlog(); display_sshconfig(); display_sshdlog(); display_sshdconfig(); stopserver($server, "$pid2"); $doesntrun{$pidfile} = 1; return (0,0); } # Ugly hack but ssh doesn't support pid files. PID is from fake pidfile. my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port); if(!$pid3) { logmsg "RUN: $srvrname server failed verification\n"; # failed to talk to it properly. Kill the server and return failure stopserver($server, "$sshpid $pid2"); $doesntrun{$pidfile} = 1; return (0,0); } $pid2 = $pid3; if($verbose) { logmsg "RUN: $srvrname server is now running PID $pid2\n"; } return ($pid2, $sshpid); } ####################################################################### # Single shot http and gopher server responsiveness test. This should only # be used to verify that a server present in %run hash is still functional # sub responsive_http_server { my ($proto, $verbose, $alt, $port) = @_; my $ip = $HOSTIP; my $ipvnum = 4; my $idnum = 1; if($alt eq "ipv6") { # if IPv6, use a different setup $ipvnum = 6; $ip = $HOST6IP; } elsif($alt eq "proxy") { $idnum = 2; } return &responsiveserver($proto, $ipvnum, $idnum, $ip, $port); } ####################################################################### # Single shot pingpong server responsiveness test. This should only be # used to verify that a server present in %run hash is still functional # sub responsive_pingpong_server { my ($proto, $id, $verbose, $ipv6) = @_; my $port; my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP"; my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4; my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1; if($proto eq "ftp") { $port = ($idnum>1)?$FTP2PORT:$FTPPORT; if($ipvnum==6) { # if IPv6, use a different setup $port = $FTP6PORT; } } elsif($proto eq "pop3") { $port = ($ipvnum==6) ? $POP36PORT : $POP3PORT; } elsif($proto eq "imap") { $port = ($ipvnum==6) ? $IMAP6PORT : $IMAPPORT; } elsif($proto eq "smtp") { $port = ($ipvnum==6) ? $SMTP6PORT : $SMTPPORT; } else { print STDERR "Unsupported protocol $proto!!\n"; return 0; } return &responsiveserver($proto, $ipvnum, $idnum, $ip, $port); } ####################################################################### # Single shot rtsp server responsiveness test. This should only be # used to verify that a server present in %run hash is still functional # sub responsive_rtsp_server { my ($verbose, $ipv6) = @_; my $port = $RTSPPORT; my $ip = $HOSTIP; my $proto = 'rtsp'; my $ipvnum = 4; my $idnum = 1; if($ipv6) { # if IPv6, use a different setup $ipvnum = 6; $port = $RTSP6PORT; $ip = $HOST6IP; } return &responsiveserver($proto, $ipvnum, $idnum, $ip, $port); } ####################################################################### # Single shot tftp server responsiveness test. This should only be # used to verify that a server present in %run hash is still functional # sub responsive_tftp_server { my ($id, $verbose, $ipv6) = @_; my $port = $TFTPPORT; my $ip = $HOSTIP; my $proto = 'tftp'; my $ipvnum = 4; my $idnum = ($id && ($id =~ /^(\d+)$/) && ($id > 1)) ? $id : 1; if($ipv6) { # if IPv6, use a different setup $ipvnum = 6; $port = $TFTP6PORT; $ip = $HOST6IP; } return &responsiveserver($proto, $ipvnum, $idnum, $ip, $port); } ####################################################################### # Single shot non-stunnel HTTP TLS extensions capable server # responsiveness test. This should only be used to verify that a # server present in %run hash is still functional # sub responsive_httptls_server { my ($verbose, $ipv6) = @_; my $proto = "httptls"; my $port = ($ipv6 && ($ipv6 =~ /6$/)) ? $HTTPTLS6PORT : $HTTPTLSPORT; my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP"; my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4; my $idnum = 1; return &responsiveserver($proto, $ipvnum, $idnum, $ip, $port); } ####################################################################### # Remove all files in the specified directory # sub cleardir { my $dir = $_[0]; my $count; my $file; # Get all files opendir(DIR, $dir) || return 0; # can't open dir while($file = readdir(DIR)) { if($file !~ /^\./) { unlink("$dir/$file"); $count++; } } closedir DIR; return $count; } ####################################################################### # filter out the specified pattern from the given input file and store the # results in the given output file # sub filteroff { my $infile=$_[0]; my $filter=$_[1]; my $ofile=$_[2]; open(IN, "<$infile") || return 1; open(OUT, ">$ofile") || return 1; # logmsg "FILTER: off $filter from $infile to $ofile\n"; while() { $_ =~ s/$filter//; print OUT $_; } close(IN); close(OUT); return 0; } ####################################################################### # compare test results with the expected output, we might filter off # some pattern that is allowed to differ, output test results # sub compare { # filter off patterns _before_ this comparison! my ($testnum, $testname, $subject, $firstref, $secondref)=@_; my $result = compareparts($firstref, $secondref); if($result) { # timestamp test result verification end $timevrfyend{$testnum} = Time::HiRes::time() if($timestats); if(!$short) { logmsg "\n $testnum: $subject FAILED:\n"; logmsg showdiff($LOGDIR, $firstref, $secondref); } elsif(!$automakestyle) { logmsg "FAILED\n"; } else { # automakestyle logmsg "FAIL: $testnum - $testname - $subject\n"; } } return $result; } ####################################################################### # display information about curl and the host the test suite runs on # sub checksystem { unlink($memdump); # remove this if there was one left my $feat; my $curl; my $libcurl; my $versretval; my $versnoexec; my @version=(); my $curlverout="$LOGDIR/curlverout.log"; my $curlvererr="$LOGDIR/curlvererr.log"; my $versioncmd="$CURL --version 1>$curlverout 2>$curlvererr"; unlink($curlverout); unlink($curlvererr); $versretval = runclient($versioncmd); $versnoexec = $!; open(VERSOUT, "<$curlverout"); @version = ; close(VERSOUT); $resolver="stock"; for(@version) { chomp; if($_ =~ /^curl/) { $curl = $_; $curl =~ s/^(.*)(libcurl.*)/$1/g; $libcurl = $2; if($curl =~ /mingw32/) { # This is a windows minw32 build, we need to translate the # given path to the "actual" windows path. The MSYS shell # has a builtin 'pwd -W' command which converts the path. $pwd = `sh -c "echo \$(pwd -W)"`; chomp($pwd); } elsif ($curl =~ /win32/) { # Native Windows builds don't understand the # output of cygwin's pwd. It will be # something like /cygdrive/c/. # # Use the cygpath utility to convert the # working directory to a Windows friendly # path. The -m option converts to use drive # letter:, but it uses / instead \. Forward # slashes (/) are easier for us. We don't # have to escape them to get them to curl # through a shell. chomp($pwd = `cygpath -m $pwd`); } if ($libcurl =~ /winssl/i) { $has_winssl=1; $ssllib="WinSSL"; } elsif ($libcurl =~ /openssl/i) { $has_openssl=1; $ssllib="OpenSSL"; } elsif ($libcurl =~ /gnutls/i) { $has_gnutls=1; $ssllib="GnuTLS"; } elsif ($libcurl =~ /nss/i) { $has_nss=1; $ssllib="NSS"; } elsif ($libcurl =~ /yassl/i) { $has_yassl=1; $ssllib="yassl"; } elsif ($libcurl =~ /polarssl/i) { $has_polarssl=1; $ssllib="polarssl"; } elsif ($libcurl =~ /axtls/i) { $has_axtls=1; $ssllib="axTLS"; } elsif ($libcurl =~ /securetransport/i) { $has_darwinssl=1; $ssllib="DarwinSSL"; } elsif ($libcurl =~ /ares/i) { $has_cares=1; $resolver="c-ares"; } } elsif($_ =~ /^Protocols: (.*)/i) { # these are the protocols compiled in to this libcurl @protocols = split(' ', lc($1)); # Generate a "proto-ipv6" version of each protocol to match the # IPv6 name. This works even if IPv6 support isn't # compiled in because the test will fail. push @protocols, map($_ . '-ipv6', @protocols); # 'http-proxy' is used in test cases to do CONNECT through push @protocols, 'http-proxy'; # 'http-pipe' is the special server for testing pipelining push @protocols, 'http-pipe'; # 'none' is used in test cases to mean no server push @protocols, 'none'; } elsif($_ =~ /^Features: (.*)/i) { $feat = $1; if($feat =~ /TrackMemory/i) { # built with memory tracking support (--enable-curldebug) $has_memory_tracking = 1; } if($feat =~ /debug/i) { # curl was built with --enable-debug $debug_build = 1; } if($feat =~ /SSL/i) { # ssl enabled $ssl_version=1; } if($feat =~ /Largefile/i) { # large file support $large_file=1; } if($feat =~ /IDN/i) { # IDN support $has_idn=1; } if($feat =~ /IPv6/i) { $has_ipv6 = 1; } if($feat =~ /libz/i) { $has_libz = 1; } if($feat =~ /NTLM/i) { # NTLM enabled $has_ntlm=1; } if($feat =~ /NTLM_WB/i) { # NTLM delegation to winbind daemon ntlm_auth helper enabled $has_ntlm_wb=1; } if($feat =~ /SSPI/i) { # SSPI enabled $has_sspi=1; } if($feat =~ /CharConv/i) { # CharConv enabled $has_charconv=1; } if($feat =~ /TLS-SRP/i) { # TLS-SRP enabled $has_tls_srp=1; } if($feat =~ /Metalink/i) { # Metalink enabled $has_metalink=1; } if($feat =~ /AsynchDNS/i) { if(!$has_cares) { # this means threaded resolver $has_threadedres=1; $resolver="threaded"; } } } # # Test harness currently uses a non-stunnel server in order to # run HTTP TLS-SRP tests required when curl is built with https # protocol support and TLS-SRP feature enabled. For convenience # 'httptls' may be included in the test harness protocols array # to differentiate this from classic stunnel based 'https' test # harness server. # if($has_tls_srp) { my $add_httptls; for(@protocols) { if($_ =~ /^https(-ipv6|)$/) { $add_httptls=1; last; } } if($add_httptls && (! grep /^httptls$/, @protocols)) { push @protocols, 'httptls'; push @protocols, 'httptls-ipv6'; } } } if(!$curl) { logmsg "unable to get curl's version, further details are:\n"; logmsg "issued command: \n"; logmsg "$versioncmd \n"; if ($versretval == -1) { logmsg "command failed with: \n"; logmsg "$versnoexec \n"; } elsif ($versretval & 127) { logmsg sprintf("command died with signal %d, and %s coredump.\n", ($versretval & 127), ($versretval & 128)?"a":"no"); } else { logmsg sprintf("command exited with value %d \n", $versretval >> 8); } logmsg "contents of $curlverout: \n"; displaylogcontent("$curlverout"); logmsg "contents of $curlvererr: \n"; displaylogcontent("$curlvererr"); die "couldn't get curl's version"; } if(-r "../lib/curl_config.h") { open(CONF, "<../lib/curl_config.h"); while() { if($_ =~ /^\#define HAVE_GETRLIMIT/) { $has_getrlimit = 1; } } close(CONF); } if($has_ipv6) { # client has ipv6 support # check if the HTTP server has it! my @sws = `server/sws --version`; if($sws[0] =~ /IPv6/) { # HTTP server has ipv6 support! $http_ipv6 = 1; $gopher_ipv6 = 1; } # check if the FTP server has it! @sws = `server/sockfilt --version`; if($sws[0] =~ /IPv6/) { # FTP server has ipv6 support! $ftp_ipv6 = 1; } } if(!$has_memory_tracking && $torture) { die "can't run torture tests since curl was built without ". "TrackMemory feature (--enable-curldebug)"; } $has_shared = `sh $CURLCONFIG --built-shared`; chomp $has_shared; # curl doesn't list cryptographic support separately, so assume it's # always available $has_crypto=1; my $hostname=join(' ', runclientoutput("hostname")); my $hosttype=join(' ', runclientoutput("uname -a")); logmsg ("********* System characteristics ******** \n", "* $curl\n", "* $libcurl\n", "* Features: $feat\n", "* Host: $hostname", "* System: $hosttype"); if($has_memory_tracking && $has_threadedres) { $has_memory_tracking = 0; logmsg("*\n", "*** DISABLES memory tracking when using threaded resolver\n", "*\n"); } logmsg sprintf("* Server SSL: %8s", $stunnel?"ON ":"OFF"); logmsg sprintf(" libcurl SSL: %s\n", $ssl_version?"ON ":"OFF"); logmsg sprintf("* debug build: %8s", $debug_build?"ON ":"OFF"); logmsg sprintf(" track memory: %s\n", $has_memory_tracking?"ON ":"OFF"); logmsg sprintf("* valgrind: %8s", $valgrind?"ON ":"OFF"); logmsg sprintf(" HTTP IPv6 %s\n", $http_ipv6?"ON ":"OFF"); logmsg sprintf("* FTP IPv6 %8s", $ftp_ipv6?"ON ":"OFF"); logmsg sprintf(" Libtool lib: %s\n", $libtool?"ON ":"OFF"); logmsg sprintf("* Shared build: %-3s", $has_shared); logmsg sprintf(" Resolver: %s\n", $resolver); if($ssl_version) { logmsg sprintf("* SSL library: %13s\n", $ssllib); } logmsg "* Ports:\n"; logmsg sprintf("* HTTP/%d ", $HTTPPORT); logmsg sprintf("FTP/%d ", $FTPPORT); logmsg sprintf("FTP2/%d ", $FTP2PORT); logmsg sprintf("RTSP/%d ", $RTSPPORT); if($stunnel) { logmsg sprintf("FTPS/%d ", $FTPSPORT); logmsg sprintf("HTTPS/%d ", $HTTPSPORT); } logmsg sprintf("\n* TFTP/%d ", $TFTPPORT); if($http_ipv6) { logmsg sprintf("HTTP-IPv6/%d ", $HTTP6PORT); logmsg sprintf("RTSP-IPv6/%d ", $RTSP6PORT); } if($ftp_ipv6) { logmsg sprintf("FTP-IPv6/%d ", $FTP6PORT); } if($tftp_ipv6) { logmsg sprintf("TFTP-IPv6/%d ", $TFTP6PORT); } logmsg sprintf("\n* GOPHER/%d ", $GOPHERPORT); if($gopher_ipv6) { logmsg sprintf("GOPHER-IPv6/%d", $GOPHERPORT); } logmsg sprintf("\n* SSH/%d ", $SSHPORT); logmsg sprintf("SOCKS/%d ", $SOCKSPORT); logmsg sprintf("POP3/%d ", $POP3PORT); logmsg sprintf("IMAP/%d ", $IMAPPORT); logmsg sprintf("SMTP/%d\n", $SMTPPORT); if($ftp_ipv6) { logmsg sprintf("* POP3-IPv6/%d ", $POP36PORT); logmsg sprintf("IMAP-IPv6/%d ", $IMAP6PORT); logmsg sprintf("SMTP-IPv6/%d\n", $SMTP6PORT); } if($httptlssrv) { logmsg sprintf("* HTTPTLS/%d ", $HTTPTLSPORT); if($has_ipv6) { logmsg sprintf("HTTPTLS-IPv6/%d ", $HTTPTLS6PORT); } logmsg "\n"; } logmsg sprintf("* HTTP-PIPE/%d \n", $HTTPPIPEPORT); $has_textaware = ($^O eq 'MSWin32') || ($^O eq 'msys'); logmsg "***************************************** \n"; } ####################################################################### # substitute the variable stuff into either a joined up file or # a command, in either case passed by reference # sub subVariables { my ($thing) = @_; # ports $$thing =~ s/%FTP6PORT/$FTP6PORT/g; $$thing =~ s/%FTP2PORT/$FTP2PORT/g; $$thing =~ s/%FTPSPORT/$FTPSPORT/g; $$thing =~ s/%FTPPORT/$FTPPORT/g; $$thing =~ s/%GOPHER6PORT/$GOPHER6PORT/g; $$thing =~ s/%GOPHERPORT/$GOPHERPORT/g; $$thing =~ s/%HTTPTLS6PORT/$HTTPTLS6PORT/g; $$thing =~ s/%HTTPTLSPORT/$HTTPTLSPORT/g; $$thing =~ s/%HTTP6PORT/$HTTP6PORT/g; $$thing =~ s/%HTTPSPORT/$HTTPSPORT/g; $$thing =~ s/%HTTPPORT/$HTTPPORT/g; $$thing =~ s/%HTTPPIPEPORT/$HTTPPIPEPORT/g; $$thing =~ s/%PROXYPORT/$HTTPPROXYPORT/g; $$thing =~ s/%IMAP6PORT/$IMAP6PORT/g; $$thing =~ s/%IMAPPORT/$IMAPPORT/g; $$thing =~ s/%POP36PORT/$POP36PORT/g; $$thing =~ s/%POP3PORT/$POP3PORT/g; $$thing =~ s/%RTSP6PORT/$RTSP6PORT/g; $$thing =~ s/%RTSPPORT/$RTSPPORT/g; $$thing =~ s/%SMTP6PORT/$SMTP6PORT/g; $$thing =~ s/%SMTPPORT/$SMTPPORT/g; $$thing =~ s/%SOCKSPORT/$SOCKSPORT/g; $$thing =~ s/%SSHPORT/$SSHPORT/g; $$thing =~ s/%TFTP6PORT/$TFTP6PORT/g; $$thing =~ s/%TFTPPORT/$TFTPPORT/g; # client IP addresses $$thing =~ s/%CLIENT6IP/$CLIENT6IP/g; $$thing =~ s/%CLIENTIP/$CLIENTIP/g; # server IP addresses $$thing =~ s/%HOST6IP/$HOST6IP/g; $$thing =~ s/%HOSTIP/$HOSTIP/g; # misc $$thing =~ s/%CURL/$CURL/g; $$thing =~ s/%PWD/$pwd/g; $$thing =~ s/%SRCDIR/$srcdir/g; $$thing =~ s/%USER/$USER/g; # The purpose of FTPTIME2 and FTPTIME3 is to provide times that can be # used for time-out tests and that whould work on most hosts as these # adjust for the startup/check time for this particular host. We needed # to do this to make the test suite run better on very slow hosts. my $ftp2 = $ftpchecktime * 2; my $ftp3 = $ftpchecktime * 3; $$thing =~ s/%FTPTIME2/$ftp2/g; $$thing =~ s/%FTPTIME3/$ftp3/g; } sub fixarray { my @in = @_; for(@in) { subVariables \$_; } return @in; } ####################################################################### # Provide time stamps for single test skipped events # sub timestampskippedevents { my $testnum = $_[0]; return if((not defined($testnum)) || ($testnum < 1)); if($timestats) { if($timevrfyend{$testnum}) { return; } elsif($timesrvrlog{$testnum}) { $timevrfyend{$testnum} = $timesrvrlog{$testnum}; return; } elsif($timetoolend{$testnum}) { $timevrfyend{$testnum} = $timetoolend{$testnum}; $timesrvrlog{$testnum} = $timetoolend{$testnum}; } elsif($timetoolini{$testnum}) { $timevrfyend{$testnum} = $timetoolini{$testnum}; $timesrvrlog{$testnum} = $timetoolini{$testnum}; $timetoolend{$testnum} = $timetoolini{$testnum}; } elsif($timesrvrend{$testnum}) { $timevrfyend{$testnum} = $timesrvrend{$testnum}; $timesrvrlog{$testnum} = $timesrvrend{$testnum}; $timetoolend{$testnum} = $timesrvrend{$testnum}; $timetoolini{$testnum} = $timesrvrend{$testnum}; } elsif($timesrvrini{$testnum}) { $timevrfyend{$testnum} = $timesrvrini{$testnum}; $timesrvrlog{$testnum} = $timesrvrini{$testnum}; $timetoolend{$testnum} = $timesrvrini{$testnum}; $timetoolini{$testnum} = $timesrvrini{$testnum}; $timesrvrend{$testnum} = $timesrvrini{$testnum}; } elsif($timeprepini{$testnum}) { $timevrfyend{$testnum} = $timeprepini{$testnum}; $timesrvrlog{$testnum} = $timeprepini{$testnum}; $timetoolend{$testnum} = $timeprepini{$testnum}; $timetoolini{$testnum} = $timeprepini{$testnum}; $timesrvrend{$testnum} = $timeprepini{$testnum}; $timesrvrini{$testnum} = $timeprepini{$testnum}; } } } ####################################################################### # Run a single specified test case # sub singletest { my ($evbased, # 1 means switch on if possible (and "curl" is tested) # returns "not a test" if it can't be used for this test $testnum, $count, $total)=@_; my @what; my $why; my %feature; my $cmd; my $disablevalgrind; # copy test number to a global scope var, this allows # testnum checking when starting test harness servers. $testnumcheck = $testnum; # timestamp test preparation start $timeprepini{$testnum} = Time::HiRes::time() if($timestats); if($disttests !~ /test$testnum\W/ ) { logmsg "Warning: test$testnum not present in tests/data/Makefile.am\n"; } if($disabled{$testnum}) { logmsg "Warning: test$testnum is explicitly disabled\n"; } # load the test case file definition if(loadtest("${TESTDIR}/test${testnum}")) { if($verbose) { # this is not a test logmsg "RUN: $testnum doesn't look like a test case\n"; } $why = "no test"; } else { @what = getpart("client", "features"); } # We require a feature to be present for(@what) { my $f = $_; $f =~ s/\s//g; if($f =~ /^([^!].*)$/) { # Store the feature for later $feature{$1} = $1; if($1 eq "SSL") { if($ssl_version) { next; } } elsif($1 eq "OpenSSL") { if($has_openssl) { next; } } elsif($1 eq "GnuTLS") { if($has_gnutls) { next; } } elsif($1 eq "NSS") { if($has_nss) { next; } } elsif($1 eq "axTLS") { if($has_axtls) { next; } } elsif($1 eq "WinSSL") { if($has_winssl) { next; } } elsif($1 eq "DarwinSSL") { if($has_darwinssl) { next; } } elsif($1 eq "unittest") { if($debug_build) { next; } } elsif($1 eq "debug") { if($debug_build) { next; } } elsif($1 eq "TrackMemory") { if($has_memory_tracking) { next; } } elsif($1 eq "large_file") { if($large_file) { next; } } elsif($1 eq "idn") { if($has_idn) { next; } } elsif($1 eq "ipv6") { if($has_ipv6) { next; } } elsif($1 eq "libz") { if($has_libz) { next; } } elsif($1 eq "NTLM") { if($has_ntlm) { next; } } elsif($1 eq "NTLM_WB") { if($has_ntlm_wb) { next; } } elsif($1 eq "SSPI") { if($has_sspi) { next; } } elsif($1 eq "getrlimit") { if($has_getrlimit) { next; } } elsif($1 eq "crypto") { if($has_crypto) { next; } } elsif($1 eq "TLS-SRP") { if($has_tls_srp) { next; } } elsif($1 eq "Metalink") { if($has_metalink) { next; } } elsif($1 eq "socks") { next; } # See if this "feature" is in the list of supported protocols elsif (grep /^\Q$1\E$/i, @protocols) { next; } $why = "curl lacks $1 support"; last; } } # We require a feature to not be present if(!$why) { for(@what) { my $f = $_; $f =~ s/\s//g; if($f =~ /^!(.*)$/) { if($1 eq "SSL") { if(!$ssl_version) { next; } } elsif($1 eq "OpenSSL") { if(!$has_openssl) { next; } } elsif($1 eq "GnuTLS") { if(!$has_gnutls) { next; } } elsif($1 eq "NSS") { if(!$has_nss) { next; } } elsif($1 eq "axTLS") { if(!$has_axtls) { next; } } elsif($1 eq "WinSSL") { if(!$has_winssl) { next; } } elsif($1 eq "DarwinSSL") { if(!$has_darwinssl) { next; } } elsif($1 eq "TrackMemory") { if(!$has_memory_tracking) { next; } } elsif($1 eq "large_file") { if(!$large_file) { next; } } elsif($1 eq "idn") { if(!$has_idn) { next; } } elsif($1 eq "ipv6") { if(!$has_ipv6) { next; } } elsif($1 eq "libz") { if(!$has_libz) { next; } } elsif($1 eq "NTLM") { if(!$has_ntlm) { next; } } elsif($1 eq "NTLM_WB") { if(!$has_ntlm_wb) { next; } } elsif($1 eq "SSPI") { if(!$has_sspi) { next; } } elsif($1 eq "getrlimit") { if(!$has_getrlimit) { next; } } elsif($1 eq "crypto") { if(!$has_crypto) { next; } } elsif($1 eq "TLS-SRP") { if(!$has_tls_srp) { next; } } elsif($1 eq "Metalink") { if(!$has_metalink) { next; } } else { next; } } else { next; } $why = "curl has $1 support"; last; } } if(!$why) { my @keywords = getpart("info", "keywords"); my $match; my $k; for $k (@keywords) { chomp $k; if ($disabled_keywords{$k}) { $why = "disabled by keyword"; } elsif ($enabled_keywords{$k}) { $match = 1; } } if(!$why && !$match && %enabled_keywords) { $why = "disabled by missing keyword"; } } # test definition may instruct to (un)set environment vars # this is done this early, so that the precheck can use environment # variables and still bail out fine on errors # restore environment variables that were modified in a previous run foreach my $var (keys %oldenv) { if($oldenv{$var} eq 'notset') { delete $ENV{$var} if($ENV{$var}); } else { $ENV{$var} = $oldenv{$var}; } delete $oldenv{$var}; } # remove test server commands file before servers are started/verified unlink($FTPDCMD) if(-f $FTPDCMD); # timestamp required servers verification start $timesrvrini{$testnum} = Time::HiRes::time() if($timestats); if(!$why) { $why = serverfortest($testnum); } # timestamp required servers verification end $timesrvrend{$testnum} = Time::HiRes::time() if($timestats); my @setenv = getpart("client", "setenv"); if(@setenv) { foreach my $s (@setenv) { chomp $s; subVariables \$s; if($s =~ /([^=]*)=(.*)/) { my ($var, $content) = ($1, $2); # remember current setting, to restore it once test runs $oldenv{$var} = ($ENV{$var})?"$ENV{$var}":'notset'; # set new value if(!$content) { delete $ENV{$var} if($ENV{$var}); } else { if($var =~ /^LD_PRELOAD/) { if(exe_ext() && (exe_ext() eq '.exe')) { # print "Skipping LD_PRELOAD due to lack of OS support\n"; next; } if($debug_build || ($has_shared ne "yes")) { # print "Skipping LD_PRELOAD due to no release shared build\n"; next; } } $ENV{$var} = "$content"; } } } } if(!$why) { # TODO: # Add a precheck cache. If a precheck command was already invoked # exactly like this, then use the previous result to speed up # successive test invokes! my @precheck = getpart("client", "precheck"); if(@precheck) { $cmd = $precheck[0]; chomp $cmd; subVariables \$cmd; if($cmd) { my @p = split(/ /, $cmd); if($p[0] !~ /\//) { # the first word, the command, does not contain a slash so # we will scan the "improved" PATH to find the command to # be able to run it my $fullp = checktestcmd($p[0]); if($fullp) { $p[0] = $fullp; } $cmd = join(" ", @p); } my @o = `$cmd 2>/dev/null`; if($o[0]) { $why = $o[0]; chomp $why; } elsif($?) { $why = "precheck command error"; } logmsg "prechecked $cmd\n" if($verbose); } } } if($why && !$listonly) { # there's a problem, count it as "skipped" $skipped++; $skipped{$why}++; $teststat[$testnum]=$why; # store reason for this test case if(!$short) { if($skipped{$why} <= 3) { # show only the first three skips for each reason logmsg sprintf("test %03d SKIPPED: $why\n", $testnum); } } timestampskippedevents($testnum); return -1; } logmsg sprintf("test %03d...", $testnum) if(!$automakestyle); # extract the reply data my @reply = getpart("reply", "data"); my @replycheck = getpart("reply", "datacheck"); if (@replycheck) { # we use this file instead to check the final output against my %hash = getpartattr("reply", "datacheck"); if($hash{'nonewline'}) { # Yes, we must cut off the final newline from the final line # of the datacheck chomp($replycheck[$#replycheck]); } @reply=@replycheck; } # this is the valid protocol blurb curl should generate my @protocol= fixarray ( getpart("verify", "protocol") ); # this is the valid protocol blurb curl should generate to a proxy my @proxyprot = fixarray ( getpart("verify", "proxy") ); # redirected stdout/stderr to these files $STDOUT="$LOGDIR/stdout$testnum"; $STDERR="$LOGDIR/stderr$testnum"; # if this section exists, we verify that the stdout contained this: my @validstdout = fixarray ( getpart("verify", "stdout") ); # if this section exists, we verify upload my @upload = getpart("verify", "upload"); # if this section exists, it might be FTP server instructions: my @ftpservercmd = getpart("reply", "servercmd"); my $CURLOUT="$LOGDIR/curl$testnum.out"; # curl output if not stdout # name of the test my @testname= getpart("client", "name"); my $testname = $testname[0]; $testname =~ s/\n//g; logmsg "[$testname]\n" if(!$short); if($listonly) { timestampskippedevents($testnum); return 0; # look successful } my @codepieces = getpart("client", "tool"); my $tool=""; if(@codepieces) { $tool = $codepieces[0]; chomp $tool; } # remove server output logfile unlink($SERVERIN); unlink($SERVER2IN); unlink($PROXYIN); if(@ftpservercmd) { # write the instructions to file writearray($FTPDCMD, \@ftpservercmd); } # get the command line options to use my @blaha; ($cmd, @blaha)= getpart("client", "command"); if($cmd) { # make some nice replace operations $cmd =~ s/\n//g; # no newlines please # substitute variables in the command line subVariables \$cmd; } else { # there was no command given, use something silly $cmd="-"; } if($has_memory_tracking) { unlink($memdump); } # create a (possibly-empty) file before starting the test my @inputfile=getpart("client", "file"); my %fileattr = getpartattr("client", "file"); my $filename=$fileattr{'name'}; if(@inputfile || $filename) { if(!$filename) { logmsg "ERROR: section client=>file has no name attribute\n"; timestampskippedevents($testnum); return -1; } my $fileContent = join('', @inputfile); subVariables \$fileContent; # logmsg "DEBUG: writing file " . $filename . "\n"; open(OUTFILE, ">$filename"); binmode OUTFILE; # for crapage systems, use binary print OUTFILE $fileContent; close(OUTFILE); } my %cmdhash = getpartattr("client", "command"); my $out=""; if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-output/)) { #We may slap on --output! if (!@validstdout) { $out=" --output $CURLOUT "; } } my $serverlogslocktimeout = $defserverlogslocktimeout; if($cmdhash{'timeout'}) { # test is allowed to override default server logs lock timeout if($cmdhash{'timeout'} =~ /(\d+)/) { $serverlogslocktimeout = $1 if($1 >= 0); } } my $postcommanddelay = $defpostcommanddelay; if($cmdhash{'delay'}) { # test is allowed to specify a delay after command is executed if($cmdhash{'delay'} =~ /(\d+)/) { $postcommanddelay = $1 if($1 > 0); } } my $CMDLINE; my $cmdargs; my $cmdtype = $cmdhash{'type'} || "default"; my $fail_due_event_based = $evbased; if($cmdtype eq "perl") { # run the command line prepended with "perl" $cmdargs ="$cmd"; $CMDLINE = "perl "; $tool=$CMDLINE; $disablevalgrind=1; } elsif($cmdtype eq "shell") { # run the command line prepended with "/bin/sh" $cmdargs ="$cmd"; $CMDLINE = "/bin/sh "; $tool=$CMDLINE; $disablevalgrind=1; } elsif(!$tool) { # run curl, add suitable command line options $cmd = "-1 ".$cmd if(exists $feature{"SSL"} && ($has_axtls)); my $inc=""; if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-include/)) { $inc = " --include"; } $cmdargs = "$out$inc "; $cmdargs .= "--trace-ascii log/trace$testnum "; $cmdargs .= "--trace-time "; if($evbased) { $cmdargs .= "--test-event "; $fail_due_event_based--; } $cmdargs .= $cmd; } else { $cmdargs = " $cmd"; # $cmd is the command line for the test file $CURLOUT = $STDOUT; # sends received data to stdout if($tool =~ /^lib/) { $CMDLINE="$LIBDIR/$tool"; } elsif($tool =~ /^unit/) { $CMDLINE="$UNITDIR/$tool"; } if(! -f $CMDLINE) { logmsg "The tool set in the test case for this: '$tool' does not exist\n"; timestampskippedevents($testnum); return -1; } $DBGCURL=$CMDLINE; } if($fail_due_event_based) { logmsg "This test cannot run event based\n"; return -1; } my @stdintest = getpart("client", "stdin"); if(@stdintest) { my $stdinfile="$LOGDIR/stdin-for-$testnum"; my %hash = getpartattr("client", "stdin"); if($hash{'nonewline'}) { # cut off the final newline from the final line of the stdin data chomp($stdintest[$#stdintest]); } writearray($stdinfile, \@stdintest); $cmdargs .= " <$stdinfile"; } if(!$tool) { $CMDLINE="$CURL"; } my $usevalgrind; if($valgrind && !$disablevalgrind) { my @valgrindoption = getpart("verify", "valgrind"); if((!@valgrindoption) || ($valgrindoption[0] !~ /disable/)) { $usevalgrind = 1; my $valgrindcmd = "$valgrind "; $valgrindcmd .= "$valgrind_tool " if($valgrind_tool); $valgrindcmd .= "--leak-check=yes "; $valgrindcmd .= "--suppressions=$srcdir/valgrind.supp "; $valgrindcmd .= "--num-callers=16 "; $valgrindcmd .= "${valgrind_logfile}=$LOGDIR/valgrind$testnum"; $CMDLINE = "$valgrindcmd $CMDLINE"; } } $CMDLINE .= "$cmdargs >$STDOUT 2>$STDERR"; if($verbose) { logmsg "$CMDLINE\n"; } print CMDLOG "$CMDLINE\n"; unlink("core"); my $dumped_core; my $cmdres; # Apr 2007: precommand isn't being used and could be removed my @precommand= getpart("client", "precommand"); if($precommand[0]) { # this is pure perl to eval! my $code = join("", @precommand); eval $code; if($@) { logmsg "perl: $code\n"; logmsg "precommand: $@"; stopservers($verbose); timestampskippedevents($testnum); return -1; } } if($gdbthis) { my $gdbinit = "$TESTDIR/gdbinit$testnum"; open(GDBCMD, ">$LOGDIR/gdbcmd"); print GDBCMD "set args $cmdargs\n"; print GDBCMD "show args\n"; print GDBCMD "source $gdbinit\n" if -e $gdbinit; close(GDBCMD); } # timestamp starting of test command $timetoolini{$testnum} = Time::HiRes::time() if($timestats); # run the command line we built if ($torture) { $cmdres = torture($CMDLINE, "$gdb --directory libtest $DBGCURL -x $LOGDIR/gdbcmd"); } elsif($gdbthis) { my $GDBW = ($gdbxwin) ? "-w" : ""; runclient("$gdb --directory libtest $DBGCURL $GDBW -x $LOGDIR/gdbcmd"); $cmdres=0; # makes it always continue after a debugged run } else { $cmdres = runclient("$CMDLINE"); my $signal_num = $cmdres & 127; $dumped_core = $cmdres & 128; if(!$anyway && ($signal_num || $dumped_core)) { $cmdres = 1000; } else { $cmdres >>= 8; $cmdres = (2000 + $signal_num) if($signal_num && !$cmdres); } } # timestamp finishing of test command $timetoolend{$testnum} = Time::HiRes::time() if($timestats); if(!$dumped_core) { if(-r "core") { # there's core file present now! $dumped_core = 1; } } if($dumped_core) { logmsg "core dumped\n"; if(0 && $gdb) { logmsg "running gdb for post-mortem analysis:\n"; open(GDBCMD, ">$LOGDIR/gdbcmd2"); print GDBCMD "bt\n"; close(GDBCMD); runclient("$gdb --directory libtest -x $LOGDIR/gdbcmd2 -batch $DBGCURL core "); # unlink("$LOGDIR/gdbcmd2"); } } # If a server logs advisor read lock file exists, it is an indication # that the server has not yet finished writing out all its log files, # including server request log files used for protocol verification. # So, if the lock file exists the script waits here a certain amount # of time until the server removes it, or the given time expires. if($serverlogslocktimeout) { my $lockretry = $serverlogslocktimeout * 20; while((-f $SERVERLOGS_LOCK) && $lockretry--) { select(undef, undef, undef, 0.05); } if(($lockretry < 0) && ($serverlogslocktimeout >= $defserverlogslocktimeout)) { logmsg "Warning: server logs lock timeout ", "($serverlogslocktimeout seconds) expired\n"; } } # Test harness ssh server does not have this synchronization mechanism, # this implies that some ssh server based tests might need a small delay # once that the client command has run to avoid false test failures. # # gnutls-serv also lacks this synchronization mechanism, so gnutls-serv # based tests might need a small delay once that the client command has # run to avoid false test failures. sleep($postcommanddelay) if($postcommanddelay); # timestamp removal of server logs advisor read lock $timesrvrlog{$testnum} = Time::HiRes::time() if($timestats); # test definition might instruct to stop some servers # stop also all servers relative to the given one my @killtestservers = getpart("client", "killserver"); if(@killtestservers) { # # All servers relative to the given one must be stopped also # my @killservers; foreach my $server (@killtestservers) { chomp $server; if($server =~ /^(ftp|http|imap|pop3|smtp)s((\d*)(-ipv6|))$/) { # given a stunnel ssl server, also kill non-ssl underlying one push @killservers, "${1}${2}"; } elsif($server =~ /^(ftp|http|imap|pop3|smtp)((\d*)(-ipv6|))$/) { # given a non-ssl server, also kill stunnel piggybacking one push @killservers, "${1}s${2}"; } elsif($server =~ /^(socks)((\d*)(-ipv6|))$/) { # given a socks server, also kill ssh underlying one push @killservers, "ssh${2}"; } elsif($server =~ /^(ssh)((\d*)(-ipv6|))$/) { # given a ssh server, also kill socks piggybacking one push @killservers, "socks${2}"; } push @killservers, $server; } # # kill sockfilter processes for pingpong relative servers # foreach my $server (@killservers) { if($server =~ /^(ftp|imap|pop3|smtp)s?(\d*)(-ipv6|)$/) { my $proto = $1; my $idnum = ($2 && ($2 > 1)) ? $2 : 1; my $ipvnum = ($3 && ($3 =~ /6$/)) ? 6 : 4; killsockfilters($proto, $ipvnum, $idnum, $verbose); } } # # kill server relative pids clearing them in %run hash # my $pidlist; foreach my $server (@killservers) { if($run{$server}) { $pidlist .= "$run{$server} "; $run{$server} = 0; } $runcert{$server} = 0 if($runcert{$server}); } killpid($verbose, $pidlist); # # cleanup server pid files # foreach my $server (@killservers) { my $pidfile = $serverpidfile{$server}; my $pid = processexists($pidfile); if($pid > 0) { logmsg "Warning: $server server unexpectedly alive\n"; killpid($verbose, $pid); } unlink($pidfile) if(-f $pidfile); } } # remove the test server commands file after each test unlink($FTPDCMD) if(-f $FTPDCMD); # run the postcheck command my @postcheck= getpart("client", "postcheck"); if(@postcheck) { $cmd = $postcheck[0]; chomp $cmd; subVariables \$cmd; if($cmd) { logmsg "postcheck $cmd\n" if($verbose); my $rc = runclient("$cmd"); # Must run the postcheck command in torture mode in order # to clean up, but the result can't be relied upon. if($rc != 0 && !$torture) { logmsg " postcheck FAILED\n"; # timestamp test result verification end $timevrfyend{$testnum} = Time::HiRes::time() if($timestats); return 1; } } } # restore environment variables that were modified if(%oldenv) { foreach my $var (keys %oldenv) { if($oldenv{$var} eq 'notset') { delete $ENV{$var} if($ENV{$var}); } else { $ENV{$var} = "$oldenv{$var}"; } } } # Skip all the verification on torture tests if ($torture) { if(!$cmdres && !$keepoutfiles) { cleardir($LOGDIR); } # timestamp test result verification end $timevrfyend{$testnum} = Time::HiRes::time() if($timestats); return $cmdres; } my @err = getpart("verify", "errorcode"); my $errorcode = $err[0] || "0"; my $ok=""; my $res; chomp $errorcode; if (@validstdout) { # verify redirected stdout my @actual = loadarray($STDOUT); # variable-replace in the stdout we have from the test case file @validstdout = fixarray(@validstdout); # get all attributes my %hash = getpartattr("verify", "stdout"); # get the mode attribute my $filemode=$hash{'mode'}; if($filemode && ($filemode eq "text") && $has_textaware) { # text mode when running on windows: fix line endings map s/\r\n/\n/g, @actual; } if($hash{'nonewline'}) { # Yes, we must cut off the final newline from the final line # of the protocol data chomp($validstdout[$#validstdout]); } $res = compare($testnum, $testname, "stdout", \@actual, \@validstdout); if($res) { return 1; } $ok .= "s"; } else { $ok .= "-"; # stdout not checked } my %replyattr = getpartattr("reply", "data"); if(!$replyattr{'nocheck'} && (@reply || $replyattr{'sendzero'})) { # verify the received data my @out = loadarray($CURLOUT); my %hash = getpartattr("reply", "data"); # get the mode attribute my $filemode=$hash{'mode'}; if($filemode && ($filemode eq "text") && $has_textaware) { # text mode when running on windows: fix line endings map s/\r\n/\n/g, @out; } $res = compare($testnum, $testname, "data", \@out, \@reply); if ($res) { return 1; } $ok .= "d"; } else { $ok .= "-"; # data not checked } if(@upload) { # verify uploaded data my @out = loadarray("$LOGDIR/upload.$testnum"); $res = compare($testnum, $testname, "upload", \@out, \@upload); if ($res) { return 1; } $ok .= "u"; } else { $ok .= "-"; # upload not checked } if(@protocol) { # Verify the sent request my @out = loadarray($SERVERIN); # what to cut off from the live protocol sent by curl my @strip = getpart("verify", "strip"); my @protstrip=@protocol; # check if there's any attributes on the verify/protocol section my %hash = getpartattr("verify", "protocol"); if($hash{'nonewline'}) { # Yes, we must cut off the final newline from the final line # of the protocol data chomp($protstrip[$#protstrip]); } for(@strip) { # strip off all lines that match the patterns from both arrays chomp $_; @out = striparray( $_, \@out); @protstrip= striparray( $_, \@protstrip); } # what parts to cut off from the protocol my @strippart = getpart("verify", "strippart"); my $strip; for $strip (@strippart) { chomp $strip; for(@out) { eval $strip; } } $res = compare($testnum, $testname, "protocol", \@out, \@protstrip); if($res) { return 1; } $ok .= "p"; } else { $ok .= "-"; # protocol not checked } if(@proxyprot) { # Verify the sent proxy request my @out = loadarray($PROXYIN); # what to cut off from the live protocol sent by curl, we use the # same rules as for my @strip = getpart("verify", "strip"); my @protstrip=@proxyprot; # check if there's any attributes on the verify/protocol section my %hash = getpartattr("verify", "proxy"); if($hash{'nonewline'}) { # Yes, we must cut off the final newline from the final line # of the protocol data chomp($protstrip[$#protstrip]); } for(@strip) { # strip off all lines that match the patterns from both arrays chomp $_; @out = striparray( $_, \@out); @protstrip= striparray( $_, \@protstrip); } # what parts to cut off from the protocol my @strippart = getpart("verify", "strippart"); my $strip; for $strip (@strippart) { chomp $strip; for(@out) { eval $strip; } } $res = compare($testnum, $testname, "proxy", \@out, \@protstrip); if($res) { return 1; } $ok .= "P"; } else { $ok .= "-"; # protocol not checked } my $outputok; for my $partsuffix (('', '1', '2', '3', '4')) { my @outfile=getpart("verify", "file".$partsuffix); if(@outfile || partexists("verify", "file".$partsuffix) ) { # we're supposed to verify a dynamically generated file! my %hash = getpartattr("verify", "file".$partsuffix); my $filename=$hash{'name'}; if(!$filename) { logmsg "ERROR: section verify=>file$partsuffix ". "has no name attribute\n"; stopservers($verbose); # timestamp test result verification end $timevrfyend{$testnum} = Time::HiRes::time() if($timestats); return -1; } my @generated=loadarray($filename); # what parts to cut off from the file my @stripfile = getpart("verify", "stripfile".$partsuffix); my $filemode=$hash{'mode'}; if($filemode && ($filemode eq "text") && $has_textaware) { # text mode when running on windows means adding an extra # strip expression push @stripfile, "s/\r\n/\n/"; } my $strip; for $strip (@stripfile) { chomp $strip; for(@generated) { eval $strip; } } @outfile = fixarray(@outfile); $res = compare($testnum, $testname, "output ($filename)", \@generated, \@outfile); if($res) { return 1; } $outputok = 1; # output checked } } $ok .= ($outputok) ? "o" : "-"; # output checked or not # accept multiple comma-separated error codes my @splerr = split(/ *, */, $errorcode); my $errok; foreach my $e (@splerr) { if($e == $cmdres) { # a fine error code $errok = 1; last; } } if($errok) { $ok .= "e"; } else { if(!$short) { logmsg sprintf("\n%s returned $cmdres, when expecting %s\n", (!$tool)?"curl":$tool, $errorcode); } logmsg " exit FAILED\n"; # timestamp test result verification end $timevrfyend{$testnum} = Time::HiRes::time() if($timestats); return 1; } if($has_memory_tracking) { if(! -f $memdump) { logmsg "\n** ALERT! memory tracking with no output file?\n" if(!$cmdtype eq "perl"); } else { my @memdata=`$memanalyze $memdump`; my $leak=0; for(@memdata) { if($_ ne "") { # well it could be other memory problems as well, but # we call it leak for short here $leak=1; } } if($leak) { logmsg "\n** MEMORY FAILURE\n"; logmsg @memdata; # timestamp test result verification end $timevrfyend{$testnum} = Time::HiRes::time() if($timestats); return 1; } else { $ok .= "m"; } } } else { $ok .= "-"; # memory not checked } if($valgrind) { if($usevalgrind) { unless(opendir(DIR, "$LOGDIR")) { logmsg "ERROR: unable to read $LOGDIR\n"; # timestamp test result verification end $timevrfyend{$testnum} = Time::HiRes::time() if($timestats); return 1; } my @files = readdir(DIR); closedir(DIR); my $vgfile; foreach my $file (@files) { if($file =~ /^valgrind$testnum(\..*|)$/) { $vgfile = $file; last; } } if(!$vgfile) { logmsg "ERROR: valgrind log file missing for test $testnum\n"; # timestamp test result verification end $timevrfyend{$testnum} = Time::HiRes::time() if($timestats); return 1; } my @e = valgrindparse($srcdir, $feature{'SSL'}, "$LOGDIR/$vgfile"); if(@e && $e[0]) { if($automakestyle) { logmsg "FAIL: $testnum - $testname - valgrind\n"; } else { logmsg " valgrind ERROR "; logmsg @e; } # timestamp test result verification end $timevrfyend{$testnum} = Time::HiRes::time() if($timestats); return 1; } $ok .= "v"; } else { if(!$short && !$disablevalgrind) { logmsg " valgrind SKIPPED\n"; } $ok .= "-"; # skipped } } else { $ok .= "-"; # valgrind not checked } # add 'E' for event-based $ok .= $evbased ? "E" : "-"; logmsg "$ok " if(!$short); my $sofar= time()-$start; my $esttotal = $sofar/$count * $total; my $estleft = $esttotal - $sofar; my $left=sprintf("remaining: %02d:%02d", $estleft/60, $estleft%60); if(!$automakestyle) { logmsg sprintf("OK (%-3d out of %-3d, %s)\n", $count, $total, $left); } else { logmsg "PASS: $testnum - $testname\n"; } # the test succeeded, remove all log files if(!$keepoutfiles) { cleardir($LOGDIR); } # timestamp test result verification end $timevrfyend{$testnum} = Time::HiRes::time() if($timestats); return 0; } ####################################################################### # Stop all running test servers # sub stopservers { my $verbose = $_[0]; # # kill sockfilter processes for all pingpong servers # killallsockfilters($verbose); # # kill all server pids from %run hash clearing them # my $pidlist; foreach my $server (keys %run) { if($run{$server}) { if($verbose) { my $prev = 0; my $pids = $run{$server}; foreach my $pid (split(' ', $pids)) { if($pid != $prev) { logmsg sprintf("* kill pid for %s => %d\n", $server, $pid); $prev = $pid; } } } $pidlist .= "$run{$server} "; $run{$server} = 0; } $runcert{$server} = 0 if($runcert{$server}); } killpid($verbose, $pidlist); # # cleanup all server pid files # foreach my $server (keys %serverpidfile) { my $pidfile = $serverpidfile{$server}; my $pid = processexists($pidfile); if($pid > 0) { logmsg "Warning: $server server unexpectedly alive\n"; killpid($verbose, $pid); } unlink($pidfile) if(-f $pidfile); } } ####################################################################### # startservers() starts all the named servers # # Returns: string with error reason or blank for success # sub startservers { my @what = @_; my ($pid, $pid2); for(@what) { my (@whatlist) = split(/\s+/,$_); my $what = lc($whatlist[0]); $what =~ s/[^a-z0-9-]//g; my $certfile; if($what =~ /^(ftp|http|imap|pop3|smtp)s((\d*)(-ipv6|))$/) { $certfile = ($whatlist[1]) ? $whatlist[1] : 'stunnel.pem'; } if(($what eq "pop3") || ($what eq "ftp") || ($what eq "imap") || ($what eq "smtp")) { if($torture && $run{$what} && !responsive_pingpong_server($what, "", $verbose)) { stopserver($what); } if(!$run{$what}) { ($pid, $pid2) = runpingpongserver($what, "", $verbose); if($pid <= 0) { return "failed starting ". uc($what) ." server"; } printf ("* pid $what => %d %d\n", $pid, $pid2) if($verbose); $run{$what}="$pid $pid2"; } } elsif($what eq "ftp2") { if($torture && $run{'ftp2'} && !responsive_pingpong_server("ftp", "2", $verbose)) { stopserver('ftp2'); } if(!$run{'ftp2'}) { ($pid, $pid2) = runpingpongserver("ftp", "2", $verbose); if($pid <= 0) { return "failed starting FTP2 server"; } printf ("* pid ftp2 => %d %d\n", $pid, $pid2) if($verbose); $run{'ftp2'}="$pid $pid2"; } } elsif($what eq "ftp-ipv6") { if($torture && $run{'ftp-ipv6'} && !responsive_pingpong_server("ftp", "", $verbose, "ipv6")) { stopserver('ftp-ipv6'); } if(!$run{'ftp-ipv6'}) { ($pid, $pid2) = runpingpongserver("ftp", "", $verbose, "ipv6"); if($pid <= 0) { return "failed starting FTP-IPv6 server"; } logmsg sprintf("* pid ftp-ipv6 => %d %d\n", $pid, $pid2) if($verbose); $run{'ftp-ipv6'}="$pid $pid2"; } } elsif($what eq "gopher") { if($torture && $run{'gopher'} && !responsive_http_server("gopher", $verbose, 0, $GOPHERPORT)) { stopserver('gopher'); } if(!$run{'gopher'}) { ($pid, $pid2) = runhttpserver("gopher", $verbose, 0, $GOPHERPORT); if($pid <= 0) { return "failed starting GOPHER server"; } logmsg sprintf ("* pid gopher => %d %d\n", $pid, $pid2) if($verbose); $run{'gopher'}="$pid $pid2"; } } elsif($what eq "gopher-ipv6") { if($torture && $run{'gopher-ipv6'} && !responsive_http_server("gopher", $verbose, "ipv6", $GOPHER6PORT)) { stopserver('gopher-ipv6'); } if(!$run{'gopher-ipv6'}) { ($pid, $pid2) = runhttpserver("gopher", $verbose, "ipv6", $GOPHER6PORT); if($pid <= 0) { return "failed starting GOPHER-IPv6 server"; } logmsg sprintf("* pid gopher-ipv6 => %d %d\n", $pid, $pid2) if($verbose); $run{'gopher-ipv6'}="$pid $pid2"; } } elsif($what eq "http") { if($torture && $run{'http'} && !responsive_http_server("http", $verbose, 0, $HTTPPORT)) { stopserver('http'); } if(!$run{'http'}) { ($pid, $pid2) = runhttpserver("http", $verbose, 0, $HTTPPORT); if($pid <= 0) { return "failed starting HTTP server"; } logmsg sprintf ("* pid http => %d %d\n", $pid, $pid2) if($verbose); $run{'http'}="$pid $pid2"; } } elsif($what eq "http-proxy") { if($torture && $run{'http-proxy'} && !responsive_http_server("http", $verbose, "proxy", $HTTPPROXYPORT)) { stopserver('http-proxy'); } if(!$run{'http-proxy'}) { ($pid, $pid2) = runhttpserver("http", $verbose, "proxy", $HTTPPROXYPORT); if($pid <= 0) { return "failed starting HTTP-proxy server"; } logmsg sprintf ("* pid http-proxy => %d %d\n", $pid, $pid2) if($verbose); $run{'http-proxy'}="$pid $pid2"; } } elsif($what eq "http-ipv6") { if($torture && $run{'http-ipv6'} && !responsive_http_server("http", $verbose, "IPv6", $HTTP6PORT)) { stopserver('http-ipv6'); } if(!$run{'http-ipv6'}) { ($pid, $pid2) = runhttpserver("http", $verbose, "ipv6", $HTTP6PORT); if($pid <= 0) { return "failed starting HTTP-IPv6 server"; } logmsg sprintf("* pid http-ipv6 => %d %d\n", $pid, $pid2) if($verbose); $run{'http-ipv6'}="$pid $pid2"; } } elsif($what eq "http-pipe") { if($torture && $run{'http-pipe'} && !responsive_http_server("http", $verbose, "pipe", $HTTPPIPEPORT)) { stopserver('http-pipe'); } if(!$run{'http-pipe'}) { ($pid, $pid2) = runhttpserver("http", $verbose, "pipe", $HTTPPIPEPORT); if($pid <= 0) { return "failed starting HTTP-pipe server"; } logmsg sprintf ("* pid http-pipe => %d %d\n", $pid, $pid2) if($verbose); $run{'http-pipe'}="$pid $pid2"; } } elsif($what eq "rtsp") { if($torture && $run{'rtsp'} && !responsive_rtsp_server($verbose)) { stopserver('rtsp'); } if(!$run{'rtsp'}) { ($pid, $pid2) = runrtspserver($verbose); if($pid <= 0) { return "failed starting RTSP server"; } printf ("* pid rtsp => %d %d\n", $pid, $pid2) if($verbose); $run{'rtsp'}="$pid $pid2"; } } elsif($what eq "rtsp-ipv6") { if($torture && $run{'rtsp-ipv6'} && !responsive_rtsp_server($verbose, "IPv6")) { stopserver('rtsp-ipv6'); } if(!$run{'rtsp-ipv6'}) { ($pid, $pid2) = runrtspserver($verbose, "IPv6"); if($pid <= 0) { return "failed starting RTSP-IPv6 server"; } logmsg sprintf("* pid rtsp-ipv6 => %d %d\n", $pid, $pid2) if($verbose); $run{'rtsp-ipv6'}="$pid $pid2"; } } elsif($what eq "ftps") { if(!$stunnel) { # we can't run ftps tests without stunnel return "no stunnel"; } if(!$ssl_version) { # we can't run ftps tests if libcurl is SSL-less return "curl lacks SSL support"; } if($runcert{'ftps'} && ($runcert{'ftps'} ne $certfile)) { # stop server when running and using a different cert stopserver('ftps'); } if($torture && $run{'ftp'} && !responsive_pingpong_server("ftp", "", $verbose)) { stopserver('ftp'); } if(!$run{'ftp'}) { ($pid, $pid2) = runpingpongserver("ftp", "", $verbose); if($pid <= 0) { return "failed starting FTP server"; } printf ("* pid ftp => %d %d\n", $pid, $pid2) if($verbose); $run{'ftp'}="$pid $pid2"; } if(!$run{'ftps'}) { ($pid, $pid2) = runftpsserver($verbose, "", $certfile); if($pid <= 0) { return "failed starting FTPS server (stunnel)"; } logmsg sprintf("* pid ftps => %d %d\n", $pid, $pid2) if($verbose); $run{'ftps'}="$pid $pid2"; } } elsif($what eq "file") { # we support it but have no server! } elsif($what eq "https") { if(!$stunnel) { # we can't run https tests without stunnel return "no stunnel"; } if(!$ssl_version) { # we can't run https tests if libcurl is SSL-less return "curl lacks SSL support"; } if($runcert{'https'} && ($runcert{'https'} ne $certfile)) { # stop server when running and using a different cert stopserver('https'); } if($torture && $run{'http'} && !responsive_http_server("http", $verbose, 0, $HTTPPORT)) { stopserver('http'); } if(!$run{'http'}) { ($pid, $pid2) = runhttpserver("http", $verbose, 0, $HTTPPORT); if($pid <= 0) { return "failed starting HTTP server"; } printf ("* pid http => %d %d\n", $pid, $pid2) if($verbose); $run{'http'}="$pid $pid2"; } if(!$run{'https'}) { ($pid, $pid2) = runhttpsserver($verbose, "", $certfile); if($pid <= 0) { return "failed starting HTTPS server (stunnel)"; } logmsg sprintf("* pid https => %d %d\n", $pid, $pid2) if($verbose); $run{'https'}="$pid $pid2"; } } elsif($what eq "httptls") { if(!$httptlssrv) { # for now, we can't run http TLS-EXT tests without gnutls-serv return "no gnutls-serv"; } if($torture && $run{'httptls'} && !responsive_httptls_server($verbose, "IPv4")) { stopserver('httptls'); } if(!$run{'httptls'}) { ($pid, $pid2) = runhttptlsserver($verbose, "IPv4"); if($pid <= 0) { return "failed starting HTTPTLS server (gnutls-serv)"; } logmsg sprintf("* pid httptls => %d %d\n", $pid, $pid2) if($verbose); $run{'httptls'}="$pid $pid2"; } } elsif($what eq "httptls-ipv6") { if(!$httptlssrv) { # for now, we can't run http TLS-EXT tests without gnutls-serv return "no gnutls-serv"; } if($torture && $run{'httptls-ipv6'} && !responsive_httptls_server($verbose, "IPv6")) { stopserver('httptls-ipv6'); } if(!$run{'httptls-ipv6'}) { ($pid, $pid2) = runhttptlsserver($verbose, "IPv6"); if($pid <= 0) { return "failed starting HTTPTLS-IPv6 server (gnutls-serv)"; } logmsg sprintf("* pid httptls-ipv6 => %d %d\n", $pid, $pid2) if($verbose); $run{'httptls-ipv6'}="$pid $pid2"; } } elsif($what eq "tftp") { if($torture && $run{'tftp'} && !responsive_tftp_server("", $verbose)) { stopserver('tftp'); } if(!$run{'tftp'}) { ($pid, $pid2) = runtftpserver("", $verbose); if($pid <= 0) { return "failed starting TFTP server"; } printf ("* pid tftp => %d %d\n", $pid, $pid2) if($verbose); $run{'tftp'}="$pid $pid2"; } } elsif($what eq "tftp-ipv6") { if($torture && $run{'tftp-ipv6'} && !responsive_tftp_server("", $verbose, "IPv6")) { stopserver('tftp-ipv6'); } if(!$run{'tftp-ipv6'}) { ($pid, $pid2) = runtftpserver("", $verbose, "IPv6"); if($pid <= 0) { return "failed starting TFTP-IPv6 server"; } printf("* pid tftp-ipv6 => %d %d\n", $pid, $pid2) if($verbose); $run{'tftp-ipv6'}="$pid $pid2"; } } elsif($what eq "sftp" || $what eq "scp" || $what eq "socks4" || $what eq "socks5" ) { if(!$run{'ssh'}) { ($pid, $pid2) = runsshserver("", $verbose); if($pid <= 0) { return "failed starting SSH server"; } printf ("* pid ssh => %d %d\n", $pid, $pid2) if($verbose); $run{'ssh'}="$pid $pid2"; } if($what eq "socks4" || $what eq "socks5") { if(!$run{'socks'}) { ($pid, $pid2) = runsocksserver("", $verbose); if($pid <= 0) { return "failed starting socks server"; } printf ("* pid socks => %d %d\n", $pid, $pid2) if($verbose); $run{'socks'}="$pid $pid2"; } } if($what eq "socks5") { if(!$sshdid) { # Not an OpenSSH or SunSSH ssh daemon logmsg "Not OpenSSH or SunSSH; socks5 tests need at least OpenSSH 3.7\n"; return "failed starting socks5 server"; } elsif(($sshdid =~ /OpenSSH/) && ($sshdvernum < 370)) { # Need OpenSSH 3.7 for socks5 - http://www.openssh.com/txt/release-3.7 logmsg "$sshdverstr insufficient; socks5 tests need at least OpenSSH 3.7\n"; return "failed starting socks5 server"; } elsif(($sshdid =~ /SunSSH/) && ($sshdvernum < 100)) { # Need SunSSH 1.0 for socks5 logmsg "$sshdverstr insufficient; socks5 tests need at least SunSSH 1.0\n"; return "failed starting socks5 server"; } } } elsif($what eq "none") { logmsg "* starts no server\n" if ($verbose); } else { warn "we don't support a server for $what"; return "no server for $what"; } } return 0; } ############################################################################## # This function makes sure the right set of server is running for the # specified test case. This is a useful design when we run single tests as not # all servers need to run then! # # Returns: a string, blank if everything is fine or a reason why it failed # sub serverfortest { my ($testnum)=@_; my @what = getpart("client", "server"); if(!$what[0]) { warn "Test case $testnum has no server(s) specified"; return "no server specified"; } for(my $i = scalar(@what) - 1; $i >= 0; $i--) { my $srvrline = $what[$i]; chomp $srvrline if($srvrline); if($srvrline =~ /^(\S+)((\s*)(.*))/) { my $server = "${1}"; my $lnrest = "${2}"; my $tlsext; if($server =~ /^(httptls)(\+)(ext|srp)(\d*)(-ipv6|)$/) { $server = "${1}${4}${5}"; $tlsext = uc("TLS-${3}"); } if(! grep /^\Q$server\E$/, @protocols) { if(substr($server,0,5) ne "socks") { if($tlsext) { return "curl lacks $tlsext support"; } else { return "curl lacks $server server support"; } } } $what[$i] = "$server$lnrest" if($tlsext); } } return &startservers(@what); } ####################################################################### # runtimestats displays test-suite run time statistics # sub runtimestats { my $lasttest = $_[0]; return if(not $timestats); logmsg "\nTest suite total running time breakdown per task...\n\n"; my @timesrvr; my @timeprep; my @timetool; my @timelock; my @timevrfy; my @timetest; my $timesrvrtot = 0.0; my $timepreptot = 0.0; my $timetooltot = 0.0; my $timelocktot = 0.0; my $timevrfytot = 0.0; my $timetesttot = 0.0; my $counter; for my $testnum (1 .. $lasttest) { if($timesrvrini{$testnum}) { $timesrvrtot += $timesrvrend{$testnum} - $timesrvrini{$testnum}; $timepreptot += (($timetoolini{$testnum} - $timeprepini{$testnum}) - ($timesrvrend{$testnum} - $timesrvrini{$testnum})); $timetooltot += $timetoolend{$testnum} - $timetoolini{$testnum}; $timelocktot += $timesrvrlog{$testnum} - $timetoolend{$testnum}; $timevrfytot += $timevrfyend{$testnum} - $timesrvrlog{$testnum}; $timetesttot += $timevrfyend{$testnum} - $timeprepini{$testnum}; push @timesrvr, sprintf("%06.3f %04d", $timesrvrend{$testnum} - $timesrvrini{$testnum}, $testnum); push @timeprep, sprintf("%06.3f %04d", ($timetoolini{$testnum} - $timeprepini{$testnum}) - ($timesrvrend{$testnum} - $timesrvrini{$testnum}), $testnum); push @timetool, sprintf("%06.3f %04d", $timetoolend{$testnum} - $timetoolini{$testnum}, $testnum); push @timelock, sprintf("%06.3f %04d", $timesrvrlog{$testnum} - $timetoolend{$testnum}, $testnum); push @timevrfy, sprintf("%06.3f %04d", $timevrfyend{$testnum} - $timesrvrlog{$testnum}, $testnum); push @timetest, sprintf("%06.3f %04d", $timevrfyend{$testnum} - $timeprepini{$testnum}, $testnum); } } { no warnings 'numeric'; @timesrvr = sort { $b <=> $a } @timesrvr; @timeprep = sort { $b <=> $a } @timeprep; @timetool = sort { $b <=> $a } @timetool; @timelock = sort { $b <=> $a } @timelock; @timevrfy = sort { $b <=> $a } @timevrfy; @timetest = sort { $b <=> $a } @timetest; } logmsg "Spent ". sprintf("%08.3f ", $timesrvrtot) . "seconds starting and verifying test harness servers.\n"; logmsg "Spent ". sprintf("%08.3f ", $timepreptot) . "seconds reading definitions and doing test preparations.\n"; logmsg "Spent ". sprintf("%08.3f ", $timetooltot) . "seconds actually running test tools.\n"; logmsg "Spent ". sprintf("%08.3f ", $timelocktot) . "seconds awaiting server logs lock removal.\n"; logmsg "Spent ". sprintf("%08.3f ", $timevrfytot) . "seconds verifying test results.\n"; logmsg "Spent ". sprintf("%08.3f ", $timetesttot) . "seconds doing all of the above.\n"; $counter = 25; logmsg "\nTest server starting and verification time per test ". sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full"); logmsg "-time- test\n"; logmsg "------ ----\n"; foreach my $txt (@timesrvr) { last if((not $fullstats) && (not $counter--)); logmsg "$txt\n"; } $counter = 10; logmsg "\nTest definition reading and preparation time per test ". sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full"); logmsg "-time- test\n"; logmsg "------ ----\n"; foreach my $txt (@timeprep) { last if((not $fullstats) && (not $counter--)); logmsg "$txt\n"; } $counter = 25; logmsg "\nTest tool execution time per test ". sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full"); logmsg "-time- test\n"; logmsg "------ ----\n"; foreach my $txt (@timetool) { last if((not $fullstats) && (not $counter--)); logmsg "$txt\n"; } $counter = 15; logmsg "\nTest server logs lock removal time per test ". sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full"); logmsg "-time- test\n"; logmsg "------ ----\n"; foreach my $txt (@timelock) { last if((not $fullstats) && (not $counter--)); logmsg "$txt\n"; } $counter = 10; logmsg "\nTest results verification time per test ". sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full"); logmsg "-time- test\n"; logmsg "------ ----\n"; foreach my $txt (@timevrfy) { last if((not $fullstats) && (not $counter--)); logmsg "$txt\n"; } $counter = 50; logmsg "\nTotal time per test ". sprintf("(%s)...\n\n", (not $fullstats)?"top $counter":"full"); logmsg "-time- test\n"; logmsg "------ ----\n"; foreach my $txt (@timetest) { last if((not $fullstats) && (not $counter--)); logmsg "$txt\n"; } logmsg "\n"; } ####################################################################### # Check options to this test program # my $number=0; my $fromnum=-1; my @testthis; while(@ARGV) { if ($ARGV[0] eq "-v") { # verbose output $verbose=1; } elsif($ARGV[0] =~ /^-b(.*)/) { my $portno=$1; if($portno =~ s/(\d+)$//) { $base = int $1; } } elsif ($ARGV[0] eq "-c") { # use this path to curl instead of default $DBGCURL=$CURL=$ARGV[1]; shift @ARGV; } elsif ($ARGV[0] eq "-vc") { # use this path to a curl used to verify servers # Particularly useful when you introduce a crashing bug somewhere in # the development version as then it won't be able to run any tests # since it can't verify the servers! $VCURL=$ARGV[1]; shift @ARGV; } elsif ($ARGV[0] eq "-d") { # have the servers display protocol output $debugprotocol=1; } elsif ($ARGV[0] eq "-g") { # run this test with gdb $gdbthis=1; } elsif ($ARGV[0] eq "-gw") { # run this test with windowed gdb $gdbthis=1; $gdbxwin=1; } elsif($ARGV[0] eq "-s") { # short output $short=1; } elsif($ARGV[0] eq "-am") { # automake-style output $short=1; $automakestyle=1; } elsif($ARGV[0] eq "-n") { # no valgrind undef $valgrind; } elsif($ARGV[0] =~ /^-t(.*)/) { # torture $torture=1; my $xtra = $1; if($xtra =~ s/(\d+)$//) { $tortalloc = $1; } # we undef valgrind to make this fly in comparison undef $valgrind; } elsif($ARGV[0] eq "-a") { # continue anyway, even if a test fail $anyway=1; } elsif($ARGV[0] eq "-e") { # run the tests cases event based if possible $run_event_based=1; } elsif($ARGV[0] eq "-p") { $postmortem=1; } elsif($ARGV[0] eq "-l") { # lists the test case names only $listonly=1; } elsif($ARGV[0] eq "-k") { # keep stdout and stderr files after tests $keepoutfiles=1; } elsif($ARGV[0] eq "-r") { # run time statistics needs Time::HiRes if($Time::HiRes::VERSION) { keys(%timeprepini) = 1000; keys(%timesrvrini) = 1000; keys(%timesrvrend) = 1000; keys(%timetoolini) = 1000; keys(%timetoolend) = 1000; keys(%timesrvrlog) = 1000; keys(%timevrfyend) = 1000; $timestats=1; $fullstats=0; } } elsif($ARGV[0] eq "-rf") { # run time statistics needs Time::HiRes if($Time::HiRes::VERSION) { keys(%timeprepini) = 1000; keys(%timesrvrini) = 1000; keys(%timesrvrend) = 1000; keys(%timetoolini) = 1000; keys(%timetoolend) = 1000; keys(%timesrvrlog) = 1000; keys(%timevrfyend) = 1000; $timestats=1; $fullstats=1; } } elsif(($ARGV[0] eq "-h") || ($ARGV[0] eq "--help")) { # show help text print <= 0) { for($fromnum .. $number) { push @testthis, $_; } $fromnum = -1; } else { push @testthis, $1; } } elsif($ARGV[0] =~ /^to$/i) { $fromnum = $number+1; } elsif($ARGV[0] =~ /^!(\d+)/) { $fromnum = -1; $disabled{$1}=$1; } elsif($ARGV[0] =~ /^!(.+)/) { $disabled_keywords{$1}=$1; } elsif($ARGV[0] =~ /^([-[{a-zA-Z].*)/) { $enabled_keywords{$1}=$1; } else { print "Unknown option: $ARGV[0]\n"; exit; } shift @ARGV; } if(@testthis && ($testthis[0] ne "")) { $TESTCASES=join(" ", @testthis); } if($valgrind) { # we have found valgrind on the host, use it # verify that we can invoke it fine my $code = runclient("valgrind >/dev/null 2>&1"); if(($code>>8) != 1) { #logmsg "Valgrind failure, disable it\n"; undef $valgrind; } else { # since valgrind 2.1.x, '--tool' option is mandatory # use it, if it is supported by the version installed on the system runclient("valgrind --help 2>&1 | grep -- --tool > /dev/null 2>&1"); if (($? >> 8)==0) { $valgrind_tool="--tool=memcheck"; } open(C, "<$CURL"); my $l = ; if($l =~ /^\#\!/) { # A shell script. This is typically when built with libtool, $valgrind="../libtool --mode=execute $valgrind"; } close(C); # valgrind 3 renamed the --logfile option to --log-file!!! my $ver=join(' ', runclientoutput("valgrind --version")); # cut off all but digits and dots $ver =~ s/[^0-9.]//g; if($ver =~ /^(\d+)/) { $ver = $1; if($ver >= 3) { $valgrind_logfile="--log-file"; } } } } if ($gdbthis) { # open the executable curl and read the first 4 bytes of it open(CHECK, "<$CURL"); my $c; sysread CHECK, $c, 4; close(CHECK); if($c eq "#! /") { # A shell script. This is typically when built with libtool, $libtool = 1; $gdb = "libtool --mode=execute gdb"; } } $HTTPPORT = $base++; # HTTP server port $HTTPSPORT = $base++; # HTTPS (stunnel) server port $FTPPORT = $base++; # FTP server port $FTPSPORT = $base++; # FTPS (stunnel) server port $HTTP6PORT = $base++; # HTTP IPv6 server port $FTP2PORT = $base++; # FTP server 2 port $FTP6PORT = $base++; # FTP IPv6 port $TFTPPORT = $base++; # TFTP (UDP) port $TFTP6PORT = $base++; # TFTP IPv6 (UDP) port $SSHPORT = $base++; # SSH (SCP/SFTP) port $SOCKSPORT = $base++; # SOCKS port $POP3PORT = $base++; # POP3 server port $POP36PORT = $base++; # POP3 IPv6 server port $IMAPPORT = $base++; # IMAP server port $IMAP6PORT = $base++; # IMAP IPv6 server port $SMTPPORT = $base++; # SMTP server port $SMTP6PORT = $base++; # SMTP IPv6 server port $RTSPPORT = $base++; # RTSP server port $RTSP6PORT = $base++; # RTSP IPv6 server port $GOPHERPORT = $base++; # Gopher IPv4 server port $GOPHER6PORT = $base++; # Gopher IPv6 server port $HTTPTLSPORT = $base++; # HTTP TLS (non-stunnel) server port $HTTPTLS6PORT = $base++; # HTTP TLS (non-stunnel) IPv6 server port $HTTPPROXYPORT = $base++; # HTTP proxy port, when using CONNECT $HTTPPIPEPORT = $base++; # HTTP pipelining port ####################################################################### # clear and create logging directory: # cleardir($LOGDIR); mkdir($LOGDIR, 0777); ####################################################################### # initialize some variables # get_disttests(); init_serverpidfile_hash(); ####################################################################### # Output curl version and host info being tested # if(!$listonly) { checksystem(); } ####################################################################### # Fetch all disabled tests # open(D, "<$TESTDIR/DISABLED"); while() { if(/^ *\#/) { # allow comments next; } if($_ =~ /(\d+)/) { $disabled{$1}=$1; # disable this test number } } close(D); ####################################################################### # If 'all' tests are requested, find out all test numbers # if ( $TESTCASES eq "all") { # Get all commands and find out their test numbers opendir(DIR, $TESTDIR) || die "can't opendir $TESTDIR: $!"; my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR); closedir(DIR); $TESTCASES=""; # start with no test cases # cut off everything but the digits for(@cmds) { $_ =~ s/[a-z\/\.]*//g; } # sort the numbers from low to high foreach my $n (sort { $a <=> $b } @cmds) { if($disabled{$n}) { # skip disabled test cases my $why = "configured as DISABLED"; $skipped++; $skipped{$why}++; $teststat[$n]=$why; # store reason for this test case next; } $TESTCASES .= " $n"; } } ####################################################################### # Start the command line log # open(CMDLOG, ">$CURLLOG") || logmsg "can't log command lines to $CURLLOG\n"; ####################################################################### # Display the contents of the given file. Line endings are canonicalized # and excessively long files are elided sub displaylogcontent { my ($file)=@_; if(open(SINGLE, "<$file")) { my $linecount = 0; my $truncate; my @tail; while(my $string = ) { $string =~ s/\r\n/\n/g; $string =~ s/[\r\f\032]/\n/g; $string .= "\n" unless ($string =~ /\n$/); $string =~ tr/\n//; for my $line (split("\n", $string)) { $line =~ s/\s*\!$//; if ($truncate) { push @tail, " $line\n"; } else { logmsg " $line\n"; } $linecount++; $truncate = $linecount > 1000; } } if(@tail) { my $tailshow = 200; my $tailskip = 0; my $tailtotal = scalar @tail; if($tailtotal > $tailshow) { $tailskip = $tailtotal - $tailshow; logmsg "=== File too long: $tailskip lines omitted here\n"; } for($tailskip .. $tailtotal-1) { logmsg "$tail[$_]"; } } close(SINGLE); } } sub displaylogs { my ($testnum)=@_; opendir(DIR, "$LOGDIR") || die "can't open dir: $!"; my @logs = readdir(DIR); closedir(DIR); logmsg "== Contents of files in the $LOGDIR/ dir after test $testnum\n"; foreach my $log (sort @logs) { if($log =~ /\.(\.|)$/) { next; # skip "." and ".." } if($log =~ /^\.nfs/) { next; # skip ".nfs" } if(($log eq "memdump") || ($log eq "core")) { next; # skip "memdump" and "core" } if((-d "$LOGDIR/$log") || (! -s "$LOGDIR/$log")) { next; # skip directory and empty files } if(($log =~ /^stdout\d+/) && ($log !~ /^stdout$testnum/)) { next; # skip stdoutNnn of other tests } if(($log =~ /^stderr\d+/) && ($log !~ /^stderr$testnum/)) { next; # skip stderrNnn of other tests } if(($log =~ /^upload\d+/) && ($log !~ /^upload$testnum/)) { next; # skip uploadNnn of other tests } if(($log =~ /^curl\d+\.out/) && ($log !~ /^curl$testnum\.out/)) { next; # skip curlNnn.out of other tests } if(($log =~ /^test\d+\.txt/) && ($log !~ /^test$testnum\.txt/)) { next; # skip testNnn.txt of other tests } if(($log =~ /^file\d+\.txt/) && ($log !~ /^file$testnum\.txt/)) { next; # skip fileNnn.txt of other tests } if(($log =~ /^netrc\d+/) && ($log !~ /^netrc$testnum/)) { next; # skip netrcNnn of other tests } if(($log =~ /^trace\d+/) && ($log !~ /^trace$testnum/)) { next; # skip traceNnn of other tests } if(($log =~ /^valgrind\d+/) && ($log !~ /^valgrind$testnum(\..*|)$/)) { next; # skip valgrindNnn of other tests } logmsg "=== Start of file $log\n"; displaylogcontent("$LOGDIR/$log"); logmsg "=== End of file $log\n"; } } ####################################################################### # The main test-loop # my $failed; my $testnum; my $ok=0; my $total=0; my $lasttest=0; my @at = split(" ", $TESTCASES); my $count=0; $start = time(); foreach $testnum (@at) { $lasttest = $testnum if($testnum > $lasttest); $count++; my $error = singletest($run_event_based, $testnum, $count, scalar(@at)); if($error < 0) { # not a test we can run next; } $total++; # number of tests we've run if($error>0) { $failed.= "$testnum "; if($postmortem) { # display all files in log/ in a nice way displaylogs($testnum); } if(!$anyway) { # a test failed, abort logmsg "\n - abort tests\n"; last; } } elsif(!$error) { $ok++; # successful test counter } # loop for next test } my $sofar = time() - $start; ####################################################################### # Close command log # close(CMDLOG); # Tests done, stop the servers stopservers($verbose); my $all = $total + $skipped; runtimestats($lasttest); if($total) { logmsg sprintf("TESTDONE: $ok tests out of $total reported OK: %d%%\n", $ok/$total*100); if($ok != $total) { logmsg "TESTFAIL: These test cases failed: $failed\n"; } } else { logmsg "TESTFAIL: No tests were performed\n"; } if($all) { logmsg "TESTDONE: $all tests were considered during ". sprintf("%.0f", $sofar) ." seconds.\n"; } if($skipped && !$short) { my $s=0; logmsg "TESTINFO: $skipped tests were skipped due to these restraints:\n"; for(keys %skipped) { my $r = $_; printf "TESTINFO: \"%s\" %d times (", $r, $skipped{$_}; # now show all test case numbers that had this reason for being # skipped my $c=0; my $max = 9; for(0 .. scalar @teststat) { my $t = $_; if($teststat[$_] && ($teststat[$_] eq $r)) { if($c < $max) { logmsg ", " if($c); logmsg $_; } $c++; } } if($c > $max) { logmsg " and ".($c-$max)." more"; } logmsg ")\n"; } } if($total && ($ok != $total)) { exit 1; } curl-7.35.0/tests/Makefile.am0000644000175000017500000000534512262353672012711 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # ########################################################################### HTMLPAGES = testcurl.html runtests.html PDFPAGES = testcurl.pdf runtests.pdf EXTRA_DIST = ftpserver.pl httpserver.pl secureserver.pl runtests.pl getpart.pm \ FILEFORMAT README stunnel.pem memanalyze.pl testcurl.pl valgrind.pm ftp.pm \ sshserver.pl sshhelp.pm testcurl.1 runtests.1 $(HTMLPAGES) $(PDFPAGES) \ serverhelp.pm tftpserver.pl rtspserver.pl directories.pm symbol-scan.pl \ CMakeLists.txt mem-include-scan.pl valgrind.supp http_pipe.py DISTCLEANFILES = configurehelp.pm # we have two variables here to make sure DIST_SUBDIRS won't get 'unit' # added twice as then targets such as 'distclean' misbehave and try to # do things twice in that subdir at times (and thus fails). if BUILD_UNITTESTS BUILD_UNIT = unit DIST_UNIT = else BUILD_UNIT = DIST_UNIT = unit endif SUBDIRS = certs data server libtest $(BUILD_UNIT) DIST_SUBDIRS = $(SUBDIRS) $(DIST_UNIT) PERLFLAGS = -I$(srcdir) CLEANFILES = .http.pid .https.pid .ftp.pid .ftps.pid MAN2HTML= roffit < $< >$@ curl: @cd $(top_builddir) && $(MAKE) if CROSSCOMPILING TEST = @echo "NOTICE: we can't run the tests when cross-compiling!" else # if not cross-compiling: TEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl TEST_Q = -a -s TEST_AM = -a -am TEST_F = -a -p -r TEST_T = -a -t endif # make sure that PERL is pointing to an executable perlcheck: @if ! test -x "$(PERL)"; then echo "No perl!"; exit 2; fi test: perlcheck all $(TEST) quiet-test: perlcheck all $(TEST) $(TEST_Q) am-test: perlcheck all $(TEST) $(TEST_AM) full-test: perlcheck all $(TEST) $(TEST_F) torture-test: perlcheck all $(TEST) $(TEST_T) .1.html: $(MAN2HTML) .1.pdf: @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \ groff -Tps -man $< >$$foo.ps; \ ps2pdf $$foo.ps $@; \ rm $$foo.ps; \ echo "converted $< to $@") curl-7.35.0/tests/Makefile.in0000644000175000017500000005677112272122667012732 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # ########################################################################### VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tests DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \ $(top_srcdir)/m4/curl-confopts.m4 \ $(top_srcdir)/m4/curl-functions.m4 \ $(top_srcdir)/m4/curl-openssl.m4 \ $(top_srcdir)/m4/curl-override.m4 \ $(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/xc-am-iface.m4 \ $(top_srcdir)/m4/xc-cc-check.m4 \ $(top_srcdir)/m4/xc-lt-iface.m4 \ $(top_srcdir)/m4/xc-translit.m4 \ $(top_srcdir)/m4/xc-val-flgs.m4 \ $(top_srcdir)/m4/zz40-xc-ovr.m4 \ $(top_srcdir)/m4/zz50-xc-ovr.m4 \ $(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \ $(top_builddir)/include/curl/curlbuild.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@ CURLVERSION = @CURLVERSION@ CURL_CA_BUNDLE = @CURL_CA_BUNDLE@ CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@ CURL_DISABLE_DICT = @CURL_DISABLE_DICT@ CURL_DISABLE_FILE = @CURL_DISABLE_FILE@ CURL_DISABLE_FTP = @CURL_DISABLE_FTP@ CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@ CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@ CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@ CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@ CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@ CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@ CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@ CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@ CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@ CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@ CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@ CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@ CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@ CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_SHARED = @ENABLE_SHARED@ ENABLE_STATIC = @ENABLE_STATIC@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@ HAVE_LDAP_SSL = @HAVE_LDAP_SSL@ HAVE_LIBZ = @HAVE_LIBZ@ HAVE_SSLEAY_SRP = @HAVE_SSLEAY_SRP@ IDN_ENABLED = @IDN_ENABLED@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IPV6_ENABLED = @IPV6_ENABLED@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@ LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@ LIBMETALINK_LIBS = @LIBMETALINK_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANOPT = @MANOPT@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NROFF = @NROFF@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGADD_NAME = @PKGADD_NAME@ PKGADD_PKG = @PKGADD_PKG@ PKGADD_VENDOR = @PKGADD_VENDOR@ PKGCONFIG = @PKGCONFIG@ RANDOM_FILE = @RANDOM_FILE@ RANLIB = @RANLIB@ REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_ENABLED = @SSL_ENABLED@ STRIP = @STRIP@ SUPPORT_FEATURES = @SUPPORT_FEATURES@ SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@ USE_ARES = @USE_ARES@ USE_AXTLS = @USE_AXTLS@ USE_CYASSL = @USE_CYASSL@ USE_DARWINSSL = @USE_DARWINSSL@ USE_GNUTLS = @USE_GNUTLS@ USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@ USE_LIBRTMP = @USE_LIBRTMP@ USE_LIBSSH2 = @USE_LIBSSH2@ USE_NGHTTP2 = @USE_NGHTTP2@ USE_NSS = @USE_NSS@ USE_OPENLDAP = @USE_OPENLDAP@ USE_POLARSSL = @USE_POLARSSL@ USE_SCHANNEL = @USE_SCHANNEL@ USE_SSLEAY = @USE_SSLEAY@ USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@ VERSION = @VERSION@ VERSIONNUM = @VERSIONNUM@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libext = @libext@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ HTMLPAGES = testcurl.html runtests.html PDFPAGES = testcurl.pdf runtests.pdf EXTRA_DIST = ftpserver.pl httpserver.pl secureserver.pl runtests.pl getpart.pm \ FILEFORMAT README stunnel.pem memanalyze.pl testcurl.pl valgrind.pm ftp.pm \ sshserver.pl sshhelp.pm testcurl.1 runtests.1 $(HTMLPAGES) $(PDFPAGES) \ serverhelp.pm tftpserver.pl rtspserver.pl directories.pm symbol-scan.pl \ CMakeLists.txt mem-include-scan.pl valgrind.supp http_pipe.py DISTCLEANFILES = configurehelp.pm @BUILD_UNITTESTS_FALSE@BUILD_UNIT = # we have two variables here to make sure DIST_SUBDIRS won't get 'unit' # added twice as then targets such as 'distclean' misbehave and try to # do things twice in that subdir at times (and thus fails). @BUILD_UNITTESTS_TRUE@BUILD_UNIT = unit @BUILD_UNITTESTS_FALSE@DIST_UNIT = unit @BUILD_UNITTESTS_TRUE@DIST_UNIT = SUBDIRS = certs data server libtest $(BUILD_UNIT) DIST_SUBDIRS = $(SUBDIRS) $(DIST_UNIT) PERLFLAGS = -I$(srcdir) CLEANFILES = .http.pid .https.pid .ftp.pid .ftps.pid MAN2HTML = roffit < $< >$@ @CROSSCOMPILING_FALSE@TEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl @CROSSCOMPILING_TRUE@TEST = @echo "NOTICE: we can't run the tests when cross-compiling!" @CROSSCOMPILING_FALSE@TEST_Q = -a -s @CROSSCOMPILING_FALSE@TEST_AM = -a -am @CROSSCOMPILING_FALSE@TEST_F = -a -p -r @CROSSCOMPILING_FALSE@TEST_T = -a -t all: all-recursive .SUFFIXES: .SUFFIXES: .1 .html .pdf $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am curl: @cd $(top_builddir) && $(MAKE) # make sure that PERL is pointing to an executable perlcheck: @if ! test -x "$(PERL)"; then echo "No perl!"; exit 2; fi test: perlcheck all $(TEST) quiet-test: perlcheck all $(TEST) $(TEST_Q) am-test: perlcheck all $(TEST) $(TEST_AM) full-test: perlcheck all $(TEST) $(TEST_F) torture-test: perlcheck all $(TEST) $(TEST_T) .1.html: $(MAN2HTML) .1.pdf: @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \ groff -Tps -man $< >$$foo.ps; \ ps2pdf $$foo.ps $@; \ rm $$foo.ps; \ echo "converted $< to $@") # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: curl-7.35.0/tests/secureserver.pl0000755000175000017500000002224712270035364013724 00000000000000#!/usr/bin/env perl #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2014, 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. # #*************************************************************************** # This is the HTTPS, FTPS, POP3S, IMAPS, SMTPS, server used for curl test # harness. Actually just a layer that runs stunnel properly using the # non-secure test harness servers. BEGIN { push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'}); push(@INC, "."); } use strict; use warnings; use Cwd; use serverhelp qw( server_pidfilename server_logfilename ); my $stunnel = "stunnel"; my $verbose=0; # set to 1 for debugging my $accept_port = 8991; # just our default, weird enough my $target_port = 8999; # default test http-server port my $stuncert; my $ver_major; my $ver_minor; my $stunnel_version; my $socketopt; my $cmd; my $pidfile; # stunnel pid file my $logfile; # stunnel log file my $loglevel = 5; # stunnel log level my $ipvnum = 4; # default IP version of stunneled server my $idnum = 1; # dafault stunneled server instance number my $proto = 'https'; # default secure server protocol my $conffile; # stunnel configuration file my $certfile; # certificate chain PEM file #*************************************************************************** # stunnel requires full path specification for several files. # my $path = getcwd(); my $srcdir = $path; my $logdir = $path .'/log'; #*************************************************************************** # Signal handler to remove our stunnel 4.00 and newer configuration file. # sub exit_signal_handler { my $signame = shift; local $!; # preserve errno local $?; # preserve exit status unlink($conffile) if($conffile && (-f $conffile)); exit; } #*************************************************************************** # Process command line options # while(@ARGV) { if($ARGV[0] eq '--verbose') { $verbose = 1; } elsif($ARGV[0] eq '--proto') { if($ARGV[1]) { $proto = $ARGV[1]; shift @ARGV; } } elsif($ARGV[0] eq '--accept') { if($ARGV[1]) { if($ARGV[1] =~ /^(\d+)$/) { $accept_port = $1; shift @ARGV; } } } elsif($ARGV[0] eq '--connect') { if($ARGV[1]) { if($ARGV[1] =~ /^(\d+)$/) { $target_port = $1; shift @ARGV; } } } elsif($ARGV[0] eq '--stunnel') { if($ARGV[1]) { if($ARGV[1] =~ /^([\w\/]+)$/) { $stunnel = $ARGV[1]; } else { $stunnel = "\"". $ARGV[1] ."\""; } shift @ARGV; } } elsif($ARGV[0] eq '--srcdir') { if($ARGV[1]) { $srcdir = $ARGV[1]; shift @ARGV; } } elsif($ARGV[0] eq '--certfile') { if($ARGV[1]) { $stuncert = $ARGV[1]; shift @ARGV; } } elsif($ARGV[0] eq '--id') { if($ARGV[1]) { if($ARGV[1] =~ /^(\d+)$/) { $idnum = $1 if($1 > 0); shift @ARGV; } } } elsif($ARGV[0] eq '--ipv4') { $ipvnum = 4; } elsif($ARGV[0] eq '--ipv6') { $ipvnum = 6; } elsif($ARGV[0] eq '--pidfile') { if($ARGV[1]) { $pidfile = "$path/". $ARGV[1]; shift @ARGV; } } elsif($ARGV[0] eq '--logfile') { if($ARGV[1]) { $logfile = "$path/". $ARGV[1]; shift @ARGV; } } else { print STDERR "\nWarning: secureserver.pl unknown parameter: $ARGV[0]\n"; } shift @ARGV; } #*************************************************************************** # Initialize command line option dependant variables # if(!$pidfile) { $pidfile = "$path/". server_pidfilename($proto, $ipvnum, $idnum); } if(!$logfile) { $logfile = server_logfilename($logdir, $proto, $ipvnum, $idnum); } $conffile = "$path/stunnel.conf"; $certfile = "$srcdir/". ($stuncert?"certs/$stuncert":"stunnel.pem"); my $ssltext = uc($proto) ." SSL/TLS:"; #*************************************************************************** # Find out version info for the given stunnel binary # foreach my $veropt (('-version', '-V')) { foreach my $verstr (qx($stunnel $veropt 2>&1)) { if($verstr =~ /^stunnel (\d+)\.(\d+) on /) { $ver_major = $1; $ver_minor = $2; last; } } last if($ver_major); } if((!$ver_major) || (!$ver_minor)) { if(-x "$stunnel" && ! -d "$stunnel") { print "$ssltext Unknown stunnel version\n"; } else { print "$ssltext No stunnel\n"; } exit 1; } $stunnel_version = (100*$ver_major) + $ver_minor; #*************************************************************************** # Verify minimmum stunnel required version # if($stunnel_version < 310) { print "$ssltext Unsupported stunnel version $ver_major.$ver_minor\n"; exit 1; } #*************************************************************************** # Build command to execute for stunnel 3.X versions # if($stunnel_version < 400) { if($stunnel_version >= 319) { $socketopt = "-O a:SO_REUSEADDR=1"; } $cmd = "$stunnel -p $certfile -P $pidfile "; $cmd .= "-d $accept_port -r $target_port -f -D $loglevel "; $cmd .= ($socketopt) ? "$socketopt " : ""; $cmd .= ">$logfile 2>&1"; if($verbose) { print uc($proto) ." server (stunnel $ver_major.$ver_minor)\n"; print "cmd: $cmd\n"; print "pem cert file: $certfile\n"; print "pid file: $pidfile\n"; print "log file: $logfile\n"; print "log level: $loglevel\n"; print "listen on port: $accept_port\n"; print "connect to port: $target_port\n"; } } #*************************************************************************** # Build command to execute for stunnel 4.00 and newer # if($stunnel_version >= 400) { $socketopt = "a:SO_REUSEADDR=1"; $cmd = "$stunnel $conffile "; $cmd .= ">$logfile 2>&1"; # setup signal handler $SIG{INT} = \&exit_signal_handler; $SIG{TERM} = \&exit_signal_handler; # stunnel configuration file if(open(STUNCONF, ">$conffile")) { print STUNCONF " CApath = $path cert = $certfile debug = $loglevel socket = $socketopt"; if($stunnel !~ /tstunnel(\.exe)?"?$/) { print STUNCONF " output = $logfile pid = $pidfile foreground = yes"; } print STUNCONF " [curltest] accept = $accept_port connect = $target_port"; if(!close(STUNCONF)) { print "$ssltext Error closing file $conffile\n"; exit 1; } } else { print "$ssltext Error writing file $conffile\n"; exit 1; } if($verbose) { print uc($proto) ." server (stunnel $ver_major.$ver_minor)\n"; print "cmd: $cmd\n"; print "CApath = $path\n"; print "cert = $certfile\n"; print "pid = $pidfile\n"; print "debug = $loglevel\n"; print "output = $logfile\n"; print "socket = $socketopt\n"; print "foreground = yes\n"; print "\n"; print "[curltest]\n"; print "accept = $accept_port\n"; print "connect = $target_port\n"; } } #*************************************************************************** # Set file permissions on certificate pem file. # chmod(0600, $certfile) if(-f $certfile); #*************************************************************************** # Run tstunnel on Windows. # if($stunnel =~ /tstunnel(\.exe)?"?$/) { # Fake pidfile for tstunnel on Windows. if(open(OUT, ">$pidfile")) { print OUT $$ . "\n"; close(OUT); } # Put an "exec" in front of the command so that the child process # keeps this child's process ID. exec("exec $cmd") || die "Can't exec() $cmd: $!"; # exec() should never return back here to this process. We protect # ourselves by calling die() just in case something goes really bad. die "error: exec() has returned"; } #*************************************************************************** # Run stunnel. # my $rc = system($cmd); $rc >>= 8; unlink($conffile) if($conffile && -f $conffile); exit $rc; curl-7.35.0/tests/server/0000755000175000017500000000000012272124477012234 500000000000000curl-7.35.0/tests/server/server_sockaddr.h0000644000175000017500000000245212213173003015470 00000000000000#ifndef HEADER_CURL_SERVER_SOCKADDR_H #define HEADER_CURL_SERVER_SOCKADDR_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "server_setup.h" typedef union { struct sockaddr sa; struct sockaddr_in sa4; #ifdef ENABLE_IPV6 struct sockaddr_in6 sa6; #endif } srvr_sockaddr_union_t; #endif /* HEADER_CURL_SERVER_SOCKADDR_H */ curl-7.35.0/tests/server/tftpd.c0000644000175000017500000010644112262353672013447 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * * Trivial file transfer protocol server. * * This code includes many modifications by Jim Guyton * * This source file was started based on netkit-tftpd 0.17 * Heavily modified for curl's test suite */ /* * Copyright (c) 1983 Regents of the University of California. * 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. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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 "server_setup.h" #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_SIGNAL_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_ARPA_TFTP_H #include #else #include "tftp.h" #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_SYS_FILIO_H /* FIONREAD on Solaris 7 */ #include #endif #include #ifdef HAVE_PWD_H #include #endif #define ENABLE_CURLX_PRINTF /* make the curlx header define all printf() functions to use the curlx_* versions instead */ #include "curlx.h" /* from the private lib dir */ #include "getpart.h" #include "util.h" #include "server_sockaddr.h" /* include memdebug.h last */ #include "memdebug.h" /***************************************************************************** * STRUCT DECLARATIONS AND DEFINES * *****************************************************************************/ #ifndef PKTSIZE #define PKTSIZE (SEGSIZE + 4) /* SEGSIZE defined in arpa/tftp.h */ #endif struct testcase { char *buffer; /* holds the file data to send to the client */ size_t bufsize; /* size of the data in buffer */ char *rptr; /* read pointer into the buffer */ size_t rcount; /* amount of data left to read of the file */ long testno; /* test case number */ int ofile; /* file descriptor for output file when uploading to us */ int writedelay; /* number of seconds between each packet */ }; struct formats { const char *f_mode; int f_convert; }; struct errmsg { int e_code; const char *e_msg; }; typedef union { struct tftphdr hdr; char storage[PKTSIZE]; } tftphdr_storage_t; /* * bf.counter values in range [-1 .. SEGSIZE] represents size of data in the * bf.buf buffer. Additionally it can also hold flags BF_ALLOC or BF_FREE. */ struct bf { int counter; /* size of data in buffer, or flag */ tftphdr_storage_t buf; /* room for data packet */ }; #define BF_ALLOC -3 /* alloc'd but not yet filled */ #define BF_FREE -2 /* free */ #define opcode_RRQ 1 #define opcode_WRQ 2 #define opcode_DATA 3 #define opcode_ACK 4 #define opcode_ERROR 5 #define TIMEOUT 5 #undef MIN #define MIN(x,y) ((x)<(y)?(x):(y)) #ifndef DEFAULT_LOGFILE #define DEFAULT_LOGFILE "log/tftpd.log" #endif #define REQUEST_DUMP "log/server.input" #define DEFAULT_PORT 8999 /* UDP */ /***************************************************************************** * GLOBAL VARIABLES * *****************************************************************************/ static struct errmsg errmsgs[] = { { EUNDEF, "Undefined error code" }, { ENOTFOUND, "File not found" }, { EACCESS, "Access violation" }, { ENOSPACE, "Disk full or allocation exceeded" }, { EBADOP, "Illegal TFTP operation" }, { EBADID, "Unknown transfer ID" }, { EEXISTS, "File already exists" }, { ENOUSER, "No such user" }, { -1, 0 } }; static struct formats formata[] = { { "netascii", 1 }, { "octet", 0 }, { NULL, 0 } }; static struct bf bfs[2]; static int nextone; /* index of next buffer to use */ static int current; /* index of buffer in use */ /* control flags for crlf conversions */ static int newline = 0; /* fillbuf: in middle of newline expansion */ static int prevchar = -1; /* putbuf: previous char (cr check) */ static tftphdr_storage_t buf; static tftphdr_storage_t ackbuf; static srvr_sockaddr_union_t from; static curl_socklen_t fromlen; static curl_socket_t peer = CURL_SOCKET_BAD; static int timeout; static int maxtimeout = 5 * TIMEOUT; #ifdef ENABLE_IPV6 static bool use_ipv6 = FALSE; #endif static const char *ipv_inuse = "IPv4"; const char *serverlogfile = DEFAULT_LOGFILE; static char *pidname= (char *)".tftpd.pid"; static int serverlogslocked = 0; static int wrotepidfile = 0; #ifdef HAVE_SIGSETJMP static sigjmp_buf timeoutbuf; #endif #if defined(HAVE_ALARM) && defined(SIGALRM) static int rexmtval = TIMEOUT; #endif /* do-nothing macro replacement for systems which lack siginterrupt() */ #ifndef HAVE_SIGINTERRUPT #define siginterrupt(x,y) do {} while(0) #endif /* vars used to keep around previous signal handlers */ typedef RETSIGTYPE (*SIGHANDLER_T)(int); #ifdef SIGHUP static SIGHANDLER_T old_sighup_handler = SIG_ERR; #endif #ifdef SIGPIPE static SIGHANDLER_T old_sigpipe_handler = SIG_ERR; #endif #ifdef SIGINT static SIGHANDLER_T old_sigint_handler = SIG_ERR; #endif #ifdef SIGTERM static SIGHANDLER_T old_sigterm_handler = SIG_ERR; #endif #if defined(SIGBREAK) && defined(WIN32) static SIGHANDLER_T old_sigbreak_handler = SIG_ERR; #endif /* var which if set indicates that the program should finish execution */ SIG_ATOMIC_T got_exit_signal = 0; /* if next is set indicates the first signal handled in exit_signal_handler */ static volatile int exit_signal = 0; /***************************************************************************** * FUNCTION PROTOTYPES * *****************************************************************************/ static struct tftphdr *rw_init(int); static struct tftphdr *w_init(void); static struct tftphdr *r_init(void); static int readit(struct testcase *test, struct tftphdr **dpp, int convert); static int writeit(struct testcase *test, struct tftphdr **dpp, int ct, int convert); static void read_ahead(struct testcase *test, int convert); static ssize_t write_behind(struct testcase *test, int convert); static int synchnet(curl_socket_t); static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size); static int validate_access(struct testcase *test, const char *fname, int mode); static void sendtftp(struct testcase *test, struct formats *pf); static void recvtftp(struct testcase *test, struct formats *pf); static void nak(int error); #if defined(HAVE_ALARM) && defined(SIGALRM) static void mysignal(int sig, void (*handler)(int)); static void timer(int signum); static void justtimeout(int signum); #endif /* HAVE_ALARM && SIGALRM */ static RETSIGTYPE exit_signal_handler(int signum); static void install_signal_handlers(void); static void restore_signal_handlers(void); /***************************************************************************** * FUNCTION IMPLEMENTATIONS * *****************************************************************************/ #if defined(HAVE_ALARM) && defined(SIGALRM) /* * Like signal(), but with well-defined semantics. */ static void mysignal(int sig, void (*handler)(int)) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = handler; sigaction(sig, &sa, NULL); } static void timer(int signum) { (void)signum; logmsg("alarm!"); timeout += rexmtval; if(timeout >= maxtimeout) { if(wrotepidfile) { wrotepidfile = 0; unlink(pidname); } if(serverlogslocked) { serverlogslocked = 0; clear_advisor_read_lock(SERVERLOGS_LOCK); } exit(1); } #ifdef HAVE_SIGSETJMP siglongjmp(timeoutbuf, 1); #endif } static void justtimeout(int signum) { (void)signum; } #endif /* HAVE_ALARM && SIGALRM */ /* signal handler that will be triggered to indicate that the program should finish its execution in a controlled manner as soon as possible. The first time this is called it will set got_exit_signal to one and store in exit_signal the signal that triggered its execution. */ static RETSIGTYPE exit_signal_handler(int signum) { int old_errno = errno; if(got_exit_signal == 0) { got_exit_signal = 1; exit_signal = signum; } (void)signal(signum, exit_signal_handler); errno = old_errno; } static void install_signal_handlers(void) { #ifdef SIGHUP /* ignore SIGHUP signal */ if((old_sighup_handler = signal(SIGHUP, SIG_IGN)) == SIG_ERR) logmsg("cannot install SIGHUP handler: %s", strerror(errno)); #endif #ifdef SIGPIPE /* ignore SIGPIPE signal */ if((old_sigpipe_handler = signal(SIGPIPE, SIG_IGN)) == SIG_ERR) logmsg("cannot install SIGPIPE handler: %s", strerror(errno)); #endif #ifdef SIGINT /* handle SIGINT signal with our exit_signal_handler */ if((old_sigint_handler = signal(SIGINT, exit_signal_handler)) == SIG_ERR) logmsg("cannot install SIGINT handler: %s", strerror(errno)); else siginterrupt(SIGINT, 1); #endif #ifdef SIGTERM /* handle SIGTERM signal with our exit_signal_handler */ if((old_sigterm_handler = signal(SIGTERM, exit_signal_handler)) == SIG_ERR) logmsg("cannot install SIGTERM handler: %s", strerror(errno)); else siginterrupt(SIGTERM, 1); #endif #if defined(SIGBREAK) && defined(WIN32) /* handle SIGBREAK signal with our exit_signal_handler */ if((old_sigbreak_handler = signal(SIGBREAK, exit_signal_handler)) == SIG_ERR) logmsg("cannot install SIGBREAK handler: %s", strerror(errno)); else siginterrupt(SIGBREAK, 1); #endif } static void restore_signal_handlers(void) { #ifdef SIGHUP if(SIG_ERR != old_sighup_handler) (void)signal(SIGHUP, old_sighup_handler); #endif #ifdef SIGPIPE if(SIG_ERR != old_sigpipe_handler) (void)signal(SIGPIPE, old_sigpipe_handler); #endif #ifdef SIGINT if(SIG_ERR != old_sigint_handler) (void)signal(SIGINT, old_sigint_handler); #endif #ifdef SIGTERM if(SIG_ERR != old_sigterm_handler) (void)signal(SIGTERM, old_sigterm_handler); #endif #if defined(SIGBREAK) && defined(WIN32) if(SIG_ERR != old_sigbreak_handler) (void)signal(SIGBREAK, old_sigbreak_handler); #endif } /* * init for either read-ahead or write-behind. * zero for write-behind, one for read-head. */ static struct tftphdr *rw_init(int x) { newline = 0; /* init crlf flag */ prevchar = -1; bfs[0].counter = BF_ALLOC; /* pass out the first buffer */ current = 0; bfs[1].counter = BF_FREE; nextone = x; /* ahead or behind? */ return &bfs[0].buf.hdr; } static struct tftphdr *w_init(void) { return rw_init(0); /* write-behind */ } static struct tftphdr *r_init(void) { return rw_init(1); /* read-ahead */ } /* Have emptied current buffer by sending to net and getting ack. Free it and return next buffer filled with data. */ static int readit(struct testcase *test, struct tftphdr **dpp, int convert /* if true, convert to ascii */) { struct bf *b; bfs[current].counter = BF_FREE; /* free old one */ current = !current; /* "incr" current */ b = &bfs[current]; /* look at new buffer */ if (b->counter == BF_FREE) /* if it's empty */ read_ahead(test, convert); /* fill it */ *dpp = &b->buf.hdr; /* set caller's ptr */ return b->counter; } /* * fill the input buffer, doing ascii conversions if requested * conversions are lf -> cr,lf and cr -> cr, nul */ static void read_ahead(struct testcase *test, int convert /* if true, convert to ascii */) { int i; char *p; int c; struct bf *b; struct tftphdr *dp; b = &bfs[nextone]; /* look at "next" buffer */ if (b->counter != BF_FREE) /* nop if not free */ return; nextone = !nextone; /* "incr" next buffer ptr */ dp = &b->buf.hdr; if (convert == 0) { /* The former file reading code did this: b->counter = read(fileno(file), dp->th_data, SEGSIZE); */ size_t copy_n = MIN(SEGSIZE, test->rcount); memcpy(dp->th_data, test->rptr, copy_n); /* decrease amount, advance pointer */ test->rcount -= copy_n; test->rptr += copy_n; b->counter = (int)copy_n; return; } p = dp->th_data; for (i = 0 ; i < SEGSIZE; i++) { if (newline) { if (prevchar == '\n') c = '\n'; /* lf to cr,lf */ else c = '\0'; /* cr to cr,nul */ newline = 0; } else { if(test->rcount) { c=test->rptr[0]; test->rptr++; test->rcount--; } else break; if (c == '\n' || c == '\r') { prevchar = c; c = '\r'; newline = 1; } } *p++ = (char)c; } b->counter = (int)(p - dp->th_data); } /* Update count associated with the buffer, get new buffer from the queue. Calls write_behind only if next buffer not available. */ static int writeit(struct testcase *test, struct tftphdr **dpp, int ct, int convert) { bfs[current].counter = ct; /* set size of data to write */ current = !current; /* switch to other buffer */ if (bfs[current].counter != BF_FREE) /* if not free */ write_behind(test, convert); /* flush it */ bfs[current].counter = BF_ALLOC; /* mark as alloc'd */ *dpp = &bfs[current].buf.hdr; return ct; /* this is a lie of course */ } /* * Output a buffer to a file, converting from netascii if requested. * CR,NUL -> CR and CR,LF => LF. * Note spec is undefined if we get CR as last byte of file or a * CR followed by anything else. In this case we leave it alone. */ static ssize_t write_behind(struct testcase *test, int convert) { char *writebuf; int count; int ct; char *p; int c; /* current character */ struct bf *b; struct tftphdr *dp; b = &bfs[nextone]; if (b->counter < -1) /* anything to flush? */ return 0; /* just nop if nothing to do */ if(!test->ofile) { char outfile[256]; snprintf(outfile, sizeof(outfile), "log/upload.%ld", test->testno); test->ofile=open(outfile, O_CREAT|O_RDWR, 0777); if(test->ofile == -1) { logmsg("Couldn't create and/or open file %s for upload!", outfile); return -1; /* failure! */ } } count = b->counter; /* remember byte count */ b->counter = BF_FREE; /* reset flag */ dp = &b->buf.hdr; nextone = !nextone; /* incr for next time */ writebuf = dp->th_data; if (count <= 0) return -1; /* nak logic? */ if (convert == 0) return write(test->ofile, writebuf, count); p = writebuf; ct = count; while (ct--) { /* loop over the buffer */ c = *p++; /* pick up a character */ if (prevchar == '\r') { /* if prev char was cr */ if (c == '\n') /* if have cr,lf then just */ lseek(test->ofile, -1, SEEK_CUR); /* smash lf on top of the cr */ else if (c == '\0') /* if have cr,nul then */ goto skipit; /* just skip over the putc */ /* else just fall through and allow it */ } /* formerly putc(c, file); */ if(1 != write(test->ofile, &c, 1)) break; skipit: prevchar = c; } return count; } /* When an error has occurred, it is possible that the two sides are out of * synch. Ie: that what I think is the other side's response to packet N is * really their response to packet N-1. * * So, to try to prevent that, we flush all the input queued up for us on the * network connection on our host. * * We return the number of packets we flushed (mostly for reporting when trace * is active). */ static int synchnet(curl_socket_t f /* socket to flush */) { #if defined(HAVE_IOCTLSOCKET) unsigned long i; #else int i; #endif int j = 0; char rbuf[PKTSIZE]; srvr_sockaddr_union_t fromaddr; curl_socklen_t fromaddrlen; for (;;) { #if defined(HAVE_IOCTLSOCKET) (void) ioctlsocket(f, FIONREAD, &i); #else (void) ioctl(f, FIONREAD, &i); #endif if (i) { j++; #ifdef ENABLE_IPV6 if(!use_ipv6) #endif fromaddrlen = sizeof(fromaddr.sa4); #ifdef ENABLE_IPV6 else fromaddrlen = sizeof(fromaddr.sa6); #endif (void) recvfrom(f, rbuf, sizeof(rbuf), 0, &fromaddr.sa, &fromaddrlen); } else break; } return j; } int main(int argc, char **argv) { srvr_sockaddr_union_t me; struct tftphdr *tp; ssize_t n = 0; int arg = 1; unsigned short port = DEFAULT_PORT; curl_socket_t sock = CURL_SOCKET_BAD; int flag; int rc; int error; long pid; struct testcase test; int result = 0; memset(&test, 0, sizeof(test)); while(argc>arg) { if(!strcmp("--version", argv[arg])) { printf("tftpd IPv4%s\n", #ifdef ENABLE_IPV6 "/IPv6" #else "" #endif ); return 0; } else if(!strcmp("--pidfile", argv[arg])) { arg++; if(argc>arg) pidname = argv[arg++]; } else if(!strcmp("--logfile", argv[arg])) { arg++; if(argc>arg) serverlogfile = argv[arg++]; } else if(!strcmp("--ipv4", argv[arg])) { #ifdef ENABLE_IPV6 ipv_inuse = "IPv4"; use_ipv6 = FALSE; #endif arg++; } else if(!strcmp("--ipv6", argv[arg])) { #ifdef ENABLE_IPV6 ipv_inuse = "IPv6"; use_ipv6 = TRUE; #endif arg++; } else if(!strcmp("--port", argv[arg])) { arg++; if(argc>arg) { char *endptr; unsigned long ulnum = strtoul(argv[arg], &endptr, 10); if((endptr != argv[arg] + strlen(argv[arg])) || (ulnum < 1025UL) || (ulnum > 65535UL)) { fprintf(stderr, "tftpd: invalid --port argument (%s)\n", argv[arg]); return 0; } port = curlx_ultous(ulnum); arg++; } } else if(!strcmp("--srcdir", argv[arg])) { arg++; if(argc>arg) { path = argv[arg]; arg++; } } else { puts("Usage: tftpd [option]\n" " --version\n" " --logfile [file]\n" " --pidfile [file]\n" " --ipv4\n" " --ipv6\n" " --port [port]\n" " --srcdir [path]"); return 0; } } #ifdef WIN32 win32_init(); atexit(win32_cleanup); #endif install_signal_handlers(); pid = (long)getpid(); #ifdef ENABLE_IPV6 if(!use_ipv6) #endif sock = socket(AF_INET, SOCK_DGRAM, 0); #ifdef ENABLE_IPV6 else sock = socket(AF_INET6, SOCK_DGRAM, 0); #endif if(CURL_SOCKET_BAD == sock) { error = SOCKERRNO; logmsg("Error creating socket: (%d) %s", error, strerror(error)); result = 1; goto tftpd_cleanup; } flag = 1; if (0 != setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&flag, sizeof(flag))) { error = SOCKERRNO; logmsg("setsockopt(SO_REUSEADDR) failed with error: (%d) %s", error, strerror(error)); result = 1; goto tftpd_cleanup; } #ifdef ENABLE_IPV6 if(!use_ipv6) { #endif memset(&me.sa4, 0, sizeof(me.sa4)); me.sa4.sin_family = AF_INET; me.sa4.sin_addr.s_addr = INADDR_ANY; me.sa4.sin_port = htons(port); rc = bind(sock, &me.sa, sizeof(me.sa4)); #ifdef ENABLE_IPV6 } else { memset(&me.sa6, 0, sizeof(me.sa6)); me.sa6.sin6_family = AF_INET6; me.sa6.sin6_addr = in6addr_any; me.sa6.sin6_port = htons(port); rc = bind(sock, &me.sa, sizeof(me.sa6)); } #endif /* ENABLE_IPV6 */ if(0 != rc) { error = SOCKERRNO; logmsg("Error binding socket on port %hu: (%d) %s", port, error, strerror(error)); result = 1; goto tftpd_cleanup; } wrotepidfile = write_pidfile(pidname); if(!wrotepidfile) { result = 1; goto tftpd_cleanup; } logmsg("Running %s version on port UDP/%d", ipv_inuse, (int)port); for (;;) { fromlen = sizeof(from); #ifdef ENABLE_IPV6 if(!use_ipv6) #endif fromlen = sizeof(from.sa4); #ifdef ENABLE_IPV6 else fromlen = sizeof(from.sa6); #endif n = (ssize_t)recvfrom(sock, &buf.storage[0], sizeof(buf.storage), 0, &from.sa, &fromlen); if(got_exit_signal) break; if (n < 0) { logmsg("recvfrom"); result = 3; break; } set_advisor_read_lock(SERVERLOGS_LOCK); serverlogslocked = 1; #ifdef ENABLE_IPV6 if(!use_ipv6) { #endif from.sa4.sin_family = AF_INET; peer = socket(AF_INET, SOCK_DGRAM, 0); if(CURL_SOCKET_BAD == peer) { logmsg("socket"); result = 2; break; } if(connect(peer, &from.sa, sizeof(from.sa4)) < 0) { logmsg("connect: fail"); result = 1; break; } #ifdef ENABLE_IPV6 } else { from.sa6.sin6_family = AF_INET6; peer = socket(AF_INET6, SOCK_DGRAM, 0); if(CURL_SOCKET_BAD == peer) { logmsg("socket"); result = 2; break; } if(connect(peer, &from.sa, sizeof(from.sa6)) < 0) { logmsg("connect: fail"); result = 1; break; } } #endif maxtimeout = 5*TIMEOUT; tp = &buf.hdr; tp->th_opcode = ntohs(tp->th_opcode); if (tp->th_opcode == opcode_RRQ || tp->th_opcode == opcode_WRQ) { memset(&test, 0, sizeof(test)); if (do_tftp(&test, tp, n) < 0) break; if(test.buffer) free(test.buffer); } sclose(peer); peer = CURL_SOCKET_BAD; if(test.ofile > 0) { close(test.ofile); test.ofile = 0; } if(got_exit_signal) break; if(serverlogslocked) { serverlogslocked = 0; clear_advisor_read_lock(SERVERLOGS_LOCK); } logmsg("end of one transfer"); } tftpd_cleanup: if(test.ofile > 0) close(test.ofile); if((peer != sock) && (peer != CURL_SOCKET_BAD)) sclose(peer); if(sock != CURL_SOCKET_BAD) sclose(sock); if(got_exit_signal) logmsg("signalled to die"); if(wrotepidfile) unlink(pidname); if(serverlogslocked) { serverlogslocked = 0; clear_advisor_read_lock(SERVERLOGS_LOCK); } restore_signal_handlers(); if(got_exit_signal) { logmsg("========> %s tftpd (port: %d pid: %ld) exits with signal (%d)", ipv_inuse, (int)port, pid, exit_signal); /* * To properly set the return status of the process we * must raise the same signal SIGINT or SIGTERM that we * caught and let the old handler take care of it. */ raise(exit_signal); } logmsg("========> tftpd quits"); return result; } /* * Handle initial connection protocol. */ static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size) { char *cp; int first = 1, ecode; struct formats *pf; char *filename, *mode = NULL; int error; FILE *server; #ifdef USE_WINSOCK DWORD recvtimeout, recvtimeoutbak; #endif /* Open request dump file. */ server = fopen(REQUEST_DUMP, "ab"); if(!server) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg("Error opening file: %s", REQUEST_DUMP); return -1; } /* store input protocol */ fprintf(server, "opcode: %x\n", tp->th_opcode); cp = (char *)&tp->th_stuff; filename = cp; again: while (cp < &buf.storage[size]) { if (*cp == '\0') break; cp++; } if (*cp) { nak(EBADOP); fclose(server); return 3; } if (first) { mode = ++cp; first = 0; goto again; } /* store input protocol */ fprintf(server, "filename: %s\n", filename); for (cp = mode; cp && *cp; cp++) if(ISUPPER(*cp)) *cp = (char)tolower((int)*cp); /* store input protocol */ fprintf(server, "mode: %s\n", mode); fclose(server); for (pf = formata; pf->f_mode; pf++) if (strcmp(pf->f_mode, mode) == 0) break; if (!pf->f_mode) { nak(EBADOP); return 2; } ecode = validate_access(test, filename, tp->th_opcode); if (ecode) { nak(ecode); return 1; } #ifdef USE_WINSOCK recvtimeout = sizeof(recvtimeoutbak); getsockopt(peer, SOL_SOCKET, SO_RCVTIMEO, (char*)&recvtimeoutbak, (int*)&recvtimeout); recvtimeout = TIMEOUT*1000; setsockopt(peer, SOL_SOCKET, SO_RCVTIMEO, (const char*)&recvtimeout, sizeof(recvtimeout)); #endif if (tp->th_opcode == opcode_WRQ) recvtftp(test, pf); else sendtftp(test, pf); #ifdef USE_WINSOCK recvtimeout = recvtimeoutbak; setsockopt(peer, SOL_SOCKET, SO_RCVTIMEO, (const char*)&recvtimeout, sizeof(recvtimeout)); #endif return 0; } /* Based on the testno, parse the correct server commands. */ static int parse_servercmd(struct testcase *req) { FILE *stream; char *filename; int error; filename = test2file(req->testno); stream=fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg(" [1] Error opening file: %s", filename); logmsg(" Couldn't open test file %ld", req->testno); return 1; /* done */ } else { char *orgcmd = NULL; char *cmd = NULL; size_t cmdsize = 0; int num=0; /* get the custom server control "commands" */ error = getpart(&orgcmd, &cmdsize, "reply", "servercmd", stream); fclose(stream); if(error) { logmsg("getpart() failed with error: %d", error); return 1; /* done */ } cmd = orgcmd; while(cmd && cmdsize) { char *check; if(1 == sscanf(cmd, "writedelay: %d", &num)) { logmsg("instructed to delay %d secs between packets", num); req->writedelay = num; } else { logmsg("Unknown instruction found: %s", cmd); } /* try to deal with CRLF or just LF */ check = strchr(cmd, '\r'); if(!check) check = strchr(cmd, '\n'); if(check) { /* get to the letter following the newline */ while((*check == '\r') || (*check == '\n')) check++; if(!*check) /* if we reached a zero, get out */ break; cmd = check; } else break; } if(orgcmd) free(orgcmd); } return 0; /* OK! */ } /* * Validate file access. */ static int validate_access(struct testcase *test, const char *filename, int mode) { char *ptr; long testno, partno; int error; char partbuf[80]="data"; logmsg("trying to get file: %s mode %x", filename, mode); if(!strncmp("verifiedserver", filename, 14)) { char weare[128]; size_t count = sprintf(weare, "WE ROOLZ: %ld\r\n", (long)getpid()); logmsg("Are-we-friendly question received"); test->buffer = strdup(weare); test->rptr = test->buffer; /* set read pointer */ test->bufsize = count; /* set total count */ test->rcount = count; /* set data left to read */ return 0; /* fine */ } /* find the last slash */ ptr = strrchr(filename, '/'); if(ptr) { char *file; ptr++; /* skip the slash */ /* skip all non-numericals following the slash */ while(*ptr && !ISDIGIT(*ptr)) ptr++; /* get the number */ testno = strtol(ptr, &ptr, 10); if(testno > 10000) { partno = testno % 10000; testno /= 10000; } else partno = 0; logmsg("requested test number %ld part %ld", testno, partno); test->testno = testno; (void)parse_servercmd(test); file = test2file(testno); if(0 != partno) sprintf(partbuf, "data%ld", partno); if(file) { FILE *stream=fopen(file, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg("Error opening file: %s", file); logmsg("Couldn't open test file: %s", file); return EACCESS; } else { size_t count; error = getpart(&test->buffer, &count, "reply", partbuf, stream); fclose(stream); if(error) { logmsg("getpart() failed with error: %d", error); return EACCESS; } if(test->buffer) { test->rptr = test->buffer; /* set read pointer */ test->bufsize = count; /* set total count */ test->rcount = count; /* set data left to read */ } else return EACCESS; } } else return EACCESS; } else { logmsg("no slash found in path"); return EACCESS; /* failure */ } logmsg("file opened and all is good"); return 0; } /* * Send the requested file. */ static void sendtftp(struct testcase *test, struct formats *pf) { int size; ssize_t n; unsigned short sendblock; /* block count */ struct tftphdr *sdp; /* data buffer */ struct tftphdr *sap; /* ack buffer */ sendblock = 1; #if defined(HAVE_ALARM) && defined(SIGALRM) mysignal(SIGALRM, timer); #endif sdp = r_init(); sap = &ackbuf.hdr; do { size = readit(test, &sdp, pf->f_convert); if (size < 0) { nak(errno + 100); return; } sdp->th_opcode = htons((unsigned short)opcode_DATA); sdp->th_block = htons(sendblock); timeout = 0; #ifdef HAVE_SIGSETJMP (void) sigsetjmp(timeoutbuf, 1); #endif if(test->writedelay) { logmsg("Pausing %d seconds before %d bytes", test->writedelay, size); wait_ms(1000*test->writedelay); } send_data: if (swrite(peer, sdp, size + 4) != size + 4) { logmsg("write"); return; } read_ahead(test, pf->f_convert); for ( ; ; ) { #ifdef HAVE_ALARM alarm(rexmtval); /* read the ack */ #endif n = sread(peer, &ackbuf.storage[0], sizeof(ackbuf.storage)); #ifdef HAVE_ALARM alarm(0); #endif if(got_exit_signal) return; if (n < 0) { logmsg("read: fail"); return; } sap->th_opcode = ntohs((unsigned short)sap->th_opcode); sap->th_block = ntohs(sap->th_block); if (sap->th_opcode == opcode_ERROR) { logmsg("got ERROR"); return; } if (sap->th_opcode == opcode_ACK) { if (sap->th_block == sendblock) { break; } /* Re-synchronize with the other side */ (void) synchnet(peer); if (sap->th_block == (sendblock-1)) { goto send_data; } } } sendblock++; } while (size == SEGSIZE); } /* * Receive a file. */ static void recvtftp(struct testcase *test, struct formats *pf) { ssize_t n, size; unsigned short recvblock; /* block count */ struct tftphdr *rdp; /* data buffer */ struct tftphdr *rap; /* ack buffer */ recvblock = 0; #if defined(HAVE_ALARM) && defined(SIGALRM) mysignal(SIGALRM, timer); #endif rdp = w_init(); rap = &ackbuf.hdr; do { timeout = 0; rap->th_opcode = htons((unsigned short)opcode_ACK); rap->th_block = htons(recvblock); recvblock++; #ifdef HAVE_SIGSETJMP (void) sigsetjmp(timeoutbuf, 1); #endif send_ack: if (swrite(peer, &ackbuf.storage[0], 4) != 4) { logmsg("write: fail\n"); goto abort; } write_behind(test, pf->f_convert); for ( ; ; ) { #ifdef HAVE_ALARM alarm(rexmtval); #endif n = sread(peer, rdp, PKTSIZE); #ifdef HAVE_ALARM alarm(0); #endif if(got_exit_signal) goto abort; if (n < 0) { /* really? */ logmsg("read: fail\n"); goto abort; } rdp->th_opcode = ntohs((unsigned short)rdp->th_opcode); rdp->th_block = ntohs(rdp->th_block); if (rdp->th_opcode == opcode_ERROR) goto abort; if (rdp->th_opcode == opcode_DATA) { if (rdp->th_block == recvblock) { break; /* normal */ } /* Re-synchronize with the other side */ (void) synchnet(peer); if (rdp->th_block == (recvblock-1)) goto send_ack; /* rexmit */ } } size = writeit(test, &rdp, (int)(n - 4), pf->f_convert); if (size != (n-4)) { /* ahem */ if (size < 0) nak(errno + 100); else nak(ENOSPACE); goto abort; } } while (size == SEGSIZE); write_behind(test, pf->f_convert); rap->th_opcode = htons((unsigned short)opcode_ACK); /* send the "final" ack */ rap->th_block = htons(recvblock); (void) swrite(peer, &ackbuf.storage[0], 4); #if defined(HAVE_ALARM) && defined(SIGALRM) mysignal(SIGALRM, justtimeout); /* just abort read on timeout */ alarm(rexmtval); #endif /* normally times out and quits */ n = sread(peer, &buf.storage[0], sizeof(buf.storage)); #ifdef HAVE_ALARM alarm(0); #endif if(got_exit_signal) goto abort; if (n >= 4 && /* if read some data */ rdp->th_opcode == opcode_DATA && /* and got a data block */ recvblock == rdp->th_block) { /* then my last ack was lost */ (void) swrite(peer, &ackbuf.storage[0], 4); /* resend final ack */ } abort: return; } /* * Send a nak packet (error message). Error code passed in is one of the * standard TFTP codes, or a UNIX errno offset by 100. */ static void nak(int error) { struct tftphdr *tp; int length; struct errmsg *pe; tp = &buf.hdr; tp->th_opcode = htons((unsigned short)opcode_ERROR); tp->th_code = htons((unsigned short)error); for (pe = errmsgs; pe->e_code >= 0; pe++) if (pe->e_code == error) break; if (pe->e_code < 0) { pe->e_msg = strerror(error - 100); tp->th_code = EUNDEF; /* set 'undef' errorcode */ } length = (int)strlen(pe->e_msg); /* we use memcpy() instead of strcpy() in order to avoid buffer overflow * report from glibc with FORTIFY_SOURCE */ memcpy(tp->th_msg, pe->e_msg, length + 1); length += 5; if (swrite(peer, &buf.storage[0], length) != length) logmsg("nak: fail\n"); } curl-7.35.0/tests/server/testpart.c0000644000175000017500000000300512213173003014144 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "server_setup.h" #include "getpart.h" #define _MPRINTF_REPLACE /* use our functions only */ #include /* include memdebug.h last */ #include "memdebug.h" int main(int argc, char **argv) { int rc; char *part; size_t partlen, i; if(argc< 3) { printf("./testpart main sub\n"); } else { rc = getpart(&part, &partlen, argv[1], argv[2], stdin); if(rc) return(rc); for(i = 0; i < partlen; i++) printf("%c", part[i]); free(part); } return 0; } curl-7.35.0/tests/server/Makefile.inc0000644000175000017500000000332412213173003014346 00000000000000noinst_PROGRAMS = getpart resolve rtspd sockfilt sws tftpd fake_ntlm CURLX_SRCS = \ ../../lib/mprintf.c \ ../../lib/nonblock.c \ ../../lib/strequal.c \ ../../lib/strtoofft.c \ ../../lib/timeval.c \ ../../lib/warnless.c CURLX_HDRS = \ ../../lib/curlx.h \ ../../lib/nonblock.h \ ../../lib/strequal.h \ ../../lib/strtoofft.h \ ../../lib/timeval.h \ ../../lib/warnless.h USEFUL = \ getpart.c \ getpart.h \ server_setup.h \ ../../lib/base64.c \ ../../lib/curl_base64.h \ ../../lib/memdebug.c \ ../../lib/memdebug.h UTIL = \ util.c \ util.h getpart_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) \ testpart.c getpart_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ getpart_CFLAGS = $(AM_CFLAGS) resolve_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \ resolve.c resolve_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ resolve_CFLAGS = $(AM_CFLAGS) rtspd_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \ server_sockaddr.h \ rtspd.c rtspd_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ rtspd_CFLAGS = $(AM_CFLAGS) sockfilt_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \ server_sockaddr.h \ sockfilt.c \ ../../lib/inet_pton.c sockfilt_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ sockfilt_CFLAGS = $(AM_CFLAGS) sws_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \ server_sockaddr.h \ sws.c \ ../../lib/inet_pton.c sws_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ sws_CFLAGS = $(AM_CFLAGS) tftpd_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \ server_sockaddr.h \ tftpd.c \ tftp.h tftpd_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ tftpd_CFLAGS = $(AM_CFLAGS) fake_ntlm_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \ fake_ntlm.c fake_ntlm_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ fake_ntlm_CFLAGS = $(AM_CFLAGS) curl-7.35.0/tests/server/tftp.h0000644000175000017500000000410312213173003013260 00000000000000#ifndef HEADER_CURL_SERVER_TFTP_H #define HEADER_CURL_SERVER_TFTP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "server_setup.h" /* This file is a rewrite/clone of the arpa/tftp.h file for systems without it. */ #define SEGSIZE 512 /* data segment size */ #if defined(__GNUC__) && ((__GNUC__ >= 3) || \ ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 7))) # define PACKED_STRUCT __attribute__((__packed__)) #else # define PACKED_STRUCT /*NOTHING*/ #endif /* Using a packed struct as binary in a program is begging for problems, but the tftpd server was written like this so we have this struct here to make things build. */ struct tftphdr { short th_opcode; /* packet type */ unsigned short th_block; /* all sorts of things */ char th_data[1]; /* data or error string */ } PACKED_STRUCT; #define th_stuff th_block #define th_code th_block #define th_msg th_data #define EUNDEF 0 #define ENOTFOUND 1 #define EACCESS 2 #define ENOSPACE 3 #define EBADOP 4 #define EBADID 5 #define EEXISTS 6 #define ENOUSER 7 #endif /* HEADER_CURL_SERVER_TFTP_H */ curl-7.35.0/tests/server/getpart.h0000644000175000017500000000256712213173003013765 00000000000000#ifndef HEADER_CURL_SERVER_GETPART_H #define HEADER_CURL_SERVER_GETPART_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "server_setup.h" #define GPE_NO_BUFFER_SPACE -2 #define GPE_OUT_OF_MEMORY -1 #define GPE_OK 0 #define GPE_END_OF_FILE 1 int getpart(char **outbuf, size_t *outlen, const char *main, const char *sub, FILE *stream); #endif /* HEADER_CURL_SERVER_GETPART_H */ curl-7.35.0/tests/server/sws.c0000644000175000017500000020175512265612070013137 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "server_setup.h" /* sws.c: simple (silly?) web server This code was originally graciously donated to the project by Juergen Wilke. Thanks a bunch! */ #ifdef HAVE_SIGNAL_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_NETINET_TCP_H #include /* for TCP_NODELAY */ #endif #define ENABLE_CURLX_PRINTF /* make the curlx header define all printf() functions to use the curlx_* versions instead */ #include "curlx.h" /* from the private lib dir */ #include "getpart.h" #include "inet_pton.h" #include "util.h" #include "server_sockaddr.h" /* include memdebug.h last */ #include "memdebug.h" #ifdef USE_WINSOCK #undef EINTR #define EINTR 4 /* errno.h value */ #undef EAGAIN #define EAGAIN 11 /* errno.h value */ #undef ERANGE #define ERANGE 34 /* errno.h value */ #endif #ifdef ENABLE_IPV6 static bool use_ipv6 = FALSE; #endif static bool use_gopher = FALSE; static const char *ipv_inuse = "IPv4"; static int serverlogslocked = 0; static bool is_proxy = FALSE; #define REQBUFSIZ 150000 #define REQBUFSIZ_TXT "149999" static long prevtestno=-1; /* previous test number we served */ static long prevpartno=-1; /* previous part number we served */ static bool prevbounce=FALSE; /* instructs the server to increase the part number for a test in case the identical testno+partno request shows up again */ #define RCMD_NORMALREQ 0 /* default request, use the tests file normally */ #define RCMD_IDLE 1 /* told to sit idle */ #define RCMD_STREAM 2 /* told to stream */ struct httprequest { char reqbuf[REQBUFSIZ]; /* buffer area for the incoming request */ bool connect_request; /* if a CONNECT */ unsigned short connect_port; /* the port number CONNECT used */ size_t checkindex; /* where to start checking of the request */ size_t offset; /* size of the incoming request */ long testno; /* test number found in the request */ long partno; /* part number found in the request */ bool open; /* keep connection open info, as found in the request */ bool auth_req; /* authentication required, don't wait for body unless there's an Authorization header */ bool auth; /* Authorization header present in the incoming request */ size_t cl; /* Content-Length of the incoming request */ bool digest; /* Authorization digest header found */ bool ntlm; /* Authorization ntlm header found */ int writedelay; /* if non-zero, delay this number of seconds between writes in the response */ int pipe; /* if non-zero, expect this many requests to do a "piped" request/response */ int skip; /* if non-zero, the server is instructed to not read this many bytes from a PUT/POST request. Ie the client sends N bytes said in Content-Length, but the server only reads N - skip bytes. */ int rcmd; /* doing a special command, see defines above */ int prot_version; /* HTTP version * 10 */ bool pipelining; /* true if request is pipelined */ int callcount; /* times ProcessRequest() gets called */ bool connmon; /* monitor the state of the connection, log disconnects */ int done_processing; }; #define MAX_SOCKETS 1024 static curl_socket_t all_sockets[MAX_SOCKETS]; static size_t num_sockets = 0; static int ProcessRequest(struct httprequest *req); static void storerequest(char *reqbuf, size_t totalsize); #define DEFAULT_PORT 8999 #ifndef DEFAULT_LOGFILE #define DEFAULT_LOGFILE "log/sws.log" #endif const char *serverlogfile = DEFAULT_LOGFILE; #define SWSVERSION "cURL test suite HTTP server/0.1" #define REQUEST_DUMP "log/server.input" #define RESPONSE_DUMP "log/server.response" /* when told to run as proxy, we store the logs in different files so that they can co-exist with the same program running as a "server" */ #define REQUEST_PROXY_DUMP "log/proxy.input" #define RESPONSE_PROXY_DUMP "log/proxy.response" /* very-big-path support */ #define MAXDOCNAMELEN 140000 #define MAXDOCNAMELEN_TXT "139999" #define REQUEST_KEYWORD_SIZE 256 #define REQUEST_KEYWORD_SIZE_TXT "255" #define CMD_AUTH_REQUIRED "auth_required" /* 'idle' means that it will accept the request fine but never respond any data. Just keep the connection alive. */ #define CMD_IDLE "idle" /* 'stream' means to send a never-ending stream of data */ #define CMD_STREAM "stream" /* 'connection-monitor' will output when a server/proxy connection gets disconnected as for some cases it is important that it gets done at the proper point - like with NTLM */ #define CMD_CONNECTIONMONITOR "connection-monitor" #define END_OF_HEADERS "\r\n\r\n" enum { DOCNUMBER_NOTHING = -4, DOCNUMBER_QUIT = -3, DOCNUMBER_WERULEZ = -2, DOCNUMBER_404 = -1 }; static const char *end_of_headers = END_OF_HEADERS; /* sent as reply to a QUIT */ static const char *docquit = "HTTP/1.1 200 Goodbye" END_OF_HEADERS; /* send back this on 404 file not found */ static const char *doc404 = "HTTP/1.1 404 Not Found\r\n" "Server: " SWSVERSION "\r\n" "Connection: close\r\n" "Content-Type: text/html" END_OF_HEADERS "\n" "\n" "404 Not Found\n" "\n" "

Not Found

\n" "The requested URL was not found on this server.\n" "


" SWSVERSION "
\n" "\n"; /* do-nothing macro replacement for systems which lack siginterrupt() */ #ifndef HAVE_SIGINTERRUPT #define siginterrupt(x,y) do {} while(0) #endif /* vars used to keep around previous signal handlers */ typedef RETSIGTYPE (*SIGHANDLER_T)(int); #ifdef SIGHUP static SIGHANDLER_T old_sighup_handler = SIG_ERR; #endif #ifdef SIGPIPE static SIGHANDLER_T old_sigpipe_handler = SIG_ERR; #endif #ifdef SIGALRM static SIGHANDLER_T old_sigalrm_handler = SIG_ERR; #endif #ifdef SIGINT static SIGHANDLER_T old_sigint_handler = SIG_ERR; #endif #ifdef SIGTERM static SIGHANDLER_T old_sigterm_handler = SIG_ERR; #endif #if defined(SIGBREAK) && defined(WIN32) static SIGHANDLER_T old_sigbreak_handler = SIG_ERR; #endif /* var which if set indicates that the program should finish execution */ SIG_ATOMIC_T got_exit_signal = 0; /* if next is set indicates the first signal handled in exit_signal_handler */ static volatile int exit_signal = 0; /* signal handler that will be triggered to indicate that the program should finish its execution in a controlled manner as soon as possible. The first time this is called it will set got_exit_signal to one and store in exit_signal the signal that triggered its execution. */ static RETSIGTYPE exit_signal_handler(int signum) { int old_errno = errno; if(got_exit_signal == 0) { got_exit_signal = 1; exit_signal = signum; } (void)signal(signum, exit_signal_handler); errno = old_errno; } static void install_signal_handlers(void) { #ifdef SIGHUP /* ignore SIGHUP signal */ if((old_sighup_handler = signal(SIGHUP, SIG_IGN)) == SIG_ERR) logmsg("cannot install SIGHUP handler: %s", strerror(errno)); #endif #ifdef SIGPIPE /* ignore SIGPIPE signal */ if((old_sigpipe_handler = signal(SIGPIPE, SIG_IGN)) == SIG_ERR) logmsg("cannot install SIGPIPE handler: %s", strerror(errno)); #endif #ifdef SIGALRM /* ignore SIGALRM signal */ if((old_sigalrm_handler = signal(SIGALRM, SIG_IGN)) == SIG_ERR) logmsg("cannot install SIGALRM handler: %s", strerror(errno)); #endif #ifdef SIGINT /* handle SIGINT signal with our exit_signal_handler */ if((old_sigint_handler = signal(SIGINT, exit_signal_handler)) == SIG_ERR) logmsg("cannot install SIGINT handler: %s", strerror(errno)); else siginterrupt(SIGINT, 1); #endif #ifdef SIGTERM /* handle SIGTERM signal with our exit_signal_handler */ if((old_sigterm_handler = signal(SIGTERM, exit_signal_handler)) == SIG_ERR) logmsg("cannot install SIGTERM handler: %s", strerror(errno)); else siginterrupt(SIGTERM, 1); #endif #if defined(SIGBREAK) && defined(WIN32) /* handle SIGBREAK signal with our exit_signal_handler */ if((old_sigbreak_handler = signal(SIGBREAK, exit_signal_handler)) == SIG_ERR) logmsg("cannot install SIGBREAK handler: %s", strerror(errno)); else siginterrupt(SIGBREAK, 1); #endif } static void restore_signal_handlers(void) { #ifdef SIGHUP if(SIG_ERR != old_sighup_handler) (void)signal(SIGHUP, old_sighup_handler); #endif #ifdef SIGPIPE if(SIG_ERR != old_sigpipe_handler) (void)signal(SIGPIPE, old_sigpipe_handler); #endif #ifdef SIGALRM if(SIG_ERR != old_sigalrm_handler) (void)signal(SIGALRM, old_sigalrm_handler); #endif #ifdef SIGINT if(SIG_ERR != old_sigint_handler) (void)signal(SIGINT, old_sigint_handler); #endif #ifdef SIGTERM if(SIG_ERR != old_sigterm_handler) (void)signal(SIGTERM, old_sigterm_handler); #endif #if defined(SIGBREAK) && defined(WIN32) if(SIG_ERR != old_sigbreak_handler) (void)signal(SIGBREAK, old_sigbreak_handler); #endif } /* based on the testno, parse the correct server commands */ static int parse_servercmd(struct httprequest *req) { FILE *stream; char *filename; int error; filename = test2file(req->testno); stream=fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg(" [1] Error opening file: %s", filename); logmsg(" Couldn't open test file %ld", req->testno); req->open = FALSE; /* closes connection */ return 1; /* done */ } else { char *orgcmd = NULL; char *cmd = NULL; size_t cmdsize = 0; int num=0; /* get the custom server control "commands" */ error = getpart(&orgcmd, &cmdsize, "reply", "servercmd", stream); fclose(stream); if(error) { logmsg("getpart() failed with error: %d", error); req->open = FALSE; /* closes connection */ return 1; /* done */ } req->connmon = FALSE; cmd = orgcmd; while(cmd && cmdsize) { char *check; if(!strncmp(CMD_AUTH_REQUIRED, cmd, strlen(CMD_AUTH_REQUIRED))) { logmsg("instructed to require authorization header"); req->auth_req = TRUE; } else if(!strncmp(CMD_IDLE, cmd, strlen(CMD_IDLE))) { logmsg("instructed to idle"); req->rcmd = RCMD_IDLE; req->open = TRUE; } else if(!strncmp(CMD_STREAM, cmd, strlen(CMD_STREAM))) { logmsg("instructed to stream"); req->rcmd = RCMD_STREAM; } else if(!strncmp(CMD_CONNECTIONMONITOR, cmd, strlen(CMD_CONNECTIONMONITOR))) { logmsg("enabled connection monitoring"); req->connmon = TRUE; } else if(1 == sscanf(cmd, "pipe: %d", &num)) { logmsg("instructed to allow a pipe size of %d", num); if(num < 0) logmsg("negative pipe size ignored"); else if(num > 0) req->pipe = num-1; /* decrease by one since we don't count the first request in this number */ } else if(1 == sscanf(cmd, "skip: %d", &num)) { logmsg("instructed to skip this number of bytes %d", num); req->skip = num; } else if(1 == sscanf(cmd, "writedelay: %d", &num)) { logmsg("instructed to delay %d secs between packets", num); req->writedelay = num; } else { logmsg("Unknown instruction found: %s", cmd); } /* try to deal with CRLF or just LF */ check = strchr(cmd, '\r'); if(!check) check = strchr(cmd, '\n'); if(check) { /* get to the letter following the newline */ while((*check == '\r') || (*check == '\n')) check++; if(!*check) /* if we reached a zero, get out */ break; cmd = check; } else break; } if(orgcmd) free(orgcmd); } return 0; /* OK! */ } static int ProcessRequest(struct httprequest *req) { char *line=&req->reqbuf[req->checkindex]; bool chunked = FALSE; static char request[REQUEST_KEYWORD_SIZE]; static char doc[MAXDOCNAMELEN]; char logbuf[456]; int prot_major, prot_minor; char *end = strstr(line, end_of_headers); req->callcount++; logmsg("Process %d bytes request%s", req->offset, req->callcount > 1?" [CONTINUED]":""); /* try to figure out the request characteristics as soon as possible, but only once! */ if(use_gopher && (req->testno == DOCNUMBER_NOTHING) && !strncmp("/verifiedserver", line, 15)) { logmsg("Are-we-friendly question received"); req->testno = DOCNUMBER_WERULEZ; return 1; /* done */ } else if((req->testno == DOCNUMBER_NOTHING) && sscanf(line, "%" REQUEST_KEYWORD_SIZE_TXT"s %" MAXDOCNAMELEN_TXT "s HTTP/%d.%d", request, doc, &prot_major, &prot_minor) == 4) { char *ptr; req->prot_version = prot_major*10 + prot_minor; /* find the last slash */ ptr = strrchr(doc, '/'); /* get the number after it */ if(ptr) { if((strlen(doc) + strlen(request)) < 400) sprintf(logbuf, "Got request: %s %s HTTP/%d.%d", request, doc, prot_major, prot_minor); else sprintf(logbuf, "Got a *HUGE* request HTTP/%d.%d", prot_major, prot_minor); logmsg("%s", logbuf); if(!strncmp("/verifiedserver", ptr, 15)) { logmsg("Are-we-friendly question received"); req->testno = DOCNUMBER_WERULEZ; return 1; /* done */ } if(!strncmp("/quit", ptr, 5)) { logmsg("Request-to-quit received"); req->testno = DOCNUMBER_QUIT; return 1; /* done */ } ptr++; /* skip the slash */ /* skip all non-numericals following the slash */ while(*ptr && !ISDIGIT(*ptr)) ptr++; req->testno = strtol(ptr, &ptr, 10); if(req->testno > 10000) { req->partno = req->testno % 10000; req->testno /= 10000; } else req->partno = 0; if(req->testno) { sprintf(logbuf, "Requested test number %ld part %ld", req->testno, req->partno); logmsg("%s", logbuf); /* find and parse for this test */ parse_servercmd(req); } else req->testno = DOCNUMBER_NOTHING; } if(req->testno == DOCNUMBER_NOTHING) { /* didn't find any in the first scan, try alternative test case number placements */ if(sscanf(req->reqbuf, "CONNECT %" MAXDOCNAMELEN_TXT "s HTTP/%d.%d", doc, &prot_major, &prot_minor) == 3) { char *portp = NULL; unsigned long part=0; sprintf(logbuf, "Received a CONNECT %s HTTP/%d.%d request", doc, prot_major, prot_minor); logmsg("%s", logbuf); req->connect_request = TRUE; if(req->prot_version == 10) req->open = FALSE; /* HTTP 1.0 closes connection by default */ if(doc[0] == '[') { char *p = &doc[1]; /* scan through the hexgroups and store the value of the last group in the 'part' variable and use as test case number!! */ while(*p && (ISXDIGIT(*p) || (*p == ':') || (*p == '.'))) { char *endp; part = strtoul(p, &endp, 16); if(ISXDIGIT(*p)) p = endp; else p++; } if(*p != ']') logmsg("Invalid CONNECT IPv6 address format"); else if (*(p+1) != ':') logmsg("Invalid CONNECT IPv6 port format"); else portp = p+1; req->testno = part; } else portp = strchr(doc, ':'); if(portp && (*(portp+1) != '\0') && ISDIGIT(*(portp+1))) { unsigned long ulnum = strtoul(portp+1, NULL, 10); if(!ulnum || (ulnum > 65535UL)) logmsg("Invalid CONNECT port received"); else req->connect_port = curlx_ultous(ulnum); } logmsg("Port number: %d, test case number: %ld", req->connect_port, req->testno); } } if(req->testno == DOCNUMBER_NOTHING) { /* Still no test case number. Try to get the the number off the last dot instead, IE we consider the TLD to be the test number. Test 123 can then be written as "example.com.123". */ /* find the last dot */ ptr = strrchr(doc, '.'); /* get the number after it */ if(ptr) { ptr++; /* skip the dot */ req->testno = strtol(ptr, &ptr, 10); if(req->testno > 10000) { req->partno = req->testno % 10000; req->testno /= 10000; logmsg("found test %d in requested host name", req->testno); } else req->partno = 0; sprintf(logbuf, "Requested test number %ld part %ld (from host name)", req->testno, req->partno); logmsg("%s", logbuf); } if(!req->testno) { logmsg("Did not find test number in PATH"); req->testno = DOCNUMBER_404; } else parse_servercmd(req); } } else if((req->offset >= 3) && (req->testno == DOCNUMBER_NOTHING)) { logmsg("** Unusual request. Starts with %02x %02x %02x", line[0], line[1], line[2]); } if(!end) { /* we don't have a complete request yet! */ logmsg("request not complete yet"); return 0; /* not complete yet */ } logmsg("- request found to be complete"); if(use_gopher) { /* when using gopher we cannot check the request until the entire thing has been received */ char *ptr; /* find the last slash in the line */ ptr = strrchr(line, '/'); if(ptr) { ptr++; /* skip the slash */ /* skip all non-numericals following the slash */ while(*ptr && !ISDIGIT(*ptr)) ptr++; req->testno = strtol(ptr, &ptr, 10); if(req->testno > 10000) { req->partno = req->testno % 10000; req->testno /= 10000; } else req->partno = 0; sprintf(logbuf, "Requested GOPHER test number %ld part %ld", req->testno, req->partno); logmsg("%s", logbuf); } } if(req->pipe) /* we do have a full set, advance the checkindex to after the end of the headers, for the pipelining case mostly */ req->checkindex += (end - line) + strlen(end_of_headers); /* **** Persistence **** * * If the request is a HTTP/1.0 one, we close the connection unconditionally * when we're done. * * If the request is a HTTP/1.1 one, we MUST check for a "Connection:" * header that might say "close". If it does, we close a connection when * this request is processed. Otherwise, we keep the connection alive for X * seconds. */ do { if(got_exit_signal) return 1; /* done */ if((req->cl==0) && curlx_strnequal("Content-Length:", line, 15)) { /* If we don't ignore content-length, we read it and we read the whole request including the body before we return. If we've been told to ignore the content-length, we will return as soon as all headers have been received */ char *endptr; char *ptr = line + 15; unsigned long clen = 0; while(*ptr && ISSPACE(*ptr)) ptr++; endptr = ptr; errno = 0; clen = strtoul(ptr, &endptr, 10); if((ptr == endptr) || !ISSPACE(*endptr) || (ERANGE == errno)) { /* this assumes that a zero Content-Length is valid */ logmsg("Found invalid Content-Length: (%s) in the request", ptr); req->open = FALSE; /* closes connection */ return 1; /* done */ } req->cl = clen - req->skip; logmsg("Found Content-Length: %lu in the request", clen); if(req->skip) logmsg("... but will abort after %zu bytes", req->cl); break; } else if(curlx_strnequal("Transfer-Encoding: chunked", line, strlen("Transfer-Encoding: chunked"))) { /* chunked data coming in */ chunked = TRUE; } if(chunked) { if(strstr(req->reqbuf, "\r\n0\r\n\r\n")) /* end of chunks reached */ return 1; /* done */ else return 0; /* not done */ } line = strchr(line, '\n'); if(line) line++; } while(line); if(!req->auth && strstr(req->reqbuf, "Authorization:")) { req->auth = TRUE; /* Authorization: header present! */ if(req->auth_req) logmsg("Authorization header found, as required"); } if(!req->digest && strstr(req->reqbuf, "Authorization: Digest")) { /* If the client is passing this Digest-header, we set the part number to 1000. Not only to spice up the complexity of this, but to make Digest stuff to work in the test suite. */ req->partno += 1000; req->digest = TRUE; /* header found */ logmsg("Received Digest request, sending back data %ld", req->partno); } else if(!req->ntlm && strstr(req->reqbuf, "Authorization: NTLM TlRMTVNTUAAD")) { /* If the client is passing this type-3 NTLM header */ req->partno += 1002; req->ntlm = TRUE; /* NTLM found */ logmsg("Received NTLM type-3, sending back data %ld", req->partno); if(req->cl) { logmsg(" Expecting %zu POSTed bytes", req->cl); } } else if(!req->ntlm && strstr(req->reqbuf, "Authorization: NTLM TlRMTVNTUAAB")) { /* If the client is passing this type-1 NTLM header */ req->partno += 1001; req->ntlm = TRUE; /* NTLM found */ logmsg("Received NTLM type-1, sending back data %ld", req->partno); } else if((req->partno >= 1000) && strstr(req->reqbuf, "Authorization: Basic")) { /* If the client is passing this Basic-header and the part number is already >=1000, we add 1 to the part number. This allows simple Basic authentication negotiation to work in the test suite. */ req->partno += 1; logmsg("Received Basic request, sending back data %ld", req->partno); } if(strstr(req->reqbuf, "Connection: close")) req->open = FALSE; /* close connection after this request */ if(!req->pipe && req->open && req->prot_version >= 11 && end && req->reqbuf + req->offset > end + strlen(end_of_headers) && !req->cl && (!strncmp(req->reqbuf, "GET", strlen("GET")) || !strncmp(req->reqbuf, "HEAD", strlen("HEAD")))) { /* If we have a persistent connection, HTTP version >= 1.1 and GET/HEAD request, enable pipelining. */ req->checkindex = (end - req->reqbuf) + strlen(end_of_headers); req->pipelining = TRUE; } while(req->pipe) { if(got_exit_signal) return 1; /* done */ /* scan for more header ends within this chunk */ line = &req->reqbuf[req->checkindex]; end = strstr(line, end_of_headers); if(!end) break; req->checkindex += (end - line) + strlen(end_of_headers); req->pipe--; } /* If authentication is required and no auth was provided, end now. This makes the server NOT wait for PUT/POST data and you can then make the test case send a rejection before any such data has been sent. Test case 154 uses this.*/ if(req->auth_req && !req->auth) { logmsg("Return early due to auth requested by none provided"); return 1; /* done */ } if(req->cl > 0) { if(req->cl <= req->offset - (end - req->reqbuf) - strlen(end_of_headers)) return 1; /* done */ else return 0; /* not complete yet */ } return 1; /* done */ } /* store the entire request in a file */ static void storerequest(char *reqbuf, size_t totalsize) { int res; int error = 0; size_t written; size_t writeleft; FILE *dump; const char *dumpfile=is_proxy?REQUEST_PROXY_DUMP:REQUEST_DUMP; if (reqbuf == NULL) return; if (totalsize == 0) return; do { dump = fopen(dumpfile, "ab"); } while ((dump == NULL) && ((error = errno) == EINTR)); if (dump == NULL) { logmsg("[2] Error opening file %s error: %d %s", dumpfile, error, strerror(error)); logmsg("Failed to write request input "); return; } writeleft = totalsize; do { written = fwrite(&reqbuf[totalsize-writeleft], 1, writeleft, dump); if(got_exit_signal) goto storerequest_cleanup; if(written > 0) writeleft -= written; } while ((writeleft > 0) && ((error = errno) == EINTR)); if(writeleft == 0) logmsg("Wrote request (%zu bytes) input to %s", totalsize, dumpfile); else if(writeleft > 0) { logmsg("Error writing file %s error: %d %s", dumpfile, error, strerror(error)); logmsg("Wrote only (%zu bytes) of (%zu bytes) request input to %s", totalsize-writeleft, totalsize, dumpfile); } storerequest_cleanup: do { res = fclose(dump); } while(res && ((error = errno) == EINTR)); if(res) logmsg("Error closing file %s error: %d %s", dumpfile, error, strerror(error)); } static void init_httprequest(struct httprequest *req) { /* Pipelining is already set, so do not initialize it here. Only initialize checkindex and offset if pipelining is not set, since in a pipeline they need to be inherited from the previous request. */ if(!req->pipelining) { req->checkindex = 0; req->offset = 0; } req->testno = DOCNUMBER_NOTHING; req->partno = 0; req->connect_request = FALSE; req->open = TRUE; req->auth_req = FALSE; req->auth = FALSE; req->cl = 0; req->digest = FALSE; req->ntlm = FALSE; req->pipe = 0; req->skip = 0; req->writedelay = 0; req->rcmd = RCMD_NORMALREQ; req->prot_version = 0; req->callcount = 0; req->connect_port = 0; req->done_processing = 0; } /* returns 1 if the connection should be serviced again immediately, 0 if there is no data waiting, or < 0 if it should be closed */ static int get_request(curl_socket_t sock, struct httprequest *req) { int error; int fail = 0; char *reqbuf = req->reqbuf; ssize_t got = 0; int overflow = 0; char *pipereq = NULL; size_t pipereq_length = 0; if(req->pipelining) { pipereq = reqbuf + req->checkindex; pipereq_length = req->offset - req->checkindex; /* Now that we've got the pipelining info we can reset the pipelining-related vars which were skipped in init_httprequest */ req->pipelining = FALSE; req->checkindex = 0; req->offset = 0; } if(req->offset >= REQBUFSIZ-1) { /* buffer is already full; do nothing */ overflow = 1; } else { if(pipereq_length && pipereq) { memmove(reqbuf, pipereq, pipereq_length); got = curlx_uztosz(pipereq_length); pipereq_length = 0; } else { if(req->skip) /* we are instructed to not read the entire thing, so we make sure to only read what we're supposed to and NOT read the enire thing the client wants to send! */ got = sread(sock, reqbuf + req->offset, req->cl); else got = sread(sock, reqbuf + req->offset, REQBUFSIZ-1 - req->offset); } if(got_exit_signal) return -1; if(got == 0) { logmsg("Connection closed by client"); fail = 1; } else if(got < 0) { error = SOCKERRNO; if (EAGAIN == error || EWOULDBLOCK == error) { /* nothing to read at the moment */ return 0; } logmsg("recv() returned error: (%d) %s", error, strerror(error)); fail = 1; } if(fail) { /* dump the request received so far to the external file */ reqbuf[req->offset] = '\0'; storerequest(reqbuf, req->offset); return -1; } logmsg("Read %zd bytes", got); req->offset += (size_t)got; reqbuf[req->offset] = '\0'; req->done_processing = ProcessRequest(req); if(got_exit_signal) return -1; if(req->done_processing && req->pipe) { logmsg("Waiting for another piped request"); req->done_processing = 0; req->pipe--; } } if(overflow || (req->offset == REQBUFSIZ-1 && got > 0)) { logmsg("Request would overflow buffer, closing connection"); /* dump request received so far to external file anyway */ reqbuf[REQBUFSIZ-1] = '\0'; fail = 1; } else if(req->offset > REQBUFSIZ-1) { logmsg("Request buffer overflow, closing connection"); /* dump request received so far to external file anyway */ reqbuf[REQBUFSIZ-1] = '\0'; fail = 1; } else reqbuf[req->offset] = '\0'; /* at the end of a request dump it to an external file */ if (fail || req->done_processing) storerequest(reqbuf, req->pipelining ? req->checkindex : req->offset); if(got_exit_signal) return -1; return fail ? -1 : 1; } /* returns -1 on failure */ static int send_doc(curl_socket_t sock, struct httprequest *req) { ssize_t written; size_t count; const char *buffer; char *ptr=NULL; FILE *stream; char *cmd=NULL; size_t cmdsize=0; FILE *dump; bool persistant = TRUE; bool sendfailure = FALSE; size_t responsesize; int error = 0; int res; const char *responsedump = is_proxy?RESPONSE_PROXY_DUMP:RESPONSE_DUMP; static char weare[256]; switch(req->rcmd) { default: case RCMD_NORMALREQ: break; /* continue with business as usual */ case RCMD_STREAM: #define STREAMTHIS "a string to stream 01234567890\n" count = strlen(STREAMTHIS); for (;;) { written = swrite(sock, STREAMTHIS, count); if(got_exit_signal) return -1; if(written != (ssize_t)count) { logmsg("Stopped streaming"); break; } } return -1; case RCMD_IDLE: /* Do nothing. Sit idle. Pretend it rains. */ return 0; } req->open = FALSE; if(req->testno < 0) { size_t msglen; char msgbuf[64]; switch(req->testno) { case DOCNUMBER_QUIT: logmsg("Replying to QUIT"); buffer = docquit; break; case DOCNUMBER_WERULEZ: /* we got a "friends?" question, reply back that we sure are */ logmsg("Identifying ourselves as friends"); sprintf(msgbuf, "WE ROOLZ: %ld\r\n", (long)getpid()); msglen = strlen(msgbuf); if(use_gopher) sprintf(weare, "%s", msgbuf); else sprintf(weare, "HTTP/1.1 200 OK\r\nContent-Length: %zu\r\n\r\n%s", msglen, msgbuf); buffer = weare; break; case DOCNUMBER_404: default: logmsg("Replying to with a 404"); buffer = doc404; break; } count = strlen(buffer); } else { char partbuf[80]; char *filename = test2file(req->testno); /* select the tag for "normal" requests and the one for CONNECT requests (within the section) */ const char *section= req->connect_request?"connect":"data"; if(req->partno) sprintf(partbuf, "%s%ld", section, req->partno); else sprintf(partbuf, "%s", section); logmsg("Send response test%ld section <%s>", req->testno, partbuf); stream=fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg(" [3] Error opening file: %s", filename); return 0; } else { error = getpart(&ptr, &count, "reply", partbuf, stream); fclose(stream); if(error) { logmsg("getpart() failed with error: %d", error); return 0; } buffer = ptr; } if(got_exit_signal) { if(ptr) free(ptr); return -1; } /* re-open the same file again */ stream=fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg(" [4] Error opening file: %s", filename); if(ptr) free(ptr); return 0; } else { /* get the custom server control "commands" */ error = getpart(&cmd, &cmdsize, "reply", "postcmd", stream); fclose(stream); if(error) { logmsg("getpart() failed with error: %d", error); if(ptr) free(ptr); return 0; } } } if(got_exit_signal) { if(ptr) free(ptr); if(cmd) free(cmd); return -1; } /* If the word 'swsclose' is present anywhere in the reply chunk, the connection will be closed after the data has been sent to the requesting client... */ if(strstr(buffer, "swsclose") || !count) { persistant = FALSE; logmsg("connection close instruction \"swsclose\" found in response"); } if(strstr(buffer, "swsbounce")) { prevbounce = TRUE; logmsg("enable \"swsbounce\" in the next request"); } else prevbounce = FALSE; dump = fopen(responsedump, "ab"); if(!dump) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg(" [5] Error opening file: %s", responsedump); if(ptr) free(ptr); if(cmd) free(cmd); return -1; } responsesize = count; do { /* Ok, we send no more than 200 bytes at a time, just to make sure that larger chunks are split up so that the client will need to do multiple recv() calls to get it and thus we exercise that code better */ size_t num = count; if(num > 200) num = 200; written = swrite(sock, buffer, num); if (written < 0) { sendfailure = TRUE; break; } else { logmsg("Sent off %zd bytes", written); } /* write to file as well */ fwrite(buffer, 1, (size_t)written, dump); count -= written; buffer += written; if(req->writedelay) { int quarters = req->writedelay * 4; logmsg("Pausing %d seconds", req->writedelay); while((quarters > 0) && !got_exit_signal) { quarters--; wait_ms(250); } } } while((count > 0) && !got_exit_signal); do { res = fclose(dump); } while(res && ((error = errno) == EINTR)); if(res) logmsg("Error closing file %s error: %d %s", responsedump, error, strerror(error)); if(got_exit_signal) { if(ptr) free(ptr); if(cmd) free(cmd); return -1; } if(sendfailure) { logmsg("Sending response failed. Only (%zu bytes) of (%zu bytes) were sent", responsesize-count, responsesize); if(ptr) free(ptr); if(cmd) free(cmd); return -1; } logmsg("Response sent (%zu bytes) and written to %s", responsesize, responsedump); if(ptr) free(ptr); if(cmdsize > 0 ) { char command[32]; int quarters; int num; ptr=cmd; do { if(2 == sscanf(ptr, "%31s %d", command, &num)) { if(!strcmp("wait", command)) { logmsg("Told to sleep for %d seconds", num); quarters = num * 4; while((quarters > 0) && !got_exit_signal) { quarters--; res = wait_ms(250); if(res) { /* should not happen */ error = errno; logmsg("wait_ms() failed with error: (%d) %s", error, strerror(error)); break; } } if(!quarters) logmsg("Continuing after sleeping %d seconds", num); } else logmsg("Unknown command in reply command section"); } ptr = strchr(ptr, '\n'); if(ptr) ptr++; else ptr = NULL; } while(ptr && *ptr); } if(cmd) free(cmd); req->open = use_gopher?FALSE:persistant; prevtestno = req->testno; prevpartno = req->partno; return 0; } static curl_socket_t connect_to(const char *ipaddr, unsigned short port) { srvr_sockaddr_union_t serveraddr; curl_socket_t serverfd; int error; int rc; const char *op_br = ""; const char *cl_br = ""; #ifdef TCP_NODELAY curl_socklen_t flag; #endif #ifdef ENABLE_IPV6 if(use_ipv6) { op_br = "["; cl_br = "]"; } #endif if(!ipaddr) return CURL_SOCKET_BAD; logmsg("about to connect to %s%s%s:%hu", op_br, ipaddr, cl_br, port); #ifdef ENABLE_IPV6 if(!use_ipv6) #endif serverfd = socket(AF_INET, SOCK_STREAM, 0); #ifdef ENABLE_IPV6 else serverfd = socket(AF_INET6, SOCK_STREAM, 0); #endif if(CURL_SOCKET_BAD == serverfd) { error = SOCKERRNO; logmsg("Error creating socket for server conection: (%d) %s", error, strerror(error)); return CURL_SOCKET_BAD; } #ifdef TCP_NODELAY /* Disable the Nagle algorithm */ flag = 1; if(0 != setsockopt(serverfd, IPPROTO_TCP, TCP_NODELAY, (void *)&flag, sizeof(flag))) logmsg("====> TCP_NODELAY for server conection failed"); else logmsg("TCP_NODELAY set for server conection"); #endif #ifdef ENABLE_IPV6 if(!use_ipv6) { #endif memset(&serveraddr.sa4, 0, sizeof(serveraddr.sa4)); serveraddr.sa4.sin_family = AF_INET; serveraddr.sa4.sin_port = htons(port); if(Curl_inet_pton(AF_INET, ipaddr, &serveraddr.sa4.sin_addr) < 1) { logmsg("Error inet_pton failed AF_INET conversion of '%s'", ipaddr); sclose(serverfd); return CURL_SOCKET_BAD; } rc = connect(serverfd, &serveraddr.sa, sizeof(serveraddr.sa4)); #ifdef ENABLE_IPV6 } else { memset(&serveraddr.sa6, 0, sizeof(serveraddr.sa6)); serveraddr.sa6.sin6_family = AF_INET6; serveraddr.sa6.sin6_port = htons(port); if(Curl_inet_pton(AF_INET6, ipaddr, &serveraddr.sa6.sin6_addr) < 1) { logmsg("Error inet_pton failed AF_INET6 conversion of '%s'", ipaddr); sclose(serverfd); return CURL_SOCKET_BAD; } rc = connect(serverfd, &serveraddr.sa, sizeof(serveraddr.sa6)); } #endif /* ENABLE_IPV6 */ if(got_exit_signal) { sclose(serverfd); return CURL_SOCKET_BAD; } if(rc) { error = SOCKERRNO; logmsg("Error connecting to server port %hu: (%d) %s", port, error, strerror(error)); sclose(serverfd); return CURL_SOCKET_BAD; } logmsg("connected fine to %s%s%s:%hu, now tunnel", op_br, ipaddr, cl_br, port); return serverfd; } /* * A CONNECT has been received, a CONNECT response has been sent. * * This function needs to connect to the server, and then pass data between * the client and the server back and forth until the connection is closed by * either end. * * When doing FTP through a CONNECT proxy, we expect that the data connection * will be setup while the first connect is still being kept up. Therefor we * must accept a new connection and deal with it appropriately. */ #define data_or_ctrl(x) ((x)?"DATA":"CTRL") #define CTRL 0 #define DATA 1 static void http_connect(curl_socket_t *infdp, curl_socket_t rootfd, const char *ipaddr, unsigned short ipport) { curl_socket_t serverfd[2] = {CURL_SOCKET_BAD, CURL_SOCKET_BAD}; curl_socket_t clientfd[2] = {CURL_SOCKET_BAD, CURL_SOCKET_BAD}; ssize_t toc[2] = {0, 0}; /* number of bytes to client */ ssize_t tos[2] = {0, 0}; /* number of bytes to server */ char readclient[2][256]; char readserver[2][256]; bool poll_client_rd[2] = { TRUE, TRUE }; bool poll_server_rd[2] = { TRUE, TRUE }; bool poll_client_wr[2] = { TRUE, TRUE }; bool poll_server_wr[2] = { TRUE, TRUE }; #ifdef TCP_NODELAY curl_socklen_t flag; #endif bool primary = FALSE; bool secondary = FALSE; int max_tunnel_idx; /* CTRL or DATA */ int loop; int i; /* primary tunnel client endpoint already connected */ clientfd[CTRL] = *infdp; /* Sleep here to make sure the client reads CONNECT response's 'end of headers' separate from the server data that follows. This is done to prevent triggering libcurl known bug #39. */ for(loop = 2; (loop > 0) && !got_exit_signal; loop--) wait_ms(250); if(got_exit_signal) goto http_connect_cleanup; serverfd[CTRL] = connect_to(ipaddr, ipport); if(serverfd[CTRL] == CURL_SOCKET_BAD) goto http_connect_cleanup; /* Primary tunnel socket endpoints are now connected. Tunnel data back and forth over the primary tunnel until client or server breaks the primary tunnel, simultaneously allowing establishment, operation and teardown of a secondary tunnel that may be used for passive FTP data connection. */ max_tunnel_idx = CTRL; primary = TRUE; while(!got_exit_signal) { fd_set input; fd_set output; struct timeval timeout = {0, 250000L}; /* 250 ms */ ssize_t rc; curl_socket_t maxfd = (curl_socket_t)-1; FD_ZERO(&input); FD_ZERO(&output); if((clientfd[DATA] == CURL_SOCKET_BAD) && (serverfd[DATA] == CURL_SOCKET_BAD) && poll_client_rd[CTRL] && poll_client_wr[CTRL] && poll_server_rd[CTRL] && poll_server_wr[CTRL]) { /* listener socket is monitored to allow client to establish secondary tunnel only when this tunnel is not established and primary one is fully operational */ FD_SET(rootfd, &input); maxfd = rootfd; } /* set tunnel sockets to wait for */ for(i = 0; i <= max_tunnel_idx; i++) { /* client side socket monitoring */ if(clientfd[i] != CURL_SOCKET_BAD) { if(poll_client_rd[i]) { /* unless told not to do so, monitor readability */ FD_SET(clientfd[i], &input); if(clientfd[i] > maxfd) maxfd = clientfd[i]; } if(poll_client_wr[i] && toc[i]) { /* unless told not to do so, monitor writeability if there is data ready to be sent to client */ FD_SET(clientfd[i], &output); if(clientfd[i] > maxfd) maxfd = clientfd[i]; } } /* server side socket monitoring */ if(serverfd[i] != CURL_SOCKET_BAD) { if(poll_server_rd[i]) { /* unless told not to do so, monitor readability */ FD_SET(serverfd[i], &input); if(serverfd[i] > maxfd) maxfd = serverfd[i]; } if(poll_server_wr[i] && tos[i]) { /* unless told not to do so, monitor writeability if there is data ready to be sent to server */ FD_SET(serverfd[i], &output); if(serverfd[i] > maxfd) maxfd = serverfd[i]; } } } if(got_exit_signal) break; rc = select((int)maxfd + 1, &input, &output, NULL, &timeout); if(rc > 0) { /* socket action */ bool tcp_fin_wr; if(got_exit_signal) break; tcp_fin_wr = FALSE; /* ---------------------------------------------------------- */ /* passive mode FTP may establish a secondary tunnel */ if((clientfd[DATA] == CURL_SOCKET_BAD) && (serverfd[DATA] == CURL_SOCKET_BAD) && FD_ISSET(rootfd, &input)) { /* a new connection on listener socket (most likely from client) */ curl_socket_t datafd = accept(rootfd, NULL, NULL); if(datafd != CURL_SOCKET_BAD) { struct httprequest req2; int err = 0; memset(&req2, 0, sizeof(req2)); logmsg("====> Client connect DATA"); #ifdef TCP_NODELAY /* Disable the Nagle algorithm */ flag = 1; if(0 != setsockopt(datafd, IPPROTO_TCP, TCP_NODELAY, (void *)&flag, sizeof(flag))) logmsg("====> TCP_NODELAY for client DATA conection failed"); else logmsg("TCP_NODELAY set for client DATA conection"); #endif req2.pipelining = FALSE; init_httprequest(&req2); while(!req2.done_processing) { err = get_request(datafd, &req2); if(err < 0) { /* this socket must be closed, done or not */ break; } } /* skip this and close the socket if err < 0 */ if(err >= 0) { err = send_doc(datafd, &req2); if(!err && req2.connect_request) { /* sleep to prevent triggering libcurl known bug #39. */ for(loop = 2; (loop > 0) && !got_exit_signal; loop--) wait_ms(250); if(!got_exit_signal) { /* connect to the server */ serverfd[DATA] = connect_to(ipaddr, req2.connect_port); if(serverfd[DATA] != CURL_SOCKET_BAD) { /* secondary tunnel established, now we have two connections */ poll_client_rd[DATA] = TRUE; poll_client_wr[DATA] = TRUE; poll_server_rd[DATA] = TRUE; poll_server_wr[DATA] = TRUE; max_tunnel_idx = DATA; secondary = TRUE; toc[DATA] = 0; tos[DATA] = 0; clientfd[DATA] = datafd; datafd = CURL_SOCKET_BAD; } } } } if(datafd != CURL_SOCKET_BAD) { /* secondary tunnel not established */ shutdown(datafd, SHUT_RDWR); sclose(datafd); } } if(got_exit_signal) break; } /* ---------------------------------------------------------- */ /* react to tunnel endpoint readable/writeable notifications */ for(i = 0; i <= max_tunnel_idx; i++) { size_t len; if(clientfd[i] != CURL_SOCKET_BAD) { len = sizeof(readclient[i]) - tos[i]; if(len && FD_ISSET(clientfd[i], &input)) { /* read from client */ rc = sread(clientfd[i], &readclient[i][tos[i]], len); if(rc <= 0) { logmsg("[%s] got %zd, STOP READING client", data_or_ctrl(i), rc); shutdown(clientfd[i], SHUT_RD); poll_client_rd[i] = FALSE; } else { logmsg("[%s] READ %zd bytes from client", data_or_ctrl(i), rc); logmsg("[%s] READ \"%s\"", data_or_ctrl(i), data_to_hex(&readclient[i][tos[i]], rc)); tos[i] += rc; } } } if(serverfd[i] != CURL_SOCKET_BAD) { len = sizeof(readserver[i])-toc[i]; if(len && FD_ISSET(serverfd[i], &input)) { /* read from server */ rc = sread(serverfd[i], &readserver[i][toc[i]], len); if(rc <= 0) { logmsg("[%s] got %zd, STOP READING server", data_or_ctrl(i), rc); shutdown(serverfd[i], SHUT_RD); poll_server_rd[i] = FALSE; } else { logmsg("[%s] READ %zd bytes from server", data_or_ctrl(i), rc); logmsg("[%s] READ \"%s\"", data_or_ctrl(i), data_to_hex(&readserver[i][toc[i]], rc)); toc[i] += rc; } } } if(clientfd[i] != CURL_SOCKET_BAD) { if(toc[i] && FD_ISSET(clientfd[i], &output)) { /* write to client */ rc = swrite(clientfd[i], readserver[i], toc[i]); if(rc <= 0) { logmsg("[%s] got %zd, STOP WRITING client", data_or_ctrl(i), rc); shutdown(clientfd[i], SHUT_WR); poll_client_wr[i] = FALSE; tcp_fin_wr = TRUE; } else { logmsg("[%s] SENT %zd bytes to client", data_or_ctrl(i), rc); logmsg("[%s] SENT \"%s\"", data_or_ctrl(i), data_to_hex(readserver[i], rc)); if(toc[i] - rc) memmove(&readserver[i][0], &readserver[i][rc], toc[i]-rc); toc[i] -= rc; } } } if(serverfd[i] != CURL_SOCKET_BAD) { if(tos[i] && FD_ISSET(serverfd[i], &output)) { /* write to server */ rc = swrite(serverfd[i], readclient[i], tos[i]); if(rc <= 0) { logmsg("[%s] got %zd, STOP WRITING server", data_or_ctrl(i), rc); shutdown(serverfd[i], SHUT_WR); poll_server_wr[i] = FALSE; tcp_fin_wr = TRUE; } else { logmsg("[%s] SENT %zd bytes to server", data_or_ctrl(i), rc); logmsg("[%s] SENT \"%s\"", data_or_ctrl(i), data_to_hex(readclient[i], rc)); if(tos[i] - rc) memmove(&readclient[i][0], &readclient[i][rc], tos[i]-rc); tos[i] -= rc; } } } } if(got_exit_signal) break; /* ---------------------------------------------------------- */ /* endpoint read/write disabling, endpoint closing and tunnel teardown */ for(i = 0; i <= max_tunnel_idx; i++) { for(loop = 2; loop > 0; loop--) { /* loop twice to satisfy condition interdependencies without having to await select timeout or another socket event */ if(clientfd[i] != CURL_SOCKET_BAD) { if(poll_client_rd[i] && !poll_server_wr[i]) { logmsg("[%s] DISABLED READING client", data_or_ctrl(i)); shutdown(clientfd[i], SHUT_RD); poll_client_rd[i] = FALSE; } if(poll_client_wr[i] && !poll_server_rd[i] && !toc[i]) { logmsg("[%s] DISABLED WRITING client", data_or_ctrl(i)); shutdown(clientfd[i], SHUT_WR); poll_client_wr[i] = FALSE; tcp_fin_wr = TRUE; } } if(serverfd[i] != CURL_SOCKET_BAD) { if(poll_server_rd[i] && !poll_client_wr[i]) { logmsg("[%s] DISABLED READING server", data_or_ctrl(i)); shutdown(serverfd[i], SHUT_RD); poll_server_rd[i] = FALSE; } if(poll_server_wr[i] && !poll_client_rd[i] && !tos[i]) { logmsg("[%s] DISABLED WRITING server", data_or_ctrl(i)); shutdown(serverfd[i], SHUT_WR); poll_server_wr[i] = FALSE; tcp_fin_wr = TRUE; } } } } if(tcp_fin_wr) /* allow kernel to place FIN bit packet on the wire */ wait_ms(250); /* socket clearing */ for(i = 0; i <= max_tunnel_idx; i++) { for(loop = 2; loop > 0; loop--) { if(clientfd[i] != CURL_SOCKET_BAD) { if(!poll_client_wr[i] && !poll_client_rd[i]) { logmsg("[%s] CLOSING client socket", data_or_ctrl(i)); sclose(clientfd[i]); clientfd[i] = CURL_SOCKET_BAD; if(serverfd[i] == CURL_SOCKET_BAD) { logmsg("[%s] ENDING", data_or_ctrl(i)); if(i == DATA) secondary = FALSE; else primary = FALSE; } } } if(serverfd[i] != CURL_SOCKET_BAD) { if(!poll_server_wr[i] && !poll_server_rd[i]) { logmsg("[%s] CLOSING server socket", data_or_ctrl(i)); sclose(serverfd[i]); serverfd[i] = CURL_SOCKET_BAD; if(clientfd[i] == CURL_SOCKET_BAD) { logmsg("[%s] ENDING", data_or_ctrl(i)); if(i == DATA) secondary = FALSE; else primary = FALSE; } } } } } /* ---------------------------------------------------------- */ max_tunnel_idx = secondary ? DATA : CTRL; if(!primary) /* exit loop upon primary tunnel teardown */ break; } /* (rc > 0) */ } http_connect_cleanup: for(i = DATA; i >= CTRL; i--) { if(serverfd[i] != CURL_SOCKET_BAD) { logmsg("[%s] CLOSING server socket (cleanup)", data_or_ctrl(i)); shutdown(serverfd[i], SHUT_RDWR); sclose(serverfd[i]); } if(clientfd[i] != CURL_SOCKET_BAD) { logmsg("[%s] CLOSING client socket (cleanup)", data_or_ctrl(i)); shutdown(clientfd[i], SHUT_RDWR); sclose(clientfd[i]); } if((serverfd[i] != CURL_SOCKET_BAD) || (clientfd[i] != CURL_SOCKET_BAD)) { logmsg("[%s] ABORTING", data_or_ctrl(i)); } } *infdp = CURL_SOCKET_BAD; } /* returns a socket handle, or 0 if there are no more waiting sockets, or < 0 if there was an error */ static curl_socket_t accept_connection(curl_socket_t sock) { curl_socket_t msgsock = CURL_SOCKET_BAD; int error; int flag = 1; if(MAX_SOCKETS == num_sockets) { logmsg("Too many open sockets!"); return CURL_SOCKET_BAD; } msgsock = accept(sock, NULL, NULL); if(got_exit_signal) { if(CURL_SOCKET_BAD != msgsock) sclose(msgsock); return CURL_SOCKET_BAD; } if(CURL_SOCKET_BAD == msgsock) { error = SOCKERRNO; if(EAGAIN == error || EWOULDBLOCK == error) { /* nothing to accept */ return 0; } logmsg("MAJOR ERROR: accept() failed with error: (%d) %s", error, strerror(error)); return CURL_SOCKET_BAD; } if(0 != curlx_nonblock(msgsock, TRUE)) { error = SOCKERRNO; logmsg("curlx_nonblock failed with error: (%d) %s", error, strerror(error)); sclose(msgsock); return CURL_SOCKET_BAD; } if(0 != setsockopt(msgsock, SOL_SOCKET, SO_KEEPALIVE, (void *)&flag, sizeof(flag))) { error = SOCKERRNO; logmsg("setsockopt(SO_KEEPALIVE) failed with error: (%d) %s", error, strerror(error)); sclose(msgsock); return CURL_SOCKET_BAD; } /* ** As soon as this server accepts a connection from the test harness it ** must set the server logs advisor read lock to indicate that server ** logs should not be read until this lock is removed by this server. */ if(!serverlogslocked) set_advisor_read_lock(SERVERLOGS_LOCK); serverlogslocked += 1; logmsg("====> Client connect"); all_sockets[num_sockets] = msgsock; num_sockets += 1; #ifdef TCP_NODELAY /* * Disable the Nagle algorithm to make it easier to send out a large * response in many small segments to torture the clients more. */ if(0 != setsockopt(msgsock, IPPROTO_TCP, TCP_NODELAY, (void *)&flag, sizeof(flag))) logmsg("====> TCP_NODELAY failed"); else logmsg("TCP_NODELAY set"); #endif return msgsock; } /* returns 1 if the connection should be serviced again immediately, 0 if there is no data waiting, or < 0 if it should be closed */ static int service_connection(curl_socket_t msgsock, struct httprequest *req, curl_socket_t listensock, const char *connecthost) { if(got_exit_signal) return -1; while(!req->done_processing) { int rc = get_request(msgsock, req); if (rc <= 0) { /* Nothing further to read now (possibly because the socket was closed */ return rc; } } if(prevbounce) { /* bounce treatment requested */ if((req->testno == prevtestno) && (req->partno == prevpartno)) { req->partno++; logmsg("BOUNCE part number to %ld", req->partno); } else { prevbounce = FALSE; prevtestno = -1; prevpartno = -1; } } send_doc(msgsock, req); if(got_exit_signal) return -1; if(req->testno < 0) { logmsg("special request received, no persistency"); return -1; } if(!req->open) { logmsg("instructed to close connection after server-reply"); return -1; } if(req->connect_request) { /* a CONNECT request, setup and talk the tunnel */ if(!is_proxy) { logmsg("received CONNECT but isn't running as proxy!"); return 1; } else { http_connect(&msgsock, listensock, connecthost, req->connect_port); return -1; } } /* if we got a CONNECT, loop and get another request as well! */ if(req->open) { logmsg("=> persistant connection request ended, awaits new request\n"); return 1; } return -1; } int main(int argc, char *argv[]) { srvr_sockaddr_union_t me; curl_socket_t sock = CURL_SOCKET_BAD; int wrotepidfile = 0; int flag; unsigned short port = DEFAULT_PORT; char *pidname= (char *)".http.pid"; struct httprequest req; int rc; int error; int arg=1; long pid; const char *connecthost = "127.0.0.1"; /* a default CONNECT port is basically pointless but still ... */ size_t socket_idx; memset(&req, 0, sizeof(req)); while(argc>arg) { if(!strcmp("--version", argv[arg])) { printf("sws IPv4%s" "\n" , #ifdef ENABLE_IPV6 "/IPv6" #else "" #endif ); return 0; } else if(!strcmp("--pidfile", argv[arg])) { arg++; if(argc>arg) pidname = argv[arg++]; } else if(!strcmp("--logfile", argv[arg])) { arg++; if(argc>arg) serverlogfile = argv[arg++]; } else if(!strcmp("--gopher", argv[arg])) { arg++; use_gopher = TRUE; end_of_headers = "\r\n"; /* gopher style is much simpler */ } else if(!strcmp("--ipv4", argv[arg])) { #ifdef ENABLE_IPV6 ipv_inuse = "IPv4"; use_ipv6 = FALSE; #endif arg++; } else if(!strcmp("--ipv6", argv[arg])) { #ifdef ENABLE_IPV6 ipv_inuse = "IPv6"; use_ipv6 = TRUE; #endif arg++; } else if(!strcmp("--port", argv[arg])) { arg++; if(argc>arg) { char *endptr; unsigned long ulnum = strtoul(argv[arg], &endptr, 10); if((endptr != argv[arg] + strlen(argv[arg])) || (ulnum < 1025UL) || (ulnum > 65535UL)) { fprintf(stderr, "sws: invalid --port argument (%s)\n", argv[arg]); return 0; } port = curlx_ultous(ulnum); arg++; } } else if(!strcmp("--srcdir", argv[arg])) { arg++; if(argc>arg) { path = argv[arg]; arg++; } } else if(!strcmp("--connect", argv[arg])) { /* The connect host IP number that the proxy will connect to no matter what the client asks for, but also use this as a hint that we run as a proxy and do a few different internal choices */ arg++; if(argc>arg) { connecthost = argv[arg]; arg++; is_proxy = TRUE; logmsg("Run as proxy, CONNECT to host %s", connecthost); } } else { puts("Usage: sws [option]\n" " --version\n" " --logfile [file]\n" " --pidfile [file]\n" " --ipv4\n" " --ipv6\n" " --port [port]\n" " --srcdir [path]\n" " --connect [ip4-addr]\n" " --gopher"); return 0; } } #ifdef WIN32 win32_init(); atexit(win32_cleanup); #endif install_signal_handlers(); pid = (long)getpid(); #ifdef ENABLE_IPV6 if(!use_ipv6) #endif sock = socket(AF_INET, SOCK_STREAM, 0); #ifdef ENABLE_IPV6 else sock = socket(AF_INET6, SOCK_STREAM, 0); #endif all_sockets[0] = sock; num_sockets = 1; if(CURL_SOCKET_BAD == sock) { error = SOCKERRNO; logmsg("Error creating socket: (%d) %s", error, strerror(error)); goto sws_cleanup; } flag = 1; if(0 != setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&flag, sizeof(flag))) { error = SOCKERRNO; logmsg("setsockopt(SO_REUSEADDR) failed with error: (%d) %s", error, strerror(error)); goto sws_cleanup; } if(0 != curlx_nonblock(sock, TRUE)) { error = SOCKERRNO; logmsg("curlx_nonblock failed with error: (%d) %s", error, strerror(error)); goto sws_cleanup; } #ifdef ENABLE_IPV6 if(!use_ipv6) { #endif memset(&me.sa4, 0, sizeof(me.sa4)); me.sa4.sin_family = AF_INET; me.sa4.sin_addr.s_addr = INADDR_ANY; me.sa4.sin_port = htons(port); rc = bind(sock, &me.sa, sizeof(me.sa4)); #ifdef ENABLE_IPV6 } else { memset(&me.sa6, 0, sizeof(me.sa6)); me.sa6.sin6_family = AF_INET6; me.sa6.sin6_addr = in6addr_any; me.sa6.sin6_port = htons(port); rc = bind(sock, &me.sa, sizeof(me.sa6)); } #endif /* ENABLE_IPV6 */ if(0 != rc) { error = SOCKERRNO; logmsg("Error binding socket on port %hu: (%d) %s", port, error, strerror(error)); goto sws_cleanup; } logmsg("Running %s %s version on port %d", use_gopher?"GOPHER":"HTTP", ipv_inuse, (int)port); /* start accepting connections */ rc = listen(sock, 5); if(0 != rc) { error = SOCKERRNO; logmsg("listen() failed with error: (%d) %s", error, strerror(error)); goto sws_cleanup; } /* ** As soon as this server writes its pid file the test harness will ** attempt to connect to this server and initiate its verification. */ wrotepidfile = write_pidfile(pidname); if(!wrotepidfile) goto sws_cleanup; /* initialization of httprequest struct is done before get_request(), but the pipelining struct field must be initialized previously to FALSE every time a new connection arrives. */ req.pipelining = FALSE; init_httprequest(&req); for(;;) { fd_set input; fd_set output; struct timeval timeout = {0, 250000L}; /* 250 ms */ curl_socket_t maxfd = (curl_socket_t)-1; /* Clear out closed sockets */ for (socket_idx = num_sockets - 1; socket_idx >= 1; --socket_idx) { if (CURL_SOCKET_BAD == all_sockets[socket_idx]) { char* dst = (char *) (all_sockets + socket_idx); char* src = (char *) (all_sockets + socket_idx + 1); char* end = (char *) (all_sockets + num_sockets); memmove(dst, src, end - src); num_sockets -= 1; } } if(got_exit_signal) goto sws_cleanup; /* Set up for select*/ FD_ZERO(&input); FD_ZERO(&output); for (socket_idx = 0; socket_idx < num_sockets; ++socket_idx) { /* Listen on all sockets */ FD_SET(all_sockets[socket_idx], &input); if(all_sockets[socket_idx] > maxfd) maxfd = all_sockets[socket_idx]; } if(got_exit_signal) goto sws_cleanup; rc = select((int)maxfd + 1, &input, &output, NULL, &timeout); if (rc < 0) { error = SOCKERRNO; logmsg("select() failed with error: (%d) %s", error, strerror(error)); goto sws_cleanup; } if(got_exit_signal) goto sws_cleanup; if (rc == 0) { /* Timed out - try again*/ continue; } /* Check if the listening socket is ready to accept */ if (FD_ISSET(all_sockets[0], &input)) { /* Service all queued connections */ curl_socket_t msgsock; do { msgsock = accept_connection(sock); logmsg("accept_connection %d returned %d", sock, msgsock); if (CURL_SOCKET_BAD == msgsock) goto sws_cleanup; } while (msgsock > 0); } /* Service all connections that are ready */ for (socket_idx = 1; socket_idx < num_sockets; ++socket_idx) { if (FD_ISSET(all_sockets[socket_idx], &input)) { if(got_exit_signal) goto sws_cleanup; /* Service this connection until it has nothing available */ do { rc = service_connection(all_sockets[socket_idx], &req, sock, connecthost); if(got_exit_signal) goto sws_cleanup; if (rc < 0) { logmsg("====> Client disconnect %d", req.connmon); if(req.connmon) { const char *keepopen="[DISCONNECT]\n"; storerequest((char *)keepopen, strlen(keepopen)); } if(!req.open) /* When instructed to close connection after server-reply we wait a very small amount of time before doing so. If this is not done client might get an ECONNRESET before reading a single byte of server-reply. */ wait_ms(50); if(all_sockets[socket_idx] != CURL_SOCKET_BAD) { sclose(all_sockets[socket_idx]); all_sockets[socket_idx] = CURL_SOCKET_BAD; } serverlogslocked -= 1; if(!serverlogslocked) clear_advisor_read_lock(SERVERLOGS_LOCK); if (req.testno == DOCNUMBER_QUIT) goto sws_cleanup; } /* Reset the request, unless we're still in the middle of reading */ if (rc != 0) init_httprequest(&req); } while (rc > 0); } } if(got_exit_signal) goto sws_cleanup; } sws_cleanup: for (socket_idx = 1; socket_idx < num_sockets; ++socket_idx) if((all_sockets[socket_idx] != sock) && (all_sockets[socket_idx] != CURL_SOCKET_BAD)) sclose(all_sockets[socket_idx]); if(sock != CURL_SOCKET_BAD) sclose(sock); if(got_exit_signal) logmsg("signalled to die"); if(wrotepidfile) unlink(pidname); if(serverlogslocked) { serverlogslocked = 0; clear_advisor_read_lock(SERVERLOGS_LOCK); } restore_signal_handlers(); if(got_exit_signal) { logmsg("========> %s sws (port: %d pid: %ld) exits with signal (%d)", ipv_inuse, (int)port, pid, exit_signal); /* * To properly set the return status of the process we * must raise the same signal SIGINT or SIGTERM that we * caught and let the old handler take care of it. */ raise(exit_signal); } logmsg("========> sws quits"); return 0; } curl-7.35.0/tests/server/getpart.c0000644000175000017500000003001112262353672013761 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "server_setup.h" #include "getpart.h" #define ENABLE_CURLX_PRINTF /* make the curlx header define all printf() functions to use the curlx_* versions instead */ #include "curlx.h" /* from the private lib dir */ /* just to please curl_base64.h we create a fake struct */ struct SessionHandle { int fake; }; #include "curl_base64.h" #include "curl_memory.h" /* include memdebug.h last */ #include "memdebug.h" #define EAT_SPACE(p) while(*(p) && ISSPACE(*(p))) (p)++ #define EAT_WORD(p) while(*(p) && !ISSPACE(*(p)) && ('>' != *(p))) (p)++ #ifdef DEBUG_GETPART #define show(x) printf x #else #define show(x) Curl_nop_stmt #endif #if defined(_MSC_VER) && defined(_DLL) # pragma warning(disable:4232) /* MSVC extension, dllimport identity */ #endif 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)strdup; curl_calloc_callback Curl_ccalloc = (curl_calloc_callback)calloc; #if defined(WIN32) && defined(UNICODE) curl_wcsdup_callback Curl_cwcsdup = (curl_wcsdup_callback)_wcsdup; #endif #if defined(_MSC_VER) && defined(_DLL) # pragma warning(default:4232) /* MSVC extension, dllimport identity */ #endif /* * readline() * * Reads a complete line from a file into a dynamically allocated buffer. * * Calling function may call this multiple times with same 'buffer' * and 'bufsize' pointers to avoid multiple buffer allocations. Buffer * will be reallocated and 'bufsize' increased until whole line fits in * buffer before returning it. * * Calling function is responsible to free allocated buffer. * * This function may return: * GPE_OUT_OF_MEMORY * GPE_END_OF_FILE * GPE_OK */ static int readline(char **buffer, size_t *bufsize, FILE *stream) { size_t offset = 0; size_t length; char *newptr; if(!*buffer) { *buffer = malloc(128); if(!*buffer) return GPE_OUT_OF_MEMORY; *bufsize = 128; } for(;;) { int bytestoread = curlx_uztosi(*bufsize - offset); if(!fgets(*buffer + offset, bytestoread, stream)) return (offset != 0) ? GPE_OK : GPE_END_OF_FILE ; length = offset + strlen(*buffer + offset); if(*(*buffer + length - 1) == '\n') break; offset = length; if(length < *bufsize - 1) continue; newptr = realloc(*buffer, *bufsize * 2); if(!newptr) return GPE_OUT_OF_MEMORY; *buffer = newptr; *bufsize *= 2; } return GPE_OK; } /* * appenddata() * * This appends data from a given source buffer to the end of the used part of * a destination buffer. Arguments relative to the destination buffer are, the * address of a pointer to the destination buffer 'dst_buf', the length of data * in destination buffer excluding potential null string termination 'dst_len', * the allocated size of destination buffer 'dst_alloc'. All three destination * buffer arguments may be modified by this function. Arguments relative to the * source buffer are, a pointer to the source buffer 'src_buf' and indication * whether the source buffer is base64 encoded or not 'src_b64'. * * If the source buffer is indicated to be base64 encoded, this appends the * decoded data, binary or whatever, to the destination. The source buffer * may not hold binary data, only a null terminated string is valid content. * * Destination buffer will be enlarged and relocated as needed. * * Calling function is responsible to provide preallocated destination * buffer and also to deallocate it when no longer needed. * * This function may return: * GPE_OUT_OF_MEMORY * GPE_OK */ static int appenddata(char **dst_buf, /* dest buffer */ size_t *dst_len, /* dest buffer data length */ size_t *dst_alloc, /* dest buffer allocated size */ char *src_buf, /* source buffer */ int src_b64) /* != 0 if source is base64 encoded */ { size_t need_alloc = 0; size_t src_len = strlen(src_buf); if(!src_len) return GPE_OK; need_alloc = src_len + *dst_len + 1; if(src_b64) { if(src_buf[src_len - 1] == '\r') src_len--; if(src_buf[src_len - 1] == '\n') src_len--; } /* enlarge destination buffer if required */ if(need_alloc > *dst_alloc) { size_t newsize = need_alloc * 2; char *newptr = realloc(*dst_buf, newsize); if(!newptr) { return GPE_OUT_OF_MEMORY; } *dst_alloc = newsize; *dst_buf = newptr; } /* memcpy to support binary blobs */ memcpy(*dst_buf + *dst_len, src_buf, src_len); *dst_len += src_len; *(*dst_buf + *dst_len) = '\0'; return GPE_OK; } static int decodedata(char **buf, /* dest buffer */ size_t *len) /* dest buffer data length */ { int error = 0; unsigned char *buf64 = NULL; size_t src_len = 0; if(!*len) return GPE_OK; /* base64 decode the given buffer */ error = (int) Curl_base64_decode(*buf, &buf64, &src_len); if(error) return GPE_OUT_OF_MEMORY; if(!src_len) { /* ** currently there is no way to tell apart an OOM condition in ** Curl_base64_decode() from zero length decoded data. For now, ** let's just assume it is an OOM condition, currently we have ** no input for this function that decodes to zero length data. */ if(buf64) free(buf64); return GPE_OUT_OF_MEMORY; } /* memcpy to support binary blobs */ memcpy(*buf, buf64, src_len); *len = src_len; *(*buf + src_len) = '\0'; free(buf64); return GPE_OK; } /* * getpart() * * This returns whole contents of specified XML-like section and subsection * from the given file. This is mostly used to retrieve a specific part from * a test definition file for consumption by test suite servers. * * Data is returned in a dynamically allocated buffer, a pointer to this data * and the size of the data is stored at the addresses that caller specifies. * * If the returned data is a string the returned size will be the length of * the string excluding null termination. Otherwise it will just be the size * of the returned binary data. * * Calling function is responsible to free returned buffer. * * This function may return: * GPE_NO_BUFFER_SPACE * GPE_OUT_OF_MEMORY * GPE_OK */ int getpart(char **outbuf, size_t *outlen, const char *main, const char *sub, FILE *stream) { # define MAX_TAG_LEN 79 char couter[MAX_TAG_LEN+1]; /* current outermost section */ char cmain[MAX_TAG_LEN+1]; /* current main section */ char csub[MAX_TAG_LEN+1]; /* current sub section */ char ptag[MAX_TAG_LEN+1]; /* potential tag */ char patt[MAX_TAG_LEN+1]; /* potential attributes */ char *buffer = NULL; char *ptr; char *end; union { ssize_t sig; size_t uns; } len; size_t bufsize = 0; size_t outalloc = 256; int in_wanted_part = 0; int base64 = 0; int error; enum { STATE_OUTSIDE = 0, STATE_OUTER = 1, STATE_INMAIN = 2, STATE_INSUB = 3, STATE_ILLEGAL = 4 } state = STATE_OUTSIDE; *outlen = 0; *outbuf = malloc(outalloc); if(!*outbuf) return GPE_OUT_OF_MEMORY; *(*outbuf) = '\0'; couter[0] = cmain[0] = csub[0] = ptag[0] = patt[0] = '\0'; while((error = readline(&buffer, &bufsize, stream)) == GPE_OK) { ptr = buffer; EAT_SPACE(ptr); if('<' != *ptr) { if(in_wanted_part) { show(("=> %s", buffer)); error = appenddata(outbuf, outlen, &outalloc, buffer, base64); if(error) break; } continue; } ptr++; if('/' == *ptr) { /* ** closing section tag */ ptr++; end = ptr; EAT_WORD(end); if((len.sig = end - ptr) > MAX_TAG_LEN) { error = GPE_NO_BUFFER_SPACE; break; } memcpy(ptag, ptr, len.uns); ptag[len.uns] = '\0'; if((STATE_INSUB == state) && !strcmp(csub, ptag)) { /* end of current sub section */ state = STATE_INMAIN; csub[0] = '\0'; if(in_wanted_part) { /* end of wanted part */ in_wanted_part = 0; /* Do we need to base64 decode the data? */ if(base64) { error = decodedata(outbuf, outlen); if(error) return error; } break; } } else if((STATE_INMAIN == state) && !strcmp(cmain, ptag)) { /* end of current main section */ state = STATE_OUTER; cmain[0] = '\0'; if(in_wanted_part) { /* end of wanted part */ in_wanted_part = 0; /* Do we need to base64 decode the data? */ if(base64) { error = decodedata(outbuf, outlen); if(error) return error; } break; } } else if((STATE_OUTER == state) && !strcmp(couter, ptag)) { /* end of outermost file section */ state = STATE_OUTSIDE; couter[0] = '\0'; if(in_wanted_part) { /* end of wanted part */ in_wanted_part = 0; break; } } } else if(!in_wanted_part) { /* ** opening section tag */ /* get potential tag */ end = ptr; EAT_WORD(end); if((len.sig = end - ptr) > MAX_TAG_LEN) { error = GPE_NO_BUFFER_SPACE; break; } memcpy(ptag, ptr, len.uns); ptag[len.uns] = '\0'; /* ignore comments, doctypes and xml declarations */ if(('!' == ptag[0]) || ('?' == ptag[0])) { show(("* ignoring (%s)", buffer)); continue; } /* get all potential attributes */ ptr = end; EAT_SPACE(ptr); end = ptr; while(*end && ('>' != *end)) end++; if((len.sig = end - ptr) > MAX_TAG_LEN) { error = GPE_NO_BUFFER_SPACE; break; } memcpy(patt, ptr, len.uns); patt[len.uns] = '\0'; if(STATE_OUTSIDE == state) { /* outermost element () */ strcpy(couter, ptag); state = STATE_OUTER; continue; } else if(STATE_OUTER == state) { /* start of a main section */ strcpy(cmain, ptag); state = STATE_INMAIN; continue; } else if(STATE_INMAIN == state) { /* start of a sub section */ strcpy(csub, ptag); state = STATE_INSUB; if(!strcmp(cmain, main) && !strcmp(csub, sub)) { /* start of wanted part */ in_wanted_part = 1; if(strstr(patt, "base64=")) /* bit rough test, but "mostly" functional, */ /* treat wanted part data as base64 encoded */ base64 = 1; } continue; } } if(in_wanted_part) { show(("=> %s", buffer)); error = appenddata(outbuf, outlen, &outalloc, buffer, base64); if(error) break; } } /* while */ if(buffer) free(buffer); if(error != GPE_OK) { if(error == GPE_END_OF_FILE) error = GPE_OK; else { if(*outbuf) free(*outbuf); *outbuf = NULL; *outlen = 0; } } return error; } curl-7.35.0/tests/server/resolve.c0000644000175000017500000000745512213173003013772 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "server_setup.h" /* Purpose * * Resolve the given name, using system name resolve functions (NOT any * function provided by libcurl). Used to see if the name exists and thus if * we can allow a test case to use it for testing. * * Like if 'localhost' actual exists etc. * */ #ifdef HAVE_SIGNAL_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef _XOPEN_SOURCE_EXTENDED /* This define is "almost" required to build on HPUX 11 */ #include #endif #ifdef HAVE_NETDB_H #include #endif #define ENABLE_CURLX_PRINTF /* make the curlx header define all printf() functions to use the curlx_* versions instead */ #include "curlx.h" /* from the private lib dir */ #include "util.h" /* include memdebug.h last */ #include "memdebug.h" static bool use_ipv6 = FALSE; static const char *ipv_inuse = "IPv4"; const char *serverlogfile=""; /* for a util.c function we don't use */ int main(int argc, char *argv[]) { int arg=1; const char *host = NULL; int rc = 0; while(argc>arg) { if(!strcmp("--version", argv[arg])) { printf("resolve IPv4%s\n", #ifdef ENABLE_IPV6 "/IPv6" #else "" #endif ); return 0; } else if(!strcmp("--ipv6", argv[arg])) { ipv_inuse = "IPv6"; use_ipv6 = TRUE; arg++; } else if(!strcmp("--ipv4", argv[arg])) { /* for completeness, we support this option as well */ ipv_inuse = "IPv4"; use_ipv6 = FALSE; arg++; } else { host = argv[arg++]; } } if(!host) { puts("Usage: resolve [option] \n" " --version\n" " --ipv4" #ifdef ENABLE_IPV6 "\n --ipv6" #endif ); return 1; } #ifdef WIN32 win32_init(); atexit(win32_cleanup); #endif if(!use_ipv6) { /* gethostbyname() resolve */ struct hostent *he; he = gethostbyname(host); rc = !he; } else { #ifdef ENABLE_IPV6 /* Check that the system has IPv6 enabled before checking the resolver */ 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 */ rc = -1; else { sclose(s); } if (rc == 0) { /* getaddrinfo() resolve */ struct addrinfo *ai; struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_INET6; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_CANONNAME; /* Use parenthesis around function to stop it from being replaced by the macro in memdebug.h */ rc = (getaddrinfo)(host, "80", &hints, &ai); } #else puts("IPv6 support has been disabled in this program"); return 1; #endif } if(rc) printf("Resolving %s '%s' didn't work\n", ipv_inuse, host); return !!rc; } curl-7.35.0/tests/server/fake_ntlm.c0000644000175000017500000001662212213173003014247 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2010, Mandy Wu, * Copyright (C) 2011 - 2013, 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. * ***************************************************************************/ #include "server_setup.h" /* * This is a fake ntlm_auth, which is used for testing NTLM single-sign-on. * When DEBUGBUILD is defined, libcurl invoke this tool instead of real winbind * daemon helper /usr/bin/ntlm_auth. This tool will accept commands and * responses with a pre-written string saved in test case test2005. */ #define ENABLE_CURLX_PRINTF #include "curlx.h" /* from the private lib dir */ #include "getpart.h" #include "util.h" /* include memdebug.h last */ #include "memdebug.h" #ifndef DEFAULT_LOGFILE #define DEFAULT_LOGFILE "log/fake_ntlm.log" #endif const char *serverlogfile = DEFAULT_LOGFILE; /* * Returns an allocated buffer with printable representation of input * buffer contents or returns NULL on out of memory condition. */ static char *printable(char *inbuf, size_t inlength) { char *outbuf; char *newbuf; size_t newsize; size_t outsize; size_t outincr = 0; size_t i, o = 0; #define HEX_FMT_STR "[0x%02X]" #define HEX_STR_LEN 6 #define NOTHING_STR "[NOTHING]" #define NOTHING_LEN 9 if(!inlength) inlength = strlen(inbuf); if(inlength) { outincr = ((inlength/2) < (HEX_STR_LEN+1)) ? HEX_STR_LEN+1 : inlength/2; outsize = inlength + outincr; } else outsize = NOTHING_LEN + 1; outbuf = malloc(outsize); if(!outbuf) return NULL; if(!inlength) { sprintf(&outbuf[0], "%s", NOTHING_STR); return outbuf; } for(i=0; i outsize - (HEX_STR_LEN + 1)) { newsize = outsize + outincr; newbuf = realloc(outbuf, newsize); if(!newbuf) { free(outbuf); return NULL; } outbuf = newbuf; outsize = newsize; } if((inbuf[i] > 0x20) && (inbuf[i] < 0x7F)) { outbuf[o] = inbuf[i]; o++; } else { sprintf(&outbuf[o], HEX_FMT_STR, inbuf[i]); o += HEX_STR_LEN; } } outbuf[o] = '\0'; return outbuf; } int main(int argc, char *argv[]) { char buf[1024]; FILE *stream; char *filename; int error; char *type1_input = NULL, *type3_input = NULL; char *type1_output = NULL, *type3_output = NULL; size_t size = 0; long testnum; const char *env; int arg = 1; char *helper_user = (char *)"unknown"; char *helper_proto = (char *)"unknown"; char *helper_domain = (char *)"unknown"; bool use_cached_creds = FALSE; char *msgbuf; buf[0] = '\0'; while(argc > arg) { if(!strcmp("--use-cached-creds", argv[arg])) { use_cached_creds = TRUE; arg++; } else if(!strcmp("--helper-protocol", argv[arg])) { arg++; if(argc > arg) helper_proto = argv[arg++]; } else if(!strcmp("--username", argv[arg])) { arg++; if(argc > arg) helper_user = argv[arg++]; } else if(!strcmp("--domain", argv[arg])) { arg++; if(argc > arg) helper_domain = argv[arg++]; } else { puts("Usage: fake_ntlm [option]\n" " --use-cached-creds\n" " --helper-protocol [protocol]\n" " --username [username]\n" " --domain [domain]"); exit(1); } } logmsg("fake_ntlm (user: %s) (proto: %s) (domain: %s) (cached creds: %s)", helper_user, helper_proto, helper_domain, (use_cached_creds) ? "yes" : "no"); env = getenv("CURL_NTLM_AUTH_TESTNUM"); if (env) { char *endptr; long lnum = strtol(env, &endptr, 10); if((endptr != env + strlen(env)) || (lnum < 1L)) { logmsg("Test number not valid in CURL_NTLM_AUTH_TESTNUM"); exit(1); } testnum = lnum; } else { logmsg("Test number not specified in CURL_NTLM_AUTH_TESTNUM"); exit(1); } env = getenv("CURL_NTLM_AUTH_SRCDIR"); if (env) { path = env; } filename = test2file(testnum); stream=fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg("Error opening file: %s", filename); logmsg("Couldn't open test file %ld", testnum); exit(1); } else { /* get the ntlm_auth input/output */ error = getpart(&type1_input, &size, "ntlm_auth_type1", "input", stream); fclose(stream); if(error || size == 0) { logmsg("getpart() type 1 input failed with error: %d", error); exit(1); } } stream=fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg("Error opening file: %s", filename); logmsg("Couldn't open test file %ld", testnum); exit(1); } else { size = 0; error = getpart(&type3_input, &size, "ntlm_auth_type3", "input", stream); fclose(stream); if(error || size == 0) { logmsg("getpart() type 3 input failed with error: %d", error); exit(1); } } while(fgets(buf, sizeof(buf), stdin)) { if(strcmp(buf, type1_input) == 0) { stream=fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg("Error opening file: %s", filename); logmsg("Couldn't open test file %ld", testnum); exit(1); } else { size = 0; error = getpart(&type1_output, &size, "ntlm_auth_type1", "output", stream); fclose(stream); if(error || size == 0) { logmsg("getpart() type 1 output failed with error: %d", error); exit(1); } } printf("%s", type1_output); fflush(stdout); } else if(strncmp(buf, type3_input, strlen(type3_input)) == 0) { stream=fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg("Error opening file: %s", filename); logmsg("Couldn't open test file %ld", testnum); exit(1); } else { size = 0; error = getpart(&type3_output, &size, "ntlm_auth_type3", "output", stream); fclose(stream); if(error || size == 0) { logmsg("getpart() type 3 output failed with error: %d", error); exit(1); } } printf("%s", type3_output); fflush(stdout); } else { printf("Unknown request\n"); msgbuf = printable(buf, 0); if(msgbuf) { logmsg("invalid input: '%s'\n", msgbuf); free(msgbuf); } else logmsg("OOM formatting invalid input: '%s'\n", buf); exit(1); } } return 1; } curl-7.35.0/tests/server/server_setup.h0000644000175000017500000000231712213173003015036 00000000000000#ifndef HEADER_CURL_SERVER_SETUP_H #define HEADER_CURL_SERVER_SETUP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #define CURL_NO_OLDIES #include "curl_setup.h" /* portability help from the lib directory */ #endif /* HEADER_CURL_SERVER_SETUP_H */ curl-7.35.0/tests/server/util.c0000644000175000017500000001673312213173003013267 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "server_setup.h" #ifdef HAVE_SIGNAL_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef _XOPEN_SOURCE_EXTENDED /* This define is "almost" required to build on HPUX 11 */ #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_SYS_POLL_H #include #elif defined(HAVE_POLL_H) #include #endif #define ENABLE_CURLX_PRINTF /* make the curlx header define all printf() functions to use the curlx_* versions instead */ #include "curlx.h" /* from the private lib dir */ #include "getpart.h" #include "util.h" #include "timeval.h" #ifdef USE_WINSOCK #undef EINTR #define EINTR 4 /* errno.h value */ #undef EINVAL #define EINVAL 22 /* errno.h value */ #endif #if defined(ENABLE_IPV6) && defined(__MINGW32__) const struct in6_addr in6addr_any = {{ IN6ADDR_ANY_INIT }}; #endif /* This function returns a pointer to STATIC memory. It converts the given * binary lump to a hex formatted string usable for output in logs or * whatever. */ char *data_to_hex(char *data, size_t len) { static char buf[256*3]; size_t i; char *optr = buf; char *iptr = data; if(len > 255) len = 255; for(i=0; i < len; i++) { if((data[i] >= 0x20) && (data[i] < 0x7f)) *optr++ = *iptr++; else { sprintf(optr, "%%%02x", *iptr++); optr+=3; } } *optr=0; /* in case no sprintf() was used */ return buf; } void logmsg(const char *msg, ...) { va_list ap; char buffer[2048 + 1]; FILE *logfp; int error; struct timeval tv; time_t sec; struct tm *now; char timebuf[20]; static time_t epoch_offset; static int known_offset; if (!serverlogfile) { fprintf(stderr, "Error: serverlogfile not set\n"); return; } tv = curlx_tvnow(); if(!known_offset) { epoch_offset = time(NULL) - tv.tv_sec; known_offset = 1; } sec = epoch_offset + tv.tv_sec; now = localtime(&sec); /* not thread safe but we don't care */ snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld", (int)now->tm_hour, (int)now->tm_min, (int)now->tm_sec, (long)tv.tv_usec); va_start(ap, msg); vsnprintf(buffer, sizeof(buffer), msg, ap); va_end(ap); logfp = fopen(serverlogfile, "ab"); if(logfp) { fprintf(logfp, "%s %s\n", timebuf, buffer); fclose(logfp); } else { error = errno; fprintf(stderr, "fopen() failed with error: %d %s\n", error, strerror(error)); fprintf(stderr, "Error opening file: %s\n", serverlogfile); fprintf(stderr, "Msg not logged: %s %s\n", timebuf, buffer); } } #ifdef WIN32 /* use instead of perror() on generic windows */ void win32_perror (const char *msg) { char buf[512]; DWORD err = SOCKERRNO; if (!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, LANG_NEUTRAL, buf, sizeof(buf), NULL)) snprintf(buf, sizeof(buf), "Unknown error %lu (%#lx)", err, err); if (msg) fprintf(stderr, "%s: ", msg); fprintf(stderr, "%s\n", buf); } #endif /* WIN32 */ #ifdef USE_WINSOCK void win32_init(void) { WORD wVersionRequested; WSADATA wsaData; int err; wVersionRequested = MAKEWORD(USE_WINSOCK, USE_WINSOCK); err = WSAStartup(wVersionRequested, &wsaData); if (err != 0) { perror("Winsock init failed"); logmsg("Error initialising winsock -- aborting"); exit(1); } if ( LOBYTE( wsaData.wVersion ) != USE_WINSOCK || HIBYTE( wsaData.wVersion ) != USE_WINSOCK ) { WSACleanup(); perror("Winsock init failed"); logmsg("No suitable winsock.dll found -- aborting"); exit(1); } } void win32_cleanup(void) { WSACleanup(); } #endif /* USE_WINSOCK */ /* set by the main code to point to where the test dir is */ const char *path="."; char *test2file(long testno) { static char filename[256]; snprintf(filename, sizeof(filename), TEST_DATA_PATH, path, testno); return filename; } /* * Portable function used for waiting a specific amount of ms. * Waiting indefinitely with this function is not allowed, a * zero or negative timeout value will return immediately. * * Return values: * -1 = system call error, or invalid timeout value * 0 = specified timeout has elapsed */ int wait_ms(int timeout_ms) { #if !defined(MSDOS) && !defined(USE_WINSOCK) #ifndef HAVE_POLL_FINE struct timeval pending_tv; #endif struct timeval initial_tv; int pending_ms; int error; #endif int r = 0; if(!timeout_ms) return 0; if(timeout_ms < 0) { errno = EINVAL; return -1; } #if defined(MSDOS) delay(timeout_ms); #elif defined(USE_WINSOCK) Sleep(timeout_ms); #else pending_ms = timeout_ms; initial_tv = curlx_tvnow(); do { #if defined(HAVE_POLL_FINE) r = poll(NULL, 0, pending_ms); #else pending_tv.tv_sec = pending_ms / 1000; pending_tv.tv_usec = (pending_ms % 1000) * 1000; r = select(0, NULL, NULL, NULL, &pending_tv); #endif /* HAVE_POLL_FINE */ if(r != -1) break; error = errno; if(error && (error != EINTR)) break; pending_ms = timeout_ms - (int)curlx_tvdiff(curlx_tvnow(), initial_tv); if(pending_ms <= 0) break; } while(r == -1); #endif /* USE_WINSOCK */ if(r) r = -1; return r; } int write_pidfile(const char *filename) { FILE *pidfile; long pid; pid = (long)getpid(); pidfile = fopen(filename, "wb"); if(!pidfile) { logmsg("Couldn't write pid file: %s %s", filename, strerror(errno)); return 0; /* fail */ } fprintf(pidfile, "%ld\n", pid); fclose(pidfile); logmsg("Wrote pid %ld to %s", pid, filename); return 1; /* success */ } void set_advisor_read_lock(const char *filename) { FILE *lockfile; int error = 0; int res; do { lockfile = fopen(filename, "wb"); } while((lockfile == NULL) && ((error = errno) == EINTR)); if(lockfile == NULL) { logmsg("Error creating lock file %s error: %d %s", filename, error, strerror(error)); return; } do { res = fclose(lockfile); } while(res && ((error = errno) == EINTR)); if(res) logmsg("Error closing lock file %s error: %d %s", filename, error, strerror(error)); } void clear_advisor_read_lock(const char *filename) { int error = 0; int res; /* ** Log all removal failures. Even those due to file not existing. ** This allows to detect if unexpectedly the file has already been ** removed by a process different than the one that should do this. */ do { res = unlink(filename); } while(res && ((error = errno) == EINTR)); if(res) logmsg("Error removing lock file %s error: %d %s", filename, error, strerror(error)); } curl-7.35.0/tests/server/base64.pl0000644000175000017500000000023012213173003013550 00000000000000#!/usr/bin/perl use MIME::Base64 qw(encode_base64); my $buf; while(read(STDIN, $buf, 60*57)) { my $enc = encode_base64($buf); print "$enc"; } curl-7.35.0/tests/server/Makefile.am0000644000175000017500000000513012213173003014167 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2012, 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. # ########################################################################### AUTOMAKE_OPTIONS = foreign nostdinc # Specify our include paths here, and do it relative to $(top_srcdir) and # $(top_builddir), to ensure that these paths which belong to the library # being currently built and tested are searched before the library which # might possibly already be installed in the system. # # $(top_builddir)/include/curl for generated curlbuild.h included from curl.h # $(top_builddir)/include for generated curlbuild.h inc. from lib/curl_setup.h # $(top_srcdir)/include is for libcurl's external include files # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files # $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file # $(top_srcdir)/ares is for in-tree c-ares's external include files if USE_EMBEDDED_ARES AM_CPPFLAGS = -I$(top_builddir)/include/curl \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_builddir)/ares \ -I$(top_srcdir)/ares else AM_CPPFLAGS = -I$(top_builddir)/include/curl \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib endif # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) if DOING_NATIVE_WINDOWS AM_CPPFLAGS += -DCURL_STATICLIB endif # Makefile.inc provides neat definitions include Makefile.inc EXTRA_DIST = base64.pl Makefile.inc curl-7.35.0/tests/server/Makefile.in0000644000175000017500000060466512272122670014233 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @DOING_NATIVE_WINDOWS_TRUE@am__append_1 = -DCURL_STATICLIB DIST_COMMON = $(srcdir)/Makefile.inc $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/mkinstalldirs \ $(top_srcdir)/depcomp noinst_PROGRAMS = getpart$(EXEEXT) resolve$(EXEEXT) rtspd$(EXEEXT) \ sockfilt$(EXEEXT) sws$(EXEEXT) tftpd$(EXEEXT) \ fake_ntlm$(EXEEXT) subdir = tests/server ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \ $(top_srcdir)/m4/curl-confopts.m4 \ $(top_srcdir)/m4/curl-functions.m4 \ $(top_srcdir)/m4/curl-openssl.m4 \ $(top_srcdir)/m4/curl-override.m4 \ $(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/xc-am-iface.m4 \ $(top_srcdir)/m4/xc-cc-check.m4 \ $(top_srcdir)/m4/xc-lt-iface.m4 \ $(top_srcdir)/m4/xc-translit.m4 \ $(top_srcdir)/m4/xc-val-flgs.m4 \ $(top_srcdir)/m4/zz40-xc-ovr.m4 \ $(top_srcdir)/m4/zz50-xc-ovr.m4 \ $(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \ $(top_builddir)/include/curl/curlbuild.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am__objects_1 = ../../lib/fake_ntlm-mprintf.$(OBJEXT) \ ../../lib/fake_ntlm-nonblock.$(OBJEXT) \ ../../lib/fake_ntlm-strequal.$(OBJEXT) \ ../../lib/fake_ntlm-strtoofft.$(OBJEXT) \ ../../lib/fake_ntlm-timeval.$(OBJEXT) \ ../../lib/fake_ntlm-warnless.$(OBJEXT) am__objects_2 = am__objects_3 = fake_ntlm-getpart.$(OBJEXT) \ ../../lib/fake_ntlm-base64.$(OBJEXT) \ ../../lib/fake_ntlm-memdebug.$(OBJEXT) am__objects_4 = fake_ntlm-util.$(OBJEXT) am_fake_ntlm_OBJECTS = $(am__objects_1) $(am__objects_2) \ $(am__objects_3) $(am__objects_4) \ fake_ntlm-fake_ntlm.$(OBJEXT) fake_ntlm_OBJECTS = $(am_fake_ntlm_OBJECTS) fake_ntlm_DEPENDENCIES = AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = fake_ntlm_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(fake_ntlm_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__objects_5 = ../../lib/getpart-mprintf.$(OBJEXT) \ ../../lib/getpart-nonblock.$(OBJEXT) \ ../../lib/getpart-strequal.$(OBJEXT) \ ../../lib/getpart-strtoofft.$(OBJEXT) \ ../../lib/getpart-timeval.$(OBJEXT) \ ../../lib/getpart-warnless.$(OBJEXT) am__objects_6 = getpart-getpart.$(OBJEXT) \ ../../lib/getpart-base64.$(OBJEXT) \ ../../lib/getpart-memdebug.$(OBJEXT) am_getpart_OBJECTS = $(am__objects_5) $(am__objects_2) \ $(am__objects_6) getpart-testpart.$(OBJEXT) getpart_OBJECTS = $(am_getpart_OBJECTS) getpart_DEPENDENCIES = getpart_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(getpart_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__objects_7 = ../../lib/resolve-mprintf.$(OBJEXT) \ ../../lib/resolve-nonblock.$(OBJEXT) \ ../../lib/resolve-strequal.$(OBJEXT) \ ../../lib/resolve-strtoofft.$(OBJEXT) \ ../../lib/resolve-timeval.$(OBJEXT) \ ../../lib/resolve-warnless.$(OBJEXT) am__objects_8 = resolve-getpart.$(OBJEXT) \ ../../lib/resolve-base64.$(OBJEXT) \ ../../lib/resolve-memdebug.$(OBJEXT) am__objects_9 = resolve-util.$(OBJEXT) am_resolve_OBJECTS = $(am__objects_7) $(am__objects_2) \ $(am__objects_8) $(am__objects_9) resolve-resolve.$(OBJEXT) resolve_OBJECTS = $(am_resolve_OBJECTS) resolve_DEPENDENCIES = resolve_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(resolve_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__objects_10 = ../../lib/rtspd-mprintf.$(OBJEXT) \ ../../lib/rtspd-nonblock.$(OBJEXT) \ ../../lib/rtspd-strequal.$(OBJEXT) \ ../../lib/rtspd-strtoofft.$(OBJEXT) \ ../../lib/rtspd-timeval.$(OBJEXT) \ ../../lib/rtspd-warnless.$(OBJEXT) am__objects_11 = rtspd-getpart.$(OBJEXT) \ ../../lib/rtspd-base64.$(OBJEXT) \ ../../lib/rtspd-memdebug.$(OBJEXT) am__objects_12 = rtspd-util.$(OBJEXT) am_rtspd_OBJECTS = $(am__objects_10) $(am__objects_2) \ $(am__objects_11) $(am__objects_12) rtspd-rtspd.$(OBJEXT) rtspd_OBJECTS = $(am_rtspd_OBJECTS) rtspd_DEPENDENCIES = rtspd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rtspd_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__objects_13 = ../../lib/sockfilt-mprintf.$(OBJEXT) \ ../../lib/sockfilt-nonblock.$(OBJEXT) \ ../../lib/sockfilt-strequal.$(OBJEXT) \ ../../lib/sockfilt-strtoofft.$(OBJEXT) \ ../../lib/sockfilt-timeval.$(OBJEXT) \ ../../lib/sockfilt-warnless.$(OBJEXT) am__objects_14 = sockfilt-getpart.$(OBJEXT) \ ../../lib/sockfilt-base64.$(OBJEXT) \ ../../lib/sockfilt-memdebug.$(OBJEXT) am__objects_15 = sockfilt-util.$(OBJEXT) am_sockfilt_OBJECTS = $(am__objects_13) $(am__objects_2) \ $(am__objects_14) $(am__objects_15) \ sockfilt-sockfilt.$(OBJEXT) \ ../../lib/sockfilt-inet_pton.$(OBJEXT) sockfilt_OBJECTS = $(am_sockfilt_OBJECTS) sockfilt_DEPENDENCIES = sockfilt_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(sockfilt_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__objects_16 = ../../lib/sws-mprintf.$(OBJEXT) \ ../../lib/sws-nonblock.$(OBJEXT) \ ../../lib/sws-strequal.$(OBJEXT) \ ../../lib/sws-strtoofft.$(OBJEXT) \ ../../lib/sws-timeval.$(OBJEXT) \ ../../lib/sws-warnless.$(OBJEXT) am__objects_17 = sws-getpart.$(OBJEXT) ../../lib/sws-base64.$(OBJEXT) \ ../../lib/sws-memdebug.$(OBJEXT) am__objects_18 = sws-util.$(OBJEXT) am_sws_OBJECTS = $(am__objects_16) $(am__objects_2) $(am__objects_17) \ $(am__objects_18) sws-sws.$(OBJEXT) \ ../../lib/sws-inet_pton.$(OBJEXT) sws_OBJECTS = $(am_sws_OBJECTS) sws_DEPENDENCIES = sws_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(sws_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__objects_19 = ../../lib/tftpd-mprintf.$(OBJEXT) \ ../../lib/tftpd-nonblock.$(OBJEXT) \ ../../lib/tftpd-strequal.$(OBJEXT) \ ../../lib/tftpd-strtoofft.$(OBJEXT) \ ../../lib/tftpd-timeval.$(OBJEXT) \ ../../lib/tftpd-warnless.$(OBJEXT) am__objects_20 = tftpd-getpart.$(OBJEXT) \ ../../lib/tftpd-base64.$(OBJEXT) \ ../../lib/tftpd-memdebug.$(OBJEXT) am__objects_21 = tftpd-util.$(OBJEXT) am_tftpd_OBJECTS = $(am__objects_19) $(am__objects_2) \ $(am__objects_20) $(am__objects_21) tftpd-tftpd.$(OBJEXT) tftpd_OBJECTS = $(am_tftpd_OBJECTS) tftpd_DEPENDENCIES = tftpd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(tftpd_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(fake_ntlm_SOURCES) $(getpart_SOURCES) $(resolve_SOURCES) \ $(rtspd_SOURCES) $(sockfilt_SOURCES) $(sws_SOURCES) \ $(tftpd_SOURCES) DIST_SOURCES = $(fake_ntlm_SOURCES) $(getpart_SOURCES) \ $(resolve_SOURCES) $(rtspd_SOURCES) $(sockfilt_SOURCES) \ $(sws_SOURCES) $(tftpd_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@ CURLVERSION = @CURLVERSION@ CURL_CA_BUNDLE = @CURL_CA_BUNDLE@ CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@ CURL_DISABLE_DICT = @CURL_DISABLE_DICT@ CURL_DISABLE_FILE = @CURL_DISABLE_FILE@ CURL_DISABLE_FTP = @CURL_DISABLE_FTP@ CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@ CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@ CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@ CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@ CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@ CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@ CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@ CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@ CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@ CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@ CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@ CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@ CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@ CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_SHARED = @ENABLE_SHARED@ ENABLE_STATIC = @ENABLE_STATIC@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@ HAVE_LDAP_SSL = @HAVE_LDAP_SSL@ HAVE_LIBZ = @HAVE_LIBZ@ HAVE_SSLEAY_SRP = @HAVE_SSLEAY_SRP@ IDN_ENABLED = @IDN_ENABLED@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IPV6_ENABLED = @IPV6_ENABLED@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@ LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@ LIBMETALINK_LIBS = @LIBMETALINK_LIBS@ LIBOBJS = @LIBOBJS@ # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANOPT = @MANOPT@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NROFF = @NROFF@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGADD_NAME = @PKGADD_NAME@ PKGADD_PKG = @PKGADD_PKG@ PKGADD_VENDOR = @PKGADD_VENDOR@ PKGCONFIG = @PKGCONFIG@ RANDOM_FILE = @RANDOM_FILE@ RANLIB = @RANLIB@ REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_ENABLED = @SSL_ENABLED@ STRIP = @STRIP@ SUPPORT_FEATURES = @SUPPORT_FEATURES@ SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@ USE_ARES = @USE_ARES@ USE_AXTLS = @USE_AXTLS@ USE_CYASSL = @USE_CYASSL@ USE_DARWINSSL = @USE_DARWINSSL@ USE_GNUTLS = @USE_GNUTLS@ USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@ USE_LIBRTMP = @USE_LIBRTMP@ USE_LIBSSH2 = @USE_LIBSSH2@ USE_NGHTTP2 = @USE_NGHTTP2@ USE_NSS = @USE_NSS@ USE_OPENLDAP = @USE_OPENLDAP@ USE_POLARSSL = @USE_POLARSSL@ USE_SCHANNEL = @USE_SCHANNEL@ USE_SSLEAY = @USE_SSLEAY@ USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@ VERSION = @VERSION@ VERSIONNUM = @VERSIONNUM@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libext = @libext@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2012, 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. # ########################################################################### AUTOMAKE_OPTIONS = foreign nostdinc @USE_EMBEDDED_ARES_FALSE@AM_CPPFLAGS = -I$(top_builddir)/include/curl \ @USE_EMBEDDED_ARES_FALSE@ -I$(top_builddir)/include \ @USE_EMBEDDED_ARES_FALSE@ -I$(top_srcdir)/include \ @USE_EMBEDDED_ARES_FALSE@ -I$(top_builddir)/lib \ @USE_EMBEDDED_ARES_FALSE@ -I$(top_srcdir)/lib $(am__append_1) # Specify our include paths here, and do it relative to $(top_srcdir) and # $(top_builddir), to ensure that these paths which belong to the library # being currently built and tested are searched before the library which # might possibly already be installed in the system. # # $(top_builddir)/include/curl for generated curlbuild.h included from curl.h # $(top_builddir)/include for generated curlbuild.h inc. from lib/curl_setup.h # $(top_srcdir)/include is for libcurl's external include files # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files # $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file # $(top_srcdir)/ares is for in-tree c-ares's external include files @USE_EMBEDDED_ARES_TRUE@AM_CPPFLAGS = -I$(top_builddir)/include/curl \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_builddir)/include \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/include \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_builddir)/lib \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/lib \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_builddir)/ares \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/ares $(am__append_1) CURLX_SRCS = \ ../../lib/mprintf.c \ ../../lib/nonblock.c \ ../../lib/strequal.c \ ../../lib/strtoofft.c \ ../../lib/timeval.c \ ../../lib/warnless.c CURLX_HDRS = \ ../../lib/curlx.h \ ../../lib/nonblock.h \ ../../lib/strequal.h \ ../../lib/strtoofft.h \ ../../lib/timeval.h \ ../../lib/warnless.h USEFUL = \ getpart.c \ getpart.h \ server_setup.h \ ../../lib/base64.c \ ../../lib/curl_base64.h \ ../../lib/memdebug.c \ ../../lib/memdebug.h UTIL = \ util.c \ util.h getpart_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) \ testpart.c getpart_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ getpart_CFLAGS = $(AM_CFLAGS) resolve_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \ resolve.c resolve_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ resolve_CFLAGS = $(AM_CFLAGS) rtspd_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \ server_sockaddr.h \ rtspd.c rtspd_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ rtspd_CFLAGS = $(AM_CFLAGS) sockfilt_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \ server_sockaddr.h \ sockfilt.c \ ../../lib/inet_pton.c sockfilt_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ sockfilt_CFLAGS = $(AM_CFLAGS) sws_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \ server_sockaddr.h \ sws.c \ ../../lib/inet_pton.c sws_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ sws_CFLAGS = $(AM_CFLAGS) tftpd_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \ server_sockaddr.h \ tftpd.c \ tftp.h tftpd_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ tftpd_CFLAGS = $(AM_CFLAGS) fake_ntlm_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \ fake_ntlm.c fake_ntlm_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ fake_ntlm_CFLAGS = $(AM_CFLAGS) # Makefile.inc provides neat definitions EXTRA_DIST = base64.pl Makefile.inc all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Makefile.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/server/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/server/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(srcdir)/Makefile.inc: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../lib/$(am__dirstamp): @$(MKDIR_P) ../../lib @: > ../../lib/$(am__dirstamp) ../../lib/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../lib/$(DEPDIR) @: > ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/fake_ntlm-mprintf.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/fake_ntlm-nonblock.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/fake_ntlm-strequal.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/fake_ntlm-strtoofft.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/fake_ntlm-timeval.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/fake_ntlm-warnless.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/fake_ntlm-base64.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/fake_ntlm-memdebug.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) fake_ntlm$(EXEEXT): $(fake_ntlm_OBJECTS) $(fake_ntlm_DEPENDENCIES) $(EXTRA_fake_ntlm_DEPENDENCIES) @rm -f fake_ntlm$(EXEEXT) $(AM_V_CCLD)$(fake_ntlm_LINK) $(fake_ntlm_OBJECTS) $(fake_ntlm_LDADD) $(LIBS) ../../lib/getpart-mprintf.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/getpart-nonblock.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/getpart-strequal.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/getpart-strtoofft.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/getpart-timeval.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/getpart-warnless.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/getpart-base64.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/getpart-memdebug.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) getpart$(EXEEXT): $(getpart_OBJECTS) $(getpart_DEPENDENCIES) $(EXTRA_getpart_DEPENDENCIES) @rm -f getpart$(EXEEXT) $(AM_V_CCLD)$(getpart_LINK) $(getpart_OBJECTS) $(getpart_LDADD) $(LIBS) ../../lib/resolve-mprintf.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/resolve-nonblock.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/resolve-strequal.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/resolve-strtoofft.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/resolve-timeval.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/resolve-warnless.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/resolve-base64.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/resolve-memdebug.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) resolve$(EXEEXT): $(resolve_OBJECTS) $(resolve_DEPENDENCIES) $(EXTRA_resolve_DEPENDENCIES) @rm -f resolve$(EXEEXT) $(AM_V_CCLD)$(resolve_LINK) $(resolve_OBJECTS) $(resolve_LDADD) $(LIBS) ../../lib/rtspd-mprintf.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/rtspd-nonblock.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/rtspd-strequal.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/rtspd-strtoofft.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/rtspd-timeval.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/rtspd-warnless.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/rtspd-base64.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/rtspd-memdebug.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) rtspd$(EXEEXT): $(rtspd_OBJECTS) $(rtspd_DEPENDENCIES) $(EXTRA_rtspd_DEPENDENCIES) @rm -f rtspd$(EXEEXT) $(AM_V_CCLD)$(rtspd_LINK) $(rtspd_OBJECTS) $(rtspd_LDADD) $(LIBS) ../../lib/sockfilt-mprintf.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sockfilt-nonblock.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sockfilt-strequal.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sockfilt-strtoofft.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sockfilt-timeval.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sockfilt-warnless.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sockfilt-base64.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sockfilt-memdebug.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sockfilt-inet_pton.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) sockfilt$(EXEEXT): $(sockfilt_OBJECTS) $(sockfilt_DEPENDENCIES) $(EXTRA_sockfilt_DEPENDENCIES) @rm -f sockfilt$(EXEEXT) $(AM_V_CCLD)$(sockfilt_LINK) $(sockfilt_OBJECTS) $(sockfilt_LDADD) $(LIBS) ../../lib/sws-mprintf.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sws-nonblock.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sws-strequal.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sws-strtoofft.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sws-timeval.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sws-warnless.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sws-base64.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sws-memdebug.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/sws-inet_pton.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) sws$(EXEEXT): $(sws_OBJECTS) $(sws_DEPENDENCIES) $(EXTRA_sws_DEPENDENCIES) @rm -f sws$(EXEEXT) $(AM_V_CCLD)$(sws_LINK) $(sws_OBJECTS) $(sws_LDADD) $(LIBS) ../../lib/tftpd-mprintf.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/tftpd-nonblock.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/tftpd-strequal.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/tftpd-strtoofft.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/tftpd-timeval.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/tftpd-warnless.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/tftpd-base64.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) ../../lib/tftpd-memdebug.$(OBJEXT): ../../lib/$(am__dirstamp) \ ../../lib/$(DEPDIR)/$(am__dirstamp) tftpd$(EXEEXT): $(tftpd_OBJECTS) $(tftpd_DEPENDENCIES) $(EXTRA_tftpd_DEPENDENCIES) @rm -f tftpd$(EXEEXT) $(AM_V_CCLD)$(tftpd_LINK) $(tftpd_OBJECTS) $(tftpd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../lib/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/fake_ntlm-base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/fake_ntlm-memdebug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/fake_ntlm-mprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/fake_ntlm-nonblock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/fake_ntlm-strequal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/fake_ntlm-strtoofft.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/fake_ntlm-timeval.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/fake_ntlm-warnless.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/getpart-base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/getpart-memdebug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/getpart-mprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/getpart-nonblock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/getpart-strequal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/getpart-strtoofft.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/getpart-timeval.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/getpart-warnless.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/resolve-base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/resolve-memdebug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/resolve-mprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/resolve-nonblock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/resolve-strequal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/resolve-strtoofft.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/resolve-timeval.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/resolve-warnless.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/rtspd-base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/rtspd-memdebug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/rtspd-mprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/rtspd-nonblock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/rtspd-strequal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/rtspd-strtoofft.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/rtspd-timeval.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/rtspd-warnless.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sockfilt-base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sockfilt-inet_pton.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sockfilt-memdebug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sockfilt-mprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sockfilt-nonblock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sockfilt-strequal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sockfilt-strtoofft.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sockfilt-timeval.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sockfilt-warnless.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sws-base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sws-inet_pton.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sws-memdebug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sws-mprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sws-nonblock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sws-strequal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sws-strtoofft.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sws-timeval.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/sws-warnless.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/tftpd-base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/tftpd-memdebug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/tftpd-mprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/tftpd-nonblock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/tftpd-strequal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/tftpd-strtoofft.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/tftpd-timeval.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../lib/$(DEPDIR)/tftpd-warnless.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake_ntlm-fake_ntlm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake_ntlm-getpart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake_ntlm-util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpart-getpart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpart-testpart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve-getpart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve-resolve.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve-util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtspd-getpart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtspd-rtspd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtspd-util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-getpart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-sockfilt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockfilt-util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sws-getpart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sws-sws.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sws-util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tftpd-getpart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tftpd-tftpd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tftpd-util.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< ../../lib/fake_ntlm-mprintf.o: ../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-mprintf.o -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-mprintf.Tpo -c -o ../../lib/fake_ntlm-mprintf.o `test -f '../../lib/mprintf.c' || echo '$(srcdir)/'`../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-mprintf.Tpo ../../lib/$(DEPDIR)/fake_ntlm-mprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/mprintf.c' object='../../lib/fake_ntlm-mprintf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-mprintf.o `test -f '../../lib/mprintf.c' || echo '$(srcdir)/'`../../lib/mprintf.c ../../lib/fake_ntlm-mprintf.obj: ../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-mprintf.obj -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-mprintf.Tpo -c -o ../../lib/fake_ntlm-mprintf.obj `if test -f '../../lib/mprintf.c'; then $(CYGPATH_W) '../../lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/mprintf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-mprintf.Tpo ../../lib/$(DEPDIR)/fake_ntlm-mprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/mprintf.c' object='../../lib/fake_ntlm-mprintf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-mprintf.obj `if test -f '../../lib/mprintf.c'; then $(CYGPATH_W) '../../lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/mprintf.c'; fi` ../../lib/fake_ntlm-nonblock.o: ../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-nonblock.o -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-nonblock.Tpo -c -o ../../lib/fake_ntlm-nonblock.o `test -f '../../lib/nonblock.c' || echo '$(srcdir)/'`../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-nonblock.Tpo ../../lib/$(DEPDIR)/fake_ntlm-nonblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/nonblock.c' object='../../lib/fake_ntlm-nonblock.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-nonblock.o `test -f '../../lib/nonblock.c' || echo '$(srcdir)/'`../../lib/nonblock.c ../../lib/fake_ntlm-nonblock.obj: ../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-nonblock.obj -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-nonblock.Tpo -c -o ../../lib/fake_ntlm-nonblock.obj `if test -f '../../lib/nonblock.c'; then $(CYGPATH_W) '../../lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/nonblock.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-nonblock.Tpo ../../lib/$(DEPDIR)/fake_ntlm-nonblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/nonblock.c' object='../../lib/fake_ntlm-nonblock.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-nonblock.obj `if test -f '../../lib/nonblock.c'; then $(CYGPATH_W) '../../lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/nonblock.c'; fi` ../../lib/fake_ntlm-strequal.o: ../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-strequal.o -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-strequal.Tpo -c -o ../../lib/fake_ntlm-strequal.o `test -f '../../lib/strequal.c' || echo '$(srcdir)/'`../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-strequal.Tpo ../../lib/$(DEPDIR)/fake_ntlm-strequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strequal.c' object='../../lib/fake_ntlm-strequal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-strequal.o `test -f '../../lib/strequal.c' || echo '$(srcdir)/'`../../lib/strequal.c ../../lib/fake_ntlm-strequal.obj: ../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-strequal.obj -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-strequal.Tpo -c -o ../../lib/fake_ntlm-strequal.obj `if test -f '../../lib/strequal.c'; then $(CYGPATH_W) '../../lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strequal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-strequal.Tpo ../../lib/$(DEPDIR)/fake_ntlm-strequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strequal.c' object='../../lib/fake_ntlm-strequal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-strequal.obj `if test -f '../../lib/strequal.c'; then $(CYGPATH_W) '../../lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strequal.c'; fi` ../../lib/fake_ntlm-strtoofft.o: ../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-strtoofft.o -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-strtoofft.Tpo -c -o ../../lib/fake_ntlm-strtoofft.o `test -f '../../lib/strtoofft.c' || echo '$(srcdir)/'`../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-strtoofft.Tpo ../../lib/$(DEPDIR)/fake_ntlm-strtoofft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strtoofft.c' object='../../lib/fake_ntlm-strtoofft.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-strtoofft.o `test -f '../../lib/strtoofft.c' || echo '$(srcdir)/'`../../lib/strtoofft.c ../../lib/fake_ntlm-strtoofft.obj: ../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-strtoofft.obj -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-strtoofft.Tpo -c -o ../../lib/fake_ntlm-strtoofft.obj `if test -f '../../lib/strtoofft.c'; then $(CYGPATH_W) '../../lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strtoofft.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-strtoofft.Tpo ../../lib/$(DEPDIR)/fake_ntlm-strtoofft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strtoofft.c' object='../../lib/fake_ntlm-strtoofft.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-strtoofft.obj `if test -f '../../lib/strtoofft.c'; then $(CYGPATH_W) '../../lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strtoofft.c'; fi` ../../lib/fake_ntlm-timeval.o: ../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-timeval.o -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-timeval.Tpo -c -o ../../lib/fake_ntlm-timeval.o `test -f '../../lib/timeval.c' || echo '$(srcdir)/'`../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-timeval.Tpo ../../lib/$(DEPDIR)/fake_ntlm-timeval.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/timeval.c' object='../../lib/fake_ntlm-timeval.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-timeval.o `test -f '../../lib/timeval.c' || echo '$(srcdir)/'`../../lib/timeval.c ../../lib/fake_ntlm-timeval.obj: ../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-timeval.obj -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-timeval.Tpo -c -o ../../lib/fake_ntlm-timeval.obj `if test -f '../../lib/timeval.c'; then $(CYGPATH_W) '../../lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/timeval.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-timeval.Tpo ../../lib/$(DEPDIR)/fake_ntlm-timeval.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/timeval.c' object='../../lib/fake_ntlm-timeval.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-timeval.obj `if test -f '../../lib/timeval.c'; then $(CYGPATH_W) '../../lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/timeval.c'; fi` ../../lib/fake_ntlm-warnless.o: ../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-warnless.o -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-warnless.Tpo -c -o ../../lib/fake_ntlm-warnless.o `test -f '../../lib/warnless.c' || echo '$(srcdir)/'`../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-warnless.Tpo ../../lib/$(DEPDIR)/fake_ntlm-warnless.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/warnless.c' object='../../lib/fake_ntlm-warnless.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-warnless.o `test -f '../../lib/warnless.c' || echo '$(srcdir)/'`../../lib/warnless.c ../../lib/fake_ntlm-warnless.obj: ../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-warnless.obj -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-warnless.Tpo -c -o ../../lib/fake_ntlm-warnless.obj `if test -f '../../lib/warnless.c'; then $(CYGPATH_W) '../../lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/warnless.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-warnless.Tpo ../../lib/$(DEPDIR)/fake_ntlm-warnless.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/warnless.c' object='../../lib/fake_ntlm-warnless.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-warnless.obj `if test -f '../../lib/warnless.c'; then $(CYGPATH_W) '../../lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/warnless.c'; fi` fake_ntlm-getpart.o: getpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT fake_ntlm-getpart.o -MD -MP -MF $(DEPDIR)/fake_ntlm-getpart.Tpo -c -o fake_ntlm-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fake_ntlm-getpart.Tpo $(DEPDIR)/fake_ntlm-getpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpart.c' object='fake_ntlm-getpart.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o fake_ntlm-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c fake_ntlm-getpart.obj: getpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT fake_ntlm-getpart.obj -MD -MP -MF $(DEPDIR)/fake_ntlm-getpart.Tpo -c -o fake_ntlm-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fake_ntlm-getpart.Tpo $(DEPDIR)/fake_ntlm-getpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpart.c' object='fake_ntlm-getpart.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o fake_ntlm-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi` ../../lib/fake_ntlm-base64.o: ../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-base64.o -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-base64.Tpo -c -o ../../lib/fake_ntlm-base64.o `test -f '../../lib/base64.c' || echo '$(srcdir)/'`../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-base64.Tpo ../../lib/$(DEPDIR)/fake_ntlm-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/base64.c' object='../../lib/fake_ntlm-base64.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-base64.o `test -f '../../lib/base64.c' || echo '$(srcdir)/'`../../lib/base64.c ../../lib/fake_ntlm-base64.obj: ../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-base64.obj -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-base64.Tpo -c -o ../../lib/fake_ntlm-base64.obj `if test -f '../../lib/base64.c'; then $(CYGPATH_W) '../../lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/base64.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-base64.Tpo ../../lib/$(DEPDIR)/fake_ntlm-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/base64.c' object='../../lib/fake_ntlm-base64.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-base64.obj `if test -f '../../lib/base64.c'; then $(CYGPATH_W) '../../lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/base64.c'; fi` ../../lib/fake_ntlm-memdebug.o: ../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-memdebug.o -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-memdebug.Tpo -c -o ../../lib/fake_ntlm-memdebug.o `test -f '../../lib/memdebug.c' || echo '$(srcdir)/'`../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-memdebug.Tpo ../../lib/$(DEPDIR)/fake_ntlm-memdebug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/memdebug.c' object='../../lib/fake_ntlm-memdebug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-memdebug.o `test -f '../../lib/memdebug.c' || echo '$(srcdir)/'`../../lib/memdebug.c ../../lib/fake_ntlm-memdebug.obj: ../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT ../../lib/fake_ntlm-memdebug.obj -MD -MP -MF ../../lib/$(DEPDIR)/fake_ntlm-memdebug.Tpo -c -o ../../lib/fake_ntlm-memdebug.obj `if test -f '../../lib/memdebug.c'; then $(CYGPATH_W) '../../lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/memdebug.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/fake_ntlm-memdebug.Tpo ../../lib/$(DEPDIR)/fake_ntlm-memdebug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/memdebug.c' object='../../lib/fake_ntlm-memdebug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o ../../lib/fake_ntlm-memdebug.obj `if test -f '../../lib/memdebug.c'; then $(CYGPATH_W) '../../lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/memdebug.c'; fi` fake_ntlm-util.o: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT fake_ntlm-util.o -MD -MP -MF $(DEPDIR)/fake_ntlm-util.Tpo -c -o fake_ntlm-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fake_ntlm-util.Tpo $(DEPDIR)/fake_ntlm-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='fake_ntlm-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o fake_ntlm-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c fake_ntlm-util.obj: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT fake_ntlm-util.obj -MD -MP -MF $(DEPDIR)/fake_ntlm-util.Tpo -c -o fake_ntlm-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fake_ntlm-util.Tpo $(DEPDIR)/fake_ntlm-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='fake_ntlm-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o fake_ntlm-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` fake_ntlm-fake_ntlm.o: fake_ntlm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT fake_ntlm-fake_ntlm.o -MD -MP -MF $(DEPDIR)/fake_ntlm-fake_ntlm.Tpo -c -o fake_ntlm-fake_ntlm.o `test -f 'fake_ntlm.c' || echo '$(srcdir)/'`fake_ntlm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fake_ntlm-fake_ntlm.Tpo $(DEPDIR)/fake_ntlm-fake_ntlm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fake_ntlm.c' object='fake_ntlm-fake_ntlm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o fake_ntlm-fake_ntlm.o `test -f 'fake_ntlm.c' || echo '$(srcdir)/'`fake_ntlm.c fake_ntlm-fake_ntlm.obj: fake_ntlm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -MT fake_ntlm-fake_ntlm.obj -MD -MP -MF $(DEPDIR)/fake_ntlm-fake_ntlm.Tpo -c -o fake_ntlm-fake_ntlm.obj `if test -f 'fake_ntlm.c'; then $(CYGPATH_W) 'fake_ntlm.c'; else $(CYGPATH_W) '$(srcdir)/fake_ntlm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fake_ntlm-fake_ntlm.Tpo $(DEPDIR)/fake_ntlm-fake_ntlm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fake_ntlm.c' object='fake_ntlm-fake_ntlm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fake_ntlm_CFLAGS) $(CFLAGS) -c -o fake_ntlm-fake_ntlm.obj `if test -f 'fake_ntlm.c'; then $(CYGPATH_W) 'fake_ntlm.c'; else $(CYGPATH_W) '$(srcdir)/fake_ntlm.c'; fi` ../../lib/getpart-mprintf.o: ../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-mprintf.o -MD -MP -MF ../../lib/$(DEPDIR)/getpart-mprintf.Tpo -c -o ../../lib/getpart-mprintf.o `test -f '../../lib/mprintf.c' || echo '$(srcdir)/'`../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-mprintf.Tpo ../../lib/$(DEPDIR)/getpart-mprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/mprintf.c' object='../../lib/getpart-mprintf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-mprintf.o `test -f '../../lib/mprintf.c' || echo '$(srcdir)/'`../../lib/mprintf.c ../../lib/getpart-mprintf.obj: ../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-mprintf.obj -MD -MP -MF ../../lib/$(DEPDIR)/getpart-mprintf.Tpo -c -o ../../lib/getpart-mprintf.obj `if test -f '../../lib/mprintf.c'; then $(CYGPATH_W) '../../lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/mprintf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-mprintf.Tpo ../../lib/$(DEPDIR)/getpart-mprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/mprintf.c' object='../../lib/getpart-mprintf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-mprintf.obj `if test -f '../../lib/mprintf.c'; then $(CYGPATH_W) '../../lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/mprintf.c'; fi` ../../lib/getpart-nonblock.o: ../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-nonblock.o -MD -MP -MF ../../lib/$(DEPDIR)/getpart-nonblock.Tpo -c -o ../../lib/getpart-nonblock.o `test -f '../../lib/nonblock.c' || echo '$(srcdir)/'`../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-nonblock.Tpo ../../lib/$(DEPDIR)/getpart-nonblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/nonblock.c' object='../../lib/getpart-nonblock.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-nonblock.o `test -f '../../lib/nonblock.c' || echo '$(srcdir)/'`../../lib/nonblock.c ../../lib/getpart-nonblock.obj: ../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-nonblock.obj -MD -MP -MF ../../lib/$(DEPDIR)/getpart-nonblock.Tpo -c -o ../../lib/getpart-nonblock.obj `if test -f '../../lib/nonblock.c'; then $(CYGPATH_W) '../../lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/nonblock.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-nonblock.Tpo ../../lib/$(DEPDIR)/getpart-nonblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/nonblock.c' object='../../lib/getpart-nonblock.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-nonblock.obj `if test -f '../../lib/nonblock.c'; then $(CYGPATH_W) '../../lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/nonblock.c'; fi` ../../lib/getpart-strequal.o: ../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-strequal.o -MD -MP -MF ../../lib/$(DEPDIR)/getpart-strequal.Tpo -c -o ../../lib/getpart-strequal.o `test -f '../../lib/strequal.c' || echo '$(srcdir)/'`../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-strequal.Tpo ../../lib/$(DEPDIR)/getpart-strequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strequal.c' object='../../lib/getpart-strequal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-strequal.o `test -f '../../lib/strequal.c' || echo '$(srcdir)/'`../../lib/strequal.c ../../lib/getpart-strequal.obj: ../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-strequal.obj -MD -MP -MF ../../lib/$(DEPDIR)/getpart-strequal.Tpo -c -o ../../lib/getpart-strequal.obj `if test -f '../../lib/strequal.c'; then $(CYGPATH_W) '../../lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strequal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-strequal.Tpo ../../lib/$(DEPDIR)/getpart-strequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strequal.c' object='../../lib/getpart-strequal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-strequal.obj `if test -f '../../lib/strequal.c'; then $(CYGPATH_W) '../../lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strequal.c'; fi` ../../lib/getpart-strtoofft.o: ../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-strtoofft.o -MD -MP -MF ../../lib/$(DEPDIR)/getpart-strtoofft.Tpo -c -o ../../lib/getpart-strtoofft.o `test -f '../../lib/strtoofft.c' || echo '$(srcdir)/'`../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-strtoofft.Tpo ../../lib/$(DEPDIR)/getpart-strtoofft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strtoofft.c' object='../../lib/getpart-strtoofft.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-strtoofft.o `test -f '../../lib/strtoofft.c' || echo '$(srcdir)/'`../../lib/strtoofft.c ../../lib/getpart-strtoofft.obj: ../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-strtoofft.obj -MD -MP -MF ../../lib/$(DEPDIR)/getpart-strtoofft.Tpo -c -o ../../lib/getpart-strtoofft.obj `if test -f '../../lib/strtoofft.c'; then $(CYGPATH_W) '../../lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strtoofft.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-strtoofft.Tpo ../../lib/$(DEPDIR)/getpart-strtoofft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strtoofft.c' object='../../lib/getpart-strtoofft.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-strtoofft.obj `if test -f '../../lib/strtoofft.c'; then $(CYGPATH_W) '../../lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strtoofft.c'; fi` ../../lib/getpart-timeval.o: ../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-timeval.o -MD -MP -MF ../../lib/$(DEPDIR)/getpart-timeval.Tpo -c -o ../../lib/getpart-timeval.o `test -f '../../lib/timeval.c' || echo '$(srcdir)/'`../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-timeval.Tpo ../../lib/$(DEPDIR)/getpart-timeval.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/timeval.c' object='../../lib/getpart-timeval.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-timeval.o `test -f '../../lib/timeval.c' || echo '$(srcdir)/'`../../lib/timeval.c ../../lib/getpart-timeval.obj: ../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-timeval.obj -MD -MP -MF ../../lib/$(DEPDIR)/getpart-timeval.Tpo -c -o ../../lib/getpart-timeval.obj `if test -f '../../lib/timeval.c'; then $(CYGPATH_W) '../../lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/timeval.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-timeval.Tpo ../../lib/$(DEPDIR)/getpart-timeval.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/timeval.c' object='../../lib/getpart-timeval.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-timeval.obj `if test -f '../../lib/timeval.c'; then $(CYGPATH_W) '../../lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/timeval.c'; fi` ../../lib/getpart-warnless.o: ../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-warnless.o -MD -MP -MF ../../lib/$(DEPDIR)/getpart-warnless.Tpo -c -o ../../lib/getpart-warnless.o `test -f '../../lib/warnless.c' || echo '$(srcdir)/'`../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-warnless.Tpo ../../lib/$(DEPDIR)/getpart-warnless.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/warnless.c' object='../../lib/getpart-warnless.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-warnless.o `test -f '../../lib/warnless.c' || echo '$(srcdir)/'`../../lib/warnless.c ../../lib/getpart-warnless.obj: ../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-warnless.obj -MD -MP -MF ../../lib/$(DEPDIR)/getpart-warnless.Tpo -c -o ../../lib/getpart-warnless.obj `if test -f '../../lib/warnless.c'; then $(CYGPATH_W) '../../lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/warnless.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-warnless.Tpo ../../lib/$(DEPDIR)/getpart-warnless.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/warnless.c' object='../../lib/getpart-warnless.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-warnless.obj `if test -f '../../lib/warnless.c'; then $(CYGPATH_W) '../../lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/warnless.c'; fi` getpart-getpart.o: getpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-getpart.o -MD -MP -MF $(DEPDIR)/getpart-getpart.Tpo -c -o getpart-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/getpart-getpart.Tpo $(DEPDIR)/getpart-getpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpart.c' object='getpart-getpart.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c getpart-getpart.obj: getpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-getpart.obj -MD -MP -MF $(DEPDIR)/getpart-getpart.Tpo -c -o getpart-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/getpart-getpart.Tpo $(DEPDIR)/getpart-getpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpart.c' object='getpart-getpart.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi` ../../lib/getpart-base64.o: ../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-base64.o -MD -MP -MF ../../lib/$(DEPDIR)/getpart-base64.Tpo -c -o ../../lib/getpart-base64.o `test -f '../../lib/base64.c' || echo '$(srcdir)/'`../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-base64.Tpo ../../lib/$(DEPDIR)/getpart-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/base64.c' object='../../lib/getpart-base64.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-base64.o `test -f '../../lib/base64.c' || echo '$(srcdir)/'`../../lib/base64.c ../../lib/getpart-base64.obj: ../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-base64.obj -MD -MP -MF ../../lib/$(DEPDIR)/getpart-base64.Tpo -c -o ../../lib/getpart-base64.obj `if test -f '../../lib/base64.c'; then $(CYGPATH_W) '../../lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/base64.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-base64.Tpo ../../lib/$(DEPDIR)/getpart-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/base64.c' object='../../lib/getpart-base64.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-base64.obj `if test -f '../../lib/base64.c'; then $(CYGPATH_W) '../../lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/base64.c'; fi` ../../lib/getpart-memdebug.o: ../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-memdebug.o -MD -MP -MF ../../lib/$(DEPDIR)/getpart-memdebug.Tpo -c -o ../../lib/getpart-memdebug.o `test -f '../../lib/memdebug.c' || echo '$(srcdir)/'`../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-memdebug.Tpo ../../lib/$(DEPDIR)/getpart-memdebug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/memdebug.c' object='../../lib/getpart-memdebug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-memdebug.o `test -f '../../lib/memdebug.c' || echo '$(srcdir)/'`../../lib/memdebug.c ../../lib/getpart-memdebug.obj: ../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT ../../lib/getpart-memdebug.obj -MD -MP -MF ../../lib/$(DEPDIR)/getpart-memdebug.Tpo -c -o ../../lib/getpart-memdebug.obj `if test -f '../../lib/memdebug.c'; then $(CYGPATH_W) '../../lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/memdebug.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/getpart-memdebug.Tpo ../../lib/$(DEPDIR)/getpart-memdebug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/memdebug.c' object='../../lib/getpart-memdebug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o ../../lib/getpart-memdebug.obj `if test -f '../../lib/memdebug.c'; then $(CYGPATH_W) '../../lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/memdebug.c'; fi` getpart-testpart.o: testpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-testpart.o -MD -MP -MF $(DEPDIR)/getpart-testpart.Tpo -c -o getpart-testpart.o `test -f 'testpart.c' || echo '$(srcdir)/'`testpart.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/getpart-testpart.Tpo $(DEPDIR)/getpart-testpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testpart.c' object='getpart-testpart.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-testpart.o `test -f 'testpart.c' || echo '$(srcdir)/'`testpart.c getpart-testpart.obj: testpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -MT getpart-testpart.obj -MD -MP -MF $(DEPDIR)/getpart-testpart.Tpo -c -o getpart-testpart.obj `if test -f 'testpart.c'; then $(CYGPATH_W) 'testpart.c'; else $(CYGPATH_W) '$(srcdir)/testpart.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/getpart-testpart.Tpo $(DEPDIR)/getpart-testpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testpart.c' object='getpart-testpart.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(getpart_CFLAGS) $(CFLAGS) -c -o getpart-testpart.obj `if test -f 'testpart.c'; then $(CYGPATH_W) 'testpart.c'; else $(CYGPATH_W) '$(srcdir)/testpart.c'; fi` ../../lib/resolve-mprintf.o: ../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-mprintf.o -MD -MP -MF ../../lib/$(DEPDIR)/resolve-mprintf.Tpo -c -o ../../lib/resolve-mprintf.o `test -f '../../lib/mprintf.c' || echo '$(srcdir)/'`../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-mprintf.Tpo ../../lib/$(DEPDIR)/resolve-mprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/mprintf.c' object='../../lib/resolve-mprintf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-mprintf.o `test -f '../../lib/mprintf.c' || echo '$(srcdir)/'`../../lib/mprintf.c ../../lib/resolve-mprintf.obj: ../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-mprintf.obj -MD -MP -MF ../../lib/$(DEPDIR)/resolve-mprintf.Tpo -c -o ../../lib/resolve-mprintf.obj `if test -f '../../lib/mprintf.c'; then $(CYGPATH_W) '../../lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/mprintf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-mprintf.Tpo ../../lib/$(DEPDIR)/resolve-mprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/mprintf.c' object='../../lib/resolve-mprintf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-mprintf.obj `if test -f '../../lib/mprintf.c'; then $(CYGPATH_W) '../../lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/mprintf.c'; fi` ../../lib/resolve-nonblock.o: ../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-nonblock.o -MD -MP -MF ../../lib/$(DEPDIR)/resolve-nonblock.Tpo -c -o ../../lib/resolve-nonblock.o `test -f '../../lib/nonblock.c' || echo '$(srcdir)/'`../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-nonblock.Tpo ../../lib/$(DEPDIR)/resolve-nonblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/nonblock.c' object='../../lib/resolve-nonblock.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-nonblock.o `test -f '../../lib/nonblock.c' || echo '$(srcdir)/'`../../lib/nonblock.c ../../lib/resolve-nonblock.obj: ../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-nonblock.obj -MD -MP -MF ../../lib/$(DEPDIR)/resolve-nonblock.Tpo -c -o ../../lib/resolve-nonblock.obj `if test -f '../../lib/nonblock.c'; then $(CYGPATH_W) '../../lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/nonblock.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-nonblock.Tpo ../../lib/$(DEPDIR)/resolve-nonblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/nonblock.c' object='../../lib/resolve-nonblock.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-nonblock.obj `if test -f '../../lib/nonblock.c'; then $(CYGPATH_W) '../../lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/nonblock.c'; fi` ../../lib/resolve-strequal.o: ../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-strequal.o -MD -MP -MF ../../lib/$(DEPDIR)/resolve-strequal.Tpo -c -o ../../lib/resolve-strequal.o `test -f '../../lib/strequal.c' || echo '$(srcdir)/'`../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-strequal.Tpo ../../lib/$(DEPDIR)/resolve-strequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strequal.c' object='../../lib/resolve-strequal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-strequal.o `test -f '../../lib/strequal.c' || echo '$(srcdir)/'`../../lib/strequal.c ../../lib/resolve-strequal.obj: ../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-strequal.obj -MD -MP -MF ../../lib/$(DEPDIR)/resolve-strequal.Tpo -c -o ../../lib/resolve-strequal.obj `if test -f '../../lib/strequal.c'; then $(CYGPATH_W) '../../lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strequal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-strequal.Tpo ../../lib/$(DEPDIR)/resolve-strequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strequal.c' object='../../lib/resolve-strequal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-strequal.obj `if test -f '../../lib/strequal.c'; then $(CYGPATH_W) '../../lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strequal.c'; fi` ../../lib/resolve-strtoofft.o: ../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-strtoofft.o -MD -MP -MF ../../lib/$(DEPDIR)/resolve-strtoofft.Tpo -c -o ../../lib/resolve-strtoofft.o `test -f '../../lib/strtoofft.c' || echo '$(srcdir)/'`../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-strtoofft.Tpo ../../lib/$(DEPDIR)/resolve-strtoofft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strtoofft.c' object='../../lib/resolve-strtoofft.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-strtoofft.o `test -f '../../lib/strtoofft.c' || echo '$(srcdir)/'`../../lib/strtoofft.c ../../lib/resolve-strtoofft.obj: ../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-strtoofft.obj -MD -MP -MF ../../lib/$(DEPDIR)/resolve-strtoofft.Tpo -c -o ../../lib/resolve-strtoofft.obj `if test -f '../../lib/strtoofft.c'; then $(CYGPATH_W) '../../lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strtoofft.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-strtoofft.Tpo ../../lib/$(DEPDIR)/resolve-strtoofft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strtoofft.c' object='../../lib/resolve-strtoofft.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-strtoofft.obj `if test -f '../../lib/strtoofft.c'; then $(CYGPATH_W) '../../lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strtoofft.c'; fi` ../../lib/resolve-timeval.o: ../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-timeval.o -MD -MP -MF ../../lib/$(DEPDIR)/resolve-timeval.Tpo -c -o ../../lib/resolve-timeval.o `test -f '../../lib/timeval.c' || echo '$(srcdir)/'`../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-timeval.Tpo ../../lib/$(DEPDIR)/resolve-timeval.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/timeval.c' object='../../lib/resolve-timeval.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-timeval.o `test -f '../../lib/timeval.c' || echo '$(srcdir)/'`../../lib/timeval.c ../../lib/resolve-timeval.obj: ../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-timeval.obj -MD -MP -MF ../../lib/$(DEPDIR)/resolve-timeval.Tpo -c -o ../../lib/resolve-timeval.obj `if test -f '../../lib/timeval.c'; then $(CYGPATH_W) '../../lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/timeval.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-timeval.Tpo ../../lib/$(DEPDIR)/resolve-timeval.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/timeval.c' object='../../lib/resolve-timeval.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-timeval.obj `if test -f '../../lib/timeval.c'; then $(CYGPATH_W) '../../lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/timeval.c'; fi` ../../lib/resolve-warnless.o: ../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-warnless.o -MD -MP -MF ../../lib/$(DEPDIR)/resolve-warnless.Tpo -c -o ../../lib/resolve-warnless.o `test -f '../../lib/warnless.c' || echo '$(srcdir)/'`../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-warnless.Tpo ../../lib/$(DEPDIR)/resolve-warnless.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/warnless.c' object='../../lib/resolve-warnless.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-warnless.o `test -f '../../lib/warnless.c' || echo '$(srcdir)/'`../../lib/warnless.c ../../lib/resolve-warnless.obj: ../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-warnless.obj -MD -MP -MF ../../lib/$(DEPDIR)/resolve-warnless.Tpo -c -o ../../lib/resolve-warnless.obj `if test -f '../../lib/warnless.c'; then $(CYGPATH_W) '../../lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/warnless.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-warnless.Tpo ../../lib/$(DEPDIR)/resolve-warnless.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/warnless.c' object='../../lib/resolve-warnless.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-warnless.obj `if test -f '../../lib/warnless.c'; then $(CYGPATH_W) '../../lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/warnless.c'; fi` resolve-getpart.o: getpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-getpart.o -MD -MP -MF $(DEPDIR)/resolve-getpart.Tpo -c -o resolve-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/resolve-getpart.Tpo $(DEPDIR)/resolve-getpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpart.c' object='resolve-getpart.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c resolve-getpart.obj: getpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-getpart.obj -MD -MP -MF $(DEPDIR)/resolve-getpart.Tpo -c -o resolve-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/resolve-getpart.Tpo $(DEPDIR)/resolve-getpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpart.c' object='resolve-getpart.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi` ../../lib/resolve-base64.o: ../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-base64.o -MD -MP -MF ../../lib/$(DEPDIR)/resolve-base64.Tpo -c -o ../../lib/resolve-base64.o `test -f '../../lib/base64.c' || echo '$(srcdir)/'`../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-base64.Tpo ../../lib/$(DEPDIR)/resolve-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/base64.c' object='../../lib/resolve-base64.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-base64.o `test -f '../../lib/base64.c' || echo '$(srcdir)/'`../../lib/base64.c ../../lib/resolve-base64.obj: ../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-base64.obj -MD -MP -MF ../../lib/$(DEPDIR)/resolve-base64.Tpo -c -o ../../lib/resolve-base64.obj `if test -f '../../lib/base64.c'; then $(CYGPATH_W) '../../lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/base64.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-base64.Tpo ../../lib/$(DEPDIR)/resolve-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/base64.c' object='../../lib/resolve-base64.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-base64.obj `if test -f '../../lib/base64.c'; then $(CYGPATH_W) '../../lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/base64.c'; fi` ../../lib/resolve-memdebug.o: ../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-memdebug.o -MD -MP -MF ../../lib/$(DEPDIR)/resolve-memdebug.Tpo -c -o ../../lib/resolve-memdebug.o `test -f '../../lib/memdebug.c' || echo '$(srcdir)/'`../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-memdebug.Tpo ../../lib/$(DEPDIR)/resolve-memdebug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/memdebug.c' object='../../lib/resolve-memdebug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-memdebug.o `test -f '../../lib/memdebug.c' || echo '$(srcdir)/'`../../lib/memdebug.c ../../lib/resolve-memdebug.obj: ../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT ../../lib/resolve-memdebug.obj -MD -MP -MF ../../lib/$(DEPDIR)/resolve-memdebug.Tpo -c -o ../../lib/resolve-memdebug.obj `if test -f '../../lib/memdebug.c'; then $(CYGPATH_W) '../../lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/memdebug.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/resolve-memdebug.Tpo ../../lib/$(DEPDIR)/resolve-memdebug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/memdebug.c' object='../../lib/resolve-memdebug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o ../../lib/resolve-memdebug.obj `if test -f '../../lib/memdebug.c'; then $(CYGPATH_W) '../../lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/memdebug.c'; fi` resolve-util.o: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-util.o -MD -MP -MF $(DEPDIR)/resolve-util.Tpo -c -o resolve-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/resolve-util.Tpo $(DEPDIR)/resolve-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='resolve-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c resolve-util.obj: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-util.obj -MD -MP -MF $(DEPDIR)/resolve-util.Tpo -c -o resolve-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/resolve-util.Tpo $(DEPDIR)/resolve-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='resolve-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` resolve-resolve.o: resolve.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-resolve.o -MD -MP -MF $(DEPDIR)/resolve-resolve.Tpo -c -o resolve-resolve.o `test -f 'resolve.c' || echo '$(srcdir)/'`resolve.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/resolve-resolve.Tpo $(DEPDIR)/resolve-resolve.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='resolve.c' object='resolve-resolve.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-resolve.o `test -f 'resolve.c' || echo '$(srcdir)/'`resolve.c resolve-resolve.obj: resolve.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -MT resolve-resolve.obj -MD -MP -MF $(DEPDIR)/resolve-resolve.Tpo -c -o resolve-resolve.obj `if test -f 'resolve.c'; then $(CYGPATH_W) 'resolve.c'; else $(CYGPATH_W) '$(srcdir)/resolve.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/resolve-resolve.Tpo $(DEPDIR)/resolve-resolve.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='resolve.c' object='resolve-resolve.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(resolve_CFLAGS) $(CFLAGS) -c -o resolve-resolve.obj `if test -f 'resolve.c'; then $(CYGPATH_W) 'resolve.c'; else $(CYGPATH_W) '$(srcdir)/resolve.c'; fi` ../../lib/rtspd-mprintf.o: ../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-mprintf.o -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-mprintf.Tpo -c -o ../../lib/rtspd-mprintf.o `test -f '../../lib/mprintf.c' || echo '$(srcdir)/'`../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-mprintf.Tpo ../../lib/$(DEPDIR)/rtspd-mprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/mprintf.c' object='../../lib/rtspd-mprintf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-mprintf.o `test -f '../../lib/mprintf.c' || echo '$(srcdir)/'`../../lib/mprintf.c ../../lib/rtspd-mprintf.obj: ../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-mprintf.obj -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-mprintf.Tpo -c -o ../../lib/rtspd-mprintf.obj `if test -f '../../lib/mprintf.c'; then $(CYGPATH_W) '../../lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/mprintf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-mprintf.Tpo ../../lib/$(DEPDIR)/rtspd-mprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/mprintf.c' object='../../lib/rtspd-mprintf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-mprintf.obj `if test -f '../../lib/mprintf.c'; then $(CYGPATH_W) '../../lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/mprintf.c'; fi` ../../lib/rtspd-nonblock.o: ../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-nonblock.o -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-nonblock.Tpo -c -o ../../lib/rtspd-nonblock.o `test -f '../../lib/nonblock.c' || echo '$(srcdir)/'`../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-nonblock.Tpo ../../lib/$(DEPDIR)/rtspd-nonblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/nonblock.c' object='../../lib/rtspd-nonblock.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-nonblock.o `test -f '../../lib/nonblock.c' || echo '$(srcdir)/'`../../lib/nonblock.c ../../lib/rtspd-nonblock.obj: ../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-nonblock.obj -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-nonblock.Tpo -c -o ../../lib/rtspd-nonblock.obj `if test -f '../../lib/nonblock.c'; then $(CYGPATH_W) '../../lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/nonblock.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-nonblock.Tpo ../../lib/$(DEPDIR)/rtspd-nonblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/nonblock.c' object='../../lib/rtspd-nonblock.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-nonblock.obj `if test -f '../../lib/nonblock.c'; then $(CYGPATH_W) '../../lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/nonblock.c'; fi` ../../lib/rtspd-strequal.o: ../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-strequal.o -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-strequal.Tpo -c -o ../../lib/rtspd-strequal.o `test -f '../../lib/strequal.c' || echo '$(srcdir)/'`../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-strequal.Tpo ../../lib/$(DEPDIR)/rtspd-strequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strequal.c' object='../../lib/rtspd-strequal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-strequal.o `test -f '../../lib/strequal.c' || echo '$(srcdir)/'`../../lib/strequal.c ../../lib/rtspd-strequal.obj: ../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-strequal.obj -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-strequal.Tpo -c -o ../../lib/rtspd-strequal.obj `if test -f '../../lib/strequal.c'; then $(CYGPATH_W) '../../lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strequal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-strequal.Tpo ../../lib/$(DEPDIR)/rtspd-strequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strequal.c' object='../../lib/rtspd-strequal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-strequal.obj `if test -f '../../lib/strequal.c'; then $(CYGPATH_W) '../../lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strequal.c'; fi` ../../lib/rtspd-strtoofft.o: ../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-strtoofft.o -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-strtoofft.Tpo -c -o ../../lib/rtspd-strtoofft.o `test -f '../../lib/strtoofft.c' || echo '$(srcdir)/'`../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-strtoofft.Tpo ../../lib/$(DEPDIR)/rtspd-strtoofft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strtoofft.c' object='../../lib/rtspd-strtoofft.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-strtoofft.o `test -f '../../lib/strtoofft.c' || echo '$(srcdir)/'`../../lib/strtoofft.c ../../lib/rtspd-strtoofft.obj: ../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-strtoofft.obj -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-strtoofft.Tpo -c -o ../../lib/rtspd-strtoofft.obj `if test -f '../../lib/strtoofft.c'; then $(CYGPATH_W) '../../lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strtoofft.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-strtoofft.Tpo ../../lib/$(DEPDIR)/rtspd-strtoofft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strtoofft.c' object='../../lib/rtspd-strtoofft.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-strtoofft.obj `if test -f '../../lib/strtoofft.c'; then $(CYGPATH_W) '../../lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strtoofft.c'; fi` ../../lib/rtspd-timeval.o: ../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-timeval.o -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-timeval.Tpo -c -o ../../lib/rtspd-timeval.o `test -f '../../lib/timeval.c' || echo '$(srcdir)/'`../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-timeval.Tpo ../../lib/$(DEPDIR)/rtspd-timeval.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/timeval.c' object='../../lib/rtspd-timeval.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-timeval.o `test -f '../../lib/timeval.c' || echo '$(srcdir)/'`../../lib/timeval.c ../../lib/rtspd-timeval.obj: ../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-timeval.obj -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-timeval.Tpo -c -o ../../lib/rtspd-timeval.obj `if test -f '../../lib/timeval.c'; then $(CYGPATH_W) '../../lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/timeval.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-timeval.Tpo ../../lib/$(DEPDIR)/rtspd-timeval.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/timeval.c' object='../../lib/rtspd-timeval.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-timeval.obj `if test -f '../../lib/timeval.c'; then $(CYGPATH_W) '../../lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/timeval.c'; fi` ../../lib/rtspd-warnless.o: ../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-warnless.o -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-warnless.Tpo -c -o ../../lib/rtspd-warnless.o `test -f '../../lib/warnless.c' || echo '$(srcdir)/'`../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-warnless.Tpo ../../lib/$(DEPDIR)/rtspd-warnless.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/warnless.c' object='../../lib/rtspd-warnless.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-warnless.o `test -f '../../lib/warnless.c' || echo '$(srcdir)/'`../../lib/warnless.c ../../lib/rtspd-warnless.obj: ../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-warnless.obj -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-warnless.Tpo -c -o ../../lib/rtspd-warnless.obj `if test -f '../../lib/warnless.c'; then $(CYGPATH_W) '../../lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/warnless.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-warnless.Tpo ../../lib/$(DEPDIR)/rtspd-warnless.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/warnless.c' object='../../lib/rtspd-warnless.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-warnless.obj `if test -f '../../lib/warnless.c'; then $(CYGPATH_W) '../../lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/warnless.c'; fi` rtspd-getpart.o: getpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-getpart.o -MD -MP -MF $(DEPDIR)/rtspd-getpart.Tpo -c -o rtspd-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rtspd-getpart.Tpo $(DEPDIR)/rtspd-getpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpart.c' object='rtspd-getpart.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c rtspd-getpart.obj: getpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-getpart.obj -MD -MP -MF $(DEPDIR)/rtspd-getpart.Tpo -c -o rtspd-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rtspd-getpart.Tpo $(DEPDIR)/rtspd-getpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpart.c' object='rtspd-getpart.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi` ../../lib/rtspd-base64.o: ../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-base64.o -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-base64.Tpo -c -o ../../lib/rtspd-base64.o `test -f '../../lib/base64.c' || echo '$(srcdir)/'`../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-base64.Tpo ../../lib/$(DEPDIR)/rtspd-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/base64.c' object='../../lib/rtspd-base64.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-base64.o `test -f '../../lib/base64.c' || echo '$(srcdir)/'`../../lib/base64.c ../../lib/rtspd-base64.obj: ../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-base64.obj -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-base64.Tpo -c -o ../../lib/rtspd-base64.obj `if test -f '../../lib/base64.c'; then $(CYGPATH_W) '../../lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/base64.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-base64.Tpo ../../lib/$(DEPDIR)/rtspd-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/base64.c' object='../../lib/rtspd-base64.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-base64.obj `if test -f '../../lib/base64.c'; then $(CYGPATH_W) '../../lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/base64.c'; fi` ../../lib/rtspd-memdebug.o: ../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-memdebug.o -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-memdebug.Tpo -c -o ../../lib/rtspd-memdebug.o `test -f '../../lib/memdebug.c' || echo '$(srcdir)/'`../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-memdebug.Tpo ../../lib/$(DEPDIR)/rtspd-memdebug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/memdebug.c' object='../../lib/rtspd-memdebug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-memdebug.o `test -f '../../lib/memdebug.c' || echo '$(srcdir)/'`../../lib/memdebug.c ../../lib/rtspd-memdebug.obj: ../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT ../../lib/rtspd-memdebug.obj -MD -MP -MF ../../lib/$(DEPDIR)/rtspd-memdebug.Tpo -c -o ../../lib/rtspd-memdebug.obj `if test -f '../../lib/memdebug.c'; then $(CYGPATH_W) '../../lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/memdebug.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/rtspd-memdebug.Tpo ../../lib/$(DEPDIR)/rtspd-memdebug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/memdebug.c' object='../../lib/rtspd-memdebug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o ../../lib/rtspd-memdebug.obj `if test -f '../../lib/memdebug.c'; then $(CYGPATH_W) '../../lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/memdebug.c'; fi` rtspd-util.o: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-util.o -MD -MP -MF $(DEPDIR)/rtspd-util.Tpo -c -o rtspd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rtspd-util.Tpo $(DEPDIR)/rtspd-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='rtspd-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c rtspd-util.obj: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-util.obj -MD -MP -MF $(DEPDIR)/rtspd-util.Tpo -c -o rtspd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rtspd-util.Tpo $(DEPDIR)/rtspd-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='rtspd-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` rtspd-rtspd.o: rtspd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-rtspd.o -MD -MP -MF $(DEPDIR)/rtspd-rtspd.Tpo -c -o rtspd-rtspd.o `test -f 'rtspd.c' || echo '$(srcdir)/'`rtspd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rtspd-rtspd.Tpo $(DEPDIR)/rtspd-rtspd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtspd.c' object='rtspd-rtspd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-rtspd.o `test -f 'rtspd.c' || echo '$(srcdir)/'`rtspd.c rtspd-rtspd.obj: rtspd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -MT rtspd-rtspd.obj -MD -MP -MF $(DEPDIR)/rtspd-rtspd.Tpo -c -o rtspd-rtspd.obj `if test -f 'rtspd.c'; then $(CYGPATH_W) 'rtspd.c'; else $(CYGPATH_W) '$(srcdir)/rtspd.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rtspd-rtspd.Tpo $(DEPDIR)/rtspd-rtspd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtspd.c' object='rtspd-rtspd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtspd_CFLAGS) $(CFLAGS) -c -o rtspd-rtspd.obj `if test -f 'rtspd.c'; then $(CYGPATH_W) 'rtspd.c'; else $(CYGPATH_W) '$(srcdir)/rtspd.c'; fi` ../../lib/sockfilt-mprintf.o: ../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-mprintf.o -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-mprintf.Tpo -c -o ../../lib/sockfilt-mprintf.o `test -f '../../lib/mprintf.c' || echo '$(srcdir)/'`../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-mprintf.Tpo ../../lib/$(DEPDIR)/sockfilt-mprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/mprintf.c' object='../../lib/sockfilt-mprintf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-mprintf.o `test -f '../../lib/mprintf.c' || echo '$(srcdir)/'`../../lib/mprintf.c ../../lib/sockfilt-mprintf.obj: ../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-mprintf.obj -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-mprintf.Tpo -c -o ../../lib/sockfilt-mprintf.obj `if test -f '../../lib/mprintf.c'; then $(CYGPATH_W) '../../lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/mprintf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-mprintf.Tpo ../../lib/$(DEPDIR)/sockfilt-mprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/mprintf.c' object='../../lib/sockfilt-mprintf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-mprintf.obj `if test -f '../../lib/mprintf.c'; then $(CYGPATH_W) '../../lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/mprintf.c'; fi` ../../lib/sockfilt-nonblock.o: ../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-nonblock.o -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-nonblock.Tpo -c -o ../../lib/sockfilt-nonblock.o `test -f '../../lib/nonblock.c' || echo '$(srcdir)/'`../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-nonblock.Tpo ../../lib/$(DEPDIR)/sockfilt-nonblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/nonblock.c' object='../../lib/sockfilt-nonblock.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-nonblock.o `test -f '../../lib/nonblock.c' || echo '$(srcdir)/'`../../lib/nonblock.c ../../lib/sockfilt-nonblock.obj: ../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-nonblock.obj -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-nonblock.Tpo -c -o ../../lib/sockfilt-nonblock.obj `if test -f '../../lib/nonblock.c'; then $(CYGPATH_W) '../../lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/nonblock.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-nonblock.Tpo ../../lib/$(DEPDIR)/sockfilt-nonblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/nonblock.c' object='../../lib/sockfilt-nonblock.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-nonblock.obj `if test -f '../../lib/nonblock.c'; then $(CYGPATH_W) '../../lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/nonblock.c'; fi` ../../lib/sockfilt-strequal.o: ../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-strequal.o -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-strequal.Tpo -c -o ../../lib/sockfilt-strequal.o `test -f '../../lib/strequal.c' || echo '$(srcdir)/'`../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-strequal.Tpo ../../lib/$(DEPDIR)/sockfilt-strequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strequal.c' object='../../lib/sockfilt-strequal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-strequal.o `test -f '../../lib/strequal.c' || echo '$(srcdir)/'`../../lib/strequal.c ../../lib/sockfilt-strequal.obj: ../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-strequal.obj -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-strequal.Tpo -c -o ../../lib/sockfilt-strequal.obj `if test -f '../../lib/strequal.c'; then $(CYGPATH_W) '../../lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strequal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-strequal.Tpo ../../lib/$(DEPDIR)/sockfilt-strequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strequal.c' object='../../lib/sockfilt-strequal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-strequal.obj `if test -f '../../lib/strequal.c'; then $(CYGPATH_W) '../../lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strequal.c'; fi` ../../lib/sockfilt-strtoofft.o: ../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-strtoofft.o -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-strtoofft.Tpo -c -o ../../lib/sockfilt-strtoofft.o `test -f '../../lib/strtoofft.c' || echo '$(srcdir)/'`../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-strtoofft.Tpo ../../lib/$(DEPDIR)/sockfilt-strtoofft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strtoofft.c' object='../../lib/sockfilt-strtoofft.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-strtoofft.o `test -f '../../lib/strtoofft.c' || echo '$(srcdir)/'`../../lib/strtoofft.c ../../lib/sockfilt-strtoofft.obj: ../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-strtoofft.obj -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-strtoofft.Tpo -c -o ../../lib/sockfilt-strtoofft.obj `if test -f '../../lib/strtoofft.c'; then $(CYGPATH_W) '../../lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strtoofft.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-strtoofft.Tpo ../../lib/$(DEPDIR)/sockfilt-strtoofft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strtoofft.c' object='../../lib/sockfilt-strtoofft.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-strtoofft.obj `if test -f '../../lib/strtoofft.c'; then $(CYGPATH_W) '../../lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strtoofft.c'; fi` ../../lib/sockfilt-timeval.o: ../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-timeval.o -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-timeval.Tpo -c -o ../../lib/sockfilt-timeval.o `test -f '../../lib/timeval.c' || echo '$(srcdir)/'`../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-timeval.Tpo ../../lib/$(DEPDIR)/sockfilt-timeval.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/timeval.c' object='../../lib/sockfilt-timeval.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-timeval.o `test -f '../../lib/timeval.c' || echo '$(srcdir)/'`../../lib/timeval.c ../../lib/sockfilt-timeval.obj: ../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-timeval.obj -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-timeval.Tpo -c -o ../../lib/sockfilt-timeval.obj `if test -f '../../lib/timeval.c'; then $(CYGPATH_W) '../../lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/timeval.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-timeval.Tpo ../../lib/$(DEPDIR)/sockfilt-timeval.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/timeval.c' object='../../lib/sockfilt-timeval.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-timeval.obj `if test -f '../../lib/timeval.c'; then $(CYGPATH_W) '../../lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/timeval.c'; fi` ../../lib/sockfilt-warnless.o: ../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-warnless.o -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-warnless.Tpo -c -o ../../lib/sockfilt-warnless.o `test -f '../../lib/warnless.c' || echo '$(srcdir)/'`../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-warnless.Tpo ../../lib/$(DEPDIR)/sockfilt-warnless.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/warnless.c' object='../../lib/sockfilt-warnless.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-warnless.o `test -f '../../lib/warnless.c' || echo '$(srcdir)/'`../../lib/warnless.c ../../lib/sockfilt-warnless.obj: ../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-warnless.obj -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-warnless.Tpo -c -o ../../lib/sockfilt-warnless.obj `if test -f '../../lib/warnless.c'; then $(CYGPATH_W) '../../lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/warnless.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-warnless.Tpo ../../lib/$(DEPDIR)/sockfilt-warnless.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/warnless.c' object='../../lib/sockfilt-warnless.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-warnless.obj `if test -f '../../lib/warnless.c'; then $(CYGPATH_W) '../../lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/warnless.c'; fi` sockfilt-getpart.o: getpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-getpart.o -MD -MP -MF $(DEPDIR)/sockfilt-getpart.Tpo -c -o sockfilt-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sockfilt-getpart.Tpo $(DEPDIR)/sockfilt-getpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpart.c' object='sockfilt-getpart.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c sockfilt-getpart.obj: getpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-getpart.obj -MD -MP -MF $(DEPDIR)/sockfilt-getpart.Tpo -c -o sockfilt-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sockfilt-getpart.Tpo $(DEPDIR)/sockfilt-getpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpart.c' object='sockfilt-getpart.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi` ../../lib/sockfilt-base64.o: ../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-base64.o -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-base64.Tpo -c -o ../../lib/sockfilt-base64.o `test -f '../../lib/base64.c' || echo '$(srcdir)/'`../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-base64.Tpo ../../lib/$(DEPDIR)/sockfilt-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/base64.c' object='../../lib/sockfilt-base64.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-base64.o `test -f '../../lib/base64.c' || echo '$(srcdir)/'`../../lib/base64.c ../../lib/sockfilt-base64.obj: ../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-base64.obj -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-base64.Tpo -c -o ../../lib/sockfilt-base64.obj `if test -f '../../lib/base64.c'; then $(CYGPATH_W) '../../lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/base64.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-base64.Tpo ../../lib/$(DEPDIR)/sockfilt-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/base64.c' object='../../lib/sockfilt-base64.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-base64.obj `if test -f '../../lib/base64.c'; then $(CYGPATH_W) '../../lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/base64.c'; fi` ../../lib/sockfilt-memdebug.o: ../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-memdebug.o -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-memdebug.Tpo -c -o ../../lib/sockfilt-memdebug.o `test -f '../../lib/memdebug.c' || echo '$(srcdir)/'`../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-memdebug.Tpo ../../lib/$(DEPDIR)/sockfilt-memdebug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/memdebug.c' object='../../lib/sockfilt-memdebug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-memdebug.o `test -f '../../lib/memdebug.c' || echo '$(srcdir)/'`../../lib/memdebug.c ../../lib/sockfilt-memdebug.obj: ../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-memdebug.obj -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-memdebug.Tpo -c -o ../../lib/sockfilt-memdebug.obj `if test -f '../../lib/memdebug.c'; then $(CYGPATH_W) '../../lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/memdebug.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-memdebug.Tpo ../../lib/$(DEPDIR)/sockfilt-memdebug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/memdebug.c' object='../../lib/sockfilt-memdebug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-memdebug.obj `if test -f '../../lib/memdebug.c'; then $(CYGPATH_W) '../../lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/memdebug.c'; fi` sockfilt-util.o: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-util.o -MD -MP -MF $(DEPDIR)/sockfilt-util.Tpo -c -o sockfilt-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sockfilt-util.Tpo $(DEPDIR)/sockfilt-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='sockfilt-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c sockfilt-util.obj: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-util.obj -MD -MP -MF $(DEPDIR)/sockfilt-util.Tpo -c -o sockfilt-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sockfilt-util.Tpo $(DEPDIR)/sockfilt-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='sockfilt-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` sockfilt-sockfilt.o: sockfilt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-sockfilt.o -MD -MP -MF $(DEPDIR)/sockfilt-sockfilt.Tpo -c -o sockfilt-sockfilt.o `test -f 'sockfilt.c' || echo '$(srcdir)/'`sockfilt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sockfilt-sockfilt.Tpo $(DEPDIR)/sockfilt-sockfilt.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sockfilt.c' object='sockfilt-sockfilt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-sockfilt.o `test -f 'sockfilt.c' || echo '$(srcdir)/'`sockfilt.c sockfilt-sockfilt.obj: sockfilt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT sockfilt-sockfilt.obj -MD -MP -MF $(DEPDIR)/sockfilt-sockfilt.Tpo -c -o sockfilt-sockfilt.obj `if test -f 'sockfilt.c'; then $(CYGPATH_W) 'sockfilt.c'; else $(CYGPATH_W) '$(srcdir)/sockfilt.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sockfilt-sockfilt.Tpo $(DEPDIR)/sockfilt-sockfilt.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sockfilt.c' object='sockfilt-sockfilt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o sockfilt-sockfilt.obj `if test -f 'sockfilt.c'; then $(CYGPATH_W) 'sockfilt.c'; else $(CYGPATH_W) '$(srcdir)/sockfilt.c'; fi` ../../lib/sockfilt-inet_pton.o: ../../lib/inet_pton.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-inet_pton.o -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-inet_pton.Tpo -c -o ../../lib/sockfilt-inet_pton.o `test -f '../../lib/inet_pton.c' || echo '$(srcdir)/'`../../lib/inet_pton.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-inet_pton.Tpo ../../lib/$(DEPDIR)/sockfilt-inet_pton.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/inet_pton.c' object='../../lib/sockfilt-inet_pton.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-inet_pton.o `test -f '../../lib/inet_pton.c' || echo '$(srcdir)/'`../../lib/inet_pton.c ../../lib/sockfilt-inet_pton.obj: ../../lib/inet_pton.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -MT ../../lib/sockfilt-inet_pton.obj -MD -MP -MF ../../lib/$(DEPDIR)/sockfilt-inet_pton.Tpo -c -o ../../lib/sockfilt-inet_pton.obj `if test -f '../../lib/inet_pton.c'; then $(CYGPATH_W) '../../lib/inet_pton.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/inet_pton.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sockfilt-inet_pton.Tpo ../../lib/$(DEPDIR)/sockfilt-inet_pton.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/inet_pton.c' object='../../lib/sockfilt-inet_pton.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sockfilt_CFLAGS) $(CFLAGS) -c -o ../../lib/sockfilt-inet_pton.obj `if test -f '../../lib/inet_pton.c'; then $(CYGPATH_W) '../../lib/inet_pton.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/inet_pton.c'; fi` ../../lib/sws-mprintf.o: ../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-mprintf.o -MD -MP -MF ../../lib/$(DEPDIR)/sws-mprintf.Tpo -c -o ../../lib/sws-mprintf.o `test -f '../../lib/mprintf.c' || echo '$(srcdir)/'`../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-mprintf.Tpo ../../lib/$(DEPDIR)/sws-mprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/mprintf.c' object='../../lib/sws-mprintf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-mprintf.o `test -f '../../lib/mprintf.c' || echo '$(srcdir)/'`../../lib/mprintf.c ../../lib/sws-mprintf.obj: ../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-mprintf.obj -MD -MP -MF ../../lib/$(DEPDIR)/sws-mprintf.Tpo -c -o ../../lib/sws-mprintf.obj `if test -f '../../lib/mprintf.c'; then $(CYGPATH_W) '../../lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/mprintf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-mprintf.Tpo ../../lib/$(DEPDIR)/sws-mprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/mprintf.c' object='../../lib/sws-mprintf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-mprintf.obj `if test -f '../../lib/mprintf.c'; then $(CYGPATH_W) '../../lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/mprintf.c'; fi` ../../lib/sws-nonblock.o: ../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-nonblock.o -MD -MP -MF ../../lib/$(DEPDIR)/sws-nonblock.Tpo -c -o ../../lib/sws-nonblock.o `test -f '../../lib/nonblock.c' || echo '$(srcdir)/'`../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-nonblock.Tpo ../../lib/$(DEPDIR)/sws-nonblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/nonblock.c' object='../../lib/sws-nonblock.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-nonblock.o `test -f '../../lib/nonblock.c' || echo '$(srcdir)/'`../../lib/nonblock.c ../../lib/sws-nonblock.obj: ../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-nonblock.obj -MD -MP -MF ../../lib/$(DEPDIR)/sws-nonblock.Tpo -c -o ../../lib/sws-nonblock.obj `if test -f '../../lib/nonblock.c'; then $(CYGPATH_W) '../../lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/nonblock.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-nonblock.Tpo ../../lib/$(DEPDIR)/sws-nonblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/nonblock.c' object='../../lib/sws-nonblock.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-nonblock.obj `if test -f '../../lib/nonblock.c'; then $(CYGPATH_W) '../../lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/nonblock.c'; fi` ../../lib/sws-strequal.o: ../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-strequal.o -MD -MP -MF ../../lib/$(DEPDIR)/sws-strequal.Tpo -c -o ../../lib/sws-strequal.o `test -f '../../lib/strequal.c' || echo '$(srcdir)/'`../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-strequal.Tpo ../../lib/$(DEPDIR)/sws-strequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strequal.c' object='../../lib/sws-strequal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-strequal.o `test -f '../../lib/strequal.c' || echo '$(srcdir)/'`../../lib/strequal.c ../../lib/sws-strequal.obj: ../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-strequal.obj -MD -MP -MF ../../lib/$(DEPDIR)/sws-strequal.Tpo -c -o ../../lib/sws-strequal.obj `if test -f '../../lib/strequal.c'; then $(CYGPATH_W) '../../lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strequal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-strequal.Tpo ../../lib/$(DEPDIR)/sws-strequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strequal.c' object='../../lib/sws-strequal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-strequal.obj `if test -f '../../lib/strequal.c'; then $(CYGPATH_W) '../../lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strequal.c'; fi` ../../lib/sws-strtoofft.o: ../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-strtoofft.o -MD -MP -MF ../../lib/$(DEPDIR)/sws-strtoofft.Tpo -c -o ../../lib/sws-strtoofft.o `test -f '../../lib/strtoofft.c' || echo '$(srcdir)/'`../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-strtoofft.Tpo ../../lib/$(DEPDIR)/sws-strtoofft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strtoofft.c' object='../../lib/sws-strtoofft.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-strtoofft.o `test -f '../../lib/strtoofft.c' || echo '$(srcdir)/'`../../lib/strtoofft.c ../../lib/sws-strtoofft.obj: ../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-strtoofft.obj -MD -MP -MF ../../lib/$(DEPDIR)/sws-strtoofft.Tpo -c -o ../../lib/sws-strtoofft.obj `if test -f '../../lib/strtoofft.c'; then $(CYGPATH_W) '../../lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strtoofft.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-strtoofft.Tpo ../../lib/$(DEPDIR)/sws-strtoofft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strtoofft.c' object='../../lib/sws-strtoofft.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-strtoofft.obj `if test -f '../../lib/strtoofft.c'; then $(CYGPATH_W) '../../lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strtoofft.c'; fi` ../../lib/sws-timeval.o: ../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-timeval.o -MD -MP -MF ../../lib/$(DEPDIR)/sws-timeval.Tpo -c -o ../../lib/sws-timeval.o `test -f '../../lib/timeval.c' || echo '$(srcdir)/'`../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-timeval.Tpo ../../lib/$(DEPDIR)/sws-timeval.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/timeval.c' object='../../lib/sws-timeval.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-timeval.o `test -f '../../lib/timeval.c' || echo '$(srcdir)/'`../../lib/timeval.c ../../lib/sws-timeval.obj: ../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-timeval.obj -MD -MP -MF ../../lib/$(DEPDIR)/sws-timeval.Tpo -c -o ../../lib/sws-timeval.obj `if test -f '../../lib/timeval.c'; then $(CYGPATH_W) '../../lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/timeval.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-timeval.Tpo ../../lib/$(DEPDIR)/sws-timeval.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/timeval.c' object='../../lib/sws-timeval.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-timeval.obj `if test -f '../../lib/timeval.c'; then $(CYGPATH_W) '../../lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/timeval.c'; fi` ../../lib/sws-warnless.o: ../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-warnless.o -MD -MP -MF ../../lib/$(DEPDIR)/sws-warnless.Tpo -c -o ../../lib/sws-warnless.o `test -f '../../lib/warnless.c' || echo '$(srcdir)/'`../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-warnless.Tpo ../../lib/$(DEPDIR)/sws-warnless.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/warnless.c' object='../../lib/sws-warnless.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-warnless.o `test -f '../../lib/warnless.c' || echo '$(srcdir)/'`../../lib/warnless.c ../../lib/sws-warnless.obj: ../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-warnless.obj -MD -MP -MF ../../lib/$(DEPDIR)/sws-warnless.Tpo -c -o ../../lib/sws-warnless.obj `if test -f '../../lib/warnless.c'; then $(CYGPATH_W) '../../lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/warnless.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-warnless.Tpo ../../lib/$(DEPDIR)/sws-warnless.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/warnless.c' object='../../lib/sws-warnless.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-warnless.obj `if test -f '../../lib/warnless.c'; then $(CYGPATH_W) '../../lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/warnless.c'; fi` sws-getpart.o: getpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-getpart.o -MD -MP -MF $(DEPDIR)/sws-getpart.Tpo -c -o sws-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sws-getpart.Tpo $(DEPDIR)/sws-getpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpart.c' object='sws-getpart.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c sws-getpart.obj: getpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-getpart.obj -MD -MP -MF $(DEPDIR)/sws-getpart.Tpo -c -o sws-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sws-getpart.Tpo $(DEPDIR)/sws-getpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpart.c' object='sws-getpart.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi` ../../lib/sws-base64.o: ../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-base64.o -MD -MP -MF ../../lib/$(DEPDIR)/sws-base64.Tpo -c -o ../../lib/sws-base64.o `test -f '../../lib/base64.c' || echo '$(srcdir)/'`../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-base64.Tpo ../../lib/$(DEPDIR)/sws-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/base64.c' object='../../lib/sws-base64.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-base64.o `test -f '../../lib/base64.c' || echo '$(srcdir)/'`../../lib/base64.c ../../lib/sws-base64.obj: ../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-base64.obj -MD -MP -MF ../../lib/$(DEPDIR)/sws-base64.Tpo -c -o ../../lib/sws-base64.obj `if test -f '../../lib/base64.c'; then $(CYGPATH_W) '../../lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/base64.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-base64.Tpo ../../lib/$(DEPDIR)/sws-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/base64.c' object='../../lib/sws-base64.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-base64.obj `if test -f '../../lib/base64.c'; then $(CYGPATH_W) '../../lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/base64.c'; fi` ../../lib/sws-memdebug.o: ../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-memdebug.o -MD -MP -MF ../../lib/$(DEPDIR)/sws-memdebug.Tpo -c -o ../../lib/sws-memdebug.o `test -f '../../lib/memdebug.c' || echo '$(srcdir)/'`../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-memdebug.Tpo ../../lib/$(DEPDIR)/sws-memdebug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/memdebug.c' object='../../lib/sws-memdebug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-memdebug.o `test -f '../../lib/memdebug.c' || echo '$(srcdir)/'`../../lib/memdebug.c ../../lib/sws-memdebug.obj: ../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-memdebug.obj -MD -MP -MF ../../lib/$(DEPDIR)/sws-memdebug.Tpo -c -o ../../lib/sws-memdebug.obj `if test -f '../../lib/memdebug.c'; then $(CYGPATH_W) '../../lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/memdebug.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-memdebug.Tpo ../../lib/$(DEPDIR)/sws-memdebug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/memdebug.c' object='../../lib/sws-memdebug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-memdebug.obj `if test -f '../../lib/memdebug.c'; then $(CYGPATH_W) '../../lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/memdebug.c'; fi` sws-util.o: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-util.o -MD -MP -MF $(DEPDIR)/sws-util.Tpo -c -o sws-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sws-util.Tpo $(DEPDIR)/sws-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='sws-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c sws-util.obj: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-util.obj -MD -MP -MF $(DEPDIR)/sws-util.Tpo -c -o sws-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sws-util.Tpo $(DEPDIR)/sws-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='sws-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` sws-sws.o: sws.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-sws.o -MD -MP -MF $(DEPDIR)/sws-sws.Tpo -c -o sws-sws.o `test -f 'sws.c' || echo '$(srcdir)/'`sws.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sws-sws.Tpo $(DEPDIR)/sws-sws.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sws.c' object='sws-sws.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-sws.o `test -f 'sws.c' || echo '$(srcdir)/'`sws.c sws-sws.obj: sws.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT sws-sws.obj -MD -MP -MF $(DEPDIR)/sws-sws.Tpo -c -o sws-sws.obj `if test -f 'sws.c'; then $(CYGPATH_W) 'sws.c'; else $(CYGPATH_W) '$(srcdir)/sws.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sws-sws.Tpo $(DEPDIR)/sws-sws.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sws.c' object='sws-sws.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o sws-sws.obj `if test -f 'sws.c'; then $(CYGPATH_W) 'sws.c'; else $(CYGPATH_W) '$(srcdir)/sws.c'; fi` ../../lib/sws-inet_pton.o: ../../lib/inet_pton.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-inet_pton.o -MD -MP -MF ../../lib/$(DEPDIR)/sws-inet_pton.Tpo -c -o ../../lib/sws-inet_pton.o `test -f '../../lib/inet_pton.c' || echo '$(srcdir)/'`../../lib/inet_pton.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-inet_pton.Tpo ../../lib/$(DEPDIR)/sws-inet_pton.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/inet_pton.c' object='../../lib/sws-inet_pton.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-inet_pton.o `test -f '../../lib/inet_pton.c' || echo '$(srcdir)/'`../../lib/inet_pton.c ../../lib/sws-inet_pton.obj: ../../lib/inet_pton.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -MT ../../lib/sws-inet_pton.obj -MD -MP -MF ../../lib/$(DEPDIR)/sws-inet_pton.Tpo -c -o ../../lib/sws-inet_pton.obj `if test -f '../../lib/inet_pton.c'; then $(CYGPATH_W) '../../lib/inet_pton.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/inet_pton.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/sws-inet_pton.Tpo ../../lib/$(DEPDIR)/sws-inet_pton.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/inet_pton.c' object='../../lib/sws-inet_pton.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sws_CFLAGS) $(CFLAGS) -c -o ../../lib/sws-inet_pton.obj `if test -f '../../lib/inet_pton.c'; then $(CYGPATH_W) '../../lib/inet_pton.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/inet_pton.c'; fi` ../../lib/tftpd-mprintf.o: ../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-mprintf.o -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-mprintf.Tpo -c -o ../../lib/tftpd-mprintf.o `test -f '../../lib/mprintf.c' || echo '$(srcdir)/'`../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-mprintf.Tpo ../../lib/$(DEPDIR)/tftpd-mprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/mprintf.c' object='../../lib/tftpd-mprintf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-mprintf.o `test -f '../../lib/mprintf.c' || echo '$(srcdir)/'`../../lib/mprintf.c ../../lib/tftpd-mprintf.obj: ../../lib/mprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-mprintf.obj -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-mprintf.Tpo -c -o ../../lib/tftpd-mprintf.obj `if test -f '../../lib/mprintf.c'; then $(CYGPATH_W) '../../lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/mprintf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-mprintf.Tpo ../../lib/$(DEPDIR)/tftpd-mprintf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/mprintf.c' object='../../lib/tftpd-mprintf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-mprintf.obj `if test -f '../../lib/mprintf.c'; then $(CYGPATH_W) '../../lib/mprintf.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/mprintf.c'; fi` ../../lib/tftpd-nonblock.o: ../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-nonblock.o -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-nonblock.Tpo -c -o ../../lib/tftpd-nonblock.o `test -f '../../lib/nonblock.c' || echo '$(srcdir)/'`../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-nonblock.Tpo ../../lib/$(DEPDIR)/tftpd-nonblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/nonblock.c' object='../../lib/tftpd-nonblock.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-nonblock.o `test -f '../../lib/nonblock.c' || echo '$(srcdir)/'`../../lib/nonblock.c ../../lib/tftpd-nonblock.obj: ../../lib/nonblock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-nonblock.obj -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-nonblock.Tpo -c -o ../../lib/tftpd-nonblock.obj `if test -f '../../lib/nonblock.c'; then $(CYGPATH_W) '../../lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/nonblock.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-nonblock.Tpo ../../lib/$(DEPDIR)/tftpd-nonblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/nonblock.c' object='../../lib/tftpd-nonblock.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-nonblock.obj `if test -f '../../lib/nonblock.c'; then $(CYGPATH_W) '../../lib/nonblock.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/nonblock.c'; fi` ../../lib/tftpd-strequal.o: ../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-strequal.o -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-strequal.Tpo -c -o ../../lib/tftpd-strequal.o `test -f '../../lib/strequal.c' || echo '$(srcdir)/'`../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-strequal.Tpo ../../lib/$(DEPDIR)/tftpd-strequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strequal.c' object='../../lib/tftpd-strequal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-strequal.o `test -f '../../lib/strequal.c' || echo '$(srcdir)/'`../../lib/strequal.c ../../lib/tftpd-strequal.obj: ../../lib/strequal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-strequal.obj -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-strequal.Tpo -c -o ../../lib/tftpd-strequal.obj `if test -f '../../lib/strequal.c'; then $(CYGPATH_W) '../../lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strequal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-strequal.Tpo ../../lib/$(DEPDIR)/tftpd-strequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strequal.c' object='../../lib/tftpd-strequal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-strequal.obj `if test -f '../../lib/strequal.c'; then $(CYGPATH_W) '../../lib/strequal.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strequal.c'; fi` ../../lib/tftpd-strtoofft.o: ../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-strtoofft.o -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-strtoofft.Tpo -c -o ../../lib/tftpd-strtoofft.o `test -f '../../lib/strtoofft.c' || echo '$(srcdir)/'`../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-strtoofft.Tpo ../../lib/$(DEPDIR)/tftpd-strtoofft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strtoofft.c' object='../../lib/tftpd-strtoofft.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-strtoofft.o `test -f '../../lib/strtoofft.c' || echo '$(srcdir)/'`../../lib/strtoofft.c ../../lib/tftpd-strtoofft.obj: ../../lib/strtoofft.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-strtoofft.obj -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-strtoofft.Tpo -c -o ../../lib/tftpd-strtoofft.obj `if test -f '../../lib/strtoofft.c'; then $(CYGPATH_W) '../../lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strtoofft.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-strtoofft.Tpo ../../lib/$(DEPDIR)/tftpd-strtoofft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/strtoofft.c' object='../../lib/tftpd-strtoofft.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-strtoofft.obj `if test -f '../../lib/strtoofft.c'; then $(CYGPATH_W) '../../lib/strtoofft.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/strtoofft.c'; fi` ../../lib/tftpd-timeval.o: ../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-timeval.o -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-timeval.Tpo -c -o ../../lib/tftpd-timeval.o `test -f '../../lib/timeval.c' || echo '$(srcdir)/'`../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-timeval.Tpo ../../lib/$(DEPDIR)/tftpd-timeval.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/timeval.c' object='../../lib/tftpd-timeval.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-timeval.o `test -f '../../lib/timeval.c' || echo '$(srcdir)/'`../../lib/timeval.c ../../lib/tftpd-timeval.obj: ../../lib/timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-timeval.obj -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-timeval.Tpo -c -o ../../lib/tftpd-timeval.obj `if test -f '../../lib/timeval.c'; then $(CYGPATH_W) '../../lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/timeval.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-timeval.Tpo ../../lib/$(DEPDIR)/tftpd-timeval.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/timeval.c' object='../../lib/tftpd-timeval.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-timeval.obj `if test -f '../../lib/timeval.c'; then $(CYGPATH_W) '../../lib/timeval.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/timeval.c'; fi` ../../lib/tftpd-warnless.o: ../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-warnless.o -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-warnless.Tpo -c -o ../../lib/tftpd-warnless.o `test -f '../../lib/warnless.c' || echo '$(srcdir)/'`../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-warnless.Tpo ../../lib/$(DEPDIR)/tftpd-warnless.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/warnless.c' object='../../lib/tftpd-warnless.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-warnless.o `test -f '../../lib/warnless.c' || echo '$(srcdir)/'`../../lib/warnless.c ../../lib/tftpd-warnless.obj: ../../lib/warnless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-warnless.obj -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-warnless.Tpo -c -o ../../lib/tftpd-warnless.obj `if test -f '../../lib/warnless.c'; then $(CYGPATH_W) '../../lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/warnless.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-warnless.Tpo ../../lib/$(DEPDIR)/tftpd-warnless.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/warnless.c' object='../../lib/tftpd-warnless.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-warnless.obj `if test -f '../../lib/warnless.c'; then $(CYGPATH_W) '../../lib/warnless.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/warnless.c'; fi` tftpd-getpart.o: getpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-getpart.o -MD -MP -MF $(DEPDIR)/tftpd-getpart.Tpo -c -o tftpd-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tftpd-getpart.Tpo $(DEPDIR)/tftpd-getpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpart.c' object='tftpd-getpart.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-getpart.o `test -f 'getpart.c' || echo '$(srcdir)/'`getpart.c tftpd-getpart.obj: getpart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-getpart.obj -MD -MP -MF $(DEPDIR)/tftpd-getpart.Tpo -c -o tftpd-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tftpd-getpart.Tpo $(DEPDIR)/tftpd-getpart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpart.c' object='tftpd-getpart.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-getpart.obj `if test -f 'getpart.c'; then $(CYGPATH_W) 'getpart.c'; else $(CYGPATH_W) '$(srcdir)/getpart.c'; fi` ../../lib/tftpd-base64.o: ../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-base64.o -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-base64.Tpo -c -o ../../lib/tftpd-base64.o `test -f '../../lib/base64.c' || echo '$(srcdir)/'`../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-base64.Tpo ../../lib/$(DEPDIR)/tftpd-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/base64.c' object='../../lib/tftpd-base64.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-base64.o `test -f '../../lib/base64.c' || echo '$(srcdir)/'`../../lib/base64.c ../../lib/tftpd-base64.obj: ../../lib/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-base64.obj -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-base64.Tpo -c -o ../../lib/tftpd-base64.obj `if test -f '../../lib/base64.c'; then $(CYGPATH_W) '../../lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/base64.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-base64.Tpo ../../lib/$(DEPDIR)/tftpd-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/base64.c' object='../../lib/tftpd-base64.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-base64.obj `if test -f '../../lib/base64.c'; then $(CYGPATH_W) '../../lib/base64.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/base64.c'; fi` ../../lib/tftpd-memdebug.o: ../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-memdebug.o -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-memdebug.Tpo -c -o ../../lib/tftpd-memdebug.o `test -f '../../lib/memdebug.c' || echo '$(srcdir)/'`../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-memdebug.Tpo ../../lib/$(DEPDIR)/tftpd-memdebug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/memdebug.c' object='../../lib/tftpd-memdebug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-memdebug.o `test -f '../../lib/memdebug.c' || echo '$(srcdir)/'`../../lib/memdebug.c ../../lib/tftpd-memdebug.obj: ../../lib/memdebug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT ../../lib/tftpd-memdebug.obj -MD -MP -MF ../../lib/$(DEPDIR)/tftpd-memdebug.Tpo -c -o ../../lib/tftpd-memdebug.obj `if test -f '../../lib/memdebug.c'; then $(CYGPATH_W) '../../lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/memdebug.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../lib/$(DEPDIR)/tftpd-memdebug.Tpo ../../lib/$(DEPDIR)/tftpd-memdebug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../lib/memdebug.c' object='../../lib/tftpd-memdebug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o ../../lib/tftpd-memdebug.obj `if test -f '../../lib/memdebug.c'; then $(CYGPATH_W) '../../lib/memdebug.c'; else $(CYGPATH_W) '$(srcdir)/../../lib/memdebug.c'; fi` tftpd-util.o: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-util.o -MD -MP -MF $(DEPDIR)/tftpd-util.Tpo -c -o tftpd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tftpd-util.Tpo $(DEPDIR)/tftpd-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='tftpd-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c tftpd-util.obj: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-util.obj -MD -MP -MF $(DEPDIR)/tftpd-util.Tpo -c -o tftpd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tftpd-util.Tpo $(DEPDIR)/tftpd-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='tftpd-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` tftpd-tftpd.o: tftpd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-tftpd.o -MD -MP -MF $(DEPDIR)/tftpd-tftpd.Tpo -c -o tftpd-tftpd.o `test -f 'tftpd.c' || echo '$(srcdir)/'`tftpd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tftpd-tftpd.Tpo $(DEPDIR)/tftpd-tftpd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tftpd.c' object='tftpd-tftpd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-tftpd.o `test -f 'tftpd.c' || echo '$(srcdir)/'`tftpd.c tftpd-tftpd.obj: tftpd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -MT tftpd-tftpd.obj -MD -MP -MF $(DEPDIR)/tftpd-tftpd.Tpo -c -o tftpd-tftpd.obj `if test -f 'tftpd.c'; then $(CYGPATH_W) 'tftpd.c'; else $(CYGPATH_W) '$(srcdir)/tftpd.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tftpd-tftpd.Tpo $(DEPDIR)/tftpd-tftpd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tftpd.c' object='tftpd-tftpd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tftpd_CFLAGS) $(CFLAGS) -c -o tftpd-tftpd.obj `if test -f 'tftpd.c'; then $(CYGPATH_W) 'tftpd.c'; else $(CYGPATH_W) '$(srcdir)/tftpd.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../lib/$(DEPDIR)/$(am__dirstamp) -rm -f ../../lib/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ../../lib/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../lib/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: curl-7.35.0/tests/server/util.h0000644000175000017500000000375712213173003013276 00000000000000#ifndef HEADER_CURL_SERVER_UTIL_H #define HEADER_CURL_SERVER_UTIL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, 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. * ***************************************************************************/ #include "server_setup.h" char *data_to_hex(char *data, size_t len); void logmsg(const char *msg, ...); #define TEST_DATA_PATH "%s/data/test%ld" #define SERVERLOGS_LOCK "log/serverlogs.lock" /* global variable, where to find the 'data' dir */ extern const char *path; /* global variable, log file name */ extern const char *serverlogfile; #ifdef WIN32 #include #include #define sleep(sec) Sleep ((sec)*1000) #undef perror #define perror(m) win32_perror(m) void win32_perror (const char *msg); #endif /* WIN32 */ #ifdef USE_WINSOCK void win32_init(void); void win32_cleanup(void); #endif /* USE_WINSOCK */ /* returns the path name to the test case file */ char *test2file(long testno); int wait_ms(int timeout_ms); int write_pidfile(const char *filename); void set_advisor_read_lock(const char *filename); void clear_advisor_read_lock(const char *filename); #endif /* HEADER_CURL_SERVER_UTIL_H */ curl-7.35.0/tests/server/rtspd.c0000644000175000017500000012251012213173003013435 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "server_setup.h" /* * curl's test suite Real Time Streaming Protocol (RTSP) server. * * This source file was started based on curl's HTTP test suite server. */ #ifdef HAVE_SIGNAL_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_NETINET_TCP_H #include /* for TCP_NODELAY */ #endif #define ENABLE_CURLX_PRINTF /* make the curlx header define all printf() functions to use the curlx_* versions instead */ #include "curlx.h" /* from the private lib dir */ #include "getpart.h" #include "util.h" #include "server_sockaddr.h" /* include memdebug.h last */ #include "memdebug.h" #ifdef USE_WINSOCK #undef EINTR #define EINTR 4 /* errno.h value */ #undef ERANGE #define ERANGE 34 /* errno.h value */ #endif #ifdef ENABLE_IPV6 static bool use_ipv6 = FALSE; #endif static const char *ipv_inuse = "IPv4"; static int serverlogslocked = 0; #define REQBUFSIZ 150000 #define REQBUFSIZ_TXT "149999" static long prevtestno=-1; /* previous test number we served */ static long prevpartno=-1; /* previous part number we served */ static bool prevbounce=FALSE; /* instructs the server to increase the part number for a test in case the identical testno+partno request shows up again */ #define RCMD_NORMALREQ 0 /* default request, use the tests file normally */ #define RCMD_IDLE 1 /* told to sit idle */ #define RCMD_STREAM 2 /* told to stream */ typedef enum { RPROT_NONE = 0, RPROT_RTSP = 1, RPROT_HTTP = 2 } reqprot_t; #define SET_RTP_PKT_CHN(p,c) ((p)[1] = (unsigned char)((c) & 0xFF)) #define SET_RTP_PKT_LEN(p,l) (((p)[2] = (unsigned char)(((l) >> 8) & 0xFF)), \ ((p)[3] = (unsigned char)((l) & 0xFF))) struct httprequest { char reqbuf[REQBUFSIZ]; /* buffer area for the incoming request */ size_t checkindex; /* where to start checking of the request */ size_t offset; /* size of the incoming request */ long testno; /* test number found in the request */ long partno; /* part number found in the request */ bool open; /* keep connection open info, as found in the request */ bool auth_req; /* authentication required, don't wait for body unless there's an Authorization header */ bool auth; /* Authorization header present in the incoming request */ size_t cl; /* Content-Length of the incoming request */ bool digest; /* Authorization digest header found */ bool ntlm; /* Authorization ntlm header found */ int pipe; /* if non-zero, expect this many requests to do a "piped" request/response */ int skip; /* if non-zero, the server is instructed to not read this many bytes from a PUT/POST request. Ie the client sends N bytes said in Content-Length, but the server only reads N - skip bytes. */ int rcmd; /* doing a special command, see defines above */ reqprot_t protocol; /* request protocol, HTTP or RTSP */ int prot_version; /* HTTP or RTSP version (major*10 + minor) */ bool pipelining; /* true if request is pipelined */ char *rtp_buffer; size_t rtp_buffersize; }; static int ProcessRequest(struct httprequest *req); static void storerequest(char *reqbuf, size_t totalsize); #define DEFAULT_PORT 8999 #ifndef DEFAULT_LOGFILE #define DEFAULT_LOGFILE "log/rtspd.log" #endif const char *serverlogfile = DEFAULT_LOGFILE; #define RTSPDVERSION "cURL test suite RTSP server/0.1" #define REQUEST_DUMP "log/server.input" #define RESPONSE_DUMP "log/server.response" /* very-big-path support */ #define MAXDOCNAMELEN 140000 #define MAXDOCNAMELEN_TXT "139999" #define REQUEST_KEYWORD_SIZE 256 #define REQUEST_KEYWORD_SIZE_TXT "255" #define CMD_AUTH_REQUIRED "auth_required" /* 'idle' means that it will accept the request fine but never respond any data. Just keep the connection alive. */ #define CMD_IDLE "idle" /* 'stream' means to send a never-ending stream of data */ #define CMD_STREAM "stream" #define END_OF_HEADERS "\r\n\r\n" enum { DOCNUMBER_NOTHING = -7, DOCNUMBER_QUIT = -6, DOCNUMBER_BADCONNECT = -5, DOCNUMBER_INTERNAL= -4, DOCNUMBER_CONNECT = -3, DOCNUMBER_WERULEZ = -2, DOCNUMBER_404 = -1 }; /* sent as reply to a QUIT */ static const char *docquit = "HTTP/1.1 200 Goodbye" END_OF_HEADERS; /* sent as reply to a CONNECT */ static const char *docconnect = "HTTP/1.1 200 Mighty fine indeed" END_OF_HEADERS; /* sent as reply to a "bad" CONNECT */ static const char *docbadconnect = "HTTP/1.1 501 Forbidden you fool" END_OF_HEADERS; /* send back this on HTTP 404 file not found */ static const char *doc404_HTTP = "HTTP/1.1 404 Not Found\r\n" "Server: " RTSPDVERSION "\r\n" "Connection: close\r\n" "Content-Type: text/html" END_OF_HEADERS "\n" "\n" "404 Not Found\n" "\n" "

Not Found

\n" "The requested URL was not found on this server.\n" "


" RTSPDVERSION "
\n" "\n"; /* send back this on RTSP 404 file not found */ static const char *doc404_RTSP = "RTSP/1.0 404 Not Found\r\n" "Server: " RTSPDVERSION END_OF_HEADERS; /* Default size to send away fake RTP data */ #define RTP_DATA_SIZE 12 static const char *RTP_DATA = "$_1234\n\0asdf"; /* do-nothing macro replacement for systems which lack siginterrupt() */ #ifndef HAVE_SIGINTERRUPT #define siginterrupt(x,y) do {} while(0) #endif /* vars used to keep around previous signal handlers */ typedef RETSIGTYPE (*SIGHANDLER_T)(int); #ifdef SIGHUP static SIGHANDLER_T old_sighup_handler = SIG_ERR; #endif #ifdef SIGPIPE static SIGHANDLER_T old_sigpipe_handler = SIG_ERR; #endif #ifdef SIGALRM static SIGHANDLER_T old_sigalrm_handler = SIG_ERR; #endif #ifdef SIGINT static SIGHANDLER_T old_sigint_handler = SIG_ERR; #endif #ifdef SIGTERM static SIGHANDLER_T old_sigterm_handler = SIG_ERR; #endif #if defined(SIGBREAK) && defined(WIN32) static SIGHANDLER_T old_sigbreak_handler = SIG_ERR; #endif /* var which if set indicates that the program should finish execution */ SIG_ATOMIC_T got_exit_signal = 0; /* if next is set indicates the first signal handled in exit_signal_handler */ static volatile int exit_signal = 0; /* signal handler that will be triggered to indicate that the program should finish its execution in a controlled manner as soon as possible. The first time this is called it will set got_exit_signal to one and store in exit_signal the signal that triggered its execution. */ static RETSIGTYPE exit_signal_handler(int signum) { int old_errno = errno; if(got_exit_signal == 0) { got_exit_signal = 1; exit_signal = signum; } (void)signal(signum, exit_signal_handler); errno = old_errno; } static void install_signal_handlers(void) { #ifdef SIGHUP /* ignore SIGHUP signal */ if((old_sighup_handler = signal(SIGHUP, SIG_IGN)) == SIG_ERR) logmsg("cannot install SIGHUP handler: %s", strerror(errno)); #endif #ifdef SIGPIPE /* ignore SIGPIPE signal */ if((old_sigpipe_handler = signal(SIGPIPE, SIG_IGN)) == SIG_ERR) logmsg("cannot install SIGPIPE handler: %s", strerror(errno)); #endif #ifdef SIGALRM /* ignore SIGALRM signal */ if((old_sigalrm_handler = signal(SIGALRM, SIG_IGN)) == SIG_ERR) logmsg("cannot install SIGALRM handler: %s", strerror(errno)); #endif #ifdef SIGINT /* handle SIGINT signal with our exit_signal_handler */ if((old_sigint_handler = signal(SIGINT, exit_signal_handler)) == SIG_ERR) logmsg("cannot install SIGINT handler: %s", strerror(errno)); else siginterrupt(SIGINT, 1); #endif #ifdef SIGTERM /* handle SIGTERM signal with our exit_signal_handler */ if((old_sigterm_handler = signal(SIGTERM, exit_signal_handler)) == SIG_ERR) logmsg("cannot install SIGTERM handler: %s", strerror(errno)); else siginterrupt(SIGTERM, 1); #endif #if defined(SIGBREAK) && defined(WIN32) /* handle SIGBREAK signal with our exit_signal_handler */ if((old_sigbreak_handler = signal(SIGBREAK, exit_signal_handler)) == SIG_ERR) logmsg("cannot install SIGBREAK handler: %s", strerror(errno)); else siginterrupt(SIGBREAK, 1); #endif } static void restore_signal_handlers(void) { #ifdef SIGHUP if(SIG_ERR != old_sighup_handler) (void)signal(SIGHUP, old_sighup_handler); #endif #ifdef SIGPIPE if(SIG_ERR != old_sigpipe_handler) (void)signal(SIGPIPE, old_sigpipe_handler); #endif #ifdef SIGALRM if(SIG_ERR != old_sigalrm_handler) (void)signal(SIGALRM, old_sigalrm_handler); #endif #ifdef SIGINT if(SIG_ERR != old_sigint_handler) (void)signal(SIGINT, old_sigint_handler); #endif #ifdef SIGTERM if(SIG_ERR != old_sigterm_handler) (void)signal(SIGTERM, old_sigterm_handler); #endif #if defined(SIGBREAK) && defined(WIN32) if(SIG_ERR != old_sigbreak_handler) (void)signal(SIGBREAK, old_sigbreak_handler); #endif } static int ProcessRequest(struct httprequest *req) { char *line=&req->reqbuf[req->checkindex]; bool chunked = FALSE; static char request[REQUEST_KEYWORD_SIZE]; static char doc[MAXDOCNAMELEN]; static char prot_str[5]; char logbuf[256]; int prot_major, prot_minor; char *end; int error; end = strstr(line, END_OF_HEADERS); logmsg("ProcessRequest() called with testno %ld and line [%s]", req->testno, line); /* try to figure out the request characteristics as soon as possible, but only once! */ if((req->testno == DOCNUMBER_NOTHING) && sscanf(line, "%" REQUEST_KEYWORD_SIZE_TXT"s %" MAXDOCNAMELEN_TXT "s %4s/%d.%d", request, doc, prot_str, &prot_major, &prot_minor) == 5) { char *ptr; if(!strcmp(prot_str, "HTTP")) { req->protocol = RPROT_HTTP; } else if(!strcmp(prot_str, "RTSP")) { req->protocol = RPROT_RTSP; } else { req->protocol = RPROT_NONE; logmsg("got unknown protocol %s", prot_str); return 1; } req->prot_version = prot_major*10 + prot_minor; /* find the last slash */ ptr = strrchr(doc, '/'); /* get the number after it */ if(ptr) { FILE *stream; char *filename; if((strlen(doc) + strlen(request)) < 200) sprintf(logbuf, "Got request: %s %s %s/%d.%d", request, doc, prot_str, prot_major, prot_minor); else sprintf(logbuf, "Got a *HUGE* request %s/%d.%d", prot_str, prot_major, prot_minor); logmsg("%s", logbuf); if(!strncmp("/verifiedserver", ptr, 15)) { logmsg("Are-we-friendly question received"); req->testno = DOCNUMBER_WERULEZ; return 1; /* done */ } if(!strncmp("/quit", ptr, 5)) { logmsg("Request-to-quit received"); req->testno = DOCNUMBER_QUIT; return 1; /* done */ } ptr++; /* skip the slash */ /* skip all non-numericals following the slash */ while(*ptr && !ISDIGIT(*ptr)) ptr++; req->testno = strtol(ptr, &ptr, 10); if(req->testno > 10000) { req->partno = req->testno % 10000; req->testno /= 10000; } else req->partno = 0; sprintf(logbuf, "Requested test number %ld part %ld", req->testno, req->partno); logmsg("%s", logbuf); filename = test2file(req->testno); stream=fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg("Error opening file: %s", filename); logmsg("Couldn't open test file %ld", req->testno); req->open = FALSE; /* closes connection */ return 1; /* done */ } else { char *cmd = NULL; size_t cmdsize = 0; int num=0; int rtp_channel = 0; int rtp_size = 0; int rtp_partno = -1; int i = 0; char *rtp_scratch = NULL; /* get the custom server control "commands" */ error = getpart(&cmd, &cmdsize, "reply", "servercmd", stream); fclose(stream); if(error) { logmsg("getpart() failed with error: %d", error); req->open = FALSE; /* closes connection */ return 1; /* done */ } ptr = cmd; if(cmdsize) { logmsg("Found a reply-servercmd section!"); do { if(!strncmp(CMD_AUTH_REQUIRED, ptr, strlen(CMD_AUTH_REQUIRED))) { logmsg("instructed to require authorization header"); req->auth_req = TRUE; } else if(!strncmp(CMD_IDLE, ptr, strlen(CMD_IDLE))) { logmsg("instructed to idle"); req->rcmd = RCMD_IDLE; req->open = TRUE; } else if(!strncmp(CMD_STREAM, ptr, strlen(CMD_STREAM))) { logmsg("instructed to stream"); req->rcmd = RCMD_STREAM; } else if(1 == sscanf(ptr, "pipe: %d", &num)) { logmsg("instructed to allow a pipe size of %d", num); if(num < 0) logmsg("negative pipe size ignored"); else if(num > 0) req->pipe = num-1; /* decrease by one since we don't count the first request in this number */ } else if(1 == sscanf(ptr, "skip: %d", &num)) { logmsg("instructed to skip this number of bytes %d", num); req->skip = num; } else if(3 == sscanf(ptr, "rtp: part %d channel %d size %d", &rtp_partno, &rtp_channel, &rtp_size)) { if(rtp_partno == req->partno) { logmsg("RTP: part %d channel %d size %d", rtp_partno, rtp_channel, rtp_size); /* Make our scratch buffer enough to fit all the * desired data and one for padding */ rtp_scratch = malloc(rtp_size + 4 + RTP_DATA_SIZE); /* RTP is signalled with a $ */ rtp_scratch[0] = '$'; /* The channel follows and is one byte */ SET_RTP_PKT_CHN(rtp_scratch ,rtp_channel); /* Length follows and is a two byte short in network order */ SET_RTP_PKT_LEN(rtp_scratch, rtp_size); /* Fill it with junk data */ for(i = 0; i < rtp_size; i+= RTP_DATA_SIZE) { memcpy(rtp_scratch + 4 + i, RTP_DATA, RTP_DATA_SIZE); } if(req->rtp_buffer == NULL) { req->rtp_buffer = rtp_scratch; req->rtp_buffersize = rtp_size + 4; } else { req->rtp_buffer = realloc(req->rtp_buffer, req->rtp_buffersize + rtp_size + 4); memcpy(req->rtp_buffer + req->rtp_buffersize, rtp_scratch, rtp_size + 4); req->rtp_buffersize += rtp_size + 4; free(rtp_scratch); } logmsg("rtp_buffersize is %zu, rtp_size is %d.", req->rtp_buffersize, rtp_size); } } else { logmsg("funny instruction found: %s", ptr); } ptr = strchr(ptr, '\n'); if(ptr) ptr++; else ptr = NULL; } while(ptr && *ptr); logmsg("Done parsing server commands"); } if(cmd) free(cmd); } } else { if(sscanf(req->reqbuf, "CONNECT %" MAXDOCNAMELEN_TXT "s HTTP/%d.%d", doc, &prot_major, &prot_minor) == 3) { sprintf(logbuf, "Received a CONNECT %s HTTP/%d.%d request", doc, prot_major, prot_minor); logmsg("%s", logbuf); if(req->prot_version == 10) req->open = FALSE; /* HTTP 1.0 closes connection by default */ if(!strncmp(doc, "bad", 3)) /* if the host name starts with bad, we fake an error here */ req->testno = DOCNUMBER_BADCONNECT; else if(!strncmp(doc, "test", 4)) { /* if the host name starts with test, the port number used in the CONNECT line will be used as test number! */ char *portp = strchr(doc, ':'); if(portp && (*(portp+1) != '\0') && ISDIGIT(*(portp+1))) req->testno = strtol(portp+1, NULL, 10); else req->testno = DOCNUMBER_CONNECT; } else req->testno = DOCNUMBER_CONNECT; } else { logmsg("Did not find test number in PATH"); req->testno = DOCNUMBER_404; } } } if(!end) { /* we don't have a complete request yet! */ logmsg("ProcessRequest returned without a complete request"); return 0; /* not complete yet */ } logmsg("ProcessRequest found a complete request"); if(req->pipe) /* we do have a full set, advance the checkindex to after the end of the headers, for the pipelining case mostly */ req->checkindex += (end - line) + strlen(END_OF_HEADERS); /* **** Persistence **** * * If the request is a HTTP/1.0 one, we close the connection unconditionally * when we're done. * * If the request is a HTTP/1.1 one, we MUST check for a "Connection:" * header that might say "close". If it does, we close a connection when * this request is processed. Otherwise, we keep the connection alive for X * seconds. */ do { if(got_exit_signal) return 1; /* done */ if((req->cl==0) && curlx_strnequal("Content-Length:", line, 15)) { /* If we don't ignore content-length, we read it and we read the whole request including the body before we return. If we've been told to ignore the content-length, we will return as soon as all headers have been received */ char *endptr; char *ptr = line + 15; unsigned long clen = 0; while(*ptr && ISSPACE(*ptr)) ptr++; endptr = ptr; errno = 0; clen = strtoul(ptr, &endptr, 10); if((ptr == endptr) || !ISSPACE(*endptr) || (ERANGE == errno)) { /* this assumes that a zero Content-Length is valid */ logmsg("Found invalid Content-Length: (%s) in the request", ptr); req->open = FALSE; /* closes connection */ return 1; /* done */ } req->cl = clen - req->skip; logmsg("Found Content-Length: %lu in the request", clen); if(req->skip) logmsg("... but will abort after %zu bytes", req->cl); break; } else if(curlx_strnequal("Transfer-Encoding: chunked", line, strlen("Transfer-Encoding: chunked"))) { /* chunked data coming in */ chunked = TRUE; } if(chunked) { if(strstr(req->reqbuf, "\r\n0\r\n\r\n")) /* end of chunks reached */ return 1; /* done */ else return 0; /* not done */ } line = strchr(line, '\n'); if(line) line++; } while(line); if(!req->auth && strstr(req->reqbuf, "Authorization:")) { req->auth = TRUE; /* Authorization: header present! */ if(req->auth_req) logmsg("Authorization header found, as required"); } if(!req->digest && strstr(req->reqbuf, "Authorization: Digest")) { /* If the client is passing this Digest-header, we set the part number to 1000. Not only to spice up the complexity of this, but to make Digest stuff to work in the test suite. */ req->partno += 1000; req->digest = TRUE; /* header found */ logmsg("Received Digest request, sending back data %ld", req->partno); } else if(!req->ntlm && strstr(req->reqbuf, "Authorization: NTLM TlRMTVNTUAAD")) { /* If the client is passing this type-3 NTLM header */ req->partno += 1002; req->ntlm = TRUE; /* NTLM found */ logmsg("Received NTLM type-3, sending back data %ld", req->partno); if(req->cl) { logmsg(" Expecting %zu POSTed bytes", req->cl); } } else if(!req->ntlm && strstr(req->reqbuf, "Authorization: NTLM TlRMTVNTUAAB")) { /* If the client is passing this type-1 NTLM header */ req->partno += 1001; req->ntlm = TRUE; /* NTLM found */ logmsg("Received NTLM type-1, sending back data %ld", req->partno); } else if((req->partno >= 1000) && strstr(req->reqbuf, "Authorization: Basic")) { /* If the client is passing this Basic-header and the part number is already >=1000, we add 1 to the part number. This allows simple Basic authentication negotiation to work in the test suite. */ req->partno += 1; logmsg("Received Basic request, sending back data %ld", req->partno); } if(strstr(req->reqbuf, "Connection: close")) req->open = FALSE; /* close connection after this request */ if(!req->pipe && req->open && req->prot_version >= 11 && end && req->reqbuf + req->offset > end + strlen(END_OF_HEADERS) && (!strncmp(req->reqbuf, "GET", strlen("GET")) || !strncmp(req->reqbuf, "HEAD", strlen("HEAD")))) { /* If we have a persistent connection, HTTP version >= 1.1 and GET/HEAD request, enable pipelining. */ req->checkindex = (end - req->reqbuf) + strlen(END_OF_HEADERS); req->pipelining = TRUE; } while(req->pipe) { if(got_exit_signal) return 1; /* done */ /* scan for more header ends within this chunk */ line = &req->reqbuf[req->checkindex]; end = strstr(line, END_OF_HEADERS); if(!end) break; req->checkindex += (end - line) + strlen(END_OF_HEADERS); req->pipe--; } /* If authentication is required and no auth was provided, end now. This makes the server NOT wait for PUT/POST data and you can then make the test case send a rejection before any such data has been sent. Test case 154 uses this.*/ if(req->auth_req && !req->auth) return 1; /* done */ if(req->cl > 0) { if(req->cl <= req->offset - (end - req->reqbuf) - strlen(END_OF_HEADERS)) return 1; /* done */ else return 0; /* not complete yet */ } return 1; /* done */ } /* store the entire request in a file */ static void storerequest(char *reqbuf, size_t totalsize) { int res; int error = 0; size_t written; size_t writeleft; FILE *dump; if (reqbuf == NULL) return; if (totalsize == 0) return; do { dump = fopen(REQUEST_DUMP, "ab"); } while ((dump == NULL) && ((error = errno) == EINTR)); if (dump == NULL) { logmsg("Error opening file %s error: %d %s", REQUEST_DUMP, error, strerror(error)); logmsg("Failed to write request input to " REQUEST_DUMP); return; } writeleft = totalsize; do { written = fwrite(&reqbuf[totalsize-writeleft], 1, writeleft, dump); if(got_exit_signal) goto storerequest_cleanup; if(written > 0) writeleft -= written; } while ((writeleft > 0) && ((error = errno) == EINTR)); if(writeleft == 0) logmsg("Wrote request (%zu bytes) input to " REQUEST_DUMP, totalsize); else if(writeleft > 0) { logmsg("Error writing file %s error: %d %s", REQUEST_DUMP, error, strerror(error)); logmsg("Wrote only (%zu bytes) of (%zu bytes) request input to %s", totalsize-writeleft, totalsize, REQUEST_DUMP); } storerequest_cleanup: do { res = fclose(dump); } while(res && ((error = errno) == EINTR)); if(res) logmsg("Error closing file %s error: %d %s", REQUEST_DUMP, error, strerror(error)); } /* return 0 on success, non-zero on failure */ static int get_request(curl_socket_t sock, struct httprequest *req) { int error; int fail = 0; int done_processing = 0; char *reqbuf = req->reqbuf; ssize_t got = 0; char *pipereq = NULL; size_t pipereq_length = 0; if(req->pipelining) { pipereq = reqbuf + req->checkindex; pipereq_length = req->offset - req->checkindex; } /*** Init the httprequest structure properly for the upcoming request ***/ req->checkindex = 0; req->offset = 0; req->testno = DOCNUMBER_NOTHING; req->partno = 0; req->open = TRUE; req->auth_req = FALSE; req->auth = FALSE; req->cl = 0; req->digest = FALSE; req->ntlm = FALSE; req->pipe = 0; req->skip = 0; req->rcmd = RCMD_NORMALREQ; req->protocol = RPROT_NONE; req->prot_version = 0; req->pipelining = FALSE; req->rtp_buffer = NULL; req->rtp_buffersize = 0; /*** end of httprequest init ***/ while(!done_processing && (req->offset < REQBUFSIZ-1)) { if(pipereq_length && pipereq) { memmove(reqbuf, pipereq, pipereq_length); got = curlx_uztosz(pipereq_length); pipereq_length = 0; } else { if(req->skip) /* we are instructed to not read the entire thing, so we make sure to only read what we're supposed to and NOT read the enire thing the client wants to send! */ got = sread(sock, reqbuf + req->offset, req->cl); else got = sread(sock, reqbuf + req->offset, REQBUFSIZ-1 - req->offset); } if(got_exit_signal) return 1; if(got == 0) { logmsg("Connection closed by client"); fail = 1; } else if(got < 0) { error = SOCKERRNO; logmsg("recv() returned error: (%d) %s", error, strerror(error)); fail = 1; } if(fail) { /* dump the request received so far to the external file */ reqbuf[req->offset] = '\0'; storerequest(reqbuf, req->offset); return 1; } logmsg("Read %zd bytes", got); req->offset += (size_t)got; reqbuf[req->offset] = '\0'; done_processing = ProcessRequest(req); if(got_exit_signal) return 1; if(done_processing && req->pipe) { logmsg("Waiting for another piped request"); done_processing = 0; req->pipe--; } } if((req->offset == REQBUFSIZ-1) && (got > 0)) { logmsg("Request would overflow buffer, closing connection"); /* dump request received so far to external file anyway */ reqbuf[REQBUFSIZ-1] = '\0'; fail = 1; } else if(req->offset > REQBUFSIZ-1) { logmsg("Request buffer overflow, closing connection"); /* dump request received so far to external file anyway */ reqbuf[REQBUFSIZ-1] = '\0'; fail = 1; } else reqbuf[req->offset] = '\0'; /* dump the request to an external file */ storerequest(reqbuf, req->pipelining ? req->checkindex : req->offset); if(got_exit_signal) return 1; return fail; /* return 0 on success */ } /* returns -1 on failure */ static int send_doc(curl_socket_t sock, struct httprequest *req) { ssize_t written; size_t count; const char *buffer; char *ptr=NULL; FILE *stream; char *cmd=NULL; size_t cmdsize=0; FILE *dump; bool persistant = TRUE; bool sendfailure = FALSE; size_t responsesize; int error = 0; int res; static char weare[256]; char partbuf[80]="data"; logmsg("Send response number %ld part %ld", req->testno, req->partno); switch(req->rcmd) { default: case RCMD_NORMALREQ: break; /* continue with business as usual */ case RCMD_STREAM: #define STREAMTHIS "a string to stream 01234567890\n" count = strlen(STREAMTHIS); for (;;) { written = swrite(sock, STREAMTHIS, count); if(got_exit_signal) return -1; if(written != (ssize_t)count) { logmsg("Stopped streaming"); break; } } return -1; case RCMD_IDLE: /* Do nothing. Sit idle. Pretend it rains. */ return 0; } req->open = FALSE; if(req->testno < 0) { size_t msglen; char msgbuf[64]; switch(req->testno) { case DOCNUMBER_QUIT: logmsg("Replying to QUIT"); buffer = docquit; break; case DOCNUMBER_WERULEZ: /* we got a "friends?" question, reply back that we sure are */ logmsg("Identifying ourselves as friends"); sprintf(msgbuf, "RTSP_SERVER WE ROOLZ: %ld\r\n", (long)getpid()); msglen = strlen(msgbuf); sprintf(weare, "HTTP/1.1 200 OK\r\nContent-Length: %zu\r\n\r\n%s", msglen, msgbuf); buffer = weare; break; case DOCNUMBER_INTERNAL: logmsg("Bailing out due to internal error"); return -1; case DOCNUMBER_CONNECT: logmsg("Replying to CONNECT"); buffer = docconnect; break; case DOCNUMBER_BADCONNECT: logmsg("Replying to a bad CONNECT"); buffer = docbadconnect; break; case DOCNUMBER_404: default: logmsg("Replying to with a 404"); if(req->protocol == RPROT_HTTP) { buffer = doc404_HTTP; } else { buffer = doc404_RTSP; } break; } count = strlen(buffer); } else { char *filename = test2file(req->testno); if(0 != req->partno) sprintf(partbuf, "data%ld", req->partno); stream=fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg("Error opening file: %s", filename); logmsg("Couldn't open test file"); return 0; } else { error = getpart(&ptr, &count, "reply", partbuf, stream); fclose(stream); if(error) { logmsg("getpart() failed with error: %d", error); return 0; } buffer = ptr; } if(got_exit_signal) { if(ptr) free(ptr); return -1; } /* re-open the same file again */ stream=fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg("Error opening file: %s", filename); logmsg("Couldn't open test file"); if(ptr) free(ptr); return 0; } else { /* get the custom server control "commands" */ error = getpart(&cmd, &cmdsize, "reply", "postcmd", stream); fclose(stream); if(error) { logmsg("getpart() failed with error: %d", error); if(ptr) free(ptr); return 0; } } } if(got_exit_signal) { if(ptr) free(ptr); if(cmd) free(cmd); return -1; } /* If the word 'swsclose' is present anywhere in the reply chunk, the connection will be closed after the data has been sent to the requesting client... */ if(strstr(buffer, "swsclose") || !count) { persistant = FALSE; logmsg("connection close instruction \"swsclose\" found in response"); } if(strstr(buffer, "swsbounce")) { prevbounce = TRUE; logmsg("enable \"swsbounce\" in the next request"); } else prevbounce = FALSE; dump = fopen(RESPONSE_DUMP, "ab"); if(!dump) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg("Error opening file: %s", RESPONSE_DUMP); logmsg("couldn't create logfile: " RESPONSE_DUMP); if(ptr) free(ptr); if(cmd) free(cmd); return -1; } responsesize = count; do { /* Ok, we send no more than 200 bytes at a time, just to make sure that larger chunks are split up so that the client will need to do multiple recv() calls to get it and thus we exercise that code better */ size_t num = count; if(num > 200) num = 200; written = swrite(sock, buffer, num); if (written < 0) { sendfailure = TRUE; break; } else { logmsg("Sent off %zd bytes", written); } /* write to file as well */ fwrite(buffer, 1, (size_t)written, dump); if(got_exit_signal) break; count -= written; buffer += written; } while(count>0); /* Send out any RTP data */ if(req->rtp_buffer) { logmsg("About to write %zu RTP bytes", req->rtp_buffersize); count = req->rtp_buffersize; do { size_t num = count; if(num > 200) num = 200; written = swrite(sock, req->rtp_buffer + (req->rtp_buffersize - count), num); if(written < 0) { sendfailure = TRUE; break; } count -= written; } while(count > 0); free(req->rtp_buffer); req->rtp_buffersize = 0; } do { res = fclose(dump); } while(res && ((error = errno) == EINTR)); if(res) logmsg("Error closing file %s error: %d %s", RESPONSE_DUMP, error, strerror(error)); if(got_exit_signal) { if(ptr) free(ptr); if(cmd) free(cmd); return -1; } if(sendfailure) { logmsg("Sending response failed. Only (%zu bytes) of (%zu bytes) were sent", responsesize-count, responsesize); if(ptr) free(ptr); if(cmd) free(cmd); return -1; } logmsg("Response sent (%zu bytes) and written to " RESPONSE_DUMP, responsesize); if(ptr) free(ptr); if(cmdsize > 0 ) { char command[32]; int quarters; int num; ptr=cmd; do { if(2 == sscanf(ptr, "%31s %d", command, &num)) { if(!strcmp("wait", command)) { logmsg("Told to sleep for %d seconds", num); quarters = num * 4; while(quarters > 0) { quarters--; res = wait_ms(250); if(got_exit_signal) break; if(res) { /* should not happen */ error = errno; logmsg("wait_ms() failed with error: (%d) %s", error, strerror(error)); break; } } if(!quarters) logmsg("Continuing after sleeping %d seconds", num); } else logmsg("Unknown command in reply command section"); } ptr = strchr(ptr, '\n'); if(ptr) ptr++; else ptr = NULL; } while(ptr && *ptr); } if(cmd) free(cmd); req->open = persistant; prevtestno = req->testno; prevpartno = req->partno; return 0; } int main(int argc, char *argv[]) { srvr_sockaddr_union_t me; curl_socket_t sock = CURL_SOCKET_BAD; curl_socket_t msgsock = CURL_SOCKET_BAD; int wrotepidfile = 0; int flag; unsigned short port = DEFAULT_PORT; char *pidname= (char *)".rtsp.pid"; struct httprequest req; int rc; int error; int arg=1; long pid; while(argc>arg) { if(!strcmp("--version", argv[arg])) { printf("rtspd IPv4%s" "\n" , #ifdef ENABLE_IPV6 "/IPv6" #else "" #endif ); return 0; } else if(!strcmp("--pidfile", argv[arg])) { arg++; if(argc>arg) pidname = argv[arg++]; } else if(!strcmp("--logfile", argv[arg])) { arg++; if(argc>arg) serverlogfile = argv[arg++]; } else if(!strcmp("--ipv4", argv[arg])) { #ifdef ENABLE_IPV6 ipv_inuse = "IPv4"; use_ipv6 = FALSE; #endif arg++; } else if(!strcmp("--ipv6", argv[arg])) { #ifdef ENABLE_IPV6 ipv_inuse = "IPv6"; use_ipv6 = TRUE; #endif arg++; } else if(!strcmp("--port", argv[arg])) { arg++; if(argc>arg) { char *endptr; unsigned long ulnum = strtoul(argv[arg], &endptr, 10); if((endptr != argv[arg] + strlen(argv[arg])) || (ulnum < 1025UL) || (ulnum > 65535UL)) { fprintf(stderr, "rtspd: invalid --port argument (%s)\n", argv[arg]); return 0; } port = curlx_ultous(ulnum); arg++; } } else if(!strcmp("--srcdir", argv[arg])) { arg++; if(argc>arg) { path = argv[arg]; arg++; } } else { puts("Usage: rtspd [option]\n" " --version\n" " --logfile [file]\n" " --pidfile [file]\n" " --ipv4\n" " --ipv6\n" " --port [port]\n" " --srcdir [path]"); return 0; } } #ifdef WIN32 win32_init(); atexit(win32_cleanup); #endif install_signal_handlers(); pid = (long)getpid(); #ifdef ENABLE_IPV6 if(!use_ipv6) #endif sock = socket(AF_INET, SOCK_STREAM, 0); #ifdef ENABLE_IPV6 else sock = socket(AF_INET6, SOCK_STREAM, 0); #endif if(CURL_SOCKET_BAD == sock) { error = SOCKERRNO; logmsg("Error creating socket: (%d) %s", error, strerror(error)); goto server_cleanup; } flag = 1; if (0 != setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&flag, sizeof(flag))) { error = SOCKERRNO; logmsg("setsockopt(SO_REUSEADDR) failed with error: (%d) %s", error, strerror(error)); goto server_cleanup; } #ifdef ENABLE_IPV6 if(!use_ipv6) { #endif memset(&me.sa4, 0, sizeof(me.sa4)); me.sa4.sin_family = AF_INET; me.sa4.sin_addr.s_addr = INADDR_ANY; me.sa4.sin_port = htons(port); rc = bind(sock, &me.sa, sizeof(me.sa4)); #ifdef ENABLE_IPV6 } else { memset(&me.sa6, 0, sizeof(me.sa6)); me.sa6.sin6_family = AF_INET6; me.sa6.sin6_addr = in6addr_any; me.sa6.sin6_port = htons(port); rc = bind(sock, &me.sa, sizeof(me.sa6)); } #endif /* ENABLE_IPV6 */ if(0 != rc) { error = SOCKERRNO; logmsg("Error binding socket on port %hu: (%d) %s", port, error, strerror(error)); goto server_cleanup; } logmsg("Running %s version on port %d", ipv_inuse, (int)port); /* start accepting connections */ rc = listen(sock, 5); if(0 != rc) { error = SOCKERRNO; logmsg("listen() failed with error: (%d) %s", error, strerror(error)); goto server_cleanup; } /* ** As soon as this server writes its pid file the test harness will ** attempt to connect to this server and initiate its verification. */ wrotepidfile = write_pidfile(pidname); if(!wrotepidfile) goto server_cleanup; for (;;) { msgsock = accept(sock, NULL, NULL); if(got_exit_signal) break; if (CURL_SOCKET_BAD == msgsock) { error = SOCKERRNO; logmsg("MAJOR ERROR: accept() failed with error: (%d) %s", error, strerror(error)); break; } /* ** As soon as this server acepts a connection from the test harness it ** must set the server logs advisor read lock to indicate that server ** logs should not be read until this lock is removed by this server. */ set_advisor_read_lock(SERVERLOGS_LOCK); serverlogslocked = 1; logmsg("====> Client connect"); #ifdef TCP_NODELAY /* * Disable the Nagle algorithm to make it easier to send out a large * response in many small segments to torture the clients more. */ flag = 1; if (setsockopt(msgsock, IPPROTO_TCP, TCP_NODELAY, (void *)&flag, sizeof(flag)) == -1) { logmsg("====> TCP_NODELAY failed"); } #endif /* initialization of httprequest struct is done in get_request(), but due to pipelining treatment the pipelining struct field must be initialized previously to FALSE every time a new connection arrives. */ req.pipelining = FALSE; do { if(got_exit_signal) break; if(get_request(msgsock, &req)) /* non-zero means error, break out of loop */ break; if(prevbounce) { /* bounce treatment requested */ if((req.testno == prevtestno) && (req.partno == prevpartno)) { req.partno++; logmsg("BOUNCE part number to %ld", req.partno); } else { prevbounce = FALSE; prevtestno = -1; prevpartno = -1; } } send_doc(msgsock, &req); if(got_exit_signal) break; if((req.testno < 0) && (req.testno != DOCNUMBER_CONNECT)) { logmsg("special request received, no persistency"); break; } if(!req.open) { logmsg("instructed to close connection after server-reply"); break; } if(req.open) logmsg("=> persistant connection request ended, awaits new request"); /* if we got a CONNECT, loop and get another request as well! */ } while(req.open || (req.testno == DOCNUMBER_CONNECT)); if(got_exit_signal) break; logmsg("====> Client disconnect"); sclose(msgsock); msgsock = CURL_SOCKET_BAD; if(serverlogslocked) { serverlogslocked = 0; clear_advisor_read_lock(SERVERLOGS_LOCK); } if (req.testno == DOCNUMBER_QUIT) break; } server_cleanup: if((msgsock != sock) && (msgsock != CURL_SOCKET_BAD)) sclose(msgsock); if(sock != CURL_SOCKET_BAD) sclose(sock); if(got_exit_signal) logmsg("signalled to die"); if(wrotepidfile) unlink(pidname); if(serverlogslocked) { serverlogslocked = 0; clear_advisor_read_lock(SERVERLOGS_LOCK); } restore_signal_handlers(); if(got_exit_signal) { logmsg("========> %s rtspd (port: %d pid: %ld) exits with signal (%d)", ipv_inuse, (int)port, pid, exit_signal); /* * To properly set the return status of the process we * must raise the same signal SIGINT or SIGTERM that we * caught and let the old handler take care of it. */ raise(exit_signal); } logmsg("========> rtspd quits"); return 0; } curl-7.35.0/tests/server/sockfilt.c0000644000175000017500000011225712271275507014146 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, 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. * ***************************************************************************/ #include "server_setup.h" /* Purpose * * 1. Accept a TCP connection on a custom port (ipv4 or ipv6), or connect * to a given (localhost) port. * * 2. Get commands on STDIN. Pass data on to the TCP stream. * Get data from TCP stream and pass on to STDOUT. * * This program is made to perform all the socket/stream/connection stuff for * the test suite's (perl) FTP server. Previously the perl code did all of * this by its own, but I decided to let this program do the socket layer * because of several things: * * o We want the perl code to work with rather old perl installations, thus * we cannot use recent perl modules or features. * * o We want IPv6 support for systems that provide it, and doing optional IPv6 * support in perl seems if not impossible so at least awkward. * * o We want FTP-SSL support, which means that a connection that starts with * plain sockets needs to be able to "go SSL" in the midst. This would also * require some nasty perl stuff I'd rather avoid. * * (Source originally based on sws.c) */ /* * Signal handling notes for sockfilt * ---------------------------------- * * This program is a single-threaded process. * * This program is intended to be highly portable and as such it must be kept as * simple as possible, due to this the only signal handling mechanisms used will * be those of ANSI C, and used only in the most basic form which is good enough * for the purpose of this program. * * For the above reason and the specific needs of this program signals SIGHUP, * SIGPIPE and SIGALRM will be simply ignored on systems where this can be done. * If possible, signals SIGINT and SIGTERM will be handled by this program as an * indication to cleanup and finish execution as soon as possible. This will be * achieved with a single signal handler 'exit_signal_handler' for both signals. * * The 'exit_signal_handler' upon the first SIGINT or SIGTERM received signal * will just set to one the global var 'got_exit_signal' storing in global var * 'exit_signal' the signal that triggered this change. * * Nothing fancy that could introduce problems is used, the program at certain * points in its normal flow checks if var 'got_exit_signal' is set and in case * this is true it just makes its way out of loops and functions in structured * and well behaved manner to achieve proper program cleanup and termination. * * Even with the above mechanism implemented it is worthwile to note that other * signals might still be received, or that there might be systems on which it * is not possible to trap and ignore some of the above signals. This implies * that for increased portability and reliability the program must be coded as * if no signal was being ignored or handled at all. Enjoy it! */ #ifdef HAVE_SIGNAL_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #define ENABLE_CURLX_PRINTF /* make the curlx header define all printf() functions to use the curlx_* versions instead */ #include "curlx.h" /* from the private lib dir */ #include "getpart.h" #include "inet_pton.h" #include "util.h" #include "server_sockaddr.h" #include "warnless.h" /* include memdebug.h last */ #include "memdebug.h" #ifdef USE_WINSOCK #undef EINTR #define EINTR 4 /* errno.h value */ #undef EAGAIN #define EAGAIN 11 /* errno.h value */ #undef ENOMEM #define ENOMEM 12 /* errno.h value */ #undef EINVAL #define EINVAL 22 /* errno.h value */ #endif #define DEFAULT_PORT 8999 #ifndef DEFAULT_LOGFILE #define DEFAULT_LOGFILE "log/sockfilt.log" #endif const char *serverlogfile = DEFAULT_LOGFILE; static bool verbose = FALSE; static bool bind_only = FALSE; #ifdef ENABLE_IPV6 static bool use_ipv6 = FALSE; #endif static const char *ipv_inuse = "IPv4"; static unsigned short port = DEFAULT_PORT; static unsigned short connectport = 0; /* if non-zero, we activate this mode */ enum sockmode { PASSIVE_LISTEN, /* as a server waiting for connections */ PASSIVE_CONNECT, /* as a server, connected to a client */ ACTIVE, /* as a client, connected to a server */ ACTIVE_DISCONNECT /* as a client, disconnected from server */ }; /* do-nothing macro replacement for systems which lack siginterrupt() */ #ifndef HAVE_SIGINTERRUPT #define siginterrupt(x,y) do {} while(0) #endif /* vars used to keep around previous signal handlers */ typedef RETSIGTYPE (*SIGHANDLER_T)(int); #ifdef SIGHUP static SIGHANDLER_T old_sighup_handler = SIG_ERR; #endif #ifdef SIGPIPE static SIGHANDLER_T old_sigpipe_handler = SIG_ERR; #endif #ifdef SIGALRM static SIGHANDLER_T old_sigalrm_handler = SIG_ERR; #endif #ifdef SIGINT static SIGHANDLER_T old_sigint_handler = SIG_ERR; #endif #ifdef SIGTERM static SIGHANDLER_T old_sigterm_handler = SIG_ERR; #endif #if defined(SIGBREAK) && defined(WIN32) static SIGHANDLER_T old_sigbreak_handler = SIG_ERR; #endif /* var which if set indicates that the program should finish execution */ SIG_ATOMIC_T got_exit_signal = 0; /* if next is set indicates the first signal handled in exit_signal_handler */ static volatile int exit_signal = 0; /* signal handler that will be triggered to indicate that the program should finish its execution in a controlled manner as soon as possible. The first time this is called it will set got_exit_signal to one and store in exit_signal the signal that triggered its execution. */ static RETSIGTYPE exit_signal_handler(int signum) { int old_errno = errno; if(got_exit_signal == 0) { got_exit_signal = 1; exit_signal = signum; } (void)signal(signum, exit_signal_handler); errno = old_errno; } static void install_signal_handlers(void) { #ifdef SIGHUP /* ignore SIGHUP signal */ if((old_sighup_handler = signal(SIGHUP, SIG_IGN)) == SIG_ERR) logmsg("cannot install SIGHUP handler: %s", strerror(errno)); #endif #ifdef SIGPIPE /* ignore SIGPIPE signal */ if((old_sigpipe_handler = signal(SIGPIPE, SIG_IGN)) == SIG_ERR) logmsg("cannot install SIGPIPE handler: %s", strerror(errno)); #endif #ifdef SIGALRM /* ignore SIGALRM signal */ if((old_sigalrm_handler = signal(SIGALRM, SIG_IGN)) == SIG_ERR) logmsg("cannot install SIGALRM handler: %s", strerror(errno)); #endif #ifdef SIGINT /* handle SIGINT signal with our exit_signal_handler */ if((old_sigint_handler = signal(SIGINT, exit_signal_handler)) == SIG_ERR) logmsg("cannot install SIGINT handler: %s", strerror(errno)); else siginterrupt(SIGINT, 1); #endif #ifdef SIGTERM /* handle SIGTERM signal with our exit_signal_handler */ if((old_sigterm_handler = signal(SIGTERM, exit_signal_handler)) == SIG_ERR) logmsg("cannot install SIGTERM handler: %s", strerror(errno)); else siginterrupt(SIGTERM, 1); #endif #if defined(SIGBREAK) && defined(WIN32) /* handle SIGBREAK signal with our exit_signal_handler */ if((old_sigbreak_handler = signal(SIGBREAK, exit_signal_handler)) == SIG_ERR) logmsg("cannot install SIGBREAK handler: %s", strerror(errno)); else siginterrupt(SIGBREAK, 1); #endif } static void restore_signal_handlers(void) { #ifdef SIGHUP if(SIG_ERR != old_sighup_handler) (void)signal(SIGHUP, old_sighup_handler); #endif #ifdef SIGPIPE if(SIG_ERR != old_sigpipe_handler) (void)signal(SIGPIPE, old_sigpipe_handler); #endif #ifdef SIGALRM if(SIG_ERR != old_sigalrm_handler) (void)signal(SIGALRM, old_sigalrm_handler); #endif #ifdef SIGINT if(SIG_ERR != old_sigint_handler) (void)signal(SIGINT, old_sigint_handler); #endif #ifdef SIGTERM if(SIG_ERR != old_sigterm_handler) (void)signal(SIGTERM, old_sigterm_handler); #endif #if defined(SIGBREAK) && defined(WIN32) if(SIG_ERR != old_sigbreak_handler) (void)signal(SIGBREAK, old_sigbreak_handler); #endif } #ifdef WIN32 /* * read-wrapper to support reading from stdin on Windows. */ static ssize_t read_wincon(int fd, void *buf, size_t count) { HANDLE handle = NULL; DWORD mode, rcount = 0; BOOL success; if(fd == fileno(stdin)) { handle = GetStdHandle(STD_INPUT_HANDLE); } else { return read(fd, buf, count); } if(GetConsoleMode(handle, &mode)) { success = ReadConsole(handle, buf, count, &rcount, NULL); } else { success = ReadFile(handle, buf, count, &rcount, NULL); } if(success) { return rcount; } errno = GetLastError(); return -1; } #define read(a,b,c) read_wincon(a,b,c) /* * write-wrapper to support writing to stdout and stderr on Windows. */ static ssize_t write_wincon(int fd, const void *buf, size_t count) { HANDLE handle = NULL; DWORD mode, wcount = 0; BOOL success; if(fd == fileno(stdout)) { handle = GetStdHandle(STD_OUTPUT_HANDLE); } else if(fd == fileno(stderr)) { handle = GetStdHandle(STD_ERROR_HANDLE); } else { return write(fd, buf, count); } if(GetConsoleMode(handle, &mode)) { success = WriteConsole(handle, buf, count, &wcount, NULL); } else { success = WriteFile(handle, buf, count, &wcount, NULL); } if(success) { return wcount; } errno = GetLastError(); return -1; } #define write(a,b,c) write_wincon(a,b,c) #endif /* * fullread is a wrapper around the read() function. This will repeat the call * to read() until it actually has read the complete number of bytes indicated * in nbytes or it fails with a condition that cannot be handled with a simple * retry of the read call. */ static ssize_t fullread(int filedes, void *buffer, size_t nbytes) { int error; ssize_t rc; ssize_t nread = 0; do { rc = read(filedes, (unsigned char *)buffer + nread, nbytes - nread); if(got_exit_signal) { logmsg("signalled to die"); return -1; } if(rc < 0) { error = errno; if((error == EINTR) || (error == EAGAIN)) continue; logmsg("reading from file descriptor: %d,", filedes); logmsg("unrecoverable read() failure: (%d) %s", error, strerror(error)); return -1; } if(rc == 0) { logmsg("got 0 reading from stdin"); return 0; } nread += rc; } while((size_t)nread < nbytes); if(verbose) logmsg("read %zd bytes", nread); return nread; } /* * fullwrite is a wrapper around the write() function. This will repeat the * call to write() until it actually has written the complete number of bytes * indicated in nbytes or it fails with a condition that cannot be handled * with a simple retry of the write call. */ static ssize_t fullwrite(int filedes, const void *buffer, size_t nbytes) { int error; ssize_t wc; ssize_t nwrite = 0; do { wc = write(filedes, (unsigned char *)buffer + nwrite, nbytes - nwrite); if(got_exit_signal) { logmsg("signalled to die"); return -1; } if(wc < 0) { error = errno; if((error == EINTR) || (error == EAGAIN)) continue; logmsg("writing to file descriptor: %d,", filedes); logmsg("unrecoverable write() failure: (%d) %s", error, strerror(error)); return -1; } if(wc == 0) { logmsg("put 0 writing to stdout"); return 0; } nwrite += wc; } while((size_t)nwrite < nbytes); if(verbose) logmsg("wrote %zd bytes", nwrite); return nwrite; } /* * read_stdin tries to read from stdin nbytes into the given buffer. This is a * blocking function that will only return TRUE when nbytes have actually been * read or FALSE when an unrecoverable error has been detected. Failure of this * function is an indication that the sockfilt process should terminate. */ static bool read_stdin(void *buffer, size_t nbytes) { ssize_t nread = fullread(fileno(stdin), buffer, nbytes); if(nread != (ssize_t)nbytes) { logmsg("exiting..."); return FALSE; } return TRUE; } /* * write_stdout tries to write to stdio nbytes from the given buffer. This is a * blocking function that will only return TRUE when nbytes have actually been * written or FALSE when an unrecoverable error has been detected. Failure of * this function is an indication that the sockfilt process should terminate. */ static bool write_stdout(const void *buffer, size_t nbytes) { ssize_t nwrite = fullwrite(fileno(stdout), buffer, nbytes); if(nwrite != (ssize_t)nbytes) { logmsg("exiting..."); return FALSE; } return TRUE; } static void lograw(unsigned char *buffer, ssize_t len) { char data[120]; ssize_t i; unsigned char *ptr = buffer; char *optr = data; ssize_t width=0; for(i=0; i60) { logmsg("'%s'", data); width = 0; optr = data; } } if(width) logmsg("'%s'", data); } #ifdef USE_WINSOCK /* * WinSock select() does not support standard file descriptors, * it can only check SOCKETs. The following function is an attempt * to re-create a select() function with support for other handle types. * * select() function with support for WINSOCK2 sockets and all * other handle types supported by WaitForMultipleObjectsEx(). * * TODO: Differentiate between read/write/except for non-SOCKET handles. * * http://msdn.microsoft.com/en-us/library/windows/desktop/ms687028.aspx * http://msdn.microsoft.com/en-us/library/windows/desktop/ms741572.aspx */ static DWORD WINAPI select_ws_stdin_wait_thread(LPVOID lpParameter) { HANDLE handle; DWORD mode; handle = (HANDLE) lpParameter; if(GetConsoleMode(handle, &mode)) WaitForSingleObjectEx(handle, INFINITE, FALSE); else ReadFile(handle, NULL, 0, &mode, NULL); return 0; } static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) { DWORD milliseconds, wait, idx; WSAEVENT wsaevent, *wsaevents; WSANETWORKEVENTS wsanetevents; HANDLE handle, *handles; curl_socket_t sock, *fdarr, *wsasocks; long networkevents; int error, fds; DWORD nfd = 0, wsa = 0; int ret = 0; /* check if the input value is valid */ if(nfds < 0) { errno = EINVAL; return -1; } /* check if we got descriptors, sleep in case we got none */ if(!nfds) { Sleep((timeout->tv_sec * 1000) + (timeout->tv_usec / 1000)); return 0; } /* allocate internal array for the original input handles */ fdarr = malloc(nfds * sizeof(curl_socket_t)); if(fdarr == NULL) { errno = ENOMEM; return -1; } /* allocate internal array for the internal event handles */ handles = malloc(nfds * sizeof(HANDLE)); if(handles == NULL) { errno = ENOMEM; return -1; } /* allocate internal array for the internal socket handles */ wsasocks = malloc(nfds * sizeof(curl_socket_t)); if(wsasocks == NULL) { errno = ENOMEM; return -1; } /* allocate internal array for the internal WINSOCK2 events */ wsaevents = malloc(nfds * sizeof(WSAEVENT)); if(wsaevents == NULL) { errno = ENOMEM; return -1; } /* loop over the handles in the input descriptor sets */ for(fds = 0; fds < nfds; fds++) { networkevents = 0; handles[nfd] = 0; if(FD_ISSET(fds, readfds)) networkevents |= FD_READ|FD_ACCEPT|FD_CLOSE; if(FD_ISSET(fds, writefds)) networkevents |= FD_WRITE|FD_CONNECT; if(FD_ISSET(fds, exceptfds)) networkevents |= FD_OOB|FD_CLOSE; /* only wait for events for which we actually care */ if(networkevents) { fdarr[nfd] = curlx_sitosk(fds); if(fds == fileno(stdin)) { handles[nfd] = CreateThread(NULL, 0, &select_ws_stdin_wait_thread, GetStdHandle(STD_INPUT_HANDLE), 0, NULL); } else if(fds == fileno(stdout)) { handles[nfd] = GetStdHandle(STD_OUTPUT_HANDLE); } else if(fds == fileno(stderr)) { handles[nfd] = GetStdHandle(STD_ERROR_HANDLE); } else { wsaevent = WSACreateEvent(); if(wsaevent != WSA_INVALID_EVENT) { error = WSAEventSelect(fds, wsaevent, networkevents); if(error != SOCKET_ERROR) { handles[nfd] = wsaevent; wsasocks[wsa] = curlx_sitosk(fds); wsaevents[wsa] = wsaevent; wsa++; } else { handles[nfd] = (HANDLE) curlx_sitosk(fds); WSACloseEvent(wsaevent); } } } nfd++; } } /* convert struct timeval to milliseconds */ if(timeout) { milliseconds = ((timeout->tv_sec * 1000) + (timeout->tv_usec / 1000)); } else { milliseconds = INFINITE; } /* wait for one of the internal handles to trigger */ wait = WaitForMultipleObjectsEx(nfd, handles, FALSE, milliseconds, FALSE); /* loop over the internal handles returned in the descriptors */ for(idx = 0; idx < nfd; idx++) { handle = handles[idx]; sock = fdarr[idx]; fds = curlx_sktosi(sock); /* check if the current internal handle was triggered */ if(wait != WAIT_FAILED && (wait - WAIT_OBJECT_0) <= idx && WaitForSingleObjectEx(handle, 0, FALSE) == WAIT_OBJECT_0) { /* first handle stdin, stdout and stderr */ if(fds == fileno(stdin)) { /* stdin is never ready for write or exceptional */ FD_CLR(sock, writefds); FD_CLR(sock, exceptfds); } else if(fds == fileno(stdout) || fds == fileno(stderr)) { /* stdout and stderr are never ready for read or exceptional */ FD_CLR(sock, readfds); FD_CLR(sock, exceptfds); } else { /* try to handle the event with the WINSOCK2 functions */ error = WSAEnumNetworkEvents(fds, handle, &wsanetevents); if(error != SOCKET_ERROR) { /* remove from descriptor set if not ready for read/accept/close */ if(!(wsanetevents.lNetworkEvents & (FD_READ|FD_ACCEPT|FD_CLOSE))) FD_CLR(sock, readfds); /* remove from descriptor set if not ready for write/connect */ if(!(wsanetevents.lNetworkEvents & (FD_WRITE|FD_CONNECT))) FD_CLR(sock, writefds); /* HACK: * use exceptfds together with readfds to signal * that the connection was closed by the client. * * Reason: FD_CLOSE is only signaled once, sometimes * at the same time as FD_READ with data being available. * This means that recv/sread is not reliable to detect * that the connection is closed. */ /* remove from descriptor set if not exceptional */ if(!(wsanetevents.lNetworkEvents & (FD_OOB|FD_CLOSE))) FD_CLR(sock, exceptfds); } } /* check if the event has not been filtered using specific tests */ if(FD_ISSET(sock, readfds) || FD_ISSET(sock, writefds) || FD_ISSET(sock, exceptfds)) { ret++; } } else { /* remove from all descriptor sets since this handle did not trigger */ FD_CLR(sock, readfds); FD_CLR(sock, writefds); FD_CLR(sock, exceptfds); } } for(idx = 0; idx < wsa; idx++) { WSAEventSelect(wsasocks[idx], NULL, 0); WSACloseEvent(wsaevents[idx]); } free(wsaevents); free(wsasocks); free(handles); free(fdarr); return ret; } #define select(a,b,c,d,e) select_ws(a,b,c,d,e) #endif /* USE_WINSOCK */ /* sockfdp is a pointer to an established stream or CURL_SOCKET_BAD if sockfd is CURL_SOCKET_BAD, listendfd is a listening socket we must accept() */ static bool juggle(curl_socket_t *sockfdp, curl_socket_t listenfd, enum sockmode *mode) { struct timeval timeout; fd_set fds_read; fd_set fds_write; fd_set fds_err; curl_socket_t sockfd = CURL_SOCKET_BAD; int maxfd = -99; ssize_t rc; ssize_t nread_socket; ssize_t bytes_written; ssize_t buffer_len; int error = 0; /* 'buffer' is this excessively large only to be able to support things like test 1003 which tests exceedingly large server response lines */ unsigned char buffer[17010]; char data[16]; if(got_exit_signal) { logmsg("signalled to die, exiting..."); return FALSE; } #ifdef HAVE_GETPPID /* As a last resort, quit if sockfilt process becomes orphan. Just in case parent ftpserver process has died without killing its sockfilt children */ if(getppid() <= 1) { logmsg("process becomes orphan, exiting"); return FALSE; } #endif timeout.tv_sec = 120; timeout.tv_usec = 0; FD_ZERO(&fds_read); FD_ZERO(&fds_write); FD_ZERO(&fds_err); FD_SET((curl_socket_t)fileno(stdin), &fds_read); switch(*mode) { case PASSIVE_LISTEN: /* server mode */ sockfd = listenfd; /* there's always a socket to wait for */ FD_SET(sockfd, &fds_read); maxfd = (int)sockfd; break; case PASSIVE_CONNECT: sockfd = *sockfdp; if(CURL_SOCKET_BAD == sockfd) { /* eeek, we are supposedly connected and then this cannot be -1 ! */ logmsg("socket is -1! on %s:%d", __FILE__, __LINE__); maxfd = 0; /* stdin */ } else { /* there's always a socket to wait for */ FD_SET(sockfd, &fds_read); #ifdef USE_WINSOCK FD_SET(sockfd, &fds_err); #endif maxfd = (int)sockfd; } break; case ACTIVE: sockfd = *sockfdp; /* sockfd turns CURL_SOCKET_BAD when our connection has been closed */ if(CURL_SOCKET_BAD != sockfd) { FD_SET(sockfd, &fds_read); #ifdef USE_WINSOCK FD_SET(sockfd, &fds_err); #endif maxfd = (int)sockfd; } else { logmsg("No socket to read on"); maxfd = 0; } break; case ACTIVE_DISCONNECT: logmsg("disconnected, no socket to read on"); maxfd = 0; sockfd = CURL_SOCKET_BAD; break; } /* switch(*mode) */ do { /* select() blocking behavior call on blocking descriptors please */ rc = select(maxfd + 1, &fds_read, &fds_write, &fds_err, &timeout); if(got_exit_signal) { logmsg("signalled to die, exiting..."); return FALSE; } } while((rc == -1) && ((error = errno) == EINTR)); if(rc < 0) { logmsg("select() failed with error: (%d) %s", error, strerror(error)); return FALSE; } if(rc == 0) /* timeout */ return TRUE; if(FD_ISSET(fileno(stdin), &fds_read)) { /* read from stdin, commands/data to be dealt with and possibly passed on to the socket protocol: 4 letter command + LF [mandatory] 4-digit hexadecimal data length + LF [if the command takes data] data [the data being as long as set above] Commands: DATA - plain pass-thru data */ if(!read_stdin(buffer, 5)) return FALSE; logmsg("Received %c%c%c%c (on stdin)", buffer[0], buffer[1], buffer[2], buffer[3] ); if(!memcmp("PING", buffer, 4)) { /* send reply on stdout, just proving we are alive */ if(!write_stdout("PONG\n", 5)) return FALSE; } else if(!memcmp("PORT", buffer, 4)) { /* Question asking us what PORT number we are listening to. Replies to PORT with "IPv[num]/[port]" */ sprintf((char *)buffer, "%s/%hu\n", ipv_inuse, port); buffer_len = (ssize_t)strlen((char *)buffer); snprintf(data, sizeof(data), "PORT\n%04zx\n", buffer_len); if(!write_stdout(data, 10)) return FALSE; if(!write_stdout(buffer, buffer_len)) return FALSE; } else if(!memcmp("QUIT", buffer, 4)) { /* just die */ logmsg("quits"); return FALSE; } else if(!memcmp("DATA", buffer, 4)) { /* data IN => data OUT */ if(!read_stdin(buffer, 5)) return FALSE; buffer[5] = '\0'; buffer_len = (ssize_t)strtol((char *)buffer, NULL, 16); if (buffer_len > (ssize_t)sizeof(buffer)) { logmsg("ERROR: Buffer size (%zu bytes) too small for data size " "(%zd bytes)", sizeof(buffer), buffer_len); return FALSE; } logmsg("> %zd bytes data, server => client", buffer_len); if(!read_stdin(buffer, buffer_len)) return FALSE; lograw(buffer, buffer_len); if(*mode == PASSIVE_LISTEN) { logmsg("*** We are disconnected!"); if(!write_stdout("DISC\n", 5)) return FALSE; } else { /* send away on the socket */ bytes_written = swrite(sockfd, buffer, buffer_len); if(bytes_written != buffer_len) { logmsg("Not all data was sent. Bytes to send: %zd sent: %zd", buffer_len, bytes_written); } } } else if(!memcmp("DISC", buffer, 4)) { /* disconnect! */ if(!write_stdout("DISC\n", 5)) return FALSE; if(sockfd != CURL_SOCKET_BAD) { logmsg("====> Client forcibly disconnected"); sclose(sockfd); *sockfdp = CURL_SOCKET_BAD; if(*mode == PASSIVE_CONNECT) *mode = PASSIVE_LISTEN; else *mode = ACTIVE_DISCONNECT; } else logmsg("attempt to close already dead connection"); return TRUE; } } if((sockfd != CURL_SOCKET_BAD) && (FD_ISSET(sockfd, &fds_read)) ) { curl_socket_t newfd = CURL_SOCKET_BAD; /* newly accepted socket */ if(*mode == PASSIVE_LISTEN) { /* there's no stream set up yet, this is an indication that there's a client connecting. */ newfd = accept(sockfd, NULL, NULL); if(CURL_SOCKET_BAD == newfd) { error = SOCKERRNO; logmsg("accept(%d, NULL, NULL) failed with error: (%d) %s", sockfd, error, strerror(error)); } else { logmsg("====> Client connect"); if(!write_stdout("CNCT\n", 5)) return FALSE; *sockfdp = newfd; /* store the new socket */ *mode = PASSIVE_CONNECT; /* we have connected */ } return TRUE; } /* read from socket, pass on data to stdout */ nread_socket = sread(sockfd, buffer, sizeof(buffer)); if(nread_socket > 0) { snprintf(data, sizeof(data), "DATA\n%04zx\n", nread_socket); if(!write_stdout(data, 10)) return FALSE; if(!write_stdout(buffer, nread_socket)) return FALSE; logmsg("< %zd bytes data, client => server", nread_socket); lograw(buffer, nread_socket); } if(nread_socket <= 0 #ifdef USE_WINSOCK || FD_ISSET(sockfd, &fds_err) #endif ) { logmsg("====> Client disconnect"); if(!write_stdout("DISC\n", 5)) return FALSE; sclose(sockfd); *sockfdp = CURL_SOCKET_BAD; if(*mode == PASSIVE_CONNECT) *mode = PASSIVE_LISTEN; else *mode = ACTIVE_DISCONNECT; return TRUE; } } return TRUE; } static curl_socket_t sockdaemon(curl_socket_t sock, unsigned short *listenport) { /* passive daemon style */ srvr_sockaddr_union_t listener; int flag; int rc; int totdelay = 0; int maxretr = 10; int delay= 20; int attempt = 0; int error = 0; do { attempt++; flag = 1; rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&flag, sizeof(flag)); if(rc) { error = SOCKERRNO; logmsg("setsockopt(SO_REUSEADDR) failed with error: (%d) %s", error, strerror(error)); if(maxretr) { rc = wait_ms(delay); if(rc) { /* should not happen */ error = errno; logmsg("wait_ms() failed with error: (%d) %s", error, strerror(error)); sclose(sock); return CURL_SOCKET_BAD; } if(got_exit_signal) { logmsg("signalled to die, exiting..."); sclose(sock); return CURL_SOCKET_BAD; } totdelay += delay; delay *= 2; /* double the sleep for next attempt */ } } } while(rc && maxretr--); if(rc) { logmsg("setsockopt(SO_REUSEADDR) failed %d times in %d ms. Error: (%d) %s", attempt, totdelay, error, strerror(error)); logmsg("Continuing anyway..."); } /* When the specified listener port is zero, it is actually a request to let the system choose a non-zero available port. */ #ifdef ENABLE_IPV6 if(!use_ipv6) { #endif memset(&listener.sa4, 0, sizeof(listener.sa4)); listener.sa4.sin_family = AF_INET; listener.sa4.sin_addr.s_addr = INADDR_ANY; listener.sa4.sin_port = htons(*listenport); rc = bind(sock, &listener.sa, sizeof(listener.sa4)); #ifdef ENABLE_IPV6 } else { memset(&listener.sa6, 0, sizeof(listener.sa6)); listener.sa6.sin6_family = AF_INET6; listener.sa6.sin6_addr = in6addr_any; listener.sa6.sin6_port = htons(*listenport); rc = bind(sock, &listener.sa, sizeof(listener.sa6)); } #endif /* ENABLE_IPV6 */ if(rc) { error = SOCKERRNO; logmsg("Error binding socket on port %hu: (%d) %s", *listenport, error, strerror(error)); sclose(sock); return CURL_SOCKET_BAD; } if(!*listenport) { /* The system was supposed to choose a port number, figure out which port we actually got and update the listener port value with it. */ curl_socklen_t la_size; srvr_sockaddr_union_t localaddr; #ifdef ENABLE_IPV6 if(!use_ipv6) #endif la_size = sizeof(localaddr.sa4); #ifdef ENABLE_IPV6 else la_size = sizeof(localaddr.sa6); #endif memset(&localaddr.sa, 0, (size_t)la_size); if(getsockname(sock, &localaddr.sa, &la_size) < 0) { error = SOCKERRNO; logmsg("getsockname() failed with error: (%d) %s", error, strerror(error)); sclose(sock); return CURL_SOCKET_BAD; } switch (localaddr.sa.sa_family) { case AF_INET: *listenport = ntohs(localaddr.sa4.sin_port); break; #ifdef ENABLE_IPV6 case AF_INET6: *listenport = ntohs(localaddr.sa6.sin6_port); break; #endif default: break; } if(!*listenport) { /* Real failure, listener port shall not be zero beyond this point. */ logmsg("Apparently getsockname() succeeded, with listener port zero."); logmsg("A valid reason for this failure is a binary built without"); logmsg("proper network library linkage. This might not be the only"); logmsg("reason, but double check it before anything else."); sclose(sock); return CURL_SOCKET_BAD; } } /* bindonly option forces no listening */ if(bind_only) { logmsg("instructed to bind port without listening"); return sock; } /* start accepting connections */ rc = listen(sock, 5); if(0 != rc) { error = SOCKERRNO; logmsg("listen(%d, 5) failed with error: (%d) %s", sock, error, strerror(error)); sclose(sock); return CURL_SOCKET_BAD; } return sock; } int main(int argc, char *argv[]) { srvr_sockaddr_union_t me; curl_socket_t sock = CURL_SOCKET_BAD; curl_socket_t msgsock = CURL_SOCKET_BAD; int wrotepidfile = 0; char *pidname= (char *)".sockfilt.pid"; bool juggle_again; int rc; int error; int arg=1; enum sockmode mode = PASSIVE_LISTEN; /* default */ const char *addr = NULL; while(argc>arg) { if(!strcmp("--version", argv[arg])) { printf("sockfilt IPv4%s\n", #ifdef ENABLE_IPV6 "/IPv6" #else "" #endif ); return 0; } else if(!strcmp("--verbose", argv[arg])) { verbose = TRUE; arg++; } else if(!strcmp("--pidfile", argv[arg])) { arg++; if(argc>arg) pidname = argv[arg++]; } else if(!strcmp("--logfile", argv[arg])) { arg++; if(argc>arg) serverlogfile = argv[arg++]; } else if(!strcmp("--ipv6", argv[arg])) { #ifdef ENABLE_IPV6 ipv_inuse = "IPv6"; use_ipv6 = TRUE; #endif arg++; } else if(!strcmp("--ipv4", argv[arg])) { /* for completeness, we support this option as well */ #ifdef ENABLE_IPV6 ipv_inuse = "IPv4"; use_ipv6 = FALSE; #endif arg++; } else if(!strcmp("--bindonly", argv[arg])) { bind_only = TRUE; arg++; } else if(!strcmp("--port", argv[arg])) { arg++; if(argc>arg) { char *endptr; unsigned long ulnum = strtoul(argv[arg], &endptr, 10); if((endptr != argv[arg] + strlen(argv[arg])) || ((ulnum != 0UL) && ((ulnum < 1025UL) || (ulnum > 65535UL)))) { fprintf(stderr, "sockfilt: invalid --port argument (%s)\n", argv[arg]); return 0; } port = curlx_ultous(ulnum); arg++; } } else if(!strcmp("--connect", argv[arg])) { /* Asked to actively connect to the specified local port instead of doing a passive server-style listening. */ arg++; if(argc>arg) { char *endptr; unsigned long ulnum = strtoul(argv[arg], &endptr, 10); if((endptr != argv[arg] + strlen(argv[arg])) || (ulnum < 1025UL) || (ulnum > 65535UL)) { fprintf(stderr, "sockfilt: invalid --connect argument (%s)\n", argv[arg]); return 0; } connectport = curlx_ultous(ulnum); arg++; } } else if(!strcmp("--addr", argv[arg])) { /* Set an IP address to use with --connect; otherwise use localhost */ arg++; if(argc>arg) { addr = argv[arg]; arg++; } } else { puts("Usage: sockfilt [option]\n" " --version\n" " --verbose\n" " --logfile [file]\n" " --pidfile [file]\n" " --ipv4\n" " --ipv6\n" " --bindonly\n" " --port [port]\n" " --connect [port]\n" " --addr [address]"); return 0; } } #ifdef WIN32 win32_init(); atexit(win32_cleanup); setmode(fileno(stdin), O_BINARY); setmode(fileno(stdout), O_BINARY); setmode(fileno(stderr), O_BINARY); #endif install_signal_handlers(); #ifdef ENABLE_IPV6 if(!use_ipv6) #endif sock = socket(AF_INET, SOCK_STREAM, 0); #ifdef ENABLE_IPV6 else sock = socket(AF_INET6, SOCK_STREAM, 0); #endif if(CURL_SOCKET_BAD == sock) { error = SOCKERRNO; logmsg("Error creating socket: (%d) %s", error, strerror(error)); write_stdout("FAIL\n", 5); goto sockfilt_cleanup; } if(connectport) { /* Active mode, we should connect to the given port number */ mode = ACTIVE; #ifdef ENABLE_IPV6 if(!use_ipv6) { #endif memset(&me.sa4, 0, sizeof(me.sa4)); me.sa4.sin_family = AF_INET; me.sa4.sin_port = htons(connectport); me.sa4.sin_addr.s_addr = INADDR_ANY; if (!addr) addr = "127.0.0.1"; Curl_inet_pton(AF_INET, addr, &me.sa4.sin_addr); rc = connect(sock, &me.sa, sizeof(me.sa4)); #ifdef ENABLE_IPV6 } else { memset(&me.sa6, 0, sizeof(me.sa6)); me.sa6.sin6_family = AF_INET6; me.sa6.sin6_port = htons(connectport); if (!addr) addr = "::1"; Curl_inet_pton(AF_INET6, addr, &me.sa6.sin6_addr); rc = connect(sock, &me.sa, sizeof(me.sa6)); } #endif /* ENABLE_IPV6 */ if(rc) { error = SOCKERRNO; logmsg("Error connecting to port %hu: (%d) %s", connectport, error, strerror(error)); write_stdout("FAIL\n", 5); goto sockfilt_cleanup; } logmsg("====> Client connect"); msgsock = sock; /* use this as stream */ } else { /* passive daemon style */ sock = sockdaemon(sock, &port); if(CURL_SOCKET_BAD == sock) { write_stdout("FAIL\n", 5); goto sockfilt_cleanup; } msgsock = CURL_SOCKET_BAD; /* no stream socket yet */ } logmsg("Running %s version", ipv_inuse); if(connectport) logmsg("Connected to port %hu", connectport); else if(bind_only) logmsg("Bound without listening on port %hu", port); else logmsg("Listening on port %hu", port); wrotepidfile = write_pidfile(pidname); if(!wrotepidfile) { write_stdout("FAIL\n", 5); goto sockfilt_cleanup; } do { juggle_again = juggle(&msgsock, sock, &mode); } while(juggle_again); sockfilt_cleanup: if((msgsock != sock) && (msgsock != CURL_SOCKET_BAD)) sclose(msgsock); if(sock != CURL_SOCKET_BAD) sclose(sock); if(wrotepidfile) unlink(pidname); restore_signal_handlers(); if(got_exit_signal) { logmsg("============> sockfilt exits with signal (%d)", exit_signal); /* * To properly set the return status of the process we * must raise the same signal SIGINT or SIGTERM that we * caught and let the old handler take care of it. */ raise(exit_signal); } logmsg("============> sockfilt quits"); return 0; } curl-7.35.0/tests/testcurl.pl0000755000175000017500000005207212270035364013053 00000000000000#!/usr/bin/env perl #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2014, 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. # ########################################################################### ########################### # What is This Script? ########################### # testcurl.pl is the master script to use for automatic testing of curl # directly off its source repository. # This is written for the purpose of being run from a crontab job or similar # at a regular interval. The output is suitable to be mailed to # curl-autocompile@haxx.se to be dealt with automatically (make sure the # subject includes the word "autobuild" as the mail gets silently discarded # otherwise). The most current build status (with a resonable backlog) will # be published on the curl site, at http://curl.haxx.se/auto/ # USAGE: # testcurl.pl [options] [curl-daily-name] > output # Options: # # --configure=[options] Configure options # --crosscompile This is a crosscompile # --desc=[desc] Description of your test system # --email=[email] Set email address to report as # --extvercmd=[command] Command to use for displaying version with cross compiles. # --mktarball=[command] Command to run after completed test # --name=[name] Set name to report as # --nocvsup Don't pull from git even though it is a git tree # --nogitpull Don't pull from git even though it is a git tree # --nobuildconf Don't run buildconf # --noconfigure Don't run configure # --runtestopts=[options] Options to pass to runtests.pl # --setup=[file name] File name to read setup from (deprecated) # --target=[your os] Specify your target environment. # # if [curl-daily-name] is omitted, a 'curl' git directory is assumed. # use strict; use Cwd; # Turn on warnings (equivalent to -w, which can't be used with /usr/bin/env) #BEGIN { $^W = 1; } use vars qw($version $fixed $infixed $CURLDIR $git $pwd $build $buildlog $buildlogname $configurebuild $targetos $confheader $binext $libext); use vars qw($name $email $desc $confopts $runtestopts $setupfile $mktarball $extvercmd $nogitpull $nobuildconf $crosscompile $timestamp $notes); # version of this script $version='2012-11-30'; $fixed=0; # Determine if we're running from git or a canned copy of curl, # or if we got a specific target option or setup file option. $CURLDIR="curl"; if (-f ".git/config") { $CURLDIR = "./"; } $git=1; $setupfile = 'setup'; $configurebuild = 1; while ($ARGV[0]) { if ($ARGV[0] =~ /--target=/) { $targetos = (split(/=/, shift @ARGV))[1]; } elsif ($ARGV[0] =~ /--setup=/) { $setupfile = (split(/=/, shift @ARGV))[1]; } elsif ($ARGV[0] =~ /--extvercmd=/) { $extvercmd = (split(/=/, shift @ARGV))[1]; } elsif ($ARGV[0] =~ /--mktarball=/) { $mktarball = (split(/=/, shift @ARGV))[1]; } elsif ($ARGV[0] =~ /--name=/) { $name = (split(/=/, shift @ARGV))[1]; } elsif ($ARGV[0] =~ /--email=/) { $email = (split(/=/, shift @ARGV))[1]; } elsif ($ARGV[0] =~ /--desc=/) { $desc = (split(/=/, shift @ARGV))[1]; } elsif ($ARGV[0] =~ /--configure=(.*)/) { $confopts = $1; shift @ARGV; } elsif (($ARGV[0] eq "--nocvsup") || ($ARGV[0] eq "--nogitpull")) { $nogitpull=1; shift @ARGV; } elsif ($ARGV[0] =~ /--nobuildconf/) { $nobuildconf=1; shift @ARGV; } elsif ($ARGV[0] =~ /--noconfigure/) { $configurebuild=0; shift @ARGV; } elsif ($ARGV[0] =~ /--crosscompile/) { $crosscompile=1; shift @ARGV; } elsif ($ARGV[0] =~ /--runtestopts=/) { $runtestopts = (split(/=/, shift @ARGV, 2))[1]; } else { $CURLDIR=shift @ARGV; $git=0; # a given dir, assume not using git } } # Do the platform-specific stuff here $confheader = 'curl_config.h'; $binext = ''; $libext = '.la'; # .la since both libcurl and libcares are made with libtool if ($^O eq 'MSWin32' || $targetos) { if (!$targetos) { # If no target defined on Win32 lets assume vc $targetos = 'vc'; } if ($targetos =~ /vc/ || $targetos =~ /borland/ || $targetos =~ /watcom/) { $binext = '.exe'; $libext = '.lib'; } elsif ($targetos =~ /mingw/) { $binext = '.exe'; if ($^O eq 'MSWin32') { $libext = '.a'; } } elsif ($targetos =~ /netware/) { $configurebuild = 0; $binext = '.nlm'; if ($^O eq 'MSWin32') { $libext = '.lib'; } else { $libext = '.a'; } } } if (($^O eq 'MSWin32' || $^O eq 'msys') && ($targetos =~ /vc/ || $targetos =~ /mingw32/ || $targetos =~ /borland/ || $targetos =~ /watcom/)) { # Set these things only when building ON Windows and for Win32 platform. # FOR Windows since we might be cross-compiling on another system. Non- # Windows builds still default to configure-style builds with curl_config.h. $configurebuild = 0; $confheader = 'config-win32.h'; } $ENV{LC_ALL}="C" if (($ENV{LC_ALL}) && ($ENV{LC_ALL} !~ /^C$/)); $ENV{LC_CTYPE}="C" if (($ENV{LC_CTYPE}) && ($ENV{LC_CTYPE} !~ /^C$/)); $ENV{LANG}="C"; sub rmtree($) { my $target = $_[0]; if ($^O eq 'MSWin32') { foreach (glob($target)) { s:/:\\:g; system("rd /s /q $_"); } } else { system("rm -rf $target"); } } sub grepfile($$) { my ($target, $fn) = @_; open(F, $fn) or die; while () { if (/$target/) { close(F); return 1; } } close(F); return 0; } sub logit($) { my $text=$_[0]; if ($text) { print "testcurl: $text\n"; } } sub logit_spaced($) { my $text=$_[0]; if ($text) { print "\ntestcurl: $text\n\n"; } } sub mydie($){ my $text=$_[0]; logit "$text"; chdir $pwd; # cd back to the original root dir if ($pwd && $build) { # we have a build directory name, remove the dir logit "removing the $build dir"; rmtree "$pwd/$build"; } if (-r $buildlog) { # we have a build log output file left, remove it logit "removing the $buildlogname file"; unlink "$buildlog"; } logit "ENDING HERE"; # last line logged! exit 1; } sub get_host_triplet { my $triplet; my $configfile = "$pwd/$build/lib/curl_config.h"; if(-f $configfile && -s $configfile && open(LIBCONFIGH, "<$configfile")) { while() { if($_ =~ /^\#define\s+OS\s+"*([^"][^"]*)"*\s*/) { $triplet = $1; last; } } close(LIBCONFIGH); } return $triplet; } if (open(F, "$setupfile")) { while () { if (/(\w+)=(.*)/) { eval "\$$1=$2;"; } } close(F); $infixed=$fixed; } else { $infixed=0; # so that "additional args to configure" works properly first time... } if (!$name) { print "please enter your name\n"; $name = <>; chomp $name; $fixed=1; } if (!$email) { print "please enter your contact email address\n"; $email = <>; chomp $email; $fixed=2; } if (!$desc) { print "please enter a one line system description\n"; $desc = <>; chomp $desc; $fixed=3; } if (!$confopts) { if ($infixed < 4) { print "please enter your additional arguments to configure\n"; print "examples: --with-ssl --enable-debug --enable-ipv6 --with-krb4\n"; $confopts = <>; chomp $confopts; } } if ($fixed < 4) { $fixed=4; open(F, ">$setupfile") or die; print F "name='$name'\n"; print F "email='$email'\n"; print F "desc='$desc'\n"; print F "confopts='$confopts'\n"; print F "notes='$notes'\n"; print F "fixed='$fixed'\n"; close(F); } # Enable picky compiler warnings unless explicitly disabled if (($confopts !~ /--enable-debug/) && ($confopts !~ /--enable-warnings/) && ($confopts !~ /--disable-warnings/)) { $confopts .= " --enable-warnings"; } my $str1066os = 'o' x 1066; # Set timestamp to the UTC this script is running. Its value might # be changed later in the script to the value present in curlver.h $timestamp = scalar(gmtime)." UTC"; logit "STARTING HERE"; # first line logged, for scripts to trigger on logit 'TRANSFER CONTROL ==== 1120 CHAR LINE' . $str1066os . 'LINE_END'; logit "NAME = $name"; logit "EMAIL = $email"; logit "DESC = $desc"; logit "NOTES = $notes"; logit "CONFOPTS = $confopts"; logit "CPPFLAGS = ".$ENV{CPPFLAGS}; logit "CFLAGS = ".$ENV{CFLAGS}; logit "LDFLAGS = ".$ENV{LDFLAGS}; logit "LIBS = ".$ENV{LIBS}; logit "CC = ".$ENV{CC}; logit "TMPDIR = ".$ENV{TMPDIR}; logit "MAKEFLAGS = ".$ENV{MAKEFLAGS}; logit "ACLOCAL_FLAGS = ".$ENV{ACLOCAL_FLAGS}; logit "PKG_CONFIG_PATH = ".$ENV{PKG_CONFIG_PATH}; logit "DYLD_LIBRARY_PATH = ".$ENV{DYLD_LIBRARY_PATH}; logit "LD_LIBRARY_PATH = ".$ENV{LD_LIBRARY_PATH}; logit "LIBRARY_PATH = ".$ENV{LIBRARY_PATH}; logit "SHLIB_PATH = ".$ENV{SHLIB_PATH}; logit "LIBPATH = ".$ENV{LIBPATH}; logit "target = ".$targetos; logit "version = $version"; # script version logit "date = $timestamp"; # When the test build starts $str1066os = undef; # Make $pwd to become the path without newline. We'll use that in order to cut # off that path from all possible logs and error messages etc. $pwd = getcwd(); my $have_embedded_ares = 0; if (-d $CURLDIR) { if ($git && -d "$CURLDIR/.git") { logit "$CURLDIR is verified to be a fine git source dir"; # remove the generated sources to force them to be re-generated each # time we run this test unlink "$CURLDIR/src/tool_hugehelp.c"; # find out if curl source dir has an in-tree c-ares repo $have_embedded_ares = 1 if (-f "$CURLDIR/ares/GIT-INFO"); } elsif (!$git && -f "$CURLDIR/tests/testcurl.pl") { logit "$CURLDIR is verified to be a fine daily source dir"; # find out if curl source dir has an in-tree c-ares extracted tarball $have_embedded_ares = 1 if (-f "$CURLDIR/ares/ares_build.h"); } else { mydie "$CURLDIR is not a daily source dir or checked out from git!" } } $build="build-$$"; $buildlogname="buildlog-$$"; $buildlog="$pwd/$buildlogname"; # remove any previous left-overs rmtree "build-*"; rmtree "buildlog-*"; # this is to remove old build logs that ended up in the wrong dir foreach (glob("$CURLDIR/buildlog-*")) { unlink $_; } # create a dir to build in mkdir $build, 0777; if (-d $build) { logit "build dir $build was created fine"; } else { mydie "failed to create dir $build"; } # get in the curl source tree root chdir $CURLDIR; # Do the git thing, or not... if ($git) { my $gitstat = 0; my @commits; # update quietly to the latest git if($nogitpull) { logit "skipping git pull (--nogitpull)"; } else { logit "run git pull in curl"; system("git pull 2>&1"); $gitstat += $?; logit "failed to update from curl git ($?), continue anyway" if ($?); # Set timestamp to the UTC the git update took place. $timestamp = scalar(gmtime)." UTC" if (!$gitstat); } # get the last 5 commits for show (even if no pull was made) @commits=`git log --pretty=oneline --abbrev-commit -5`; logit "The most recent curl git commits:"; for (@commits) { chomp ($_); logit " $_"; } if (-d "ares/.git") { chdir "ares"; if($nogitpull) { logit "skipping git pull (--nogitpull) in ares"; } else { logit "run git pull in ares"; system("git pull 2>&1"); $gitstat += $?; logit "failed to update from ares git ($?), continue anyway" if ($?); # Set timestamp to the UTC the git update took place. $timestamp = scalar(gmtime)." UTC" if (!$gitstat); } # get the last 5 commits for show (even if no pull was made) @commits=`git log --pretty=oneline --abbrev-commit -5`; logit "The most recent ares git commits:"; for (@commits) { chomp ($_); logit " $_"; } chdir "$pwd/$CURLDIR"; } if($nobuildconf) { logit "told to not run buildconf"; } elsif ($configurebuild) { # remove possible left-overs from the past unlink "configure"; unlink "autom4te.cache"; # generate the build files logit "invoke buildconf"; open(F, "./buildconf 2>&1 |") or die; open(LOG, ">$buildlog") or die; while () { my $ll = $_; # ignore messages pertaining to third party m4 files we don't care next if ($ll =~ /aclocal\/gtk\.m4/); next if ($ll =~ /aclocal\/gtkextra\.m4/); print $ll; print LOG $ll; } close(F); close(LOG); if (grepfile("^buildconf: OK", $buildlog)) { logit "buildconf was successful"; } else { mydie "buildconf was NOT successful"; } } else { logit "buildconf was successful (dummy message)"; } } # Set timestamp to the one in curlver.h if this isn't a git test build. if ((-f "include/curl/curlver.h") && (open(F, ") { chomp; if ($_ =~ /^\#define\s+LIBCURL_TIMESTAMP\s+\"(.+)\".*$/) { my $stampstring = $1; if ($stampstring !~ /DEV/) { $stampstring =~ s/\s+UTC//; $timestamp = $stampstring." UTC"; } last; } } close(F); } # Show timestamp we are using for this test build. logit "timestamp = $timestamp"; if ($configurebuild) { if (-f "configure") { logit "configure created (at least it exists)"; } else { mydie "no configure created/found"; } } else { logit "configure created (dummy message)"; # dummy message to feign success } sub findinpath { my $c; my $e; my $x = ($^O eq 'MSWin32') ? '.exe' : ''; my $s = ($^O eq 'MSWin32') ? ';' : ':'; my $p=$ENV{'PATH'}; my @pa = split($s, $p); for $c (@_) { for $e (@pa) { if( -x "$e/$c$x") { return $c; } } } } my $make = findinpath("gmake", "make", "nmake"); if(!$make) { mydie "Couldn't find make in the PATH"; } # force to 'nmake' for VC builds $make = "nmake" if ($targetos =~ /vc/); # force to 'wmake' for Watcom builds $make = "wmake" if ($targetos =~ /watcom/); logit "going with $make as make"; # change to build dir chdir "$pwd/$build"; if ($configurebuild) { # run configure script print `../$CURLDIR/configure $confopts 2>&1`; if (-f "lib/Makefile") { logit "configure seems to have finished fine"; } else { mydie "configure didn't work"; } } else { logit "copying files to build dir ..."; if (($^O eq 'MSWin32') && ($targetos !~ /netware/)) { system("xcopy /s /q ..\\$CURLDIR ."); system("buildconf.bat"); } elsif ($targetos =~ /netware/) { system("cp -afr ../$CURLDIR/* ."); system("cp -af ../$CURLDIR/Makefile.dist Makefile"); system("$make -i -C lib -f Makefile.netware prebuild"); system("$make -i -C src -f Makefile.netware prebuild"); if (-d "../$CURLDIR/ares") { system("$make -i -C ares -f Makefile.netware prebuild"); } } elsif ($^O eq 'linux') { system("cp -afr ../$CURLDIR/* ."); system("cp -af ../$CURLDIR/Makefile.dist Makefile"); system("cp -af ../$CURLDIR/include/curl/curlbuild.h.dist ./include/curl/curlbuild.h"); system("$make -i -C lib -f Makefile.$targetos prebuild"); system("$make -i -C src -f Makefile.$targetos prebuild"); if (-d "../$CURLDIR/ares") { system("cp -af ../$CURLDIR/ares/ares_build.h.dist ./ares/ares_build.h"); system("$make -i -C ares -f Makefile.$targetos prebuild"); } } } if(-f "./libcurl.pc") { logit_spaced "display libcurl.pc"; if(open(F, "<./libcurl.pc")) { while() { my $ll = $_; print $ll if(($ll !~ /^ *#/) && ($ll !~ /^ *$/)); } close(F); } } if(-f "./include/curl/curlbuild.h") { logit_spaced "display include/curl/curlbuild.h"; if(open(F, "<./include/curl/curlbuild.h")) { while() { my $ll = $_; print $ll if(($ll =~ /^ *# *define *CURL_/) && ($ll !~ /__CURL_CURLBUILD_H/)); } close(F); } } else { mydie "no curlbuild.h created/found"; } logit_spaced "display lib/$confheader"; open(F, "lib/$confheader") or die "lib/$confheader: $!"; while () { print if /^ *#/; } close(F); if (($have_embedded_ares) && (grepfile("^#define USE_ARES", "lib/$confheader"))) { print "\n"; logit "setup to build ares"; if(-f "./ares/libcares.pc") { logit_spaced "display ares/libcares.pc"; if(open(F, "<./ares/libcares.pc")) { while() { my $ll = $_; print $ll if(($ll !~ /^ *#/) && ($ll !~ /^ *$/)); } close(F); } } if(-f "./ares/ares_build.h") { logit_spaced "display ares/ares_build.h"; if(open(F, "<./ares/ares_build.h")) { while() { my $ll = $_; print $ll if(($ll =~ /^ *# *define *CARES_/) && ($ll !~ /__CARES_BUILD_H/)); } close(F); } } else { mydie "no ares_build.h created/found"; } $confheader =~ s/curl/ares/; logit_spaced "display ares/$confheader"; if(open(F, "ares/$confheader")) { while () { print if /^ *#/; } close(F); } print "\n"; logit "build ares"; chdir "ares"; if ($targetos && !$configurebuild) { logit "$make -f Makefile.$targetos"; open(F, "$make -f Makefile.$targetos 2>&1 |") or die; } else { logit "$make"; open(F, "$make 2>&1 |") or die; } while () { s/$pwd//g; print; } close(F); if (-f "libcares$libext") { logit "ares is now built successfully (libcares$libext)"; } else { mydie "ares build failed (libcares$libext)"; } # cd back to the curl build dir chdir "$pwd/$build"; } my $mkcmd = "$make -i" . ($targetos && !$configurebuild ? " $targetos" : ""); logit "$mkcmd"; open(F, "$mkcmd 2>&1 |") or die; while () { s/$pwd//g; print; } close(F); if (-f "lib/libcurl$libext") { logit "libcurl was created fine (libcurl$libext)"; } else { mydie "libcurl was not created (libcurl$libext)"; } if (-f "src/curl$binext") { logit "curl was created fine (curl$binext)"; } else { mydie "curl was not created (curl$binext)"; } if (!$crosscompile || (($extvercmd ne '') && (-x $extvercmd))) { logit "display curl${binext} --version output"; my $cmd = ($extvercmd ne '' ? $extvercmd.' ' : '')."./src/curl${binext} --version|"; open(F, $cmd); while() { # strip CR from output on non-win32 platforms (wine on Linux) s/\r// if ($^O ne 'MSWin32'); print; } close(F); } if ($configurebuild && !$crosscompile) { my $host_triplet = get_host_triplet(); # build example programs for selected build targets if(($host_triplet =~ /([^-]+)-([^-]+)-irix(.*)/) || ($host_triplet =~ /([^-]+)-([^-]+)-aix(.*)/) || ($host_triplet =~ /([^-]+)-([^-]+)-osf(.*)/) || ($host_triplet =~ /([^-]+)-([^-]+)-solaris2(.*)/)) { chdir "$pwd/$build/docs/examples"; logit_spaced "build examples"; open(F, "$make -i 2>&1 |") or die; open(LOG, ">$buildlog") or die; while () { s/$pwd//g; print; print LOG; } close(F); close(LOG); chdir "$pwd/$build"; } # build and run full test suite my $o; if($runtestopts) { $o = "TEST_F=\"$runtestopts\" "; } logit "$make -k ${o}test-full"; open(F, "$make -k ${o}test-full 2>&1 |") or die; open(LOG, ">$buildlog") or die; while () { s/$pwd//g; print; print LOG; } close(F); close(LOG); if (grepfile("^TEST", $buildlog)) { logit "tests were run"; } else { mydie "test suite failure"; } if (grepfile("^TESTFAIL:", $buildlog)) { logit "the tests were not successful"; } else { logit "the tests were successful!"; } } else { if($crosscompile) { my $host_triplet = get_host_triplet(); # build example programs for selected cross-compiles if(($host_triplet =~ /([^-]+)-([^-]+)-mingw(.*)/) || ($host_triplet =~ /([^-]+)-([^-]+)-android(.*)/)) { chdir "$pwd/$build/docs/examples"; logit_spaced "build examples"; open(F, "$make -i 2>&1 |") or die; open(LOG, ">$buildlog") or die; while () { s/$pwd//g; print; print LOG; } close(F); close(LOG); chdir "$pwd/$build"; } # build test harness programs for selected cross-compiles if($host_triplet =~ /([^-]+)-([^-]+)-mingw(.*)/) { chdir "$pwd/$build/tests"; logit_spaced "build test harness"; open(F, "$make -i 2>&1 |") or die; open(LOG, ">$buildlog") or die; while () { s/$pwd//g; print; print LOG; } close(F); close(LOG); chdir "$pwd/$build"; } logit_spaced "cross-compiling, can't run tests"; } # dummy message to feign success print "TESTDONE: 1 tests out of 0 (dummy message)\n"; } # create a tarball if we got that option. if (($mktarball ne '') && (-x $mktarball)) { system($mktarball); } # mydie to cleanup mydie "ending nicely"; curl-7.35.0/tests/tftpserver.pl0000755000175000017500000000571612213173003013403 00000000000000#!/usr/bin/env perl #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2010, 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. # #*************************************************************************** BEGIN { push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'}); push(@INC, "."); } use strict; use warnings; use serverhelp qw( server_pidfilename server_logfilename ); my $verbose = 0; # set to 1 for debugging my $port = 8997; # just a default my $ipvnum = 4; # default IP version of tftp server my $idnum = 1; # dafault tftp server instance number my $proto = 'tftp'; # protocol the tftp server speaks my $pidfile; # tftp server pid file my $logfile; # tftp server log file my $srcdir; my $fork; my $flags = ""; my $path = '.'; my $logdir = $path .'/log'; while(@ARGV) { if($ARGV[0] eq '--pidfile') { if($ARGV[1]) { $pidfile = $ARGV[1]; shift @ARGV; } } elsif($ARGV[0] eq '--logfile') { if($ARGV[1]) { $logfile = $ARGV[1]; shift @ARGV; } } elsif($ARGV[0] eq '--srcdir') { if($ARGV[1]) { $srcdir = $ARGV[1]; shift @ARGV; } } elsif($ARGV[0] eq '--ipv4') { $ipvnum = 4; } elsif($ARGV[0] eq '--ipv6') { $ipvnum = 6; } elsif($ARGV[0] eq '--port') { if($ARGV[1] =~ /^(\d+)$/) { $port = $1; shift @ARGV; } } elsif($ARGV[0] eq '--id') { if($ARGV[1] =~ /^(\d+)$/) { $idnum = $1 if($1 > 0); shift @ARGV; } } elsif($ARGV[0] eq '--verbose') { $verbose = 1; } else { print STDERR "\nWarning: tftpserver.pl unknown parameter: $ARGV[0]\n"; } shift @ARGV; } if(!$srcdir) { $srcdir = $ENV{'srcdir'} || '.'; } if(!$pidfile) { $pidfile = "$path/". server_pidfilename($proto, $ipvnum, $idnum); } if(!$logfile) { $logfile = server_logfilename($logdir, $proto, $ipvnum, $idnum); } $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" "; $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\""; exec("server/tftpd $flags"); curl-7.35.0/tests/unit/0000755000175000017500000000000012272124477011705 500000000000000curl-7.35.0/tests/unit/unit1396.c0000644000175000017500000000620512272122645013271 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curlcheck.h" CURL *hnd; static CURLcode unit_setup(void) { return CURLE_OK; } static void unit_stop(void) { if (hnd) curl_easy_cleanup(hnd); } struct test { const char *in; int inlen; const char *out; int outlen; }; UNITTEST_START { /* unescape, this => that */ const struct test list1[]={ {"%61", 3, "a", 1}, {"%61a", 4, "aa", 2}, {"%61b", 4, "ab", 2}, {"%6 1", 4, "%6 1", 4}, {"%61", 1, "%", 1}, {"%61", 2, "%6", 2}, {"%6%a", 4, "%6%a", 4}, {"%6a", 0, "j", 1}, {"%FF", 0, "\xff", 1}, {"%FF%00%ff", 9, "\xff\x00\xff", 3}, {"%-2", 0, "%-2", 3}, {"%FG", 0, "%FG", 3}, {NULL, 0, NULL, 0} /* end of list marker */ }; /* escape, this => that */ const struct test list2[]={ {"a", 1, "a", 1}, {"/", 1, "%2F", 3}, {"a=b", 3, "a%3Db", 5}, {"a=b", 0, "a%3Db", 5}, {"a=b", 1, "a", 1}, {"a=b", 2, "a%3D", 4}, {"1/./0", 5, "1%2F.%2F0", 9}, {"-._~!#%&", 0, "-._~%21%23%25%26", 16}, {"a", 2, "a%00", 4}, {"a\xff\x01g", 4, "a%FF%01g", 8}, {NULL, 0, NULL, 0} /* end of list marker */ }; int i; hnd = curl_easy_init(); abort_unless(hnd != NULL, "returned NULL!"); for(i=0; list1[i].in; i++) { int outlen; char *out = curl_easy_unescape(hnd, list1[i].in, list1[i].inlen, &outlen); abort_unless(out != NULL, "returned NULL!"); fail_unless(outlen == list1[i].outlen, "wrong output length returned"); fail_unless(!memcmp(out, list1[i].out, list1[i].outlen), "bad output data returned"); printf("curl_easy_unescape test %d DONE\n", i); curl_free(out); } for(i=0; list2[i].in; i++) { int outlen; char *out = curl_easy_escape(hnd, list2[i].in, list2[i].inlen); abort_unless(out != NULL, "returned NULL!"); outlen = (int)strlen(out); fail_unless(outlen == list2[i].outlen, "wrong output length returned"); fail_unless(!memcmp(out, list2[i].out, list2[i].outlen), "bad output data returned"); printf("curl_easy_escape test %d DONE (%s)\n", i, out); curl_free(out); } } UNITTEST_STOP curl-7.35.0/tests/unit/Makefile.inc0000644000175000017500000000275612262353672014047 00000000000000# these files are used in every single unit test program UNITFILES = curlcheck.h \ ../libtest/test.h \ ../libtest/first.c # These are all unit test programs UNITPROGS = unit1300 unit1301 unit1302 unit1303 unit1304 unit1305 unit1307 \ unit1308 unit1309 unit1330 unit1394 unit1395 unit1396 unit1300_SOURCES = unit1300.c $(UNITFILES) unit1300_CPPFLAGS = $(AM_CPPFLAGS) unit1301_SOURCES = unit1301.c $(UNITFILES) unit1301_CPPFLAGS = $(AM_CPPFLAGS) unit1302_SOURCES = unit1302.c $(UNITFILES) unit1302_CPPFLAGS = $(AM_CPPFLAGS) unit1303_SOURCES = unit1303.c $(UNITFILES) unit1303_CPPFLAGS = $(AM_CPPFLAGS) unit1304_SOURCES = unit1304.c $(UNITFILES) unit1304_CPPFLAGS = $(AM_CPPFLAGS) unit1305_SOURCES = unit1305.c $(UNITFILES) unit1305_CPPFLAGS = $(AM_CPPFLAGS) unit1307_SOURCES = unit1307.c $(UNITFILES) unit1307_CPPFLAGS = $(AM_CPPFLAGS) unit1308_SOURCES = unit1308.c $(UNITFILES) unit1308_CPPFLAGS = $(AM_CPPFLAGS) unit1309_SOURCES = unit1309.c $(UNITFILES) unit1309_CPPFLAGS = $(AM_CPPFLAGS) unit1330_SOURCES = unit1330.c $(UNITFILES) unit1330_CPPFLAGS = $(AM_CPPFLAGS) unit1394_SOURCES = unit1394.c $(UNITFILES) unit1394_CPPFLAGS = $(AM_CPPFLAGS) $(LIBMETALINK_CPPFLAGS) unit1394_LDADD = @LIBMETALINK_LIBS@ $(top_builddir)/lib/libcurl.la @LIBCURL_LIBS@ unit1394_LDFLAGS = @LIBMETALINK_LDFLAGS@ $(top_builddir)/src/libcurltool.la unit1394_LIBS = unit1395_SOURCES = unit1395.c $(UNITFILES) unit1395_CPPFLAGS = $(AM_CPPFLAGS) unit1396_SOURCES = unit1396.c $(UNITFILES) unit1396_CPPFLAGS = $(AM_CPPFLAGS) curl-7.35.0/tests/unit/curlcheck.h0000644000175000017500000001035412213173003013724 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "test.h" /* The fail macros mark the current test step as failed, and continue */ #define fail_if(expr, msg) \ if(expr) { \ fprintf(stderr, "%s:%d Assertion '%s' met: %s\n" , \ __FILE__, __LINE__, #expr, msg); \ unitfail++; \ } #define fail_unless(expr, msg) \ if(!(expr)) { \ fprintf(stderr, "%s:%d Assertion '%s' failed: %s\n", \ __FILE__, __LINE__, #expr, msg); \ unitfail++; \ } #define verify_memory(dynamic, check, len) \ if(dynamic && memcmp(dynamic, check, len)) { \ fprintf(stderr, "%s:%d The dynamic string didn't match '%s'\n", \ __FILE__, __LINE__, check); \ unitfail++; \ } /* fail() is for when the test case figured out by itself that a check proved a failure */ #define fail(msg) do { \ fprintf(stderr, "%s:%d test failed: '%s'\n", \ __FILE__, __LINE__, msg); \ unitfail++; \ } WHILE_FALSE /* The abort macros mark the current test step as failed, and exit the test */ #define abort_if(expr, msg) \ if(expr) { \ fprintf(stderr, "%s:%d Abort assertion '%s' met: %s\n" , \ __FILE__, __LINE__, #expr, msg); \ unitfail++; \ goto unit_test_abort; \ } #define abort_unless(expr, msg) \ if(!(expr)) { \ fprintf(stderr, "%s:%d Abort assertion '%s' failed: %s\n", \ __FILE__, __LINE__, #expr, msg); \ unitfail++; \ goto unit_test_abort; \ } #define abort_test(msg) do { \ fprintf(stderr, "%s:%d test aborted: '%s'\n", \ __FILE__, __LINE__, msg); \ unitfail++; \ goto unit_test_abort; \ } WHILE_FALSE extern int unitfail; #define UNITTEST_START \ int test(char *arg) \ { \ (void)arg; \ if (unit_setup()) { \ fail("unit_setup() failure"); \ } else { #define UNITTEST_STOP \ goto unit_test_abort; /* avoid warning */ \ unit_test_abort: \ unit_stop(); \ } \ return unitfail; \ } curl-7.35.0/tests/unit/README0000644000175000017500000000427112213173003012471 00000000000000Unit tests ========== The goal is to add tests for *ALL* functions in libcurl. If functions are too big and complicated, we should split them into smaller and testable ones. Build Unit Tests ================ './configure --enable-debug' is required for the unit tests to build. To enable unit tests, there will be a separate static libcurl built that will be used exclusively for linking unit test programs. Just build everything as normal, and then you can run the unit test cases as well. Run Unit Tests ============== Unit tests are run as part of the regular test suite. If you have built everything to run unit tests, to can do 'make test' at the root level. Or you can 'cd tests' and then invoke individual unit tests with ./runtests.pl NNNN where NNNN is the specific test number. Debug Unit Tests ================ If a specific test fails you will get told. The test case then has output left in the log/ subdirectory, but most importantly you can re-run the test again using gdb by doing ./runtests.pl -g NNNN. That is, add a -g to make it start up gdb and run the same case using that. Write Unit Tests ================ We put tests that focus on an area or a specific function into a single C source file. The source file should be named 'unitNNNN.c' where NNNN is a number that starts with 1300 and you can pick the next free number. You also need a separate file called tests/data/testNNNN (using the same number) that describes your test case. See the test1300 file for inspiration and the tests/FILEFORMAT documentation. For the actual C file, here's a very simple example: ----------------------- start ------------------------------- #include "curlcheck.h" #include "a libcurl header.h" /* from the lib dir */ static void unit_setup( void ) { /* whatever you want done first */ } static void unit_stop( void ) { /* done before shutting down and exiting */ } UNITTEST_START /* here you start doing things and checking that the results are good */ fail_unless( size == 0 , "initial size should be zero" ); fail_if( head == NULL , "head should not be initiated to NULL" ); /* you end the test code like this: */ UNITTEST_STOP ----------------------- end ------------------------------- curl-7.35.0/tests/unit/unit1330.c0000644000175000017500000000233012213173003013235 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curlcheck.h" #include "memdebug.h" static CURLcode unit_setup(void) { return CURLE_OK; } static void unit_stop(void) { } UNITTEST_START char *ptr = malloc(1330); Curl_safefree(ptr); UNITTEST_STOP curl-7.35.0/tests/unit/unit1395.c0000644000175000017500000000447712262353672013306 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curlcheck.h" #include "dotdot.h" #include "memdebug.h" static CURLcode unit_setup(void) { return CURLE_OK; } static void unit_stop(void) { } struct dotdot { const char *input; const char *output; }; UNITTEST_START unsigned int i; int fails=0; struct dotdot pairs[] = { { "/a/b/c/./../../g", "/a/g" }, { "mid/content=5/../6", "mid/6" }, { "/hello/../moo", "/moo" }, { "/1/../1", "/1" }, { "/1/./1", "/1/1" }, { "/1/..", "/" }, { "/1/.", "/1/" }, { "/1/./..", "/" }, { "/1/./../2", "/2" }, { "/hello/1/./../2", "/hello/2" }, { "test/this", "test/this" }, { "test/this/../now", "test/now" }, { "/1../moo../foo", "/1../moo../foo"}, { "/../../moo", "/moo"}, { "/../../moo?andnot/../yay", "/moo?andnot/../yay"}, { "/123?foo=/./&bar=/../", "/123?foo=/./&bar=/../"}, { "/../moo/..?what", "/?what" }, }; for(i=0; i < sizeof(pairs)/sizeof(pairs[0]); i++) { char *out = Curl_dedotdotify((char *)pairs[i].input); if(strcmp(out, pairs[i].output)) { fprintf(stderr, "Test %d: '%s' gave '%s' instead of '%s'\n", i, pairs[i].input, out, pairs[i].output); fail("Test case output mismatched"); fails++; } else fprintf(stderr, "Test %d: OK\n", i); free(out); } return fails; UNITTEST_STOP curl-7.35.0/tests/unit/unit1394.c0000644000175000017500000001057412270035364013272 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curlcheck.h" #include "tool_getparam.h" #include #include #include #include "memdebug.h" /* LAST include file */ static CURLcode unit_setup(void) { return CURLE_OK; } static void unit_stop(void) { } UNITTEST_START const char *values[] = { /* -E parameter */ /* exp. cert name */ /* exp. passphrase */ "foo:bar:baz", "foo", "bar:baz", "foo\\:bar:baz", "foo:bar", "baz", "foo\\\\:bar:baz", "foo\\", "bar:baz", "foo:bar\\:baz", "foo", "bar\\:baz", "foo:bar\\\\:baz", "foo", "bar\\\\:baz", "foo\\bar\\baz", "foo\\bar\\baz", NULL, "foo\\\\bar\\\\baz", "foo\\bar\\baz", NULL, "foo\\", "foo\\", NULL, "foo\\\\", "foo\\", NULL, "foo:bar\\", "foo", "bar\\", "foo:bar\\\\", "foo", "bar\\\\", "foo:bar:", "foo", "bar:", "foo\\::bar\\:", "foo:", "bar\\:", #ifdef WIN32 "c:\\foo:bar:baz", "c:\\foo", "bar:baz", "c:\\foo\\:bar:baz", "c:\\foo:bar", "baz", "c:\\foo\\\\:bar:baz", "c:\\foo\\", "bar:baz", "c:\\foo:bar\\:baz", "c:\\foo", "bar\\:baz", "c:\\foo:bar\\\\:baz", "c:\\foo", "bar\\\\:baz", "c:\\foo\\bar\\baz", "c:\\foo\\bar\\baz", NULL, "c:\\foo\\\\bar\\\\baz", "c:\\foo\\bar\\baz", NULL, "c:\\foo\\", "c:\\foo\\", NULL, "c:\\foo\\\\", "c:\\foo\\", NULL, "c:\\foo:bar\\", "c:\\foo", "bar\\", "c:\\foo:bar\\\\", "c:\\foo", "bar\\\\", "c:\\foo:bar:", "c:\\foo", "bar:", "c:\\foo\\::bar\\:", "c:\\foo:", "bar\\:", #endif NULL, NULL, NULL, }; const char **p; char *certname, *passphrase; for(p = values; *p; p += 3) { parse_cert_parameter(p[0], &certname, &passphrase); if(p[1]) { if(certname) { if(strcmp(p[1], certname)) { printf("expected certname '%s' but got '%s' " "for -E param '%s'\n", p[1], certname, p[0]); fail("assertion failure"); } } else { printf("expected certname '%s' but got NULL " "for -E param '%s'\n", p[1], p[0]); fail("assertion failure"); } } else { if(certname) { printf("expected certname NULL but got '%s' " "for -E param '%s'\n", certname, p[0]); fail("assertion failure"); } } if(p[2]) { if(passphrase) { if(strcmp(p[2], passphrase)) { printf("expected passphrase '%s' but got '%s'" "for -E param '%s'\n", p[2], passphrase, p[0]); fail("assertion failure"); } } else { printf("expected passphrase '%s' but got NULL " "for -E param '%s'\n", p[2], p[0]); fail("assertion failure"); } } else { if(passphrase) { printf("expected passphrase NULL but got '%s' " "for -E param '%s'\n", passphrase, p[0]); fail("assertion failure"); } } if(certname) free(certname); if(passphrase) free(passphrase); } UNITTEST_STOP curl-7.35.0/tests/unit/unit1307.c0000644000175000017500000002774412213173003013261 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curlcheck.h" #include "curl_fnmatch.h" #define MATCH CURL_FNMATCH_MATCH #define NOMATCH CURL_FNMATCH_NOMATCH #define RE_ERR CURL_FNMATCH_FAIL #define MAX_PATTERN_L 100 #define MAX_STRING_L 100 struct testcase { char pattern[MAX_PATTERN_L]; char string[MAX_STRING_L]; int result; }; static const struct testcase tests[] = { /* brackets syntax */ { "\\[", "[", MATCH }, { "[", "[", RE_ERR }, { "[]", "[]", RE_ERR }, { "[][]", "[", MATCH }, { "[][]", "]", MATCH }, { "[[]", "[", MATCH }, { "[[[]", "[", MATCH }, { "[[[[]", "[", MATCH }, { "[[[[]", "[", MATCH }, { "[][[]", "]", MATCH }, { "[][[[]", "[", MATCH }, { "[[]", "]", NOMATCH }, { "[a-z]", "a", MATCH }, { "[a-z]", "A", NOMATCH }, { "?[a-z]", "?Z", NOMATCH }, { "[A-Z]", "C", MATCH }, { "[A-Z]", "c", NOMATCH }, { "[0-9]", "7", MATCH }, { "[7-8]", "7", MATCH }, { "[7-]", "7", MATCH }, { "[7-]", "-", MATCH }, { "[7-]", "[", NOMATCH }, { "[a-bA-F]", "F", MATCH }, { "[a-bA-B9]", "9", MATCH }, { "[a-bA-B98]", "8", MATCH }, { "[a-bA-B98]", "C", NOMATCH }, { "[a-bA-Z9]", "F", MATCH }, { "[a-bA-Z9]ero*", "Zero chance.", MATCH }, { "S[a-][x]opho*", "Saxophone", MATCH }, { "S[a-][x]opho*", "SaXophone", NOMATCH }, { "S[a-][x]*.txt", "S-x.txt", MATCH }, { "[\\a-\\b]", "a", MATCH }, { "[\\a-\\b]", "b", MATCH }, { "[?*[][?*[][?*[]", "?*[", MATCH }, { "[][?*-]", "]", MATCH }, { "[][?*-]", "[", MATCH }, { "[][?*-]", "?", MATCH }, { "[][?*-]", "*", MATCH }, { "[][?*-]", "-", MATCH }, { "[]?*-]", "-", MATCH }, { "?/b/c", "a/b/c", MATCH }, { "^_{}~", "^_{}~", MATCH }, { "!#%+,-./01234567889", "!#%+,-./01234567889", MATCH }, { "PQRSTUVWXYZ]abcdefg", "PQRSTUVWXYZ]abcdefg", MATCH }, { ":;=@ABCDEFGHIJKLMNO", ":;=@ABCDEFGHIJKLMNO", MATCH }, /* negate */ { "[!a]", "b", MATCH }, { "[!a]", "a", NOMATCH }, { "[^a]", "b", MATCH }, { "[^a]", "a", NOMATCH }, { "[^a-z0-9A-Z]", "a", NOMATCH }, { "[^a-z0-9A-Z]", "-", MATCH }, { "curl[!a-z]lib", "curl lib", MATCH }, { "curl[! ]lib", "curl lib", NOMATCH }, { "[! ][ ]", " ", NOMATCH }, { "[! ][ ]", "a ", MATCH }, { "*[^a].t?t", "a.txt", NOMATCH }, { "*[^a].t?t", "ba.txt", NOMATCH }, { "*[^a].t?t", "ab.txt", MATCH }, { "[!?*[]", "?", NOMATCH }, { "[!!]", "!", NOMATCH }, { "[!!]", "x", MATCH }, { "[[:alpha:]]", "a", MATCH }, { "[[:alpha:]]", "9", NOMATCH }, { "[[:alnum:]]", "a", MATCH }, { "[[:alnum:]]", "[", NOMATCH }, { "[[:alnum:]]", "]", NOMATCH }, { "[[:alnum:]]", "9", MATCH }, { "[[:digit:]]", "9", MATCH }, { "[[:xdigit:]]", "9", MATCH }, { "[[:xdigit:]]", "F", MATCH }, { "[[:xdigit:]]", "G", NOMATCH }, { "[[:upper:]]", "U", MATCH }, { "[[:upper:]]", "u", NOMATCH }, { "[[:lower:]]", "l", MATCH }, { "[[:lower:]]", "L", NOMATCH }, { "[[:print:]]", "L", MATCH }, { "[[:print:]]", {'\10'}, NOMATCH }, { "[[:print:]]", {'\10'}, NOMATCH }, { "[[:space:]]", " ", MATCH }, { "[[:space:]]", "x", NOMATCH }, { "[[:graph:]]", " ", NOMATCH }, { "[[:graph:]]", "x", MATCH }, { "[[:blank:]]", {'\t'}, MATCH }, { "[[:blank:]]", {' '}, MATCH }, { "[[:blank:]]", {'\r'}, NOMATCH }, { "[^[:blank:]]", {'\t'}, NOMATCH }, { "[^[:print:]]", {'\10'}, MATCH }, { "[[:lower:]][[:lower:]]", "ll", MATCH }, { "Curl[[:blank:]];-)", "Curl ;-)", MATCH }, { "*[[:blank:]]*", " ", MATCH }, { "*[[:blank:]]*", "", NOMATCH }, { "*[[:blank:]]*", "hi, im_Pavel", MATCH }, /* common using */ { "filename.dat", "filename.dat", MATCH }, { "*curl*", "lets use curl!!", MATCH }, { "filename.txt", "filename.dat", NOMATCH }, { "*.txt", "text.txt", MATCH }, { "*.txt", "a.txt", MATCH }, { "*.txt", ".txt", MATCH }, { "*.txt", "txt", NOMATCH }, { "??.txt", "99.txt", MATCH }, { "??.txt", "a99.txt", NOMATCH }, { "?.???", "a.txt", MATCH }, { "*.???", "somefile.dat", MATCH }, { "*.???", "photo.jpeg", NOMATCH }, { ".*", ".htaccess", MATCH }, { ".*", ".", MATCH }, { ".*", "..", MATCH }, /* many stars => one star */ { "**.txt", "text.txt", MATCH }, { "***.txt", "t.txt", MATCH }, { "****.txt", ".txt", MATCH }, /* empty string or pattern */ { "", "", MATCH } , { "", "hello", NOMATCH }, { "file", "", NOMATCH }, { "?", "", NOMATCH }, { "*", "", MATCH }, { "x", "", NOMATCH }, /* backslash */ { "\\", "\\", RE_ERR }, { "\\\\", "\\", MATCH }, { "\\\\", "\\\\", NOMATCH }, { "\\?", "?", MATCH }, { "\\*", "*", MATCH }, { "?.txt", "?.txt", MATCH }, { "*.txt", "*.txt", MATCH }, { "\\?.txt", "?.txt", MATCH }, { "\\*.txt", "*.txt", MATCH }, { "\\?.txt", "x.txt", NOMATCH }, { "\\*.txt", "x.txt", NOMATCH }, { "\\*\\\\.txt", "*\\.txt", MATCH }, { "*\\**\\?*\\\\*", "cc*cc?cc\\cc*cc", MATCH }, { "*\\**\\?*\\\\*", "cc*cc?cccc", NOMATCH }, { "*\\**\\?*\\\\*", "cc*cc?cc\\cc*cc", MATCH }, { "*\\?*\\**", "cc?c*c", MATCH }, { "*\\?*\\**curl*", "cc?c*curl", MATCH }, { "*\\?*\\**", "cc?cc", NOMATCH }, { "\\\"\\$\\&\\'\\(\\)", "\"$&'()", MATCH }, { "\\*\\?\\[\\\\\\`\\|", "*?[\\`|", MATCH }, { "[\\a\\b]c", "ac", MATCH }, { "[\\a\\b]c", "bc", MATCH }, { "[\\a\\b]d", "bc", NOMATCH }, { "[a-bA-B\\?]", "?", MATCH }, { "cu[a-ab-b\\r]l", "curl", MATCH }, { "[\\a-z]", "c", MATCH }, { "?*?*?.*?*", "abc.c", MATCH }, { "?*?*?.*?*", "abcc", NOMATCH }, { "?*?*?.*?*", "abc.", NOMATCH }, { "?*?*?.*?*", "abc.c++", MATCH }, { "?*?*?.*?*", "abcdef.c++", MATCH }, { "?*?*?.?", "abcdef.c", MATCH }, { "?*?*?.?", "abcdef.cd", NOMATCH }, { "Lindmätarv", "Lindmätarv", MATCH }, { "", "", MATCH } }; static CURLcode unit_setup( void ) { return CURLE_OK; } static void unit_stop( void ) { } UNITTEST_START int testnum = sizeof(tests) / sizeof(struct testcase); int i, rc; for(i = 0; i < testnum; i++) { rc = Curl_fnmatch(NULL, tests[i].pattern, tests[i].string); if(rc != tests[i].result) { printf("Curl_fnmatch(\"%s\", \"%s\") should return %d (returns %d)\n", tests[i].pattern, tests[i].string, tests[i].result, rc); fail("pattern mismatch"); } } UNITTEST_STOP curl-7.35.0/tests/unit/unit1302.c0000644000175000017500000001170112262353672013256 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curlcheck.h" #include "urldata.h" #include "url.h" /* for Curl_safefree */ #include "curl_base64.h" #include "memdebug.h" /* LAST include file */ static struct SessionHandle *data; static CURLcode unit_setup( void ) { data = curl_easy_init(); if(!data) return CURLE_OUT_OF_MEMORY; return CURLE_OK; } static void unit_stop( void ) { curl_easy_cleanup(data); } UNITTEST_START char *output; unsigned char *decoded; size_t size = 0; unsigned char anychar = 'x'; CURLcode rc; rc = Curl_base64_encode(data, "i", 1, &output, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 4, "size should be 4"); verify_memory( output, "aQ==", 4); Curl_safefree(output); rc = Curl_base64_encode(data, "ii", 2, &output, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 4, "size should be 4"); verify_memory( output, "aWk=", 4); Curl_safefree(output); rc = Curl_base64_encode(data, "iii", 3, &output, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 4, "size should be 4"); verify_memory( output, "aWlp", 4); Curl_safefree(output); rc = Curl_base64_encode(data, "iiii", 4, &output, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 8, "size should be 8"); verify_memory( output, "aWlpaQ==", 8); Curl_safefree(output); /* 0 length makes it do strlen() */ rc = Curl_base64_encode(data, "iiii", 0, &output, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 8, "size should be 8"); verify_memory( output, "aWlpaQ==", 8); Curl_safefree(output); rc = Curl_base64_decode("aWlpaQ==", &decoded, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 4, "size should be 4"); verify_memory(decoded, "iiii", 4); Curl_safefree(decoded); rc = Curl_base64_decode("aWlp", &decoded, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 3, "size should be 3"); verify_memory(decoded, "iii", 3); Curl_safefree(decoded); rc = Curl_base64_decode("aWk=", &decoded, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 2, "size should be 2"); verify_memory(decoded, "ii", 2); Curl_safefree(decoded); rc = Curl_base64_decode("aQ==", &decoded, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 1, "size should be 1"); verify_memory(decoded, "i", 2); Curl_safefree(decoded); /* This is illegal input as the data is too short */ size = 1; /* not zero */ decoded = &anychar; /* not NULL */ rc = Curl_base64_decode("aQ", &decoded, &size); fail_unless(rc == CURLE_BAD_CONTENT_ENCODING, "return code should be CURLE_BAD_CONTENT_ENCODING"); fail_unless(size == 0, "size should be 0"); fail_if(decoded, "returned pointer should be NULL"); /* This is illegal input as it contains three padding characters */ size = 1; /* not zero */ decoded = &anychar; /* not NULL */ rc = Curl_base64_decode("a===", &decoded, &size); fail_unless(rc == CURLE_BAD_CONTENT_ENCODING, "return code should be CURLE_BAD_CONTENT_ENCODING"); fail_unless(size == 0, "size should be 0"); fail_if(decoded, "returned pointer should be NULL"); /* This is illegal input as it contains a padding character mid input */ size = 1; /* not zero */ decoded = &anychar; /* not NULL */ rc = Curl_base64_decode("a=Q=", &decoded, &size); fail_unless(rc == CURLE_BAD_CONTENT_ENCODING, "return code should be CURLE_BAD_CONTENT_ENCODING"); fail_unless(size == 0, "size should be 0"); fail_if(decoded, "returned pointer should be NULL"); /* This is garbage input as it contains an illegal base64 character */ size = 1; /* not zero */ decoded = &anychar; /* not NULL */ rc = Curl_base64_decode("a\x1f==", &decoded, &size); fail_unless(rc == CURLE_BAD_CONTENT_ENCODING, "return code should be CURLE_BAD_CONTENT_ENCODING"); fail_unless(size == 0, "size should be 0"); fail_if(decoded, "returned pointer should be NULL"); UNITTEST_STOP curl-7.35.0/tests/unit/unit1304.c0000644000175000017500000001530512272122645013257 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, 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. * ***************************************************************************/ #include "curlcheck.h" #include "netrc.h" #include "memdebug.h" /* LAST include file */ static char *login; static char *password; static char filename[64]; static CURLcode unit_setup(void) { password = strdup(""); login = strdup(""); if (!password || !login) { Curl_safefree(password); Curl_safefree(login); return CURLE_OUT_OF_MEMORY; } return CURLE_OK; } static void unit_stop(void) { Curl_safefree(password); Curl_safefree(login); } UNITTEST_START int result; static const char* const filename1 = "log/netrc1304"; memcpy(filename, filename1, strlen(filename1)); /* * Test a non existent host in our netrc file. */ result = Curl_parsenetrc("test.example.com", &login, &password, filename); fail_unless(result == 1, "Host not found should return 1"); abort_unless(password != NULL, "returned NULL!"); fail_unless(password[0] == 0, "password should not have been changed"); abort_unless(login != NULL, "returned NULL!"); fail_unless(login[0] == 0, "login should not have been changed"); /* * Test a non existent login in our netrc file. */ free(login); login = strdup("me"); abort_unless(login != NULL, "returned NULL!"); result = Curl_parsenetrc("example.com", &login, &password, filename); fail_unless(result == 0, "Host should be found"); abort_unless(password != NULL, "returned NULL!"); fail_unless(password[0] == 0, "password should not have been changed"); abort_unless(login != NULL, "returned NULL!"); fail_unless(strncmp(login, "me", 2) == 0, "login should not have been changed"); /* * Test a non existent login and host in our netrc file. */ free(login); login = strdup("me"); abort_unless(login != NULL, "returned NULL!"); result = Curl_parsenetrc("test.example.com", &login, &password, filename); fail_unless(result == 1, "Host should be found"); abort_unless(password != NULL, "returned NULL!"); fail_unless(password[0] == 0, "password should not have been changed"); abort_unless(login != NULL, "returned NULL!"); fail_unless(strncmp(login, "me", 2) == 0, "login should not have been changed"); /* * Test a non existent login (substring of an existing one) in our * netrc file. */ free(login); login = strdup("admi"); abort_unless(login != NULL, "returned NULL!"); result = Curl_parsenetrc("example.com", &login, &password, filename); fail_unless(result == 0, "Host should be found"); abort_unless(password != NULL, "returned NULL!"); fail_unless(password[0] == 0, "password should not have been changed"); abort_unless(login != NULL, "returned NULL!"); fail_unless(strncmp(login, "admi", 4) == 0, "login should not have been changed"); /* * Test a non existent login (superstring of an existing one) * in our netrc file. */ free(login); login = strdup("adminn"); abort_unless(login != NULL, "returned NULL!"); result = Curl_parsenetrc("example.com", &login, &password, filename); fail_unless(result == 0, "Host should be found"); abort_unless(password != NULL, "returned NULL!"); fail_unless(password[0] == 0, "password should not have been changed"); abort_unless(login != NULL, "returned NULL!"); fail_unless(strncmp(login, "adminn", 6) == 0, "login should not have been changed"); /* * Test for the first existing host in our netrc file * with login[0] = 0. */ free(login); login = strdup(""); abort_unless(login != NULL, "returned NULL!"); result = Curl_parsenetrc("example.com", &login, &password, filename); fail_unless(result == 0, "Host should have been found"); abort_unless(password != NULL, "returned NULL!"); fail_unless(strncmp(password, "passwd", 6) == 0, "password should be 'passwd'"); abort_unless(login != NULL, "returned NULL!"); fail_unless(strncmp(login, "admin", 5) == 0, "login should be 'admin'"); /* * Test for the first existing host in our netrc file * with login[0] != 0. */ free(password); password = strdup(""); abort_unless(password != NULL, "returned NULL!"); result = Curl_parsenetrc("example.com", &login, &password, filename); fail_unless(result == 0, "Host should have been found"); abort_unless(password != NULL, "returned NULL!"); fail_unless(strncmp(password, "passwd", 6) == 0, "password should be 'passwd'"); abort_unless(login != NULL, "returned NULL!"); fail_unless(strncmp(login, "admin", 5) == 0, "login should be 'admin'"); /* * Test for the second existing host in our netrc file * with login[0] = 0. */ free(password); password = strdup(""); abort_unless(password != NULL, "returned NULL!"); free(login); login = strdup(""); abort_unless(login != NULL, "returned NULL!"); result = Curl_parsenetrc("curl.example.com", &login, &password, filename); fail_unless(result == 0, "Host should have been found"); abort_unless(password != NULL, "returned NULL!"); fail_unless(strncmp(password, "none", 4) == 0, "password should be 'none'"); abort_unless(login != NULL, "returned NULL!"); fail_unless(strncmp(login, "none", 4) == 0, "login should be 'none'"); /* * Test for the second existing host in our netrc file * with login[0] != 0. */ free(password); password = strdup(""); abort_unless(password != NULL, "returned NULL!"); result = Curl_parsenetrc("curl.example.com", &login, &password, filename); fail_unless(result == 0, "Host should have been found"); abort_unless(password != NULL, "returned NULL!"); fail_unless(strncmp(password, "none", 4) == 0, "password should be 'none'"); abort_unless(login != NULL, "returned NULL!"); fail_unless(strncmp(login, "none", 4) == 0, "login should be 'none'"); /* TODO: * Test over the size limit password / login! * Test files with a bad format */ UNITTEST_STOP curl-7.35.0/tests/unit/unit1308.c0000644000175000017500000000606212213173003013250 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curlcheck.h" #include static CURLcode unit_setup(void) { return CURLE_OK; } static void unit_stop(void) { } static size_t print_httppost_callback(void *arg, const char *buf, size_t len) { fwrite(buf, len, 1, stdout); (*(size_t *) arg) += len; return len; } UNITTEST_START int rc; struct curl_httppost* post = NULL; struct curl_httppost* last = NULL; size_t total_size = 0; char buffer[] = "test buffer"; rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "name", CURLFORM_COPYCONTENTS, "content", CURLFORM_END); fail_unless(rc == 0, "curl_formadd returned error"); /* after the first curl_formadd when there's a single entry, both pointers should point to the same struct */ fail_unless(post == last, "post and last weren't the same"); rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "htmlcode", CURLFORM_COPYCONTENTS, "", CURLFORM_CONTENTTYPE, "text/html", CURLFORM_END); fail_unless(rc == 0, "curl_formadd returned error"); rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "name_for_ptrcontent", CURLFORM_PTRCONTENTS, buffer, CURLFORM_END); fail_unless(rc == 0, "curl_formadd returned error"); rc = curl_formget(post, &total_size, print_httppost_callback); fail_unless(rc == 0, "curl_formget returned error"); fail_unless(total_size == 486, "curl_formget got wrong size back"); curl_formfree(post); /* start a new formpost with a file upload and formget */ post = last = NULL; rc = curl_formadd(&post, &last, CURLFORM_PTRNAME, "name of file field", CURLFORM_FILE, "log/test-1308", CURLFORM_FILENAME, "custom named file", CURLFORM_END); fail_unless(rc == 0, "curl_formadd returned error"); rc = curl_formget(post, &total_size, print_httppost_callback); fail_unless(rc == 0, "curl_formget returned error"); fail_unless(total_size == 847, "curl_formget got wrong size back"); curl_formfree(post); UNITTEST_STOP curl-7.35.0/tests/unit/unit1309.c0000644000175000017500000000506612213173003013254 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curlcheck.h" #include "splay.h" static CURLcode unit_setup(void) { return CURLE_OK; } static void unit_stop(void) { } static void splayprint(struct Curl_tree * t, int d, char output) { struct Curl_tree *node; int i; int count; if(t == NULL) return; splayprint(t->larger, d+1, output); for(i=0; ikey.tv_sec, (long)t->key.tv_usec, i); } for(count=0, node = t->same; node; node = node->same, count++) ; if(output) { if(count) printf(" [%d more]\n", count); else printf("\n"); } splayprint(t->smaller, d+1, output); } UNITTEST_START /* number of nodes to add to the splay tree */ #define NUM_NODES 50 struct Curl_tree *root; struct Curl_tree nodes[NUM_NODES]; int rc; int i; root = NULL; /* the empty tree */ for(i = 0; i < NUM_NODES; i++) { struct timeval key; key.tv_sec = 0; key.tv_usec = (541*i)%1023; nodes[i].payload = (void *)key.tv_usec; /* for simplicity */ root = Curl_splayinsert(key, root, &nodes[i]); } puts("Result:"); splayprint(root, 0, 1); for(i = 0; i < NUM_NODES; i++) { int rem = (i+7)%NUM_NODES; printf("Tree look:\n"); splayprint(root, 0, 1); printf("remove pointer %d, payload %ld\n", rem, (long)(nodes[rem].payload)); rc = Curl_splayremovebyaddr(root, &nodes[rem], &root); if(rc) { /* failed! */ printf("remove %d failed!\n", rem); fail("remove"); } } UNITTEST_STOP curl-7.35.0/tests/unit/unit1301.c0000644000175000017500000000351112213173003013235 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curlcheck.h" #include "strequal.h" static CURLcode unit_setup( void ) {return CURLE_OK;} static void unit_stop( void ) {} UNITTEST_START int rc; rc = curl_strequal("iii", "III"); fail_unless( rc != 0 , "return code should be zero" ); rc = curl_strequal("iiia", "III"); fail_unless( rc == 0 , "return code should be zero" ); rc = curl_strequal("iii", "IIIa"); fail_unless( rc == 0 , "return code should be zero" ); rc = curl_strequal("iiiA", "IIIa"); fail_unless( rc != 0 , "return code should be non-zero" ); rc = curl_strnequal("iii", "III", 3); fail_unless( rc != 0 , "return code should be non-zero" ); rc = curl_strnequal("iiiABC", "IIIcba", 3); fail_unless( rc != 0 , "return code should be non-zero" ); rc = curl_strnequal("ii", "II", 3); fail_unless( rc != 0 , "return code should be non-zero" ); UNITTEST_STOP curl-7.35.0/tests/unit/unit1305.c0000644000175000017500000000643412270035364013262 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curlcheck.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #define ENABLE_CURLX_PRINTF #include "curlx.h" #include "hash.h" #include "hostip.h" #include "memdebug.h" /* LAST include file */ static struct SessionHandle *data; static struct curl_hash *hp; static char *data_key; static struct Curl_dns_entry *data_node; static CURLcode unit_setup( void ) { data = curl_easy_init(); if (!data) return CURLE_OUT_OF_MEMORY; hp = Curl_mk_dnscache(); if(!hp) { curl_easy_cleanup(data); curl_global_cleanup(); return CURLE_OUT_OF_MEMORY; } return CURLE_OK; } static void unit_stop( void ) { if (data_node) { Curl_freeaddrinfo(data_node->addr); free(data_node); } if (data_key) free(data_key); Curl_hash_destroy(hp); curl_easy_cleanup(data); curl_global_cleanup(); } static Curl_addrinfo *fake_ai(void) { static Curl_addrinfo *ai; int ss_size; ss_size = sizeof (struct sockaddr_in); if((ai = calloc(1, sizeof(Curl_addrinfo))) == NULL) return NULL; if((ai->ai_canonname = strdup("dummy")) == NULL) { free(ai); return NULL; } if((ai->ai_addr = calloc(1, ss_size)) == NULL) { free(ai->ai_canonname); free(ai); return NULL; } ai->ai_family = AF_INET; ai->ai_addrlen = ss_size; return ai; } static CURLcode create_node(void) { data_key = aprintf("%s:%d", "dummy", 0); if (!data_key) return CURLE_OUT_OF_MEMORY; data_node = calloc(1, sizeof(struct Curl_dns_entry)); if (!data_node) return CURLE_OUT_OF_MEMORY; data_node->addr = fake_ai(); if (!data_node->addr) return CURLE_OUT_OF_MEMORY; return CURLE_OK; } UNITTEST_START struct Curl_dns_entry *nodep; size_t key_len; /* Test 1305 exits without adding anything to the hash */ if (strcmp(arg, "1305") != 0) { CURLcode rc = create_node(); abort_unless(rc == CURLE_OK, "data node creation failed"); key_len = strlen(data_key); nodep = Curl_hash_add(hp, data_key, key_len+1, data_node); abort_unless(nodep, "insertion into hash failed"); /* Freeing will now be done by Curl_hash_destroy */ data_node = NULL; /* To do: test retrieval, deletion, edge conditions */ } UNITTEST_STOP curl-7.35.0/tests/unit/Makefile.am0000644000175000017500000000606512262353672013670 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # ########################################################################### AUTOMAKE_OPTIONS = foreign nostdinc # Specify our include paths here, and do it relative to $(top_srcdir) and # $(top_builddir), to ensure that these paths which belong to the library # being currently built and tested are searched before the library which # might possibly already be installed in the system. # # $(top_builddir)/include/curl for generated curlbuild.h included from curl.h # $(top_builddir)/include for generated curlbuild.h inc. from lib/curl_setup.h # $(top_srcdir)/include is for libcurl's external include files # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files # $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file # $(top_srcdir)/ares is for in-tree c-ares's external include files if USE_EMBEDDED_ARES AM_CPPFLAGS = -I$(top_builddir)/include/curl \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/tests/libtest \ -I$(top_builddir)/ares \ -I$(top_srcdir)/ares else AM_CPPFLAGS = -I$(top_builddir)/include/curl \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/tests/libtest endif EXTRA_DIST = Makefile.inc # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) LDADD = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la \ @LDFLAGS@ @LIBCURL_LIBS@ DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la AM_CPPFLAGS += -DCURL_STATICLIB -DUNITTESTS # Makefile.inc provides neat definitions include Makefile.inc if BUILD_UNITTESTS noinst_PROGRAMS = $(UNITPROGS) else noinst_PROGRAMS = endif curl-7.35.0/tests/unit/Makefile.in0000644000175000017500000025001112272122670013662 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # these files are used in every single unit test program VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.inc $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/mkinstalldirs \ $(top_srcdir)/depcomp README @BUILD_UNITTESTS_TRUE@noinst_PROGRAMS = $(am__EXEEXT_1) subdir = tests/unit ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \ $(top_srcdir)/m4/curl-confopts.m4 \ $(top_srcdir)/m4/curl-functions.m4 \ $(top_srcdir)/m4/curl-openssl.m4 \ $(top_srcdir)/m4/curl-override.m4 \ $(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/xc-am-iface.m4 \ $(top_srcdir)/m4/xc-cc-check.m4 \ $(top_srcdir)/m4/xc-lt-iface.m4 \ $(top_srcdir)/m4/xc-translit.m4 \ $(top_srcdir)/m4/xc-val-flgs.m4 \ $(top_srcdir)/m4/zz40-xc-ovr.m4 \ $(top_srcdir)/m4/zz50-xc-ovr.m4 \ $(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \ $(top_builddir)/include/curl/curlbuild.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = unit1300$(EXEEXT) unit1301$(EXEEXT) unit1302$(EXEEXT) \ unit1303$(EXEEXT) unit1304$(EXEEXT) unit1305$(EXEEXT) \ unit1307$(EXEEXT) unit1308$(EXEEXT) unit1309$(EXEEXT) \ unit1330$(EXEEXT) unit1394$(EXEEXT) unit1395$(EXEEXT) \ unit1396$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am__objects_1 = ../libtest/unit1300-first.$(OBJEXT) am_unit1300_OBJECTS = unit1300-unit1300.$(OBJEXT) $(am__objects_1) unit1300_OBJECTS = $(am_unit1300_OBJECTS) unit1300_LDADD = $(LDADD) unit1300_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am__objects_2 = ../libtest/unit1301-first.$(OBJEXT) am_unit1301_OBJECTS = unit1301-unit1301.$(OBJEXT) $(am__objects_2) unit1301_OBJECTS = $(am_unit1301_OBJECTS) unit1301_LDADD = $(LDADD) unit1301_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la am__objects_3 = ../libtest/unit1302-first.$(OBJEXT) am_unit1302_OBJECTS = unit1302-unit1302.$(OBJEXT) $(am__objects_3) unit1302_OBJECTS = $(am_unit1302_OBJECTS) unit1302_LDADD = $(LDADD) unit1302_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la am__objects_4 = ../libtest/unit1303-first.$(OBJEXT) am_unit1303_OBJECTS = unit1303-unit1303.$(OBJEXT) $(am__objects_4) unit1303_OBJECTS = $(am_unit1303_OBJECTS) unit1303_LDADD = $(LDADD) unit1303_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la am__objects_5 = ../libtest/unit1304-first.$(OBJEXT) am_unit1304_OBJECTS = unit1304-unit1304.$(OBJEXT) $(am__objects_5) unit1304_OBJECTS = $(am_unit1304_OBJECTS) unit1304_LDADD = $(LDADD) unit1304_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la am__objects_6 = ../libtest/unit1305-first.$(OBJEXT) am_unit1305_OBJECTS = unit1305-unit1305.$(OBJEXT) $(am__objects_6) unit1305_OBJECTS = $(am_unit1305_OBJECTS) unit1305_LDADD = $(LDADD) unit1305_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la am__objects_7 = ../libtest/unit1307-first.$(OBJEXT) am_unit1307_OBJECTS = unit1307-unit1307.$(OBJEXT) $(am__objects_7) unit1307_OBJECTS = $(am_unit1307_OBJECTS) unit1307_LDADD = $(LDADD) unit1307_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la am__objects_8 = ../libtest/unit1308-first.$(OBJEXT) am_unit1308_OBJECTS = unit1308-unit1308.$(OBJEXT) $(am__objects_8) unit1308_OBJECTS = $(am_unit1308_OBJECTS) unit1308_LDADD = $(LDADD) unit1308_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la am__objects_9 = ../libtest/unit1309-first.$(OBJEXT) am_unit1309_OBJECTS = unit1309-unit1309.$(OBJEXT) $(am__objects_9) unit1309_OBJECTS = $(am_unit1309_OBJECTS) unit1309_LDADD = $(LDADD) unit1309_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la am__objects_10 = ../libtest/unit1330-first.$(OBJEXT) am_unit1330_OBJECTS = unit1330-unit1330.$(OBJEXT) $(am__objects_10) unit1330_OBJECTS = $(am_unit1330_OBJECTS) unit1330_LDADD = $(LDADD) unit1330_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la am__objects_11 = ../libtest/unit1394-first.$(OBJEXT) am_unit1394_OBJECTS = unit1394-unit1394.$(OBJEXT) $(am__objects_11) unit1394_OBJECTS = $(am_unit1394_OBJECTS) unit1394_DEPENDENCIES = $(top_builddir)/lib/libcurl.la unit1394_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(unit1394_LDFLAGS) $(LDFLAGS) -o $@ am__objects_12 = ../libtest/unit1395-first.$(OBJEXT) am_unit1395_OBJECTS = unit1395-unit1395.$(OBJEXT) $(am__objects_12) unit1395_OBJECTS = $(am_unit1395_OBJECTS) unit1395_LDADD = $(LDADD) unit1395_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la am__objects_13 = ../libtest/unit1396-first.$(OBJEXT) am_unit1396_OBJECTS = unit1396-unit1396.$(OBJEXT) $(am__objects_13) unit1396_OBJECTS = $(am_unit1396_OBJECTS) unit1396_LDADD = $(LDADD) unit1396_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(unit1300_SOURCES) $(unit1301_SOURCES) $(unit1302_SOURCES) \ $(unit1303_SOURCES) $(unit1304_SOURCES) $(unit1305_SOURCES) \ $(unit1307_SOURCES) $(unit1308_SOURCES) $(unit1309_SOURCES) \ $(unit1330_SOURCES) $(unit1394_SOURCES) $(unit1395_SOURCES) \ $(unit1396_SOURCES) DIST_SOURCES = $(unit1300_SOURCES) $(unit1301_SOURCES) \ $(unit1302_SOURCES) $(unit1303_SOURCES) $(unit1304_SOURCES) \ $(unit1305_SOURCES) $(unit1307_SOURCES) $(unit1308_SOURCES) \ $(unit1309_SOURCES) $(unit1330_SOURCES) $(unit1394_SOURCES) \ $(unit1395_SOURCES) $(unit1396_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@ CURLVERSION = @CURLVERSION@ CURL_CA_BUNDLE = @CURL_CA_BUNDLE@ CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@ CURL_DISABLE_DICT = @CURL_DISABLE_DICT@ CURL_DISABLE_FILE = @CURL_DISABLE_FILE@ CURL_DISABLE_FTP = @CURL_DISABLE_FTP@ CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@ CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@ CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@ CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@ CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@ CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@ CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@ CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@ CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@ CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@ CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@ CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@ CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@ CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_SHARED = @ENABLE_SHARED@ ENABLE_STATIC = @ENABLE_STATIC@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@ HAVE_LDAP_SSL = @HAVE_LDAP_SSL@ HAVE_LIBZ = @HAVE_LIBZ@ HAVE_SSLEAY_SRP = @HAVE_SSLEAY_SRP@ IDN_ENABLED = @IDN_ENABLED@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IPV6_ENABLED = @IPV6_ENABLED@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@ LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@ LIBMETALINK_LIBS = @LIBMETALINK_LIBS@ LIBOBJS = @LIBOBJS@ # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANOPT = @MANOPT@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NROFF = @NROFF@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGADD_NAME = @PKGADD_NAME@ PKGADD_PKG = @PKGADD_PKG@ PKGADD_VENDOR = @PKGADD_VENDOR@ PKGCONFIG = @PKGCONFIG@ RANDOM_FILE = @RANDOM_FILE@ RANLIB = @RANLIB@ REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_ENABLED = @SSL_ENABLED@ STRIP = @STRIP@ SUPPORT_FEATURES = @SUPPORT_FEATURES@ SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@ USE_ARES = @USE_ARES@ USE_AXTLS = @USE_AXTLS@ USE_CYASSL = @USE_CYASSL@ USE_DARWINSSL = @USE_DARWINSSL@ USE_GNUTLS = @USE_GNUTLS@ USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@ USE_LIBRTMP = @USE_LIBRTMP@ USE_LIBSSH2 = @USE_LIBSSH2@ USE_NGHTTP2 = @USE_NGHTTP2@ USE_NSS = @USE_NSS@ USE_OPENLDAP = @USE_OPENLDAP@ USE_POLARSSL = @USE_POLARSSL@ USE_SCHANNEL = @USE_SCHANNEL@ USE_SSLEAY = @USE_SSLEAY@ USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@ VERSION = @VERSION@ VERSIONNUM = @VERSIONNUM@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libext = @libext@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # ########################################################################### AUTOMAKE_OPTIONS = foreign nostdinc @USE_EMBEDDED_ARES_FALSE@AM_CPPFLAGS = -I$(top_builddir)/include/curl \ @USE_EMBEDDED_ARES_FALSE@ -I$(top_builddir)/include \ @USE_EMBEDDED_ARES_FALSE@ -I$(top_srcdir)/include \ @USE_EMBEDDED_ARES_FALSE@ -I$(top_builddir)/lib \ @USE_EMBEDDED_ARES_FALSE@ -I$(top_srcdir)/lib \ @USE_EMBEDDED_ARES_FALSE@ -I$(top_srcdir)/src \ @USE_EMBEDDED_ARES_FALSE@ -I$(top_srcdir)/tests/libtest \ @USE_EMBEDDED_ARES_FALSE@ -DCURL_STATICLIB -DUNITTESTS # Specify our include paths here, and do it relative to $(top_srcdir) and # $(top_builddir), to ensure that these paths which belong to the library # being currently built and tested are searched before the library which # might possibly already be installed in the system. # # $(top_builddir)/include/curl for generated curlbuild.h included from curl.h # $(top_builddir)/include for generated curlbuild.h inc. from lib/curl_setup.h # $(top_srcdir)/include is for libcurl's external include files # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files # $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file # $(top_srcdir)/ares is for in-tree c-ares's external include files @USE_EMBEDDED_ARES_TRUE@AM_CPPFLAGS = -I$(top_builddir)/include/curl \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_builddir)/include \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/include \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_builddir)/lib \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/lib \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/src \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/tests/libtest \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_builddir)/ares \ @USE_EMBEDDED_ARES_TRUE@ -I$(top_srcdir)/ares -DCURL_STATICLIB \ @USE_EMBEDDED_ARES_TRUE@ -DUNITTESTS EXTRA_DIST = Makefile.inc LDADD = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la \ @LDFLAGS@ @LIBCURL_LIBS@ DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la UNITFILES = curlcheck.h \ ../libtest/test.h \ ../libtest/first.c # These are all unit test programs UNITPROGS = unit1300 unit1301 unit1302 unit1303 unit1304 unit1305 unit1307 \ unit1308 unit1309 unit1330 unit1394 unit1395 unit1396 unit1300_SOURCES = unit1300.c $(UNITFILES) unit1300_CPPFLAGS = $(AM_CPPFLAGS) unit1301_SOURCES = unit1301.c $(UNITFILES) unit1301_CPPFLAGS = $(AM_CPPFLAGS) unit1302_SOURCES = unit1302.c $(UNITFILES) unit1302_CPPFLAGS = $(AM_CPPFLAGS) unit1303_SOURCES = unit1303.c $(UNITFILES) unit1303_CPPFLAGS = $(AM_CPPFLAGS) unit1304_SOURCES = unit1304.c $(UNITFILES) unit1304_CPPFLAGS = $(AM_CPPFLAGS) unit1305_SOURCES = unit1305.c $(UNITFILES) unit1305_CPPFLAGS = $(AM_CPPFLAGS) unit1307_SOURCES = unit1307.c $(UNITFILES) unit1307_CPPFLAGS = $(AM_CPPFLAGS) unit1308_SOURCES = unit1308.c $(UNITFILES) unit1308_CPPFLAGS = $(AM_CPPFLAGS) unit1309_SOURCES = unit1309.c $(UNITFILES) unit1309_CPPFLAGS = $(AM_CPPFLAGS) unit1330_SOURCES = unit1330.c $(UNITFILES) unit1330_CPPFLAGS = $(AM_CPPFLAGS) unit1394_SOURCES = unit1394.c $(UNITFILES) unit1394_CPPFLAGS = $(AM_CPPFLAGS) $(LIBMETALINK_CPPFLAGS) unit1394_LDADD = @LIBMETALINK_LIBS@ $(top_builddir)/lib/libcurl.la @LIBCURL_LIBS@ unit1394_LDFLAGS = @LIBMETALINK_LDFLAGS@ $(top_builddir)/src/libcurltool.la unit1394_LIBS = unit1395_SOURCES = unit1395.c $(UNITFILES) unit1395_CPPFLAGS = $(AM_CPPFLAGS) unit1396_SOURCES = unit1396.c $(UNITFILES) unit1396_CPPFLAGS = $(AM_CPPFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Makefile.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/unit/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/unit/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(srcdir)/Makefile.inc: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../libtest/$(am__dirstamp): @$(MKDIR_P) ../libtest @: > ../libtest/$(am__dirstamp) ../libtest/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../libtest/$(DEPDIR) @: > ../libtest/$(DEPDIR)/$(am__dirstamp) ../libtest/unit1300-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ ../libtest/$(DEPDIR)/$(am__dirstamp) unit1300$(EXEEXT): $(unit1300_OBJECTS) $(unit1300_DEPENDENCIES) $(EXTRA_unit1300_DEPENDENCIES) @rm -f unit1300$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unit1300_OBJECTS) $(unit1300_LDADD) $(LIBS) ../libtest/unit1301-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ ../libtest/$(DEPDIR)/$(am__dirstamp) unit1301$(EXEEXT): $(unit1301_OBJECTS) $(unit1301_DEPENDENCIES) $(EXTRA_unit1301_DEPENDENCIES) @rm -f unit1301$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unit1301_OBJECTS) $(unit1301_LDADD) $(LIBS) ../libtest/unit1302-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ ../libtest/$(DEPDIR)/$(am__dirstamp) unit1302$(EXEEXT): $(unit1302_OBJECTS) $(unit1302_DEPENDENCIES) $(EXTRA_unit1302_DEPENDENCIES) @rm -f unit1302$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unit1302_OBJECTS) $(unit1302_LDADD) $(LIBS) ../libtest/unit1303-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ ../libtest/$(DEPDIR)/$(am__dirstamp) unit1303$(EXEEXT): $(unit1303_OBJECTS) $(unit1303_DEPENDENCIES) $(EXTRA_unit1303_DEPENDENCIES) @rm -f unit1303$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unit1303_OBJECTS) $(unit1303_LDADD) $(LIBS) ../libtest/unit1304-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ ../libtest/$(DEPDIR)/$(am__dirstamp) unit1304$(EXEEXT): $(unit1304_OBJECTS) $(unit1304_DEPENDENCIES) $(EXTRA_unit1304_DEPENDENCIES) @rm -f unit1304$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unit1304_OBJECTS) $(unit1304_LDADD) $(LIBS) ../libtest/unit1305-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ ../libtest/$(DEPDIR)/$(am__dirstamp) unit1305$(EXEEXT): $(unit1305_OBJECTS) $(unit1305_DEPENDENCIES) $(EXTRA_unit1305_DEPENDENCIES) @rm -f unit1305$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unit1305_OBJECTS) $(unit1305_LDADD) $(LIBS) ../libtest/unit1307-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ ../libtest/$(DEPDIR)/$(am__dirstamp) unit1307$(EXEEXT): $(unit1307_OBJECTS) $(unit1307_DEPENDENCIES) $(EXTRA_unit1307_DEPENDENCIES) @rm -f unit1307$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unit1307_OBJECTS) $(unit1307_LDADD) $(LIBS) ../libtest/unit1308-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ ../libtest/$(DEPDIR)/$(am__dirstamp) unit1308$(EXEEXT): $(unit1308_OBJECTS) $(unit1308_DEPENDENCIES) $(EXTRA_unit1308_DEPENDENCIES) @rm -f unit1308$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unit1308_OBJECTS) $(unit1308_LDADD) $(LIBS) ../libtest/unit1309-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ ../libtest/$(DEPDIR)/$(am__dirstamp) unit1309$(EXEEXT): $(unit1309_OBJECTS) $(unit1309_DEPENDENCIES) $(EXTRA_unit1309_DEPENDENCIES) @rm -f unit1309$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unit1309_OBJECTS) $(unit1309_LDADD) $(LIBS) ../libtest/unit1330-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ ../libtest/$(DEPDIR)/$(am__dirstamp) unit1330$(EXEEXT): $(unit1330_OBJECTS) $(unit1330_DEPENDENCIES) $(EXTRA_unit1330_DEPENDENCIES) @rm -f unit1330$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unit1330_OBJECTS) $(unit1330_LDADD) $(LIBS) ../libtest/unit1394-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ ../libtest/$(DEPDIR)/$(am__dirstamp) unit1394$(EXEEXT): $(unit1394_OBJECTS) $(unit1394_DEPENDENCIES) $(EXTRA_unit1394_DEPENDENCIES) @rm -f unit1394$(EXEEXT) $(AM_V_CCLD)$(unit1394_LINK) $(unit1394_OBJECTS) $(unit1394_LDADD) $(LIBS) ../libtest/unit1395-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ ../libtest/$(DEPDIR)/$(am__dirstamp) unit1395$(EXEEXT): $(unit1395_OBJECTS) $(unit1395_DEPENDENCIES) $(EXTRA_unit1395_DEPENDENCIES) @rm -f unit1395$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unit1395_OBJECTS) $(unit1395_LDADD) $(LIBS) ../libtest/unit1396-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ ../libtest/$(DEPDIR)/$(am__dirstamp) unit1396$(EXEEXT): $(unit1396_OBJECTS) $(unit1396_DEPENDENCIES) $(EXTRA_unit1396_DEPENDENCIES) @rm -f unit1396$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unit1396_OBJECTS) $(unit1396_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../libtest/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1300-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1301-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1302-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1303-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1304-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1305-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1307-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1308-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1309-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1330-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1394-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1395-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1396-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1300-unit1300.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1301-unit1301.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1302-unit1302.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1303-unit1303.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1304-unit1304.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1305-unit1305.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1307-unit1307.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1308-unit1308.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1309-unit1309.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1330-unit1330.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1394-unit1394.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1395-unit1395.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1396-unit1396.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< unit1300-unit1300.o: unit1300.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1300_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1300-unit1300.o -MD -MP -MF $(DEPDIR)/unit1300-unit1300.Tpo -c -o unit1300-unit1300.o `test -f 'unit1300.c' || echo '$(srcdir)/'`unit1300.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1300-unit1300.Tpo $(DEPDIR)/unit1300-unit1300.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1300.c' object='unit1300-unit1300.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1300_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1300-unit1300.o `test -f 'unit1300.c' || echo '$(srcdir)/'`unit1300.c unit1300-unit1300.obj: unit1300.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1300_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1300-unit1300.obj -MD -MP -MF $(DEPDIR)/unit1300-unit1300.Tpo -c -o unit1300-unit1300.obj `if test -f 'unit1300.c'; then $(CYGPATH_W) 'unit1300.c'; else $(CYGPATH_W) '$(srcdir)/unit1300.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1300-unit1300.Tpo $(DEPDIR)/unit1300-unit1300.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1300.c' object='unit1300-unit1300.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1300_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1300-unit1300.obj `if test -f 'unit1300.c'; then $(CYGPATH_W) 'unit1300.c'; else $(CYGPATH_W) '$(srcdir)/unit1300.c'; fi` ../libtest/unit1300-first.o: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1300_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1300-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1300-first.Tpo -c -o ../libtest/unit1300-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1300-first.Tpo ../libtest/$(DEPDIR)/unit1300-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1300-first.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1300_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1300-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c ../libtest/unit1300-first.obj: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1300_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1300-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1300-first.Tpo -c -o ../libtest/unit1300-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1300-first.Tpo ../libtest/$(DEPDIR)/unit1300-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1300-first.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1300_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1300-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` unit1301-unit1301.o: unit1301.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1301_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1301-unit1301.o -MD -MP -MF $(DEPDIR)/unit1301-unit1301.Tpo -c -o unit1301-unit1301.o `test -f 'unit1301.c' || echo '$(srcdir)/'`unit1301.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1301-unit1301.Tpo $(DEPDIR)/unit1301-unit1301.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1301.c' object='unit1301-unit1301.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1301_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1301-unit1301.o `test -f 'unit1301.c' || echo '$(srcdir)/'`unit1301.c unit1301-unit1301.obj: unit1301.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1301_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1301-unit1301.obj -MD -MP -MF $(DEPDIR)/unit1301-unit1301.Tpo -c -o unit1301-unit1301.obj `if test -f 'unit1301.c'; then $(CYGPATH_W) 'unit1301.c'; else $(CYGPATH_W) '$(srcdir)/unit1301.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1301-unit1301.Tpo $(DEPDIR)/unit1301-unit1301.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1301.c' object='unit1301-unit1301.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1301_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1301-unit1301.obj `if test -f 'unit1301.c'; then $(CYGPATH_W) 'unit1301.c'; else $(CYGPATH_W) '$(srcdir)/unit1301.c'; fi` ../libtest/unit1301-first.o: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1301_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1301-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1301-first.Tpo -c -o ../libtest/unit1301-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1301-first.Tpo ../libtest/$(DEPDIR)/unit1301-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1301-first.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1301_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1301-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c ../libtest/unit1301-first.obj: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1301_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1301-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1301-first.Tpo -c -o ../libtest/unit1301-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1301-first.Tpo ../libtest/$(DEPDIR)/unit1301-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1301-first.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1301_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1301-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` unit1302-unit1302.o: unit1302.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1302_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1302-unit1302.o -MD -MP -MF $(DEPDIR)/unit1302-unit1302.Tpo -c -o unit1302-unit1302.o `test -f 'unit1302.c' || echo '$(srcdir)/'`unit1302.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1302-unit1302.Tpo $(DEPDIR)/unit1302-unit1302.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1302.c' object='unit1302-unit1302.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1302_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1302-unit1302.o `test -f 'unit1302.c' || echo '$(srcdir)/'`unit1302.c unit1302-unit1302.obj: unit1302.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1302_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1302-unit1302.obj -MD -MP -MF $(DEPDIR)/unit1302-unit1302.Tpo -c -o unit1302-unit1302.obj `if test -f 'unit1302.c'; then $(CYGPATH_W) 'unit1302.c'; else $(CYGPATH_W) '$(srcdir)/unit1302.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1302-unit1302.Tpo $(DEPDIR)/unit1302-unit1302.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1302.c' object='unit1302-unit1302.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1302_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1302-unit1302.obj `if test -f 'unit1302.c'; then $(CYGPATH_W) 'unit1302.c'; else $(CYGPATH_W) '$(srcdir)/unit1302.c'; fi` ../libtest/unit1302-first.o: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1302_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1302-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1302-first.Tpo -c -o ../libtest/unit1302-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1302-first.Tpo ../libtest/$(DEPDIR)/unit1302-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1302-first.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1302_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1302-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c ../libtest/unit1302-first.obj: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1302_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1302-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1302-first.Tpo -c -o ../libtest/unit1302-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1302-first.Tpo ../libtest/$(DEPDIR)/unit1302-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1302-first.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1302_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1302-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` unit1303-unit1303.o: unit1303.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1303_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1303-unit1303.o -MD -MP -MF $(DEPDIR)/unit1303-unit1303.Tpo -c -o unit1303-unit1303.o `test -f 'unit1303.c' || echo '$(srcdir)/'`unit1303.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1303-unit1303.Tpo $(DEPDIR)/unit1303-unit1303.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1303.c' object='unit1303-unit1303.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1303_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1303-unit1303.o `test -f 'unit1303.c' || echo '$(srcdir)/'`unit1303.c unit1303-unit1303.obj: unit1303.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1303_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1303-unit1303.obj -MD -MP -MF $(DEPDIR)/unit1303-unit1303.Tpo -c -o unit1303-unit1303.obj `if test -f 'unit1303.c'; then $(CYGPATH_W) 'unit1303.c'; else $(CYGPATH_W) '$(srcdir)/unit1303.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1303-unit1303.Tpo $(DEPDIR)/unit1303-unit1303.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1303.c' object='unit1303-unit1303.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1303_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1303-unit1303.obj `if test -f 'unit1303.c'; then $(CYGPATH_W) 'unit1303.c'; else $(CYGPATH_W) '$(srcdir)/unit1303.c'; fi` ../libtest/unit1303-first.o: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1303_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1303-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1303-first.Tpo -c -o ../libtest/unit1303-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1303-first.Tpo ../libtest/$(DEPDIR)/unit1303-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1303-first.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1303_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1303-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c ../libtest/unit1303-first.obj: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1303_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1303-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1303-first.Tpo -c -o ../libtest/unit1303-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1303-first.Tpo ../libtest/$(DEPDIR)/unit1303-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1303-first.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1303_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1303-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` unit1304-unit1304.o: unit1304.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1304_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1304-unit1304.o -MD -MP -MF $(DEPDIR)/unit1304-unit1304.Tpo -c -o unit1304-unit1304.o `test -f 'unit1304.c' || echo '$(srcdir)/'`unit1304.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1304-unit1304.Tpo $(DEPDIR)/unit1304-unit1304.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1304.c' object='unit1304-unit1304.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1304_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1304-unit1304.o `test -f 'unit1304.c' || echo '$(srcdir)/'`unit1304.c unit1304-unit1304.obj: unit1304.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1304_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1304-unit1304.obj -MD -MP -MF $(DEPDIR)/unit1304-unit1304.Tpo -c -o unit1304-unit1304.obj `if test -f 'unit1304.c'; then $(CYGPATH_W) 'unit1304.c'; else $(CYGPATH_W) '$(srcdir)/unit1304.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1304-unit1304.Tpo $(DEPDIR)/unit1304-unit1304.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1304.c' object='unit1304-unit1304.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1304_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1304-unit1304.obj `if test -f 'unit1304.c'; then $(CYGPATH_W) 'unit1304.c'; else $(CYGPATH_W) '$(srcdir)/unit1304.c'; fi` ../libtest/unit1304-first.o: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1304_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1304-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1304-first.Tpo -c -o ../libtest/unit1304-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1304-first.Tpo ../libtest/$(DEPDIR)/unit1304-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1304-first.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1304_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1304-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c ../libtest/unit1304-first.obj: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1304_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1304-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1304-first.Tpo -c -o ../libtest/unit1304-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1304-first.Tpo ../libtest/$(DEPDIR)/unit1304-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1304-first.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1304_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1304-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` unit1305-unit1305.o: unit1305.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1305_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1305-unit1305.o -MD -MP -MF $(DEPDIR)/unit1305-unit1305.Tpo -c -o unit1305-unit1305.o `test -f 'unit1305.c' || echo '$(srcdir)/'`unit1305.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1305-unit1305.Tpo $(DEPDIR)/unit1305-unit1305.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1305.c' object='unit1305-unit1305.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1305_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1305-unit1305.o `test -f 'unit1305.c' || echo '$(srcdir)/'`unit1305.c unit1305-unit1305.obj: unit1305.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1305_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1305-unit1305.obj -MD -MP -MF $(DEPDIR)/unit1305-unit1305.Tpo -c -o unit1305-unit1305.obj `if test -f 'unit1305.c'; then $(CYGPATH_W) 'unit1305.c'; else $(CYGPATH_W) '$(srcdir)/unit1305.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1305-unit1305.Tpo $(DEPDIR)/unit1305-unit1305.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1305.c' object='unit1305-unit1305.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1305_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1305-unit1305.obj `if test -f 'unit1305.c'; then $(CYGPATH_W) 'unit1305.c'; else $(CYGPATH_W) '$(srcdir)/unit1305.c'; fi` ../libtest/unit1305-first.o: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1305_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1305-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1305-first.Tpo -c -o ../libtest/unit1305-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1305-first.Tpo ../libtest/$(DEPDIR)/unit1305-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1305-first.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1305_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1305-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c ../libtest/unit1305-first.obj: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1305_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1305-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1305-first.Tpo -c -o ../libtest/unit1305-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1305-first.Tpo ../libtest/$(DEPDIR)/unit1305-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1305-first.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1305_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1305-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` unit1307-unit1307.o: unit1307.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1307_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1307-unit1307.o -MD -MP -MF $(DEPDIR)/unit1307-unit1307.Tpo -c -o unit1307-unit1307.o `test -f 'unit1307.c' || echo '$(srcdir)/'`unit1307.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1307-unit1307.Tpo $(DEPDIR)/unit1307-unit1307.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1307.c' object='unit1307-unit1307.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1307_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1307-unit1307.o `test -f 'unit1307.c' || echo '$(srcdir)/'`unit1307.c unit1307-unit1307.obj: unit1307.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1307_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1307-unit1307.obj -MD -MP -MF $(DEPDIR)/unit1307-unit1307.Tpo -c -o unit1307-unit1307.obj `if test -f 'unit1307.c'; then $(CYGPATH_W) 'unit1307.c'; else $(CYGPATH_W) '$(srcdir)/unit1307.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1307-unit1307.Tpo $(DEPDIR)/unit1307-unit1307.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1307.c' object='unit1307-unit1307.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1307_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1307-unit1307.obj `if test -f 'unit1307.c'; then $(CYGPATH_W) 'unit1307.c'; else $(CYGPATH_W) '$(srcdir)/unit1307.c'; fi` ../libtest/unit1307-first.o: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1307_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1307-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1307-first.Tpo -c -o ../libtest/unit1307-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1307-first.Tpo ../libtest/$(DEPDIR)/unit1307-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1307-first.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1307_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1307-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c ../libtest/unit1307-first.obj: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1307_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1307-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1307-first.Tpo -c -o ../libtest/unit1307-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1307-first.Tpo ../libtest/$(DEPDIR)/unit1307-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1307-first.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1307_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1307-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` unit1308-unit1308.o: unit1308.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1308_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1308-unit1308.o -MD -MP -MF $(DEPDIR)/unit1308-unit1308.Tpo -c -o unit1308-unit1308.o `test -f 'unit1308.c' || echo '$(srcdir)/'`unit1308.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1308-unit1308.Tpo $(DEPDIR)/unit1308-unit1308.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1308.c' object='unit1308-unit1308.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1308_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1308-unit1308.o `test -f 'unit1308.c' || echo '$(srcdir)/'`unit1308.c unit1308-unit1308.obj: unit1308.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1308_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1308-unit1308.obj -MD -MP -MF $(DEPDIR)/unit1308-unit1308.Tpo -c -o unit1308-unit1308.obj `if test -f 'unit1308.c'; then $(CYGPATH_W) 'unit1308.c'; else $(CYGPATH_W) '$(srcdir)/unit1308.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1308-unit1308.Tpo $(DEPDIR)/unit1308-unit1308.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1308.c' object='unit1308-unit1308.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1308_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1308-unit1308.obj `if test -f 'unit1308.c'; then $(CYGPATH_W) 'unit1308.c'; else $(CYGPATH_W) '$(srcdir)/unit1308.c'; fi` ../libtest/unit1308-first.o: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1308_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1308-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1308-first.Tpo -c -o ../libtest/unit1308-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1308-first.Tpo ../libtest/$(DEPDIR)/unit1308-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1308-first.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1308_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1308-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c ../libtest/unit1308-first.obj: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1308_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1308-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1308-first.Tpo -c -o ../libtest/unit1308-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1308-first.Tpo ../libtest/$(DEPDIR)/unit1308-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1308-first.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1308_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1308-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` unit1309-unit1309.o: unit1309.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1309_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1309-unit1309.o -MD -MP -MF $(DEPDIR)/unit1309-unit1309.Tpo -c -o unit1309-unit1309.o `test -f 'unit1309.c' || echo '$(srcdir)/'`unit1309.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1309-unit1309.Tpo $(DEPDIR)/unit1309-unit1309.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1309.c' object='unit1309-unit1309.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1309_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1309-unit1309.o `test -f 'unit1309.c' || echo '$(srcdir)/'`unit1309.c unit1309-unit1309.obj: unit1309.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1309_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1309-unit1309.obj -MD -MP -MF $(DEPDIR)/unit1309-unit1309.Tpo -c -o unit1309-unit1309.obj `if test -f 'unit1309.c'; then $(CYGPATH_W) 'unit1309.c'; else $(CYGPATH_W) '$(srcdir)/unit1309.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1309-unit1309.Tpo $(DEPDIR)/unit1309-unit1309.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1309.c' object='unit1309-unit1309.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1309_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1309-unit1309.obj `if test -f 'unit1309.c'; then $(CYGPATH_W) 'unit1309.c'; else $(CYGPATH_W) '$(srcdir)/unit1309.c'; fi` ../libtest/unit1309-first.o: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1309_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1309-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1309-first.Tpo -c -o ../libtest/unit1309-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1309-first.Tpo ../libtest/$(DEPDIR)/unit1309-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1309-first.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1309_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1309-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c ../libtest/unit1309-first.obj: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1309_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1309-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1309-first.Tpo -c -o ../libtest/unit1309-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1309-first.Tpo ../libtest/$(DEPDIR)/unit1309-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1309-first.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1309_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1309-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` unit1330-unit1330.o: unit1330.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1330_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1330-unit1330.o -MD -MP -MF $(DEPDIR)/unit1330-unit1330.Tpo -c -o unit1330-unit1330.o `test -f 'unit1330.c' || echo '$(srcdir)/'`unit1330.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1330-unit1330.Tpo $(DEPDIR)/unit1330-unit1330.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1330.c' object='unit1330-unit1330.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1330_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1330-unit1330.o `test -f 'unit1330.c' || echo '$(srcdir)/'`unit1330.c unit1330-unit1330.obj: unit1330.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1330_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1330-unit1330.obj -MD -MP -MF $(DEPDIR)/unit1330-unit1330.Tpo -c -o unit1330-unit1330.obj `if test -f 'unit1330.c'; then $(CYGPATH_W) 'unit1330.c'; else $(CYGPATH_W) '$(srcdir)/unit1330.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1330-unit1330.Tpo $(DEPDIR)/unit1330-unit1330.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1330.c' object='unit1330-unit1330.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1330_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1330-unit1330.obj `if test -f 'unit1330.c'; then $(CYGPATH_W) 'unit1330.c'; else $(CYGPATH_W) '$(srcdir)/unit1330.c'; fi` ../libtest/unit1330-first.o: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1330_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1330-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1330-first.Tpo -c -o ../libtest/unit1330-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1330-first.Tpo ../libtest/$(DEPDIR)/unit1330-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1330-first.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1330_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1330-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c ../libtest/unit1330-first.obj: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1330_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1330-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1330-first.Tpo -c -o ../libtest/unit1330-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1330-first.Tpo ../libtest/$(DEPDIR)/unit1330-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1330-first.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1330_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1330-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` unit1394-unit1394.o: unit1394.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1394_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1394-unit1394.o -MD -MP -MF $(DEPDIR)/unit1394-unit1394.Tpo -c -o unit1394-unit1394.o `test -f 'unit1394.c' || echo '$(srcdir)/'`unit1394.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1394-unit1394.Tpo $(DEPDIR)/unit1394-unit1394.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1394.c' object='unit1394-unit1394.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1394_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1394-unit1394.o `test -f 'unit1394.c' || echo '$(srcdir)/'`unit1394.c unit1394-unit1394.obj: unit1394.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1394_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1394-unit1394.obj -MD -MP -MF $(DEPDIR)/unit1394-unit1394.Tpo -c -o unit1394-unit1394.obj `if test -f 'unit1394.c'; then $(CYGPATH_W) 'unit1394.c'; else $(CYGPATH_W) '$(srcdir)/unit1394.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1394-unit1394.Tpo $(DEPDIR)/unit1394-unit1394.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1394.c' object='unit1394-unit1394.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1394_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1394-unit1394.obj `if test -f 'unit1394.c'; then $(CYGPATH_W) 'unit1394.c'; else $(CYGPATH_W) '$(srcdir)/unit1394.c'; fi` ../libtest/unit1394-first.o: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1394_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1394-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1394-first.Tpo -c -o ../libtest/unit1394-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1394-first.Tpo ../libtest/$(DEPDIR)/unit1394-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1394-first.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1394_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1394-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c ../libtest/unit1394-first.obj: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1394_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1394-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1394-first.Tpo -c -o ../libtest/unit1394-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1394-first.Tpo ../libtest/$(DEPDIR)/unit1394-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1394-first.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1394_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1394-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` unit1395-unit1395.o: unit1395.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1395_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1395-unit1395.o -MD -MP -MF $(DEPDIR)/unit1395-unit1395.Tpo -c -o unit1395-unit1395.o `test -f 'unit1395.c' || echo '$(srcdir)/'`unit1395.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1395-unit1395.Tpo $(DEPDIR)/unit1395-unit1395.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1395.c' object='unit1395-unit1395.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1395_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1395-unit1395.o `test -f 'unit1395.c' || echo '$(srcdir)/'`unit1395.c unit1395-unit1395.obj: unit1395.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1395_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1395-unit1395.obj -MD -MP -MF $(DEPDIR)/unit1395-unit1395.Tpo -c -o unit1395-unit1395.obj `if test -f 'unit1395.c'; then $(CYGPATH_W) 'unit1395.c'; else $(CYGPATH_W) '$(srcdir)/unit1395.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1395-unit1395.Tpo $(DEPDIR)/unit1395-unit1395.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1395.c' object='unit1395-unit1395.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1395_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1395-unit1395.obj `if test -f 'unit1395.c'; then $(CYGPATH_W) 'unit1395.c'; else $(CYGPATH_W) '$(srcdir)/unit1395.c'; fi` ../libtest/unit1395-first.o: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1395_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1395-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1395-first.Tpo -c -o ../libtest/unit1395-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1395-first.Tpo ../libtest/$(DEPDIR)/unit1395-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1395-first.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1395_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1395-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c ../libtest/unit1395-first.obj: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1395_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1395-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1395-first.Tpo -c -o ../libtest/unit1395-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1395-first.Tpo ../libtest/$(DEPDIR)/unit1395-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1395-first.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1395_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1395-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` unit1396-unit1396.o: unit1396.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1396_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1396-unit1396.o -MD -MP -MF $(DEPDIR)/unit1396-unit1396.Tpo -c -o unit1396-unit1396.o `test -f 'unit1396.c' || echo '$(srcdir)/'`unit1396.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1396-unit1396.Tpo $(DEPDIR)/unit1396-unit1396.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1396.c' object='unit1396-unit1396.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1396_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1396-unit1396.o `test -f 'unit1396.c' || echo '$(srcdir)/'`unit1396.c unit1396-unit1396.obj: unit1396.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1396_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1396-unit1396.obj -MD -MP -MF $(DEPDIR)/unit1396-unit1396.Tpo -c -o unit1396-unit1396.obj `if test -f 'unit1396.c'; then $(CYGPATH_W) 'unit1396.c'; else $(CYGPATH_W) '$(srcdir)/unit1396.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1396-unit1396.Tpo $(DEPDIR)/unit1396-unit1396.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1396.c' object='unit1396-unit1396.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1396_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1396-unit1396.obj `if test -f 'unit1396.c'; then $(CYGPATH_W) 'unit1396.c'; else $(CYGPATH_W) '$(srcdir)/unit1396.c'; fi` ../libtest/unit1396-first.o: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1396_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1396-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1396-first.Tpo -c -o ../libtest/unit1396-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1396-first.Tpo ../libtest/$(DEPDIR)/unit1396-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1396-first.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1396_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1396-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c ../libtest/unit1396-first.obj: ../libtest/first.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1396_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1396-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1396-first.Tpo -c -o ../libtest/unit1396-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1396-first.Tpo ../libtest/$(DEPDIR)/unit1396-first.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1396-first.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1396_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1396-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../libtest/$(DEPDIR)/$(am__dirstamp) -rm -f ../libtest/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ../libtest/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../libtest/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: curl-7.35.0/tests/unit/unit1300.c0000644000175000017500000002314112213173003013235 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curlcheck.h" #include "llist.h" static struct curl_llist *llist; static struct curl_llist *llist_destination; static void test_curl_llist_dtor(void *key, void *value) { /* used by the llist API, does nothing here */ (void)key; (void)value; } static CURLcode unit_setup(void) { llist = Curl_llist_alloc(test_curl_llist_dtor); if(!llist) return CURLE_OUT_OF_MEMORY; llist_destination = Curl_llist_alloc(test_curl_llist_dtor); if(!llist_destination) { Curl_llist_destroy(llist, NULL); return CURLE_OUT_OF_MEMORY; } return CURLE_OK; } static void unit_stop(void) { Curl_llist_destroy(llist, NULL); Curl_llist_destroy(llist_destination, NULL); } UNITTEST_START int unusedData_case1 = 1; int unusedData_case2 = 2; int unusedData_case3 = 3; struct curl_llist_element *head; struct curl_llist_element *element_next; struct curl_llist_element *element_prev; struct curl_llist_element *to_remove; size_t llist_size = Curl_llist_count(llist); int curlErrCode = 0; /** * testing llist_init * case 1: * list initiation * @assumptions: * 1: list size will be 0 * 2: list head will be NULL * 3: list tail will be NULL * 4: list dtor will be NULL */ fail_unless(llist->size == 0, "list initial size should be zero"); fail_unless(llist->head == NULL, "list head should initiate to NULL"); fail_unless(llist->tail == NULL, "list tail should intiate to NULL"); fail_unless(llist->dtor == test_curl_llist_dtor, "list dtor shold initiate to test_curl_llist_dtor"); /** * testing Curl_llist_insert_next * case 1: * list is empty * @assumptions: * 1: list size will be 1 * 2: list head will hold the data "unusedData_case1" * 3: list tail will be the same as list head */ curlErrCode = Curl_llist_insert_next(llist, llist->head, &unusedData_case1); if(curlErrCode == 1) { fail_unless(Curl_llist_count(llist) == 1, "List size should be 1 after adding a new element"); /*test that the list head data holds my unusedData */ fail_unless(llist->head->ptr == &unusedData_case1, "List size should be 1 after adding a new element"); /*same goes for the list tail */ fail_unless(llist->tail == llist->head, "List size should be 1 after adding a new element"); /** * testing Curl_llist_insert_next * case 2: * list has 1 element, adding one element after the head * @assumptions: * 1: the element next to head should be our newly created element * 2: the list tail should be our newly created element */ curlErrCode = Curl_llist_insert_next(llist, llist->head, &unusedData_case3); if(curlErrCode == 1) { fail_unless(llist->head->next->ptr == &unusedData_case3, "the node next to head is not getting set correctly"); fail_unless(llist->tail->ptr == &unusedData_case3, "the list tail is not getting set correctly"); } else { printf("skipping Curl_llist_insert_next as a non " "success error code was returned\n"); } /** * testing Curl_llist_insert_next * case 3: * list has >1 element, adding one element after "NULL" * @assumptions: * 1: the element next to head should be our newly created element * 2: the list tail should different from newly created element */ curlErrCode = Curl_llist_insert_next(llist, llist->head, &unusedData_case2); if(curlErrCode == 1) { fail_unless(llist->head->next->ptr == &unusedData_case2, "the node next to head is not getting set correctly"); /* better safe than sorry, check that the tail isn't corrupted */ fail_unless(llist->tail->ptr != &unusedData_case2, "the list tail is not getting set correctly"); } else { printf("skipping Curl_llist_insert_next as a non " "success error code was returned\n"); } } else { printf("skipping Curl_llist_insert_next as a non " "success error code was returned\n"); } /* unit tests for Curl_llist_remove */ /** * case 1: * list has >1 element, removing head * @assumptions: * 1: list size will be decremented by one * 2: head will be the head->next * 3: "new" head's previous will be NULL */ head=llist->head; abort_unless(head, "llist->head is NULL"); element_next = head->next; llist_size = Curl_llist_count(llist); Curl_llist_remove(llist, llist->head, NULL); fail_unless(Curl_llist_count(llist) == (llist_size-1), "llist size not decremented as expected"); fail_unless(llist->head == element_next, "llist new head not modified properly"); abort_unless(llist->head, "llist->head is NULL"); fail_unless(llist->head->prev == NULL, "new head previous not set to null"); /** * case 2: * removing non head element, with list having >=2 elements * @setup: * 1: insert another element to the list to make element >=2 * @assumptions: * 1: list size will be decremented by one ; tested * 2: element->previous->next will be element->next * 3: element->next->previous will be element->previous */ Curl_llist_insert_next(llist, llist->head, &unusedData_case3); llist_size = Curl_llist_count(llist); to_remove = llist->head->next; abort_unless(to_remove, "to_remove is NULL"); element_next = to_remove->next; element_prev = to_remove->prev; Curl_llist_remove(llist, to_remove, NULL); fail_unless(element_prev->next == element_next, "element previous->next is not being adjusted"); abort_unless(element_next, "element_next is NULL"); fail_unless(element_next->prev == element_prev, "element next->previous is not being adjusted"); /** * case 3: * removing the tail with list having >=1 element * @assumptions * 1: list size will be decremented by one ;tested * 2: element->previous->next will be element->next ;tested * 3: element->next->previous will be element->previous ;tested * 4: list->tail will be tail->previous */ to_remove = llist->tail; element_prev = to_remove->prev; Curl_llist_remove(llist, to_remove, NULL); fail_unless(llist->tail == element_prev, "llist tail is not being adjusted when removing tail"); /** * case 4: * removing head with list having 1 element * @assumptions: * 1: list size will be decremented by one ;tested * 2: list head will be null * 3: list tail will be null */ to_remove = llist->head; Curl_llist_remove(llist, to_remove, NULL); fail_unless(llist->head == NULL, "llist head is not NULL while the llist is empty"); fail_unless(llist->tail == NULL, "llist tail is not NULL while the llist is empty"); /* @testing Curl_llist_move(struct curl_llist *, * struct curl_llist_element *, struct curl_llist *, * struct curl_llist_element *); */ /** * @case 1: * moving head from an llist containg one element to an empty llist * @assumptions: * 1: llist size will be 0 * 2: llist_destination size will be 1 * 3: llist head will be NULL * 4: llist_destination head == llist_destination tail != NULL */ /* * @setup * add one element to the list */ curlErrCode = Curl_llist_insert_next(llist, llist->head, &unusedData_case1); /* necessary assertions */ abort_unless(curlErrCode == 1, "Curl_llist_insert_next returned an error, Can't move on with test"); abort_unless(Curl_llist_count(llist) == 1, "Number of list elements is not as expected, Aborting"); abort_unless(Curl_llist_count(llist_destination) == 0, "Number of list elements is not as expected, Aborting"); /*actual testing code*/ curlErrCode = Curl_llist_move(llist, llist->head, llist_destination, NULL); abort_unless(curlErrCode == 1, "Curl_llist_move returned an error, Can't move on with test"); fail_unless(Curl_llist_count(llist) == 0, "moving element from llist didn't decrement the size"); fail_unless(Curl_llist_count(llist_destination) == 1, "moving element to llist_destination didn't increment the size"); fail_unless(llist->head == NULL, "llist head not set to null after moving the head"); fail_unless(llist_destination->head != NULL, "llist_destination head set to null after moving an element"); fail_unless(llist_destination->tail != NULL, "llist_destination tail set to null after moving an element"); fail_unless(llist_destination->tail == llist_destination->tail, "llist_destination tail doesn't equal llist_destination head"); UNITTEST_STOP curl-7.35.0/tests/unit/unit1303.c0000644000175000017500000001220512213173003013237 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #include "curlcheck.h" #include "urldata.h" #include "connect.h" #include "memdebug.h" /* LAST include file */ static struct SessionHandle *data; static CURLcode unit_setup( void ) { data = curl_easy_init(); if (!data) return CURLE_OUT_OF_MEMORY; return CURLE_OK; } static void unit_stop( void ) { curl_easy_cleanup(data); } /* BASE is just a define to make us fool around with decently large number so that we aren't zero-based */ #define BASE 1000000 /* macro to set the pretended current time */ #define NOW(x,y) now.tv_sec = x; now.tv_usec = y /* macro to set the millisecond based timeouts to use */ #define TIMEOUTS(x,y) data->set.timeout = x; data->set.connecttimeout = y /* * To test: * * 00/10/01/11 timeouts set * 0/1 during connect * T various values on the timeouts * N various values of now */ struct timetest { int now_s; int now_us; int timeout_ms; int connecttimeout_ms; bool connecting; long result; const char *comment; }; UNITTEST_START struct timeval now; long timeout; unsigned int i; const struct timetest run[] = { /* both timeouts set, not connecting */ {BASE + 4, 0, 10000, 8000, FALSE, 6000, "6 seconds should be left"}, {BASE + 4, 990000, 10000, 8000, FALSE, 5010, "5010 ms should be left"}, {BASE + 10, 0, 10000, 8000, FALSE, -1, "timeout is -1, expired"}, {BASE + 12, 0, 10000, 8000, FALSE, -2000, "-2000, overdue 2 seconds"}, /* both timeouts set, connecting */ {BASE + 4, 0, 10000, 8000, TRUE, 4000, "4 seconds should be left"}, {BASE + 4, 990000, 10000, 8000, TRUE, 3010, "3010 ms should be left"}, {BASE + 8, 0, 10000, 8000, TRUE, -1, "timeout is -1, expired"}, {BASE + 10, 0, 10000, 8000, TRUE, -2000, "-2000, overdue 2 seconds"}, /* no connect timeout set, not connecting */ {BASE + 4, 0, 10000, 0, FALSE, 6000, "6 seconds should be left"}, {BASE + 4, 990000, 10000, 0, FALSE, 5010, "5010 ms should be left"}, {BASE + 10, 0, 10000, 0, FALSE, -1, "timeout is -1, expired"}, {BASE + 12, 0, 10000, 0, FALSE, -2000, "-2000, overdue 2 seconds"}, /* no connect timeout set, connecting */ {BASE + 4, 0, 10000, 0, FALSE, 6000, "6 seconds should be left"}, {BASE + 4, 990000, 10000, 0, FALSE, 5010, "5010 ms should be left"}, {BASE + 10, 0, 10000, 0, FALSE, -1, "timeout is -1, expired"}, {BASE + 12, 0, 10000, 0, FALSE, -2000, "-2000, overdue 2 seconds"}, /* only connect timeout set, not connecting */ {BASE + 4, 0, 0, 10000, FALSE, 0, "no timeout active"}, {BASE + 4, 990000, 0, 10000, FALSE, 0, "no timeout active"}, {BASE + 10, 0, 0, 10000, FALSE, 0, "no timeout active"}, {BASE + 12, 0, 0, 10000, FALSE, 0, "no timeout active"}, /* only connect timeout set, connecting */ {BASE + 4, 0, 0, 10000, TRUE, 6000, "6 seconds should be left"}, {BASE + 4, 990000, 0, 10000, TRUE, 5010, "5010 ms should be left"}, {BASE + 10, 0, 0, 10000, TRUE, -1, "timeout is -1, expired"}, {BASE + 12, 0, 0, 10000, TRUE, -2000, "-2000, overdue 2 seconds"}, /* no timeout set, not connecting */ {BASE + 4, 0, 0, 0, FALSE, 0, "no timeout active"}, {BASE + 4, 990000, 0, 0, FALSE, 0, "no timeout active"}, {BASE + 10, 0, 0, 0, FALSE, 0, "no timeout active"}, {BASE + 12, 0, 0, 0, FALSE, 0, "no timeout active"}, /* no timeout set, connecting */ {BASE + 4, 0, 0, 0, TRUE, 296000, "no timeout active"}, {BASE + 4, 990000, 0, 0, TRUE, 295010, "no timeout active"}, {BASE + 10, 0, 0, 0, TRUE, 290000, "no timeout active"}, {BASE + 12, 0, 0, 0, TRUE, 288000, "no timeout active"}, /* both timeouts set, connecting, connect timeout the longer one */ {BASE + 4, 0, 10000, 12000, TRUE, 6000, "6 seconds should be left"}, }; /* this is the pretended start time of the transfer */ data->progress.t_startsingle.tv_sec = BASE; data->progress.t_startsingle.tv_usec = 0; for(i=0; i < sizeof(run)/sizeof(run[0]); i++) { NOW(run[i].now_s, run[i].now_us); TIMEOUTS(run[i].timeout_ms, run[i].connecttimeout_ms); timeout = Curl_timeleft(data, &now, run[i].connecting); if(timeout != run[i].result) fail(run[i].comment); } UNITTEST_STOP curl-7.35.0/tests/valgrind.supp0000644000175000017500000000136412262353672013371 00000000000000{ libidn-idna_to_ascii-error Memcheck:Addr4 fun:idna_to_ascii_4z fun:idna_to_ascii_8z fun:idna_to_ascii_lz fun:fix_hostname fun:resolve_server fun:create_conn fun:Curl_connect fun:multi_runsingle fun:curl_multi_perform fun:easy_transfer fun:easy_perform fun:curl_easy_perform fun:operate fun:main } { libidn-idna_to_ascii-error-eventbased Memcheck:Addr4 fun:idna_to_ascii_4z fun:idna_to_ascii_8z fun:idna_to_ascii_lz fun:fix_hostname fun:resolve_server fun:create_conn fun:Curl_connect fun:multi_runsingle fun:multi_socket fun:curl_multi_socket_action fun:wait_or_timeout fun:easy_events fun:easy_perform fun:curl_easy_perform_ev fun:operate fun:main } curl-7.35.0/maketgz0000755000175000017500000001233412262102134011060 00000000000000#! /bin/sh # Script to build release-archives with. Note that this requires a checkout # from git and you should first run ./buildconf and build curl once. # #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # ########################################################################### 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/tool_version.h # requires a date command that knows -u for UTC time zone datestamp=`date -u` # 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' \ -e "s/^#define LIBCURL_TIMESTAMP .*/#define LIBCURL_TIMESTAMP \"$datestamp\"/g" \ $HEADER >$HEADER.dist # Replace version number in header file: sed 's/#define CURL_VERSION .*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER >$CHEADER.dist # Generate VC8, VC9, and VC10 versions from the VC6 Makefile versions for ver in vc8 vc9 vc10; do make -f Makefile.dist $ver mv src/Makefile.$ver src/Makefile.$ver.dist mv lib/Makefile.$ver lib/Makefile.$ver.dist done # 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" echo "datestamp $datestamp" 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 } ############################################################################ # # 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 echo "produce CHANGES" git log --pretty=fuller --no-color --date=short --decorate=full -1000 | ./log2changes.pl > CHANGES.dist ############################################################################ # # 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 --best > $bzip2 ############################################################################ # # Now make an lzma archive from the tar.gz original # lzma="curl-$version.tar.lzma" echo "Generating $lzma" gzip -dc $targz | lzma --best - > $lzma ############################################################################ # # 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 $lzma echo "Run this:" echo "gpg -b -a $targz && gpg -b -a $bzip2 && gpg -b -a $zip && gpg -b -a $lzma" curl-7.35.0/CMake/0000755000175000017500000000000012272124475010542 500000000000000curl-7.35.0/CMake/Utilities.cmake0000644000175000017500000000217312213173003013424 00000000000000# File containing various utilities # Converts a CMake list to a string containing elements separated by spaces function(TO_LIST_SPACES _LIST_NAME OUTPUT_VAR) set(NEW_LIST_SPACE) foreach(ITEM ${${_LIST_NAME}}) set(NEW_LIST_SPACE "${NEW_LIST_SPACE} ${ITEM}") endforeach() string(STRIP ${NEW_LIST_SPACE} NEW_LIST_SPACE) set(${OUTPUT_VAR} "${NEW_LIST_SPACE}" PARENT_SCOPE) endfunction() # Appends a lis of item to a string which is a space-separated list, if they don't already exist. function(LIST_SPACES_APPEND_ONCE LIST_NAME) string(REPLACE " " ";" _LIST ${${LIST_NAME}}) list(APPEND _LIST ${ARGN}) list(REMOVE_DUPLICATES _LIST) to_list_spaces(_LIST NEW_LIST_SPACE) set(${LIST_NAME} "${NEW_LIST_SPACE}" PARENT_SCOPE) endfunction() # Convinience function that does the same as LIST(FIND ...) but with a TRUE/FALSE return value. # Ex: IN_STR_LIST(MY_LIST "Searched item" WAS_FOUND) function(IN_STR_LIST LIST_NAME ITEM_SEARCHED RETVAL) list(FIND ${LIST_NAME} ${ITEM_SEARCHED} FIND_POS) if(${FIND_POS} EQUAL -1) set(${RETVAL} FALSE PARENT_SCOPE) else() set(${RETVAL} TRUE PARENT_SCOPE) endif() endfunction() curl-7.35.0/CMake/CurlTests.c0000644000175000017500000003014312213173003012541 00000000000000/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, 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. * ***************************************************************************/ #ifdef TIME_WITH_SYS_TIME /* Time with sys/time test */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } #endif #ifdef HAVE_FCNTL_O_NONBLOCK /* headers for FCNTL_O_NONBLOCK test */ #include #include #include /* */ #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(_AIX41) # 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 main () { /* O_NONBLOCK source test */ int flags = 0; if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK)) return 1; return 0; } #endif #ifdef HAVE_GETHOSTBYADDR_R_5 #include #include int main () { char * address; int length; int type; struct hostent h; struct hostent_data hdata; int rc; #ifndef gethostbyaddr_r (void)gethostbyaddr_r; #endif rc = gethostbyaddr_r(address, length, type, &h, &hdata); ; return 0; } #endif #ifdef HAVE_GETHOSTBYADDR_R_5_REENTRANT #define _REENTRANT #include #include int main () { char * address; int length;q int type; struct hostent h; struct hostent_data hdata; int rc; #ifndef gethostbyaddr_r (void)gethostbyaddr_r; #endif rc = gethostbyaddr_r(address, length, type, &h, &hdata); ; return 0; } #endif #ifdef HAVE_GETHOSTBYADDR_R_7 #include #include int main () { char * address; int length; int type; struct hostent h; char buffer[8192]; int h_errnop; struct hostent * hp; #ifndef gethostbyaddr_r (void)gethostbyaddr_r; #endif hp = gethostbyaddr_r(address, length, type, &h, buffer, 8192, &h_errnop); ; return 0; } #endif #ifdef HAVE_GETHOSTBYADDR_R_7_REENTRANT #define _REENTRANT #include #include int main () { char * address; int length; int type; struct hostent h; char buffer[8192]; int h_errnop; struct hostent * hp; #ifndef gethostbyaddr_r (void)gethostbyaddr_r; #endif hp = gethostbyaddr_r(address, length, type, &h, buffer, 8192, &h_errnop); ; return 0; } #endif #ifdef HAVE_GETHOSTBYADDR_R_8 #include #include int main () { char * address; int length; int type; struct hostent h; char buffer[8192]; int h_errnop; struct hostent * hp; int rc; #ifndef gethostbyaddr_r (void)gethostbyaddr_r; #endif rc = gethostbyaddr_r(address, length, type, &h, buffer, 8192, &hp, &h_errnop); ; return 0; } #endif #ifdef HAVE_GETHOSTBYADDR_R_8_REENTRANT #define _REENTRANT #include #include int main () { char * address; int length; int type; struct hostent h; char buffer[8192]; int h_errnop; struct hostent * hp; int rc; #ifndef gethostbyaddr_r (void)gethostbyaddr_r; #endif rc = gethostbyaddr_r(address, length, type, &h, buffer, 8192, &hp, &h_errnop); ; return 0; } #endif #ifdef HAVE_GETHOSTBYNAME_R_3 #include #include #include #undef NULL #define NULL (void *)0 int main () { struct hostent_data data; #ifndef gethostbyname_r (void)gethostbyname_r; #endif gethostbyname_r(NULL, NULL, NULL); ; return 0; } #endif #ifdef HAVE_GETHOSTBYNAME_R_3_REENTRANT #define _REENTRANT #include #include #include #undef NULL #define NULL (void *)0 int main () { struct hostent_data data; #ifndef gethostbyname_r (void)gethostbyname_r; #endif gethostbyname_r(NULL, NULL, NULL); ; return 0; } #endif #ifdef HAVE_GETHOSTBYNAME_R_5 #include #include #include #undef NULL #define NULL (void *)0 int main () { #ifndef gethostbyname_r (void)gethostbyname_r; #endif gethostbyname_r(NULL, NULL, NULL, 0, NULL); ; return 0; } #endif #ifdef HAVE_GETHOSTBYNAME_R_5_REENTRANT #define _REENTRANT #include #include #undef NULL #define NULL (void *)0 int main () { #ifndef gethostbyname_r (void)gethostbyname_r; #endif gethostbyname_r(NULL, NULL, NULL, 0, NULL); ; return 0; } #endif #ifdef HAVE_GETHOSTBYNAME_R_6 #include #include #undef NULL #define NULL (void *)0 int main () { #ifndef gethostbyname_r (void)gethostbyname_r; #endif gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL); ; return 0; } #endif #ifdef HAVE_GETHOSTBYNAME_R_6_REENTRANT #define _REENTRANT #include #include #undef NULL #define NULL (void *)0 int main () { #ifndef gethostbyname_r (void)gethostbyname_r; #endif gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL); ; return 0; } #endif #ifdef HAVE_SOCKLEN_T #ifdef _WIN32 #include #else #include #include #endif int main () { if ((socklen_t *) 0) return 0; if (sizeof (socklen_t)) return 0; ; return 0; } #endif #ifdef HAVE_IN_ADDR_T #include #include #include int main () { if ((in_addr_t *) 0) return 0; if (sizeof (in_addr_t)) return 0; ; return 0; } #endif #ifdef HAVE_BOOL_T #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDBOOL_H #include #endif int main () { if (sizeof (bool *) ) return 0; ; return 0; } #endif #ifdef STDC_HEADERS #include #include #include #include int main() { return 0; } #endif #ifdef RETSIGTYPE_TEST #include #include #ifdef signal # undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main () { return 0; } #endif #ifdef HAVE_INET_NTOA_R_DECL #include typedef void (*func_type)(); int main() { #ifndef inet_ntoa_r func_type func; func = (func_type)inet_ntoa_r; #endif return 0; } #endif #ifdef HAVE_INET_NTOA_R_DECL_REENTRANT #define _REENTRANT #include typedef void (*func_type)(); int main() { #ifndef inet_ntoa_r func_type func; func = (func_type)&inet_ntoa_r; #endif return 0; } #endif #ifdef HAVE_GETADDRINFO #include #include #include int main(void) { struct addrinfo hints, *ai; int error; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; #ifndef getaddrinfo (void)getaddrinfo; #endif error = getaddrinfo("127.0.0.1", "8080", &hints, &ai); if (error) { return 1; } return 0; } #endif #ifdef HAVE_FILE_OFFSET_BITS #ifdef _FILE_OFFSET_BITS #undef _FILE_OFFSET_BITS #endif #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } #endif #ifdef HAVE_IOCTLSOCKET /* includes start */ #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 int main () { /* ioctlsocket source code */ int socket; unsigned long flags = ioctlsocket(socket, FIONBIO, &flags); ; return 0; } #endif #ifdef HAVE_IOCTLSOCKET_CAMEL /* includes start */ #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 int main () { /* IoctlSocket source code */ if(0 != IoctlSocket(0, 0, 0)) return 1; ; return 0; } #endif #ifdef HAVE_IOCTLSOCKET_CAMEL_FIONBIO /* includes start */ #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 int main () { /* IoctlSocket source code */ long flags = 0; if(0 != ioctlsocket(0, FIONBIO, &flags)) return 1; ; return 0; } #endif #ifdef HAVE_IOCTLSOCKET_FIONBIO /* includes start */ #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 int main () { int flags = 0; if(0 != ioctlsocket(0, FIONBIO, &flags)) return 1; ; return 0; } #endif #ifdef HAVE_IOCTL_FIONBIO /* headers for FIONBIO test */ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_STROPTS_H # include #endif int main () { int flags = 0; if(0 != ioctl(0, FIONBIO, &flags)) return 1; ; return 0; } #endif #ifdef HAVE_IOCTL_SIOCGIFADDR /* headers for FIONBIO test */ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_STROPTS_H # include #endif #include int main () { struct ifreq ifr; if(0 != ioctl(0, SIOCGIFADDR, &ifr)) return 1; ; return 0; } #endif #ifdef HAVE_SETSOCKOPT_SO_NONBLOCK /* includes start */ #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 /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif /* includes end */ int main () { if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0)) return 1; ; return 0; } #endif #ifdef HAVE_GLIBC_STRERROR_R #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; } #endif #ifdef HAVE_POSIX_STRERROR_R #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; } #endif curl-7.35.0/CMake/FindZLIB.cmake0000644000175000017500000000060112213173003013004 00000000000000# Locate zlib include("${CMAKE_ROOT}/Modules/FindZLIB.cmake") # starting 2.8 it is better to use standard modules if(CMAKE_MAJOR_VERSION EQUAL "2" AND CMAKE_MINOR_VERSION LESS "8") find_library(ZLIB_LIBRARY_DEBUG NAMES zd zlibd zdlld zlib1d ) if(ZLIB_FOUND AND ZLIB_LIBRARY_DEBUG) set( ZLIB_LIBRARIES optimized "${ZLIB_LIBRARY}" debug ${ZLIB_LIBRARY_DEBUG}) endif() endif() curl-7.35.0/CMake/CurlCheckCSourceCompiles.cmake0000644000175000017500000000643512213173003016301 00000000000000# - Check if the source code provided in the SOURCE argument compiles. # CURL_CHECK_C_SOURCE_COMPILES(SOURCE VAR) # - macro which checks if the source code compiles # SOURCE - source code to try to compile # VAR - variable to store whether the source code compiled # # The following variables may be set before calling this macro to # modify the way the check is run: # # CMAKE_REQUIRED_FLAGS = string of compile command line flags # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_LIBRARIES = list of libraries to link macro(CURL_CHECK_C_SOURCE_COMPILES SOURCE VAR) if("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN") set(message "${VAR}") # If the number of arguments is greater than 2 (SOURCE VAR) if(${ARGC} GREATER 2) # then add the third argument as a message set(message "${ARGV2} (${VAR})") endif(${ARGC} GREATER 2) set(MACRO_CHECK_FUNCTION_DEFINITIONS "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") if(CMAKE_REQUIRED_LIBRARIES) set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") else(CMAKE_REQUIRED_LIBRARIES) set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) endif(CMAKE_REQUIRED_LIBRARIES) if(CMAKE_REQUIRED_INCLUDES) set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") else(CMAKE_REQUIRED_INCLUDES) set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) endif(CMAKE_REQUIRED_INCLUDES) set(src "") foreach(def ${EXTRA_DEFINES}) set(src "${src}#define ${def} 1\n") endforeach(def) foreach(inc ${HEADER_INCLUDES}) set(src "${src}#include <${inc}>\n") endforeach(inc) set(src "${src}\nint main() { ${SOURCE} ; return 0; }") set(CMAKE_CONFIGURABLE_FILE_CONTENT "${src}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeConfigurableFile.in "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c" IMMEDIATE) message(STATUS "Performing Test ${message}") try_compile(${VAR} ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} "${CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}" "${CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" OUTPUT_VARIABLE OUTPUT) if(${VAR}) set(${VAR} 1 CACHE INTERNAL "Test ${message}") message(STATUS "Performing Test ${message} - Success") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C SOURCE FILE Test ${message} succeded with the following output:\n" "${OUTPUT}\n" "Source file was:\n${src}\n") else(${VAR}) message(STATUS "Performing Test ${message} - Failed") set(${VAR} "" CACHE INTERNAL "Test ${message}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing C SOURCE FILE Test ${message} failed with the following output:\n" "${OUTPUT}\n" "Source file was:\n${src}\n") endif(${VAR}) endif("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN") endmacro(CURL_CHECK_C_SOURCE_COMPILES) curl-7.35.0/CMake/CurlCheckCSourceRuns.cmake0000644000175000017500000000716112213173003015452 00000000000000# - Check if the source code provided in the SOURCE argument compiles and runs. # CURL_CHECK_C_SOURCE_RUNS(SOURCE VAR) # - macro which checks if the source code runs # SOURCE - source code to try to compile # VAR - variable to store size if the type exists. # # The following variables may be set before calling this macro to # modify the way the check is run: # # CMAKE_REQUIRED_FLAGS = string of compile command line flags # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_LIBRARIES = list of libraries to link macro(CURL_CHECK_C_SOURCE_RUNS SOURCE VAR) if("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN") set(message "${VAR}") # If the number of arguments is greater than 2 (SOURCE VAR) if(${ARGC} GREATER 2) # then add the third argument as a message set(message "${ARGV2} (${VAR})") endif(${ARGC} GREATER 2) set(MACRO_CHECK_FUNCTION_DEFINITIONS "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") if(CMAKE_REQUIRED_LIBRARIES) set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") else(CMAKE_REQUIRED_LIBRARIES) set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) endif(CMAKE_REQUIRED_LIBRARIES) if(CMAKE_REQUIRED_INCLUDES) set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") else(CMAKE_REQUIRED_INCLUDES) set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) endif(CMAKE_REQUIRED_INCLUDES) set(src "") foreach(def ${EXTRA_DEFINES}) set(src "${src}#define ${def} 1\n") endforeach(def) foreach(inc ${HEADER_INCLUDES}) set(src "${src}#include <${inc}>\n") endforeach(inc) set(src "${src}\nint main() { ${SOURCE} ; return 0; }") set(CMAKE_CONFIGURABLE_FILE_CONTENT "${src}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeConfigurableFile.in "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c" IMMEDIATE) message(STATUS "Performing Test ${message}") try_run(${VAR} ${VAR}_COMPILED ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} "${CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}" "${CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" OUTPUT_VARIABLE OUTPUT) # if it did not compile make the return value fail code of 1 if(NOT ${VAR}_COMPILED) set(${VAR} 1) endif(NOT ${VAR}_COMPILED) # if the return value was 0 then it worked set(result_var ${${VAR}}) if("${result_var}" EQUAL 0) set(${VAR} 1 CACHE INTERNAL "Test ${message}") message(STATUS "Performing Test ${message} - Success") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C SOURCE FILE Test ${message} succeded with the following output:\n" "${OUTPUT}\n" "Return value: ${${VAR}}\n" "Source file was:\n${src}\n") else("${result_var}" EQUAL 0) message(STATUS "Performing Test ${message} - Failed") set(${VAR} "" CACHE INTERNAL "Test ${message}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing C SOURCE FILE Test ${message} failed with the following output:\n" "${OUTPUT}\n" "Return value: ${result_var}\n" "Source file was:\n${src}\n") endif("${result_var}" EQUAL 0) endif("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN") endmacro(CURL_CHECK_C_SOURCE_RUNS) curl-7.35.0/CMake/FindOpenSSL.cmake0000644000175000017500000000123512213173003013533 00000000000000# Extension of the standard FindOpenSSL.cmake # Adds OPENSSL_INCLUDE_DIRS and libeay32 include("${CMAKE_ROOT}/Modules/FindOpenSSL.cmake") # starting 2.8 it is better to use standard modules if(CMAKE_MAJOR_VERSION EQUAL "2" AND CMAKE_MINOR_VERSION LESS "8") # Bill Hoffman told that libeay32 is necessary for him: find_library(SSL_LIBEAY NAMES libeay32) if(OPENSSL_FOUND) if(SSL_LIBEAY) list(APPEND OPENSSL_LIBRARIES ${SSL_LIBEAY}) else() set(OPENSSL_FOUND FALSE) endif() endif() endif() # if (CMAKE_MAJOR_VERSION EQUAL "2" AND CMAKE_MINOR_VERSION LESS "8") if(OPENSSL_FOUND) set(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) endif() curl-7.35.0/CMake/Platforms/0000755000175000017500000000000012272124475012511 500000000000000curl-7.35.0/CMake/Platforms/WindowsCache.cmake0000644000175000017500000000615212262353672016017 00000000000000if(NOT UNIX) if(WIN32) set(HAVE_LIBDL 0) set(HAVE_LIBUCB 0) set(HAVE_LIBSOCKET 0) set(NOT_NEED_LIBNSL 0) set(HAVE_LIBNSL 0) set(HAVE_LIBZ 0) set(HAVE_LIBCRYPTO 0) set(HAVE_DLOPEN 0) set(HAVE_ALLOCA_H 0) set(HAVE_ARPA_INET_H 0) set(HAVE_DLFCN_H 0) set(HAVE_FCNTL_H 1) set(HAVE_FEATURES_H 0) set(HAVE_INTTYPES_H 0) set(HAVE_IO_H 1) set(HAVE_MALLOC_H 1) set(HAVE_MEMORY_H 1) set(HAVE_NETDB_H 0) set(HAVE_NETINET_IF_ETHER_H 0) set(HAVE_NETINET_IN_H 0) set(HAVE_NET_IF_H 0) set(HAVE_PROCESS_H 1) set(HAVE_PWD_H 0) set(HAVE_SETJMP_H 1) set(HAVE_SGTTY_H 0) set(HAVE_SIGNAL_H 1) set(HAVE_SOCKIO_H 0) set(HAVE_STDINT_H 0) set(HAVE_STDLIB_H 1) set(HAVE_STRINGS_H 0) set(HAVE_STRING_H 1) set(HAVE_SYS_PARAM_H 0) set(HAVE_SYS_POLL_H 0) set(HAVE_SYS_SELECT_H 0) set(HAVE_SYS_SOCKET_H 0) set(HAVE_SYS_SOCKIO_H 0) set(HAVE_SYS_STAT_H 1) set(HAVE_SYS_TIME_H 0) set(HAVE_SYS_TYPES_H 1) set(HAVE_SYS_UTIME_H 1) set(HAVE_TERMIOS_H 0) set(HAVE_TERMIO_H 0) set(HAVE_TIME_H 1) set(HAVE_UNISTD_H 0) set(HAVE_UTIME_H 0) set(HAVE_X509_H 0) set(HAVE_ZLIB_H 0) set(HAVE_SIZEOF_LONG_DOUBLE 1) set(SIZEOF_LONG_DOUBLE 8) set(HAVE_SOCKET 1) set(HAVE_POLL 0) set(HAVE_SELECT 1) set(HAVE_STRDUP 1) set(HAVE_STRSTR 1) set(HAVE_STRTOK_R 0) set(HAVE_STRFTIME 1) set(HAVE_UNAME 0) set(HAVE_STRCASECMP 0) set(HAVE_STRICMP 1) set(HAVE_STRCMPI 1) set(HAVE_GETHOSTBYADDR 1) set(HAVE_GETTIMEOFDAY 0) set(HAVE_INET_ADDR 1) set(HAVE_INET_NTOA 1) set(HAVE_INET_NTOA_R 0) set(HAVE_TCGETATTR 0) set(HAVE_TCSETATTR 0) set(HAVE_PERROR 1) set(HAVE_CLOSESOCKET 1) set(HAVE_SETVBUF 0) set(HAVE_SIGSETJMP 0) set(HAVE_GETPASS_R 0) set(HAVE_STRLCAT 0) set(HAVE_GETPWUID 0) set(HAVE_GETEUID 0) set(HAVE_UTIME 1) set(HAVE_RAND_EGD 0) set(HAVE_RAND_SCREEN 0) set(HAVE_RAND_STATUS 0) set(HAVE_GMTIME_R 0) set(HAVE_LOCALTIME_R 0) set(HAVE_GETHOSTBYADDR_R 0) set(HAVE_GETHOSTBYNAME_R 0) set(HAVE_SIGNAL_FUNC 1) set(HAVE_SIGNAL_MACRO 0) set(HAVE_GETHOSTBYADDR_R_5 0) set(HAVE_GETHOSTBYADDR_R_5_REENTRANT 0) set(HAVE_GETHOSTBYADDR_R_7 0) set(HAVE_GETHOSTBYADDR_R_7_REENTRANT 0) set(HAVE_GETHOSTBYADDR_R_8 0) set(HAVE_GETHOSTBYADDR_R_8_REENTRANT 0) set(HAVE_GETHOSTBYNAME_R_3 0) set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0) set(HAVE_GETHOSTBYNAME_R_5 0) set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0) set(HAVE_GETHOSTBYNAME_R_6 0) set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0) set(TIME_WITH_SYS_TIME 0) set(HAVE_O_NONBLOCK 0) set(HAVE_IN_ADDR_T 0) set(HAVE_INET_NTOA_R_DECL 0) set(HAVE_INET_NTOA_R_DECL_REENTRANT 0) if(ENABLE_IPV6) set(HAVE_GETADDRINFO 1) else() set(HAVE_GETADDRINFO 0) endif() set(STDC_HEADERS 1) set(RETSIGTYPE_TEST 1) set(HAVE_SIGACTION 0) set(HAVE_MACRO_SIGSETJMP 0) else(WIN32) message("This file should be included on Windows platform only") endif(WIN32) endif(NOT UNIX) curl-7.35.0/CMake/OtherTests.cmake0000644000175000017500000002647112213173003013564 00000000000000include(CurlCheckCSourceCompiles) set(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2") set(HEADER_INCLUDES) set(headers_hack) macro(add_header_include check header) if(${check}) set(headers_hack "${headers_hack}\n#include <${header}>") #SET(HEADER_INCLUDES # ${HEADER_INCLUDES} # "${header}") endif(${check}) endmacro(add_header_include) set(signature_call_conv) if(HAVE_WINDOWS_H) add_header_include(HAVE_WINDOWS_H "windows.h") add_header_include(HAVE_WINSOCK2_H "winsock2.h") add_header_include(HAVE_WINSOCK_H "winsock.h") set(EXTRA_DEFINES ${EXTRA_DEFINES} "__unused7\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#define __unused3") set(signature_call_conv "PASCAL") else(HAVE_WINDOWS_H) add_header_include(HAVE_SYS_TYPES_H "sys/types.h") add_header_include(HAVE_SYS_SOCKET_H "sys/socket.h") endif(HAVE_WINDOWS_H) set(EXTRA_DEFINES_BACKUP "${EXTRA_DEFINES}") set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5") curl_check_c_source_compiles("recv(0, 0, 0, 0)" curl_cv_recv) if(curl_cv_recv) # AC_CACHE_CHECK([types of arguments and return type for recv], #[curl_cv_func_recv_args], [ #SET(curl_cv_func_recv_args "unknown") #for recv_retv in 'int' 'ssize_t'; do if(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown") foreach(recv_retv "int" "ssize_t" ) foreach(recv_arg1 "int" "ssize_t" "SOCKET") foreach(recv_arg2 "void *" "char *") foreach(recv_arg3 "size_t" "int" "socklen_t" "unsigned int") foreach(recv_arg4 "int" "unsigned int") if(NOT curl_cv_func_recv_done) set(curl_cv_func_recv_test "UNKNOWN") set(extern_line "extern ${recv_retv} ${signature_call_conv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})\;") set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5") curl_check_c_source_compiles(" ${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_test "${recv_retv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})") if(curl_cv_func_recv_test) set(curl_cv_func_recv_args "${recv_arg1},${recv_arg2},${recv_arg3},${recv_arg4},${recv_retv}") set(RECV_TYPE_ARG1 "${recv_arg1}") set(RECV_TYPE_ARG2 "${recv_arg2}") set(RECV_TYPE_ARG3 "${recv_arg3}") set(RECV_TYPE_ARG4 "${recv_arg4}") set(RECV_TYPE_RETV "${recv_retv}") set(HAVE_RECV 1) set(curl_cv_func_recv_done 1) endif(curl_cv_func_recv_test) endif(NOT curl_cv_func_recv_done) endforeach(recv_arg4) endforeach(recv_arg3) endforeach(recv_arg2) endforeach(recv_arg1) endforeach(recv_retv) else(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown") string(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG1 "${curl_cv_func_recv_args}") string(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG2 "${curl_cv_func_recv_args}") string(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG3 "${curl_cv_func_recv_args}") string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" RECV_TYPE_ARG4 "${curl_cv_func_recv_args}") string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" RECV_TYPE_RETV "${curl_cv_func_recv_args}") #MESSAGE("RECV_TYPE_ARG1 ${RECV_TYPE_ARG1}") #MESSAGE("RECV_TYPE_ARG2 ${RECV_TYPE_ARG2}") #MESSAGE("RECV_TYPE_ARG3 ${RECV_TYPE_ARG3}") #MESSAGE("RECV_TYPE_ARG4 ${RECV_TYPE_ARG4}") #MESSAGE("RECV_TYPE_RETV ${RECV_TYPE_RETV}") endif(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown") if("${curl_cv_func_recv_args}" STREQUAL "unknown") message(FATAL_ERROR "Cannot find proper types to use for recv args") endif("${curl_cv_func_recv_args}" STREQUAL "unknown") else(curl_cv_recv) message(FATAL_ERROR "Unable to link function recv") endif(curl_cv_recv) set(curl_cv_func_recv_args "${curl_cv_func_recv_args}" CACHE INTERNAL "Arguments for recv") set(HAVE_RECV 1) curl_check_c_source_compiles("send(0, 0, 0, 0)" curl_cv_send) if(curl_cv_send) # AC_CACHE_CHECK([types of arguments and return type for send], #[curl_cv_func_send_args], [ #SET(curl_cv_func_send_args "unknown") #for send_retv in 'int' 'ssize_t'; do if(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown") foreach(send_retv "int" "ssize_t" ) foreach(send_arg1 "int" "ssize_t" "SOCKET") foreach(send_arg2 "const void *" "void *" "char *" "const char *") foreach(send_arg3 "size_t" "int" "socklen_t" "unsigned int") foreach(send_arg4 "int" "unsigned int") if(NOT curl_cv_func_send_done) set(curl_cv_func_send_test "UNKNOWN") set(extern_line "extern ${send_retv} ${signature_call_conv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})\;") set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5") curl_check_c_source_compiles(" ${send_arg1} s=0; ${send_arg2} buf=0; ${send_arg3} len=0; ${send_arg4} flags=0; ${send_retv} res = send(s, buf, len, flags)" curl_cv_func_send_test "${send_retv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})") if(curl_cv_func_send_test) #MESSAGE("Found arguments: ${curl_cv_func_send_test}") string(REGEX REPLACE "(const) .*" "\\1" send_qual_arg2 "${send_arg2}") string(REGEX REPLACE "const (.*)" "\\1" send_arg2 "${send_arg2}") set(curl_cv_func_send_args "${send_arg1},${send_arg2},${send_arg3},${send_arg4},${send_retv},${send_qual_arg2}") set(SEND_TYPE_ARG1 "${send_arg1}") set(SEND_TYPE_ARG2 "${send_arg2}") set(SEND_TYPE_ARG3 "${send_arg3}") set(SEND_TYPE_ARG4 "${send_arg4}") set(SEND_TYPE_RETV "${send_retv}") set(HAVE_SEND 1) set(curl_cv_func_send_done 1) endif(curl_cv_func_send_test) endif(NOT curl_cv_func_send_done) endforeach(send_arg4) endforeach(send_arg3) endforeach(send_arg2) endforeach(send_arg1) endforeach(send_retv) else(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown") string(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG1 "${curl_cv_func_send_args}") string(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG2 "${curl_cv_func_send_args}") string(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG3 "${curl_cv_func_send_args}") string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG4 "${curl_cv_func_send_args}") string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" SEND_TYPE_RETV "${curl_cv_func_send_args}") string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" SEND_QUAL_ARG2 "${curl_cv_func_send_args}") #MESSAGE("SEND_TYPE_ARG1 ${SEND_TYPE_ARG1}") #MESSAGE("SEND_TYPE_ARG2 ${SEND_TYPE_ARG2}") #MESSAGE("SEND_TYPE_ARG3 ${SEND_TYPE_ARG3}") #MESSAGE("SEND_TYPE_ARG4 ${SEND_TYPE_ARG4}") #MESSAGE("SEND_TYPE_RETV ${SEND_TYPE_RETV}") #MESSAGE("SEND_QUAL_ARG2 ${SEND_QUAL_ARG2}") endif(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown") if("${curl_cv_func_send_args}" STREQUAL "unknown") message(FATAL_ERROR "Cannot find proper types to use for send args") endif("${curl_cv_func_send_args}" STREQUAL "unknown") set(SEND_QUAL_ARG2 "const") else(curl_cv_send) message(FATAL_ERROR "Unable to link function send") endif(curl_cv_send) set(curl_cv_func_send_args "${curl_cv_func_send_args}" CACHE INTERNAL "Arguments for send") set(HAVE_SEND 1) set(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5") curl_check_c_source_compiles("int flag = MSG_NOSIGNAL" HAVE_MSG_NOSIGNAL) set(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2") set(HEADER_INCLUDES) set(headers_hack) macro(add_header_include check header) if(${check}) set(headers_hack "${headers_hack}\n#include <${header}>") #SET(HEADER_INCLUDES # ${HEADER_INCLUDES} # "${header}") endif(${check}) endmacro(add_header_include header) if(HAVE_WINDOWS_H) set(EXTRA_DEFINES ${EXTRA_DEFINES} "__unused7\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#define __unused3") add_header_include(HAVE_WINDOWS_H "windows.h") add_header_include(HAVE_WINSOCK2_H "winsock2.h") add_header_include(HAVE_WINSOCK_H "winsock.h") else(HAVE_WINDOWS_H) add_header_include(HAVE_SYS_TYPES_H "sys/types.h") add_header_include(HAVE_SYS_TIME_H "sys/time.h") add_header_include(TIME_WITH_SYS_TIME "time.h") add_header_include(HAVE_TIME_H "time.h") endif(HAVE_WINDOWS_H) set(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5") curl_check_c_source_compiles("struct timeval ts;\nts.tv_sec = 0;\nts.tv_usec = 0" HAVE_STRUCT_TIMEVAL) include(CurlCheckCSourceRuns) set(EXTRA_DEFINES) set(HEADER_INCLUDES) if(HAVE_SYS_POLL_H) set(HEADER_INCLUDES "sys/poll.h") endif(HAVE_SYS_POLL_H) curl_check_c_source_runs("return poll((void *)0, 0, 10 /*ms*/)" HAVE_POLL_FINE) set(HAVE_SIG_ATOMIC_T 1) set(EXTRA_DEFINES) set(HEADER_INCLUDES) if(HAVE_SIGNAL_H) set(HEADER_INCLUDES "signal.h") set(CMAKE_EXTRA_INCLUDE_FILES "signal.h") endif(HAVE_SIGNAL_H) check_type_size("sig_atomic_t" SIZEOF_SIG_ATOMIC_T) if(HAVE_SIZEOF_SIG_ATOMIC_T) curl_check_c_source_compiles("static volatile sig_atomic_t dummy = 0" HAVE_SIG_ATOMIC_T_NOT_VOLATILE) if(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE) set(HAVE_SIG_ATOMIC_T_VOLATILE 1) endif(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE) endif(HAVE_SIZEOF_SIG_ATOMIC_T) set(CHECK_TYPE_SIZE_PREINCLUDE "#undef inline") if(HAVE_WINDOWS_H) set(CHECK_TYPE_SIZE_PREINCLUDE "${CHECK_TYPE_SIZE_PREINCLUDE} #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include ") if(HAVE_WINSOCK2_H) set(CHECK_TYPE_SIZE_PREINCLUDE "${CHECK_TYPE_SIZE_PREINCLUDE}\n#include ") endif(HAVE_WINSOCK2_H) else(HAVE_WINDOWS_H) if(HAVE_SYS_SOCKET_H) set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} "sys/socket.h") endif(HAVE_SYS_SOCKET_H) if(HAVE_NETINET_IN_H) set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} "netinet/in.h") endif(HAVE_NETINET_IN_H) if(HAVE_ARPA_INET_H) set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} "arpa/inet.h") endif(HAVE_ARPA_INET_H) endif(HAVE_WINDOWS_H) check_type_size("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE) if(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE) set(HAVE_STRUCT_SOCKADDR_STORAGE 1) endif(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE) curl-7.35.0/CMake/CMakeConfigurableFile.in0000644000175000017500000000004312213173003015072 00000000000000@CMAKE_CONFIGURABLE_FILE_CONTENT@ curl-7.35.0/Makefile.am0000644000175000017500000002143512213173003011525 00000000000000#*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # ########################################################################### AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 CMAKE_DIST = CMakeLists.txt CMake/CMakeConfigurableFile.in \ CMake/CurlCheckCSourceCompiles.cmake CMake/CurlCheckCSourceRuns.cmake \ CMake/CurlTests.c CMake/FindOpenSSL.cmake CMake/FindZLIB.cmake \ CMake/OtherTests.cmake CMake/Platforms/WindowsCache.cmake \ CMake/Utilities.cmake include/curl/curlbuild.h.cmake VC6LIBDSP = vs/vc6/lib/vc6libcurl.dsp VC6LIBDSPHEAD = vs/t/lib/vc6_libcurl_dsp.head VC6LIBDSPFOOT = vs/t/lib/vc6_libcurl_dsp.foot VC8LIBPRJ = vs/vc8/lib/vc8libcurl.vcproj VC8LIBPRJHEAD = vs/t/lib/vc8_libcurl_prj.head VC8LIBPRJFOOT = vs/t/lib/vc8_libcurl_prj.foot VC_DIST = \ vs/t/README \ $(VC6LIBDSP) $(VC6LIBDSPHEAD) $(VC6LIBDSPFOOT) \ $(VC8LIBPRJ) $(VC8LIBPRJHEAD) $(VC8LIBPRJFOOT) \ vs/vc6/vc6curl.dsw \ vs/vc6/lib/vc6libcurl.dsw \ vs/vc6/src/vc6curltool.dsw \ vs/vc6/src/vc6curltool.dsp VC6LIBDSP_DEPS = $(VC6LIBDSPHEAD) $(VC6LIBDSPFOOT) \ Makefile.am lib/Makefile.inc VC8LIBPRJ_DEPS = $(VC8LIBPRJHEAD) $(VC8LIBPRJFOOT) \ Makefile.am lib/Makefile.inc WINBUILD_DIST = winbuild/BUILD.WINDOWS.txt winbuild/gen_resp_file.bat \ winbuild/MakefileBuild.vc winbuild/Makefile.vc \ winbuild/Makefile.msvc.names EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \ RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework \ $(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) lib/libcurl.vers.in CLEANFILES = $(VC6LIBDSP) $(VC8LIBPRJ) bin_SCRIPTS = curl-config SUBDIRS = lib src include DIST_SUBDIRS = $(SUBDIRS) tests packages docs pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libcurl.pc # List of libcurl source files required to generate VC IDE dsp and prj files include lib/Makefile.inc WIN32SOURCES = $(CSOURCES) WIN32HEADERS = $(HHEADERS) config-win32.h dist-hook: rm -rf $(top_builddir)/tests/log find $(distdir) -name "*.dist" -exec rm {} \; (distit=`find $(srcdir) -name "*.dist" | grep -v ./ares/`; \ for file in $$distit; do \ strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \ cp $$file $(distdir)$$strip; \ done) html: cd docs; make html pdf: cd docs; make pdf check: test examples if CROSSCOMPILING test-full: test test-torture: test test: @echo "NOTICE: we can't run the tests when cross-compiling!" else test: @(cd tests; $(MAKE) all quiet-test) test-full: @(cd tests; $(MAKE) all full-test) test-torture: @(cd tests; $(MAKE) all torture-test) test-am: @(cd tests; $(MAKE) all am-test) endif examples: @(cd docs/examples; $(MAKE) check) # This is a hook to have 'make clean' also clean up the docs and the tests # dir. The extra check for the Makefiles being present is necessary because # 'make distcheck' will make clean first in these directories _before_ it runs # this hook. clean-local: @(if test -f tests/Makefile; then cd tests; $(MAKE) clean; fi) @(if test -f docs/Makefile; then cd docs; $(MAKE) clean; fi) # # Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros # must contain the following line: # %_topdir /home/loic/local/rpm # and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc. # # cd /home/loic/local/rpm ; mkdir -p SOURCES BUILD RPMS/i386 SPECS SRPMS # # If additional configure flags are needed to build the package, add the # following in ~/.rpmmacros # %configure CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} ${AM_CONFIGFLAGS} # and run make rpm in the following way: # AM_CONFIGFLAGS='--with-uri=/home/users/loic/local/RedHat-6.2' make rpm # rpms: $(MAKE) RPMDIST=curl rpm $(MAKE) RPMDIST=curl-ssl rpm rpm: RPM_TOPDIR=`rpm --showrc | $(PERL) -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \ cp $(srcdir)/packages/Linux/RPM/$(RPMDIST).spec $$RPM_TOPDIR/SPECS ; \ cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \ rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(RPMDIST).spec ; \ mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \ mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm . # # Build a Solaris pkgadd format file # run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format # file (which ends up back in this directory). # The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do # pkgadd -d ./HAXXcurl-* # # gak - libtool requires an absoulte directory, hence the pwd below... pkgadd: umask 022 ; \ make install DESTDIR=`/bin/pwd`/packages/Solaris/root ; \ cat COPYING > $(srcdir)/packages/Solaris/copyright ; \ cd $(srcdir)/packages/Solaris && $(MAKE) package # # Build a cygwin binary tarball installation file # resulting .tar.bz2 file will end up at packages/Win32/cygwin cygwinbin: $(MAKE) -C packages/Win32/cygwin cygwinbin # We extend the standard install with a custom hook: install-data-hook: cd include && $(MAKE) install cd docs && $(MAKE) install # We extend the standard uninstall with a custom hook: uninstall-hook: cd include && $(MAKE) uninstall cd docs && $(MAKE) uninstall ca-bundle: lib/mk-ca-bundle.pl @echo "generate a fresh ca-bundle.crt" @perl $< -b -l -u lib/ca-bundle.crt ca-firefox: lib/firefox-db2pem.sh @echo "generate a fresh ca-bundle.crt" ./lib/firefox-db2pem.sh lib/ca-bundle.crt checksrc: cd lib && $(MAKE) checksrc cd src && $(MAKE) checksrc .PHONY: vc6-ide vc6-ide: $(MAKE) $(VC6LIBDSP) $(VC6LIBDSP): $(VC6LIBDSP_DEPS) @(echo "generating '$(VC6LIBDSP)'"; \ \ for dir in 'vs' 'vs/vc6' 'vs/vc6/lib'; do \ test -d "$$dir" || mkdir "$$dir" || exit 1; \ done; \ \ dir='..\..\..\lib\'; \ body='$(VC6LIBDSP)'.body; \ win32_srcs='$(WIN32SOURCES)'; \ win32_hdrs='$(WIN32HEADERS)'; \ sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \ sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \ \ echo "# Begin Group \"Source Files\"" > $$body; \ echo "" >> $$body; \ echo "# PROP Default_Filter \"\"" >> $$body; \ for file in $$sorted_srcs; do \ echo "# Begin Source File" >> $$body; \ echo "" >> $$body; \ echo "SOURCE="$$dir$$file >> $$body; \ echo "# End Source File" >> $$body; \ done; \ echo "# End Group" >> $$body; \ echo "# Begin Group \"Header Files\"" >> $$body; \ echo "" >> $$body; \ echo "# PROP Default_Filter \"\"" >> $$body; \ for file in $$sorted_hdrs; do \ echo "# Begin Source File" >> $$body; \ echo "" >> $$body; \ echo "SOURCE="$$dir$$file >> $$body; \ echo "# End Source File" >> $$body; \ done; \ echo "# End Group" >> $$body; \ \ awk '{ printf("%s\r\n", $$0); }' \ $(srcdir)/$(VC6LIBDSPHEAD) $$body $(srcdir)/$(VC6LIBDSPFOOT) \ > $(VC6LIBDSP) || { rm -f $$body; exit 1; }; \ \ rm -f $$body) .PHONY: vc8-ide vc8-ide: $(MAKE) $(VC8LIBPRJ) $(VC8LIBPRJ): $(VC8LIBPRJ_DEPS) @(echo "generating '$(VC8LIBPRJ)'"; \ \ for dir in 'vs' 'vs/vc8' 'vs/vc8/lib'; do \ test -d "$$dir" || mkdir "$$dir" || exit 1; \ done; \ \ dir='..\..\..\lib\'; \ body='$(VC8LIBPRJ)'.body; \ win32_srcs='$(WIN32SOURCES)'; \ win32_hdrs='$(WIN32HEADERS)'; \ sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \ sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \ \ echo "%tab%%tab%" > $$body; \ for file in $$sorted_srcs; do \ echo "%tab%%tab%%tab%" >> $$body; \ done; \ echo "%tab%%tab%" >> $$body; \ echo "%tab%%tab%" >> $$body; \ for file in $$sorted_hdrs; do \ echo "%tab%%tab%%tab%" >> $$body; \ done; \ echo "%tab%%tab%" >> $$body; \ \ awk '{ gsub(/%tab%/, "\t"); printf("%s\r\n", $$0); }' \ $(srcdir)/$(VC8LIBPRJHEAD) $$body $(srcdir)/$(VC8LIBPRJFOOT) \ > $(VC8LIBPRJ) || { rm -f $$body; exit 1; }; \ \ rm -f $$body) curl-7.35.0/Makefile.in0000644000175000017500000012760112272124466011556 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # ########################################################################### #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # # Copyright (C) 1998 - 2013, 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. # ########################################################################### VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/lib/Makefile.inc $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) mkinstalldirs $(srcdir)/curl-config.in \ $(srcdir)/libcurl.pc.in COPYING README compile config.guess \ config.sub depcomp install-sh missing ltmain.sh subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \ $(top_srcdir)/m4/curl-confopts.m4 \ $(top_srcdir)/m4/curl-functions.m4 \ $(top_srcdir)/m4/curl-openssl.m4 \ $(top_srcdir)/m4/curl-override.m4 \ $(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/xc-am-iface.m4 \ $(top_srcdir)/m4/xc-cc-check.m4 \ $(top_srcdir)/m4/xc-lt-iface.m4 \ $(top_srcdir)/m4/xc-translit.m4 \ $(top_srcdir)/m4/xc-val-flgs.m4 \ $(top_srcdir)/m4/zz40-xc-ovr.m4 \ $(top_srcdir)/m4/zz50-xc-ovr.m4 \ $(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \ $(top_builddir)/include/curl/curlbuild.h CONFIG_CLEAN_FILES = curl-config libcurl.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)" SCRIPTS = $(bin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@ CURLVERSION = @CURLVERSION@ CURL_CA_BUNDLE = @CURL_CA_BUNDLE@ CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@ CURL_DISABLE_DICT = @CURL_DISABLE_DICT@ CURL_DISABLE_FILE = @CURL_DISABLE_FILE@ CURL_DISABLE_FTP = @CURL_DISABLE_FTP@ CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@ CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@ CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@ CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@ CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@ CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@ CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@ CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@ CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@ CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@ CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@ CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@ CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@ CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_SHARED = @ENABLE_SHARED@ ENABLE_STATIC = @ENABLE_STATIC@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@ HAVE_LDAP_SSL = @HAVE_LDAP_SSL@ HAVE_LIBZ = @HAVE_LIBZ@ HAVE_SSLEAY_SRP = @HAVE_SSLEAY_SRP@ IDN_ENABLED = @IDN_ENABLED@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IPV6_ENABLED = @IPV6_ENABLED@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@ LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@ LIBMETALINK_LIBS = @LIBMETALINK_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANOPT = @MANOPT@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ NROFF = @NROFF@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKGADD_NAME = @PKGADD_NAME@ PKGADD_PKG = @PKGADD_PKG@ PKGADD_VENDOR = @PKGADD_VENDOR@ PKGCONFIG = @PKGCONFIG@ RANDOM_FILE = @RANDOM_FILE@ RANLIB = @RANLIB@ REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_ENABLED = @SSL_ENABLED@ STRIP = @STRIP@ SUPPORT_FEATURES = @SUPPORT_FEATURES@ SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@ USE_ARES = @USE_ARES@ USE_AXTLS = @USE_AXTLS@ USE_CYASSL = @USE_CYASSL@ USE_DARWINSSL = @USE_DARWINSSL@ USE_GNUTLS = @USE_GNUTLS@ USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@ USE_LIBRTMP = @USE_LIBRTMP@ USE_LIBSSH2 = @USE_LIBSSH2@ USE_NGHTTP2 = @USE_NGHTTP2@ USE_NSS = @USE_NSS@ USE_OPENLDAP = @USE_OPENLDAP@ USE_POLARSSL = @USE_POLARSSL@ USE_SCHANNEL = @USE_SCHANNEL@ USE_SSLEAY = @USE_SSLEAY@ USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@ VERSION = @VERSION@ VERSIONNUM = @VERSIONNUM@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libext = @libext@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 CMAKE_DIST = CMakeLists.txt CMake/CMakeConfigurableFile.in \ CMake/CurlCheckCSourceCompiles.cmake CMake/CurlCheckCSourceRuns.cmake \ CMake/CurlTests.c CMake/FindOpenSSL.cmake CMake/FindZLIB.cmake \ CMake/OtherTests.cmake CMake/Platforms/WindowsCache.cmake \ CMake/Utilities.cmake include/curl/curlbuild.h.cmake VC6LIBDSP = vs/vc6/lib/vc6libcurl.dsp VC6LIBDSPHEAD = vs/t/lib/vc6_libcurl_dsp.head VC6LIBDSPFOOT = vs/t/lib/vc6_libcurl_dsp.foot VC8LIBPRJ = vs/vc8/lib/vc8libcurl.vcproj VC8LIBPRJHEAD = vs/t/lib/vc8_libcurl_prj.head VC8LIBPRJFOOT = vs/t/lib/vc8_libcurl_prj.foot VC_DIST = \ vs/t/README \ $(VC6LIBDSP) $(VC6LIBDSPHEAD) $(VC6LIBDSPFOOT) \ $(VC8LIBPRJ) $(VC8LIBPRJHEAD) $(VC8LIBPRJFOOT) \ vs/vc6/vc6curl.dsw \ vs/vc6/lib/vc6libcurl.dsw \ vs/vc6/src/vc6curltool.dsw \ vs/vc6/src/vc6curltool.dsp VC6LIBDSP_DEPS = $(VC6LIBDSPHEAD) $(VC6LIBDSPFOOT) \ Makefile.am lib/Makefile.inc VC8LIBPRJ_DEPS = $(VC8LIBPRJHEAD) $(VC8LIBPRJFOOT) \ Makefile.am lib/Makefile.inc WINBUILD_DIST = winbuild/BUILD.WINDOWS.txt winbuild/gen_resp_file.bat \ winbuild/MakefileBuild.vc winbuild/Makefile.vc \ winbuild/Makefile.msvc.names EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \ RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework \ $(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) lib/libcurl.vers.in CLEANFILES = $(VC6LIBDSP) $(VC8LIBPRJ) bin_SCRIPTS = curl-config SUBDIRS = lib src include DIST_SUBDIRS = $(SUBDIRS) tests packages docs pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libcurl.pc VSOURCES = vtls/openssl.c vtls/gtls.c vtls/vtls.c vtls/nss.c vtls/qssl.c \ vtls/polarssl.c vtls/polarssl_threadlock.c vtls/axtls.c vtls/cyassl.c \ vtls/curl_schannel.c vtls/curl_darwinssl.c vtls/gskit.c VHEADERS = vtls/qssl.h vtls/openssl.h vtls/vtls.h vtls/gtls.h \ vtls/nssg.h vtls/polarssl.h vtls/polarssl_threadlock.h vtls/axtls.h \ vtls/cyassl.h vtls/curl_schannel.h vtls/curl_darwinssl.h vtls/gskit.h 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 version.c getenv.c escape.c mprintf.c telnet.c netrc.c \ getinfo.c transfer.c strequal.c easy.c security.c curl_fnmatch.c \ fileinfo.c ftplistparser.c wildcard.c krb5.c memdebug.c http_chunks.c \ strtok.c connect.c llist.c hash.c multi.c content_encoding.c share.c \ http_digest.c md4.c md5.c http_negotiate.c inet_pton.c strtoofft.c \ strerror.c amigaos.c hostasyn.c hostip4.c hostip6.c hostsyn.c \ inet_ntop.c parsedate.c select.c tftp.c splay.c strdup.c socks.c \ ssh.c rawstr.c curl_addrinfo.c socks_gssapi.c socks_sspi.c \ curl_sspi.c slist.c nonblock.c curl_memrchr.c imap.c pop3.c smtp.c \ pingpong.c rtsp.c curl_threads.c warnless.c hmac.c curl_rtmp.c \ openldap.c curl_gethostname.c gopher.c idn_win32.c \ http_negotiate_sspi.c http_proxy.c non-ascii.c asyn-ares.c \ asyn-thread.c curl_gssapi.c curl_ntlm.c curl_ntlm_wb.c \ curl_ntlm_core.c curl_ntlm_msgs.c curl_sasl.c curl_multibyte.c \ hostcheck.c bundles.c conncache.c pipeline.c dotdot.c x509asn1.c \ http2.c $(VSOURCES) HHEADERS = arpa_telnet.h netrc.h file.h timeval.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 curl_ldap.h escape.h telnet.h getinfo.h \ strequal.h curl_sec.h memdebug.h http_chunks.h curl_fnmatch.h \ wildcard.h fileinfo.h ftplistparser.h strtok.h connect.h llist.h \ hash.h content_encoding.h share.h curl_md4.h curl_md5.h http_digest.h \ http_negotiate.h inet_pton.h amigaos.h strtoofft.h strerror.h \ inet_ntop.h curlx.h curl_memory.h curl_setup.h transfer.h select.h \ easyif.h multiif.h parsedate.h tftp.h sockaddr.h splay.h strdup.h \ socks.h ssh.h curl_base64.h rawstr.h curl_addrinfo.h curl_sspi.h \ slist.h nonblock.h curl_memrchr.h imap.h pop3.h smtp.h pingpong.h \ rtsp.h curl_threads.h warnless.h curl_hmac.h curl_rtmp.h \ curl_gethostname.h gopher.h http_proxy.h non-ascii.h asyn.h \ curl_ntlm.h curl_gssapi.h curl_ntlm_wb.h curl_ntlm_core.h \ curl_ntlm_msgs.h curl_sasl.h curl_multibyte.h hostcheck.h bundles.h \ conncache.h curl_setup_once.h multihandle.h setup-vms.h pipeline.h \ dotdot.h x509asn1.h http2.h sigpipe.h $(VHEADERS) # List of libcurl source files required to generate VC IDE dsp and prj files WIN32SOURCES = $(CSOURCES) WIN32HEADERS = $(HHEADERS) config-win32.h all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/lib/Makefile.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(srcdir)/lib/Makefile.inc: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): curl-config: $(top_builddir)/config.status $(srcdir)/curl-config.in cd $(top_builddir) && $(SHELL) ./config.status $@ libcurl.pc: $(top_builddir)/config.status $(srcdir)/libcurl.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-pkgconfigDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: $(am__recursive_targets) install-am install-data-am \ install-strip uninstall-am .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool clean-local cscope cscopelist-am ctags ctags-am \ dist dist-all dist-bzip2 dist-gzip dist-hook dist-lzip \ dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \ distclean-generic distclean-libtool distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-binSCRIPTS \ install-data install-data-am install-data-hook install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkgconfigDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binSCRIPTS uninstall-hook \ uninstall-pkgconfigDATA dist-hook: rm -rf $(top_builddir)/tests/log find $(distdir) -name "*.dist" -exec rm {} \; (distit=`find $(srcdir) -name "*.dist" | grep -v ./ares/`; \ for file in $$distit; do \ strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \ cp $$file $(distdir)$$strip; \ done) html: cd docs; make html pdf: cd docs; make pdf check: test examples @CROSSCOMPILING_TRUE@test-full: test @CROSSCOMPILING_TRUE@test-torture: test @CROSSCOMPILING_TRUE@test: @CROSSCOMPILING_TRUE@ @echo "NOTICE: we can't run the tests when cross-compiling!" @CROSSCOMPILING_FALSE@test: @CROSSCOMPILING_FALSE@ @(cd tests; $(MAKE) all quiet-test) @CROSSCOMPILING_FALSE@test-full: @CROSSCOMPILING_FALSE@ @(cd tests; $(MAKE) all full-test) @CROSSCOMPILING_FALSE@test-torture: @CROSSCOMPILING_FALSE@ @(cd tests; $(MAKE) all torture-test) @CROSSCOMPILING_FALSE@test-am: @CROSSCOMPILING_FALSE@ @(cd tests; $(MAKE) all am-test) examples: @(cd docs/examples; $(MAKE) check) # This is a hook to have 'make clean' also clean up the docs and the tests # dir. The extra check for the Makefiles being present is necessary because # 'make distcheck' will make clean first in these directories _before_ it runs # this hook. clean-local: @(if test -f tests/Makefile; then cd tests; $(MAKE) clean; fi) @(if test -f docs/Makefile; then cd docs; $(MAKE) clean; fi) # # Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros # must contain the following line: # %_topdir /home/loic/local/rpm # and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc. # # cd /home/loic/local/rpm ; mkdir -p SOURCES BUILD RPMS/i386 SPECS SRPMS # # If additional configure flags are needed to build the package, add the # following in ~/.rpmmacros # %configure CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} ${AM_CONFIGFLAGS} # and run make rpm in the following way: # AM_CONFIGFLAGS='--with-uri=/home/users/loic/local/RedHat-6.2' make rpm # rpms: $(MAKE) RPMDIST=curl rpm $(MAKE) RPMDIST=curl-ssl rpm rpm: RPM_TOPDIR=`rpm --showrc | $(PERL) -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \ cp $(srcdir)/packages/Linux/RPM/$(RPMDIST).spec $$RPM_TOPDIR/SPECS ; \ cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \ rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(RPMDIST).spec ; \ mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \ mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm . # # Build a Solaris pkgadd format file # run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format # file (which ends up back in this directory). # The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do # pkgadd -d ./HAXXcurl-* # # gak - libtool requires an absoulte directory, hence the pwd below... pkgadd: umask 022 ; \ make install DESTDIR=`/bin/pwd`/packages/Solaris/root ; \ cat COPYING > $(srcdir)/packages/Solaris/copyright ; \ cd $(srcdir)/packages/Solaris && $(MAKE) package # # Build a cygwin binary tarball installation file # resulting .tar.bz2 file will end up at packages/Win32/cygwin cygwinbin: $(MAKE) -C packages/Win32/cygwin cygwinbin # We extend the standard install with a custom hook: install-data-hook: cd include && $(MAKE) install cd docs && $(MAKE) install # We extend the standard uninstall with a custom hook: uninstall-hook: cd include && $(MAKE) uninstall cd docs && $(MAKE) uninstall ca-bundle: lib/mk-ca-bundle.pl @echo "generate a fresh ca-bundle.crt" @perl $< -b -l -u lib/ca-bundle.crt ca-firefox: lib/firefox-db2pem.sh @echo "generate a fresh ca-bundle.crt" ./lib/firefox-db2pem.sh lib/ca-bundle.crt checksrc: cd lib && $(MAKE) checksrc cd src && $(MAKE) checksrc .PHONY: vc6-ide vc6-ide: $(MAKE) $(VC6LIBDSP) $(VC6LIBDSP): $(VC6LIBDSP_DEPS) @(echo "generating '$(VC6LIBDSP)'"; \ \ for dir in 'vs' 'vs/vc6' 'vs/vc6/lib'; do \ test -d "$$dir" || mkdir "$$dir" || exit 1; \ done; \ \ dir='..\..\..\lib\'; \ body='$(VC6LIBDSP)'.body; \ win32_srcs='$(WIN32SOURCES)'; \ win32_hdrs='$(WIN32HEADERS)'; \ sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \ sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \ \ echo "# Begin Group \"Source Files\"" > $$body; \ echo "" >> $$body; \ echo "# PROP Default_Filter \"\"" >> $$body; \ for file in $$sorted_srcs; do \ echo "# Begin Source File" >> $$body; \ echo "" >> $$body; \ echo "SOURCE="$$dir$$file >> $$body; \ echo "# End Source File" >> $$body; \ done; \ echo "# End Group" >> $$body; \ echo "# Begin Group \"Header Files\"" >> $$body; \ echo "" >> $$body; \ echo "# PROP Default_Filter \"\"" >> $$body; \ for file in $$sorted_hdrs; do \ echo "# Begin Source File" >> $$body; \ echo "" >> $$body; \ echo "SOURCE="$$dir$$file >> $$body; \ echo "# End Source File" >> $$body; \ done; \ echo "# End Group" >> $$body; \ \ awk '{ printf("%s\r\n", $$0); }' \ $(srcdir)/$(VC6LIBDSPHEAD) $$body $(srcdir)/$(VC6LIBDSPFOOT) \ > $(VC6LIBDSP) || { rm -f $$body; exit 1; }; \ \ rm -f $$body) .PHONY: vc8-ide vc8-ide: $(MAKE) $(VC8LIBPRJ) $(VC8LIBPRJ): $(VC8LIBPRJ_DEPS) @(echo "generating '$(VC8LIBPRJ)'"; \ \ for dir in 'vs' 'vs/vc8' 'vs/vc8/lib'; do \ test -d "$$dir" || mkdir "$$dir" || exit 1; \ done; \ \ dir='..\..\..\lib\'; \ body='$(VC8LIBPRJ)'.body; \ win32_srcs='$(WIN32SOURCES)'; \ win32_hdrs='$(WIN32HEADERS)'; \ sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \ sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \ \ echo "%tab%%tab%" > $$body; \ for file in $$sorted_srcs; do \ echo "%tab%%tab%%tab%" >> $$body; \ done; \ echo "%tab%%tab%" >> $$body; \ echo "%tab%%tab%" >> $$body; \ for file in $$sorted_hdrs; do \ echo "%tab%%tab%%tab%" >> $$body; \ done; \ echo "%tab%%tab%" >> $$body; \ \ awk '{ gsub(/%tab%/, "\t"); printf("%s\r\n", $$0); }' \ $(srcdir)/$(VC8LIBPRJHEAD) $$body $(srcdir)/$(VC8LIBPRJFOOT) \ > $(VC8LIBPRJ) || { rm -f $$body; exit 1; }; \ \ rm -f $$body) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: